SaveTool: implement the request thread.

This commit is contained in:
Guillaume Jacquemin 2021-07-28 14:15:39 +02:00
parent 017900afe2
commit 7f32166ab0

View file

@ -594,10 +594,13 @@ void SaveTool::checkGameState() {
}
void SaveTool::checkForUpdates() {
// TODO: implement
cpr::Response r = cpr::Get(cpr::Url{"https://williamjcm.ovh/git/api/v1/repos/williamjcm/MassBuilderSaveTool/releases"},
cpr::Parameters{{"limit", "1"}}, cpr::Timeout{10000});
SDL_Event event;
SDL_zero(event);
event.type = _updateEventId;
event.user.code = r.status_code;
event.user.data1 = new cpr::Response{std::move(r)};
SDL_PushEvent(&event);
}