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); }
public bool AddPlayer(PlayerSession pS) { lock (_players) { if (!_players.Contains(pS)) { _players.Add(pS); Game_SyncNet.UpdateGSCount(serverId); return(true); } return(false); } }
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); }