private static Object parseCmd(Console console) {
        String line = console.readLine();
        String[] args = line.trim().split("\\s+");
        if (args.length != 3) {
            console.printf("Bad cmd: %s", line);
            return null;
        }
        
        try {
            int msgId = Integer.parseInt(args[1]);
            return new Gson().fromJson(args[2], MsgRegistry.getMsgClass(msgId));
        } catch (Exception e) { // todo
            console.writer().println(e.getMessage());
            return null;
        }
    }