use of com.faforever.server.game.ArmyScoreReport in project faf-java-server by FAForever.
the class V2ClientMessageTransformerTest method armyScore.
@Test
public void armyScore() throws Exception {
ClientMessage result = instance.transform(write(new ArmyScoreClientMessage(1, 10)));
assertThat(result, is(new ArmyScoreReport(1, 10)));
}
use of com.faforever.server.game.ArmyScoreReport in project faf-java-server by FAForever.
the class LegacyRequestTransformer method handleGameResult.
private ClientMessage handleGameResult(Map<String, Object> source) {
List<Object> args;
args = getArgs(source);
int armyId = (int) args.get(0);
String[] results = ((String) args.get(1)).split(" ");
if ("score".equals(results[0])) {
return new ArmyScoreReport(armyId, Integer.parseInt(results[1]));
}
Outcome outcome = Outcome.fromString(results[0]);
return ArmyOutcomeReport.valueOf(armyId, outcome);
}
use of com.faforever.server.game.ArmyScoreReport in project faf-java-server by FAForever.
the class GameServiceActivatorsTest method reportArmyScore.
@Test
public void reportArmyScore() throws Exception {
instance.reportArmyScore(new ArmyScoreReport(1, 10), clientConnection.getAuthentication());
verify(gameService).reportArmyScore(player, 1, 10);
}
use of com.faforever.server.game.ArmyScoreReport in project faf-java-server by FAForever.
the class LegacyRequestTransformerTest method transformGameResultToArmyScoreReport.
@Test
public void transformGameResultToArmyScoreReport() throws Exception {
ArmyScoreReport armyScoreReport = (ArmyScoreReport) instance.transform(ImmutableMap.of(KEY_COMMAND, "GameResult", KEY_ARGS, Arrays.asList(1, "score 10")));
assertThat(armyScoreReport, is(notNullValue()));
assertThat(armyScoreReport.getArmyId(), is(1));
assertThat(armyScoreReport.getScore(), is(10));
}
Aggregations