diff --git a/src/configuration.c b/src/configuration.c index a3d7fcf..363fa5a 100644 --- a/src/configuration.c +++ b/src/configuration.c @@ -423,7 +423,24 @@ ReadPrgArgs (int argc, char **argv) strncpy (bman.port, argv[++i], LEN_PORT); if (!strcmp (argv[i], "-ogcport")) 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); + } + } }; diff --git a/src/netmenu.c b/src/netmenu.c index 9f155bf..c338155 100644 --- a/src/netmenu.c +++ b/src/netmenu.c @@ -161,10 +161,10 @@ void multiplayer_game () { net_new_game (); game_start (); if (GT_MP_PTPM) { + bman.state = GS_update; net_send_mapinfo (); // maybe we have to make a break net_send_servermode (); // between mapinfo and servermode } - bman.state = GS_update; net_transmit_gamedata (); if (bman.state == GS_ready || bman.state == GS_running) { diff --git a/src/packets.c b/src/packets.c index 9a21b78..c0642e3 100644 --- a/src/packets.c +++ b/src/packets.c @@ -362,8 +362,7 @@ void send_servermode (_net_addr * addr, int pl_nr) { struct pkg_servermode s_mod; - d_printf ("Send ServerMode\n"); - + s_mod.h.typ = PKG_servermode; s_mod.h.len = HTON16 (sizeof (struct pkg_servermode)); s_mod.h.flags = PKGF_ackreq; @@ -382,6 +381,26 @@ send_servermode (_net_addr * addr, int pl_nr) s_mod.fieldsize_x = map.size.x; s_mod.fieldsize_y = map.size.y; 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); };