[11465] non-ObjectGuid guids in random places.

Only ChannelMgr code wide use uint64 guids now, and Map object stores.
This commit is contained in:
VladimirMangos 2011-05-10 21:24:43 +04:00
parent a925db80fa
commit ef6a48fe03
44 changed files with 219 additions and 215 deletions

View file

@ -64,13 +64,13 @@ namespace MaNGOS
private: private:
void do_helper(WorldPacket& data, char const* text) void do_helper(WorldPacket& data, char const* text)
{ {
uint64 target_guid = i_source ? i_source ->GetGUID() : 0; ObjectGuid targetGuid = i_source ? i_source ->GetObjectGuid() : ObjectGuid();
data << uint8(i_msgtype); data << uint8(i_msgtype);
data << uint32(LANG_UNIVERSAL); data << uint32(LANG_UNIVERSAL);
data << uint64(target_guid); // there 0 for BG messages data << ObjectGuid(targetGuid); // there 0 for BG messages
data << uint32(0); // can be chat msg group or something data << uint32(0); // can be chat msg group or something
data << uint64(target_guid); data << ObjectGuid(targetGuid);
data << uint32(strlen(text)+1); data << uint32(strlen(text)+1);
data << text; data << text;
data << uint8(i_source ? i_source->chatTag() : uint8(0)); data << uint8(i_source ? i_source->chatTag() : uint8(0));
@ -110,16 +110,16 @@ namespace MaNGOS
void do_helper(WorldPacket& data, char const* text) void do_helper(WorldPacket& data, char const* text)
{ {
//copyied from BuildMonsterChat //copyied from BuildMonsterChat
data << (uint8)CHAT_MSG_MONSTER_YELL; data << uint8(CHAT_MSG_MONSTER_YELL);
data << (uint32)i_language; data << uint32(i_language);
data << (uint64)i_source->GetGUID(); data << ObjectGuid(i_source->GetObjectGuid());
data << (uint32)0; //2.1.0 data << uint32(0); // 2.1.0
data << (uint32)(strlen(i_source->GetName())+1); data << uint32(strlen(i_source->GetName())+1);
data << i_source->GetName(); data << i_source->GetName();
data << (uint64)0; //Unit Target - isn't important for bgs data << ObjectGuid(); // Unit Target - isn't important for bgs
data << (uint32)strlen(text)+1; data << uint32(strlen(text)+1);
data << text; data << text;
data << (uint8)0; // ChatTag - for bgs allways 0? data << uint8(0); // ChatTag - for bgs allways 0?
} }
uint32 i_language; uint32 i_language;
@ -143,13 +143,13 @@ namespace MaNGOS
char str [2048]; char str [2048];
snprintf(str,2048,text, arg1str, arg2str ); snprintf(str,2048,text, arg1str, arg2str );
uint64 target_guid = i_source ? i_source ->GetGUID() : 0; ObjectGuid targetGuid = i_source ? i_source ->GetObjectGuid() : ObjectGuid();
data << uint8(i_msgtype); data << uint8(i_msgtype);
data << uint32(LANG_UNIVERSAL); data << uint32(LANG_UNIVERSAL);
data << uint64(target_guid); // there 0 for BG messages data << ObjectGuid(targetGuid); // there 0 for BG messages
data << uint32(0); // can be chat msg group or something data << uint32(0); // can be chat msg group or something
data << uint64(target_guid); data << ObjectGuid(targetGuid);
data << uint32(strlen(str)+1); data << uint32(strlen(str)+1);
data << str; data << str;
data << uint8(i_source ? i_source->chatTag() : uint8(0)); data << uint8(i_source ? i_source->chatTag() : uint8(0));
@ -175,18 +175,18 @@ namespace MaNGOS
char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2,loc_idx) : ""; char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2,loc_idx) : "";
char str [2048]; char str [2048];
snprintf(str,2048,text, arg1str, arg2str ); snprintf(str, 2048, text, arg1str, arg2str);
//copyied from BuildMonsterChat //copyied from BuildMonsterChat
data << (uint8)CHAT_MSG_MONSTER_YELL; data << uint8(CHAT_MSG_MONSTER_YELL);
data << (uint32)i_language; data << uint32(i_language);
data << (uint64)i_source->GetGUID(); data << ObjectGuid(i_source->GetObjectGuid());
data << (uint32)0; //2.1.0 data << uint32(0); // 2.1.0
data << (uint32)(strlen(i_source->GetName())+1); data << uint32(strlen(i_source->GetName())+1);
data << i_source->GetName(); data << i_source->GetName();
data << (uint64)0; //Unit Target - isn't important for bgs data << uint64(0); // Unit Target - isn't important for bgs
data << (uint32)strlen(str)+1; data << uint32(strlen(str)+1);
data << str; data << str;
data << (uint8)0; // ChatTag - for bgs allways 0? data << uint8(0); // ChatTag - for bgs allways 0?
} }
private: private:

View file

@ -249,15 +249,15 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv
data << count2; // horde flag holders count - obsolete, now count of next fields data << count2; // horde flag holders count - obsolete, now count of next fields
if (ali_plr) if (ali_plr)
{ {
data << (uint64)ali_plr->GetGUID(); data << ObjectGuid(ali_plr->GetObjectGuid());
data << (float)ali_plr->GetPositionX(); data << float(ali_plr->GetPositionX());
data << (float)ali_plr->GetPositionY(); data << float(ali_plr->GetPositionY());
} }
if (horde_plr) if (horde_plr)
{ {
data << (uint64)horde_plr->GetGUID(); data << ObjectGuid(horde_plr->GetObjectGuid());
data << (float)horde_plr->GetPositionX(); data << float(horde_plr->GetPositionX());
data << (float)horde_plr->GetPositionY(); data << float(horde_plr->GetPositionY());
} }
SendPacket(&data); SendPacket(&data);

View file

@ -484,7 +484,7 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * b
BGQueueInviteEvent* inviteEvent = new BGQueueInviteEvent(plr->GetObjectGuid(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, ginfo->arenaType, ginfo->RemoveInviteTime); BGQueueInviteEvent* inviteEvent = new BGQueueInviteEvent(plr->GetObjectGuid(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, ginfo->arenaType, ginfo->RemoveInviteTime);
plr->m_Events.AddEvent(inviteEvent, plr->m_Events.CalculateTime(INVITATION_REMIND_TIME)); plr->m_Events.AddEvent(inviteEvent, plr->m_Events.CalculateTime(INVITATION_REMIND_TIME));
// create automatic remove events // create automatic remove events
BGQueueRemoveEvent* removeEvent = new BGQueueRemoveEvent(plr->GetGUID(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, bgQueueTypeId, ginfo->RemoveInviteTime); BGQueueRemoveEvent* removeEvent = new BGQueueRemoveEvent(plr->GetObjectGuid(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, bgQueueTypeId, ginfo->RemoveInviteTime);
plr->m_Events.AddEvent(removeEvent, plr->m_Events.CalculateTime(INVITE_ACCEPT_WAIT_TIME)); plr->m_Events.AddEvent(removeEvent, plr->m_Events.CalculateTime(INVITE_ACCEPT_WAIT_TIME));
WorldPacket data; WorldPacket data;

View file

@ -168,8 +168,8 @@ class BGQueueInviteEvent : public BasicEvent
class BGQueueRemoveEvent : public BasicEvent class BGQueueRemoveEvent : public BasicEvent
{ {
public: public:
BGQueueRemoveEvent(const uint64& pl_guid, uint32 bgInstanceGUID, BattleGroundTypeId BgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 removeTime) BGQueueRemoveEvent(ObjectGuid plGuid, uint32 bgInstanceGUID, BattleGroundTypeId BgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 removeTime)
: m_PlayerGuid(pl_guid), m_BgInstanceGUID(bgInstanceGUID), m_RemoveTime(removeTime), m_BgTypeId(BgTypeId), m_BgQueueTypeId(bgQueueTypeId) : m_PlayerGuid(plGuid), m_BgInstanceGUID(bgInstanceGUID), m_RemoveTime(removeTime), m_BgTypeId(BgTypeId), m_BgQueueTypeId(bgQueueTypeId)
{} {}
virtual ~BGQueueRemoveEvent() {} virtual ~BGQueueRemoveEvent() {}
@ -177,7 +177,7 @@ class BGQueueRemoveEvent : public BasicEvent
virtual bool Execute(uint64 e_time, uint32 p_time); virtual bool Execute(uint64 e_time, uint32 p_time);
virtual void Abort(uint64 e_time); virtual void Abort(uint64 e_time);
private: private:
uint64 m_PlayerGuid; ObjectGuid m_PlayerGuid;
uint32 m_BgInstanceGUID; uint32 m_BgInstanceGUID;
uint32 m_RemoveTime; uint32 m_RemoveTime;
BattleGroundTypeId m_BgTypeId; BattleGroundTypeId m_BgTypeId;

View file

@ -357,7 +357,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
type = CHAT_MSG_BG_SYSTEM_HORDE; type = CHAT_MSG_BG_SYSTEM_HORDE;
PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP); PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP);
SpawnEvent(WS_EVENT_FLAG_A, 0, false); SpawnEvent(WS_EVENT_FLAG_A, 0, false);
SetAllianceFlagPicker(Source->GetGUID()); SetAllianceFlagPicker(Source->GetObjectGuid());
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER; m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER;
//update world state to show correct flag carrier //update world state to show correct flag carrier
UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER);
@ -373,7 +373,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
type = CHAT_MSG_BG_SYSTEM_ALLIANCE; type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP); PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP);
SpawnEvent(WS_EVENT_FLAG_H, 0, false); SpawnEvent(WS_EVENT_FLAG_H, 0, false);
SetHordeFlagPicker(Source->GetGUID()); SetHordeFlagPicker(Source->GetObjectGuid());
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER; m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER;
//update world state to show correct flag carrier //update world state to show correct flag carrier
UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER);
@ -399,7 +399,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
type = CHAT_MSG_BG_SYSTEM_HORDE; type = CHAT_MSG_BG_SYSTEM_HORDE;
PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP); PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP);
SpawnEvent(WS_EVENT_FLAG_A, 0, false); SpawnEvent(WS_EVENT_FLAG_A, 0, false);
SetAllianceFlagPicker(Source->GetGUID()); SetAllianceFlagPicker(Source->GetObjectGuid());
Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG, true); Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG, true);
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER; m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER;
UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER);
@ -427,7 +427,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
type = CHAT_MSG_BG_SYSTEM_ALLIANCE; type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP); PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP);
SpawnEvent(WS_EVENT_FLAG_H, 0, false); SpawnEvent(WS_EVENT_FLAG_H, 0, false);
SetHordeFlagPicker(Source->GetGUID()); SetHordeFlagPicker(Source->GetObjectGuid());
Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG, true); Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG, true);
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER; m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER;
UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER);

