Search in sources :

Example 6 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method selectAvatar.

@Test
public void selectAvatar() throws Exception {
    ClientMessage result = instance.transform(write(new SelectAvatarClientMessage(1231)));
    assertThat(result, is(new SelectAvatarRequest(1231, null)));
}
Also used : SelectAvatarRequest(com.faforever.server.avatar.SelectAvatarRequest) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Example 7 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method hostGame.

@Test
public void hostGame() throws Exception {
    ClientMessage result = instance.transform(write(new HostGameClientMessage("scmp1", "Game", "faf", "123", GameVisibility.PUBLIC, 500, 900)));
    assertThat(result, is(new HostGameRequest("scmp1", "Game", "faf", "123", GameVisibility.PUBLIC, 500, 900)));
}
Also used : ClientMessage(com.faforever.server.common.ClientMessage) HostGameRequest(com.faforever.server.game.HostGameRequest) Test(org.junit.Test)

Example 8 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method searchMatch.

@Test
public void searchMatch() throws Exception {
    ClientMessage result = instance.transform(write(new SearchMatchClientMessage(Faction.UEF, "ladder1v1")));
    assertThat(result, is(new MatchMakerSearchRequest(Faction.UEF, "ladder1v1")));
}
Also used : ClientMessage(com.faforever.server.common.ClientMessage) MatchMakerSearchRequest(com.faforever.server.matchmaker.MatchMakerSearchRequest) Test(org.junit.Test)

Example 9 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method joinGame.

@Test
public void joinGame() throws Exception {
    ClientMessage result = instance.transform(write(new JoinGameClientMessage(34, "foobar")));
    assertThat(result, is(new JoinGameRequest(34, "foobar")));
}
Also used : ClientMessage(com.faforever.server.common.ClientMessage) JoinGameRequest(com.faforever.server.game.JoinGameRequest) Test(org.junit.Test)

Example 10 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method coopMissionCompleted.

@Test
public void coopMissionCompleted() throws Exception {
    ClientMessage result = instance.transform(write(new CoopMissionCompletedClientMessage(true, false, 300)));
    assertThat(result, is(new CoopMissionCompletedReport(true, false, Duration.ofSeconds(300))));
}
Also used : CoopMissionCompletedReport(com.faforever.server.coop.CoopMissionCompletedReport) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Aggregations

ClientMessage (com.faforever.server.common.ClientMessage)27 Test (org.junit.Test)26 SelectAvatarRequest (com.faforever.server.avatar.SelectAvatarRequest)1 BroadcastRequest (com.faforever.server.client.BroadcastRequest)1 LoginRequest (com.faforever.server.client.LoginRequest)1 CoopMissionCompletedReport (com.faforever.server.coop.CoopMissionCompletedReport)1 RequestException (com.faforever.server.error.RequestException)1 AiOptionReport (com.faforever.server.game.AiOptionReport)1 ArmyScoreReport (com.faforever.server.game.ArmyScoreReport)1 DisconnectPeerRequest (com.faforever.server.game.DisconnectPeerRequest)1 GameChatMessageReport (com.faforever.server.game.GameChatMessageReport)1 GameModsReport (com.faforever.server.game.GameModsReport)1 GameOptionReport (com.faforever.server.game.GameOptionReport)1 GameStateReport (com.faforever.server.game.GameStateReport)1 HostGameRequest (com.faforever.server.game.HostGameRequest)1 JoinGameRequest (com.faforever.server.game.JoinGameRequest)1 PlayerOptionReport (com.faforever.server.game.PlayerOptionReport)1 TeamKillReport (com.faforever.server.game.TeamKillReport)1 IceMessage (com.faforever.server.ice.IceMessage)1 RestoreGameSessionRequest (com.faforever.server.integration.legacy.transformer.RestoreGameSessionRequest)1