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
This commit is contained in:
kaelima
2012-03-28 03:59:03 +02:00
parent f9caf79b16
commit 820f45c424
8 changed files with 56 additions and 43 deletions

View File

@@ -1167,7 +1167,7 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /*
}
m_QueueInfoMap[gguid] = pqInfo;
if(GetState(gguid) != LFG_STATE_NONE)
if (GetState(gguid) != LFG_STATE_NONE)
{
LfgGuidList& currentQueue = m_currentQueue[team];
currentQueue.push_front(gguid);

View File

@@ -17009,7 +17009,7 @@ void Unit::ExitVehicle(Position const* /*exitPosition*/)
//! to specify exit coordinates and either store those per passenger, or we need to
//! init spline movement based on those coordinates in unapply handlers, and
//! relocate exiting passengers based on Unit::moveSpline data. Either way,
//! Coming Soon<EFBFBD>
//! Coming Soon(TM)
}
void Unit::_ExitVehicle(Position const* exitPosition)

View File

@@ -820,28 +820,28 @@ void Group::SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumb
}
}
void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r)
void Group::SendLootAllPassed(uint32 numberOfPlayers, Roll const& roll)
{
WorldPacket data(SMSG_LOOT_ALL_PASSED, (8+4+4+4+4));
data << uint64(r.itemGUID); // Guid of the item rolled
data << uint32(NumberOfPlayers); // The number of players rolling for it???
data << uint32(r.itemid); // The itemEntryId for the item that shall be rolled for
data << uint32(r.itemRandomPropId); // Item random property ID
data << uint32(r.itemRandomSuffix); // Item random suffix ID
data << uint64(roll.itemGUID); // Guid of the item rolled
data << uint32(numberOfPlayers); // The number of players rolling for it
data << uint32(roll.itemid); // The itemEntryId for the item that shall be rolled for
data << uint32(roll.itemRandomPropId); // Item random property ID
data << uint32(roll.itemRandomSuffix); // Item random suffix ID
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr)
{
Player* p = ObjectAccessor::FindPlayer(itr->first);
if (!p || !p->GetSession())
Player* player = ObjectAccessor::FindPlayer(itr->first);
if (!player || !player->GetSession())
continue;
if (itr->second != NOT_VALID)
p->GetSession()->SendPacket(&data);
player->GetSession()->SendPacket(&data);
}
}
// notify group members which player is the allowed looter for the given creature
void Group::SendLooter(Creature* creature, Player* pLooter)
void Group::SendLooter(Creature* creature, Player* groupLooter)
{
ASSERT(creature);
@@ -849,8 +849,8 @@ void Group::SendLooter(Creature* creature, Player* pLooter)
data << uint64(creature->GetGUID());
data << uint8(0); // unk1
if (pLooter)
data.append(pLooter->GetPackGUID());
if (groupLooter)
data.append(groupLooter->GetPackGUID());
else
data << uint8(0);

View File

@@ -352,8 +352,8 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data)
uint64 GoGuid;
recv_data >> GoGuid;
uint8 unk;
recv_data >> unk;
uint8 fullSlotList;
recv_data >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
{
@@ -375,8 +375,8 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data)
uint8 tabId;
recv_data >> tabId;
uint8 unk1;
recv_data >> unk1;
uint8 fullSlotList;
recv_data >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* guild = _GetPlayerGuild(this))

View File

@@ -38,7 +38,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
return;
}
GMTicketResponse response = GMTICKET_RESPONSE_FAILURE;
GMTicketResponse response = GMTICKET_RESPONSE_CREATE_ERROR;
// Player must not have ticket
if (!sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID()))
{
@@ -48,7 +48,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
sWorld->SendGMText(LANG_COMMAND_TICKETNEW, GetPlayer()->GetName(), ticket->GetId());
response = GMTICKET_RESPONSE_SUCCESS;
response = GMTICKET_RESPONSE_CREATE_SUCCESS;
}
WorldPacket data(SMSG_GMTICKET_CREATE, 4);
@@ -61,8 +61,8 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data)
std::string message;
recv_data >> message;
GMTicketResponse response = GMTICKET_RESPONSE_FAILURE;
if (GmTicket *ticket = sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID()))
GMTicketResponse response = GMTICKET_RESPONSE_UPDATE_ERROR;
if (GmTicket* ticket = sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID()))
{
SQLTransaction trans = SQLTransaction(NULL);
ticket->SetMessage(message);
@@ -70,7 +70,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data)
sWorld->SendGMText(LANG_COMMAND_TICKETUPDATED, GetPlayer()->GetName(), ticket->GetId());
response = GMTICKET_RESPONSE_SUCCESS;
response = GMTICKET_RESPONSE_UPDATE_SUCCESS;
}
WorldPacket data(SMSG_GMTICKET_UPDATETEXT, 4);

View File

@@ -455,7 +455,7 @@ class Spell
void SetAutoRepeat(bool rep) { m_autoRepeat = rep; }
void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; }
bool IsNextMeleeSwingSpell() const;
bool IsTriggered() const {return _triggeredCastFlags & TRIGGERED_FULL_MASK;};
bool IsTriggered() const { return _triggeredCastFlags & TRIGGERED_FULL_MASK; };
bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; }
bool IsAutoActionResetSpell() const;

View File

@@ -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 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
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
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

View File

@@ -40,8 +40,11 @@ enum GMTicketStatus
enum GMTicketResponse
{
GMTICKET_RESPONSE_FAILURE = 1,
GMTICKET_RESPONSE_SUCCESS = 2,
GMTICKET_RESPONSE_ALREADY_EXIST = 1,
GMTICKET_RESPONSE_CREATE_SUCCESS = 2,
GMTICKET_RESPONSE_CREATE_ERROR = 3,
GMTICKET_RESPONSE_UPDATE_SUCCESS = 4,
GMTICKET_RESPONSE_UPDATE_ERROR = 5,
GMTICKET_RESPONSE_TICKET_DELETED = 9,
};
@@ -156,6 +159,7 @@ private:
bool _completed;
GMTicketEscalationStatus _escalatedStatus;
bool _viewed;
bool _needResponse; // TODO: find out the use of this, and then store it in DB
std::string _response;
};
typedef std::map<uint32, GmTicket*> GmTicketList;