Firewall Option added to the game. Network Starting Game Problem Fixed.\n

origin
stpohle 22 years ago
parent 8d164d38a0
commit a3028d1941

@ -423,7 +423,24 @@ ReadPrgArgs (int argc, char **argv)
strncpy (bman.port, argv[++i], LEN_PORT); strncpy (bman.port, argv[++i], LEN_PORT);
if (!strcmp (argv[i], "-ogcport")) if (!strcmp (argv[i], "-ogcport"))
strncpy (bman.ogc_port, argv[++i], LEN_PORT); strncpy (bman.ogc_port, argv[++i], LEN_PORT);
} if (!strcmp (argv[i], "-firewall"))
bman.firewall = 1;
if (!strcmp (argv[i], "-name"))
strncpy (bman.playername, argv[++i], LEN_PLAYERNAME);
if (!strcmp (argv[i], "-help")) {
printf ("BomberClone Version " VERSION "\n");
printf (" WebPage : http://www.bomberclone.de\n");
printf (" Bug Report to :\n");
printf (" http://sourceforge.net/tracker/?group_id=79449&atid=556629\n");
printf (" Other Comments: steffen@bomberclone.de\n");
printf ("\nProgramm options:\n");
printf (" -name PLAYERNAME - set the Playername\n");
printf (" -port PORT - set the local BomberClone port (Def.: 11000)\n");
printf (" -ogcport PORT - set the local OGC Port (Def.: 11100)\n");
printf (" -firewall - Client is behind a firewall\n");
printf (" Only set this if you get some problems\n");
printf (" with network games.\n");
exit (0);
}
}
}; };

@ -161,10 +161,10 @@ void multiplayer_game () {
net_new_game (); net_new_game ();
game_start (); game_start ();
if (GT_MP_PTPM) { if (GT_MP_PTPM) {
bman.state = GS_update;
net_send_mapinfo (); // maybe we have to make a break net_send_mapinfo (); // maybe we have to make a break
net_send_servermode (); // between mapinfo and servermode net_send_servermode (); // between mapinfo and servermode
} }
bman.state = GS_update;
net_transmit_gamedata (); net_transmit_gamedata ();
if (bman.state == GS_ready || bman.state == GS_running) { if (bman.state == GS_ready || bman.state == GS_running) {

@ -362,7 +362,6 @@ void
send_servermode (_net_addr * addr, int pl_nr) send_servermode (_net_addr * addr, int pl_nr)
{ {
struct pkg_servermode s_mod; struct pkg_servermode s_mod;
d_printf ("Send ServerMode\n");
s_mod.h.typ = PKG_servermode; s_mod.h.typ = PKG_servermode;
s_mod.h.len = HTON16 (sizeof (struct pkg_servermode)); s_mod.h.len = HTON16 (sizeof (struct pkg_servermode));
@ -382,6 +381,26 @@ send_servermode (_net_addr * addr, int pl_nr)
s_mod.fieldsize_x = map.size.x; s_mod.fieldsize_x = map.size.x;
s_mod.fieldsize_y = map.size.y; s_mod.fieldsize_y = map.size.y;
strncpy (s_mod.tileset, map.tileset, LEN_TILESETNAME); strncpy (s_mod.tileset, map.tileset, LEN_TILESETNAME);
switch (s_mod.state) {
case (GS_startup):
d_printf ("Send ServerMode : startup\n");
break;
case (GS_ready):
d_printf ("Send ServerMode : ready\n");
break;
case (GS_running):
d_printf ("Send ServerMode : running\n");
break;
case (GS_quit):
d_printf ("Send ServerMode : quit\n");
break;
case (GS_wait):
d_printf ("Send ServerMode : wait\n");
break;
case (GS_update):
d_printf ("Send ServerMode : wait\n");
break;
}
send_pkg ((struct pkg *) &s_mod, addr); send_pkg ((struct pkg *) &s_mod, addr);
}; };

Loading…
Cancel
Save