equal
deleted
inserted
replaced
157 " -g [savegame] = Start new/save game immediately\n" |
157 " -g [savegame] = Start new/save game immediately\n" |
158 " -G seed = Set random seed\n" |
158 " -G seed = Set random seed\n" |
159 #if defined(ENABLE_NETWORK) |
159 #if defined(ENABLE_NETWORK) |
160 " -n [ip:port#player] = Start networkgame\n" |
160 " -n [ip:port#player] = Start networkgame\n" |
161 " -D [ip][:port] = Start dedicated server\n" |
161 " -D [ip][:port] = Start dedicated server\n" |
|
162 " -l ip[:port] = Redirect DEBUG()\n" |
162 #if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32) |
163 #if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32) |
163 " -f = Fork into the background (dedicated only)\n" |
164 " -f = Fork into the background (dedicated only)\n" |
164 #endif |
165 #endif |
165 #endif /* ENABLE_NETWORK */ |
166 #endif /* ENABLE_NETWORK */ |
166 " -i = Force to use the DOS palette\n" |
167 " -i = Force to use the DOS palette\n" |
342 bool save_config = true; |
343 bool save_config = true; |
343 #if defined(ENABLE_NETWORK) |
344 #if defined(ENABLE_NETWORK) |
344 bool dedicated = false; |
345 bool dedicated = false; |
345 bool network = false; |
346 bool network = false; |
346 char *network_conn = NULL; |
347 char *network_conn = NULL; |
|
348 char *debuglog_conn = NULL; |
347 char *dedicated_host = NULL; |
349 char *dedicated_host = NULL; |
348 uint16 dedicated_port = 0; |
350 uint16 dedicated_port = 0; |
349 #endif /* ENABLE_NETWORK */ |
351 #endif /* ENABLE_NETWORK */ |
350 |
352 |
351 musicdriver[0] = sounddriver[0] = videodriver[0] = '\0'; |
353 musicdriver[0] = sounddriver[0] = videodriver[0] = '\0'; |
358 |
360 |
359 // The last param of the following function means this: |
361 // The last param of the following function means this: |
360 // a letter means: it accepts that param (e.g.: -h) |
362 // a letter means: it accepts that param (e.g.: -h) |
361 // a ':' behind it means: it need a param (e.g.: -m<driver>) |
363 // a ':' behind it means: it need a param (e.g.: -m<driver>) |
362 // a '::' behind it means: it can optional have a param (e.g.: -d<debug>) |
364 // a '::' behind it means: it can optional have a param (e.g.: -d<debug>) |
363 optformat = "m:s:v:hD::n::eit:d::r:g::G:c:x" |
365 optformat = "m:s:v:hD::n::eit:d::r:g::G:c:xl:" |
364 #if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32) |
366 #if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32) |
365 "f" |
367 "f" |
366 #endif |
368 #endif |
367 ; |
369 ; |
368 |
370 |
392 case 'f': _dedicated_forks = true; break; |
394 case 'f': _dedicated_forks = true; break; |
393 case 'n': |
395 case 'n': |
394 network = true; |
396 network = true; |
395 network_conn = mgo.opt; // optional IP parameter, NULL if unset |
397 network_conn = mgo.opt; // optional IP parameter, NULL if unset |
396 break; |
398 break; |
|
399 case 'l': |
|
400 debuglog_conn = mgo.opt; |
|
401 break; |
397 #endif /* ENABLE_NETWORK */ |
402 #endif /* ENABLE_NETWORK */ |
398 case 'r': ParseResolution(resolution, mgo.opt); break; |
403 case 'r': ParseResolution(resolution, mgo.opt); break; |
399 case 't': startyear = atoi(mgo.opt); break; |
404 case 't': startyear = atoi(mgo.opt); break; |
400 case 'd': { |
405 case 'd': { |
401 #if defined(WIN32) |
406 #if defined(WIN32) |
487 |
492 |
488 // restore saved music volume |
493 // restore saved music volume |
489 _music_driver->set_volume(msf.music_vol); |
494 _music_driver->set_volume(msf.music_vol); |
490 |
495 |
491 NetworkStartUp(); // initialize network-core |
496 NetworkStartUp(); // initialize network-core |
|
497 |
|
498 #if defined(ENABLE_NETWORK) |
|
499 if (debuglog_conn != NULL && _network_available) { |
|
500 const char *not_used = NULL; |
|
501 const char *port = NULL; |
|
502 uint16 rport; |
|
503 |
|
504 rport = NETWORK_DEFAULT_DEBUGLOG_PORT; |
|
505 |
|
506 ParseConnectionString(¬_used, &port, debuglog_conn); |
|
507 if (port != NULL) rport = atoi(port); |
|
508 |
|
509 NetworkStartDebugLog(debuglog_conn, rport); |
|
510 } |
|
511 #endif /* ENABLE_NETWORK */ |
492 |
512 |
493 ScanNewGRFFiles(); |
513 ScanNewGRFFiles(); |
494 |
514 |
495 _opt_ptr = &_opt_newgame; |
515 _opt_ptr = &_opt_newgame; |
496 ResetGRFConfig(false); |
516 ResetGRFConfig(false); |