mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
Save error handling clean up
This commit is contained in:
parent
2d7886bf33
commit
7146eb572b
|
@ -398,6 +398,8 @@ bool CSaveTeam::HandleSaveError(int Result, int ClientID, CGameContext *pGameCon
|
||||||
{
|
{
|
||||||
switch(Result)
|
switch(Result)
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
|
return false;
|
||||||
case 1:
|
case 1:
|
||||||
pGameContext->SendChatTarget(ClientID, "You have to be in a team (from 1-63)");
|
pGameContext->SendChatTarget(ClientID, "You have to be in a team (from 1-63)");
|
||||||
break;
|
break;
|
||||||
|
@ -408,12 +410,12 @@ bool CSaveTeam::HandleSaveError(int Result, int ClientID, CGameContext *pGameCon
|
||||||
pGameContext->SendChatTarget(ClientID, "Unable to find all Characters");
|
pGameContext->SendChatTarget(ClientID, "Unable to find all Characters");
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
pGameContext->SendChatTarget(ClientID, "Your team is not started yet");
|
pGameContext->SendChatTarget(ClientID, "Your team has not started yet");
|
||||||
|
break;
|
||||||
|
default: // this state should never be reached
|
||||||
|
pGameContext->SendChatTarget(ClientID, "Unknown error while saving");
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,7 @@ public:
|
||||||
int load(int Team);
|
int load(int Team);
|
||||||
CSaveTee* m_pSavedTees;
|
CSaveTee* m_pSavedTees;
|
||||||
|
|
||||||
|
// returns true if an error occured
|
||||||
static bool HandleSaveError(int Result, int ClientID, CGameContext *pGameContext);
|
static bool HandleSaveError(int Result, int ClientID, CGameContext *pGameContext);
|
||||||
private:
|
private:
|
||||||
int MatchPlayer(char name[16]);
|
int MatchPlayer(char name[16]);
|
||||||
|
|
Loading…
Reference in a new issue