98 std::string receiverName;
102 char* tail1 = strtok(
NULL,
"");
110 char* tail2 = strtok(
NULL,
"");
119 std::string subject = msgSubject;
120 std::string text = msgText;
123 typedef std::pair<uint32, uint32> ItemPair;
124 typedef std::list< ItemPair > ItemPairs;
128 char* tail = strtok(
NULL,
"");
131 while (
char* itemStr = strtok(tail,
" "))
134 tail = strtok(
NULL,
"");
137 char const* itemIdStr = strtok(itemStr,
":");
138 char const* itemCountStr = strtok(
NULL,
" ");
140 uint32 itemId = atoi(itemIdStr);
152 uint32 itemCount = itemCountStr ? atoi(itemCountStr) : 1;
166 items.push_back(ItemPair(itemId, itemCount));
184 for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr)
188 item->SaveToDB(trans);
196 std::string nameLink = handler->
playerLink(receiverName);
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
Definition: Language.h:86
SQLTransaction BeginTransaction()
Begins an automanaged transaction pointer that will automatically rollback if not commited...
Definition: DatabaseWorkerPool.h:221
#define UI64LIT(N)
Definition: Define.h:138
char * extractQuotedArg(char *args)
Definition: Chat.cpp:1016
arena_t NULL
Definition: jemalloc_internal.h:624
Player * GetPlayer() const
Definition: WorldSession.h:927
bool extractPlayerTarget(char *args, Player **player, ObjectGuid *player_guid=NULL, std::string *player_name=NULL)
Definition: Chat.cpp:945
#define sObjectMgr
Definition: ObjectMgr.h:1567
void CommitTransaction(SQLTransaction transaction)
Definition: DatabaseWorkerPool.cpp:179
uint32_t uint32
Definition: Define.h:150
static Item * CreateItem(uint32 itemEntry, uint32 count, Player const *player=NULL)
Definition: Item.cpp:1068
uint32 GetMaxStackSize() const
Definition: ItemTemplate.h:745
Definition: ItemTemplate.h:647
Definition: Language.h:437
WorldSession * GetSession()
Definition: Chat.h:59
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
uint32 GetMaxCount() const
Definition: ItemTemplate.h:674
Definition: ObjectGuid.h:189
uint32_t uint32
Definition: g3dmath.h:168
Definition: Language.h:201
Definition: Language.h:85
#define MAX_MAIL_ITEMS
Definition: Mail.h:34
std::string playerLink(std::string const &name) const
Definition: Chat.h:132
LowType GetCounter() const
Definition: ObjectGuid.h:221
std::shared_ptr< Transaction > SQLTransaction
Definition: Transaction.h:58