mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[10363] More wide use ObjectGuid in way remove MAKE_NEW_GUID uses.
Also * Fixed some amount wrong uses low guids as full player guids. * Add private without body ObjectGuid(uint32 const&) for catch wrong assigns low guids to ObjectGuid. In some cases need assign "0" guid, then use ObjectGuid() instead. * Fixed .pdump commands work.
This commit is contained in:
parent
db7db6382a
commit
5f44c4da21
41 changed files with 369 additions and 323 deletions
|
|
@ -458,7 +458,8 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
|
|||
if(!result)
|
||||
return;
|
||||
|
||||
uint64 friendGuid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
uint32 friendLowGuid = (*result)[0].GetUInt32();
|
||||
ObjectGuid friendGuid = ObjectGuid(HIGHGUID_PLAYER, friendLowGuid);
|
||||
uint32 team = Player::TeamForRace((*result)[1].GetUInt8());
|
||||
|
||||
delete result;
|
||||
|
|
@ -468,13 +469,13 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
|
|||
return;
|
||||
|
||||
FriendsResult friendResult = FRIEND_NOT_FOUND;
|
||||
if(friendGuid)
|
||||
if (!friendGuid.IsEmpty())
|
||||
{
|
||||
if(friendGuid==session->GetPlayer()->GetGUID())
|
||||
if (friendGuid == session->GetPlayer()->GetObjectGuid())
|
||||
friendResult = FRIEND_SELF;
|
||||
else if(session->GetPlayer()->GetTeam() != team && !sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_ADD_FRIEND) && session->GetSecurity() < SEC_MODERATOR)
|
||||
friendResult = FRIEND_ENEMY;
|
||||
else if(session->GetPlayer()->GetSocial()->HasFriend(GUID_LOPART(friendGuid)))
|
||||
else if(session->GetPlayer()->GetSocial()->HasFriend(friendLowGuid))
|
||||
friendResult = FRIEND_ALREADY;
|
||||
else
|
||||
{
|
||||
|
|
@ -484,17 +485,17 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
|
|||
else
|
||||
friendResult = FRIEND_ADDED_OFFLINE;
|
||||
|
||||
if(!session->GetPlayer()->GetSocial()->AddToSocialList(GUID_LOPART(friendGuid), false))
|
||||
if(!session->GetPlayer()->GetSocial()->AddToSocialList(friendLowGuid, false))
|
||||
{
|
||||
friendResult = FRIEND_LIST_FULL;
|
||||
DEBUG_LOG( "WORLD: %s's friend list is full.", session->GetPlayer()->GetName());
|
||||
}
|
||||
|
||||
session->GetPlayer()->GetSocial()->SetFriendNote(GUID_LOPART(friendGuid), friendNote);
|
||||
session->GetPlayer()->GetSocial()->SetFriendNote(friendLowGuid, friendNote);
|
||||
}
|
||||
}
|
||||
|
||||
sSocialMgr.SendFriendStatus(session->GetPlayer(), friendResult, GUID_LOPART(friendGuid), false);
|
||||
sSocialMgr.SendFriendStatus(session->GetPlayer(), friendResult, friendLowGuid, false);
|
||||
|
||||
DEBUG_LOG( "WORLD: Sent (SMSG_FRIEND_STATUS)" );
|
||||
}
|
||||
|
|
@ -538,7 +539,8 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult *result, uint32 acc
|
|||
if(!result)
|
||||
return;
|
||||
|
||||
uint64 IgnoreGuid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
uint32 ignoreLowGuid = (*result)[0].GetUInt32();
|
||||
ObjectGuid ignoreGuid = ObjectGuid(HIGHGUID_PLAYER, ignoreLowGuid);
|
||||
|
||||
delete result;
|
||||
|
||||
|
|
@ -547,23 +549,23 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult *result, uint32 acc
|
|||
return;
|
||||
|
||||
FriendsResult ignoreResult = FRIEND_IGNORE_NOT_FOUND;
|
||||
if(IgnoreGuid)
|
||||
if (!ignoreGuid.IsEmpty())
|
||||
{
|
||||
if(IgnoreGuid == session->GetPlayer()->GetGUID()) //not add yourself
|
||||
if (ignoreGuid == session->GetPlayer()->GetObjectGuid())
|
||||
ignoreResult = FRIEND_IGNORE_SELF;
|
||||
else if( session->GetPlayer()->GetSocial()->HasIgnore(GUID_LOPART(IgnoreGuid)) )
|
||||
else if (session->GetPlayer()->GetSocial()->HasIgnore(ignoreLowGuid))
|
||||
ignoreResult = FRIEND_IGNORE_ALREADY;
|
||||
else
|
||||
{
|
||||
ignoreResult = FRIEND_IGNORE_ADDED;
|
||||
|
||||
// ignore list full
|
||||
if(!session->GetPlayer()->GetSocial()->AddToSocialList(GUID_LOPART(IgnoreGuid), true))
|
||||
if(!session->GetPlayer()->GetSocial()->AddToSocialList(ignoreLowGuid, true))
|
||||
ignoreResult = FRIEND_IGNORE_FULL;
|
||||
}
|
||||
}
|
||||
|
||||
sSocialMgr.SendFriendStatus(session->GetPlayer(), ignoreResult, GUID_LOPART(IgnoreGuid), false);
|
||||
sSocialMgr.SendFriendStatus(session->GetPlayer(), ignoreResult, ignoreLowGuid, false);
|
||||
|
||||
DEBUG_LOG( "WORLD: Sent (SMSG_FRIEND_STATUS)" );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue