diff options
| author | Carbenium <carbenium@outlook.com> | 2015-09-23 20:21:20 +0200 |
|---|---|---|
| committer | Carbenium <carbenium@outlook.com> | 2015-09-23 20:21:20 +0200 |
| commit | ff31a1d9eddccca5f8077bb35cd5a7f7740f467d (patch) | |
| tree | 93a1bc20a25da58e73f356c8dfa14b4b07154748 /src/server/game/Handlers | |
| parent | d476e0eff24af5849bbbc21128aa461a24d4fe9b (diff) | |
| parent | dcb7082277447c21b11c4a1d59f105fa342c172e (diff) | |
Merge pull request #15313 from pete318/map_local_guid_335
[3.3.5/Core/Map] map local guids 6.x -> 3.3.5
Diffstat (limited to 'src/server/game/Handlers')
23 files changed, 143 insertions, 141 deletions
diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index ead05033a35..5616eb89b07 100644 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -125,7 +125,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket& recvData) } // OK result but don't send invite - if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow())) + if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUID().GetCounter())) return; if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam()) diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 8ee14d6baa9..aa51b19a659 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -149,7 +149,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) if (bid > MAX_MONEY_AMOUNT || buyout > MAX_MONEY_AMOUNT) { - TC_LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Player %s (GUID %u) attempted to sell item with higher price than max gold amount.", _player->GetName().c_str(), _player->GetGUIDLow()); + TC_LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Player %s (GUID %u) attempted to sell item with higher price than max gold amount.", _player->GetName().c_str(), _player->GetGUID().GetCounter()); SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); return; } @@ -202,7 +202,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) if (itemEntry == 0) itemEntry = item->GetTemplate()->ItemId; - if (sAuctionMgr->GetAItem(item->GetGUIDLow()) || !item->CanBeTraded() || item->IsNotEmptyBag() || + if (sAuctionMgr->GetAItem(item->GetGUID().GetCounter()) || !item->CanBeTraded() || item->IsNotEmptyBag() || item->GetTemplate()->Flags & ITEM_PROTO_FLAG_CONJURED || item->GetUInt32Value(ITEM_FIELD_DURATION) || item->GetCount() < count[i] || itemEntry != item->GetTemplate()->ItemId) { @@ -273,10 +273,10 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) } AH->Id = sObjectMgr->GenerateAuctionID(); - AH->itemGUIDLow = item->GetGUIDLow(); + AH->itemGUIDLow = item->GetGUID().GetCounter(); AH->itemEntry = item->GetEntry(); AH->itemCount = item->GetCount(); - AH->owner = _player->GetGUIDLow(); + AH->owner = _player->GetGUID().GetCounter(); AH->startbid = bid; AH->bidder = 0; AH->bid = 0; @@ -286,7 +286,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) AH->auctionHouseEntry = auctionHouseEntry; TC_LOG_INFO("network", "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", - _player->GetName().c_str(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); + _player->GetName().c_str(), _player->GetGUID().GetCounter(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUID().GetCounter(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); sAuctionMgr->AddAItem(item); auctionHouse->AddAuction(AH); @@ -321,10 +321,10 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) } AH->Id = sObjectMgr->GenerateAuctionID(); - AH->itemGUIDLow = newItem->GetGUIDLow(); + AH->itemGUIDLow = newItem->GetGUID().GetCounter(); AH->itemEntry = newItem->GetEntry(); AH->itemCount = newItem->GetCount(); - AH->owner = _player->GetGUIDLow(); + AH->owner = _player->GetGUID().GetCounter(); AH->startbid = bid; AH->bidder = 0; AH->bid = 0; @@ -334,7 +334,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) AH->auctionHouseEntry = auctionHouseEntry; TC_LOG_INFO("network", "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", - _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); + _player->GetName().c_str(), _player->GetGUID().GetCounter(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUID().GetCounter(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); sAuctionMgr->AddAItem(newItem); auctionHouse->AddAuction(AH); @@ -410,7 +410,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) AuctionEntry* auction = auctionHouse->GetAuction(auctionId); Player* player = GetPlayer(); - if (!auction || auction->owner == player->GetGUIDLow()) + if (!auction || auction->owner == player->GetGUID().GetCounter()) { //you cannot bid your own auction: SendAuctionCommandResult(0, AUCTION_PLACE_BID, ERR_AUCTION_BID_OWN); @@ -418,7 +418,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) } // impossible have online own another character (use this for speedup check in case online owner) - ObjectGuid ownerGuid(HIGHGUID_PLAYER, auction->owner); + ObjectGuid ownerGuid(HighGuid::Player, auction->owner); Player* auction_owner = ObjectAccessor::FindPlayer(ownerGuid); if (!auction_owner && sObjectMgr->GetPlayerAccountIdByGUID(ownerGuid) == player->GetSession()->GetAccountId()) { @@ -452,7 +452,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) { if (auction->bidder > 0) { - if (auction->bidder == player->GetGUIDLow()) + if (auction->bidder == player->GetGUID().GetCounter()) player->ModifyMoney(-int32(price - auction->bid)); else { @@ -464,7 +464,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) else player->ModifyMoney(-int32(price)); - auction->bidder = player->GetGUIDLow(); + auction->bidder = player->GetGUID().GetCounter(); auction->bid = price; GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price); @@ -479,7 +479,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) else { //buyout: - if (player->GetGUIDLow() == auction->bidder) + if (player->GetGUID().GetCounter() == auction->bidder) player->ModifyMoney(-int32(auction->buyout - auction->bid)); else { @@ -487,7 +487,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) if (auction->bidder) //buyout for bidded auction .. sAuctionMgr->SendAuctionOutbiddedMail(auction, auction->buyout, GetPlayer(), trans); } - auction->bidder = player->GetGUIDLow(); + auction->bidder = player->GetGUID().GetCounter(); auction->bid = auction->buyout; GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout); @@ -535,7 +535,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData) Player* player = GetPlayer(); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - if (auction && auction->owner == player->GetGUIDLow()) + if (auction && auction->owner == player->GetGUID().GetCounter()) { Item* pItem = sAuctionMgr->GetAItem(auction->itemGUIDLow); if (pItem) @@ -566,7 +566,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData) { SendAuctionCommandResult(0, AUCTION_CANCEL, ERR_AUCTION_DATABASE_ERROR); //this code isn't possible ... maybe there should be assert - TC_LOG_ERROR("network", "CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is NULL", player->GetGUIDLow(), auctionId); + TC_LOG_ERROR("network", "CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is NULL", player->GetGUID().GetCounter(), auctionId); return; } diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 2ec89ac2a26..fec0b8e0d40 100644 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -86,7 +86,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData) if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) { - TC_LOG_ERROR("network", "Battleground: invalid bgtype (%u) received. possible cheater? player guid %u", bgTypeId_, _player->GetGUIDLow()); + TC_LOG_ERROR("network", "Battleground: invalid bgtype (%u) received. possible cheater? player guid %u", bgTypeId_, _player->GetGUID().GetCounter()); return; } @@ -194,7 +194,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType, 0); SendPacket(&data); TC_LOG_DEBUG("bg.battleground", "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", - bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName().c_str()); + bgQueueTypeId, bgTypeId, _player->GetGUID().GetCounter(), _player->GetName().c_str()); } else { @@ -242,7 +242,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData) sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); TC_LOG_DEBUG("bg.battleground", "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", - bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName().c_str()); + bgQueueTypeId, bgTypeId, member->GetGUID().GetCounter(), member->GetName().c_str()); } TC_LOG_DEBUG("bg.battleground", "Battleground: group end"); } @@ -335,7 +335,7 @@ void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recvData) BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId); if (!bl) { - TC_LOG_DEBUG("bg.battleground", "BattlegroundHandler: invalid bgtype (%u) with player (Name: %s, GUID: %u) received.", bgTypeId, _player->GetName().c_str(), _player->GetGUIDLow()); + TC_LOG_DEBUG("bg.battleground", "BattlegroundHandler: invalid bgtype (%u) with player (Name: %s, GUID: %u) received.", bgTypeId, _player->GetName().c_str(), _player->GetGUID().GetCounter()); return; } @@ -424,13 +424,13 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data2, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data2); action = 0; - TC_LOG_DEBUG("bg.battleground", "Player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName().c_str(), _player->GetGUIDLow()); + TC_LOG_DEBUG("bg.battleground", "Player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName().c_str(), _player->GetGUID().GetCounter()); } //if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue if (_player->getLevel() > bg->GetMaxLevel()) { TC_LOG_ERROR("network", "Player %s (%u) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!", - _player->GetName().c_str(), _player->GetGUIDLow(), _player->getLevel(), bg->GetMaxLevel(), bg->GetTypeID()); + _player->GetName().c_str(), _player->GetGUID().GetCounter(), _player->getLevel(), bg->GetMaxLevel(), bg->GetTypeID()); action = 0; } } @@ -480,7 +480,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) sBattlegroundMgr->SendToBattleground(_player, ginfo.IsInvitedToBGInstanceGUID, bgTypeId); // add only in HandleMoveWorldPortAck() // bg->AddPlayer(_player, team); - TC_LOG_DEBUG("bg.battleground", "Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName().c_str(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId); + TC_LOG_DEBUG("bg.battleground", "Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName().c_str(), _player->GetGUID().GetCounter(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId); } else // leave queue { @@ -505,7 +505,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) if (!ginfo.ArenaType) sBattlegroundMgr->ScheduleQueueUpdate(ginfo.ArenaMatchmakerRating, ginfo.ArenaType, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); SendPacket(&data); - TC_LOG_DEBUG("bg.battleground", "Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName().c_str(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId); + TC_LOG_DEBUG("bg.battleground", "Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName().c_str(), _player->GetGUID().GetCounter(), bg->GetTypeID(), bgQueueTypeId); } } @@ -741,7 +741,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData) member->GetSession()->SendPacket(&data); sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); - TC_LOG_DEBUG("bg.battleground", "Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName().c_str()); + TC_LOG_DEBUG("bg.battleground", "Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUID().GetCounter(), member->GetName().c_str()); } } else @@ -754,7 +754,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData) // send status packet (in queue) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype, 0); SendPacket(&data); - TC_LOG_DEBUG("bg.battleground", "Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName().c_str()); + TC_LOG_DEBUG("bg.battleground", "Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUID().GetCounter(), _player->GetName().c_str()); } sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 0cd170dfba7..e9b3bea5991 100644 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -447,7 +447,7 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recvData) if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) { Field* fields = result->Fetch(); - inviteeGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()); + inviteeGuid = ObjectGuid(HighGuid::Player, fields[0].GetUInt32()); inviteeTeam = Player::TeamForRace(fields[1].GetUInt8()); inviteeGuildId = Player::GetGuildIdFromDB(inviteeGuid); } diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index b6e8d3c3ede..61b2837dc10 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -219,7 +219,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result) { do { - ObjectGuid guid(HIGHGUID_PLAYER, (*result)[0].GetUInt32()); + ObjectGuid guid(HighGuid::Player, (*result)[0].GetUInt32()); TC_LOG_INFO("network", "Loading %s from account %u.", guid.ToString().c_str(), GetAccountId()); if (Player::BuildEnumData(result, &data)) { @@ -601,7 +601,8 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte Player newChar(this); newChar.GetMotionMaster()->Initialize(); - if (!newChar.Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PLAYER), createInfo)) + if (!newChar.Create(sObjectMgr->GetGenerator<HighGuid::Player>().Generate(), createInfo)) + { // Player not create (race/class/etc problem?) newChar.CleanupsBeforeDelete(); @@ -638,7 +639,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte SendCharCreate(CHAR_CREATE_SUCCESS); - TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow()); + TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), createInfo->Name.c_str(), newChar.GetGUID().GetCounter()); sScriptMgr->OnPlayerCreate(&newChar); sWorld->AddCharacterNameData(newChar.GetGUID(), newChar.GetName(), newChar.getGender(), newChar.getRace(), newChar.getClass(), newChar.getLevel()); @@ -832,7 +833,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) TC_LOG_DEBUG("network", "WORLD: Sent server info"); } - //QueryResult* result = CharacterDatabase.PQuery("SELECT guildid, rank FROM guild_member WHERE guid = '%u'", pCurrChar->GetGUIDLow()); + //QueryResult* result = CharacterDatabase.PQuery("SELECT guildid, rank FROM guild_member WHERE guid = '%u'", pCurrChar->GetGUID().GetCounter()); if (PreparedQueryResult resultGuild = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_GUILD)) { Field* fields = resultGuild->Fetch(); @@ -852,7 +853,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) else { // remove wrong guild data - TC_LOG_ERROR("network", "Player %s (GUID: %u) marked as member of not existing guild (id: %u), removing guild membership for player.", pCurrChar->GetName().c_str(), pCurrChar->GetGUIDLow(), pCurrChar->GetGuildId()); + TC_LOG_ERROR("network", "Player %s (GUID: %u) marked as member of not existing guild (id: %u), removing guild membership for player.", pCurrChar->GetName().c_str(), pCurrChar->GetGUID().GetCounter(), pCurrChar->GetGuildId()); pCurrChar->SetInGuild(0); } } @@ -898,7 +899,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ONLINE); - stmt->setUInt32(0, pCurrChar->GetGUIDLow()); + stmt->setUInt32(0, pCurrChar->GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); @@ -919,7 +920,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) } // friend status - sSocialMgr->SendFriendStatus(pCurrChar, FRIEND_ONLINE, pCurrChar->GetGUIDLow(), true); + sSocialMgr->SendFriendStatus(pCurrChar, FRIEND_ONLINE, pCurrChar->GetGUID().GetCounter(), true); // Place character in world (and load zone) before some object loading pCurrChar->LoadCorpse(); @@ -981,7 +982,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) std::string IP_str = GetRemoteAddress(); TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s) Login Character:[%s] (GUID: %u) Level: %d", - GetAccountId(), IP_str.c_str(), pCurrChar->GetName().c_str(), pCurrChar->GetGUIDLow(), pCurrChar->getLevel()); + GetAccountId(), IP_str.c_str(), pCurrChar->GetName().c_str(), pCurrChar->GetGUID().GetCounter(), pCurrChar->getLevel()); if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED)) pCurrChar->SetStandState(UNIT_STAND_STATE_STAND); diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 2acbaba1f67..e13b417215b 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -115,7 +115,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) break; default: TC_LOG_ERROR("network", "Player %s (GUID: %u) sent a chatmessage with an invalid language/message type combination", - GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); + GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().GetCounter()); recvData.rfinish(); return; @@ -226,7 +226,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && !ChatHandler(this).isValidChatMessage(msg.c_str())) { TC_LOG_ERROR("network", "Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName().c_str(), - GetPlayer()->GetGUIDLow(), msg.c_str()); + GetPlayer()->GetGUID().GetCounter(), msg.c_str()); if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK)) KickPlayer(); diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp index ac33880cb98..78aeaa1b41b 100644 --- a/src/server/game/Handlers/CombatHandler.cpp +++ b/src/server/game/Handlers/CombatHandler.cpp @@ -75,7 +75,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket& recvData) uint32 sheathed; recvData >> sheathed; - //TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed); + //TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUID().GetCounter(), sheathed); if (sheathed >= MAX_SHEATH_STATE) { diff --git a/src/server/game/Handlers/DuelHandler.cpp b/src/server/game/Handlers/DuelHandler.cpp index 954fb66a9db..2f39a91afbe 100644 --- a/src/server/game/Handlers/DuelHandler.cpp +++ b/src/server/game/Handlers/DuelHandler.cpp @@ -40,8 +40,8 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) return; //TC_LOG_DEBUG("network", "WORLD: Received CMSG_DUEL_ACCEPTED"); - TC_LOG_DEBUG("network", "Player 1 is: %u (%s)", player->GetGUIDLow(), player->GetName().c_str()); - TC_LOG_DEBUG("network", "Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName().c_str()); + TC_LOG_DEBUG("network", "Player 1 is: %u (%s)", player->GetGUID().GetCounter(), player->GetName().c_str()); + TC_LOG_DEBUG("network", "Player 2 is: %u (%s)", plTarget->GetGUID().GetCounter(), plTarget->GetName().c_str()); time_t now = time(NULL); player->duel->startTimer = now; diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index f8531adeb88..30764fea2a3 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -107,7 +107,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData) return; } - if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow())) + if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUID().GetCounter())) { SendPartyResult(PARTY_OP_INVITE, membername, ERR_IGNORING_YOU_S); return; @@ -210,7 +210,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData) if (group->GetLeaderGUID() == GetPlayer()->GetGUID()) { - TC_LOG_ERROR("network", "HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); + TC_LOG_ERROR("network", "HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().GetCounter()); return; } @@ -283,7 +283,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData) if (guid == GetPlayer()->GetGUID()) { TC_LOG_ERROR("network", "WorldSession::HandleGroupUninviteGuidOpcode: leader %s(%d) tried to uninvite himself from the group.", - GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); + GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().GetCounter()); return; } @@ -328,7 +328,7 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket& recvData) if (GetPlayer()->GetName() == membername) { TC_LOG_ERROR("network", "WorldSession::HandleGroupUninviteOpcode: leader %s(%d) tried to uninvite himself from the group.", - GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); + GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().GetCounter()); return; } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 672e1c69920..13987c983f7 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1157,7 +1157,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT); stmt->setUInt32(0, item->GetOwnerGUID().GetCounter()); - stmt->setUInt32(1, item->GetGUIDLow()); + stmt->setUInt32(1, item->GetGUID().GetCounter()); stmt->setUInt32(2, item->GetEntry()); stmt->setUInt32(3, item->GetUInt32Value(ITEM_FIELD_FLAGS)); trans->Append(stmt); diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 18ad2e828f0..9876e939395 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -110,7 +110,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) switch (guid.GetHigh()) { - case HIGHGUID_GAMEOBJECT: + case HighGuid::GameObject: { GameObject* go = GetPlayer()->GetMap()->GetGameObject(guid); @@ -120,7 +120,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) break; } - case HIGHGUID_CORPSE: // remove insignia ONLY in BG + case HighGuid::Corpse: // remove insignia ONLY in BG { Corpse* bones = ObjectAccessor::GetCorpse(*player, guid); @@ -132,7 +132,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) break; } - case HIGHGUID_ITEM: + case HighGuid::Item: { if (Item* item = player->GetItemByGuid(guid)) { @@ -141,8 +141,8 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) } break; } - case HIGHGUID_UNIT: - case HIGHGUID_VEHICLE: + case HighGuid::Unit: + case HighGuid::Vehicle: { Creature* creature = player->GetMap()->GetCreature(guid); bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING); diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index d55af4bac35..5f25f57addd 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -110,7 +110,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) { TC_LOG_INFO("network", "Player %u is sending mail to %s (GUID: not existed!) with subject %s " "and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", - player->GetGUIDLow(), receiverName.c_str(), subject.c_str(), body.c_str(), + player->GetGUID().GetCounter(), receiverName.c_str(), subject.c_str(), body.c_str(), items_count, money, COD, stationery, package); player->SendMailResult(0, MAIL_SEND, MAIL_ERR_RECIPIENT_NOT_FOUND); return; @@ -118,7 +118,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) TC_LOG_INFO("network", "Player %u is sending mail to %s (%s) with subject %s and body %s " "includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", - player->GetGUIDLow(), receiverName.c_str(), receiverGuid.ToString().c_str(), subject.c_str(), + player->GetGUID().GetCounter(), receiverName.c_str(), receiverGuid.ToString().c_str(), subject.c_str(), body.c_str(), items_count, money, COD, stationery, package); if (player->GetGUID() == receiverGuid) @@ -293,7 +293,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (log) { sLog->outCommand(GetAccountId(), "GM %s (GUID: %u) (Account: %u) mail item: %s (Entry: %u Count: %u) " - "to: %s (%s) (Account: %u)", GetPlayerName().c_str(), GetGuidLow(), GetAccountId(), + "to: %s (%s) (Account: %u)", GetPlayerName().c_str(), GetGUIDLow(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiverName.c_str(), receiverGuid.ToString().c_str(), receiverAccountId); } @@ -315,7 +315,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (log && money > 0) { sLog->outCommand(GetAccountId(), "GM %s (GUID: %u) (Account: %u) mail money: %u to: %s (%s) (Account: %u)", - GetPlayerName().c_str(), GetGuidLow(), GetAccountId(), money, receiverName.c_str(), receiverGuid.ToString().c_str(), receiverAccountId); + GetPlayerName().c_str(), GetGUIDLow(), GetAccountId(), money, receiverName.c_str(), receiverGuid.ToString().c_str(), receiverAccountId); } } @@ -499,7 +499,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData) if (m->COD > 0) //if there is COD, take COD money from player and send them to sender by mail { - ObjectGuid sender_guid(HIGHGUID_PLAYER, m->sender); + ObjectGuid sender_guid(HighGuid::Player, m->sender); Player* receiver = ObjectAccessor::FindConnectedPlayer(sender_guid); uint32 sender_accId = 0; @@ -539,7 +539,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData) m->COD = 0; m->state = MAIL_STATE_CHANGED; player->m_mailsUpdated = true; - player->RemoveMItem(it->GetGUIDLow()); + player->RemoveMItem(it->GetGUID().GetCounter()); uint32 count = it->GetCount(); // save counts before store and possible merge with deleting it->SetState(ITEM_UNCHANGED); // need to set this state, otherwise item cannot be removed later, if neccessary @@ -649,7 +649,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData) switch ((*itr)->messageType) { case MAIL_NORMAL: // sender guid - data << ObjectGuid(HIGHGUID_PLAYER, (*itr)->sender); + data << ObjectGuid(HighGuid::Player, (*itr)->sender); break; case MAIL_CREATURE: case MAIL_GAMEOBJECT: @@ -676,7 +676,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData) // item index (0-6?) data << uint8(i); // item guid low? - data << uint32((item ? item->GetGUIDLow() : 0)); + data << uint32((item ? item->GetGUID().GetCounter() : 0)); // entry data << uint32((item ? item->GetEntry() : 0)); for (uint8 j = 0; j < MAX_INSPECTED_ENCHANTMENT_SLOT; ++j) @@ -735,7 +735,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData) } Item* bodyItem = new Item; // This is not bag and then can be used new Item. - if (!bodyItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), MAIL_BODY_ITEM_TEMPLATE, player)) + if (!bodyItem->Create(sObjectMgr->GetGenerator<HighGuid::Item>().Generate(), MAIL_BODY_ITEM_TEMPLATE, player)) { delete bodyItem; return; @@ -757,7 +757,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData) bodyItem->SetText(m->body); if (m->messageType == MAIL_NORMAL) - bodyItem->SetGuidValue(ITEM_FIELD_CREATOR, ObjectGuid(HIGHGUID_PLAYER, m->sender)); + bodyItem->SetGuidValue(ITEM_FIELD_CREATOR, ObjectGuid(HighGuid::Player, m->sender)); bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_MAIL_TEXT_MASK); @@ -812,7 +812,7 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recvData*/) if (sentSenders.count(m->sender)) continue; - data << uint64(m->messageType == MAIL_NORMAL ? ObjectGuid(HIGHGUID_PLAYER, m->sender) : ObjectGuid::Empty); // player guid + data << uint64(m->messageType == MAIL_NORMAL ? ObjectGuid(HighGuid::Player, m->sender) : ObjectGuid::Empty); // player guid data << uint32(m->messageType != MAIL_NORMAL ? m->sender : 0); // non-player entries data << uint32(m->messageType); data << uint32(m->stationery); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 7a9760ecf80..51f7e3f840a 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -66,7 +66,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recvData) if (GetPlayer()->getDeathState() == JUST_DIED) { TC_LOG_DEBUG("network", "HandleRepopRequestOpcode: got request after player %s(%d) was killed and before he was updated", - GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); + GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().GetCounter()); GetPlayer()->KillPlayer(); } @@ -564,7 +564,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(PreparedQueryResult result, std { Field* fields = result->Fetch(); - friendGuid = ObjectGuid(HIGHGUID_PLAYER, 0, fields[0].GetUInt32()); + friendGuid = ObjectGuid(HighGuid::Player, 0, fields[0].GetUInt32()); team = Player::TeamForRace(fields[1].GetUInt8()); friendAccountId = fields[2].GetUInt32(); @@ -649,7 +649,7 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(PreparedQueryResult result) if (result) { - IgnoreGuid = ObjectGuid(HIGHGUID_PLAYER, (*result)[0].GetUInt32()); + IgnoreGuid = ObjectGuid(HighGuid::Player, (*result)[0].GetUInt32()); if (IgnoreGuid) { @@ -811,7 +811,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) if (player->IsInFlight()) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", - player->GetName().c_str(), player->GetGUIDLow(), triggerId); + player->GetName().c_str(), player->GetGUID().GetCounter(), triggerId); return; } @@ -819,14 +819,14 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) if (!atEntry) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", - player->GetName().c_str(), player->GetGUIDLow(), triggerId); + player->GetName().c_str(), player->GetGUID().GetCounter(), triggerId); return; } if (!player->IsInAreaTriggerRadius(atEntry)) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far, ignore Area Trigger ID: %u", - player->GetName().c_str(), player->GetGUIDLow(), triggerId); + player->GetName().c_str(), player->GetGUID().GetCounter(), triggerId); return; } @@ -1191,7 +1191,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recvData) if (GetPlayer()->IsInFlight()) { TC_LOG_DEBUG("network", "Player '%s' (GUID: %u) in flight, ignore worldport command.", - GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); + GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().GetCounter()); return; } @@ -1335,7 +1335,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket& recvData) if (apply) { - TC_LOG_DEBUG("network", "Added FarSight %s to player %u", _player->GetGuidValue(PLAYER_FARSIGHT).ToString().c_str(), _player->GetGUIDLow()); + TC_LOG_DEBUG("network", "Added FarSight %s to player %u", _player->GetGuidValue(PLAYER_FARSIGHT).ToString().c_str(), _player->GetGUID().GetCounter()); if (WorldObject* target = _player->GetViewpoint()) _player->SetSeer(target); else @@ -1343,7 +1343,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket& recvData) } else { - TC_LOG_DEBUG("network", "Player %u set vision to self", _player->GetGUIDLow()); + TC_LOG_DEBUG("network", "Player %u set vision to self", _player->GetGUID().GetCounter()); _player->SetSeer(_player); } @@ -1411,7 +1411,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket& recvData) if (mode >= MAX_DUNGEON_DIFFICULTY) { - TC_LOG_DEBUG("network", "WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode); + TC_LOG_DEBUG("network", "WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUID().GetCounter(), mode); return; } @@ -1423,7 +1423,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket& recvData) if (map && map->IsDungeon()) { TC_LOG_DEBUG("network", "WorldSession::HandleSetDungeonDifficultyOpcode: player (Name: %s, GUID: %u) tried to reset the instance while player is inside!", - _player->GetName().c_str(), _player->GetGUIDLow()); + _player->GetName().c_str(), _player->GetGUID().GetCounter()); return; } @@ -1444,7 +1444,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket& recvData) if (groupGuy->GetMap()->IsNonRaidDungeon()) { TC_LOG_DEBUG("network", "WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", - _player->GetGUIDLow(), groupGuy->GetName().c_str(), groupGuy->GetGUIDLow()); + _player->GetGUID().GetCounter(), groupGuy->GetName().c_str(), groupGuy->GetGUID().GetCounter()); return; } } @@ -1470,7 +1470,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket& recvData) if (mode >= MAX_RAID_DIFFICULTY) { - TC_LOG_ERROR("network", "WorldSession::HandleSetRaidDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode); + TC_LOG_ERROR("network", "WorldSession::HandleSetRaidDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUID().GetCounter(), mode); return; } @@ -1478,7 +1478,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket& recvData) Map* map = _player->FindMap(); if (map && map->IsDungeon()) { - TC_LOG_DEBUG("network", "WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + TC_LOG_DEBUG("network", "WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUID().GetCounter()); return; } @@ -1501,7 +1501,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket& recvData) if (groupGuy->GetMap()->IsRaid()) { - TC_LOG_DEBUG("network", "WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + TC_LOG_DEBUG("network", "WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUID().GetCounter()); return; } } @@ -1695,7 +1695,7 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket) if (!_player->HasPendingBind()) { TC_LOG_INFO("network", "InstanceLockResponse: Player %s (guid %u) tried to bind himself/teleport to graveyard without a pending bind!", - _player->GetName().c_str(), _player->GetGUIDLow()); + _player->GetName().c_str(), _player->GetGUID().GetCounter()); return; } diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index cedfed2e7c5..518baa42e97 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -79,7 +79,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() // while the player is in transit, for example the map may get full if (!newMap || !newMap->CanEnter(GetPlayer())) { - TC_LOG_ERROR("network", "Map %d (%s) could not be created for player %d (%s), porting player to homebind", loc.GetMapId(), newMap ? newMap->GetMapName() : "Unknown", GetPlayer()->GetGUIDLow(), GetPlayer()->GetName().c_str()); + TC_LOG_ERROR("network", "Map %d (%s) could not be created for player %d (%s), porting player to homebind", loc.GetMapId(), newMap ? newMap->GetMapName() : "Unknown", GetPlayer()->GetGUID().GetCounter(), GetPlayer()->GetName().c_str()); GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation()); return; } @@ -96,7 +96,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() if (!GetPlayer()->GetMap()->AddPlayerToMap(GetPlayer())) { TC_LOG_ERROR("network", "WORLD: failed to teleport player %s (%d) to map %d (%s) because of unknown reason!", - GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow(), loc.GetMapId(), newMap ? newMap->GetMapName() : "Unknown"); + GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().GetCounter(), loc.GetMapId(), newMap ? newMap->GetMapName() : "Unknown"); GetPlayer()->ResetMap(); GetPlayer()->SetMap(oldMap); GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation()); diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 3c4bbd87b3f..14436a864f9 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -494,7 +494,7 @@ void WorldSession::SendStablePet(ObjectGuid guid) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOTS_DETAIL); - stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt32(0, _player->GetGUID().GetCounter()); stmt->setUInt8(1, PET_SAVE_FIRST_STABLE_SLOT); stmt->setUInt8(2, PET_SAVE_LAST_STABLE_SLOT); @@ -596,7 +596,7 @@ void WorldSession::HandleStablePet(WorldPacket& recvData) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOTS); - stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt32(0, _player->GetGUID().GetCounter()); stmt->setUInt8(1, PET_SAVE_FIRST_STABLE_SLOT); stmt->setUInt8(2, PET_SAVE_LAST_STABLE_SLOT); @@ -657,7 +657,7 @@ void WorldSession::HandleUnstablePet(WorldPacket& recvData) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_ENTRY); - stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt32(0, _player->GetGUID().GetCounter()); stmt->setUInt32(1, petnumber); stmt->setUInt8(2, PET_SAVE_FIRST_STABLE_SLOT); stmt->setUInt8(3, PET_SAVE_LAST_STABLE_SLOT); @@ -786,7 +786,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket& recvData) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOT_BY_ID); - stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt32(0, _player->GetGUID().GetCounter()); stmt->setUInt32(1, petId); _stableSwapCallback.SetParam(petId); diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 8ec887ea94d..4495c044c61 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -46,7 +46,7 @@ void WorldSession::HandleDismissCritter(WorldPacket& recvData) if (!pet) { 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()); + guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().GetCounter(), GetAccountId()); return; } @@ -146,7 +146,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe if (!charmInfo) { 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()); + guid1.ToString().c_str(), guid2.ToString().c_str(), spellid, flag, pet->GetGUID().GetCounter(), pet->GetEntry(), pet->GetTypeId()); return; } @@ -482,7 +482,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData) CharmInfo* charmInfo = pet->GetCharmInfo(); if (!charmInfo) { - TC_LOG_ERROR("network", "WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId()); + TC_LOG_ERROR("network", "WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().GetCounter(), pet->GetTypeId()); return; } @@ -593,7 +593,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData) recvData >> name; recvData >> isdeclined; - Pet* pet = ObjectAccessor::FindPet(petguid); + Pet* pet = ObjectAccessor::GetPet(*_player, petguid); // check it! if (!pet || !pet->IsPet() || ((Pet*)pet)->getPetType()!= HUNTER_PET || !pet->HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) || @@ -646,7 +646,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData) trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_PET_DECLINEDNAME); - stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt32(0, _player->GetGUID().GetCounter()); for (uint8 i = 0; i < 5; i++) stmt->setString(i + 1, declinedname.name[i]); @@ -656,7 +656,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_NAME); stmt->setString(0, name); - stmt->setUInt32(1, _player->GetGUIDLow()); + stmt->setUInt32(1, _player->GetGUID().GetCounter()); stmt->setUInt32(2, pet->GetCharmInfo()->GetPetNumber()); trans->Append(stmt); @@ -729,7 +729,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) CharmInfo* charmInfo = pet->GetCharmInfo(); if (!charmInfo) { - TC_LOG_ERROR("network", "WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId()); + TC_LOG_ERROR("network", "WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().GetCounter(), pet->GetTypeId()); return; } diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 05e793455da..c7a3f419d62 100644 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -191,7 +191,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); @@ -201,7 +201,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); @@ -217,7 +217,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); @@ -226,8 +226,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); @@ -253,7 +253,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 player %u %s", petitionguid.ToString().c_str(), GetPlayer()->GetGUID().GetCounter(), GetPlayer()->GetName().c_str()); return; } Field* fields = result->Fetch(); @@ -286,7 +286,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData) Field* fields2 = result->Fetch(); uint32 lowGuid = fields2[0].GetUInt32(); - data << ObjectGuid(HIGHGUID_PLAYER, 0, lowGuid); // Player GUID + data << ObjectGuid(HighGuid::Player, 0, lowGuid); // Player GUID data << uint32(0); // there 0 ... result->NextRow(); @@ -322,7 +322,7 @@ void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionguid) if (result) { Field* fields = result->Fetch(); - ownerguid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()); + ownerguid = ObjectGuid(HighGuid::Player, fields[0].GetUInt32()); name = fields[1].GetString(); type = fields[2].GetUInt8(); } @@ -461,16 +461,16 @@ 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 player %u %s", petitionGuid.ToString().c_str(), GetPlayer()->GetGUID().GetCounter(), GetPlayer()->GetName().c_str()); return; } fields = result->Fetch(); - ObjectGuid ownerGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()); + ObjectGuid ownerGuid(HighGuid::Player, fields[0].GetUInt32()); uint64 signs = fields[1].GetUInt64(); uint8 type = fields[2].GetUInt8(); - uint32 playerGuid = _player->GetGUIDLow(); + uint32 playerGuid = _player->GetGUID().GetCounter(); if (ownerGuid == _player->GetGUID()) return; @@ -585,7 +585,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 %u", petitionguid.ToString().c_str(), _player->GetGUID().GetCounter()); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID); @@ -597,7 +597,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData) return; Field* fields = result->Fetch(); - ObjectGuid ownerguid(HIGHGUID_PLAYER, 0, fields[0].GetUInt32()); + ObjectGuid ownerguid(HighGuid::Player, 0, fields[0].GetUInt32()); Player* owner = ObjectAccessor::FindConnectedPlayer(ownerguid); if (owner) // petition owner online @@ -708,7 +708,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData) for (uint8 i = 1; i <= signs; ++i) { Field* fields2 = result->Fetch(); - data << uint64(ObjectGuid(HIGHGUID_PLAYER, fields2[0].GetUInt32())); // Player GUID + data << uint64(ObjectGuid(HighGuid::Player, fields2[0].GetUInt32())); // Player GUID data << uint32(0); // there 0 ... result->NextRow(); @@ -732,7 +732,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 %u", petitionGuid.ToString().c_str(), _player->GetGUID().GetCounter()); // Get petition data from db uint32 ownerguidlo; @@ -752,12 +752,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 (guid: %u) tried to turn in petition (%s) that is not present in the database", _player->GetName().c_str(), _player->GetGUID().GetCounter(), 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 @@ -853,7 +853,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData) for (uint8 i = 0; i < signatures; ++i) { Field* fields = result->Fetch(); - guild->AddMember(ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32())); + guild->AddMember(ObjectGuid(HighGuid::Player, fields[0].GetUInt32())); result->NextRow(); } } @@ -880,7 +880,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData) for (uint8 i = 0; i < signatures; ++i) { Field* fields = result->Fetch(); - ObjectGuid memberGUID(HIGHGUID_PLAYER, fields[0].GetUInt32()); + 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(); diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index b6297e1705a..91bc8309b18 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -48,14 +48,14 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData) { case TYPEID_UNIT: { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", questGiver->GetGUIDLow()); + TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", questGiver->GetGUID().GetCounter()); if (!questGiver->ToCreature()->IsHostileTo(_player)) // do not show quest status to enemies questStatus = _player->GetQuestDialogStatus(questGiver); break; } case TYPEID_GAMEOBJECT: { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u", questGiver->GetGUIDLow()); + TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u", questGiver->GetGUID().GetCounter()); questStatus = _player->GetQuestDialogStatus(questGiver); break; } @@ -260,7 +260,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData) if (reward >= QUEST_REWARD_CHOICES_COUNT) { - TC_LOG_ERROR("network", "Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player %s (guid %d) tried to get invalid reward (%u) (possible packet-hacking detected)", _player->GetName().c_str(), _player->GetGUIDLow(), reward); + TC_LOG_ERROR("network", "Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player %s (guid %d) tried to get invalid reward (%u) (possible packet-hacking detected)", _player->GetName().c_str(), _player->GetGUID().GetCounter(), reward); return; } @@ -280,7 +280,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData) (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE && !quest->IsAutoComplete())) { TC_LOG_ERROR("network", "Error in QUEST_STATUS_COMPLETE: player %s (guid %u) tried to complete quest %u, but is not allowed to do so (possible packet-hacking or high latency)", - _player->GetName().c_str(), _player->GetGUIDLow(), questId); + _player->GetName().c_str(), _player->GetGUID().GetCounter(), questId); return; } if (_player->CanRewardQuest(quest, reward, true)) @@ -418,14 +418,14 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData) _player->RemoveActiveQuest(questId); _player->RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId); - TC_LOG_INFO("network", "Player %u abandoned quest %u", _player->GetGUIDLow(), questId); + TC_LOG_INFO("network", "Player %u abandoned quest %u", _player->GetGUID().GetCounter(), questId); if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled { // prepare Quest Tracker datas PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_ABANDON_TIME); stmt->setUInt32(0, questId); - stmt->setUInt32(1, _player->GetGUIDLow()); + stmt->setUInt32(1, _player->GetGUID().GetCounter()); // add to Quest Tracker CharacterDatabase.Execute(stmt); @@ -494,7 +494,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) if (!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) { TC_LOG_ERROR("network", "Possible hacking attempt: Player %s [guid: %u] tried to complete quest [entry: %u] without being in possession of the quest!", - _player->GetName().c_str(), _player->GetGUIDLow(), questId); + _player->GetName().c_str(), _player->GetGUID().GetCounter(), questId); return; } diff --git a/src/server/game/Handlers/ReferAFriendHandler.cpp b/src/server/game/Handlers/ReferAFriendHandler.cpp index f87198834b9..db5d0997eeb 100644 --- a/src/server/game/Handlers/ReferAFriendHandler.cpp +++ b/src/server/game/Handlers/ReferAFriendHandler.cpp @@ -27,7 +27,7 @@ void WorldSession::HandleGrantLevel(WorldPacket& recvData) ObjectGuid guid; recvData >> guid.ReadAsPacked(); - Player* target = ObjectAccessor::GetObjectInWorld(guid, _player); + Player* target = ObjectAccessor::GetPlayer(*_player, guid); // check cheating uint8 levels = _player->GetGrantableLevels(); @@ -70,7 +70,8 @@ void WorldSession::HandleAcceptGrantLevel(WorldPacket& recvData) ObjectGuid guid; recvData >> guid.ReadAsPacked(); - Player* other = ObjectAccessor::GetObjectInWorld(guid, _player); + Player* other = ObjectAccessor::GetPlayer(*_player, guid); + if (!(other && other->GetSession())) return; diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index a6108b36c13..0f0640e3a2e 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -200,7 +200,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); TC_LOG_ERROR("network", "Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!", - pUser->GetName().c_str(), pUser->GetGUIDLow(), item->GetGUIDLow(), proto->ItemId); + pUser->GetName().c_str(), pUser->GetGUID().GetCounter(), item->GetGUID().GetCounter(), proto->ItemId); return; } @@ -213,7 +213,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) if (!lockInfo) { pUser->SendEquipError(EQUIP_ERR_ITEM_LOCKED, item, NULL); - TC_LOG_ERROR("network", "WORLD::OpenItem: item [guid = %u] has an unknown lockId: %u!", item->GetGUIDLow(), lockId); + TC_LOG_ERROR("network", "WORLD::OpenItem: item [guid = %u] has an unknown lockId: %u!", item->GetGUID().GetCounter(), lockId); return; } @@ -229,7 +229,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM); - stmt->setUInt32(0, item->GetGUIDLow()); + stmt->setUInt32(0, item->GetGUID().GetCounter()); PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -246,14 +246,14 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) } else { - TC_LOG_ERROR("network", "Wrapped item %u don't have record in character_gifts table and will deleted", item->GetGUIDLow()); + TC_LOG_ERROR("network", "Wrapped item %u don't have record in character_gifts table and will deleted", item->GetGUID().GetCounter()); pUser->DestroyItem(item->GetBagSlot(), item->GetSlot(), true); return; } stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); - stmt->setUInt32(0, item->GetGUIDLow()); + stmt->setUInt32(0, item->GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); } @@ -579,7 +579,7 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData) recvData >> guid; // Get unit for which data is needed by client - Unit* unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)NULL); + Unit* unit = ObjectAccessor::GetUnit(*_player, guid); if (!unit) return; diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp index f3b421a4b93..cf6181f02b4 100644 --- a/src/server/game/Handlers/TicketHandler.cpp +++ b/src/server/game/Handlers/TicketHandler.cpp @@ -217,7 +217,7 @@ void WorldSession::HandleGMSurveySubmit(WorldPacket& recvData) recvData >> comment; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GM_SURVEY); - stmt->setUInt32(0, GetPlayer()->GetGUIDLow()); + stmt->setUInt32(0, GetPlayer()->GetGUID().GetCounter()); stmt->setUInt32(1, nextSurveyID); stmt->setUInt32(2, mainSurvey); stmt->setString(3, comment); @@ -240,7 +240,7 @@ void WorldSession::HandleReportLag(WorldPacket& recvData) recvData >> z; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_LAG_REPORT); - stmt->setUInt32(0, GetPlayer()->GetGUIDLow()); + stmt->setUInt32(0, GetPlayer()->GetGUID().GetCounter()); stmt->setUInt8 (1, lagType); stmt->setUInt16(2, mapId); stmt->setFloat (3, x); diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index c50888544de..fbfd16ae1c6 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -60,13 +60,13 @@ void WorldSession::SendTradeStatus(TradeStatusInfo const& info) void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/) { - TC_LOG_DEBUG("network", "WORLD: Ignore Trade %u", _player->GetGUIDLow()); + TC_LOG_DEBUG("network", "WORLD: Ignore Trade %u", _player->GetGUID().GetCounter()); // recvPacket.print_storage(); } void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/) { - TC_LOG_DEBUG("network", "WORLD: Busy Trade %u", _player->GetGUIDLow()); + TC_LOG_DEBUG("network", "WORLD: Busy Trade %u", _player->GetGUID().GetCounter()); // recvPacket.print_storage(); } @@ -141,7 +141,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (myItems[i]) { // logging - TC_LOG_DEBUG("network", "partner storing: %u", myItems[i]->GetGUIDLow()); + TC_LOG_DEBUG("network", "partner storing: %u", myItems[i]->GetGUID().GetCounter()); if (HasPermission(rbac::RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", @@ -159,7 +159,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (hisItems[i]) { // logging - TC_LOG_DEBUG("network", "player storing: %u", hisItems[i]->GetGUIDLow()); + TC_LOG_DEBUG("network", "player storing: %u", hisItems[i]->GetGUID().GetCounter()); if (HasPermission(rbac::RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", @@ -182,21 +182,21 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (myItems[i]) { if (!traderCanTrade) - TC_LOG_ERROR("network", "trader can't store item: %u", myItems[i]->GetGUIDLow()); + TC_LOG_ERROR("network", "trader can't store item: %u", myItems[i]->GetGUID().GetCounter()); if (_player->CanStoreItem(NULL_BAG, NULL_SLOT, playerDst, myItems[i], false) == EQUIP_ERR_OK) _player->MoveItemToInventory(playerDst, myItems[i], true, true); else - TC_LOG_ERROR("network", "player can't take item back: %u", myItems[i]->GetGUIDLow()); + TC_LOG_ERROR("network", "player can't take item back: %u", myItems[i]->GetGUID().GetCounter()); } // return the already removed items to the original owner if (hisItems[i]) { if (!playerCanTrade) - TC_LOG_ERROR("network", "player can't store item: %u", hisItems[i]->GetGUIDLow()); + TC_LOG_ERROR("network", "player can't store item: %u", hisItems[i]->GetGUID().GetCounter()); if (trader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, hisItems[i], false) == EQUIP_ERR_OK) trader->MoveItemToInventory(traderDst, hisItems[i], true, true); else - TC_LOG_ERROR("network", "trader can't take item back: %u", hisItems[i]->GetGUIDLow()); + TC_LOG_ERROR("network", "trader can't take item back: %u", hisItems[i]->GetGUID().GetCounter()); } } } @@ -214,7 +214,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m { if (Item* item = myTrade->GetItem(TradeSlots(i))) { - TC_LOG_DEBUG("network", "player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); + TC_LOG_DEBUG("network", "player trade item %u bag: %u slot: %u", item->GetGUID().GetCounter(), item->GetBagSlot(), item->GetSlot()); //Can return NULL myItems[i] = item; myItems[i]->SetInTrade(); @@ -222,7 +222,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m if (Item* item = hisTrade->GetItem(TradeSlots(i))) { - TC_LOG_DEBUG("network", "partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); + TC_LOG_DEBUG("network", "partner trade item %u bag: %u slot: %u", item->GetGUID().GetCounter(), item->GetBagSlot(), item->GetSlot()); hisItems[i] = item; hisItems[i]->SetInTrade(); } @@ -668,7 +668,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (pOther->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow())) + if (pOther->GetSocial()->HasIgnore(GetPlayer()->GetGUID().GetCounter())) { info.Status = TRADE_STATUS_IGNORE_YOU; SendTradeStatus(info); diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index 6328eb3e2fe..3bb2ca78931 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -63,7 +63,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recvData) { recvData.rfinish(); // prevent warnings spam TC_LOG_ERROR("network", "HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.", - recvData.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags); + recvData.GetOpcode(), GetPlayer()->GetGUID().GetCounter(), seat->m_flags); return; } @@ -176,7 +176,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data) if (seat->IsEjectable()) unit->ExitVehicle(); else - TC_LOG_ERROR("network", "Player %u attempted to eject %s from non-ejectable seat.", GetPlayer()->GetGUIDLow(), guid.ToString().c_str()); + TC_LOG_ERROR("network", "Player %u attempted to eject %s from non-ejectable seat.", GetPlayer()->GetGUID().GetCounter(), guid.ToString().c_str()); } else TC_LOG_ERROR("network", "HandleEjectPassenger: %s tried to eject invalid %s ", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str()); @@ -194,7 +194,7 @@ void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/) GetPlayer()->ExitVehicle(); else TC_LOG_ERROR("network", "Player %u tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.", - GetPlayer()->GetGUIDLow(), seat->m_ID, seat->m_flags); + GetPlayer()->GetGUID().GetCounter(), seat->m_ID, seat->m_flags); } } } |
