void HandleAddIgnore(AddIgnore packet) { if (!ObjectManager.NormalizePlayerName(ref packet.Name)) { return; } ObjectGuid IgnoreGuid = Global.CharacterCacheStorage.GetCharacterGuidByName(packet.Name); FriendsResult ignoreResult = FriendsResult.IgnoreNotFound; if (IgnoreGuid.IsEmpty()) { if (IgnoreGuid == GetPlayer().GetGUID()) //not add yourself { ignoreResult = FriendsResult.IgnoreSelf; } else if (GetPlayer().GetSocial().HasIgnore(IgnoreGuid)) { ignoreResult = FriendsResult.IgnoreAlready; } else { ignoreResult = FriendsResult.IgnoreAdded; // ignore list full if (!GetPlayer().GetSocial().AddToSocialList(IgnoreGuid, SocialFlag.Ignored)) { ignoreResult = FriendsResult.IgnoreFull; } } } Global.SocialMgr.SendFriendStatus(GetPlayer(), ignoreResult, IgnoreGuid); }
void HandleAddIgnore(AddIgnore packet) { if (!ObjectManager.NormalizePlayerName(ref packet.Name)) { return; } PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_GUID_BY_NAME); stmt.AddValue(0, packet.Name); _queryProcessor.AddQuery(DB.Characters.AsyncQuery(stmt).WithCallback(HandleAddIgnoreCallBack)); }
void HandleAddIgnore(AddIgnore packet) { if (!ObjectManager.NormalizePlayerName(ref packet.Name)) { return; } ObjectGuid ignoreGuid; FriendsResult ignoreResult = FriendsResult.IgnoreNotFound; CharacterCacheEntry characterInfo = Global.CharacterCacheStorage.GetCharacterCacheByName(packet.Name); if (characterInfo != null) { ignoreGuid = characterInfo.Guid; ObjectGuid ignoreAccountGuid = ObjectGuid.Create(HighGuid.WowAccount, characterInfo.AccountId); if (ignoreGuid == GetPlayer().GetGUID()) //not add yourself { ignoreResult = FriendsResult.IgnoreSelf; } else if (GetPlayer().GetSocial().HasIgnore(ignoreGuid, ignoreAccountGuid)) { ignoreResult = FriendsResult.IgnoreAlready; } else { ignoreResult = FriendsResult.IgnoreAdded; // ignore list full if (!GetPlayer().GetSocial().AddToSocialList(ignoreGuid, ignoreAccountGuid, SocialFlag.Ignored)) { ignoreResult = FriendsResult.IgnoreFull; } } } Global.SocialMgr.SendFriendStatus(GetPlayer(), ignoreResult, ObjectGuid.Empty); }