Jump to content

[WIP] BGMarks mail only 3 days

Guest xeross155

Recommended Posts

Hey Folks,

As I was making some modifications to the mail system for my own test server balrok said on IRC ( asked him something about it) while you're looking at it try to make the BG Marks mails expire after 3 days (Now they expire after 30), so I thought why not, some extra practice.

However I've checked the code now so far I've found the following

MailStationery (Mail.h)

enum MailStationery
   MAIL_STATIONERY_GM      = 0x3D,
   MAIL_STATIONERY_VAL     = 0x40,

The code used to send marks (In Battleground.cpp)

WorldSession::SendMailTo(plr, MAIL_CREATURE, MAIL_STATIONERY_NORMAL, bmEntry, plr->GetGUIDLow(), subject, itemTextId , &mi, 0, 0, MAIL_CHECK_MASK_NONE);

and well the SendMailTo function in Mail.cpp

void WorldSession::SendMailTo(Player* receiver, uint8 messageType, uint8 stationery, uint32 sender_guidlow_or_entry, uint32 receiver_guidlow, std::string subject, uint32 itemTextId, MailItemsInfo* mi, uint32 money, uint32 COD, uint32 checked, uint32 deliver_delay, uint16 mailTemplateId)

Which has

uint32 expire_delay;
   if(messageType == MAIL_AUCTION && !mi && !money)        // auction mail without any items and money
       expire_delay = HOUR;
       expire_delay = (COD > 0) ? 3*DAY : 30*DAY;

So to fix it we would need to add an elseif to the if statement or something similiar. however I don't see any way to determine if an in-game mail is coming from "the BG", well we could check what item is being sent with the mail but I dunno if that's concidered hacky, other then that the stationery is not other then normal mails and so isn't the template.

Like to hear some thoughts, etc. on this.

Regards, Xeross

Link to comment
Share on other sites

The default mail expiry is 30 days so that's why it is like that, and well balrok said it should be 3 days.

So there isn't any other thing that uses MAIL_CREATURE else that would yield unexpected results.

Edit: Achievements, etc. also use it so this would make achievement items dissapear in 1 day, not good.

Link to comment
Share on other sites

ah thx tom_rus i thought bg-marks getting a different mailtype..

with latest revision this should be fixed - i just check for mail from battlemasters - since they actualy don't send anything else than battlegroundmarks i think it's ok..

checking for item-ids doesn't sound so good cause we then need to take care about this code everytime a new bg comes out (which is quite often in last days)

Link to comment
Share on other sites


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use