mapmenu and helpmenu in the multiplayer selection screen disapeared after a OGC message came in.. even browsing was cut of. Misstake found in file ogcache-client.c the loop started the browing again.

wait_for_players is now handling the sym key of the keyboard.
origin
stpohle 22 years ago
parent a7f683c7b9
commit e04cafe44d

@ -307,7 +307,7 @@ wait_for_players ()
bman.state = GS_startup; bman.state = GS_startup;
} }
if (keys[SDLK_F8] && event.type == SDL_KEYDOWN) { if (event.key.keysym.sym == SDLK_F8 && event.type == SDL_KEYDOWN) {
/* Switch Fullscreen */ /* Switch Fullscreen */
SDL_WM_ToggleFullScreen(gfx.screen); SDL_WM_ToggleFullScreen(gfx.screen);
gfx.fullscreen = !gfx.fullscreen; gfx.fullscreen = !gfx.fullscreen;
@ -316,7 +316,7 @@ wait_for_players ()
if (bman.p_nr != -1) { if (bman.p_nr != -1) {
if (keys[SDLK_LEFT] && (!keypressed) && players[bman.p_nr].gfx_nr == -1) { if (event.key.keysym.sym == SDLK_LEFT && event.type == SDL_KEYDOWN && (!keypressed) && players[bman.p_nr].gfx_nr == -1) {
i = 0; i = 0;
while (selgfx < 0 || selgfx >= MAX_PLAYERS || i != -1) { while (selgfx < 0 || selgfx >= MAX_PLAYERS || i != -1) {
selgfx--; selgfx--;
@ -326,7 +326,7 @@ wait_for_players ()
} }
} }
if (keys[SDLK_RIGHT] && (!keypressed) && players[bman.p_nr].gfx_nr == -1) { if (event.key.keysym.sym == SDLK_RIGHT && event.type == SDL_KEYDOWN && (!keypressed) && players[bman.p_nr].gfx_nr == -1) {
i = 0; i = 0;
while (selgfx < 0 || selgfx >= MAX_PLAYERS || i != -1) { while (selgfx < 0 || selgfx >= MAX_PLAYERS || i != -1) {
selgfx++; selgfx++;
@ -347,7 +347,7 @@ wait_for_players ()
} }
} }
if ((keys[SDLK_LCTRL] || keys[SDLK_RCTRL]) && (!keypressed)) { if ((event.key.keysym.sym == SDLK_LCTRL || event.key.keysym.sym == SDLK_RCTRL) && event.type == SDL_KEYDOWN && (!keypressed)) {
if (players[bman.p_nr].gfx_nr == -1) if (players[bman.p_nr].gfx_nr == -1)
/* select player */ /* select player */
players[bman.p_nr].gfx_nr = selgfx; players[bman.p_nr].gfx_nr = selgfx;
@ -359,12 +359,12 @@ wait_for_players ()
keypressed = 1; keypressed = 1;
} }
if ((GT_MP_PTPM) && ready && keys[SDLK_F4] && (!keypressed)) { if ((GT_MP_PTPM) && ready && event.key.keysym.sym == SDLK_F4 && event.type == SDL_KEYDOWN && (!keypressed)) {
done = 1; done = 1;
bman.updatestatusbar = 1; bman.updatestatusbar = 1;
} }
if (keys[SDLK_F2] && (!keypressed)) { if (event.key.keysym.sym == SDLK_F2 && (!keypressed)) {
/* Map modification or setting display */ /* Map modification or setting display */
if (GT_MP_PTPM) { if (GT_MP_PTPM) {
mapmenu (); mapmenu ();
@ -392,9 +392,9 @@ wait_for_players ()
bman.updatestatusbar = 1; bman.updatestatusbar = 1;
} }
if (keys[SDLK_F1] && (!keypressed)) /* open help screen */ if (event.key.keysym.sym == SDLK_F1 && event.type == SDL_KEYDOWN && (!keypressed)) /* open help screen */
network_helpscreen (); network_helpscreen ();
chat_loop (&event); chat_loop (&event);
} }

@ -1,4 +1,4 @@
/* $Id: network.c,v 1.52 2004/01/04 03:22:49 stpohle Exp $ */ /* $Id: network.c,v 1.53 2004/01/06 04:49:36 stpohle Exp $ */
/* /*
network routines. network routines.
*/ */
@ -408,7 +408,7 @@ net_transmit_gamedata ()
else else
net_istep = 3; net_istep = 3;
while (!done && bman.state == GS_update) { while (!done && (bman.state == GS_update || (GT_MP_PTPS && net_istep != 0))) {
/* the network thing */ /* the network thing */
network_loop (); network_loop ();

@ -1,4 +1,4 @@
/* $Id: ogcache-client.c,v 1.2 2004/01/03 22:32:18 stpohle Exp $ /* $Id: ogcache-client.c,v 1.3 2004/01/06 04:49:36 stpohle Exp $
* OpenGameCache-Client: this file will hold the protocol for the gameserver communication * OpenGameCache-Client: this file will hold the protocol for the gameserver communication
*/ */
@ -241,7 +241,7 @@ int ogc_loop () {
if (ogc_sock <= 0) if (ogc_sock <= 0)
return -1; return -1;
len = udp_get (ogc_sock, in, BUF_SIZE, &inaddr, ogc_ai_family); len = udp_get (ogc_sock, in, BUF_SIZE, &inaddr, ogc_ai_family);
if (len > 0) { /* we have got something */ if (len > 0) { /* we have got something */
@ -249,7 +249,7 @@ int ogc_loop () {
i = ogc_do_inpacket (in, len, &inaddr); i = ogc_do_inpacket (in, len, &inaddr);
} }
if ((time (NULL) - ogc_lasttimeout) > 30) if (ogc_browsing && (time (NULL) - ogc_lasttimeout) > 30)
ogc_browsestart (); ogc_browsestart ();
return i; return i;

@ -619,7 +619,7 @@ do_playerdata (struct pkg_playerdata *p_dat, _net_addr * addr)
if (bman.state == GS_update && PS_IS_used (p_dat->state)) if (bman.state == GS_update && PS_IS_used (p_dat->state))
bman.players_nr_s++; bman.players_nr_s++;
if (bman.state == GS_update && players[bman.p_nr].net.net_istep == 1) if (players[bman.p_nr].net.net_istep == 1)
players[bman.p_nr].net.net_status = p_dat->p_nr; players[bman.p_nr].net.net_status = p_dat->p_nr;
} }
@ -990,7 +990,7 @@ do_fieldline (struct pkg_fieldline *f_dat, _net_addr * addr)
return; return;
} }
if (bman.state == GS_update && players[bman.p_nr].net.net_istep == 2) if (players[bman.p_nr].net.net_istep == 2)
players[bman.p_nr].net.net_status = f_dat->line; players[bman.p_nr].net.net_status = f_dat->line;
for (i = 0; i < MAX_FIELDSIZE_X; i++) { for (i = 0; i < MAX_FIELDSIZE_X; i++) {

Loading…
Cancel
Save