Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Geosearchef committed Nov 17, 2018
1 parent 230e4ee commit 8c17280
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
import com.faforever.server.config.ServerProperties;
import com.faforever.server.coop.CoopMissionResponse;
import com.faforever.server.coop.CoopService;
import com.faforever.server.game.Game;
import com.faforever.server.game.GameResponse;
import com.faforever.server.game.HostGameResponse;
import com.faforever.server.game.StartGameProcessResponse;
import com.faforever.server.game.*;
import com.faforever.server.ice.ForwardedIceMessage;
import com.faforever.server.ice.IceServerList;
import com.faforever.server.integration.ClientGateway;
Expand Down Expand Up @@ -94,7 +91,8 @@ public void startGameProcess(Game game, Player player) {
log.debug("Telling '{}' to start game process for game '{}'", game.getHost(), game);

Optional<Integer> team = game.getPresetParticipants()
.map(gameParticipants -> gameParticipants.get(player.getId()).getTeam());
.flatMap(gameParticipants -> gameParticipants.stream().filter(gameParticipant -> gameParticipant.getId() == player.getId()).findFirst())
.map(GameParticipant::getTeam);

send(new StartGameProcessResponse(game.getFeaturedMod().getTechnicalName(), game.getId(), game.getMapFolderName(), game.getLobbyMode(), team, getCommandLineArgs(player)), player);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.faforever.server.security.User;
import lombok.Getter;
import lombok.Setter;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula;
Expand Down Expand Up @@ -52,6 +53,7 @@ public class Player extends Login implements ConnectionAware {

@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "id", insertable = false, updatable = false)
@JsonIgnore
private User user;

@ManyToOne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ faf-server:
access-token-uri: ${API_ACCESS_TOKEN_URI}
max-page-size: 10000
database:
schema-version: ${DATABASE_SCHEMA_VERSION:59}
schema-version: ${DATABASE_SCHEMA_VERSION:61}
ice:
twilio:
account-sid: ${TWILIO_ACCOUNT_SID:}
Expand Down

0 comments on commit 8c17280

Please sign in to comment.