diff options
Diffstat (limited to 'linden/indra/newview')
63 files changed, 3883 insertions, 488 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index f224652..cd725d2 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt | |||
@@ -61,7 +61,16 @@ include_directories( | |||
61 | ) | 61 | ) |
62 | 62 | ||
63 | set(viewer_SOURCE_FILES | 63 | set(viewer_SOURCE_FILES |
64 | jcfloater_animation_list.cpp | 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 | ||
73 | jcfloater_animation_list.cpp | ||
65 | llagent.cpp | 74 | llagent.cpp |
66 | llagentdata.cpp | 75 | llagentdata.cpp |
67 | llagentlanguage.cpp | 76 | llagentlanguage.cpp |
@@ -433,6 +442,7 @@ set(viewer_SOURCE_FILES | |||
433 | llxmlrpctransaction.cpp | 442 | llxmlrpctransaction.cpp |
434 | noise.cpp | 443 | noise.cpp |
435 | pipeline.cpp | 444 | pipeline.cpp |
445 | prefpanelpasswords.cpp | ||
436 | primbackup.cpp | 446 | primbackup.cpp |
437 | rlvhandler.cpp | 447 | rlvhandler.cpp |
438 | rlvhelper.cpp | 448 | rlvhelper.cpp |
@@ -461,8 +471,16 @@ endif (LINUX) | |||
461 | set(viewer_HEADER_FILES | 471 | set(viewer_HEADER_FILES |
462 | CMakeLists.txt | 472 | CMakeLists.txt |
463 | ViewerInstall.cmake | 473 | ViewerInstall.cmake |
464 | 474 | authentication_controller.h | |
465 | jcfloater_animation_list.h | 475 | authentication_floater.h |
476 | authentication_model.h | ||
477 | controllerlogin.h | ||
478 | controllerpasswords.h | ||
479 | floaterlogin.h | ||
480 | hippoGridManager.h | ||
481 | hippoLimits.h | ||
482 | hippoRestRequest.h | ||
483 | jcfloater_animation_list.h | ||
466 | llagent.h | 484 | llagent.h |
467 | llagentdata.h | 485 | llagentdata.h |
468 | llagentlanguage.h | 486 | llagentlanguage.h |
@@ -841,6 +859,7 @@ set(viewer_HEADER_FILES | |||
841 | macmain.h | 859 | macmain.h |
842 | noise.h | 860 | noise.h |
843 | pipeline.h | 861 | pipeline.h |
862 | prefpanelpasswords.h | ||
844 | primbackup.h | 863 | primbackup.h |
845 | randgauss.h | 864 | randgauss.h |
846 | VertexCache.h | 865 | VertexCache.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 154fd5f..79ea136 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -10646,5 +10646,38 @@ | |||
10646 | <key>Value</key> | 10646 | <key>Value</key> |
10647 | <integer>0</integer> | 10647 | <integer>0</integer> |
10648 | </map> | 10648 | </map> |
10649 | <key>DefaultGrid</key> | ||
10650 | <map> | ||
10651 | <key>Comment</key> | ||
10652 | <string>Nickname of the default grid</string> | ||
10653 | <key>Persist</key> | ||
10654 | <integer>1</integer> | ||
10655 | <key>Type</key> | ||
10656 | <string>String</string> | ||
10657 | <key>Value</key> | ||
10658 | <string>secondlife</string> | ||
10659 | </map> | ||
10660 | <key>KeepAppearance</key> | ||
10661 | <map> | ||
10662 | <key>Comment</key> | ||
10663 | <string>Keep appearance across grid teleport</string> | ||
10664 | <key>Persist</key> | ||
10665 | <integer>1</integer> | ||
10666 | <key>Type</key> | ||
10667 | <string>Boolean</string> | ||
10668 | <key>Value</key> | ||
10669 | <string>0</string> | ||
10670 | </map> | ||
10671 | <key>CheckForGridUpdates</key> | ||
10672 | <map> | ||
10673 | <key>Comment</key> | ||
10674 | <string>Check for grid info updates on the web server</string> | ||
10675 | <key>Persist</key> | ||
10676 | <integer>1</integer> | ||
10677 | <key>Type</key> | ||
10678 | <string>Boolean</string> | ||
10679 | <key>Value</key> | ||
10680 | <integer>1</integer> | ||
10681 | </map> | ||
10649 | </map> | 10682 | </map> |
10650 | </llsd> | 10683 | </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 | ||
17 | std::string AuthenticationController::target_grid; | ||
18 | std::string AuthenticationController::username; | ||
19 | std::string AuthenticationController::password; | ||
20 | BOOL AuthenticationController::store_pw = FALSE; | ||
21 | |||
22 | AuthenticationController::AuthenticationController(const std::string& tg, void (*cb)(void*)) | ||
23 | { | ||
24 | target_grid = tg; | ||
25 | callback = cb; | ||
26 | } | ||
27 | |||
28 | AuthenticationController::~AuthenticationController() | ||
29 | { | ||
30 | } | ||
31 | |||
32 | // user interface callbacks: all static | ||
33 | void AuthenticationController::onCommitUser(LLUICtrl* ctrl, void* userdata) | ||
34 | { | ||
35 | AuthenticationFloater *floater = (AuthenticationFloater*)userdata; | ||
36 | username = floater->childGetText("User_edit"); | ||
37 | } | ||
38 | |||
39 | void AuthenticationController::onCommitPassword(LLUICtrl* ctrl, void* userdata) | ||
40 | { | ||
41 | AuthenticationFloater *floater = (AuthenticationFloater*)userdata; | ||
42 | password = floater->childGetText("Password_edit"); | ||
43 | } | ||
44 | |||
45 | void 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 | |||
54 | void AuthenticationController::onAccept(void* userdata) | ||
55 | { | ||
56 | |||
57 | } | ||
58 | |||
59 | void AuthenticationController::onCancel(void* userdata) | ||
60 | { | ||
61 | AuthenticationFloater *floater = (AuthenticationFloater*)userdata; | ||
62 | floater->cancel(); | ||
63 | floater->close(); | ||
64 | } | ||
65 | |||
66 | void AuthenticationController::onClickRegister(void* userdata) | ||
67 | { | ||
68 | llinfos << "onClickRegister" << llendl; | ||
69 | } | ||
70 | |||
71 | void AuthenticationController::retrieveStoredAccountData(void* userdata) | ||
72 | { | ||
73 | |||
74 | } | ||
75 | |||
76 | // static | ||
77 | std::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 | |||
14 | class AuthenticationController | ||
15 | { | ||
16 | public: | ||
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 | |||
32 | private: | ||
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 | ||
15 | AuthenticationFloater* AuthenticationFloater::sInstance = NULL; | ||
16 | AuthenticationController* AuthenticationFloater::sController = NULL; | ||
17 | |||
18 | AuthenticationFloater::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 | |||
36 | AuthenticationFloater::~AuthenticationFloater() | ||
37 | { | ||
38 | sInstance = NULL; | ||
39 | delete sController; | ||
40 | sController = NULL; | ||
41 | } | ||
42 | |||
43 | // static | ||
44 | void 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 | |||
62 | void AuthenticationFloater::accept() | ||
63 | { | ||
64 | llinfos << "accept" << llendl; | ||
65 | } | ||
66 | |||
67 | void AuthenticationFloater::cancel() | ||
68 | { | ||
69 | llinfos << "cancel" << llendl; | ||
70 | } | ||
71 | |||
72 | AuthenticationController* 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 | |||
15 | class AuthenticationFloater : public LLFloater | ||
16 | { | ||
17 | public: | ||
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 | |||
28 | private: | ||
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 | |||
16 | AuthenticationModel::AuthenticationModel() | ||
17 | { | ||
18 | loadPersistentData(); | ||
19 | } | ||
20 | |||
21 | AuthenticationModel::~AuthenticationModel() | ||
22 | { | ||
23 | savePersistentData(); | ||
24 | } | ||
25 | |||
26 | void 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 | |||
37 | void 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 | |||
46 | void AuthenticationModel::revert() | ||
47 | { | ||
48 | loadPersistentData(); | ||
49 | } | ||
50 | |||
51 | AuthenticationModel::connection_t AuthenticationModel::subscribeToModelUpdates | ||
52 | (event_t::slot_function_type subscriber) | ||
53 | { | ||
54 | return mEventUpdate.connect(subscriber); | ||
55 | } | ||
56 | |||
57 | void AuthenticationModel::unsubscribe(connection_t subscriber) | ||
58 | { | ||
59 | subscriber.disconnect(); | ||
60 | } | ||
61 | |||
62 | /* setters */ | ||
63 | void 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 | |||
70 | void AuthenticationModel::removeAccount(const std::string &grid, const std::string &accountName) | ||
71 | { | ||
72 | mAuthLLSD[grid].erase(accountName); | ||
73 | mEventUpdate(); | ||
74 | } | ||
75 | |||
76 | void 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 | |||
85 | void AuthenticationModel::getAllAccountNames(std::list<std::string> &names) | ||
86 | { | ||
87 | // TODO: implement this for account management | ||
88 | } | ||
89 | |||
90 | void 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 | |||
102 | void AuthenticationModel::getPassword(const std::string &grid, const std::string &accountName, | ||
103 | std::string &password) | ||
104 | { | ||
105 | password = mAuthLLSD[grid][accountName].asString(); | ||
106 | } | ||
107 | |||
108 | void 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 | |||
21 | class AuthenticationModel : public LLSingleton<AuthenticationModel> | ||
22 | { | ||
23 | public: | ||
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(); | ||
48 | protected: | ||
49 | LLSD mAuthLLSD; | ||
50 | private: | ||
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 | |||
13 | LoginController::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 | |||
40 | LoginController::~LoginController() | ||
41 | { | ||
42 | mModel->unsubscribe(mModelConnection); | ||
43 | } | ||
44 | |||
45 | void 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 | |||
67 | void 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 | |||
77 | void 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 | |||
95 | void 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 | |||
109 | void 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 | |||
138 | void 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 | |||
20 | class LoginController | ||
21 | { | ||
22 | public: | ||
23 | LoginController(LoginFloater *floater, AuthenticationModel *authModel, const std::string &grid); | ||
24 | virtual ~LoginController(); | ||
25 | virtual void update(); | ||
26 | protected: | ||
27 | LoginFloater *mFloater; | ||
28 | AuthenticationModel *mModel; | ||
29 | std::string mGrid; | ||
30 | private: | ||
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 | |||
13 | PasswordsController::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 | |||
26 | PasswordsController::~PasswordsController() | ||
27 | { | ||
28 | mModel->unsubscribe(mModelConnection); | ||
29 | mModel = NULL; | ||
30 | } | ||
31 | |||
32 | void 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 | ||
17 | class PasswordsPrefPanel; | ||
18 | |||
19 | class PasswordsController | ||
20 | { | ||
21 | public: | ||
22 | PasswordsController(PasswordsPrefPanel *panel); | ||
23 | virtual ~PasswordsController(); | ||
24 | virtual void update(); | ||
25 | protected: | ||
26 | LLScrollListCtrl *accounts_list; | ||
27 | LLButton *remove_btn; | ||
28 | private: | ||
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 | |||
27 | LoginFloater* LoginFloater::sInstance = NULL; | ||
28 | LoginController* LoginFloater::sController = NULL; | ||
29 | AuthenticationModel* LoginFloater::sModel = NULL; | ||
30 | bool LoginFloater::sIsInitialLogin; | ||
31 | std::string LoginFloater::sGrid; | ||
32 | |||
33 | LoginFloater::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 | |||
105 | LoginFloater::~LoginFloater() | ||
106 | { | ||
107 | delete LoginFloater::sController; | ||
108 | |||
109 | LoginFloater::sModel = NULL; | ||
110 | LoginFloater::sController = NULL; | ||
111 | LoginFloater::sInstance = NULL; | ||
112 | } | ||
113 | |||
114 | void LoginFloater::close() | ||
115 | { | ||
116 | if(sInstance) | ||
117 | { | ||
118 | delete sInstance; | ||
119 | sInstance = NULL; | ||
120 | } | ||
121 | } | ||
122 | |||
123 | BOOL 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 | |||
166 | void 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 | |||
290 | void LoginFloater::update() | ||
291 | { | ||
292 | mState = NORMAL; | ||
293 | mCurGrid = gHippoGridManager->getCurrentGridNick(); | ||
294 | refresh_grids(); | ||
295 | //KOW gHippoLimits->setLimits(); | ||
296 | } | ||
297 | |||
298 | void 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 | |||
337 | bool 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 | |||
391 | void 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 | |||
408 | void 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 | |||
426 | void LoginFloater::cancel() | ||
427 | { | ||
428 | gHippoGridManager->discardAndReload(); | ||
429 | LoginFloater::sModel->revert(); | ||
430 | update(); | ||
431 | } | ||
432 | |||
433 | void 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 | ||
463 | void 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 | ||
473 | void 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 | ||
483 | void 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 | ||
492 | void LoginFloater::onClickApply(void *data) | ||
493 | { | ||
494 | sInstance->apply(); | ||
495 | } | ||
496 | |||
497 | //static | ||
498 | void LoginFloater::onClickDefault(void *data) | ||
499 | { | ||
500 | sInstance->setDefault(); | ||
501 | } | ||
502 | |||
503 | //static | ||
504 | void LoginFloater::onClickCancel(void *data) | ||
505 | { | ||
506 | sInstance->cancel(); | ||
507 | } | ||
508 | |||
509 | void LoginFloater::setAlwaysRefresh(bool refresh) | ||
510 | { | ||
511 | // wargames 2: dead code, LLPanelLogin compatibility | ||
512 | return; | ||
513 | } | ||
514 | |||
515 | void 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 | |||
545 | void 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 | |||
578 | void 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 | |||
585 | void 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 | |||
605 | void 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 | |||
614 | void 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 | |||
629 | void 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 | |||
645 | void 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 | |||
670 | void 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 | |||
680 | void 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 | |||
719 | void 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 | |||
726 | BOOL 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 | |||
741 | void 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 | |||
753 | std::string& LoginFloater::getPassword() | ||
754 | { | ||
755 | return mMungedPassword; | ||
756 | } | ||
757 | |||
758 | void LoginFloater::setPassword(std::string &password) | ||
759 | { | ||
760 | mMungedPassword = password; | ||
761 | } | ||
762 | |||
763 | bool LoginFloater::isSamePassword(std::string &password) | ||
764 | { | ||
765 | return mMungedPassword == password; | ||
766 | } | ||
767 | |||
768 | void 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 | |||
781 | void 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 | |||
800 | void 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 | |||
816 | void 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 | |||
16 | class LoginController; | ||
17 | class AuthenticationModel; | ||
18 | |||
19 | class LoginFloater : public LLFloater | ||
20 | { | ||
21 | public: | ||
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); | ||
67 | protected: | ||
68 | static bool sIsInitialLogin; | ||
69 | static std::string sGrid; | ||
70 | private: | ||
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 | |||
23 | HippoGridManager *gHippoGridManager = 0; | ||
24 | |||
25 | HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO(""); | ||
26 | |||
27 | |||
28 | |||
29 | // ******************************************************************** | ||
30 | // ******************************************************************** | ||
31 | // HippoGridInfo | ||
32 | // ******************************************************************** | ||
33 | // ******************************************************************** | ||
34 | |||
35 | |||
36 | // ******************************************************************** | ||
37 | // Initialize | ||
38 | |||
39 | HippoGridInfo::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 | |||
51 | void HippoGridInfo::setPlatform(Platform platform) | ||
52 | { | ||
53 | mPlatform = platform; | ||
54 | mCurrencySymbol = (mPlatform == PLATFORM_SECONDLIFE)? "L$": "OS$"; | ||
55 | } | ||
56 | |||
57 | |||
58 | void 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 | |||
78 | std::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]®ion=[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 | ||
109 | void 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 | ||
137 | void HippoGridInfo::onXmlElementEnd(void *userData, const XML_Char *name) | ||
138 | { | ||
139 | HippoGridInfo *self = (HippoGridInfo*)userData; | ||
140 | self->mXmlState = XML_VOID; | ||
141 | } | ||
142 | |||
143 | //static | ||
144 | void 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 | |||
187 | bool 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 | |||
213 | std::string HippoGridInfo::getUploadFee() const | ||
214 | { | ||
215 | std::string fee; | ||
216 | formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), true); | ||
217 | return fee; | ||
218 | } | ||
219 | |||
220 | std::string HippoGridInfo::getGroupCreationFee() const | ||
221 | { | ||
222 | std::string fee; | ||
223 | formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceGroupCreate(), false); | ||
224 | return fee; | ||
225 | } | ||
226 | |||
227 | std::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 | |||
235 | void 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 | ||
249 | const 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 | ||
262 | void 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 | ||
278 | void 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 | |||
286 | void 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 | |||
309 | HippoGridManager::HippoGridManager() : | ||
310 | mConnectedGrid(0), | ||
311 | mDefaultGridsVersion(0) | ||
312 | { | ||
313 | } | ||
314 | |||
315 | HippoGridManager::~HippoGridManager() | ||
316 | { | ||
317 | cleanup(); | ||
318 | } | ||
319 | |||
320 | |||
321 | void 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 | |||
331 | void 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 | |||
343 | void HippoGridManager::discardAndReload() | ||
344 | { | ||
345 | cleanup(); | ||
346 | loadFromFile(); | ||
347 | } | ||
348 | |||
349 | |||
350 | // ******************************************************************** | ||
351 | // Public Access | ||
352 | |||
353 | HippoGridInfo *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 | |||
365 | HippoGridInfo *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 | |||
376 | void 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 | |||
394 | void 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 | |||
411 | void 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 | |||
426 | void 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 | |||
441 | void 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 | |||
457 | void 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 | |||
478 | void 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 | |||
498 | void 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 | |||
555 | void 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 | |||
14 | class LLSD; | ||
15 | |||
16 | |||
17 | class HippoGridInfo | ||
18 | { | ||
19 | public: | ||
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 | |||
88 | private: | ||
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 | |||
126 | class HippoGridManager | ||
127 | { | ||
128 | public: | ||
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 | |||
153 | private: | ||
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 | |||
168 | extern 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 | |||
10 | HippoLimits *gHippoLimits = 0; | ||
11 | |||
12 | |||
13 | HippoLimits::HippoLimits() | ||
14 | { | ||
15 | setLimits(); | ||
16 | } | ||
17 | |||
18 | |||
19 | void HippoLimits::setLimits() | ||
20 | { | ||
21 | if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) { | ||
22 | setSecondLifeLimits(); | ||
23 | } else { | ||
24 | setOpenSimLimits(); | ||
25 | } | ||
26 | } | ||
27 | |||
28 | |||
29 | void 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 | |||
45 | void 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 | |||
5 | class HippoLimits | ||
6 | { | ||
7 | public: | ||
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 | |||
18 | private: | ||
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 | |||
30 | extern 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 | |||
14 | static 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 | ||
24 | int 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 | |||
8 | class 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 | |||
18 | std::string gHippoChannel; | ||
19 | |||
20 | |||
21 | // static | ||
22 | bool 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 | |||
5 | class HippoUpdate | ||
6 | { | ||
7 | public: | ||
8 | static bool checkUpdate(); | ||
9 | }; | ||
10 | |||
11 | |||
12 | #endif | ||
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index d73ddb6..edcb82c 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp | |||
@@ -467,6 +467,10 @@ void LLAgent::init() | |||
467 | //----------------------------------------------------------------------------- | 467 | //----------------------------------------------------------------------------- |
468 | void LLAgent::cleanup() | 468 | void LLAgent::cleanup() |
469 | { | 469 | { |
470 | mInitialized = FALSE; | ||
471 | mWearablesLoaded = FALSE; | ||
472 | mShowAvatar = TRUE; | ||
473 | |||
470 | setSitCamera(LLUUID::null); | 474 | setSitCamera(LLUUID::null); |
471 | mAvatarObject = NULL; | 475 | mAvatarObject = NULL; |
472 | mLookAt = NULL; | 476 | mLookAt = NULL; |
@@ -6674,11 +6678,19 @@ BOOL LLAgent::isWearingItem( const LLUUID& item_id ) | |||
6674 | // static | 6678 | // static |
6675 | void LLAgent::processAgentInitialWearablesUpdate( LLMessageSystem* mesgsys, void** user_data ) | 6679 | void LLAgent::processAgentInitialWearablesUpdate( LLMessageSystem* mesgsys, void** user_data ) |
6676 | { | 6680 | { |
6681 | if (gNoRender) | ||
6682 | { | ||
6683 | return; | ||
6684 | } | ||
6685 | |||
6677 | // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates | 6686 | // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates |
6678 | // that may result from AgentWearablesRequest having been sent more than once. | 6687 | // that may result from AgentWearablesRequest having been sent more than once. |
6688 | // If we do this, then relogging won't work. - Gigs | ||
6689 | /* | ||
6679 | static bool first = true; | 6690 | static bool first = true; |
6680 | if (!first) return; | 6691 | if (!first) return; |
6681 | first = false; | 6692 | first = false; |
6693 | */ | ||
6682 | 6694 | ||
6683 | LLUUID agent_id; | 6695 | LLUUID agent_id; |
6684 | gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); | 6696 | gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); |
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index ab4d8a9..52aa1eb 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. |
200 | extern void disable_win_error_reporting(); | ||
195 | 201 | ||
196 | #if LL_DARWIN | 202 | #if LL_DARWIN |
203 | #include <Carbon/Carbon.h> | ||
197 | extern void init_apple_menu(const char* product); | 204 | extern void init_apple_menu(const char* product); |
205 | extern OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn); | ||
206 | extern OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn); | ||
207 | extern OSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata); | ||
208 | #include <boost/tokenizer.hpp> | ||
198 | #endif // LL_DARWIN | 209 | #endif // LL_DARWIN |
199 | 210 | ||
211 | |||
200 | extern BOOL gRandomizeFramerate; | 212 | extern BOOL gRandomizeFramerate; |
201 | extern BOOL gPeriodicSlowFrame; | 213 | extern BOOL gPeriodicSlowFrame; |
202 | extern BOOL gDebugGL; | 214 | extern BOOL gDebugGL; |
203 | 215 | ||
204 | //////////////////////////////////////////////////////////// | 216 | //////////////////////////////////////////////////////////// |
205 | // All from the last globals push... | 217 | // All from the last globals push... |
218 | |||
219 | |||
206 | const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard | 220 | const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard |
207 | 221 | ||
208 | F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() | 222 | F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() |
209 | F32 gSimFrames; | 223 | F32 gSimFrames; |
210 | 224 | ||
225 | std::string gDisabledMessage; // Set in LLAppViewer::initConfiguration used in idle_startup | ||
226 | |||
227 | BOOL gHideLinks = FALSE; // Set in LLAppViewer::initConfiguration, used externally | ||
228 | |||
211 | BOOL gAllowIdleAFK = TRUE; | 229 | BOOL gAllowIdleAFK = TRUE; |
212 | BOOL gAllowTapTapHoldRun = TRUE; | 230 | BOOL gAllowTapTapHoldRun = TRUE; |
213 | BOOL gShowObjectUpdates = FALSE; | 231 | BOOL gShowObjectUpdates = FALSE; |
@@ -233,7 +251,7 @@ F32 gFPSClamped = 10.f; // Pretend we start at target rate. | |||
233 | F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets | 251 | F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets |
234 | U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds | 252 | U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds |
235 | U32 gFrameStalls = 0; | 253 | U32 gFrameStalls = 0; |
236 | const F64 FRAME_STALL_THRESHOLD = 1.0; | 254 | const F64 FRAME_STALL_THRESHOLD = 5.0; |
237 | 255 | ||
238 | LLTimer gRenderStartTime; | 256 | LLTimer gRenderStartTime; |
239 | LLFrameTimer gForegroundTime; | 257 | LLFrameTimer gForegroundTime; |
@@ -302,7 +320,8 @@ std::string gLoginPage; | |||
302 | std::vector<std::string> gLoginURIs; | 320 | std::vector<std::string> gLoginURIs; |
303 | static std::string gHelperURI; | 321 | static std::string gHelperURI; |
304 | 322 | ||
305 | LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; | 323 | //FIXME |
324 | //LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; | ||
306 | 325 | ||
307 | void idle_afk_check() | 326 | void 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 | /* | |
457 | void LLAppViewer::initGridChoice() | 476 | void 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 |
487 | bool LLAppViewer::initSLURLHandler() | 507 | bool 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 | ||
2545 | void LLAppViewer::forceQuit() | 2613 | void 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 | ||
2550 | void LLAppViewer::requestQuit() | 2632 | void 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 | ||
2582 | static void finish_quit(S32 option, void *userdata) | 2670 | static 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 | ||
2684 | void LLAppViewer::userLogout(void *userdata) | ||
2685 | { | ||
2686 | LLAppViewer::instance()->requestLogout(false); | ||
2687 | } | ||
2688 | |||
2595 | static void finish_early_exit(S32 option, void* userdata) | 2689 | static 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 | ||
2624 | bool LLAppViewer::initCache() | 2719 | bool LLAppViewer::initCache() |
@@ -2895,7 +2990,7 @@ void finish_forced_disconnect(S32 /* option */, void* /* userdata */) | |||
2895 | 2990 | ||
2896 | void LLAppViewer::forceDisconnect(const std::string& mesg) | 2991 | void 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. |
@@ -3203,9 +3298,12 @@ void LLAppViewer::idle() | |||
3203 | // Check for away from keyboard, kick idle agents. | 3298 | // Check for away from keyboard, kick idle agents. |
3204 | idle_afk_check(); | 3299 | idle_afk_check(); |
3205 | 3300 | ||
3301 | if (!gDisconnected) //check again | ||
3302 | { | ||
3206 | // Update statistics for this frame | 3303 | // Update statistics for this frame |
3207 | update_statistics(gFrameCount); | 3304 | update_statistics(gFrameCount); |
3208 | } | 3305 | } |
3306 | } | ||
3209 | 3307 | ||
3210 | //////////////////////////////////////// | 3308 | //////////////////////////////////////// |
3211 | // | 3309 | // |
@@ -3406,7 +3504,7 @@ void LLAppViewer::idle() | |||
3406 | // Handle shutdown process, for example, | 3504 | // Handle shutdown process, for example, |
3407 | // wait for floaters to close, send quit message, | 3505 | // wait for floaters to close, send quit message, |
3408 | // forcibly quit if it has taken too long | 3506 | // forcibly quit if it has taken too long |
3409 | if (mQuitRequested) | 3507 | if (mQuitRequested || mLogoutRequested) |
3410 | { | 3508 | { |
3411 | idleShutdown(); | 3509 | idleShutdown(); |
3412 | } | 3510 | } |
@@ -3506,12 +3604,12 @@ void LLAppViewer::sendLogoutRequest() | |||
3506 | if (mLogoutMarkerFile) | 3604 | if (mLogoutMarkerFile) |
3507 | { | 3605 | { |
3508 | llinfos << "Created logout marker file " << mLogoutMarkerFileName << llendl; | 3606 | llinfos << "Created logout marker file " << mLogoutMarkerFileName << llendl; |
3509 | apr_file_close(mLogoutMarkerFile); | ||
3510 | } | 3607 | } |
3511 | else | 3608 | else |
3512 | { | 3609 | { |
3513 | llwarns << "Cannot create logout marker file " << mLogoutMarkerFileName << llendl; | 3610 | llwarns << "Cannot create logout marker file " << mLogoutMarkerFileName << llendl; |
3514 | } | 3611 | } |
3612 | apr_file_close(mLogoutMarkerFile); | ||
3515 | } | 3613 | } |
3516 | } | 3614 | } |
3517 | 3615 | ||
@@ -3528,6 +3626,9 @@ static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME; | |||
3528 | 3626 | ||
3529 | void LLAppViewer::idleNetwork() | 3627 | void LLAppViewer::idleNetwork() |
3530 | { | 3628 | { |
3629 | if (gDisconnected) | ||
3630 | return; | ||
3631 | |||
3531 | pingMainloopTimeout("idleNetwork"); | 3632 | pingMainloopTimeout("idleNetwork"); |
3532 | 3633 | ||
3533 | gObjectList.mNumNewObjects = 0; | 3634 | gObjectList.mNumNewObjects = 0; |
@@ -3614,7 +3715,11 @@ void LLAppViewer::idleNetwork() | |||
3614 | 3715 | ||
3615 | gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); | 3716 | gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); |
3616 | 3717 | ||
3718 | if (gDisconnected) | ||
3719 | return; | ||
3720 | |||
3617 | // Retransmit unacknowledged packets. | 3721 | // Retransmit unacknowledged packets. |
3722 | if (gXferManager) | ||
3618 | gXferManager->retransmitUnackedPackets(); | 3723 | gXferManager->retransmitUnackedPackets(); |
3619 | gAssetStorage->checkForTimeouts(); | 3724 | gAssetStorage->checkForTimeouts(); |
3620 | 3725 | ||
@@ -3624,7 +3729,7 @@ void LLAppViewer::idleNetwork() | |||
3624 | // Check that the circuit between the viewer and the agent's current | 3729 | // Check that the circuit between the viewer and the agent's current |
3625 | // region is still alive | 3730 | // region is still alive |
3626 | LLViewerRegion *agent_region = gAgent.getRegion(); | 3731 | LLViewerRegion *agent_region = gAgent.getRegion(); |
3627 | if (agent_region) | 3732 | if ((agent_region)&&(LLStartUp::getStartupState() == STATE_STARTED)) |
3628 | { | 3733 | { |
3629 | LLUUID this_region_id = agent_region->getRegionID(); | 3734 | LLUUID this_region_id = agent_region->getRegionID(); |
3630 | bool this_region_alive = agent_region->isAlive(); | 3735 | bool this_region_alive = agent_region->isAlive(); |
@@ -3644,6 +3749,9 @@ void LLAppViewer::disconnectViewer() | |||
3644 | { | 3749 | { |
3645 | return; | 3750 | return; |
3646 | } | 3751 | } |
3752 | |||
3753 | //set this true now, to prevent things from trying to access the network we are destroying | ||
3754 | gDisconnected = TRUE; | ||
3647 | // | 3755 | // |
3648 | // Cleanup after quitting. | 3756 | // Cleanup after quitting. |
3649 | // | 3757 | // |
@@ -3693,8 +3801,8 @@ void LLAppViewer::disconnectViewer() | |||
3693 | // Now we just ask the LLWorld singleton to cleanly shut down. | 3801 | // Now we just ask the LLWorld singleton to cleanly shut down. |
3694 | LLWorld::getInstance()->destroyClass(); | 3802 | LLWorld::getInstance()->destroyClass(); |
3695 | 3803 | ||
3696 | cleanup_xfer_manager(); | 3804 | if (mQuitRequested) |
3697 | gDisconnected = TRUE; | 3805 | cleanup_xfer_manager(); |
3698 | } | 3806 | } |
3699 | 3807 | ||
3700 | void LLAppViewer::forceErrorLLError() | 3808 | void 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 | |||
160 | private: | 163 | private: |
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 | |||
224 | public: | ||
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 | |||
238 | extern std::string gDisabledMessage; // llstartup | ||
239 | extern BOOL gHideLinks; // used by llpanellogin, lllfloaterbuycurrency, llstartup | ||
242 | extern LLSD gDebugInfo; | 240 | extern LLSD gDebugInfo; |
243 | 241 | ||
244 | extern BOOL gAllowIdleAFK; | 242 | extern 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 | ||
62 | protected: | 62 | protected: |
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 | |||
144 | void 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 | |||
141 | void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name) | 153 | void 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 | { |
86 | public: | 86 | public: |
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/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp index 1b1284d..7aab713 100644 --- a/linden/indra/newview/llchatbar.cpp +++ b/linden/indra/newview/llchatbar.cpp | |||
@@ -120,6 +120,7 @@ LLChatBar::LLChatBar() | |||
120 | 120 | ||
121 | LLChatBar::~LLChatBar() | 121 | LLChatBar::~LLChatBar() |
122 | { | 122 | { |
123 | gGestureManager.removeObserver(mObserver); | ||
123 | delete mObserver; | 124 | delete mObserver; |
124 | mObserver = NULL; | 125 | mObserver = NULL; |
125 | // LLView destructor cleans up children | 126 | // LLView destructor cleans up children |
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 | ||
53 | class LLCamera; | 54 | class LLCamera; |
54 | class LLDrawPool; | 55 | class LLDrawPool; |
diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp index a31dde5..2f6dc99 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); |
@@ -334,6 +344,8 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target) | |||
334 | 344 | ||
335 | // If nothing is being tracked, set flag so the user position will be found | 345 | // If nothing is being tracked, set flag so the user position will be found |
336 | gFloaterWorldMap->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); | 346 | gFloaterWorldMap->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); |
347 | |||
348 | LLFloaterWorldMap::addServer(gHippoGridManager->getDefaultGridNick()); | ||
337 | } | 349 | } |
338 | 350 | ||
339 | if (center_on_target) | 351 | if (center_on_target) |
@@ -378,6 +390,48 @@ void LLFloaterWorldMap::hide(void*) | |||
378 | } | 390 | } |
379 | 391 | ||
380 | 392 | ||
393 | // static | ||
394 | void LLFloaterWorldMap::addServer(const std::string& server) | ||
395 | { | ||
396 | const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick(); | ||
397 | |||
398 | LLCtrlListInterface *grids = gFloaterWorldMap->childGetListInterface("grid_combo"); | ||
399 | if (!grids) return; | ||
400 | |||
401 | // Delete all but the "None" entry | ||
402 | S32 list_size = grids->getItemCount(); | ||
403 | while (list_size > 1) | ||
404 | { | ||
405 | grids->selectNthItem(1); | ||
406 | grids->operateOnSelection(LLCtrlListInterface::OP_DELETE); | ||
407 | --list_size; | ||
408 | } | ||
409 | |||
410 | |||
411 | //LLComboBox *grids = gFloaterWorldMap->getChild<LLComboBox>("grid_combo"); | ||
412 | S32 selectIndex = -1, i = 0; | ||
413 | //grids->removeall(); | ||
414 | if (defaultGrid != "") { | ||
415 | grids->addSimpleElement(defaultGrid); | ||
416 | selectIndex = i++; | ||
417 | } | ||
418 | HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid(); | ||
419 | for (it = gHippoGridManager->beginGrid(); it != end; ++it) { | ||
420 | const std::string &grid = it->second->getGridNick(); | ||
421 | if (grid != defaultGrid) { | ||
422 | grids->addSimpleElement(grid); | ||
423 | //if (grid == mCurGrid) selectIndex = i; | ||
424 | i++; | ||
425 | } | ||
426 | } | ||
427 | grids->selectFirstItem(); | ||
428 | //grids->setCurrentByIndex(0); | ||
429 | |||
430 | //LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); | ||
431 | //combo->add(server, LLSD(domain_name) ); | ||
432 | //combo->setCurrentByIndex(0); | ||
433 | } | ||
434 | |||
381 | // virtual | 435 | // virtual |
382 | void LLFloaterWorldMap::setVisible( BOOL visible ) | 436 | void LLFloaterWorldMap::setVisible( BOOL visible ) |
383 | { | 437 | { |
@@ -450,7 +504,10 @@ void LLFloaterWorldMap::draw() | |||
450 | childSetEnabled("Go Home", enable_go_home); | 504 | childSetEnabled("Go Home", enable_go_home); |
451 | 505 | ||
452 | updateLocation(); | 506 | updateLocation(); |
453 | 507 | ||
508 | LLComboBox *grid_combo = getChild<LLComboBox>("grid_combo"); | ||
509 | std::string current_grid = gHippoGridManager->getConnectedGrid()->getGridNick(); | ||
510 | |||
454 | LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); | 511 | LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); |
455 | if (LLTracker::TRACKING_AVATAR == tracking_status) | 512 | if (LLTracker::TRACKING_AVATAR == tracking_status) |
456 | { | 513 | { |
@@ -496,7 +553,19 @@ void LLFloaterWorldMap::draw() | |||
496 | centerOnTarget(TRUE); | 553 | centerOnTarget(TRUE); |
497 | } | 554 | } |
498 | 555 | ||
499 | childSetEnabled("Teleport", (BOOL)tracking_status); | 556 | //GRID MANAGER |
557 | if (grid_combo->getSelectedValue().asString() != "None") | ||
558 | { | ||
559 | childSetEnabled("Teleport", TRUE); | ||
560 | childSetColor("grid_icon", gTrackColor); | ||
561 | } | ||
562 | else | ||
563 | { | ||
564 | childSetEnabled("Teleport", (BOOL)tracking_status); | ||
565 | childSetColor("grid_icon", gDisabledTrackColor); | ||
566 | } | ||
567 | //END GRID MANAGER | ||
568 | |||
500 | // childSetEnabled("Clear", (BOOL)tracking_status); | 569 | // childSetEnabled("Clear", (BOOL)tracking_status); |
501 | childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation); | 570 | childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation); |
502 | childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); | 571 | childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); |
@@ -769,7 +838,7 @@ void LLFloaterWorldMap::updateLocation() | |||
769 | void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord) | 838 | void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord) |
770 | { | 839 | { |
771 | LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name); | 840 | LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name); |
772 | z_coord = llclamp(z_coord, 0, 4096); | 841 | z_coord = llclamp(z_coord, 0, 1000); |
773 | if (sim_info) | 842 | if (sim_info) |
774 | { | 843 | { |
775 | LLVector3 local_pos; | 844 | LLVector3 local_pos; |
@@ -979,6 +1048,18 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui) | |||
979 | } | 1048 | } |
980 | 1049 | ||
981 | 1050 | ||
1051 | void LLFloaterWorldMap::clearGridSelection(BOOL clear_ui) | ||
1052 | { | ||
1053 | if (clear_ui || !childHasKeyboardFocus("grid_combo")) | ||
1054 | { | ||
1055 | LLCtrlListInterface *list = childGetListInterface("grid_combo"); | ||
1056 | if (list) | ||
1057 | { | ||
1058 | list->selectByValue( "None" ); | ||
1059 | } | ||
1060 | } | ||
1061 | } | ||
1062 | |||
982 | void LLFloaterWorldMap::clearLandmarkSelection(BOOL clear_ui) | 1063 | void LLFloaterWorldMap::clearLandmarkSelection(BOOL clear_ui) |
983 | { | 1064 | { |
984 | if (clear_ui || !childHasKeyboardFocus("landmark combo")) | 1065 | if (clear_ui || !childHasKeyboardFocus("landmark combo")) |
@@ -1076,9 +1157,18 @@ void LLFloaterWorldMap::onPanBtn( void* userdata ) | |||
1076 | } | 1157 | } |
1077 | 1158 | ||
1078 | // static | 1159 | // static |
1160 | void LLFloaterWorldMap::onGridManager(void*) | ||
1161 | { | ||
1162 | LoginFloater::newShow(std::string("Test"), false, LoginFloater::testCallback, NULL); | ||
1163 | //gAgent.teleportHome(); | ||
1164 | //gFloaterWorldMap->close(); | ||
1165 | } | ||
1166 | |||
1167 | // static | ||
1079 | void LLFloaterWorldMap::onGoHome(void*) | 1168 | void LLFloaterWorldMap::onGoHome(void*) |
1080 | { | 1169 | { |
1081 | gAgent.teleportHomeConfirm(); | 1170 | gAgent.teleportHomeConfirm(); |
1171 | gFloaterWorldMap->close(); | ||
1082 | } | 1172 | } |
1083 | 1173 | ||
1084 | 1174 | ||
@@ -1161,6 +1251,9 @@ void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata ) | |||
1161 | item_id.setNull(); | 1251 | item_id.setNull(); |
1162 | } | 1252 | } |
1163 | } | 1253 | } |
1254 | //GRID MANAGER HAX | ||
1255 | self->clearGridSelection(TRUE); | ||
1256 | //END GRID MANAGER HAX | ||
1164 | 1257 | ||
1165 | self->trackLandmark( item_id); | 1258 | self->trackLandmark( item_id); |
1166 | onShowTargetBtn(self); | 1259 | onShowTargetBtn(self); |
@@ -1212,6 +1305,10 @@ void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata ) | |||
1212 | const LLUUID& new_avatar_id = list->getCurrentID(); | 1305 | const LLUUID& new_avatar_id = list->getCurrentID(); |
1213 | if (new_avatar_id.notNull()) | 1306 | if (new_avatar_id.notNull()) |
1214 | { | 1307 | { |
1308 | //GRID MANAGER HAX | ||
1309 | self->clearGridSelection(TRUE); | ||
1310 | //END GRID MANAGER HAX | ||
1311 | |||
1215 | std::string name; | 1312 | std::string name; |
1216 | LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo"); | 1313 | LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo"); |
1217 | if (combo) name = combo->getSimple(); | 1314 | if (combo) name = combo->getSimple(); |
@@ -1293,6 +1390,10 @@ void LLFloaterWorldMap::onClearBtn(void* data) | |||
1293 | LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE; | 1390 | LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE; |
1294 | self->mSLURL = ""; // Clear the SLURL since it's invalid | 1391 | self->mSLURL = ""; // Clear the SLURL since it's invalid |
1295 | self->mSetToUserPosition = TRUE; // Revert back to the current user position | 1392 | self->mSetToUserPosition = TRUE; // Revert back to the current user position |
1393 | //KOW TODO clear grid combo red ring, clear grid combo. | ||
1394 | //GRID MANAGER HAX | ||
1395 | self->clearGridSelection(TRUE); | ||
1396 | //END GRID MANAGER HAX | ||
1296 | } | 1397 | } |
1297 | 1398 | ||
1298 | // static | 1399 | // static |
@@ -1402,6 +1503,39 @@ void LLFloaterWorldMap::fly() | |||
1402 | // protected | 1503 | // protected |
1403 | void LLFloaterWorldMap::teleport() | 1504 | void LLFloaterWorldMap::teleport() |
1404 | { | 1505 | { |
1506 | //BEGIN CROSS GRIP TP// | ||
1507 | LLComboBox *grid_combo = getChild<LLComboBox>("grid_combo"); | ||
1508 | std::string current_grid = gHippoGridManager->getConnectedGrid()->getGridNick(); | ||
1509 | |||
1510 | // BUG: the client crashes if fed an invalid grid through this interface, which shouldn't happen | ||
1511 | if(//grid_combo && grid_combo->getSelectedValue().asString() != current_grid || gSavedSettings.getBOOL("CmdLineLoginURI") && | ||
1512 | grid_combo->getSelectedValue().asString() != "None" && | ||
1513 | !grid_combo->getSelectedValue().asString().empty()) | ||
1514 | { | ||
1515 | HippoGridInfo *gridInfo = gHippoGridManager->getGrid(grid_combo->getSelectedValue().asString()); | ||
1516 | //DEBUG | ||
1517 | |||
1518 | llwarns << "tp button current grid = " << grid_combo->getSelectedValue().asString() << llendl; | ||
1519 | std::string firstName = gridInfo->getFirstName(); | ||
1520 | std::string lastName = gridInfo->getLastName(); | ||
1521 | std::string loginPassword = gridInfo->getAvatarPassword(); | ||
1522 | |||
1523 | if(!firstName.empty() && !lastName.empty()) | ||
1524 | { | ||
1525 | gLoginHandler.mFirstName = firstName; | ||
1526 | gLoginHandler.mLastName = lastName; | ||
1527 | gLoginHandler.mPassword = loginPassword; | ||
1528 | } | ||
1529 | |||
1530 | gHippoGridManager->setCurrentGrid(gridInfo->getGridNick()); | ||
1531 | gHippoGridManager->setDefaultGrid(gridInfo->getGridNick()); | ||
1532 | //this doesn't work :( gSavedSettings.setBOOL("CmdLineLoginURI", FALSE); | ||
1533 | LLStartUp::setShouldAutoLogin(true); | ||
1534 | LLAppViewer::instance()->requestLogout(false); | ||
1535 | return; | ||
1536 | } | ||
1537 | //END CROSS GRID TP// | ||
1538 | |||
1405 | BOOL teleport_home = FALSE; | 1539 | BOOL teleport_home = FALSE; |
1406 | LLVector3d pos_global; | 1540 | LLVector3d pos_global; |
1407 | LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); | 1541 | LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); |
@@ -1692,3 +1826,20 @@ void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata) | |||
1692 | 1826 | ||
1693 | onShowTargetBtn(self); | 1827 | onShowTargetBtn(self); |
1694 | } | 1828 | } |
1829 | |||
1830 | // static | ||
1831 | void LLFloaterWorldMap::onSelectServer(LLUICtrl* ctrl, void* userdata) | ||
1832 | { | ||
1833 | //GRID MANAGER COMBO BOX CLICKED// | ||
1834 | llwarns << "onSelectServer called" << llendl; | ||
1835 | //snip from onClearBtn (bless this mess) | ||
1836 | LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata; | ||
1837 | self->mTrackedStatus = LLTracker::TRACKING_NOTHING; | ||
1838 | LLTracker::stopTracking((void *)(intptr_t)TRUE); | ||
1839 | //LLTracker::stopTracking(NULL); | ||
1840 | LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE; | ||
1841 | self->mSLURL = ""; // Clear the SLURL since it's invalid | ||
1842 | self->mSetToUserPosition = TRUE; // Revert back to the current user position | ||
1843 | |||
1844 | self->setDefaultBtn("Teleport"); | ||
1845 | } | ||
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: | |||
114 | protected: | 117 | protected: |
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/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp index e662058..490000f 100644 --- a/linden/indra/newview/llinventorymodel.cpp +++ b/linden/indra/newview/llinventorymodel.cpp | |||
@@ -1499,7 +1499,7 @@ void LLInventoryModel::stopBackgroundFetch() | |||
1499 | //static | 1499 | //static |
1500 | void LLInventoryModel::backgroundFetch(void*) | 1500 | void LLInventoryModel::backgroundFetch(void*) |
1501 | { | 1501 | { |
1502 | if (sBackgroundFetchActive && gAgent.getRegion()) | 1502 | if (sBackgroundFetchActive) |
1503 | { | 1503 | { |
1504 | //If we'll be using the capability, we'll be sending batches and the background thing isn't as important. | 1504 | //If we'll be using the capability, we'll be sending batches and the background thing isn't as important. |
1505 | std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents"); | 1505 | std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents"); |
diff --git a/linden/indra/newview/llinventorymodel.h b/linden/indra/newview/llinventorymodel.h index 7c7d231..e95d246 100644 --- a/linden/indra/newview/llinventorymodel.h +++ b/linden/indra/newview/llinventorymodel.h | |||
@@ -323,6 +323,8 @@ public: | |||
323 | // relations. | 323 | // relations. |
324 | void buildParentChildMap(); | 324 | void buildParentChildMap(); |
325 | 325 | ||
326 | // Empty the entire contents | ||
327 | void empty(); | ||
326 | // | 328 | // |
327 | // Category accounting. | 329 | // Category accounting. |
328 | // | 330 | // |
@@ -374,6 +376,7 @@ public: | |||
374 | static bool isEverythingFetched(); | 376 | static bool isEverythingFetched(); |
375 | static void backgroundFetch(void*); // background fetch idle function | 377 | static void backgroundFetch(void*); // background fetch idle function |
376 | static void incrBulkFetch(S16 fetching) { sBulkFetchCount+=fetching; if (sBulkFetchCount<0) sBulkFetchCount=0; } | 378 | static void incrBulkFetch(S16 fetching) { sBulkFetchCount+=fetching; if (sBulkFetchCount<0) sBulkFetchCount=0; } |
379 | |||
377 | protected: | 380 | protected: |
378 | 381 | ||
379 | // Internal methods which add inventory and make sure that all of | 382 | // Internal methods which add inventory and make sure that all of |
@@ -387,8 +390,7 @@ protected: | |||
387 | // preferred type. Returns LLUUID::null if not found | 390 | // preferred type. Returns LLUUID::null if not found |
388 | LLUUID findCatUUID(LLAssetType::EType preferred_type); | 391 | LLUUID findCatUUID(LLAssetType::EType preferred_type); |
389 | 392 | ||
390 | // Empty the entire contents | 393 | |
391 | void empty(); | ||
392 | 394 | ||
393 | // Given the current state of the inventory items, figure out the | 395 | // Given the current state of the inventory items, figure out the |
394 | // clone information. *FIX: This is sub-optimal, since we can | 396 | // clone information. *FIX: This is sub-optimal, since we can |
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index 8e8e894..65df653 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -958,6 +958,7 @@ void LLInventoryView::cleanup() | |||
958 | { | 958 | { |
959 | sActiveViews.get(i)->destroy(); | 959 | sActiveViews.get(i)->destroy(); |
960 | } | 960 | } |
961 | gInventory.empty(); | ||
961 | } | 962 | } |
962 | 963 | ||
963 | void LLInventoryView::toggleFindOptions() | 964 | void LLInventoryView::toggleFindOptions() |
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 325fcbc..2ecdcb5 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp | |||
@@ -34,6 +34,9 @@ | |||
34 | #include "llpanellogin.h" | 34 | #include "llpanellogin.h" |
35 | #include "llpanelgeneral.h" | 35 | #include "llpanelgeneral.h" |
36 | 36 | ||
37 | #include "hippoGridManager.h" | ||
38 | #include "floaterlogin.h" | ||
39 | |||
37 | #include "indra_constants.h" // for key and mask constants | 40 | #include "indra_constants.h" // for key and mask constants |
38 | #include "llfontgl.h" | 41 | #include "llfontgl.h" |
39 | #include "llmd5.h" | 42 | #include "llmd5.h" |
@@ -63,12 +66,15 @@ | |||
63 | #include "llviewernetwork.h" | 66 | #include "llviewernetwork.h" |
64 | #include "llviewerwindow.h" // to link into child list | 67 | #include "llviewerwindow.h" // to link into child list |
65 | #include "llnotify.h" | 68 | #include "llnotify.h" |
69 | #include "llappviewer.h" // for gHideLinks | ||
66 | #include "llurlsimstring.h" | 70 | #include "llurlsimstring.h" |
67 | #include "lluictrlfactory.h" | 71 | #include "lluictrlfactory.h" |
68 | #include "llhttpclient.h" | 72 | #include "llhttpclient.h" |
69 | #include "llweb.h" | 73 | #include "llweb.h" |
70 | #include "llwebbrowserctrl.h" | 74 | #include "llwebbrowserctrl.h" |
71 | 75 | ||
76 | #include "llfloaterhtml.h" | ||
77 | |||
72 | #include "llfloaterhtmlhelp.h" | 78 | #include "llfloaterhtmlhelp.h" |
73 | #include "llfloatertos.h" | 79 | #include "llfloatertos.h" |
74 | 80 | ||
@@ -134,21 +140,8 @@ void LLLoginHandler::parse(const LLSD& queryMap) | |||
134 | mFirstName = queryMap["first_name"].asString(); | 140 | mFirstName = queryMap["first_name"].asString(); |
135 | mLastName = queryMap["last_name"].asString(); | 141 | mLastName = queryMap["last_name"].asString(); |
136 | 142 | ||
137 | EGridInfo grid_choice = GRID_INFO_NONE; | 143 | const std::string &grid = queryMap["grid"].asString(); |
138 | if (queryMap["grid"].asString() == "sl beta grid") | 144 | if (grid != "") gHippoGridManager->setCurrentGrid(grid); |
139 | { | ||
140 | grid_choice = GRID_INFO_ADITI; | ||
141 | } | ||
142 | else if (queryMap["grid"].asString() == "sl main grid") | ||
143 | { | ||
144 | grid_choice = GRID_INFO_AGNI; | ||
145 | } | ||
146 | |||
147 | if(grid_choice != GRID_INFO_NONE) | ||
148 | { | ||
149 | LLViewerLogin::getInstance()->setGridChoice(grid_choice); | ||
150 | } | ||
151 | |||
152 | std::string startLocation = queryMap["location"].asString(); | 145 | std::string startLocation = queryMap["location"].asString(); |
153 | 146 | ||
154 | if (startLocation == "specify") | 147 | if (startLocation == "specify") |
@@ -262,11 +255,6 @@ namespace { | |||
262 | boost::intrusive_ptr< LLIamHereLogin > gResponsePtr = 0; | 255 | boost::intrusive_ptr< LLIamHereLogin > gResponsePtr = 0; |
263 | }; | 256 | }; |
264 | 257 | ||
265 | void set_start_location(LLUICtrl* ctrl, void* data) | ||
266 | { | ||
267 | LLURLSimString::setString(ctrl->getValue().asString()); | ||
268 | } | ||
269 | |||
270 | //--------------------------------------------------------------------------- | 258 | //--------------------------------------------------------------------------- |
271 | // Public methods | 259 | // Public methods |
272 | //--------------------------------------------------------------------------- | 260 | //--------------------------------------------------------------------------- |
@@ -353,13 +341,13 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, | |||
353 | combo->setCurrentByIndex( 0 ); | 341 | combo->setCurrentByIndex( 0 ); |
354 | } | 342 | } |
355 | 343 | ||
356 | combo->setCommitCallback( &set_start_location ); | ||
357 | 344 | ||
358 | LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo"); | 345 | LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo"); |
359 | server_choice_combo->setCommitCallback(onSelectServer); | 346 | server_choice_combo->setCommitCallback(onSelectServer); |
360 | server_choice_combo->setFocusLostCallback(onServerComboLostFocus); | 347 | //server_choice_combo->setFocusLostCallback(onServerComboLostFocus); |
361 | 348 | ||
362 | childSetAction("connect_btn", onClickConnect, this); | 349 | childSetAction("connect_btn", onClickConnect, this); |
350 | childSetAction("grid_btn", onClickGrid, this); | ||
363 | 351 | ||
364 | setDefaultBtn("connect_btn"); | 352 | setDefaultBtn("connect_btn"); |
365 | 353 | ||
@@ -661,6 +649,7 @@ void LLPanelLogin::show(const LLRect &rect, | |||
661 | 649 | ||
662 | // Make sure that focus always goes here (and use the latest sInstance that was just created) | 650 | // Make sure that focus always goes here (and use the latest sInstance that was just created) |
663 | gFocusMgr.setDefaultKeyboardFocus(sInstance); | 651 | gFocusMgr.setDefaultKeyboardFocus(sInstance); |
652 | LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel()); | ||
664 | } | 653 | } |
665 | 654 | ||
666 | // static | 655 | // static |
@@ -705,7 +694,7 @@ void LLPanelLogin::setFields(const std::string& firstname, const std::string& la | |||
705 | 694 | ||
706 | 695 | ||
707 | // static | 696 | // static |
708 | void LLPanelLogin::addServer(const std::string& server, S32 domain_name) | 697 | void LLPanelLogin::addServer(const std::string& server) |
709 | { | 698 | { |
710 | if (!sInstance) | 699 | if (!sInstance) |
711 | { | 700 | { |
@@ -713,17 +702,29 @@ void LLPanelLogin::addServer(const std::string& server, S32 domain_name) | |||
713 | return; | 702 | return; |
714 | } | 703 | } |
715 | 704 | ||
716 | LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); | 705 | const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick(); |
717 | combo->add(server, LLSD(domain_name) ); | ||
718 | combo->setCurrentByIndex(0); | ||
719 | } | ||
720 | 706 | ||
707 | LLComboBox *grids = sInstance->getChild<LLComboBox>("server_combo"); | ||
708 | S32 selectIndex = -1, i = 0; | ||
709 | grids->removeall(); | ||
710 | if (defaultGrid != "") { | ||
711 | grids->add(defaultGrid); | ||
712 | selectIndex = i++; | ||
713 | } | ||
714 | HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid(); | ||
715 | for (it = gHippoGridManager->beginGrid(); it != end; ++it) { | ||
716 | const std::string &grid = it->second->getGridNick(); | ||
717 | if (grid != defaultGrid) { | ||
718 | grids->add(grid); | ||
719 | //if (grid == mCurGrid) selectIndex = i; | ||
720 | i++; | ||
721 | } | ||
722 | } | ||
723 | grids->setCurrentByIndex(0); | ||
721 | 724 | ||
722 | // static | 725 | //LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); |
723 | void LLPanelLogin::setServer(S32 domain_name) | 726 | //combo->add(server, LLSD(domain_name) ); |
724 | { | 727 | //combo->setCurrentByIndex(0); |
725 | LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); | ||
726 | combo->setCurrentByIndex(domain_name); | ||
727 | } | 728 | } |
728 | 729 | ||
729 | // static | 730 | // static |
@@ -816,7 +817,12 @@ void LLPanelLogin::refreshLocation( bool force_visible ) | |||
816 | sInstance->childSetVisible("start_location_combo", show_start); | 817 | sInstance->childSetVisible("start_location_combo", show_start); |
817 | sInstance->childSetVisible("start_location_text", show_start); | 818 | sInstance->childSetVisible("start_location_text", show_start); |
818 | 819 | ||
820 | /*#if LL_RELEASE_FOR_DOWNLOAD | ||
821 | BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid"); | ||
822 | sInstance->childSetVisible("server_combo", show_server); | ||
823 | #else*/ | ||
819 | sInstance->childSetVisible("server_combo", TRUE); | 824 | sInstance->childSetVisible("server_combo", TRUE); |
825 | //#endif | ||
820 | 826 | ||
821 | #endif | 827 | #endif |
822 | } | 828 | } |
@@ -849,18 +855,39 @@ void LLPanelLogin::setAlwaysRefresh(bool refresh) | |||
849 | } | 855 | } |
850 | 856 | ||
851 | 857 | ||
858 | // static | ||
859 | void LLPanelLogin::refreshLoginPage() | ||
860 | { | ||
861 | if (!sInstance) return; | ||
862 | |||
863 | sInstance->childSetVisible("create_new_account_text", | ||
864 | !gHippoGridManager->getConnectedGrid()->getRegisterUrl().empty()); | ||
865 | sInstance->childSetVisible("forgot_password_text", | ||
866 | !gHippoGridManager->getConnectedGrid()->getPasswordUrl().empty()); | ||
867 | |||
868 | // kick off a request to grab the url manually | ||
869 | gResponsePtr = LLIamHereLogin::build(sInstance); | ||
870 | std::string login_page = gHippoGridManager->getConnectedGrid()->getLoginPage(); | ||
871 | if (!login_page.empty()) { | ||
872 | LLHTTPClient::head(login_page, gResponsePtr); | ||
873 | } else { | ||
874 | sInstance->setSiteIsAlive(false); | ||
875 | } | ||
876 | } | ||
877 | |||
852 | 878 | ||
853 | void LLPanelLogin::loadLoginPage() | 879 | void LLPanelLogin::loadLoginPage() |
854 | { | 880 | { |
855 | if (!sInstance) return; | 881 | if (!sInstance) return; |
856 | 882 | ||
857 | std::ostringstream oStr; | ||
858 | 883 | ||
859 | std::string login_page = gSavedSettings.getString("LoginPage"); | 884 | std::string login_page = gHippoGridManager->getConnectedGrid()->getLoginPage(); |
860 | if (login_page.empty()) | 885 | if (login_page.empty()) { |
861 | { | 886 | sInstance->setSiteIsAlive(false); |
862 | login_page = sInstance->getString( "real_url" ); | 887 | return; |
863 | } | 888 | } |
889 | |||
890 | std::ostringstream oStr; | ||
864 | oStr << login_page; | 891 | oStr << login_page; |
865 | 892 | ||
866 | // Use the right delimeter depending on how LLURI parses the URL | 893 | // Use the right delimeter depending on how LLURI parses the URL |
@@ -895,11 +922,12 @@ void LLPanelLogin::loadLoginPage() | |||
895 | curl_free(curl_version); | 922 | curl_free(curl_version); |
896 | 923 | ||
897 | // Grid | 924 | // Grid |
898 | char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridCodeName().c_str(), 0); | 925 | char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridLabel().c_str(), 0); |
899 | oStr << "&grid=" << curl_grid; | 926 | oStr << "&grid=" << curl_grid; |
900 | curl_free(curl_grid); | 927 | curl_free(curl_grid); |
901 | 928 | ||
902 | gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid()); | 929 | gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid()); |
930 | //LLViewerLogin::getInstance()->setMenuColor(); | ||
903 | gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor()); | 931 | gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor()); |
904 | 932 | ||
905 | 933 | ||
@@ -1033,12 +1061,27 @@ void LLPanelLogin::onClickConnect(void *) | |||
1033 | } | 1061 | } |
1034 | else | 1062 | else |
1035 | { | 1063 | { |
1064 | if (gHideLinks) | ||
1065 | { | ||
1066 | gViewerWindow->alertXml("MustHaveAccountToLogInNoLinks"); | ||
1067 | } | ||
1068 | else | ||
1069 | { | ||
1036 | gViewerWindow->alertXml("MustHaveAccountToLogIn", | 1070 | gViewerWindow->alertXml("MustHaveAccountToLogIn", |
1037 | LLPanelLogin::newAccountAlertCallback); | 1071 | LLPanelLogin::newAccountAlertCallback); |
1038 | } | 1072 | } |
1039 | } | 1073 | } |
1040 | } | 1074 | } |
1075 | } | ||
1041 | 1076 | ||
1077 | void LLPanelLogin::onClickGrid(void *) | ||
1078 | { | ||
1079 | if (sInstance && sInstance->mCallback) | ||
1080 | { | ||
1081 | LoginFloater::newShow(std::string("Test"), false, LoginFloater::testCallback, NULL); | ||
1082 | } | ||
1083 | } | ||
1084 | |||
1042 | 1085 | ||
1043 | // static | 1086 | // static |
1044 | void LLPanelLogin::newAccountAlertCallback(S32 option, void*) | 1087 | void LLPanelLogin::newAccountAlertCallback(S32 option, void*) |
@@ -1104,7 +1147,7 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) | |||
1104 | } | 1147 | } |
1105 | 1148 | ||
1106 | // static | 1149 | // static |
1107 | void LLPanelLogin::onSelectServer(LLUICtrl*, void*) | 1150 | void LLPanelLogin::onSelectServer(LLUICtrl* ctrl, void*) |
1108 | { | 1151 | { |
1109 | // *NOTE: The paramters for this method are ignored. | 1152 | // *NOTE: The paramters for this method are ignored. |
1110 | // LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) | 1153 | // LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) |
@@ -1113,11 +1156,31 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*) | |||
1113 | // The user twiddled with the grid choice ui. | 1156 | // The user twiddled with the grid choice ui. |
1114 | // apply the selection to the grid setting. | 1157 | // apply the selection to the grid setting. |
1115 | std::string grid_label; | 1158 | std::string grid_label; |
1116 | S32 grid_index; | 1159 | //S32 grid_index; |
1117 | 1160 | ||
1118 | LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); | 1161 | LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); |
1119 | LLSD combo_val = combo->getValue(); | 1162 | LLSD combo_val = combo->getValue(); |
1120 | 1163 | ||
1164 | std::string mCurGrid = ctrl->getValue().asString(); | ||
1165 | //KOW | ||
1166 | gHippoGridManager->setCurrentGrid(mCurGrid); | ||
1167 | //gHippoGridManager->setDefaultGrid(mCurGrid); | ||
1168 | //gHippoGridManager->saveFile(); | ||
1169 | HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid); | ||
1170 | if (gridInfo) { | ||
1171 | //childSetText("gridnick", gridInfo->getGridNick()); | ||
1172 | //platform->setCurrentByIndex(gridInfo->getPlatform()); | ||
1173 | //childSetText("gridname", gridInfo->getGridName()); | ||
1174 | LLPanelLogin::setFields( gridInfo->getFirstName(), gridInfo->getLastName(), gridInfo->getAvatarPassword(), 1 ); | ||
1175 | } | ||
1176 | //gHippoGridManager->setCurrentGrid(mCurGrid); | ||
1177 | |||
1178 | |||
1179 | |||
1180 | llwarns << "current grid = " << mCurGrid << llendl; | ||
1181 | |||
1182 | /* | ||
1183 | |||
1121 | if (LLSD::TypeInteger == combo_val.type()) | 1184 | if (LLSD::TypeInteger == combo_val.type()) |
1122 | { | 1185 | { |
1123 | grid_index = combo->getValue().asInteger(); | 1186 | grid_index = combo->getValue().asInteger(); |
@@ -1142,17 +1205,27 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*) | |||
1142 | vl->resetURIs(); | 1205 | vl->resetURIs(); |
1143 | if(grid_index != GRID_INFO_OTHER) | 1206 | if(grid_index != GRID_INFO_OTHER) |
1144 | { | 1207 | { |
1145 | vl->setGridChoice((EGridInfo)grid_index); | 1208 | vl->setGridChoice(grid_index); |
1146 | } | 1209 | } |
1147 | else | 1210 | else |
1148 | { | 1211 | { |
1149 | vl->setGridChoice(grid_label); | 1212 | vl->setGridChoice(grid_label); |
1150 | } | 1213 | } |
1151 | 1214 | ||
1215 | // clear the password if we are switching grids so we don't send | ||
1216 | // the wrong pass to the wrong grid. | ||
1217 | if (sInstance) | ||
1218 | { | ||
1219 | // no method to clear a text box? | ||
1220 | const std::string nothing(""); | ||
1221 | sInstance->childSetText("password_edit", nothing); | ||
1222 | } | ||
1223 | */ | ||
1152 | // grid changed so show new splash screen (possibly) | 1224 | // grid changed so show new splash screen (possibly) |
1153 | loadLoginPage(); | 1225 | loadLoginPage(); |
1154 | } | 1226 | } |
1155 | 1227 | ||
1228 | /* | ||
1156 | void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) | 1229 | void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) |
1157 | { | 1230 | { |
1158 | LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); | 1231 | LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); |
@@ -1161,3 +1234,4 @@ void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) | |||
1161 | onSelectServer(combo, NULL); | 1234 | onSelectServer(combo, NULL); |
1162 | } | 1235 | } |
1163 | } | 1236 | } |
1237 | */ | ||
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 | ||
65 | extern LLLoginHandler gLoginHandler; | 66 | extern 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 | ||
108 | private: | 109 | private: |
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 8d5aa9e..ffd7f3d 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" | |||
222 | static bool gUseCircuitCallbackCalled = false; | 231 | static bool gUseCircuitCallbackCalled = false; |
223 | 232 | ||
224 | EStartupState LLStartUp::gStartupState = STATE_FIRST; | 233 | EStartupState LLStartUp::gStartupState = STATE_FIRST; |
225 | 234 | bool LLStartUp::mStartedOnce = false; | |
235 | bool 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(); | |||
248 | void callback_choose_gender(S32 option, void* userdata); | 258 | void callback_choose_gender(S32 option, void* userdata); |
249 | void init_start_screen(S32 location_id); | 259 | void init_start_screen(S32 location_id); |
250 | void release_start_screen(); | 260 | void release_start_screen(); |
251 | void reset_login(); | ||
252 | void apply_udp_blacklist(const std::string& csv); | 261 | void apply_udp_blacklist(const std::string& csv); |
253 | 262 | ||
254 | void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) | 263 | void 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. |
@@ -659,7 +669,7 @@ bool idle_startup() | |||
659 | 669 | ||
660 | show_connect_box = false; | 670 | show_connect_box = false; |
661 | } | 671 | } |
662 | else if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3) | 672 | else if((gSavedSettings.getLLSD("UserLoginInfo").size() == 3) && !LLStartUp::shouldAutoLogin()) |
663 | { | 673 | { |
664 | LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); | 674 | LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); |
665 | firstname = cmd_line_login[0].asString(); | 675 | firstname = cmd_line_login[0].asString(); |
@@ -726,12 +736,19 @@ bool idle_startup() | |||
726 | if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) | 736 | if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) |
727 | { | 737 | { |
728 | LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL; | 738 | LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL; |
739 | sAuthUris.clear(); | ||
740 | sAuthUriNum = -1; | ||
729 | 741 | ||
730 | gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); | 742 | gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); |
731 | // Push our window frontmost | 743 | // Push our window frontmost |
732 | gViewerWindow->getWindow()->show(); | 744 | gViewerWindow->getWindow()->show(); |
733 | 745 | ||
734 | timeout_count = 0; | 746 | timeout_count = 0; |
747 | |||
748 | if(LLStartUp::shouldAutoLogin()) | ||
749 | { | ||
750 | show_connect_box = false; | ||
751 | } | ||
735 | 752 | ||
736 | if (show_connect_box) | 753 | if (show_connect_box) |
737 | { | 754 | { |
@@ -814,6 +831,18 @@ bool idle_startup() | |||
814 | lastname = gLoginHandler.mLastName; | 831 | lastname = gLoginHandler.mLastName; |
815 | web_login_key = gLoginHandler.mWebLoginKey; | 832 | web_login_key = gLoginHandler.mWebLoginKey; |
816 | } | 833 | } |
834 | |||
835 | if(!gLoginHandler.mPassword.empty()) | ||
836 | { | ||
837 | firstname = gLoginHandler.mFirstName; | ||
838 | lastname = gLoginHandler.mLastName; | ||
839 | password = gLoginHandler.mPassword; | ||
840 | |||
841 | gLoginHandler.mFirstName = ""; | ||
842 | gLoginHandler.mLastName = ""; | ||
843 | gLoginHandler.mPassword = ""; | ||
844 | LLStartUp::setShouldAutoLogin(false); | ||
845 | } | ||
817 | 846 | ||
818 | if (show_connect_box) | 847 | if (show_connect_box) |
819 | { | 848 | { |
@@ -841,10 +870,11 @@ bool idle_startup() | |||
841 | } | 870 | } |
842 | gSavedSettings.setBOOL("RememberPassword", remember_password); | 871 | gSavedSettings.setBOOL("RememberPassword", remember_password); |
843 | 872 | ||
844 | LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << LL_ENDL; | 873 | LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL; |
845 | gDebugInfo["LoginName"] = firstname + " " + lastname; | 874 | gDebugInfo["LoginName"] = firstname + " " + lastname; |
846 | } | 875 | } |
847 | 876 | ||
877 | gHippoGridManager->setCurrentGridAsConnected(); | ||
848 | // create necessary directories | 878 | // create necessary directories |
849 | // *FIX: these mkdir's should error check | 879 | // *FIX: these mkdir's should error check |
850 | gDirUtilp->setLindenUserDir(firstname, lastname); | 880 | gDirUtilp->setLindenUserDir(firstname, lastname); |
@@ -1053,6 +1083,10 @@ bool idle_startup() | |||
1053 | LLStringUtil::format_map_t args; | 1083 | LLStringUtil::format_map_t args; |
1054 | args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); | 1084 | args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); |
1055 | auth_desc = LLTrans::getString("LoginInProgress", args); | 1085 | auth_desc = LLTrans::getString("LoginInProgress", args); |
1086 | |||
1087 | //Since we are about to login, we don't want the client to attempt auto login | ||
1088 | //again until the user does a grid2grid teleport. | ||
1089 | LLStartUp::setShouldAutoLogin(false); | ||
1056 | LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); | 1090 | LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); |
1057 | } | 1091 | } |
1058 | 1092 | ||
@@ -1092,13 +1126,15 @@ bool idle_startup() | |||
1092 | hashed_mac.hex_digest(hashed_mac_string); | 1126 | hashed_mac.hex_digest(hashed_mac_string); |
1093 | 1127 | ||
1094 | // TODO if statement here to use web_login_key | 1128 | // TODO if statement here to use web_login_key |
1129 | if(web_login_key.isNull()){ | ||
1095 | sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); | 1130 | sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); |
1096 | LLUserAuth::getInstance()->authenticate( | 1131 | LLUserAuth::getInstance()->authenticate( |
1097 | sAuthUris[sAuthUriNum], | 1132 | sAuthUris[sAuthUriNum], |
1098 | auth_method, | 1133 | auth_method, |
1099 | firstname, | 1134 | firstname, |
1100 | lastname, | 1135 | lastname, |
1101 | password, // web_login_key, | 1136 | password, |
1137 | //web_login_key, | ||
1102 | start.str(), | 1138 | start.str(), |
1103 | gSkipOptionalUpdate, | 1139 | gSkipOptionalUpdate, |
1104 | gAcceptTOS, | 1140 | gAcceptTOS, |
@@ -1107,6 +1143,22 @@ bool idle_startup() | |||
1107 | requested_options, | 1143 | requested_options, |
1108 | hashed_mac_string, | 1144 | hashed_mac_string, |
1109 | LLAppViewer::instance()->getSerialNumber()); | 1145 | LLAppViewer::instance()->getSerialNumber()); |
1146 | } else { | ||
1147 | LLUserAuth::getInstance()->authenticate( | ||
1148 | sAuthUris[sAuthUriNum], | ||
1149 | auth_method, | ||
1150 | firstname, | ||
1151 | lastname, | ||
1152 | web_login_key, | ||
1153 | start.str(), | ||
1154 | gSkipOptionalUpdate, | ||
1155 | gAcceptTOS, | ||
1156 | gAcceptCriticalMessage, | ||
1157 | gLastExecEvent, | ||
1158 | requested_options, | ||
1159 | hashed_mac_string, | ||
1160 | LLAppViewer::instance()->getSerialNumber()); | ||
1161 | } | ||
1110 | 1162 | ||
1111 | // reset globals | 1163 | // reset globals |
1112 | gAcceptTOS = FALSE; | 1164 | gAcceptTOS = FALSE; |
@@ -1166,7 +1218,6 @@ bool idle_startup() | |||
1166 | LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; | 1218 | LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; |
1167 | std::ostringstream emsg; | 1219 | std::ostringstream emsg; |
1168 | bool quit = false; | 1220 | bool quit = false; |
1169 | bool update = false; | ||
1170 | std::string login_response; | 1221 | std::string login_response; |
1171 | std::string reason_response; | 1222 | std::string reason_response; |
1172 | std::string message_response; | 1223 | std::string message_response; |
@@ -1210,7 +1261,11 @@ bool idle_startup() | |||
1210 | reason_response = LLUserAuth::getInstance()->getResponse("reason"); | 1261 | reason_response = LLUserAuth::getInstance()->getResponse("reason"); |
1211 | message_response = LLUserAuth::getInstance()->getResponse("message"); | 1262 | message_response = LLUserAuth::getInstance()->getResponse("message"); |
1212 | 1263 | ||
1213 | if (!message_response.empty()) | 1264 | if (gHideLinks && reason_response == "disabled") |
1265 | { | ||
1266 | emsg << gDisabledMessage; | ||
1267 | } | ||
1268 | else if (!message_response.empty()) | ||
1214 | { | 1269 | { |
1215 | // XUI: fix translation for strings returned during login | 1270 | // XUI: fix translation for strings returned during login |
1216 | // We need a generic table for translations | 1271 | // We need a generic table for translations |
@@ -1268,7 +1323,16 @@ bool idle_startup() | |||
1268 | if(reason_response == "update") | 1323 | if(reason_response == "update") |
1269 | { | 1324 | { |
1270 | auth_message = LLUserAuth::getInstance()->getResponse("message"); | 1325 | auth_message = LLUserAuth::getInstance()->getResponse("message"); |
1271 | update = true; | 1326 | if (show_connect_box) |
1327 | { | ||
1328 | update_app(TRUE, auth_message); | ||
1329 | LLStartUp::setStartupState( STATE_UPDATE_CHECK ); | ||
1330 | return false; | ||
1331 | } | ||
1332 | else | ||
1333 | { | ||
1334 | quit = true; | ||
1335 | } | ||
1272 | } | 1336 | } |
1273 | if(reason_response == "optional") | 1337 | if(reason_response == "optional") |
1274 | { | 1338 | { |
@@ -1306,21 +1370,6 @@ bool idle_startup() | |||
1306 | break; | 1370 | break; |
1307 | } | 1371 | } |
1308 | 1372 | ||
1309 | if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate")) | ||
1310 | { | ||
1311 | gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); | ||
1312 | if (show_connect_box) | ||
1313 | { | ||
1314 | update_app(TRUE, auth_message); | ||
1315 | LLStartUp::setStartupState( STATE_UPDATE_CHECK ); | ||
1316 | return false; | ||
1317 | } | ||
1318 | else | ||
1319 | { | ||
1320 | quit = true; | ||
1321 | } | ||
1322 | } | ||
1323 | |||
1324 | // Version update and we're not showing the dialog | 1373 | // Version update and we're not showing the dialog |
1325 | if(quit) | 1374 | if(quit) |
1326 | { | 1375 | { |
@@ -1533,6 +1582,42 @@ bool idle_startup() | |||
1533 | } | 1582 | } |
1534 | } | 1583 | } |
1535 | 1584 | ||
1585 | // Override grid info with anything sent in the login response | ||
1586 | std::string tmp = LLUserAuth::getInstance()->getResponse("gridname"); | ||
1587 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp); | ||
1588 | tmp = LLUserAuth::getInstance()->getResponse("loginuri"); | ||
1589 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp); | ||
1590 | tmp = LLUserAuth::getInstance()->getResponse("welcome"); | ||
1591 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp); | ||
1592 | tmp = LLUserAuth::getInstance()->getResponse("loginpage"); | ||
1593 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp); | ||
1594 | tmp = LLUserAuth::getInstance()->getResponse("economy"); | ||
1595 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp); | ||
1596 | tmp = LLUserAuth::getInstance()->getResponse("helperuri"); | ||
1597 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp); | ||
1598 | tmp = LLUserAuth::getInstance()->getResponse("about"); | ||
1599 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp); | ||
1600 | tmp = LLUserAuth::getInstance()->getResponse("website"); | ||
1601 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp); | ||
1602 | tmp = LLUserAuth::getInstance()->getResponse("help"); | ||
1603 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp); | ||
1604 | tmp = LLUserAuth::getInstance()->getResponse("support"); | ||
1605 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp); | ||
1606 | tmp = LLUserAuth::getInstance()->getResponse("register"); | ||
1607 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp); | ||
1608 | tmp = LLUserAuth::getInstance()->getResponse("account"); | ||
1609 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp); | ||
1610 | tmp = LLUserAuth::getInstance()->getResponse("password"); | ||
1611 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp); | ||
1612 | tmp = LLUserAuth::getInstance()->getResponse("search"); | ||
1613 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp); | ||
1614 | tmp = LLUserAuth::getInstance()->getResponse("currency"); | ||
1615 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp); | ||
1616 | tmp = LLUserAuth::getInstance()->getResponse("real_currency"); | ||
1617 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp); | ||
1618 | tmp = LLUserAuth::getInstance()->getResponse("directory_fee"); | ||
1619 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str())); | ||
1620 | gHippoGridManager->saveFile(); | ||
1536 | 1621 | ||
1537 | // JC: gesture loading done below, when we have an asset system | 1622 | // JC: gesture loading done below, when we have an asset system |
1538 | // in place. Don't delete/clear user_credentials until then. | 1623 | // in place. Don't delete/clear user_credentials until then. |
@@ -1557,8 +1642,10 @@ bool idle_startup() | |||
1557 | LLStringUtil::format_map_t args; | 1642 | LLStringUtil::format_map_t args; |
1558 | args["[ERROR_MESSAGE]"] = emsg.str(); | 1643 | args["[ERROR_MESSAGE]"] = emsg.str(); |
1559 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); | 1644 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); |
1560 | reset_login(); | 1645 | LLStartUp::resetLogin(); |
1561 | gSavedSettings.setBOOL("AutoLogin", FALSE); | 1646 | gSavedSettings.setBOOL("AutoLogin", FALSE); |
1647 | //this might be redundant | ||
1648 | LLStartUp::setShouldAutoLogin(false); | ||
1562 | show_connect_box = true; | 1649 | show_connect_box = true; |
1563 | } | 1650 | } |
1564 | 1651 | ||
@@ -1577,8 +1664,10 @@ bool idle_startup() | |||
1577 | LLStringUtil::format_map_t args; | 1664 | LLStringUtil::format_map_t args; |
1578 | args["[ERROR_MESSAGE]"] = emsg.str(); | 1665 | args["[ERROR_MESSAGE]"] = emsg.str(); |
1579 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); | 1666 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); |
1580 | reset_login(); | 1667 | LLStartUp::resetLogin(); |
1581 | gSavedSettings.setBOOL("AutoLogin", FALSE); | 1668 | gSavedSettings.setBOOL("AutoLogin", FALSE); |
1669 | //this might be redundant | ||
1670 | LLStartUp::setShouldAutoLogin(false); | ||
1582 | show_connect_box = true; | 1671 | show_connect_box = true; |
1583 | // Don't save an incorrect password to disk. | 1672 | // Don't save an incorrect password to disk. |
1584 | save_password_to_disk(NULL); | 1673 | save_password_to_disk(NULL); |
@@ -1592,6 +1681,7 @@ bool idle_startup() | |||
1592 | if (STATE_WORLD_INIT == LLStartUp::getStartupState()) | 1681 | if (STATE_WORLD_INIT == LLStartUp::getStartupState()) |
1593 | { | 1682 | { |
1594 | set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); | 1683 | set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); |
1684 | gDisconnected=FALSE; | ||
1595 | display_startup(); | 1685 | display_startup(); |
1596 | // We should have an agent id by this point. | 1686 | // We should have an agent id by this point. |
1597 | llassert(!(gAgentID == LLUUID::null)); | 1687 | llassert(!(gAgentID == LLUUID::null)); |
@@ -1620,10 +1710,11 @@ bool idle_startup() | |||
1620 | LLWaterParamManager::initClass(); | 1710 | LLWaterParamManager::initClass(); |
1621 | 1711 | ||
1622 | // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering | 1712 | // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering |
1713 | |||
1714 | if (!LLStartUp::getStartedOnce()) | ||
1623 | LLViewerObject::initVOClasses(); | 1715 | LLViewerObject::initVOClasses(); |
1624 | 1716 | ||
1625 | display_startup(); | 1717 | display_startup(); |
1626 | |||
1627 | // This is where we used to initialize gWorldp. Original comment said: | 1718 | // This is where we used to initialize gWorldp. Original comment said: |
1628 | // World initialization must be done after above window init | 1719 | // World initialization must be done after above window init |
1629 | 1720 | ||
@@ -1766,7 +1857,7 @@ bool idle_startup() | |||
1766 | //reset statistics | 1857 | //reset statistics |
1767 | LLViewerStats::getInstance()->resetStats(); | 1858 | LLViewerStats::getInstance()->resetStats(); |
1768 | 1859 | ||
1769 | if (!gNoRender) | 1860 | if ((!gNoRender)&&(!LLStartUp::getStartedOnce())) |
1770 | { | 1861 | { |
1771 | // | 1862 | // |
1772 | // Set up all of our statistics UI stuff. | 1863 | // Set up all of our statistics UI stuff. |
@@ -2038,6 +2129,7 @@ bool idle_startup() | |||
2038 | LLAvatarTracker::instance().addBuddyList(list); | 2129 | LLAvatarTracker::instance().addBuddyList(list); |
2039 | } | 2130 | } |
2040 | 2131 | ||
2132 | /* | ||
2041 | options.clear(); | 2133 | options.clear(); |
2042 | if(LLUserAuth::getInstance()->getOptions("ui-config", options)) | 2134 | if(LLUserAuth::getInstance()->getOptions("ui-config", options)) |
2043 | { | 2135 | { |
@@ -2056,6 +2148,7 @@ bool idle_startup() | |||
2056 | } | 2148 | } |
2057 | } | 2149 | } |
2058 | } | 2150 | } |
2151 | */ | ||
2059 | options.clear(); | 2152 | options.clear(); |
2060 | bool show_hud = false; | 2153 | bool show_hud = false; |
2061 | if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) | 2154 | if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) |
@@ -2143,6 +2236,7 @@ bool idle_startup() | |||
2143 | // Create the inventory views | 2236 | // Create the inventory views |
2144 | llinfos << "Creating Inventory Views" << llendl; | 2237 | llinfos << "Creating Inventory Views" << llendl; |
2145 | LLInventoryView::showAgentInventory(); | 2238 | LLInventoryView::showAgentInventory(); |
2239 | llinfos << "Inventory Views Created" << llendl; | ||
2146 | 2240 | ||
2147 | // Hide the inventory if it wasn't shown at exit | 2241 | // Hide the inventory if it wasn't shown at exit |
2148 | if(!shown_at_exit) | 2242 | if(!shown_at_exit) |
@@ -2206,7 +2300,7 @@ bool idle_startup() | |||
2206 | gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); | 2300 | gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); |
2207 | }; | 2301 | }; |
2208 | 2302 | ||
2209 | if (!gNoRender) | 2303 | if ((!gNoRender)&&(!LLStartUp::getStartedOnce())) |
2210 | { | 2304 | { |
2211 | // JC: Initializing audio requests many sounds for download. | 2305 | // JC: Initializing audio requests many sounds for download. |
2212 | init_audio(); | 2306 | init_audio(); |
@@ -2366,25 +2460,11 @@ bool idle_startup() | |||
2366 | LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); | 2460 | LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); |
2367 | } | 2461 | } |
2368 | 2462 | ||
2369 | |||
2370 | // We now have an inventory skeleton, so if this is a user's first | ||
2371 | // login, we can start setting up their clothing and avatar | ||
2372 | // appearance. This helps to avoid the generic "Ruth" avatar in | ||
2373 | // the orientation island tutorial experience. JC | ||
2374 | if (gAgent.isFirstLogin() | ||
2375 | && !sInitialOutfit.empty() // registration set up an outfit | ||
2376 | && !sInitialOutfitGender.empty() // and a gender | ||
2377 | && gAgent.getAvatarObject() // can't wear clothes without object | ||
2378 | && !gAgent.isGenderChosen() ) // nothing already loading | ||
2379 | { | ||
2380 | // Start loading the wearables, textures, gestures | ||
2381 | LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); | ||
2382 | } | ||
2383 | |||
2384 | // wait precache-delay and for agent's avatar or a lot longer. | 2463 | // wait precache-delay and for agent's avatar or a lot longer. |
2385 | if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) | 2464 | if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) |
2386 | || (timeout_frac > 3.f)) | 2465 | || (timeout_frac > 3.f)) |
2387 | { | 2466 | { |
2467 | wearables_timer.reset(); | ||
2388 | LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); | 2468 | LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); |
2389 | } | 2469 | } |
2390 | else | 2470 | else |
@@ -2400,7 +2480,6 @@ bool idle_startup() | |||
2400 | 2480 | ||
2401 | if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) | 2481 | if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) |
2402 | { | 2482 | { |
2403 | static LLFrameTimer wearables_timer; | ||
2404 | 2483 | ||
2405 | const F32 wearables_time = wearables_timer.getElapsedTimeF32(); | 2484 | const F32 wearables_time = wearables_timer.getElapsedTimeF32(); |
2406 | const F32 MAX_WEARABLES_TIME = 10.f; | 2485 | const F32 MAX_WEARABLES_TIME = 10.f; |
@@ -2508,6 +2587,7 @@ bool idle_startup() | |||
2508 | LLUserAuth::getInstance()->reset(); | 2587 | LLUserAuth::getInstance()->reset(); |
2509 | 2588 | ||
2510 | LLStartUp::setStartupState( STATE_STARTED ); | 2589 | LLStartUp::setStartupState( STATE_STARTED ); |
2590 | LLStartUp::setStartedOnce(true); | ||
2511 | 2591 | ||
2512 | // Unmute audio if desired and setup volumes. | 2592 | // Unmute audio if desired and setup volumes. |
2513 | // Unmute audio if desired and setup volumes. | 2593 | // Unmute audio if desired and setup volumes. |
@@ -2524,7 +2604,7 @@ bool idle_startup() | |||
2524 | gDebugView->mFastTimerView->setVisible(TRUE); | 2604 | gDebugView->mFastTimerView->setVisible(TRUE); |
2525 | #endif | 2605 | #endif |
2526 | 2606 | ||
2527 | LLAppViewer::instance()->handleLoginComplete(); | 2607 | LLAppViewer::instance()->initMainloopTimeout("Mainloop Init"); |
2528 | 2608 | ||
2529 | return TRUE; | 2609 | return TRUE; |
2530 | } | 2610 | } |
@@ -2554,14 +2634,15 @@ void login_show() | |||
2554 | // UI textures have been previously loaded in doPreloadImages() | 2634 | // UI textures have been previously loaded in doPreloadImages() |
2555 | 2635 | ||
2556 | LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL; | 2636 | LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL; |
2557 | LL_INFOS("AppInit") << "getGridChoice is " << LLViewerLogin::getInstance()->getGridChoice() << LL_ENDL; | ||
2558 | 2637 | ||
2638 | //KOW | ||
2639 | /* | ||
2559 | LLViewerLogin* vl = LLViewerLogin::getInstance(); | 2640 | LLViewerLogin* vl = LLViewerLogin::getInstance(); |
2560 | for(int grid_index = GRID_INFO_NONE + 1; grid_index < GRID_INFO_OTHER; ++grid_index) | 2641 | for(int grid_index = 1; grid_index < GRID_INFO_OTHER; ++grid_index) |
2561 | { | 2642 | { |
2562 | LLPanelLogin::addServer(vl->getKnownGridLabel((EGridInfo)grid_index), grid_index); | 2643 | LLPanelLogin::addServer(vl->getKnownGridLabel(grid_index), grid_index); |
2563 | } | 2644 | } |
2564 | LLPanelLogin::setServer(LLViewerLogin::getInstance()->getGridChoice()-1); | 2645 | */ |
2565 | } | 2646 | } |
2566 | 2647 | ||
2567 | // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. | 2648 | // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. |
@@ -2840,6 +2921,7 @@ void update_app(BOOL mandatory, const std::string& auth_msg) | |||
2840 | 2921 | ||
2841 | void update_dialog_callback(S32 option, void *userdata) | 2922 | void update_dialog_callback(S32 option, void *userdata) |
2842 | { | 2923 | { |
2924 | std::string update_exe_path; | ||
2843 | bool mandatory = userdata != NULL; | 2925 | bool mandatory = userdata != NULL; |
2844 | 2926 | ||
2845 | #if !LL_RELEASE_FOR_DOWNLOAD | 2927 | #if !LL_RELEASE_FOR_DOWNLOAD |
@@ -2856,8 +2938,6 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2856 | if (mandatory) | 2938 | if (mandatory) |
2857 | { | 2939 | { |
2858 | LLAppViewer::instance()->forceQuit(); | 2940 | LLAppViewer::instance()->forceQuit(); |
2859 | // Bump them back to the login screen. | ||
2860 | //reset_login(); | ||
2861 | } | 2941 | } |
2862 | else | 2942 | else |
2863 | { | 2943 | { |
@@ -2882,7 +2962,7 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2882 | // *TODO constantize this guy | 2962 | // *TODO constantize this guy |
2883 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); | 2963 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); |
2884 | 2964 | ||
2885 | if(LLAppViewer::sUpdaterInfo) | 2965 | /* if(LLAppViewer::sUpdaterInfo) |
2886 | { | 2966 | { |
2887 | delete LLAppViewer::sUpdaterInfo ; | 2967 | delete LLAppViewer::sUpdaterInfo ; |
2888 | } | 2968 | } |
@@ -2955,14 +3035,16 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2955 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; | 3035 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; |
2956 | 3036 | ||
2957 | // Run the auto-updater. | 3037 | // Run the auto-updater. |
2958 | system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ | 3038 | */ |
2959 | 3039 | //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ | |
3040 | /* | ||
2960 | #elif LL_LINUX | 3041 | #elif LL_LINUX |
2961 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" | 3042 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" |
2962 | "Please download the latest version from www.secondlife.com.", | 3043 | "Please download the latest version from www.secondlife.com.", |
2963 | LLStringUtil::null, OSMB_OK); | 3044 | LLStringUtil::null, OSMB_OK); |
2964 | #endif | 3045 | #endif |
2965 | LLAppViewer::instance()->forceQuit(); | 3046 | LLAppViewer::instance()->forceQuit(); |
3047 | */ | ||
2966 | } | 3048 | } |
2967 | 3049 | ||
2968 | void use_circuit_callback(void**, S32 result) | 3050 | void use_circuit_callback(void**, S32 result) |
@@ -2978,7 +3060,7 @@ void use_circuit_callback(void**, S32 result) | |||
2978 | LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; | 3060 | LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; |
2979 | gViewerWindow->alertXml("LoginPacketNeverReceived", | 3061 | gViewerWindow->alertXml("LoginPacketNeverReceived", |
2980 | login_alert_status, NULL); | 3062 | login_alert_status, NULL); |
2981 | reset_login(); | 3063 | LLStartUp::resetLogin(); |
2982 | } | 3064 | } |
2983 | else | 3065 | else |
2984 | { | 3066 | { |
@@ -3928,7 +4010,16 @@ void LLStartUp::setStartupState( EStartupState state ) | |||
3928 | } | 4010 | } |
3929 | 4011 | ||
3930 | 4012 | ||
3931 | void reset_login() | 4013 | //static |
4014 | void LLStartUp::setStartedOnce(bool started) | ||
4015 | { | ||
4016 | mStartedOnce=started; | ||
4017 | } | ||
4018 | |||
4019 | |||
4020 | //displays the screen and cleans up UI | ||
4021 | // static | ||
4022 | void LLStartUp::resetLogin() | ||
3932 | { | 4023 | { |
3933 | LLStartUp::setStartupState( STATE_LOGIN_SHOW ); | 4024 | LLStartUp::setStartupState( STATE_LOGIN_SHOW ); |
3934 | 4025 | ||
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 | ||
109 | private: | 114 | private: |
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/llviewerjointattachment.h b/linden/indra/newview/llviewerjointattachment.h index dd63bfd..cbfee0b 100644 --- a/linden/indra/newview/llviewerjointattachment.h +++ b/linden/indra/newview/llviewerjointattachment.h | |||
@@ -98,7 +98,9 @@ protected: | |||
98 | void calcLOD(); | 98 | void calcLOD(); |
99 | 99 | ||
100 | protected: | 100 | protected: |
101 | LLPointer<LLViewerObject> mAttachedObject; | 101 | |
102 | // Backlink only; don't make this an LLPointer. | ||
103 | LLViewerObject* mAttachedObject; | ||
102 | BOOL mVisibleInFirst; | 104 | BOOL mVisibleInFirst; |
103 | LLVector3 mOriginalPos; | 105 | LLVector3 mOriginalPos; |
104 | S32 mGroup; | 106 | S32 mGroup; |
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index e83bc2d..8b3014b 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -575,6 +575,11 @@ void set_underclothes_menu_options() | |||
575 | 575 | ||
576 | void init_menus() | 576 | void init_menus() |
577 | { | 577 | { |
578 | if (gMenuHolder) | ||
579 | { | ||
580 | cleanup_menus(); | ||
581 | } | ||
582 | |||
578 | S32 top = gViewerWindow->getRootView()->getRect().getHeight(); | 583 | S32 top = gViewerWindow->getRootView()->getRect().getHeight(); |
579 | S32 width = gViewerWindow->getRootView()->getRect().getWidth(); | 584 | S32 width = gViewerWindow->getRootView()->getRect().getWidth(); |
580 | 585 | ||
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 | ||
465 | class 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 | |||
465 | class LLFileQuit : public view_listener_t | 474 | class 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 1b2ba22..0a9889f 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 | ||
38 | struct 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 | |||
47 | static 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 | |||
68 | const EGridInfo DEFAULT_GRID_CHOICE = GRID_INFO_AGNI; | ||
69 | 40 | ||
70 | 41 | ||
71 | unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ | 42 | unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ |
72 | 43 | ||
73 | LLViewerLogin::LLViewerLogin() : | ||
74 | mGridChoice(DEFAULT_GRID_CHOICE) | ||
75 | { | ||
76 | } | ||
77 | |||
78 | void 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 | |||
107 | void 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 | |||
138 | void LLViewerLogin::resetURIs() | ||
139 | { | ||
140 | // Clear URIs when picking a new server | ||
141 | gSavedSettings.setValue("CmdLineLoginURI", LLSD::emptyArray()); | ||
142 | gSavedSettings.setString("CmdLineHelperURI", ""); | ||
143 | } | ||
144 | |||
145 | EGridInfo LLViewerLogin::getGridChoice() const | ||
146 | { | ||
147 | return mGridChoice; | ||
148 | } | ||
149 | |||
150 | std::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 | |||
164 | std::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 | |||
175 | std::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 | ||
184 | void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const | 45 | void 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 | ||
229 | std::string LLViewerLogin::getHelperURI() const | 92 | const 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()) | 97 | const 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 | ||
249 | bool LLViewerLogin::isInProductionGrid() | 102 | const 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); | 107 | bool 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, | 112 | bool 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 | ||
117 | bool 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 | ||
36 | class LLHost; | ||
37 | |||
38 | enum 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 | |||
52 | class LLViewerLogin : public LLSingleton<LLViewerLogin> | 40 | class LLViewerLogin : public LLSingleton<LLViewerLogin> |
53 | { | 41 | { |
54 | public: | 42 | public: |
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 | ||
96 | private: | 51 | bool isInProductionGrid(); |
97 | EGridInfo mGridChoice; | ||
98 | std::string mGridName; | ||
99 | }; | 52 | }; |
100 | 53 | ||
54 | |||
101 | const S32 MAC_ADDRESS_BYTES = 6; | 55 | const S32 MAC_ADDRESS_BYTES = 6; |
102 | extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ | 56 | extern 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 | ||
53 | class LLAgent; // TODO: Get rid of this. | 54 | class LLAgent; // TODO: Get rid of this. |
54 | class LLAudioSource; | 55 | class LLAudioSource; |
diff --git a/linden/indra/newview/llviewerobjectlist.h b/linden/indra/newview/llviewerobjectlist.h index 0d0fd85..8ed4a34 100644 --- a/linden/indra/newview/llviewerobjectlist.h +++ b/linden/indra/newview/llviewerobjectlist.h | |||
@@ -43,6 +43,7 @@ | |||
43 | // project includes | 43 | // project includes |
44 | #include "llviewerobject.h" | 44 | #include "llviewerobject.h" |
45 | 45 | ||
46 | class LLCamera; | ||
46 | class LLNetMap; | 47 | class LLNetMap; |
47 | class LLDebugBeacon; | 48 | class LLDebugBeacon; |
48 | 49 | ||
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 2240d44..99bbb2a 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp | |||
@@ -1574,69 +1574,82 @@ void LLViewerWindow::initWorldUI() | |||
1574 | S32 width = mRootView->getRect().getWidth(); | 1574 | S32 width = mRootView->getRect().getWidth(); |
1575 | LLRect full_window(0, height, width, 0); | 1575 | LLRect full_window(0, height, width, 0); |
1576 | 1576 | ||
1577 | if ( gBottomPanel == NULL ) // Don't re-enter if objects are alreay created | 1577 | if (gBottomPanel) |
1578 | { | 1578 | mRootView->removeChild(gBottomPanel, TRUE); |
1579 | // panel containing chatbar, toolbar, and overlay, over floaters | 1579 | // panel containing chatbar, toolbar, and overlay, over floaters |
1580 | gBottomPanel = new LLBottomPanel(mRootView->getRect()); | 1580 | gBottomPanel = new LLBottomPanel(mRootView->getRect()); |
1581 | mRootView->addChild(gBottomPanel); | 1581 | mRootView->addChild(gBottomPanel); |
1582 | 1582 | ||
1583 | // View for hover information | 1583 | if (gHoverView) |
1584 | gHoverView = new LLHoverView(std::string("gHoverView"), full_window); | 1584 | mRootView->removeChild(gHoverView, TRUE); |
1585 | gHoverView->setVisible(TRUE); | 1585 | // View for hover information |
1586 | mRootView->addChild(gHoverView); | 1586 | gHoverView = new LLHoverView(std::string("gHoverView"), full_window); |
1587 | gHoverView->setVisible(TRUE); | ||
1588 | mRootView->addChild(gHoverView); | ||
1587 | 1589 | ||
1588 | gIMMgr = LLIMMgr::getInstance(); | 1590 | gIMMgr = LLIMMgr::getInstance(); |
1589 | 1591 | ||
1590 | if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) | 1592 | if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) |
1591 | { | 1593 | { |
1592 | LLFloaterChat::getInstance(LLSD())->loadHistory(); | 1594 | LLFloaterChat::getInstance(LLSD())->loadHistory(); |
1593 | } | 1595 | } |
1594 | 1596 | ||
1595 | LLRect morph_view_rect = full_window; | 1597 | LLRect morph_view_rect = full_window; |
1596 | morph_view_rect.stretch( -STATUS_BAR_HEIGHT ); | 1598 | morph_view_rect.stretch( -STATUS_BAR_HEIGHT ); |
1597 | morph_view_rect.mTop = full_window.mTop - 32; | 1599 | morph_view_rect.mTop = full_window.mTop - 32; |
1598 | gMorphView = new LLMorphView(std::string("gMorphView"), morph_view_rect ); | 1600 | if (gMorphView) |
1599 | mRootView->addChild(gMorphView); | 1601 | mRootView->removeChild(gMorphView, TRUE); |
1600 | gMorphView->setVisible(FALSE); | 1602 | |
1603 | gMorphView = new LLMorphView(std::string("gMorphView"), morph_view_rect ); | ||
1604 | mRootView->addChild(gMorphView); | ||
1605 | gMorphView->setVisible(FALSE); | ||
1601 | 1606 | ||
1602 | // *Note: this is where gFloaterMute used to be initialized. | 1607 | // *Note: this is where gFloaterMute used to be initialized. |
1603 | 1608 | ||
1604 | LLWorldMapView::initClass(); | 1609 | LLWorldMapView::initClass(); |
1605 | 1610 | ||
1606 | adjust_rect_centered_partial_zoom("FloaterWorldMapRect2", full_window); | 1611 | adjust_rect_centered_partial_zoom("FloaterWorldMapRect2", full_window); |
1607 | 1612 | ||
1613 | if (!gFloaterWorldMap) | ||
1614 | { | ||
1608 | gFloaterWorldMap = new LLFloaterWorldMap(); | 1615 | gFloaterWorldMap = new LLFloaterWorldMap(); |
1609 | gFloaterWorldMap->setVisible(FALSE); | 1616 | gFloaterWorldMap->setVisible(FALSE); |
1617 | } | ||
1610 | 1618 | ||
1611 | // | 1619 | // |
1612 | // Tools for building | 1620 | // Tools for building |
1613 | // | 1621 | // |
1614 | |||
1615 | // Toolbox floater | ||
1616 | init_menus(); | ||
1617 | 1622 | ||
1623 | // Toolbox floater | ||
1624 | init_menus(); | ||
1625 | if (!gFloaterTools) | ||
1626 | { | ||
1618 | gFloaterTools = new LLFloaterTools(); | 1627 | gFloaterTools = new LLFloaterTools(); |
1619 | gFloaterTools->setVisible(FALSE); | 1628 | gFloaterTools->setVisible(FALSE); |
1629 | } | ||
1620 | 1630 | ||
1631 | if (!gStatusBar) | ||
1632 | { | ||
1621 | // Status bar | 1633 | // Status bar |
1622 | S32 menu_bar_height = gMenuBarView->getRect().getHeight(); | 1634 | S32 menu_bar_height = gMenuBarView->getRect().getHeight(); |
1623 | LLRect root_rect = getRootView()->getRect(); | 1635 | LLRect root_rect = mRootView->getRect(); |
1624 | LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height); | 1636 | LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height); |
1625 | gStatusBar = new LLStatusBar(std::string("status"), status_rect); | 1637 | gStatusBar = new LLStatusBar(std::string("status"), status_rect); |
1626 | gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP); | 1638 | gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP); |
1627 | 1639 | ||
1628 | gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE); | 1640 | gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE); |
1629 | gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight()); | 1641 | gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight()); |
1630 | // sync bg color with menu bar | 1642 | // sync bg color with menu bar |
1631 | gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() ); | 1643 | gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() ); |
1644 | mRootView->addChild(gStatusBar); | ||
1645 | } | ||
1632 | 1646 | ||
1633 | LLFloaterChatterBox::createInstance(LLSD()); | 1647 | LLFloaterChatterBox::createInstance(LLSD()); |
1634 | 1648 | ||
1635 | getRootView()->addChild(gStatusBar); | ||
1636 | 1649 | ||
1637 | // menu holder appears on top to get first pass at all mouse events | 1650 | // menu holder appears on top to get first pass at all mouse events |
1638 | getRootView()->sendChildToFront(gMenuHolder); | 1651 | |
1639 | } | 1652 | mRootView->sendChildToFront(gMenuHolder); |
1640 | } | 1653 | } |
1641 | 1654 | ||
1642 | // Destroy the UI | 1655 | // Destroy the UI |
@@ -4891,7 +4904,6 @@ void LLBottomPanel::draw() | |||
4891 | 4904 | ||
4892 | void* LLBottomPanel::createHUD(void* data) | 4905 | void* LLBottomPanel::createHUD(void* data) |
4893 | { | 4906 | { |
4894 | delete gHUDView; | ||
4895 | gHUDView = new LLHUDView(); | 4907 | gHUDView = new LLHUDView(); |
4896 | return gHUDView; | 4908 | return gHUDView; |
4897 | } | 4909 | } |
@@ -4899,14 +4911,12 @@ void* LLBottomPanel::createHUD(void* data) | |||
4899 | 4911 | ||
4900 | void* LLBottomPanel::createOverlayBar(void* data) | 4912 | void* LLBottomPanel::createOverlayBar(void* data) |
4901 | { | 4913 | { |
4902 | delete gOverlayBar; | ||
4903 | gOverlayBar = new LLOverlayBar(); | 4914 | gOverlayBar = new LLOverlayBar(); |
4904 | return gOverlayBar; | 4915 | return gOverlayBar; |
4905 | } | 4916 | } |
4906 | 4917 | ||
4907 | void* LLBottomPanel::createToolBar(void* data) | 4918 | void* LLBottomPanel::createToolBar(void* data) |
4908 | { | 4919 | { |
4909 | delete gToolBar; | ||
4910 | gToolBar = new LLToolBar(); | 4920 | gToolBar = new LLToolBar(); |
4911 | return gToolBar; | 4921 | return gToolBar; |
4912 | } | 4922 | } |
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 158977e..281caf3 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp | |||
@@ -695,7 +695,11 @@ LLVOAvatar::LLVOAvatar( | |||
695 | mTexEyeColor( NULL ), | 695 | mTexEyeColor( NULL ), |
696 | mNeedsSkin(FALSE), | 696 | mNeedsSkin(FALSE), |
697 | mUpdatePeriod(1), | 697 | mUpdatePeriod(1), |
698 | mFullyLoadedInitialized(FALSE) | 698 | // mFullyLoadedInitialized(FALSE) |
699 | mPreviousFullyLoaded(FALSE), | ||
700 | mVisibleChat( FALSE ), | ||
701 | mFullyLoadedInitialized(FALSE), | ||
702 | mFullyLoaded(FALSE) | ||
699 | { | 703 | { |
700 | LLMemType mt(LLMemType::MTYPE_AVATAR); | 704 | LLMemType mt(LLMemType::MTYPE_AVATAR); |
701 | 705 | ||
@@ -1811,6 +1815,10 @@ BOOL LLVOAvatar::buildSkeleton(LLVOAvatarSkeletonInfo *info) | |||
1811 | { | 1815 | { |
1812 | LLMemType mt(LLMemType::MTYPE_AVATAR); | 1816 | LLMemType mt(LLMemType::MTYPE_AVATAR); |
1813 | 1817 | ||
1818 | //this can get called with null info on startup sometimes | ||
1819 | if (!info) | ||
1820 | return FALSE; | ||
1821 | |||
1814 | //------------------------------------------------------------------------- | 1822 | //------------------------------------------------------------------------- |
1815 | // allocate joints | 1823 | // allocate joints |
1816 | //------------------------------------------------------------------------- | 1824 | //------------------------------------------------------------------------- |
@@ -2191,9 +2199,10 @@ void LLVOAvatar::buildCharacter() | |||
2191 | LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), | 2199 | LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), |
2192 | NULL, &object_selected_and_point_valid, | 2200 | NULL, &object_selected_and_point_valid, |
2193 | &attach_label, attachment); | 2201 | &attach_label, attachment); |
2202 | if (item){ | ||
2194 | item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); | 2203 | item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); |
2195 | gAttachSubMenu->append(item); | 2204 | gAttachSubMenu->append(item); |
2196 | 2205 | } | |
2197 | gDetachSubMenu->append(new LLMenuItemCallGL(attachment->getName(), | 2206 | gDetachSubMenu->append(new LLMenuItemCallGL(attachment->getName(), |
2198 | &handle_detach_from_avatar, object_attached, &detach_label, attachment)); | 2207 | &handle_detach_from_avatar, object_attached, &detach_label, attachment)); |
2199 | 2208 | ||
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 |
46 | LLWearableList gWearableList; // Globally constructed; be careful that there's no dependency with gAgent. | 49 | LLWearableList 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/llworld.cpp b/linden/indra/newview/llworld.cpp index 9ee789a..4c02191 100644 --- a/linden/indra/newview/llworld.cpp +++ b/linden/indra/newview/llworld.cpp | |||
@@ -117,6 +117,7 @@ LLWorld::LLWorld() : | |||
117 | 117 | ||
118 | void LLWorld::destroyClass() | 118 | void LLWorld::destroyClass() |
119 | { | 119 | { |
120 | mHoleWaterObjects.clear(); | ||
120 | gObjectList.destroy(); | 121 | gObjectList.destroy(); |
121 | for(region_list_t::iterator region_it = mRegionList.begin(); region_it != mRegionList.end(); ) | 122 | for(region_list_t::iterator region_it = mRegionList.begin(); region_it != mRegionList.end(); ) |
122 | { | 123 | { |
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 | |||
14 | PasswordsPrefPanel::PasswordsPrefPanel() | ||
15 | : LLPanel(std::string("panel_preferences_passwords")) | ||
16 | { | ||
17 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_passwords.xml"); | ||
18 | } | ||
19 | |||
20 | PasswordsPrefPanel::~PasswordsPrefPanel() | ||
21 | { | ||
22 | delete mController; | ||
23 | mController = NULL; | ||
24 | } | ||
25 | |||
26 | BOOL PasswordsPrefPanel::postBuild() | ||
27 | { | ||
28 | mController = new PasswordsController(this); | ||
29 | return TRUE; | ||
30 | } | ||
31 | |||
32 | void PasswordsPrefPanel::apply() | ||
33 | { | ||
34 | |||
35 | } | ||
36 | |||
37 | void 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 | |||
14 | class PasswordsController; | ||
15 | |||
16 | class PasswordsPrefPanel : public LLPanel | ||
17 | { | ||
18 | public: | ||
19 | PasswordsPrefPanel(); | ||
20 | virtual ~PasswordsPrefPanel(); | ||
21 | |||
22 | BOOL postBuild(); | ||
23 | |||
24 | void apply(); | ||
25 | void cancel(); | ||
26 | protected: | ||
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"> | ||
2242 | Friends can give permissions to track each | ||
2243 | other on the map and receive online status updates. | ||
2244 | |||
2245 | Offer 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="<Type region name>"> | ||
147 | <Type region name> | ||
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 81c49e7..a251f95 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 | |||
@@ -72,6 +72,10 @@ | |||
72 | userdata="" /> | 72 | userdata="" /> |
73 | </menu_item_call> | 73 | </menu_item_call> |
74 | <menu_item_separator /> | 74 | <menu_item_separator /> |
75 | <menu_item_call name="Logout" label="Logout" | ||
76 | shortcut="control|alt|Q"> | ||
77 | <on_click function="File.Logout" userdata="" /> | ||
78 | </menu_item_call> | ||
75 | <menu_item_call name="Quit" label="Quit" | 79 | <menu_item_call name="Quit" label="Quit" |
76 | shortcut="control|Q"> | 80 | shortcut="control|Q"> |
77 | <on_click function="File.Quit" userdata="" /> | 81 | <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" |