mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
refreshing the server info when loading
This commit is contained in:
parent
aedd342674
commit
5141ddac4d
|
@ -513,8 +513,7 @@ void client_connect(const char *server_address_str)
|
|||
|
||||
dbg_msg("client", "connecting to '%s'", server_address_str);
|
||||
|
||||
mem_zero(¤t_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, ¤t_server_info, sizeof(current_server_info));
|
||||
}
|
||||
|
||||
void client_serverinfo_request()
|
||||
{
|
||||
mem_zero(¤t_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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue