コード例 #1
0
        public static void HandleIgnoredAddRequestMessage(WorldClient client, IgnoredAddRequestMessage message)
        {
            Character character = Singleton <World> .Instance.GetCharacter(message.name);

            if (character != null)
            {
                if (character.UserGroup.Role == RoleEnum.Player)
                {
                    client.Character.FriendsBook.AddIgnored(character.Client.WorldAccount, message.session);
                }
                else
                {
                    FriendHandler.SendFriendAddFailureMessage(client, ListAddFailureEnum.LIST_ADD_FAILURE_NOT_FOUND);
                }
            }
            else
            {
                ServerBase <WorldServer> .Instance.IOTaskPool.AddMessage(delegate
                {
                    WorldAccount record = Singleton <AccountManager> .Instance.FindByNickname(message.name);
                    if (record != null && client.Character.Context != null)
                    {
                        client.Character.Context.ExecuteInContext(delegate
                        {
                            client.Character.FriendsBook.AddIgnored(record, message.session);
                        });
                    }
                    else
                    {
                        FriendHandler.SendIgnoredAddFailureMessage(client, ListAddFailureEnum.LIST_ADD_FAILURE_NOT_FOUND);
                    }
                });
            }
        }
コード例 #2
0
        public static void HandleFriendDeleteRequestMessage(WorldClient client, FriendDeleteRequestMessage message)
        {
            Friend friend = client.Character.FriendsBook.Friends.FirstOrDefault((Friend entry) => entry.Account.Id == message.accountId);

            if (friend == null)
            {
                FriendHandler.SendFriendDeleteResultMessage(client, false, friend.Account.Nickname);
            }
            else
            {
                client.Character.FriendsBook.RemoveFriend(friend);
            }
        }
コード例 #3
0
        public static void HandleIgnoredDeleteRequestMessage(WorldClient client, IgnoredDeleteRequestMessage message)
        {
            Ignored ignored = client.Character.FriendsBook.Ignoreds.FirstOrDefault((Ignored entry) => entry.Account.Id == message.accountId);

            if (ignored == null)
            {
                FriendHandler.SendIgnoredDeleteResultMessage(client, false, false, ignored.Account.Nickname);
            }
            else
            {
                client.Character.FriendsBook.RemoveIgnored(ignored);
            }
        }
コード例 #4
0
 public static void HandleIgnoredGetListMessage(WorldClient client, IgnoredGetListMessage message)
 {
     FriendHandler.SendIgnoredListMessage(client, client.Character.FriendsBook.Ignoreds);
 }
コード例 #5
0
 public static void HandleFriendsGetListMessage(WorldClient client, FriendsGetListMessage message)
 {
     FriendHandler.SendFriendsListMessage(client, client.Character.FriendsBook.Friends);
 }