aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorJacek Antonelli2009-09-25 22:15:49 -0500
committerJacek Antonelli2009-09-25 22:15:49 -0500
commit5ff1687542240fe9b00d4c217b764770fc369c06 (patch)
treebc5a1dbc882c19120ca00efb9914d70059cd79cb /linden
parentMerge remote branch 'mccabe/1.2.0-next' into next (diff)
parentRemoved grid stuff from World Map (for now). (diff)
downloadmeta-impy-5ff1687542240fe9b00d4c217b764770fc369c06.zip
meta-impy-5ff1687542240fe9b00d4c217b764770fc369c06.tar.gz
meta-impy-5ff1687542240fe9b00d4c217b764770fc369c06.tar.bz2
meta-impy-5ff1687542240fe9b00d4c217b764770fc369c06.tar.xz
Merge branch 'gridmanager' into next
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/llcommon/llstring.h1
-rw-r--r--linden/indra/llvfs/lldir.cpp12
-rw-r--r--linden/indra/llvfs/lldir.h4
-rw-r--r--linden/indra/newview/CMakeLists.txt13
-rw-r--r--linden/indra/newview/app_settings/default_grids.xml37
-rw-r--r--linden/indra/newview/app_settings/settings.xml33
-rw-r--r--linden/indra/newview/floaterlogin.cpp726
-rw-r--r--linden/indra/newview/floaterlogin.h90
-rw-r--r--linden/indra/newview/hippoGridManager.cpp603
-rw-r--r--linden/indra/newview/hippoGridManager.h175
-rw-r--r--linden/indra/newview/hippoLimits.cpp54
-rw-r--r--linden/indra/newview/hippoLimits.h33
-rw-r--r--linden/indra/newview/hippoRestRequest.cpp54
-rw-r--r--linden/indra/newview/hippoRestRequest.h16
-rw-r--r--linden/indra/newview/hippoUpdate.cpp92
-rw-r--r--linden/indra/newview/hippoUpdate.h12
-rw-r--r--linden/indra/newview/llagent.cpp12
-rw-r--r--linden/indra/newview/llappviewer.cpp164
-rw-r--r--linden/indra/newview/llappviewer.h20
-rw-r--r--linden/indra/newview/llappviewerlinux.h3
-rw-r--r--linden/indra/newview/llcallingcard.cpp12
-rw-r--r--linden/indra/newview/llcallingcard.h2
-rw-r--r--linden/indra/newview/llchatbar.cpp1
-rw-r--r--linden/indra/newview/lldrawable.h1
-rw-r--r--linden/indra/newview/llfloaterworldmap.cpp8
-rw-r--r--linden/indra/newview/llfloaterworldmap.h7
-rw-r--r--linden/indra/newview/llinventorymodel.h6
-rw-r--r--linden/indra/newview/llinventoryview.cpp1
-rw-r--r--linden/indra/newview/llpanellogin.cpp166
-rw-r--r--linden/indra/newview/llpanellogin.h8
-rw-r--r--linden/indra/newview/llprefsim.cpp4
-rw-r--r--linden/indra/newview/llprogressview.cpp2
-rw-r--r--linden/indra/newview/llstartup.cpp211
-rw-r--r--linden/indra/newview/llstartup.h9
-rw-r--r--linden/indra/newview/lluserauth.cpp53
-rw-r--r--linden/indra/newview/llviewerjointattachment.h4
-rw-r--r--linden/indra/newview/llviewermenu.cpp5
-rw-r--r--linden/indra/newview/llviewermenufile.cpp15
-rw-r--r--linden/indra/newview/llviewermessage.cpp2
-rw-r--r--linden/indra/newview/llviewermessage.h2
-rw-r--r--linden/indra/newview/llviewernetwork.cpp201
-rw-r--r--linden/indra/newview/llviewernetwork.h63
-rw-r--r--linden/indra/newview/llviewerobject.h1
-rw-r--r--linden/indra/newview/llviewerobjectlist.h1
-rw-r--r--linden/indra/newview/llviewerwindow.cpp88
-rw-r--r--linden/indra/newview/llvoavatar.cpp13
-rw-r--r--linden/indra/newview/llwearablelist.cpp10
-rw-r--r--linden/indra/newview/llworld.cpp1
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/alerts.xml17
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_login.xml265
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml4
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_login.xml211
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml21
53 files changed, 3011 insertions, 558 deletions
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h
index 720b163..93bd89a 100644
--- a/linden/indra/llcommon/llstring.h
+++ b/linden/indra/llcommon/llstring.h
@@ -36,6 +36,7 @@
36#include <wctype.h> 36#include <wctype.h>
37#include <wchar.h> 37#include <wchar.h>
38#endif 38#endif
39#include "linden_common.h"
39 40
40const char LL_UNKNOWN_CHAR = '?'; 41const char LL_UNKNOWN_CHAR = '?';
41 42
diff --git a/linden/indra/llvfs/lldir.cpp b/linden/indra/llvfs/lldir.cpp
index 1dc00dd..eb705dd 100644
--- a/linden/indra/llvfs/lldir.cpp
+++ b/linden/indra/llvfs/lldir.cpp
@@ -520,19 +520,23 @@ std::string LLDir::getForbiddenFileChars()
520 return "\\/:*?\"<>|"; 520 return "\\/:*?\"<>|";
521} 521}
522 522
523void LLDir::setLindenUserDir(const std::string &first, const std::string &last) 523void LLDir::setLindenUserDir(const std::string &grid, const std::string &first, const std::string &last)
524{ 524{
525 // if both first and last aren't set, assume we're grabbing the cached dir 525 // if both first and last aren't set, assume we're grabbing the cached dir
526 if (!first.empty() && !last.empty()) 526 if (!first.empty() && !last.empty())
527 { 527 {
528 // some platforms have case-sensitive filesystems, so be 528 // some platforms have case-sensitive filesystems, so be
529 // utterly consistent with our firstname/lastname case. 529 // utterly consistent with our firstname/lastname case.
530 // std::string gridlower(grid);
531 // LLStringUtil::toLower(gridlower);
530 std::string firstlower(first); 532 std::string firstlower(first);
531 LLStringUtil::toLower(firstlower); 533 LLStringUtil::toLower(firstlower);
532 std::string lastlower(last); 534 std::string lastlower(last);
533 LLStringUtil::toLower(lastlower); 535 LLStringUtil::toLower(lastlower);
534 mLindenUserDir = getOSUserAppDir(); 536 mLindenUserDir = getOSUserAppDir();
535 mLindenUserDir += mDirDelimiter; 537 mLindenUserDir += mDirDelimiter;
538 // mLindenUserDir += gridlower;
539 // mLindenUserDir += "-";
536 mLindenUserDir += firstlower; 540 mLindenUserDir += firstlower;
537 mLindenUserDir += "_"; 541 mLindenUserDir += "_";
538 mLindenUserDir += lastlower; 542 mLindenUserDir += lastlower;
@@ -557,19 +561,23 @@ void LLDir::setChatLogsDir(const std::string &path)
557 } 561 }
558} 562}
559 563
560void LLDir::setPerAccountChatLogsDir(const std::string &first, const std::string &last) 564void LLDir::setPerAccountChatLogsDir(const std::string &grid, const std::string &first, const std::string &last)
561{ 565{
562 // if both first and last aren't set, assume we're grabbing the cached dir 566 // if both first and last aren't set, assume we're grabbing the cached dir
563 if (!first.empty() && !last.empty()) 567 if (!first.empty() && !last.empty())
564 { 568 {
565 // some platforms have case-sensitive filesystems, so be 569 // some platforms have case-sensitive filesystems, so be
566 // utterly consistent with our firstname/lastname case. 570 // utterly consistent with our firstname/lastname case.
571 // std::string gridlower(grid);
572 // LLStringUtil::toLower(gridlower);
567 std::string firstlower(first); 573 std::string firstlower(first);
568 LLStringUtil::toLower(firstlower); 574 LLStringUtil::toLower(firstlower);
569 std::string lastlower(last); 575 std::string lastlower(last);
570 LLStringUtil::toLower(lastlower); 576 LLStringUtil::toLower(lastlower);
571 mPerAccountChatLogsDir = getChatLogsDir(); 577 mPerAccountChatLogsDir = getChatLogsDir();
572 mPerAccountChatLogsDir += mDirDelimiter; 578 mPerAccountChatLogsDir += mDirDelimiter;
579 // mPerAccountChatLogsDir += gridlower;
580 // mPerAccountChatLogsDir += "-";
573 mPerAccountChatLogsDir += firstlower; 581 mPerAccountChatLogsDir += firstlower;
574 mPerAccountChatLogsDir += "_"; 582 mPerAccountChatLogsDir += "_";
575 mPerAccountChatLogsDir += lastlower; 583 mPerAccountChatLogsDir += lastlower;
diff --git a/linden/indra/llvfs/lldir.h b/linden/indra/llvfs/lldir.h
index b041afc..4ab5d85 100644
--- a/linden/indra/llvfs/lldir.h
+++ b/linden/indra/llvfs/lldir.h
@@ -119,8 +119,8 @@ class LLDir
119 static std::string getForbiddenFileChars(); 119 static std::string getForbiddenFileChars();
120 120
121 virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir 121 virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir
122 virtual void setPerAccountChatLogsDir(const std::string &first, const std::string &last); // Set the per user chat log directory. 122 virtual void setPerAccountChatLogsDir(const std::string &grid, const std::string &first, const std::string &last); // Set the per user chat log directory.
123 virtual void setLindenUserDir(const std::string &first, const std::string &last); // Set the linden user dir to this user's dir 123 virtual void setLindenUserDir(const std::string &grid, const std::string &first, const std::string &last); // Set the linden user dir to this user's dir
124 virtual void setSkinFolder(const std::string &skin_folder); 124 virtual void setSkinFolder(const std::string &skin_folder);
125 virtual bool setCacheDir(const std::string &path); 125 virtual bool setCacheDir(const std::string &path);
126 126
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index bb07922..e993564 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -61,7 +61,11 @@ include_directories(
61 ) 61 )
62 62
63set(viewer_SOURCE_FILES 63set(viewer_SOURCE_FILES
64 jcfloater_animation_list.cpp 64 floaterlogin.cpp
65 hippoGridManager.cpp
66 hippoLimits.cpp
67 hippoRestRequest.cpp
68 jcfloater_animation_list.cpp
65 llagent.cpp 69 llagent.cpp
66 llagentdata.cpp 70 llagentdata.cpp
67 llagentlanguage.cpp 71 llagentlanguage.cpp
@@ -463,8 +467,11 @@ endif (LINUX)
463set(viewer_HEADER_FILES 467set(viewer_HEADER_FILES
464 CMakeLists.txt 468 CMakeLists.txt
465 ViewerInstall.cmake 469 ViewerInstall.cmake
466 470 floaterlogin.h
467 jcfloater_animation_list.h 471 hippoGridManager.h
472 hippoLimits.h
473 hippoRestRequest.h
474 jcfloater_animation_list.h
468 llagent.h 475 llagent.h
469 llagentdata.h 476 llagentdata.h
470 llagentlanguage.h 477 llagentlanguage.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..13293cf
--- /dev/null
+++ b/linden/indra/newview/app_settings/default_grids.xml
@@ -0,0 +1,37 @@
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 <!-- Second Life -->
14 <map>
15 <key>gridnick</key><string>secondlife</string>
16 <key>gridname</key><string>Second Life</string>
17 <key>platform</key><string>SecondLife</string>
18 <key>loginuri</key><string>https://login.agni.lindenlab.com/cgi-bin/login.cgi</string>
19 <key>loginpage</key><string>http://secondlife.com/app/login/</string>
20 <key>helperuri</key><string>https://secondlife.com/helpers/</string>
21 <key>website</key><string>http://secondlife.com/</string>
22 <key>support</key><string>http://secondlife.com/support/</string>
23 <key>register</key><string>http://secondlife.com/registration/</string>
24 <key>password</key><string>http://secondlife.com/account/request.php</string>
25 </map>
26
27 <!-- Local Host -->
28 <map>
29 <key>gridnick</key><string>localhost</string>
30 <key>gridname</key><string>Local Host</string>
31 <key>platform</key><string>OpenSim</string>
32 <key>loginuri</key><string>http://127.0.0.1:9000/</string>
33 <key>helperuri</key><string>http://127.0.0.1:9000/</string>
34 </map>
35
36 </array>
37</llsd>
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 087c92f..efe32e7 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -10762,5 +10762,38 @@
10762 <key>Value</key> 10762 <key>Value</key>
10763 <integer>0</integer> 10763 <integer>0</integer>
10764 </map> 10764 </map>
10765 <key>DefaultGrid</key>
10766 <map>
10767 <key>Comment</key>
10768 <string>Nickname of the default grid</string>
10769 <key>Persist</key>
10770 <integer>1</integer>
10771 <key>Type</key>
10772 <string>String</string>
10773 <key>Value</key>
10774 <string>secondlife</string>
10775 </map>
10776 <key>KeepAppearance</key>
10777 <map>
10778 <key>Comment</key>
10779 <string>Keep appearance across grid teleport</string>
10780 <key>Persist</key>
10781 <integer>1</integer>
10782 <key>Type</key>
10783 <string>Boolean</string>
10784 <key>Value</key>
10785 <string>0</string>
10786 </map>
10787 <key>CheckForGridUpdates</key>
10788 <map>
10789 <key>Comment</key>
10790 <string>Check for grid info updates on the web server</string>
10791 <key>Persist</key>
10792 <integer>1</integer>
10793 <key>Type</key>
10794 <string>Boolean</string>
10795 <key>Value</key>
10796 <integer>1</integer>
10797 </map>
10765 </map> 10798 </map>
10766</llsd> 10799</llsd>
diff --git a/linden/indra/newview/floaterlogin.cpp b/linden/indra/newview/floaterlogin.cpp
new file mode 100644
index 0000000..17e4d0c
--- /dev/null
+++ b/linden/indra/newview/floaterlogin.cpp
@@ -0,0 +1,726 @@
1/*
2 * floaterlogin.cpp (floatergridmanager.cpp pls)
3 * This is Meerkats grid manager, and I accidentally finished it with the wrong name :)
4 * -Patrick Sapinski (Monday, August 17, 2009)
5 */
6
7#include "llviewerprecompiledheaders.h"
8
9#include <boost/algorithm/string.hpp>
10#include "llviewercontrol.h"
11#include "llviewerbuild.h"
12#include "llcombobox.h"
13#include "llscrolllistctrl.h"
14#include "llmd5.h"
15#include "llurlsimstring.h"
16#include "lluictrlfactory.h"
17#include "floaterlogin.h"
18#include "hippoGridManager.h"
19#include "llviewernetwork.h"
20#include "llpanellogin.h"
21
22#define PASSWORD_FILLER "123456789!123456"
23
24LoginFloater* LoginFloater::sInstance = NULL;
25LoginController* LoginFloater::sController = NULL;
26bool LoginFloater::sIsInitialLogin;
27std::string LoginFloater::sGrid;
28
29LoginFloater::LoginFloater()
30: LLFloater("floater_login")
31{
32
33 mState = NORMAL;
34 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_login.xml");
35
36
37 llwarns << "LoginFloater called" << llendl;
38
39
40 // configure the floater interface for non-initial login
41 setCanMinimize(!sIsInitialLogin);
42 setCanClose(!sIsInitialLogin);
43 setCanDrag(!sIsInitialLogin);
44 childSetVisible("server_combo", sIsInitialLogin);
45
46 if(!sIsInitialLogin)
47 {
48 LLButton* quit_btn = getChild<LLButton>("quit_btn");
49 quit_btn->setLabel(std::string("Cancel"));
50 setTitle(std::string("Grid Manager"));
51 }
52
53 center();
54 LLLineEditor* edit = getChild<LLLineEditor>("avatar_password_edit");
55 if (edit) edit->setDrawAsterixes(TRUE);
56 LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
57 combo->setAllowTextEntry(TRUE, 128, FALSE);
58
59 BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
60 std::string sim_string = LLURLSimString::sInstance.mSimString;
61 if (!sim_string.empty())
62 {
63 // Replace "<Type region name>" with this region name
64 combo->remove(2);
65 combo->add( sim_string );
66 combo->setTextEntry(sim_string);
67 combo->setCurrentByIndex( 2 );
68 }
69 else if (login_last)
70 {
71 combo->setCurrentByIndex( 1 );
72 }
73 else
74 {
75 combo->setCurrentByIndex( 0 );
76 }
77}
78
79
80LoginFloater::~LoginFloater()
81{
82 LoginFloater::sController = NULL;
83 LoginFloater::sInstance = NULL;
84}
85
86void LoginFloater::close()
87{
88 if(sInstance)
89 {
90 delete sInstance;
91 sInstance = NULL;
92 }
93}
94
95BOOL LoginFloater::postBuild()
96{
97 requires<LLScrollListCtrl>("grid_selector");
98 requires<LLLineEditor>("gridnick");
99 requires<LLLineEditor>("gridname");
100 requires<LLLineEditor>("loginuri");
101 requires<LLLineEditor>("loginpage");
102 requires<LLLineEditor>("helperuri");
103 requires<LLLineEditor>("website");
104 requires<LLLineEditor>("support");
105 requires<LLLineEditor>("register");
106 requires<LLLineEditor>("password");
107 requires<LLLineEditor>("first_name");
108 requires<LLLineEditor>("last_name");
109 requires<LLLineEditor>("avatar_password");
110 //requires<LLLineEditor>("search");
111 requires<LLButton>("btn_delete");
112 requires<LLButton>("btn_add");
113 requires<LLButton>("btn_copy");
114 requires<LLButton>("set_default");
115 requires<LLButton>("btn_gridinfo");
116 requires<LLButton>("btn_help_render_compat");
117 if (!checkRequirements()) return false;
118 LLLineEditor* password_edit = getChild<LLLineEditor>("avatar_password");
119 if (password_edit) password_edit->setDrawAsterixes(TRUE);
120
121 childSetAction("btn_delete", onClickDelete, this);
122 childSetAction("btn_add", onClickAdd, this);
123 childSetAction("btn_copy", onClickCopy, this);
124 childSetAction("btn_ok", onClickOk, this);
125 childSetAction("btn_apply", onClickApply, this);
126 childSetAction("set_default", onClickDefault, this);
127 childSetAction("btn_cancel", onClickCancel, this);
128//KOW childSetAction("set_default", onClickDefault, this);
129 childSetAction("btn_gridinfo", onClickGridInfo, this);
130//KOW childSetAction("btn_help_render_compat", onClickHelpRenderCompat, this);
131
132 childSetCommitCallback("grid_selector", onSelectGrid, this);
133//KOW childSetCommitCallback("platform", onSelectPlatform, this);
134
135 // !!!### server_choice_combo->setFocusLostCallback(onServerComboLostFocus);
136
137//KOW update();
138 return TRUE;
139}
140
141void LoginFloater::refresh_grids()
142{
143 const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
144 LLScrollListCtrl *grids = sInstance->getChild<LLScrollListCtrl>("grid_selector");
145 S32 selectIndex = -1, i = 0;
146 grids->deleteAllItems();
147 if (defaultGrid != "") {
148 LLSD value;
149 value["id"] = defaultGrid;
150 value["columns"][0]["column"] = "grid";
151 value["columns"][0]["value"] = defaultGrid;
152 grids->addElement(value);
153 selectIndex = i++;
154 }
155
156 HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
157 for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
158 const std::string &grid = it->second->getGridNick();
159 if (grid != defaultGrid) {
160 LLSD value;
161 value["id"] = grid;
162 value["columns"][0]["column"] = "grid";
163 value["columns"][0]["value"] = grid;
164 grids->addElement(value);
165
166 if (grid == sInstance->mCurGrid) selectIndex = i;
167 i++;
168 }
169 }
170 if ((sInstance->mState == ADD_NEW) || (sInstance->mState == ADD_COPY)) {
171 grids->addElement("<new>");
172 selectIndex = i++;
173 }
174 if (selectIndex >= 0) {
175 //grids->setCurrentByIndex(selectIndex);
176 } else {
177 //grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label
178 }
179
180 sInstance->childSetTextArg("default_grid", "[DEFAULT]", (defaultGrid != "")? defaultGrid: " ");
181
182 sInstance->childSetEnabled("btn_delete", (selectIndex >= 0));
183 sInstance->childSetEnabled("btn_copy", (sInstance->mState == NORMAL) && (selectIndex >= 0));
184 sInstance->childSetEnabled("set_default", (sInstance->mState == NORMAL) && (selectIndex > 0));
185 sInstance->childSetEnabled("gridnick", (sInstance->mState == ADD_NEW) || (sInstance->mState == ADD_COPY));
186
187 if (sInstance->mState == NORMAL) {
188 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(sInstance->mCurGrid);
189 if (gridInfo) {
190 sInstance->childSetText("gridnick", gridInfo->getGridNick());
191 //sInstance->childSetText("grid_name", gridInfo->getGridName());
192 sInstance->childSetText("loginuri", gridInfo->getLoginUri());
193 sInstance->childSetText("loginpage", gridInfo->getLoginPage());
194 sInstance->childSetText("helperuri", gridInfo->getHelperUri());
195 sInstance->childSetText("website", gridInfo->getWebSite());
196 sInstance->childSetText("support", gridInfo->getSupportUrl());
197 sInstance->childSetText("register", gridInfo->getRegisterUrl());
198 sInstance->childSetText("password", gridInfo->getPasswordUrl());
199
200 // sInstance->childSetText("first_name", gridInfo->getFirstName());
201 // sInstance->childSetText("last_name", gridInfo->getLastName());
202 // if(gridInfo->getAvatarPassword().length() == 32)
203 // sInstance->childSetText("avatar_password", std::string(PASSWORD_FILLER));
204 // else if(gridInfo->getPasswordUrl().empty())
205 // sInstance->childSetText("avatar_password", std::string(""));
206
207 // if (gridInfo->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) {
208 // //childSetEnabled("search", false);
209 // //childSetText("search", LLStringExplicit(""));
210 // childSetEnabled("render_compat", false);
211 // childSetValue("render_compat", false);
212 // } else {
213 // //childSetEnabled("search", true);
214 // //childSetText("search", gridInfo->getSearchUrl());
215 // childSetEnabled("render_compat", true);
216 // childSetValue("render_compat", gridInfo->isRenderCompat());
217 // }
218
219 } else {
220 std::string empty = "";
221 sInstance->childSetText("gridnick", empty);
222 sInstance->childSetText("gridname", empty);
223 sInstance->childSetText("loginuri", empty);
224 sInstance->childSetText("loginpage", empty);
225 sInstance->childSetText("helperuri", empty);
226 sInstance->childSetText("website", empty);
227 // sInstance->childSetText("first_name", empty);
228 // sInstance->childSetText("last_name", empty);
229 // sInstance->childSetText("avatar_password", empty);
230 }
231 } else if (sInstance->mState == ADD_NEW) {
232 llwarns << "ADD_NEW" << llendl;
233 std::string required = "<required>";
234 std::string empty = "";
235 sInstance->childSetText("gridnick", required);
236 sInstance->childSetText("gridname", empty);
237 sInstance->childSetText("loginuri", required);
238 sInstance->childSetText("loginpage", empty);
239 sInstance->childSetText("helperuri", empty);
240 sInstance->childSetText("website", empty);
241 sInstance->childSetText("support", empty);
242 sInstance->childSetText("register", empty);
243 sInstance->childSetText("password", empty);
244 // sInstance->childSetText("first_name", empty);
245 // sInstance->childSetText("last_name", empty);
246 // sInstance->childSetText("avatar_password", empty);
247 //childSetEnabled("search", true);
248 //childSetText("search", empty);
249 } else if (sInstance->mState == ADD_COPY) {
250 llwarns << "ADD_COPY" << llendl;
251 sInstance->childSetText("gridnick", LLStringExplicit("<required>"));
252 } else {
253 llwarns << "Illegal state " << sInstance->mState << '.' << llendl;
254 }
255 return;
256}
257
258void LoginFloater::update()
259{
260 mState = NORMAL;
261 mCurGrid = gHippoGridManager->getCurrentGridNick();
262 refresh_grids();
263 //KOW gHippoLimits->setLimits();
264}
265
266void LoginFloater::applyChanges()
267{
268 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
269 if (gridInfo)
270 {
271 if (gridInfo->getGridNick() == childGetValue("gridnick").asString())
272 {
273 gridInfo->setGridName(childGetValue("gridname"));
274 gridInfo->setLoginUri(childGetValue("loginuri"));
275 gridInfo->setLoginPage(childGetValue("loginpage"));
276 gridInfo->setHelperUri(childGetValue("helperuri"));
277 gridInfo->setWebSite(childGetValue("website"));
278 gridInfo->setSupportUrl(childGetValue("support"));
279 gridInfo->setRegisterUrl(childGetValue("register"));
280 gridInfo->setPasswordUrl(childGetValue("password"));
281 //gridInfo->setSearchUrl(childGetValue("search"));
282 gridInfo->setRenderCompat(childGetValue("render_compat"));
283
284 // gridInfo->setFirstName(childGetValue("first_name"));
285 // gridInfo->setLastName(childGetValue("last_name"));
286 // if(childGetValue("avatar_password").asString().empty())
287 // gridInfo->setAvatarPassword(std::string(""));
288 // else if(childGetValue("avatar_password").asString() != std::string(PASSWORD_FILLER))
289 // {
290 // // store account authentication data
291 // std::string auth_password = childGetValue("avatar_password");
292 // std::string hashed_password;
293 // hashPassword(auth_password, hashed_password);
294 // gridInfo->setAvatarPassword(hashed_password);
295 // }
296
297 //this bug was a feature -Patrick Sapinski (Friday, August 21, 2009)
298 //LLPanelLogin::setFields(gridInfo->getFirstName(), gridInfo->getLastName(),
299 // gridInfo->getAvatarPassword(), true);
300 }
301 else
302 {
303 llwarns << "Grid nickname mismatch, ignoring changes." << llendl;
304 }
305 }
306}
307
308
309bool LoginFloater::createNewGrid()
310{
311 // check nickname
312 std::string gridnick = childGetValue("gridnick");
313 if (gridnick == "<required>") gridnick = "";
314 HippoGridInfo::cleanUpGridNick(gridnick);
315 childSetValue("gridnick", (gridnick != "")? gridnick: "<required>");
316 if (gridnick == "") {
317 //KOW gViewerWindow->alertXml("GridsNoNick");
318 return false;
319 }
320 if (gHippoGridManager->getGrid(gridnick)) {
321 LLStringUtil::format_map_t args;
322 args["[NAME]"] = gridnick;
323 //KOW gViewerWindow->alertXml("GridExists", args);
324 return false;
325 }
326
327 // check login URI
328 std::string loginuri = childGetValue("loginuri");
329 if ((loginuri == "") || (loginuri == "<required>")) {
330 LLStringUtil::format_map_t args;
331 args["[NAME]"] = gridnick;
332 //KOW gViewerWindow->alertXml("GridsNoLoginUri", args);
333 return false;
334 }
335
336 // create new grid
337 HippoGridInfo *grid = new HippoGridInfo(gridnick);
338 grid->setGridName(childGetValue("gridname"));
339 grid->setLoginUri(loginuri);
340 grid->setLoginPage(childGetValue("loginpage"));
341 grid->setHelperUri(childGetValue("helperuri"));
342 grid->setWebSite(childGetValue("website"));
343 grid->setSupportUrl(childGetValue("support"));
344 grid->setRegisterUrl(childGetValue("register"));
345 grid->setPasswordUrl(childGetValue("password"));
346 //grid->setSearchUrl(childGetValue("search"));
347 grid->setRenderCompat(childGetValue("render_compat"));
348 gHippoGridManager->addGrid(grid);
349
350 // grid->setFirstName(childGetValue("first_name"));
351 // grid->setLastName(childGetValue("last_name"));
352 // if(childGetValue("avatar_password").asString().empty())
353 // grid->setAvatarPassword(std::string(""));
354 // else
355 // {
356 // std::string hashed_password;
357 // hashPassword(childGetValue("avatar_password"), hashed_password);
358 // grid->setAvatarPassword(hashed_password);
359 // }
360
361 mCurGrid = gridnick;
362 return true;
363}
364
365void LoginFloater::retrieveGridInfo()
366{
367 std::string loginuri = childGetValue("loginuri");
368 if ((loginuri == "") || (loginuri == "<required>")) {
369 //KOW gViewerWindow->alertXml("GridInfoNoLoginUri");
370 return;
371 }
372
373 HippoGridInfo *grid = 0;
374 bool cleanupGrid = false;
375 if (mState == NORMAL) {
376 grid = gHippoGridManager->getGrid(mCurGrid);
377 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
378 grid = new HippoGridInfo("");
379 cleanupGrid = true;
380 } else {
381 llerrs << "Illegal state " << mState << '.' << llendl;
382 return;
383 }
384 if (!grid) {
385 llerrs << "Internal error retrieving grid info." << llendl;
386 return;
387 }
388
389 grid->setLoginUri(loginuri);
390 if (grid->retrieveGridInfo()) {
391 if (grid->getGridNick() != "") childSetText("gridnick", grid->getGridNick());
392 if (grid->getGridName() != "") childSetText("gridname", grid->getGridName());
393 if (grid->getLoginUri() != "") childSetText("loginuri", grid->getLoginUri());
394 if (grid->getLoginPage() != "") childSetText("loginpage", grid->getLoginPage());
395 if (grid->getHelperUri() != "") childSetText("helperuri", grid->getHelperUri());
396 if (grid->getWebSite() != "") childSetText("website", grid->getWebSite());
397 if (grid->getSupportUrl() != "") childSetText("support", grid->getSupportUrl());
398 if (grid->getRegisterUrl() != "") childSetText("register", grid->getRegisterUrl());
399 if (grid->getPasswordUrl() != "") childSetText("password", grid->getPasswordUrl());
400 //if (grid->getSearchUrl() != "") childSetText("search", grid->getSearchUrl());
401 } else {
402 //KOW gViewerWindow->alertXml("GridInfoError");
403 }
404
405 if (cleanupGrid) delete grid;
406}
407
408void LoginFloater::apply()
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 //LLPanelLogin::refreshLoginPage();
421 gHippoGridManager->saveFile();
422 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
423}
424
425void LoginFloater::setDefault()
426{
427 if (mState == NORMAL) {
428 applyChanges();
429 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
430 if (!createNewGrid()) return;
431 } else {
432 llwarns << "Illegal state " << mState << '.' << llendl;
433 return;
434 }
435 gHippoGridManager->setCurrentGrid(mCurGrid);
436 gHippoGridManager->setDefaultGrid(mCurGrid);
437 gHippoGridManager->saveFile();
438 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
439}
440
441void LoginFloater::cancel()
442{
443 gHippoGridManager->discardAndReload();
444 update();
445}
446
447void LoginFloater::onSelectGrid(LLUICtrl* ctrl, void *data)
448{
449 LoginFloater* self = (LoginFloater*)data;
450 if (self->mState == NORMAL) {
451 self->applyChanges();
452 } else if ((self->mState == ADD_NEW) || (self->mState == ADD_COPY)) {
453 if (self->createNewGrid()) {
454 self->mState = NORMAL;
455 } else {
456 //LLScrollListCtrl *grids = self->getChild<LLScrollListCtrl>("grid_selector");
457 //grids->setCurrentByIndex(grids->getItemCount() - 1);
458 return;
459 }
460 } else {
461 llwarns << "Illegal state " << self->mState << '.' << llendl;
462 return;
463 }
464 self->mCurGrid = ctrl->getValue().asString();
465 self->refresh_grids();
466}
467
468//static
469void LoginFloater::onClickDelete(void *data)
470{
471 llwarns << "onclickdelete" << llendl;
472 LoginFloater* self = (LoginFloater*)data;
473 if (self->mState == NORMAL)
474 gHippoGridManager->deleteGrid(self->mCurGrid);
475 self->update();
476}
477
478//static
479void LoginFloater::onClickAdd(void *data)
480{
481 llwarns << "add" << llendl;
482 LoginFloater* self = (LoginFloater*)data;
483 self->mState = ADD_NEW;
484 self->refresh_grids();
485}
486
487
488//static
489void LoginFloater::onClickCopy(void *data)
490{
491 llwarns << "copy" << llendl;
492 LoginFloater* self = (LoginFloater*)data;
493 self->mState = ADD_COPY;
494 self->refresh_grids();
495}
496
497// static
498void LoginFloater::onClickOk(void* data)
499{
500 if(NULL==sInstance)
501 return;
502
503 sInstance->apply();
504 sInstance->close();
505}
506
507//static
508void LoginFloater::onClickApply(void *data)
509{
510 if(NULL==sInstance)
511 return;
512
513 sInstance->apply();
514 refresh_grids();
515}
516
517//static
518void LoginFloater::onClickDefault(void *data)
519{
520 sInstance->setDefault();
521 sInstance->refresh_grids();
522}
523
524//static
525void LoginFloater::onClickGridInfo(void *data)
526{
527 //HippoPanelGrids* self = (HippoPanelGrids*)data;
528 sInstance->retrieveGridInfo();
529}
530
531//static
532void LoginFloater::onClickCancel(void *data)
533{
534 sInstance->cancel();
535}
536
537void LoginFloater::setAlwaysRefresh(bool refresh)
538{
539 // wargames 2: dead code, LLPanelLogin compatibility
540 return;
541}
542
543void LoginFloater::refreshLocation( bool force_visible )
544{
545
546 llwarns << "refreshLocation called" << llendl;
547
548 if (!sInstance) return;
549
550 LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
551
552 if (LLURLSimString::parse())
553 {
554 combo->setCurrentByIndex( 3 ); // BUG? Maybe 2?
555 combo->setTextEntry(LLURLSimString::sInstance.mSimString);
556 }
557 else
558 {
559 BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
560 combo->setCurrentByIndex( login_last ? 1 : 0 );
561 }
562
563 BOOL show_start = TRUE;
564
565 if ( ! force_visible )
566 show_start = gSavedSettings.getBOOL("ShowStartLocation");
567
568 sInstance->childSetVisible("start_location_combo", show_start);
569 sInstance->childSetVisible("start_location_text", show_start);
570 sInstance->childSetVisible("server_combo", TRUE);
571}
572
573void LoginFloater::newShow(const std::string &grid, bool initialLogin)
574{
575
576 llwarns << "newShow called" << llendl;
577 if(NULL==sInstance)
578 {
579 LoginFloater::sGrid = grid;
580 LoginFloater::sIsInitialLogin = initialLogin;
581 sInstance = new LoginFloater();
582
583 llwarns << "sInstance assigned. sInstance=" << sInstance << llendl;
584 }
585
586 llwarns << "newshow called" << llendl;
587 sInstance->mCurGrid = gHippoGridManager->getCurrentGridNick();
588 refresh_grids();
589
590 sInstance->open(); /*Flawfinder: ignore*/
591 // we're important
592 //sInstance->setFrontmost(TRUE);
593 //sInstance->setFocus(TRUE);
594
595}
596
597void LoginFloater::show(const LLRect &rect, BOOL show_server,
598 void (*callback)(S32 option, void* user_data),
599 void* callback_data)
600{
601 // we don't need a grid passed in because this is old-style login
602 std::string grid = "";
603 newShow(grid, TRUE);
604}
605
606void LoginFloater::setFocus(BOOL b)
607{
608 if(b != hasFocus())
609 {
610 if(b)
611 {
612 LoginFloater::giveFocus();
613 }
614 else
615 {
616 LLPanel::setFocus(b);
617 }
618 }
619}
620
621void LoginFloater::giveFocus()
622{
623 LLScrollListCtrl *combo = NULL;
624
625 if(NULL==sInstance)
626 {
627 llwarns << "giveFocus has no LoginFloater instance. sInstance=" << sInstance << llendl;
628 return;
629 }
630
631 // for our combo box approach, selecting the combo box is almost always
632 // the right thing to do on the floater receiving focus
633 combo = sInstance->getChild<LLScrollListCtrl>("grid_selector");
634 combo->setFocus(TRUE);
635}
636
637BOOL LoginFloater::isGridComboDirty()
638{
639 BOOL user_picked = FALSE;
640 if (!sInstance)
641 {
642 llwarns << "Attempted getServer with no login view shown" << llendl;
643 }
644 else
645 {
646 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
647 user_picked = combo->isDirty();
648 }
649 return user_picked;
650}
651
652void LoginFloater::getLocation(std::string &location)
653{
654 if (!sInstance)
655 {
656 llwarns << "Attempted getLocation with no login view shown" << llendl;
657 return;
658 }
659
660 LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
661 location = combo->getValue().asString();
662}
663
664std::string& LoginFloater::getPassword()
665{
666 return mMungedPassword;
667}
668
669void LoginFloater::setPassword(std::string &password)
670{
671 mMungedPassword = password;
672}
673
674bool LoginFloater::isSamePassword(std::string &password)
675{
676 return mMungedPassword == password;
677}
678
679void LoginFloater::addServer(const std::string& server, S32 domain_name)
680{
681 if (!sInstance)
682 {
683 llwarns << "Attempted addServer with no login view shown" << llendl;
684 return;
685 }
686
687 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
688 combo->add(server, LLSD(domain_name) );
689 combo->setCurrentByIndex(0);
690}
691
692void LoginFloater::cancel_old()
693{
694 if(NULL==sInstance)
695 return;
696
697 if(sInstance->sIsInitialLogin)
698 {
699 // send a callback that indicates we're quitting or closing
700 if(sInstance->mCallback)
701 sInstance->mCallback(LOGIN_OPTION_QUIT, sInstance->mCallbackData);
702 return;
703 }
704
705 sInstance->close();
706}
707
708void LoginFloater::hashPassword(const std::string& password, std::string& hashedPassword)
709{
710 // Max "actual" password length is 16 characters.
711 // Hex digests are always 32 characters.
712 if (password.length() == 32)
713 {
714 hashedPassword = password;
715 }
716 else
717 {
718 // this is a normal text password
719 LLMD5 pass((unsigned char *)password.c_str());
720 char munged_password[MD5HEX_STR_SIZE];
721 pass.hex_digest(munged_password);
722 hashedPassword = munged_password;
723 }
724
725}
726
diff --git a/linden/indra/newview/floaterlogin.h b/linden/indra/newview/floaterlogin.h
new file mode 100644
index 0000000..cdb60b0
--- /dev/null
+++ b/linden/indra/newview/floaterlogin.h
@@ -0,0 +1,90 @@
1/*
2 * floaterlogin.h (floatergridmanager.h pls)
3 * This is Meerkats grid manager, and I accidentally finished it with the wrong name :)
4 * -Patrick Sapinski (Monday, August 17, 2009)
5 */
6
7#ifndef PL_floaterlogin_H
8#define PL_floaterlogin_H
9
10#define LOGIN_OPTION_CONNECT 0
11#define LOGIN_OPTION_QUIT 1
12
13#include "llfloater.h"
14
15class LoginController;
16class AuthenticationModel;
17
18class LoginFloater : public LLFloater
19{
20public:
21 LoginFloater();
22 virtual ~LoginFloater();
23
24 virtual BOOL postBuild();
25
26 static void refresh_grids();
27 void apply();
28 void setDefault();
29 void cancel();
30
31 // new-style login methods
32 static void newShow(const std::string &grid, bool initialLogin);
33 virtual std::string& getPassword();
34 virtual void setPassword(std::string &password);
35 virtual bool isSamePassword(std::string &password);
36 static void getFields(std::string &loginname, std::string &password,
37 BOOL &remember);
38 static void setFields(const std::string &loginname, const std::string &password,
39 BOOL remember);
40
41 // LLLoginPanel compatibility
42 //TODO: Make this not suck
43 static void show(const LLRect &rect, BOOL show_server,
44 void (*callback)(S32 option, void *user_data),
45 void *callback_data);
46 static void close();
47 static void setAlwaysRefresh(bool refresh);
48 static void refreshLocation(bool force_visible);
49 virtual void setFocus(BOOL b);
50 static void giveFocus();
51 static void getLocation(std::string &location);
52 static BOOL isGridComboDirty();
53 static void addServer(const std::string& server, S32 domain_name);
54 static void cancel_old();
55 static void hashPassword(const std::string& password, std::string& hashedPassword);
56protected:
57 static bool sIsInitialLogin;
58 static std::string sGrid;
59private:
60 enum State { NORMAL, ADD_NEW, ADD_COPY };
61 State mState;
62 std::string mCurGrid;
63
64 std::string mIncomingPassword;
65 std::string mMungedPassword;
66
67 void applyChanges();
68 bool createNewGrid();
69 void update();
70 void retrieveGridInfo();
71
72 static void onSelectGrid(LLUICtrl *ctrl, void *data);
73 static void onClickDelete(void *data);
74 static void onClickAdd(void *data);
75 static void onClickCopy(void *data);
76 static void onClickOk(void *data);
77 static void onClickApply(void *data);
78 static void onClickDefault(void *data);
79 static void onClickGridInfo(void *data);
80 static void onClickCancel(void *data);
81
82 static LoginFloater *sInstance;
83 static LoginController *sController;
84 static AuthenticationModel *sModel;
85
86 void (*mCallback)(S32 option, void *userdata);
87 void *mCallbackData;
88};
89
90#endif // PL_floaterlogin_H
diff --git a/linden/indra/newview/hippoGridManager.cpp b/linden/indra/newview/hippoGridManager.cpp
new file mode 100644
index 0000000..2143a40
--- /dev/null
+++ b/linden/indra/newview/hippoGridManager.cpp
@@ -0,0 +1,603 @@
1
2
3#include "hippoGridManager.h"
4
5#include <cctype>
6
7#include <stdtypes.h>
8#include <lldir.h>
9#include <lleconomy.h>
10#include <llerror.h>
11#include <llfile.h>
12#include <llhttpclient.h>
13#include <llsdserialize.h>
14#include "llviewercontrol.h"
15#include "llweb.h"
16
17#include "hippoRestRequest.h"
18
19
20// ********************************************************************
21// Global Variables
22
23HippoGridManager *gHippoGridManager = 0;
24
25HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO("");
26
27
28
29// ********************************************************************
30// ********************************************************************
31// HippoGridInfo
32// ********************************************************************
33// ********************************************************************
34
35
36// ********************************************************************
37// Initialize
38
39HippoGridInfo::HippoGridInfo(const std::string &gridNick) :
40 mPlatform(PLATFORM_OTHER),
41 mGridNick(gridNick),
42 mRenderCompat(true),
43 mCurrencySymbol("OS$"),
44 mRealCurrencySymbol("US$"),
45 mDirectoryFee(30)
46{
47 cleanUpGridNick(mGridNick);
48}
49
50
51void HippoGridInfo::setPlatform(Platform platform)
52{
53 mPlatform = platform;
54 mCurrencySymbol = (mPlatform == PLATFORM_SECONDLIFE)? "L$": "OS$";
55}
56
57
58void HippoGridInfo::setPlatform(const std::string &platform)
59{
60 std::string tmp = platform;
61 for (unsigned i=0; i<platform.size(); i++)
62 tmp[i] = tolower(tmp[i]);
63
64 if (tmp == "opensim") {
65 setPlatform(PLATFORM_OPENSIM);
66 } else if (tmp == "secondlife") {
67 setPlatform(PLATFORM_SECONDLIFE);
68 } else {
69 setPlatform(PLATFORM_OTHER);
70 llwarns << "Unknown platform '" << platform << "'." << llendl;
71 }
72}
73
74
75// ********************************************************************
76// Grid Info
77
78std::string HippoGridInfo::getSearchUrl(SearchType ty) const
79{
80 if ((mPlatform == PLATFORM_SECONDLIFE) || mSearchUrl.empty()) {
81 // Second Life defaults
82 if (ty == SEARCH_ALL_EMPTY) {
83 return gSavedSettings.getString("SearchURLDefault");
84 } else if (ty == SEARCH_ALL_QUERY) {
85 return gSavedSettings.getString("SearchURLQuery");
86 } else if (ty == SEARCH_ALL_TEMPLATE) {
87 return gSavedSettings.getString("SearchURLSuffix2");
88 } else {
89 llinfos << "Illegal search URL type " << ty << llendl;
90 return "";
91 }
92 } else {
93 // OpenSim and other
94 if (ty == SEARCH_ALL_EMPTY) {
95 return (mSearchUrl + "panel=All&");
96 } else if (ty == SEARCH_ALL_QUERY) {
97 return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
98 } else if (ty == SEARCH_ALL_TEMPLATE) {
99 return "lang=[LANG]&m=[MATURE]&t=[TEEN]&region=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]";
100 } else {
101 llinfos << "Illegal search URL type " << ty << llendl;
102 return "";
103 }
104 }
105}
106
107
108//static
109void HippoGridInfo::onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts)
110{
111 HippoGridInfo *self = (HippoGridInfo*)userData;
112 if (strcasecmp(name, "gridnick") == 0)
113 self->mXmlState = XML_GRIDNICK;
114 else if (strcasecmp(name, "gridname") == 0)
115 self->mXmlState = XML_GRIDNAME;
116 else if (strcasecmp(name, "platform") == 0)
117 self->mXmlState = XML_PLATFORM;
118 else if ((strcasecmp(name, "login") == 0) || (strcasecmp(name, "loginuri") == 0))
119 self->mXmlState = XML_LOGINURI;
120 else if ((strcasecmp(name, "welcome") == 0) || (strcasecmp(name, "loginpage") == 0))
121 self->mXmlState = XML_LOGINPAGE;
122 else if ((strcasecmp(name, "economy") == 0) || (strcasecmp(name, "helperuri") == 0))
123 self->mXmlState = XML_HELPERURI;
124 else if ((strcasecmp(name, "about") == 0) || (strcasecmp(name, "website") == 0))
125 self->mXmlState = XML_WEBSITE;
126 else if ((strcasecmp(name, "help") == 0) || (strcasecmp(name, "support") == 0))
127 self->mXmlState = XML_SUPPORT;
128 else if ((strcasecmp(name, "register") == 0) || (strcasecmp(name, "account") == 0))
129 self->mXmlState = XML_REGISTER;
130 else if (strcasecmp(name, "password") == 0)
131 self->mXmlState = XML_PASSWORD;
132 //else if (strcasecmp(name, "search") == 0)
133 //self->mXmlState = XML_SEARCH;
134}
135
136//static
137void HippoGridInfo::onXmlElementEnd(void *userData, const XML_Char *name)
138{
139 HippoGridInfo *self = (HippoGridInfo*)userData;
140 self->mXmlState = XML_VOID;
141}
142
143//static
144void HippoGridInfo::onXmlCharacterData(void *userData, const XML_Char *s, int len)
145{
146 HippoGridInfo *self = (HippoGridInfo*)userData;
147 switch (self->mXmlState) {
148
149 case XML_GRIDNICK:
150 if (self->mGridNick == "") self->mGridNick.assign(s, len);
151 cleanUpGridNick(self->mGridNick);
152 break;
153
154 case XML_PLATFORM: {
155 std::string platform(s, len);
156 self->setPlatform(platform);
157 break;
158 }
159
160 case XML_LOGINURI:
161 self->mLoginUri.assign(s, len);
162 cleanUpUri(self->mLoginUri);
163 break;
164
165 case XML_HELPERURI:
166 self->mHelperUri.assign(s, len);
167 cleanUpUri(self->mHelperUri);
168 break;
169
170 case XML_SEARCH:
171 //self->mSearchUrl.assign(s, len);
172 //cleanUpQueryUrl(mSearchUrl);
173 break;
174
175 case XML_GRIDNAME: self->mGridName.assign(s, len); break;
176 case XML_LOGINPAGE: self->mLoginPage.assign(s, len); break;
177 case XML_WEBSITE: self->mWebSite.assign(s, len); break;
178 case XML_SUPPORT: self->mSupportUrl.assign(s, len); break;
179 case XML_REGISTER: self->mRegisterUrl.assign(s, len); break;
180 case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break;
181
182 case XML_VOID: break;
183 }
184}
185
186
187bool HippoGridInfo::retrieveGridInfo()
188{
189 if (mLoginUri == "") return false;
190
191 std::string reply;
192 int result = HippoRestRequest::getBlocking(mLoginUri + "get_grid_info", &reply);
193 if (result != 200) return false;
194
195 llinfos << "Received: " << reply << llendl;
196
197 bool success = true;
198 XML_Parser parser = XML_ParserCreate(0);
199 XML_SetUserData(parser, this);
200 XML_SetElementHandler(parser, onXmlElementStart, onXmlElementEnd);
201 XML_SetCharacterDataHandler(parser, onXmlCharacterData);
202 mXmlState = XML_VOID;
203 if (!XML_Parse(parser, reply.data(), reply.size(), TRUE)) {
204 llwarns << "XML Parse Error: " << XML_ErrorString(XML_GetErrorCode(parser)) << llendl;
205 success = false;
206 }
207 XML_ParserFree(parser);
208
209 return success;
210}
211
212
213std::string HippoGridInfo::getUploadFee() const
214{
215 std::string fee;
216 formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), true);
217 return fee;
218}
219
220std::string HippoGridInfo::getGroupCreationFee() const
221{
222 std::string fee;
223 formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceGroupCreate(), false);
224 return fee;
225}
226
227std::string HippoGridInfo::getDirectoryFee() const
228{
229 std::string fee;
230 formatFee(fee, mDirectoryFee, true);
231 if (fee != "free") fee += "/week";
232 return fee;
233}
234
235void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const
236{
237 if (showFree && (cost == 0)) {
238 fee = "free";
239 } else {
240 fee = llformat("%s%d", getCurrencySymbol().c_str(), cost);
241 }
242}
243
244
245// ********************************************************************
246// Static Helpers
247
248// static
249const char *HippoGridInfo::getPlatformString(Platform platform)
250{
251 static const char *platformStrings[PLATFORM_LAST] = {
252 "Other", "OpenSim", "SecondLife"
253 };
254
255 if ((platform < PLATFORM_OTHER) || (platform >= PLATFORM_LAST))
256 platform = PLATFORM_OTHER;
257 return platformStrings[platform];
258}
259
260
261// static
262void HippoGridInfo::cleanUpGridNick(std::string &gridnick)
263{
264 std::string tmp;
265 int size = gridnick.size();
266 for (int i=0; i<size; i++) {
267 char c = gridnick[i];
268 if ((c == '_') || isalnum(c)) {
269 tmp += tolower(c);
270 } else if (isspace(c)) {
271 tmp += "_";
272 }
273 }
274 gridnick = tmp;
275}
276
277// static
278void HippoGridInfo::cleanUpUri(std::string &uri)
279{
280 if (uri.empty()) {
281 return;
282 }
283
284 // If last character in uri is not "/"
285 if (uri.compare(uri.length()-1, 1, "/") != 0) {
286 uri += '/';
287 }
288}
289
290
291void HippoGridInfo::initFallback()
292{
293 FALLBACK_GRIDINFO.mGridNick = "secondlife";
294 FALLBACK_GRIDINFO.setPlatform(PLATFORM_SECONDLIFE);
295 FALLBACK_GRIDINFO.setGridName("Second Life");
296 FALLBACK_GRIDINFO.setLoginUri("https://login.agni.lindenlab.com/cgi-bin/login.cgi");
297 FALLBACK_GRIDINFO.setLoginPage("http://secondlife.com/app/login/");
298 FALLBACK_GRIDINFO.setHelperUri("https://secondlife.com/helpers/");
299 FALLBACK_GRIDINFO.setWebSite("http://secondlife.com/");
300}
301
302
303
304// ********************************************************************
305// ********************************************************************
306// HippoGridManager
307// ********************************************************************
308// ********************************************************************
309
310
311// ********************************************************************
312// Initialize
313
314HippoGridManager::HippoGridManager() :
315 mConnectedGrid(0),
316 mDefaultGridsVersion(0)
317{
318}
319
320HippoGridManager::~HippoGridManager()
321{
322 cleanup();
323}
324
325
326void HippoGridManager::cleanup()
327{
328 std::map<std::string, HippoGridInfo*>::iterator it, end = mGridInfo.end();
329 for (it=mGridInfo.begin(); it != end; ++it) {
330 delete it->second;
331 }
332 mGridInfo.clear();
333}
334
335
336void HippoGridManager::init()
337{
338 HippoGridInfo::initFallback();
339 loadFromFile();
340
341 // !!!### gSavedSettings.getControl("CmdLineLoginURI");
342 // !!!### gSavedSettings.getString("CmdLineLoginPage");
343 // !!!### gSavedSettings.getString("CmdLineHelperURI");
344 // !!!### LLString::compareInsensitive(gGridInfo[grid_index].mLabel, grid_name.c_str()))
345}
346
347
348void HippoGridManager::discardAndReload()
349{
350 cleanup();
351 loadFromFile();
352}
353
354
355// ********************************************************************
356// Public Access
357
358HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const
359{
360 std::map<std::string, HippoGridInfo*>::const_iterator it;
361 it = mGridInfo.find(grid);
362 if (it != mGridInfo.end()) {
363 return it->second;
364 } else {
365 return 0;
366 }
367}
368
369
370HippoGridInfo *HippoGridManager::getCurrentGrid() const
371{
372 HippoGridInfo *grid = getGrid(mCurrentGrid);
373 if (grid) {
374 return grid;
375 } else {
376 return &HippoGridInfo::FALLBACK_GRIDINFO;
377 }
378}
379
380
381void HippoGridManager::addGrid(HippoGridInfo *grid)
382{
383 if (!grid) return;
384 const std::string &nick = grid->getGridNick();
385 if (nick == "") {
386 llwarns << "Ignoring to try adding grid with empty nick." << llendl;
387 delete grid;
388 return;
389 }
390 if (mGridInfo.find(nick) != mGridInfo.end()) {
391 llwarns << "Ignoring to try adding existing grid " << nick << '.' << llendl;
392 delete grid;
393 return;
394 }
395 mGridInfo[nick] = grid;
396}
397
398
399void HippoGridManager::deleteGrid(const std::string &grid)
400{
401 GridIterator it = mGridInfo.find(grid);
402 if (it == mGridInfo.end()) {
403 llwarns << "Trying to delete non-existing grid " << grid << '.' << llendl;
404 return;
405 }
406 mGridInfo.erase(it);
407 llinfos << "Number of grids now: " << mGridInfo.size() << llendl;
408 if (mGridInfo.empty()) llinfos << "Grid info map is empty." << llendl;
409 if (grid == mDefaultGrid)
410 setDefaultGrid(""); // sets first grid, if map not empty
411 if (grid == mCurrentGrid)
412 mCurrentGrid = mDefaultGrid;
413}
414
415
416void HippoGridManager::setDefaultGrid(const std::string &grid)
417{
418 GridIterator it = mGridInfo.find(grid);
419 if (it != mGridInfo.end()) {
420 mDefaultGrid = grid;
421 } else if (mGridInfo.find("secondlife") != mGridInfo.end()) {
422 mDefaultGrid = "secondlife";
423 } else if (!mGridInfo.empty()) {
424 mDefaultGrid = mGridInfo.begin()->first;
425 } else {
426 mDefaultGrid = "";
427 }
428}
429
430
431void HippoGridManager::setCurrentGrid(const std::string &grid)
432{
433 GridIterator it = mGridInfo.find(grid);
434 if (it != mGridInfo.end()) {
435 mCurrentGrid = grid;
436 } else if (!mGridInfo.empty()) {
437 llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl;
438 mCurrentGrid = mDefaultGrid;
439 }
440}
441
442
443// ********************************************************************
444// Persistent Store
445
446void HippoGridManager::loadFromFile()
447{
448 mDefaultGridsVersion = 0;
449 // load user grid info
450 parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml"), false);
451 // merge default grid info, if newer. Force load, if list of grids is empty.
452 parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty());
453 // merge grid info from web site, if newer. Force load, if list of grids is empty.
454 if (gSavedSettings.getBOOL("CheckForGridUpdates"))
455 parseUrl("http://imprudenceviewer.org/app/grids/", !mGridInfo.empty());
456
457 setDefaultGrid(gSavedSettings.getString("DefaultGrid"));
458 setCurrentGrid(gSavedSettings.getString("DefaultGrid"));
459}
460
461
462void HippoGridManager::parseUrl(const char *url, bool mergeIfNewer)
463{
464 llinfos << "Loading grid info from '" << url << "'." << llendl;
465
466 // query update server
467 std::string escaped_url = LLWeb::escapeURL(url);
468 LLSD response = LLHTTPClient::blockingGet(url);
469
470 // check response, return on error
471 S32 status = response["status"].asInteger();
472 if ((status != 200) || !response["body"].isArray()) {
473 llinfos << "GridInfo Update failed (" << status << "): "
474 << (response["body"].isString()? response["body"].asString(): "<unknown error>")
475 << llendl;
476 return;
477 }
478
479 LLSD gridInfo = response["body"];
480 parseData(gridInfo, mergeIfNewer);
481}
482
483void HippoGridManager::parseFile(const std::string &fileName, bool mergeIfNewer)
484{
485 llifstream infile;
486 infile.open(fileName.c_str());
487 if(!infile.is_open()) {
488 llwarns << "Cannot find grid info file " << fileName << " to load." << llendl;
489 return;
490 }
491
492 LLSD gridInfo;
493 if (LLSDSerialize::fromXML(gridInfo, infile) <= 0) {
494 llwarns << "Unable to parse grid info file " << fileName << '.' << llendl;
495 return;
496 }
497
498 llinfos << "Loading grid info file " << fileName << '.' << llendl;
499 parseData(gridInfo, mergeIfNewer);
500}
501
502
503void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
504{
505 if (mergeIfNewer) {
506 LLSD::array_const_iterator it, end = gridInfo.endArray();
507 for (it = gridInfo.beginArray(); it != end; ++it) {
508 LLSD gridMap = *it;
509 if (gridMap.has("default_grids_version")) {
510 int version = gridMap["default_grids_version"];
511 if (version <= mDefaultGridsVersion) return;
512 else break;
513 }
514 }
515 if (it == end) {
516 llwarns << "Grid data has no version number." << llendl;
517 return;
518 }
519 }
520
521 llinfos << "Loading grid data." << llendl;
522
523 LLSD::array_const_iterator it, end = gridInfo.endArray();
524 for (it = gridInfo.beginArray(); it != end; ++it) {
525 LLSD gridMap = *it;
526 if (gridMap.has("default_grids_version")) {
527 mDefaultGridsVersion = gridMap["default_grids_version"];
528 } else if (gridMap.has("gridnick") && gridMap.has("loginuri")) {
529 std::string gridnick = gridMap["gridnick"];
530 HippoGridInfo *grid;
531 GridIterator it = mGridInfo.find(gridnick);
532 bool newGrid = (it == mGridInfo.end());
533 if (newGrid) {
534 // create new grid info
535 grid = new HippoGridInfo(gridnick);
536 } else {
537 // update existing grid info
538 grid = it->second;
539 }
540 grid->setLoginUri(gridMap["loginuri"]);
541 if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
542 if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]);
543 if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]);
544 if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
545 if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
546 if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]);
547 if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]);
548 if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
549 //if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
550 if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
551 // if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
552 // if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
553 // if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
554 if (newGrid) addGrid(grid);
555 }
556 }
557}
558
559
560void HippoGridManager::saveFile()
561{
562 // save default grid to client settings
563 gSavedSettings.setString("DefaultGrid", mDefaultGrid);
564
565 // build LLSD
566 LLSD gridInfo;
567 gridInfo[0]["default_grids_version"] = mDefaultGridsVersion;
568
569 // add grids
570 S32 i = 1;
571 GridIterator it, end = mGridInfo.end();
572 for (it = mGridInfo.begin(); it != end; ++it, i++) {
573 HippoGridInfo *grid = it->second;
574 gridInfo[i]["gridnick"] = grid->getGridNick();
575 gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform());
576 gridInfo[i]["gridname"] = grid->getGridName();
577 gridInfo[i]["loginuri"] = grid->getLoginUri();
578 gridInfo[i]["loginpage"] = grid->getLoginPage();
579 gridInfo[i]["helperuri"] = grid->getHelperUri();
580 gridInfo[i]["website"] = grid->getWebSite();
581 gridInfo[i]["support"] = grid->getSupportUrl();
582 gridInfo[i]["register"] = grid->getRegisterUrl();
583 gridInfo[i]["password"] = grid->getPasswordUrl();
584 // gridInfo[i]["firstname"] = grid->getFirstName();
585 // gridInfo[i]["lastname"] = grid->getLastName();
586 // gridInfo[i]["avatarpassword"] = grid->getAvatarPassword();
587
588 //gridInfo[i]["search"] = grid->getSearchUrl();
589 gridInfo[i]["render_compat"] = grid->isRenderCompat();
590 }
591
592 // write client grid info file
593 std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml");
594 llofstream file;
595 file.open(fileName.c_str());
596 if (file.is_open()) {
597 LLSDSerialize::toPrettyXML(gridInfo, file);
598 file.close();
599 llinfos << "Saved grids to " << fileName << llendl;
600 } else {
601 llerrs << "Unable to open grid info file: " << fileName << llendl;
602 }
603}
diff --git a/linden/indra/newview/hippoGridManager.h b/linden/indra/newview/hippoGridManager.h
new file mode 100644
index 0000000..cd90ac1
--- /dev/null
+++ b/linden/indra/newview/hippoGridManager.h
@@ -0,0 +1,175 @@
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
12#ifdef LL_STANDALONE
13#include <expat.h>
14#else
15#include "expat/expat.h"
16#endif
17
18class LLSD;
19
20
21class HippoGridInfo
22{
23public:
24 enum Platform {
25 PLATFORM_OTHER = 0,
26 PLATFORM_OPENSIM,
27 PLATFORM_SECONDLIFE,
28 PLATFORM_LAST
29 };
30 enum SearchType {
31 SEARCH_ALL_EMPTY,
32 SEARCH_ALL_QUERY,
33 SEARCH_ALL_TEMPLATE
34 };
35
36 explicit HippoGridInfo(const std::string &gridNick);
37
38 Platform getPlatform() const { return mPlatform; }
39 const std::string &getGridNick() const { return mGridNick; }
40 const std::string &getGridName() const { return mGridName; }
41 const std::string &getLoginUri() const { return mLoginUri; }
42 const std::string &getLoginPage() const { return mLoginPage; }
43 const std::string &getHelperUri() const { return mHelperUri; }
44 const std::string &getWebSite() const { return mWebSite; }
45 const std::string &getSupportUrl() const { return mSupportUrl; }
46 const std::string &getRegisterUrl() const { return mRegisterUrl; }
47 const std::string &getPasswordUrl() const { return mPasswordUrl; }
48 const std::string &getSearchUrl() const { return mSearchUrl; }
49 const std::string &getFirstName() const { return mFirstName; }
50 const std::string &getLastName() const { return mLastName; }
51 const std::string &getAvatarPassword() const { return mAvatarPassword; }
52 std::string getSearchUrl(SearchType ty) const;
53 bool isRenderCompat() const { return mRenderCompat; }
54
55 const std::string &getCurrencySymbol() const { return mCurrencySymbol; }
56 const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; }
57 std::string getUploadFee() const;
58 std::string getGroupCreationFee() const;
59 std::string getDirectoryFee() const;
60
61 bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); }
62 bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); }
63
64 void setPlatform (const std::string &platform);
65 void setPlatform (Platform platform);
66 void setGridName (const std::string &gridName) { mGridName = gridName; }
67 void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); }
68 void setLoginPage(const std::string &loginPage) { mLoginPage = loginPage; }
69 void setHelperUri(const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); }
70 void setWebSite (const std::string &website) { mWebSite = website; }
71 void setSupportUrl(const std::string &url) { mSupportUrl = url; }
72 void setRegisterUrl(const std::string &url) { mRegisterUrl = url; }
73 void setPasswordUrl(const std::string &url) { mPasswordUrl = url; }
74 void setSearchUrl(const std::string &url) { mSearchUrl = url; }
75 void setRenderCompat(bool compat) { mRenderCompat = compat; }
76 void setFirstName(const std::string &firstName) { mFirstName = firstName; } //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
77 void setLastName(const std::string &lastName) { mLastName = lastName; }
78 void setAvatarPassword(const std::string &avatarPassword) { mAvatarPassword = avatarPassword; }
79
80 void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); }
81 void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); }
82 void setDirectoryFee(int fee) { mDirectoryFee = fee; }
83
84 bool retrieveGridInfo();
85
86 static const char *getPlatformString(Platform platform);
87 static void cleanUpGridNick(std::string &gridnick);
88
89 static HippoGridInfo FALLBACK_GRIDINFO;
90 static void initFallback();
91
92private:
93 Platform mPlatform;
94 std::string mGridNick;
95 std::string mGridName;
96 std::string mLoginUri;
97 std::string mLoginPage;
98 std::string mHelperUri;
99 std::string mWebSite;
100 std::string mSupportUrl;
101 std::string mRegisterUrl;
102 std::string mPasswordUrl;
103 std::string mSearchUrl;
104 std::string mFirstName;
105 std::string mLastName;
106 std::string mAvatarPassword;
107 bool mRenderCompat;
108
109 std::string mCurrencySymbol;
110 std::string mRealCurrencySymbol;
111 int mDirectoryFee;
112
113 // for parsing grid info XML
114 enum XmlState {
115 XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME,
116 XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
117 XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH
118 };
119 XmlState mXmlState;
120
121 static void cleanUpUri(std::string &uri);
122 void formatFee(std::string &fee, int cost, bool showFree) const;
123
124 static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts);
125 static void onXmlElementEnd(void *userData, const XML_Char *name);
126 static void onXmlCharacterData(void *userData, const XML_Char *s, int len);
127};
128
129
130class HippoGridManager
131{
132public:
133 HippoGridManager();
134 ~HippoGridManager();
135
136 void init();
137 void saveFile();
138 void discardAndReload();
139
140 HippoGridInfo *getGrid(const std::string &grid) const;
141 HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); }
142 HippoGridInfo *getCurrentGrid() const;
143 const std::string &getDefaultGridNick() const { return mDefaultGrid; }
144 const std::string &getCurrentGridNick() const { return mCurrentGrid; }
145
146 void setDefaultGrid(const std::string &grid);
147 void setCurrentGrid(const std::string &grid);
148 void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); }
149
150 void addGrid(HippoGridInfo *grid);
151 void deleteGrid(const std::string &grid);
152
153 typedef std::map<std::string, HippoGridInfo*>::iterator GridIterator;
154 GridIterator beginGrid() { return mGridInfo.begin(); }
155 GridIterator endGrid() { return mGridInfo.end(); }
156
157private:
158 std::map<std::string, HippoGridInfo*> mGridInfo;
159 std::string mDefaultGrid;
160 std::string mCurrentGrid;
161 HippoGridInfo *mConnectedGrid;
162 int mDefaultGridsVersion;
163
164 void cleanup();
165 void loadFromFile();
166 void parseFile(const std::string &fileName, bool mergeIfNewer);
167 void parseUrl(const char *url, bool mergeIfNewer);
168 void parseData(LLSD &gridInfo, bool mergeIfNewer);
169};
170
171
172extern HippoGridManager *gHippoGridManager;
173
174
175#endif
diff --git a/linden/indra/newview/hippoLimits.cpp b/linden/indra/newview/hippoLimits.cpp
new file mode 100644
index 0000000..d5deb9f
--- /dev/null
+++ b/linden/indra/newview/hippoLimits.cpp
@@ -0,0 +1,54 @@
1
2
3#include "hippoLimits.h"
4
5#include "hippoGridManager.h"
6
7#include <llerror.h>
8
9
10HippoLimits *gHippoLimits = 0;
11
12
13HippoLimits::HippoLimits()
14{
15 setLimits();
16}
17
18
19void HippoLimits::setLimits()
20{
21 if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) {
22 setSecondLifeLimits();
23 } else {
24 setOpenSimLimits();
25 }
26}
27
28
29void HippoLimits::setOpenSimLimits()
30{
31 mMaxAgentGroups = 100;
32 mMaxPrimScale = 256.0f;
33 mMaxHeight = 10000.0f;
34 if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) {
35 llinfos << "Using rendering compatible OpenSim limits." << llendl;
36 mMinHoleSize = 0.05f;
37 mMaxHollow = 0.95f;
38 } else {
39 llinfos << "Using Hippo OpenSim limits." << llendl;
40 mMinHoleSize = 0.01f;
41 mMaxHollow = 0.99f;
42 }
43}
44
45void HippoLimits::setSecondLifeLimits()
46{
47 llinfos << "Using Second Life limits." << llendl;
48 mMaxAgentGroups = 25;
49 mMaxPrimScale = 10.0f;
50 mMaxHeight = 4096.0f;
51 mMinHoleSize = 0.05f;
52 mMaxHollow = 0.95f;
53}
54
diff --git a/linden/indra/newview/hippoLimits.h b/linden/indra/newview/hippoLimits.h
new file mode 100644
index 0000000..900480b
--- /dev/null
+++ b/linden/indra/newview/hippoLimits.h
@@ -0,0 +1,33 @@
1#ifndef __HIPPO_LIMITS_H__
2#define __HIPPO_LIMITS_H__
3
4
5class HippoLimits
6{
7public:
8 HippoLimits();
9
10 int getMaxAgentGroups() const { return mMaxAgentGroups; }
11 float getMaxHeight() const { return mMaxHeight; }
12 float getMinHoleSize() const { return mMinHoleSize; }
13 float getMaxHollow() const { return mMaxHollow; }
14 float getMaxPrimScale() const { return mMaxPrimScale; }
15
16 void setLimits();
17
18private:
19 int mMaxAgentGroups;
20 float mMaxHeight;
21 float mMinHoleSize;
22 float mMaxHollow;
23 float mMaxPrimScale;
24
25 void setOpenSimLimits();
26 void setSecondLifeLimits();
27};
28
29
30extern HippoLimits *gHippoLimits;
31
32
33#endif
diff --git a/linden/indra/newview/hippoRestRequest.cpp b/linden/indra/newview/hippoRestRequest.cpp
new file mode 100644
index 0000000..cf518de
--- /dev/null
+++ b/linden/indra/newview/hippoRestRequest.cpp
@@ -0,0 +1,54 @@
1
2
3#include "hippoRestRequest.h"
4
5#ifndef CURL_STATICLIB
6#define CURL_STATICLIB 1
7#endif
8#include <curl/curl.h>
9
10#include <stdtypes.h>
11#include <llerror.h>
12
13
14static size_t curlWrite(void *ptr, size_t size, size_t nmemb, void *userData)
15{
16 std::string *result = (std::string*)userData;
17 size_t bytes = (size * nmemb);
18 result->append((char*)ptr, bytes);
19 return nmemb;
20}
21
22
23//static
24int HippoRestRequest::getBlocking(const std::string &url, std::string *result)
25{
26 llinfos << "Requesting: " << url << llendl;
27
28 char curlErrorBuffer[CURL_ERROR_SIZE];
29 CURL* curlp = curl_easy_init();
30
31 curl_easy_setopt(curlp, CURLOPT_NOSIGNAL, 1); // don't use SIGALRM for timeouts
32 curl_easy_setopt(curlp, CURLOPT_TIMEOUT, 5); // seconds
33
34 curl_easy_setopt(curlp, CURLOPT_WRITEFUNCTION, curlWrite);
35 curl_easy_setopt(curlp, CURLOPT_WRITEDATA, result);
36 curl_easy_setopt(curlp, CURLOPT_URL, url.c_str());
37 curl_easy_setopt(curlp, CURLOPT_ERRORBUFFER, curlErrorBuffer);
38 curl_easy_setopt(curlp, CURLOPT_FAILONERROR, 1);
39
40 *result = "";
41 S32 curlSuccess = curl_easy_perform(curlp);
42 S32 httpStatus = 499;
43 curl_easy_getinfo(curlp, CURLINFO_RESPONSE_CODE, &httpStatus);
44
45 if (curlSuccess != 0) {
46 llwarns << "CURL ERROR (HTTP Status " << httpStatus << "): " << curlErrorBuffer << llendl;
47 } else if (httpStatus != 200) {
48 llwarns << "HTTP Error " << httpStatus << ", but no Curl error." << llendl;
49 }
50
51 curl_easy_cleanup(curlp);
52 return httpStatus;
53}
54
diff --git a/linden/indra/newview/hippoRestRequest.h b/linden/indra/newview/hippoRestRequest.h
new file mode 100644
index 0000000..1dcb4a0
--- /dev/null
+++ b/linden/indra/newview/hippoRestRequest.h
@@ -0,0 +1,16 @@
1#ifndef __HIPPO_REST_REQTUEST_H__
2#define __HIPPO_REST_REQTUEST_H__
3
4
5#include <string>
6
7
8class HippoRestRequest
9{
10 public:
11 static int getBlocking(const std::string &url, std::string *result);
12
13};
14
15
16#endif
diff --git a/linden/indra/newview/hippoUpdate.cpp b/linden/indra/newview/hippoUpdate.cpp
new file mode 100644
index 0000000..872ca30
--- /dev/null
+++ b/linden/indra/newview/hippoUpdate.cpp
@@ -0,0 +1,92 @@
1
2#include "hippoUpdate.h"
3
4#include <cstdio>
5#include <list>
6#include <vector>
7
8#include <stdtypes.h>
9#include <llhttpclient.h>
10#include <llmemory.h>
11#include <llversionviewer.h>
12#include "llviewercontrol.h"
13#include "llviewernetwork.h"
14#include "llweb.h"
15#include <llwindow.h>
16
17
18std::string gHippoChannel;
19
20
21// static
22bool HippoUpdate::checkUpdate()
23{
24 llinfos << "Hippo Update Check..." << llendl;
25
26 // get channel name
27 gHippoChannel = gSavedSettings.getString("ChannelName");
28
29 // get mac address
30 char macAddress[18];
31 sprintf(macAddress, "%02x:%02x:%02x:%02x:%02x:%02x",
32 gMACAddress[0], gMACAddress[1], gMACAddress[2], gMACAddress[3], gMACAddress[4], gMACAddress[5]);
33
34 // build URL for update check
35 char url[1000];
36 snprintf(url, 1000,
37/* "http://update.mjm.game-host.org/os/viewer.php?"
38 "product=%s&channel=%s&"
39 "version_major=%d&version_minor=%d&version_patch=%d&version_base=%s&"
40 "platform=%s&mac=%s",
41 LL_PRODUCT, LL_CHANNEL_CSTR,
42 LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BASE,
43 LL_PLATFORM*/"", macAddress);
44
45 // query update server
46 std::string escaped_url = LLWeb::escapeURL(url);
47 LLSD response = LLHTTPClient::blockingGet(escaped_url.c_str());
48
49 // check response, return on error
50 S32 status = response["status"].asInteger();
51 if ((status != 200) || !response["body"].isMap()) {
52 llinfos << "Hippo Update failed (" << status << "): "
53 << (response["body"].isString()? response["body"].asString(): "<unknown error>")
54 << llendl;
55 return true;
56 }
57
58 // get data from response
59 LLSD data = response["body"];
60 std::string webpage = (data.has("webpage") && data["webpage"].isString())? data["webpage"].asString(): "";
61 std::string message = (data.has("message") && data["message"].isString())? data["message"].asString(): "";
62 std::string yourVersion = (data.has("yourVersion") && data["yourVersion"].isString())? data["yourVersion"].asString(): "";
63 std::string curVersion = (data.has("curVersion") && data["curVersion"].isString())? data["curVersion"].asString(): "";
64 bool update = (data.has("update") && data["update"].isBoolean())? data["update"].asBoolean(): false;
65 bool mandatory = (data.has("mandatory") && data["mandatory"].isBoolean())? data["mandatory"].asBoolean(): false;
66
67 // log and return, if no update available
68 llinfos << "Your version is " << yourVersion << ", current version is " << curVersion << '.' << llendl;
69 if (!update) return true;
70 llinfos << "Update is " << (mandatory? "mandatory.": "optional.") << llendl;
71
72 // show update dialog
73 char msg[1000];
74 snprintf(msg, 1000,
75 "There is a new viewer version available.\n"
76 "\n"
77 "Your version: %s\n"
78 "Current version: %s\n"
79 "%s\n"
80 "Do you want to visit the web site?",
81 yourVersion.c_str(), curVersion.c_str(),
82 mandatory? "\nThis is a mandatory update.\n": "");
83 S32 button = OSMessageBox(msg, "Hippo OpenSim Viewer Update", OSMB_YESNO);
84 if (button == OSBTN_YES) {
85 llinfos << "Taking user to " << webpage << llendl;
86 LLWeb::loadURLExternal(webpage);
87 // exit the viewer
88 return false;
89 }
90
91 return !mandatory;
92}
diff --git a/linden/indra/newview/hippoUpdate.h b/linden/indra/newview/hippoUpdate.h
new file mode 100644
index 0000000..559c8b3
--- /dev/null
+++ b/linden/indra/newview/hippoUpdate.h
@@ -0,0 +1,12 @@
1#ifndef __HIPPO_UPDATE_H__
2#define __HIPPO_UPDATE_H__
3
4
5class HippoUpdate
6{
7 public:
8 static bool checkUpdate();
9};
10
11
12#endif
diff --git a/linden/indra/newview/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//-----------------------------------------------------------------------------
468void LLAgent::cleanup() 468void 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
6675void LLAgent::processAgentInitialWearablesUpdate( LLMessageSystem* mesgsys, void** user_data ) 6679void 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.
200extern void disable_win_error_reporting();
195 201
196#if LL_DARWIN 202#if LL_DARWIN
203#include <Carbon/Carbon.h>
197extern void init_apple_menu(const char* product); 204extern void init_apple_menu(const char* product);
205extern OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn);
206extern OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn);
207extern OSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata);
208#include <boost/tokenizer.hpp>
198#endif // LL_DARWIN 209#endif // LL_DARWIN
199 210
211
200extern BOOL gRandomizeFramerate; 212extern BOOL gRandomizeFramerate;
201extern BOOL gPeriodicSlowFrame; 213extern BOOL gPeriodicSlowFrame;
202extern BOOL gDebugGL; 214extern BOOL gDebugGL;
203 215
204//////////////////////////////////////////////////////////// 216////////////////////////////////////////////////////////////
205// All from the last globals push... 217// All from the last globals push...
218
219
206const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard 220const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard
207 221
208F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() 222F32 gSimLastTime; // Used in LLAppViewer::init and send_stats()
209F32 gSimFrames; 223F32 gSimFrames;
210 224
225std::string gDisabledMessage; // Set in LLAppViewer::initConfiguration used in idle_startup
226
227BOOL gHideLinks = FALSE; // Set in LLAppViewer::initConfiguration, used externally
228
211BOOL gAllowIdleAFK = TRUE; 229BOOL gAllowIdleAFK = TRUE;
212BOOL gAllowTapTapHoldRun = TRUE; 230BOOL gAllowTapTapHoldRun = TRUE;
213BOOL gShowObjectUpdates = FALSE; 231BOOL gShowObjectUpdates = FALSE;
@@ -233,7 +251,7 @@ F32 gFPSClamped = 10.f; // Pretend we start at target rate.
233F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets 251F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets
234U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds 252U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds
235U32 gFrameStalls = 0; 253U32 gFrameStalls = 0;
236const F64 FRAME_STALL_THRESHOLD = 1.0; 254const F64 FRAME_STALL_THRESHOLD = 5.0;
237 255
238LLTimer gRenderStartTime; 256LLTimer gRenderStartTime;
239LLFrameTimer gForegroundTime; 257LLFrameTimer gForegroundTime;
@@ -302,7 +320,8 @@ std::string gLoginPage;
302std::vector<std::string> gLoginURIs; 320std::vector<std::string> gLoginURIs;
303static std::string gHelperURI; 321static std::string gHelperURI;
304 322
305LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; 323//FIXME
324//LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ;
306 325
307void idle_afk_check() 326void idle_afk_check()
308{ 327{
@@ -453,7 +472,7 @@ static void settings_modify()
453 gSavedSettings.setBOOL("VectorizeSkin", FALSE); 472 gSavedSettings.setBOOL("VectorizeSkin", FALSE);
454#endif 473#endif
455} 474}
456 475/*
457void LLAppViewer::initGridChoice() 476void LLAppViewer::initGridChoice()
458{ 477{
459 // Load up the initial grid choice from: 478 // Load up the initial grid choice from:
@@ -470,7 +489,7 @@ void LLAppViewer::initGridChoice()
470 if(grid_choice.empty()) 489 if(grid_choice.empty())
471 { 490 {
472 S32 server = gSavedSettings.getS32("ServerChoice"); 491 S32 server = gSavedSettings.getS32("ServerChoice");
473 server = llclamp(server, 0, (S32)GRID_INFO_COUNT - 1); 492 //server = llclamp(server, 0, (S32)GRID_INFO_COUNT - 1);
474 if(server == GRID_INFO_OTHER) 493 if(server == GRID_INFO_OTHER)
475 { 494 {
476 std::string custom_server = gSavedSettings.getString("CustomServer"); 495 std::string custom_server = gSavedSettings.getString("CustomServer");
@@ -478,11 +497,12 @@ void LLAppViewer::initGridChoice()
478 } 497 }
479 else if(server != (S32)GRID_INFO_NONE) 498 else if(server != (S32)GRID_INFO_NONE)
480 { 499 {
481 LLViewerLogin::getInstance()->setGridChoice((EGridInfo)server); 500 llwarns << "setgridchoice = " << server << llendl;
501 LLViewerLogin::getInstance()->setGridChoice(server);
482 } 502 }
483 } 503 }
484} 504}
485 505*/
486//virtual 506//virtual
487bool LLAppViewer::initSLURLHandler() 507bool LLAppViewer::initSLURLHandler()
488{ 508{
@@ -521,6 +541,7 @@ LLAppViewer::LLAppViewer() :
521 mSecondInstance(false), 541 mSecondInstance(false),
522 mSavedFinalSnapshot(false), 542 mSavedFinalSnapshot(false),
523 mQuitRequested(false), 543 mQuitRequested(false),
544 mLogoutRequested(false),
524 mLogoutRequestSent(false), 545 mLogoutRequestSent(false),
525 mYieldTime(-1), 546 mYieldTime(-1),
526 mMainloopTimeout(NULL), 547 mMainloopTimeout(NULL),
@@ -662,7 +683,6 @@ bool LLAppViewer::init()
662 ui_audio_callback, 683 ui_audio_callback,
663 &LLUI::sGLScaleFactor); 684 &LLUI::sGLScaleFactor);
664 LLWeb::initClass(); // do this after LLUI 685 LLWeb::initClass(); // do this after LLUI
665
666 LLTextEditor::setURLCallbacks(&LLWeb::loadURL, 686 LLTextEditor::setURLCallbacks(&LLWeb::loadURL,
667 &LLURLDispatcher::dispatchFromTextEditor, 687 &LLURLDispatcher::dispatchFromTextEditor,
668 &LLURLDispatcher::dispatchFromTextEditor); 688 &LLURLDispatcher::dispatchFromTextEditor);
@@ -683,6 +703,7 @@ bool LLAppViewer::init()
683 // load MIME type -> media impl mappings 703 // load MIME type -> media impl mappings
684 LLMIMETypes::parseMIMETypes( std::string("mime_types.xml") ); 704 LLMIMETypes::parseMIMETypes( std::string("mime_types.xml") );
685 705
706
686 // Copy settings to globals. *TODO: Remove or move to appropriage class initializers 707 // Copy settings to globals. *TODO: Remove or move to appropriage class initializers
687 settings_to_globals(); 708 settings_to_globals();
688 // Setup settings listeners 709 // Setup settings listeners
@@ -1117,12 +1138,21 @@ bool LLAppViewer::cleanup()
1117 // to ensure shutdown order 1138 // to ensure shutdown order
1118 LLMortician::setZealous(TRUE); 1139 LLMortician::setZealous(TRUE);
1119 1140
1141 if (mQuitRequested)
1120 LLVoiceClient::terminate(); 1142 LLVoiceClient::terminate();
1121 1143
1122 disconnectViewer(); 1144 disconnectViewer();
1123 1145
1124 llinfos << "Viewer disconnected" << llendflush; 1146 llinfos << "Viewer disconnected" << llendflush;
1125 1147
1148
1149
1150
1151
1152 //this deletes all your buddies
1153 LLAvatarTracker::instance().reset();
1154
1155 if (mQuitRequested)
1126 display_cleanup(); 1156 display_cleanup();
1127 1157
1128 release_start_screen(); // just in case 1158 release_start_screen(); // just in case
@@ -1137,6 +1167,13 @@ bool LLAppViewer::cleanup()
1137 1167
1138 LLKeyframeDataCache::clear(); 1168 LLKeyframeDataCache::clear();
1139 1169
1170 //clear all the chat off the screen
1171 gConsole->clear();
1172
1173 if (!mQuitRequested) //if we are doing a soft cleanup, bail here
1174 {
1175 return true;
1176 }
1140 // End TransferManager before deleting systems it depends on (Audio, VFS, AssetStorage) 1177 // End TransferManager before deleting systems it depends on (Audio, VFS, AssetStorage)
1141#if 0 // this seems to get us stuck in an infinite loop... 1178#if 0 // this seems to get us stuck in an infinite loop...
1142 gTransferManager.cleanup(); 1179 gTransferManager.cleanup();
@@ -1242,6 +1279,9 @@ bool LLAppViewer::cleanup()
1242 // viewer UI relies on keyboard so keep it aound until viewer UI isa gone 1279 // viewer UI relies on keyboard so keep it aound until viewer UI isa gone
1243 delete gKeyboard; 1280 delete gKeyboard;
1244 gKeyboard = NULL; 1281 gKeyboard = NULL;
1282 // Clean up selection managers after UI is destroyed, as UI
1283 // may be observing them.
1284 LLSelectMgr::cleanupGlobals();
1245 1285
1246 LLViewerObject::cleanupVOClasses(); 1286 LLViewerObject::cleanupVOClasses();
1247 1287
@@ -1251,6 +1291,7 @@ bool LLAppViewer::cleanup()
1251 1291
1252 LLTracker::cleanupInstance(); 1292 LLTracker::cleanupInstance();
1253 1293
1294
1254 // *FIX: This is handled in LLAppViewerWin32::cleanup(). 1295 // *FIX: This is handled in LLAppViewerWin32::cleanup().
1255 // I'm keeping the comment to remember its order in cleanup, 1296 // I'm keeping the comment to remember its order in cleanup,
1256 // in case of unforseen dependency. 1297 // in case of unforseen dependency.
@@ -1319,6 +1360,7 @@ bool LLAppViewer::cleanup()
1319 // save mute list. gMuteList used to also be deleted here too. 1360 // save mute list. gMuteList used to also be deleted here too.
1320 LLMuteList::getInstance()->cache(gAgent.getID()); 1361 LLMuteList::getInstance()->cache(gAgent.getID());
1321 1362
1363
1322 if (mPurgeOnExit) 1364 if (mPurgeOnExit)
1323 { 1365 {
1324 llinfos << "Purging all cache files on exit" << llendflush; 1366 llinfos << "Purging all cache files on exit" << llendflush;
@@ -1819,7 +1861,14 @@ bool LLAppViewer::initConfiguration()
1819 } 1861 }
1820 } 1862 }
1821 1863
1822 initGridChoice(); 1864 //init Hippo grid manager
1865 if (!gHippoGridManager) {
1866 gHippoGridManager = new HippoGridManager();
1867 gHippoGridManager->init();
1868 }
1869
1870
1871 //initGridChoice();
1823 1872
1824 // If we have specified crash on startup, set the global so we'll trigger the crash at the right time 1873 // If we have specified crash on startup, set the global so we'll trigger the crash at the right time
1825 if(clp.hasOption("crashonstartup")) 1874 if(clp.hasOption("crashonstartup"))
@@ -1836,7 +1885,6 @@ bool LLAppViewer::initConfiguration()
1836 // achieve this. For now... 1885 // achieve this. For now...
1837 1886
1838 // *NOTE:Mani The command line parser parses tokens and is 1887 // *NOTE:Mani The command line parser parses tokens and is
1839 // setup to bail after parsing the '--url' option or the
1840 // first option specified without a '--option' flag (or 1888 // first option specified without a '--option' flag (or
1841 // any other option that uses the 'last_option' setting - 1889 // any other option that uses the 'last_option' setting -
1842 // see LLControlGroupCLP::configure()) 1890 // see LLControlGroupCLP::configure())
@@ -1894,6 +1942,22 @@ bool LLAppViewer::initConfiguration()
1894 // llerrs << "Failed to parse skin definition." << llendl; 1942 // llerrs << "Failed to parse skin definition." << llendl;
1895 // } 1943 // }
1896 1944
1945 // LLXmlTreeNode* rootp = skin_def_tree.getRoot();
1946 // LLXmlTreeNode* disabled_message_node = rootp->getChildByName("disabled_message");
1947 // if (disabled_message_node)
1948 // {
1949 // gDisabledMessage = disabled_message_node->getContents();
1950 // }
1951
1952 // static LLStdStringHandle hide_links_string = LLXmlTree::addAttributeString("hide_links");
1953 // rootp->getFastAttributeBOOL(hide_links_string, gHideLinks);
1954
1955 // // Legacy string. This flag really meant we didn't want to expose references to "Second Life".
1956 // // Just set gHideLinks instead.
1957 // static LLStdStringHandle silent_string = LLXmlTree::addAttributeString("silent_update");
1958 // BOOL silent_update;
1959 // rootp->getFastAttributeBOOL(silent_string, silent_update);
1960 // gHideLinks = (gHideLinks || silent_update);
1897 //} 1961 //}
1898 1962
1899#if LL_DARWIN 1963#if LL_DARWIN
@@ -2315,7 +2379,7 @@ void LLAppViewer::handleViewerCrash()
2315 gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName(); 2379 gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName();
2316 gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath(); 2380 gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath();
2317 gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds()); 2381 gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds());
2318 gDebugInfo["StartupState"] = LLStartUp::getStartupStateString(); 2382//FIXME gDebugInfo["StartupState"] = LLStartUp::getStartupStateString();
2319 gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) getCurrentRSS() >> 10; 2383 gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) getCurrentRSS() >> 10;
2320 2384
2321 if(gLogoutInProgress) 2385 if(gLogoutInProgress)
@@ -2542,28 +2606,55 @@ void LLAppViewer::removeMarkerFile(bool leave_logout_marker)
2542 } 2606 }
2543} 2607}
2544 2608
2609
2610//this gets called after we get a packet back from the
2611//server saying we are logged out, or if the packet times
2612//out
2545void LLAppViewer::forceQuit() 2613void LLAppViewer::forceQuit()
2546{ 2614{
2615
2616 LL_INFOS("forceQuit") << "Destroying the entire world" << LL_ENDL;
2617 if (mQuitRequested)
2547 LLApp::setQuitting(); 2618 LLApp::setQuitting();
2619 else
2620 {
2621 if (mLogoutRequested) //we just finished a logout request
2622 {
2623 //LLStartUp::setStartupState( STATE_LOGIN_SHOW );
2624 LLStartUp::resetLogin();
2625 cleanup();
2626 mLogoutRequested=false;
2627 mLogoutRequestSent=false;
2628 }
2629 }
2548} 2630}
2549 2631
2550void LLAppViewer::requestQuit() 2632void LLAppViewer::requestLogout(bool quit_after)
2551{ 2633{
2552 llinfos << "requestQuit" << llendl; 2634
2635 mLogoutRequested=true;
2636 if(quit_after)
2637 mQuitRequested=true;
2638 else
2639 mQuitRequested=false;
2640
2641 llinfos << "requestLogout" << llendl;
2553 2642
2554 LLViewerRegion* region = gAgent.getRegion(); 2643 LLViewerRegion* region = gAgent.getRegion();
2555 2644
2556 if( (LLStartUp::getStartupState() < STATE_STARTED) || !region ) 2645 if( (LLStartUp::getStartupState() >= STATE_STARTED) && region )
2557 { 2646 {
2558 // Quit immediately
2559 forceQuit();
2560 return;
2561 }
2562
2563 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); 2647 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
2564 effectp->setPositionGlobal(gAgent.getPositionGlobal()); 2648 effectp->setPositionGlobal(gAgent.getPositionGlobal());
2565 effectp->setColor(LLColor4U(gAgent.getEffectColor())); 2649 effectp->setColor(LLColor4U(gAgent.getEffectColor()));
2566 LLHUDManager::getInstance()->sendEffects(); 2650 LLHUDManager::getInstance()->sendEffects();
2651 send_stats();
2652 }
2653 else
2654 {
2655 mQuitRequested=true;
2656 LLAppViewer::instance()->forceQuit();
2657 }
2567 2658
2568 // Attempt to close all floaters that might be 2659 // Attempt to close all floaters that might be
2569 // editing things. 2660 // editing things.
@@ -2573,17 +2664,14 @@ void LLAppViewer::requestQuit()
2573 gFloaterView->closeAllChildren(true); 2664 gFloaterView->closeAllChildren(true);
2574 } 2665 }
2575 2666
2576 send_stats();
2577
2578 gLogoutTimer.reset(); 2667 gLogoutTimer.reset();
2579 mQuitRequested = true;
2580} 2668}
2581 2669
2582static void finish_quit(S32 option, void *userdata) 2670static void finish_quit(S32 option, void *userdata)
2583{ 2671{
2584 if (option == 0) 2672 if (option == 0)
2585 { 2673 {
2586 LLAppViewer::instance()->requestQuit(); 2674 LLAppViewer::instance()->requestLogout(true);
2587 } 2675 }
2588} 2676}
2589 2677
@@ -2592,6 +2680,12 @@ void LLAppViewer::userQuit()
2592 gViewerWindow->alertXml("ConfirmQuit", finish_quit, NULL); 2680 gViewerWindow->alertXml("ConfirmQuit", finish_quit, NULL);
2593} 2681}
2594 2682
2683//static
2684void LLAppViewer::userLogout(void *userdata)
2685{
2686 LLAppViewer::instance()->requestLogout(false);
2687}
2688
2595static void finish_early_exit(S32 option, void* userdata) 2689static void finish_early_exit(S32 option, void* userdata)
2596{ 2690{
2597 LLAppViewer::instance()->forceQuit(); 2691 LLAppViewer::instance()->forceQuit();
@@ -2619,6 +2713,7 @@ void LLAppViewer::abortQuit()
2619{ 2713{
2620 llinfos << "abortQuit()" << llendl; 2714 llinfos << "abortQuit()" << llendl;
2621 mQuitRequested = false; 2715 mQuitRequested = false;
2716 mLogoutRequested = false;
2622} 2717}
2623 2718
2624bool LLAppViewer::initCache() 2719bool LLAppViewer::initCache()
@@ -2895,7 +2990,7 @@ void finish_forced_disconnect(S32 /* option */, void* /* userdata */)
2895 2990
2896void LLAppViewer::forceDisconnect(const std::string& mesg) 2991void LLAppViewer::forceDisconnect(const std::string& mesg)
2897{ 2992{
2898 if (gDoDisconnect) 2993 if (gDoDisconnect||mQuitRequested||mLogoutRequested)
2899 { 2994 {
2900 // Already popped up one of these dialogs, don't 2995 // Already popped up one of these dialogs, don't
2901 // do this again. 2996 // do this again.
@@ -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
3529void LLAppViewer::idleNetwork() 3627void 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
3700void LLAppViewer::forceErrorLLError() 3808void LLAppViewer::forceErrorLLError()
diff --git a/linden/indra/newview/llappviewer.h b/linden/indra/newview/llappviewer.h
index 3be5de7..8d8e30f 100644
--- a/linden/indra/newview/llappviewer.h
+++ b/linden/indra/newview/llappviewer.h
@@ -61,13 +61,15 @@ public:
61 61
62 // Application control 62 // Application control
63 void forceQuit(); // Puts the viewer into 'shutting down without error' mode. 63 void forceQuit(); // Puts the viewer into 'shutting down without error' mode.
64 void requestQuit(); // Request a quit. A kinder, gentler quit. 64 void requestLogout(bool quit_after); // Request a logout, optionally quitting after
65 void userQuit(); // The users asks to quit. Confirm, then requestQuit() 65 void userQuit(); // The users asks to quit. Confirm, then requestQuit()
66 static void userLogout(void *userdata); //graceful logout without quit
66 void earlyExit(const std::string& msg); // Display an error dialog and forcibly quit. 67 void earlyExit(const std::string& msg); // Display an error dialog and forcibly quit.
67 void forceExit(S32 arg); // exit() immediately (after some cleanup). 68 void forceExit(S32 arg); // exit() immediately (after some cleanup).
68 void abortQuit(); // Called to abort a quit request. 69 void abortQuit(); // Called to abort a quit request.
69 70
70 bool quitRequested() { return mQuitRequested; } 71 bool quitRequested() { return mQuitRequested; }
72 bool logoutRequested() { return mLogoutRequested; }
71 bool logoutRequestSent() { return mLogoutRequestSent; } 73 bool logoutRequestSent() { return mLogoutRequestSent; }
72 74
73 void writeDebugInfo(); 75 void writeDebugInfo();
@@ -157,11 +159,12 @@ protected:
157 159
158 virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this. 160 virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this.
159 161
162
160private: 163private:
161 164
162 bool initThreads(); // Initialize viewer threads, return false on failure. 165 bool initThreads(); // Initialize viewer threads, return false on failure.
163 bool initConfiguration(); // Initialize settings from the command line/config file. 166 bool initConfiguration(); // Initialize settings from the command line/config file.
164 void initGridChoice(); 167 //void initGridChoice();
165 168
166 bool initCache(); // Initialize local client cache. 169 bool initCache(); // Initialize local client cache.
167 void purgeCache(); // Clear the local cache. 170 void purgeCache(); // Clear the local cache.
@@ -211,6 +214,7 @@ private:
211 bool mSavedFinalSnapshot; 214 bool mSavedFinalSnapshot;
212 215
213 bool mQuitRequested; // User wants to quit, may have modified documents open. 216 bool mQuitRequested; // User wants to quit, may have modified documents open.
217 bool mLogoutRequested; // User wants to log out, but not quit
214 bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. 218 bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim.
215 S32 mYieldTime; 219 S32 mYieldTime;
216 LLSD mSettingsFileList; 220 LLSD mSettingsFileList;
@@ -220,15 +224,6 @@ private:
220 // for tracking viewer<->region circuit death 224 // for tracking viewer<->region circuit death
221 bool mAgentRegionLastAlive; 225 bool mAgentRegionLastAlive;
222 LLUUID mAgentRegionLastID; 226 LLUUID mAgentRegionLastID;
223
224public:
225 //some information for updater
226 typedef struct
227 {
228 std::string mUpdateExePath;
229 std::ostringstream mParams;
230 }LLUpdaterInfo ;
231 static LLUpdaterInfo *sUpdaterInfo ;
232}; 227};
233 228
234// consts from viewer.h 229// consts from viewer.h
@@ -239,6 +234,9 @@ const S32 AGENT_UPDATES_PER_SECOND = 10;
239// 234//
240// "// llstartup" indicates that llstartup is the only client for this global. 235// "// llstartup" indicates that llstartup is the only client for this global.
241 236
237
238extern std::string gDisabledMessage; // llstartup
239extern BOOL gHideLinks; // used by llpanellogin, lllfloaterbuycurrency, llstartup
242extern LLSD gDebugInfo; 240extern LLSD gDebugInfo;
243 241
244extern BOOL gAllowIdleAFK; 242extern BOOL gAllowIdleAFK;
diff --git a/linden/indra/newview/llappviewerlinux.h b/linden/indra/newview/llappviewerlinux.h
index b464e48..2f5c13b 100644
--- a/linden/indra/newview/llappviewerlinux.h
+++ b/linden/indra/newview/llappviewerlinux.h
@@ -61,9 +61,10 @@ public:
61 61
62protected: 62protected:
63 virtual bool beingDebugged(); 63 virtual bool beingDebugged();
64 64
65 virtual bool restoreErrorTrap(); 65 virtual bool restoreErrorTrap();
66 virtual void handleCrashReporting(bool reportFreeze); 66 virtual void handleCrashReporting(bool reportFreeze);
67
67 virtual void handleSyncCrashTrace(); 68 virtual void handleSyncCrashTrace();
68 69
69 virtual bool initLogging(); 70 virtual bool initLogging();
diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp
index 1d353fa..ccecef9 100644
--- a/linden/indra/newview/llcallingcard.cpp
+++ b/linden/indra/newview/llcallingcard.cpp
@@ -136,8 +136,20 @@ LLAvatarTracker::~LLAvatarTracker()
136 deleteTrackingData(); 136 deleteTrackingData();
137 std::for_each(mObservers.begin(), mObservers.end(), DeletePointer()); 137 std::for_each(mObservers.begin(), mObservers.end(), DeletePointer());
138 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer()); 138 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer());
139 mObservers.erase(mObservers.begin(), mObservers.end());
140 mBuddyInfo.erase(mBuddyInfo.begin(), mBuddyInfo.end());
139} 141}
140 142
143
144void LLAvatarTracker::reset()
145{
146 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer());
147 mBuddyInfo.erase(mBuddyInfo.begin(), mBuddyInfo.end());
148 mModifyMask |= LLFriendObserver::REMOVE;
149 notifyObservers();
150}
151
152
141void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name) 153void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name)
142{ 154{
143 deleteTrackingData(); 155 deleteTrackingData();
diff --git a/linden/indra/newview/llcallingcard.h b/linden/indra/newview/llcallingcard.h
index cbcb237..21eea2b 100644
--- a/linden/indra/newview/llcallingcard.h
+++ b/linden/indra/newview/llcallingcard.h
@@ -85,7 +85,7 @@ class LLAvatarTracker
85{ 85{
86public: 86public:
87 static LLAvatarTracker& instance() { return sInstance; } 87 static LLAvatarTracker& instance() { return sInstance; }
88 88 void reset();
89 void track(const LLUUID& avatar_id, const std::string& name); 89 void track(const LLUUID& avatar_id, const std::string& name);
90 void untrack(const LLUUID& avatar_id); 90 void untrack(const LLUUID& avatar_id);
91 bool isTrackedAgentValid() { return mTrackedAgentValid; } 91 bool isTrackedAgentValid() { return mTrackedAgentValid; }
diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp
index 1de3690..403ab20 100644
--- a/linden/indra/newview/llchatbar.cpp
+++ b/linden/indra/newview/llchatbar.cpp
@@ -120,6 +120,7 @@ LLChatBar::LLChatBar()
120 120
121LLChatBar::~LLChatBar() 121LLChatBar::~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
53class LLCamera; 54class LLCamera;
54class LLDrawPool; 55class LLDrawPool;
diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp
index a31dde5..70223c9 100644
--- a/linden/indra/newview/llfloaterworldmap.cpp
+++ b/linden/indra/newview/llfloaterworldmap.cpp
@@ -334,6 +334,7 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
334 334
335 // If nothing is being tracked, set flag so the user position will be found 335 // If nothing is being tracked, set flag so the user position will be found
336 gFloaterWorldMap->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); 336 gFloaterWorldMap->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING );
337
337 } 338 }
338 339
339 if (center_on_target) 340 if (center_on_target)
@@ -450,7 +451,8 @@ void LLFloaterWorldMap::draw()
450 childSetEnabled("Go Home", enable_go_home); 451 childSetEnabled("Go Home", enable_go_home);
451 452
452 updateLocation(); 453 updateLocation();
453 454
455
454 LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); 456 LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus();
455 if (LLTracker::TRACKING_AVATAR == tracking_status) 457 if (LLTracker::TRACKING_AVATAR == tracking_status)
456 { 458 {
@@ -496,7 +498,6 @@ void LLFloaterWorldMap::draw()
496 centerOnTarget(TRUE); 498 centerOnTarget(TRUE);
497 } 499 }
498 500
499 childSetEnabled("Teleport", (BOOL)tracking_status);
500// childSetEnabled("Clear", (BOOL)tracking_status); 501// childSetEnabled("Clear", (BOOL)tracking_status);
501 childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation); 502 childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation);
502 childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); 503 childSetEnabled("copy_slurl", (mSLURL.size() > 0) );
@@ -769,7 +770,7 @@ void LLFloaterWorldMap::updateLocation()
769void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord) 770void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord)
770{ 771{
771 LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name); 772 LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name);
772 z_coord = llclamp(z_coord, 0, 4096); 773 z_coord = llclamp(z_coord, 0, 1000);
773 if (sim_info) 774 if (sim_info)
774 { 775 {
775 LLVector3 local_pos; 776 LLVector3 local_pos;
@@ -1079,6 +1080,7 @@ void LLFloaterWorldMap::onPanBtn( void* userdata )
1079void LLFloaterWorldMap::onGoHome(void*) 1080void LLFloaterWorldMap::onGoHome(void*)
1080{ 1081{
1081 gAgent.teleportHomeConfirm(); 1082 gAgent.teleportHomeConfirm();
1083 gFloaterWorldMap->close();
1082} 1084}
1083 1085
1084 1086
diff --git a/linden/indra/newview/llfloaterworldmap.h b/linden/indra/newview/llfloaterworldmap.h
index 568d3cc..2f444b9 100644
--- a/linden/indra/newview/llfloaterworldmap.h
+++ b/linden/indra/newview/llfloaterworldmap.h
@@ -67,6 +67,8 @@ public:
67 static void toggle(void*); 67 static void toggle(void*);
68 static void hide(void*); 68 static void hide(void*);
69 69
70 static void addServer(const std::string& server);
71
70 /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE ); 72 /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE );
71 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); 73 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
72 /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 74 /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
@@ -100,6 +102,7 @@ public:
100 void clearLocationSelection(BOOL clear_ui = FALSE); 102 void clearLocationSelection(BOOL clear_ui = FALSE);
101 void clearAvatarSelection(BOOL clear_ui = FALSE); 103 void clearAvatarSelection(BOOL clear_ui = FALSE);
102 void clearLandmarkSelection(BOOL clear_ui = FALSE); 104 void clearLandmarkSelection(BOOL clear_ui = FALSE);
105 void clearGridSelection(BOOL clear_ui = FALSE);
103 106
104 // Adjust the maximally zoomed out limit of the zoom slider so you can 107 // Adjust the maximally zoomed out limit of the zoom slider so you can
105 // see the whole world, plus a little. 108 // see the whole world, plus a little.
@@ -114,8 +117,9 @@ public:
114protected: 117protected:
115 static void onPanBtn( void* userdata ); 118 static void onPanBtn( void* userdata );
116 119
117 static void onGoHome(void* data); 120 static void onGridManager(void* data);
118 121
122 static void onGoHome(void* data);
119 static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data ); 123 static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data );
120 static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data ); 124 static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data );
121 125
@@ -157,6 +161,7 @@ protected:
157 static void onLocationCommit( void* userdata ); 161 static void onLocationCommit( void* userdata );
158 static void onCommitLocation( LLUICtrl* ctrl, void* userdata ); 162 static void onCommitLocation( LLUICtrl* ctrl, void* userdata );
159 static void onCommitSearchResult( LLUICtrl* ctrl, void* userdata ); 163 static void onCommitSearchResult( LLUICtrl* ctrl, void* userdata );
164 static void onSelectServer(LLUICtrl*, void* userdata);
160 165
161 void cacheLandmarkPosition(); 166 void cacheLandmarkPosition();
162 167
diff --git a/linden/indra/newview/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
377protected: 380protected:
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 a8d5045..008d79d 100644
--- a/linden/indra/newview/llinventoryview.cpp
+++ b/linden/indra/newview/llinventoryview.cpp
@@ -967,6 +967,7 @@ void LLInventoryView::cleanup()
967 { 967 {
968 sActiveViews.get(i)->destroy(); 968 sActiveViews.get(i)->destroy();
969 } 969 }
970 gInventory.empty();
970} 971}
971 972
972void LLInventoryView::toggleFindOptions() 973void LLInventoryView::toggleFindOptions()
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index 325fcbc..27e6043 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
265void 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
708void LLPanelLogin::addServer(const std::string& server, S32 domain_name) 697void 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");
723void 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
859void 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
853void LLPanelLogin::loadLoginPage() 879void 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,26 @@ 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
1077void LLPanelLogin::onClickGrid(void *)
1078{
1079 if (sInstance && sInstance->mCallback)
1080 {
1081 LoginFloater::newShow(std::string("Test"), false);
1082 }
1083}
1042 1084
1043// static 1085// static
1044void LLPanelLogin::newAccountAlertCallback(S32 option, void*) 1086void LLPanelLogin::newAccountAlertCallback(S32 option, void*)
@@ -1104,7 +1146,7 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
1104} 1146}
1105 1147
1106// static 1148// static
1107void LLPanelLogin::onSelectServer(LLUICtrl*, void*) 1149void LLPanelLogin::onSelectServer(LLUICtrl* ctrl, void*)
1108{ 1150{
1109 // *NOTE: The paramters for this method are ignored. 1151 // *NOTE: The paramters for this method are ignored.
1110 // LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) 1152 // LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
@@ -1113,46 +1155,29 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
1113 // The user twiddled with the grid choice ui. 1155 // The user twiddled with the grid choice ui.
1114 // apply the selection to the grid setting. 1156 // apply the selection to the grid setting.
1115 std::string grid_label; 1157 std::string grid_label;
1116 S32 grid_index; 1158 //S32 grid_index;
1117 1159
1118 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); 1160 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
1119 LLSD combo_val = combo->getValue(); 1161 LLSD combo_val = combo->getValue();
1120 1162
1121 if (LLSD::TypeInteger == combo_val.type()) 1163 std::string mCurGrid = ctrl->getValue().asString();
1122 { 1164 //KOW
1123 grid_index = combo->getValue().asInteger(); 1165 gHippoGridManager->setCurrentGrid(mCurGrid);
1124 1166 // HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
1125 if ((S32)GRID_INFO_OTHER == grid_index) 1167 // if (gridInfo) {
1126 { 1168 // //childSetText("gridnick", gridInfo->getGridNick());
1127 // This happens if the user specifies a custom grid 1169 // //platform->setCurrentByIndex(gridInfo->getPlatform());
1128 // via command line. 1170 // //childSetText("gridname", gridInfo->getGridName());
1129 grid_label = combo->getSimple(); 1171 // LLPanelLogin::setFields( gridInfo->getFirstName(), gridInfo->getLastName(), gridInfo->getAvatarPassword(), 1 );
1130 } 1172 // }
1131 }
1132 else
1133 {
1134 // no valid selection, return other
1135 grid_index = (S32)GRID_INFO_OTHER;
1136 grid_label = combo_val.asString();
1137 }
1138 1173
1139 // This new seelction will override preset uris 1174
1140 // from the command line. 1175 llwarns << "current grid = " << mCurGrid << llendl;
1141 LLViewerLogin* vl = LLViewerLogin::getInstance();
1142 vl->resetURIs();
1143 if(grid_index != GRID_INFO_OTHER)
1144 {
1145 vl->setGridChoice((EGridInfo)grid_index);
1146 }
1147 else
1148 {
1149 vl->setGridChoice(grid_label);
1150 }
1151 1176
1152 // grid changed so show new splash screen (possibly) 1177 // grid changed so show new splash screen (possibly)
1153 loadLoginPage(); 1178 loadLoginPage();
1154} 1179}
1155 1180/*
1156void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) 1181void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
1157{ 1182{
1158 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); 1183 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
@@ -1161,3 +1186,4 @@ void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
1161 onSelectServer(combo, NULL); 1186 onSelectServer(combo, NULL);
1162 } 1187 }
1163} 1188}
1189*/
diff --git a/linden/indra/newview/llpanellogin.h b/linden/indra/newview/llpanellogin.h
index a303e32..8a9747b 100644
--- a/linden/indra/newview/llpanellogin.h
+++ b/linden/indra/newview/llpanellogin.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2009, Linden Research, Inc. 7 * Copyright (c) 2002-2008, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -60,6 +60,7 @@ class LLLoginHandler : public LLCommandHandler
60 LLUUID mWebLoginKey; 60 LLUUID mWebLoginKey;
61 std::string mFirstName; 61 std::string mFirstName;
62 std::string mLastName; 62 std::string mLastName;
63 std::string mPassword;
63}; 64};
64 65
65extern LLLoginHandler gLoginHandler; 66extern LLLoginHandler gLoginHandler;
@@ -86,8 +87,7 @@ public:
86 static void setFields(const std::string& firstname, const std::string& lastname, 87 static void setFields(const std::string& firstname, const std::string& lastname,
87 const std::string& password, BOOL remember); 88 const std::string& password, BOOL remember);
88 89
89 static void addServer(const std::string& server, S32 domain_name); 90 static void addServer(const std::string& server);
90 static void setServer(S32 domain_name);
91 static void refreshLocation( bool force_visible ); 91 static void refreshLocation( bool force_visible );
92 92
93 static void getFields(std::string& firstname, std::string& lastname, 93 static void getFields(std::string& firstname, std::string& lastname,
@@ -101,12 +101,14 @@ public:
101 void setSiteIsAlive( bool alive ); 101 void setSiteIsAlive( bool alive );
102 102
103 static void loadLoginPage(); 103 static void loadLoginPage();
104 static void refreshLoginPage();
104 static void giveFocus(); 105 static void giveFocus();
105 static void setAlwaysRefresh(bool refresh); 106 static void setAlwaysRefresh(bool refresh);
106 static void mungePassword(LLUICtrl* caller, void* user_data); 107 static void mungePassword(LLUICtrl* caller, void* user_data);
107 108
108private: 109private:
109 static void onClickConnect(void*); 110 static void onClickConnect(void*);
111 static void onClickGrid(void*);
110 static void onClickNewAccount(void*); 112 static void onClickNewAccount(void*);
111 static void newAccountAlertCallback(S32 option, void*); 113 static void newAccountAlertCallback(S32 option, void*);
112 static void onClickQuit(void*); 114 static void onClickQuit(void*);
diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp
index 5cb14fc..3d71202 100644
--- a/linden/indra/newview/llprefsim.cpp
+++ b/linden/indra/newview/llprefsim.cpp
@@ -46,6 +46,8 @@
46 46
47#include "lldirpicker.h" 47#include "lldirpicker.h"
48 48
49#include "hippoGridManager.h"
50
49class LLPrefsIMImpl : public LLPanel 51class LLPrefsIMImpl : public LLPanel
50{ 52{
51public: 53public:
@@ -181,7 +183,7 @@ void LLPrefsIMImpl::apply()
181 183
182 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); 184 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
183 185
184 gDirUtilp->setPerAccountChatLogsDir(gSavedSettings.getString("FirstName"), 186 gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(), gSavedSettings.getString("FirstName"),
185 gSavedSettings.getString("LastName") ); 187 gSavedSettings.getString("LastName") );
186 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); 188 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
187 189
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 ea08298..9b46054 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -29,7 +29,14 @@
29 * $/LicenseInfo$ 29 * $/LicenseInfo$
30 */ 30 */
31 31
32#include "llviewerprecompiledheaders.h" 32// #include "llviewerprecompiledheaders.h"
33
34
35#if LL_WINDOWS
36 #define WIN32_LEAN_AND_MEAN
37 #include <winsock2.h>
38 #include <windows.h>
39#endif
33 40
34#include "llstartup.h" 41#include "llstartup.h"
35 42
@@ -190,6 +197,8 @@
190#include "lldxhardware.h" 197#include "lldxhardware.h"
191#endif 198#endif
192 199
200#include "hippoGridManager.h"
201#include "hippoLimits.h"
193// 202//
194// exported globals 203// exported globals
195// 204//
@@ -222,7 +231,8 @@ static std::string sInitialOutfitGender; // "male" or "female"
222static bool gUseCircuitCallbackCalled = false; 231static bool gUseCircuitCallbackCalled = false;
223 232
224EStartupState LLStartUp::gStartupState = STATE_FIRST; 233EStartupState LLStartUp::gStartupState = STATE_FIRST;
225 234bool LLStartUp::mStartedOnce = false;
235bool LLStartUp::mShouldAutoLogin = false;
226 236
227// 237//
228// local function declaration 238// local function declaration
@@ -248,7 +258,6 @@ void dialog_choose_gender_first_start();
248void callback_choose_gender(S32 option, void* userdata); 258void callback_choose_gender(S32 option, void* userdata);
249void init_start_screen(S32 location_id); 259void init_start_screen(S32 location_id);
250void release_start_screen(); 260void release_start_screen();
251void reset_login();
252void apply_udp_blacklist(const std::string& csv); 261void apply_udp_blacklist(const std::string& csv);
253 262
254void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) 263void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data)
@@ -322,6 +331,7 @@ bool idle_startup()
322 static S32 timeout_count = 0; 331 static S32 timeout_count = 0;
323 332
324 static LLTimer login_time; 333 static LLTimer login_time;
334 static LLFrameTimer wearables_timer;
325 335
326 // until this is encapsulated, this little hack for the 336 // until this is encapsulated, this little hack for the
327 // auth/transform loop will do. 337 // auth/transform loop will do.
@@ -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();
@@ -695,10 +705,10 @@ bool idle_startup()
695 else 705 else
696 { 706 {
697 // if not automatically logging in, display login dialog 707 // if not automatically logging in, display login dialog
698 // a valid grid is selected
699 firstname = gSavedSettings.getString("FirstName"); 708 firstname = gSavedSettings.getString("FirstName");
700 lastname = gSavedSettings.getString("LastName"); 709 lastname = gSavedSettings.getString("LastName");
701 password = load_password_from_disk(); 710 password = load_password_from_disk();
711
702 remember_password = gSavedSettings.getBOOL("RememberPassword"); 712 remember_password = gSavedSettings.getBOOL("RememberPassword");
703 show_connect_box = true; 713 show_connect_box = true;
704 } 714 }
@@ -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,13 +870,14 @@ 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(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
851 LLFile::mkdir(gDirUtilp->getLindenUserDir()); 881 LLFile::mkdir(gDirUtilp->getLindenUserDir());
852 882
853 // Set PerAccountSettingsFile to the default value. 883 // Set PerAccountSettingsFile to the default value.
@@ -878,7 +908,7 @@ bool idle_startup()
878 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); 908 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
879 } 909 }
880 910
881 gDirUtilp->setPerAccountChatLogsDir(firstname, lastname); 911 gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
882 912
883 LLFile::mkdir(gDirUtilp->getChatLogsDir()); 913 LLFile::mkdir(gDirUtilp->getChatLogsDir());
884 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); 914 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
@@ -1054,6 +1084,10 @@ bool idle_startup()
1054 LLStringUtil::format_map_t args; 1084 LLStringUtil::format_map_t args;
1055 args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); 1085 args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle();
1056 auth_desc = LLTrans::getString("LoginInProgress", args); 1086 auth_desc = LLTrans::getString("LoginInProgress", args);
1087
1088 //Since we are about to login, we don't want the client to attempt auto login
1089 //again until the user does a grid2grid teleport.
1090 LLStartUp::setShouldAutoLogin(false);
1057 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); 1091 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE );
1058 } 1092 }
1059 1093
@@ -1093,13 +1127,15 @@ bool idle_startup()
1093 hashed_mac.hex_digest(hashed_mac_string); 1127 hashed_mac.hex_digest(hashed_mac_string);
1094 1128
1095 // TODO if statement here to use web_login_key 1129 // TODO if statement here to use web_login_key
1130 if(web_login_key.isNull()){
1096 sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); 1131 sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1);
1097 LLUserAuth::getInstance()->authenticate( 1132 LLUserAuth::getInstance()->authenticate(
1098 sAuthUris[sAuthUriNum], 1133 sAuthUris[sAuthUriNum],
1099 auth_method, 1134 auth_method,
1100 firstname, 1135 firstname,
1101 lastname, 1136 lastname,
1102 password, // web_login_key, 1137 password,
1138 //web_login_key,
1103 start.str(), 1139 start.str(),
1104 gSkipOptionalUpdate, 1140 gSkipOptionalUpdate,
1105 gAcceptTOS, 1141 gAcceptTOS,
@@ -1108,6 +1144,22 @@ bool idle_startup()
1108 requested_options, 1144 requested_options,
1109 hashed_mac_string, 1145 hashed_mac_string,
1110 LLAppViewer::instance()->getSerialNumber()); 1146 LLAppViewer::instance()->getSerialNumber());
1147 } else {
1148 LLUserAuth::getInstance()->authenticate(
1149 sAuthUris[sAuthUriNum],
1150 auth_method,
1151 firstname,
1152 lastname,
1153 web_login_key,
1154 start.str(),
1155 gSkipOptionalUpdate,
1156 gAcceptTOS,
1157 gAcceptCriticalMessage,
1158 gLastExecEvent,
1159 requested_options,
1160 hashed_mac_string,
1161 LLAppViewer::instance()->getSerialNumber());
1162 }
1111 1163
1112 // reset globals 1164 // reset globals
1113 gAcceptTOS = FALSE; 1165 gAcceptTOS = FALSE;
@@ -1167,7 +1219,6 @@ bool idle_startup()
1167 LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; 1219 LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL;
1168 std::ostringstream emsg; 1220 std::ostringstream emsg;
1169 bool quit = false; 1221 bool quit = false;
1170 bool update = false;
1171 std::string login_response; 1222 std::string login_response;
1172 std::string reason_response; 1223 std::string reason_response;
1173 std::string message_response; 1224 std::string message_response;
@@ -1211,7 +1262,11 @@ bool idle_startup()
1211 reason_response = LLUserAuth::getInstance()->getResponse("reason"); 1262 reason_response = LLUserAuth::getInstance()->getResponse("reason");
1212 message_response = LLUserAuth::getInstance()->getResponse("message"); 1263 message_response = LLUserAuth::getInstance()->getResponse("message");
1213 1264
1214 if (!message_response.empty()) 1265 if (gHideLinks && reason_response == "disabled")
1266 {
1267 emsg << gDisabledMessage;
1268 }
1269 else if (!message_response.empty())
1215 { 1270 {
1216 // XUI: fix translation for strings returned during login 1271 // XUI: fix translation for strings returned during login
1217 // We need a generic table for translations 1272 // We need a generic table for translations
@@ -1269,7 +1324,16 @@ bool idle_startup()
1269 if(reason_response == "update") 1324 if(reason_response == "update")
1270 { 1325 {
1271 auth_message = LLUserAuth::getInstance()->getResponse("message"); 1326 auth_message = LLUserAuth::getInstance()->getResponse("message");
1272 update = true; 1327 if (show_connect_box)
1328 {
1329 update_app(TRUE, auth_message);
1330 LLStartUp::setStartupState( STATE_UPDATE_CHECK );
1331 return false;
1332 }
1333 else
1334 {
1335 quit = true;
1336 }
1273 } 1337 }
1274 if(reason_response == "optional") 1338 if(reason_response == "optional")
1275 { 1339 {
@@ -1307,21 +1371,6 @@ bool idle_startup()
1307 break; 1371 break;
1308 } 1372 }
1309 1373
1310 if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
1311 {
1312 gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
1313 if (show_connect_box)
1314 {
1315 update_app(TRUE, auth_message);
1316 LLStartUp::setStartupState( STATE_UPDATE_CHECK );
1317 return false;
1318 }
1319 else
1320 {
1321 quit = true;
1322 }
1323 }
1324
1325 // Version update and we're not showing the dialog 1374 // Version update and we're not showing the dialog
1326 if(quit) 1375 if(quit)
1327 { 1376 {
@@ -1534,6 +1583,42 @@ bool idle_startup()
1534 } 1583 }
1535 } 1584 }
1536 1585
1586 // Override grid info with anything sent in the login response
1587 std::string tmp = LLUserAuth::getInstance()->getResponse("gridname");
1588 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
1589 tmp = LLUserAuth::getInstance()->getResponse("loginuri");
1590 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp);
1591 tmp = LLUserAuth::getInstance()->getResponse("welcome");
1592 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
1593 tmp = LLUserAuth::getInstance()->getResponse("loginpage");
1594 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
1595 tmp = LLUserAuth::getInstance()->getResponse("economy");
1596 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
1597 tmp = LLUserAuth::getInstance()->getResponse("helperuri");
1598 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
1599 tmp = LLUserAuth::getInstance()->getResponse("about");
1600 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
1601 tmp = LLUserAuth::getInstance()->getResponse("website");
1602 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
1603 tmp = LLUserAuth::getInstance()->getResponse("help");
1604 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
1605 tmp = LLUserAuth::getInstance()->getResponse("support");
1606 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
1607 tmp = LLUserAuth::getInstance()->getResponse("register");
1608 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
1609 tmp = LLUserAuth::getInstance()->getResponse("account");
1610 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
1611 tmp = LLUserAuth::getInstance()->getResponse("password");
1612 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp);
1613 tmp = LLUserAuth::getInstance()->getResponse("search");
1614 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
1615 tmp = LLUserAuth::getInstance()->getResponse("currency");
1616 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
1617 tmp = LLUserAuth::getInstance()->getResponse("real_currency");
1618 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
1619 tmp = LLUserAuth::getInstance()->getResponse("directory_fee");
1620 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str()));
1621 gHippoGridManager->saveFile();
1537 1622
1538 // JC: gesture loading done below, when we have an asset system 1623 // JC: gesture loading done below, when we have an asset system
1539 // in place. Don't delete/clear user_credentials until then. 1624 // in place. Don't delete/clear user_credentials until then.
@@ -1558,8 +1643,10 @@ bool idle_startup()
1558 LLStringUtil::format_map_t args; 1643 LLStringUtil::format_map_t args;
1559 args["[ERROR_MESSAGE]"] = emsg.str(); 1644 args["[ERROR_MESSAGE]"] = emsg.str();
1560 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1645 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done);
1561 reset_login(); 1646 LLStartUp::resetLogin();
1562 gSavedSettings.setBOOL("AutoLogin", FALSE); 1647 gSavedSettings.setBOOL("AutoLogin", FALSE);
1648 //this might be redundant
1649 LLStartUp::setShouldAutoLogin(false);
1563 show_connect_box = true; 1650 show_connect_box = true;
1564 } 1651 }
1565 1652
@@ -1578,8 +1665,10 @@ bool idle_startup()
1578 LLStringUtil::format_map_t args; 1665 LLStringUtil::format_map_t args;
1579 args["[ERROR_MESSAGE]"] = emsg.str(); 1666 args["[ERROR_MESSAGE]"] = emsg.str();
1580 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1667 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done);
1581 reset_login(); 1668 LLStartUp::resetLogin();
1582 gSavedSettings.setBOOL("AutoLogin", FALSE); 1669 gSavedSettings.setBOOL("AutoLogin", FALSE);
1670 //this might be redundant
1671 LLStartUp::setShouldAutoLogin(false);
1583 show_connect_box = true; 1672 show_connect_box = true;
1584 // Don't save an incorrect password to disk. 1673 // Don't save an incorrect password to disk.
1585 save_password_to_disk(NULL); 1674 save_password_to_disk(NULL);
@@ -1593,6 +1682,7 @@ bool idle_startup()
1593 if (STATE_WORLD_INIT == LLStartUp::getStartupState()) 1682 if (STATE_WORLD_INIT == LLStartUp::getStartupState())
1594 { 1683 {
1595 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); 1684 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD);
1685 gDisconnected=FALSE;
1596 display_startup(); 1686 display_startup();
1597 // We should have an agent id by this point. 1687 // We should have an agent id by this point.
1598 llassert(!(gAgentID == LLUUID::null)); 1688 llassert(!(gAgentID == LLUUID::null));
@@ -1621,10 +1711,11 @@ bool idle_startup()
1621 LLWaterParamManager::initClass(); 1711 LLWaterParamManager::initClass();
1622 1712
1623 // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering 1713 // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering
1714
1715 if (!LLStartUp::getStartedOnce())
1624 LLViewerObject::initVOClasses(); 1716 LLViewerObject::initVOClasses();
1625 1717
1626 display_startup(); 1718 display_startup();
1627
1628 // This is where we used to initialize gWorldp. Original comment said: 1719 // This is where we used to initialize gWorldp. Original comment said:
1629 // World initialization must be done after above window init 1720 // World initialization must be done after above window init
1630 1721
@@ -1767,7 +1858,7 @@ bool idle_startup()
1767 //reset statistics 1858 //reset statistics
1768 LLViewerStats::getInstance()->resetStats(); 1859 LLViewerStats::getInstance()->resetStats();
1769 1860
1770 if (!gNoRender) 1861 if ((!gNoRender)&&(!LLStartUp::getStartedOnce()))
1771 { 1862 {
1772 // 1863 //
1773 // Set up all of our statistics UI stuff. 1864 // Set up all of our statistics UI stuff.
@@ -2039,6 +2130,7 @@ bool idle_startup()
2039 LLAvatarTracker::instance().addBuddyList(list); 2130 LLAvatarTracker::instance().addBuddyList(list);
2040 } 2131 }
2041 2132
2133 /*
2042 options.clear(); 2134 options.clear();
2043 if(LLUserAuth::getInstance()->getOptions("ui-config", options)) 2135 if(LLUserAuth::getInstance()->getOptions("ui-config", options))
2044 { 2136 {
@@ -2057,6 +2149,7 @@ bool idle_startup()
2057 } 2149 }
2058 } 2150 }
2059 } 2151 }
2152 */
2060 options.clear(); 2153 options.clear();
2061 bool show_hud = false; 2154 bool show_hud = false;
2062 if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) 2155 if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options))
@@ -2144,6 +2237,7 @@ bool idle_startup()
2144 // Create the inventory views 2237 // Create the inventory views
2145 llinfos << "Creating Inventory Views" << llendl; 2238 llinfos << "Creating Inventory Views" << llendl;
2146 LLInventoryView::showAgentInventory(); 2239 LLInventoryView::showAgentInventory();
2240 llinfos << "Inventory Views Created" << llendl;
2147 2241
2148 // Hide the inventory if it wasn't shown at exit 2242 // Hide the inventory if it wasn't shown at exit
2149 if(!shown_at_exit) 2243 if(!shown_at_exit)
@@ -2207,7 +2301,7 @@ bool idle_startup()
2207 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); 2301 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
2208 }; 2302 };
2209 2303
2210 if (!gNoRender) 2304 if ((!gNoRender)&&(!LLStartUp::getStartedOnce()))
2211 { 2305 {
2212 // JC: Initializing audio requests many sounds for download. 2306 // JC: Initializing audio requests many sounds for download.
2213 init_audio(); 2307 init_audio();
@@ -2367,25 +2461,11 @@ bool idle_startup()
2367 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); 2461 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
2368 } 2462 }
2369 2463
2370
2371 // We now have an inventory skeleton, so if this is a user's first
2372 // login, we can start setting up their clothing and avatar
2373 // appearance. This helps to avoid the generic "Ruth" avatar in
2374 // the orientation island tutorial experience. JC
2375 if (gAgent.isFirstLogin()
2376 && !sInitialOutfit.empty() // registration set up an outfit
2377 && !sInitialOutfitGender.empty() // and a gender
2378 && gAgent.getAvatarObject() // can't wear clothes without object
2379 && !gAgent.isGenderChosen() ) // nothing already loading
2380 {
2381 // Start loading the wearables, textures, gestures
2382 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
2383 }
2384
2385 // wait precache-delay and for agent's avatar or a lot longer. 2464 // wait precache-delay and for agent's avatar or a lot longer.
2386 if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) 2465 if(((timeout_frac > 1.f) && gAgent.getAvatarObject())
2387 || (timeout_frac > 3.f)) 2466 || (timeout_frac > 3.f))
2388 { 2467 {
2468 wearables_timer.reset();
2389 LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); 2469 LLStartUp::setStartupState( STATE_WEARABLES_WAIT );
2390 } 2470 }
2391 else 2471 else
@@ -2401,7 +2481,6 @@ bool idle_startup()
2401 2481
2402 if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) 2482 if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState())
2403 { 2483 {
2404 static LLFrameTimer wearables_timer;
2405 2484
2406 const F32 wearables_time = wearables_timer.getElapsedTimeF32(); 2485 const F32 wearables_time = wearables_timer.getElapsedTimeF32();
2407 const F32 MAX_WEARABLES_TIME = 10.f; 2486 const F32 MAX_WEARABLES_TIME = 10.f;
@@ -2509,6 +2588,7 @@ bool idle_startup()
2509 LLUserAuth::getInstance()->reset(); 2588 LLUserAuth::getInstance()->reset();
2510 2589
2511 LLStartUp::setStartupState( STATE_STARTED ); 2590 LLStartUp::setStartupState( STATE_STARTED );
2591 LLStartUp::setStartedOnce(true);
2512 2592
2513 // Unmute audio if desired and setup volumes. 2593 // Unmute audio if desired and setup volumes.
2514 // Unmute audio if desired and setup volumes. 2594 // Unmute audio if desired and setup volumes.
@@ -2525,7 +2605,7 @@ bool idle_startup()
2525 gDebugView->mFastTimerView->setVisible(TRUE); 2605 gDebugView->mFastTimerView->setVisible(TRUE);
2526#endif 2606#endif
2527 2607
2528 LLAppViewer::instance()->handleLoginComplete(); 2608 LLAppViewer::instance()->initMainloopTimeout("Mainloop Init");
2529 2609
2530 return TRUE; 2610 return TRUE;
2531 } 2611 }
@@ -2555,14 +2635,15 @@ void login_show()
2555 // UI textures have been previously loaded in doPreloadImages() 2635 // UI textures have been previously loaded in doPreloadImages()
2556 2636
2557 LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL; 2637 LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL;
2558 LL_INFOS("AppInit") << "getGridChoice is " << LLViewerLogin::getInstance()->getGridChoice() << LL_ENDL;
2559 2638
2639 //KOW
2640/*
2560 LLViewerLogin* vl = LLViewerLogin::getInstance(); 2641 LLViewerLogin* vl = LLViewerLogin::getInstance();
2561 for(int grid_index = GRID_INFO_NONE + 1; grid_index < GRID_INFO_OTHER; ++grid_index) 2642 for(int grid_index = 1; grid_index < GRID_INFO_OTHER; ++grid_index)
2562 { 2643 {
2563 LLPanelLogin::addServer(vl->getKnownGridLabel((EGridInfo)grid_index), grid_index); 2644 LLPanelLogin::addServer(vl->getKnownGridLabel(grid_index), grid_index);
2564 } 2645 }
2565 LLPanelLogin::setServer(LLViewerLogin::getInstance()->getGridChoice()-1); 2646*/
2566} 2647}
2567 2648
2568// Callback for when login screen is closed. Option 0 = connect, option 1 = quit. 2649// Callback for when login screen is closed. Option 0 = connect, option 1 = quit.
@@ -2841,6 +2922,7 @@ void update_app(BOOL mandatory, const std::string& auth_msg)
2841 2922
2842void update_dialog_callback(S32 option, void *userdata) 2923void update_dialog_callback(S32 option, void *userdata)
2843{ 2924{
2925 std::string update_exe_path;
2844 bool mandatory = userdata != NULL; 2926 bool mandatory = userdata != NULL;
2845 2927
2846#if !LL_RELEASE_FOR_DOWNLOAD 2928#if !LL_RELEASE_FOR_DOWNLOAD
@@ -2857,8 +2939,6 @@ void update_dialog_callback(S32 option, void *userdata)
2857 if (mandatory) 2939 if (mandatory)
2858 { 2940 {
2859 LLAppViewer::instance()->forceQuit(); 2941 LLAppViewer::instance()->forceQuit();
2860 // Bump them back to the login screen.
2861 //reset_login();
2862 } 2942 }
2863 else 2943 else
2864 { 2944 {
@@ -2883,7 +2963,7 @@ void update_dialog_callback(S32 option, void *userdata)
2883 // *TODO constantize this guy 2963 // *TODO constantize this guy
2884 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); 2964 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
2885 2965
2886 if(LLAppViewer::sUpdaterInfo) 2966/* if(LLAppViewer::sUpdaterInfo)
2887 { 2967 {
2888 delete LLAppViewer::sUpdaterInfo ; 2968 delete LLAppViewer::sUpdaterInfo ;
2889 } 2969 }
@@ -2956,14 +3036,16 @@ void update_dialog_callback(S32 option, void *userdata)
2956 LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; 3036 LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL;
2957 3037
2958 // Run the auto-updater. 3038 // Run the auto-updater.
2959 system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ 3039*/
2960 3040 //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */
3041/*
2961#elif LL_LINUX 3042#elif LL_LINUX
2962 OSMessageBox("Automatic updating is not yet implemented for Linux.\n" 3043 OSMessageBox("Automatic updating is not yet implemented for Linux.\n"
2963 "Please download the latest version from www.secondlife.com.", 3044 "Please download the latest version from www.secondlife.com.",
2964 LLStringUtil::null, OSMB_OK); 3045 LLStringUtil::null, OSMB_OK);
2965#endif 3046#endif
2966 LLAppViewer::instance()->forceQuit(); 3047 LLAppViewer::instance()->forceQuit();
3048 */
2967} 3049}
2968 3050
2969void use_circuit_callback(void**, S32 result) 3051void use_circuit_callback(void**, S32 result)
@@ -2979,7 +3061,7 @@ void use_circuit_callback(void**, S32 result)
2979 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; 3061 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL;
2980 gViewerWindow->alertXml("LoginPacketNeverReceived", 3062 gViewerWindow->alertXml("LoginPacketNeverReceived",
2981 login_alert_status, NULL); 3063 login_alert_status, NULL);
2982 reset_login(); 3064 LLStartUp::resetLogin();
2983 } 3065 }
2984 else 3066 else
2985 { 3067 {
@@ -3929,7 +4011,16 @@ void LLStartUp::setStartupState( EStartupState state )
3929} 4011}
3930 4012
3931 4013
3932void reset_login() 4014//static
4015void LLStartUp::setStartedOnce(bool started)
4016{
4017 mStartedOnce=started;
4018}
4019
4020
4021//displays the screen and cleans up UI
4022// static
4023void LLStartUp::resetLogin()
3933{ 4024{
3934 LLStartUp::setStartupState( STATE_LOGIN_SHOW ); 4025 LLStartUp::setStartupState( STATE_LOGIN_SHOW );
3935 4026
diff --git a/linden/indra/newview/llstartup.h b/linden/indra/newview/llstartup.h
index cde9a1a..cf6d17c 100644
--- a/linden/indra/newview/llstartup.h
+++ b/linden/indra/newview/llstartup.h
@@ -87,7 +87,10 @@ public:
87 // Always use this to set gStartupState so changes are logged 87 // Always use this to set gStartupState so changes are logged
88 static void setStartupState( EStartupState state ); 88 static void setStartupState( EStartupState state );
89 static EStartupState getStartupState() { return gStartupState; }; 89 static EStartupState getStartupState() { return gStartupState; };
90 static std::string getStartupStateString() { return startupStateToString(gStartupState); }; 90 static void resetLogin();
91
92 static void setStartedOnce(bool started);
93 static bool getStartedOnce() { return mStartedOnce; };
91 94
92 static void multimediaInit(); 95 static void multimediaInit();
93 // Initialize LLViewerMedia multimedia engine. 96 // Initialize LLViewerMedia multimedia engine.
@@ -105,8 +108,12 @@ public:
105 static std::string sSLURLCommand; 108 static std::string sSLURLCommand;
106 // *HACK: On startup, if we were passed a secondlife://app/do/foo 109 // *HACK: On startup, if we were passed a secondlife://app/do/foo
107 // command URL, store it for later processing. 110 // command URL, store it for later processing.
111 static bool shouldAutoLogin() { return mShouldAutoLogin; };
112 static void setShouldAutoLogin(bool value) { mShouldAutoLogin = value; };
108 113
109private: 114private:
115 static bool mStartedOnce;
116 static bool mShouldAutoLogin;
110 static std::string startupStateToString(EStartupState state); 117 static std::string startupStateToString(EStartupState state);
111 static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState 118 static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState
112}; 119};
diff --git a/linden/indra/newview/lluserauth.cpp b/linden/indra/newview/lluserauth.cpp
index 968d489..c15eaed 100644
--- a/linden/indra/newview/lluserauth.cpp
+++ b/linden/indra/newview/lluserauth.cpp
@@ -42,6 +42,7 @@
42#include "llviewerbuild.h" 42#include "llviewerbuild.h"
43#include "llviewercontrol.h" 43#include "llviewercontrol.h"
44#include "llxmlrpctransaction.h" 44#include "llxmlrpctransaction.h"
45#include "llmd5.h"
45 46
46// NOTE: MUST include these after otherincludes since queue gets redefined!?!! 47// NOTE: MUST include these after otherincludes since queue gets redefined!?!!
47#include <curl/curl.h> 48#include <curl/curl.h>
@@ -114,8 +115,25 @@ void LLUserAuth::authenticate(
114 LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL; 115 LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL;
115 116
116 mAuthResponse = E_NO_RESPONSE_YET; 117 mAuthResponse = E_NO_RESPONSE_YET;
117 //mDownloadTimer.reset(); 118 //mDownloadTimer.reset();
118 119
120 std::string strMac;
121 std::string strHDD;
122 char mac[MAX_STRING];
123 char hdd[MAX_STRING];
124
125 strMac.assign(web_login_key.asString());
126 strMac.append(hashed_mac.c_str());
127
128 strHDD.assign(web_login_key.asString());
129 strHDD.append(hashed_volume_serial.c_str());
130
131 LLMD5 md5Mac((const unsigned char *)strMac.c_str());
132 LLMD5 md5HDD((const unsigned char *)strHDD.c_str());
133
134 md5Mac.hex_digest(mac);
135 md5HDD.hex_digest(hdd);
136
119 // create the request 137 // create the request
120 XMLRPC_REQUEST request = XMLRPC_RequestNew(); 138 XMLRPC_REQUEST request = XMLRPC_RequestNew();
121 XMLRPC_RequestSetMethodName(request, method.c_str()); 139 XMLRPC_RequestSetMethodName(request, method.c_str());
@@ -130,9 +148,9 @@ void LLUserAuth::authenticate(
130 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name 148 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name
131 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); 149 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0);
132 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 150 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
133 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); 151 XMLRPC_VectorAppendString(params, "mac", mac, 0);
134 // A bit of security through obscurity: id0 is volume_serial 152 // A bit of security through obscurity: id0 is volume_serial
135 XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); 153 XMLRPC_VectorAppendString(params, "id0", hdd, 0);
136 if (skip_optional) 154 if (skip_optional)
137 { 155 {
138 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); 156 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0);
@@ -201,7 +219,28 @@ void LLUserAuth::authenticate(
201 219
202 mAuthResponse = E_NO_RESPONSE_YET; 220 mAuthResponse = E_NO_RESPONSE_YET;
203 //mDownloadTimer.reset(); 221 //mDownloadTimer.reset();
204 222
223 std::string strMac;
224 std::string strHDD;
225 char mac[MAX_STRING];
226 char hdd[MAX_STRING];
227
228 strMac.assign(firstname);
229 strMac.append(lastname);
230 strMac.append(dpasswd.c_str());
231 strMac.append(hashed_mac.c_str());
232
233 strHDD.assign(firstname);
234 strHDD.append(lastname);
235 strHDD.append(dpasswd.c_str());
236 strHDD.append(hashed_volume_serial.c_str());
237
238 LLMD5 md5Mac((const unsigned char *)strMac.c_str());
239 LLMD5 md5HDD((const unsigned char *)strHDD.c_str());
240
241 md5Mac.hex_digest(mac);
242 md5HDD.hex_digest(hdd);
243
205 // create the request 244 // create the request
206 XMLRPC_REQUEST request = XMLRPC_RequestNew(); 245 XMLRPC_REQUEST request = XMLRPC_RequestNew();
207 XMLRPC_RequestSetMethodName(request, method.c_str()); 246 XMLRPC_RequestSetMethodName(request, method.c_str());
@@ -216,9 +255,9 @@ void LLUserAuth::authenticate(
216 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name 255 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name
217 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); 256 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0);
218 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 257 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
219 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); 258 XMLRPC_VectorAppendString(params, "mac", mac, 0);
220 // A bit of security through obscurity: id0 is volume_serial 259 // A bit of security through obscurity: id0 is volume_serial
221 XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); 260 XMLRPC_VectorAppendString(params, "id0", hdd, 0);
222 if (skip_optional) 261 if (skip_optional)
223 { 262 {
224 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); 263 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0);
diff --git a/linden/indra/newview/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
100protected: 100protected:
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 8a92963..d5e4d20 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -575,6 +575,11 @@ void set_underclothes_menu_options()
575 575
576void init_menus() 576void 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
465class FileLogout : public view_listener_t
466{
467 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
468 {
469 LLAppViewer::userLogout(NULL);
470 return true;
471 }
472};
473
465class LLFileQuit : public view_listener_t 474class LLFileQuit : public view_listener_t
466{ 475{
467 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 476 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -931,11 +940,6 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
931 LLAssetStorage::LLStoreAssetCallback callback, 940 LLAssetStorage::LLStoreAssetCallback callback,
932 void *userdata) 941 void *userdata)
933{ 942{
934 if(gDisconnected)
935 {
936 return ;
937 }
938
939 LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); 943 LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID());
940 944
941 if( LLAssetType::AT_SOUND == asset_type ) 945 if( LLAssetType::AT_SOUND == asset_type )
@@ -1053,6 +1057,7 @@ void init_menu_file()
1053 (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); 1057 (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture");
1054 (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); 1058 (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot");
1055 (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); 1059 (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk");
1060 (new FileLogout())->registerListener(gMenuHolder, "File.Logout");
1056 (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit"); 1061 (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit");
1057 1062
1058 (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload"); 1063 (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload");
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index d5d9324..d900cd9 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -109,7 +109,7 @@
109#include "llui.h" // for make_ui_sound 109#include "llui.h" // for make_ui_sound
110#include "lluploaddialog.h" 110#include "lluploaddialog.h"
111#include "llviewercamera.h" 111#include "llviewercamera.h"
112#include "llviewercontrol.h" 112//#include "llviewercontrol.h"
113#include "llviewergenericmessage.h" 113#include "llviewergenericmessage.h"
114#include "llviewerinventory.h" 114#include "llviewerinventory.h"
115#include "llviewermenu.h" 115#include "llviewermenu.h"
diff --git a/linden/indra/newview/llviewermessage.h b/linden/indra/newview/llviewermessage.h
index be825ed..da29936 100644
--- a/linden/indra/newview/llviewermessage.h
+++ b/linden/indra/newview/llviewermessage.h
@@ -36,7 +36,7 @@
36#include "lltransactiontypes.h" 36#include "lltransactiontypes.h"
37#include "lluuid.h" 37#include "lluuid.h"
38#include "stdenums.h" 38#include "stdenums.h"
39 39#include "llfloaterbump.h"
40// 40//
41// Forward declarations 41// Forward declarations
42// 42//
diff --git a/linden/indra/newview/llviewernetwork.cpp b/linden/indra/newview/llviewernetwork.cpp
index f4e3bb7..de9addf 100644
--- a/linden/indra/newview/llviewernetwork.cpp
+++ b/linden/indra/newview/llviewernetwork.cpp
@@ -5,7 +5,7 @@
5 * 5 *
6 * $LicenseInfo:firstyear=2006&license=viewergpl$ 6 * $LicenseInfo:firstyear=2006&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2006-2009, Linden Research, Inc. 8 * Copyright (c) 2006-2008, Linden Research, Inc.
9 * 9 *
10 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab 11 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -34,158 +34,19 @@
34 34
35#include "llviewernetwork.h" 35#include "llviewernetwork.h"
36#include "llviewercontrol.h" 36#include "llviewercontrol.h"
37#include "llstartup.h"
37 38
38struct LLGridData 39 #include "hippoGridManager.h"
39{
40 const char* mLabel;
41 const char* mCodeName;
42 const char* mName;
43 const char* mLoginURI;
44 const char* mHelperURI;
45};
46
47static LLGridData gGridInfo[GRID_INFO_COUNT] =
48{
49 { "None", "", "", "", "" },
50 { "SL Main Grid",
51 "Agni",
52 "util.agni.lindenlab.com",
53 "https://login.agni.lindenlab.com/cgi-bin/login.cgi",
54 "https://secondlife.com/helpers/" },
55 { "SL Beta Grid",
56 "Aditi",
57 "util.aditi.lindenlab.com",
58 "https://login.aditi.lindenlab.com/cgi-bin/login.cgi",
59 "http://aditi-secondlife.webdev.lindenlab.com/helpers/" },
60 { "Local OpenSim",
61 "",
62 "localhost",
63 "http://127.0.0.1:9000",
64 "" },
65 { "Other", "", "", "", "" }
66};
67
68const EGridInfo DEFAULT_GRID_CHOICE = GRID_INFO_AGNI;
69 40
70 41
71unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ 42unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */
72 43
73LLViewerLogin::LLViewerLogin() :
74 mGridChoice(DEFAULT_GRID_CHOICE)
75{
76}
77
78void LLViewerLogin::setGridChoice(EGridInfo grid)
79{
80 if(grid < 0 || grid >= GRID_INFO_COUNT)
81 {
82 llerrs << "Invalid grid index specified." << llendl;
83 }
84
85 if(mGridChoice != grid || gSavedSettings.getS32("ServerChoice") != grid)
86 {
87 mGridChoice = grid;
88 if(GRID_INFO_LOCAL == mGridChoice)
89 {
90 mGridName = LOOPBACK_ADDRESS_STRING;
91 }
92 else if(GRID_INFO_OTHER == mGridChoice)
93 {
94 // *FIX:Mani - could this possibly be valid?
95 mGridName = "other";
96 }
97 else
98 {
99 mGridName = gGridInfo[mGridChoice].mLabel;
100 }
101
102 gSavedSettings.setS32("ServerChoice", mGridChoice);
103 gSavedSettings.setString("CustomServer", "");
104 }
105}
106
107void LLViewerLogin::setGridChoice(const std::string& grid_name)
108{
109 // Set the grid choice based on a string.
110 // The string can be:
111 // - a grid label from the gGridInfo table
112 // - an ip address
113 if(!grid_name.empty())
114 {
115 // find the grid choice from the user setting.
116 int grid_index = GRID_INFO_NONE;
117 for(;grid_index < GRID_INFO_OTHER; ++grid_index)
118 {
119 if(0 == LLStringUtil::compareInsensitive(gGridInfo[grid_index].mLabel, grid_name))
120 {
121 // Founding a matching label in the list...
122 setGridChoice((EGridInfo)grid_index);
123 break;
124 }
125 }
126
127 if(GRID_INFO_OTHER == grid_index)
128 {
129 // *FIX:MEP Can and should we validate that this is an IP address?
130 mGridChoice = GRID_INFO_OTHER;
131 mGridName = grid_name;
132 gSavedSettings.setS32("ServerChoice", mGridChoice);
133 gSavedSettings.setString("CustomServer", mGridName);
134 }
135 }
136}
137
138void LLViewerLogin::resetURIs()
139{
140 // Clear URIs when picking a new server
141 gSavedSettings.setValue("CmdLineLoginURI", LLSD::emptyArray());
142 gSavedSettings.setString("CmdLineHelperURI", "");
143}
144
145EGridInfo LLViewerLogin::getGridChoice() const
146{
147 return mGridChoice;
148}
149
150std::string LLViewerLogin::getGridLabel() const
151{
152 if(mGridChoice == GRID_INFO_NONE)
153 {
154 return "None";
155 }
156 else if(mGridChoice < GRID_INFO_OTHER)
157 {
158 return gGridInfo[mGridChoice].mLabel;
159 }
160
161 return mGridName;
162}
163
164std::string LLViewerLogin::getGridCodeName() const
165{
166 // Fall back to grid label if code name is empty.
167 if( strcmp(gGridInfo[mGridChoice].mCodeName, "") == 0 )
168 {
169 return getGridLabel();
170 }
171
172 return gGridInfo[mGridChoice].mCodeName;
173}
174
175std::string LLViewerLogin::getKnownGridLabel(EGridInfo grid_index) const
176{
177 if(grid_index > GRID_INFO_NONE && grid_index < GRID_INFO_OTHER)
178 {
179 return gGridInfo[grid_index].mLabel;
180 }
181 return gGridInfo[GRID_INFO_NONE].mLabel;
182}
183 44
184void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const 45void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
185{ 46{
186 // return the login uri set on the command line. 47 // return the login uri set on the command line.
187 LLControlVariable* c = gSavedSettings.getControl("CmdLineLoginURI"); 48 LLControlVariable* c = gSavedSettings.getControl("CmdLineLoginURI");
188 if(c) 49 if(c && !LLStartUp::shouldAutoLogin())
189 { 50 {
190 LLSD v = c->getValue(); 51 LLSD v = c->getValue();
191 if(v.isArray()) 52 if(v.isArray())
@@ -209,10 +70,12 @@ void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
209 } 70 }
210 } 71 }
211 } 72 }
212 73
213 // If there was no command line uri... 74 // If there was no command line uri...
214 if(uris.empty()) 75 if(uris.empty())
215 { 76 {
77 uris.push_back(gHippoGridManager->getConnectedGrid()->getLoginUri());
78 /*
216 // If its a known grid choice, get the uri from the table, 79 // If its a known grid choice, get the uri from the table,
217 // else try the grid name. 80 // else try the grid name.
218 if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER) 81 if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER)
@@ -222,44 +85,36 @@ void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
222 else 85 else
223 { 86 {
224 uris.push_back(mGridName); 87 uris.push_back(mGridName);
225 } 88 } */
226 } 89 }
227} 90}
228 91
229std::string LLViewerLogin::getHelperURI() const 92const std::string &LLViewerLogin::getGridLabel() const
230{ 93{
231 std::string helper_uri = gSavedSettings.getString("CmdLineHelperURI"); 94 return gHippoGridManager->getConnectedGrid()->getGridNick();
232 if (helper_uri.empty()) 95}
233 {
234 // grab URI from selected grid
235 if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER)
236 {
237 helper_uri = gGridInfo[mGridChoice].mHelperURI;
238 }
239 96
240 if (helper_uri.empty()) 97const std::string &LLViewerLogin::getLoginPage() const
241 { 98{
242 // what do we do with unnamed/miscellaneous grids? 99 return gHippoGridManager->getConnectedGrid()->getLoginPage();
243 // for now, operations that rely on the helper URI (currency/land purchasing) will fail
244 }
245 }
246 return helper_uri;
247} 100}
248 101
249bool LLViewerLogin::isInProductionGrid() 102const std::string &LLViewerLogin::getHelperURI() const
250{ 103{
251 // *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice, 104 return gHippoGridManager->getConnectedGrid()->getHelperUri();
252 // but it seems that loginURI trumps that. 105}
253 std::vector<std::string> uris; 106
254 getLoginURIs(uris); 107bool LLViewerLogin::isOpenSimulator()
255 LLStringUtil::toLower(uris[0]); 108{
109 return gHippoGridManager->getConnectedGrid()->isOpenSimulator();
110}
256 111
257 // Returns true for every grid but Aditi now, 112bool LLViewerLogin::isSecondLife()
258 // because opensim grids have feelings too! -- McCabe 113{
259 if((uris[0].find("aditi") != std::string::npos)) 114 return gHippoGridManager->getConnectedGrid()->isSecondLife();
260 { 115}
261 return false;
262 }
263 116
117bool LLViewerLogin::isInProductionGrid()
118{
264 return true; 119 return true;
265} 120}
diff --git a/linden/indra/newview/llviewernetwork.h b/linden/indra/newview/llviewernetwork.h
index 6c5823c..881629e 100644
--- a/linden/indra/newview/llviewernetwork.h
+++ b/linden/indra/newview/llviewernetwork.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * $LicenseInfo:firstyear=2006&license=viewergpl$ 6 * $LicenseInfo:firstyear=2006&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2006-2009, Linden Research, Inc. 8 * Copyright (c) 2006-2008, Linden Research, Inc.
9 * 9 *
10 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab 11 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -29,21 +29,9 @@
29 * COMPLETENESS OR PERFORMANCE. 29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$ 30 * $/LicenseInfo$
31 */ 31 */
32
33#ifndef LL_LLVIEWERNETWORK_H 32#ifndef LL_LLVIEWERNETWORK_H
34#define LL_LLVIEWERNETWORK_H 33#define LL_LLVIEWERNETWORK_H
35 34
36class LLHost;
37
38enum EGridInfo
39{
40 GRID_INFO_NONE,
41 GRID_INFO_AGNI,
42 GRID_INFO_ADITI,
43 GRID_INFO_LOCAL,
44 GRID_INFO_OTHER, // IP address set via command line option
45 GRID_INFO_COUNT
46};
47 35
48/** 36/**
49 * @brief A class to manage the viewer's login state. 37 * @brief A class to manage the viewer's login state.
@@ -52,53 +40,20 @@ enum EGridInfo
52class LLViewerLogin : public LLSingleton<LLViewerLogin> 40class LLViewerLogin : public LLSingleton<LLViewerLogin>
53{ 41{
54public: 42public:
55 LLViewerLogin();
56
57 void setGridChoice(EGridInfo grid);
58 void setGridChoice(const std::string& grid_name);
59 void resetURIs();
60
61 /**
62 * @brief Get the enumeration of the grid choice.
63 * Should only return values > 0 && < GRID_INFO_COUNT
64 **/
65 EGridInfo getGridChoice() const;
66
67 /**
68 * @brief Get a readable label for the grid choice.
69 * Returns the readable name for the grid choice.
70 * If the grid is 'other', returns something
71 * the string used to specifiy the grid.
72 **/
73 std::string getGridLabel() const;
74
75 /**
76 * @brief Get the code name for the grid choice.
77 *
78 * Returns the code name for the grid choice, as designated
79 * by Linden Lab. The SL main grid is Agni, and the beta
80 * grid is Aditi. There are other LL testing grids with code
81 * names, but we don't care about those.
82 *
83 * This string is used primarily for fetching the proper
84 * login splash page, since the web server expects "Agni"
85 * and "Aditi", not "SL Main Grid" and "SL Beta Grid".
86 */
87 std::string getGridCodeName() const;
88
89 std::string getKnownGridLabel(EGridInfo grid_index) const;
90
91 void getLoginURIs(std::vector<std::string>& uris) const; 43 void getLoginURIs(std::vector<std::string>& uris) const;
92 std::string getHelperURI() const; 44 const std::string &getGridLabel() const;
45 const std::string &getLoginPage() const;
46 const std::string &getHelperURI() const;
93 47
94 bool isInProductionGrid(); 48 bool isOpenSimulator();
49 bool isSecondLife();
95 50
96private: 51 bool isInProductionGrid();
97 EGridInfo mGridChoice;
98 std::string mGridName;
99}; 52};
100 53
54
101const S32 MAC_ADDRESS_BYTES = 6; 55const S32 MAC_ADDRESS_BYTES = 6;
102extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ 56extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */
103 57
58
104#endif 59#endif
diff --git a/linden/indra/newview/llviewerobject.h b/linden/indra/newview/llviewerobject.h
index 340f279..dc529cd 100644
--- a/linden/indra/newview/llviewerobject.h
+++ b/linden/indra/newview/llviewerobject.h
@@ -49,6 +49,7 @@
49#include "v3dmath.h" 49#include "v3dmath.h"
50#include "v3math.h" 50#include "v3math.h"
51#include "llvertexbuffer.h" 51#include "llvertexbuffer.h"
52#include "llpartdata.h"
52 53
53class LLAgent; // TODO: Get rid of this. 54class LLAgent; // TODO: Get rid of this.
54class LLAudioSource; 55class LLAudioSource;
diff --git a/linden/indra/newview/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
46class LLCamera;
46class LLNetMap; 47class LLNetMap;
47class LLDebugBeacon; 48class 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
4892void* LLBottomPanel::createHUD(void* data) 4905void* 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
4900void* LLBottomPanel::createOverlayBar(void* data) 4912void* 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
4907void* LLBottomPanel::createToolBar(void* data) 4918void* 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 431ef96..4ab14f4 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -698,7 +698,11 @@ LLVOAvatar::LLVOAvatar(
698 mTexEyeColor( NULL ), 698 mTexEyeColor( NULL ),
699 mNeedsSkin(FALSE), 699 mNeedsSkin(FALSE),
700 mUpdatePeriod(1), 700 mUpdatePeriod(1),
701 mFullyLoadedInitialized(FALSE) 701// mFullyLoadedInitialized(FALSE)
702 mPreviousFullyLoaded(FALSE),
703 mVisibleChat( FALSE ),
704 mFullyLoadedInitialized(FALSE),
705 mFullyLoaded(FALSE)
702{ 706{
703 LLMemType mt(LLMemType::MTYPE_AVATAR); 707 LLMemType mt(LLMemType::MTYPE_AVATAR);
704 708
@@ -1814,6 +1818,10 @@ BOOL LLVOAvatar::buildSkeleton(LLVOAvatarSkeletonInfo *info)
1814{ 1818{
1815 LLMemType mt(LLMemType::MTYPE_AVATAR); 1819 LLMemType mt(LLMemType::MTYPE_AVATAR);
1816 1820
1821 //this can get called with null info on startup sometimes
1822 if (!info)
1823 return FALSE;
1824
1817 //------------------------------------------------------------------------- 1825 //-------------------------------------------------------------------------
1818 // allocate joints 1826 // allocate joints
1819 //------------------------------------------------------------------------- 1827 //-------------------------------------------------------------------------
@@ -2194,9 +2202,10 @@ void LLVOAvatar::buildCharacter()
2194 LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), 2202 LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(),
2195 NULL, &object_selected_and_point_valid, 2203 NULL, &object_selected_and_point_valid,
2196 &attach_label, attachment); 2204 &attach_label, attachment);
2205if (item){
2197 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); 2206 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first);
2198 gAttachSubMenu->append(item); 2207 gAttachSubMenu->append(item);
2199 2208}
2200 gDetachSubMenu->append(new LLMenuItemCallGL(attachment->getName(), 2209 gDetachSubMenu->append(new LLMenuItemCallGL(attachment->getName(),
2201 &handle_detach_from_avatar, object_attached, &detach_label, attachment)); 2210 &handle_detach_from_avatar, object_attached, &detach_label, attachment));
2202 2211
diff --git a/linden/indra/newview/llwearablelist.cpp b/linden/indra/newview/llwearablelist.cpp
index 2d4f26a..4e91975 100644
--- a/linden/indra/newview/llwearablelist.cpp
+++ b/linden/indra/newview/llwearablelist.cpp
@@ -42,6 +42,9 @@
42#include "llviewerstats.h" 42#include "llviewerstats.h"
43#include "llnotify.h" 43#include "llnotify.h"
44 44
45#include "llstartup.h"
46#include "llpanellogin.h"
47
45// Globals 48// Globals
46LLWearableList gWearableList; // Globally constructed; be careful that there's no dependency with gAgent. 49LLWearableList gWearableList; // Globally constructed; be careful that there's no dependency with gAgent.
47 50
@@ -185,12 +188,15 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID
185 args["[TYPE]"] = LLAssetType::lookupHumanReadable(data->mAssetType); 188 args["[TYPE]"] = LLAssetType::lookupHumanReadable(data->mAssetType);
186 if (data->mName.empty()) 189 if (data->mName.empty())
187 { 190 {
188 LLNotifyBox::showXml("FailedToFindWearableUnnamed", args); 191 // work around missing avatar part spam on grid to grid teleport login
192 if(LLStartUp::shouldAutoLogin() && !gLoginHandler.mPassword.empty())
193 LLNotifyBox::showXml("FailedToFindWearableUnnamed", args);
189 } 194 }
190 else 195 else
191 { 196 {
192 args["[DESC]"] = data->mName; 197 args["[DESC]"] = data->mName;
193 LLNotifyBox::showXml("FailedToFindWearable", args); 198 if(LLStartUp::shouldAutoLogin() && !gLoginHandler.mPassword.empty())
199 LLNotifyBox::showXml("FailedToFindWearable", args);
194 } 200 }
195 } 201 }
196 // Always call callback; wearable will be NULL if we failed 202 // Always call callback; wearable will be NULL if we failed
diff --git a/linden/indra/newview/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
118void LLWorld::destroyClass() 118void 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/skins/default/xui/en-us/alerts.xml b/linden/indra/newview/skins/default/xui/en-us/alerts.xml
index 42d9782..acac138 100644
--- a/linden/indra/newview/skins/default/xui/en-us/alerts.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/alerts.xml
@@ -2237,6 +2237,23 @@ Offer friendship to [NAME]?
2237 Cancel 2237 Cancel
2238 </option> 2238 </option>
2239 </alert> 2239 </alert>
2240 <alert modal="true" name="AddFriendWithMessage" title="Add Friend">
2241 <message name="message">
2242Friends can give permissions to track each
2243other on the map and receive online status updates.
2244
2245Offer friendship to [NAME]?
2246 </message>
2247 <editline name="editline">
2248 Would you be my friend?
2249 </editline>
2250 <option name="Offer">
2251 OK
2252 </option>
2253 <option name="Cancel">
2254 Cancel
2255 </option>
2256 </alert>
2240 <alert modal="true" name="RemoveFromFriends"> 2257 <alert modal="true" name="RemoveFromFriends">
2241 <message name="message"> 2258 <message name="message">
2242 Do you want to remove [FIRST_NAME] [LAST_NAME] from your Friends List? 2259 Do you want to remove [FIRST_NAME] [LAST_NAME] from your Friends List?
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_login.xml b/linden/indra/newview/skins/default/xui/en-us/floater_login.xml
new file mode 100644
index 0000000..8116213
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_login.xml
@@ -0,0 +1,265 @@
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="plasticwuzhere" width="600">
5
6 <!-- Grid Selector -->
7 <text type="string" length="1" enabled="true" name="grid_selector_label"
8 height="10" width="100" left="5" top="-20"
9 h_pad="0" v_pad="0" halign="left"
10 font="SansSerif"
11 follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
12 drop_shadow_visible="true" border_drop_shadow_visible="false">
13 Select a grid:
14 </text>
15
16 <scroll_list background_visible="true" bottom_delta="25" draw_border="true"
17 draw_stripes="false"
18 follows="top|left|bottom" height="340" left="5" multi_select="false"
19 name="grid_selector" width="170">
20 <column label="" name="grid" width="200" />
21 </scroll_list>
22
23 <!-- Grid Selector Buttons -->
24 <button label="Add" label_selected="Delete" enabled="true" name="btn_add"
25 height="18" width="55" left="5" bottom_delta="-20"
26 halign="center"
27 follows="left|bottom" scale_image="true"
28 font="SansSerifSmall" mouse_opaque="true" />
29 <button label="Copy" label_selected="Add" enabled="true" name="btn_copy"
30 height="18" width="55" left_delta="58" bottom_delta="0"
31 halign="center"
32 follows="left|bottom" scale_image="true"
33 font="SansSerifSmall" mouse_opaque="true" />
34 <button label="Delete" label_selected="Copy" enabled="true" name="btn_delete"
35 height="18" width="55" left_delta="58" bottom_delta="0"
36 halign="center"
37 follows="left|bottom" scale_image="true"
38 font="SansSerifSmall" mouse_opaque="true" />
39
40 <!-- Grid Details -->
41 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
42 top="-25" drop_shadow_visible="true" follows="left|top"
43 font="SansSerif" h_pad="0" halign="left" height="16"
44 left_delta="60" mouse_opaque="true" name="gridnick_text" v_pad="0" width="120">
45 Grid Name:
46 </text>
47 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="360"
48 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
49 height="20" left_delta="90" max_length="40" mouse_opaque="true"
50 name="gridnick" select_all_on_focus_received="true" width="200" />
51
52
53 <!--
54 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
55 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
56 font="SansSerif" h_pad="0" halign="left" height="16"
57 left_delta="-90" mouse_opaque="true" name="first_name_text" v_pad="0" width="100">
58 First Name:
59 </text>
60 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
61 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
62 height="20" left_delta="90" max_length="45" mouse_opaque="true"
63 name="first_name" select_all_on_focus_received="true" width="200" />
64
65 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
66 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
67 font="SansSerif" h_pad="0" halign="left" height="16"
68 left_delta="-90" mouse_opaque="true" name="last_name_text" v_pad="0" width="100">
69 Last Name:
70 </text>
71 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
72 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
73 height="20" left_delta="90" max_length="45" mouse_opaque="true"
74 name="last_name" select_all_on_focus_received="true" width="200" />
75
76 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
77 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
78 font="SansSerif" h_pad="0" halign="left" height="16"
79 left_delta="-90" mouse_opaque="true" name="avatar_password_text" v_pad="0" width="120">
80 Password:
81 </text>
82 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
83 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
84 height="20" left_delta="90" max_length="16" mouse_opaque="true"
85 name="avatar_password" select_all_on_focus_received="true" width="200" />
86
87 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
88 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
89 font="SansSerif" h_pad="0" halign="left" height="16"
90 left_delta="-90" mouse_opaque="true" name="start_location_text" v_pad="0"
91 width="95">
92 Start Location:
93 </text>
94 <combo_box allow_text_entry="true" bottom_delta="0" follows="left|top|right" height="18"
95 left_delta="90" max_chars="128" mouse_opaque="true"
96 name="start_location_combo" width="180">
97 <combo_item name="MyHome" value="My Home">
98 My Home
99 </combo_item>
100 <combo_item name="MyLastLocation" value="My Last Location">
101 My Last Location
102 </combo_item>
103 <combo_item name="Typeregionname" value="&lt;Type region name&gt;">
104 &lt;Type region name&gt;
105 </combo_item>
106 </combo_box>
107 -->
108
109 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
110 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
111 font="SansSerif" h_pad="0" halign="left" height="16"
112 left_delta="-90" mouse_opaque="true" name="loginuri_text" v_pad="0" width="120">
113 Login URI:
114 </text>
115 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
116 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
117 height="20" left_delta="90" max_length="255" mouse_opaque="true"
118 name="loginuri" select_all_on_focus_received="true" width="320" />
119
120 <button label="Get Grid Info" label_selected="Get Grid Info" enabled="true" name="btn_gridinfo"
121 height="18" width="100" bottom_delta="-22"
122 halign="center"
123 follows="left|top" scale_image="true"
124 font="SansSerifSmall" mouse_opaque="true" />
125
126 <text_editor type="string" length="1" allow_html="false" bg_readonly_color="0 0 0 0" bottom_delta="-62"
127 embedded_items="false" enabled="false" follows="left|top"
128 font="SansSerifSmall" height="65" hide_border="true" hide_scrollbar="true"
129 left="190" max_length="65535" mouse_opaque="true"
130 name="protip1" tab_stop="false" width="420" word_wrap="true">
131 Tip: Store information for alternate accounts by using the "Copy" button to create multiple profiles for the same grid.
132 </text_editor>
133
134 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
135 bottom_delta="10" drop_shadow_visible="true" follows="left|top"
136 font="SansSerif" h_pad="0" halign="left" height="16"
137 left="182" mouse_opaque="true" name="loginpage_text" v_pad="0" width="120">
138 Optional Fields
139 </text>
140 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
141 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
142 font="SansSerif" h_pad="0" halign="left" height="16"
143 left_delta="0" mouse_opaque="true" name="loginpage_text" v_pad="0" width="120">
144 Login Page:
145 </text>
146 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
147 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
148 height="20" left_delta="90" max_length="255" mouse_opaque="true"
149 name="loginpage" select_all_on_focus_received="true" width="320" />
150
151 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
152 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
153 font="SansSerif" h_pad="0" halign="left" height="16"
154 left_delta="-90" mouse_opaque="true" name="helperuri_text" v_pad="0" width="120">
155 Helper URI:
156 </text>
157 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
158 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
159 height="20" left_delta="90" max_length="255" mouse_opaque="true"
160 name="helperuri" select_all_on_focus_received="true" width="320" />
161
162 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
163 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
164 font="SansSerif" h_pad="0" halign="left" height="16"
165 left_delta="-90" mouse_opaque="true" name="website_text" v_pad="0" width="120">
166 Website:
167 </text>
168 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
169 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
170 height="20" left_delta="90" max_length="255" mouse_opaque="true"
171 name="website" select_all_on_focus_received="true" width="320" />
172
173 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
174 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
175 font="SansSerif" h_pad="0" halign="left" height="16"
176 left_delta="-90" mouse_opaque="true" name="support_text" v_pad="0" width="120">
177 Support URL:
178 </text>
179 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
180 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
181 height="20" left_delta="90" max_length="255" mouse_opaque="true"
182 name="support" select_all_on_focus_received="true" width="320" />
183
184 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
185 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
186 font="SansSerif" h_pad="0" halign="left" height="16"
187 left_delta="-90" mouse_opaque="true" name="register_text" v_pad="0" width="120">
188 Account URL:
189 </text>
190 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
191 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
192 height="20" left_delta="90" max_length="255" mouse_opaque="true"
193 name="register" select_all_on_focus_received="true" width="320" />
194
195 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
196 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
197 font="SansSerif" h_pad="0" halign="left" height="16"
198 left_delta="-90" mouse_opaque="true" name="password_text" v_pad="0" width="120">
199 Password URL:
200 </text>
201 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
202 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
203 height="20" left_delta="90" max_length="255" mouse_opaque="true"
204 name="password" select_all_on_focus_received="true" width="320" />
205
206 <view_border bevel_style="none" border_thickness="1" bottom_delta="-4" follows="top|left" height="155" left_delta="-93" name="OptionalPrefsBorder" width="417" />
207
208 <!-- Combo box for multi avatar grid manager avatar name
209 <combo_box allow_text_entry="true" bevel_style="in" border_style="line" border_thickness="1"
210 bottom_delta="0" follows="left|top" font="SansSerif" handle_edit_keys_directly="true"
211 height="20" left="290" max_length="45" mouse_opaque="true"
212 name="name_combo" select_all_on_focus_received="true" width="185" />
213 -->
214 <!-- Buttons for mutli avatar grid manager
215 <button bottom="159" follows="top|right" font="SansSerif" halign="center"
216 height="20" label="New" label_selected="New"
217 left="480" mouse_opaque="true" name="new_btn" scale_image="TRUE"
218 width="70" />
219 -->
220 <!--
221 <button bottom="134" follows="top|right" font="SansSerif" halign="center"
222 height="20" label="Remove" label_selected="Remove"
223 left="480" mouse_opaque="true" name="remove_btn" scale_image="TRUE"
224 width="70" />
225-->
226
227 <!-- Checkbox for selecting a global avatar (for when combo box avatar selector works)
228 <check_box bottom="85" follows="left|top" font="SansSerifSmall" height="16"
229 initial_value="false" label="Global Avatar"
230 left_delta="0" mouse_opaque="true" name="global_check" width="138" />
231
232 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16"
233 initial_value="false" label="Remember password"
234 left_delta="165" mouse_opaque="true" name="remember_check" width="138" />
235
236 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16"
237 initial_value="false" label="secret level"
238 left_delta="165" mouse_opaque="true" name="gawd_mode" width="138" />
239 -->
240
241 <!-- Cancel/Connect Buttons -->
242
243 <button bottom="-44" follows="right|top" font="SansSerif" halign="center"
244 height="24" label="Set as Default" label_selected="Set as Default"
245 left="470" mouse_opaque="true" name="set_default" scale_image="TRUE"
246 width="110" />
247 <!-- <button bottom="28" follows="right|bottom" font="SansSerif" halign="center"
248 height="24" label="Connect" label_selected="Connect"
249 left="280" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
250 width="100" /> -->
251 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
252 height="24" label="Ok" label_selected="Apply" left="280"
253 mouse_opaque="true" name="btn_ok" scale_image="TRUE" width="100" />
254 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
255 height="24" label="Apply" label_selected="Apply" left="385"
256 mouse_opaque="true" name="btn_apply" scale_image="TRUE" width="100" />
257 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
258 height="24" label="Undo" label_selected="Undo" left="490"
259 mouse_opaque="true" name="btn_cancel" scale_image="TRUE" width="100" />
260 <!--
261 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18"
262 left_delta="135" max_chars="40" mouse_opaque="true"
263 name="server_combo" width="200" />
264 -->
265</floater>
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 512ee16..81fe178 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..5b2f3ad 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
@@ -1,56 +1,35 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel bottom="0" follows="left|top|right|bottom" height="600" left="0" 2
3 mouse_opaque="true" name="panel_login" width="800"> 3<panel name="panel_login"
4 <web_browser border_visible="false" bottom="0" follows="top|left|bottom|right" left="0" 4 bottom="0" left="0" height="600" width="800"
5 name="login_html" right="-1" 5 follows="left|top|right|bottom" mouse_opaque="true" >
6 start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody bgcolor=%22#000000%22 text=%22ffffff%22%3E%3Ch1%3E%3Ctt%3Eloading...%3C/tt%3E%3C/h1%3E %3C/body%3E %3C/html%3E" 6
7 top="-1" /> 7 <web_browser name="login_html"
8 bottom="0" top="-1" left="0" right="-1"
9 border_visible="false" follows="top|left|bottom|right"
10 start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody bgcolor=%22#000000%22 text=%22ffffff%22%3E%3Ch1%3E%3Ctt%3Eloading...%3C/tt%3E%3C/h1%3E %3C/body%3E %3C/html%3E" />
8 <string name="real_url"> 11 <string name="real_url">
9 http://secondlife.com/app/login/ 12 http://secondlife.com/app/login/
10 </string> 13 </string>
11 <string name="forgot_password_url"> 14 <string name="forgot_password_url">
12 http://secondlife.com/account/request.php 15 http://secondlife.com/account/request.php
13 </string> 16 </string>
14 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 17
15 bottom="54" drop_shadow_visible="true" follows="left|bottom" 18
16 font="SansSerif" h_pad="0" halign="left" height="16" 19 <!-- START LOCATION -->
17 left="32" mouse_opaque="true" name="first_name_text" v_pad="0" width="120"> 20
18 First Name: 21 <text name="start_location_text"
19 </text> 22 bottom="8" left="24" height="16" width="95"
20 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-24" 23 follows="left|bottom" h_pad="0" halign="right" v_pad="0"
21 follows="left|bottom" font="SansSerif" handle_edit_keys_directly="true" 24 bg_visible="false" drop_shadow_visible="true"
22 height="20" left="32" max_length="31" mouse_opaque="true" 25 border_visible="false" border_drop_shadow_visible="false"
23 name="first_name_edit" select_all_on_focus_received="true" width="120" /> 26 font="SansSerifSmall" mouse_opaque="true">
24 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
25 bottom="54" drop_shadow_visible="true" follows="left|bottom"
26 font="SansSerif" h_pad="0" halign="left" height="16"
27 left="164" mouse_opaque="true" name="last_name_text" v_pad="0" width="120">
28 Last Name:
29 </text>
30 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-24"
31 follows="left|bottom" font="SansSerif" handle_edit_keys_directly="true"
32 height="20" left="164" max_length="31" mouse_opaque="true"
33 name="last_name_edit" select_all_on_focus_received="true" width="120" />
34 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
35 bottom="54" drop_shadow_visible="true" follows="left|bottom"
36 font="SansSerif" h_pad="0" halign="left" height="16"
37 left="296" mouse_opaque="true" name="password_text" v_pad="0" width="120">
38 Password:
39 </text>
40 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-24"
41 follows="left|bottom" font="SansSerif" handle_edit_keys_directly="true"
42 height="20" left="296" max_length="16" mouse_opaque="true"
43 name="password_edit" select_all_on_focus_received="true" width="120" />
44 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
45 bottom="10" drop_shadow_visible="true" follows="left|bottom"
46 font="SansSerif" h_pad="0" halign="left" height="16"
47 left="32" mouse_opaque="true" name="start_location_text" v_pad="0"
48 width="95">
49 Start Location: 27 Start Location:
50 </text> 28 </text>
51 <combo_box allow_text_entry="true" bottom="8" follows="left|bottom" height="18" 29 <combo_box name="start_location_combo"
52 left_delta="97" max_chars="128" mouse_opaque="true" 30 bottom_delta="2" left_delta="100" height="16" width="150"
53 name="start_location_combo" width="155"> 31 follows="left|bottom" font="SansSerifSmall"
32 mouse_opaque="true" allow_text_entry="true" max_chars="128">
54 <combo_item name="MyHome" value="My Home"> 33 <combo_item name="MyHome" value="My Home">
55 My Home 34 My Home
56 </combo_item> 35 </combo_item>
@@ -61,35 +40,129 @@
61 &lt;Type region name&gt; 40 &lt;Type region name&gt;
62 </combo_item> 41 </combo_item>
63 </combo_box> 42 </combo_box>
64 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16" 43
65 initial_value="false" label="Remember password" 44
66 left_delta="163" mouse_opaque="true" name="remember_check" width="138" /> 45 <!-- FIRST NAME -->
67 <button bottom="28" follows="left|bottom" font="SansSerif" halign="center" 46
68 height="24" label="Log In" label_selected="Log In" 47 <text name="first_name_text"
69 left="435" mouse_opaque="true" name="connect_btn" scale_image="TRUE" 48 bottom="56" left="24" height="16" width="120"
70 width="120" /> 49 follows="left|bottom" h_pad="0" halign="left" v_pad="0"
71 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18" 50 bg_visible="false" drop_shadow_visible="true"
72 left_delta="135" max_chars="20" mouse_opaque="true" 51 border_visible="false" border_drop_shadow_visible="false"
73 name="server_combo" width="120" /> 52 font="SansSerif" mouse_opaque="true">
74 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 53 First Name:
75 bottom="45" drop_shadow_visible="true" follows="right|bottom" 54 </text>
76 font="SansSerifSmall" font-style="UNDERLINE" h_pad="0" halign="right" height="16" 55 <line_editor name="first_name_edit"
77 left="-210" mouse_opaque="true" name="create_new_account_text" v_pad="0" width="200" 56 bottom_delta="-20" left_delta="0" height="20" width="120"
78 hover="true" hover_color="50 115 185"> 57 follows="left|bottom" font="SansSerif"
58 bevel_style="in" border_style="line" border_thickness="1"
59 max_length="16" mouse_opaque="true"
60 handle_edit_keys_directly="true"
61 select_all_on_focus_received="true" />
62
63
64 <!-- LAST NAME -->
65
66 <text name="last_name_text"
67 bottom_delta="20" left_delta="130" height="16" width="120"
68 follows="left|bottom" h_pad="0" halign="left" v_pad="0"
69 bg_visible="false" drop_shadow_visible="true"
70 border_visible="false" border_drop_shadow_visible="false"
71 font="SansSerif" mouse_opaque="true">
72 Last Name:
73 </text>
74 <line_editor name="last_name_edit"
75 bottom_delta="-20" left_delta="0" height="20" width="120"
76 follows="left|bottom" font="SansSerif"
77 bevel_style="in" border_style="line" border_thickness="1"
78 max_length="16" mouse_opaque="true"
79 handle_edit_keys_directly="true"
80 select_all_on_focus_received="true" />
81
82
83 <!-- PASSWORD -->
84
85 <text name="password_text"
86 bottom_delta="20" left_delta="130" height="16" width="120"
87 follows="left|bottom" h_pad="0" halign="left" v_pad="0"
88 bg_visible="false" drop_shadow_visible="true"
89 border_visible="false" border_drop_shadow_visible="false"
90 font="SansSerif" mouse_opaque="true">
91 Password:
92 </text>
93 <line_editor name="password_edit"
94 bottom_delta="-20" left_delta="0" height="20" width="120"
95 follows="left|bottom" font="SansSerif"
96 bevel_style="in" border_style="line" border_thickness="1"
97 max_length="16" mouse_opaque="true"
98 handle_edit_keys_directly="true"
99 select_all_on_focus_received="true" />
100 <check_box name="remember_check" label="Remember password"
101 bottom_delta="-24" left_delta="0" height="16" width="140"
102 follows="left|bottom" font="SansSerifSmall"
103 initial_value="false" mouse_opaque="true" />
104
105
106 <!-- GRIDS -->
107
108 <text name="grid_text"
109 bottom="56" left_delta="150" height="16" width="120"
110 follows="left|bottom" h_pad="0" halign="left" v_pad="0"
111 bg_visible="false" drop_shadow_visible="true"
112 border_visible="false" border_drop_shadow_visible="false"
113 font="SansSerif" mouse_opaque="true">
114 Grid:
115 </text>
116 <combo_box name="server_combo"
117 bottom_delta="-20" left_delta="0" height="20" width="120"
118 follows="left|bottom" allow_text_entry="false"
119 max_chars="20" mouse_opaque="true" />
120 <button name="grid_btn" label="Grid Manager"
121 bottom_delta="-24" left_delta="10" height="16" width="100"
122 follows="left|bottom" font="SansSerifSmall" halign="center"
123 mouse_opaque="true" scale_image="TRUE" />
124
125
126 <!-- LOG IN -->
127
128 <button name="connect_btn" label="Log In"
129 bottom="34" left_delta="140" height="24" width="120"
130 follows="left|bottom" font="SansSerif" halign="center"
131 mouse_opaque="true" scale_image="TRUE" />
132
133
134 <!-- ACCOUNT / FORGOT PASSWORD -->
135
136 <text name="create_new_account_text"
137 bottom="45" left="-210" height="16" width="200"
138 follows="right|bottom" h_pad="0" halign="right" v_pad="0"
139 bg_visible="false" drop_shadow_visible="true"
140 border_visible="false" border_drop_shadow_visible="false"
141 font="SansSerifSmall" font-style="UNDERLINE"
142 mouse_opaque="true" hover="true" hover_color="50 115 185">
79 Sign up for account 143 Sign up for account
80 </text> 144 </text>
81 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 145
82 bottom="25" drop_shadow_visible="true" follows="right|bottom" 146 <text name="forgot_password_text"
83 font="SansSerifSmall" font-style="UNDERLINE" h_pad="0" halign="right" height="16" 147 bottom="25" left="-210" height="16" width="200"
84 left="-210" mouse_opaque="true" name="forgot_password_text" v_pad="0" width="200" 148 follows="right|bottom" h_pad="0" halign="right" v_pad="0"
85 hover="true" hover_color="50 115 185"> 149 bg_visible="false" drop_shadow_visible="true"
150 border_visible="false" border_drop_shadow_visible="false"
151 font="SansSerifSmall" font-style="UNDERLINE"
152 mouse_opaque="true" hover="true" hover_color="50 115 185">
86 Forgot your name or password? 153 Forgot your name or password?
87 </text> 154 </text>
88 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 155
89 bottom="5" drop_shadow_visible="true" follows="right|bottom" 156
90 font="SansSerifSmall" h_pad="0" halign="right" height="16" 157 <!-- CHANNEL & VERSION -->
91 left="-310" mouse_opaque="true" name="channel_text" v_pad="0" width="300" 158
92 hover="true" hover_color="50 115 185"> 159 <text name="channel_text"
160 bottom="5" left="-310" height="16" width="300"
161 follows="right|bottom" h_pad="0" halign="right" v_pad="0"
162 bg_visible="false" drop_shadow_visible="true"
163 border_visible="false" border_drop_shadow_visible="false"
164 font="SansSerifSmall" mouse_opaque="true"
165 hover="true" hover_color="50 115 185">
93 [CHANNEL] [VERSION] 166 [CHANNEL] [VERSION]
94 </text> 167 </text>
95</panel> 168</panel>
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 d4ec307..655859a 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,7 +8,7 @@
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="1000" left_delta="0" max_val="5000" min_val="50" 13 increment="10" initial_val="1000" left_delta="0" max_val="5000" min_val="50"
14 mouse_opaque="true" name="max_bandwidth" show_text="true" value="1000" 14 mouse_opaque="true" name="max_bandwidth" show_text="true" value="1000"
@@ -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"