mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-29 23:14:23 +01:00
Good error message if no servers
This commit is contained in:
parent
fb56639526
commit
4722d9f028
@ -970,6 +970,8 @@ network_connection_error_t Network::WaitForPeerList()
|
|||||||
return SERVER_GARBAGE_ERROR;
|
return SERVER_GARBAGE_ERROR;
|
||||||
|
|
||||||
pi = (NetworkUpdateListPeers *)this->ud->data;
|
pi = (NetworkUpdateListPeers *)this->ud->data;
|
||||||
|
if (pi->n_peers == 0)
|
||||||
|
return NO_PEERS_ERROR;
|
||||||
msgs = (const char**)calloc(pi->n_peers + 1, sizeof(const char*));
|
msgs = (const char**)calloc(pi->n_peers + 1, sizeof(const char*));
|
||||||
|
|
||||||
for (int i = 0; i < pi->n_peers; i++) {
|
for (int i = 0; i < pi->n_peers; i++) {
|
||||||
@ -1108,6 +1110,7 @@ network_connection_error_t Network::ConnectFSM()
|
|||||||
|
|
||||||
bool Network::Connect()
|
bool Network::Connect()
|
||||||
{
|
{
|
||||||
|
this->network_connection_state = CONN_CONNECT_TO_BROKER;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
SDL_FillRect(real_screen, 0, SDL_MapRGB(real_screen->format,
|
SDL_FillRect(real_screen, 0, SDL_MapRGB(real_screen->format,
|
||||||
@ -1142,6 +1145,11 @@ bool Network::Connect()
|
|||||||
return true;
|
return true;
|
||||||
case AGAIN_ERROR:
|
case AGAIN_ERROR:
|
||||||
break;
|
break;
|
||||||
|
case NO_PEERS_ERROR:
|
||||||
|
menu_print_font(real_screen, 255,255,0, 30, 70,
|
||||||
|
"No servers to connect to.");
|
||||||
|
sleep(1);
|
||||||
|
return false;
|
||||||
case VERSION_ERROR:
|
case VERSION_ERROR:
|
||||||
menu_print_font(real_screen, 255,255,0, 30, 70,
|
menu_print_font(real_screen, 255,255,0, 30, 70,
|
||||||
"Your frodo is too old.");
|
"Your frodo is too old.");
|
||||||
|
@ -58,6 +58,7 @@ typedef enum
|
|||||||
AGAIN_ERROR,
|
AGAIN_ERROR,
|
||||||
VERSION_ERROR,
|
VERSION_ERROR,
|
||||||
SERVER_GARBAGE_ERROR,
|
SERVER_GARBAGE_ERROR,
|
||||||
|
NO_PEERS_ERROR,
|
||||||
} network_connection_error_t;
|
} network_connection_error_t;
|
||||||
|
|
||||||
struct NetworkUpdate
|
struct NetworkUpdate
|
||||||
|
Loading…
Reference in New Issue
Block a user