View file

@ -1993,7 +1993,7 @@ valid examples:
} }
//Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored) //Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored)
void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker) void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, ObjectGuid targetGuid, const char *message, Unit *speaker)
{ {
uint32 messageLength = (message ? strlen(message) : 0) + 1; uint32 messageLength = (message ? strlen(message) : 0) + 1;
@ -2022,7 +2022,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin
case CHAT_MSG_BG_SYSTEM_HORDE: case CHAT_MSG_BG_SYSTEM_HORDE:
case CHAT_MSG_BATTLEGROUND: case CHAT_MSG_BATTLEGROUND:
case CHAT_MSG_BATTLEGROUND_LEADER: case CHAT_MSG_BATTLEGROUND_LEADER:
target_guid = session ? session->GetPlayer()->GetGUID() : 0; targetGuid = session ? session->GetPlayer()->GetObjectGuid() : ObjectGuid();
break; break;
case CHAT_MSG_MONSTER_SAY: case CHAT_MSG_MONSTER_SAY:
case CHAT_MSG_MONSTER_PARTY: case CHAT_MSG_MONSTER_PARTY:
@ -2033,7 +2033,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin
case CHAT_MSG_RAID_BOSS_EMOTE: case CHAT_MSG_RAID_BOSS_EMOTE:
case CHAT_MSG_BATTLENET: case CHAT_MSG_BATTLENET:
{ {
*data << speaker->GetObjectGuid(); *data << ObjectGuid(speaker->GetObjectGuid());
*data << uint32(0); // 2.1.0 *data << uint32(0); // 2.1.0
*data << uint32(strlen(speaker->GetName()) + 1); *data << uint32(strlen(speaker->GetName()) + 1);
*data << speaker->GetName(); *data << speaker->GetName();
@ -2051,11 +2051,11 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin
} }
default: default:
if (type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_IGNORED && type != CHAT_MSG_DND && type != CHAT_MSG_AFK) if (type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_IGNORED && type != CHAT_MSG_DND && type != CHAT_MSG_AFK)
target_guid = 0; // only for CHAT_MSG_WHISPER_INFORM used original value target_guid targetGuid.Clear(); // only for CHAT_MSG_WHISPER_INFORM used original value target_guid
break; break;
} }
*data << uint64(target_guid); // there 0 for BG messages *data << ObjectGuid(targetGuid); // there 0 for BG messages
*data << uint32(0); // can be chat msg group or something *data << uint32(0); // can be chat msg group or something
if (type == CHAT_MSG_CHANNEL) if (type == CHAT_MSG_CHANNEL)
@ -2064,7 +2064,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin
*data << channelName; *data << channelName;
} }
*data << uint64(target_guid); *data << ObjectGuid(targetGuid);
*data << uint32(messageLength); *data << uint32(messageLength);
*data << message; *data << message;
if(session != 0 && type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_DND && type != CHAT_MSG_AFK) if(session != 0 && type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_DND && type != CHAT_MSG_AFK)

View file

@ -69,16 +69,21 @@ class ChatHandler
explicit ChatHandler(Player* player); explicit ChatHandler(Player* player);
~ChatHandler(); ~ChatHandler();
static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker); static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, ObjectGuid targetGuid, const char *message, Unit *speaker);
void FillMessageData( WorldPacket *data, uint8 type, uint32 language, uint64 target_guid, const char* message) static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, ObjectGuid targetGuid, const char* message)
{ {
FillMessageData( data, m_session, type, language, NULL, target_guid, message, NULL); FillMessageData( data, session, type, language, NULL, targetGuid, message, NULL);
}
static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char* message)
{
FillMessageData( data, session, type, language, NULL, ObjectGuid(), message, NULL);
} }
void FillSystemMessageData( WorldPacket *data, const char* message ) void FillSystemMessageData( WorldPacket *data, const char* message )
{ {
FillMessageData( data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, 0, message ); FillMessageData( data, m_session, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, ObjectGuid(), message );
} }
static char* LineFromMessage(char*& pos) { char* start = strtok(pos,"\n"); pos = NULL; return start; } static char* LineFromMessage(char*& pos) { char* start = strtok(pos,"\n"); pos = NULL; return start; }

View file

@ -257,7 +257,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
return; return;
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, this, type, lang, NULL, 0, msg.c_str(), NULL); ChatHandler::FillMessageData(&data, this, type, lang, msg.c_str());
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetObjectGuid())); group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetObjectGuid()));
} break; } break;
@ -332,7 +332,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
} }
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, "", 0, msg.c_str(), NULL); ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, msg.c_str());
group->BroadcastPacket(&data, false); group->BroadcastPacket(&data, false);
} break; } break;
case CHAT_MSG_RAID_LEADER: case CHAT_MSG_RAID_LEADER:
@ -362,7 +362,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
} }
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_LEADER, lang, "", 0, msg.c_str(), NULL); ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_LEADER, lang, msg.c_str());
group->BroadcastPacket(&data, false); group->BroadcastPacket(&data, false);
} break; } break;
@ -384,7 +384,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
WorldPacket data; WorldPacket data;
//in battleground, raid warning is sent only to players in battleground - code is ok //in battleground, raid warning is sent only to players in battleground - code is ok
ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, "", 0, msg.c_str(), NULL); ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, msg.c_str());
group->BroadcastPacket(&data, false); group->BroadcastPacket(&data, false);
} break; } break;
@ -405,7 +405,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
return; return;
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND, lang, "", 0, msg.c_str(), NULL); ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND, lang, msg.c_str());
group->BroadcastPacket(&data, false); group->BroadcastPacket(&data, false);
} break; } break;
@ -426,7 +426,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
return; return;
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND_LEADER, lang, "", 0, msg.c_str(), NULL); ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND_LEADER, lang, msg.c_str());
group->BroadcastPacket(&data, false); group->BroadcastPacket(&data, false);
} break; } break;
@ -520,14 +520,14 @@ namespace MaNGOS
uint32 namlen = (nam ? strlen(nam) : 0) + 1; uint32 namlen = (nam ? strlen(nam) : 0) + 1;
data.Initialize(SMSG_TEXT_EMOTE, (20+namlen)); data.Initialize(SMSG_TEXT_EMOTE, (20+namlen));
data << i_player.GetGUID(); data << ObjectGuid(i_player.GetObjectGuid());
data << (uint32)i_text_emote; data << uint32(i_text_emote);
data << i_emote_num; data << uint32(i_emote_num);
data << (uint32)namlen; data << uint32(namlen);
if( namlen > 1 ) if (namlen > 1)
data.append(nam, namlen); data.append(nam, namlen);
else else
data << (uint8)0x00; data << uint8(0x00);
} }
private: private:
@ -609,7 +609,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data )
return; return;
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_IGNORED, LANG_UNIVERSAL, NULL, GetPlayer()->GetGUID(), GetPlayer()->GetName(), NULL); ChatHandler::FillMessageData(&data, this, CHAT_MSG_IGNORED, LANG_UNIVERSAL, NULL, GetPlayer()->GetObjectGuid(), GetPlayer()->GetName(), NULL);
player->GetSession()->SendPacket(&data); player->GetSession()->SendPacket(&data);
} }

View file

