use of com.faforever.client.fa.relay.GpgClientCommand in project downlords-faf-client by FAForever.
the class GpgGameMessageTypeAdapterTest method testRead.
@Test
public void testRead() throws Exception {
JsonReader in = mock(JsonReader.class);
when(in.nextString()).thenReturn(GpgClientCommand.CHAT.getString());
GpgClientCommand gpgClientCommand = instance.read(in);
assertEquals(GpgClientCommand.CHAT, gpgClientCommand);
}
use of com.faforever.client.fa.relay.GpgClientCommand in project downlords-faf-client by FAForever.
the class IceAdapterImpl method onGpgGameMessage.
@Subscribe
public void onGpgGameMessage(GpgGameMessageEvent event) {
GpgGameMessage gpgGameMessage = event.getGpgGameMessage();
GpgClientCommand command = gpgGameMessage.getCommand();
if (command == GpgClientCommand.REHOST) {
eventBus.post(new RehostRequestEvent());
return;
}
if (command == GpgClientCommand.GAME_FULL) {
eventBus.post(new GameFullEvent());
return;
}
fafService.sendGpgGameMessage(gpgGameMessage);
}
Aggregations