aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt177
-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.cpp723
-rw-r--r--linden/indra/newview/floaterlogin.h90
-rw-r--r--linden/indra/newview/hippoGridManager.cpp816
-rw-r--r--linden/indra/newview/hippoGridManager.h174
-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.xml260
-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
54 files changed, 3392 insertions, 558 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 3cfcdaf..df161e6 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -17,6 +17,87 @@
17 modified: linden/indra/newview/app_settings/settings.xml 17 modified: linden/indra/newview/app_settings/settings.xml
18 18
19 19
202009-09-25 Jacek Antonelli <jacek.antonelli@gmail.com>
21
22 * Removed the multiple accounts tip from grid manager.
23
24 linden/indra/newview/skins/default/xui/en-us/floater_login.xml
25
26
27 * Removed 'Set Default' button from grid manager floater.
28
29 modified: linden/indra/newview/floaterlogin.cpp
30 modified: linden/indra/newview/skins/default/xui/en-us/floater_login.xml
31
32
33 * Made HippoGridManager's sanitation code more sane.
34
35 modified: linden/indra/newview/floaterlogin.cpp
36 modified: linden/indra/newview/hippoGridManager.cpp
37 modified: linden/indra/newview/hippoGridManager.h
38
39
40 * Moved many HippoGridManager methods defs out of the header.
41 There's no good reason for these to be in the header, it
42 just breaks encapsulation for no significant gain.
43
44 linden/indra/newview/hippoGridManager.cpp
45 linden/indra/newview/hippoGridManager.h
46
47
48 * Removed grid stuff from World Map (for now).
49
50 modified: linden/indra/newview/llfloaterworldmap.cpp
51 modified: linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
52
53
54 * Hid "Start Location" from grid manager floater. Not used anyway.
55
56 modified: linden/indra/newview/skins/default/xui/en-us/floater_login.xml
57
58
59 * Made grid manager update from Imprudence site, not Meerkat.
60
61 modified: linden/indra/newview/hippoGridManager.cpp:
62
63
64 * Renamed default grid "local" -> "localhost".
65 So it matches the one downloaded from the web.
66
67 modified: linden/indra/newview/app_settings/default_grids.xml
68
69
70 * Fixed HippoGridInfo::cleanUpUri appending "/" stupidly.
71 It was appending it to an empty string, "/", "//", etc.
72
73 modified: linden/indra/newview/hippoGridManager.cpp
74
75
76 * Rearranged login screen and cleaned up XUI.
77
78 modified: linden/indra/newview/skins/default/xui/en-us/panel_login.xml
79
80
81 * Login screen fields shouldn't be set from grid (for now).
82
83 modified: linden/indra/newview/llpanellogin.cpp
84 modified: linden/indra/newview/llstartup.cpp
85
86
87 * Disabled avatar name and password fields in grid manager.
88 Temporary, until we implement a decent account manager.
89
90 modified: linden/indra/newview/floaterlogin.cpp
91 modified: linden/indra/newview/hippoGridManager.cpp
92 modified: linden/indra/newview/skins/default/xui/en-us/floater_login.xml
93
94
95 * Reverted "grid-firstname_lastname" user directories.
96 Back to "firstname_lastname", like it was without grid manager.
97
98 modified: linden/indra/llvfs/lldir.cpp
99
100
202009-09-25 McCabe Maxsted <hakushakukun@gmail.com> 1012009-09-25 McCabe Maxsted <hakushakukun@gmail.com>
21 102
22 * Removed problematic /MP flag. 103 * Removed problematic /MP flag.
@@ -467,6 +548,102 @@
467 548
4682009-09-09 Jacek Antonelli <jacek.antonelli@gmail.com> 5492009-09-09 Jacek Antonelli <jacek.antonelli@gmail.com>
469 550
551 * Updated Grid Manager from Meerkat's SVN (as of r215).
552
553 modified: linden/indra/llvfs/lldir.cpp
554 modified: linden/indra/llvfs/lldir.h
555 modified: linden/indra/newview/CMakeLists.txt
556 modified: linden/indra/newview/app_settings/default_grids.xml
557 deleted: linden/indra/newview/authentication_controller.cpp
558 deleted: linden/indra/newview/authentication_controller.h
559 deleted: linden/indra/newview/authentication_floater.cpp
560 deleted: linden/indra/newview/authentication_floater.h
561 deleted: linden/indra/newview/authentication_model.cpp
562 deleted: linden/indra/newview/authentication_model.h
563 deleted: linden/indra/newview/controllerlogin.cpp
564 deleted: linden/indra/newview/controllerlogin.h
565 deleted: linden/indra/newview/controllerpasswords.cpp
566 deleted: linden/indra/newview/controllerpasswords.h
567 modified: linden/indra/newview/floaterlogin.cpp
568 modified: linden/indra/newview/floaterlogin.h
569 modified: linden/indra/newview/hippoGridManager.cpp
570 modified: linden/indra/newview/hippoGridManager.h
571 modified: linden/indra/newview/llfloaterworldmap.cpp
572 modified: linden/indra/newview/llpanellogin.cpp
573 modified: linden/indra/newview/llprefsim.cpp
574 modified: linden/indra/newview/llstartup.cpp
575 deleted: linden/indra/newview/prefpanelpasswords.cpp
576 deleted: linden/indra/newview/prefpanelpasswords.h
577 modified: linden/indra/newview/skins/default/xui/en-us/floater_login.xml
578
579
580 * Merged in Grid Manager, etc. (thanks Armin).
581
582 modified: linden/indra/llcommon/llstring.h
583 modified: linden/indra/newview/CMakeLists.txt
584 new file: linden/indra/newview/app_settings/default_grids.xml
585 modified: linden/indra/newview/app_settings/settings.xml
586 new file: linden/indra/newview/authentication_controller.cpp
587 new file: linden/indra/newview/authentication_controller.h
588 new file: linden/indra/newview/authentication_floater.cpp
589 new file: linden/indra/newview/authentication_floater.h
590 new file: linden/indra/newview/authentication_model.cpp
591 new file: linden/indra/newview/authentication_model.h
592 new file: linden/indra/newview/controllerlogin.cpp
593 new file: linden/indra/newview/controllerlogin.h
594 new file: linden/indra/newview/controllerpasswords.cpp
595 new file: linden/indra/newview/controllerpasswords.h
596 new file: linden/indra/newview/floaterlogin.cpp
597 new file: linden/indra/newview/floaterlogin.h
598 new file: linden/indra/newview/hippoGridManager.cpp
599 new file: linden/indra/newview/hippoGridManager.h
600 new file: linden/indra/newview/hippoLimits.cpp
601 new file: linden/indra/newview/hippoLimits.h
602 new file: linden/indra/newview/hippoRestRequest.cpp
603 new file: linden/indra/newview/hippoRestRequest.h
604 new file: linden/indra/newview/hippoUpdate.cpp
605 new file: linden/indra/newview/hippoUpdate.h
606 modified: linden/indra/newview/llagent.cpp
607 modified: linden/indra/newview/llappviewer.cpp
608 modified: linden/indra/newview/llappviewer.h
609 modified: linden/indra/newview/llappviewerlinux.h
610 modified: linden/indra/newview/llcallingcard.cpp
611 modified: linden/indra/newview/llcallingcard.h
612 modified: linden/indra/newview/llchatbar.cpp
613 modified: linden/indra/newview/lldrawable.h
614 modified: linden/indra/newview/llfloaterworldmap.cpp
615 modified: linden/indra/newview/llfloaterworldmap.h
616 modified: linden/indra/newview/llinventorymodel.cpp
617 modified: linden/indra/newview/llinventorymodel.h
618 modified: linden/indra/newview/llinventoryview.cpp
619 modified: linden/indra/newview/llpanellogin.cpp
620 modified: linden/indra/newview/llpanellogin.h
621 modified: linden/indra/newview/llprogressview.cpp
622 modified: linden/indra/newview/llstartup.cpp
623 modified: linden/indra/newview/llstartup.h
624 modified: linden/indra/newview/lluserauth.cpp
625 modified: linden/indra/newview/llviewerjointattachment.h
626 modified: linden/indra/newview/llviewermenu.cpp
627 modified: linden/indra/newview/llviewermenufile.cpp
628 modified: linden/indra/newview/llviewermessage.cpp
629 modified: linden/indra/newview/llviewermessage.h
630 modified: linden/indra/newview/llviewernetwork.cpp
631 modified: linden/indra/newview/llviewernetwork.h
632 modified: linden/indra/newview/llviewerobject.h
633 modified: linden/indra/newview/llviewerwindow.cpp
634 modified: linden/indra/newview/llvoavatar.cpp
635 modified: linden/indra/newview/llwearablelist.cpp
636 modified: linden/indra/newview/llworld.cpp
637 new file: linden/indra/newview/prefpanelpasswords.cpp
638 new file: linden/indra/newview/prefpanelpasswords.h
639 modified: linden/indra/newview/skins/default/xui/en-us/alerts.xml
640 new file: linden/indra/newview/skins/default/xui/en-us/floater_login.xml
641 modified: linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
642 modified: linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
643 modified: linden/indra/newview/skins/default/xui/en-us/panel_login.xml
644 modified: linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml
645
646
470 * Commented out Linux tarball building. 647 * Commented out Linux tarball building.
471 It's a waste of time to package after every compile. 648 It's a waste of time to package after every compile.
472 649
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 d0370cf..e9705de 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -10778,5 +10778,38 @@
10778 <key>Value</key> 10778 <key>Value</key>
10779 <integer>0</integer> 10779 <integer>0</integer>
10780 </map> 10780 </map>
10781 <key>DefaultGrid</key>
10782 <map>
10783 <key>Comment</key>
10784 <string>Nickname of the default grid</string>
10785 <key>Persist</key>
10786 <integer>1</integer>
10787 <key>Type</key>
10788 <string>String</string>
10789 <key>Value</key>
10790 <string>secondlife</string>
10791 </map>
10792 <key>KeepAppearance</key>
10793 <map>
10794 <key>Comment</key>
10795 <string>Keep appearance across grid teleport</string>
10796 <key>Persist</key>
10797 <integer>1</integer>
10798 <key>Type</key>
10799 <string>Boolean</string>
10800 <key>Value</key>
10801 <string>0</string>
10802 </map>
10803 <key>CheckForGridUpdates</key>
10804 <map>
10805 <key>Comment</key>
10806 <string>Check for grid info updates on the web server</string>
10807 <key>Persist</key>
10808 <integer>1</integer>
10809 <key>Type</key>
10810 <string>Boolean</string>
10811 <key>Value</key>
10812 <integer>1</integer>
10813 </map>
10781 </map> 10814 </map>
10782</llsd> 10815</llsd>
diff --git a/linden/indra/newview/floaterlogin.cpp b/linden/indra/newview/floaterlogin.cpp
new file mode 100644
index 0000000..f1afc53
--- /dev/null
+++ b/linden/indra/newview/floaterlogin.cpp
@@ -0,0 +1,723 @@
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 childSetAction("btn_gridinfo", onClickGridInfo, this);
129 // childSetAction("btn_help_render_compat", onClickHelpRenderCompat, this);
130
131 childSetCommitCallback("grid_selector", onSelectGrid, this);
132//KOW childSetCommitCallback("platform", onSelectPlatform, this);
133
134 // !!!### server_choice_combo->setFocusLostCallback(onServerComboLostFocus);
135
136//KOW update();
137 return TRUE;
138}
139
140void LoginFloater::refresh_grids()
141{
142 const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
143 LLScrollListCtrl *grids = sInstance->getChild<LLScrollListCtrl>("grid_selector");
144 S32 selectIndex = -1, i = 0;
145 grids->deleteAllItems();
146 if (defaultGrid != "") {
147 LLSD value;
148 value["id"] = defaultGrid;
149 value["columns"][0]["column"] = "grid";
150 value["columns"][0]["value"] = defaultGrid;
151 grids->addElement(value);
152 selectIndex = i++;
153 }
154
155 HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
156 for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
157 const std::string &grid = it->second->getGridNick();
158 if (grid != defaultGrid) {
159 LLSD value;
160 value["id"] = grid;
161 value["columns"][0]["column"] = "grid";
162 value["columns"][0]["value"] = grid;
163 grids->addElement(value);
164
165 if (grid == sInstance->mCurGrid) selectIndex = i;
166 i++;
167 }
168 }
169 if ((sInstance->mState == ADD_NEW) || (sInstance->mState == ADD_COPY)) {
170 grids->addElement("<new>");
171 selectIndex = i++;
172 }
173 if (selectIndex >= 0) {
174 //grids->setCurrentByIndex(selectIndex);
175 } else {
176 //grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label
177 }
178
179 // sInstance->childSetTextArg("default_grid", "[DEFAULT]", (defaultGrid != "")? defaultGrid: " ");
180
181 sInstance->childSetEnabled("btn_delete", (selectIndex >= 0));
182 sInstance->childSetEnabled("btn_copy", (sInstance->mState == NORMAL) && (selectIndex >= 0));
183 // sInstance->childSetEnabled("set_default", (sInstance->mState == NORMAL) && (selectIndex > 0));
184 sInstance->childSetEnabled("gridnick", (sInstance->mState == ADD_NEW) || (sInstance->mState == ADD_COPY));
185
186 if (sInstance->mState == NORMAL) {
187 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(sInstance->mCurGrid);
188 if (gridInfo) {
189 sInstance->childSetText("gridnick", gridInfo->getGridNick());
190 //sInstance->childSetText("grid_name", gridInfo->getGridName());
191 sInstance->childSetText("loginuri", gridInfo->getLoginUri());
192 sInstance->childSetText("loginpage", gridInfo->getLoginPage());
193 sInstance->childSetText("helperuri", gridInfo->getHelperUri());
194 sInstance->childSetText("website", gridInfo->getWebSite());
195 sInstance->childSetText("support", gridInfo->getSupportUrl());
196 sInstance->childSetText("register", gridInfo->getRegisterUrl());
197 sInstance->childSetText("password", gridInfo->getPasswordUrl());
198
199 // sInstance->childSetText("first_name", gridInfo->getFirstName());
200 // sInstance->childSetText("last_name", gridInfo->getLastName());
201 // if(gridInfo->getAvatarPassword().length() == 32)
202 // sInstance->childSetText("avatar_password", std::string(PASSWORD_FILLER));
203 // else if(gridInfo->getPasswordUrl().empty())
204 // sInstance->childSetText("avatar_password", std::string(""));
205
206 // if (gridInfo->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) {
207 // //childSetEnabled("search", false);
208 // //childSetText("search", LLStringExplicit(""));
209 // childSetEnabled("render_compat", false);
210 // childSetValue("render_compat", false);
211 // } else {
212 // //childSetEnabled("search", true);
213 // //childSetText("search", gridInfo->getSearchUrl());
214 // childSetEnabled("render_compat", true);
215 // childSetValue("render_compat", gridInfo->isRenderCompat());
216 // }
217
218 } else {
219 std::string empty = "";
220 sInstance->childSetText("gridnick", empty);
221 sInstance->childSetText("gridname", empty);
222 sInstance->childSetText("loginuri", empty);
223 sInstance->childSetText("loginpage", empty);
224 sInstance->childSetText("helperuri", empty);
225 sInstance->childSetText("website", empty);
226 // sInstance->childSetText("first_name", empty);
227 // sInstance->childSetText("last_name", empty);
228 // sInstance->childSetText("avatar_password", empty);
229 }
230 } else if (sInstance->mState == ADD_NEW) {
231 llwarns << "ADD_NEW" << llendl;
232 std::string required = "<required>";
233 std::string empty = "";
234 sInstance->childSetText("gridnick", required);
235 sInstance->childSetText("gridname", empty);
236 sInstance->childSetText("loginuri", required);
237 sInstance->childSetText("loginpage", empty);
238 sInstance->childSetText("helperuri", empty);
239 sInstance->childSetText("website", empty);
240 sInstance->childSetText("support", empty);
241 sInstance->childSetText("register", empty);
242 sInstance->childSetText("password", empty);
243 // sInstance->childSetText("first_name", empty);
244 // sInstance->childSetText("last_name", empty);
245 // sInstance->childSetText("avatar_password", empty);
246 //childSetEnabled("search", true);
247 //childSetText("search", empty);
248 } else if (sInstance->mState == ADD_COPY) {
249 llwarns << "ADD_COPY" << llendl;
250 sInstance->childSetText("gridnick", LLStringExplicit("<required>"));
251 } else {
252 llwarns << "Illegal state " << sInstance->mState << '.' << llendl;
253 }
254 return;
255}
256
257void LoginFloater::update()
258{
259 mState = NORMAL;
260 mCurGrid = gHippoGridManager->getCurrentGridNick();
261 refresh_grids();
262 //KOW gHippoLimits->setLimits();
263}
264
265void LoginFloater::applyChanges()
266{
267 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
268 if (gridInfo)
269 {
270 if (gridInfo->getGridNick() == childGetValue("gridnick").asString())
271 {
272 gridInfo->setGridName(childGetValue("gridname"));
273 gridInfo->setLoginUri(childGetValue("loginuri"));
274 gridInfo->setLoginPage(childGetValue("loginpage"));
275 gridInfo->setHelperUri(childGetValue("helperuri"));
276 gridInfo->setWebSite(childGetValue("website"));
277 gridInfo->setSupportUrl(childGetValue("support"));
278 gridInfo->setRegisterUrl(childGetValue("register"));
279 gridInfo->setPasswordUrl(childGetValue("password"));
280 //gridInfo->setSearchUrl(childGetValue("search"));
281 gridInfo->setRenderCompat(childGetValue("render_compat"));
282
283 // gridInfo->setFirstName(childGetValue("first_name"));
284 // gridInfo->setLastName(childGetValue("last_name"));
285 // if(childGetValue("avatar_password").asString().empty())
286 // gridInfo->setAvatarPassword(std::string(""));
287 // else if(childGetValue("avatar_password").asString() != std::string(PASSWORD_FILLER))
288 // {
289 // // store account authentication data
290 // std::string auth_password = childGetValue("avatar_password");
291 // std::string hashed_password;
292 // hashPassword(auth_password, hashed_password);
293 // gridInfo->setAvatarPassword(hashed_password);
294 // }
295
296 //this bug was a feature -Patrick Sapinski (Friday, August 21, 2009)
297 //LLPanelLogin::setFields(gridInfo->getFirstName(), gridInfo->getLastName(),
298 // gridInfo->getAvatarPassword(), true);
299 }
300 else
301 {
302 llwarns << "Grid nickname mismatch, ignoring changes." << llendl;
303 }
304 }
305}
306
307
308bool LoginFloater::createNewGrid()
309{
310 // check nickname
311 std::string gridnick = childGetValue("gridnick");
312 if (gridnick == "<required>") gridnick = "";
313 if (gridnick == "") {
314 //KOW gViewerWindow->alertXml("GridsNoNick");
315 return false;
316 }
317 if (gHippoGridManager->getGrid(gridnick)) {
318 LLStringUtil::format_map_t args;
319 args["[NAME]"] = gridnick;
320 //KOW gViewerWindow->alertXml("GridExists", args);
321 return false;
322 }
323
324 // check login URI
325 std::string loginuri = childGetValue("loginuri");
326 if ((loginuri == "") || (loginuri == "<required>")) {
327 LLStringUtil::format_map_t args;
328 args["[NAME]"] = gridnick;
329 //KOW gViewerWindow->alertXml("GridsNoLoginUri", args);
330 return false;
331 }
332
333 // create new grid
334 HippoGridInfo *grid = new HippoGridInfo(gridnick);
335 grid->setGridName(childGetValue("gridname"));
336 grid->setLoginUri(loginuri);
337 grid->setLoginPage(childGetValue("loginpage"));
338 grid->setHelperUri(childGetValue("helperuri"));
339 grid->setWebSite(childGetValue("website"));
340 grid->setSupportUrl(childGetValue("support"));
341 grid->setRegisterUrl(childGetValue("register"));
342 grid->setPasswordUrl(childGetValue("password"));
343 //grid->setSearchUrl(childGetValue("search"));
344 grid->setRenderCompat(childGetValue("render_compat"));
345 gHippoGridManager->addGrid(grid);
346
347 // grid->setFirstName(childGetValue("first_name"));
348 // grid->setLastName(childGetValue("last_name"));
349 // if(childGetValue("avatar_password").asString().empty())
350 // grid->setAvatarPassword(std::string(""));
351 // else
352 // {
353 // std::string hashed_password;
354 // hashPassword(childGetValue("avatar_password"), hashed_password);
355 // grid->setAvatarPassword(hashed_password);
356 // }
357
358 mCurGrid = gridnick;
359 return true;
360}
361
362void LoginFloater::retrieveGridInfo()
363{
364 std::string loginuri = childGetValue("loginuri");
365 if ((loginuri == "") || (loginuri == "<required>")) {
366 //KOW gViewerWindow->alertXml("GridInfoNoLoginUri");
367 return;
368 }
369
370 HippoGridInfo *grid = 0;
371 bool cleanupGrid = false;
372 if (mState == NORMAL) {
373 grid = gHippoGridManager->getGrid(mCurGrid);
374 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
375 grid = new HippoGridInfo("");
376 cleanupGrid = true;
377 } else {
378 llerrs << "Illegal state " << mState << '.' << llendl;
379 return;
380 }
381 if (!grid) {
382 llerrs << "Internal error retrieving grid info." << llendl;
383 return;
384 }
385
386 grid->setLoginUri(loginuri);
387 if (grid->retrieveGridInfo()) {
388 if (grid->getGridNick() != "") childSetText("gridnick", grid->getGridNick());
389 if (grid->getGridName() != "") childSetText("gridname", grid->getGridName());
390 if (grid->getLoginUri() != "") childSetText("loginuri", grid->getLoginUri());
391 if (grid->getLoginPage() != "") childSetText("loginpage", grid->getLoginPage());
392 if (grid->getHelperUri() != "") childSetText("helperuri", grid->getHelperUri());
393 if (grid->getWebSite() != "") childSetText("website", grid->getWebSite());
394 if (grid->getSupportUrl() != "") childSetText("support", grid->getSupportUrl());
395 if (grid->getRegisterUrl() != "") childSetText("register", grid->getRegisterUrl());
396 if (grid->getPasswordUrl() != "") childSetText("password", grid->getPasswordUrl());
397 //if (grid->getSearchUrl() != "") childSetText("search", grid->getSearchUrl());
398 } else {
399 //KOW gViewerWindow->alertXml("GridInfoError");
400 }
401
402 if (cleanupGrid) delete grid;
403}
404
405void LoginFloater::apply()
406{
407 if (mState == NORMAL) {
408 applyChanges();
409 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
410 if (!createNewGrid()) return;
411 } else {
412 llwarns << "Illegal state " << mState << '.' << llendl;
413 return;
414 }
415 //gHippoGridManager->setCurrentGrid(mCurGrid);
416 //gHippoGridManager->setDefaultGrid(mCurGrid);
417 //LLPanelLogin::refreshLoginPage();
418 gHippoGridManager->saveFile();
419 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
420}
421
422void LoginFloater::setDefault()
423{
424 if (mState == NORMAL) {
425 applyChanges();
426 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
427 if (!createNewGrid()) return;
428 } else {
429 llwarns << "Illegal state " << mState << '.' << llendl;
430 return;
431 }
432 gHippoGridManager->setCurrentGrid(mCurGrid);
433 gHippoGridManager->setDefaultGrid(mCurGrid);
434 gHippoGridManager->saveFile();
435 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
436}
437
438void LoginFloater::cancel()
439{
440 gHippoGridManager->discardAndReload();
441 update();
442}
443
444void LoginFloater::onSelectGrid(LLUICtrl* ctrl, void *data)
445{
446 LoginFloater* self = (LoginFloater*)data;
447 if (self->mState == NORMAL) {
448 self->applyChanges();
449 } else if ((self->mState == ADD_NEW) || (self->mState == ADD_COPY)) {
450 if (self->createNewGrid()) {
451 self->mState = NORMAL;
452 } else {
453 //LLScrollListCtrl *grids = self->getChild<LLScrollListCtrl>("grid_selector");
454 //grids->setCurrentByIndex(grids->getItemCount() - 1);
455 return;
456 }
457 } else {
458 llwarns << "Illegal state " << self->mState << '.' << llendl;
459 return;
460 }
461 self->mCurGrid = ctrl->getValue().asString();
462 self->refresh_grids();
463}
464
465//static
466void LoginFloater::onClickDelete(void *data)
467{
468 llwarns << "onclickdelete" << llendl;
469 LoginFloater* self = (LoginFloater*)data;
470 if (self->mState == NORMAL)
471 gHippoGridManager->deleteGrid(self->mCurGrid);
472 self->update();
473}
474
475//static
476void LoginFloater::onClickAdd(void *data)
477{
478 llwarns << "add" << llendl;
479 LoginFloater* self = (LoginFloater*)data;
480 self->mState = ADD_NEW;
481 self->refresh_grids();
482}
483
484
485//static
486void LoginFloater::onClickCopy(void *data)
487{
488 llwarns << "copy" << llendl;
489 LoginFloater* self = (LoginFloater*)data;
490 self->mState = ADD_COPY;
491 self->refresh_grids();
492}
493
494// static
495void LoginFloater::onClickOk(void* data)
496{
497 if(NULL==sInstance)
498 return;
499
500 sInstance->apply();
501 sInstance->close();
502}
503
504//static
505void LoginFloater::onClickApply(void *data)
506{
507 if(NULL==sInstance)
508 return;
509
510 sInstance->apply();
511 refresh_grids();
512}
513
514//static
515void LoginFloater::onClickDefault(void *data)
516{
517 sInstance->setDefault();
518 sInstance->refresh_grids();
519}
520
521//static
522void LoginFloater::onClickGridInfo(void *data)
523{
524 //HippoPanelGrids* self = (HippoPanelGrids*)data;
525 sInstance->retrieveGridInfo();
526}
527
528//static
529void LoginFloater::onClickCancel(void *data)
530{
531 sInstance->cancel();
532}
533
534void LoginFloater::setAlwaysRefresh(bool refresh)
535{
536 // wargames 2: dead code, LLPanelLogin compatibility
537 return;
538}
539
540void LoginFloater::refreshLocation( bool force_visible )
541{
542
543 llwarns << "refreshLocation called" << llendl;
544
545 if (!sInstance) return;
546
547 LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
548
549 if (LLURLSimString::parse())
550 {
551 combo->setCurrentByIndex( 3 ); // BUG? Maybe 2?
552 combo->setTextEntry(LLURLSimString::sInstance.mSimString);
553 }
554 else
555 {
556 BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
557 combo->setCurrentByIndex( login_last ? 1 : 0 );
558 }
559
560 BOOL show_start = TRUE;
561
562 if ( ! force_visible )
563 show_start = gSavedSettings.getBOOL("ShowStartLocation");
564
565 sInstance->childSetVisible("start_location_combo", show_start);
566 sInstance->childSetVisible("start_location_text", show_start);
567 sInstance->childSetVisible("server_combo", TRUE);
568}
569
570void LoginFloater::newShow(const std::string &grid, bool initialLogin)
571{
572
573 llwarns << "newShow called" << llendl;
574 if(NULL==sInstance)
575 {
576 LoginFloater::sGrid = grid;
577 LoginFloater::sIsInitialLogin = initialLogin;
578 sInstance = new LoginFloater();
579
580 llwarns << "sInstance assigned. sInstance=" << sInstance << llendl;
581 }
582
583 llwarns << "newshow called" << llendl;
584 sInstance->mCurGrid = gHippoGridManager->getCurrentGridNick();
585 refresh_grids();
586
587 sInstance->open(); /*Flawfinder: ignore*/
588 // we're important
589 //sInstance->setFrontmost(TRUE);
590 //sInstance->setFocus(TRUE);
591
592}
593
594void LoginFloater::show(const LLRect &rect, BOOL show_server,
595 void (*callback)(S32 option, void* user_data),
596 void* callback_data)
597{
598 // we don't need a grid passed in because this is old-style login
599 std::string grid = "";
600 newShow(grid, TRUE);
601}
602
603void LoginFloater::setFocus(BOOL b)
604{
605 if(b != hasFocus())
606 {
607 if(b)
608 {
609 LoginFloater::giveFocus();
610 }
611 else
612 {
613 LLPanel::setFocus(b);
614 }
615 }
616}
617
618void LoginFloater::giveFocus()
619{
620 LLScrollListCtrl *combo = NULL;
621
622 if(NULL==sInstance)
623 {
624 llwarns << "giveFocus has no LoginFloater instance. sInstance=" << sInstance << llendl;
625 return;
626 }
627
628 // for our combo box approach, selecting the combo box is almost always
629 // the right thing to do on the floater receiving focus
630 combo = sInstance->getChild<LLScrollListCtrl>("grid_selector");
631 combo->setFocus(TRUE);
632}
633
634BOOL LoginFloater::isGridComboDirty()
635{
636 BOOL user_picked = FALSE;
637 if (!sInstance)
638 {
639 llwarns << "Attempted getServer with no login view shown" << llendl;
640 }
641 else
642 {
643 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
644 user_picked = combo->isDirty();
645 }
646 return user_picked;
647}
648
649void LoginFloater::getLocation(std::string &location)
650{
651 if (!sInstance)
652 {
653 llwarns << "Attempted getLocation with no login view shown" << llendl;
654 return;
655 }
656
657 LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
658 location = combo->getValue().asString();
659}
660
661std::string& LoginFloater::getPassword()
662{
663 return mMungedPassword;
664}
665
666void LoginFloater::setPassword(std::string &password)
667{
668 mMungedPassword = password;
669}
670
671bool LoginFloater::isSamePassword(std::string &password)
672{
673 return mMungedPassword == password;
674}
675
676void LoginFloater::addServer(const std::string& server, S32 domain_name)
677{
678 if (!sInstance)
679 {
680 llwarns << "Attempted addServer with no login view shown" << llendl;
681 return;
682 }
683
684 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
685 combo->add(server, LLSD(domain_name) );
686 combo->setCurrentByIndex(0);
687}
688
689void LoginFloater::cancel_old()
690{
691 if(NULL==sInstance)
692 return;
693
694 if(sInstance->sIsInitialLogin)
695 {
696 // send a callback that indicates we're quitting or closing
697 if(sInstance->mCallback)
698 sInstance->mCallback(LOGIN_OPTION_QUIT, sInstance->mCallbackData);
699 return;
700 }
701
702 sInstance->close();
703}
704
705void LoginFloater::hashPassword(const std::string& password, std::string& hashedPassword)
706{
707 // Max "actual" password length is 16 characters.
708 // Hex digests are always 32 characters.
709 if (password.length() == 32)
710 {
711 hashedPassword = password;
712 }
713 else
714 {
715 // this is a normal text password
716 LLMD5 pass((unsigned char *)password.c_str());
717 char munged_password[MD5HEX_STR_SIZE];
718 pass.hex_digest(munged_password);
719 hashedPassword = munged_password;
720 }
721
722}
723
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..485be20
--- /dev/null
+++ b/linden/indra/newview/hippoGridManager.cpp
@@ -0,0 +1,816 @@
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 mRenderCompat(true),
42 mCurrencySymbol("OS$"),
43 mRealCurrencySymbol("US$"),
44 mDirectoryFee(30)
45{
46 std::string nick = gridNick;
47 mGridNick = sanitizeGridNick( nick );
48}
49
50
51// ********************************************************************
52// Getters
53
54HippoGridInfo::Platform HippoGridInfo::getPlatform()
55{
56 return mPlatform;
57}
58
59bool HippoGridInfo::isOpenSimulator() const
60{
61 return (mPlatform == HippoGridInfo::PLATFORM_OPENSIM);
62}
63
64bool HippoGridInfo::isSecondLife() const
65{
66 return (mPlatform == HippoGridInfo::PLATFORM_SECONDLIFE);
67}
68
69const std::string& HippoGridInfo::getGridNick() const
70{
71 return mGridNick;
72}
73
74const std::string& HippoGridInfo::getGridName() const
75{
76 return mGridName;
77}
78
79const std::string& HippoGridInfo::getLoginUri() const
80{
81 return mLoginUri;
82}
83
84const std::string& HippoGridInfo::getLoginPage() const
85{
86 return mLoginPage;
87}
88
89const std::string& HippoGridInfo::getHelperUri() const
90{
91 return mHelperUri;
92}
93
94const std::string& HippoGridInfo::getWebSite() const
95{
96 return mWebSite;
97}
98
99const std::string& HippoGridInfo::getSupportUrl() const
100{
101 return mSupportUrl;
102}
103
104const std::string& HippoGridInfo::getRegisterUrl() const
105{
106 return mRegisterUrl;
107}
108
109const std::string& HippoGridInfo::getPasswordUrl() const
110{
111 return mPasswordUrl;
112}
113
114const std::string& HippoGridInfo::getSearchUrl() const
115{
116 return mSearchUrl;
117}
118
119const std::string& HippoGridInfo::getFirstName() const
120{
121 return mFirstName;
122}
123
124const std::string& HippoGridInfo::getLastName() const
125{
126 return mLastName;
127}
128
129const std::string& HippoGridInfo::getAvatarPassword() const
130{
131 return mAvatarPassword;
132}
133
134bool HippoGridInfo::isRenderCompat() const
135{
136 return mRenderCompat;
137}
138
139const std::string& HippoGridInfo::getCurrencySymbol() const
140{
141 return mCurrencySymbol;
142}
143
144const std::string& HippoGridInfo::getRealCurrencySymbol() const
145{
146 return mRealCurrencySymbol;
147}
148
149
150
151// ********************************************************************
152// Setters
153
154void HippoGridInfo::setPlatform(Platform platform)
155{
156 mPlatform = platform;
157 mCurrencySymbol = (mPlatform == PLATFORM_SECONDLIFE)? "L$": "OS$";
158}
159
160
161void HippoGridInfo::setPlatform(const std::string &platform)
162{
163 std::string tmp = platform;
164 for (unsigned i=0; i<platform.size(); i++)
165 tmp[i] = tolower(tmp[i]);
166
167 if (tmp == "opensim") {
168 setPlatform(PLATFORM_OPENSIM);
169 } else if (tmp == "secondlife") {
170 setPlatform(PLATFORM_SECONDLIFE);
171 } else {
172 setPlatform(PLATFORM_OTHER);
173 llwarns << "Unknown platform '" << platform << "'." << llendl;
174 }
175}
176
177void HippoGridInfo::setGridName(const std::string &gridName)
178{
179 mGridName = gridName;
180}
181
182void HippoGridInfo::setLoginUri(const std::string &loginUri)
183{
184 std::string uri = loginUri;
185 mLoginUri = sanitizeUri(uri);
186}
187
188void HippoGridInfo::setLoginPage(const std::string &loginPage)
189{
190 mLoginPage = loginPage;
191}
192
193void HippoGridInfo::setHelperUri(const std::string &helperUri)
194{
195 std::string uri = helperUri;
196 mHelperUri = sanitizeUri(uri);
197}
198
199void HippoGridInfo::setWebSite(const std::string &website)
200{
201 mWebSite = website;
202}
203
204void HippoGridInfo::setSupportUrl(const std::string &url)
205{
206 mSupportUrl = url;
207}
208
209void HippoGridInfo::setRegisterUrl(const std::string &url)
210{
211 mRegisterUrl = url;
212}
213
214void HippoGridInfo::setPasswordUrl(const std::string &url)
215{
216 mPasswordUrl = url;
217}
218
219void HippoGridInfo::setSearchUrl(const std::string &url)
220{
221 mSearchUrl = url;
222}
223
224void HippoGridInfo::setFirstName(const std::string &firstName)
225{
226 mFirstName = firstName;
227}
228
229void HippoGridInfo::setLastName(const std::string &lastName)
230{
231 mLastName = lastName;
232}
233
234void HippoGridInfo::setAvatarPassword(const std::string &avatarPassword)
235{
236 mAvatarPassword = avatarPassword;
237}
238
239void HippoGridInfo::setRenderCompat(bool compat)
240{
241 mRenderCompat = compat;
242}
243
244void HippoGridInfo::setCurrencySymbol(const std::string &sym)
245{
246 mCurrencySymbol = sym.substr(0, 3);
247}
248
249void HippoGridInfo::setRealCurrencySymbol(const std::string &sym)
250{
251 mRealCurrencySymbol = sym.substr(0, 3);
252}
253
254void HippoGridInfo::setDirectoryFee(int fee)
255{
256 mDirectoryFee = fee;
257}
258
259
260
261// ********************************************************************
262// Grid Info
263
264std::string HippoGridInfo::getSearchUrl(SearchType ty) const
265{
266 if ((mPlatform == PLATFORM_SECONDLIFE) || mSearchUrl.empty()) {
267 // Second Life defaults
268 if (ty == SEARCH_ALL_EMPTY) {
269 return gSavedSettings.getString("SearchURLDefault");
270 } else if (ty == SEARCH_ALL_QUERY) {
271 return gSavedSettings.getString("SearchURLQuery");
272 } else if (ty == SEARCH_ALL_TEMPLATE) {
273 return gSavedSettings.getString("SearchURLSuffix2");
274 } else {
275 llinfos << "Illegal search URL type " << ty << llendl;
276 return "";
277 }
278 } else {
279 // OpenSim and other
280 if (ty == SEARCH_ALL_EMPTY) {
281 return (mSearchUrl + "panel=All&");
282 } else if (ty == SEARCH_ALL_QUERY) {
283 return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
284 } else if (ty == SEARCH_ALL_TEMPLATE) {
285 return "lang=[LANG]&m=[MATURE]&t=[TEEN]&region=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]";
286 } else {
287 llinfos << "Illegal search URL type " << ty << llendl;
288 return "";
289 }
290 }
291}
292
293
294//static
295void HippoGridInfo::onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts)
296{
297 HippoGridInfo *self = (HippoGridInfo*)userData;
298 if (strcasecmp(name, "gridnick") == 0)
299 self->mXmlState = XML_GRIDNICK;
300 else if (strcasecmp(name, "gridname") == 0)
301 self->mXmlState = XML_GRIDNAME;
302 else if (strcasecmp(name, "platform") == 0)
303 self->mXmlState = XML_PLATFORM;
304 else if ((strcasecmp(name, "login") == 0) || (strcasecmp(name, "loginuri") == 0))
305 self->mXmlState = XML_LOGINURI;
306 else if ((strcasecmp(name, "welcome") == 0) || (strcasecmp(name, "loginpage") == 0))
307 self->mXmlState = XML_LOGINPAGE;
308 else if ((strcasecmp(name, "economy") == 0) || (strcasecmp(name, "helperuri") == 0))
309 self->mXmlState = XML_HELPERURI;
310 else if ((strcasecmp(name, "about") == 0) || (strcasecmp(name, "website") == 0))
311 self->mXmlState = XML_WEBSITE;
312 else if ((strcasecmp(name, "help") == 0) || (strcasecmp(name, "support") == 0))
313 self->mXmlState = XML_SUPPORT;
314 else if ((strcasecmp(name, "register") == 0) || (strcasecmp(name, "account") == 0))
315 self->mXmlState = XML_REGISTER;
316 else if (strcasecmp(name, "password") == 0)
317 self->mXmlState = XML_PASSWORD;
318 //else if (strcasecmp(name, "search") == 0)
319 //self->mXmlState = XML_SEARCH;
320}
321
322//static
323void HippoGridInfo::onXmlElementEnd(void *userData, const XML_Char *name)
324{
325 HippoGridInfo *self = (HippoGridInfo*)userData;
326 self->mXmlState = XML_VOID;
327}
328
329//static
330void HippoGridInfo::onXmlCharacterData(void *userData, const XML_Char *s, int len)
331{
332 HippoGridInfo *self = (HippoGridInfo*)userData;
333 switch (self->mXmlState) {
334
335 case XML_GRIDNICK: {
336 if (self->mGridNick == "") self->mGridNick.assign(s, len);
337 self->mGridNick = sanitizeGridNick(self->mGridNick);
338 break;
339 }
340
341 case XML_PLATFORM: {
342 std::string platform(s, len);
343 self->setPlatform(platform);
344 break;
345 }
346
347 case XML_LOGINURI: {
348 std::string loginuri(s, len);
349 self->mLoginUri = sanitizeUri( loginuri );
350 break;
351 }
352
353 case XML_HELPERURI: {
354 std::string helperuri(s, len);
355 self->mHelperUri = sanitizeUri( helperuri );
356 break;
357 }
358
359 case XML_SEARCH: {
360 //self->mSearchUrl.assign(s, len);
361 //sanitizeQueryUrl(mSearchUrl);
362 break;
363 }
364
365 case XML_GRIDNAME: self->mGridName.assign(s, len); break;
366 case XML_LOGINPAGE: self->mLoginPage.assign(s, len); break;
367 case XML_WEBSITE: self->mWebSite.assign(s, len); break;
368 case XML_SUPPORT: self->mSupportUrl.assign(s, len); break;
369 case XML_REGISTER: self->mRegisterUrl.assign(s, len); break;
370 case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break;
371
372 case XML_VOID: break;
373 }
374}
375
376
377bool HippoGridInfo::retrieveGridInfo()
378{
379 if (mLoginUri == "") return false;
380
381 std::string reply;
382 int result = HippoRestRequest::getBlocking(mLoginUri + "get_grid_info", &reply);
383 if (result != 200) return false;
384
385 llinfos << "Received: " << reply << llendl;
386
387 bool success = true;
388 XML_Parser parser = XML_ParserCreate(0);
389 XML_SetUserData(parser, this);
390 XML_SetElementHandler(parser, onXmlElementStart, onXmlElementEnd);
391 XML_SetCharacterDataHandler(parser, onXmlCharacterData);
392 mXmlState = XML_VOID;
393 if (!XML_Parse(parser, reply.data(), reply.size(), TRUE)) {
394 llwarns << "XML Parse Error: " << XML_ErrorString(XML_GetErrorCode(parser)) << llendl;
395 success = false;
396 }
397 XML_ParserFree(parser);
398
399 return success;
400}
401
402
403std::string HippoGridInfo::getUploadFee() const
404{
405 std::string fee;
406 formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), true);
407 return fee;
408}
409
410std::string HippoGridInfo::getGroupCreationFee() const
411{
412 std::string fee;
413 formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceGroupCreate(), false);
414 return fee;
415}
416
417std::string HippoGridInfo::getDirectoryFee() const
418{
419 std::string fee;
420 formatFee(fee, mDirectoryFee, true);
421 if (fee != "free") fee += "/week";
422 return fee;
423}
424
425void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const
426{
427 if (showFree && (cost == 0)) {
428 fee = "free";
429 } else {
430 fee = llformat("%s%d", getCurrencySymbol().c_str(), cost);
431 }
432}
433
434
435// ********************************************************************
436// Static Helpers
437
438// static
439const char *HippoGridInfo::getPlatformString(Platform platform)
440{
441 static const char *platformStrings[PLATFORM_LAST] = {
442 "Other", "OpenSim", "SecondLife"
443 };
444
445 if ((platform < PLATFORM_OTHER) || (platform >= PLATFORM_LAST))
446 platform = PLATFORM_OTHER;
447 return platformStrings[platform];
448}
449
450
451// static
452std::string HippoGridInfo::sanitizeGridNick(std::string &gridnick)
453{
454 std::string tmp;
455 int size = gridnick.size();
456 for (int i=0; i<size; i++) {
457 char c = gridnick[i];
458 if ((c == '_') || isalnum(c)) {
459 tmp += tolower(c);
460 } else if (isspace(c)) {
461 tmp += "_";
462 }
463 }
464 return tmp;
465}
466
467// static
468std::string HippoGridInfo::sanitizeUri(std::string &uri)
469{
470 if (uri.empty()) {
471 return "";
472 }
473
474 // If last character in uri is not "/"
475 if (uri.compare(uri.length()-1, 1, "/") != 0) {
476 return uri + '/';
477 }
478
479 return uri;
480}
481
482
483void HippoGridInfo::initFallback()
484{
485 FALLBACK_GRIDINFO.mGridNick = "secondlife";
486 FALLBACK_GRIDINFO.setPlatform(PLATFORM_SECONDLIFE);
487 FALLBACK_GRIDINFO.setGridName("Second Life");
488 FALLBACK_GRIDINFO.setLoginUri("https://login.agni.lindenlab.com/cgi-bin/login.cgi");
489 FALLBACK_GRIDINFO.setLoginPage("http://secondlife.com/app/login/");
490 FALLBACK_GRIDINFO.setHelperUri("https://secondlife.com/helpers/");
491 FALLBACK_GRIDINFO.setWebSite("http://secondlife.com/");
492}
493
494
495
496// ********************************************************************
497// ********************************************************************
498// HippoGridManager
499// ********************************************************************
500// ********************************************************************
501
502
503// ********************************************************************
504// Initialize
505
506HippoGridManager::HippoGridManager() :
507 mConnectedGrid(0),
508 mDefaultGridsVersion(0)
509{
510}
511
512HippoGridManager::~HippoGridManager()
513{
514 cleanup();
515}
516
517
518void HippoGridManager::cleanup()
519{
520 std::map<std::string, HippoGridInfo*>::iterator it, end = mGridInfo.end();
521 for (it=mGridInfo.begin(); it != end; ++it) {
522 delete it->second;
523 }
524 mGridInfo.clear();
525}
526
527
528void HippoGridManager::init()
529{
530 HippoGridInfo::initFallback();
531 loadFromFile();
532
533 // !!!### gSavedSettings.getControl("CmdLineLoginURI");
534 // !!!### gSavedSettings.getString("CmdLineLoginPage");
535 // !!!### gSavedSettings.getString("CmdLineHelperURI");
536 // !!!### LLString::compareInsensitive(gGridInfo[grid_index].mLabel, grid_name.c_str()))
537}
538
539
540void HippoGridManager::discardAndReload()
541{
542 cleanup();
543 loadFromFile();
544}
545
546
547// ********************************************************************
548// Public Access
549
550HippoGridInfo* HippoGridManager::getGrid(const std::string &grid) const
551{
552 std::map<std::string, HippoGridInfo*>::const_iterator it;
553 it = mGridInfo.find(grid);
554 if (it != mGridInfo.end()) {
555 return it->second;
556 } else {
557 return 0;
558 }
559}
560
561
562HippoGridInfo* HippoGridManager::getConnectedGrid() const
563{
564 return (mConnectedGrid)? mConnectedGrid: getCurrentGrid();
565}
566
567
568HippoGridInfo* HippoGridManager::getCurrentGrid() const
569{
570 HippoGridInfo *grid = getGrid(mCurrentGrid);
571 if (grid) {
572 return grid;
573 } else {
574 return &HippoGridInfo::FALLBACK_GRIDINFO;
575 }
576}
577
578const std::string& HippoGridManager::getDefaultGridNick() const
579{
580 return mDefaultGrid;
581}
582
583const std::string& HippoGridManager::getCurrentGridNick() const
584{
585 return mCurrentGrid;
586}
587
588void HippoGridManager::setCurrentGridAsConnected()
589{
590 mConnectedGrid = getCurrentGrid();
591}
592
593
594void HippoGridManager::addGrid(HippoGridInfo *grid)
595{
596 if (!grid) return;
597 const std::string &nick = grid->getGridNick();
598 if (nick == "") {
599 llwarns << "Ignoring to try adding grid with empty nick." << llendl;
600 delete grid;
601 return;
602 }
603 if (mGridInfo.find(nick) != mGridInfo.end()) {
604 llwarns << "Ignoring to try adding existing grid " << nick << '.' << llendl;
605 delete grid;
606 return;
607 }
608 mGridInfo[nick] = grid;
609}
610
611
612void HippoGridManager::deleteGrid(const std::string &grid)
613{
614 GridIterator it = mGridInfo.find(grid);
615 if (it == mGridInfo.end()) {
616 llwarns << "Trying to delete non-existing grid " << grid << '.' << llendl;
617 return;
618 }
619 mGridInfo.erase(it);
620 llinfos << "Number of grids now: " << mGridInfo.size() << llendl;
621 if (mGridInfo.empty()) llinfos << "Grid info map is empty." << llendl;
622 if (grid == mDefaultGrid)
623 setDefaultGrid(""); // sets first grid, if map not empty
624 if (grid == mCurrentGrid)
625 mCurrentGrid = mDefaultGrid;
626}
627
628
629void HippoGridManager::setDefaultGrid(const std::string &grid)
630{
631 GridIterator it = mGridInfo.find(grid);
632 if (it != mGridInfo.end()) {
633 mDefaultGrid = grid;
634 } else if (mGridInfo.find("secondlife") != mGridInfo.end()) {
635 mDefaultGrid = "secondlife";
636 } else if (!mGridInfo.empty()) {
637 mDefaultGrid = mGridInfo.begin()->first;
638 } else {
639 mDefaultGrid = "";
640 }
641}
642
643
644void HippoGridManager::setCurrentGrid(const std::string &grid)
645{
646 GridIterator it = mGridInfo.find(grid);
647 if (it != mGridInfo.end()) {
648 mCurrentGrid = grid;
649 } else if (!mGridInfo.empty()) {
650 llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl;
651 mCurrentGrid = mDefaultGrid;
652 }
653}
654
655
656// ********************************************************************
657// Persistent Store
658
659void HippoGridManager::loadFromFile()
660{
661 mDefaultGridsVersion = 0;
662 // load user grid info
663 parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml"), false);
664 // merge default grid info, if newer. Force load, if list of grids is empty.
665 parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty());
666 // merge grid info from web site, if newer. Force load, if list of grids is empty.
667 if (gSavedSettings.getBOOL("CheckForGridUpdates"))
668 parseUrl("http://imprudenceviewer.org/app/grids/", !mGridInfo.empty());
669
670 setDefaultGrid(gSavedSettings.getString("DefaultGrid"));
671 setCurrentGrid(gSavedSettings.getString("DefaultGrid"));
672}
673
674
675void HippoGridManager::parseUrl(const char *url, bool mergeIfNewer)
676{
677 llinfos << "Loading grid info from '" << url << "'." << llendl;
678
679 // query update server
680 std::string escaped_url = LLWeb::escapeURL(url);
681 LLSD response = LLHTTPClient::blockingGet(url);
682
683 // check response, return on error
684 S32 status = response["status"].asInteger();
685 if ((status != 200) || !response["body"].isArray()) {
686 llinfos << "GridInfo Update failed (" << status << "): "
687 << (response["body"].isString()? response["body"].asString(): "<unknown error>")
688 << llendl;
689 return;
690 }
691
692 LLSD gridInfo = response["body"];
693 parseData(gridInfo, mergeIfNewer);
694}
695
696void HippoGridManager::parseFile(const std::string &fileName, bool mergeIfNewer)
697{
698 llifstream infile;
699 infile.open(fileName.c_str());
700 if(!infile.is_open()) {
701 llwarns << "Cannot find grid info file " << fileName << " to load." << llendl;
702 return;
703 }
704
705 LLSD gridInfo;
706 if (LLSDSerialize::fromXML(gridInfo, infile) <= 0) {
707 llwarns << "Unable to parse grid info file " << fileName << '.' << llendl;
708 return;
709 }
710
711 llinfos << "Loading grid info file " << fileName << '.' << llendl;
712 parseData(gridInfo, mergeIfNewer);
713}
714
715
716void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
717{
718 if (mergeIfNewer) {
719 LLSD::array_const_iterator it, end = gridInfo.endArray();
720 for (it = gridInfo.beginArray(); it != end; ++it) {
721 LLSD gridMap = *it;
722 if (gridMap.has("default_grids_version")) {
723 int version = gridMap["default_grids_version"];
724 if (version <= mDefaultGridsVersion) return;
725 else break;
726 }
727 }
728 if (it == end) {
729 llwarns << "Grid data has no version number." << llendl;
730 return;
731 }
732 }
733
734 llinfos << "Loading grid data." << llendl;
735
736 LLSD::array_const_iterator it, end = gridInfo.endArray();
737 for (it = gridInfo.beginArray(); it != end; ++it) {
738 LLSD gridMap = *it;
739 if (gridMap.has("default_grids_version")) {
740 mDefaultGridsVersion = gridMap["default_grids_version"];
741 } else if (gridMap.has("gridnick") && gridMap.has("loginuri")) {
742 std::string gridnick = gridMap["gridnick"];
743 HippoGridInfo *grid;
744 GridIterator it = mGridInfo.find(gridnick);
745 bool newGrid = (it == mGridInfo.end());
746 if (newGrid) {
747 // create new grid info
748 grid = new HippoGridInfo(gridnick);
749 } else {
750 // update existing grid info
751 grid = it->second;
752 }
753 grid->setLoginUri(gridMap["loginuri"]);
754 if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
755 if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]);
756 if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]);
757 if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
758 if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
759 if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]);
760 if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]);
761 if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
762 //if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
763 if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
764 // if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
765 // if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
766 // if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
767 if (newGrid) addGrid(grid);
768 }
769 }
770}
771
772
773void HippoGridManager::saveFile()
774{
775 // save default grid to client settings
776 gSavedSettings.setString("DefaultGrid", mDefaultGrid);
777
778 // build LLSD
779 LLSD gridInfo;
780 gridInfo[0]["default_grids_version"] = mDefaultGridsVersion;
781
782 // add grids
783 S32 i = 1;
784 GridIterator it, end = mGridInfo.end();
785 for (it = mGridInfo.begin(); it != end; ++it, i++) {
786 HippoGridInfo *grid = it->second;
787 gridInfo[i]["gridnick"] = grid->getGridNick();
788 gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform());
789 gridInfo[i]["gridname"] = grid->getGridName();
790 gridInfo[i]["loginuri"] = grid->getLoginUri();
791 gridInfo[i]["loginpage"] = grid->getLoginPage();
792 gridInfo[i]["helperuri"] = grid->getHelperUri();
793 gridInfo[i]["website"] = grid->getWebSite();
794 gridInfo[i]["support"] = grid->getSupportUrl();
795 gridInfo[i]["register"] = grid->getRegisterUrl();
796 gridInfo[i]["password"] = grid->getPasswordUrl();
797 // gridInfo[i]["firstname"] = grid->getFirstName();
798 // gridInfo[i]["lastname"] = grid->getLastName();
799 // gridInfo[i]["avatarpassword"] = grid->getAvatarPassword();
800
801 //gridInfo[i]["search"] = grid->getSearchUrl();
802 gridInfo[i]["render_compat"] = grid->isRenderCompat();
803 }
804
805 // write client grid info file
806 std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml");
807 llofstream file;
808 file.open(fileName.c_str());
809 if (file.is_open()) {
810 LLSDSerialize::toPrettyXML(gridInfo, file);
811 file.close();
812 llinfos << "Saved grids to " << fileName << llendl;
813 } else {
814 llerrs << "Unable to open grid info file: " << fileName << llendl;
815 }
816}
diff --git a/linden/indra/newview/hippoGridManager.h b/linden/indra/newview/hippoGridManager.h
new file mode 100644
index 0000000..ef351d9
--- /dev/null
+++ b/linden/indra/newview/hippoGridManager.h
@@ -0,0 +1,174 @@
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();
39 bool isOpenSimulator() const;
40 bool isSecondLife() const;
41 const std::string& getGridNick() const;
42 const std::string& getGridName() const;
43 const std::string& getLoginUri() const;
44 const std::string& getLoginPage() const;
45 const std::string& getHelperUri() const;
46 const std::string& getWebSite() const;
47 const std::string& getSupportUrl() const;
48 const std::string& getRegisterUrl() const;
49 const std::string& getPasswordUrl() const;
50 const std::string& getSearchUrl() const;
51 const std::string& getFirstName() const;
52 const std::string& getLastName() const;
53 const std::string& getAvatarPassword() const;
54 std::string getSearchUrl(SearchType ty) const;
55 bool isRenderCompat() const;
56
57 const std::string& getCurrencySymbol() const;
58 const std::string& getRealCurrencySymbol() const;
59 std::string getUploadFee() const;
60 std::string getGroupCreationFee() const;
61 std::string getDirectoryFee() const;
62
63 void setPlatform (const std::string &platform);
64 void setPlatform (Platform platform);
65 void setGridName (const std::string &gridName);
66 void setLoginUri (const std::string &loginUri);
67 void setLoginPage(const std::string &loginPage);
68 void setHelperUri(const std::string &helperUri);
69 void setWebSite (const std::string &website);
70 void setSupportUrl(const std::string &url);
71 void setRegisterUrl(const std::string &url);
72 void setPasswordUrl(const std::string &url);
73 void setSearchUrl(const std::string &url);
74 void setRenderCompat(bool compat);
75 void setFirstName(const std::string &firstName);
76 void setLastName(const std::string &lastName);
77 void setAvatarPassword(const std::string &avatarPassword);
78
79 void setCurrencySymbol(const std::string &sym);
80 void setRealCurrencySymbol(const std::string &sym);
81 void setDirectoryFee(int fee);
82
83 bool retrieveGridInfo();
84
85 static const char *getPlatformString(Platform platform);
86 static std::string sanitizeGridNick(std::string &gridnick);
87
88 static HippoGridInfo FALLBACK_GRIDINFO;
89 static void initFallback();
90
91private:
92 Platform mPlatform;
93 std::string mGridNick;
94 std::string mGridName;
95 std::string mLoginUri;
96 std::string mLoginPage;
97 std::string mHelperUri;
98 std::string mWebSite;
99 std::string mSupportUrl;
100 std::string mRegisterUrl;
101 std::string mPasswordUrl;
102 std::string mSearchUrl;
103 std::string mFirstName;
104 std::string mLastName;
105 std::string mAvatarPassword;
106 bool mRenderCompat;
107
108 std::string mCurrencySymbol;
109 std::string mRealCurrencySymbol;
110 int mDirectoryFee;
111
112 // for parsing grid info XML
113 enum XmlState {
114 XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME,
115 XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
116 XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH
117 };
118 XmlState mXmlState;
119
120 static std::string sanitizeUri(std::string &uri);
121 void formatFee(std::string &fee, int cost, bool showFree) const;
122
123 static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts);
124 static void onXmlElementEnd(void *userData, const XML_Char *name);
125 static void onXmlCharacterData(void *userData, const XML_Char *s, int len);
126};
127
128
129class HippoGridManager
130{
131public:
132 HippoGridManager();
133 ~HippoGridManager();
134
135 void init();
136 void saveFile();
137 void discardAndReload();
138
139 HippoGridInfo* getGrid(const std::string &grid) const;
140 HippoGridInfo* getConnectedGrid() const;
141 HippoGridInfo* getCurrentGrid() const;
142 const std::string& getDefaultGridNick() const;
143 const std::string& getCurrentGridNick() const;
144
145 void setDefaultGrid(const std::string &grid);
146 void setCurrentGrid(const std::string &grid);
147 void setCurrentGridAsConnected();
148
149 void addGrid(HippoGridInfo *grid);
150 void deleteGrid(const std::string &grid);
151
152 typedef std::map<std::string, HippoGridInfo*>::iterator GridIterator;
153 GridIterator beginGrid() { return mGridInfo.begin(); }
154 GridIterator endGrid() { return mGridInfo.end(); }
155
156private:
157 std::map<std::string, HippoGridInfo*> mGridInfo;
158 std::string mDefaultGrid;
159 std::string mCurrentGrid;
160 HippoGridInfo *mConnectedGrid;
161 int mDefaultGridsVersion;
162
163 void cleanup();
164 void loadFromFile();
165 void parseFile(const std::string &fileName, bool mergeIfNewer);
166 void parseUrl(const char *url, bool mergeIfNewer);
167 void parseData(LLSD &gridInfo, bool mergeIfNewer);
168};
169
170
171extern HippoGridManager *gHippoGridManager;
172
173
174#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 8c22931..608fb54 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 91caa72..0146f9e 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..96e2aa3
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_login.xml
@@ -0,0 +1,260 @@
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 bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
127 bottom_delta="-50" drop_shadow_visible="true" follows="left|top"
128 font="SansSerif" h_pad="0" halign="left" height="16"
129 left="182" mouse_opaque="true" name="loginpage_text" v_pad="0" width="120">
130 Optional Fields
131 </text>
132 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
133 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
134 font="SansSerif" h_pad="0" halign="left" height="16"
135 left_delta="0" mouse_opaque="true" name="loginpage_text" v_pad="0" width="120">
136 Login Page:
137 </text>
138 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
139 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
140 height="20" left_delta="90" max_length="255" mouse_opaque="true"
141 name="loginpage" select_all_on_focus_received="true" width="320" />
142
143 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
144 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
145 font="SansSerif" h_pad="0" halign="left" height="16"
146 left_delta="-90" mouse_opaque="true" name="helperuri_text" v_pad="0" width="120">
147 Helper URI:
148 </text>
149 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
150 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
151 height="20" left_delta="90" max_length="255" mouse_opaque="true"
152 name="helperuri" select_all_on_focus_received="true" width="320" />
153
154 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
155 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
156 font="SansSerif" h_pad="0" halign="left" height="16"
157 left_delta="-90" mouse_opaque="true" name="website_text" v_pad="0" width="120">
158 Website:
159 </text>
160 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
161 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
162 height="20" left_delta="90" max_length="255" mouse_opaque="true"
163 name="website" select_all_on_focus_received="true" width="320" />
164
165 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
166 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
167 font="SansSerif" h_pad="0" halign="left" height="16"
168 left_delta="-90" mouse_opaque="true" name="support_text" v_pad="0" width="120">
169 Support URL:
170 </text>
171 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
172 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
173 height="20" left_delta="90" max_length="255" mouse_opaque="true"
174 name="support" select_all_on_focus_received="true" width="320" />
175
176 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
177 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
178 font="SansSerif" h_pad="0" halign="left" height="16"
179 left_delta="-90" mouse_opaque="true" name="register_text" v_pad="0" width="120">
180 Account URL:
181 </text>
182 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
183 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
184 height="20" left_delta="90" max_length="255" mouse_opaque="true"
185 name="register" select_all_on_focus_received="true" width="320" />
186
187 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
188 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
189 font="SansSerif" h_pad="0" halign="left" height="16"
190 left_delta="-90" mouse_opaque="true" name="password_text" v_pad="0" width="120">
191 Password URL:
192 </text>
193 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
194 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
195 height="20" left_delta="90" max_length="255" mouse_opaque="true"
196 name="password" select_all_on_focus_received="true" width="320" />
197
198 <view_border bevel_style="none" border_thickness="1" bottom_delta="-4" follows="top|left" height="155" left_delta="-93" name="OptionalPrefsBorder" width="417" />
199
200 <!-- Combo box for multi avatar grid manager avatar name
201 <combo_box allow_text_entry="true" bevel_style="in" border_style="line" border_thickness="1"
202 bottom_delta="0" follows="left|top" font="SansSerif" handle_edit_keys_directly="true"
203 height="20" left="290" max_length="45" mouse_opaque="true"
204 name="name_combo" select_all_on_focus_received="true" width="185" />
205 -->
206 <!-- Buttons for mutli avatar grid manager
207 <button bottom="159" follows="top|right" font="SansSerif" halign="center"
208 height="20" label="New" label_selected="New"
209 left="480" mouse_opaque="true" name="new_btn" scale_image="TRUE"
210 width="70" />
211 -->
212 <!--
213 <button bottom="134" follows="top|right" font="SansSerif" halign="center"
214 height="20" label="Remove" label_selected="Remove"
215 left="480" mouse_opaque="true" name="remove_btn" scale_image="TRUE"
216 width="70" />
217-->
218
219 <!-- Checkbox for selecting a global avatar (for when combo box avatar selector works)
220 <check_box bottom="85" follows="left|top" font="SansSerifSmall" height="16"
221 initial_value="false" label="Global Avatar"
222 left_delta="0" mouse_opaque="true" name="global_check" width="138" />
223
224 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16"
225 initial_value="false" label="Remember password"
226 left_delta="165" mouse_opaque="true" name="remember_check" width="138" />
227
228 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16"
229 initial_value="false" label="secret level"
230 left_delta="165" mouse_opaque="true" name="gawd_mode" width="138" />
231 -->
232
233 <!-- Cancel/Connect Buttons -->
234
235 <!--
236 <button bottom="-44" follows="right|top" font="SansSerif" halign="center"
237 height="24" label="Set as Default" label_selected="Set as Default"
238 left="470" mouse_opaque="true" name="set_default" scale_image="TRUE"
239 width="110" />
240 -->
241
242 <!-- <button bottom="28" follows="right|bottom" font="SansSerif" halign="center"
243 height="24" label="Connect" label_selected="Connect"
244 left="280" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
245 width="100" /> -->
246 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
247 height="24" label="Ok" label_selected="Apply" left="280"
248 mouse_opaque="true" name="btn_ok" scale_image="TRUE" width="100" />
249 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
250 height="24" label="Apply" label_selected="Apply" left="385"
251 mouse_opaque="true" name="btn_apply" scale_image="TRUE" width="100" />
252 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
253 height="24" label="Undo" label_selected="Undo" left="490"
254 mouse_opaque="true" name="btn_cancel" scale_image="TRUE" width="100" />
255 <!--
256 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18"
257 left_delta="135" max_chars="40" mouse_opaque="true"
258 name="server_combo" width="200" />
259 -->
260</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 aba747d..92b7008 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"