diff --git a/src/gfxpixelimage.c b/src/gfxpixelimage.c index e340e27..480c42e 100644 --- a/src/gfxpixelimage.c +++ b/src/gfxpixelimage.c @@ -1,4 +1,4 @@ -/* $Id: gfxpixelimage.c,v 1.4 2003/12/24 02:38:15 stpohle Exp $ */ +/* $Id: gfxpixelimage.c,v 1.5 2004/01/03 22:32:18 stpohle Exp $ */ /* gfx pixel manipulation and image manipulation */ #include "bomberclone.h" @@ -281,6 +281,8 @@ scale_image (SDL_Surface *orginal, int newx, int newy) return surface; }; + + SDL_Surface * makegray_image (SDL_Surface * org) { diff --git a/src/netsrvlist.c b/src/netsrvlist.c index fe2ba1f..4e2ba06 100644 --- a/src/netsrvlist.c +++ b/src/netsrvlist.c @@ -1,4 +1,4 @@ -/* $Id: netsrvlist.c,v 1.4 2004/01/03 21:40:56 stpohle Exp $ +/* $Id: netsrvlist.c,v 1.5 2004/01/03 22:32:18 stpohle Exp $ * netsrvlist.c - shows a list of possible servers.*/ #include "basic.h" @@ -31,9 +31,15 @@ void srvlist_rebuildlist () { d_printf ("srvlist_rebuildlist\n"); /* delete the whole list */ + for (i = 0; i < MAX_SRVLIST; i++) { + srvlst_text[i].text[0] = 0; + srvlst_text[i].next = NULL; + srvlst_dat[i].host[0] = 0; + srvlst_dat[i].port[0] = 0; + srvlst_dat[i].gamename[0] = 0; + } + srvlst_cnt = 0; - srvlst_text[0].text[0] = 0; - srvlst_text[0].next = NULL; /* add the OpenGameCache Entrys */ if (bman.notifygamemaster) { @@ -65,7 +71,10 @@ void srvlist_rebuildlist () { sprintf (text, "%s:%s", srvlst_dat[i].host, srvlst_dat[i].port); strncpy (srvlst_text[i].text, text, LEN_CHARENTRY); } + if (srvlst_cnt == 0) + strcpy (srvlst_text[0].text, "No Servers Found"); charlist_fillarraypointer (srvlst_text, srvlst_cnt); + }; diff --git a/src/ogcache-client.c b/src/ogcache-client.c index 788d6c4..87507e0 100644 --- a/src/ogcache-client.c +++ b/src/ogcache-client.c @@ -1,4 +1,4 @@ -/* $Id: ogcache-client.c,v 1.1 2003/12/24 02:42:06 stpohle Exp $ +/* $Id: ogcache-client.c,v 1.2 2004/01/03 22:32:18 stpohle Exp $ * OpenGameCache-Client: this file will hold the protocol for the gameserver communication */ @@ -15,7 +15,7 @@ char ogc_game[LEN_GAME]; int ogc_ai_family; struct _sockaddr ogc_addr; int ogc_browsing = 0; - +int ogc_lasttimeout = 0; /* fill out the whole gameentry */ static void fill_gameentry (char *pos, struct game_entry *ge) { @@ -249,6 +249,9 @@ int ogc_loop () { i = ogc_do_inpacket (in, len, &inaddr); } + if ((time (NULL) - ogc_lasttimeout) > 30) + ogc_browsestart (); + return i; }; @@ -265,6 +268,8 @@ void ogc_browsestart () { udp_send (ogc_sock, data, strlen (data), &ogc_addr, ogc_ai_family); ogc_browsing = 1; + + ogc_lasttimeout = time (NULL); };