示例#1
0
        //ToDo
        public static void RemovePlayer(IConnection connection, int playerId)
        {
            Player p = connection.Account.Players.FirstOrDefault(player => player.PlayerId == playerId);

            if (p == null)
            {
                return;
            }

            if (Cache.UsedNames.Contains(p.PlayerData.Name.ToLower()))
            {
                Cache.UsedNames.Remove(p.PlayerData.Name.ToLower());
            }

            PartyService.LeaveParty(p);
            GuildService.LeaveGuild(p, p.Guild);
            connection.Account.Players.Remove(connection.Account.Players.FirstOrDefault(player => player.PlayerId == playerId));
            FeedbackService.SendCharRemove(connection);
        }