From 9458b32502a0e2aad4ffbc62dc235a02e3254758 Mon Sep 17 00:00:00 2001 From: stpohle Date: Mon, 28 Mar 2005 18:20:18 +0000 Subject: [PATCH] fixed problems with the broadcasting stuff.. and the new game list --- ChangeLog | 5 +++-- configure.in | 2 +- src/netsrvlist.c | 19 +++++++++++++++---- tools/cross-mingw32-linux.sh | 3 ++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64b413f..be64f46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.98 2005/03/28 03:39:51 stpohle Exp $ +$Id: ChangeLog,v 1.99 2005/03/28 18:20:18 stpohle Exp $ Version 0.11.6 ============== @@ -8,7 +8,8 @@ Version 0.11.6 - Fixed: pkg_resendcache, no right calaculation for the size of the saved packet. -- Changed: Version number of network games will show up. +- Changed: Version number and the ping time to each game + (ver 0.11.6 or later) of network games will show up. - Added: Parameter -gamename to set the games name from the command line. diff --git a/configure.in b/configure.in index 7998bfd..34f1729 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl Please disable it in the Anjuta project configuration AC_INIT(configure.in) AC_CANONICAL_TARGET -AM_INIT_AUTOMAKE(bomberclone, 0.11.6b) +AM_INIT_AUTOMAKE(bomberclone, 0.11.6c) AM_CONFIG_HEADER(config.h) diff --git a/src/netsrvlist.c b/src/netsrvlist.c index dadfb1d..afdb9ce 100644 --- a/src/netsrvlist.c +++ b/src/netsrvlist.c @@ -1,4 +1,4 @@ -/* $Id: netsrvlist.c,v 1.13 2005/03/28 16:38:35 stpohle Exp $ +/* $Id: netsrvlist.c,v 1.14 2005/03/28 18:20:26 stpohle Exp $ * netsrvlist.c - shows a list of possible servers.*/ #include "basic.h" @@ -42,7 +42,7 @@ void srvlist_rebuildlist () { srvlst_dat[i].version[0] = 0; srvlst_dat[i].gamename[0] = 0; srvlst_dat[i].comment[0] = 0; - srvlst_dat[i].ping = 0; + srvlst_dat[i].ping = -1; } srvlst_cnt = 0; @@ -54,6 +54,7 @@ void srvlist_rebuildlist () { strncpy (srvlst_dat[srvlst_cnt].port, broadcast_list[i].port, LEN_PORT); strncpy (srvlst_dat[srvlst_cnt].version, broadcast_list[i].version, LEN_VERSION); strncpy (srvlst_dat[srvlst_cnt].gamename, broadcast_list[i].gamename, LEN_GAMENAME); + srvlst_dat[srvlst_cnt].ping = broadcast_list[i].ping; srvlst_dat[srvlst_cnt].ai_family = bman.net_ai_family; if (broadcast_list[i].lan) sprintf (srvlst_dat[srvlst_cnt].comment, "LAN"); @@ -144,7 +145,6 @@ void net_getserver () { if ((timestamp - srvlst_lastrebuild) > SRVLST_TIMEREBUILD) { srvlist_rebuildlist (); srvlst_lastrebuild = timestamp; - menu_reload (menu); srvlst_listmenu->changed = 1; menu_draw (menu); } @@ -156,7 +156,7 @@ void net_getserver () { menuselect = menu->focus->id; newentry = sel_entry - &srvlst_text[0]; - if (newentry != entry) { + if ((newentry != entry || (bman.servername[0] == 0 && srvlst_dat[entry].host[0] != 0)) && menu->focus->id != 2) { entry = newentry; d_printf ("Selected Entry (%d) %s:%s Game:%s\n", entry, srvlst_dat[entry].host, srvlst_dat[entry].port, srvlst_dat[entry].gamename); if (srvlst_dat[entry].host[0] != 0 @@ -176,6 +176,17 @@ void net_getserver () { menuselect = -1; break; case (1): // Join a Game + entry = newentry; + d_printf ("Selected Entry (%d) %s:%s Game:%s\n", entry, srvlst_dat[entry].host, srvlst_dat[entry].port, srvlst_dat[entry].gamename); + if (srvlst_dat[entry].host[0] != 0 + && srvlst_dat[entry].port[0] != 0 + && srvlst_dat[entry].gamename[0] != 0) { /* test if there was a selection */ + bman.net_ai_family = srvlst_dat[entry].ai_family; + sprintf (bman.servername, "%s:%s", srvlst_dat[entry].host, srvlst_dat[entry].port); + } + srvlst_listmenu->changed = 1; + menu_reload (menu); + menu_draw (menu); menu_focus_id (menu, 0); break; } diff --git a/tools/cross-mingw32-linux.sh b/tools/cross-mingw32-linux.sh index 21606c2..2d80237 100755 --- a/tools/cross-mingw32-linux.sh +++ b/tools/cross-mingw32-linux.sh @@ -3,6 +3,8 @@ # to use this please read http://www.libsdl.org/extras/win32/cross/README.txt # from there i have got all this. + + PREFIX=/usr/local/cross-tools TARGET=i386-mingw32msvc PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH" @@ -19,4 +21,3 @@ make clean make $* strip src/bomberclone.exe -