Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public PvpGame getGamePlayerIsIn(Player player)
- {
- List<PvpGame> games;
- synchronized(this.games)
- { games = new ArrayList<PvpGame>(this.games); }
- for(PvpGame game : games)
- {
- synchronized(game.playersInLobby)
- {
- if(game.playersInLobby.contains(player))
- return game;
- }
- synchronized(game.playersInGame)
- {
- if(game.playersInGame.contains(player))
- return game;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment