aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/PetitionsHandler.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-09-20 11:05:30 +0200
committerShauren <shauren.trinity@gmail.com>2014-09-20 11:05:30 +0200
commit8e288dd6731ed608d8285f9f966783ee9b46eebf (patch)
treea0dfb3e110f4ba63214ccde1ade6d633294e4746 /src/server/game/Handlers/PetitionsHandler.cpp
parent7cbaa028cd3192725ed47226c08fb3e6f82f02d3 (diff)
parent050d56ac21fff48d260908e72e430f212e1d770d (diff)
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Achievements/AchievementMgr.cpp src/server/game/Battlefield/Battlefield.h src/server/game/Battlegrounds/ArenaScore.h src/server/game/Battlegrounds/ArenaTeam.cpp src/server/game/Battlegrounds/ArenaTeam.h src/server/game/Battlegrounds/ArenaTeamMgr.cpp src/server/game/Battlegrounds/BattlegroundMgr.cpp src/server/game/Battlegrounds/BattlegroundMgr.h src/server/game/Battlegrounds/BattlegroundQueue.h src/server/game/Battlegrounds/BattlegroundScore.h src/server/game/Battlegrounds/Zones/BattlegroundAB.h src/server/game/Battlegrounds/Zones/BattlegroundAV.h src/server/game/Battlegrounds/Zones/BattlegroundEY.h src/server/game/Battlegrounds/Zones/BattlegroundIC.h src/server/game/Battlegrounds/Zones/BattlegroundSA.h src/server/game/Battlegrounds/Zones/BattlegroundWS.h src/server/game/DungeonFinding/LFG.h src/server/game/DungeonFinding/LFGMgr.cpp src/server/game/DungeonFinding/LFGMgr.h src/server/game/DungeonFinding/LFGQueue.cpp src/server/game/DungeonFinding/LFGQueue.h src/server/game/Entities/Corpse/Corpse.cpp src/server/game/Entities/Creature/Creature.cpp src/server/game/Entities/Creature/GossipDef.cpp src/server/game/Entities/Creature/GossipDef.h src/server/game/Entities/Creature/TemporarySummon.cpp src/server/game/Entities/DynamicObject/DynamicObject.cpp src/server/game/Entities/Object/Object.cpp src/server/game/Entities/Object/Object.h src/server/game/Entities/Object/ObjectDefines.h src/server/game/Entities/Object/Updates/UpdateData.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Player/Player.h src/server/game/Entities/Unit/Unit.cpp src/server/game/Entities/Unit/Unit.h src/server/game/Globals/ObjectAccessor.cpp src/server/game/Globals/ObjectAccessor.h src/server/game/Globals/ObjectMgr.cpp src/server/game/Groups/Group.cpp src/server/game/Groups/Group.h src/server/game/Guilds/Guild.cpp src/server/game/Guilds/Guild.h src/server/game/Handlers/AuctionHouseHandler.cpp src/server/game/Handlers/BattleGroundHandler.cpp src/server/game/Handlers/CalendarHandler.cpp src/server/game/Handlers/CharacterHandler.cpp src/server/game/Handlers/ChatHandler.cpp src/server/game/Handlers/GroupHandler.cpp src/server/game/Handlers/GuildHandler.cpp src/server/game/Handlers/ItemHandler.cpp src/server/game/Handlers/LFGHandler.cpp src/server/game/Handlers/MailHandler.cpp src/server/game/Handlers/MiscHandler.cpp src/server/game/Handlers/MovementHandler.cpp src/server/game/Handlers/NPCHandler.cpp src/server/game/Handlers/PetHandler.cpp src/server/game/Handlers/QueryHandler.cpp src/server/game/Handlers/QuestHandler.cpp src/server/game/Handlers/TradeHandler.cpp src/server/game/Handlers/VehicleHandler.cpp src/server/game/Movement/Spline/MoveSplineInit.cpp src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSession.h src/server/game/Spells/Spell.cpp src/server/scripts/Commands/cs_debug.cpp src/server/scripts/Commands/cs_gm.cpp src/server/scripts/Commands/cs_misc.cpp src/server/scripts/Commands/cs_modify.cpp src/server/scripts/Commands/cs_reset.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp src/server/scripts/Kalimdor/zone_azshara.cpp src/server/scripts/Kalimdor/zone_durotar.cpp src/server/scripts/Kalimdor/zone_moonglade.cpp src/server/scripts/Kalimdor/zone_orgrimmar.cpp src/server/scripts/Kalimdor/zone_ungoro_crater.cpp src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp src/server/scripts/Spells/spell_dk.cpp src/server/scripts/Spells/spell_generic.cpp src/server/shared/Packets/ByteBuffer.h
Diffstat (limited to 'src/server/game/Handlers/PetitionsHandler.cpp')
-rw-r--r--src/server/game/Handlers/PetitionsHandler.cpp112
1 files changed, 55 insertions, 57 deletions
diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp
index 8eb699a978f..d3d32745c5e 100644
--- a/src/server/game/Handlers/PetitionsHandler.cpp
+++ b/src/server/game/Handlers/PetitionsHandler.cpp
@@ -54,7 +54,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
{
TC_LOG_DEBUG("network", "Received opcode CMSG_PETITION_BUY");
- uint64 guidNPC;
+ ObjectGuid guidNPC;
uint32 clientIndex; // 1 for guild and arenaslot+1 for arenas in client
std::string name;
@@ -81,13 +81,13 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
recvData >> clientIndex; // index
recvData.read_skip<uint32>(); // 0
- TC_LOG_DEBUG("network", "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str());
+ TC_LOG_DEBUG("network", "Petitioner %s tried sell petition: name %s", guidNPC.ToString().c_str(), name.c_str());
// prevent cheating
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC, UNIT_NPC_FLAG_PETITIONER);
if (!creature)
{
- TC_LOG_DEBUG("network", "WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC));
+ TC_LOG_DEBUG("network", "WORLD: HandlePetitionBuyOpcode - %s not found or you can't interact with him.", guidNPC.ToString().c_str());
return;
}
@@ -250,11 +250,10 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
TC_LOG_DEBUG("network", "Received opcode CMSG_PETITION_SHOW_SIGNATURES");
uint8 signs = 0;
- uint64 petitionguid;
+ ObjectGuid petitionguid;
recvData >> petitionguid; // petition guid
- // solve (possible) some strange compile problems with explicit use GUID_LOPART(petitionguid) at some GCC versions (wrong code optimization in compiler?)
- uint32 petitionGuidLow = GUID_LOPART(petitionguid);
+ uint32 petitionGuidLow = petitionguid.GetCounter();
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE);
@@ -264,7 +263,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
if (!result)
{
- TC_LOG_DEBUG("entities.player.items", "Petition %u is not found for player %u %s", GUID_LOPART(petitionguid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName().c_str());
+ TC_LOG_DEBUG("entities.player.items", "Petition %u is not found for player %u %s", petitionguid.GetCounter(), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName().c_str());
return;
}
Field* fields = result->Fetch();
@@ -297,7 +296,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
Field* fields2 = result->Fetch();
uint32 lowGuid = fields2[0].GetUInt32();
- data << uint64(MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER)); // Player GUID
+ data << ObjectGuid(HIGHGUID_PLAYER, 0, lowGuid); // Player GUID
data << uint32(0); // there 0 ...
result->NextRow();
@@ -310,41 +309,41 @@ void WorldSession::HandlePetitionQueryOpcode(WorldPacket& recvData)
TC_LOG_DEBUG("network", "Received opcode CMSG_PETITION_QUERY"); // ok
uint32 guildguid;
- uint64 petitionguid;
+ ObjectGuid petitionguid;
recvData >> guildguid; // in Trinity always same as GUID_LOPART(petitionguid)
recvData >> petitionguid; // petition guid
- TC_LOG_DEBUG("network", "CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid);
+ TC_LOG_DEBUG("network", "CMSG_PETITION_QUERY Petition %s Guild GUID %u", petitionguid.ToString().c_str(), guildguid);
SendPetitionQueryOpcode(petitionguid);
}
-void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid)
+void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionguid)
{
- uint64 ownerguid = 0;
+ ObjectGuid ownerguid;
uint32 type;
std::string name = "NO_NAME_FOR_GUID";
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
- stmt->setUInt32(0, GUID_LOPART(petitionguid));
+ stmt->setUInt32(0, petitionguid.GetCounter());
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (result)
{
Field* fields = result->Fetch();
- ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
+ ownerguid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32());
name = fields[1].GetString();
type = fields[2].GetUInt8();
}
else
{
- TC_LOG_DEBUG("network", "CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid));
+ TC_LOG_DEBUG("network", "CMSG_PETITION_QUERY failed for petition (%s)", petitionguid.ToString().c_str());
return;
}
WorldPacket data(SMSG_PETITION_QUERY_RESPONSE, (4+8+name.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 << uint32(petitionguid.GetCounter()); // guild/team guid (in Trinity always same as GUID_LOPART(petition guid)
data << uint64(ownerguid); // charter owner guid
data << name; // name (guild/arena team)
data << uint8(0); // some string
@@ -384,7 +383,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
{
TC_LOG_DEBUG("network", "Received opcode MSG_PETITION_RENAME");
- uint64 petitionGuid;
+ ObjectGuid petitionGuid;
uint32 type;
std::string newName;
@@ -397,7 +396,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE);
- stmt->setUInt32(0, GUID_LOPART(petitionGuid));
+ stmt->setUInt32(0, petitionGuid.GetCounter());
PreparedQueryResult result = CharacterDatabase.Query(stmt);
@@ -408,7 +407,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
}
else
{
- TC_LOG_DEBUG("network", "CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionGuid));
+ TC_LOG_DEBUG("network", "CMSG_PETITION_QUERY failed for petition %s", petitionGuid.ToString().c_str());
return;
}
@@ -442,11 +441,11 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PETITION_NAME);
stmt->setString(0, newName);
- stmt->setUInt32(1, GUID_LOPART(petitionGuid));
+ stmt->setUInt32(1, petitionGuid.GetCounter());
CharacterDatabase.Execute(stmt);
- TC_LOG_DEBUG("network", "Petition (GUID: %u) renamed to '%s'", GUID_LOPART(petitionGuid), newName.c_str());
+ TC_LOG_DEBUG("network", "Petition %s renamed to '%s'", petitionGuid.ToString().c_str(), newName.c_str());
WorldPacket data(MSG_PETITION_RENAME, (8+newName.size()+1));
data << uint64(petitionGuid);
data << newName;
@@ -458,31 +457,31 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
TC_LOG_DEBUG("network", "Received opcode CMSG_PETITION_SIGN"); // ok
Field* fields;
- uint64 petitionGuid;
+ ObjectGuid petitionGuid;
uint8 unk;
recvData >> petitionGuid; // petition guid
recvData >> unk;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURES);
- stmt->setUInt32(0, GUID_LOPART(petitionGuid));
- stmt->setUInt32(1, GUID_LOPART(petitionGuid));
+ stmt->setUInt32(0, petitionGuid.GetCounter());
+ stmt->setUInt32(1, petitionGuid.GetCounter());
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
- TC_LOG_ERROR("network", "Petition %u is not found for player %u %s", GUID_LOPART(petitionGuid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName().c_str());
+ TC_LOG_ERROR("network", "Petition %s is not found for player %u %s", petitionGuid.ToString().c_str(), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName().c_str());
return;
}
fields = result->Fetch();
- uint64 ownerGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
+ ObjectGuid ownerGuid(HIGHGUID_PLAYER, fields[0].GetUInt32());
uint64 signs = fields[1].GetUInt64();
uint8 type = fields[2].GetUInt8();
uint32 playerGuid = _player->GetGUIDLow();
- if (GUID_LOPART(ownerGuid) == playerGuid)
+ if (ownerGuid == _player->GetGUID())
return;
// not let enemies sign guild charter
@@ -541,7 +540,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_ACCOUNT);
stmt->setUInt32(0, GetAccountId());
- stmt->setUInt32(1, GUID_LOPART(petitionGuid));
+ stmt->setUInt32(1, petitionGuid.GetCounter());
result = CharacterDatabase.Query(stmt);
@@ -559,14 +558,14 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION_SIGNATURE);
- stmt->setUInt32(0, GUID_LOPART(ownerGuid));
- stmt->setUInt32(1, GUID_LOPART(petitionGuid));
+ stmt->setUInt32(0, ownerGuid.GetCounter());
+ stmt->setUInt32(1, petitionGuid.GetCounter());
stmt->setUInt32(2, playerGuid);
stmt->setUInt32(3, GetAccountId());
CharacterDatabase.Execute(stmt);
- TC_LOG_DEBUG("network", "PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionGuid), _player->GetName().c_str(), playerGuid, GetAccountId());
+ TC_LOG_DEBUG("network", "PETITION SIGN: %s by player: %s (GUID: %u Account: %u)", petitionGuid.ToString().c_str(), _player->GetName().c_str(), playerGuid, GetAccountId());
WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4));
data << uint64(petitionGuid);
@@ -590,14 +589,13 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
{
TC_LOG_DEBUG("network", "Received opcode MSG_PETITION_DECLINE"); // ok
- uint64 petitionguid;
- uint64 ownerguid;
+ ObjectGuid petitionguid;
recvData >> petitionguid; // petition guid
- TC_LOG_DEBUG("network", "Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow());
+ TC_LOG_DEBUG("network", "Petition %s declined by %u", petitionguid.ToString().c_str(), _player->GetGUIDLow());
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID);
- stmt->setUInt32(0, GUID_LOPART(petitionguid));
+ stmt->setUInt32(0, petitionguid.GetCounter());
PreparedQueryResult result = CharacterDatabase.Query(stmt);
@@ -605,7 +603,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
return;
Field* fields = result->Fetch();
- ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
+ ObjectGuid ownerguid(HIGHGUID_PLAYER, 0, fields[0].GetUInt32());
Player* owner = ObjectAccessor::FindPlayer(ownerguid);
if (owner) // petition owner online
@@ -621,7 +619,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
TC_LOG_DEBUG("network", "Received opcode CMSG_OFFER_PETITION"); // ok
uint8 signs = 0;
- uint64 petitionguid, plguid;
+ ObjectGuid petitionguid, plguid;
uint32 type, junk;
Player* player;
recvData >> junk; // this is not petition type!
@@ -634,7 +632,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE);
- stmt->setUInt32(0, GUID_LOPART(petitionguid));
+ stmt->setUInt32(0, petitionguid.GetCounter());
PreparedQueryResult result = CharacterDatabase.Query(stmt);
@@ -644,7 +642,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
Field* fields = result->Fetch();
type = fields[0].GetUInt8();
- TC_LOG_DEBUG("network", "OFFER PETITION: type %u, GUID1 %u, to player id: %u", type, GUID_LOPART(petitionguid), GUID_LOPART(plguid));
+ TC_LOG_DEBUG("network", "OFFER PETITION: type %u, %s, to %s", type, petitionguid.ToString().c_str(), plguid.ToString().c_str());
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != player->GetTeam())
{
@@ -699,7 +697,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE);
- stmt->setUInt32(0, GUID_LOPART(petitionguid));
+ stmt->setUInt32(0, petitionguid.GetCounter());
result = CharacterDatabase.Query(stmt);
@@ -710,13 +708,13 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
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
+ data << uint32(petitionguid.GetCounter()); // guild guid
data << uint8(signs); // sign's count
for (uint8 i = 1; i <= signs; ++i)
{
Field* fields2 = result->Fetch();
- data << uint64(MAKE_NEW_GUID(fields2[0].GetUInt32(), 0, HIGHGUID_PLAYER)); // Player GUID
+ data << uint64(ObjectGuid(HIGHGUID_PLAYER, fields2[0].GetUInt32())); // Player GUID
data << uint32(0); // there 0 ...
result->NextRow();
@@ -731,7 +729,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
// Get petition guid from packet
WorldPacket data;
- uint64 petitionGuid;
+ ObjectGuid petitionGuid;
recvData >> petitionGuid;
@@ -740,7 +738,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
if (!item)
return;
- TC_LOG_DEBUG("network", "Petition %u turned in by %u", GUID_LOPART(petitionGuid), _player->GetGUIDLow());
+ TC_LOG_DEBUG("network", "Petition %s turned in by %u", petitionGuid.ToString().c_str(), _player->GetGUIDLow());
// Get petition data from db
uint32 ownerguidlo;
@@ -748,7 +746,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
std::string name;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
- stmt->setUInt32(0, GUID_LOPART(petitionGuid));
+ stmt->setUInt32(0, petitionGuid.GetCounter());
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (result)
@@ -760,7 +758,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
}
else
{
- TC_LOG_ERROR("network", "Player %s (guid: %u) tried to turn in petition (guid: %u) that is not present in the database", _player->GetName().c_str(), _player->GetGUIDLow(), GUID_LOPART(petitionGuid));
+ TC_LOG_ERROR("network", "Player %s (guid: %u) tried to turn in petition (%s) that is not present in the database", _player->GetName().c_str(), _player->GetGUIDLow(), petitionGuid.ToString().c_str());
return;
}
@@ -813,7 +811,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
uint8 signatures;
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE);
- stmt->setUInt32(0, GUID_LOPART(petitionGuid));
+ stmt->setUInt32(0, petitionGuid.GetCounter());
result = CharacterDatabase.Query(stmt);
if (result)
@@ -861,7 +859,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
for (uint8 i = 0; i < signatures; ++i)
{
Field* fields = result->Fetch();
- guild->AddMember(MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER));
+ guild->AddMember(ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()));
result->NextRow();
}
}
@@ -888,9 +886,9 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
for (uint8 i = 0; i < signatures; ++i)
{
Field* fields = result->Fetch();
- uint32 memberGUID = fields[0].GetUInt32();
- TC_LOG_DEBUG("network", "PetitionsHandler: Adding arena team (guid: %u) member %u", arenaTeam->GetId(), memberGUID);
- arenaTeam->AddMember(MAKE_NEW_GUID(memberGUID, 0, HIGHGUID_PLAYER));
+ ObjectGuid memberGUID(HIGHGUID_PLAYER, fields[0].GetUInt32());
+ TC_LOG_DEBUG("network", "PetitionsHandler: Adding arena team (guid: %u) member %s", arenaTeam->GetId(), memberGUID.ToString().c_str());
+ arenaTeam->AddMember(memberGUID);
result->NextRow();
}
}
@@ -898,17 +896,17 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
SQLTransaction trans = CharacterDatabase.BeginTransaction();
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_BY_GUID);
- stmt->setUInt32(0, GUID_LOPART(petitionGuid));
+ stmt->setUInt32(0, petitionGuid.GetCounter());
trans->Append(stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE_BY_GUID);
- stmt->setUInt32(0, GUID_LOPART(petitionGuid));
+ stmt->setUInt32(0, petitionGuid.GetCounter());
trans->Append(stmt);
CharacterDatabase.CommitTransaction(trans);
// created
- TC_LOG_DEBUG("network", "TURN IN PETITION GUID %u", GUID_LOPART(petitionGuid));
+ TC_LOG_DEBUG("network", "Player %s (%s) turning in petition %s", _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), petitionGuid.ToString().c_str());
data.Initialize(SMSG_TURN_IN_PETITION_RESULTS, 4);
data << (uint32)PETITION_TURN_OK;
@@ -919,18 +917,18 @@ void WorldSession::HandlePetitionShowListOpcode(WorldPacket& recvData)
{
TC_LOG_DEBUG("network", "Received CMSG_PETITION_SHOWLIST");
- uint64 guid;
+ ObjectGuid guid;
recvData >> guid;
SendPetitionShowList(guid);
}
-void WorldSession::SendPetitionShowList(uint64 guid)
+void WorldSession::SendPetitionShowList(ObjectGuid guid)
{
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_PETITIONER);
if (!creature)
{
- TC_LOG_DEBUG("network", "WORLD: HandlePetitionShowListOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
+ TC_LOG_DEBUG("network", "WORLD: HandlePetitionShowListOpcode - %s not found or you can't interact with him.", guid.ToString().c_str());
return;
}