@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();
        }
    }
@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);
       
        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();
        }
    }
@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); 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(); } }