mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
refactor(Core/Game): restyle game lib with astyle (#3466)
This commit is contained in:
@@ -31,7 +31,7 @@ enum CharterItemIDs
|
||||
ARENA_TEAM_CHARTER_5v5 = 23562
|
||||
};
|
||||
|
||||
void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData)
|
||||
void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_BUY");
|
||||
@@ -172,7 +172,8 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData)
|
||||
}
|
||||
|
||||
if (!_player->HasEnoughMoney(cost))
|
||||
{ //player hasn't got enough money
|
||||
{
|
||||
//player hasn't got enough money
|
||||
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, charterid, 0);
|
||||
return;
|
||||
}
|
||||
@@ -260,7 +261,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionGuidLow);
|
||||
#endif
|
||||
|
||||
WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+1+signs*12));
|
||||
WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8 + 8 + 4 + 1 + signs * 12));
|
||||
data << uint64(petitionguid); // petition guid
|
||||
data << uint64(_player->GetGUID()); // owner guid
|
||||
data << uint32(petitionGuidLow); // guild guid
|
||||
@@ -276,7 +277,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recvData)
|
||||
void WorldSession::HandlePetitionQueryOpcode(WorldPacket& recvData)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_QUERY"); // ok
|
||||
@@ -305,7 +306,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid)
|
||||
}
|
||||
|
||||
uint8 type = petition->petitionType;
|
||||
WorldPacket data(SMSG_PETITION_QUERY_RESPONSE, (4+8+petition->petitionName.size()+1+1+4*12+2+10));
|
||||
WorldPacket data(SMSG_PETITION_QUERY_RESPONSE, (4 + 8 + petition->petitionName.size() + 1 + 1 + 4 * 12 + 2 + 10));
|
||||
data << uint32(GUID_LOPART(petitionguid)); // guild/team guid (in Trinity always same as GUID_LOPART(petition guid)
|
||||
data << MAKE_NEW_GUID(petition->ownerGuid, 0, HIGHGUID_PLAYER); // charter owner guid
|
||||
data << petition->petitionName; // name (guild/arena team)
|
||||
@@ -319,8 +320,8 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid)
|
||||
}
|
||||
else
|
||||
{
|
||||
data << uint32(type-1);
|
||||
data << uint32(type-1);
|
||||
data << uint32(type - 1);
|
||||
data << uint32(type - 1);
|
||||
data << uint32(type); // bypass client - side limitation, a different value is needed here for each petition
|
||||
}
|
||||
data << uint32(0); // 5
|
||||
@@ -342,7 +343,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid)
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData)
|
||||
void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_RENAME"); // ok
|
||||
@@ -407,13 +408,13 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData)
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition (GUID: %u) renamed to '%s'", GUID_LOPART(petitionGuid), newName.c_str());
|
||||
#endif
|
||||
WorldPacket data(MSG_PETITION_RENAME, (8+newName.size()+1));
|
||||
WorldPacket data(MSG_PETITION_RENAME, (8 + newName.size() + 1));
|
||||
data << uint64(petitionGuid);
|
||||
data << newName;
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData)
|
||||
void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SIGN"); // ok
|
||||
@@ -509,7 +510,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData)
|
||||
|
||||
if (found)
|
||||
{
|
||||
WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4));
|
||||
WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8 + 8 + 4));
|
||||
data << uint64(petitionGuid);
|
||||
data << uint64(_player->GetGUID());
|
||||
data << (uint32)PETITION_SIGN_ALREADY_SIGNED;
|
||||
@@ -539,7 +540,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionGuid), _player->GetName().c_str(), playerGuid, GetAccountId());
|
||||
#endif
|
||||
|
||||
WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4));
|
||||
WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8 + 8 + 4));
|
||||
data << uint64(petitionGuid);
|
||||
data << uint64(_player->GetGUID());
|
||||
data << uint32(PETITION_SIGN_OK);
|
||||
@@ -557,7 +558,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData)
|
||||
owner->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recvData)
|
||||
void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_DECLINE"); // ok
|
||||
@@ -583,7 +584,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recvData)
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData)
|
||||
void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_OFFER_PETITION"); // ok
|
||||
@@ -657,7 +658,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData)
|
||||
Signatures const* signatures = sPetitionMgr->GetSignature(GUID_LOPART(petitionguid));
|
||||
uint8 signs = signatures ? signatures->signatureMap.size() : 0;
|
||||
|
||||
WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+signs+signs*12));
|
||||
WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8 + 8 + 4 + signs + signs * 12));
|
||||
data << uint64(petitionguid); // petition guid
|
||||
data << uint64(_player->GetGUID()); // owner guid
|
||||
data << uint32(GUID_LOPART(petitionguid)); // guild guid
|
||||
@@ -673,7 +674,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData)
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData)
|
||||
void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_TURN_IN_PETITION");
|
||||
@@ -761,7 +762,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData)
|
||||
if (type == GUILD_CHARTER_TYPE)
|
||||
requiredSignatures = sWorld->getIntConfig(CONFIG_MIN_PETITION_SIGNS);
|
||||
else
|
||||
requiredSignatures = type-1;
|
||||
requiredSignatures = type - 1;
|
||||
|
||||
// Notify player if signatures are missing
|
||||
if (signs < requiredSignatures)
|
||||
@@ -855,7 +856,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData)
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recvData)
|
||||
void WorldSession::HandlePetitionShowListOpcode(WorldPacket& recvData)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received CMSG_PETITION_SHOWLIST");
|
||||
@@ -878,7 +879,7 @@ void WorldSession::SendPetitionShowList(uint64 guid)
|
||||
return;
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_PETITION_SHOWLIST, 8+1+4*6);
|
||||
WorldPacket data(SMSG_PETITION_SHOWLIST, 8 + 1 + 4 * 6);
|
||||
data << guid; // npc guid
|
||||
|
||||
if (creature->IsTabardDesigner())
|
||||
|
||||
Reference in New Issue
Block a user