Exemplo n.º 1
0
        private static string addRobot(DBStorage db, string message)
        {
            Robot robot;

            try
            {
                robot = (Robot)JsonConvert.DeserializeObject(message, typeof(Robot));
            }
            catch (Exception) { return("ERR"); }
            if (robot == null || !robot.isValid())
            {
                return("ERR");
            }

            return("" + db.addRobot(robot));
        }