Exemple #1
0
        public bool RemovePlayer(Account p)
        {
            bool result = false;

            try
            {
                p.channelId = -1;
                if (p.Session != null)
                {
                    lock (_players)
                    {
                        result = _players.Remove(p.Session);
                    }
                    if (result)
                    {
                        Game_SyncNet.UpdateGSCount(serverId);
                    }
                }
            }
            catch (Exception ex)
            {
                SaveLog.fatal(ex.ToString());
                Printf.b_danger("[Channel.RemovePlayer] Erro fatal!");
            }
            return(result);
        }
Exemple #2
0
 public bool AddPlayer(PlayerSession pS)
 {
     lock (_players)
     {
         if (!_players.Contains(pS))
         {
             _players.Add(pS);
             Game_SyncNet.UpdateGSCount(serverId);
             return(true);
         }
         return(false);
     }
 }
Exemple #3
0
        public bool RemovePlayer(Account p)
        {
            bool flag = false;

            try
            {
                p.channelId = -1;
                if (p.Session != null)
                {
                    lock (this._players)
                        flag = this._players.Remove(p.Session);
                    if (flag)
                    {
                        Game_SyncNet.UpdateGSCount(this.serverId);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.warning(ex.ToString());
            }
            return(flag);
        }