@ -126,7 +126,7 @@ void Corpse::SaveToDB()
void Corpse::DeleteBonesFromWorld() void Corpse::DeleteBonesFromWorld()
{ {
MANGOS_ASSERT(GetType() == CORPSE_BONES); MANGOS_ASSERT(GetType() == CORPSE_BONES);
Corpse* corpse = GetMap()->GetCorpse(GetGUID()); Corpse* corpse = GetMap()->GetCorpse(GetObjectGuid());
if (!corpse) if (!corpse)
{ {

View file

@ -815,15 +815,15 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const
pPlayer->PlayerTalkClass->ClearMenus(); pPlayer->PlayerTalkClass->ClearMenus();
switch(GetCreatureInfo()->trainer_class) switch(GetCreatureInfo()->trainer_class)
{ {
case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu( 4913,GetGUID()); break; case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu( 4913, GetObjectGuid()); break;
case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090,GetGUID()); break; case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090, GetObjectGuid()); break;
case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu( 328,GetGUID()); break; case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu( 328, GetObjectGuid()); break;
case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu( 1635,GetGUID()); break; case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu( 1635, GetObjectGuid()); break;
case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu( 4436,GetGUID()); break; case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu( 4436, GetObjectGuid()); break;
case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu( 4797,GetGUID()); break; case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu( 4797, GetObjectGuid()); break;
case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu( 5003,GetGUID()); break; case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu( 5003, GetObjectGuid()); break;
case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu( 5836,GetGUID()); break; case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu( 5836, GetObjectGuid()); break;
case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu( 4985,GetGUID()); break; case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu( 4985, GetObjectGuid()); break;
} }
} }
return false; return false;
@ -835,7 +835,7 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const
if (msg) if (msg)
{ {
pPlayer->PlayerTalkClass->ClearMenus(); pPlayer->PlayerTalkClass->ClearMenus();
pPlayer->PlayerTalkClass->SendGossipMenu(3620, GetGUID()); pPlayer->PlayerTalkClass->SendGossipMenu(3620, GetObjectGuid());
} }
return false; return false;
} }
@ -855,16 +855,16 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const
pPlayer->PlayerTalkClass->ClearMenus(); pPlayer->PlayerTalkClass->ClearMenus();
switch(GetCreatureInfo()->trainer_class) switch(GetCreatureInfo()->trainer_class)
{ {
case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865,GetGUID()); break; case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865, GetObjectGuid()); break;
case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881,GetGUID()); break; case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881, GetObjectGuid()); break;
case RACE_HUMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5861,GetGUID()); break; case RACE_HUMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5861, GetObjectGuid()); break;
case RACE_NIGHTELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862,GetGUID()); break; case RACE_NIGHTELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetObjectGuid()); break;
case RACE_ORC: pPlayer->PlayerTalkClass->SendGossipMenu(5863,GetGUID()); break; case RACE_ORC: pPlayer->PlayerTalkClass->SendGossipMenu(5863, GetObjectGuid()); break;
case RACE_TAUREN: pPlayer->PlayerTalkClass->SendGossipMenu(5864,GetGUID()); break; case RACE_TAUREN: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetObjectGuid()); break;
case RACE_TROLL: pPlayer->PlayerTalkClass->SendGossipMenu(5816,GetGUID()); break; case RACE_TROLL: pPlayer->PlayerTalkClass->SendGossipMenu(5816, GetObjectGuid()); break;
case RACE_UNDEAD: pPlayer->PlayerTalkClass->SendGossipMenu( 624,GetGUID()); break; case RACE_UNDEAD: pPlayer->PlayerTalkClass->SendGossipMenu( 624, GetObjectGuid()); break;
case RACE_BLOODELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862,GetGUID()); break; case RACE_BLOODELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetObjectGuid()); break;
case RACE_DRAENEI: pPlayer->PlayerTalkClass->SendGossipMenu(5864,GetGUID()); break; case RACE_DRAENEI: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetObjectGuid()); break;
} }
} }
return false; return false;
@ -876,7 +876,7 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const
if (msg) if (msg)
{ {
pPlayer->PlayerTalkClass->ClearMenus(); pPlayer->PlayerTalkClass->ClearMenus();
pPlayer->PlayerTalkClass->SendGossipMenu(11031, GetGUID()); pPlayer->PlayerTalkClass->SendGossipMenu(11031, GetObjectGuid());
} }
return false; return false;
} }
@ -904,9 +904,9 @@ bool Creature::CanInteractWithBattleMaster(Player* pPlayer, bool msg) const
pPlayer->PlayerTalkClass->ClearMenus(); pPlayer->PlayerTalkClass->ClearMenus();
switch(bgTypeId) switch(bgTypeId)
{ {
case BATTLEGROUND_AV: pPlayer->PlayerTalkClass->SendGossipMenu(7616, GetGUID()); break; case BATTLEGROUND_AV: pPlayer->PlayerTalkClass->SendGossipMenu(7616, GetObjectGuid()); break;
case BATTLEGROUND_WS: pPlayer->PlayerTalkClass->SendGossipMenu(7599, GetGUID()); break; case BATTLEGROUND_WS: pPlayer->PlayerTalkClass->SendGossipMenu(7599, GetObjectGuid()); break;
case BATTLEGROUND_AB: pPlayer->PlayerTalkClass->SendGossipMenu(7642, GetGUID()); break; case BATTLEGROUND_AB: pPlayer->PlayerTalkClass->SendGossipMenu(7642, GetObjectGuid()); break;
case BATTLEGROUND_EY: case BATTLEGROUND_EY:
case BATTLEGROUND_NA: case BATTLEGROUND_NA:
case BATTLEGROUND_BE: case BATTLEGROUND_BE:
@ -914,7 +914,7 @@ bool Creature::CanInteractWithBattleMaster(Player* pPlayer, bool msg) const
case BATTLEGROUND_RL: case BATTLEGROUND_RL:
case BATTLEGROUND_SA: case BATTLEGROUND_SA:
case BATTLEGROUND_DS: case BATTLEGROUND_DS:
case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024, GetGUID()); break; case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024, GetObjectGuid()); break;
default: break; default: break;
} }
return false; return false;
@ -2412,7 +2412,8 @@ void Creature::SendAreaSpiritHealerQueryOpcode(Player *pl)
if (Spell* pcurSpell = GetCurrentSpell(CURRENT_CHANNELED_SPELL)) if (Spell* pcurSpell = GetCurrentSpell(CURRENT_CHANNELED_SPELL))
next_resurrect = pcurSpell->GetCastedTime(); next_resurrect = pcurSpell->GetCastedTime();
WorldPacket data(SMSG_AREA_SPIRIT_HEALER_TIME, 8 + 4); WorldPacket data(SMSG_AREA_SPIRIT_HEALER_TIME, 8 + 4);
data << GetGUID() << next_resurrect; data << ObjectGuid(GetObjectGuid());
data << uint32(next_resurrect);
pl->SendDirectMessage(&data); pl->SendDirectMessage(&data);
} }

View file

@ -773,7 +773,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
return; return;
} }
pInst->SetData64(action.set_inst_data64.field, target->GetGUID()); pInst->SetData64(action.set_inst_data64.field, target->GetObjectGuid().GetRawValue());
break; break;
} }
case ACTION_T_UPDATE_TEMPLATE: case ACTION_T_UPDATE_TEMPLATE:

View file

@ -141,14 +141,14 @@ void DynamicObject::Update(uint32 update_diff, uint32 p_time)
if(deleteThis) if(deleteThis)
{ {
caster->RemoveDynObjectWithGUID(GetGUID()); caster->RemoveDynObjectWithGUID(GetObjectGuid());
Delete(); Delete();
} }
} }
void DynamicObject::Delete() void DynamicObject::Delete()
{ {
SendObjectDeSpawnAnim(GetGUID()); SendObjectDeSpawnAnim(GetObjectGuid());
AddObjectToRemoveList(); AddObjectToRemoveList();
} }

View file

@ -199,7 +199,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/)
udata.BuildPacket(&packet); udata.BuildPacket(&packet);
((Player*)caster)->GetSession()->SendPacket(&packet); ((Player*)caster)->GetSession()->SendPacket(&packet);
SendGameObjectCustomAnim(GetGUID()); SendGameObjectCustomAnim(GetObjectGuid());
} }
m_lootState = GO_READY; // can be successfully open with some chance m_lootState = GO_READY; // can be successfully open with some chance
@ -316,7 +316,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/)
{ {
Unit *caster = owner ? owner : ok; Unit *caster = owner ? owner : ok;
caster->CastSpell(ok, goInfo->trap.spellId, true, NULL, NULL, GetGUID()); caster->CastSpell(ok, goInfo->trap.spellId, true, NULL, NULL, GetObjectGuid());
// use template cooldown if provided // use template cooldown if provided
m_cooldownTime = time(NULL) + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4)); m_cooldownTime = time(NULL) + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4));
@ -329,7 +329,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/)
//BattleGround gameobjects case //BattleGround gameobjects case
if (((Player*)ok)->InBattleGround()) if (((Player*)ok)->InBattleGround())
if (BattleGround *bg = ((Player*)ok)->GetBattleGround()) if (BattleGround *bg = ((Player*)ok)->GetBattleGround())
bg->HandleTriggerBuff(GetGUID()); bg->HandleTriggerBuff(GetObjectGuid());
} }
} }
} }
@ -380,7 +380,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/)
for (GuidsSet::const_iterator itr = m_UniqueUsers.begin(); itr != m_UniqueUsers.end(); ++itr) for (GuidsSet::const_iterator itr = m_UniqueUsers.begin(); itr != m_UniqueUsers.end(); ++itr)
{ {
if (Player* owner = GetMap()->GetPlayer(*itr)) if (Player* owner = GetMap()->GetPlayer(*itr))
owner->CastSpell(owner, spellId, false, NULL, NULL, GetGUID()); owner->CastSpell(owner, spellId, false, NULL, NULL, GetObjectGuid());
} }
ClearAllUsesData(); ClearAllUsesData();
@ -404,7 +404,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/)
// burning flags in some battlegrounds, if you find better condition, just add it // burning flags in some battlegrounds, if you find better condition, just add it
if (GetGOInfo()->IsDespawnAtAction() || GetGoAnimProgress() > 0) if (GetGOInfo()->IsDespawnAtAction() || GetGoAnimProgress() > 0)
{ {
SendObjectDeSpawnAnim(GetGUID()); SendObjectDeSpawnAnim(GetObjectGuid());
//reset flags //reset flags
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
} }
@ -458,7 +458,7 @@ void GameObject::AddUniqueUse(Player* player)
void GameObject::Delete() void GameObject::Delete()
{ {
SendObjectDeSpawnAnim(GetGUID()); SendObjectDeSpawnAnim(GetObjectGuid());
SetGoState(GO_STATE_READY); SetGoState(GO_STATE_READY);
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
@ -1098,7 +1098,7 @@ void GameObject::Use(Unit* user)
if (info->goober.pageId) // show page... if (info->goober.pageId) // show page...
{ {
WorldPacket data(SMSG_GAMEOBJECT_PAGETEXT, 8); WorldPacket data(SMSG_GAMEOBJECT_PAGETEXT, 8);
data << GetGUID(); data << ObjectGuid(GetObjectGuid());
player->GetSession()->SendPacket(&data); player->GetSession()->SendPacket(&data);
} }
else if (info->goober.gossipID) // ...or gossip, if page does not exist else if (info->goober.gossipID) // ...or gossip, if page does not exist
@ -1139,7 +1139,7 @@ void GameObject::Use(Unit* user)
// this appear to be ok, however others exist in addition to this that should have custom (ex: 190510, 188692, 187389) // this appear to be ok, however others exist in addition to this that should have custom (ex: 190510, 188692, 187389)
if (time_to_restore && info->goober.customAnim) if (time_to_restore && info->goober.customAnim)
SendGameObjectCustomAnim(GetGUID()); SendGameObjectCustomAnim(GetObjectGuid());
else else
SetGoState(GO_STATE_ACTIVE); SetGoState(GO_STATE_ACTIVE);

View file

@ -149,10 +149,10 @@ bool PlayerMenu::GossipOptionCoded( unsigned int Selection )
return mGossipMenu.MenuItemCoded( Selection ); return mGossipMenu.MenuItemCoded( Selection );
} }
void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID) void PlayerMenu::SendGossipMenu(uint32 TitleTextId, ObjectGuid objectGuid)
{ {
WorldPacket data(SMSG_GOSSIP_MESSAGE, (100)); // guess size WorldPacket data(SMSG_GOSSIP_MESSAGE, (100)); // guess size
data << uint64(objectGUID); data << ObjectGuid(objectGuid);
data << uint32(mGossipMenu.GetMenuId()); // new 2.4.0 data << uint32(mGossipMenu.GetMenuId()); // new 2.4.0
data << uint32(TitleTextId); data << uint32(TitleTextId);
data << uint32(mGossipMenu.MenuItemCount()); // max count 0x20 data << uint32(mGossipMenu.MenuItemCount()); // max count 0x20
@ -160,17 +160,17 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID)
for (uint32 iI = 0; iI < mGossipMenu.MenuItemCount(); ++iI ) for (uint32 iI = 0; iI < mGossipMenu.MenuItemCount(); ++iI )
{ {
GossipMenuItem const& gItem = mGossipMenu.GetItem(iI); GossipMenuItem const& gItem = mGossipMenu.GetItem(iI);
data << uint32( iI ); data << uint32(iI);
data << uint8( gItem.m_gIcon ); data << uint8(gItem.m_gIcon);
data << uint8( gItem.m_gCoded ); // makes pop up box password data << uint8(gItem.m_gCoded); // makes pop up box password
data << uint32(gItem.m_gBoxMoney); // money required to open menu, 2.0.3 data << uint32(gItem.m_gBoxMoney); // money required to open menu, 2.0.3
data << gItem.m_gMessage; // text for gossip item, max 0x800 data << gItem.m_gMessage; // text for gossip item, max 0x800
data << gItem.m_gBoxMessage; // accept text (related to money) pop up box, 2.0.3, max 0x800 data << gItem.m_gBoxMessage; // accept text (related to money) pop up box, 2.0.3, max 0x800
} }
data << uint32( mQuestMenu.MenuItemCount() ); // max count 0x20 data << uint32(mQuestMenu.MenuItemCount()); // max count 0x20
for (uint32 iI = 0; iI < mQuestMenu.MenuItemCount(); ++iI ) for (uint32 iI = 0; iI < mQuestMenu.MenuItemCount(); ++iI)
{ {
QuestMenuItem const& qItem = mQuestMenu.GetItem(iI); QuestMenuItem const& qItem = mQuestMenu.GetItem(iI);
uint32 questID = qItem.m_qId; uint32 questID = qItem.m_qId;

View file

@ -264,7 +264,7 @@ class MANGOS_DLL_SPEC PlayerMenu
uint32 GossipOptionAction( unsigned int Selection ); uint32 GossipOptionAction( unsigned int Selection );
bool GossipOptionCoded( unsigned int Selection ); bool GossipOptionCoded( unsigned int Selection );
void SendGossipMenu( uint32 TitleTextId, uint64 npcGUID ); void SendGossipMenu(uint32 titleTextId, ObjectGuid objectGuid);
void CloseGossip(); void CloseGossip();
void SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char * locName ); void SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char * locName );
void SendPointOfInterest( uint32 poi_id ); void SendPointOfInterest( uint32 poi_id );

View file

@ -47,12 +47,12 @@ VisibleNotifier::Notify()
{ {
for(Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin();itr!=transport->GetPassengers().end();++itr) for(Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin();itr!=transport->GetPassengers().end();++itr)
{ {
if (i_clientGUIDs.find((*itr)->GetGUID()) != i_clientGUIDs.end()) if (i_clientGUIDs.find((*itr)->GetObjectGuid()) != i_clientGUIDs.end())
{ {
// ignore far sight case // ignore far sight case
(*itr)->UpdateVisibilityOf(*itr, &player); (*itr)->UpdateVisibilityOf(*itr, &player);
player.UpdateVisibilityOf(&player, *itr, i_data, i_visibleNow); player.UpdateVisibilityOf(&player, *itr, i_data, i_visibleNow);
i_clientGUIDs.erase((*itr)->GetGUID()); i_clientGUIDs.erase((*itr)->GetObjectGuid());
} }
} }
} }

View file

@ -34,7 +34,7 @@ inline void MaNGOS::VisibleNotifier::Visit(GridRefManager<T> &m)
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter) for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
{ {
i_camera.UpdateVisibilityOf(iter->getSource(), i_data, i_visibleNow); i_camera.UpdateVisibilityOf(iter->getSource(), i_data, i_visibleNow);
i_clientGUIDs.erase(iter->getSource()->GetGUID()); i_clientGUIDs.erase(iter->getSource()->GetObjectGuid());
} }
} }

View file

@ -750,7 +750,7 @@ void Group::StartLootRool(Creature* lootTarget, LootMethod method, Loot* loot, u
LootItem const& lootItem = loot->items[itemSlot]; LootItem const& lootItem = loot->items[itemSlot];
Roll* r = new Roll(lootTarget->GetGUID(), method, lootItem); Roll* r = new Roll(lootTarget->GetObjectGuid(), method, lootItem);
//a vector is filled with only near party members //a vector is filled with only near party members
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())

View file

@ -622,7 +622,7 @@ void WorldSession::HandleRaidReadyCheckOpcode( WorldPacket & recv_data )
// everything is fine, do it // everything is fine, do it
WorldPacket data(MSG_RAID_READY_CHECK, 8); WorldPacket data(MSG_RAID_READY_CHECK, 8);
data << GetPlayer()->GetGUID(); data << ObjectGuid(GetPlayer()->GetObjectGuid());
group->BroadcastPacket(&data, false, -1); group->BroadcastPacket(&data, false, -1);
group->OfflineReadyCheck(); group->OfflineReadyCheck();

View file

@ -554,7 +554,7 @@ void Guild::BroadcastToGuild(WorldSession *session, const std::string& msg, uint
if (session && session->GetPlayer() && HasRankRight(session->GetPlayer()->GetRank(),GR_RIGHT_GCHATSPEAK)) if (session && session->GetPlayer() && HasRankRight(session->GetPlayer()->GetRank(),GR_RIGHT_GCHATSPEAK))
{ {
WorldPacket data; WorldPacket data;
ChatHandler(session).FillMessageData(&data, CHAT_MSG_GUILD, language, 0, msg.c_str()); ChatHandler::FillMessageData(&data, session, CHAT_MSG_GUILD, language, msg.c_str());
for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr)
{ {
@ -573,7 +573,7 @@ void Guild::BroadcastToOfficers(WorldSession *session, const std::string& msg, u
for(MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) for(MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr)
{ {
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, session, CHAT_MSG_OFFICER, language, NULL, 0, msg.c_str(), NULL); ChatHandler::FillMessageData(&data, session, CHAT_MSG_OFFICER, language, msg.c_str());
Player *pl = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first)); Player *pl = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first));

View file

@ -383,7 +383,7 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
// Put record into guild log // Put record into guild log
guild->LogGuildEvent(GUILD_EVENT_LOG_LEAVE_GUILD, _player->GetObjectGuid()); guild->LogGuildEvent(GUILD_EVENT_LOG_LEAVE_GUILD, _player->GetObjectGuid());
guild->BroadcastEvent(GE_LEFT, _player->GetGUID(), _player->GetName()); guild->BroadcastEvent(GE_LEFT, _player->GetObjectGuid(), _player->GetName());
SendGuildCommandResult(GUILD_QUIT_S, guild->GetName(), ERR_PLAYER_NO_MORE_IN_GUILD); SendGuildCommandResult(GUILD_QUIT_S, guild->GetName(), ERR_PLAYER_NO_MORE_IN_GUILD);
} }

View file

@ -466,7 +466,7 @@ void WorldSession::HandleReadItemOpcode( WorldPacket & recv_data )
DETAIL_LOG("STORAGE: Unable to read item"); DETAIL_LOG("STORAGE: Unable to read item");
_player->SendEquipError( msg, pItem, NULL ); _player->SendEquipError( msg, pItem, NULL );
} }
data << pItem->GetGUID(); data << ObjectGuid(pItem->GetObjectGuid());
SendPacket(&data); SendPacket(&data);
} }
else else

View file

@ -3498,7 +3498,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
// (0.001) - There is no other way to compare C++ floats with mySQL floats // (0.001) - There is no other way to compare C++ floats with mySQL floats
// See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html
const char* maxDIFF = "0.01"; const char* maxDIFF = "0.01";
PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUID()); PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetObjectGuid().GetRawValue());
result = WorldDatabase.PQuery("SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s )", result = WorldDatabase.PQuery("SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s )",
target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF); target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF);

View file

@ -999,7 +999,7 @@ void Map::RemoveAllObjectsInRemoveList()
case TYPEID_CORPSE: case TYPEID_CORPSE:
{ {
// ??? WTF // ??? WTF
Corpse* corpse = GetCorpse(obj->GetGUID()); Corpse* corpse = GetCorpse(obj->GetObjectGuid());
if (!corpse) if (!corpse)
sLog.outError("Try delete corpse/bones %u that not in map", obj->GetGUIDLow()); sLog.outError("Try delete corpse/bones %u that not in map", obj->GetGUIDLow());
else else

View file

@ -213,7 +213,7 @@ void Object::BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) c
void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const
{ {
data->AddOutOfRangeGUID(GetGUID()); data->AddOutOfRangeGUID(GetObjectGuid());
} }
void Object::DestroyForPlayer( Player *target, bool anim ) const void Object::DestroyForPlayer( Player *target, bool anim ) const
@ -1605,17 +1605,17 @@ void WorldObject::SendMessageToSetExcept(WorldPacket *data, Player const* skippe
} }
} }
void WorldObject::SendObjectDeSpawnAnim(uint64 guid) void WorldObject::SendObjectDeSpawnAnim(ObjectGuid guid)
{ {
WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8); WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8);
data << uint64(guid); data << ObjectGuid(guid);
SendMessageToSet(&data, true); SendMessageToSet(&data, true);
} }
void WorldObject::SendGameObjectCustomAnim(uint64 guid) void WorldObject::SendGameObjectCustomAnim(ObjectGuid guid)
{ {
WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8+4); WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8+4);
data << uint64(guid); data << ObjectGuid(guid);
data << uint32(0); // not known what this is data << uint32(0); // not known what this is
SendMessageToSet(&data, true); SendMessageToSet(&data, true);
} }

View file

@ -546,8 +546,8 @@ class MANGOS_DLL_SPEC WorldObject : public Object
void PlayDistanceSound(uint32 sound_id, Player* target = NULL); void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
void PlayDirectSound(uint32 sound_id, Player* target = NULL); void PlayDirectSound(uint32 sound_id, Player* target = NULL);
void SendObjectDeSpawnAnim(uint64 guid); void SendObjectDeSpawnAnim(ObjectGuid guid);
void SendGameObjectCustomAnim(uint64 guid); void SendGameObjectCustomAnim(ObjectGuid guid);
virtual bool IsHostileTo(Unit const* unit) const =0; virtual bool IsHostileTo(Unit const* unit) const =0;
virtual bool IsFriendlyTo(Unit const* unit) const =0; virtual bool IsFriendlyTo(Unit const* unit) const =0;

View file

@ -1145,7 +1145,7 @@ void Pet::_LoadSpellCooldowns()
time_t curTime = time(NULL); time_t curTime = time(NULL);
WorldPacket data(SMSG_SPELL_COOLDOWN, (8+1+size_t(result->GetRowCount())*8)); WorldPacket data(SMSG_SPELL_COOLDOWN, (8+1+size_t(result->GetRowCount())*8));
data << GetGUID(); data << ObjectGuid(GetObjectGuid());
data << uint8(0x0); // flags (0x1, 0x2) data << uint8(0x0); // flags (0x1, 0x2)
do do

View file

@ -335,14 +335,14 @@ void PetAI::UpdateAllies()
{ {
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{ {
Player* Target = itr->getSource(); Player* target = itr->getSource();
if (!Target || !pGroup->SameSubGroup((Player*)owner, Target)) if (!target || !pGroup->SameSubGroup((Player*)owner, target))
continue; continue;
if (Target->GetGUID() == owner->GetGUID()) if (target->GetObjectGuid() == owner->GetObjectGuid())
continue; continue;
m_AllySet.insert(Target->GetObjectGuid()); m_AllySet.insert(target->GetObjectGuid());
} }
} }
else //remove group else //remove group

View file

@ -4649,7 +4649,7 @@ void Player::SpawnCorpseBones()
Corpse* Player::GetCorpse() const Corpse* Player::GetCorpse() const
{ {
return sObjectAccessor.GetCorpseForPlayerGUID(GetGUID()); return sObjectAccessor.GetCorpseForPlayerGUID(GetObjectGuid());
} }
void Player::DurabilityLossAll(double percent, bool inventory) void Player::DurabilityLossAll(double percent, bool inventory)
@ -8700,7 +8700,7 @@ void Player::SendPetSkillWipeConfirm()
if(!pet) if(!pet)
return; return;
WorldPacket data(SMSG_PET_UNLEARN_CONFIRM, (8+4)); WorldPacket data(SMSG_PET_UNLEARN_CONFIRM, (8+4));
data << pet->GetGUID(); data << ObjectGuid(pet->GetObjectGuid());
data << uint32(pet->resetTalentsCost()); data << uint32(pet->resetTalentsCost());
GetSession()->SendPacket( &data ); GetSession()->SendPacket( &data );
} }
@ -13042,7 +13042,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
if (canTalkToCredit) if (canTalkToCredit)
{ {
if (pSource->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) if (pSource->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
TalkedToCreature(pSource->GetEntry(), pSource->GetGUID()); TalkedToCreature(pSource->GetEntry(), pSource->GetObjectGuid());
} }
// some gossips aren't handled in normal way ... so we need to do it this way .. TODO: handle it in normal way ;-) // some gossips aren't handled in normal way ... so we need to do it this way .. TODO: handle it in normal way ;-)
@ -13094,7 +13094,7 @@ void Player::SendPreparedGossip(WorldObject *pSource)
if (uint32 menuId = PlayerTalkClass->GetGossipMenu().GetMenuId()) if (uint32 menuId = PlayerTalkClass->GetGossipMenu().GetMenuId())
textId = GetGossipTextId(menuId); textId = GetGossipTextId(menuId);
PlayerTalkClass->SendGossipMenu(textId, pSource->GetGUID()); PlayerTalkClass->SendGossipMenu(textId, pSource->GetObjectGuid());
} }
void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 menuId) void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 menuId)
@ -13150,7 +13150,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me
else if (pMenuData.m_gAction_menu < 0) else if (pMenuData.m_gAction_menu < 0)
{ {
PlayerTalkClass->CloseGossip(); PlayerTalkClass->CloseGossip();
TalkedToCreature(pSource->GetEntry(), pSource->GetGUID()); TalkedToCreature(pSource->GetEntry(), pSource->GetObjectGuid());
} }
if (pMenuData.m_gAction_script) if (pMenuData.m_gAction_script)
@ -13165,7 +13165,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me
} }
case GOSSIP_OPTION_SPIRITHEALER: case GOSSIP_OPTION_SPIRITHEALER:
if (isDead()) if (isDead())
((Creature*)pSource)->CastSpell(((Creature*)pSource),17251,true,NULL,NULL,GetGUID()); ((Creature*)pSource)->CastSpell(((Creature*)pSource), 17251, true, NULL, NULL, GetObjectGuid());
break; break;
case GOSSIP_OPTION_QUESTGIVER: case GOSSIP_OPTION_QUESTGIVER:
PrepareQuestMenu(guid); PrepareQuestMenu(guid);
@ -16994,7 +16994,7 @@ void Player::ConvertInstancesToGroup(Player *player, Group *group, ObjectGuid pl
if (player) if (player)
{ {
player_guid = player->GetGUID(); player_guid = player->GetObjectGuid();
if (!group) if (!group)
group = player->GetGroup(); group = player->GetGroup();
} }
@ -18681,7 +18681,7 @@ void Player::HandleStealthedUnitsDetection()
{ {
if(!hasAtClient) if(!hasAtClient)
{ {
ObjectGuid i_guid = (*i)->GetGUID(); ObjectGuid i_guid = (*i)->GetObjectGuid();
(*i)->SendCreateUpdateToPlayer(this); (*i)->SendCreateUpdateToPlayer(this);
m_clientGUIDs.insert(i_guid); m_clientGUIDs.insert(i_guid);
@ -18698,7 +18698,7 @@ void Player::HandleStealthedUnitsDetection()
if(hasAtClient) if(hasAtClient)
{ {
(*i)->DestroyForPlayer(this); (*i)->DestroyForPlayer(this);
m_clientGUIDs.erase((*i)->GetGUID()); m_clientGUIDs.erase((*i)->GetObjectGuid());
} }
} }
} }
@ -19914,7 +19914,7 @@ template<>
inline void UpdateVisibilityOf_helper(ObjectGuidSet& s64, GameObject* target) inline void UpdateVisibilityOf_helper(ObjectGuidSet& s64, GameObject* target)
{ {
if(!target->IsTransport()) if(!target->IsTransport())
s64.insert(target->GetGUID()); s64.insert(target->GetObjectGuid());
} }
template<class T> template<class T>
@ -20208,7 +20208,7 @@ void Player::ApplyEquipCooldown( Item * pItem )
AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30); AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30);
WorldPacket data(SMSG_ITEM_COOLDOWN, 12); WorldPacket data(SMSG_ITEM_COOLDOWN, 12);
data << pItem->GetGUID(); data << ObjectGuid(pItem->GetObjectGuid());
data << uint32(spellData.SpellId); data << uint32(spellData.SpellId);
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
} }

