Search in sources :

Example 1 with SearchLadder1v1ClientMessage

use of com.faforever.client.rankedmatch.SearchLadder1v1ClientMessage in project downlords-faf-client by FAForever.

the class FafServerAccessorImpl method startSearchLadder1v1.

@Override
public CompletableFuture<GameLaunchMessage> startSearchLadder1v1(Faction faction) {
    gameLaunchFuture = new CompletableFuture<>();
    writeToServer(new SearchLadder1v1ClientMessage(faction));
    return gameLaunchFuture;
}
Also used : StopSearchLadder1v1ClientMessage(com.faforever.client.rankedmatch.StopSearchLadder1v1ClientMessage) SearchLadder1v1ClientMessage(com.faforever.client.rankedmatch.SearchLadder1v1ClientMessage)

Example 2 with SearchLadder1v1ClientMessage

use of com.faforever.client.rankedmatch.SearchLadder1v1ClientMessage in project downlords-faf-client by FAForever.

the class ServerAccessorImplTest method startSearchLadder1v1WithAeon.

@Test
public void startSearchLadder1v1WithAeon() throws Exception {
    connectAndLogIn();
    CompletableFuture<GameLaunchMessage> future = instance.startSearchLadder1v1(Faction.AEON).toCompletableFuture();
    String clientMessage = messagesReceivedByFafServer.poll(TIMEOUT, TIMEOUT_UNIT);
    SearchLadder1v1ClientMessage searchRanked1v1Message = gson.fromJson(clientMessage, SearchLadder1v1ClientMessage.class);
    assertThat(searchRanked1v1Message, instanceOf(SearchLadder1v1ClientMessage.class));
    assertThat(searchRanked1v1Message.getFaction(), is(Faction.AEON));
    GameLaunchMessage gameLaunchMessage = new GameLaunchMessage();
    gameLaunchMessage.setUid(1234);
    sendFromServer(gameLaunchMessage);
    assertThat(future.get(TIMEOUT, TIMEOUT_UNIT).getUid(), is(gameLaunchMessage.getUid()));
}
Also used : SearchLadder1v1ClientMessage(com.faforever.client.rankedmatch.SearchLadder1v1ClientMessage) StopSearchLadder1v1ClientMessage(com.faforever.client.rankedmatch.StopSearchLadder1v1ClientMessage) GameLaunchMessage(com.faforever.client.remote.domain.GameLaunchMessage) Test(org.junit.Test) AbstractPlainJavaFxTest(com.faforever.client.test.AbstractPlainJavaFxTest)

Aggregations

SearchLadder1v1ClientMessage (com.faforever.client.rankedmatch.SearchLadder1v1ClientMessage)2 StopSearchLadder1v1ClientMessage (com.faforever.client.rankedmatch.StopSearchLadder1v1ClientMessage)2 GameLaunchMessage (com.faforever.client.remote.domain.GameLaunchMessage)1 AbstractPlainJavaFxTest (com.faforever.client.test.AbstractPlainJavaFxTest)1 Test (org.junit.Test)1