Jump to content

xeross155

Members
  • Posts

    702
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by xeross155

  1. 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.

  2. Hey,

    I saw some patches similiar to this one and wrote 2 of my own, made but haven't tested compiling now.

    Revision 9199 (Rewrite)

    GM Mode On

    diff --git a/contrib/extractor/ad.exe b/contrib/extractor/ad.exe
    index 105f381..ed50bc2 100755
    Binary files a/contrib/extractor/ad.exe and b/contrib/extractor/ad.exe differ
    diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
    index 0509240..90d029d 100644
    --- a/src/game/Mail.cpp
    +++ b/src/game/Mail.cpp
    @@ -793,6 +793,8 @@ MailSender::MailSender( Object* sender, MailStationery stationery ) : m_statione
            case TYPEID_PLAYER:
                m_messageType = MAIL_NORMAL;
                m_senderId = sender->GetGUIDLow();
    +            if(static_cast<Player *>(sender)->isGameMaster())
    +                m_stationery = MAIL_STATIONERY_GM;
                break;
            default:
                m_messageType = MAIL_NORMAL;
    

    Revision 8818

    - GM Mode On

    diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
    index 061bfbb..8f6291a 100644
    --- a/src/game/Mail.cpp
    +++ b/src/game/Mail.cpp
    @@ -799,6 +799,11 @@ MailSender::MailSender( Object* sender, MailStationery stationery ) : m_statione
            case TYPEID_PLAYER:
                m_messageType = MAIL_NORMAL;
                m_senderId = sender->GetGUIDLow();
    +            {
    +                Player* plr = sObjectMgr.GetPlayer(m_senderId);
    +                if(plr && plr->isGameMaster())
    +                    m_stationery = MAIL_STATIONERY_GM;
    +            }
                break;
            default:
                m_messageType = MAIL_NORMAL;
    

    - GM Mode On + Item

    diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
    index 061bfbb..7c801bc 100644
    --- a/src/game/Mail.cpp
    +++ b/src/game/Mail.cpp
    @@ -799,6 +799,11 @@ MailSender::MailSender( Object* sender, MailStationery stationery ) : m_statione
            case TYPEID_PLAYER:
                m_messageType = MAIL_NORMAL;
                m_senderId = sender->GetGUIDLow();
    +            {
    +                Player* plr = sObjectMgr.GetPlayer(m_senderId);
    +                if(plr && plr->isGameMaster() && pl->HasItemCount(18154, 1, false))
    +                    m_stationery = MAIL_STATIONERY_GM;
    +            }
                break;
            default:
                m_messageType = MAIL_NORMAL;
    

    Download

    Old

    - One that requires for gm mode to be on

    diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
    index 5dba0b6..26c4ad2 100644
    --- a/src/game/Mail.cpp
    +++ b/src/game/Mail.cpp
    @@ -273,8 +273,11 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
        // If theres is an item, there is a one hour delivery delay if sent to another account's character.
        uint32 deliver_delay = needItemDelay ? sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0;
    
    +    // Set the mail type
    +    MailStationery mailType = (pl->isGameMaster()) ? MAIL_STATIONERY_GM : MAIL_STATIONERY_NORMAL;
    +
        // will delete item or place to receiver mail list
    -    WorldSession::SendMailTo(receive, MAIL_NORMAL, MAIL_STATIONERY_NORMAL, pl->GetGUIDLow(), GUID_LOPART(rc), subject, itemTextId, &mi, money, COD, MAIL_CHECK_MASK_NONE, deliver_delay);
    +    WorldSession::SendMailTo(receive, MAIL_NORMAL, mailType, pl->GetGUIDLow(), GUID_LOPART(rc), subject, itemTextId, &mi, money, COD, MAIL_CHECK_MASK_NONE, deliver_delay);
    
        CharacterDatabase.BeginTransaction();
        pl->SaveInventoryAndGoldToDB();
    

    - One that requires an item and gm mode to be on

    diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
    index 5dba0b6..88b1625 100644
    --- a/src/game/Mail.cpp
    +++ b/src/game/Mail.cpp
    @@ -273,8 +273,11 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
        // If theres is an item, there is a one hour delivery delay if sent to another account's character.
        uint32 deliver_delay = needItemDelay ? sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0;
    
    +    // Set the mail type
    +    MailStationery mailType = (pl->isGameMaster() && pl->HasItemCount(18154, 1, false)) ? MAIL_STATIONERY_GM : MAIL_STATIONERY_NORMAL;
    +
        // will delete item or place to receiver mail list
    -    WorldSession::SendMailTo(receive, MAIL_NORMAL, MAIL_STATIONERY_NORMAL, pl->GetGUIDLow(), GUID_LOPART(rc), subject, itemTextId, &mi, money, COD, MAIL_CHECK_MASK_NONE, deliver_delay);
    +    WorldSession::SendMailTo(receive, MAIL_NORMAL, mailType, pl->GetGUIDLow(), GUID_LOPART(rc), subject, itemTextId, &mi, money, COD, MAIL_CHECK_MASK_NONE, deliver_delay);
    
        CharacterDatabase.BeginTransaction();
        pl->SaveInventoryAndGoldToDB();
    

    Download em here

    Regards, Xeross

  3. 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_UNKNOWN = 0x01,
       MAIL_STATIONERY_NORMAL  = 0x29,
       MAIL_STATIONERY_GM      = 0x3D,
       MAIL_STATIONERY_AUCTION = 0x3E,
       MAIL_STATIONERY_VAL     = 0x40,
       MAIL_STATIONERY_CHR     = 0x41
    };
    

    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;
       else
           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

  4. Hey,

    MaNGOS has just switched to 3.2.2a however I prefer to say at 3.1.3 for a while till I have the time to properly do the upgrade.

    I use a custom branch with my source edits in git and use the following commands to update it to the latest mangos

    git pull
    git merge origin/master
    

    so it just pulls all updates for all branches and then I merge the master branch into my custom branch.

    However how can I merge upto a specific branch (or a tag) so I can keep my server at the last 3.1.3 revision ?

    Thank you for your time, Xeross

×
×
  • 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