From a0e50ea35fca61447bf07fc45d93c98234ba59f7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 14 Sep 2014 16:14:12 +0200 Subject: Core/Entities: Use ObjectGuid class in game project --- src/server/game/Chat/Channels/Channel.cpp | 92 +++++++++++++++---------------- src/server/game/Chat/Channels/Channel.h | 70 +++++++++++------------ src/server/game/Chat/Chat.cpp | 64 ++++++++++----------- src/server/game/Chat/Chat.h | 10 ++-- 4 files changed, 118 insertions(+), 118 deletions(-) (limited to 'src/server/game/Chat') diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 3f6a40d825d..7881fb24d11 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -32,7 +32,7 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 team): _flags(0), _channelId(channelId), _Team(team), - _ownerGUID(0), + _ownerGUID(), _name(name), _password("") { @@ -80,7 +80,7 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 team): Tokenizer tokens(db_BannedList, ' '); for (Tokenizer::const_iterator i = tokens.begin(); i != tokens.end(); ++i) { - uint64 banned_guid = atol(*i); + ObjectGuid banned_guid(strtoull(*i, NULL, 10)); if (banned_guid) { TC_LOG_DEBUG("chat.system", "Channel(%s) loaded bannedStore guid:" UI64FMTD "", name.c_str(), banned_guid); @@ -110,7 +110,7 @@ void Channel::UpdateChannelInDB() const std::ostringstream banlist; BannedContainer::const_iterator iter; for (iter = bannedStore.begin(); iter != bannedStore.end(); ++iter) - banlist << (*iter) << ' '; + banlist << iter->GetRawValue() << ' '; std::string banListStr = banlist.str(); @@ -149,7 +149,7 @@ void Channel::CleanOldChannelsInDB() void Channel::JoinChannel(Player* player, std::string const& pass) { - uint64 guid = player->GetGUID(); + ObjectGuid guid = player->GetGUID(); if (IsOn(guid)) { // Do not send error message for built-in channels @@ -227,7 +227,7 @@ void Channel::JoinChannel(Player* player, std::string const& pass) void Channel::LeaveChannel(Player* player, bool send) { - uint64 guid = player->GetGUID(); + ObjectGuid guid = player->GetGUID(); if (!IsOn(guid)) { if (send) @@ -269,7 +269,7 @@ void Channel::LeaveChannel(Player* player, bool send) // If the channel owner left and there are still playersStore inside, pick a new owner if (changeowner && _ownership && !playersStore.empty()) { - uint64 newowner = playersStore.begin()->second.player; + ObjectGuid newowner = playersStore.begin()->second.player; playersStore[newowner].SetModerator(true); SetOwner(newowner); } @@ -278,7 +278,7 @@ void Channel::LeaveChannel(Player* player, bool send) void Channel::KickOrBan(Player const* player, std::string const& badname, bool ban) { - uint64 good = player->GetGUID(); + ObjectGuid good = player->GetGUID(); if (!IsOn(good)) { @@ -297,7 +297,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b } Player* bad = sObjectAccessor->FindPlayerByName(badname); - uint64 victim = bad ? bad->GetGUID() : 0; + ObjectGuid victim = bad ? bad->GetGUID() : ObjectGuid::Empty; if (!victim || !IsOn(victim)) { WorldPacket data; @@ -340,7 +340,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b if (changeowner && _ownership && !playersStore.empty()) { - uint64 newowner = good; + ObjectGuid newowner = good; playersStore[newowner].SetModerator(true); SetOwner(newowner); } @@ -348,7 +348,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b void Channel::UnBan(Player const* player, std::string const& badname) { - uint64 good = player->GetGUID(); + ObjectGuid good = player->GetGUID(); if (!IsOn(good)) { @@ -367,7 +367,7 @@ void Channel::UnBan(Player const* player, std::string const& badname) } Player* bad = sObjectAccessor->FindPlayerByName(badname); - uint64 victim = bad ? bad->GetGUID(): 0; + ObjectGuid victim = bad ? bad->GetGUID() : ObjectGuid::Empty; if (!victim || !IsBanned(victim)) { @@ -388,7 +388,7 @@ void Channel::UnBan(Player const* player, std::string const& badname) void Channel::Password(Player const* player, std::string const& pass) { - uint64 guid = player->GetGUID(); + ObjectGuid guid = player->GetGUID(); ChatHandler chat(player->GetSession()); if (!IsOn(guid)) @@ -418,7 +418,7 @@ void Channel::Password(Player const* player, std::string const& pass) void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bool set) { - uint64 guid = player->GetGUID(); + ObjectGuid guid = player->GetGUID(); if (!IsOn(guid)) { @@ -440,7 +440,7 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo return; Player* newp = sObjectAccessor->FindPlayerByName(p2n); - uint64 victim = newp ? newp->GetGUID() : 0; + ObjectGuid victim = newp ? newp->GetGUID() : ObjectGuid::Empty; if (!victim || !IsOn(victim) || (player->GetTeam() != newp->GetTeam() && @@ -469,7 +469,7 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo void Channel::SetOwner(Player const* player, std::string const& newname) { - uint64 guid = player->GetGUID(); + ObjectGuid guid = player->GetGUID(); if (!IsOn(guid)) { @@ -488,7 +488,7 @@ void Channel::SetOwner(Player const* player, std::string const& newname) } Player* newp = sObjectAccessor->FindPlayerByName(newname); - uint64 victim = newp ? newp->GetGUID() : 0; + ObjectGuid victim = newp ? newp->GetGUID() : ObjectGuid::Empty; if (!victim || !IsOn(victim) || (player->GetTeam() != newp->GetTeam() && @@ -505,7 +505,7 @@ void Channel::SetOwner(Player const* player, std::string const& newname) SetOwner(victim); } -void Channel::SendWhoOwner(uint64 guid) +void Channel::SendWhoOwner(ObjectGuid guid) { WorldPacket data; if (IsOn(guid)) @@ -517,7 +517,7 @@ void Channel::SendWhoOwner(uint64 guid) void Channel::List(Player const* player) { - uint64 guid = player->GetGUID(); + ObjectGuid guid = player->GetGUID(); if (!IsOn(guid)) { @@ -565,7 +565,7 @@ void Channel::List(Player const* player) void Channel::Announce(Player const* player) { - uint64 guid = player->GetGUID(); + ObjectGuid guid = player->GetGUID(); if (!IsOn(guid)) { @@ -595,7 +595,7 @@ void Channel::Announce(Player const* player) UpdateChannelInDB(); } -void Channel::Say(uint64 guid, std::string const& what, uint32 lang) +void Channel::Say(ObjectGuid guid, std::string const& what, uint32 lang) { if (what.empty()) return; @@ -626,12 +626,12 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang) else ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, 0, "", "", 0, false, _name); - SendToAll(&data, !playersStore[guid].IsModerator() ? guid : false); + SendToAll(&data, !playersStore[guid].IsModerator() ? guid : ObjectGuid::Empty); } void Channel::Invite(Player const* player, std::string const& newname) { - uint64 guid = player->GetGUID(); + ObjectGuid guid = player->GetGUID(); if (!IsOn(guid)) { @@ -676,7 +676,7 @@ void Channel::Invite(Player const* player, std::string const& newname) return; } - if (!newp->GetSocial()->HasIgnore(GUID_LOPART(guid))) + if (!newp->GetSocial()->HasIgnore(guid.GetCounter())) { WorldPacket data; MakeInvite(&data, guid); @@ -689,7 +689,7 @@ void Channel::Invite(Player const* player, std::string const& newname) SendToOne(&data, guid); } -void Channel::SetOwner(uint64 guid, bool exclaim) +void Channel::SetOwner(ObjectGuid guid, bool exclaim) { if (_ownerGUID) { @@ -720,15 +720,15 @@ void Channel::SetOwner(uint64 guid, bool exclaim) } } -void Channel::SendToAll(WorldPacket* data, uint64 guid) +void Channel::SendToAll(WorldPacket* data, ObjectGuid guid) { for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i) if (Player* player = ObjectAccessor::FindPlayer(i->first)) - if (!guid || !player->GetSocial()->HasIgnore(GUID_LOPART(guid))) + if (!guid || !player->GetSocial()->HasIgnore(guid.GetCounter())) player->GetSession()->SendPacket(data); } -void Channel::SendToAllButOne(WorldPacket* data, uint64 who) +void Channel::SendToAllButOne(WorldPacket* data, ObjectGuid who) { for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i) if (i->first != who) @@ -736,18 +736,18 @@ void Channel::SendToAllButOne(WorldPacket* data, uint64 who) player->GetSession()->SendPacket(data); } -void Channel::SendToOne(WorldPacket* data, uint64 who) +void Channel::SendToOne(WorldPacket* data, ObjectGuid who) { if (Player* player = ObjectAccessor::FindPlayer(who)) player->GetSession()->SendPacket(data); } -void Channel::Voice(uint64 /*guid1*/, uint64 /*guid2*/) +void Channel::Voice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/) { } -void Channel::DeVoice(uint64 /*guid1*/, uint64 /*guid2*/) +void Channel::DeVoice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/) { } @@ -759,13 +759,13 @@ void Channel::MakeNotifyPacket(WorldPacket* data, uint8 notify_type) *data << _name; } -void Channel::MakeJoined(WorldPacket* data, uint64 guid) +void Channel::MakeJoined(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_JOINED_NOTICE); *data << uint64(guid); } -void Channel::MakeLeft(WorldPacket* data, uint64 guid) +void Channel::MakeLeft(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_LEFT_NOTICE); *data << uint64(guid); @@ -801,13 +801,13 @@ void Channel::MakeNotModerator(WorldPacket* data) MakeNotifyPacket(data, CHAT_NOT_MODERATOR_NOTICE); } -void Channel::MakePasswordChanged(WorldPacket* data, uint64 guid) +void Channel::MakePasswordChanged(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_PASSWORD_CHANGED_NOTICE); *data << uint64(guid); } -void Channel::MakeOwnerChanged(WorldPacket* data, uint64 guid) +void Channel::MakeOwnerChanged(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_OWNER_CHANGED_NOTICE); *data << uint64(guid); @@ -835,7 +835,7 @@ void Channel::MakeChannelOwner(WorldPacket* data) *data << ((IsConstant() || !_ownerGUID) ? "Nobody" : name); } -void Channel::MakeModeChange(WorldPacket* data, uint64 guid, uint8 oldflags) +void Channel::MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags) { MakeNotifyPacket(data, CHAT_MODE_CHANGE_NOTICE); *data << uint64(guid); @@ -843,13 +843,13 @@ void Channel::MakeModeChange(WorldPacket* data, uint64 guid, uint8 oldflags) *data << uint8(GetPlayerFlags(guid)); } -void Channel::MakeAnnouncementsOn(WorldPacket* data, uint64 guid) +void Channel::MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_ON_NOTICE); *data << uint64(guid); } -void Channel::MakeAnnouncementsOff(WorldPacket* data, uint64 guid) +void Channel::MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_OFF_NOTICE); *data << uint64(guid); @@ -860,7 +860,7 @@ void Channel::MakeMuted(WorldPacket* data) MakeNotifyPacket(data, CHAT_MUTED_NOTICE); } -void Channel::MakePlayerKicked(WorldPacket* data, uint64 bad, uint64 good) +void Channel::MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good) { MakeNotifyPacket(data, CHAT_PLAYER_KICKED_NOTICE); *data << uint64(bad); @@ -872,14 +872,14 @@ void Channel::MakeBanned(WorldPacket* data) MakeNotifyPacket(data, CHAT_BANNED_NOTICE); } -void Channel::MakePlayerBanned(WorldPacket* data, uint64 bad, uint64 good) +void Channel::MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good) { MakeNotifyPacket(data, CHAT_PLAYER_BANNED_NOTICE); *data << uint64(bad); *data << uint64(good); } -void Channel::MakePlayerUnbanned(WorldPacket* data, uint64 bad, uint64 good) +void Channel::MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good) { MakeNotifyPacket(data, CHAT_PLAYER_UNBANNED_NOTICE); *data << uint64(bad); @@ -892,13 +892,13 @@ void Channel::MakePlayerNotBanned(WorldPacket* data, const std::string &name) *data << name; } -void Channel::MakePlayerAlreadyMember(WorldPacket* data, uint64 guid) +void Channel::MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_PLAYER_ALREADY_MEMBER_NOTICE); *data << uint64(guid); } -void Channel::MakeInvite(WorldPacket* data, uint64 guid) +void Channel::MakeInvite(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_INVITE_NOTICE); *data << uint64(guid); @@ -951,19 +951,19 @@ void Channel::MakeNotInLfg(WorldPacket* data) MakeNotifyPacket(data, CHAT_NOT_IN_LFG_NOTICE); } -void Channel::MakeVoiceOn(WorldPacket* data, uint64 guid) +void Channel::MakeVoiceOn(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_VOICE_ON_NOTICE); *data << uint64(guid); } -void Channel::MakeVoiceOff(WorldPacket* data, uint64 guid) +void Channel::MakeVoiceOff(WorldPacket* data, ObjectGuid guid) { MakeNotifyPacket(data, CHAT_VOICE_OFF_NOTICE); *data << uint64(guid); } -void Channel::JoinNotify(uint64 guid) +void Channel::JoinNotify(ObjectGuid guid) { WorldPacket data(IsConstant() ? SMSG_USERLIST_ADD : SMSG_USERLIST_UPDATE, 8 + 1 + 1 + 4 + GetName().size()); data << uint64(guid); @@ -978,7 +978,7 @@ void Channel::JoinNotify(uint64 guid) SendToAll(&data); } -void Channel::LeaveNotify(uint64 guid) +void Channel::LeaveNotify(ObjectGuid guid) { WorldPacket data(SMSG_USERLIST_REMOVE, 8 + 1 + 4 + GetName().size()); data << uint64(guid); diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h index 877c1e826c9..6489c8b47ad 100644 --- a/src/server/game/Chat/Channels/Channel.h +++ b/src/server/game/Chat/Channels/Channel.h @@ -122,7 +122,7 @@ class Channel { struct PlayerInfo { - uint64 player; + ObjectGuid player; uint8 flags; bool HasFlag(uint8 flag) const { return (flags & flag) != 0; } @@ -169,21 +169,21 @@ class Channel void UnBan(Player const* player, std::string const& badname); void Password(Player const* player, std::string const& pass); void SetMode(Player const* player, std::string const& p2n, bool mod, bool set); - void SetOwner(uint64 guid, bool exclaim = true); + void SetOwner(ObjectGuid guid, bool exclaim = true); void SetOwner(Player const* player, std::string const& name); - void SendWhoOwner(uint64 guid); + void SendWhoOwner(ObjectGuid guid); void SetModerator(Player const* player, std::string const& newname) { SetMode(player, newname, true, true); } void UnsetModerator(Player const* player, std::string const& newname) { SetMode(player, newname, true, false); } void SetMute(Player const* player, std::string const& newname) { SetMode(player, newname, false, true); } void UnsetMute(Player const* player, std::string const& newname) { SetMode(player, newname, false, false); } void List(Player const* player); void Announce(Player const* player); - void Say(uint64 guid, std::string const& what, uint32 lang); + void Say(ObjectGuid guid, std::string const& what, uint32 lang); void Invite(Player const* player, std::string const& newp); - void Voice(uint64 guid1, uint64 guid2); - void DeVoice(uint64 guid1, uint64 guid2); - void JoinNotify(uint64 guid); // invisible notify - void LeaveNotify(uint64 guid); // invisible notify + void Voice(ObjectGuid guid1, ObjectGuid guid2); + void DeVoice(ObjectGuid guid1, ObjectGuid guid2); + void JoinNotify(ObjectGuid guid); // invisible notify + void LeaveNotify(ObjectGuid guid); // invisible notify void SetOwnership(bool ownership) { _ownership = ownership; }; static void CleanOldChannelsInDB(); @@ -191,29 +191,29 @@ class Channel // initial packet data (notify type and channel name) void MakeNotifyPacket(WorldPacket* data, uint8 notify_type); // type specific packet data - void MakeJoined(WorldPacket* data, uint64 guid); //+ 0x00 - void MakeLeft(WorldPacket* data, uint64 guid); //+ 0x01 + void MakeJoined(WorldPacket* data, ObjectGuid guid); //+ 0x00 + void MakeLeft(WorldPacket* data, ObjectGuid guid); //+ 0x01 void MakeYouJoined(WorldPacket* data); //+ 0x02 void MakeYouLeft(WorldPacket* data); //+ 0x03 void MakeWrongPassword(WorldPacket* data); //? 0x04 void MakeNotMember(WorldPacket* data); //? 0x05 void MakeNotModerator(WorldPacket* data); //? 0x06 - void MakePasswordChanged(WorldPacket* data, uint64 guid); //+ 0x07 - void MakeOwnerChanged(WorldPacket* data, uint64 guid); //? 0x08 - void MakePlayerNotFound(WorldPacket* data, std::string const& name); //+ 0x09 + void MakePasswordChanged(WorldPacket* data, ObjectGuid guid); //+ 0x07 + void MakeOwnerChanged(WorldPacket* data, ObjectGuid guid); //? 0x08 + void MakePlayerNotFound(WorldPacket* data, std::string const& name); //+ 0x09 void MakeNotOwner(WorldPacket* data); //? 0x0A void MakeChannelOwner(WorldPacket* data); //? 0x0B - void MakeModeChange(WorldPacket* data, uint64 guid, uint8 oldflags); //+ 0x0C - void MakeAnnouncementsOn(WorldPacket* data, uint64 guid); //+ 0x0D - void MakeAnnouncementsOff(WorldPacket* data, uint64 guid); //+ 0x0E + void MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags);//+ 0x0C + void MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid); //+ 0x0D + void MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid); //+ 0x0E void MakeMuted(WorldPacket* data); //? 0x11 - void MakePlayerKicked(WorldPacket* data, uint64 bad, uint64 good); //? 0x12 + void MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good);//? 0x12 void MakeBanned(WorldPacket* data); //? 0x13 - void MakePlayerBanned(WorldPacket* data, uint64 bad, uint64 good); //? 0x14 - void MakePlayerUnbanned(WorldPacket* data, uint64 bad, uint64 good); //? 0x15 - void MakePlayerNotBanned(WorldPacket* data, std::string const& name); //? 0x16 - void MakePlayerAlreadyMember(WorldPacket* data, uint64 guid); //+ 0x17 - void MakeInvite(WorldPacket* data, uint64 guid); //? 0x18 + void MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good);//? 0x14 + void MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good);//? 0x15 + void MakePlayerNotBanned(WorldPacket* data, std::string const& name); //? 0x16 + void MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid); //+ 0x17 + void MakeInvite(WorldPacket* data, ObjectGuid guid); //? 0x18 void MakeInviteWrongFaction(WorldPacket* data); //? 0x19 void MakeWrongFaction(WorldPacket* data); //? 0x1A void MakeInvalidName(WorldPacket* data); //? 0x1B @@ -223,26 +223,26 @@ class Channel void MakeThrottled(WorldPacket* data); //? 0x1F void MakeNotInArea(WorldPacket* data); //? 0x20 void MakeNotInLfg(WorldPacket* data); //? 0x21 - void MakeVoiceOn(WorldPacket* data, uint64 guid); //+ 0x22 - void MakeVoiceOff(WorldPacket* data, uint64 guid); //+ 0x23 + void MakeVoiceOn(WorldPacket* data, ObjectGuid guid); //+ 0x22 + void MakeVoiceOff(WorldPacket* data, ObjectGuid guid); //+ 0x23 - void SendToAll(WorldPacket* data, uint64 guid = 0); - void SendToAllButOne(WorldPacket* data, uint64 who); - void SendToOne(WorldPacket* data, uint64 who); + void SendToAll(WorldPacket* data, ObjectGuid guid = ObjectGuid::Empty); + void SendToAllButOne(WorldPacket* data, ObjectGuid who); + void SendToOne(WorldPacket* data, ObjectGuid who); - bool IsOn(uint64 who) const { return playersStore.find(who) != playersStore.end(); } - bool IsBanned(uint64 guid) const { return bannedStore.find(guid) != bannedStore.end(); } + bool IsOn(ObjectGuid who) const { return playersStore.find(who) != playersStore.end(); } + bool IsBanned(ObjectGuid guid) const { return bannedStore.find(guid) != bannedStore.end(); } void UpdateChannelInDB() const; void UpdateChannelUseageInDB() const; - uint8 GetPlayerFlags(uint64 guid) const + uint8 GetPlayerFlags(ObjectGuid guid) const { PlayerContainer::const_iterator itr = playersStore.find(guid); return itr != playersStore.end() ? itr->second.flags : 0; } - void SetModerator(uint64 guid, bool set) + void SetModerator(ObjectGuid guid, bool set) { if (playersStore[guid].IsModerator() != set) { @@ -255,7 +255,7 @@ class Channel } } - void SetMute(uint64 guid, bool set) + void SetMute(ObjectGuid guid, bool set) { if (playersStore[guid].IsMuted() != set) { @@ -268,8 +268,8 @@ class Channel } } - typedef std::map PlayerContainer; - typedef std::set BannedContainer; + typedef std::map PlayerContainer; + typedef GuidSet BannedContainer; bool _announce; bool _ownership; @@ -277,7 +277,7 @@ class Channel uint8 _flags; uint32 _channelId; uint32 _Team; - uint64 _ownerGUID; + ObjectGuid _ownerGUID; std::string _name; std::string _password; PlayerContainer playersStore; diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 265197e9c3b..a50cf00ad9e 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -125,7 +125,7 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const return HasPermission(cmd.Permission); } -bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong) +bool ChatHandler::HasLowerSecurity(Player* target, ObjectGuid guid, bool strong) { WorldSession* target_session = NULL; uint32 target_account = 0; @@ -345,7 +345,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, st Player* player = m_session->GetPlayer(); if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity())) { - uint64 guid = player->GetTarget(); + ObjectGuid guid = player->GetTarget(); uint32 areaId = player->GetAreaId(); std::string areaName = "Unknown"; std::string zoneName = "Unknown"; @@ -357,14 +357,14 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, st zoneName = zone->area_name[locale]; } - sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (Guid: %u) (Account: %u) X: %f Y: %f Z: %f Map: %u (%s) Area: %u (%s) Zone: %s Selected %s: %s (GUID: %u)]", - fullcmd.c_str(), player->GetName().c_str(), GUID_LOPART(player->GetGUID()), + sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (%s) (Account: %u) X: %f Y: %f Z: %f Map: %u (%s) Area: %u (%s) Zone: %s Selected: %s (%s)]", + fullcmd.c_str(), player->GetName().c_str(), player->GetGUID().ToString().c_str(), m_session->GetAccountId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetMap() ? player->GetMap()->GetMapName() : "Unknown", - areaId, areaName.c_str(), zoneName.c_str(), GetLogNameForGuid(guid), + areaId, areaName.c_str(), zoneName.c_str(), (player->GetSelectedUnit()) ? player->GetSelectedUnit()->GetName().c_str() : "", - GUID_LOPART(guid)); + guid.ToString().c_str()); } } // some commands have custom error messages. Don't send the default one in these cases. @@ -629,7 +629,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd) return ShowHelpForSubCommands(table, "", cmd); } -size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, uint64 senderGUID, uint64 receiverGUID, std::string const& message, uint8 chatTag, +size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string const& message, uint8 chatTag, std::string const& senderName /*= ""*/, std::string const& receiverName /*= ""*/, uint32 achievementId /*= 0*/, bool gmMessage /*= false*/, std::string const& channelName /*= ""*/) { @@ -653,7 +653,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag data << senderName; receiverGUIDPos = data.wpos(); data << uint64(receiverGUID); - if (receiverGUID && !IS_PLAYER_GUID(receiverGUID) && !IS_PET_GUID(receiverGUID)) + if (receiverGUID && !receiverGUID.IsPlayer() && !receiverGUID.IsPet()) { data << uint32(receiverName.length() + 1); data << receiverName; @@ -670,7 +670,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag case CHAT_MSG_BG_SYSTEM_HORDE: receiverGUIDPos = data.wpos(); data << uint64(receiverGUID); - if (receiverGUID && !IS_PLAYER_GUID(receiverGUID)) + if (receiverGUID && !receiverGUID.IsPlayer()) { data << uint32(receiverName.length() + 1); data << receiverName; @@ -712,11 +712,11 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string const& message, uint32 achievementId /*= 0*/, std::string const& channelName /*= ""*/, LocaleConstant locale /*= DEFAULT_LOCALE*/) { - uint64 senderGUID = 0; + ObjectGuid senderGUID; std::string senderName = ""; uint8 chatTag = 0; bool gmMessage = false; - uint64 receiverGUID = 0; + ObjectGuid receiverGUID; std::string receiverName = ""; if (sender) { @@ -743,7 +743,7 @@ Player* ChatHandler::getSelectedPlayer() if (!m_session) return NULL; - uint64 selected = m_session->GetPlayer()->GetTarget(); + ObjectGuid selected = m_session->GetPlayer()->GetTarget(); if (!selected) return m_session->GetPlayer(); @@ -766,9 +766,9 @@ WorldObject* ChatHandler::getSelectedObject() if (!m_session) return NULL; - uint64 guid = m_session->GetPlayer()->GetTarget(); + ObjectGuid guid = m_session->GetPlayer()->GetTarget(); - if (guid == 0) + if (!guid) return GetNearbyGameObject(); return ObjectAccessor::GetUnit(*m_session->GetPlayer(), guid); @@ -787,7 +787,7 @@ Player* ChatHandler::getSelectedPlayerOrSelf() if (!m_session) return NULL; - uint64 selected = m_session->GetPlayer()->GetTarget(); + ObjectGuid selected = m_session->GetPlayer()->GetTarget(); if (!selected) return m_session->GetPlayer(); @@ -932,7 +932,7 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid Player* pl = m_session->GetPlayer(); - GameObject* obj = pl->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, entry, HIGHGUID_GAMEOBJECT)); + GameObject* obj = pl->GetMap()->GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, entry, lowguid)); if (!obj && sObjectMgr->GetGOData(lowguid)) // guid is DB guid of object { @@ -1053,7 +1053,7 @@ static char const* const guidKeys[] = nullptr }; -uint64 ChatHandler::extractGuidFromLink(char* text) +ObjectGuid ChatHandler::extractGuidFromLink(char* text) { int type = 0; @@ -1062,7 +1062,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text) // |color|Hplayer:name|h[name]|h|r char* idS = extractKeyFromLink(text, guidKeys, &type); if (!idS) - return 0; + return ObjectGuid::Empty; switch (type) { @@ -1070,38 +1070,38 @@ uint64 ChatHandler::extractGuidFromLink(char* text) { std::string name = idS; if (!normalizePlayerName(name)) - return 0; + return ObjectGuid::Empty; if (Player* player = sObjectAccessor->FindPlayerByName(name)) return player->GetGUID(); - if (uint64 guid = sObjectMgr->GetPlayerGUIDByName(name)) + if (ObjectGuid guid = sObjectMgr->GetPlayerGUIDByName(name)) return guid; - return 0; + return ObjectGuid::Empty; } case SPELL_LINK_CREATURE: { uint32 lowguid = (uint32)atol(idS); if (CreatureData const* data = sObjectMgr->GetCreatureData(lowguid)) - return MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT); + return ObjectGuid(HIGHGUID_UNIT, data->id, lowguid); else - return 0; + return ObjectGuid::Empty; } case SPELL_LINK_GAMEOBJECT: { uint32 lowguid = (uint32)atol(idS); if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid)) - return MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT); + return ObjectGuid(HIGHGUID_GAMEOBJECT, data->id, lowguid); else - return 0; + return ObjectGuid::Empty; } } // unknown type? - return 0; + return ObjectGuid::Empty; } std::string ChatHandler::extractPlayerNameFromLink(char* text) @@ -1118,7 +1118,7 @@ std::string ChatHandler::extractPlayerNameFromLink(char* text) return name; } -bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* player_guid /*=NULL*/, std::string* player_name /*= NULL*/) +bool ChatHandler::extractPlayerTarget(char* args, Player** player, ObjectGuid* player_guid /*=NULL*/, std::string* player_name /*= NULL*/) { if (args && *args) { @@ -1137,7 +1137,7 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* playe *player = pl; // if need guid value from DB (in name case for check player existence) - uint64 guid = !pl && (player_guid || player_name) ? sObjectMgr->GetPlayerGUIDByName(name) : 0; + ObjectGuid guid = !pl && (player_guid || player_name) ? sObjectMgr->GetPlayerGUIDByName(name) : ObjectGuid::Empty; // if allowed player guid (if no then only online players allowed) if (player_guid) @@ -1154,7 +1154,7 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* playe *player = pl; // if allowed player guid (if no then only online players allowed) if (player_guid) - *player_guid = pl ? pl->GetGUID() : 0; + *player_guid = pl ? pl->GetGUID() : ObjectGuid::Empty; if (player_name) *player_name = pl ? pl->GetName() : ""; @@ -1277,10 +1277,10 @@ bool CliHandler::needReportToTarget(Player* /*chr*/) const return true; } -bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player* &player, Group* &group, uint64 &guid, bool offline) +bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline) { - player = NULL; - guid = 0; + player = NULL; + guid.Clear(); if (cname) { diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index c0e3da32b3f..6ce4e01585f 100644 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -54,7 +54,7 @@ class ChatHandler virtual ~ChatHandler() { } // Builds chat packet and returns receiver guid position in the packet to substitute in whisper builders - static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, uint64 senderGUID, uint64 receiverGUID, std::string const& message, uint8 chatTag, + static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string const& message, uint8 chatTag, std::string const& senderName = "", std::string const& receiverName = "", uint32 achievementId = 0, bool gmMessage = false, std::string const& channelName = ""); @@ -89,7 +89,7 @@ class ChatHandler virtual LocaleConstant GetSessionDbcLocale() const; virtual int GetSessionDbLocaleIndex() const; - bool HasLowerSecurity(Player* target, uint64 guid, bool strong = false); + bool HasLowerSecurity(Player* target, ObjectGuid guid, bool strong = false); bool HasLowerSecurityAccount(WorldSession* target, uint32 account, bool strong = false); void SendGlobalGMSysMessage(const char *str); @@ -108,12 +108,12 @@ class ChatHandler char* extractQuotedArg(char* args); uint32 extractSpellIdFromLink(char* text); - uint64 extractGuidFromLink(char* text); + ObjectGuid extractGuidFromLink(char* text); GameTele const* extractGameTeleFromLink(char* text); - bool GetPlayerGroupAndGUIDByName(const char* cname, Player* &player, Group* &group, uint64 &guid, bool offline = false); + bool GetPlayerGroupAndGUIDByName(const char* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline = false); std::string extractPlayerNameFromLink(char* text); // select by arg (name/link) or in-game selection online/offline player or self if a creature is selected - bool extractPlayerTarget(char* args, Player** player, uint64* player_guid = NULL, std::string* player_name = NULL); + bool extractPlayerTarget(char* args, Player** player, ObjectGuid* player_guid = NULL, std::string* player_name = NULL); std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; } std::string GetNameLink(Player* chr) const; -- cgit v1.2.3 From 6c1a33d62df8a67a913171ad8000d5be1b724ce4 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 16 Sep 2014 19:47:10 +0200 Subject: Core/Scripts: Fixed incorrect guid usage in logs --- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 4 ++-- src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 2 +- src/server/game/AI/SmartScripts/SmartScript.cpp | 10 +++++----- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 2 +- src/server/game/Chat/Channels/Channel.cpp | 2 +- src/server/scripts/Commands/cs_character.cpp | 6 +++--- src/server/scripts/Commands/cs_npc.cpp | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/server/game/Chat') diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 06820b03218..cb3e480e01a 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -311,8 +311,8 @@ void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o if (Player* player = unit->ToPlayer()) player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); else - TC_LOG_ERROR("scripts", "Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", - me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o); + TC_LOG_ERROR("scripts", "Creature %s Tried to teleport non-player unit (%s) to x: %f y:%f z: %f o: %f. Aborted.", + me->GetGUID().ToString().c_str(), unit->GetGUID().ToString().c_str(), x, y, z, o); } void ScriptedAI::DoTeleportAll(float x, float y, float z, float o) diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 3fab506e3b2..6640341e589 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -319,7 +319,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - TC_LOG_DEBUG("scripts", "FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName().c_str(), m_uiLeaderGUID); + TC_LOG_DEBUG("scripts", "FollowerAI start follow %s (%s)", player->GetName().c_str(), m_uiLeaderGUID.ToString().c_str()); } Player* FollowerAI::GetLeaderForFollower() diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 1e60cde90d0..3a0d18a0d9e 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -529,7 +529,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (me ? me->GetGUID() : go->GetGUID()).GetTypeName(), me ? me->GetGUIDLow() : go->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags); } else - TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId())); + TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (%s) already has the aura", e.action.cast.spell, (*itr)->GetGUID().ToString().c_str()); } delete targets; @@ -560,7 +560,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u tempLastInvoker->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags); } else - TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId())); + TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (%s) already has the aura", e.action.cast.spell, (*itr)->GetGUID().ToString().c_str()); } delete targets; @@ -957,8 +957,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; instance->SetGuidData(e.action.setInstanceData64.field, targets->front()->GetGUID()); - TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: " UI64FMTD, - e.action.setInstanceData64.field, targets->front()->GetGUID()); + TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: %s", + e.action.setInstanceData64.field, targets->front()->GetGUID().ToString().c_str()); delete targets; break; @@ -1730,7 +1730,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u unit->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) != 0); } else - TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId())); + TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (%s) already has the aura", e.action.cast.spell, (*it)->GetGUID().ToString().c_str()); } } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 6d3671a3143..83e9377d3ca 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1385,7 +1385,7 @@ public: if (WorldObject* obj = ObjectAccessor::GetWorldObject(*m_baseObject, *itr)) m_objectList->push_back(obj); else - TC_LOG_DEBUG("scripts.ai", "SmartScript::mTargetStorage stores a guid to an invalid object: " UI64FMTD, *itr); + TC_LOG_DEBUG("scripts.ai", "SmartScript::mTargetStorage stores a guid to an invalid object: %s", itr->ToString().c_str()); } } diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 7881fb24d11..3607cc416ed 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -80,7 +80,7 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 team): Tokenizer tokens(db_BannedList, ' '); for (Tokenizer::const_iterator i = tokens.begin(); i != tokens.end(); ++i) { - ObjectGuid banned_guid(strtoull(*i, NULL, 10)); + ObjectGuid banned_guid(uint64(strtoull(*i, NULL, 10))); if (banned_guid) { TC_LOG_DEBUG("chat.system", "Channel(%s) loaded bannedStore guid:" UI64FMTD "", name.c_str(), banned_guid); diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 7cd29747606..c6769493020 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -199,7 +199,7 @@ public: { if (delInfo.accountName.empty()) // account not exist { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.guid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.guid.GetCounter(), delInfo.accountId); return; } @@ -207,13 +207,13 @@ public: uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId); if (charcount >= 10) { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.guid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.guid.GetCounter(), delInfo.accountId); return; } if (sObjectMgr->GetPlayerGUIDByName(delInfo.name)) { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.guid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.guid.GetCounter(), delInfo.accountId); return; } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index e4509189cf9..5f3f82cf1db 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -682,7 +682,7 @@ public: creature->AI()->SetData(data_1, data_2); std::string AIorScript = creature->GetAIName() != "" ? "AI type: " + creature->GetAIName() : (creature->GetScriptName() != "" ? "Script Name: " + creature->GetScriptName() : "No AI or Script Name Set"); - handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID(), creature->GetEntry(), creature->GetName().c_str(), data_1, data_2, AIorScript.c_str()); + handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID().GetCounter(), creature->GetEntry(), creature->GetName().c_str(), data_1, data_2, AIorScript.c_str()); return true; } -- cgit v1.2.3 From bee9a3069b51e7e3472096e433730d8d619eda9c Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 16 Sep 2014 19:56:33 +0200 Subject: Core/Scripts: Fixed incorrect guid usage in logs --- src/server/game/Chat/Channels/Channel.cpp | 2 +- src/server/scripts/Commands/cs_arena.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/game/Chat') diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 3607cc416ed..654ce8da2b9 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -83,7 +83,7 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 team): ObjectGuid banned_guid(uint64(strtoull(*i, NULL, 10))); if (banned_guid) { - TC_LOG_DEBUG("chat.system", "Channel(%s) loaded bannedStore guid:" UI64FMTD "", name.c_str(), banned_guid); + TC_LOG_DEBUG("chat.system", "Channel(%s) loaded bannedStore %s", name.c_str(), banned_guid.ToString().c_str()); bannedStore.insert(banned_guid); } } diff --git a/src/server/scripts/Commands/cs_arena.cpp b/src/server/scripts/Commands/cs_arena.cpp index c4bee7a1d19..4db7c088d35 100644 --- a/src/server/scripts/Commands/cs_arena.cpp +++ b/src/server/scripts/Commands/cs_arena.cpp @@ -103,7 +103,7 @@ public: } sArenaTeamMgr->AddArenaTeam(arena); - handler->PSendSysMessage(LANG_ARENA_CREATE, arena->GetName().c_str(), arena->GetId(), arena->GetType(), arena->GetCaptain()); + handler->PSendSysMessage(LANG_ARENA_CREATE, arena->GetName().c_str(), arena->GetId(), arena->GetType(), arena->GetCaptain().GetCounter()); } else { -- cgit v1.2.3 From 72ed5bfc93af016722c115ef032f7cb1c43d9983 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Thu, 18 Sep 2014 02:36:28 +0200 Subject: Core/Misc: changed trinity string id to unsigned and removed obsolete code --- src/server/game/Battlegrounds/Battleground.cpp | 27 +++----- src/server/game/Battlegrounds/Battleground.h | 10 ++- src/server/game/Chat/Chat.cpp | 10 +-- src/server/game/Chat/Chat.h | 14 ++-- src/server/game/Globals/ObjectMgr.cpp | 96 +++++--------------------- src/server/game/Globals/ObjectMgr.h | 27 ++++---- src/server/game/Miscellaneous/Language.h | 3 - src/server/game/Server/WorldSession.cpp | 2 +- src/server/game/Server/WorldSession.h | 2 +- src/server/game/World/World.cpp | 8 +-- src/server/game/World/World.h | 4 +- 11 files changed, 63 insertions(+), 140 deletions(-) (limited to 'src/server/game/Chat') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 88c0035d21d..90a84774a81 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -41,7 +41,7 @@ namespace Trinity class BattlegroundChatBuilder { public: - BattlegroundChatBuilder(ChatMsg msgtype, int32 textId, Player const* source, va_list* args = NULL) + BattlegroundChatBuilder(ChatMsg msgtype, uint32 textId, Player const* source, va_list* args = NULL) : _msgtype(msgtype), _textId(textId), _source(source), _args(args) { } void operator()(WorldPacket& data, LocaleConstant loc_idx) @@ -70,7 +70,7 @@ namespace Trinity } ChatMsg _msgtype; - int32 _textId; + uint32 _textId; Player const* _source; va_list* _args; }; @@ -78,7 +78,7 @@ namespace Trinity class Battleground2ChatBuilder { public: - Battleground2ChatBuilder(ChatMsg msgtype, int32 textId, Player const* source, int32 arg1, int32 arg2) + Battleground2ChatBuilder(ChatMsg msgtype, uint32 textId, Player const* source, uint32 arg1, uint32 arg2) : _msgtype(msgtype), _textId(textId), _source(source), _arg1(arg1), _arg2(arg2) { } void operator()(WorldPacket& data, LocaleConstant loc_idx) @@ -95,10 +95,10 @@ namespace Trinity private: ChatMsg _msgtype; - int32 _textId; + uint32 _textId; Player const* _source; - int32 _arg1; - int32 _arg2; + uint32 _arg1; + uint32 _arg2; }; } // namespace Trinity @@ -1561,7 +1561,7 @@ bool Battleground::AddSpiritGuide(uint32 type, Position const& pos, TeamId teamI return AddSpiritGuide(type, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teamId); } -void Battleground::SendMessageToAll(int32 entry, ChatMsg type, Player const* source) +void Battleground::SendMessageToAll(uint32 entry, ChatMsg type, Player const* source) { if (!entry) return; @@ -1571,7 +1571,7 @@ void Battleground::SendMessageToAll(int32 entry, ChatMsg type, Player const* sou BroadcastWorker(bg_do); } -void Battleground::PSendMessageToAll(int32 entry, ChatMsg type, Player const* source, ...) +void Battleground::PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...) { if (!entry) return; @@ -1586,7 +1586,7 @@ void Battleground::PSendMessageToAll(int32 entry, ChatMsg type, Player const* so va_end(ap); } -void Battleground::SendWarningToAll(int32 entry, ...) +void Battleground::SendWarningToAll(uint32 entry, ...) { if (!entry) return; @@ -1612,7 +1612,7 @@ void Battleground::SendWarningToAll(int32 entry, ...) } } -void Battleground::SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 arg1, int32 arg2) +void Battleground::SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 arg1, uint32 arg2) { Trinity::Battleground2ChatBuilder bg_builder(type, entry, source, arg1, arg2); Trinity::LocalizedPacketDo bg_do(bg_builder); @@ -1626,13 +1626,6 @@ void Battleground::EndNow() SetEndTime(0); } -// To be removed -char const* Battleground::GetTrinityString(int32 entry) -{ - // FIXME: now we have different DBC locales and need localized message for each target client - return sObjectMgr->GetTrinityStringForDBCLocale(entry); -} - // IMPORTANT NOTICE: // buffs aren't spawned/despawned when players captures anything // buffs are in their positions when battleground starts diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index ab411e3cfc6..001c33cba40 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -360,12 +360,12 @@ class Battleground virtual void EndBattleground(uint32 winner); void BlockMovement(Player* player); - void SendWarningToAll(int32 entry, ...); - void SendMessageToAll(int32 entry, ChatMsg type, Player const* source = NULL); - void PSendMessageToAll(int32 entry, ChatMsg type, Player const* source, ...); + void SendWarningToAll(uint32 entry, ...); + void SendMessageToAll(uint32 entry, ChatMsg type, Player const* source = NULL); + void PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...); // specialized version with 2 string id args - void SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 strId1 = 0, int32 strId2 = 0); + void SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 strId1 = 0, uint32 strId2 = 0); // Raid Group Group* GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[TEAM_ALLIANCE] : m_BgRaids[TEAM_HORDE]; } @@ -442,8 +442,6 @@ class Battleground void DoorOpen(uint32 type); void DoorClose(uint32 type); - //to be removed - const char* GetTrinityString(int32 entry); virtual bool HandlePlayerUnderMap(Player* /*player*/) { return false; } diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index a50cf00ad9e..4099b3ac3fd 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -104,7 +104,7 @@ ChatCommand* ChatHandler::getCommandTable() return commandTableCache; } -std::string ChatHandler::PGetParseString(int32 entry, ...) const +std::string ChatHandler::PGetParseString(uint32 entry, ...) const { const char *format = GetTrinityString(entry); char str[1024]; @@ -115,7 +115,7 @@ std::string ChatHandler::PGetParseString(int32 entry, ...) const return std::string(str); } -const char *ChatHandler::GetTrinityString(int32 entry) const +char const* ChatHandler::GetTrinityString(uint32 entry) const { return m_session->GetTrinityString(entry); } @@ -253,12 +253,12 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str) free(buf); } -void ChatHandler::SendSysMessage(int32 entry) +void ChatHandler::SendSysMessage(uint32 entry) { SendSysMessage(GetTrinityString(entry)); } -void ChatHandler::PSendSysMessage(int32 entry, ...) +void ChatHandler::PSendSysMessage(uint32 entry, ...) { const char *format = GetTrinityString(entry); va_list ap; @@ -1250,7 +1250,7 @@ std::string ChatHandler::GetNameLink(Player* chr) const return playerLink(chr->GetName()); } -const char *CliHandler::GetTrinityString(int32 entry) const +char const* CliHandler::GetTrinityString(uint32 entry) const { return sObjectMgr->GetTrinityStringForDBCLocale(entry); } diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 6ce4e01585f..9e7dcc88c95 100644 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -64,13 +64,13 @@ class ChatHandler static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = NULL; return start; } // function with different implementation for chat/console - virtual const char *GetTrinityString(int32 entry) const; - virtual void SendSysMessage(const char *str); + virtual char const* GetTrinityString(uint32 entry) const; + virtual void SendSysMessage(char const* str); - void SendSysMessage(int32 entry); - void PSendSysMessage(const char *format, ...) ATTR_PRINTF(2, 3); - void PSendSysMessage(int32 entry, ...); - std::string PGetParseString(int32 entry, ...) const; + void SendSysMessage(uint32 entry); + void PSendSysMessage(char const* format, ...) ATTR_PRINTF(2, 3); + void PSendSysMessage(uint32 entry, ...); + std::string PGetParseString(uint32 entry, ...) const; bool ParseCommands(const char* text); @@ -147,7 +147,7 @@ class CliHandler : public ChatHandler explicit CliHandler(void* callbackArg, Print* zprint) : m_callbackArg(callbackArg), m_print(zprint) { } // overwrite functions - const char *GetTrinityString(int32 entry) const override; + char const* GetTrinityString(uint32 entry) const override; bool isAvailable(ChatCommand const& cmd) const override; bool HasPermission(uint32 /*permission*/) const override { return true; } void SendSysMessage(const char *str) override; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 475774831ba..50d8ffec5ae 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7673,112 +7673,48 @@ void ObjectMgr::LoadGameObjectForQuests() TC_LOG_INFO("server.loading", ">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } -bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max_value) +bool ObjectMgr::LoadTrinityStrings() { uint32 oldMSTime = getMSTime(); - int32 start_value = min_value; - int32 end_value = max_value; - // some string can have negative indexes range - if (start_value < 0) - { - if (end_value >= start_value) - { - TC_LOG_ERROR("sql.sql", "Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value); - return false; - } - - // real range (max+1, min+1) exaple: (-10, -1000) -> -999...-10+1 - std::swap(start_value, end_value); - ++start_value; - ++end_value; - } - else - { - if (start_value >= end_value) - { - TC_LOG_ERROR("sql.sql", "Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value); - return false; - } - } - - // cleanup affected map part for reloading case - for (TrinityStringLocaleContainer::iterator itr = _trinityStringLocaleStore.begin(); itr != _trinityStringLocaleStore.end();) - { - if (itr->first >= start_value && itr->first < end_value) - _trinityStringLocaleStore.erase(itr++); - else - ++itr; - } - - QueryResult result = WorldDatabase.PQuery("SELECT entry, content_default, content_loc1, content_loc2, content_loc3, content_loc4, content_loc5, content_loc6, content_loc7, content_loc8 FROM %s", table); + _trinityStringStore.clear(); // for reload case + QueryResult result = WorldDatabase.Query("SELECT entry, content_default, content_loc1, content_loc2, content_loc3, content_loc4, content_loc5, content_loc6, content_loc7, content_loc8 FROM trinity_string"); if (!result) { - if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings - TC_LOG_ERROR("server.loading", ">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table); - else - TC_LOG_INFO("server.loading", ">> Loaded 0 string templates. DB table `%s` is empty.", table); - + TC_LOG_ERROR("server.loading", ">> Loaded 0 trinity strings. DB table `trinity_string` is empty."); return false; } - uint32 count = 0; - do { Field* fields = result->Fetch(); - int32 entry = fields[0].GetInt32(); - - if (entry == 0) - { - TC_LOG_ERROR("sql.sql", "Table `%s` contain reserved entry 0, ignored.", table); - continue; - } - else if (entry < start_value || entry >= end_value) - { - TC_LOG_ERROR("sql.sql", "Table `%s` contain entry %i out of allowed range (%d - %d), ignored.", table, entry, min_value, max_value); - continue; - } - - TrinityStringLocale& data = _trinityStringLocaleStore[entry]; + uint32 entry = fields[0].GetUInt32(); - if (!data.Content.empty()) - { - TC_LOG_ERROR("sql.sql", "Table `%s` contain data for already loaded entry %i (from another table?), ignored.", table, entry); - continue; - } + TrinityString& data = _trinityStringStore[entry]; - data.Content.resize(1); - ++count; + data.Content.resize(DEFAULT_LOCALE + 1); for (int8 i = TOTAL_LOCALES - 1; i >= 0; --i) AddLocaleString(fields[i + 1].GetString(), LocaleConstant(i), data.Content); - } while (result->NextRow()); - - if (min_value == MIN_TRINITY_STRING_ID) - TC_LOG_INFO("server.loading", ">> Loaded %u Trinity strings from table %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); - else - TC_LOG_INFO("server.loading", ">> Loaded %u string templates from %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); + } + while (result->NextRow()); + TC_LOG_INFO("server.loading", ">> Loaded " SZFMTD " trinity strings in %u ms", _trinityStringStore.size(), GetMSTimeDiffToNow(oldMSTime)); return true; } -const char *ObjectMgr::GetTrinityString(int32 entry, LocaleConstant locale_idx) const +char const* ObjectMgr::GetTrinityString(uint32 entry, LocaleConstant locale) const { - if (TrinityStringLocale const* msl = GetTrinityStringLocale(entry)) + if (TrinityString const* ts = GetTrinityString(entry)) { - if (msl->Content.size() > size_t(locale_idx) && !msl->Content[locale_idx].empty()) - return msl->Content[locale_idx].c_str(); - - return msl->Content[DEFAULT_LOCALE].c_str(); + if (ts->Content.size() > size_t(locale) && !ts->Content[locale].empty()) + return ts->Content[locale].c_str(); + return ts->Content[DEFAULT_LOCALE].c_str(); } - if (entry > 0) - TC_LOG_ERROR("sql.sql", "Entry %i not found in `trinity_string` table.", entry); - else - TC_LOG_ERROR("sql.sql", "Trinity string entry %i not found in DB.", entry); + TC_LOG_ERROR("sql.sql", "Trinity string entry %u not found in DB.", entry); return ""; } diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index a26e2959769..f7e555d336a 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -463,14 +463,10 @@ struct CellObjectGuids typedef std::unordered_map CellObjectGuidsMap; typedef std::unordered_map MapObjectGuids; -// Trinity string ranges -#define MIN_TRINITY_STRING_ID 1 // 'trinity_string' -#define MAX_TRINITY_STRING_ID 2000000000 - // Trinity Trainer Reference start range #define TRINITY_TRAINER_START_REF 200000 -struct TrinityStringLocale +struct TrinityString { StringVector Content; }; @@ -486,10 +482,11 @@ typedef std::unordered_map ItemSetNameLocaleContainer typedef std::unordered_map QuestLocaleContainer; typedef std::unordered_map NpcTextLocaleContainer; typedef std::unordered_map PageTextLocaleContainer; -typedef std::unordered_map TrinityStringLocaleContainer; typedef std::unordered_map GossipMenuItemsLocaleContainer; typedef std::unordered_map PointOfInterestLocaleContainer; +typedef std::unordered_map TrinityStringContainer; + typedef std::multimap QuestRelations; // unit/go -> quest typedef std::multimap QuestRelationsReverse; // quest -> unit/go typedef std::pair QuestRelationBounds; @@ -955,6 +952,8 @@ class ObjectMgr return _creatureQuestInvolvedRelationsReverse.equal_range(questId); } + bool LoadTrinityStrings(); + void LoadEventScripts(); void LoadSpellScripts(); void LoadWaypointScripts(); @@ -964,8 +963,6 @@ class ObjectMgr void LoadBroadcastTexts(); void LoadBroadcastTextLocales(); - bool LoadTrinityStrings(char const* table, int32 min_value, int32 max_value); - bool LoadTrinityStrings() { return LoadTrinityStrings("trinity_string", MIN_TRINITY_STRING_ID, MAX_TRINITY_STRING_ID); } void LoadCreatureClassLevelStats(); void LoadCreatureLocales(); void LoadCreatureTemplates(); @@ -1187,14 +1184,15 @@ class ObjectMgr GameObjectData& NewGOData(uint32 guid) { return _gameObjectDataStore[guid]; } void DeleteGOData(uint32 guid); - TrinityStringLocale const* GetTrinityStringLocale(int32 entry) const + TrinityString const* GetTrinityString(uint32 entry) const { - TrinityStringLocaleContainer::const_iterator itr = _trinityStringLocaleStore.find(entry); - if (itr == _trinityStringLocaleStore.end()) return NULL; + TrinityStringContainer::const_iterator itr = _trinityStringStore.find(entry); + if (itr == _trinityStringStore.end()) + return nullptr; return &itr->second; } - const char *GetTrinityString(int32 entry, LocaleConstant locale_idx) const; - const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); } + char const* GetTrinityString(uint32 entry, LocaleConstant locale) const; + char const* GetTrinityStringForDBCLocale(uint32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); } LocaleConstant GetDBCLocaleIndex() const { return DBCLocaleIndex; } void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; } @@ -1438,10 +1436,11 @@ class ObjectMgr QuestLocaleContainer _questLocaleStore; NpcTextLocaleContainer _npcTextLocaleStore; PageTextLocaleContainer _pageTextLocaleStore; - TrinityStringLocaleContainer _trinityStringLocaleStore; GossipMenuItemsLocaleContainer _gossipMenuItemsLocaleStore; PointOfInterestLocaleContainer _pointOfInterestLocaleStore; + TrinityStringContainer _trinityStringStore; + CacheVendorItemContainer _cacheVendorItemStore; CacheTrainerSpellContainer _cacheTrainerSpellStore; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 814deba78db..ae8221ef49f 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1192,8 +1192,5 @@ enum TrinityStrings LANG_NPCINFO_INHABIT_TYPE = 11008, LANG_NPCINFO_FLAGS_EXTRA = 11009 - - // NOT RESERVED IDS 12000-1999999999 - // For other tables maybe 2000010000-2147483647 (max index) }; #endif diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index beb6ea54b32..84bb90638f7 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -621,7 +621,7 @@ void WorldSession::SendNotification(uint32 string_id, ...) } } -const char *WorldSession::GetTrinityString(int32 entry) const +char const* WorldSession::GetTrinityString(uint32 entry) const { return sObjectMgr->GetTrinityString(entry, GetSessionDbLocaleIndex()); } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index e46a58d5098..789bd5ab04f 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -366,7 +366,7 @@ class WorldSession // Locales LocaleConstant GetSessionDbcLocale() const { return m_sessionDbcLocale; } LocaleConstant GetSessionDbLocaleIndex() const { return m_sessionDbLocaleIndex; } - const char *GetTrinityString(int32 entry) const; + char const* GetTrinityString(uint32 entry) const; uint32 GetLatency() const { return m_latency; } void SetLatency(uint32 latency) { m_latency = latency; } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index a34362ddacc..0462148129a 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2186,7 +2186,7 @@ namespace Trinity { public: typedef std::vector WorldPacketList; - explicit WorldWorldTextBuilder(int32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) { } + explicit WorldWorldTextBuilder(uint32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) { } void operator()(WorldPacketList& data_list, LocaleConstant loc_idx) { char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx); @@ -2219,13 +2219,13 @@ namespace Trinity } } - int32 i_textId; + uint32 i_textId; va_list* i_args; }; } // namespace Trinity /// Send a System Message to all players (except self if mentioned) -void World::SendWorldText(int32 string_id, ...) +void World::SendWorldText(uint32 string_id, ...) { va_list ap; va_start(ap, string_id); @@ -2244,7 +2244,7 @@ void World::SendWorldText(int32 string_id, ...) } /// Send a System Message to all GMs (except self if mentioned) -void World::SendGMText(int32 string_id, ...) +void World::SendGMText(uint32 string_id, ...) { va_list ap; va_start(ap, string_id); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 6394fa42327..9987b8ab62c 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -628,9 +628,9 @@ class World void SetInitialWorldSettings(); void LoadConfigSettings(bool reload = false); - void SendWorldText(int32 string_id, ...); + void SendWorldText(uint32 string_id, ...); void SendGlobalText(const char* text, WorldSession* self); - void SendGMText(int32 string_id, ...); + void SendGMText(uint32 string_id, ...); void SendServerMessage(ServerMessageType type, const char *text = "", Player* player = NULL); void SendGlobalMessage(WorldPacket* packet, WorldSession* self = nullptr, uint32 team = 0); void SendGlobalGMMessage(WorldPacket* packet, WorldSession* self = nullptr, uint32 team = 0); -- cgit v1.2.3