Skip to content

Commit

Permalink
[backend] throw websocket events for game_status_change & round_statu…
Browse files Browse the repository at this point in the history
…s_change

#12
  • Loading branch information
OliverWich committed Jan 24, 2022
1 parent 40ec2ce commit 3f1687a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void consumeGameStatusEvent(@Header String eventId,
gameStatusEventRepository.save(gameStatusEvent);
logger.info("saved game event with status " + gameStatusEvent.getStatus().toString());
gameApplicationService.gameStatusExternallyChanged(gameStatusEvent.getGameId(), gameStatusEvent.getStatus());
this.template.convertAndSend("game_events", "Game " + gameStatusEvent.getGameId() + " changed its Status to: " + gameStatusEvent.getStatus());
this.template.convertAndSend("game_events", "game_status_change");
} catch (Exception e) {
this.kafkaErrorService.newKafkaError("status", payload, e.getMessage());
}
Expand All @@ -62,6 +62,7 @@ public void consumeRoundStatusEvent(@Header String eventId, @Header String times
roundStatusEventRepository.save(roundStatusEvent);
logger.info("saved round event with status "+roundStatusEvent.getRoundStatus().toString());
gameApplicationService.roundStatusExternallyChanged(roundStatusEvent.getEventId(), roundStatusEvent.getRoundNumber(), roundStatusEvent.getRoundStatus());
this.template.convertAndSend("game_events", "round_status_change");
} catch (KafkaException e) {
this.kafkaErrorService.newKafkaError("roundStatus", payload, e.getMessage());
}
Expand Down

0 comments on commit 3f1687a

Please sign in to comment.