Search in sources :

Example 1 with GpgGameMessage

use of com.faforever.client.fa.relay.GpgGameMessage in project downlords-faf-client by FAForever.

the class IceAdapterCallbacks method onGpgNetMessageReceived.

public void onGpgNetMessageReceived(String header, List<Object> chunks) {
    log.debug("Message from game: '{}' '{}'", header, chunks);
    eventBus.post(new GpgGameMessageEvent(new GpgGameMessage(header, chunks)));
}
Also used : GpgGameMessageEvent(com.faforever.client.fa.relay.ice.event.GpgGameMessageEvent) GpgGameMessage(com.faforever.client.fa.relay.GpgGameMessage)

Example 2 with GpgGameMessage

use of com.faforever.client.fa.relay.GpgGameMessage 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);
}
Also used : GpgClientCommand(com.faforever.client.fa.relay.GpgClientCommand) RehostRequestEvent(com.faforever.client.fa.relay.event.RehostRequestEvent) GameFullEvent(com.faforever.client.fa.relay.event.GameFullEvent) GpgGameMessage(com.faforever.client.fa.relay.GpgGameMessage) Subscribe(com.google.common.eventbus.Subscribe)

Aggregations

GpgGameMessage (com.faforever.client.fa.relay.GpgGameMessage)2 GpgClientCommand (com.faforever.client.fa.relay.GpgClientCommand)1 GameFullEvent (com.faforever.client.fa.relay.event.GameFullEvent)1 RehostRequestEvent (com.faforever.client.fa.relay.event.RehostRequestEvent)1 GpgGameMessageEvent (com.faforever.client.fa.relay.ice.event.GpgGameMessageEvent)1 Subscribe (com.google.common.eventbus.Subscribe)1