Skip to content

Commit

Permalink
Merge pull request akorobeinikov#10 from akorobeinikov/develop
Browse files Browse the repository at this point in the history
Add game start after connecting second player
  • Loading branch information
akorobeinikov authored Nov 24, 2020
2 parents c23bdee + cde3183 commit 247cedc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/server/mvp/Model/ModelServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ public void addPresenter(int p_id, IPresenter p) {
generateNewItem(p_id);
free_games.offerLast(games.size()-1);
} else {
presenter_game.add(p_id, free_games.pollFirst());
int gameId = free_games.pollFirst();
presenter_game.add(p_id, gameId);
updateSecondPlayer(p_id);
gameStart(gameId);
}
addSnake(p_id);
refresh(getGameId(p_id));
Expand Down

0 comments on commit 247cedc

Please sign in to comment.