refreshing the server info when loading

This commit is contained in:
Alfred Eriksson 2009-01-12 14:03:19 +00:00
parent aedd342674
commit 5141ddac4d
3 changed files with 11 additions and 2 deletions

View file

@ -513,8 +513,7 @@ void client_connect(const char *server_address_str)
dbg_msg("client", "connecting to '%s'", server_address_str);
mem_zero(&current_server_info, sizeof(current_server_info));
current_server_info_requesttime = 0;
//client_serverinfo_request();
str_copy(buf, server_address_str, sizeof(buf));
for(k = 0; buf[k]; k++)
@ -585,6 +584,12 @@ void client_serverinfo(SERVER_INFO *serverinfo)
mem_copy(serverinfo, &current_server_info, sizeof(current_server_info));
}
void client_serverinfo_request()
{
mem_zero(&current_server_info, sizeof(current_server_info));
current_server_info_requesttime = 0;
}
static int client_load_data()
{
debug_font = gfx_load_texture("debug_font.png", IMG_AUTO, TEXLOAD_NORESAMPLE);

View file

@ -574,5 +574,6 @@ void client_demoplayer_setpause(int paused);
void client_demoplayer_setspeed(float speed);
const char *client_user_directory();
void client_serverinfo(SERVER_INFO *serverinfo);
void client_serverinfo_request();
void client_serverbrowse_request(NETADDR *addr);
#endif

View file

@ -981,7 +981,10 @@ void MENUS::on_statechange(int new_state, int old_state)
popup = POPUP_DISCONNECTED;
} }
else if(new_state == CLIENTSTATE_LOADING)
{
popup = POPUP_CONNECTING;
client_serverinfo_request();
}
else if(new_state == CLIENTSTATE_CONNECTING)
popup = POPUP_CONNECTING;
else if (new_state == CLIENTSTATE_ONLINE || new_state == CLIENTSTATE_DEMOPLAYBACK)