Core/Guild: Code Refactor
- Send correct events when modifiying Ranks (Add, modify, delete) - Store money/slots withdraw, not remaining slots. This will update remaining slots/money properly. - Reset daily slots/money withdraw for all members at same time, configurable - Better debug messages
This commit is contained in:
1 parent
3ee840a9be
commit
58ec4e5319
38 files changed
+1893
-1709
No files matched your search
@@ -56,13 +56,13 @@ void WorldSession::SendPartyResult(PartyOperation operation, const std::string&
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE");
|
||||
|
||||
std::string membername;
|
||||
recv_data >> membername;
|
||||
recv_data.read_skip<uint32>();
|
||||
recvData >> membername;
|
||||
recvData.read_skip<uint32>();
|
||||
|
||||
// attempt add selected player
|
||||
|
||||
@@ -195,11 +195,11 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, ERR_PARTY_RESULT_OK);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data)
|
||||
void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ACCEPT");
|
||||
|
||||
recv_data.read_skip<uint32>();
|
||||
recvData.read_skip<uint32>();
|
||||
Group* group = GetPlayer()->GetGroupInvite();
|
||||
|
||||
if (!group)
|
||||
@@ -247,7 +247,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data)
|
||||
group->BroadcastGroupUpdate();
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/)
|
||||
void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recvData*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE");
|
||||
|
||||
@@ -270,14 +270,14 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/)
|
||||
leader->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE_GUID");
|
||||
|
||||
uint64 guid;
|
||||
std::string reason;
|
||||
recv_data >> guid;
|
||||
recv_data >> reason;
|
||||
recvData >> guid;
|
||||
recvData >> reason;
|
||||
|
||||
//can't uninvite yourself
|
||||
if (guid == GetPlayer()->GetGUID())
|
||||
@@ -319,12 +319,12 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
|
||||
SendPartyResult(PARTY_OP_UNINVITE, "", ERR_TARGET_NOT_IN_GROUP_S);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE");
|
||||
|
||||
std::string membername;
|
||||
recv_data >> membername;
|
||||
recvData >> membername;
|
||||
|
||||
// player not found
|
||||
if (!normalizePlayerName(membername))
|
||||
@@ -364,12 +364,12 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data)
|
||||
SendPartyResult(PARTY_OP_UNINVITE, membername, ERR_TARGET_NOT_IN_GROUP_S);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_LEADER");
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
recvData >> guid;
|
||||
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
Group* group = GetPlayer()->GetGroup();
|
||||
@@ -385,7 +385,7 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data)
|
||||
group->SendUpdate();
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/)
|
||||
void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recvData*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND");
|
||||
|
||||
@@ -408,14 +408,14 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/)
|
||||
GetPlayer()->RemoveFromGroup(GROUP_REMOVEMETHOD_LEAVE);
|
||||
}
|
||||
|
||||
void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleLootMethodOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LOOT_METHOD");
|
||||
|
||||
uint32 lootMethod;
|
||||
uint64 lootMaster;
|
||||
uint32 lootThreshold;
|
||||
recv_data >> lootMethod >> lootMaster >> lootThreshold;
|
||||
recvData >> lootMethod >> lootMaster >> lootThreshold;
|
||||
|
||||
Group* group = GetPlayer()->GetGroup();
|
||||
if (!group)
|
||||
@@ -459,7 +459,7 @@ void WorldSession::HandleLootRoll(WorldPacket& recvData)
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
|
||||
void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_MINIMAP_PING");
|
||||
|
||||
@@ -467,8 +467,8 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
|
||||
float x, y;
|
||||
recv_data >> x;
|
||||
recv_data >> y;
|
||||
recvData >> x;
|
||||
recvData >> y;
|
||||
|
||||
//sLog->outDebug("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y);
|
||||
|
||||
@@ -483,13 +483,13 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
|
||||
GetPlayer()->GetGroup()->BroadcastPacket(&data, true, -1, GetPlayer()->GetGUID());
|
||||
}
|
||||
|
||||
void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data)
|
||||
void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RANDOM_ROLL");
|
||||
|
||||
uint32 minimum, maximum, roll;
|
||||
recv_data >> minimum;
|
||||
recv_data >> maximum;
|
||||
recvData >> minimum;
|
||||
recvData >> maximum;
|
||||
|
||||
/** error handling **/
|
||||
if (minimum > maximum || maximum > 10000) // < 32768 for urand call
|
||||
@@ -512,7 +512,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data)
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_TARGET_UPDATE");
|
||||
|
||||
@@ -521,7 +521,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
|
||||
uint8 x;
|
||||
recv_data >> x;
|
||||
recvData >> x;
|
||||
|
||||
/** error handling **/
|
||||
/********************/
|
||||
@@ -537,12 +537,12 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
recvData >> guid;
|
||||
group->SetTargetIcon(x, _player->GetGUID(), guid);
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recv_data*/)
|
||||
void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recvData*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT");
|
||||
|
||||
@@ -563,7 +563,7 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recv_data*/)
|
||||
group->ConvertToRaid();
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP");
|
||||
|
||||
@@ -574,8 +574,8 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data)
|
||||
|
||||
std::string name;
|
||||
uint8 groupNr;
|
||||
recv_data >> name;
|
||||
recv_data >> groupNr;
|
||||
recvData >> name;
|
||||
recvData >> groupNr;
|
||||
|
||||
if (groupNr >= MAX_RAID_SUBGROUPS)
|
||||
return;
|
||||
@@ -602,7 +602,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data)
|
||||
group->ChangeMembersGroup(guid, groupNr);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER");
|
||||
|
||||
@@ -615,15 +615,15 @@ void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data)
|
||||
|
||||
uint64 guid;
|
||||
bool apply;
|
||||
recv_data >> guid;
|
||||
recv_data >> apply;
|
||||
recvData >> guid;
|
||||
recvData >> apply;
|
||||
|
||||
group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_ASSISTANT);
|
||||
|
||||
group->SendUpdate();
|
||||
}
|
||||
|
||||
void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_PARTY_ASSIGNMENT");
|
||||
|
||||
@@ -638,8 +638,8 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data)
|
||||
uint8 assignment;
|
||||
bool apply;
|
||||
uint64 guid;
|
||||
recv_data >> assignment >> apply;
|
||||
recv_data >> guid;
|
||||
recvData >> assignment >> apply;
|
||||
recvData >> guid;
|
||||
|
||||
switch (assignment)
|
||||
{
|
||||
@@ -657,7 +657,7 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data)
|
||||
group->SendUpdate();
|
||||
}
|
||||
|
||||
void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK");
|
||||
|
||||
@@ -665,7 +665,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data)
|
||||
if (!group)
|
||||
return;
|
||||
|
||||
if (recv_data.empty()) // request
|
||||
if (recvData.empty()) // request
|
||||
{
|
||||
/** error handling **/
|
||||
if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
|
||||
@@ -682,7 +682,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data)
|
||||
else // answer
|
||||
{
|
||||
uint8 state;
|
||||
recv_data >> state;
|
||||
recvData >> state;
|
||||
|
||||
// everything's fine, do it
|
||||
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
|
||||
@@ -692,7 +692,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket & /*recv_data*/)
|
||||
void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket & /*recvData*/)
|
||||
{
|
||||
//Group* group = GetPlayer()->GetGroup();
|
||||
//if (!group)
|
||||
@@ -872,11 +872,11 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
|
||||
}
|
||||
|
||||
/*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/
|
||||
void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data)
|
||||
void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS");
|
||||
uint64 Guid;
|
||||
recv_data >> Guid;
|
||||
recvData >> Guid;
|
||||
|
||||
Player* player = HashMapHolder<Player>::Find(Guid);
|
||||
if (!player)
|
||||
@@ -962,23 +962,23 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data)
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
/*!*/void WorldSession::HandleRequestRaidInfoOpcode(WorldPacket & /*recv_data*/)
|
||||
/*!*/void WorldSession::HandleRequestRaidInfoOpcode(WorldPacket & /*recvData*/)
|
||||
{
|
||||
// every time the player checks the character screen
|
||||
_player->SendRaidInfo();
|
||||
}
|
||||
|
||||
/*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recv_data)
|
||||
/*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug("WORLD: got CMSG_GROUP_CANCEL.");
|
||||
}*/
|
||||
|
||||
void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_OPT_OUT_OF_LOOT");
|
||||
|
||||
uint32 passOnLoot;
|
||||
recv_data >> passOnLoot; // 1 always pass, 0 do not pass
|
||||
recvData >> passOnLoot; // 1 always pass, 0 do not pass
|
||||
|
||||
// ignore if player not loaded
|
||||
if (!GetPlayer()) // needed because STATUS_AUTHED
|
||||
|
||||
Reference in new issue
Block a user