use of com.faforever.server.game.StartGameProcessResponse in project faf-java-server by FAForever.
the class ClientService method startGameProcess.
public void startGameProcess(Game game, Player player) {
log.debug("Telling '{}' to start game process for game '{}'", game.getHost(), game);
send(new StartGameProcessResponse(game.getFeaturedMod().getTechnicalName(), game.getId(), getCommandLineArgs(player)), player);
}
use of com.faforever.server.game.StartGameProcessResponse in project faf-java-server by FAForever.
the class V2ServerMessageTransformerTest method startGameProcess.
@Test
public void startGameProcess() throws Exception {
String response = instance.transform(new StartGameProcessResponse("faf", 1, Arrays.asList("/foo", "/bar")));
assertThat(response, is("{\"data\":{\"mod\":\"faf\",\"gameId\":1,\"commandLineArguments\":[\"/foo\",\"/bar\"]},\"type\":\"startGameProcess\"}"));
}
use of com.faforever.server.game.StartGameProcessResponse in project faf-java-server by FAForever.
the class LaunchGameResponseTransformerTest method transform.
@Test
public void transform() throws Exception {
Map<String, Serializable> result = LaunchGameResponseTransformer.INSTANCE.transform(new StartGameProcessResponse("faf", 4, Arrays.asList("/numgames", "4")));
assertThat(result.get("command"), is("game_launch"));
assertThat(result.get("mod"), is("faf"));
assertThat(result.get("uid"), is(4));
assertThat(result.get("args"), is(new String[] { "/numgames 4" }));
}
use of com.faforever.server.game.StartGameProcessResponse in project faf-java-server by FAForever.
the class ClientServiceTest method startGameProcess.
@Test
public void startGameProcess() throws Exception {
Game game = new Game().setId(1).setFeaturedMod(new FeaturedMod());
instance.startGameProcess(game, player);
ArgumentCaptor<StartGameProcessResponse> captor = ArgumentCaptor.forClass(StartGameProcessResponse.class);
verify(clientGateway).send(captor.capture(), any());
assertThat(captor.getValue().getGameId(), is(1));
}
Aggregations