aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/llcommon/llstring.h1
-rw-r--r--linden/indra/newview/CMakeLists.txt21
-rw-r--r--linden/indra/newview/app_settings/default_grids.xml51
-rw-r--r--linden/indra/newview/app_settings/settings.xml33
-rw-r--r--linden/indra/newview/authentication_controller.cpp80
-rw-r--r--linden/indra/newview/authentication_controller.h42
-rw-r--r--linden/indra/newview/authentication_floater.cpp75
-rw-r--r--linden/indra/newview/authentication_floater.h35
-rw-r--r--linden/indra/newview/authentication_model.cpp111
-rw-r--r--linden/indra/newview/authentication_model.h53
-rw-r--r--linden/indra/newview/controllerlogin.cpp142
-rw-r--r--linden/indra/newview/controllerlogin.h55
-rw-r--r--linden/indra/newview/controllerpasswords.cpp41
-rw-r--r--linden/indra/newview/controllerpasswords.h37
-rw-r--r--linden/indra/newview/floaterlogin.cpp834
-rw-r--r--linden/indra/newview/floaterlogin.h98
-rw-r--r--linden/indra/newview/hippoGridManager.cpp597
-rw-r--r--linden/indra/newview/hippoGridManager.h171
-rw-r--r--linden/indra/newview/hippoLimits.cpp54
-rw-r--r--linden/indra/newview/hippoLimits.h33
-rw-r--r--linden/indra/newview/hippoRestRequest.cpp54
-rw-r--r--linden/indra/newview/hippoRestRequest.h16
-rw-r--r--linden/indra/newview/hippoUpdate.cpp92
-rw-r--r--linden/indra/newview/hippoUpdate.h12
-rw-r--r--linden/indra/newview/llappviewer.cpp162
-rw-r--r--linden/indra/newview/llappviewer.h20
-rw-r--r--linden/indra/newview/llappviewerlinux.h3
-rw-r--r--linden/indra/newview/llcallingcard.cpp12
-rw-r--r--linden/indra/newview/llcallingcard.h2
-rw-r--r--linden/indra/newview/lldrawable.h1
-rw-r--r--linden/indra/newview/llfloaterworldmap.cpp157
-rw-r--r--linden/indra/newview/llfloaterworldmap.h7
-rw-r--r--linden/indra/newview/llpanellogin.cpp157
-rw-r--r--linden/indra/newview/llpanellogin.h8
-rw-r--r--linden/indra/newview/llprogressview.cpp2
-rw-r--r--linden/indra/newview/llstartup.cpp205
-rw-r--r--linden/indra/newview/llstartup.h9
-rw-r--r--linden/indra/newview/lluserauth.cpp53
-rw-r--r--linden/indra/newview/llviewermenufile.cpp15
-rw-r--r--linden/indra/newview/llviewermessage.cpp2
-rw-r--r--linden/indra/newview/llviewermessage.h2
-rw-r--r--linden/indra/newview/llviewernetwork.cpp201
-rw-r--r--linden/indra/newview/llviewernetwork.h63
-rw-r--r--linden/indra/newview/llviewerobject.h1
-rw-r--r--linden/indra/newview/llwearablelist.cpp10
-rw-r--r--linden/indra/newview/prefpanelpasswords.cpp40
-rw-r--r--linden/indra/newview/prefpanelpasswords.h30
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/alerts.xml17
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_login.xml185
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml98
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml4
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_login.xml4
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml25
53 files changed, 3793 insertions, 440 deletions
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h
index 720b163..93bd89a 100644
--- a/linden/indra/llcommon/llstring.h
+++ b/linden/indra/llcommon/llstring.h
@@ -36,6 +36,7 @@
36#include <wctype.h> 36#include <wctype.h>
37#include <wchar.h> 37#include <wchar.h>
38#endif 38#endif
39#include "linden_common.h"
39 40
40const char LL_UNKNOWN_CHAR = '?'; 41const char LL_UNKNOWN_CHAR = '?';
41 42
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 34aa29f..07285f1 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -61,6 +61,15 @@ include_directories(
61 ) 61 )
62 62
63set(viewer_SOURCE_FILES 63set(viewer_SOURCE_FILES
64 authentication_controller.cpp
65 authentication_floater.cpp
66 authentication_model.cpp
67 controllerlogin.cpp
68 controllerpasswords.cpp
69 floaterlogin.cpp
70 hippoGridManager.cpp
71 hippoLimits.cpp
72 hippoRestRequest.cpp
64 llagent.cpp 73 llagent.cpp
65 llagentdata.cpp 74 llagentdata.cpp
66 llagentlanguage.cpp 75 llagentlanguage.cpp
@@ -431,6 +440,7 @@ set(viewer_SOURCE_FILES
431 llxmlrpctransaction.cpp 440 llxmlrpctransaction.cpp
432 noise.cpp 441 noise.cpp
433 pipeline.cpp 442 pipeline.cpp
443 prefpanelpasswords.cpp
434 ) 444 )
435 445
436set(VIEWER_BINARY_NAME "imprudence-bin" CACHE STRING 446set(VIEWER_BINARY_NAME "imprudence-bin" CACHE STRING
@@ -453,7 +463,15 @@ endif (LINUX)
453set(viewer_HEADER_FILES 463set(viewer_HEADER_FILES
454 CMakeLists.txt 464 CMakeLists.txt
455 ViewerInstall.cmake 465 ViewerInstall.cmake
456 466 authentication_controller.h
467 authentication_floater.h
468 authentication_model.h
469 controllerlogin.h
470 controllerpasswords.h
471 floaterlogin.h
472 hippoGridManager.h
473 hippoLimits.h
474 hippoRestRequest.h
457 llagent.h 475 llagent.h
458 llagentdata.h 476 llagentdata.h
459 llagentlanguage.h 477 llagentlanguage.h
@@ -831,6 +849,7 @@ set(viewer_HEADER_FILES
831 macmain.h 849 macmain.h
832 noise.h 850 noise.h
833 pipeline.h 851 pipeline.h
852 prefpanelpasswords.h
834 randgauss.h 853 randgauss.h
835 VertexCache.h 854 VertexCache.h
836 VorbisFramework.h 855 VorbisFramework.h
diff --git a/linden/indra/newview/app_settings/default_grids.xml b/linden/indra/newview/app_settings/default_grids.xml
new file mode 100644
index 0000000..f4feb0c
--- /dev/null
+++ b/linden/indra/newview/app_settings/default_grids.xml
@@ -0,0 +1,51 @@
1<llsd>
2 <array>
3
4 <!--
5 This file contains fallback settings only.
6 The actual list of grids is loaded from a web server.
7 -->
8
9 <map>
10 <key>default_grids_version</key><string>0</string>
11 </map>
12
13 <!-- OSGrid -->
14 <map>
15 <key>gridnick</key><string>osgrid</string>
16 <key>gridname</key><string>OSGrid</string>
17 <key>platform</key><string>OpenSim</string>
18 <key>loginuri</key><string>http://osgrid.org:8002/</string>
19 <key>loginpage</key><string>http://osgrid.org/loginscreen.php</string>
20 <key>helperuri</key><string>http://osgrid.org/</string>
21 <key>website</key><string>http://osgrid.org/</string>
22 <key>support</key><string>http://osgrid.org/</string>
23 <key>register</key><string>http://osgrid.org/index.php?page=create</string>
24 <key>password</key><string>http://osgrid.org/index.php?page=change</string>
25 </map>
26
27 <!-- Second Life -->
28 <map>
29 <key>gridnick</key><string>secondlife</string>
30 <key>gridname</key><string>Second Life</string>
31 <key>platform</key><string>SecondLife</string>
32 <key>loginuri</key><string>https://login.agni.lindenlab.com/cgi-bin/login.cgi</string>
33 <key>loginpage</key><string>http://secondlife.com/app/login/</string>
34 <key>helperuri</key><string>https://secondlife.com/helpers/</string>
35 <key>website</key><string>http://secondlife.com/</string>
36 <key>support</key><string>http://secondlife.com/support/</string>
37 <key>register</key><string>http://secondlife.com/registration/</string>
38 <key>password</key><string>http://secondlife.com/account/request.php</string>
39 </map>
40
41 <!-- Local Host -->
42 <map>
43 <key>gridnick</key><string>local</string>
44 <key>gridname</key><string>Local Host</string>
45 <key>platform</key><string>OpenSim</string>
46 <key>loginuri</key><string>http://127.0.0.1:9000/</string>
47 <key>helperuri</key><string>http://127.0.0.1:9000/</string>
48 </map>
49
50 </array>
51</llsd>
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 5c76185..a8d7a08 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -10509,5 +10509,38 @@
10509 <key>Value</key> 10509 <key>Value</key>
10510 <integer>0</integer> 10510 <integer>0</integer>
10511 </map> 10511 </map>
10512 <key>DefaultGrid</key>
10513 <map>
10514 <key>Comment</key>
10515 <string>Nickname of the default grid</string>
10516 <key>Persist</key>
10517 <integer>1</integer>
10518 <key>Type</key>
10519 <string>String</string>
10520 <key>Value</key>
10521 <string>secondlife</string>
10522 </map>
10523 <key>KeepAppearance</key>
10524 <map>
10525 <key>Comment</key>
10526 <string>Keep appearance across grid teleport</string>
10527 <key>Persist</key>
10528 <integer>1</integer>
10529 <key>Type</key>
10530 <string>Boolean</string>
10531 <key>Value</key>
10532 <string>0</string>
10533 </map>
10534 <key>CheckForGridUpdates</key>
10535 <map>
10536 <key>Comment</key>
10537 <string>Check for grid info updates on the web server</string>
10538 <key>Persist</key>
10539 <integer>1</integer>
10540 <key>Type</key>
10541 <string>Boolean</string>
10542 <key>Value</key>
10543 <integer>1</integer>
10544 </map>
10512 </map> 10545 </map>
10513</llsd> 10546</llsd>
diff --git a/linden/indra/newview/authentication_controller.cpp b/linden/indra/newview/authentication_controller.cpp
new file mode 100644
index 0000000..a060409
--- /dev/null
+++ b/linden/indra/newview/authentication_controller.cpp
@@ -0,0 +1,80 @@
1/*
2 * AuthenticationController.cpp
3 * SecondLife
4 *
5 * Created by RMS on 7/1/08.
6 *
7 */
8
9#include "llviewerprecompiledheaders.h"
10#include "authentication_floater.h"
11#include "llviewerobject.h"
12#include "llcheckboxctrl.h"
13#include "llselectmgr.h"
14#include "authentication_controller.h"
15
16// Statics
17std::string AuthenticationController::target_grid;
18std::string AuthenticationController::username;
19std::string AuthenticationController::password;
20BOOL AuthenticationController::store_pw = FALSE;
21
22AuthenticationController::AuthenticationController(const std::string& tg, void (*cb)(void*))
23{
24 target_grid = tg;
25 callback = cb;
26}
27
28AuthenticationController::~AuthenticationController()
29{
30}
31
32// user interface callbacks: all static
33void AuthenticationController::onCommitUser(LLUICtrl* ctrl, void* userdata)
34{
35 AuthenticationFloater *floater = (AuthenticationFloater*)userdata;
36 username = floater->childGetText("User_edit");
37}
38
39void AuthenticationController::onCommitPassword(LLUICtrl* ctrl, void* userdata)
40{
41 AuthenticationFloater *floater = (AuthenticationFloater*)userdata;
42 password = floater->childGetText("Password_edit");
43}
44
45void AuthenticationController::onCommitRemember(LLUICtrl* ctrl, void* userdata)
46{
47 LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
48 if(!object) return;
49
50 LLCheckBoxCtrl *check = (LLCheckBoxCtrl*)ctrl;
51 store_pw = check->get();
52}
53
54void AuthenticationController::onAccept(void* userdata)
55{
56
57}
58
59void AuthenticationController::onCancel(void* userdata)
60{
61 AuthenticationFloater *floater = (AuthenticationFloater*)userdata;
62 floater->cancel();
63 floater->close();
64}
65
66void AuthenticationController::onClickRegister(void* userdata)
67{
68 llinfos << "onClickRegister" << llendl;
69}
70
71void AuthenticationController::retrieveStoredAccountData(void* userdata)
72{
73
74}
75
76// static
77std::string AuthenticationController::getTargetGrid()
78{
79 return target_grid;
80}
diff --git a/linden/indra/newview/authentication_controller.h b/linden/indra/newview/authentication_controller.h
new file mode 100644
index 0000000..db875ea
--- /dev/null
+++ b/linden/indra/newview/authentication_controller.h
@@ -0,0 +1,42 @@
1/*
2 * AuthenticationController.h
3 * SecondLife
4 *
5 * Created by RMS on 7/1/08.
6 *
7 */
8
9#ifndef PL_AuthenticationController_H
10#define PL_AuthenticationController_H
11
12#include "llfloater.h"
13
14class AuthenticationController
15{
16public:
17 AuthenticationController(const std::string& tg, void (*cb)(void*));
18 virtual ~AuthenticationController();
19
20 // line editor callbacks
21 static void onCommitUser(LLUICtrl* ctrl, void* userdata);
22 static void onCommitPassword(LLUICtrl* ctrl, void* userdata);
23 static void onCommitRemember(LLUICtrl* ctrl, void* userdata);
24 // button callbacks
25 static void onAccept(void* userdata);
26 static void onCancel(void* userdata);
27 static void onClickRegister(void* userdata);
28
29 void retrieveStoredAccountData(void* userdata);
30 static std::string getTargetGrid();
31
32private:
33 static std::string target_grid;
34 static std::string username;
35 static std::string password;
36 static BOOL store_pw;
37 void (*callback)(void*);
38};
39
40
41#endif // PL_AuthenticationController_H
42
diff --git a/linden/indra/newview/authentication_floater.cpp b/linden/indra/newview/authentication_floater.cpp
new file mode 100644
index 0000000..2fc7add
--- /dev/null
+++ b/linden/indra/newview/authentication_floater.cpp
@@ -0,0 +1,75 @@
1/*
2 * AuthenticationFloater.cpp
3 * Cross-grid authentication system view.
4 *
5 * Created by RMS on 7/1/08.
6 *
7 */
8
9
10#include "llviewerprecompiledheaders.h"
11#include "authentication_floater.h"
12#include "lluictrlfactory.h"
13
14// Statics
15AuthenticationFloater* AuthenticationFloater::sInstance = NULL;
16AuthenticationController* AuthenticationFloater::sController = NULL;
17
18AuthenticationFloater::AuthenticationFloater()
19: LLFloater("floater_authentication")
20{
21 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_authentication.xml");
22
23 childSetTextArg("Intro_text", "[TARGET_GRID]", sController->getTargetGrid());
24
25 childSetCommitCallback("User_edit", controller()->onCommitUser, this);
26 childSetCommitCallback("Password_edit", controller()->onCommitPassword, this);
27 childSetCommitCallback("Remember_check", controller()->onCommitRemember, this);
28
29 childSetAction("OK", controller()->onAccept, this);
30 childSetAction("Cancel", controller()->onCancel, this);
31 childSetAction("Register", controller()->onClickRegister, this);
32
33 setDefaultBtn("OK");
34}
35
36AuthenticationFloater::~AuthenticationFloater()
37{
38 sInstance = NULL;
39 delete sController;
40 sController = NULL;
41}
42
43// static
44void AuthenticationFloater::show(void* userdata)
45{
46 std::string target_grid;
47 void (*cb)(void*) = NULL;
48
49 if (!userdata)
50 {
51 target_grid = "Authentication Test";
52 }
53
54 if (!sInstance)
55 sInstance = new AuthenticationFloater();
56 if (!sController)
57 sController = new AuthenticationController(target_grid, cb);
58
59 sInstance->open();
60}
61
62void AuthenticationFloater::accept()
63{
64 llinfos << "accept" << llendl;
65}
66
67void AuthenticationFloater::cancel()
68{
69 llinfos << "cancel" << llendl;
70}
71
72AuthenticationController* AuthenticationFloater::controller()
73{
74 return sController;
75}
diff --git a/linden/indra/newview/authentication_floater.h b/linden/indra/newview/authentication_floater.h
new file mode 100644
index 0000000..b24426b
--- /dev/null
+++ b/linden/indra/newview/authentication_floater.h
@@ -0,0 +1,35 @@
1/*
2 * AuthenticationFloater.h
3 * Cross-grid authentication system view.
4 *
5 * Created by RMS on 7/1/08.
6 *
7 */
8
9#ifndef PL_AuthenticationFloater_H
10#define PL_AuthenticationFloater_H
11
12#include "llfloater.h"
13#include "authentication_controller.h"
14
15class AuthenticationFloater : public LLFloater
16{
17public:
18 AuthenticationFloater();
19 virtual ~AuthenticationFloater();
20
21 static void show(void* userdata);
22 static void accept();
23 static void cancel();
24
25 // data accessors
26 static AuthenticationController* controller();
27
28private:
29 // static because we only need one floater
30 static AuthenticationFloater* sInstance;
31 static AuthenticationController* sController;
32};
33
34
35#endif // PL_AuthenticationFloater_H
diff --git a/linden/indra/newview/authentication_model.cpp b/linden/indra/newview/authentication_model.cpp
new file mode 100644
index 0000000..763ab4a
--- /dev/null
+++ b/linden/indra/newview/authentication_model.cpp
@@ -0,0 +1,111 @@
1/*
2 * authentication_model.cpp
3 * SecondLife
4 *
5 * Created by RMS on 7/17/08.
6 *
7 */
8
9#include "llviewerprecompiledheaders.h"
10
11#include "lldir.h"
12#include "llfile.h"
13#include "llsdserialize.h"
14#include "authentication_model.h"
15
16AuthenticationModel::AuthenticationModel()
17{
18 loadPersistentData();
19}
20
21AuthenticationModel::~AuthenticationModel()
22{
23 savePersistentData();
24}
25
26void AuthenticationModel::loadPersistentData()
27{
28 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
29 "cross_grid_authentication.xml");
30 LLSD auth_llsd;
31 llifstream file;
32 file.open(filename);
33 if(file.is_open())
34 LLSDSerialize::fromXML(mAuthLLSD, file);
35}
36
37void AuthenticationModel::savePersistentData()
38{
39 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
40 "cross_grid_authentication.xml");
41 llofstream ofile;
42 ofile.open(filename);
43 LLSDSerialize::toPrettyXML(mAuthLLSD, ofile);
44}
45
46void AuthenticationModel::revert()
47{
48 loadPersistentData();
49}
50
51AuthenticationModel::connection_t AuthenticationModel::subscribeToModelUpdates
52 (event_t::slot_function_type subscriber)
53{
54 return mEventUpdate.connect(subscriber);
55}
56
57void AuthenticationModel::unsubscribe(connection_t subscriber)
58{
59 subscriber.disconnect();
60}
61
62/* setters */
63void AuthenticationModel::addAccount(const std::string &grid, const std::string &accountName,
64 const std::string &accountPassword)
65{
66 mAuthLLSD[grid][accountName] = LLSD::LLSD(accountPassword);
67 mEventUpdate();
68}
69
70void AuthenticationModel::removeAccount(const std::string &grid, const std::string &accountName)
71{
72 mAuthLLSD[grid].erase(accountName);
73 mEventUpdate();
74}
75
76void AuthenticationModel::changePassword(const std::string &grid, const std::string &accountName,
77 const std::string &newPassword)
78{
79 mAuthLLSD[grid][accountName] = newPassword;
80 // no event necessary: passwords aren't displayed in any view
81}
82
83/* getters */
84
85void AuthenticationModel::getAllAccountNames(std::list<std::string> &names)
86{
87 // TODO: implement this for account management
88}
89
90void AuthenticationModel::getAccountNames(const std::string &grid, std::set<std::string> &names)
91{
92 if(!mAuthLLSD.has(grid))
93 return;
94
95 for(LLSD::map_const_iterator it = mAuthLLSD[grid].beginMap();
96 it != mAuthLLSD[grid].endMap(); ++it)
97 {
98 names.insert(it->first);
99 }
100}
101
102void AuthenticationModel::getPassword(const std::string &grid, const std::string &accountName,
103 std::string &password)
104{
105 password = mAuthLLSD[grid][accountName].asString();
106}
107
108void AuthenticationModel::requestUpdate()
109{
110 mEventUpdate();
111}
diff --git a/linden/indra/newview/authentication_model.h b/linden/indra/newview/authentication_model.h
new file mode 100644
index 0000000..858e936
--- /dev/null
+++ b/linden/indra/newview/authentication_model.h
@@ -0,0 +1,53 @@
1/*
2 * authentication_model.h
3 * SecondLife
4 *
5 * Created by RMS on 7/17/08.
6 *
7 */
8
9#ifndef PL_authentication_model_H
10#define PL_authentication_model_H
11
12#include <string>
13#include <set>
14#include <list>
15#include <boost/signal.hpp>
16#include <boost/bind.hpp>
17#include "lluuid.h"
18#include "llmemory.h"
19#include "llsd.h"
20
21class AuthenticationModel : public LLSingleton<AuthenticationModel>
22{
23public:
24 typedef boost::signal<void ()> event_t;
25 typedef boost::signals::connection connection_t;
26
27 AuthenticationModel();
28 virtual ~AuthenticationModel();
29
30 void loadPersistentData();
31 void savePersistentData();
32 void revert();
33
34 /* generic update, pull model: */
35 connection_t subscribeToModelUpdates(event_t::slot_function_type subscriber);
36 void unsubscribe(connection_t subscriber);
37
38 /* setters */
39 void addAccount(const std::string &grid, const std::string &accountName, const std::string &accountPassword);
40 void removeAccount(const std::string &grid, const std::string &accountName);
41 void changePassword(const std::string &grid, const std::string &accountName, const std::string &newPassword);
42
43 /* getters */
44 void getAllAccountNames(std::list<std::string> &names);
45 void getAccountNames(const std::string &grid, std::set<std::string> &names);
46 void getPassword(const std::string &grid, const std::string &accountName, std::string &password);
47 void requestUpdate();
48protected:
49 LLSD mAuthLLSD;
50private:
51 event_t mEventUpdate;
52};
53#endif // PL_authentication_model_H
diff --git a/linden/indra/newview/controllerlogin.cpp b/linden/indra/newview/controllerlogin.cpp
new file mode 100644
index 0000000..9dd61a6
--- /dev/null
+++ b/linden/indra/newview/controllerlogin.cpp
@@ -0,0 +1,142 @@
1/*
2 * controllerlogin.cpp
3 * SecondLife
4 *
5 * Created by RMS on 7/16/08.
6 *
7 */
8#include "llerror.h"
9#include "llmd5.h"
10#include <boost/bind.hpp>
11#include "controllerlogin.h"
12
13LoginController::LoginController(LoginFloater *floater, AuthenticationModel *authModel, const std::string &grid)
14: mFloater(floater), mModel(authModel), mGrid(grid)
15{
16 // set up the user interface subview pointers
17 name_combo = mFloater->getChild<LLComboBox>("name_combo");
18 password_edit = mFloater->getChild<LLLineEditor>("password_edit");
19 start_location_combo= mFloater->getChild<LLComboBox>("start_location_combo");
20 remember_check = mFloater->getChild<LLCheckBoxCtrl>("remember_check");
21 connect_btn = mFloater->getChild<LLButton>("connect_btn");
22 quit_btn = mFloater->getChild<LLButton>("quit_btn");
23 server_combo = mFloater->getChild<LLComboBox>("server_combo");
24
25 // callbacks
26 // TODO: account creation and version information callbacks
27 name_combo->setCommitCallback(onCommitName);
28 name_combo->setCallbackUserData(this);
29 password_edit->setCommitCallback(onCommitPassword);
30 password_edit->setCallbackUserData(mFloater);
31 connect_btn->setClickedCallback(onAccept, this);
32 quit_btn->setClickedCallback(onCancel, this);
33
34 // subscribe to the model
35 mModelConnection = mModel->subscribeToModelUpdates(boost::bind(&LoginController::update, this));
36 // request an initial update
37 mModel->requestUpdate();
38}
39
40LoginController::~LoginController()
41{
42 mModel->unsubscribe(mModelConnection);
43}
44
45void LoginController::update()
46{
47 // when we want to update, we need to make sure it's relevant to our
48 // interests and make the change as smooth as possible for the user
49 std::set<std::string> newAccountNames;
50 mModel->getAccountNames(mGrid, newAccountNames);
51
52 if(mAccountNames == newAccountNames)
53 return;
54
55 name_combo->removeall();
56
57 for(std::set<std::string>::iterator it = newAccountNames.begin();
58 it != newAccountNames.end(); ++it)
59 {
60 name_combo->add(*it);
61 }
62
63 name_combo->sortByName();
64 mAccountNames.swap(newAccountNames);
65}
66
67void LoginController::mungePassword(std::string &password)
68{
69 LLMD5 pass((unsigned char *)password.c_str());
70 char munged_password[MD5HEX_STR_SIZE];
71 pass.hex_digest(munged_password);
72 password = munged_password;
73}
74
75// user interface callbacks
76
77void LoginController::onCommitName(LLUICtrl *control, void *userdata)
78{
79 // look at this shit it fills in the password box if it finds a stored account
80 // and auto checks remember password
81 LoginController *controller = (LoginController *)userdata;
82 LoginFloater *floater = controller->mFloater;
83
84 std::string loginname = floater->childGetText("name_combo");
85 std::set<std::string>::iterator it = controller->mAccountNames.find(loginname);
86 if(it != controller->mAccountNames.end())
87 {
88 std::string loginpassword;
89
90 controller->mModel->getPassword(controller->mGrid, loginname, loginpassword);
91 LoginFloater::setFields(loginname, loginpassword, true);
92 }
93}
94
95void LoginController::onCommitPassword(LLUICtrl *control, void *userdata)
96{
97 LoginFloater *floater = (LoginFloater *)userdata;
98 LLLineEditor *editor = (LLLineEditor *)control;
99 std::string password = editor->getText();
100
101 // when we have a new password we need to MD5 it and tell the floater
102 if(!floater->isSamePassword(password))
103 {
104 mungePassword(password);
105 floater->setPassword(password);
106 }
107}
108
109void LoginController::onAccept(void* userdata)
110{
111 // this here does the main work of telling the model we need to write
112 // account data
113 LoginController *controller = (LoginController *)userdata;
114 LoginFloater *floater = controller->mFloater;
115
116 if(!floater->childGetValue("remember_check"))
117 {
118 LoginFloater::accept();
119 return;
120 }
121
122 std::string username = floater->childGetText("name_combo");
123 std::string password = floater->getPassword();
124
125 if(controller->mAccountNames.find(username) != controller->mAccountNames.end())
126 {
127 controller->mModel->changePassword(controller->mGrid, username, password);
128 }
129
130 else
131 {
132 controller->mModel->addAccount(controller->mGrid, username, password);
133 }
134 controller->mModel->savePersistentData();
135 LoginFloater::accept();
136}
137
138void LoginController::onCancel(void* userdata)
139{
140 // if the user backs out of the dialog we tell it to clean up and such
141 LoginFloater::cancel_old();
142}
diff --git a/linden/indra/newview/controllerlogin.h b/linden/indra/newview/controllerlogin.h
new file mode 100644
index 0000000..a187558
--- /dev/null
+++ b/linden/indra/newview/controllerlogin.h
@@ -0,0 +1,55 @@
1/*
2 * controllerlogin.h
3 * SecondLife
4 *
5 * Created by RMS on 7/16/08.
6 *
7 */
8#ifndef PL_controllerlogin_H
9#define PL_controllerlogin_H
10
11#include <set>
12#include <string>
13#include "llcombobox.h"
14#include "lllineeditor.h"
15#include "llcheckboxctrl.h"
16#include "llbutton.h"
17#include "floaterlogin.h"
18#include "authentication_model.h"
19
20class LoginController
21{
22public:
23 LoginController(LoginFloater *floater, AuthenticationModel *authModel, const std::string &grid);
24 virtual ~LoginController();
25 virtual void update();
26protected:
27 LoginFloater *mFloater;
28 AuthenticationModel *mModel;
29 std::string mGrid;
30private:
31 AuthenticationModel::connection_t mModelConnection;
32
33 static void mungePassword(std::string &password);
34
35 // UI subview pointers
36 LLComboBox *name_combo;
37 LLLineEditor *password_edit;
38 LLComboBox *start_location_combo;
39 LLCheckBoxCtrl *remember_check;
40 LLButton *connect_btn;
41 LLButton *quit_btn;
42 LLComboBox *server_combo;
43
44 // state
45 std::set<std::string> mAccountNames;
46
47 // user interface callbacks
48 // TODO: find an alternative to linden callbacks
49 static void onCommitName(LLUICtrl *control, void *userdata);
50 static void onCommitPassword(LLUICtrl *control, void *userdata);
51 static void onAccept(void* userdata);
52 static void onCancel(void* userdata);
53};
54
55#endif // PL_controllerlogin_H
diff --git a/linden/indra/newview/controllerpasswords.cpp b/linden/indra/newview/controllerpasswords.cpp
new file mode 100644
index 0000000..6e39d9a
--- /dev/null
+++ b/linden/indra/newview/controllerpasswords.cpp
@@ -0,0 +1,41 @@
1/*
2 * controllerpasswords.cpp
3 * SecondLife
4 *
5 * Created by RMS on 8/5/08.
6 *
7 */
8
9#include "authentication_model.h"
10#include "prefpanelpasswords.h"
11#include "controllerpasswords.h"
12
13PasswordsController::PasswordsController(PasswordsPrefPanel *panel)
14: mPanel(panel)
15{
16 accounts_list = mPanel->getChild<LLScrollListCtrl>("accounts_list");
17 remove_btn = mPanel->getChild<LLButton>("remove_btn");
18 mModel = AuthenticationModel::getInstance();
19
20 // subscribe to the model
21 mModelConnection = mModel->subscribeToModelUpdates(boost::bind(&PasswordsController::update, this));
22 // request an initial update
23 mModel->requestUpdate();
24}
25
26PasswordsController::~PasswordsController()
27{
28 mModel->unsubscribe(mModelConnection);
29 mModel = NULL;
30}
31
32void PasswordsController::update()
33{
34 std::list<std::string> newAccountData;
35 mModel->getAllAccountNames(newAccountData);
36
37 if(mAccountData == newAccountData)
38 return;
39
40 accounts_list->deleteAllItems();
41}
diff --git a/linden/indra/newview/controllerpasswords.h b/linden/indra/newview/controllerpasswords.h
new file mode 100644
index 0000000..e656659
--- /dev/null
+++ b/linden/indra/newview/controllerpasswords.h
@@ -0,0 +1,37 @@
1/*
2 * controllerpasswords.h
3 * SecondLife
4 *
5 * Created by RMS on 8/5/08.
6 *
7 */
8
9#include <string>
10#include <list>
11#include "llscrolllistctrl.h"
12#include "llbutton.h"
13#include "authentication_model.h"
14
15#ifndef PL_controllerpasswords_H
16#define PL_controllerpasswords_H
17class PasswordsPrefPanel;
18
19class PasswordsController
20{
21public:
22 PasswordsController(PasswordsPrefPanel *panel);
23 virtual ~PasswordsController();
24 virtual void update();
25protected:
26 LLScrollListCtrl *accounts_list;
27 LLButton *remove_btn;
28private:
29 AuthenticationModel::connection_t mModelConnection;
30
31 PasswordsPrefPanel *mPanel;
32 AuthenticationModel *mModel;
33
34 std::list<std::string> mAccountData;
35};
36
37#endif // PL_controllerpasswords_H
diff --git a/linden/indra/newview/floaterlogin.cpp b/linden/indra/newview/floaterlogin.cpp
new file mode 100644
index 0000000..b943c4e
--- /dev/null
+++ b/linden/indra/newview/floaterlogin.cpp
@@ -0,0 +1,834 @@
1/*
2 * floaterlogin.cpp
3 * SecondLife
4 *
5 * Created by RMS on 7/15/08.
6 *
7 */
8
9#include "llviewerprecompiledheaders.h"
10
11#include <boost/algorithm/string.hpp>
12#include "llviewercontrol.h"
13#include "llviewerbuild.h"
14#include "llcombobox.h"
15#include "llscrolllistctrl.h"
16#include "llmd5.h"
17#include "llurlsimstring.h"
18#include "lluictrlfactory.h"
19#include "controllerlogin.h"
20#include "floaterlogin.h"
21#include "hippoGridManager.h"
22#include "llviewernetwork.h"
23#include "llpanellogin.h"
24
25#define PASSWORD_FILLER "123456789!123456"
26
27LoginFloater* LoginFloater::sInstance = NULL;
28LoginController* LoginFloater::sController = NULL;
29AuthenticationModel* LoginFloater::sModel = NULL;
30bool LoginFloater::sIsInitialLogin;
31std::string LoginFloater::sGrid;
32
33LoginFloater::LoginFloater(void (*callback)(S32 option, void* user_data),
34 void *cb_data)
35: LLFloater("floater_login"), mCallback(callback), mCallbackData(cb_data)
36{
37
38 mState = NORMAL;
39 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_login.xml");
40
41
42 llwarns << "LoginFloater called" << llendl;
43
44
45 // configure the floater interface for non-initial login
46 setCanMinimize(!sIsInitialLogin);
47 setCanClose(!sIsInitialLogin);
48 setCanDrag(!sIsInitialLogin);
49 childSetVisible("server_combo", sIsInitialLogin);
50
51 if(!sIsInitialLogin)
52 {
53 LLButton* quit_btn = getChild<LLButton>("quit_btn");
54 quit_btn->setLabel(std::string("Cancel"));
55 setTitle(std::string("Grid Manager"));
56 }
57
58 center();
59 LLLineEditor* edit = getChild<LLLineEditor>("password_edit");
60 if (edit) edit->setDrawAsterixes(TRUE);
61 LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
62 combo->setAllowTextEntry(TRUE, 128, FALSE);
63
64 BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
65 std::string sim_string = LLURLSimString::sInstance.mSimString;
66 if (!sim_string.empty())
67 {
68 // Replace "<Type region name>" with this region name
69 combo->remove(2);
70 combo->add( sim_string );
71 combo->setTextEntry(sim_string);
72 combo->setCurrentByIndex( 2 );
73 }
74 else if (login_last)
75 {
76 combo->setCurrentByIndex( 1 );
77 }
78 else
79 {
80 combo->setCurrentByIndex( 0 );
81 }
82
83 LLTextBox* version_text = getChild<LLTextBox>("version_text");
84 std::string version = llformat("%d.%d.%d (%d)",
85 LL_VERSION_MAJOR,
86 LL_VERSION_MINOR,
87 LL_VERSION_PATCH,
88 LL_VIEWER_BUILD );
89 version_text->setText(version);
90
91 LLTextBox* channel_text = getChild<LLTextBox>("channel_text");
92 channel_text->setText(gSavedSettings.getString("VersionChannelName"));
93
94 sendChildToBack(getChildView("channel_text"));
95 sendChildToBack(getChildView("version_text"));
96 sendChildToBack(getChildView("forgot_password_text"));
97
98 setDefaultBtn("connect_btn");
99
100
101
102}
103
104
105LoginFloater::~LoginFloater()
106{
107 delete LoginFloater::sController;
108
109 LoginFloater::sModel = NULL;
110 LoginFloater::sController = NULL;
111 LoginFloater::sInstance = NULL;
112}
113
114void LoginFloater::close()
115{
116 if(sInstance)
117 {
118 delete sInstance;
119 sInstance = NULL;
120 }
121}
122
123BOOL LoginFloater::postBuild()
124{
125 requires<LLComboBox>("grid_selector");
126 requires<LLLineEditor>("gridnick");
127 requires<LLComboBox>("platform");
128 requires<LLLineEditor>("gridname");
129 requires<LLLineEditor>("loginuri");
130 requires<LLLineEditor>("loginpage");
131 requires<LLLineEditor>("helperuri");
132 requires<LLLineEditor>("website");
133 requires<LLLineEditor>("first_name");
134 requires<LLLineEditor>("last_name");
135 requires<LLLineEditor>("password");
136 //requires<LLLineEditor>("search");
137 requires<LLButton>("btn_delete");
138 requires<LLButton>("btn_add");
139 requires<LLButton>("btn_copy");
140 requires<LLButton>("set_default");
141 requires<LLButton>("btn_gridinfo");
142 requires<LLButton>("btn_help_render_compat");
143 if (!checkRequirements()) return false;
144 LLLineEditor* password_edit = getChild<LLLineEditor>("password");
145 if (password_edit) password_edit->setDrawAsterixes(TRUE);
146
147 childSetAction("btn_delete", onClickDelete, this);
148 childSetAction("btn_add", onClickAdd, this);
149 childSetAction("btn_copy", onClickCopy, this);
150 childSetAction("btn_apply", onClickApply, this);
151 childSetAction("set_default", onClickDefault, this);
152 childSetAction("btn_cancel", onClickCancel, this);
153//KOW childSetAction("set_default", onClickDefault, this);
154//KOW childSetAction("btn_gridinfo", onClickGridInfo, this);
155//KOW childSetAction("btn_help_render_compat", onClickHelpRenderCompat, this);
156
157 childSetCommitCallback("grid_selector", onSelectGrid, this);
158//KOW childSetCommitCallback("platform", onSelectPlatform, this);
159
160 // !!!### server_choice_combo->setFocusLostCallback(onServerComboLostFocus);
161
162//KOW update();
163 return TRUE;
164}
165
166void LoginFloater::refresh_grids()
167{
168 const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
169 LLScrollListCtrl *grids = sInstance->getChild<LLScrollListCtrl>("grid_selector");
170 S32 selectIndex = -1, i = 0;
171 grids->deleteAllItems();
172 if (defaultGrid != "") {
173 LLSD value;
174 value["id"] = defaultGrid;
175 value["columns"][0]["column"] = "grid";
176 value["columns"][0]["value"] = defaultGrid;
177 grids->addElement(value);
178 selectIndex = i++;
179 }
180
181 HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
182 for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
183 const std::string &grid = it->second->getGridNick();
184 if (grid != defaultGrid) {
185 LLSD value;
186 value["id"] = grid;
187 value["columns"][0]["column"] = "grid";
188 value["columns"][0]["value"] = grid;
189 grids->addElement(value);
190
191 if (grid == sInstance->mCurGrid) selectIndex = i;
192 i++;
193 }
194 }
195 if ((sInstance->mState == ADD_NEW) || (sInstance->mState == ADD_COPY)) {
196 grids->addElement("<new>");
197 selectIndex = i++;
198 }
199 if (selectIndex >= 0) {
200 //grids->setCurrentByIndex(selectIndex);
201 } else {
202 //grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label
203 }
204
205 sInstance->childSetTextArg("default_grid", "[DEFAULT]", (defaultGrid != "")? defaultGrid: " ");
206
207 sInstance->childSetEnabled("btn_delete", (selectIndex >= 0));
208 sInstance->childSetEnabled("btn_copy", (sInstance->mState == NORMAL) && (selectIndex >= 0));
209 sInstance->childSetEnabled("set_default", (sInstance->mState == NORMAL) && (selectIndex > 0));
210 sInstance->childSetEnabled("gridnick", (sInstance->mState == ADD_NEW) || (sInstance->mState == ADD_COPY));
211
212
213 LLComboBox *platform = sInstance->getChild<LLComboBox>("platform");
214 platform->removeall();
215 for (int p=HippoGridInfo::PLATFORM_OTHER; p<HippoGridInfo::PLATFORM_LAST; p++)
216 platform->add(HippoGridInfo::getPlatformString(static_cast<HippoGridInfo::Platform>(p)));
217
218
219 if (sInstance->mState == NORMAL) {
220 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(sInstance->mCurGrid);
221 if (gridInfo) {
222 sInstance->childSetText("gridnick", gridInfo->getGridNick());
223 platform->setCurrentByIndex(gridInfo->getPlatform());
224 //sInstance->childSetText("grid_name", gridInfo->getGridName());
225 sInstance->childSetText("loginuri", gridInfo->getLoginUri());
226 sInstance->childSetText("loginpage", gridInfo->getLoginPage());
227 sInstance->childSetText("helperuri", gridInfo->getHelperUri());
228 sInstance->childSetText("website", gridInfo->getWebSite());
229 sInstance->childSetText("first_name", gridInfo->getFirstName());
230 sInstance->childSetText("last_name", gridInfo->getLastName());
231 if(gridInfo->getAvatarPassword().length() == 32)
232 sInstance->childSetText("password", std::string(PASSWORD_FILLER));
233 else if(gridInfo->getPasswordUrl().empty())
234 sInstance->childSetText("password", std::string(""));
235/*
236 if (gridInfo->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) {
237 //childSetEnabled("search", false);
238 //childSetText("search", LLStringExplicit(""));
239 childSetEnabled("render_compat", false);
240 childSetValue("render_compat", false);
241 } else {
242 //childSetEnabled("search", true);
243 //childSetText("search", gridInfo->getSearchUrl());
244 childSetEnabled("render_compat", true);
245 childSetValue("render_compat", gridInfo->isRenderCompat());
246 }
247 */
248 } else {
249 std::string empty = "";
250 sInstance->childSetText("gridnick", empty);
251 platform->setCurrentByIndex(HippoGridInfo::PLATFORM_OTHER);
252 sInstance->childSetText("gridname", empty);
253 sInstance->childSetText("loginuri", empty);
254 sInstance->childSetText("loginpage", empty);
255 sInstance->childSetText("helperuri", empty);
256 sInstance->childSetText("website", empty);
257 sInstance->childSetText("first_name", empty);
258 sInstance->childSetText("last_name", empty);
259 sInstance->childSetText("password", empty);
260 sInstance->childSetEnabled("render_compat", true);
261 sInstance->childSetValue("render_compat", true);
262 }
263 } else if (sInstance->mState == ADD_NEW) {
264 llwarns << "ADD_NEW" << llendl;
265 std::string required = "<required>";
266 std::string empty = "";
267 sInstance->childSetText("gridnick", required);
268 platform->setCurrentByIndex(HippoGridInfo::PLATFORM_OTHER);
269 sInstance->childSetText("gridname", empty);
270 sInstance->childSetText("loginuri", required);
271 sInstance->childSetText("loginpage", empty);
272 sInstance->childSetText("helperuri", empty);
273 sInstance->childSetText("website", empty);
274 sInstance->childSetText("first_name", empty);
275 sInstance->childSetText("last_name", empty);
276 sInstance->childSetText("password", empty);
277 //childSetEnabled("search", true);
278 //childSetText("search", empty);
279 sInstance->childSetEnabled("render_compat", true);
280 sInstance->childSetValue("render_compat", true);
281 } else if (sInstance->mState == ADD_COPY) {
282 llwarns << "ADD_COPY" << llendl;
283 sInstance->childSetText("gridnick", LLStringExplicit("<required>"));
284 } else {
285 llwarns << "Illegal state " << sInstance->mState << '.' << llendl;
286 }
287 return;
288}
289
290void LoginFloater::update()
291{
292 mState = NORMAL;
293 mCurGrid = gHippoGridManager->getCurrentGridNick();
294 refresh_grids();
295 //KOW gHippoLimits->setLimits();
296}
297
298void LoginFloater::applyChanges()
299{
300 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
301 if (gridInfo)
302 {
303 if (gridInfo->getGridNick() == childGetValue("gridnick").asString())
304 {
305 gridInfo->setPlatform(childGetValue("platform"));
306 gridInfo->setGridName(childGetValue("gridname"));
307 gridInfo->setLoginUri(childGetValue("loginuri"));
308 gridInfo->setLoginPage(childGetValue("loginpage"));
309 gridInfo->setHelperUri(childGetValue("helperuri"));
310 gridInfo->setWebSite(childGetValue("website"));
311 gridInfo->setFirstName(childGetValue("first_name"));
312 gridInfo->setLastName(childGetValue("last_name"));
313 //gridInfo->setSearchUrl(childGetValue("search"));
314 gridInfo->setRenderCompat(childGetValue("render_compat"));
315
316 if(childGetValue("password").asString().empty())
317 gridInfo->setPasswordUrl(std::string(""));
318 else if(childGetValue("password").asString() != std::string(PASSWORD_FILLER))
319 {
320 // store account authentication data
321 std::string auth_password = childGetValue("password");
322 std::string hashed_password;
323 hashPassword(auth_password, hashed_password);
324 gridInfo->setAvatarPassword(hashed_password);
325 }
326 LLPanelLogin::setFields(gridInfo->getFirstName(), gridInfo->getLastName(),
327 gridInfo->getAvatarPassword(), true);
328 }
329 else
330 {
331 llwarns << "Grid nickname mismatch, ignoring changes." << llendl;
332 }
333 }
334}
335
336
337bool LoginFloater::createNewGrid()
338{
339 // check nickname
340 std::string gridnick = childGetValue("gridnick");
341 if (gridnick == "<required>") gridnick = "";
342 HippoGridInfo::cleanUpGridNick(gridnick);
343 childSetValue("gridnick", (gridnick != "")? gridnick: "<required>");
344 if (gridnick == "") {
345 //KOW gViewerWindow->alertXml("GridsNoNick");
346 return false;
347 }
348 if (gHippoGridManager->getGrid(gridnick)) {
349 LLStringUtil::format_map_t args;
350 args["[NAME]"] = gridnick;
351 //KOW gViewerWindow->alertXml("GridExists", args);
352 return false;
353 }
354
355 // check login URI
356 std::string loginuri = childGetValue("loginuri");
357 if ((loginuri == "") || (loginuri == "<required>")) {
358 LLStringUtil::format_map_t args;
359 args["[NAME]"] = gridnick;
360 //KOW gViewerWindow->alertXml("GridsNoLoginUri", args);
361 return false;
362 }
363
364 // create new grid
365 HippoGridInfo *grid = new HippoGridInfo(gridnick);
366 grid->setPlatform(childGetValue("platform"));
367 grid->setGridName(childGetValue("gridname"));
368 grid->setLoginUri(loginuri);
369 grid->setLoginPage(childGetValue("loginpage"));
370 grid->setHelperUri(childGetValue("helperuri"));
371 grid->setWebSite(childGetValue("website"));
372 grid->setFirstName(childGetValue("first_name"));
373 grid->setLastName(childGetValue("last_name"));
374 //grid->setSearchUrl(childGetValue("search"));
375 grid->setRenderCompat(childGetValue("render_compat"));
376 gHippoGridManager->addGrid(grid);
377
378 if(childGetValue("password").asString().empty())
379 grid->setAvatarPassword(std::string(""));
380 else
381 {
382 std::string hashed_password;
383 hashPassword(childGetValue("password"), hashed_password);
384 grid->setAvatarPassword(hashed_password);
385 }
386
387 mCurGrid = gridnick;
388 return true;
389}
390
391void LoginFloater::apply()
392{
393 if (mState == NORMAL) {
394 applyChanges();
395 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
396 if (!createNewGrid()) return;
397 } else {
398 llwarns << "Illegal state " << mState << '.' << llendl;
399 return;
400 }
401 //gHippoGridManager->setCurrentGrid(mCurGrid);
402 //gHippoGridManager->setDefaultGrid(mCurGrid);
403 //LLPanelLogin::refreshLoginPage();
404 gHippoGridManager->saveFile();
405 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
406}
407
408void LoginFloater::setDefault()
409{
410 if (mState == NORMAL) {
411 applyChanges();
412 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
413 if (!createNewGrid()) return;
414 } else {
415 llwarns << "Illegal state " << mState << '.' << llendl;
416 return;
417 }
418 gHippoGridManager->setCurrentGrid(mCurGrid);
419 gHippoGridManager->setDefaultGrid(mCurGrid);
420 llwarns << "I think me grid is " << mCurGrid << llendl;
421 //LLPanelLogin::refreshLoginPage();
422 gHippoGridManager->saveFile();
423 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
424}
425
426void LoginFloater::cancel()
427{
428 gHippoGridManager->discardAndReload();
429 LoginFloater::sModel->revert();
430 update();
431}
432
433void LoginFloater::onSelectGrid(LLUICtrl* ctrl, void *data)
434{
435 LoginFloater* self = (LoginFloater*)data;
436 if (self->mState == NORMAL) {
437 self->applyChanges();
438 } else if ((self->mState == ADD_NEW) || (self->mState == ADD_COPY)) {
439 if (self->createNewGrid()) {
440 self->mState = NORMAL;
441 } else {
442 //LLCtrlListInterface *grids = self->childGetListInterface("search_results");
443 //if (!grids) return;
444
445 //LLSD selected_value = grids->getSelectedValue();
446 //std::string sim_name = selected_value.asString();
447
448 LLComboBox *grids = self->getChild<LLComboBox>("grid_selector");
449 grids->setCurrentByIndex(grids->getItemCount() - 1);
450 return;
451 }
452 } else {
453 llwarns << "Illegal state " << self->mState << '.' << llendl;
454 return;
455 }
456 self->mCurGrid = ctrl->getValue().asString();
457 llwarns << "I think me grid is " << self->mCurGrid << llendl;
458
459 self->refresh_grids();
460}
461
462//static
463void LoginFloater::onClickDelete(void *data)
464{
465 llwarns << "onclickdelete" << llendl;
466 LoginFloater* self = (LoginFloater*)data;
467 if (self->mState == NORMAL)
468 gHippoGridManager->deleteGrid(self->mCurGrid);
469 self->update();
470}
471
472//static
473void LoginFloater::onClickAdd(void *data)
474{
475 llwarns << "add" << llendl;
476 LoginFloater* self = (LoginFloater*)data;
477 self->mState = ADD_NEW;
478 self->refresh_grids();
479}
480
481
482//static
483void LoginFloater::onClickCopy(void *data)
484{
485 llwarns << "copy" << llendl;
486 LoginFloater* self = (LoginFloater*)data;
487 self->mState = ADD_COPY;
488 self->refresh_grids();
489}
490
491//static
492void LoginFloater::onClickApply(void *data)
493{
494 sInstance->apply();
495}
496
497//static
498void LoginFloater::onClickDefault(void *data)
499{
500 sInstance->setDefault();
501}
502
503//static
504void LoginFloater::onClickCancel(void *data)
505{
506 sInstance->cancel();
507}
508
509void LoginFloater::setAlwaysRefresh(bool refresh)
510{
511 // wargames 2: dead code, LLPanelLogin compatibility
512 return;
513}
514
515void LoginFloater::refreshLocation( bool force_visible )
516{
517
518 llwarns << "refreshLocation called" << llendl;
519
520 if (!sInstance) return;
521
522 LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
523
524 if (LLURLSimString::parse())
525 {
526 combo->setCurrentByIndex( 3 ); // BUG? Maybe 2?
527 combo->setTextEntry(LLURLSimString::sInstance.mSimString);
528 }
529 else
530 {
531 BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
532 combo->setCurrentByIndex( login_last ? 1 : 0 );
533 }
534
535 BOOL show_start = TRUE;
536
537 if ( ! force_visible )
538 show_start = gSavedSettings.getBOOL("ShowStartLocation");
539
540 sInstance->childSetVisible("start_location_combo", show_start);
541 sInstance->childSetVisible("start_location_text", show_start);
542 sInstance->childSetVisible("server_combo", TRUE);
543}
544
545void LoginFloater::newShow(const std::string &grid, bool initialLogin,
546 void (*callback)(S32 option, void* user_data),
547 void* callback_data)
548{
549
550 llwarns << "newShow called" << llendl;
551 if(NULL==sInstance)
552 {
553 LoginFloater::sGrid = grid;
554 LoginFloater::sIsInitialLogin = initialLogin;
555 sInstance = new LoginFloater(callback, callback_data);
556
557 llwarns << "sInstance assigned. sInstance=" << sInstance << llendl;
558 }
559
560 // floater controller requires initialized floater and model
561 if(NULL==sModel)
562 sModel = AuthenticationModel::getInstance();
563 if(NULL==sController)
564 //sController = new LoginController(sInstance, sModel, sGrid);
565
566
567
568 llwarns << "newshow called" << llendl;
569 sInstance->mCurGrid = gHippoGridManager->getCurrentGridNick();
570 refresh_grids();
571
572 // we're important
573 sInstance->setFrontmost(TRUE);
574 sInstance->setFocus(TRUE);
575
576}
577
578void LoginFloater::testShow(void *lies)
579{
580 // this is if we want to call LoginFloater from a menu option
581 // or you know whatever
582 newShow(std::string("Test"), false, testCallback, NULL);
583}
584
585void LoginFloater::testCallback(S32 option, void *user_data)
586{
587 // test callback, referenced by testShow()
588 if(LOGIN_OPTION_CONNECT == option)
589 {
590 llinfos << "this is how we connect to a METAVERSE" << llendl;
591 std::string first, last, password;
592 BOOL remember = TRUE;
593 getFields(first, last, password, remember);
594 llinfos << "first\t\tlast\t\tpassword" << llendl;
595 llinfos << first << "\t\t" << last << "\t\t" << password << llendl;
596 }
597 else if(LOGIN_OPTION_QUIT == option)
598 {
599 llinfos << "my login, she die" << llendl;
600 llinfos << ":(" << llendl;
601 close();
602 }
603}
604
605void LoginFloater::show(const LLRect &rect, BOOL show_server,
606 void (*callback)(S32 option, void* user_data),
607 void* callback_data)
608{
609 // we don't need a grid passed in because this is old-style login
610 std::string grid = "";
611 newShow(grid, TRUE, callback, callback_data);
612}
613
614void LoginFloater::setFocus(BOOL b)
615{
616 if(b != hasFocus())
617 {
618 if(b)
619 {
620 LoginFloater::giveFocus();
621 }
622 else
623 {
624 LLPanel::setFocus(b);
625 }
626 }
627}
628
629void LoginFloater::giveFocus()
630{
631 LLComboBox *combo = NULL;
632
633 if(NULL==sInstance)
634 {
635 llwarns << "giveFocus has no LoginFloater instance. sInstance=" << sInstance << llendl;
636 return;
637 }
638
639 // for our combo box approach, selecting the combo box is almost always
640 // the right thing to do on the floater receiving focus
641 combo = sInstance->getChild<LLComboBox>("name_combo");
642 combo->setFocus(TRUE);
643}
644
645void LoginFloater::getFields(std::string &firstname, std::string &lastname, std::string &password,
646 BOOL &remember)
647{
648 if (!sInstance)
649 {
650 llwarns << "Attempted getFields with no login view shown" << llendl;
651 return;
652 }
653
654 std::string loginname = sInstance->childGetText("name_combo");
655
656 LLStringUtil::replaceTabsWithSpaces(loginname, 1);
657 LLStringUtil::trim(loginname);
658 std::vector<std::string> loginVec;
659 boost::split(loginVec, loginname, boost::is_any_of(" "), boost::token_compress_on);
660 if(loginVec.size() == 2)
661 {
662 firstname = loginVec[0];
663 lastname = loginVec[1];
664 }
665
666 password = sInstance->mMungedPassword;
667 remember = sInstance->childGetValue("remember_check");
668}
669
670void LoginFloater::getFields(std::string &loginname, std::string &password, BOOL &remember)
671{
672 std::string first, last, pass;
673 BOOL rem;
674 getFields(first, last, pass, rem);
675 loginname = first + " " + last;
676 password = pass;
677 remember = rem;
678}
679
680void LoginFloater::setFields(const std::string& firstname, const std::string& lastname, const std::string& password,
681 BOOL remember)
682{
683 if (!sInstance)
684 {
685 llwarns << "Attempted setFields with no login view shown" << llendl;
686 return;
687 }
688
689 std::string loginname = firstname + " " + lastname;
690 sInstance->childSetText("name_combo", loginname);
691
692 // Max "actual" password length is 16 characters.
693 // Hex digests are always 32 characters.
694 if (password.length() == 32)
695 {
696 // This is a MD5 hex digest of a password.
697 // We don't actually use the password input field,
698 // fill it with MAX_PASSWORD characters so we get a
699 // nice row of asterixes.
700 const std::string filler("123456789!123456");
701 sInstance->childSetText("password_edit", filler);
702 sInstance->mIncomingPassword = filler;
703 sInstance->mMungedPassword = password;
704 }
705 else
706 {
707 // this is a normal text password
708 sInstance->childSetText("password_edit", password);
709 sInstance->mIncomingPassword = password;
710 LLMD5 pass((unsigned char *)password.c_str());
711 char munged_password[MD5HEX_STR_SIZE];
712 pass.hex_digest(munged_password);
713 sInstance->mMungedPassword = munged_password;
714 }
715
716 sInstance->childSetValue("remember_check", remember);
717}
718
719void LoginFloater::setFields(const std::string &loginname, const std::string &password, BOOL remember)
720{
721 std::vector<std::string> loginVec;
722 boost::split(loginVec, loginname, boost::is_any_of(" "), boost::token_compress_on);
723 setFields(loginVec[0], loginVec[1], password, remember);
724}
725
726BOOL LoginFloater::isGridComboDirty()
727{
728 BOOL user_picked = FALSE;
729 if (!sInstance)
730 {
731 llwarns << "Attempted getServer with no login view shown" << llendl;
732 }
733 else
734 {
735 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
736 user_picked = combo->isDirty();
737 }
738 return user_picked;
739}
740
741void LoginFloater::getLocation(std::string &location)
742{
743 if (!sInstance)
744 {
745 llwarns << "Attempted getLocation with no login view shown" << llendl;
746 return;
747 }
748
749 LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
750 location = combo->getValue().asString();
751}
752
753std::string& LoginFloater::getPassword()
754{
755 return mMungedPassword;
756}
757
758void LoginFloater::setPassword(std::string &password)
759{
760 mMungedPassword = password;
761}
762
763bool LoginFloater::isSamePassword(std::string &password)
764{
765 return mMungedPassword == password;
766}
767
768void LoginFloater::addServer(const std::string& server, S32 domain_name)
769{
770 if (!sInstance)
771 {
772 llwarns << "Attempted addServer with no login view shown" << llendl;
773 return;
774 }
775
776 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
777 combo->add(server, LLSD(domain_name) );
778 combo->setCurrentByIndex(0);
779}
780
781void LoginFloater::accept()
782{
783 if(NULL==sInstance || NULL==sInstance->mCallback)
784 return;
785
786 sInstance->setFocus(FALSE);
787
788 std::string name_combo = sInstance->childGetText("name_combo");
789 if(!name_combo.empty())
790 {
791 sInstance->mCallback(LOGIN_OPTION_CONNECT, sInstance->mCallbackData);
792 }
793 else
794 {
795 // TODO: new account call goes here
796 return;
797 }
798}
799
800void LoginFloater::cancel_old()
801{
802 if(NULL==sInstance)
803 return;
804
805 if(sInstance->sIsInitialLogin)
806 {
807 // send a callback that indicates we're quitting or closing
808 if(sInstance->mCallback)
809 sInstance->mCallback(LOGIN_OPTION_QUIT, sInstance->mCallbackData);
810 return;
811 }
812
813 sInstance->close();
814}
815
816void LoginFloater::hashPassword(const std::string& password, std::string& hashedPassword)
817{
818 // Max "actual" password length is 16 characters.
819 // Hex digests are always 32 characters.
820 if (password.length() == 32)
821 {
822 hashedPassword = password;
823 }
824 else
825 {
826 // this is a normal text password
827 LLMD5 pass((unsigned char *)password.c_str());
828 char munged_password[MD5HEX_STR_SIZE];
829 pass.hex_digest(munged_password);
830 hashedPassword = munged_password;
831 }
832
833}
834
diff --git a/linden/indra/newview/floaterlogin.h b/linden/indra/newview/floaterlogin.h
new file mode 100644
index 0000000..1800897
--- /dev/null
+++ b/linden/indra/newview/floaterlogin.h
@@ -0,0 +1,98 @@
1/*
2 * floaterlogin.h
3 * SecondLife
4 *
5 * Created by RMS on 7/15/08.
6 *
7 */
8#ifndef PL_floaterlogin_H
9#define PL_floaterlogin_H
10
11#define LOGIN_OPTION_CONNECT 0
12#define LOGIN_OPTION_QUIT 1
13
14#include "llfloater.h"
15
16class LoginController;
17class AuthenticationModel;
18
19class LoginFloater : public LLFloater
20{
21public:
22 LoginFloater(void (*callback)(S32 option, void *user_data),
23 void *callback_data);
24 virtual ~LoginFloater();
25
26 virtual BOOL postBuild();
27
28 static void refresh_grids();
29 void apply();
30 void setDefault();
31 void cancel();
32
33 // new-style login methods
34 static void newShow(const std::string &grid, bool initialLogin,
35 void (*callback)(S32 option, void *user_data),
36 void *callback_data);
37 static void testShow(void *lies);
38 static void testCallback(S32 option, void *user_data);
39 virtual std::string& getPassword();
40 virtual void setPassword(std::string &password);
41 virtual bool isSamePassword(std::string &password);
42 static void getFields(std::string &loginname, std::string &password,
43 BOOL &remember);
44 static void setFields(const std::string &loginname, const std::string &password,
45 BOOL remember);
46
47 // LLLoginPanel compatibility
48 //TODO: Make this not suck
49 static void show(const LLRect &rect, BOOL show_server,
50 void (*callback)(S32 option, void *user_data),
51 void *callback_data);
52 static void close();
53 static void setAlwaysRefresh(bool refresh);
54 static void refreshLocation(bool force_visible);
55 virtual void setFocus(BOOL b);
56 static void giveFocus();
57 static void getFields(std::string& firstname, std::string& lastname,
58 std::string& password, BOOL& remember);
59 static void setFields(const std::string& firstname, const std::string &lastname,
60 const std::string& password, BOOL remember);
61 static void getLocation(std::string &location);
62 static BOOL isGridComboDirty();
63 static void addServer(const std::string& server, S32 domain_name);
64 static void accept();
65 static void cancel_old();
66 static void hashPassword(const std::string& password, std::string& hashedPassword);
67protected:
68 static bool sIsInitialLogin;
69 static std::string sGrid;
70private:
71 enum State { NORMAL, ADD_NEW, ADD_COPY };
72 State mState;
73 std::string mCurGrid;
74
75 std::string mIncomingPassword;
76 std::string mMungedPassword;
77
78 void applyChanges();
79 bool createNewGrid();
80 void update();
81
82 static void onSelectGrid(LLUICtrl *ctrl, void *data);
83 static void onClickDelete(void *data);
84 static void onClickAdd(void *data);
85 static void onClickCopy(void *data);
86 static void onClickApply(void *data);
87 static void onClickDefault(void *data);
88 static void onClickCancel(void *data);
89
90 static LoginFloater *sInstance;
91 static LoginController *sController;
92 static AuthenticationModel *sModel;
93
94 void (*mCallback)(S32 option, void *userdata);
95 void *mCallbackData;
96};
97
98#endif // PL_floaterlogin_H
diff --git a/linden/indra/newview/hippoGridManager.cpp b/linden/indra/newview/hippoGridManager.cpp
new file mode 100644
index 0000000..8415adb
--- /dev/null
+++ b/linden/indra/newview/hippoGridManager.cpp
@@ -0,0 +1,597 @@
1
2
3#include "hippoGridManager.h"
4
5#include <cctype>
6
7#include <stdtypes.h>
8#include <lldir.h>
9#include <lleconomy.h>
10#include <llerror.h>
11#include <llfile.h>
12#include <llhttpclient.h>
13#include <llsdserialize.h>
14#include "llviewercontrol.h"
15#include "llweb.h"
16
17#include "hippoRestRequest.h"
18
19
20// ********************************************************************
21// Global Variables
22
23HippoGridManager *gHippoGridManager = 0;
24
25HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO("");
26
27
28
29// ********************************************************************
30// ********************************************************************
31// HippoGridInfo
32// ********************************************************************
33// ********************************************************************
34
35
36// ********************************************************************
37// Initialize
38
39HippoGridInfo::HippoGridInfo(const std::string &gridNick) :
40 mPlatform(PLATFORM_OTHER),
41 mGridNick(gridNick),
42 mRenderCompat(true),
43 mCurrencySymbol("OS$"),
44 mRealCurrencySymbol("US$"),
45 mDirectoryFee(30)
46{
47 cleanUpGridNick(mGridNick);
48}
49
50
51void HippoGridInfo::setPlatform(Platform platform)
52{
53 mPlatform = platform;
54 mCurrencySymbol = (mPlatform == PLATFORM_SECONDLIFE)? "L$": "OS$";
55}
56
57
58void HippoGridInfo::setPlatform(const std::string &platform)
59{
60 std::string tmp = platform;
61 for (unsigned i=0; i<platform.size(); i++)
62 tmp[i] = tolower(tmp[i]);
63
64 if (tmp == "opensim") {
65 setPlatform(PLATFORM_OPENSIM);
66 } else if (tmp == "secondlife") {
67 setPlatform(PLATFORM_SECONDLIFE);
68 } else {
69 setPlatform(PLATFORM_OTHER);
70 llwarns << "Unknown platform '" << platform << "'." << llendl;
71 }
72}
73
74
75// ********************************************************************
76// Grid Info
77
78std::string HippoGridInfo::getSearchUrl(SearchType ty) const
79{
80 if ((mPlatform == PLATFORM_SECONDLIFE) || mSearchUrl.empty()) {
81 // Second Life defaults
82 if (ty == SEARCH_ALL_EMPTY) {
83 return gSavedSettings.getString("SearchURLDefault");
84 } else if (ty == SEARCH_ALL_QUERY) {
85 return gSavedSettings.getString("SearchURLQuery");
86 } else if (ty == SEARCH_ALL_TEMPLATE) {
87 return gSavedSettings.getString("SearchURLSuffix2");
88 } else {
89 llinfos << "Illegal search URL type " << ty << llendl;
90 return "";
91 }
92 } else {
93 // OpenSim and other
94 if (ty == SEARCH_ALL_EMPTY) {
95 return (mSearchUrl + "panel=All&");
96 } else if (ty == SEARCH_ALL_QUERY) {
97 return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
98 } else if (ty == SEARCH_ALL_TEMPLATE) {
99 return "lang=[LANG]&m=[MATURE]&t=[TEEN]&region=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]";
100 } else {
101 llinfos << "Illegal search URL type " << ty << llendl;
102 return "";
103 }
104 }
105}
106
107
108//static
109void HippoGridInfo::onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts)
110{
111 HippoGridInfo *self = (HippoGridInfo*)userData;
112 if (strcasecmp(name, "gridnick") == 0)
113 self->mXmlState = XML_GRIDNICK;
114 else if (strcasecmp(name, "gridname") == 0)
115 self->mXmlState = XML_GRIDNAME;
116 else if (strcasecmp(name, "platform") == 0)
117 self->mXmlState = XML_PLATFORM;
118 else if ((strcasecmp(name, "login") == 0) || (strcasecmp(name, "loginuri") == 0))
119 self->mXmlState = XML_LOGINURI;
120 else if ((strcasecmp(name, "welcome") == 0) || (strcasecmp(name, "loginpage") == 0))
121 self->mXmlState = XML_LOGINPAGE;
122 else if ((strcasecmp(name, "economy") == 0) || (strcasecmp(name, "helperuri") == 0))
123 self->mXmlState = XML_HELPERURI;
124 else if ((strcasecmp(name, "about") == 0) || (strcasecmp(name, "website") == 0))
125 self->mXmlState = XML_WEBSITE;
126 else if ((strcasecmp(name, "help") == 0) || (strcasecmp(name, "support") == 0))
127 self->mXmlState = XML_SUPPORT;
128 else if ((strcasecmp(name, "register") == 0) || (strcasecmp(name, "account") == 0))
129 self->mXmlState = XML_REGISTER;
130 else if (strcasecmp(name, "password") == 0)
131 self->mXmlState = XML_PASSWORD;
132 //else if (strcasecmp(name, "search") == 0)
133 //self->mXmlState = XML_SEARCH;
134}
135
136//static
137void HippoGridInfo::onXmlElementEnd(void *userData, const XML_Char *name)
138{
139 HippoGridInfo *self = (HippoGridInfo*)userData;
140 self->mXmlState = XML_VOID;
141}
142
143//static
144void HippoGridInfo::onXmlCharacterData(void *userData, const XML_Char *s, int len)
145{
146 HippoGridInfo *self = (HippoGridInfo*)userData;
147 switch (self->mXmlState) {
148
149 case XML_GRIDNICK:
150 if (self->mGridNick == "") self->mGridNick.assign(s, len);
151 cleanUpGridNick(self->mGridNick);
152 break;
153
154 case XML_PLATFORM: {
155 std::string platform(s, len);
156 self->setPlatform(platform);
157 break;
158 }
159
160 case XML_LOGINURI:
161 self->mLoginUri.assign(s, len);
162 cleanUpUri(self->mLoginUri);
163 break;
164
165 case XML_HELPERURI:
166 self->mHelperUri.assign(s, len);
167 cleanUpUri(self->mHelperUri);
168 break;
169
170 case XML_SEARCH:
171 //self->mSearchUrl.assign(s, len);
172 //cleanUpQueryUrl(mSearchUrl);
173 break;
174
175 case XML_GRIDNAME: self->mGridName.assign(s, len); break;
176 case XML_LOGINPAGE: self->mLoginPage.assign(s, len); break;
177 case XML_WEBSITE: self->mWebSite.assign(s, len); break;
178 case XML_SUPPORT: self->mSupportUrl.assign(s, len); break;
179 case XML_REGISTER: self->mRegisterUrl.assign(s, len); break;
180 case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break;
181
182 case XML_VOID: break;
183 }
184}
185
186
187bool HippoGridInfo::retrieveGridInfo()
188{
189 if (mLoginUri == "") return false;
190
191 std::string reply;
192 int result = HippoRestRequest::getBlocking(mLoginUri + "get_grid_info", &reply);
193 if (result != 200) return false;
194
195 llinfos << "Received: " << reply << llendl;
196
197 bool success = true;
198 XML_Parser parser = XML_ParserCreate(0);
199 XML_SetUserData(parser, this);
200 XML_SetElementHandler(parser, onXmlElementStart, onXmlElementEnd);
201 XML_SetCharacterDataHandler(parser, onXmlCharacterData);
202 mXmlState = XML_VOID;
203 if (!XML_Parse(parser, reply.data(), reply.size(), TRUE)) {
204 llwarns << "XML Parse Error: " << XML_ErrorString(XML_GetErrorCode(parser)) << llendl;
205 success = false;
206 }
207 XML_ParserFree(parser);
208
209 return success;
210}
211
212
213std::string HippoGridInfo::getUploadFee() const
214{
215 std::string fee;
216 formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), true);
217 return fee;
218}
219
220std::string HippoGridInfo::getGroupCreationFee() const
221{
222 std::string fee;
223 formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceGroupCreate(), false);
224 return fee;
225}
226
227std::string HippoGridInfo::getDirectoryFee() const
228{
229 std::string fee;
230 formatFee(fee, mDirectoryFee, true);
231 if (fee != "free") fee += "/week";
232 return fee;
233}
234
235void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const
236{
237 if (showFree && (cost == 0)) {
238 fee = "free";
239 } else {
240 fee = llformat("%s%d", getCurrencySymbol().c_str(), cost);
241 }
242}
243
244
245// ********************************************************************
246// Static Helpers
247
248// static
249const char *HippoGridInfo::getPlatformString(Platform platform)
250{
251 static const char *platformStrings[PLATFORM_LAST] = {
252 "Other", "OpenSim", "SecondLife"
253 };
254
255 if ((platform < PLATFORM_OTHER) || (platform >= PLATFORM_LAST))
256 platform = PLATFORM_OTHER;
257 return platformStrings[platform];
258}
259
260
261// static
262void HippoGridInfo::cleanUpGridNick(std::string &gridnick)
263{
264 std::string tmp;
265 int size = gridnick.size();
266 for (int i=0; i<size; i++) {
267 char c = gridnick[i];
268 if ((c == '_') || isalnum(c)) {
269 tmp += tolower(c);
270 } else if (isspace(c)) {
271 tmp += "_";
272 }
273 }
274 gridnick = tmp;
275}
276
277// static
278void HippoGridInfo::cleanUpUri(std::string &uri)
279{
280 std::string::size_type n = uri.rfind('/');
281 if ((n == std::string::npos) || (n < 10))
282 uri += '/';
283}
284
285
286void HippoGridInfo::initFallback()
287{
288 FALLBACK_GRIDINFO.mGridNick = "secondlife";
289 FALLBACK_GRIDINFO.setPlatform(PLATFORM_SECONDLIFE);
290 FALLBACK_GRIDINFO.setGridName("Second Life");
291 FALLBACK_GRIDINFO.setLoginUri("https://login.agni.lindenlab.com/cgi-bin/login.cgi");
292 FALLBACK_GRIDINFO.setLoginPage("http://secondlife.com/app/login/");
293 FALLBACK_GRIDINFO.setHelperUri("https://secondlife.com/helpers/");
294 FALLBACK_GRIDINFO.setWebSite("http://secondlife.com/");
295}
296
297
298
299// ********************************************************************
300// ********************************************************************
301// HippoGridManager
302// ********************************************************************
303// ********************************************************************
304
305
306// ********************************************************************
307// Initialize
308
309HippoGridManager::HippoGridManager() :
310 mConnectedGrid(0),
311 mDefaultGridsVersion(0)
312{
313}
314
315HippoGridManager::~HippoGridManager()
316{
317 cleanup();
318}
319
320
321void HippoGridManager::cleanup()
322{
323 std::map<std::string, HippoGridInfo*>::iterator it, end = mGridInfo.end();
324 for (it=mGridInfo.begin(); it != end; ++it) {
325 delete it->second;
326 }
327 mGridInfo.clear();
328}
329
330
331void HippoGridManager::init()
332{
333 HippoGridInfo::initFallback();
334 loadFromFile();
335
336 // !!!### gSavedSettings.getControl("CmdLineLoginURI");
337 // !!!### gSavedSettings.getString("CmdLineLoginPage");
338 // !!!### gSavedSettings.getString("CmdLineHelperURI");
339 // !!!### LLString::compareInsensitive(gGridInfo[grid_index].mLabel, grid_name.c_str()))
340}
341
342
343void HippoGridManager::discardAndReload()
344{
345 cleanup();
346 loadFromFile();
347}
348
349
350// ********************************************************************
351// Public Access
352
353HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const
354{
355 std::map<std::string, HippoGridInfo*>::const_iterator it;
356 it = mGridInfo.find(grid);
357 if (it != mGridInfo.end()) {
358 return it->second;
359 } else {
360 return 0;
361 }
362}
363
364
365HippoGridInfo *HippoGridManager::getCurrentGrid() const
366{
367 HippoGridInfo *grid = getGrid(mCurrentGrid);
368 if (grid) {
369 return grid;
370 } else {
371 return &HippoGridInfo::FALLBACK_GRIDINFO;
372 }
373}
374
375
376void HippoGridManager::addGrid(HippoGridInfo *grid)
377{
378 if (!grid) return;
379 const std::string &nick = grid->getGridNick();
380 if (nick == "") {
381 llwarns << "Ignoring to try adding grid with empty nick." << llendl;
382 delete grid;
383 return;
384 }
385 if (mGridInfo.find(nick) != mGridInfo.end()) {
386 llwarns << "Ignoring to try adding existing grid " << nick << '.' << llendl;
387 delete grid;
388 return;
389 }
390 mGridInfo[nick] = grid;
391}
392
393
394void HippoGridManager::deleteGrid(const std::string &grid)
395{
396 GridIterator it = mGridInfo.find(grid);
397 if (it == mGridInfo.end()) {
398 llwarns << "Trying to delete non-existing grid " << grid << '.' << llendl;
399 return;
400 }
401 mGridInfo.erase(it);
402 llinfos << "Number of grids now: " << mGridInfo.size() << llendl;
403 if (mGridInfo.empty()) llinfos << "Grid info map is empty." << llendl;
404 if (grid == mDefaultGrid)
405 setDefaultGrid(""); // sets first grid, if map not empty
406 if (grid == mCurrentGrid)
407 mCurrentGrid = mDefaultGrid;
408}
409
410
411void HippoGridManager::setDefaultGrid(const std::string &grid)
412{
413 GridIterator it = mGridInfo.find(grid);
414 if (it != mGridInfo.end()) {
415 mDefaultGrid = grid;
416 } else if (mGridInfo.find("secondlife") != mGridInfo.end()) {
417 mDefaultGrid = "secondlife";
418 } else if (!mGridInfo.empty()) {
419 mDefaultGrid = mGridInfo.begin()->first;
420 } else {
421 mDefaultGrid = "";
422 }
423}
424
425
426void HippoGridManager::setCurrentGrid(const std::string &grid)
427{
428 GridIterator it = mGridInfo.find(grid);
429 if (it != mGridInfo.end()) {
430 mCurrentGrid = grid;
431 } else if (!mGridInfo.empty()) {
432 llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl;
433 mCurrentGrid = mDefaultGrid;
434 }
435}
436
437
438// ********************************************************************
439// Persistent Store
440
441void HippoGridManager::loadFromFile()
442{
443 mDefaultGridsVersion = 0;
444 // load user grid info
445 parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml"), false);
446 // merge default grid info, if newer. Force load, if list of grids is empty.
447 parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty());
448 // merge grid info from web site, if newer. Force load, if list of grids is empty.
449 if (gSavedSettings.getBOOL("CheckForGridUpdates"))
450 parseUrl("http://opensim-viewer.sourceforge.net/db/grids.php", !mGridInfo.empty());
451
452 setDefaultGrid(gSavedSettings.getString("DefaultGrid"));
453 setCurrentGrid(gSavedSettings.getString("CmdLineGridChoice"));
454}
455
456
457void HippoGridManager::parseUrl(const char *url, bool mergeIfNewer)
458{
459 llinfos << "Loading grid info from '" << url << "'." << llendl;
460
461 // query update server
462 std::string escaped_url = LLWeb::escapeURL(url);
463 LLSD response = LLHTTPClient::blockingGet(url);
464
465 // check response, return on error
466 S32 status = response["status"].asInteger();
467 if ((status != 200) || !response["body"].isArray()) {
468 llinfos << "GridInfo Update failed (" << status << "): "
469 << (response["body"].isString()? response["body"].asString(): "<unknown error>")
470 << llendl;
471 return;
472 }
473
474 LLSD gridInfo = response["body"];
475 parseData(gridInfo, mergeIfNewer);
476}
477
478void HippoGridManager::parseFile(const std::string &fileName, bool mergeIfNewer)
479{
480 llifstream infile;
481 infile.open(fileName.c_str());
482 if(!infile.is_open()) {
483 llwarns << "Cannot find grid info file " << fileName << " to load." << llendl;
484 return;
485 }
486
487 LLSD gridInfo;
488 if (LLSDSerialize::fromXML(gridInfo, infile) <= 0) {
489 llwarns << "Unable to parse grid info file " << fileName << '.' << llendl;
490 return;
491 }
492
493 llinfos << "Loading grid info file " << fileName << '.' << llendl;
494 parseData(gridInfo, mergeIfNewer);
495}
496
497
498void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
499{
500 if (mergeIfNewer) {
501 LLSD::array_const_iterator it, end = gridInfo.endArray();
502 for (it = gridInfo.beginArray(); it != end; ++it) {
503 LLSD gridMap = *it;
504 if (gridMap.has("default_grids_version")) {
505 int version = gridMap["default_grids_version"];
506 if (version <= mDefaultGridsVersion) return;
507 else break;
508 }
509 }
510 if (it == end) {
511 llwarns << "Grid data has no version number." << llendl;
512 return;
513 }
514 }
515
516 llinfos << "Loading grid data." << llendl;
517
518 LLSD::array_const_iterator it, end = gridInfo.endArray();
519 for (it = gridInfo.beginArray(); it != end; ++it) {
520 LLSD gridMap = *it;
521 if (gridMap.has("default_grids_version")) {
522 mDefaultGridsVersion = gridMap["default_grids_version"];
523 } else if (gridMap.has("gridnick") && gridMap.has("loginuri")) {
524 std::string gridnick = gridMap["gridnick"];
525 HippoGridInfo *grid;
526 GridIterator it = mGridInfo.find(gridnick);
527 bool newGrid = (it == mGridInfo.end());
528 if (newGrid) {
529 // create new grid info
530 grid = new HippoGridInfo(gridnick);
531 } else {
532 // update existing grid info
533 grid = it->second;
534 }
535 grid->setLoginUri(gridMap["loginuri"]);
536 if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
537 if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]);
538 if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]);
539 if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
540 if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
541 if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]);
542 if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]);
543 if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
544 //if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
545 if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
546 if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
547 if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
548 if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
549 if (newGrid) addGrid(grid);
550 }
551 }
552}
553
554
555void HippoGridManager::saveFile()
556{
557 // save default grid to client settings
558 gSavedSettings.setString("DefaultGrid", mDefaultGrid);
559
560 // build LLSD
561 LLSD gridInfo;
562 gridInfo[0]["default_grids_version"] = mDefaultGridsVersion;
563
564 // add grids
565 S32 i = 1;
566 GridIterator it, end = mGridInfo.end();
567 for (it = mGridInfo.begin(); it != end; ++it, i++) {
568 HippoGridInfo *grid = it->second;
569 gridInfo[i]["gridnick"] = grid->getGridNick();
570 gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform());
571 gridInfo[i]["gridname"] = grid->getGridName();
572 gridInfo[i]["loginuri"] = grid->getLoginUri();
573 gridInfo[i]["loginpage"] = grid->getLoginPage();
574 gridInfo[i]["helperuri"] = grid->getHelperUri();
575 gridInfo[i]["website"] = grid->getWebSite();
576 gridInfo[i]["support"] = grid->getSupportUrl();
577 gridInfo[i]["register"] = grid->getRegisterUrl();
578 gridInfo[i]["firstname"] = grid->getFirstName();
579 gridInfo[i]["lastname"] = grid->getLastName();
580 gridInfo[i]["avatarpassword"] = grid->getAvatarPassword();
581
582 //gridInfo[i]["search"] = grid->getSearchUrl();
583 gridInfo[i]["render_compat"] = grid->isRenderCompat();
584 }
585
586 // write client grid info file
587 std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml");
588 llofstream file;
589 file.open(fileName.c_str());
590 if (file.is_open()) {
591 LLSDSerialize::toPrettyXML(gridInfo, file);
592 file.close();
593 llinfos << "Saved grids to " << fileName << llendl;
594 } else {
595 llerrs << "Unable to open grid info file: " << fileName << llendl;
596 }
597}
diff --git a/linden/indra/newview/hippoGridManager.h b/linden/indra/newview/hippoGridManager.h
new file mode 100644
index 0000000..933a944
--- /dev/null
+++ b/linden/indra/newview/hippoGridManager.h
@@ -0,0 +1,171 @@
1#ifndef __HIPPO_GRID_MANAGER_H__
2#define __HIPPO_GRID_MANAGER_H__
3
4
5#include <map>
6#include <string>
7
8#ifndef XML_STATIC
9#define XML_STATIC
10#endif
11#include <expat/expat.h>
12
13
14class LLSD;
15
16
17class HippoGridInfo
18{
19public:
20 enum Platform {
21 PLATFORM_OTHER = 0,
22 PLATFORM_OPENSIM,
23 PLATFORM_SECONDLIFE,
24 PLATFORM_LAST
25 };
26 enum SearchType {
27 SEARCH_ALL_EMPTY,
28 SEARCH_ALL_QUERY,
29 SEARCH_ALL_TEMPLATE
30 };
31
32 explicit HippoGridInfo(const std::string &gridNick);
33
34 Platform getPlatform() const { return mPlatform; }
35 const std::string &getGridNick() const { return mGridNick; }
36 const std::string &getGridName() const { return mGridName; }
37 const std::string &getLoginUri() const { return mLoginUri; }
38 const std::string &getLoginPage() const { return mLoginPage; }
39 const std::string &getHelperUri() const { return mHelperUri; }
40 const std::string &getWebSite() const { return mWebSite; }
41 const std::string &getSupportUrl() const { return mSupportUrl; }
42 const std::string &getRegisterUrl() const { return mRegisterUrl; }
43 const std::string &getPasswordUrl() const { return mPasswordUrl; }
44 const std::string &getSearchUrl() const { return mSearchUrl; }
45 const std::string &getFirstName() const { return mFirstName; }
46 const std::string &getLastName() const { return mLastName; }
47 const std::string &getAvatarPassword() const { return mAvatarPassword; }
48 std::string getSearchUrl(SearchType ty) const;
49 bool isRenderCompat() const { return mRenderCompat; }
50
51 const std::string &getCurrencySymbol() const { return mCurrencySymbol; }
52 const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; }
53 std::string getUploadFee() const;
54 std::string getGroupCreationFee() const;
55 std::string getDirectoryFee() const;
56
57 bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); }
58 bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); }
59
60 void setPlatform (const std::string &platform);
61 void setPlatform (Platform platform);
62 void setGridName (const std::string &gridName) { mGridName = gridName; }
63 void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); }
64 void setLoginPage(const std::string &loginPage) { mLoginPage = loginPage; }
65 void setHelperUri(const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); }
66 void setWebSite (const std::string &website) { mWebSite = website; }
67 void setSupportUrl(const std::string &url) { mSupportUrl = url; }
68 void setRegisterUrl(const std::string &url) { mRegisterUrl = url; }
69 void setPasswordUrl(const std::string &url) { mPasswordUrl = url; }
70 void setSearchUrl(const std::string &url) { mSearchUrl = url; }
71 void setRenderCompat(bool compat) { mRenderCompat = compat; }
72 void setFirstName(const std::string &firstName) { mFirstName = firstName; } //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
73 void setLastName(const std::string &lastName) { mLastName = lastName; }
74 void setAvatarPassword(const std::string &avatarPassword) { mAvatarPassword = avatarPassword; }
75
76 void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); }
77 void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); }
78 void setDirectoryFee(int fee) { mDirectoryFee = fee; }
79
80 bool retrieveGridInfo();
81
82 static const char *getPlatformString(Platform platform);
83 static void cleanUpGridNick(std::string &gridnick);
84
85 static HippoGridInfo FALLBACK_GRIDINFO;
86 static void initFallback();
87
88private:
89 Platform mPlatform;
90 std::string mGridNick;
91 std::string mGridName;
92 std::string mLoginUri;
93 std::string mLoginPage;
94 std::string mHelperUri;
95 std::string mWebSite;
96 std::string mSupportUrl;
97 std::string mRegisterUrl;
98 std::string mPasswordUrl;
99 std::string mSearchUrl;
100 std::string mFirstName;
101 std::string mLastName;
102 std::string mAvatarPassword;
103 bool mRenderCompat;
104
105 std::string mCurrencySymbol;
106 std::string mRealCurrencySymbol;
107 int mDirectoryFee;
108
109 // for parsing grid info XML
110 enum XmlState {
111 XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME,
112 XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
113 XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH
114 };
115 XmlState mXmlState;
116
117 static void cleanUpUri(std::string &uri);
118 void formatFee(std::string &fee, int cost, bool showFree) const;
119
120 static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts);
121 static void onXmlElementEnd(void *userData, const XML_Char *name);
122 static void onXmlCharacterData(void *userData, const XML_Char *s, int len);
123};
124
125
126class HippoGridManager
127{
128public:
129 HippoGridManager();
130 ~HippoGridManager();
131
132 void init();
133 void saveFile();
134 void discardAndReload();
135
136 HippoGridInfo *getGrid(const std::string &grid) const;
137 HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); }
138 HippoGridInfo *getCurrentGrid() const;
139 const std::string &getDefaultGridNick() const { return mDefaultGrid; }
140 const std::string &getCurrentGridNick() const { return mCurrentGrid; }
141
142 void setDefaultGrid(const std::string &grid);
143 void setCurrentGrid(const std::string &grid);
144 void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); }
145
146 void addGrid(HippoGridInfo *grid);
147 void deleteGrid(const std::string &grid);
148
149 typedef std::map<std::string, HippoGridInfo*>::iterator GridIterator;
150 GridIterator beginGrid() { return mGridInfo.begin(); }
151 GridIterator endGrid() { return mGridInfo.end(); }
152
153private:
154 std::map<std::string, HippoGridInfo*> mGridInfo;
155 std::string mDefaultGrid;
156 std::string mCurrentGrid;
157 HippoGridInfo *mConnectedGrid;
158 int mDefaultGridsVersion;
159
160 void cleanup();
161 void loadFromFile();
162 void parseFile(const std::string &fileName, bool mergeIfNewer);
163 void parseUrl(const char *url, bool mergeIfNewer);
164 void parseData(LLSD &gridInfo, bool mergeIfNewer);
165};
166
167
168extern HippoGridManager *gHippoGridManager;
169
170
171#endif
diff --git a/linden/indra/newview/hippoLimits.cpp b/linden/indra/newview/hippoLimits.cpp
new file mode 100644
index 0000000..63a5899
--- /dev/null
+++ b/linden/indra/newview/hippoLimits.cpp
@@ -0,0 +1,54 @@
1
2
3#include "hippoLimits.h"
4
5#include "hippoGridManager.h"
6
7#include <llerror.h>
8
9
10HippoLimits *gHippoLimits = 0;
11
12
13HippoLimits::HippoLimits()
14{
15 setLimits();
16}
17
18
19void HippoLimits::setLimits()
20{
21 if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) {
22 setSecondLifeLimits();
23 } else {
24 setOpenSimLimits();
25 }
26}
27
28
29void HippoLimits::setOpenSimLimits()
30{
31 mMaxAgentGroups = 100;
32 mMaxPrimScale = 256.0f;
33 mMaxHeight = 10000.0f;
34 if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) {
35 llinfos << "Using rendering compatible OpenSim limits." << llendl;
36 mMinHoleSize = 0.05f;
37 mMaxHollow = 0.95f;
38 } else {
39 llinfos << "Using Hippo OpenSim limits." << llendl;
40 mMinHoleSize = 0.01f;
41 mMaxHollow = 0.99f;
42 }
43}
44
45void HippoLimits::setSecondLifeLimits()
46{
47 llinfos << "Using Second Life limits." << llendl;
48 mMaxAgentGroups = 25;
49 mMaxPrimScale = 10.0f;
50 mMaxHeight = 4096.0f;
51 mMinHoleSize = 0.05f;
52 mMaxHollow = 0.95f;
53}
54
diff --git a/linden/indra/newview/hippoLimits.h b/linden/indra/newview/hippoLimits.h
new file mode 100644
index 0000000..333a979
--- /dev/null
+++ b/linden/indra/newview/hippoLimits.h
@@ -0,0 +1,33 @@
1#ifndef __HIPPO_LIMITS_H__
2#define __HIPPO_LIMITS_H__
3
4
5class HippoLimits
6{
7public:
8 HippoLimits();
9
10 int getMaxAgentGroups() const { return mMaxAgentGroups; }
11 float getMaxHeight() const { return mMaxHeight; }
12 float getMinHoleSize() const { return mMinHoleSize; }
13 float getMaxHollow() const { return mMaxHollow; }
14 float getMaxPrimScale() const { return mMaxPrimScale; }
15
16 void setLimits();
17
18private:
19 int mMaxAgentGroups;
20 float mMaxHeight;
21 float mMinHoleSize;
22 float mMaxHollow;
23 float mMaxPrimScale;
24
25 void setOpenSimLimits();
26 void setSecondLifeLimits();
27};
28
29
30extern HippoLimits *gHippoLimits;
31
32
33#endif
diff --git a/linden/indra/newview/hippoRestRequest.cpp b/linden/indra/newview/hippoRestRequest.cpp
new file mode 100644
index 0000000..ab8a557
--- /dev/null
+++ b/linden/indra/newview/hippoRestRequest.cpp
@@ -0,0 +1,54 @@
1
2
3#include "hippoRestRequest.h"
4
5#ifndef CURL_STATICLIB
6#define CURL_STATICLIB 1
7#endif
8#include <curl/curl.h>
9
10#include <stdtypes.h>
11#include <llerror.h>
12
13
14static size_t curlWrite(void *ptr, size_t size, size_t nmemb, void *userData)
15{
16 std::string *result = (std::string*)userData;
17 size_t bytes = (size * nmemb);
18 result->append((char*)ptr, bytes);
19 return nmemb;
20}
21
22
23//static
24int HippoRestRequest::getBlocking(const std::string &url, std::string *result)
25{
26 llinfos << "Requesting: " << url << llendl;
27
28 char curlErrorBuffer[CURL_ERROR_SIZE];
29 CURL* curlp = curl_easy_init();
30
31 curl_easy_setopt(curlp, CURLOPT_NOSIGNAL, 1); // don't use SIGALRM for timeouts
32 curl_easy_setopt(curlp, CURLOPT_TIMEOUT, 5); // seconds
33
34 curl_easy_setopt(curlp, CURLOPT_WRITEFUNCTION, curlWrite);
35 curl_easy_setopt(curlp, CURLOPT_WRITEDATA, result);
36 curl_easy_setopt(curlp, CURLOPT_URL, url.c_str());
37 curl_easy_setopt(curlp, CURLOPT_ERRORBUFFER, curlErrorBuffer);
38 curl_easy_setopt(curlp, CURLOPT_FAILONERROR, 1);
39
40 *result = "";
41 S32 curlSuccess = curl_easy_perform(curlp);
42 S32 httpStatus = 499;
43 curl_easy_getinfo(curlp, CURLINFO_RESPONSE_CODE, &httpStatus);
44
45 if (curlSuccess != 0) {
46 llwarns << "CURL ERROR (HTTP Status " << httpStatus << "): " << curlErrorBuffer << llendl;
47 } else if (httpStatus != 200) {
48 llwarns << "HTTP Error " << httpStatus << ", but no Curl error." << llendl;
49 }
50
51 curl_easy_cleanup(curlp);
52 return httpStatus;
53}
54
diff --git a/linden/indra/newview/hippoRestRequest.h b/linden/indra/newview/hippoRestRequest.h
new file mode 100644
index 0000000..e43233c
--- /dev/null
+++ b/linden/indra/newview/hippoRestRequest.h
@@ -0,0 +1,16 @@
1#ifndef __HIPPO_REST_REQTUEST_H__
2#define __HIPPO_REST_REQTUEST_H__
3
4
5#include <string>
6
7
8class HippoRestRequest
9{
10 public:
11 static int getBlocking(const std::string &url, std::string *result);
12
13};
14
15
16#endif
diff --git a/linden/indra/newview/hippoUpdate.cpp b/linden/indra/newview/hippoUpdate.cpp
new file mode 100644
index 0000000..7a33487
--- /dev/null
+++ b/linden/indra/newview/hippoUpdate.cpp
@@ -0,0 +1,92 @@
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
18std::string gHippoChannel;
19
20
21// static
22bool HippoUpdate::checkUpdate()
23{
24 llinfos << "Hippo Update Check..." << llendl;
25
26 // get channel name
27 gHippoChannel = gSavedSettings.getString("ChannelName");
28
29 // get mac address
30 char macAddress[18];
31 sprintf(macAddress, "%02x:%02x:%02x:%02x:%02x:%02x",
32 gMACAddress[0], gMACAddress[1], gMACAddress[2], gMACAddress[3], gMACAddress[4], gMACAddress[5]);
33
34 // build URL for update check
35 char url[1000];
36 snprintf(url, 1000,
37/* "http://update.mjm.game-host.org/os/viewer.php?"
38 "product=%s&channel=%s&"
39 "version_major=%d&version_minor=%d&version_patch=%d&version_base=%s&"
40 "platform=%s&mac=%s",
41 LL_PRODUCT, LL_CHANNEL_CSTR,
42 LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BASE,
43 LL_PLATFORM*/"", macAddress);
44
45 // query update server
46 std::string escaped_url = LLWeb::escapeURL(url);
47 LLSD response = LLHTTPClient::blockingGet(escaped_url.c_str());
48
49 // check response, return on error
50 S32 status = response["status"].asInteger();
51 if ((status != 200) || !response["body"].isMap()) {
52 llinfos << "Hippo Update failed (" << status << "): "
53 << (response["body"].isString()? response["body"].asString(): "<unknown error>")
54 << llendl;
55 return true;
56 }
57
58 // get data from response
59 LLSD data = response["body"];
60 std::string webpage = (data.has("webpage") && data["webpage"].isString())? data["webpage"].asString(): "";
61 std::string message = (data.has("message") && data["message"].isString())? data["message"].asString(): "";
62 std::string yourVersion = (data.has("yourVersion") && data["yourVersion"].isString())? data["yourVersion"].asString(): "";
63 std::string curVersion = (data.has("curVersion") && data["curVersion"].isString())? data["curVersion"].asString(): "";
64 bool update = (data.has("update") && data["update"].isBoolean())? data["update"].asBoolean(): false;
65 bool mandatory = (data.has("mandatory") && data["mandatory"].isBoolean())? data["mandatory"].asBoolean(): false;
66
67 // log and return, if no update available
68 llinfos << "Your version is " << yourVersion << ", current version is " << curVersion << '.' << llendl;
69 if (!update) return true;
70 llinfos << "Update is " << (mandatory? "mandatory.": "optional.") << llendl;
71
72 // show update dialog
73 char msg[1000];
74 snprintf(msg, 1000,
75 "There is a new viewer version available.\n"
76 "\n"
77 "Your version: %s\n"
78 "Current version: %s\n"
79 "%s\n"
80 "Do you want to visit the web site?",
81 yourVersion.c_str(), curVersion.c_str(),
82 mandatory? "\nThis is a mandatory update.\n": "");
83 S32 button = OSMessageBox(msg, "Hippo OpenSim Viewer Update", OSMB_YESNO);
84 if (button == OSBTN_YES) {
85 llinfos << "Taking user to " << webpage << llendl;
86 LLWeb::loadURLExternal(webpage);
87 // exit the viewer
88 return false;
89 }
90
91 return !mandatory;
92}
diff --git a/linden/indra/newview/hippoUpdate.h b/linden/indra/newview/hippoUpdate.h
new file mode 100644
index 0000000..632b2ef
--- /dev/null
+++ b/linden/indra/newview/hippoUpdate.h
@@ -0,0 +1,12 @@
1#ifndef __HIPPO_UPDATE_H__
2#define __HIPPO_UPDATE_H__
3
4
5class 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 4d53c88..60faaf2 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -125,6 +125,7 @@
125#include "llvectorperfoptions.h" 125#include "llvectorperfoptions.h"
126#include "llurlsimstring.h" 126#include "llurlsimstring.h"
127#include "llwatchdog.h" 127#include "llwatchdog.h"
128#include "llcallingcard.h"
128 129
129// Included so that constants/settings might be initialized 130// Included so that constants/settings might be initialized
130// in save_settings_to_globals() 131// in save_settings_to_globals()
@@ -164,6 +165,10 @@
164 165
165#include "llcommandlineparser.h" 166#include "llcommandlineparser.h"
166 167
168#include "hippoGridManager.h"
169#include "hippoLimits.h"
170#include "hippoUpdate.h"
171
167// annoying detail to determine whether font prefs are over-ridden 172// annoying detail to determine whether font prefs are over-ridden
168#if LL_LINUX 173#if LL_LINUX
169# define LL_DYNAMIC_FONT_DISCOVERY 1 174# define LL_DYNAMIC_FONT_DISCOVERY 1
@@ -192,22 +197,35 @@
192 197
193//---------------------------------------------------------------------------- 198//----------------------------------------------------------------------------
194// viewer.cpp - these are only used in viewer, should be easily moved. 199// viewer.cpp - these are only used in viewer, should be easily moved.
200extern void disable_win_error_reporting();
195 201
196#if LL_DARWIN 202#if LL_DARWIN
203#include <Carbon/Carbon.h>
197extern void init_apple_menu(const char* product); 204extern void init_apple_menu(const char* product);
205extern OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn);
206extern OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn);
207extern OSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata);
208#include <boost/tokenizer.hpp>
198#endif // LL_DARWIN 209#endif // LL_DARWIN
199 210
211
200extern BOOL gRandomizeFramerate; 212extern BOOL gRandomizeFramerate;
201extern BOOL gPeriodicSlowFrame; 213extern BOOL gPeriodicSlowFrame;
202extern BOOL gDebugGL; 214extern BOOL gDebugGL;
203 215
204//////////////////////////////////////////////////////////// 216////////////////////////////////////////////////////////////
205// All from the last globals push... 217// All from the last globals push...
218
219
206const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard 220const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard
207 221
208F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() 222F32 gSimLastTime; // Used in LLAppViewer::init and send_stats()
209F32 gSimFrames; 223F32 gSimFrames;
210 224
225std::string gDisabledMessage; // Set in LLAppViewer::initConfiguration used in idle_startup
226
227BOOL gHideLinks = FALSE; // Set in LLAppViewer::initConfiguration, used externally
228
211BOOL gAllowIdleAFK = TRUE; 229BOOL gAllowIdleAFK = TRUE;
212BOOL gAllowTapTapHoldRun = TRUE; 230BOOL gAllowTapTapHoldRun = TRUE;
213BOOL gShowObjectUpdates = FALSE; 231BOOL gShowObjectUpdates = FALSE;
@@ -233,7 +251,7 @@ F32 gFPSClamped = 10.f; // Pretend we start at target rate.
233F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets 251F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets
234U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds 252U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds
235U32 gFrameStalls = 0; 253U32 gFrameStalls = 0;
236const F64 FRAME_STALL_THRESHOLD = 1.0; 254const F64 FRAME_STALL_THRESHOLD = 5.0;
237 255
238LLTimer gRenderStartTime; 256LLTimer gRenderStartTime;
239LLFrameTimer gForegroundTime; 257LLFrameTimer gForegroundTime;
@@ -302,7 +320,8 @@ std::string gLoginPage;
302std::vector<std::string> gLoginURIs; 320std::vector<std::string> gLoginURIs;
303static std::string gHelperURI; 321static std::string gHelperURI;
304 322
305LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; 323//FIXME
324//LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ;
306 325
307void idle_afk_check() 326void idle_afk_check()
308{ 327{
@@ -453,7 +472,7 @@ static void settings_modify()
453 gSavedSettings.setBOOL("VectorizeSkin", FALSE); 472 gSavedSettings.setBOOL("VectorizeSkin", FALSE);
454#endif 473#endif
455} 474}
456 475/*
457void LLAppViewer::initGridChoice() 476void LLAppViewer::initGridChoice()
458{ 477{
459 // Load up the initial grid choice from: 478 // Load up the initial grid choice from:
@@ -470,7 +489,7 @@ void LLAppViewer::initGridChoice()
470 if(grid_choice.empty()) 489 if(grid_choice.empty())
471 { 490 {
472 S32 server = gSavedSettings.getS32("ServerChoice"); 491 S32 server = gSavedSettings.getS32("ServerChoice");
473 server = llclamp(server, 0, (S32)GRID_INFO_COUNT - 1); 492 //server = llclamp(server, 0, (S32)GRID_INFO_COUNT - 1);
474 if(server == GRID_INFO_OTHER) 493 if(server == GRID_INFO_OTHER)
475 { 494 {
476 std::string custom_server = gSavedSettings.getString("CustomServer"); 495 std::string custom_server = gSavedSettings.getString("CustomServer");
@@ -478,11 +497,12 @@ void LLAppViewer::initGridChoice()
478 } 497 }
479 else if(server != (S32)GRID_INFO_NONE) 498 else if(server != (S32)GRID_INFO_NONE)
480 { 499 {
481 LLViewerLogin::getInstance()->setGridChoice((EGridInfo)server); 500 llwarns << "setgridchoice = " << server << llendl;
501 LLViewerLogin::getInstance()->setGridChoice(server);
482 } 502 }
483 } 503 }
484} 504}
485 505*/
486//virtual 506//virtual
487bool LLAppViewer::initSLURLHandler() 507bool LLAppViewer::initSLURLHandler()
488{ 508{
@@ -521,6 +541,7 @@ LLAppViewer::LLAppViewer() :
521 mSecondInstance(false), 541 mSecondInstance(false),
522 mSavedFinalSnapshot(false), 542 mSavedFinalSnapshot(false),
523 mQuitRequested(false), 543 mQuitRequested(false),
544 mLogoutRequested(false),
524 mLogoutRequestSent(false), 545 mLogoutRequestSent(false),
525 mYieldTime(-1), 546 mYieldTime(-1),
526 mMainloopTimeout(NULL), 547 mMainloopTimeout(NULL),
@@ -662,7 +683,6 @@ bool LLAppViewer::init()
662 ui_audio_callback, 683 ui_audio_callback,
663 &LLUI::sGLScaleFactor); 684 &LLUI::sGLScaleFactor);
664 LLWeb::initClass(); // do this after LLUI 685 LLWeb::initClass(); // do this after LLUI
665
666 LLTextEditor::setURLCallbacks(&LLWeb::loadURL, 686 LLTextEditor::setURLCallbacks(&LLWeb::loadURL,
667 &LLURLDispatcher::dispatchFromTextEditor, 687 &LLURLDispatcher::dispatchFromTextEditor,
668 &LLURLDispatcher::dispatchFromTextEditor); 688 &LLURLDispatcher::dispatchFromTextEditor);
@@ -683,6 +703,7 @@ bool LLAppViewer::init()
683 // load MIME type -> media impl mappings 703 // load MIME type -> media impl mappings
684 LLMIMETypes::parseMIMETypes( std::string("mime_types.xml") ); 704 LLMIMETypes::parseMIMETypes( std::string("mime_types.xml") );
685 705
706
686 // Copy settings to globals. *TODO: Remove or move to appropriage class initializers 707 // Copy settings to globals. *TODO: Remove or move to appropriage class initializers
687 settings_to_globals(); 708 settings_to_globals();
688 // Setup settings listeners 709 // Setup settings listeners
@@ -1117,12 +1138,21 @@ bool LLAppViewer::cleanup()
1117 // to ensure shutdown order 1138 // to ensure shutdown order
1118 LLMortician::setZealous(TRUE); 1139 LLMortician::setZealous(TRUE);
1119 1140
1141 if (mQuitRequested)
1120 LLVoiceClient::terminate(); 1142 LLVoiceClient::terminate();
1121 1143
1122 disconnectViewer(); 1144 disconnectViewer();
1123 1145
1124 llinfos << "Viewer disconnected" << llendflush; 1146 llinfos << "Viewer disconnected" << llendflush;
1125 1147
1148
1149
1150
1151
1152 //this deletes all your buddies
1153 LLAvatarTracker::instance().reset();
1154
1155 if (mQuitRequested)
1126 display_cleanup(); 1156 display_cleanup();
1127 1157
1128 release_start_screen(); // just in case 1158 release_start_screen(); // just in case
@@ -1137,6 +1167,13 @@ bool LLAppViewer::cleanup()
1137 1167
1138 LLKeyframeDataCache::clear(); 1168 LLKeyframeDataCache::clear();
1139 1169
1170 //clear all the chat off the screen
1171 gConsole->clear();
1172
1173 if (!mQuitRequested) //if we are doing a soft cleanup, bail here
1174 {
1175 return true;
1176 }
1140 // End TransferManager before deleting systems it depends on (Audio, VFS, AssetStorage) 1177 // End TransferManager before deleting systems it depends on (Audio, VFS, AssetStorage)
1141#if 0 // this seems to get us stuck in an infinite loop... 1178#if 0 // this seems to get us stuck in an infinite loop...
1142 gTransferManager.cleanup(); 1179 gTransferManager.cleanup();
@@ -1242,6 +1279,9 @@ bool LLAppViewer::cleanup()
1242 // viewer UI relies on keyboard so keep it aound until viewer UI isa gone 1279 // viewer UI relies on keyboard so keep it aound until viewer UI isa gone
1243 delete gKeyboard; 1280 delete gKeyboard;
1244 gKeyboard = NULL; 1281 gKeyboard = NULL;
1282 // Clean up selection managers after UI is destroyed, as UI
1283 // may be observing them.
1284 LLSelectMgr::cleanupGlobals();
1245 1285
1246 LLViewerObject::cleanupVOClasses(); 1286 LLViewerObject::cleanupVOClasses();
1247 1287
@@ -1251,6 +1291,7 @@ bool LLAppViewer::cleanup()
1251 1291
1252 LLTracker::cleanupInstance(); 1292 LLTracker::cleanupInstance();
1253 1293
1294
1254 // *FIX: This is handled in LLAppViewerWin32::cleanup(). 1295 // *FIX: This is handled in LLAppViewerWin32::cleanup().
1255 // I'm keeping the comment to remember its order in cleanup, 1296 // I'm keeping the comment to remember its order in cleanup,
1256 // in case of unforseen dependency. 1297 // in case of unforseen dependency.
@@ -1319,6 +1360,7 @@ bool LLAppViewer::cleanup()
1319 // save mute list. gMuteList used to also be deleted here too. 1360 // save mute list. gMuteList used to also be deleted here too.
1320 LLMuteList::getInstance()->cache(gAgent.getID()); 1361 LLMuteList::getInstance()->cache(gAgent.getID());
1321 1362
1363
1322 if (mPurgeOnExit) 1364 if (mPurgeOnExit)
1323 { 1365 {
1324 llinfos << "Purging all cache files on exit" << llendflush; 1366 llinfos << "Purging all cache files on exit" << llendflush;
@@ -1819,7 +1861,14 @@ bool LLAppViewer::initConfiguration()
1819 } 1861 }
1820 } 1862 }
1821 1863
1822 initGridChoice(); 1864 //init Hippo grid manager
1865 if (!gHippoGridManager) {
1866 gHippoGridManager = new HippoGridManager();
1867 gHippoGridManager->init();
1868 }
1869
1870
1871 //initGridChoice();
1823 1872
1824 // If we have specified crash on startup, set the global so we'll trigger the crash at the right time 1873 // If we have specified crash on startup, set the global so we'll trigger the crash at the right time
1825 if(clp.hasOption("crashonstartup")) 1874 if(clp.hasOption("crashonstartup"))
@@ -1836,7 +1885,6 @@ bool LLAppViewer::initConfiguration()
1836 // achieve this. For now... 1885 // achieve this. For now...
1837 1886
1838 // *NOTE:Mani The command line parser parses tokens and is 1887 // *NOTE:Mani The command line parser parses tokens and is
1839 // setup to bail after parsing the '--url' option or the
1840 // first option specified without a '--option' flag (or 1888 // first option specified without a '--option' flag (or
1841 // any other option that uses the 'last_option' setting - 1889 // any other option that uses the 'last_option' setting -
1842 // see LLControlGroupCLP::configure()) 1890 // see LLControlGroupCLP::configure())
@@ -1894,6 +1942,22 @@ bool LLAppViewer::initConfiguration()
1894 // llerrs << "Failed to parse skin definition." << llendl; 1942 // llerrs << "Failed to parse skin definition." << llendl;
1895 // } 1943 // }
1896 1944
1945 // LLXmlTreeNode* rootp = skin_def_tree.getRoot();
1946 // LLXmlTreeNode* disabled_message_node = rootp->getChildByName("disabled_message");
1947 // if (disabled_message_node)
1948 // {
1949 // gDisabledMessage = disabled_message_node->getContents();
1950 // }
1951
1952 // static LLStdStringHandle hide_links_string = LLXmlTree::addAttributeString("hide_links");
1953 // rootp->getFastAttributeBOOL(hide_links_string, gHideLinks);
1954
1955 // // Legacy string. This flag really meant we didn't want to expose references to "Second Life".
1956 // // Just set gHideLinks instead.
1957 // static LLStdStringHandle silent_string = LLXmlTree::addAttributeString("silent_update");
1958 // BOOL silent_update;
1959 // rootp->getFastAttributeBOOL(silent_string, silent_update);
1960 // gHideLinks = (gHideLinks || silent_update);
1897 //} 1961 //}
1898 1962
1899#if LL_DARWIN 1963#if LL_DARWIN
@@ -2315,7 +2379,7 @@ void LLAppViewer::handleViewerCrash()
2315 gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName(); 2379 gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName();
2316 gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath(); 2380 gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath();
2317 gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds()); 2381 gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds());
2318 gDebugInfo["StartupState"] = LLStartUp::getStartupStateString(); 2382//FIXME gDebugInfo["StartupState"] = LLStartUp::getStartupStateString();
2319 gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) getCurrentRSS() >> 10; 2383 gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) getCurrentRSS() >> 10;
2320 2384
2321 if(gLogoutInProgress) 2385 if(gLogoutInProgress)
@@ -2542,28 +2606,55 @@ void LLAppViewer::removeMarkerFile(bool leave_logout_marker)
2542 } 2606 }
2543} 2607}
2544 2608
2609
2610//this gets called after we get a packet back from the
2611//server saying we are logged out, or if the packet times
2612//out
2545void LLAppViewer::forceQuit() 2613void LLAppViewer::forceQuit()
2546{ 2614{
2615
2616 LL_INFOS("forceQuit") << "Destroying the entire world" << LL_ENDL;
2617 if (mQuitRequested)
2547 LLApp::setQuitting(); 2618 LLApp::setQuitting();
2619 else
2620 {
2621 if (mLogoutRequested) //we just finished a logout request
2622 {
2623 //LLStartUp::setStartupState( STATE_LOGIN_SHOW );
2624 LLStartUp::resetLogin();
2625 cleanup();
2626 mLogoutRequested=false;
2627 mLogoutRequestSent=false;
2628 }
2629 }
2548} 2630}
2549 2631
2550void LLAppViewer::requestQuit() 2632void LLAppViewer::requestLogout(bool quit_after)
2551{ 2633{
2552 llinfos << "requestQuit" << llendl; 2634
2635 mLogoutRequested=true;
2636 if(quit_after)
2637 mQuitRequested=true;
2638 else
2639 mQuitRequested=false;
2640
2641 llinfos << "requestLogout" << llendl;
2553 2642
2554 LLViewerRegion* region = gAgent.getRegion(); 2643 LLViewerRegion* region = gAgent.getRegion();
2555 2644
2556 if( (LLStartUp::getStartupState() < STATE_STARTED) || !region ) 2645 if( (LLStartUp::getStartupState() >= STATE_STARTED) && region )
2557 { 2646 {
2558 // Quit immediately
2559 forceQuit();
2560 return;
2561 }
2562
2563 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); 2647 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
2564 effectp->setPositionGlobal(gAgent.getPositionGlobal()); 2648 effectp->setPositionGlobal(gAgent.getPositionGlobal());
2565 effectp->setColor(LLColor4U(gAgent.getEffectColor())); 2649 effectp->setColor(LLColor4U(gAgent.getEffectColor()));
2566 LLHUDManager::getInstance()->sendEffects(); 2650 LLHUDManager::getInstance()->sendEffects();
2651 send_stats();
2652 }
2653 else
2654 {
2655 mQuitRequested=true;
2656 LLAppViewer::instance()->forceQuit();
2657 }
2567 2658
2568 // Attempt to close all floaters that might be 2659 // Attempt to close all floaters that might be
2569 // editing things. 2660 // editing things.
@@ -2573,17 +2664,14 @@ void LLAppViewer::requestQuit()
2573 gFloaterView->closeAllChildren(true); 2664 gFloaterView->closeAllChildren(true);
2574 } 2665 }
2575 2666
2576 send_stats();
2577
2578 gLogoutTimer.reset(); 2667 gLogoutTimer.reset();
2579 mQuitRequested = true;
2580} 2668}
2581 2669
2582static void finish_quit(S32 option, void *userdata) 2670static void finish_quit(S32 option, void *userdata)
2583{ 2671{
2584 if (option == 0) 2672 if (option == 0)
2585 { 2673 {
2586 LLAppViewer::instance()->requestQuit(); 2674 LLAppViewer::instance()->requestLogout(true);
2587 } 2675 }
2588} 2676}
2589 2677
@@ -2592,6 +2680,12 @@ void LLAppViewer::userQuit()
2592 gViewerWindow->alertXml("ConfirmQuit", finish_quit, NULL); 2680 gViewerWindow->alertXml("ConfirmQuit", finish_quit, NULL);
2593} 2681}
2594 2682
2683//static
2684void LLAppViewer::userLogout(void *userdata)
2685{
2686 LLAppViewer::instance()->requestLogout(false);
2687}
2688
2595static void finish_early_exit(S32 option, void* userdata) 2689static void finish_early_exit(S32 option, void* userdata)
2596{ 2690{
2597 LLAppViewer::instance()->forceQuit(); 2691 LLAppViewer::instance()->forceQuit();
@@ -2619,6 +2713,7 @@ void LLAppViewer::abortQuit()
2619{ 2713{
2620 llinfos << "abortQuit()" << llendl; 2714 llinfos << "abortQuit()" << llendl;
2621 mQuitRequested = false; 2715 mQuitRequested = false;
2716 mLogoutRequested = false;
2622} 2717}
2623 2718
2624bool LLAppViewer::initCache() 2719bool LLAppViewer::initCache()
@@ -2895,7 +2990,7 @@ void finish_forced_disconnect(S32 /* option */, void* /* userdata */)
2895 2990
2896void LLAppViewer::forceDisconnect(const std::string& mesg) 2991void LLAppViewer::forceDisconnect(const std::string& mesg)
2897{ 2992{
2898 if (gDoDisconnect) 2993 if (gDoDisconnect||mQuitRequested||mLogoutRequested)
2899 { 2994 {
2900 // Already popped up one of these dialogs, don't 2995 // Already popped up one of these dialogs, don't
2901 // do this again. 2996 // do this again.
@@ -3198,9 +3293,12 @@ void LLAppViewer::idle()
3198 // Check for away from keyboard, kick idle agents. 3293 // Check for away from keyboard, kick idle agents.
3199 idle_afk_check(); 3294 idle_afk_check();
3200 3295
3296 if (!gDisconnected) //check again
3297 {
3201 // Update statistics for this frame 3298 // Update statistics for this frame
3202 update_statistics(gFrameCount); 3299 update_statistics(gFrameCount);
3203 } 3300 }
3301 }
3204 3302
3205 //////////////////////////////////////// 3303 ////////////////////////////////////////
3206 // 3304 //
@@ -3401,7 +3499,7 @@ void LLAppViewer::idle()
3401 // Handle shutdown process, for example, 3499 // Handle shutdown process, for example,
3402 // wait for floaters to close, send quit message, 3500 // wait for floaters to close, send quit message,
3403 // forcibly quit if it has taken too long 3501 // forcibly quit if it has taken too long
3404 if (mQuitRequested) 3502 if (mQuitRequested || mLogoutRequested)
3405 { 3503 {
3406 idleShutdown(); 3504 idleShutdown();
3407 } 3505 }
@@ -3501,12 +3599,12 @@ void LLAppViewer::sendLogoutRequest()
3501 if (mLogoutMarkerFile) 3599 if (mLogoutMarkerFile)
3502 { 3600 {
3503 llinfos << "Created logout marker file " << mLogoutMarkerFileName << llendl; 3601 llinfos << "Created logout marker file " << mLogoutMarkerFileName << llendl;
3504 apr_file_close(mLogoutMarkerFile);
3505 } 3602 }
3506 else 3603 else
3507 { 3604 {
3508 llwarns << "Cannot create logout marker file " << mLogoutMarkerFileName << llendl; 3605 llwarns << "Cannot create logout marker file " << mLogoutMarkerFileName << llendl;
3509 } 3606 }
3607 apr_file_close(mLogoutMarkerFile);
3510 } 3608 }
3511} 3609}
3512 3610
@@ -3523,6 +3621,9 @@ static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME;
3523 3621
3524void LLAppViewer::idleNetwork() 3622void LLAppViewer::idleNetwork()
3525{ 3623{
3624 if (gDisconnected)
3625 return;
3626
3526 pingMainloopTimeout("idleNetwork"); 3627 pingMainloopTimeout("idleNetwork");
3527 3628
3528 gObjectList.mNumNewObjects = 0; 3629 gObjectList.mNumNewObjects = 0;
@@ -3609,7 +3710,11 @@ void LLAppViewer::idleNetwork()
3609 3710
3610 gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); 3711 gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects);
3611 3712
3713 if (gDisconnected)
3714 return;
3715
3612 // Retransmit unacknowledged packets. 3716 // Retransmit unacknowledged packets.
3717 if (gXferManager)
3613 gXferManager->retransmitUnackedPackets(); 3718 gXferManager->retransmitUnackedPackets();
3614 gAssetStorage->checkForTimeouts(); 3719 gAssetStorage->checkForTimeouts();
3615 3720
@@ -3619,7 +3724,7 @@ void LLAppViewer::idleNetwork()
3619 // Check that the circuit between the viewer and the agent's current 3724 // Check that the circuit between the viewer and the agent's current
3620 // region is still alive 3725 // region is still alive
3621 LLViewerRegion *agent_region = gAgent.getRegion(); 3726 LLViewerRegion *agent_region = gAgent.getRegion();
3622 if (agent_region) 3727 if ((agent_region)&&(LLStartUp::getStartupState() == STATE_STARTED))
3623 { 3728 {
3624 LLUUID this_region_id = agent_region->getRegionID(); 3729 LLUUID this_region_id = agent_region->getRegionID();
3625 bool this_region_alive = agent_region->isAlive(); 3730 bool this_region_alive = agent_region->isAlive();
@@ -3639,6 +3744,9 @@ void LLAppViewer::disconnectViewer()
3639 { 3744 {
3640 return; 3745 return;
3641 } 3746 }
3747
3748 //set this true now, to prevent things from trying to access the network we are destroying
3749 gDisconnected = TRUE;
3642 // 3750 //
3643 // Cleanup after quitting. 3751 // Cleanup after quitting.
3644 // 3752 //
@@ -3688,8 +3796,8 @@ void LLAppViewer::disconnectViewer()
3688 // Now we just ask the LLWorld singleton to cleanly shut down. 3796 // Now we just ask the LLWorld singleton to cleanly shut down.
3689 LLWorld::getInstance()->destroyClass(); 3797 LLWorld::getInstance()->destroyClass();
3690 3798
3799 if (mQuitRequested)
3691 cleanup_xfer_manager(); 3800 cleanup_xfer_manager();
3692 gDisconnected = TRUE;
3693} 3801}
3694 3802
3695void LLAppViewer::forceErrorLLError() 3803void LLAppViewer::forceErrorLLError()
diff --git a/linden/indra/newview/llappviewer.h b/linden/indra/newview/llappviewer.h
index 3be5de7..8d8e30f 100644
--- a/linden/indra/newview/llappviewer.h
+++ b/linden/indra/newview/llappviewer.h
@@ -61,13 +61,15 @@ public:
61 61
62 // Application control 62 // Application control
63 void forceQuit(); // Puts the viewer into 'shutting down without error' mode. 63 void forceQuit(); // Puts the viewer into 'shutting down without error' mode.
64 void requestQuit(); // Request a quit. A kinder, gentler quit. 64 void requestLogout(bool quit_after); // Request a logout, optionally quitting after
65 void userQuit(); // The users asks to quit. Confirm, then requestQuit() 65 void userQuit(); // The users asks to quit. Confirm, then requestQuit()
66 static void userLogout(void *userdata); //graceful logout without quit
66 void earlyExit(const std::string& msg); // Display an error dialog and forcibly quit. 67 void earlyExit(const std::string& msg); // Display an error dialog and forcibly quit.
67 void forceExit(S32 arg); // exit() immediately (after some cleanup). 68 void forceExit(S32 arg); // exit() immediately (after some cleanup).
68 void abortQuit(); // Called to abort a quit request. 69 void abortQuit(); // Called to abort a quit request.
69 70
70 bool quitRequested() { return mQuitRequested; } 71 bool quitRequested() { return mQuitRequested; }
72 bool logoutRequested() { return mLogoutRequested; }
71 bool logoutRequestSent() { return mLogoutRequestSent; } 73 bool logoutRequestSent() { return mLogoutRequestSent; }
72 74
73 void writeDebugInfo(); 75 void writeDebugInfo();
@@ -157,11 +159,12 @@ protected:
157 159
158 virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this. 160 virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this.
159 161
162
160private: 163private:
161 164
162 bool initThreads(); // Initialize viewer threads, return false on failure. 165 bool initThreads(); // Initialize viewer threads, return false on failure.
163 bool initConfiguration(); // Initialize settings from the command line/config file. 166 bool initConfiguration(); // Initialize settings from the command line/config file.
164 void initGridChoice(); 167 //void initGridChoice();
165 168
166 bool initCache(); // Initialize local client cache. 169 bool initCache(); // Initialize local client cache.
167 void purgeCache(); // Clear the local cache. 170 void purgeCache(); // Clear the local cache.
@@ -211,6 +214,7 @@ private:
211 bool mSavedFinalSnapshot; 214 bool mSavedFinalSnapshot;
212 215
213 bool mQuitRequested; // User wants to quit, may have modified documents open. 216 bool mQuitRequested; // User wants to quit, may have modified documents open.
217 bool mLogoutRequested; // User wants to log out, but not quit
214 bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. 218 bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim.
215 S32 mYieldTime; 219 S32 mYieldTime;
216 LLSD mSettingsFileList; 220 LLSD mSettingsFileList;
@@ -220,15 +224,6 @@ private:
220 // for tracking viewer<->region circuit death 224 // for tracking viewer<->region circuit death
221 bool mAgentRegionLastAlive; 225 bool mAgentRegionLastAlive;
222 LLUUID mAgentRegionLastID; 226 LLUUID mAgentRegionLastID;
223
224public:
225 //some information for updater
226 typedef struct
227 {
228 std::string mUpdateExePath;
229 std::ostringstream mParams;
230 }LLUpdaterInfo ;
231 static LLUpdaterInfo *sUpdaterInfo ;
232}; 227};
233 228
234// consts from viewer.h 229// consts from viewer.h
@@ -239,6 +234,9 @@ const S32 AGENT_UPDATES_PER_SECOND = 10;
239// 234//
240// "// llstartup" indicates that llstartup is the only client for this global. 235// "// llstartup" indicates that llstartup is the only client for this global.
241 236
237
238extern std::string gDisabledMessage; // llstartup
239extern BOOL gHideLinks; // used by llpanellogin, lllfloaterbuycurrency, llstartup
242extern LLSD gDebugInfo; 240extern LLSD gDebugInfo;
243 241
244extern BOOL gAllowIdleAFK; 242extern BOOL gAllowIdleAFK;
diff --git a/linden/indra/newview/llappviewerlinux.h b/linden/indra/newview/llappviewerlinux.h
index b464e48..2f5c13b 100644
--- a/linden/indra/newview/llappviewerlinux.h
+++ b/linden/indra/newview/llappviewerlinux.h
@@ -61,9 +61,10 @@ public:
61 61
62protected: 62protected:
63 virtual bool beingDebugged(); 63 virtual bool beingDebugged();
64 64
65 virtual bool restoreErrorTrap(); 65 virtual bool restoreErrorTrap();
66 virtual void handleCrashReporting(bool reportFreeze); 66 virtual void handleCrashReporting(bool reportFreeze);
67
67 virtual void handleSyncCrashTrace(); 68 virtual void handleSyncCrashTrace();
68 69
69 virtual bool initLogging(); 70 virtual bool initLogging();
diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp
index 1d353fa..ccecef9 100644
--- a/linden/indra/newview/llcallingcard.cpp
+++ b/linden/indra/newview/llcallingcard.cpp
@@ -136,8 +136,20 @@ LLAvatarTracker::~LLAvatarTracker()
136 deleteTrackingData(); 136 deleteTrackingData();
137 std::for_each(mObservers.begin(), mObservers.end(), DeletePointer()); 137 std::for_each(mObservers.begin(), mObservers.end(), DeletePointer());
138 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer()); 138 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer());
139 mObservers.erase(mObservers.begin(), mObservers.end());
140 mBuddyInfo.erase(mBuddyInfo.begin(), mBuddyInfo.end());
139} 141}
140 142
143
144void LLAvatarTracker::reset()
145{
146 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer());
147 mBuddyInfo.erase(mBuddyInfo.begin(), mBuddyInfo.end());
148 mModifyMask |= LLFriendObserver::REMOVE;
149 notifyObservers();
150}
151
152
141void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name) 153void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name)
142{ 154{
143 deleteTrackingData(); 155 deleteTrackingData();
diff --git a/linden/indra/newview/llcallingcard.h b/linden/indra/newview/llcallingcard.h
index cbcb237..21eea2b 100644
--- a/linden/indra/newview/llcallingcard.h
+++ b/linden/indra/newview/llcallingcard.h
@@ -85,7 +85,7 @@ class LLAvatarTracker
85{ 85{
86public: 86public:
87 static LLAvatarTracker& instance() { return sInstance; } 87 static LLAvatarTracker& instance() { return sInstance; }
88 88 void reset();
89 void track(const LLUUID& avatar_id, const std::string& name); 89 void track(const LLUUID& avatar_id, const std::string& name);
90 void untrack(const LLUUID& avatar_id); 90 void untrack(const LLUUID& avatar_id);
91 bool isTrackedAgentValid() { return mTrackedAgentValid; } 91 bool isTrackedAgentValid() { return mTrackedAgentValid; }
diff --git a/linden/indra/newview/lldrawable.h b/linden/indra/newview/lldrawable.h
index 15ad2e1..8f18be0 100644
--- a/linden/indra/newview/lldrawable.h
+++ b/linden/indra/newview/lldrawable.h
@@ -49,6 +49,7 @@
49#include "llviewerobject.h" 49#include "llviewerobject.h"
50#include "llrect.h" 50#include "llrect.h"
51#include "llappviewer.h" // for gFrameTimeSeconds 51#include "llappviewer.h" // for gFrameTimeSeconds
52#include "llimagej2c.h"
52 53
53class LLCamera; 54class LLCamera;
54class LLDrawPool; 55class LLDrawPool;
diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp
index bc61d8a..b235265 100644
--- a/linden/indra/newview/llfloaterworldmap.cpp
+++ b/linden/indra/newview/llfloaterworldmap.cpp
@@ -68,6 +68,12 @@
68#include "llappviewer.h" 68#include "llappviewer.h"
69#include "llmapimagetype.h" 69#include "llmapimagetype.h"
70#include "llweb.h" 70#include "llweb.h"
71#include "floaterlogin.h"
72#include "llstartup.h"
73#include "hippoGridManager.h"
74#include "floaterlogin.h"
75#include "llpanellogin.h"
76
71 77
72#include "llglheaders.h" 78#include "llglheaders.h"
73 79
@@ -237,6 +243,10 @@ BOOL LLFloaterWorldMap::postBuild()
237 landmark_combo->setTextEntryCallback( onComboTextEntry ); 243 landmark_combo->setTextEntryCallback( onComboTextEntry );
238 } 244 }
239 245
246 childSetCommitCallback("grid_combo", onSelectServer, this);
247
248 childSetAction("Grid Manager", onGridManager, this);
249
240 childSetAction("Go Home", onGoHome, this); 250 childSetAction("Go Home", onGoHome, this);
241 251
242 childSetAction("Teleport", onClickTeleportBtn, this); 252 childSetAction("Teleport", onClickTeleportBtn, this);
@@ -327,6 +337,8 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
327 337
328 // If nothing is being tracked, set flag so the user position will be found 338 // If nothing is being tracked, set flag so the user position will be found
329 gFloaterWorldMap->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); 339 gFloaterWorldMap->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING );
340
341 LLFloaterWorldMap::addServer(gHippoGridManager->getDefaultGridNick());
330 } 342 }
331 343
332 if (center_on_target) 344 if (center_on_target)
@@ -371,6 +383,48 @@ void LLFloaterWorldMap::hide(void*)
371} 383}
372 384
373 385
386// static
387void LLFloaterWorldMap::addServer(const std::string& server)
388{
389 const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
390
391 LLCtrlListInterface *grids = gFloaterWorldMap->childGetListInterface("grid_combo");
392 if (!grids) return;
393
394 // Delete all but the "None" entry
395 S32 list_size = grids->getItemCount();
396 while (list_size > 1)
397 {
398 grids->selectNthItem(1);
399 grids->operateOnSelection(LLCtrlListInterface::OP_DELETE);
400 --list_size;
401 }
402
403
404 //LLComboBox *grids = gFloaterWorldMap->getChild<LLComboBox>("grid_combo");
405 S32 selectIndex = -1, i = 0;
406 //grids->removeall();
407 if (defaultGrid != "") {
408 grids->addSimpleElement(defaultGrid);
409 selectIndex = i++;
410 }
411 HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
412 for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
413 const std::string &grid = it->second->getGridNick();
414 if (grid != defaultGrid) {
415 grids->addSimpleElement(grid);
416 //if (grid == mCurGrid) selectIndex = i;
417 i++;
418 }
419 }
420 grids->selectFirstItem();
421 //grids->setCurrentByIndex(0);
422
423 //LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
424 //combo->add(server, LLSD(domain_name) );
425 //combo->setCurrentByIndex(0);
426}
427
374// virtual 428// virtual
375void LLFloaterWorldMap::setVisible( BOOL visible ) 429void LLFloaterWorldMap::setVisible( BOOL visible )
376{ 430{
@@ -443,7 +497,10 @@ void LLFloaterWorldMap::draw()
443 childSetEnabled("Go Home", enable_go_home); 497 childSetEnabled("Go Home", enable_go_home);
444 498
445 updateLocation(); 499 updateLocation();
446 500
501 LLComboBox *grid_combo = getChild<LLComboBox>("grid_combo");
502 std::string current_grid = gHippoGridManager->getConnectedGrid()->getGridNick();
503
447 LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); 504 LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus();
448 if (LLTracker::TRACKING_AVATAR == tracking_status) 505 if (LLTracker::TRACKING_AVATAR == tracking_status)
449 { 506 {
@@ -489,7 +546,19 @@ void LLFloaterWorldMap::draw()
489 centerOnTarget(TRUE); 546 centerOnTarget(TRUE);
490 } 547 }
491 548
492 childSetEnabled("Teleport", (BOOL)tracking_status); 549 //GRID MANAGER
550 if (grid_combo->getSelectedValue().asString() != "None")
551 {
552 childSetEnabled("Teleport", TRUE);
553 childSetColor("grid_icon", gTrackColor);
554 }
555 else
556 {
557 childSetEnabled("Teleport", (BOOL)tracking_status);
558 childSetColor("grid_icon", gDisabledTrackColor);
559 }
560 //END GRID MANAGER
561
493// childSetEnabled("Clear", (BOOL)tracking_status); 562// childSetEnabled("Clear", (BOOL)tracking_status);
494 childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation); 563 childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation);
495 childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); 564 childSetEnabled("copy_slurl", (mSLURL.size() > 0) );
@@ -743,7 +812,7 @@ void LLFloaterWorldMap::updateLocation()
743void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord) 812void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord)
744{ 813{
745 LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name); 814 LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name);
746 z_coord = llclamp(z_coord, 0, 4096); 815 z_coord = llclamp(z_coord, 0, 1000);
747 if (sim_info) 816 if (sim_info)
748 { 817 {
749 LLVector3 local_pos; 818 LLVector3 local_pos;
@@ -953,6 +1022,18 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui)
953} 1022}
954 1023
955 1024
1025void LLFloaterWorldMap::clearGridSelection(BOOL clear_ui)
1026{
1027 if (clear_ui || !childHasKeyboardFocus("grid_combo"))
1028 {
1029 LLCtrlListInterface *list = childGetListInterface("grid_combo");
1030 if (list)
1031 {
1032 list->selectByValue( "None" );
1033 }
1034 }
1035}
1036
956void LLFloaterWorldMap::clearLandmarkSelection(BOOL clear_ui) 1037void LLFloaterWorldMap::clearLandmarkSelection(BOOL clear_ui)
957{ 1038{
958 if (clear_ui || !childHasKeyboardFocus("landmark combo")) 1039 if (clear_ui || !childHasKeyboardFocus("landmark combo"))
@@ -1050,9 +1131,18 @@ void LLFloaterWorldMap::onPanBtn( void* userdata )
1050} 1131}
1051 1132
1052// static 1133// static
1134void LLFloaterWorldMap::onGridManager(void*)
1135{
1136 LoginFloater::newShow(std::string("Test"), false, LoginFloater::testCallback, NULL);
1137 //gAgent.teleportHome();
1138 //gFloaterWorldMap->close();
1139}
1140
1141// static
1053void LLFloaterWorldMap::onGoHome(void*) 1142void LLFloaterWorldMap::onGoHome(void*)
1054{ 1143{
1055 gAgent.teleportHomeConfirm(); 1144 gAgent.teleportHomeConfirm();
1145 gFloaterWorldMap->close();
1056} 1146}
1057 1147
1058 1148
@@ -1135,6 +1225,9 @@ void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata )
1135 item_id.setNull(); 1225 item_id.setNull();
1136 } 1226 }
1137 } 1227 }
1228 //GRID MANAGER HAX
1229 self->clearGridSelection(TRUE);
1230 //END GRID MANAGER HAX
1138 1231
1139 self->trackLandmark( item_id); 1232 self->trackLandmark( item_id);
1140 onShowTargetBtn(self); 1233 onShowTargetBtn(self);
@@ -1186,6 +1279,10 @@ void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata )
1186 const LLUUID& new_avatar_id = list->getCurrentID(); 1279 const LLUUID& new_avatar_id = list->getCurrentID();
1187 if (new_avatar_id.notNull()) 1280 if (new_avatar_id.notNull())
1188 { 1281 {
1282 //GRID MANAGER HAX
1283 self->clearGridSelection(TRUE);
1284 //END GRID MANAGER HAX
1285
1189 std::string name; 1286 std::string name;
1190 LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo"); 1287 LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo");
1191 if (combo) name = combo->getSimple(); 1288 if (combo) name = combo->getSimple();
@@ -1267,6 +1364,10 @@ void LLFloaterWorldMap::onClearBtn(void* data)
1267 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE; 1364 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE;
1268 self->mSLURL = ""; // Clear the SLURL since it's invalid 1365 self->mSLURL = ""; // Clear the SLURL since it's invalid
1269 self->mSetToUserPosition = TRUE; // Revert back to the current user position 1366 self->mSetToUserPosition = TRUE; // Revert back to the current user position
1367 //KOW TODO clear grid combo red ring, clear grid combo.
1368 //GRID MANAGER HAX
1369 self->clearGridSelection(TRUE);
1370 //END GRID MANAGER HAX
1270} 1371}
1271 1372
1272// static 1373// static
@@ -1376,6 +1477,39 @@ void LLFloaterWorldMap::fly()
1376// protected 1477// protected
1377void LLFloaterWorldMap::teleport() 1478void LLFloaterWorldMap::teleport()
1378{ 1479{
1480 //BEGIN CROSS GRIP TP//
1481 LLComboBox *grid_combo = getChild<LLComboBox>("grid_combo");
1482 std::string current_grid = gHippoGridManager->getConnectedGrid()->getGridNick();
1483
1484 // BUG: the client crashes if fed an invalid grid through this interface, which shouldn't happen
1485 if(//grid_combo && grid_combo->getSelectedValue().asString() != current_grid || gSavedSettings.getBOOL("CmdLineLoginURI") &&
1486 grid_combo->getSelectedValue().asString() != "None" &&
1487 !grid_combo->getSelectedValue().asString().empty())
1488 {
1489 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(grid_combo->getSelectedValue().asString());
1490 //DEBUG
1491
1492 llwarns << "tp button current grid = " << grid_combo->getSelectedValue().asString() << llendl;
1493 std::string firstName = gridInfo->getFirstName();
1494 std::string lastName = gridInfo->getLastName();
1495 std::string loginPassword = gridInfo->getAvatarPassword();
1496
1497 if(!firstName.empty() && !lastName.empty())
1498 {
1499 gLoginHandler.mFirstName = firstName;
1500 gLoginHandler.mLastName = lastName;
1501 gLoginHandler.mPassword = loginPassword;
1502 }
1503
1504 gHippoGridManager->setCurrentGrid(gridInfo->getGridNick());
1505 gHippoGridManager->setDefaultGrid(gridInfo->getGridNick());
1506 //this doesn't work :( gSavedSettings.setBOOL("CmdLineLoginURI", FALSE);
1507 LLStartUp::setShouldAutoLogin(true);
1508 LLAppViewer::instance()->requestLogout(false);
1509 return;
1510 }
1511 //END CROSS GRID TP//
1512
1379 BOOL teleport_home = FALSE; 1513 BOOL teleport_home = FALSE;
1380 LLVector3d pos_global; 1514 LLVector3d pos_global;
1381 LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); 1515 LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
@@ -1666,3 +1800,20 @@ void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata)
1666 1800
1667 onShowTargetBtn(self); 1801 onShowTargetBtn(self);
1668} 1802}
1803
1804// static
1805void LLFloaterWorldMap::onSelectServer(LLUICtrl* ctrl, void* userdata)
1806{
1807 //GRID MANAGER COMBO BOX CLICKED//
1808 llwarns << "onSelectServer called" << llendl;
1809 //snip from onClearBtn (bless this mess)
1810 LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata;
1811 self->mTrackedStatus = LLTracker::TRACKING_NOTHING;
1812 LLTracker::stopTracking((void *)(intptr_t)TRUE);
1813 //LLTracker::stopTracking(NULL);
1814 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE;
1815 self->mSLURL = ""; // Clear the SLURL since it's invalid
1816 self->mSetToUserPosition = TRUE; // Revert back to the current user position
1817
1818 self->setDefaultBtn("Teleport");
1819}
diff --git a/linden/indra/newview/llfloaterworldmap.h b/linden/indra/newview/llfloaterworldmap.h
index 568d3cc..2f444b9 100644
--- a/linden/indra/newview/llfloaterworldmap.h
+++ b/linden/indra/newview/llfloaterworldmap.h
@@ -67,6 +67,8 @@ public:
67 static void toggle(void*); 67 static void toggle(void*);
68 static void hide(void*); 68 static void hide(void*);
69 69
70 static void addServer(const std::string& server);
71
70 /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE ); 72 /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE );
71 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); 73 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
72 /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 74 /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
@@ -100,6 +102,7 @@ public:
100 void clearLocationSelection(BOOL clear_ui = FALSE); 102 void clearLocationSelection(BOOL clear_ui = FALSE);
101 void clearAvatarSelection(BOOL clear_ui = FALSE); 103 void clearAvatarSelection(BOOL clear_ui = FALSE);
102 void clearLandmarkSelection(BOOL clear_ui = FALSE); 104 void clearLandmarkSelection(BOOL clear_ui = FALSE);
105 void clearGridSelection(BOOL clear_ui = FALSE);
103 106
104 // Adjust the maximally zoomed out limit of the zoom slider so you can 107 // Adjust the maximally zoomed out limit of the zoom slider so you can
105 // see the whole world, plus a little. 108 // see the whole world, plus a little.
@@ -114,8 +117,9 @@ public:
114protected: 117protected:
115 static void onPanBtn( void* userdata ); 118 static void onPanBtn( void* userdata );
116 119
117 static void onGoHome(void* data); 120 static void onGridManager(void* data);
118 121
122 static void onGoHome(void* data);
119 static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data ); 123 static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data );
120 static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data ); 124 static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data );
121 125
@@ -157,6 +161,7 @@ protected:
157 static void onLocationCommit( void* userdata ); 161 static void onLocationCommit( void* userdata );
158 static void onCommitLocation( LLUICtrl* ctrl, void* userdata ); 162 static void onCommitLocation( LLUICtrl* ctrl, void* userdata );
159 static void onCommitSearchResult( LLUICtrl* ctrl, void* userdata ); 163 static void onCommitSearchResult( LLUICtrl* ctrl, void* userdata );
164 static void onSelectServer(LLUICtrl*, void* userdata);
160 165
161 void cacheLandmarkPosition(); 166 void cacheLandmarkPosition();
162 167
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index c26f70f..873920c 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -34,6 +34,8 @@
34#include "llpanellogin.h" 34#include "llpanellogin.h"
35#include "llpanelgeneral.h" 35#include "llpanelgeneral.h"
36 36
37#include "hippoGridManager.h"
38
37#include "indra_constants.h" // for key and mask constants 39#include "indra_constants.h" // for key and mask constants
38#include "llfontgl.h" 40#include "llfontgl.h"
39#include "llmd5.h" 41#include "llmd5.h"
@@ -63,17 +65,22 @@
63#include "llviewernetwork.h" 65#include "llviewernetwork.h"
64#include "llviewerwindow.h" // to link into child list 66#include "llviewerwindow.h" // to link into child list
65#include "llnotify.h" 67#include "llnotify.h"
68#include "llappviewer.h" // for gHideLinks
66#include "llurlsimstring.h" 69#include "llurlsimstring.h"
67#include "lluictrlfactory.h" 70#include "lluictrlfactory.h"
68#include "llhttpclient.h" 71#include "llhttpclient.h"
69#include "llweb.h" 72#include "llweb.h"
70#include "llwebbrowserctrl.h" 73#include "llwebbrowserctrl.h"
71 74
75#include "llfloaterhtml.h"
76
72#include "llfloaterhtmlhelp.h" 77#include "llfloaterhtmlhelp.h"
73#include "llfloatertos.h" 78#include "llfloatertos.h"
74 79
75#include "llglheaders.h" 80#include "llglheaders.h"
76 81
82#include "floaterlogin.h"
83
77#define USE_VIEWER_AUTH 0 84#define USE_VIEWER_AUTH 0
78 85
79std::string load_password_from_disk(void); 86std::string load_password_from_disk(void);
@@ -130,21 +137,8 @@ void LLLoginHandler::parse(const LLSD& queryMap)
130 mFirstName = queryMap["first_name"].asString(); 137 mFirstName = queryMap["first_name"].asString();
131 mLastName = queryMap["last_name"].asString(); 138 mLastName = queryMap["last_name"].asString();
132 139
133 EGridInfo grid_choice = GRID_INFO_NONE; 140 const std::string &grid = queryMap["grid"].asString();
134 if (queryMap["grid"].asString() == "sl beta grid") 141 if (grid != "") gHippoGridManager->setCurrentGrid(grid);
135 {
136 grid_choice = GRID_INFO_ADITI;
137 }
138 else if (queryMap["grid"].asString() == "sl main grid")
139 {
140 grid_choice = GRID_INFO_AGNI;
141 }
142
143 if(grid_choice != GRID_INFO_NONE)
144 {
145 LLViewerLogin::getInstance()->setGridChoice(grid_choice);
146 }
147
148 std::string startLocation = queryMap["location"].asString(); 142 std::string startLocation = queryMap["location"].asString();
149 143
150 if (startLocation == "specify") 144 if (startLocation == "specify")
@@ -258,11 +252,6 @@ namespace {
258 boost::intrusive_ptr< LLIamHereLogin > gResponsePtr = 0; 252 boost::intrusive_ptr< LLIamHereLogin > gResponsePtr = 0;
259}; 253};
260 254
261void set_start_location(LLUICtrl* ctrl, void* data)
262{
263 LLURLSimString::setString(ctrl->getValue().asString());
264}
265
266//--------------------------------------------------------------------------- 255//---------------------------------------------------------------------------
267// Public methods 256// Public methods
268//--------------------------------------------------------------------------- 257//---------------------------------------------------------------------------
@@ -349,13 +338,13 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
349 combo->setCurrentByIndex( 0 ); 338 combo->setCurrentByIndex( 0 );
350 } 339 }
351 340
352 combo->setCommitCallback( &set_start_location );
353 341
354 LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo"); 342 LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
355 server_choice_combo->setCommitCallback(onSelectServer); 343 server_choice_combo->setCommitCallback(onSelectServer);
356 server_choice_combo->setFocusLostCallback(onServerComboLostFocus); 344 //server_choice_combo->setFocusLostCallback(onServerComboLostFocus);
357 345
358 childSetAction("connect_btn", onClickConnect, this); 346 childSetAction("connect_btn", onClickConnect, this);
347 childSetAction("grid_btn", onClickGrid, this);
359 348
360 setDefaultBtn("connect_btn"); 349 setDefaultBtn("connect_btn");
361 350
@@ -657,6 +646,7 @@ void LLPanelLogin::show(const LLRect &rect,
657 646
658 // Make sure that focus always goes here (and use the latest sInstance that was just created) 647 // Make sure that focus always goes here (and use the latest sInstance that was just created)
659 gFocusMgr.setDefaultKeyboardFocus(sInstance); 648 gFocusMgr.setDefaultKeyboardFocus(sInstance);
649 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
660} 650}
661 651
662// static 652// static
@@ -701,7 +691,7 @@ void LLPanelLogin::setFields(const std::string& firstname, const std::string& la
701 691
702 692
703// static 693// static
704void LLPanelLogin::addServer(const std::string& server, S32 domain_name) 694void LLPanelLogin::addServer(const std::string& server)
705{ 695{
706 if (!sInstance) 696 if (!sInstance)
707 { 697 {
@@ -709,17 +699,29 @@ void LLPanelLogin::addServer(const std::string& server, S32 domain_name)
709 return; 699 return;
710 } 700 }
711 701
712 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); 702 const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
713 combo->add(server, LLSD(domain_name) );
714 combo->setCurrentByIndex(0);
715}
716 703
704 LLComboBox *grids = sInstance->getChild<LLComboBox>("server_combo");
705 S32 selectIndex = -1, i = 0;
706 grids->removeall();
707 if (defaultGrid != "") {
708 grids->add(defaultGrid);
709 selectIndex = i++;
710 }
711 HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
712 for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
713 const std::string &grid = it->second->getGridNick();
714 if (grid != defaultGrid) {
715 grids->add(grid);
716 //if (grid == mCurGrid) selectIndex = i;
717 i++;
718 }
719 }
720 grids->setCurrentByIndex(0);
717 721
718// static 722 //LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
719void LLPanelLogin::setServer(S32 domain_name) 723 //combo->add(server, LLSD(domain_name) );
720{ 724 //combo->setCurrentByIndex(0);
721 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
722 combo->setCurrentByIndex(domain_name);
723} 725}
724 726
725// static 727// static
@@ -800,7 +802,12 @@ void LLPanelLogin::refreshLocation( bool force_visible )
800 sInstance->childSetVisible("start_location_combo", show_start); 802 sInstance->childSetVisible("start_location_combo", show_start);
801 sInstance->childSetVisible("start_location_text", show_start); 803 sInstance->childSetVisible("start_location_text", show_start);
802 804
805/*#if LL_RELEASE_FOR_DOWNLOAD
806 BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid");
807 sInstance->childSetVisible("server_combo", show_server);
808#else*/
803 sInstance->childSetVisible("server_combo", TRUE); 809 sInstance->childSetVisible("server_combo", TRUE);
810//#endif
804 811
805#endif 812#endif
806} 813}
@@ -833,18 +840,39 @@ void LLPanelLogin::setAlwaysRefresh(bool refresh)
833} 840}
834 841
835 842
843// static
844void LLPanelLogin::refreshLoginPage()
845{
846 if (!sInstance) return;
847
848 sInstance->childSetVisible("create_new_account_text",
849 !gHippoGridManager->getConnectedGrid()->getRegisterUrl().empty());
850 sInstance->childSetVisible("forgot_password_text",
851 !gHippoGridManager->getConnectedGrid()->getPasswordUrl().empty());
852
853 // kick off a request to grab the url manually
854 gResponsePtr = LLIamHereLogin::build(sInstance);
855 std::string login_page = gHippoGridManager->getConnectedGrid()->getLoginPage();
856 if (!login_page.empty()) {
857 LLHTTPClient::head(login_page, gResponsePtr);
858 } else {
859 sInstance->setSiteIsAlive(false);
860 }
861}
862
836 863
837void LLPanelLogin::loadLoginPage() 864void LLPanelLogin::loadLoginPage()
838{ 865{
839 if (!sInstance) return; 866 if (!sInstance) return;
840 867
841 std::ostringstream oStr;
842 868
843 std::string login_page = gSavedSettings.getString("LoginPage"); 869 std::string login_page = gHippoGridManager->getConnectedGrid()->getLoginPage();
844 if (login_page.empty()) 870 if (login_page.empty()) {
845 { 871 sInstance->setSiteIsAlive(false);
846 login_page = sInstance->getString( "real_url" ); 872 return;
847 } 873 }
874
875 std::ostringstream oStr;
848 oStr << login_page; 876 oStr << login_page;
849 877
850 // Use the right delimeter depending on how LLURI parses the URL 878 // Use the right delimeter depending on how LLURI parses the URL
@@ -879,11 +907,12 @@ void LLPanelLogin::loadLoginPage()
879 curl_free(curl_version); 907 curl_free(curl_version);
880 908
881 // Grid 909 // Grid
882 char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridCodeName().c_str(), 0); 910 char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridLabel().c_str(), 0);
883 oStr << "&grid=" << curl_grid; 911 oStr << "&grid=" << curl_grid;
884 curl_free(curl_grid); 912 curl_free(curl_grid);
885 913
886 gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid()); 914 gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid());
915 //LLViewerLogin::getInstance()->setMenuColor();
887 gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor()); 916 gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());
888 917
889 918
@@ -1017,12 +1046,27 @@ void LLPanelLogin::onClickConnect(void *)
1017 } 1046 }
1018 else 1047 else
1019 { 1048 {
1049 if (gHideLinks)
1050 {
1051 gViewerWindow->alertXml("MustHaveAccountToLogInNoLinks");
1052 }
1053 else
1054 {
1020 gViewerWindow->alertXml("MustHaveAccountToLogIn", 1055 gViewerWindow->alertXml("MustHaveAccountToLogIn",
1021 LLPanelLogin::newAccountAlertCallback); 1056 LLPanelLogin::newAccountAlertCallback);
1022 } 1057 }
1023 } 1058 }
1024} 1059}
1060}
1025 1061
1062void LLPanelLogin::onClickGrid(void *)
1063{
1064 if (sInstance && sInstance->mCallback)
1065 {
1066 LoginFloater::newShow(std::string("Test"), false, LoginFloater::testCallback, NULL);
1067 }
1068}
1069
1026 1070
1027// static 1071// static
1028void LLPanelLogin::newAccountAlertCallback(S32 option, void*) 1072void LLPanelLogin::newAccountAlertCallback(S32 option, void*)
@@ -1088,7 +1132,7 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
1088} 1132}
1089 1133
1090// static 1134// static
1091void LLPanelLogin::onSelectServer(LLUICtrl*, void*) 1135void LLPanelLogin::onSelectServer(LLUICtrl* ctrl, void*)
1092{ 1136{
1093 // *NOTE: The paramters for this method are ignored. 1137 // *NOTE: The paramters for this method are ignored.
1094 // LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) 1138 // LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
@@ -1097,11 +1141,31 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
1097 // The user twiddled with the grid choice ui. 1141 // The user twiddled with the grid choice ui.
1098 // apply the selection to the grid setting. 1142 // apply the selection to the grid setting.
1099 std::string grid_label; 1143 std::string grid_label;
1100 S32 grid_index; 1144 //S32 grid_index;
1101 1145
1102 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); 1146 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
1103 LLSD combo_val = combo->getValue(); 1147 LLSD combo_val = combo->getValue();
1104 1148
1149 std::string mCurGrid = ctrl->getValue().asString();
1150 //KOW
1151 gHippoGridManager->setCurrentGrid(mCurGrid);
1152 //gHippoGridManager->setDefaultGrid(mCurGrid);
1153 //gHippoGridManager->saveFile();
1154 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
1155 if (gridInfo) {
1156 //childSetText("gridnick", gridInfo->getGridNick());
1157 //platform->setCurrentByIndex(gridInfo->getPlatform());
1158 //childSetText("gridname", gridInfo->getGridName());
1159 LLPanelLogin::setFields( gridInfo->getFirstName(), gridInfo->getLastName(), gridInfo->getAvatarPassword(), 1 );
1160 }
1161 //gHippoGridManager->setCurrentGrid(mCurGrid);
1162
1163
1164
1165 llwarns << "current grid = " << mCurGrid << llendl;
1166
1167 /*
1168
1105 if (LLSD::TypeInteger == combo_val.type()) 1169 if (LLSD::TypeInteger == combo_val.type())
1106 { 1170 {
1107 grid_index = combo->getValue().asInteger(); 1171 grid_index = combo->getValue().asInteger();
@@ -1126,17 +1190,27 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
1126 vl->resetURIs(); 1190 vl->resetURIs();
1127 if(grid_index != GRID_INFO_OTHER) 1191 if(grid_index != GRID_INFO_OTHER)
1128 { 1192 {
1129 vl->setGridChoice((EGridInfo)grid_index); 1193 vl->setGridChoice(grid_index);
1130 } 1194 }
1131 else 1195 else
1132 { 1196 {
1133 vl->setGridChoice(grid_label); 1197 vl->setGridChoice(grid_label);
1134 } 1198 }
1135 1199
1200 // clear the password if we are switching grids so we don't send
1201 // the wrong pass to the wrong grid.
1202 if (sInstance)
1203 {
1204 // no method to clear a text box?
1205 const std::string nothing("");
1206 sInstance->childSetText("password_edit", nothing);
1207 }
1208 */
1136 // grid changed so show new splash screen (possibly) 1209 // grid changed so show new splash screen (possibly)
1137 loadLoginPage(); 1210 loadLoginPage();
1138} 1211}
1139 1212
1213/*
1140void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) 1214void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
1141{ 1215{
1142 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); 1216 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
@@ -1145,3 +1219,4 @@ void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
1145 onSelectServer(combo, NULL); 1219 onSelectServer(combo, NULL);
1146 } 1220 }
1147} 1221}
1222*/
diff --git a/linden/indra/newview/llpanellogin.h b/linden/indra/newview/llpanellogin.h
index a303e32..8a9747b 100644
--- a/linden/indra/newview/llpanellogin.h
+++ b/linden/indra/newview/llpanellogin.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2009, Linden Research, Inc. 7 * Copyright (c) 2002-2008, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -60,6 +60,7 @@ class LLLoginHandler : public LLCommandHandler
60 LLUUID mWebLoginKey; 60 LLUUID mWebLoginKey;
61 std::string mFirstName; 61 std::string mFirstName;
62 std::string mLastName; 62 std::string mLastName;
63 std::string mPassword;
63}; 64};
64 65
65extern LLLoginHandler gLoginHandler; 66extern LLLoginHandler gLoginHandler;
@@ -86,8 +87,7 @@ public:
86 static void setFields(const std::string& firstname, const std::string& lastname, 87 static void setFields(const std::string& firstname, const std::string& lastname,
87 const std::string& password, BOOL remember); 88 const std::string& password, BOOL remember);
88 89
89 static void addServer(const std::string& server, S32 domain_name); 90 static void addServer(const std::string& server);
90 static void setServer(S32 domain_name);
91 static void refreshLocation( bool force_visible ); 91 static void refreshLocation( bool force_visible );
92 92
93 static void getFields(std::string& firstname, std::string& lastname, 93 static void getFields(std::string& firstname, std::string& lastname,
@@ -101,12 +101,14 @@ public:
101 void setSiteIsAlive( bool alive ); 101 void setSiteIsAlive( bool alive );
102 102
103 static void loadLoginPage(); 103 static void loadLoginPage();
104 static void refreshLoginPage();
104 static void giveFocus(); 105 static void giveFocus();
105 static void setAlwaysRefresh(bool refresh); 106 static void setAlwaysRefresh(bool refresh);
106 static void mungePassword(LLUICtrl* caller, void* user_data); 107 static void mungePassword(LLUICtrl* caller, void* user_data);
107 108
108private: 109private:
109 static void onClickConnect(void*); 110 static void onClickConnect(void*);
111 static void onClickGrid(void*);
110 static void onClickNewAccount(void*); 112 static void onClickNewAccount(void*);
111 static void newAccountAlertCallback(S32 option, void*); 113 static void newAccountAlertCallback(S32 option, void*);
112 static void onClickQuit(void*); 114 static void onClickQuit(void*);
diff --git a/linden/indra/newview/llprogressview.cpp b/linden/indra/newview/llprogressview.cpp
index a38aada..157dc6c 100644
--- a/linden/indra/newview/llprogressview.cpp
+++ b/linden/indra/newview/llprogressview.cpp
@@ -407,7 +407,7 @@ void LLProgressView::onCancelButtonClicked(void*)
407{ 407{
408 if (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE) 408 if (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE)
409 { 409 {
410 LLAppViewer::instance()->requestQuit(); 410 LLAppViewer::instance()->requestLogout(true);
411 } 411 }
412 else 412 else
413 { 413 {
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index aca3cac..8f9b728 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -29,7 +29,14 @@
29 * $/LicenseInfo$ 29 * $/LicenseInfo$
30 */ 30 */
31 31
32#include "llviewerprecompiledheaders.h" 32// #include "llviewerprecompiledheaders.h"
33
34
35#if LL_WINDOWS
36 #define WIN32_LEAN_AND_MEAN
37 #include <winsock2.h>
38 #include <windows.h>
39#endif
33 40
34#include "llstartup.h" 41#include "llstartup.h"
35 42
@@ -190,6 +197,8 @@
190#include "lldxhardware.h" 197#include "lldxhardware.h"
191#endif 198#endif
192 199
200#include "hippoGridManager.h"
201#include "hippoLimits.h"
193// 202//
194// exported globals 203// exported globals
195// 204//
@@ -222,7 +231,8 @@ static std::string sInitialOutfitGender; // "male" or "female"
222static bool gUseCircuitCallbackCalled = false; 231static bool gUseCircuitCallbackCalled = false;
223 232
224EStartupState LLStartUp::gStartupState = STATE_FIRST; 233EStartupState LLStartUp::gStartupState = STATE_FIRST;
225 234bool LLStartUp::mStartedOnce = false;
235bool LLStartUp::mShouldAutoLogin = false;
226 236
227// 237//
228// local function declaration 238// local function declaration
@@ -248,7 +258,6 @@ void dialog_choose_gender_first_start();
248void callback_choose_gender(S32 option, void* userdata); 258void callback_choose_gender(S32 option, void* userdata);
249void init_start_screen(S32 location_id); 259void init_start_screen(S32 location_id);
250void release_start_screen(); 260void release_start_screen();
251void reset_login();
252void apply_udp_blacklist(const std::string& csv); 261void apply_udp_blacklist(const std::string& csv);
253 262
254void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) 263void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data)
@@ -322,6 +331,7 @@ bool idle_startup()
322 static S32 timeout_count = 0; 331 static S32 timeout_count = 0;
323 332
324 static LLTimer login_time; 333 static LLTimer login_time;
334 static LLFrameTimer wearables_timer;
325 335
326 // until this is encapsulated, this little hack for the 336 // until this is encapsulated, this little hack for the
327 // auth/transform loop will do. 337 // auth/transform loop will do.
@@ -654,7 +664,7 @@ bool idle_startup()
654 664
655 show_connect_box = false; 665 show_connect_box = false;
656 } 666 }
657 else if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3) 667 else if((gSavedSettings.getLLSD("UserLoginInfo").size() == 3) && !LLStartUp::shouldAutoLogin())
658 { 668 {
659 LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); 669 LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo");
660 firstname = cmd_line_login[0].asString(); 670 firstname = cmd_line_login[0].asString();
@@ -721,12 +731,19 @@ bool idle_startup()
721 if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) 731 if (STATE_LOGIN_SHOW == LLStartUp::getStartupState())
722 { 732 {
723 LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL; 733 LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL;
734 sAuthUris.clear();
735 sAuthUriNum = -1;
724 736
725 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 737 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
726 // Push our window frontmost 738 // Push our window frontmost
727 gViewerWindow->getWindow()->show(); 739 gViewerWindow->getWindow()->show();
728 740
729 timeout_count = 0; 741 timeout_count = 0;
742
743 if(LLStartUp::shouldAutoLogin())
744 {
745 show_connect_box = false;
746 }
730 747
731 if (show_connect_box) 748 if (show_connect_box)
732 { 749 {
@@ -809,6 +826,18 @@ bool idle_startup()
809 lastname = gLoginHandler.mLastName; 826 lastname = gLoginHandler.mLastName;
810 web_login_key = gLoginHandler.mWebLoginKey; 827 web_login_key = gLoginHandler.mWebLoginKey;
811 } 828 }
829
830 if(!gLoginHandler.mPassword.empty())
831 {
832 firstname = gLoginHandler.mFirstName;
833 lastname = gLoginHandler.mLastName;
834 password = gLoginHandler.mPassword;
835
836 gLoginHandler.mFirstName = "";
837 gLoginHandler.mLastName = "";
838 gLoginHandler.mPassword = "";
839 LLStartUp::setShouldAutoLogin(false);
840 }
812 841
813 if (show_connect_box) 842 if (show_connect_box)
814 { 843 {
@@ -836,10 +865,11 @@ bool idle_startup()
836 } 865 }
837 gSavedSettings.setBOOL("RememberPassword", remember_password); 866 gSavedSettings.setBOOL("RememberPassword", remember_password);
838 867
839 LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << LL_ENDL; 868 LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL;
840 gDebugInfo["LoginName"] = firstname + " " + lastname; 869 gDebugInfo["LoginName"] = firstname + " " + lastname;
841 } 870 }
842 871
872 gHippoGridManager->setCurrentGridAsConnected();
843 // create necessary directories 873 // create necessary directories
844 // *FIX: these mkdir's should error check 874 // *FIX: these mkdir's should error check
845 gDirUtilp->setLindenUserDir(firstname, lastname); 875 gDirUtilp->setLindenUserDir(firstname, lastname);
@@ -1031,6 +1061,10 @@ bool idle_startup()
1031 LLStringUtil::format_map_t args; 1061 LLStringUtil::format_map_t args;
1032 args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); 1062 args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle();
1033 auth_desc = LLTrans::getString("LoginInProgress", args); 1063 auth_desc = LLTrans::getString("LoginInProgress", args);
1064
1065 //Since we are about to login, we don't want the client to attempt auto login
1066 //again until the user does a grid2grid teleport.
1067 LLStartUp::setShouldAutoLogin(false);
1034 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); 1068 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE );
1035 } 1069 }
1036 1070
@@ -1070,13 +1104,15 @@ bool idle_startup()
1070 hashed_mac.hex_digest(hashed_mac_string); 1104 hashed_mac.hex_digest(hashed_mac_string);
1071 1105
1072 // TODO if statement here to use web_login_key 1106 // TODO if statement here to use web_login_key
1107 if(web_login_key.isNull()){
1073 sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); 1108 sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1);
1074 LLUserAuth::getInstance()->authenticate( 1109 LLUserAuth::getInstance()->authenticate(
1075 sAuthUris[sAuthUriNum], 1110 sAuthUris[sAuthUriNum],
1076 auth_method, 1111 auth_method,
1077 firstname, 1112 firstname,
1078 lastname, 1113 lastname,
1079 password, // web_login_key, 1114 password,
1115 //web_login_key,
1080 start.str(), 1116 start.str(),
1081 gSkipOptionalUpdate, 1117 gSkipOptionalUpdate,
1082 gAcceptTOS, 1118 gAcceptTOS,
@@ -1085,6 +1121,22 @@ bool idle_startup()
1085 requested_options, 1121 requested_options,
1086 hashed_mac_string, 1122 hashed_mac_string,
1087 LLAppViewer::instance()->getSerialNumber()); 1123 LLAppViewer::instance()->getSerialNumber());
1124 } else {
1125 LLUserAuth::getInstance()->authenticate(
1126 sAuthUris[sAuthUriNum],
1127 auth_method,
1128 firstname,
1129 lastname,
1130 web_login_key,
1131 start.str(),
1132 gSkipOptionalUpdate,
1133 gAcceptTOS,
1134 gAcceptCriticalMessage,
1135 gLastExecEvent,
1136 requested_options,
1137 hashed_mac_string,
1138 LLAppViewer::instance()->getSerialNumber());
1139 }
1088 1140
1089 // reset globals 1141 // reset globals
1090 gAcceptTOS = FALSE; 1142 gAcceptTOS = FALSE;
@@ -1144,7 +1196,6 @@ bool idle_startup()
1144 LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; 1196 LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL;
1145 std::ostringstream emsg; 1197 std::ostringstream emsg;
1146 bool quit = false; 1198 bool quit = false;
1147 bool update = false;
1148 std::string login_response; 1199 std::string login_response;
1149 std::string reason_response; 1200 std::string reason_response;
1150 std::string message_response; 1201 std::string message_response;
@@ -1188,7 +1239,11 @@ bool idle_startup()
1188 reason_response = LLUserAuth::getInstance()->getResponse("reason"); 1239 reason_response = LLUserAuth::getInstance()->getResponse("reason");
1189 message_response = LLUserAuth::getInstance()->getResponse("message"); 1240 message_response = LLUserAuth::getInstance()->getResponse("message");
1190 1241
1191 if (!message_response.empty()) 1242 if (gHideLinks && reason_response == "disabled")
1243 {
1244 emsg << gDisabledMessage;
1245 }
1246 else if (!message_response.empty())
1192 { 1247 {
1193 // XUI: fix translation for strings returned during login 1248 // XUI: fix translation for strings returned during login
1194 // We need a generic table for translations 1249 // We need a generic table for translations
@@ -1246,7 +1301,16 @@ bool idle_startup()
1246 if(reason_response == "update") 1301 if(reason_response == "update")
1247 { 1302 {
1248 auth_message = LLUserAuth::getInstance()->getResponse("message"); 1303 auth_message = LLUserAuth::getInstance()->getResponse("message");
1249 update = true; 1304 if (show_connect_box)
1305 {
1306 update_app(TRUE, auth_message);
1307 LLStartUp::setStartupState( STATE_UPDATE_CHECK );
1308 return false;
1309 }
1310 else
1311 {
1312 quit = true;
1313 }
1250 } 1314 }
1251 if(reason_response == "optional") 1315 if(reason_response == "optional")
1252 { 1316 {
@@ -1284,21 +1348,6 @@ bool idle_startup()
1284 break; 1348 break;
1285 } 1349 }
1286 1350
1287 if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
1288 {
1289 gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
1290 if (show_connect_box)
1291 {
1292 update_app(TRUE, auth_message);
1293 LLStartUp::setStartupState( STATE_UPDATE_CHECK );
1294 return false;
1295 }
1296 else
1297 {
1298 quit = true;
1299 }
1300 }
1301
1302 // Version update and we're not showing the dialog 1351 // Version update and we're not showing the dialog
1303 if(quit) 1352 if(quit)
1304 { 1353 {
@@ -1511,6 +1560,42 @@ bool idle_startup()
1511 } 1560 }
1512 } 1561 }
1513 1562
1563 // Override grid info with anything sent in the login response
1564 std::string tmp = LLUserAuth::getInstance()->getResponse("gridname");
1565 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
1566 tmp = LLUserAuth::getInstance()->getResponse("loginuri");
1567 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp);
1568 tmp = LLUserAuth::getInstance()->getResponse("welcome");
1569 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
1570 tmp = LLUserAuth::getInstance()->getResponse("loginpage");
1571 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
1572 tmp = LLUserAuth::getInstance()->getResponse("economy");
1573 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
1574 tmp = LLUserAuth::getInstance()->getResponse("helperuri");
1575 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
1576 tmp = LLUserAuth::getInstance()->getResponse("about");
1577 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
1578 tmp = LLUserAuth::getInstance()->getResponse("website");
1579 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
1580 tmp = LLUserAuth::getInstance()->getResponse("help");
1581 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
1582 tmp = LLUserAuth::getInstance()->getResponse("support");
1583 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
1584 tmp = LLUserAuth::getInstance()->getResponse("register");
1585 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
1586 tmp = LLUserAuth::getInstance()->getResponse("account");
1587 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
1588 tmp = LLUserAuth::getInstance()->getResponse("password");
1589 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp);
1590 tmp = LLUserAuth::getInstance()->getResponse("search");
1591 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
1592 tmp = LLUserAuth::getInstance()->getResponse("currency");
1593 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
1594 tmp = LLUserAuth::getInstance()->getResponse("real_currency");
1595 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
1596 tmp = LLUserAuth::getInstance()->getResponse("directory_fee");
1597 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str()));
1598 gHippoGridManager->saveFile();
1514 1599
1515 // JC: gesture loading done below, when we have an asset system 1600 // JC: gesture loading done below, when we have an asset system
1516 // in place. Don't delete/clear user_credentials until then. 1601 // in place. Don't delete/clear user_credentials until then.
@@ -1535,8 +1620,10 @@ bool idle_startup()
1535 LLStringUtil::format_map_t args; 1620 LLStringUtil::format_map_t args;
1536 args["[ERROR_MESSAGE]"] = emsg.str(); 1621 args["[ERROR_MESSAGE]"] = emsg.str();
1537 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1622 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done);
1538 reset_login(); 1623 LLStartUp::resetLogin();
1539 gSavedSettings.setBOOL("AutoLogin", FALSE); 1624 gSavedSettings.setBOOL("AutoLogin", FALSE);
1625 //this might be redundant
1626 LLStartUp::setShouldAutoLogin(false);
1540 show_connect_box = true; 1627 show_connect_box = true;
1541 } 1628 }
1542 1629
@@ -1555,8 +1642,10 @@ bool idle_startup()
1555 LLStringUtil::format_map_t args; 1642 LLStringUtil::format_map_t args;
1556 args["[ERROR_MESSAGE]"] = emsg.str(); 1643 args["[ERROR_MESSAGE]"] = emsg.str();
1557 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1644 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done);
1558 reset_login(); 1645 LLStartUp::resetLogin();
1559 gSavedSettings.setBOOL("AutoLogin", FALSE); 1646 gSavedSettings.setBOOL("AutoLogin", FALSE);
1647 //this might be redundant
1648 LLStartUp::setShouldAutoLogin(false);
1560 show_connect_box = true; 1649 show_connect_box = true;
1561 // Don't save an incorrect password to disk. 1650 // Don't save an incorrect password to disk.
1562 save_password_to_disk(NULL); 1651 save_password_to_disk(NULL);
@@ -1570,6 +1659,7 @@ bool idle_startup()
1570 if (STATE_WORLD_INIT == LLStartUp::getStartupState()) 1659 if (STATE_WORLD_INIT == LLStartUp::getStartupState())
1571 { 1660 {
1572 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); 1661 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD);
1662 gDisconnected=FALSE;
1573 display_startup(); 1663 display_startup();
1574 // We should have an agent id by this point. 1664 // We should have an agent id by this point.
1575 llassert(!(gAgentID == LLUUID::null)); 1665 llassert(!(gAgentID == LLUUID::null));
@@ -1598,10 +1688,11 @@ bool idle_startup()
1598 LLWaterParamManager::initClass(); 1688 LLWaterParamManager::initClass();
1599 1689
1600 // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering 1690 // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering
1691
1692 if (!LLStartUp::getStartedOnce())
1601 LLViewerObject::initVOClasses(); 1693 LLViewerObject::initVOClasses();
1602 1694
1603 display_startup(); 1695 display_startup();
1604
1605 // This is where we used to initialize gWorldp. Original comment said: 1696 // This is where we used to initialize gWorldp. Original comment said:
1606 // World initialization must be done after above window init 1697 // World initialization must be done after above window init
1607 1698
@@ -1744,7 +1835,7 @@ bool idle_startup()
1744 //reset statistics 1835 //reset statistics
1745 LLViewerStats::getInstance()->resetStats(); 1836 LLViewerStats::getInstance()->resetStats();
1746 1837
1747 if (!gNoRender) 1838 if ((!gNoRender)&&(!LLStartUp::getStartedOnce()))
1748 { 1839 {
1749 // 1840 //
1750 // Set up all of our statistics UI stuff. 1841 // Set up all of our statistics UI stuff.
@@ -2016,6 +2107,7 @@ bool idle_startup()
2016 LLAvatarTracker::instance().addBuddyList(list); 2107 LLAvatarTracker::instance().addBuddyList(list);
2017 } 2108 }
2018 2109
2110 /*
2019 options.clear(); 2111 options.clear();
2020 if(LLUserAuth::getInstance()->getOptions("ui-config", options)) 2112 if(LLUserAuth::getInstance()->getOptions("ui-config", options))
2021 { 2113 {
@@ -2034,6 +2126,7 @@ bool idle_startup()
2034 } 2126 }
2035 } 2127 }
2036 } 2128 }
2129 */
2037 options.clear(); 2130 options.clear();
2038 bool show_hud = false; 2131 bool show_hud = false;
2039 if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) 2132 if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options))
@@ -2121,6 +2214,7 @@ bool idle_startup()
2121 // Create the inventory views 2214 // Create the inventory views
2122 llinfos << "Creating Inventory Views" << llendl; 2215 llinfos << "Creating Inventory Views" << llendl;
2123 LLInventoryView::showAgentInventory(); 2216 LLInventoryView::showAgentInventory();
2217 llinfos << "Inventory Views Created" << llendl;
2124 2218
2125 // Hide the inventory if it wasn't shown at exit 2219 // Hide the inventory if it wasn't shown at exit
2126 if(!shown_at_exit) 2220 if(!shown_at_exit)
@@ -2184,7 +2278,7 @@ bool idle_startup()
2184 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); 2278 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
2185 }; 2279 };
2186 2280
2187 if (!gNoRender) 2281 if ((!gNoRender)&&(!LLStartUp::getStartedOnce()))
2188 { 2282 {
2189 // JC: Initializing audio requests many sounds for download. 2283 // JC: Initializing audio requests many sounds for download.
2190 init_audio(); 2284 init_audio();
@@ -2344,25 +2438,11 @@ bool idle_startup()
2344 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); 2438 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
2345 } 2439 }
2346 2440
2347
2348 // We now have an inventory skeleton, so if this is a user's first
2349 // login, we can start setting up their clothing and avatar
2350 // appearance. This helps to avoid the generic "Ruth" avatar in
2351 // the orientation island tutorial experience. JC
2352 if (gAgent.isFirstLogin()
2353 && !sInitialOutfit.empty() // registration set up an outfit
2354 && !sInitialOutfitGender.empty() // and a gender
2355 && gAgent.getAvatarObject() // can't wear clothes without object
2356 && !gAgent.isGenderChosen() ) // nothing already loading
2357 {
2358 // Start loading the wearables, textures, gestures
2359 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
2360 }
2361
2362 // wait precache-delay and for agent's avatar or a lot longer. 2441 // wait precache-delay and for agent's avatar or a lot longer.
2363 if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) 2442 if(((timeout_frac > 1.f) && gAgent.getAvatarObject())
2364 || (timeout_frac > 3.f)) 2443 || (timeout_frac > 3.f))
2365 { 2444 {
2445 wearables_timer.reset();
2366 LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); 2446 LLStartUp::setStartupState( STATE_WEARABLES_WAIT );
2367 } 2447 }
2368 else 2448 else
@@ -2378,7 +2458,6 @@ bool idle_startup()
2378 2458
2379 if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) 2459 if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState())
2380 { 2460 {
2381 static LLFrameTimer wearables_timer;
2382 2461
2383 const F32 wearables_time = wearables_timer.getElapsedTimeF32(); 2462 const F32 wearables_time = wearables_timer.getElapsedTimeF32();
2384 const F32 MAX_WEARABLES_TIME = 10.f; 2463 const F32 MAX_WEARABLES_TIME = 10.f;
@@ -2482,6 +2561,7 @@ bool idle_startup()
2482 LLUserAuth::getInstance()->reset(); 2561 LLUserAuth::getInstance()->reset();
2483 2562
2484 LLStartUp::setStartupState( STATE_STARTED ); 2563 LLStartUp::setStartupState( STATE_STARTED );
2564 LLStartUp::setStartedOnce(true);
2485 2565
2486 // Unmute audio if desired and setup volumes. 2566 // Unmute audio if desired and setup volumes.
2487 // Unmute audio if desired and setup volumes. 2567 // Unmute audio if desired and setup volumes.
@@ -2498,7 +2578,7 @@ bool idle_startup()
2498 gDebugView->mFastTimerView->setVisible(TRUE); 2578 gDebugView->mFastTimerView->setVisible(TRUE);
2499#endif 2579#endif
2500 2580
2501 LLAppViewer::instance()->handleLoginComplete(); 2581 LLAppViewer::instance()->initMainloopTimeout("Mainloop Init");
2502 2582
2503 return TRUE; 2583 return TRUE;
2504 } 2584 }
@@ -2528,14 +2608,15 @@ void login_show()
2528 // UI textures have been previously loaded in doPreloadImages() 2608 // UI textures have been previously loaded in doPreloadImages()
2529 2609
2530 LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL; 2610 LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL;
2531 LL_INFOS("AppInit") << "getGridChoice is " << LLViewerLogin::getInstance()->getGridChoice() << LL_ENDL;
2532 2611
2612 //KOW
2613/*
2533 LLViewerLogin* vl = LLViewerLogin::getInstance(); 2614 LLViewerLogin* vl = LLViewerLogin::getInstance();
2534 for(int grid_index = GRID_INFO_NONE + 1; grid_index < GRID_INFO_OTHER; ++grid_index) 2615 for(int grid_index = 1; grid_index < GRID_INFO_OTHER; ++grid_index)
2535 { 2616 {
2536 LLPanelLogin::addServer(vl->getKnownGridLabel((EGridInfo)grid_index), grid_index); 2617 LLPanelLogin::addServer(vl->getKnownGridLabel(grid_index), grid_index);
2537 } 2618 }
2538 LLPanelLogin::setServer(LLViewerLogin::getInstance()->getGridChoice()-1); 2619*/
2539} 2620}
2540 2621
2541// Callback for when login screen is closed. Option 0 = connect, option 1 = quit. 2622// Callback for when login screen is closed. Option 0 = connect, option 1 = quit.
@@ -2814,6 +2895,7 @@ void update_app(BOOL mandatory, const std::string& auth_msg)
2814 2895
2815void update_dialog_callback(S32 option, void *userdata) 2896void update_dialog_callback(S32 option, void *userdata)
2816{ 2897{
2898 std::string update_exe_path;
2817 bool mandatory = userdata != NULL; 2899 bool mandatory = userdata != NULL;
2818 2900
2819#if !LL_RELEASE_FOR_DOWNLOAD 2901#if !LL_RELEASE_FOR_DOWNLOAD
@@ -2830,8 +2912,6 @@ void update_dialog_callback(S32 option, void *userdata)
2830 if (mandatory) 2912 if (mandatory)
2831 { 2913 {
2832 LLAppViewer::instance()->forceQuit(); 2914 LLAppViewer::instance()->forceQuit();
2833 // Bump them back to the login screen.
2834 //reset_login();
2835 } 2915 }
2836 else 2916 else
2837 { 2917 {
@@ -2856,7 +2936,7 @@ void update_dialog_callback(S32 option, void *userdata)
2856 // *TODO constantize this guy 2936 // *TODO constantize this guy
2857 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); 2937 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
2858 2938
2859 if(LLAppViewer::sUpdaterInfo) 2939/* if(LLAppViewer::sUpdaterInfo)
2860 { 2940 {
2861 delete LLAppViewer::sUpdaterInfo ; 2941 delete LLAppViewer::sUpdaterInfo ;
2862 } 2942 }
@@ -2929,14 +3009,16 @@ void update_dialog_callback(S32 option, void *userdata)
2929 LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; 3009 LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL;
2930 3010
2931 // Run the auto-updater. 3011 // Run the auto-updater.
2932 system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ 3012*/
2933 3013 //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */
3014/*
2934#elif LL_LINUX 3015#elif LL_LINUX
2935 OSMessageBox("Automatic updating is not yet implemented for Linux.\n" 3016 OSMessageBox("Automatic updating is not yet implemented for Linux.\n"
2936 "Please download the latest version from www.secondlife.com.", 3017 "Please download the latest version from www.secondlife.com.",
2937 LLStringUtil::null, OSMB_OK); 3018 LLStringUtil::null, OSMB_OK);
2938#endif 3019#endif
2939 LLAppViewer::instance()->forceQuit(); 3020 LLAppViewer::instance()->forceQuit();
3021 */
2940} 3022}
2941 3023
2942void use_circuit_callback(void**, S32 result) 3024void use_circuit_callback(void**, S32 result)
@@ -2952,7 +3034,7 @@ void use_circuit_callback(void**, S32 result)
2952 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; 3034 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL;
2953 gViewerWindow->alertXml("LoginPacketNeverReceived", 3035 gViewerWindow->alertXml("LoginPacketNeverReceived",
2954 login_alert_status, NULL); 3036 login_alert_status, NULL);
2955 reset_login(); 3037 LLStartUp::resetLogin();
2956 } 3038 }
2957 else 3039 else
2958 { 3040 {
@@ -3902,7 +3984,16 @@ void LLStartUp::setStartupState( EStartupState state )
3902} 3984}
3903 3985
3904 3986
3905void reset_login() 3987//static
3988void LLStartUp::setStartedOnce(bool started)
3989{
3990 mStartedOnce=started;
3991}
3992
3993
3994//displays the screen and cleans up UI
3995// static
3996void LLStartUp::resetLogin()
3906{ 3997{
3907 LLStartUp::setStartupState( STATE_LOGIN_SHOW ); 3998 LLStartUp::setStartupState( STATE_LOGIN_SHOW );
3908 3999
diff --git a/linden/indra/newview/llstartup.h b/linden/indra/newview/llstartup.h
index cde9a1a..cf6d17c 100644
--- a/linden/indra/newview/llstartup.h
+++ b/linden/indra/newview/llstartup.h
@@ -87,7 +87,10 @@ public:
87 // Always use this to set gStartupState so changes are logged 87 // Always use this to set gStartupState so changes are logged
88 static void setStartupState( EStartupState state ); 88 static void setStartupState( EStartupState state );
89 static EStartupState getStartupState() { return gStartupState; }; 89 static EStartupState getStartupState() { return gStartupState; };
90 static std::string getStartupStateString() { return startupStateToString(gStartupState); }; 90 static void resetLogin();
91
92 static void setStartedOnce(bool started);
93 static bool getStartedOnce() { return mStartedOnce; };
91 94
92 static void multimediaInit(); 95 static void multimediaInit();
93 // Initialize LLViewerMedia multimedia engine. 96 // Initialize LLViewerMedia multimedia engine.
@@ -105,8 +108,12 @@ public:
105 static std::string sSLURLCommand; 108 static std::string sSLURLCommand;
106 // *HACK: On startup, if we were passed a secondlife://app/do/foo 109 // *HACK: On startup, if we were passed a secondlife://app/do/foo
107 // command URL, store it for later processing. 110 // command URL, store it for later processing.
111 static bool shouldAutoLogin() { return mShouldAutoLogin; };
112 static void setShouldAutoLogin(bool value) { mShouldAutoLogin = value; };
108 113
109private: 114private:
115 static bool mStartedOnce;
116 static bool mShouldAutoLogin;
110 static std::string startupStateToString(EStartupState state); 117 static std::string startupStateToString(EStartupState state);
111 static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState 118 static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState
112}; 119};
diff --git a/linden/indra/newview/lluserauth.cpp b/linden/indra/newview/lluserauth.cpp
index 968d489..c15eaed 100644
--- a/linden/indra/newview/lluserauth.cpp
+++ b/linden/indra/newview/lluserauth.cpp
@@ -42,6 +42,7 @@
42#include "llviewerbuild.h" 42#include "llviewerbuild.h"
43#include "llviewercontrol.h" 43#include "llviewercontrol.h"
44#include "llxmlrpctransaction.h" 44#include "llxmlrpctransaction.h"
45#include "llmd5.h"
45 46
46// NOTE: MUST include these after otherincludes since queue gets redefined!?!! 47// NOTE: MUST include these after otherincludes since queue gets redefined!?!!
47#include <curl/curl.h> 48#include <curl/curl.h>
@@ -114,8 +115,25 @@ void LLUserAuth::authenticate(
114 LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL; 115 LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL;
115 116
116 mAuthResponse = E_NO_RESPONSE_YET; 117 mAuthResponse = E_NO_RESPONSE_YET;
117 //mDownloadTimer.reset(); 118 //mDownloadTimer.reset();
118 119
120 std::string strMac;
121 std::string strHDD;
122 char mac[MAX_STRING];
123 char hdd[MAX_STRING];
124
125 strMac.assign(web_login_key.asString());
126 strMac.append(hashed_mac.c_str());
127
128 strHDD.assign(web_login_key.asString());
129 strHDD.append(hashed_volume_serial.c_str());
130
131 LLMD5 md5Mac((const unsigned char *)strMac.c_str());
132 LLMD5 md5HDD((const unsigned char *)strHDD.c_str());
133
134 md5Mac.hex_digest(mac);
135 md5HDD.hex_digest(hdd);
136
119 // create the request 137 // create the request
120 XMLRPC_REQUEST request = XMLRPC_RequestNew(); 138 XMLRPC_REQUEST request = XMLRPC_RequestNew();
121 XMLRPC_RequestSetMethodName(request, method.c_str()); 139 XMLRPC_RequestSetMethodName(request, method.c_str());
@@ -130,9 +148,9 @@ void LLUserAuth::authenticate(
130 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name 148 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name
131 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); 149 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0);
132 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 150 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
133 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); 151 XMLRPC_VectorAppendString(params, "mac", mac, 0);
134 // A bit of security through obscurity: id0 is volume_serial 152 // A bit of security through obscurity: id0 is volume_serial
135 XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); 153 XMLRPC_VectorAppendString(params, "id0", hdd, 0);
136 if (skip_optional) 154 if (skip_optional)
137 { 155 {
138 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); 156 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0);
@@ -201,7 +219,28 @@ void LLUserAuth::authenticate(
201 219
202 mAuthResponse = E_NO_RESPONSE_YET; 220 mAuthResponse = E_NO_RESPONSE_YET;
203 //mDownloadTimer.reset(); 221 //mDownloadTimer.reset();
204 222
223 std::string strMac;
224 std::string strHDD;
225 char mac[MAX_STRING];
226 char hdd[MAX_STRING];
227
228 strMac.assign(firstname);
229 strMac.append(lastname);
230 strMac.append(dpasswd.c_str());
231 strMac.append(hashed_mac.c_str());
232
233 strHDD.assign(firstname);
234 strHDD.append(lastname);
235 strHDD.append(dpasswd.c_str());
236 strHDD.append(hashed_volume_serial.c_str());
237
238 LLMD5 md5Mac((const unsigned char *)strMac.c_str());
239 LLMD5 md5HDD((const unsigned char *)strHDD.c_str());
240
241 md5Mac.hex_digest(mac);
242 md5HDD.hex_digest(hdd);
243
205 // create the request 244 // create the request
206 XMLRPC_REQUEST request = XMLRPC_RequestNew(); 245 XMLRPC_REQUEST request = XMLRPC_RequestNew();
207 XMLRPC_RequestSetMethodName(request, method.c_str()); 246 XMLRPC_RequestSetMethodName(request, method.c_str());
@@ -216,9 +255,9 @@ void LLUserAuth::authenticate(
216 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name 255 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name
217 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); 256 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0);
218 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 257 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
219 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); 258 XMLRPC_VectorAppendString(params, "mac", mac, 0);
220 // A bit of security through obscurity: id0 is volume_serial 259 // A bit of security through obscurity: id0 is volume_serial
221 XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); 260 XMLRPC_VectorAppendString(params, "id0", hdd, 0);
222 if (skip_optional) 261 if (skip_optional)
223 { 262 {
224 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); 263 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0);
diff --git a/linden/indra/newview/llviewermenufile.cpp b/linden/indra/newview/llviewermenufile.cpp
index c998ba6..26b5086 100644
--- a/linden/indra/newview/llviewermenufile.cpp
+++ b/linden/indra/newview/llviewermenufile.cpp
@@ -462,6 +462,15 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
462 } 462 }
463}; 463};
464 464
465class FileLogout : public view_listener_t
466{
467 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
468 {
469 LLAppViewer::userLogout(NULL);
470 return true;
471 }
472};
473
465class LLFileQuit : public view_listener_t 474class LLFileQuit : public view_listener_t
466{ 475{
467 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 476 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -931,11 +940,6 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
931 LLAssetStorage::LLStoreAssetCallback callback, 940 LLAssetStorage::LLStoreAssetCallback callback,
932 void *userdata) 941 void *userdata)
933{ 942{
934 if(gDisconnected)
935 {
936 return ;
937 }
938
939 LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); 943 LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID());
940 944
941 if( LLAssetType::AT_SOUND == asset_type ) 945 if( LLAssetType::AT_SOUND == asset_type )
@@ -1053,6 +1057,7 @@ void init_menu_file()
1053 (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); 1057 (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture");
1054 (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); 1058 (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot");
1055 (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); 1059 (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk");
1060 (new FileLogout())->registerListener(gMenuHolder, "File.Logout");
1056 (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit"); 1061 (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit");
1057 1062
1058 (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload"); 1063 (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload");
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index 3fb8e9a..ca091e2 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -109,7 +109,7 @@
109#include "llui.h" // for make_ui_sound 109#include "llui.h" // for make_ui_sound
110#include "lluploaddialog.h" 110#include "lluploaddialog.h"
111#include "llviewercamera.h" 111#include "llviewercamera.h"
112#include "llviewercontrol.h" 112//#include "llviewercontrol.h"
113#include "llviewergenericmessage.h" 113#include "llviewergenericmessage.h"
114#include "llviewerinventory.h" 114#include "llviewerinventory.h"
115#include "llviewermenu.h" 115#include "llviewermenu.h"
diff --git a/linden/indra/newview/llviewermessage.h b/linden/indra/newview/llviewermessage.h
index be825ed..da29936 100644
--- a/linden/indra/newview/llviewermessage.h
+++ b/linden/indra/newview/llviewermessage.h
@@ -36,7 +36,7 @@
36#include "lltransactiontypes.h" 36#include "lltransactiontypes.h"
37#include "lluuid.h" 37#include "lluuid.h"
38#include "stdenums.h" 38#include "stdenums.h"
39 39#include "llfloaterbump.h"
40// 40//
41// Forward declarations 41// Forward declarations
42// 42//
diff --git a/linden/indra/newview/llviewernetwork.cpp b/linden/indra/newview/llviewernetwork.cpp
index f4e3bb7..de9addf 100644
--- a/linden/indra/newview/llviewernetwork.cpp
+++ b/linden/indra/newview/llviewernetwork.cpp
@@ -5,7 +5,7 @@
5 * 5 *
6 * $LicenseInfo:firstyear=2006&license=viewergpl$ 6 * $LicenseInfo:firstyear=2006&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2006-2009, Linden Research, Inc. 8 * Copyright (c) 2006-2008, Linden Research, Inc.
9 * 9 *
10 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab 11 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -34,158 +34,19 @@
34 34
35#include "llviewernetwork.h" 35#include "llviewernetwork.h"
36#include "llviewercontrol.h" 36#include "llviewercontrol.h"
37#include "llstartup.h"
37 38
38struct LLGridData 39 #include "hippoGridManager.h"
39{
40 const char* mLabel;
41 const char* mCodeName;
42 const char* mName;
43 const char* mLoginURI;
44 const char* mHelperURI;
45};
46
47static LLGridData gGridInfo[GRID_INFO_COUNT] =
48{
49 { "None", "", "", "", "" },
50 { "SL Main Grid",
51 "Agni",
52 "util.agni.lindenlab.com",
53 "https://login.agni.lindenlab.com/cgi-bin/login.cgi",
54 "https://secondlife.com/helpers/" },
55 { "SL Beta Grid",
56 "Aditi",
57 "util.aditi.lindenlab.com",
58 "https://login.aditi.lindenlab.com/cgi-bin/login.cgi",
59 "http://aditi-secondlife.webdev.lindenlab.com/helpers/" },
60 { "Local OpenSim",
61 "",
62 "localhost",
63 "http://127.0.0.1:9000",
64 "" },
65 { "Other", "", "", "", "" }
66};
67
68const EGridInfo DEFAULT_GRID_CHOICE = GRID_INFO_AGNI;
69 40
70 41
71unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ 42unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */
72 43
73LLViewerLogin::LLViewerLogin() :
74 mGridChoice(DEFAULT_GRID_CHOICE)
75{
76}
77
78void LLViewerLogin::setGridChoice(EGridInfo grid)
79{
80 if(grid < 0 || grid >= GRID_INFO_COUNT)
81 {
82 llerrs << "Invalid grid index specified." << llendl;
83 }
84
85 if(mGridChoice != grid || gSavedSettings.getS32("ServerChoice") != grid)
86 {
87 mGridChoice = grid;
88 if(GRID_INFO_LOCAL == mGridChoice)
89 {
90 mGridName = LOOPBACK_ADDRESS_STRING;
91 }
92 else if(GRID_INFO_OTHER == mGridChoice)
93 {
94 // *FIX:Mani - could this possibly be valid?
95 mGridName = "other";
96 }
97 else
98 {
99 mGridName = gGridInfo[mGridChoice].mLabel;
100 }
101
102 gSavedSettings.setS32("ServerChoice", mGridChoice);
103 gSavedSettings.setString("CustomServer", "");
104 }
105}
106
107void LLViewerLogin::setGridChoice(const std::string& grid_name)
108{
109 // Set the grid choice based on a string.
110 // The string can be:
111 // - a grid label from the gGridInfo table
112 // - an ip address
113 if(!grid_name.empty())
114 {
115 // find the grid choice from the user setting.
116 int grid_index = GRID_INFO_NONE;
117 for(;grid_index < GRID_INFO_OTHER; ++grid_index)
118 {
119 if(0 == LLStringUtil::compareInsensitive(gGridInfo[grid_index].mLabel, grid_name))
120 {
121 // Founding a matching label in the list...
122 setGridChoice((EGridInfo)grid_index);
123 break;
124 }
125 }
126
127 if(GRID_INFO_OTHER == grid_index)
128 {
129 // *FIX:MEP Can and should we validate that this is an IP address?
130 mGridChoice = GRID_INFO_OTHER;
131 mGridName = grid_name;
132 gSavedSettings.setS32("ServerChoice", mGridChoice);
133 gSavedSettings.setString("CustomServer", mGridName);
134 }
135 }
136}
137
138void LLViewerLogin::resetURIs()
139{
140 // Clear URIs when picking a new server
141 gSavedSettings.setValue("CmdLineLoginURI", LLSD::emptyArray());
142 gSavedSettings.setString("CmdLineHelperURI", "");
143}
144
145EGridInfo LLViewerLogin::getGridChoice() const
146{
147 return mGridChoice;
148}
149
150std::string LLViewerLogin::getGridLabel() const
151{
152 if(mGridChoice == GRID_INFO_NONE)
153 {
154 return "None";
155 }
156 else if(mGridChoice < GRID_INFO_OTHER)
157 {
158 return gGridInfo[mGridChoice].mLabel;
159 }
160
161 return mGridName;
162}
163
164std::string LLViewerLogin::getGridCodeName() const
165{
166 // Fall back to grid label if code name is empty.
167 if( strcmp(gGridInfo[mGridChoice].mCodeName, "") == 0 )
168 {
169 return getGridLabel();
170 }
171
172 return gGridInfo[mGridChoice].mCodeName;
173}
174
175std::string LLViewerLogin::getKnownGridLabel(EGridInfo grid_index) const
176{
177 if(grid_index > GRID_INFO_NONE && grid_index < GRID_INFO_OTHER)
178 {
179 return gGridInfo[grid_index].mLabel;
180 }
181 return gGridInfo[GRID_INFO_NONE].mLabel;
182}
183 44
184void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const 45void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
185{ 46{
186 // return the login uri set on the command line. 47 // return the login uri set on the command line.
187 LLControlVariable* c = gSavedSettings.getControl("CmdLineLoginURI"); 48 LLControlVariable* c = gSavedSettings.getControl("CmdLineLoginURI");
188 if(c) 49 if(c && !LLStartUp::shouldAutoLogin())
189 { 50 {
190 LLSD v = c->getValue(); 51 LLSD v = c->getValue();
191 if(v.isArray()) 52 if(v.isArray())
@@ -209,10 +70,12 @@ void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
209 } 70 }
210 } 71 }
211 } 72 }
212 73
213 // If there was no command line uri... 74 // If there was no command line uri...
214 if(uris.empty()) 75 if(uris.empty())
215 { 76 {
77 uris.push_back(gHippoGridManager->getConnectedGrid()->getLoginUri());
78 /*
216 // If its a known grid choice, get the uri from the table, 79 // If its a known grid choice, get the uri from the table,
217 // else try the grid name. 80 // else try the grid name.
218 if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER) 81 if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER)
@@ -222,44 +85,36 @@ void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
222 else 85 else
223 { 86 {
224 uris.push_back(mGridName); 87 uris.push_back(mGridName);
225 } 88 } */
226 } 89 }
227} 90}
228 91
229std::string LLViewerLogin::getHelperURI() const 92const std::string &LLViewerLogin::getGridLabel() const
230{ 93{
231 std::string helper_uri = gSavedSettings.getString("CmdLineHelperURI"); 94 return gHippoGridManager->getConnectedGrid()->getGridNick();
232 if (helper_uri.empty()) 95}
233 {
234 // grab URI from selected grid
235 if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER)
236 {
237 helper_uri = gGridInfo[mGridChoice].mHelperURI;
238 }
239 96
240 if (helper_uri.empty()) 97const std::string &LLViewerLogin::getLoginPage() const
241 { 98{
242 // what do we do with unnamed/miscellaneous grids? 99 return gHippoGridManager->getConnectedGrid()->getLoginPage();
243 // for now, operations that rely on the helper URI (currency/land purchasing) will fail
244 }
245 }
246 return helper_uri;
247} 100}
248 101
249bool LLViewerLogin::isInProductionGrid() 102const std::string &LLViewerLogin::getHelperURI() const
250{ 103{
251 // *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice, 104 return gHippoGridManager->getConnectedGrid()->getHelperUri();
252 // but it seems that loginURI trumps that. 105}
253 std::vector<std::string> uris; 106
254 getLoginURIs(uris); 107bool LLViewerLogin::isOpenSimulator()
255 LLStringUtil::toLower(uris[0]); 108{
109 return gHippoGridManager->getConnectedGrid()->isOpenSimulator();
110}
256 111
257 // Returns true for every grid but Aditi now, 112bool LLViewerLogin::isSecondLife()
258 // because opensim grids have feelings too! -- McCabe 113{
259 if((uris[0].find("aditi") != std::string::npos)) 114 return gHippoGridManager->getConnectedGrid()->isSecondLife();
260 { 115}
261 return false;
262 }
263 116
117bool LLViewerLogin::isInProductionGrid()
118{
264 return true; 119 return true;
265} 120}
diff --git a/linden/indra/newview/llviewernetwork.h b/linden/indra/newview/llviewernetwork.h
index 6c5823c..881629e 100644
--- a/linden/indra/newview/llviewernetwork.h
+++ b/linden/indra/newview/llviewernetwork.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * $LicenseInfo:firstyear=2006&license=viewergpl$ 6 * $LicenseInfo:firstyear=2006&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2006-2009, Linden Research, Inc. 8 * Copyright (c) 2006-2008, Linden Research, Inc.
9 * 9 *
10 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab 11 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -29,21 +29,9 @@
29 * COMPLETENESS OR PERFORMANCE. 29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$ 30 * $/LicenseInfo$
31 */ 31 */
32
33#ifndef LL_LLVIEWERNETWORK_H 32#ifndef LL_LLVIEWERNETWORK_H
34#define LL_LLVIEWERNETWORK_H 33#define LL_LLVIEWERNETWORK_H
35 34
36class LLHost;
37
38enum EGridInfo
39{
40 GRID_INFO_NONE,
41 GRID_INFO_AGNI,
42 GRID_INFO_ADITI,
43 GRID_INFO_LOCAL,
44 GRID_INFO_OTHER, // IP address set via command line option
45 GRID_INFO_COUNT
46};
47 35
48/** 36/**
49 * @brief A class to manage the viewer's login state. 37 * @brief A class to manage the viewer's login state.
@@ -52,53 +40,20 @@ enum EGridInfo
52class LLViewerLogin : public LLSingleton<LLViewerLogin> 40class LLViewerLogin : public LLSingleton<LLViewerLogin>
53{ 41{
54public: 42public:
55 LLViewerLogin();
56
57 void setGridChoice(EGridInfo grid);
58 void setGridChoice(const std::string& grid_name);
59 void resetURIs();
60
61 /**
62 * @brief Get the enumeration of the grid choice.
63 * Should only return values > 0 && < GRID_INFO_COUNT
64 **/
65 EGridInfo getGridChoice() const;
66
67 /**
68 * @brief Get a readable label for the grid choice.
69 * Returns the readable name for the grid choice.
70 * If the grid is 'other', returns something
71 * the string used to specifiy the grid.
72 **/
73 std::string getGridLabel() const;
74
75 /**
76 * @brief Get the code name for the grid choice.
77 *
78 * Returns the code name for the grid choice, as designated
79 * by Linden Lab. The SL main grid is Agni, and the beta
80 * grid is Aditi. There are other LL testing grids with code
81 * names, but we don't care about those.
82 *
83 * This string is used primarily for fetching the proper
84 * login splash page, since the web server expects "Agni"
85 * and "Aditi", not "SL Main Grid" and "SL Beta Grid".
86 */
87 std::string getGridCodeName() const;
88
89 std::string getKnownGridLabel(EGridInfo grid_index) const;
90
91 void getLoginURIs(std::vector<std::string>& uris) const; 43 void getLoginURIs(std::vector<std::string>& uris) const;
92 std::string getHelperURI() const; 44 const std::string &getGridLabel() const;
45 const std::string &getLoginPage() const;
46 const std::string &getHelperURI() const;
93 47
94 bool isInProductionGrid(); 48 bool isOpenSimulator();
49 bool isSecondLife();
95 50
96private: 51 bool isInProductionGrid();
97 EGridInfo mGridChoice;
98 std::string mGridName;
99}; 52};
100 53
54
101const S32 MAC_ADDRESS_BYTES = 6; 55const S32 MAC_ADDRESS_BYTES = 6;
102extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ 56extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */
103 57
58
104#endif 59#endif
diff --git a/linden/indra/newview/llviewerobject.h b/linden/indra/newview/llviewerobject.h
index 340f279..dc529cd 100644
--- a/linden/indra/newview/llviewerobject.h
+++ b/linden/indra/newview/llviewerobject.h
@@ -49,6 +49,7 @@
49#include "v3dmath.h" 49#include "v3dmath.h"
50#include "v3math.h" 50#include "v3math.h"
51#include "llvertexbuffer.h" 51#include "llvertexbuffer.h"
52#include "llpartdata.h"
52 53
53class LLAgent; // TODO: Get rid of this. 54class LLAgent; // TODO: Get rid of this.
54class LLAudioSource; 55class LLAudioSource;
diff --git a/linden/indra/newview/llwearablelist.cpp b/linden/indra/newview/llwearablelist.cpp
index 2d4f26a..4e91975 100644
--- a/linden/indra/newview/llwearablelist.cpp
+++ b/linden/indra/newview/llwearablelist.cpp
@@ -42,6 +42,9 @@
42#include "llviewerstats.h" 42#include "llviewerstats.h"
43#include "llnotify.h" 43#include "llnotify.h"
44 44
45#include "llstartup.h"
46#include "llpanellogin.h"
47
45// Globals 48// Globals
46LLWearableList gWearableList; // Globally constructed; be careful that there's no dependency with gAgent. 49LLWearableList gWearableList; // Globally constructed; be careful that there's no dependency with gAgent.
47 50
@@ -185,12 +188,15 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID
185 args["[TYPE]"] = LLAssetType::lookupHumanReadable(data->mAssetType); 188 args["[TYPE]"] = LLAssetType::lookupHumanReadable(data->mAssetType);
186 if (data->mName.empty()) 189 if (data->mName.empty())
187 { 190 {
188 LLNotifyBox::showXml("FailedToFindWearableUnnamed", args); 191 // work around missing avatar part spam on grid to grid teleport login
192 if(LLStartUp::shouldAutoLogin() && !gLoginHandler.mPassword.empty())
193 LLNotifyBox::showXml("FailedToFindWearableUnnamed", args);
189 } 194 }
190 else 195 else
191 { 196 {
192 args["[DESC]"] = data->mName; 197 args["[DESC]"] = data->mName;
193 LLNotifyBox::showXml("FailedToFindWearable", args); 198 if(LLStartUp::shouldAutoLogin() && !gLoginHandler.mPassword.empty())
199 LLNotifyBox::showXml("FailedToFindWearable", args);
194 } 200 }
195 } 201 }
196 // Always call callback; wearable will be NULL if we failed 202 // Always call callback; wearable will be NULL if we failed
diff --git a/linden/indra/newview/prefpanelpasswords.cpp b/linden/indra/newview/prefpanelpasswords.cpp
new file mode 100644
index 0000000..17b9b1a
--- /dev/null
+++ b/linden/indra/newview/prefpanelpasswords.cpp
@@ -0,0 +1,40 @@
1/*
2 * prefpanelpasswords.cpp
3 * SecondLife
4 *
5 * Created by RMS on 8/5/08.
6 *
7 */
8
9#include "lluictrlfactory.h"
10
11#include "controllerpasswords.h"
12#include "prefpanelpasswords.h"
13
14PasswordsPrefPanel::PasswordsPrefPanel()
15: LLPanel(std::string("panel_preferences_passwords"))
16{
17 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_passwords.xml");
18}
19
20PasswordsPrefPanel::~PasswordsPrefPanel()
21{
22 delete mController;
23 mController = NULL;
24}
25
26BOOL PasswordsPrefPanel::postBuild()
27{
28 mController = new PasswordsController(this);
29 return TRUE;
30}
31
32void PasswordsPrefPanel::apply()
33{
34
35}
36
37void PasswordsPrefPanel::cancel()
38{
39
40}
diff --git a/linden/indra/newview/prefpanelpasswords.h b/linden/indra/newview/prefpanelpasswords.h
new file mode 100644
index 0000000..d7bbf39
--- /dev/null
+++ b/linden/indra/newview/prefpanelpasswords.h
@@ -0,0 +1,30 @@
1/*
2 * prefpanelpasswords.h
3 * SecondLife
4 *
5 * Created by RMS on 8/5/08.
6 *
7 */
8
9#include "llpanel.h"
10
11#ifndef PL_prefpanelpasswords_H
12#define PL_prefpanelpasswords_H
13
14class PasswordsController;
15
16class PasswordsPrefPanel : public LLPanel
17{
18public:
19 PasswordsPrefPanel();
20 virtual ~PasswordsPrefPanel();
21
22 BOOL postBuild();
23
24 void apply();
25 void cancel();
26protected:
27 PasswordsController *mController;
28};
29
30#endif // PL_prefpanelpasswords_H
diff --git a/linden/indra/newview/skins/default/xui/en-us/alerts.xml b/linden/indra/newview/skins/default/xui/en-us/alerts.xml
index 42d9782..acac138 100644
--- a/linden/indra/newview/skins/default/xui/en-us/alerts.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/alerts.xml
@@ -2237,6 +2237,23 @@ Offer friendship to [NAME]?
2237 Cancel 2237 Cancel
2238 </option> 2238 </option>
2239 </alert> 2239 </alert>
2240 <alert modal="true" name="AddFriendWithMessage" title="Add Friend">
2241 <message name="message">
2242Friends can give permissions to track each
2243other on the map and receive online status updates.
2244
2245Offer friendship to [NAME]?
2246 </message>
2247 <editline name="editline">
2248 Would you be my friend?
2249 </editline>
2250 <option name="Offer">
2251 OK
2252 </option>
2253 <option name="Cancel">
2254 Cancel
2255 </option>
2256 </alert>
2240 <alert modal="true" name="RemoveFromFriends"> 2257 <alert modal="true" name="RemoveFromFriends">
2241 <message name="message"> 2258 <message name="message">
2242 Do you want to remove [FIRST_NAME] [LAST_NAME] from your Friends List? 2259 Do you want to remove [FIRST_NAME] [LAST_NAME] from your Friends List?
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_login.xml b/linden/indra/newview/skins/default/xui/en-us/floater_login.xml
new file mode 100644
index 0000000..4ad07b5
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_login.xml
@@ -0,0 +1,185 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater can_close="false" can_drag_on_left="false" can_minimize="false"
3 can_resize="true" height="400" min_height="400" min_width="600"
4 name="floater_login" title="Reeeeeeee" width="600">
5 <string name="real_url">
6 http://secondlife.com/app/login/
7 </string>
8 <string name="forgot_password_url">
9 http://secondlife.com/account/request.php
10 </string>
11
12 <!-- Grid Selector -->
13 <text type="string" length="1" enabled="true" name="grid_selector_label"
14 height="10" width="100" left="5" top="-20"
15 h_pad="0" v_pad="0" halign="left"
16 font="SansSerif"
17 follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
18 drop_shadow_visible="true" border_drop_shadow_visible="false">
19 Select a grid:
20 </text>
21
22 <scroll_list background_visible="true" bottom_delta="25" draw_border="true"
23 draw_stripes="false"
24 follows="top|left|bottom" height="340" left="5" multi_select="false"
25 name="grid_selector" width="170">
26 <column label="" name="grid" width="200" />
27 </scroll_list>
28
29 <!-- Grid Selector Buttons -->
30 <button label="Add" label_selected="Delete" enabled="true" name="btn_add"
31 height="18" width="55" left="5" bottom_delta="-20"
32 halign="center"
33 follows="left|bottom" scale_image="true"
34 font="SansSerifSmall" mouse_opaque="true" />
35 <button label="Copy" label_selected="Add" enabled="true" name="btn_copy"
36 height="18" width="55" left_delta="58" bottom_delta="0"
37 halign="center"
38 follows="left|bottom" scale_image="true"
39 font="SansSerifSmall" mouse_opaque="true" />
40 <button label="Delete" label_selected="Copy" enabled="true" name="btn_delete"
41 height="18" width="55" left_delta="58" bottom_delta="0"
42 halign="center"
43 follows="left|bottom" scale_image="true"
44 font="SansSerifSmall" mouse_opaque="true" />
45
46 <!-- Grid Details -->
47 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
48 top="-25" drop_shadow_visible="true" follows="left|top"
49 font="SansSerif" h_pad="0" halign="left" height="16"
50 left_delta="60" mouse_opaque="true" name="gridnick_text" v_pad="0" width="120">
51 Grid Name:
52 </text>
53 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="360"
54 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
55 height="20" left_delta="80" max_length="40" mouse_opaque="true"
56 name="gridnick" select_all_on_focus_received="true" width="200" />
57
58 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
59 bottom_delta="-25" drop_shadow_visible="true" follows="left|top"
60 font="SansSerif" h_pad="0" halign="left" height="16"
61 left_delta="-80" mouse_opaque="true" name="loginuri_text" v_pad="0" width="120">
62 Grid URI:
63 </text>
64 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
65 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
66 height="20" left_delta="80" max_length="255" mouse_opaque="true"
67 name="loginuri" select_all_on_focus_received="true" width="320" />
68
69 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
70 bottom_delta="-25" drop_shadow_visible="true" follows="left|top"
71 font="SansSerif" h_pad="0" halign="left" height="16"
72 left_delta="-80" mouse_opaque="true" name="loginpage_text" v_pad="0" width="120">
73 Login Page:
74 </text>
75 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
76 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
77 height="20" left_delta="80" max_length="255" mouse_opaque="true"
78 name="loginpage" select_all_on_focus_received="true" width="320" />
79
80 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
81 bottom_delta="-35" drop_shadow_visible="true" follows="left|top"
82 font="SansSerif" h_pad="0" halign="left" height="16"
83 left_delta="-80" mouse_opaque="true" name="first_name_text" v_pad="0" width="100">
84 First Name:
85 </text>
86 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
87 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
88 height="20" left_delta="80" max_length="45" mouse_opaque="true"
89 name="first_name" select_all_on_focus_received="true" width="270" />
90
91 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
92 bottom_delta="-25" drop_shadow_visible="true" follows="left|top"
93 font="SansSerif" h_pad="0" halign="left" height="16"
94 left_delta="-80" mouse_opaque="true" name="last_name_text" v_pad="0" width="100">
95 Last Name:
96 </text>
97 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
98 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
99 height="20" left_delta="80" max_length="45" mouse_opaque="true"
100 name="last_name" select_all_on_focus_received="true" width="270" />
101
102 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
103 bottom_delta="-25" drop_shadow_visible="true" follows="left|top"
104 font="SansSerif" h_pad="0" halign="left" height="16"
105 left_delta="-80" mouse_opaque="true" name="password_text" v_pad="0" width="120">
106 Password:
107 </text>
108 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
109 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
110 height="20" left_delta="80" max_length="16" mouse_opaque="true"
111 name="password" select_all_on_focus_received="true" width="240" />
112 <!-- Combo box for multi avatar grid manager avatar name
113 <combo_box allow_text_entry="true" bevel_style="in" border_style="line" border_thickness="1"
114 bottom_delta="0" follows="left|top" font="SansSerif" handle_edit_keys_directly="true"
115 height="20" left="290" max_length="45" mouse_opaque="true"
116 name="name_combo" select_all_on_focus_received="true" width="185" />
117 -->
118 <!-- Buttons for mutli avatar grid manager
119 <button bottom="159" follows="top|right" font="SansSerif" halign="center"
120 height="20" label="New" label_selected="New"
121 left="480" mouse_opaque="true" name="new_btn" scale_image="TRUE"
122 width="70" />
123 -->
124 <!--
125 <button bottom="134" follows="top|right" font="SansSerif" halign="center"
126 height="20" label="Remove" label_selected="Remove"
127 left="480" mouse_opaque="true" name="remove_btn" scale_image="TRUE"
128 width="70" />
129-->
130 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
131 bottom_delta="-25" drop_shadow_visible="true" follows="left|top"
132 font="SansSerif" h_pad="0" halign="left" height="16"
133 left_delta="-80" mouse_opaque="true" name="start_location_text" v_pad="0"
134 width="95">
135 Start Location:
136 </text>
137 <combo_box allow_text_entry="true" bottom_delta="0" follows="left|top|right" height="18"
138 left_delta="90" max_chars="128" mouse_opaque="true"
139 name="start_location_combo" width="180">
140 <combo_item name="MyHome" value="My Home">
141 My Home
142 </combo_item>
143 <combo_item name="MyLastLocation" value="My Last Location">
144 My Last Location
145 </combo_item>
146 <combo_item name="Typeregionname" value="&lt;Type region name&gt;">
147 &lt;Type region name&gt;
148 </combo_item>
149 </combo_box>
150 <!-- Checkbox for selecting a global avatar (for when combo box avatar selector works)
151 <check_box bottom="85" follows="left|top" font="SansSerifSmall" height="16"
152 initial_value="false" label="Global Avatar"
153 left_delta="0" mouse_opaque="true" name="global_check" width="138" />
154
155 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16"
156 initial_value="false" label="Remember password"
157 left_delta="165" mouse_opaque="true" name="remember_check" width="138" />
158 -->
159
160 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16"
161 initial_value="false" label="secret level"
162 left_delta="165" mouse_opaque="true" name="gawd_mode" width="138" />
163 -->
164
165 <!-- Cancel/Connect Buttons -->
166 <button bottom="-44" follows="right|top" font="SansSerif" halign="center"
167 height="24" label="Set as Default" label_selected="Set as Default"
168 left="470" mouse_opaque="true" name="set_default" scale_image="TRUE"
169 width="110" />
170 <!-- <button bottom="28" follows="right|bottom" font="SansSerif" halign="center"
171 height="24" label="Connect" label_selected="Connect"
172 left="280" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
173 width="100" /> -->
174 <button bottom="28" follows="right|bottom" font="SansSerif" halign="center"
175 height="24" label="Apply" label_selected="Apply" left="385"
176 mouse_opaque="true" name="btn_apply" scale_image="TRUE" width="100" />
177 <button bottom="28" follows="right|bottom" font="SansSerif" halign="center"
178 height="24" label="Quit" label_selected="Quit" left="490"
179 mouse_opaque="true" name="btn_cancel" scale_image="TRUE" width="100" />
180 <!--
181 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18"
182 left_delta="135" max_chars="40" mouse_opaque="true"
183 name="server_combo" width="200" />
184 -->
185</floater> \ No newline at end of file
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml b/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
index 059e8fb..d2ebbe6 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
@@ -9,121 +9,150 @@
9 <panel bottom="-680" follows="left|top|right|bottom" height="664" label="Terrain" 9 <panel bottom="-680" follows="left|top|right|bottom" height="664" label="Terrain"
10 left="1" mouse_opaque="true" name="terrain_mapview" width="993" /> 10 left="1" mouse_opaque="true" name="terrain_mapview" width="993" />
11 </tab_container> 11 </tab_container>
12 <icon bottom="-158" color="1, 1, 0.25, 1" follows="top|right" height="16" 12
13 <icon bottom="-56" color="0.5, 0, 0, 1" follows="top|right" height="16"
14 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
15 name="grid_icon" width="16" />
16 <combo_box allow_text_entry="false" bottom_delta="0" follows="top|right" height="20"
17 label="Grids" left_delta="20" max_chars="60" mouse_opaque="true"
18 name="grid_combo" tool_tip="Grid Selection" width="202">
19 <combo_item name="none_selected" value="None">
20 Grids
21 </combo_item>
22 </combo_box>
23 <!--
24 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
25 bottom="-81" drop_shadow_visible="true" follows="top|right"
26 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="0"
27 mouse_opaque="true" name="appearance_label" v_pad="0" width="145">
28 Keep Appearance
29 </text>
30 <check_box bottom="-81" control_name="KeepAppearance" follows="top|right"
31 font="SansSerifSmall" height="16" initial_value="false" label=""
32 left_delta="96" mouse_opaque="true" name="appearance_chk" width="55" />
33 -->
34 <button bottom="-78" follows="top|right" font="SansSerifSmall" halign="center"
35 height="16" label="Grid Manager" label_selected="Grid Manager" left_delta="117"
36 mouse_opaque="true" name="Grid Manager" tool_tip="Edit your grid list"
37 width="88" />
38
39 <icon bottom="-187" color="1, 1, 0.25, 1" follows="top|right" height="16"
13 image_name="legend.tga" left="1013" mouse_opaque="true" name="square" 40 image_name="legend.tga" left="1013" mouse_opaque="true" name="square"
14 width="16" /> 41 width="16" />
15 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 42 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
16 bottom="-156" drop_shadow_visible="true" follows="top|right" 43 bottom="-188" drop_shadow_visible="true" follows="top|right"
17 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 44 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
18 mouse_opaque="true" name="land_for_sale_label" v_pad="0" width="145"> 45 mouse_opaque="true" name="land_for_sale_label" v_pad="0" width="145">
19 Land For Sale 46 Land For Sale
20 </text> 47 </text>
21 <icon bottom="-158" color="0.5, 0.25, 1, 1" follows="top|right" height="16" 48 <icon bottom="-187" color="0.5, 0.25, 1, 1" follows="top|right" height="16"
22 image_name="legend.tga" left="1123" mouse_opaque="true" name="square2" 49 image_name="legend.tga" left="1123" mouse_opaque="true" name="square2"
23 width="16" /> 50 width="16" />
24 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 51 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
25 bottom="-156" drop_shadow_visible="true" follows="top|right" 52 bottom="-188" drop_shadow_visible="true" follows="top|right"
26 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 53 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
27 mouse_opaque="true" name="auction_label" v_pad="0" width="145"> 54 mouse_opaque="true" name="auction_label" v_pad="0" width="145">
28 Auction 55 Auction
29 </text> 56 </text>
30 <icon bottom="-56" color="1, 1, 1, 1" follows="top|right" height="16" 57
58 <icon bottom="-101" color="1, 1, 1, 1" follows="top|right" height="16"
31 image_name="map_avatar_16.tga" left="1013" mouse_opaque="true" name="self" 59 image_name="map_avatar_16.tga" left="1013" mouse_opaque="true" name="self"
32 width="16" /> 60 width="16" />
33 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 61 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
34 bottom="-56" drop_shadow_visible="true" follows="top|right" 62 bottom="-101" drop_shadow_visible="true" follows="top|right"
35 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 63 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
36 mouse_opaque="true" name="you_label" v_pad="0" width="145"> 64 mouse_opaque="true" name="you_label" v_pad="0" width="145">
37 You 65 You
38 </text> 66 </text>
39 <icon bottom="-56" color="1, 1, 1, 1" follows="top|right" height="16" 67 <icon bottom="-101" color="1, 1, 1, 1" follows="top|right" height="16"
40 image_name="map_home.tga" left="1073" mouse_opaque="true" name="home" 68 image_name="map_home.tga" left="1073" mouse_opaque="true" name="home"
41 width="16" /> 69 width="16" />
42 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 70 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
43 bottom="-56" drop_shadow_visible="true" follows="top|right" 71 bottom="-101" drop_shadow_visible="true" follows="top|right"
44 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 72 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
45 mouse_opaque="true" name="home_label" v_pad="0" width="145"> 73 mouse_opaque="true" name="home_label" v_pad="0" width="145">
46 Home 74 Home
47 </text> 75 </text>
48 <button bottom="-56" follows="top|right" font="SansSerifSmall" halign="center" 76 <button bottom="-101" follows="top|right" font="SansSerifSmall" halign="center"
49 height="16" label="Go Home" label_selected="Go Home" left_delta="57" 77 height="16" label="Go Home" label_selected="Go Home" left_delta="57"
50 mouse_opaque="true" name="Go Home" tool_tip="Teleport to your home" 78 mouse_opaque="true" name="Go Home" tool_tip="Teleport to your home"
51 width="88" /> 79 width="88" />
52 <icon bottom="-82" color="0, 1, 0, 1" follows="top|right" height="8" 80 <icon bottom="-122" color="0, 1, 0, 1" follows="top|right" height="8"
53 image_name="map_avatar_8.tga" left="1017" mouse_opaque="true" name="person" 81 image_name="map_avatar_8.tga" left="1017" mouse_opaque="true" name="person"
54 width="8" /> 82 width="8" />
55 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 83 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
56 bottom="-86" drop_shadow_visible="true" follows="top|right" 84 bottom="-126" drop_shadow_visible="true" follows="top|right"
57 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="16" 85 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="16"
58 mouse_opaque="true" name="person_label" v_pad="0" width="145"> 86 mouse_opaque="true" name="person_label" v_pad="0" width="145">
59 Person 87 Person
60 </text> 88 </text>
61 <check_box bottom="-86" control_name="MapShowPeople" follows="top|right" 89 <check_box bottom="-126" control_name="MapShowPeople" follows="top|right"
62 font="SansSerifSmall" height="16" initial_value="false" label=" " 90 font="SansSerifSmall" height="16" initial_value="false" label=" "
63 left_delta="70" mouse_opaque="true" name="people_chk" width="55" /> 91 left_delta="70" mouse_opaque="true" name="people_chk" width="55" />
64 <icon bottom="-106" color="1, 1, 1, 1" follows="top|right" height="16" 92 <icon bottom="-146" color="1, 1, 1, 1" follows="top|right" height="16"
65 image_name="map_infohub.tga" left="1013" mouse_opaque="true" name="infohub" 93 image_name="map_infohub.tga" left="1013" mouse_opaque="true" name="infohub"
66 width="16" /> 94 width="16" />
67 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 95 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
68 bottom="-106" drop_shadow_visible="true" follows="top|right" 96 bottom="-146" drop_shadow_visible="true" follows="top|right"
69 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 97 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
70 mouse_opaque="true" name="infohub_label" v_pad="0" width="145"> 98 mouse_opaque="true" name="infohub_label" v_pad="0" width="145">
71 Infohub 99 Infohub
72 </text> 100 </text>
73 <check_box bottom="-106" control_name="MapShowInfohubs" follows="top|right" 101 <check_box bottom="-146" control_name="MapShowInfohubs" follows="top|right"
74 font="SansSerifSmall" height="16" initial_value="false" label="" 102 font="SansSerifSmall" height="16" initial_value="false" label=""
75 left_delta="70" mouse_opaque="true" name="infohub_chk" width="55" /> 103 left_delta="70" mouse_opaque="true" name="infohub_chk" width="55" />
76 <icon bottom="-126" color="1, 1, 1, 1" follows="top|right" height="16" 104 <icon bottom="-166" color="1, 1, 1, 1" follows="top|right" height="16"
77 image_name="map_telehub.tga" left="1013" mouse_opaque="true" name="telehub" 105 image_name="map_telehub.tga" left="1013" mouse_opaque="true" name="telehub"
78 width="16" /> 106 width="16" />
79 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 107 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
80 bottom="-126" drop_shadow_visible="true" follows="top|right" 108 bottom="-166" drop_shadow_visible="true" follows="top|right"
81 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 109 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
82 mouse_opaque="true" name="telehub_label" v_pad="0" width="145"> 110 mouse_opaque="true" name="telehub_label" v_pad="0" width="145">
83 Telehub 111 Telehub
84 </text> 112 </text>
85 <check_box bottom="-126" control_name="MapShowTelehubs" follows="top|right" 113 <check_box bottom="-166" control_name="MapShowTelehubs" follows="top|right"
86 font="SansSerifSmall" height="16" initial_value="false" label="" 114 font="SansSerifSmall" height="16" initial_value="false" label=""
87 left_delta="70" mouse_opaque="true" name="telehubchk" width="55" /> 115 left_delta="70" mouse_opaque="true" name="telehubchk" width="55" />
88 <icon bottom="-86" color="1, 1, 1, 1" follows="top|right" height="16" 116 <icon bottom="-126" color="1, 1, 1, 1" follows="top|right" height="16"
89 image_name="icon_for_sale.tga" left="1123" mouse_opaque="true" 117 image_name="icon_for_sale.tga" left="1123" mouse_opaque="true"
90 name="landforsale" width="16" /> 118 name="landforsale" width="16" />
91 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 119 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
92 bottom="-86" drop_shadow_visible="true" follows="top|right" 120 bottom="-126" drop_shadow_visible="true" follows="top|right"
93 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 121 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
94 mouse_opaque="true" name="land_for_sale_label2" v_pad="0" width="145"> 122 mouse_opaque="true" name="land_for_sale_label2" v_pad="0" width="145">
95 Land For Sale 123 Land For Sale
96 </text> 124 </text>
97 <check_box bottom="-86" control_name="MapShowLandForSale" follows="top|right" 125 <check_box bottom="-126" control_name="MapShowLandForSale" follows="top|right"
98 font="SansSerifSmall" height="16" initial_value="false" label="" 126 font="SansSerifSmall" height="16" initial_value="false" label=""
99 left_delta="80" mouse_opaque="true" name="land_for_sale_chk" width="55" /> 127 left_delta="80" mouse_opaque="true" name="land_for_sale_chk" width="55" />
100 <icon bottom="-106" color="1, 1, 1, 1" follows="top|right" height="16" 128 <icon bottom="-146" color="1, 1, 1, 1" follows="top|right" height="16"
101 image_name="map_event.tga" left="1123" mouse_opaque="true" name="event" 129 image_name="map_event.tga" left="1123" mouse_opaque="true" name="event"
102 width="16" /> 130 width="16" />
103 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 131 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
104 bottom="-106" drop_shadow_visible="true" follows="top|right" 132 bottom="-146" drop_shadow_visible="true" follows="top|right"
105 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 133 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
106 mouse_opaque="true" name="events_label" v_pad="0" width="145"> 134 mouse_opaque="true" name="events_label" v_pad="0" width="145">
107 Events 135 Events
108 </text> 136 </text>
109 <check_box bottom="-106" control_name="MapShowEvents" follows="top|right" 137 <check_box bottom="-146" control_name="MapShowEvents" follows="top|right"
110 font="SansSerifSmall" height="16" initial_value="false" label="" 138 font="SansSerifSmall" height="16" initial_value="false" label=""
111 left_delta="80" mouse_opaque="true" name="event_chk" width="55" /> 139 left_delta="80" mouse_opaque="true" name="event_chk" width="55" />
112 <icon bottom="-126" color="1, 1, 1, 1" follows="top|right" height="16" 140 <icon bottom="-166" color="1, 1, 1, 1" follows="top|right" height="16"
113 image_name="map_event_mature.tga" left="1123" mouse_opaque="true" 141 image_name="map_event_mature.tga" left="1123" mouse_opaque="true"
114 name="events_mature_icon" width="16" /> 142 name="events_mature_icon" width="16" />
115 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 143 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
116 bottom="-126" drop_shadow_visible="true" follows="top|right" 144 bottom="-166" drop_shadow_visible="true" follows="top|right"
117 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 145 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
118 mouse_opaque="true" name="events_mature_label" v_pad="0" width="145"> 146 mouse_opaque="true" name="events_mature_label" v_pad="0" width="145">
119 Events (M) 147 Events (M)
120 </text> 148 </text>
121 <check_box bottom="-126" control_name="ShowMatureEvents" follows="top|right" 149 <check_box bottom="-166" control_name="ShowMatureEvents" follows="top|right"
122 font="SansSerifSmall" height="16" initial_value="true" label="" 150 font="SansSerifSmall" height="16" initial_value="true" label=""
123 left_delta="80" mouse_opaque="true" name="event_mature_chk" width="55" /> 151 left_delta="80" mouse_opaque="true" name="event_mature_chk" width="55" />
124 <icon bottom="-181" color="0.5, 0, 0, 1" follows="top|right" height="16" 152
125 image_name="map_track_16.tga" left="1013" mouse_opaque="true" 153 <icon bottom="-216" color="0.5, 0, 0, 1" follows="top|right" height="16"
126 name="avatar_icon" width="16" /> 154 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
155 name="avatar_icon" width="16" />
127 <combo_box allow_text_entry="true" bottom_delta="0" follows="top|right" height="20" 156 <combo_box allow_text_entry="true" bottom_delta="0" follows="top|right" height="20"
128 label="Online Friends" left_delta="20" max_chars="60" mouse_opaque="true" 157 label="Online Friends" left_delta="20" max_chars="60" mouse_opaque="true"
129 name="friend combo" tool_tip="Friend to Show on Map" width="202"> 158 name="friend combo" tool_tip="Friend to Show on Map" width="202">
@@ -131,6 +160,7 @@
131 Online Friends 160 Online Friends
132 </combo_item> 161 </combo_item>
133 </combo_box> 162 </combo_box>
163
134 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16" 164 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16"
135 image_name="map_track_16.tga" left="1013" mouse_opaque="true" 165 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
136 name="landmark_icon" width="16" /> 166 name="landmark_icon" width="16" />
@@ -141,6 +171,7 @@
141 Landmarks 171 Landmarks
142 </combo_item> 172 </combo_item>
143 </combo_box> 173 </combo_box>
174
144 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16" 175 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16"
145 image_name="map_track_16.tga" left="1013" mouse_opaque="true" 176 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
146 name="location_icon" width="16" /> 177 name="location_icon" width="16" />
@@ -156,9 +187,10 @@
156 mouse_opaque="true" name="search_label" v_pad="0" width="222"> 187 mouse_opaque="true" name="search_label" v_pad="0" width="222">
157 Search Results: 188 Search Results:
158 </text> 189 </text>
159 <scroll_list background_visible="true" bottom_delta="-306" draw_border="true" 190
191 <scroll_list background_visible="true" bottom_delta="-266" draw_border="true"
160 draw_stripes="false" 192 draw_stripes="false"
161 follows="top|right|bottom" height="300" left="1013" multi_select="false" 193 follows="top|right|bottom" height="261" left="1013" multi_select="false"
162 name="search_results" width="222"> 194 name="search_results" width="222">
163 <column label="" name="icon" width="16" /> 195 <column label="" name="icon" width="16" />
164 <column label="" name="sim_name" width="206" /> 196 <column label="" name="sim_name" width="206" />
@@ -178,7 +210,7 @@
178 mouse_opaque="true" name="spin y" 210 mouse_opaque="true" name="spin y"
179 tool_tip="Y coordinate of location to show on map" width="66" /> 211 tool_tip="Y coordinate of location to show on map" width="66" />
180 <spinner bottom_delta="0" decimal_digits="0" follows="bottom|right" height="16" 212 <spinner bottom_delta="0" decimal_digits="0" follows="bottom|right" height="16"
181 increment="1" initial_val="0" left_delta="68" max_val="4096" min_val="0" 213 increment="1" initial_val="0" left_delta="68" max_val="16384" min_val="0"
182 mouse_opaque="true" name="spin z" 214 mouse_opaque="true" name="spin z"
183 tool_tip="Z coordinate of location to show on map" width="66" /> 215 tool_tip="Z coordinate of location to show on map" width="66" />
184 <button bottom="-625" follows="right|bottom" font="SansSerif" halign="center" 216 <button bottom="-625" follows="right|bottom" font="SansSerif" halign="center"
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
index f837029..8a97395 100644
--- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
@@ -64,6 +64,10 @@
64 userdata="" /> 64 userdata="" />
65 </menu_item_call> 65 </menu_item_call>
66 <menu_item_separator /> 66 <menu_item_separator />
67 <menu_item_call name="Logout" label="Logout"
68 shortcut="control|alt|Q">
69 <on_click function="File.Logout" userdata="" />
70 </menu_item_call>
67 <menu_item_call name="Quit" label="Quit" 71 <menu_item_call name="Quit" label="Quit"
68 shortcut="control|Q"> 72 shortcut="control|Q">
69 <on_click function="File.Quit" userdata="" /> 73 <on_click function="File.Quit" userdata="" />
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml
index 2122ee7..ed89977 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml
@@ -71,6 +71,10 @@
71 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18" 71 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18"
72 left_delta="135" max_chars="20" mouse_opaque="true" 72 left_delta="135" max_chars="20" mouse_opaque="true"
73 name="server_combo" width="120" /> 73 name="server_combo" width="120" />
74 <button bottom="28" follows="left|bottom" font="SansSerif" halign="center"
75 height="24" label="Grid Manager" label_selected="Connect"
76 left_delta="195" mouse_opaque="true" name="grid_btn" scale_image="TRUE"
77 width="120" />
74 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 78 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
75 bottom="45" drop_shadow_visible="true" follows="right|bottom" 79 bottom="45" drop_shadow_visible="true" follows="right|bottom"
76 font="SansSerifSmall" font-style="UNDERLINE" h_pad="0" halign="right" height="16" 80 font="SansSerifSmall" font-style="UNDERLINE" h_pad="0" halign="right" height="16"
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml
index 48da432..c5237cc 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml
@@ -8,10 +8,10 @@
8 mouse_opaque="false" name="text_box" v_pad="0" width="200"> 8 mouse_opaque="false" name="text_box" v_pad="0" width="200">
9 Maximum Bandwidth: 9 Maximum Bandwidth:
10 </text> 10 </text>
11 <slider bottom_delta="-25" can_edit_text="true" 11 <slider bottom_delta="-25" can_edit_text="true" control_name="ThrottleBandwidthKBPS"
12 decimal_digits="0" enabled="true" follows="left|top" height="15" 12 decimal_digits="0" enabled="true" follows="left|top" height="15"
13 increment="10" initial_val="50" left_delta="0" max_val="1500" min_val="50" 13 increment="100" initial_val="1500" left_delta="0" max_val="5000" min_val="100"
14 mouse_opaque="true" name="max_bandwidth" show_text="true" value="500" 14 mouse_opaque="true" name="max_bandwidth" show_text="true" value="1500"
15 width="180" /> 15 width="180" />
16 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 16 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
17 bottom_delta="4" drop_shadow_visible="true" enabled="true" 17 bottom_delta="4" drop_shadow_visible="true" enabled="true"
@@ -25,22 +25,15 @@
25 follows="left|top" font="SansSerifSmall" h_pad="0" halign="left" 25 follows="left|top" font="SansSerifSmall" h_pad="0" halign="left"
26 height="10" left="12" mouse_opaque="false" name="cache_size_label_l" 26 height="10" left="12" mouse_opaque="false" name="cache_size_label_l"
27 v_pad="0" width="200"> 27 v_pad="0" width="200">
28 Disk Cache Size: 28 Disk Cache Size (MB):
29 </text> 29 </text>
30 <slider bottom_delta="-25" can_edit_text="true" 30 <slider bottom_delta="-25" can_edit_text="true" control_name="CacheSize"
31 decimal_digits="0" enabled="true" follows="left|top" height="15" 31 decimal_digits="0" enabled="true" follows="left|top" height="15"
32 increment="10" initial_val="50" left_delta="0" max_val="1000" min_val="10" 32 increment="10" initial_val="50" left_delta="0" max_val="1000" min_val="10"
33 mouse_opaque="true" name="cache_size" show_text="true" width="180" /> 33 mouse_opaque="true" name="cache_size" show_text="true" width="180" />
34 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
35 bottom_delta="4" drop_shadow_visible="true" enabled="true"
36 follows="left|top" font="SansSerifSmall" h_pad="0" halign="left"
37 height="10" left_delta="186" mouse_opaque="false" name="text_box5"
38 v_pad="0" width="40">
39 MB
40 </text>
41 <button bottom="-55" bottom_delta="-4" enabled="true" follows="left|bottom" 34 <button bottom="-55" bottom_delta="-4" enabled="true" follows="left|bottom"
42 font="SansSerif" halign="center" height="22" label="Clear Cache" left="340" 35 font="SansSerif" halign="center" height="22" label="Clear Cache" left="340"
43 left_delta="30" mouse_opaque="true" name="clear_cache" scale_image="true" 36 left_delta="186" mouse_opaque="true" name="clear_cache" scale_image="true"
44 width="100" /> 37 width="100" />
45 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 38 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
46 bottom="-70" bottom_delta="-17" drop_shadow_visible="true" enabled="true" 39 bottom="-70" bottom_delta="-17" drop_shadow_visible="true" enabled="true"
@@ -51,7 +44,7 @@
51 </text> 44 </text>
52 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-28" 45 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-28"
53 enabled="false" follows="left|top" font="SansSerif" 46 enabled="false" follows="left|top" font="SansSerif"
54 handle_edit_keys_directly="true" height="20" left_delta="7" 47 handle_edit_keys_directly="true" height="20" left_delta="0"
55 max_length="4096" mouse_opaque="true" name="cache_location" 48 max_length="4096" mouse_opaque="true" name="cache_location"
56 select_all_on_focus_received="false" width="470" word_wrap="false" /> 49 select_all_on_focus_received="false" width="470" word_wrap="false" />
57 <button bottom_delta="-25" enabled="true" follows="left|top" font="SansSerif" 50 <button bottom_delta="-25" enabled="true" follows="left|top" font="SansSerif"
@@ -61,12 +54,12 @@
61 font="SansSerif" halign="center" height="22" label="Reset" 54 font="SansSerif" halign="center" height="22" label="Reset"
62 label_selected="Set" left_delta="103" mouse_opaque="true" 55 label_selected="Set" left_delta="103" mouse_opaque="true"
63 name="reset_cache" scale_image="true" width="100" /> 56 name="reset_cache" scale_image="true" width="100" />
64 <check_box bottom="-173" bottom_delta="-35" 57 <check_box bottom="-173" bottom_delta="-25" control_name="ConnectionPortEnabled"
65 enabled="true" follows="left|top" font="SansSerifSmall" height="16" 58 enabled="true" follows="left|top" font="SansSerifSmall" height="16"
66 initial_value="false" label="Custom Port Connection" left="12" 59 initial_value="false" label="Custom Port Connection" left="12"
67 mouse_opaque="true" name="connection_port_enabled" radio_style="false" 60 mouse_opaque="true" name="connection_port_enabled" radio_style="false"
68 width="256" /> 61 width="256" />
69 <spinner bottom="-193" bottom_delta="-20" 62 <spinner bottom="-193" bottom_delta="-20" control_name="ConnectionPort"
70 decimal_digits="0" enabled="true" follows="left|top" height="16" 63 decimal_digits="0" enabled="true" follows="left|top" height="16"
71 increment="1" initial_val="13000" label="Port Number:" label_width="75" 64 increment="1" initial_val="13000" label="Port Number:" label_width="75"
72 left_delta="20" max_val="13050" min_val="13000" mouse_opaque="true" 65 left_delta="20" max_val="13050" min_val="13000" mouse_opaque="true"