mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
added connection problems sign
This commit is contained in:
parent
094a019149
commit
63e834c353
|
@ -305,6 +305,11 @@ void client_rcon(const char *cmd)
|
|||
client_send_msg();
|
||||
}
|
||||
|
||||
int client_connection_problems()
|
||||
{
|
||||
return netclient_gotproblems(net);
|
||||
}
|
||||
|
||||
static void client_send_input()
|
||||
{
|
||||
int64 now = time_get();
|
||||
|
|
|
@ -804,6 +804,7 @@ float client_localtime();
|
|||
int client_state();
|
||||
const char *client_error_string();
|
||||
int *client_get_input(int tick);
|
||||
int client_connection_problems();
|
||||
|
||||
void client_connect(const char *address);
|
||||
void client_disconnect();
|
||||
|
@ -812,6 +813,7 @@ void client_entergame();
|
|||
|
||||
void client_rcon(const char *cmd);
|
||||
|
||||
|
||||
void client_serverbrowse_refresh(int lan);
|
||||
|
||||
SERVER_INFO *client_serverbrowse_sorted_get(int index);
|
||||
|
|
|
@ -919,6 +919,13 @@ int netclient_state(NETCLIENT *c)
|
|||
return NETSTATE_CONNECTING;
|
||||
}
|
||||
|
||||
int netclient_gotproblems(NETCLIENT *c)
|
||||
{
|
||||
if(time_get() - c->conn.last_recv_time > time_freq())
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void netclient_stats(NETCLIENT *c, NETSTATS *stats)
|
||||
{
|
||||
*stats = c->conn.stats;
|
||||
|
|
|
@ -59,6 +59,7 @@ int netclient_send(NETCLIENT *c, NETPACKET *packet);
|
|||
int netclient_close(NETCLIENT *c);
|
||||
int netclient_update(NETCLIENT *c);
|
||||
int netclient_state(NETCLIENT *c);
|
||||
int netclient_gotproblems(NETCLIENT *c);
|
||||
void netclient_stats(NETCLIENT *c, NETSTATS *stats);
|
||||
const char *netclient_error_string(NETCLIENT *c);
|
||||
|
||||
|
|
|
@ -2762,6 +2762,14 @@ void render_game()
|
|||
emoticon_selector_active = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(client_connection_problems())
|
||||
{
|
||||
gfx_mapscreen(0, 0, 400, 300);
|
||||
const char *text = "Connection Problems...";
|
||||
float w = gfx_pretty_text_width(24, text, -1);
|
||||
gfx_pretty_text(200-w/2, 50, 24, text, -1);
|
||||
}
|
||||
|
||||
// render score board
|
||||
if(inp_key_pressed(KEY_TAB) || // user requested
|
||||
|
|
Loading…
Reference in a new issue