View file

@ -2220,7 +2220,7 @@ class MANGOS_DLL_SPEC Player : public Unit
// currently visible objects at player client // currently visible objects at player client
ObjectGuidSet m_clientGUIDs; ObjectGuidSet m_clientGUIDs;
bool HaveAtClient(WorldObject const* u) { return u==this || m_clientGUIDs.find(u->GetGUID())!=m_clientGUIDs.end(); } bool HaveAtClient(WorldObject const* u) { return u==this || m_clientGUIDs.find(u->GetObjectGuid())!=m_clientGUIDs.end(); }
bool IsVisibleInGridForPlayer(Player* pl) const; bool IsVisibleInGridForPlayer(Player* pl) const;
bool IsVisibleGloballyFor(Player* pl) const; bool IsVisibleGloballyFor(Player* pl) const;

View file

@ -134,7 +134,7 @@ void SpellCastTargets::setUnitTarget(Unit *target)
m_destY = target->GetPositionY(); m_destY = target->GetPositionY();
m_destZ = target->GetPositionZ(); m_destZ = target->GetPositionZ();
m_unitTarget = target; m_unitTarget = target;
m_unitTargetGUID = target->GetGUID(); m_unitTargetGUID = target->GetObjectGuid();
m_targetMask |= TARGET_FLAG_UNIT; m_targetMask |= TARGET_FLAG_UNIT;
} }
@ -157,7 +157,7 @@ void SpellCastTargets::setSource(float x, float y, float z)
void SpellCastTargets::setGOTarget(GameObject *target) void SpellCastTargets::setGOTarget(GameObject *target)
{ {
m_GOTarget = target; m_GOTarget = target;
m_GOTargetGUID = target->GetGUID(); m_GOTargetGUID = target->GetObjectGuid();
// m_targetMask |= TARGET_FLAG_OBJECT; // m_targetMask |= TARGET_FLAG_OBJECT;
} }
@ -167,7 +167,7 @@ void SpellCastTargets::setItemTarget(Item* item)
return; return;
m_itemTarget = item; m_itemTarget = item;
m_itemTargetGUID = item->GetGUID(); m_itemTargetGUID = item->GetObjectGuid();
m_itemTargetEntry = item->GetEntry(); m_itemTargetEntry = item->GetEntry();
m_targetMask |= TARGET_FLAG_ITEM; m_targetMask |= TARGET_FLAG_ITEM;
} }
@ -183,7 +183,7 @@ void SpellCastTargets::setTradeItemTarget(Player* caster)
void SpellCastTargets::setCorpseTarget(Corpse* corpse) void SpellCastTargets::setCorpseTarget(Corpse* corpse)
{ {
m_CorpseTargetGUID = corpse->GetGUID(); m_CorpseTargetGUID = corpse->GetObjectGuid();
} }
void SpellCastTargets::Update(Unit* caster) void SpellCastTargets::Update(Unit* caster)
@ -222,7 +222,7 @@ void SpellCastTargets::read( ByteBuffer& data, Unit *caster )
m_destY = caster->GetPositionY(); m_destY = caster->GetPositionY();
m_destZ = caster->GetPositionZ(); m_destZ = caster->GetPositionZ();
m_unitTarget = caster; m_unitTarget = caster;
m_unitTargetGUID = caster->GetGUID(); m_unitTargetGUID = caster->GetObjectGuid();
return; return;
} }
@ -5321,7 +5321,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK) if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK)
{ {
if (strict) //Summoning Disorientation, trigger pet stun (cast by pet so it doesn't attack player) if (strict) //Summoning Disorientation, trigger pet stun (cast by pet so it doesn't attack player)
pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID()); pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetObjectGuid());
} }
else else
return SPELL_FAILED_ALREADY_HAVE_SUMMON; return SPELL_FAILED_ALREADY_HAVE_SUMMON;

View file

@ -1839,7 +1839,7 @@ void Aura::TriggerSpell()
} }
case 53563: // Beacon of Light case 53563: // Beacon of Light
// original caster must be target (beacon) // original caster must be target (beacon)
target->CastSpell(target, trigger_spell_id, true, NULL, this, target->GetGUID()); target->CastSpell(target, trigger_spell_id, true, NULL, this, target->GetObjectGuid());
return; return;
case 56654: // Rapid Recuperation (triggered energize have baspioints == 0) case 56654: // Rapid Recuperation (triggered energize have baspioints == 0)
case 58882: case 58882:

View file

@ -3097,10 +3097,10 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
default: return; default: return;
} }
totem->CastSpell(totem, triggered_spell_id, true, NULL, NULL, m_caster->GetGUID()); totem->CastSpell(totem, triggered_spell_id, true, NULL, NULL, m_caster->GetObjectGuid());
// Fire Nova Visual // Fire Nova Visual
totem->CastSpell(totem, 19823, true, NULL, NULL, m_caster->GetGUID()); totem->CastSpell(totem, 19823, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
break; break;
@ -3919,7 +3919,7 @@ void Spell::EffectHeal(SpellEffectIndex /*eff_idx*/)
if (unitTarget == m_targets.getUnitTarget()) if (unitTarget == m_targets.getUnitTarget())
{ {
// check for Riptide // check for Riptide
Aura* riptide = unitTarget->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, UI64LIT(0x0), 0x00000010, caster->GetGUID()); Aura* riptide = unitTarget->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, UI64LIT(0x0), 0x00000010, caster->GetObjectGuid());
if (riptide) if (riptide)
{ {
addhealth += addhealth/4; addhealth += addhealth/4;
@ -7483,7 +7483,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{ {
if (roll_chance_i((*i)->GetModifier()->m_amount)) if (roll_chance_i((*i)->GetModifier()->m_amount))
{ {
unitTarget->CastSpell(unitTarget, 53398, true, NULL, (*i), m_caster->GetGUID()); unitTarget->CastSpell(unitTarget, 53398, true, NULL, (*i), m_caster->GetObjectGuid());
break; break;
} }
} }
@ -8765,7 +8765,7 @@ void Spell::EffectProspecting(SpellEffectIndex /*eff_idx*/)
p_caster->UpdateGatherSkill(SKILL_JEWELCRAFTING, SkillValue, reqSkillValue); p_caster->UpdateGatherSkill(SKILL_JEWELCRAFTING, SkillValue, reqSkillValue);
} }
((Player*)m_caster)->SendLoot(itemTarget->GetGUID(), LOOT_PROSPECTING); ((Player*)m_caster)->SendLoot(itemTarget->GetObjectGuid(), LOOT_PROSPECTING);
} }
void Spell::EffectMilling(SpellEffectIndex /*eff_idx*/) void Spell::EffectMilling(SpellEffectIndex /*eff_idx*/)

View file

@ -132,18 +132,18 @@ bool WorldSession::SendLearnNewTaxiNode( Creature* unit )
// find current node // find current node
uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam()); uint32 curloc = sObjectMgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
if ( curloc == 0 ) if (curloc == 0)
return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result. return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result.
if( GetPlayer()->m_taxi.SetTaximaskNode(curloc) ) if (GetPlayer()->m_taxi.SetTaximaskNode(curloc))
{ {
WorldPacket msg(SMSG_NEW_TAXI_PATH, 0); WorldPacket msg(SMSG_NEW_TAXI_PATH, 0);
SendPacket( &msg ); SendPacket(&msg);
WorldPacket update( SMSG_TAXINODE_STATUS, 9 ); WorldPacket update(SMSG_TAXINODE_STATUS, 9);
update << uint64( unit->GetGUID() ); update << ObjectGuid(unit->GetObjectGuid());
update << uint8( 1 ); update << uint8(1);
SendPacket( &update ); SendPacket(&update);
return true; return true;
} }

View file

