mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 05:11:34 +00:00
Make sure GetMODVersion and its console equiv properly detect failing to get a reply from the MS, also added extra console/menu messages
This commit is contained in:
parent
f34e1edb4d
commit
797f9d180e
1 changed files with 24 additions and 2 deletions
26
src/mserv.c
26
src/mserv.c
|
@ -557,9 +557,21 @@ const char *GetMODVersion(void)
|
|||
msg.room = MODID; // Might as well use it for something.
|
||||
sprintf(msg.buffer,"%d",MODVERSION);
|
||||
if (MS_Write(&msg) < 0)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Could not send to the Master Server\n"));
|
||||
M_StartMessage(M_GetText("Could not send to the Master Server\n"), NULL, MM_NOTHING);
|
||||
CloseConnection();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (MS_Read(&msg) < 0)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("No reply from the Master Server\n"));
|
||||
M_StartMessage(M_GetText("No reply from the Master Server\n"), NULL, MM_NOTHING);
|
||||
CloseConnection();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MS_Read(&msg);
|
||||
CloseConnection();
|
||||
|
||||
if(strcmp(msg.buffer,"NULL") != 0)
|
||||
|
@ -587,9 +599,19 @@ void GetMODVersion_Console(void)
|
|||
msg.room = MODID; // Might as well use it for something.
|
||||
sprintf(msg.buffer,"%d",MODVERSION);
|
||||
if (MS_Write(&msg) < 0)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Could not send to the Master Server\n"));
|
||||
CloseConnection();
|
||||
return;
|
||||
}
|
||||
|
||||
if (MS_Read(&msg) < 0)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("No reply from the Master Server\n"));
|
||||
CloseConnection();
|
||||
return;
|
||||
}
|
||||
|
||||
MS_Read(&msg);
|
||||
CloseConnection();
|
||||
|
||||
if(strcmp(msg.buffer,"NULL") != 0)
|
||||
|
|
Loading…
Reference in a new issue