// TODO: replace with login
@PostMapping(value = "/{id}/msg", consumes = "text/plain", produces = "text/plain")
    public String receiveOrderAndReturnResult(@PathVariable int id, @RequestBody String command) {
        command = command.toLowerCase().trim();
        logger.debug("User (" + id + ") sent command: " + command);
        // TODO: replace with login
        if ("start".equals(command)) {
            return gameService.pickClass(id);
        }
        try {
            var result = gameService.execute(id, command);
            logger.trace("Adding color to Result with message:");
            logger.debug(result.getMessage());
            return addColor(result);
        } catch (InvalidCommandException e) {
            logger.debug("Parsing user provided command failed.", e);
            return e.getMessage();
        }
    }
command = command.toLowerCase().trim();
logger.debug("User (" + id + ") sent command: " + command);
// TODO: replace with login
if ("start".equals(command)) {
return gameService.pickClass(id);
@PostMapping(value = "/{id}/msg", consumes = "text/plain", produces = "text/plain")
public String receiveOrderAndReturnResult(@PathVariable int id, @RequestBody String command) {
command = command.toLowerCase().trim();
logger.debug("User (" + id + ") sent command: " + command);
// TODO: replace with login
if ("start".equals(command)) {
return gameService.pickClass(id);
}
try {
var result = gameService.execute(id, command);
logger.trace("Adding color to Result with message:");
logger.debug(result.getMessage());
return addColor(result);
} catch (InvalidCommandException e) {
logger.debug("Parsing user provided command failed.", e);
@PostMapping(value = "/{id}/msg", consumes = "text/plain", produces = "text/plain")
public String receiveOrderAndReturnResult(@PathVariable int id, @RequestBody String command) {
command = command.toLowerCase().trim();
logger.debug("User (" + id + ") sent command: " + command);
// TODO: replace with login
if ("start".equals(command)) {
return gameService.pickClass(id);
}
try {
var result = gameService.execute(id, command);
logger.trace("Adding color to Result with message:");
logger.debug(result.getMessage());
return addColor(result);
} catch (InvalidCommandException e) {
logger.debug("Parsing user provided command failed.", e);
return e.getMessage();
}
}