diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-10-22 23:31:10 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-10-22 23:31:10 +0200 |
commit | cffbcea8776dcf1fd175bd678c04e1ca3eb440c1 (patch) | |
tree | d6da44a54ac3287a1fb716535eada3a56c651584 /src/server/game/Handlers/PetitionsHandler.cpp | |
parent | ac94efd5079a3a7e4d48e9f804f50acc0afa4f8f (diff) |
Core/Entities: Sixth part of removing GetGUIDLow() uses
Diffstat (limited to 'src/server/game/Handlers/PetitionsHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/PetitionsHandler.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index bb39982db00..3fe90a28a87 100644 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -201,7 +201,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData) if (!charter) return; - charter->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1, charter->GetGUIDLow()); + charter->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1, charter->GetGUID().GetCounter()); // ITEM_FIELD_ENCHANTMENT_1_1 is guild/arenateam id // ITEM_FIELD_ENCHANTMENT_1_1+1 is current signatures count (showed on item) charter->SetState(ITEM_CHANGED, _player); @@ -211,7 +211,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData) // we checked above, if this player is in an arenateam, so this must be // datacorruption PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_BY_OWNER); - stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt32(0, _player->GetGUID().GetCounter()); stmt->setUInt8(1, type); PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -227,7 +227,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData) } // delete petitions with the same guid as this one - ssInvalidPetitionGUIDs << '\'' << charter->GetGUIDLow() << '\''; + ssInvalidPetitionGUIDs << '\'' << charter->GetGUID().GetCounter() << '\''; TC_LOG_DEBUG("network", "Invalid petition GUIDs: %s", ssInvalidPetitionGUIDs.str().c_str()); CharacterDatabase.EscapeString(name); @@ -236,8 +236,8 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData) trans->PAppend("DELETE FROM petition_sign WHERE petitionguid IN (%s)", ssInvalidPetitionGUIDs.str().c_str()); stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION); - stmt->setUInt32(0, _player->GetGUIDLow()); - stmt->setUInt32(1, charter->GetGUIDLow()); + stmt->setUInt32(0, _player->GetGUID().GetCounter()); + stmt->setUInt32(1, charter->GetGUID().GetCounter()); stmt->setString(2, name); stmt->setUInt8(3, uint8(type)); trans->Append(stmt); @@ -263,7 +263,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData) if (!result) { - TC_LOG_DEBUG("entities.player.items", "Petition %s is not found for player %u %s", petitionguid.ToString().c_str(), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName().c_str()); + TC_LOG_DEBUG("entities.player.items", "Petition %s is not found for %s %s", petitionguid.ToString().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str()); return; } Field* fields = result->Fetch(); @@ -471,7 +471,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData) if (!result) { - TC_LOG_ERROR("network", "Petition %s is not found for player %u %s", petitionGuid.ToString().c_str(), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName().c_str()); + TC_LOG_ERROR("network", "Petition %s is not found for %s %s", petitionGuid.ToString().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str()); return; } @@ -480,7 +480,6 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData) uint64 signs = fields[1].GetUInt64(); uint8 type = fields[2].GetUInt8(); - uint32 playerGuid = _player->GetGUIDLow(); if (ownerGuid == _player->GetGUID()) return; @@ -560,12 +559,12 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData) stmt->setUInt32(0, ownerGuid.GetCounter()); stmt->setUInt32(1, petitionGuid.GetCounter()); - stmt->setUInt32(2, playerGuid); + stmt->setUInt32(2, _player->GetGUID().GetCounter()); stmt->setUInt32(3, GetAccountId()); CharacterDatabase.Execute(stmt); - TC_LOG_DEBUG("network", "PETITION SIGN: %s by player: %s (GUID: %u Account: %u)", petitionGuid.ToString().c_str(), _player->GetName().c_str(), playerGuid, GetAccountId()); + TC_LOG_DEBUG("network", "PETITION SIGN: %s by player: %s (%s Account: %u)", petitionGuid.ToString().c_str(), _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), GetAccountId()); WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4)); data << petitionGuid; @@ -591,7 +590,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData) ObjectGuid petitionguid; recvData >> petitionguid; // petition guid - TC_LOG_DEBUG("network", "Petition %s declined by %u", petitionguid.ToString().c_str(), _player->GetGUIDLow()); + TC_LOG_DEBUG("network", "Petition %s declined by %s", petitionguid.ToString().c_str(), _player->GetGUID().ToString().c_str()); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID); @@ -738,7 +737,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData) if (!item) return; - TC_LOG_DEBUG("network", "Petition %s turned in by %u", petitionGuid.ToString().c_str(), _player->GetGUIDLow()); + TC_LOG_DEBUG("network", "Petition %s turned in by %s", petitionGuid.ToString().c_str(), _player->GetGUID().ToString().c_str()); // Get petition data from db uint32 ownerguidlo; @@ -758,12 +757,12 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData) } else { - 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()); + TC_LOG_ERROR("network", "Player %s (%s) tried to turn in petition (%s) that is not present in the database", _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), petitionGuid.ToString().c_str()); return; } // Only the petition owner can turn in the petition - if (_player->GetGUIDLow() != ownerguidlo) + if (_player->GetGUID().GetCounter() != ownerguidlo) return; // Petition type (guild/arena) specific checks |