@ -61,7 +61,7 @@ HostileReference::HostileReference(Unit* pUnit, ThreatManager *pThreatManager, f
iThreat = pThreat; iThreat = pThreat;
iTempThreatModifyer = 0.0f; iTempThreatModifyer = 0.0f;
link(pUnit, pThreatManager); link(pUnit, pThreatManager);
iUnitGuid = pUnit->GetGUID(); iUnitGuid = pUnit->GetObjectGuid();
iOnline = true; iOnline = true;
iAccessible = true; iAccessible = true;
} }
@ -128,10 +128,9 @@ void HostileReference::updateOnlineStatus()
bool online = false; bool online = false;
bool accessible = false; bool accessible = false;
if(!isValid()) if (!isValid())
{ {
Unit* target = ObjectAccessor::GetUnit(*getSourceUnit(), getUnitGuid()); if (Unit* target = ObjectAccessor::GetUnit(*getSourceUnit(), getUnitGuid()))
if(target)
link(target, getSource()); link(target, getSource());
} }
// only check for online status if // only check for online status if
@ -224,10 +223,10 @@ void ThreatContainer::clearReferences()
HostileReference* ThreatContainer::getReferenceByTarget(Unit* pVictim) HostileReference* ThreatContainer::getReferenceByTarget(Unit* pVictim)
{ {
HostileReference* result = NULL; HostileReference* result = NULL;
uint64 guid = pVictim->GetGUID(); ObjectGuid guid = pVictim->GetObjectGuid();
for(ThreatList::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i) for(ThreatList::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
{ {
if((*i)->getUnitGuid() == guid) if ((*i)->getUnitGuid() == guid)
{ {
result = (*i); result = (*i);
break; break;

View file

@ -24,6 +24,7 @@
#include "Utilities/LinkedReference/Reference.h" #include "Utilities/LinkedReference/Reference.h"
#include "UnitEvents.h" #include "UnitEvents.h"
#include "Timer.h" #include "Timer.h"
#include "ObjectGuid.h"
#include <list> #include <list>
//============================================================== //==============================================================
@ -92,7 +93,7 @@ class MANGOS_DLL_SPEC HostileReference : public Reference<Unit, ThreatManager>
//================================================= //=================================================
uint64 getUnitGuid() const { return iUnitGuid; } ObjectGuid const& getUnitGuid() const { return iUnitGuid; }
//================================================= //=================================================
// reference is not needed anymore. realy delete it ! // reference is not needed anymore. realy delete it !
@ -121,7 +122,7 @@ class MANGOS_DLL_SPEC HostileReference : public Reference<Unit, ThreatManager>
private: private:
float iThreat; float iThreat;
float iTempThreatModifyer; // used for taunt float iTempThreatModifyer; // used for taunt
uint64 iUnitGuid; ObjectGuid iUnitGuid;
bool iOnline; bool iOnline;
bool iAccessible; bool iAccessible;
}; };

View file

@ -620,8 +620,8 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
pOther->m_trade = new TradeData(pOther, _player); pOther->m_trade = new TradeData(pOther, _player);
WorldPacket data(SMSG_TRADE_STATUS, 12); WorldPacket data(SMSG_TRADE_STATUS, 12);
data << (uint32) TRADE_STATUS_BEGIN_TRADE; data << uint32(TRADE_STATUS_BEGIN_TRADE);
data << (uint64)_player->GetGUID(); data << ObjectGuid(_player->GetObjectGuid());
pOther->GetSession()->SendPacket(&data); pOther->GetSession()->SendPacket(&data);
} }

View file

@ -3745,7 +3745,7 @@ void Unit::SetFacingToObject(WorldObject* pObject)
// TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is. // TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is.
SetOrientation(GetAngle(pObject)); SetOrientation(GetAngle(pObject));
SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), SPLINETYPE_FACINGTARGET, ((Creature*)this)->GetSplineFlags(), 0, NULL, pObject->GetGUID()); SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), SPLINETYPE_FACINGTARGET, ((Creature*)this)->GetSplineFlags(), 0, NULL, pObject->GetObjectGuid().GetRawValue());
} }
bool Unit::isInAccessablePlaceFor(Creature const* c) const bool Unit::isInAccessablePlaceFor(Creature const* c) const
@ -4747,8 +4747,11 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode)
else else
delete holder; delete holder;
if (mode != AURA_REMOVE_BY_EXPIRE && IsChanneledSpell(AurSpellInfo) && !IsAreaOfEffectSpell(AurSpellInfo) && caster && caster->GetGUID() != GetGUID()) if (mode != AURA_REMOVE_BY_EXPIRE && IsChanneledSpell(AurSpellInfo) && !IsAreaOfEffectSpell(AurSpellInfo) &&
caster && caster->GetObjectGuid() != GetObjectGuid())
{
caster->InterruptSpell(CURRENT_CHANNELED_SPELL); caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
}
} }
void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEffectIndex index, AuraRemoveMode mode) void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEffectIndex index, AuraRemoveMode mode)
@ -4925,7 +4928,7 @@ bool Unit::HasAura(uint32 spellId, SpellEffectIndex effIndex) const
void Unit::AddDynObject(DynamicObject* dynObj) void Unit::AddDynObject(DynamicObject* dynObj)
{ {
m_dynObjGUIDs.push_back(dynObj->GetGUID()); m_dynObjGUIDs.push_back(dynObj->GetObjectGuid());
} }
void Unit::RemoveDynObject(uint32 spellid) void Unit::RemoveDynObject(uint32 spellid)
@ -4953,8 +4956,7 @@ void Unit::RemoveAllDynObjects()
{ {
while(!m_dynObjGUIDs.empty()) while(!m_dynObjGUIDs.empty())
{ {
DynamicObject* dynObj = GetMap()->GetDynamicObject(*m_dynObjGUIDs.begin()); if (DynamicObject* dynObj = GetMap()->GetDynamicObject(*m_dynObjGUIDs.begin()))
if(dynObj)
dynObj->Delete(); dynObj->Delete();
m_dynObjGUIDs.erase(m_dynObjGUIDs.begin()); m_dynObjGUIDs.erase(m_dynObjGUIDs.begin());
} }
@ -5325,15 +5327,12 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const
FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(getFaction()); FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(getFaction());
if(!entry) if(!entry)
{ {
static uint64 guid = 0; // prevent repeating spam same faction problem static ObjectGuid guid; // prevent repeating spam same faction problem
if(GetGUID() != guid) if (GetObjectGuid() != guid)
{ {
if(GetTypeId() == TYPEID_PLAYER) sLog.outError("%s have invalid faction (faction template id) #%u", GetGuidStr().c_str(), getFaction());
sLog.outError("Player %s have invalid faction (faction template id) #%u", ((Player*)this)->GetName(), getFaction()); guid = GetObjectGuid();
else
sLog.outError("Creature (template id: %u) have invalid faction (faction template id) #%u", ((Creature*)this)->GetCreatureInfo()->Entry, getFaction());
guid = GetGUID();
} }
} }
return entry; return entry;
@ -5955,30 +5954,29 @@ void Unit::SetCharm(Unit* pet)
void Unit::AddGuardian( Pet* pet ) void Unit::AddGuardian( Pet* pet )
{ {
m_guardianPets.insert(pet->GetGUID()); m_guardianPets.insert(pet->GetObjectGuid());
} }
void Unit::RemoveGuardian( Pet* pet ) void Unit::RemoveGuardian( Pet* pet )
{ {
m_guardianPets.erase(pet->GetGUID()); m_guardianPets.erase(pet->GetObjectGuid());
} }
void Unit::RemoveGuardians() void Unit::RemoveGuardians()
{ {
while(!m_guardianPets.empty()) while (!m_guardianPets.empty())
{ {
uint64 guid = *m_guardianPets.begin(); if (Pet* pet = GetMap()->GetPet(*m_guardianPets.begin()))
if(Pet* pet = GetMap()->GetPet(guid))
pet->Unsummon(PET_SAVE_AS_DELETED, this); pet->Unsummon(PET_SAVE_AS_DELETED, this);
m_guardianPets.erase(guid); m_guardianPets.erase(m_guardianPets.begin());
} }
} }
Pet* Unit::FindGuardianWithEntry(uint32 entry) Pet* Unit::FindGuardianWithEntry(uint32 entry)
{ {
for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr) for (GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr)
if(Pet* pet = GetMap()->GetPet(*itr)) if (Pet* pet = GetMap()->GetPet(*itr))
if (pet->GetEntry() == entry) if (pet->GetEntry() == entry)
return pet; return pet;
@ -5987,8 +5985,8 @@ Pet* Unit::FindGuardianWithEntry(uint32 entry)
Pet* Unit::GetProtectorPet() Pet* Unit::GetProtectorPet()
{ {
for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr) for (GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr)
if(Pet* pet = GetMap()->GetPet(*itr)) if (Pet* pet = GetMap()->GetPet(*itr))
if (pet->getPetType() == PROTECTOR_PET) if (pet->getPetType() == PROTECTOR_PET)
return pet; return pet;
@ -6354,7 +6352,7 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u
// Twisted Faith // Twisted Faith
case 7377: case 7377:
{ {
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, UI64LIT(0x0000000000008000), 0, GetGUID())) if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, UI64LIT(0x0000000000008000), 0, GetObjectGuid()))
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break; break;
} }
@ -6438,7 +6436,7 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001)) if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001))
{ {
// if Insect Swarm on target // if Insect Swarm on target
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000200000), 0, GetGUID())) if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000200000), 0, GetObjectGuid()))
{ {
Unit::AuraList const& improvedSwarm = GetAurasByType(SPELL_AURA_DUMMY); Unit::AuraList const& improvedSwarm = GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator iter = improvedSwarm.begin(); iter != improvedSwarm.end(); ++iter) for(Unit::AuraList::const_iterator iter = improvedSwarm.begin(); iter != improvedSwarm.end(); ++iter)
@ -6730,7 +6728,7 @@ bool Unit::IsSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004))
{ {
// search for Moonfire on target // search for Moonfire on target
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000000002), 0, GetGUID())) if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000000002), 0, GetObjectGuid()))
{ {
Unit::AuraList const& improvedSwarm = GetAurasByType(SPELL_AURA_DUMMY); Unit::AuraList const& improvedSwarm = GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator iter = improvedSwarm.begin(); iter != improvedSwarm.end(); ++iter) for(Unit::AuraList::const_iterator iter = improvedSwarm.begin(); iter != improvedSwarm.end(); ++iter)
@ -6764,7 +6762,7 @@ bool Unit::IsSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000100000000000)) if (spellProto->SpellFamilyFlags & UI64LIT(0x0000100000000000))
{ {
// Flame Shock // Flame Shock
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, UI64LIT(0x0000000010000000), 0, GetGUID())) if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, UI64LIT(0x0000000010000000), 0, GetObjectGuid()))
return true; return true;
} }
break; break;
@ -6947,7 +6945,7 @@ uint32 Unit::SpellHealingBonusDone(Unit *pVictim, SpellEntry const *spellProto,
} }
case 7871: // Glyph of Lesser Healing Wave case 7871: // Glyph of Lesser Healing Wave
{ {
if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, UI64LIT(0x0000040000000000), 0, GetGUID())) if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, UI64LIT(0x0000040000000000), 0, GetObjectGuid()))
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break; break;
} }
@ -10608,7 +10606,7 @@ void Unit::SendThreatUpdate()
data << uint32(count); data << uint32(count);
for (ThreatList::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr) for (ThreatList::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
{ {
data.appendPackGUID((*itr)->getUnitGuid()); data << (*itr)->getUnitGuid().WriteAsPacked();
data << uint32((*itr)->getThreat()); data << uint32((*itr)->getThreat());
} }
SendMessageToSet(&data, false); SendMessageToSet(&data, false);
@ -10623,11 +10621,11 @@ void Unit::SendHighestThreatUpdate(HostileReference* pHostilReference)
DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message"); DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message");
WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8); WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8);
data << GetPackGUID(); data << GetPackGUID();
data.appendPackGUID(pHostilReference->getUnitGuid()); data << pHostilReference->getUnitGuid().WriteAsPacked();
data << uint32(count); data << uint32(count);
for (ThreatList::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr) for (ThreatList::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
{ {
data.appendPackGUID((*itr)->getUnitGuid()); data << (*itr)->getUnitGuid().WriteAsPacked();
data << uint32((*itr)->getThreat()); data << uint32((*itr)->getThreat());
} }
SendMessageToSet(&data, false); SendMessageToSet(&data, false);
@ -10647,7 +10645,7 @@ void Unit::SendThreatRemove(HostileReference* pHostileReference)
DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Send SMSG_THREAT_REMOVE Message"); DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Send SMSG_THREAT_REMOVE Message");
WorldPacket data(SMSG_THREAT_REMOVE, 8 + 8); WorldPacket data(SMSG_THREAT_REMOVE, 8 + 8);
data << GetPackGUID(); data << GetPackGUID();
data.appendPackGUID(pHostileReference->getUnitGuid()); data << pHostileReference->getUnitGuid().WriteAsPacked();
SendMessageToSet(&data, false); SendMessageToSet(&data, false);
} }

