-
@Controller()@ConditionalOnBean(value = {Server.class}) public final class BaseController
-
-
Constructor Summary
Constructors Constructor Description BaseController(Server server, SimpMessagingTemplate socket)
-
Method Summary
Modifier and Type Method Description final UnitonConnect(SessionConnectEvent e)final UnitonDisconnect(SessionDisconnectEvent e)final Stringon400Error(IllegalArgumentException e)final Stringon500Error(IllegalStateException e)final StringfindLastGame(@ModelAttribute() User user)final Iterable<String>getGames()final GamegetGame(@DestinationVariable() String gameCode)final StringcreateGame(@DestinationVariable() String gameCode, @ModelAttribute() User user)final GamejoinGame(@DestinationVariable() String gameCode, @Payload() Map<String, Object> settings, @ModelAttribute() User user)final GameupdateSettings(@DestinationVariable() String gameCode, @Payload() Map<String, Object> settings, @ModelAttribute() User user)final StringbecomeAdmin(@DestinationVariable() String gameCode, @ModelAttribute() User user)-
-
Constructor Detail
-
BaseController
BaseController(Server server, SimpMessagingTemplate socket)
-
-
Method Detail
-
onDisconnect
@EventListener() final Unit onDisconnect(SessionDisconnectEvent e)
-
on400Error
@MessageExceptionHandler()@SendToUser(value = {/topic/errors/client}) final String on400Error(IllegalArgumentException e)
-
on500Error
@MessageExceptionHandler()@SendToUser(value = {/topic/errors/server}) final String on500Error(IllegalStateException e)
-
findLastGame
@SubscribeMapping(value = {/rejoin-game}) final String findLastGame(@ModelAttribute() User user)
-
getGame
@SubscribeMapping(value = {/games/{gameCode}}) final Game getGame(@DestinationVariable() String gameCode)
-
createGame
@MessageMapping(value = {/games/{gameCode}/create})@SendToUser(value = {/topic/successes}) final String createGame(@DestinationVariable() String gameCode, @ModelAttribute() User user)
-
joinGame
@MessageMapping(value = {/games/{gameCode}/join})@SendTo(value = {/topic/games/{gameCode}}) final Game joinGame(@DestinationVariable() String gameCode, @Payload() Map<String, Object> settings, @ModelAttribute() User user)
-
updateSettings
@MessageMapping(value = {/games/{gameCode}/update})@SendTo(value = {/topic/games/{gameCode}}) final Game updateSettings(@DestinationVariable() String gameCode, @Payload() Map<String, Object> settings, @ModelAttribute() User user)
-
becomeAdmin
@MessageMapping(value = {/games/{gameCode}/become-admin})@SendToUser(value = {/topic/successes}) final String becomeAdmin(@DestinationVariable() String gameCode, @ModelAttribute() User user)
-
-
-
-