Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     bool verifyServer = false;
     BehaviorParms behaviorParms = new BehaviorParms();
     for (int i = 0; i < args.Length; ++i) {
         switch (args[i]) {
         case "--verify_server":
             verifyServer = true;
             break;
         case "--log_level":
             Debug.Assert(i + 1 < args.Length);
             // Logger.LogLevel = int.Parse(args[++i]);
             break;
         case "--max_messages_per_frame":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.MaxMessagesPerFrame = int.Parse(args[++i]);
             break;
         case "--dir_update_interval":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.DirUpdateInterval = int.Parse(args[++i]);
             break;
         case "--orient_update_interval":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.OrientUpdateInterval = int.Parse(args[++i]);
             break;
         case "--move_interval":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.moveInterval = int.Parse(args[++i]);
             break;
         case "--move_maximum":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.moveMaximum = int.Parse(args[++i]);
             break;
         case "--forward_fraction":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.forwardFraction = float.Parse(args[++i]);
             break;
         case "--back_fraction":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.backFraction = float.Parse(args[++i]);
             break;
         case "--rotate_fraction":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.rotateFraction = float.Parse(args[++i]);
             break;
         case "--side_fraction":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.sideFraction = float.Parse(args[++i]);
             break;
         case "--player_speed":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.playerSpeed = float.Parse(args[++i]);
             break;
         case "--rotate_speed":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.rotateSpeed = float.Parse(args[++i]);
             break;
         case "--player_update_interval":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.playerUpdateInterval = int.Parse(args[++i]);
             break;
         case "--max_active_time":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.maxActiveTime = int.Parse(args[++i]);
             break;
         case "--max_idle_time":
             Debug.Assert(i + 1 < args.Length);
             behaviorParms.maxIdleTime = int.Parse(args[++i]);
             break;
         default:
             break;
         }
     }
     Client client = new Client(verifyServer, behaviorParms);
     client.SourceConfig("../" + WorldSettingsFile);
     Trace.TraceInformation("Starting test client");
     try {
         client.Start();
     }
     catch (Exception e) {
         // We get an error, so return an error code of -1
         Trace.TraceInformation(string.Format("TestClient got error '{0}'",
                                              e.Message));
         Trace.Flush();
         System.Environment.Exit(-1);
     }
     Trace.TraceInformation("Exiting test client");
 }
Ejemplo n.º 2
0
 public ConfigParser(Client client, string filename) {
     this.client = client;
     this.filename = filename;
 }