fixed problems with the broadcasting stuff.. and the new game list

origin
stpohle 21 years ago
parent 441ffa7c71
commit 9458b32502

@ -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 Version 0.11.6
============== ==============
@ -8,7 +8,8 @@ Version 0.11.6
- Fixed: pkg_resendcache, no right calaculation for the size of - Fixed: pkg_resendcache, no right calaculation for the size of
the saved packet. 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 - Added: Parameter -gamename to set the games name from the
command line. command line.

@ -5,7 +5,7 @@ dnl Please disable it in the Anjuta project configuration
AC_INIT(configure.in) AC_INIT(configure.in)
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(bomberclone, 0.11.6b) AM_INIT_AUTOMAKE(bomberclone, 0.11.6c)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)

@ -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.*/ * netsrvlist.c - shows a list of possible servers.*/
#include "basic.h" #include "basic.h"
@ -42,7 +42,7 @@ void srvlist_rebuildlist () {
srvlst_dat[i].version[0] = 0; srvlst_dat[i].version[0] = 0;
srvlst_dat[i].gamename[0] = 0; srvlst_dat[i].gamename[0] = 0;
srvlst_dat[i].comment[0] = 0; srvlst_dat[i].comment[0] = 0;
srvlst_dat[i].ping = 0; srvlst_dat[i].ping = -1;
} }
srvlst_cnt = 0; 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].port, broadcast_list[i].port, LEN_PORT);
strncpy (srvlst_dat[srvlst_cnt].version, broadcast_list[i].version, LEN_VERSION); strncpy (srvlst_dat[srvlst_cnt].version, broadcast_list[i].version, LEN_VERSION);
strncpy (srvlst_dat[srvlst_cnt].gamename, broadcast_list[i].gamename, LEN_GAMENAME); 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; srvlst_dat[srvlst_cnt].ai_family = bman.net_ai_family;
if (broadcast_list[i].lan) if (broadcast_list[i].lan)
sprintf (srvlst_dat[srvlst_cnt].comment, "LAN"); sprintf (srvlst_dat[srvlst_cnt].comment, "LAN");
@ -144,7 +145,6 @@ void net_getserver () {
if ((timestamp - srvlst_lastrebuild) > SRVLST_TIMEREBUILD) { if ((timestamp - srvlst_lastrebuild) > SRVLST_TIMEREBUILD) {
srvlist_rebuildlist (); srvlist_rebuildlist ();
srvlst_lastrebuild = timestamp; srvlst_lastrebuild = timestamp;
menu_reload (menu);
srvlst_listmenu->changed = 1; srvlst_listmenu->changed = 1;
menu_draw (menu); menu_draw (menu);
} }
@ -156,7 +156,7 @@ void net_getserver () {
menuselect = menu->focus->id; menuselect = menu->focus->id;
newentry = sel_entry - &srvlst_text[0]; 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; 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); 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 if (srvlst_dat[entry].host[0] != 0
@ -176,6 +176,17 @@ void net_getserver () {
menuselect = -1; menuselect = -1;
break; break;
case (1): // Join a Game 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); menu_focus_id (menu, 0);
break; break;
} }

@ -3,6 +3,8 @@
# to use this please read http://www.libsdl.org/extras/win32/cross/README.txt # to use this please read http://www.libsdl.org/extras/win32/cross/README.txt
# from there i have got all this. # from there i have got all this.
PREFIX=/usr/local/cross-tools PREFIX=/usr/local/cross-tools
TARGET=i386-mingw32msvc TARGET=i386-mingw32msvc
PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH" PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
@ -19,4 +21,3 @@ make clean
make $* make $*
strip src/bomberclone.exe strip src/bomberclone.exe

Loading…
Cancel
Save