Merge pull request #7271 from furo321/afk-optional

Make IsAfk attribute optional
This commit is contained in:
Dennis Felsing 2023-09-30 18:22:09 +00:00 committed by GitHub
commit c8401aa38f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,7 +118,6 @@ bool CServerInfo2::FromJsonRaw(CServerInfo2 *pOut, const json_value *pJson)
Error = Error || Country.type != json_integer; Error = Error || Country.type != json_integer;
Error = Error || Score.type != json_integer; Error = Error || Score.type != json_integer;
Error = Error || IsPlayer.type != json_boolean; Error = Error || IsPlayer.type != json_boolean;
Error = Error || IsAfk.type != json_boolean;
if(Error) if(Error)
{ {
return true; return true;
@ -131,7 +130,10 @@ bool CServerInfo2::FromJsonRaw(CServerInfo2 *pOut, const json_value *pJson)
pClient->m_Country = json_int_get(&Country); pClient->m_Country = json_int_get(&Country);
pClient->m_Score = json_int_get(&Score); pClient->m_Score = json_int_get(&Score);
pClient->m_IsPlayer = IsPlayer; pClient->m_IsPlayer = IsPlayer;
pClient->m_IsAfk = IsAfk;
pClient->m_IsAfk = false;
if(IsAfk.type == json_boolean)
pClient->m_IsAfk = IsAfk;
// check if a skin is also available // check if a skin is also available
bool HasSkin = false; bool HasSkin = false;