public bool RemovePlayer(IGamePlayer player) { bool result = false; List <IGamePlayer> players; Monitor.Enter(players = this.m_players); try { if (this.m_players.Remove(player)) { result = true; } } finally { Monitor.Exit(players); } if (this.PlayerCount == 0) { ProxyRoomMgr.RemoveRoom(this); this.Dispose(); } else { this.m_client.SendRemovePlayer(player.PlayerCharacter.ID, this.m_orientRoomId); } return(result); }
public void Execute() { ProxyRoom room = ProxyRoomMgr.GetRoom(m_roomId); if (room != null) { bool result = ProxyRoomMgr.RemoveRoom(m_roomId); room.SendCancelPickUp(result); } }
public bool RemovePlayer(IGamePlayer player) { bool result = false; lock (m_players) { if (m_players.Remove(player)) { result = true; } } if (PlayerCount == 0) { ProxyRoomMgr.RemoveRoom(this); } return(result); }
public bool RemovePlayer(IGamePlayer player) { bool result = false; List <IGamePlayer> players; Monitor.Enter(players = this.m_players); try { if (this.m_players.Remove(player)) { result = true; } } finally { Monitor.Exit(players); } if (this.PlayerCount == 0) { ProxyRoomMgr.RemoveRoom(this); } return(result); }