diff options
| author | kaelima <kaelima@live.se> | 2012-03-28 03:59:03 +0200 |
|---|---|---|
| committer | kaelima <kaelima@live.se> | 2012-03-28 03:59:03 +0200 |
| commit | 820f45c4249a9f57e31a8a97b233de0e3ffdab58 (patch) | |
| tree | 7e6eb1dade0a060ee6a762a7cb9ad4500c14b68d /src/server/game/Tickets/TicketMgr.cpp | |
| parent | f9caf79b16e9de5d87dd48cdc450415b6ad33867 (diff) | |
Core/Protocol:
- Correct and rename response message from creating/updating a ticket
- Prevent some trailing data in CMSG_GMTICKET_CREATE and add comment on stuff missing from its structure.
- Random cleanup
Diffstat (limited to 'src/server/game/Tickets/TicketMgr.cpp')
| -rwxr-xr-x | src/server/game/Tickets/TicketMgr.cpp | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index e4b8ea2e034..930bf0d3372 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -37,19 +37,28 @@ GmTicket::GmTicket(Player* player, WorldPacket& recv_data) : _createTime(time(NU _playerName = player->GetName(); _playerGuid = player->GetGUID(); - uint32 mapId; - recv_data >> mapId; - _mapId = mapId; - + recv_data >> _mapId; recv_data >> _posX; recv_data >> _posY; recv_data >> _posZ; recv_data >> _message; - - uint32 unk1; - recv_data >> unk1; // not sure what this is... replyTo? - uint8 needResponse; - recv_data >> needResponse; // always 1/0 -- not sure what retail does with this + uint32 needResponse; + recv_data >> needResponse; + _needResponse = (needResponse == 17); // Requires GM response. 17 = true, 1 = false (17 is default) + uint8 unk1; + recv_data >> unk1; // Requests further GM interaction on a ticket to which a GM has already responded + + recv_data.rfinish(); + /* + recv_data >> uint32(count); // text lines + for (int i = 0; i < count; i++) + recv_data >> uint32(); + + if (something) + recv_data >> uint32(); + else + compressed uint32 + string; + */ } GmTicket::~GmTicket() { } @@ -125,11 +134,11 @@ void GmTicket::WritePacket(WorldPacket& data) const void GmTicket::SendResponse(WorldSession* session) const { WorldPacket data(SMSG_GMRESPONSE_RECEIVED); - data << uint32(1); // unk? Zor says "hasActiveTicket" - data << uint32(0); // can-edit - always 1 or 0, not flags + data << uint32(1); // responseID + data << uint32(_id); // ticketID data << _message.c_str(); data << _response.c_str(); - // 3 null strings + // 3 null strings (unused) data << uint8(0); data << uint8(0); data << uint8(0); @@ -191,7 +200,7 @@ void GmTicket::SetUnassigned() void GmTicket::TeleportTo(Player* player) const { - player->TeleportTo(_mapId, _posX, _posY, _posZ, 1, 0); + player->TeleportTo(_mapId, _posX, _posY, _posZ, 0.0f, 0); } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -345,13 +354,13 @@ void TicketMgr::SendTicket(WorldSession* session, GmTicket* ticket) const } WorldPacket data(SMSG_GMTICKET_GETTICKET, (4 + 4 + (ticket ? message.length() + 1 + 4 + 4 + 4 + 1 + 1 : 0))); - data << uint32(status); // standard 0x0A, 0x06 if text present - data << uint32(1); // g_HasActiveGMTicket -- not a flag + data << uint32(status); // standard 0x0A, 0x06 if text present + data << uint32(ticket ? ticket->GetId() : 0); // ticketID if (ticket) { - data << message.c_str(); // ticket text - data << uint8(0x7); // ticket category; why is this hardcoded? does it make a diff re: client? + data << message.c_str(); // ticket text + data << uint8(0x7); // ticket category; why is this hardcoded? does it make a diff re: client? // we've got the easy stuff done by now. // Now we need to go through the client logic for displaying various levels of ticket load |
