@WsSubscribe
public void handleSetRule(WebSocket ws, SetRuleMessage msg) {
if (!msg.getGameId().equals(game.getGameId())) throw new IllegalArgumentException("Invalid game id.");
if (gameStarted) throw new IllegalArgumentException("Game is already started.");
CustomRule rule = msg.getRule();
if (msg.isEnabled()) {
game.getCustomRules().add(rule);
} else {
game.getCustomRules().remove(rule);
}