mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #7271 from furo321/afk-optional
Make IsAfk attribute optional
This commit is contained in:
commit
c8401aa38f
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue