Added -ip_hostaddr argument to specify a host IP address via command-line/INI
This commit is contained in:
parent
e655c3115b
commit
0b523c15be
|
@ -1,5 +1,9 @@
|
|||
D2X-Rebirth Changelog
|
||||
|
||||
20070809
|
||||
--------
|
||||
d2x.ini, include/args.h, main/inferno.c, main/menu.c, misc/args.c: Added -ip_hostaddr argument to specify a host IP address via command-line/INI
|
||||
|
||||
20070808
|
||||
--------
|
||||
main/config.c, main/game.c, main/menu.c, main/movie.c, main/piggy.c, main/polyobj.c, main/titles.c, main/titles.h: Set default value for Game_screen_mode which is necessary if there's no config file yet; Made resolution switching more failsafe by not allowing resolutions below 320x200; Cleaned up briefings code (I hope so)
|
||||
|
|
1
d2x.ini
1
d2x.ini
|
@ -54,6 +54,7 @@
|
|||
;-playermessages View only messages from other players in multi - overrides -noredundancy
|
||||
;-packets <n> Specifies the number of packets per second
|
||||
;-ipxnetwork <n> Use IPX network number <n>
|
||||
;-ip_hostaddr <n> Use <n> as host ip address
|
||||
;-ip_nogetmyaddr Prevent autodetection of local ip address
|
||||
;-ip_myaddr <n> Use <a> as local ip address
|
||||
;-ip_bind_addr <n> Bind to <a> instead of INADDR_ANY
|
||||
|
|
|
@ -82,6 +82,7 @@ typedef struct Arg
|
|||
int MplPlayerMessages;
|
||||
int MplPacketsPerSec;
|
||||
const char *MplIpxNetwork;
|
||||
char *MplIpHostAddr;
|
||||
int MplIpNoGetMyAddr;
|
||||
char *MplIpMyAddr;
|
||||
int MplIpBasePort;
|
||||
|
|
|
@ -203,6 +203,7 @@ void print_commandline_help()
|
|||
printf( " -playermessages %s\n", "View only messages from other players in multi - overrides -noredundancy");
|
||||
printf( " -packets <n> %s\n", "Specifies the number of packets per second\n");
|
||||
printf( " -ipxnetwork <n> %s\n", "Use IPX network number <n>");
|
||||
printf( " -ip_hostaddr <n> %s\n", "Use <n> as host ip address");
|
||||
printf( " -ip_nogetmyaddr %s\n", "Prevent autodetection of local ip address");
|
||||
printf( " -ip_myaddr <n> %s\n", "Use <a> as local ip address");
|
||||
printf( " -ip_baseport <n> %s\n", "Use <p> as offset from normal port (allows multiple instances of d1x to be run on a single computer)");
|
||||
|
|
|
@ -1008,18 +1008,18 @@ void do_ip_manual_join_menu()
|
|||
newmenu_item m[3];
|
||||
int choice = 0, num_options = 0;
|
||||
int old_game_mode;
|
||||
char buf[128]="";
|
||||
// char buf[128]="";
|
||||
|
||||
do {
|
||||
old_game_mode = Game_mode;
|
||||
num_options = 0;
|
||||
|
||||
m[num_options].type = NM_TYPE_INPUT; m[num_options].text=buf; m[num_options].text_len=128;menu_choice[num_options]=-1; num_options++;
|
||||
m[num_options].type = NM_TYPE_INPUT; m[num_options].text=GameArg.MplIpHostAddr; m[num_options].text_len=128;menu_choice[num_options]=-1; num_options++;
|
||||
|
||||
choice = newmenu_do1( NULL, "ENTER IP OR HOSTNAME", num_options, m, NULL, choice );
|
||||
|
||||
if ( choice > -1 )
|
||||
ip_connect_manual(buf);
|
||||
ip_connect_manual(GameArg.MplIpHostAddr);
|
||||
|
||||
if (old_game_mode != Game_mode)
|
||||
break; // leave menu
|
||||
|
|
|
@ -345,6 +345,11 @@ void ReadCmdArgs(void)
|
|||
else
|
||||
GameArg.MplIpxNetwork = NULL;
|
||||
|
||||
if ((t=FindArg("-ip_hostaddr")))
|
||||
GameArg.MplIpHostAddr = Args[t+1];
|
||||
else
|
||||
GameArg.MplIpHostAddr = "";
|
||||
|
||||
if (FindArg("-ip_nogetmyaddr"))
|
||||
GameArg.MplIpNoGetMyAddr = 1;
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue