[News] JSON use integer instead of std::string
This commit is contained in:
parent
9c66d49f72
commit
1604cf76e3
@ -64,17 +64,12 @@ namespace Components
|
|||||||
std::string error;
|
std::string error;
|
||||||
json11::Json client = json11::Json::parse(_client.data(), error);
|
json11::Json client = json11::Json::parse(_client.data(), error);
|
||||||
|
|
||||||
if (client["revision"].is_string())
|
if (client["revision"].is_number())
|
||||||
{
|
{
|
||||||
std::string revisionString = client["revision"].string_value();
|
int revisionNumber = client["revision"].int_value();
|
||||||
|
|
||||||
if (!revisionString.empty())
|
Dvar::Var("cl_updateversion").get<Game::dvar_t*>()->current.integer = revisionNumber;
|
||||||
{
|
Dvar::Var("cl_updateavailable").get<Game::dvar_t*>()->current.boolean = (revisionNumber > REVISION);
|
||||||
int revision = atoi(revisionString.data());
|
|
||||||
|
|
||||||
Dvar::Var("cl_updateversion").get<Game::dvar_t*>()->current.integer = revision;
|
|
||||||
Dvar::Var("cl_updateavailable").get<Game::dvar_t*>()->current.boolean = (revision > REVISION);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user