diff options
Diffstat (limited to 'src/server/game/Handlers/PetHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/PetHandler.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index f3dc24a8c01..d03d57e49e0 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -35,17 +35,17 @@ void WorldSession::HandleDismissCritter(WorldPacket& recvData) { - uint64 guid; + ObjectGuid guid; recvData >> guid; - TC_LOG_DEBUG("network", "WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD, guid); + TC_LOG_DEBUG("network", "WORLD: Received CMSG_DISMISS_CRITTER for %s", guid.ToString().c_str()); Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if (!pet) { - TC_LOG_DEBUG("network", "Vanitypet (guid: %u) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", - uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow(), GetAccountId()); + TC_LOG_DEBUG("network", "Vanitypet (%s) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", + guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow(), GetAccountId()); return; } @@ -58,9 +58,9 @@ void WorldSession::HandleDismissCritter(WorldPacket& recvData) void WorldSession::HandlePetAction(WorldPacket& recvData) { - uint64 guid1; + ObjectGuid guid1; uint32 data; - uint64 guid2; + ObjectGuid guid2; float x, y, z; recvData >> guid1; //pet guid recvData >> data; @@ -74,18 +74,18 @@ void WorldSession::HandlePetAction(WorldPacket& recvData) uint8 flag = UNIT_ACTION_BUTTON_TYPE(data); //delete = 0x07 CastSpell = C1 // used also for charmed creature - Unit* pet= ObjectAccessor::GetUnit(*_player, guid1); - TC_LOG_INFO("network", "HandlePetAction: Pet %u - flag: %u, spellid: %u, target: %u.", uint32(GUID_LOPART(guid1)), uint32(flag), spellid, uint32(GUID_LOPART(guid2))); + Unit* pet = ObjectAccessor::GetUnit(*_player, guid1); + TC_LOG_INFO("network", "HandlePetAction: %s - flag: %u, spellid: %u, target: %s.", guid1.ToString().c_str(), uint32(flag), spellid, guid2.ToString().c_str()); if (!pet) { - TC_LOG_DEBUG("network", "HandlePetAction: Pet (GUID: %u) doesn't exist for player %s (GUID: %u)", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName().c_str(), GUID_LOPART(GetPlayer()->GetGUID())); + TC_LOG_DEBUG("network", "HandlePetAction: %s doesn't exist for %s %s", guid1.ToString().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str()); return; } if (pet != GetPlayer()->GetFirstControlled()) { - TC_LOG_DEBUG("network", "HandlePetAction: Pet (GUID: %u) does not belong to player %s (GUID: %u)", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName().c_str(), GUID_LOPART(GetPlayer()->GetGUID())); + TC_LOG_DEBUG("network", "HandlePetAction: %s does not belong to %s %s", guid1.ToString().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str()); return; } @@ -118,23 +118,23 @@ void WorldSession::HandlePetAction(WorldPacket& recvData) void WorldSession::HandlePetStopAttack(WorldPacket &recvData) { - uint64 guid; + ObjectGuid guid; recvData >> guid; - TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid); + TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_STOP_ATTACK for %s", guid.ToString().c_str()); Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if (!pet) { - TC_LOG_ERROR("network", "HandlePetStopAttack: Pet %u does not exist", uint32(GUID_LOPART(guid))); + TC_LOG_ERROR("network", "HandlePetStopAttack: %s does not exist", guid.ToString().c_str()); return; } if (pet != GetPlayer()->GetPet() && pet != GetPlayer()->GetCharm()) { - TC_LOG_ERROR("network", "HandlePetStopAttack: Pet GUID %u isn't a pet or charmed creature of player %s", - uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str()); + TC_LOG_ERROR("network", "HandlePetStopAttack: %s isn't a pet or charmed creature of player %s", + guid.ToString().c_str(), GetPlayer()->GetName().c_str()); return; } @@ -144,13 +144,13 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recvData) pet->AttackStop(); } -void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid, uint16 flag, uint64 guid2, float x, float y, float z) +void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spellid, uint16 flag, ObjectGuid guid2, float x, float y, float z) { CharmInfo* charmInfo = pet->GetCharmInfo(); if (!charmInfo) { - TC_LOG_DEBUG("network", "WorldSession::HandlePetAction(petGuid: " UI64FMTD ", tagGuid: " UI64FMTD ", spellId: %u, flag: %u): object (GUID: %u Entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", - guid1, guid2, spellid, flag, pet->GetGUIDLow(), pet->GetEntry(), pet->GetTypeId()); + TC_LOG_DEBUG("network", "WorldSession::HandlePetAction(petGuid: %s, tagGuid: %s, spellId: %u, flag: %u): object (GUID: %u Entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", + guid1.ToString().c_str(), guid2.ToString().c_str(), spellid, flag, pet->GetGUIDLow(), pet->GetEntry(), pet->GetTypeId()); return; } @@ -287,7 +287,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid { case REACT_PASSIVE: //passive pet->AttackStop(); - + // no break; case REACT_DEFENSIVE: //recovery case REACT_AGGRESSIVE: //activete if (pet->GetTypeId() == TYPEID_UNIT) @@ -418,7 +418,7 @@ void WorldSession::HandlePetNameQuery(WorldPacket& recvData) TC_LOG_INFO("network", "HandlePetNameQuery. CMSG_PET_NAME_QUERY"); uint32 petnumber; - uint64 petguid; + ObjectGuid petguid; recvData >> petnumber; recvData >> petguid; @@ -426,7 +426,7 @@ void WorldSession::HandlePetNameQuery(WorldPacket& recvData) SendPetNameQuery(petguid, petnumber); } -void WorldSession::SendPetNameQuery(uint64 petguid, uint32 petnumber) +void WorldSession::SendPetNameQuery(ObjectGuid petguid, uint32 petnumber) { Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, petguid); if (!pet) @@ -457,14 +457,14 @@ void WorldSession::SendPetNameQuery(uint64 petguid, uint32 petnumber) _player->GetSession()->SendPacket(&data); } -bool WorldSession::CheckStableMaster(uint64 guid) +bool WorldSession::CheckStableMaster(ObjectGuid guid) { // spell case or GM if (guid == GetPlayer()->GetGUID()) { if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE)) { - TC_LOG_DEBUG("network", "Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid)); + TC_LOG_DEBUG("network", "%s attempt open stable in cheating way.", guid.ToString().c_str()); return false; } } @@ -473,7 +473,7 @@ bool WorldSession::CheckStableMaster(uint64 guid) { if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER)) { - TC_LOG_DEBUG("network", "Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid)); + TC_LOG_DEBUG("network", "Stablemaster %s not found or you can't interact with him.", guid.ToString().c_str()); return false; } } @@ -484,7 +484,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData) { TC_LOG_INFO("network", "HandlePetSetAction. CMSG_PET_SET_ACTION"); - uint64 petguid; + ObjectGuid petguid; uint8 count; recvData >> petguid; @@ -493,7 +493,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData) if (!pet || pet != _player->GetFirstControlled()) { - TC_LOG_ERROR("network", "HandlePetSetAction: Unknown pet (GUID: %u) or pet owner (GUID: %u)", GUID_LOPART(petguid), _player->GetGUIDLow()); + TC_LOG_ERROR("network", "HandlePetSetAction: Unknown %s or owner (%s)", petguid.ToString().c_str(), _player->GetGUID().ToString().c_str()); return; } @@ -601,7 +601,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData) { TC_LOG_INFO("network", "HandlePetRename. CMSG_PET_RENAME"); - uint64 petguid; + ObjectGuid petguid; uint8 isdeclined; std::string name; @@ -667,7 +667,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData) stmt->setUInt32(0, _player->GetGUIDLow()); for (uint8 i = 0; i < 5; i++) - stmt->setString(i+1, declinedname.name[i]); + stmt->setString(i + 1, declinedname.name[i]); trans->Append(stmt); } @@ -685,9 +685,9 @@ void WorldSession::HandlePetRename(WorldPacket& recvData) void WorldSession::HandlePetAbandon(WorldPacket& recvData) { - uint64 guid; + ObjectGuid guid; recvData >> guid; //pet guid - TC_LOG_INFO("network", "HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid)); + TC_LOG_INFO("network", "HandlePetAbandon. CMSG_PET_ABANDON %s", guid.ToString().c_str()); if (!_player->IsInWorld()) return; @@ -706,7 +706,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recvData) void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) { TC_LOG_INFO("network", "CMSG_PET_SPELL_AUTOCAST"); - uint64 guid; + ObjectGuid guid; uint32 spellid; uint8 state; //1 for on, 0 for off recvPacket >> guid >> spellid >> state; @@ -721,7 +721,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) if (!pet || (pet != _player->GetGuardianPet() && pet != _player->GetCharm())) { - TC_LOG_ERROR("network", "HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s (GUID: %u).", uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str(), GUID_LOPART(GetPlayer()->GetGUID())); + TC_LOG_ERROR("network", "HandlePetSpellAutocastOpcode. %s isn't pet of player %s (%s).", guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); return; } @@ -755,14 +755,14 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) { TC_LOG_DEBUG("network", "WORLD: CMSG_PET_CAST_SPELL"); - uint64 guid; + ObjectGuid guid; uint8 castCount; uint32 spellId; uint8 castFlags; recvPacket >> guid >> castCount >> spellId >> castFlags; - TC_LOG_DEBUG("network", "WORLD: CMSG_PET_CAST_SPELL, guid: " UI64FMTD ", castCount: %u, spellId %u, castFlags %u", guid, castCount, spellId, castFlags); + TC_LOG_DEBUG("network", "WORLD: CMSG_PET_CAST_SPELL, %s, castCount: %u, spellId %u, castFlags %u", guid.ToString().c_str(), castCount, spellId, castFlags); // This opcode is also sent from charmed and possessed units (players and creatures) if (!_player->GetGuardianPet() && !_player->GetCharm()) @@ -772,7 +772,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) if (!caster || (caster != _player->GetGuardianPet() && caster != _player->GetCharm())) { - TC_LOG_ERROR("network", "HandlePetCastSpellOpcode: Pet %u isn't pet of player %s (GUID: %u).", uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str(), GUID_LOPART(GetPlayer()->GetGUID())); + TC_LOG_ERROR("network", "HandlePetCastSpellOpcode: %s isn't pet of player %s (%s).", guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); return; } @@ -854,7 +854,7 @@ void WorldSession::HandlePetLearnTalent(WorldPacket& recvData) { TC_LOG_DEBUG("network", "WORLD: CMSG_PET_LEARN_TALENT"); - uint64 guid; + ObjectGuid guid; uint32 talentId, requestedRank; recvData >> guid >> talentId >> requestedRank; @@ -866,7 +866,7 @@ void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket& recvData) { TC_LOG_DEBUG("network", "CMSG_LEARN_PREVIEW_TALENTS_PET"); - uint64 guid; + ObjectGuid guid; recvData >> guid; uint32 talentsCount; |