View file

@ -1106,7 +1106,7 @@ enum IgnoreUnitState
IGNORE_UNIT_TARGET_NON_FROZEN = 126, // ignore absent of frozen state IGNORE_UNIT_TARGET_NON_FROZEN = 126, // ignore absent of frozen state
}; };
typedef std::set<uint64> GuardianPetList; typedef std::set<ObjectGuid> GuardianPetList;
// delay time next attack to prevent client attack animation problems // delay time next attack to prevent client attack animation problems
#define ATTACK_DISPLAY_DELAY 200 #define ATTACK_DISPLAY_DELAY 200
@ -1801,7 +1801,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
DynamicObject* GetDynObject(uint32 spellId); DynamicObject* GetDynObject(uint32 spellId);
void AddDynObject(DynamicObject* dynObj); void AddDynObject(DynamicObject* dynObj);
void RemoveDynObject(uint32 spellid); void RemoveDynObject(uint32 spellid);
void RemoveDynObjectWithGUID(uint64 guid) { m_dynObjGUIDs.remove(guid); } void RemoveDynObjectWithGUID(ObjectGuid guid) { m_dynObjGUIDs.remove(guid); }
void RemoveAllDynObjects(); void RemoveAllDynObjects();
GameObject* GetGameObject(uint32 spellId) const; GameObject* GetGameObject(uint32 spellId) const;
@ -1982,7 +1982,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
SingleCastSpellTargetMap m_singleCastSpellTargets; // casted by unit single per-caster auras SingleCastSpellTargetMap m_singleCastSpellTargets; // casted by unit single per-caster auras
typedef std::list<uint64> DynObjectGUIDs; typedef std::list<ObjectGuid> DynObjectGUIDs;
DynObjectGUIDs m_dynObjGUIDs; DynObjectGUIDs m_dynObjGUIDs;
typedef std::list<GameObject*> GameObjectList; typedef std::list<GameObject*> GameObjectList;

View file

@ -1361,7 +1361,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
// Renew // Renew
Aura* healingAura = pVictim->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_PRIEST, UI64LIT(0x40), 0, GetGUID()); Aura* healingAura = pVictim->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_PRIEST, UI64LIT(0x40), 0, GetObjectGuid());
if (!healingAura) if (!healingAura)
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
@ -1377,7 +1377,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
if (!procSpell) if (!procSpell)
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
Aura* leachAura = pVictim->GetAura(SPELL_AURA_PERIODIC_LEECH, SPELLFAMILY_PRIEST, UI64LIT(0x02000000), 0, GetGUID()); Aura* leachAura = pVictim->GetAura(SPELL_AURA_PERIODIC_LEECH, SPELLFAMILY_PRIEST, UI64LIT(0x02000000), 0, GetObjectGuid());
if (!leachAura) if (!leachAura)
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
@ -1595,7 +1595,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
if (!second) if (!second)
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
pVictim->CastSpell(second, procSpell, true, NULL, triggeredByAura, GetGUID()); pVictim->CastSpell(second, procSpell, true, NULL, triggeredByAura, GetObjectGuid());
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
} }
} }
@ -1790,7 +1790,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
// Glyph of Mend Pet // Glyph of Mend Pet
if(dummySpell->Id == 57870) if(dummySpell->Id == 57870)
{ {
pVictim->CastSpell(pVictim, 57894, true, NULL, NULL, GetGUID()); pVictim->CastSpell(pVictim, 57894, true, NULL, NULL, GetObjectGuid());
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
} }
// Misdirection // Misdirection
@ -2027,7 +2027,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
basepoints[0] = triggeredByAura->GetModifier()->m_amount*damage/100; basepoints[0] = triggeredByAura->GetModifier()->m_amount*damage/100;
// cast with original caster set but beacon to beacon for apply caster mods and avoid LoS check // cast with original caster set but beacon to beacon for apply caster mods and avoid LoS check
beacon->CastCustomSpell(beacon,triggered_spell_id,&basepoints[0],NULL,NULL,true,castItem,triggeredByAura,pVictim->GetGUID()); beacon->CastCustomSpell(beacon,triggered_spell_id,&basepoints[0],NULL,NULL,true,castItem,triggeredByAura,pVictim->GetObjectGuid());
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
} }
// Seal of Corruption (damage calc on apply aura) // Seal of Corruption (damage calc on apply aura)

View file

@ -1638,7 +1638,7 @@ void World::SendGlobalText(const char* text, WorldSession *self)
while(char* line = ChatHandler::LineFromMessage(pos)) while(char* line = ChatHandler::LineFromMessage(pos))
{ {
ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, 0, line, NULL); ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, line);
SendGlobalMessage(&data, self); SendGlobalMessage(&data, self);
} }
@ -1667,7 +1667,7 @@ void World::SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self
void World::SendZoneText(uint32 zone, const char* text, WorldSession *self, uint32 team) void World::SendZoneText(uint32 zone, const char* text, WorldSession *self, uint32 team)
{ {
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, 0, text, NULL); ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, text);
SendZoneMessage(zone, &data, self,team); SendZoneMessage(zone, &data, self,team);
} }

View file

@ -436,7 +436,7 @@ void WorldSession::LogoutPlayer(bool Save)
slot->UpdateLogoutTime(); slot->UpdateLogoutTime();
} }
guild->BroadcastEvent(GE_SIGNED_OFF, _player->GetGUID(), _player->GetName()); guild->BroadcastEvent(GE_SIGNED_OFF, _player->GetObjectGuid(), _player->GetName());
} }
///- Remove pet ///- Remove pet

View file

@ -306,7 +306,7 @@ bool ChatHandler::HandleDebugSendChatMsgCommand(char* args)
return false; return false;
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, m_session, type, 0, "chan", m_session->GetPlayer()->GetGUID(), msg, m_session->GetPlayer()); ChatHandler::FillMessageData(&data, m_session, type, 0, "chan", m_session->GetPlayer()->GetObjectGuid(), msg, m_session->GetPlayer());
m_session->SendPacket(&data); m_session->SendPacket(&data);
return true; return true;
} }
@ -528,7 +528,7 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
error = true; continue; error = true; continue;
} }
if (item2->GetOwnerGuid() != player->GetGUID()) if (item2->GetOwnerGuid() != player->GetObjectGuid())
{ {
PSendSysMessage("%s in bag %u at slot %u owner (%s) and inventory owner (%s) don't match!", PSendSysMessage("%s in bag %u at slot %u owner (%s) and inventory owner (%s) don't match!",
item2->GetGuidStr().c_str(), bag->GetSlot(), item2->GetSlot(), item2->GetGuidStr().c_str(), bag->GetSlot(), item2->GetSlot(),

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11464" #define REVISION_NR "11465"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__