-
@Controller()@ConditionalOnBean(value = {IServer.class}) public final class BaseController
-
-
Constructor Summary
Constructors Constructor Description BaseController(IServer 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 IGamegetGame(@DestinationVariable() String gameCode)final StringcreateGame(@DestinationVariable() String gameCode, @ModelAttribute() User user)final IGamejoinGame(@DestinationVariable() String gameCode, @Payload() Map<String, Object> settings, @ModelAttribute() User user)final IGameupdateSettings(@DestinationVariable() String gameCode, @Payload() Map<String, Object> settings, @ModelAttribute() User user)final StringbecomeAdmin(@DestinationVariable() String gameCode, @ModelAttribute() User user)-
-
Constructor Detail
-
BaseController
BaseController(IServer 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 IGame 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 IGame joinGame(@DestinationVariable() String gameCode, @Payload() Map<String, Object> settings, @ModelAttribute() User user)
-
updateSettings
@MessageMapping(value = {/games/{gameCode}/update})@SendTo(value = {/topic/games/{gameCode}}) final IGame 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)
-
-
-
-