summaryrefslogtreecommitdiff
path: root/src/PowderToySDL.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/PowderToySDL.cpp')
-rw-r--r--src/PowderToySDL.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp
index 0e01c66..82a6856 100644
--- a/src/PowderToySDL.cpp
+++ b/src/PowderToySDL.cpp
@@ -244,9 +244,12 @@ std::map<std::string, std::string> readArguments(int argc, char * argv[])
{
arguments["scale"] = std::string(argv[i]+6);
}
- else if (!strncmp(argv[i], "proxy:", 6) && argv[i]+6)
+ else if (!strncmp(argv[i], "proxy:", 6))
{
- arguments["proxy"] = std::string(argv[i]+6);
+ if(argv[i]+6)
+ arguments["proxy"] = std::string(argv[i]+6);
+ else
+ arguments["proxy"] = "false";
}
else if (!strncmp(argv[i], "nohud", 5))
{
@@ -319,6 +322,27 @@ int main(int argc, char * argv[])
Client::Ref().SetPref("Scale", tempScale);
}
+ std::string proxyString = "";
+ if(arguments["proxy"].length())
+ {
+ if(arguments["proxy"] == "false")
+ {
+ proxyString = "";
+ Client::Ref().SetPref("Proxy", "");
+ }
+ else
+ {
+ proxyString = (arguments["proxy"]);
+ Client::Ref().SetPref("Proxy", arguments["proxy"]);
+ }
+ }
+ else if(Client::Ref().GetPrefString("Proxy", "").length())
+ {
+ proxyString = (Client::Ref().GetPrefString("Proxy", ""));
+ }
+
+ Client::Ref().Initialise(proxyString);
+
if(tempScale != 1 && tempScale != 2)
tempScale = 1;