Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: sql/character_updates/4636_mail_instert_queue.sql
- ===================================================================
- --- sql/character_updates/4636_mail_instert_queue.sql (revision 0)
- +++ sql/character_updates/4636_mail_instert_queue.sql (working copy)
- @@ -0,0 +1,12 @@
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id2` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack`, ADD COLUMN `item_stack2` INT(30) DEFAULT '0' NOT NULL AFTER `item_id2`;
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id3` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack2`, ADD COLUMN `item_stack3` INT(30) DEFAULT '0' NOT NULL AFTER `item_id3`;
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id4` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack3`, ADD COLUMN `item_stack4` INT(30) DEFAULT '0' NOT NULL AFTER `item_id4`;
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id5` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack4`, ADD COLUMN `item_stack5` INT(30) DEFAULT '0' NOT NULL AFTER `item_id5`;
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id6` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack5`, ADD COLUMN `item_stack6` INT(30) DEFAULT '0' NOT NULL AFTER `item_id6`;
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id7` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack6`, ADD COLUMN `item_stack7` INT(30) DEFAULT '0' NOT NULL AFTER `item_id7`;
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id8` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack7`, ADD COLUMN `item_stack8` INT(30) DEFAULT '0' NOT NULL AFTER `item_id8`;
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id9` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack8`, ADD COLUMN `item_stack9` INT(30) DEFAULT '0' NOT NULL AFTER `item_id9`;
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id10` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack9`, ADD COLUMN `item_stack10` INT(30) DEFAULT '0' NOT NULL AFTER `item_id10`;
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id11` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack10`, ADD COLUMN `item_stack11` INT(30) DEFAULT '0' NOT NULL AFTER `item_id11`;
- +ALTER TABLE `mailbox_insert_queue` ADD COLUMN `item_id12` INT(30) DEFAULT '0' NOT NULL AFTER `item_stack11`, ADD COLUMN `item_stack12` INT(30) DEFAULT '0' NOT NULL AFTER `item_id12`;
- +UPDATE `arcemu_db_version` SET `LastUpdate` = '4636';
- \ No newline at end of file
- Index: src/arcemu-world/MailSystem.cpp
- ===================================================================
- --- src/arcemu-world/MailSystem.cpp (revision 4634)
- +++ src/arcemu-world/MailSystem.cpp (working copy)
- @@ -258,9 +258,8 @@
- recv_data >> msg.subject >> msg.body >> msg.stationery;
- recv_data >> unk2 >> itemcount;
- - if(itemcount > 12 || msg.body.find("%") != string::npos || msg.subject.find("%") != string::npos)
- + if(itemcount > MAIL_MAX_ITEM_SLOT || msg.body.find("%") != string::npos || msg.subject.find("%") != string::npos)
- {
- - //SystemMessage("Sorry, Ascent does not support sending multiple items at this time. (don't want to lose your item do you) Remove some items, and try again.");
- SendMailError(MAIL_ERR_INTERNAL_ERROR);
- return;
- }
- @@ -835,7 +834,7 @@
- }
- void MailSystem::SendAutomatedMessage(uint32 type, uint64 sender, uint64 receiver, string subject, string body,
- - uint32 money, uint32 cod, uint64 item_guid, uint32 stationery, uint32 deliverdelay)
- + uint32 money, uint32 cod, vector<uint64> &item_guids, uint32 stationery, uint32 deliverdelay)
- {
- // This is for sending automated messages, for example from an auction house.
- MailMessage msg;
- @@ -846,8 +845,8 @@
- msg.body = body;
- msg.money = money;
- msg.cod = cod;
- - if(Arcemu::Util::GUID_LOPART(item_guid) != 0)
- - msg.items.push_back(Arcemu::Util::GUID_LOPART(item_guid));
- + for(vector<uint64>::iterator itr = item_guids.begin(); itr != item_guids.end(); ++itr)
- + msg.items.push_back(Arcemu::Util::GUID_LOPART(*itr));
- msg.stationery = stationery;
- msg.delivery_time = (uint32)UNIXTIME + deliverdelay;
- Index: src/arcemu-world/MailSystem.h
- ===================================================================
- --- src/arcemu-world/MailSystem.h (revision 4634)
- +++ src/arcemu-world/MailSystem.h (working copy)
- @@ -74,6 +74,8 @@
- MAIL_STATIONERY_CHR = 65 // 34171, Winter
- };
- +#define MAIL_MAX_ITEM_SLOT 12
- +
- struct MailMessage
- {
- uint32 message_id;
- @@ -134,8 +136,15 @@
- void RemoveMessageIfDeleted(uint32 message_id, Player* plr);
- void SaveMessageToSQL(MailMessage* message);
- void SendAutomatedMessage(uint32 type, uint64 sender, uint64 receiver, string subject, string body, uint32 money,
- - uint32 cod, uint64 item_guid, uint32 stationery, uint32 deliverdelay = 0);
- + uint32 cod, vector<uint64> &item_guids, uint32 stationery, uint32 deliverdelay = 0);
- + //overload to keep backward compatibility (passing just 1 item guid instead of a vector)
- + void SendAutomatedMessage(uint32 type, uint64 sender, uint64 receiver, string subject, string body, uint32 money,
- + uint32 cod, uint64 item_guid, uint32 stationery, uint32 deliverdelay = 0)
- + {
- + SendAutomatedMessage(type, sender, receiver, subject, body, money, cod, vector<uint64>(1, item_guid), stationery, deliverdelay);
- + }
- +
- ARCEMU_INLINE bool MailOption(uint32 flag)
- {
- return (config_flags & flag) ? true : false;
- Index: src/arcemu-world/Master.h
- ===================================================================
- --- src/arcemu-world/Master.h (revision 4634)
- +++ src/arcemu-world/Master.h (working copy)
- @@ -44,7 +44,7 @@
- #endif
- #define REQUIRED_WORLD_DB_VERSION 4630
- -#define REQUIRED_CHAR_DB_VERSION 4633
- +#define REQUIRED_CHAR_DB_VERSION 4636
- #define DEFAULT_LOOP_TIME 0 /* 0 milliseconds - instant */
- #define DEFAULT_LOG_LEVEL 0
- Index: src/arcemu-world/World.cpp
- ===================================================================
- --- src/arcemu-world/World.cpp (revision 4634)
- +++ src/arcemu-world/World.cpp (working copy)
- @@ -1801,7 +1801,6 @@
- {
- QueryResult* result;
- Field* f;
- - Item* pItem;
- uint32 itemid;
- uint32 stackcount;
- @@ -1812,28 +1811,30 @@
- do
- {
- f = result->Fetch();
- - itemid = f[6].GetUInt32();
- - stackcount = f[7].GetUInt32();
- + vector<uint64> itemGuids;
- - if(itemid != 0)
- + for(int itemSlot = 0; itemSlot < MAIL_MAX_ITEM_SLOT; itemSlot++)
- {
- - pItem = objmgr.CreateItem(itemid, NULL);
- + itemid = f[6].GetUInt32();
- + stackcount = f[7].GetUInt32();
- +
- + if(itemid == 0)
- + break;
- +
- + Item* pItem = objmgr.CreateItem(itemid, NULL);
- if(pItem != NULL)
- {
- pItem->SetStackCount(stackcount);
- pItem->SaveToDB(0, 0, true, NULL);
- + itemGuids.push_back(pItem->GetGUID());
- + pItem->DeleteMe();
- }
- }
- - else
- - pItem = NULL;
- Log.Notice("MailboxQueue", "Sending message to %u (item: %u)...", f[1].GetUInt32(), itemid);
- sMailSystem.SendAutomatedMessage(0, f[0].GetUInt64(), f[1].GetUInt64(), f[2].GetString(), f[3].GetString(), f[5].GetUInt32(),
- - 0, pItem ? pItem->GetGUID() : 0, f[4].GetUInt32());
- + 0, itemGuids, f[4].GetUInt32());
- - if(pItem != NULL)
- - pItem->DeleteMe();
- -
- }
- while(result->NextRow());
- delete result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement