mirror of
https://github.com/mangosfour/server.git
synced 2025-12-31 13:37:07 +00:00
Some new gm ticket stuff.
This commit is contained in:
parent
9e3e741d9b
commit
f34c11be7f
8 changed files with 126 additions and 18 deletions
|
|
@ -34,8 +34,8 @@ void GMTicketMgr::LoadGMTickets()
|
|||
m_GMTicketMap.clear(); // For reload case
|
||||
|
||||
QueryResult *result = CharacterDatabase.Query(
|
||||
// 0 1 2
|
||||
"SELECT guid, ticket_text,UNIX_TIMESTAMP(ticket_lastchange) FROM character_ticket");
|
||||
// 0 1 2 3
|
||||
"SELECT guid, ticket_text, response_text, UNIX_TIMESTAMP(ticket_lastchange) FROM character_ticket");
|
||||
|
||||
if( !result )
|
||||
{
|
||||
|
|
@ -59,7 +59,7 @@ void GMTicketMgr::LoadGMTickets()
|
|||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 guid = fields[0].GetUInt32();
|
||||
m_GMTicketMap[guid] = GMTicket(guid, fields[1].GetCppString(), time_t(fields[2].GetUInt64()));
|
||||
m_GMTicketMap[guid] = GMTicket(guid, fields[1].GetCppString(), fields[2].GetCppString(), time_t(fields[3].GetUInt64()));
|
||||
++count;
|
||||
|
||||
} while (result->NextRow());
|
||||
|
|
@ -73,8 +73,8 @@ void GMTicketMgr::DeleteAll()
|
|||
{
|
||||
for(GMTicketMap::const_iterator itr = m_GMTicketMap.begin(); itr != m_GMTicketMap.end(); ++itr)
|
||||
{
|
||||
if(Player* owner = sObjectMgr.GetPlayer(MAKE_NEW_GUID(itr->first,0,HIGHGUID_PLAYER)))
|
||||
owner->GetSession()->SendGMTicketGetTicket(0x0A,0);
|
||||
if(Player* owner = sObjectMgr.GetPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
|
||||
owner->GetSession()->SendGMTicketGetTicket(0x0A, 0);
|
||||
}
|
||||
CharacterDatabase.PExecute("DELETE FROM character_ticket");
|
||||
m_GMTicketMap.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue