use of com.faforever.server.matchmaker.MatchMakerCancelRequest in project faf-java-server by FAForever.
the class LegacyRequestTransformer method handleMatchMaking.
private ClientMessage handleMatchMaking(Map<String, Object> source) {
switch((String) source.get("state")) {
case "stop":
return new MatchMakerCancelRequest("ladder1v1");
default:
Object untypedFaction = source.get("faction");
Faction faction;
if (untypedFaction instanceof Number) {
faction = Faction.fromFaValue(((Number) untypedFaction).intValue());
} else {
faction = Faction.fromString((String) untypedFaction);
}
return new MatchMakerSearchRequest(faction, "ladder1v1");
}
}
use of com.faforever.server.matchmaker.MatchMakerCancelRequest in project faf-java-server by FAForever.
the class V2ClientMessageTransformerTest method cancelMatchSearch.
@Test
public void cancelMatchSearch() throws Exception {
ClientMessage result = instance.transform(write(new CancelMatchSearchClientMessage("ladder1v1")));
assertThat(result, is(new MatchMakerCancelRequest("ladder1v1")));
}
use of com.faforever.server.matchmaker.MatchMakerCancelRequest in project faf-java-server by FAForever.
the class LegacyRequestTransformerTest method stopMatchMaking.
@Test
public void stopMatchMaking() throws Exception {
MatchMakerCancelRequest result = (MatchMakerCancelRequest) instance.transform(ImmutableMap.of(KEY_COMMAND, "game_matchmaking", "mod", "ladder1v1", "state", "stop"));
assertThat(result.getPoolName(), is("ladder1v1"));
}
use of com.faforever.server.matchmaker.MatchMakerCancelRequest in project faf-java-server by FAForever.
the class MatchMakerServiceActivatorTest method cancelSearch.
@Test
public void cancelSearch() throws Exception {
instance.cancelSearch(new MatchMakerCancelRequest(LADDER_1V1), authentication);
verify(matchmakerService).cancelSearch(LADDER_1V1, player);
}
Aggregations