mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-18 06:01:19 +02:00
Stage 2 of autoupdate working
This commit is contained in:
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include "ClientListener.h"
|
#include "ClientListener.h"
|
||||||
|
|
||||||
|
#include "Update.h"
|
||||||
|
|
||||||
Client::Client():
|
Client::Client():
|
||||||
authUser(0, ""),
|
authUser(0, ""),
|
||||||
updateAvailable(false)
|
updateAvailable(false)
|
||||||
@@ -76,19 +78,17 @@ Client::Client():
|
|||||||
authUser = User(0, "");
|
authUser = User(0, "");
|
||||||
std::cerr << "Error: Client [Read User data from pref] " << e.what() << std::endl;
|
std::cerr << "Error: Client [Read User data from pref] " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
try
|
|
||||||
{
|
|
||||||
proxyString = ((json::String)(configDocument["Proxy"])).Value();
|
|
||||||
}
|
|
||||||
catch (json::Exception &e)
|
|
||||||
{
|
|
||||||
proxyString = "";
|
|
||||||
std::cerr << "Error: Client [Read Proxy from pref] " << e.what() << std::endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
configFile.close();
|
configFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(GetPrefBool("version.update", false)==true)
|
||||||
|
{
|
||||||
|
SetPref("version.update", false);
|
||||||
|
update_finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
proxyString = GetPrefString("proxy", "");
|
||||||
if(proxyString.length())
|
if(proxyString.length())
|
||||||
{
|
{
|
||||||
http_init((char *)proxyString.c_str());
|
http_init((char *)proxyString.c_str());
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
#include "UpdateActivity.h"
|
#include "UpdateActivity.h"
|
||||||
#include "tasks/Task.h"
|
#include "tasks/Task.h"
|
||||||
#include "client/HTTP.h"
|
#include "client/HTTP.h"
|
||||||
|
#include "client/Client.h"
|
||||||
#include "Update.h"
|
#include "Update.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -105,6 +106,7 @@ private:
|
|||||||
notifyError("Update failed - try downloading a new version.");
|
notifyError("Update failed - try downloading a new version.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Client::Ref().SetPref("version.update", true);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
corrupt:
|
corrupt:
|
||||||
|
Reference in New Issue
Block a user