• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Fix/Patch Mailbox weight limit.

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,947
Solutions
34
Reaction score
1,584
Location
Sweden
Good evening!

I've seen several servers this year that has been crashed through sending heavy parcels to a players depot. So I thought it would be good to set a weight limit.

Mailbox.cpp

Locate the following code in mailbox.cpp
Code:
bool Mailbox::sendItem(Creature* actor, Item* item)
{
        uint32_t depotId =0;
        std::string name;
        if(!getRecipient(item, name, depotId)|| name.empty()||!depotId)
              return false;

        return IOLoginData::getInstance()->playerMail(actor, name, depotId, item);
}
Replace this line
Code:
if(!getRecipient(item, name, depotId)|| name.empty()||!depotId)
with this and we are done. Remember that the weight is configurable!
Code:
if(!getRecipient(item, name, depotId) || name.empty() || !depotId || item->getWeight()>[COLOR=#ff0000]5000[/COLOR])

Sincerely,
Ninja


 
If the weight exceeds over 5000oz then it won't be possible to send the parcel through the mailbox.
 
It could get a log with certain items [items vip].. to know to whom they are sent?
 
would know how exactly? by lua I did not think anything, sources not handled well.
 
lol :p
 
Last edited:
Back
Top