diff options
author | David Walter Seikel | 2012-03-22 20:59:01 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-03-22 20:59:01 +1000 |
commit | 304f811a55ba2fe339973304d73e957273f01ca7 (patch) | |
tree | dd91939e180a0f25f6521a9603633c018d22e522 /linden/indra | |
parent | Let it build under gcc 4.5.2. Thanks to Lord Drakeo for fixing this. (diff) | |
download | meta-impy-304f811a55ba2fe339973304d73e957273f01ca7.zip meta-impy-304f811a55ba2fe339973304d73e957273f01ca7.tar.gz meta-impy-304f811a55ba2fe339973304d73e957273f01ca7.tar.bz2 meta-impy-304f811a55ba2fe339973304d73e957273f01ca7.tar.xz |
Removing ancient, left over, broken and never used, hippo update code.
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/hippoupdate.cpp | 93 | ||||
-rw-r--r-- | linden/indra/newview/hippoupdate.h | 12 | ||||
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 1 |
3 files changed, 0 insertions, 106 deletions
diff --git a/linden/indra/newview/hippoupdate.cpp b/linden/indra/newview/hippoupdate.cpp deleted file mode 100644 index 848a8fd..0000000 --- a/linden/indra/newview/hippoupdate.cpp +++ /dev/null | |||
@@ -1,93 +0,0 @@ | |||
1 | |||
2 | #include "hippoupdate.h" | ||
3 | |||
4 | #include <cstdio> | ||
5 | #include <list> | ||
6 | #include <vector> | ||
7 | |||
8 | #include <stdtypes.h> | ||
9 | #include <llhttpclient.h> | ||
10 | #include <llmemory.h> | ||
11 | //#include <llversionviewer.h> | ||
12 | #include "llviewercontrol.h" | ||
13 | #include "llviewernetwork.h" | ||
14 | #include "llweb.h" | ||
15 | #include <llwindow.h> | ||
16 | |||
17 | |||
18 | std::string gHippoChannel; | ||
19 | |||
20 | |||
21 | // TODO - Um, WTH? Is this actually used anywhere? | ||
22 | // static | ||
23 | bool HippoUpdate::checkUpdate() | ||
24 | { | ||
25 | llinfos << "Hippo Update Check..." << llendl; | ||
26 | |||
27 | // get channel name | ||
28 | gHippoChannel = gSavedSettings.getString("ChannelName"); | ||
29 | |||
30 | // get mac address | ||
31 | char macAddress[18]; | ||
32 | sprintf(macAddress, "%02x:%02x:%02x:%02x:%02x:%02x", | ||
33 | gMACAddress[0], gMACAddress[1], gMACAddress[2], gMACAddress[3], gMACAddress[4], gMACAddress[5]); | ||
34 | |||
35 | // build URL for update check | ||
36 | char url[1000]; | ||
37 | snprintf(url, 1000, | ||
38 | /* "http://update.mjm.game-host.org/os/viewer.php?" | ||
39 | "product=%s&channel=%s&" | ||
40 | "version_major=%d&version_minor=%d&version_patch=%d&version_base=%s&" | ||
41 | "platform=%s&mac=%s", | ||
42 | LL_PRODUCT, LL_CHANNEL_CSTR, | ||
43 | LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BASE, | ||
44 | LL_PLATFORM*/"", macAddress); | ||
45 | |||
46 | // query update server | ||
47 | std::string escaped_url = LLWeb::escapeURL(url); | ||
48 | LLSD response = LLHTTPClient::blockingGet(escaped_url.c_str()); | ||
49 | |||
50 | // check response, return on error | ||
51 | S32 status = response["status"].asInteger(); | ||
52 | if ((status != 200) || !response["body"].isMap()) { | ||
53 | llinfos << "Hippo Update failed (" << status << "): " | ||
54 | << (response["body"].isString()? response["body"].asString(): "<unknown error>") | ||
55 | << llendl; | ||
56 | return true; | ||
57 | } | ||
58 | |||
59 | // get data from response | ||
60 | LLSD data = response["body"]; | ||
61 | std::string webpage = (data.has("webpage") && data["webpage"].isString())? data["webpage"].asString(): ""; | ||
62 | std::string message = (data.has("message") && data["message"].isString())? data["message"].asString(): ""; | ||
63 | std::string yourVersion = (data.has("yourVersion") && data["yourVersion"].isString())? data["yourVersion"].asString(): ""; | ||
64 | std::string curVersion = (data.has("curVersion") && data["curVersion"].isString())? data["curVersion"].asString(): ""; | ||
65 | bool update = (data.has("update") && data["update"].isBoolean())? data["update"].asBoolean(): false; | ||
66 | bool mandatory = (data.has("mandatory") && data["mandatory"].isBoolean())? data["mandatory"].asBoolean(): false; | ||
67 | |||
68 | // log and return, if no update available | ||
69 | llinfos << "Your version is " << yourVersion << ", current version is " << curVersion << '.' << llendl; | ||
70 | if (!update) return true; | ||
71 | llinfos << "Update is " << (mandatory? "mandatory.": "optional.") << llendl; | ||
72 | |||
73 | // show update dialog | ||
74 | char msg[1000]; | ||
75 | snprintf(msg, 1000, | ||
76 | "There is a new viewer version available.\n" | ||
77 | "\n" | ||
78 | "Your version: %s\n" | ||
79 | "Current version: %s\n" | ||
80 | "%s\n" | ||
81 | "Do you want to visit the web site?", | ||
82 | yourVersion.c_str(), curVersion.c_str(), | ||
83 | mandatory? "\nThis is a mandatory update.\n": ""); | ||
84 | S32 button = OSMessageBox(msg, "Hippo OpenSim Viewer Update", OSMB_YESNO); | ||
85 | if (button == OSBTN_YES) { | ||
86 | llinfos << "Taking user to " << webpage << llendl; | ||
87 | LLWeb::loadURLExternal(webpage); | ||
88 | // exit the viewer | ||
89 | return false; | ||
90 | } | ||
91 | |||
92 | return !mandatory; | ||
93 | } | ||
diff --git a/linden/indra/newview/hippoupdate.h b/linden/indra/newview/hippoupdate.h deleted file mode 100644 index 559c8b3..0000000 --- a/linden/indra/newview/hippoupdate.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef __HIPPO_UPDATE_H__ | ||
2 | #define __HIPPO_UPDATE_H__ | ||
3 | |||
4 | |||
5 | class HippoUpdate | ||
6 | { | ||
7 | public: | ||
8 | static bool checkUpdate(); | ||
9 | }; | ||
10 | |||
11 | |||
12 | #endif | ||
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index e02bfc7..33a71fe 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -179,7 +179,6 @@ | |||
179 | 179 | ||
180 | #include "hippogridmanager.h" | 180 | #include "hippogridmanager.h" |
181 | #include "hippolimits.h" | 181 | #include "hippolimits.h" |
182 | #include "hippoupdate.h" | ||
183 | 182 | ||
184 | // [RLVa:KB] | 183 | // [RLVa:KB] |
185 | #include "rlvhandler.h" | 184 | #include "rlvhandler.h" |