Hippo Grid Manager
This commit is contained in:
@@ -288,7 +288,8 @@ class LLManifest(object):
|
||||
return self.args.get('channel', None) == DEFAULT_CHANNEL
|
||||
elif self.viewer_branding_id()=="snowglobe":
|
||||
return self.args.get('channel', None) == DEFAULT_CHANNEL_SNOWGLOBE
|
||||
raise ValueError, "Invalid branding id: " + self.viewer_branding_id()
|
||||
else:
|
||||
return true
|
||||
|
||||
def construct(self):
|
||||
""" Meant to be overriden by LLManifest implementors with code that
|
||||
|
||||
@@ -81,7 +81,9 @@ set(viewer_SOURCE_FILES
|
||||
hbfloatergrouptitles.cpp
|
||||
hgfloatertexteditor.cpp
|
||||
hippogridmanager.cpp
|
||||
hippolimits.cpp
|
||||
hipporestrequest.cpp
|
||||
hippopanelgrids.cpp
|
||||
jcfloaterareasearch.cpp
|
||||
chatbar_as_cmdline.cpp
|
||||
qtoolalign.cpp
|
||||
@@ -546,7 +548,9 @@ set(viewer_HEADER_FILES
|
||||
hbfloatergrouptitles.h
|
||||
hgfloatertexteditor.h
|
||||
hippogridmanager.h
|
||||
hippolimits.h
|
||||
hipporestrequest.h
|
||||
hippopanelgrids.h
|
||||
jcfloaterareasearch.h
|
||||
chatbar_as_cmdline.h
|
||||
qtoolalign.h
|
||||
|
||||
@@ -1,235 +1,48 @@
|
||||
<llsd>
|
||||
<array>
|
||||
<map>
|
||||
<key>default_grids_version</key><string>26</string>
|
||||
</map>
|
||||
|
||||
<!--
|
||||
This file contains fallback settings only.
|
||||
The actual list of grids is loaded from a web server.
|
||||
-->
|
||||
|
||||
<!-- Second Life -->
|
||||
<map>
|
||||
<key>gridnick</key><string>secondlife</string>
|
||||
<key>gridname</key><string>Second Life</string>
|
||||
<key>gridname</key><string>Agni</string>
|
||||
<key>platform</key><string>SecondLife</string>
|
||||
<key>loginuri</key><string>https://login.agni.lindenlab.com/cgi-bin/login.cgi</string>
|
||||
<key>loginpage</key><string>http://imprudenceviewer.org/app/splash/</string>
|
||||
<key>loginpage</key><string>http://secondlife.com/app/login/</string>
|
||||
<key>helperuri</key><string>https://secondlife.com/helpers/</string>
|
||||
<key>website</key><string>http://secondlife.com/</string>
|
||||
<key>support</key><string>http://secondlife.com/support/</string>
|
||||
<key>register</key><string>http://secondlife.com/registration/</string>
|
||||
<key>password</key><string>http://secondlife.com/account/request.php</string>
|
||||
<key>version</key><string>0</string>
|
||||
</map>
|
||||
|
||||
<!-- Second Life Beta -->
|
||||
<map>
|
||||
<key>gridnick</key><string>secondlifebeta</string>
|
||||
<key>gridname</key><string>Second Life Beta Grid</string>
|
||||
<key>platform</key><string>SecondLife</string>
|
||||
<key>loginuri</key><string>https://login.aditi.lindenlab.com/cgi-bin/login.cgi</string>
|
||||
<key>loginpage</key><string>http://imprudenceviewer.org/app/splash/</string>
|
||||
<key>gridnick</key><string>secondlife_beta</string>
|
||||
<key>gridname</key><string>Aditi</string>
|
||||
<key>helperuri</key><string>http://aditi-secondlife.webdev.lindenlab.com/helpers/</string>
|
||||
<key>website</key><string>http://secondlife.com/</string>
|
||||
<key>support</key><string>http://secondlife.com/support/</string>
|
||||
<key>register</key><string>http://secondlife.com/registration/</string>
|
||||
<key>loginpage</key><string>http://secondlife.com/app/login/</string>
|
||||
<key>loginuri</key><string>https://login.aditi.lindenlab.com/cgi-bin/login.cgi</string>
|
||||
<key>password</key><string>http://secondlife.com/account/request.php</string>
|
||||
<key>version</key><string>1</string>
|
||||
<key>platform</key><string>SecondLife</string>
|
||||
<key>register</key><string>http://secondlife.com/registration/</string>
|
||||
<key>render_compat</key><boolean>0</boolean>
|
||||
<key>support</key><string>http://secondlife.com/support/</string>
|
||||
<key>version</key><integer>0</integer>
|
||||
<key>website</key><string>http://secondlife.com/</string>
|
||||
</map>
|
||||
|
||||
|
||||
<!-- Local Host -->
|
||||
<map>
|
||||
<key>gridnick</key><string>localhost</string>
|
||||
<key>gridnick</key><string>local</string>
|
||||
<key>gridname</key><string>Local Host</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://127.0.0.1:9000/</string>
|
||||
<key>loginpage</key><string />
|
||||
<key>helperuri</key><string>http://127.0.0.1:9000/</string>
|
||||
<key>version</key><string>1</string>
|
||||
</map>
|
||||
|
||||
<!-- OSGrid -->
|
||||
<map>
|
||||
<key>gridnick</key><string>osgrid</string>
|
||||
<key>gridname</key><string>OSGrid</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://login.osgrid.org/</string>
|
||||
<key>loginpage</key><string>http://osgrid.org/splash/</string>
|
||||
<key>helperuri</key><string>http://helper.osgrid.org/</string>
|
||||
<key>website</key><string>http://osgrid.org/</string>
|
||||
<key>support</key><string>http://osgrid.org/</string>
|
||||
<key>register</key><string>http://www.osgrid.org/index.php/auth/register</string>
|
||||
<key>password</key><string>http://www.osgrid.org/index.php/auth/forgot_password</string>
|
||||
<key>version</key><string>1</string>
|
||||
</map>
|
||||
|
||||
<!-- Legend City Online -->
|
||||
<map>
|
||||
<key>gridnick</key><string>legendcityonline</string>
|
||||
<key>gridname</key><string>Legend City Online</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://login.legendcityonline.com</string>
|
||||
<key>loginpage</key><string>http://www.legendcityonline.com/welcome.php</string>
|
||||
<key>helperuri</key><string>https://secure.legendcityonline.com/</string>
|
||||
<key>website</key><string>http://www.legendcityonline.com/</string>
|
||||
<key>support</key><string>http://www.legendcityonline.com/</string>
|
||||
<key>register</key><string>http://www.legendcityonline.com/</string>
|
||||
<key>password</key><string>http://www.legendcityonline.com/</string>
|
||||
<key>version</key><string>0</string>
|
||||
</map>
|
||||
|
||||
<!-- WorldSimTerra -->
|
||||
<map>
|
||||
<key>gridnick</key><string>worldsimterra</string>
|
||||
<key>gridname</key><string>WorldSimTerra</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://wsterra.com:8002</string>
|
||||
<key>loginpage</key><string>http://wsterra.com/log.php</string>
|
||||
<key>helperuri</key><string>http://wsterra.com/</string>
|
||||
<key>website</key><string>http://www.worldsimterra.com/</string>
|
||||
<key>support</key><string>http://www.worldsimterra.com/</string>
|
||||
<key>register</key><string>http://www.worldsimterra.com/</string>
|
||||
<key>password</key><string>http://www.worldsimterra.com/</string>
|
||||
<key>version</key><string>0</string>
|
||||
</map>
|
||||
|
||||
<!-- Your Alternative Life -->
|
||||
<map>
|
||||
<key>gridnick</key><string>youralternativelife</string>
|
||||
<key>gridname</key><string>Your Alternative Life</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://grid01.from-ne.com:8002/</string>
|
||||
<key>loginpage</key><string>http://grid01.from-ne.com/tios/loginscreen3.php</string>
|
||||
<key>helperuri</key><string>http://grid01.from-ne.com/tios/services/</string>
|
||||
<key>website</key><string>http://www.youralternativelife.com</string>
|
||||
<key>support</key><string>http://www.youralternativelife.com</string>
|
||||
<key>register</key><string>http://www.youralternativelife.com</string>
|
||||
<key>password</key><string>http://www.youralternativelife.com</string>
|
||||
<key>version</key><string>0</string>
|
||||
|
||||
</map>
|
||||
|
||||
<!-- The New World Grid -->
|
||||
<map>
|
||||
<key>gridnick</key><string>thenewworldgrid</string>
|
||||
<key>gridname</key><string>The New World Grid</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://grid.newworldgrid.com:8002/</string>
|
||||
<key>loginpage</key><string>http://account.newworldgrid.com/loginscreen.php</string>
|
||||
<key>helperuri</key><string>http://account.newworldgrid.com/</string>
|
||||
<key>website</key><string>http://www.newworldgrid.com/</string>
|
||||
<key>support</key><string>http://www.newworldgrid.com/</string>
|
||||
<key>register</key><string>http://www.newworldgrid.com/register</string>
|
||||
<key>password</key><string>http://account.newworldgrid.com/</string>
|
||||
<key>version</key><string>0</string>
|
||||
</map>
|
||||
|
||||
<!-- ReactionGrid -->
|
||||
<map>
|
||||
<key>gridnick</key><string>reactiongrid</string>
|
||||
<key>gridname</key><string>ReactionGrid</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://reactiongrid.com:8008/</string>
|
||||
<key>loginpage</key><string>http://gsquared.info/portal</string>
|
||||
<key>website</key><string>http://reactiongrid.com/Default.aspx</string>
|
||||
<key>support</key><string>http://reactiongrid.com/Support.aspx</string>
|
||||
<key>register</key><string>http://reactiongrid.com/Register.aspx</string>
|
||||
<key>password</key><string>http://reactiongrid.com/Support/ResetPassword.aspx</string>
|
||||
<key>version</key><string>0</string>
|
||||
</map>
|
||||
|
||||
<!-- Cyberlandia -->
|
||||
<map>
|
||||
<key>gridnick</key><string>cyberlandia</string>
|
||||
<key>gridname</key><string>Cyberlandia</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://grid.cyberlandia.net:8002</string>
|
||||
<key>loginpage</key><string></string>
|
||||
<key>helperuri</key><string></string>
|
||||
<key>website</key><string>http://www.cyberlandia.net</string>
|
||||
<key>version</key><string>0</string>
|
||||
</map>
|
||||
|
||||
<!-- Role Play Worlds -->
|
||||
<map>
|
||||
<key>gridnick</key><string>roleplayworlds</string>
|
||||
<key>gridname</key><string>Role Play Worlds</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://grid.roleplayworlds.net:8002/</string>
|
||||
<key>loginpage</key><string>http://grid.roleplayworlds.net/loginscreen.php</string>
|
||||
<key>helperuri</key><string>http://grid.roleplayworlds.net/</string>
|
||||
<key>website</key><string>http://roleplayworlds.net/</string>
|
||||
<key>register</key><string>http://grid.roleplayworlds.net/index.php?page=create</string>
|
||||
<key>password</key><string>http://grid.roleplayworlds.net/index.php?page=change</string>
|
||||
<key>version</key><string>0</string>
|
||||
</map>
|
||||
|
||||
<!-- GiantGrid -->
|
||||
<map>
|
||||
<key>gridnick</key><string>giantgrid</string>
|
||||
<key>gridname</key><string>GiantGrid</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://Gianttest.no-ip.biz:8002/</string>
|
||||
<key>loginpage</key><string>http://gianttest.no-ip.biz:80/gridsplash?method=login</string>
|
||||
<key>helperuri</key><string>http://gianttest.no-ip.biz/giantmap/</string>
|
||||
<key>version</key><string>0</string>
|
||||
</map>
|
||||
|
||||
<!-- 3rd Rock Grid -->
|
||||
<map>
|
||||
<key>gridnick</key><string>3rdrock</string>
|
||||
<key>gridname</key><string>3rd Rock Grid</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</key><string>http://grid.3rdrockgrid.com:8002/</string>
|
||||
<key>loginpage</key><string>http://3rdrockgrid.com/startpage.php</string>
|
||||
<key>helperuri</key><string>http://grid.3rdrockgrid.com/money/</string>
|
||||
<key>website</key><string>http://3rdrockgrid.com/</string>
|
||||
<key>register</key><string>http://3rdrockgrid.com/</string>
|
||||
<key>password</key><string>http://3rdrockgrid.com/</string>
|
||||
<key>support</key><string>http://3rdrockgrid.com/</string>
|
||||
<key>version</key><string>1</string>
|
||||
</map>
|
||||
|
||||
<!-- InWorldz -->
|
||||
<map>
|
||||
<key>gridname</key> <string>Inworldz</string>
|
||||
<key>gridnick</key> <string>inworldz</string>
|
||||
<key>platform</key> <string>OpenSim</string>
|
||||
<key>loginuri</key> <string>http://inworldz.com:8002/</string>
|
||||
<key>loginpage</key> <string>http://inworldz.com/loginscreen.php</string>
|
||||
<key>helperuri</key> <string>http://inworldz.com/</string>
|
||||
<key>password</key> <string>http://inworldz.com/wpassword</string>
|
||||
<key>register</key> <string>http://inworldz.com/register</string>
|
||||
<key>support</key> <string>http://inworldz.com/help</string>
|
||||
<key>website</key> <string>http://inworldz.com/about/</string>
|
||||
<key>version</key> <string>1</string>
|
||||
</map>
|
||||
|
||||
<!-- Meta7 -->
|
||||
<map>
|
||||
<key>gridname</key> <string>Meta7</string>
|
||||
<key>gridnick</key> <string>meta7</string>
|
||||
<key>platform</key> <string>OpenSim</string>
|
||||
<key>loginuri</key> <string>http://login.meta7.com/</string>
|
||||
<key>loginpage</key> <string>http://api.meta7.com/loginscreen.php</string>
|
||||
<key>helperuri</key> <string>https://secure.meta7.com/</string>
|
||||
<key>password</key> <string>http://www.meta7.com/resetpass.php</string>
|
||||
<key>register</key> <string>http://www.meta7.com/register.php</string>
|
||||
<key>support</key> <string>http://www.meta7.com/support.php</string>
|
||||
<key>website</key> <string>http://meta7.com/</string>
|
||||
<key>version</key> <string>0</string>
|
||||
</map>
|
||||
|
||||
<!-- ScienceSim -->
|
||||
<map>
|
||||
<key>gridname</key> <string>IEEE/ACM ScienceSim Virtual World</string>
|
||||
<key>gridnick</key> <string>sciencesim</string>
|
||||
<key>platform</key> <string>OpenSim</string>
|
||||
<key>loginuri</key> <string>http://grid.sciencesim.com/</string>
|
||||
<key>loginpage</key> <string>http://island.sciencesim.com/scisim/loginscreen.php</string>
|
||||
<key>helperuri</key> <string></string>
|
||||
<key>password</key> <string>http://island.sciencesim.com/scisim</string>
|
||||
<key>register</key> <string>http://island.sciencesim.com/scisim</string>
|
||||
<key>support</key> <string>http://island.sciencesim.com/wiki</string>
|
||||
<key>website</key> <string>http://island.sciencesim.com/about/</string>
|
||||
<key>version</key> <string>0</string>
|
||||
</map>
|
||||
|
||||
</array>
|
||||
|
||||
@@ -8,7 +8,30 @@
|
||||
<string>settings_sh.xml</string>
|
||||
<string>settings_rlv.xml</string>
|
||||
</array>
|
||||
|
||||
|
||||
<key>CheckForGridUpdates</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Fetch list of grids from Hippo server</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>DefaultGrid</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Nickname of the default grid</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>secondlife</string>
|
||||
</map>
|
||||
|
||||
<key>VivoxLicenseAccepted</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
#include <cctype>
|
||||
#include <climits>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
#include <stdtypes.h>
|
||||
#include <lldir.h>
|
||||
#include <lleconomy.h>
|
||||
#include <llerror.h>
|
||||
#include <llfile.h>
|
||||
#include <llhttpclient.h>
|
||||
#include <llsdserialize.h>
|
||||
#include "lldir.h"
|
||||
#include "lleconomy.h"
|
||||
#include "llerror.h"
|
||||
#include "llfile.h"
|
||||
#include "llhttpclient.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llweb.h"
|
||||
|
||||
@@ -39,12 +40,15 @@ HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO("");
|
||||
// Initialize
|
||||
|
||||
HippoGridInfo::HippoGridInfo(const std::string &gridNick) :
|
||||
mPlatform(PLATFORM_OTHER),
|
||||
mGridNick(gridNick),
|
||||
mRenderCompat(true),
|
||||
mCurrencySymbol("OS$"),
|
||||
mRealCurrencySymbol("US$"),
|
||||
mDirectoryFee(30)
|
||||
mPlatform(PLATFORM_OTHER),
|
||||
mGridNick(gridNick),
|
||||
mVoiceConnector("SLVoice"),
|
||||
mRenderCompat(true),
|
||||
mMaxAgentGroups(-1),
|
||||
mVersion(0),
|
||||
mCurrencySymbol("OS$"),
|
||||
mRealCurrencySymbol("US$"),
|
||||
mDirectoryFee(30)
|
||||
{
|
||||
cleanUpGridNick(mGridNick);
|
||||
}
|
||||
@@ -53,7 +57,7 @@ HippoGridInfo::HippoGridInfo(const std::string &gridNick) :
|
||||
void HippoGridInfo::setPlatform(Platform platform)
|
||||
{
|
||||
mPlatform = platform;
|
||||
mCurrencySymbol = (mPlatform == PLATFORM_SECONDLIFE)? "L$": "OS$";
|
||||
if (mPlatform == PLATFORM_SECONDLIFE) mCurrencySymbol = "L$";
|
||||
}
|
||||
|
||||
|
||||
@@ -79,31 +83,31 @@ void HippoGridInfo::setPlatform(const std::string &platform)
|
||||
|
||||
std::string HippoGridInfo::getSearchUrl(SearchType ty) const
|
||||
{
|
||||
if ((mPlatform == PLATFORM_SECONDLIFE) || mSearchUrl.empty()) {
|
||||
// Second Life defaults
|
||||
if (ty == SEARCH_ALL_EMPTY) {
|
||||
return gSavedSettings.getString("SearchURLDefault");
|
||||
} else if (ty == SEARCH_ALL_QUERY) {
|
||||
return gSavedSettings.getString("SearchURLQuery");
|
||||
} else if (ty == SEARCH_ALL_TEMPLATE) {
|
||||
return gSavedSettings.getString("SearchURLSuffix2");
|
||||
} else {
|
||||
llinfos << "Illegal search URL type " << ty << llendl;
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
// OpenSim and other
|
||||
if (ty == SEARCH_ALL_EMPTY) {
|
||||
return (mSearchUrl + "panel=All&");
|
||||
} else if (ty == SEARCH_ALL_QUERY) {
|
||||
return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
|
||||
} else if (ty == SEARCH_ALL_TEMPLATE) {
|
||||
return "lang=[LANG]&m=[MATURE]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]";
|
||||
} else {
|
||||
llinfos << "Illegal search URL type " << ty << llendl;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
if ((mPlatform == PLATFORM_SECONDLIFE) || mSearchUrl.empty()) {
|
||||
// Second Life defaults
|
||||
if (ty == SEARCH_ALL_EMPTY) {
|
||||
return gSavedSettings.getString("SearchURLDefault");
|
||||
} else if (ty == SEARCH_ALL_QUERY) {
|
||||
return gSavedSettings.getString("SearchURLQuery");
|
||||
} else if (ty == SEARCH_ALL_TEMPLATE) {
|
||||
return gSavedSettings.getString("SearchURLSuffix2");
|
||||
} else {
|
||||
llinfos << "Illegal search URL type " << ty << llendl;
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
// OpenSim and other
|
||||
if (ty == SEARCH_ALL_EMPTY) {
|
||||
return (mSearchUrl + "panel=All&");
|
||||
} else if (ty == SEARCH_ALL_QUERY) {
|
||||
return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
|
||||
} else if (ty == SEARCH_ALL_TEMPLATE) {
|
||||
return "lang=[LANG]&m=[MATURE]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]";
|
||||
} else {
|
||||
llinfos << "Illegal search URL type " << ty << llendl;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +151,7 @@ void HippoGridInfo::onXmlCharacterData(void *userData, const XML_Char *s, int le
|
||||
{
|
||||
HippoGridInfo *self = (HippoGridInfo*)userData;
|
||||
switch (self->mXmlState) {
|
||||
|
||||
|
||||
case XML_GRIDNICK:
|
||||
if (self->mGridNick == "") self->mGridNick.assign(s, len);
|
||||
cleanUpGridNick(self->mGridNick);
|
||||
@@ -155,9 +159,9 @@ void HippoGridInfo::onXmlCharacterData(void *userData, const XML_Char *s, int le
|
||||
|
||||
case XML_PLATFORM: {
|
||||
std::string platform(s, len);
|
||||
self->setPlatform(platform);
|
||||
self->setPlatform(platform);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
case XML_LOGINURI:
|
||||
self->mLoginUri.assign(s, len);
|
||||
@@ -177,8 +181,8 @@ void HippoGridInfo::onXmlCharacterData(void *userData, const XML_Char *s, int le
|
||||
case XML_GRIDNAME: self->mGridName.assign(s, len); break;
|
||||
case XML_LOGINPAGE: self->mLoginPage.assign(s, len); break;
|
||||
case XML_WEBSITE: self->mWebSite.assign(s, len); break;
|
||||
case XML_SUPPORT: self->mSupportUrl.assign(s, len); break;
|
||||
case XML_REGISTER: self->mRegisterUrl.assign(s, len); break;
|
||||
case XML_SUPPORT: self->mSupportUrl.assign(s, len); break;
|
||||
case XML_REGISTER: self->mRegisterUrl.assign(s, len); break;
|
||||
case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break;
|
||||
|
||||
case XML_VOID: break;
|
||||
@@ -190,8 +194,14 @@ bool HippoGridInfo::retrieveGridInfo()
|
||||
{
|
||||
if (mLoginUri == "") return false;
|
||||
|
||||
// If last character in uri is not "/"
|
||||
std::string uri = mLoginUri;
|
||||
if (uri.compare(uri.length()-1, 1, "/") != 0)
|
||||
{
|
||||
uri += '/';
|
||||
}
|
||||
std::string reply;
|
||||
int result = HippoRestRequest::getBlocking(mLoginUri + "get_grid_info", &reply);
|
||||
int result = HippoRestRequest::getBlocking(uri + "get_grid_info", &reply);
|
||||
if (result != 200) return false;
|
||||
|
||||
llinfos << "Received: " << reply << llendl;
|
||||
@@ -214,37 +224,33 @@ bool HippoGridInfo::retrieveGridInfo()
|
||||
|
||||
std::string HippoGridInfo::getUploadFee() const
|
||||
{
|
||||
std::string fee;
|
||||
formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), true);
|
||||
return fee;
|
||||
std::string fee;
|
||||
formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), true);
|
||||
return fee;
|
||||
}
|
||||
|
||||
std::string HippoGridInfo::getGroupCreationFee() const
|
||||
{
|
||||
std::string fee;
|
||||
formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceGroupCreate(), false);
|
||||
return fee;
|
||||
std::string fee;
|
||||
formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceGroupCreate(), false);
|
||||
return fee;
|
||||
}
|
||||
|
||||
std::string HippoGridInfo::getDirectoryFee() const
|
||||
{
|
||||
std::string fee;
|
||||
formatFee(fee, mDirectoryFee, true);
|
||||
if (fee != "free") fee += "/week";
|
||||
return fee;
|
||||
}
|
||||
int HippoGridInfo::getRawDirectoryFee() const
|
||||
{
|
||||
return mDirectoryFee;
|
||||
std::string fee;
|
||||
formatFee(fee, mDirectoryFee, true);
|
||||
if (fee != "free") fee += "/week";
|
||||
return fee;
|
||||
}
|
||||
|
||||
void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const
|
||||
{
|
||||
if (showFree && (cost == 0)) {
|
||||
fee = "free";
|
||||
} else {
|
||||
fee = llformat("%s%d", getCurrencySymbol().c_str(), cost);
|
||||
}
|
||||
if (showFree && (cost == 0)) {
|
||||
fee = "free";
|
||||
} else {
|
||||
fee = llformat("%s%d", getCurrencySymbol().c_str(), cost);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -286,7 +292,6 @@ void HippoGridInfo::cleanUpUri(std::string &uri)
|
||||
std::string::size_type n = uri.rfind('/');
|
||||
if ((n == std::string::npos) || (n < 10))
|
||||
uri += '/';
|
||||
LLStringUtil::stripNonprintable(uri);
|
||||
}
|
||||
|
||||
|
||||
@@ -294,9 +299,9 @@ void HippoGridInfo::initFallback()
|
||||
{
|
||||
FALLBACK_GRIDINFO.mGridNick = "secondlife";
|
||||
FALLBACK_GRIDINFO.setPlatform(PLATFORM_SECONDLIFE);
|
||||
FALLBACK_GRIDINFO.setGridName("Second Life");
|
||||
FALLBACK_GRIDINFO.setGridName("secondlife");
|
||||
FALLBACK_GRIDINFO.setLoginUri("https://login.agni.lindenlab.com/cgi-bin/login.cgi");
|
||||
FALLBACK_GRIDINFO.setLoginPage("http://secondlife.com/app/login/");
|
||||
FALLBACK_GRIDINFO.setLoginPage("http://phoenixviewer.com/app/login/");
|
||||
FALLBACK_GRIDINFO.setHelperUri("https://secondlife.com/helpers/");
|
||||
FALLBACK_GRIDINFO.setWebSite("http://secondlife.com/");
|
||||
}
|
||||
@@ -314,8 +319,7 @@ void HippoGridInfo::initFallback()
|
||||
// Initialize
|
||||
|
||||
HippoGridManager::HippoGridManager() :
|
||||
mConnectedGrid(0),
|
||||
mDefaultGridsVersion(0)
|
||||
mConnectedGrid(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -347,13 +351,6 @@ void HippoGridManager::init()
|
||||
}
|
||||
|
||||
|
||||
void HippoGridManager::discardAndReload()
|
||||
{
|
||||
cleanup();
|
||||
loadFromFile();
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
// Public Access
|
||||
|
||||
@@ -365,7 +362,7 @@ HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const
|
||||
return it->second;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -409,7 +406,7 @@ void HippoGridManager::deleteGrid(const std::string &grid)
|
||||
llinfos << "Number of grids now: " << mGridInfo.size() << llendl;
|
||||
if (mGridInfo.empty()) llinfos << "Grid info map is empty." << llendl;
|
||||
if (grid == mDefaultGrid)
|
||||
setDefaultGrid(""); // sets first grid, if map not empty
|
||||
setDefaultGrid(""); // sets first grid, if map not empty
|
||||
if (grid == mCurrentGrid)
|
||||
mCurrentGrid = mDefaultGrid;
|
||||
}
|
||||
@@ -423,7 +420,7 @@ void HippoGridManager::setDefaultGrid(const std::string &grid)
|
||||
} else if (mGridInfo.find("secondlife") != mGridInfo.end()) {
|
||||
mDefaultGrid = "secondlife";
|
||||
} else if (!mGridInfo.empty()) {
|
||||
mDefaultGrid = mGridInfo.begin()->first;
|
||||
mDefaultGrid = mGridInfo.begin()->first;
|
||||
} else {
|
||||
mDefaultGrid = "";
|
||||
}
|
||||
@@ -437,7 +434,7 @@ void HippoGridManager::setCurrentGrid(const std::string &grid)
|
||||
mCurrentGrid = grid;
|
||||
} else if (!mGridInfo.empty()) {
|
||||
llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl;
|
||||
mCurrentGrid = mDefaultGrid;
|
||||
mCurrentGrid = mDefaultGrid;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,15 +444,38 @@ void HippoGridManager::setCurrentGrid(const std::string &grid)
|
||||
|
||||
void HippoGridManager::loadFromFile()
|
||||
{
|
||||
mDefaultGridsVersion = 0;
|
||||
// load user grid info
|
||||
parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml"), false);
|
||||
parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg1.xml"), false);
|
||||
// merge default grid info, if newer. Force load, if list of grids is empty.
|
||||
parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty());
|
||||
std::string last_grid = gSavedSettings.getString("LastSelectedGrid");
|
||||
if (last_grid.empty()) last_grid = gSavedSettings.getString("DefaultGrid");
|
||||
setDefaultGrid(last_grid);
|
||||
setCurrentGrid(last_grid);
|
||||
// merge grid info from web site, if newer. Force load, if list of grids is empty.
|
||||
if (gSavedSettings.getBOOL("CheckForGridUpdates"))
|
||||
parseUrl("http://opensim-viewer.sourceforge.net/db/grids.php", !mGridInfo.empty());
|
||||
|
||||
setDefaultGrid(gSavedSettings.getString("DefaultGrid"));
|
||||
setCurrentGrid(gSavedSettings.getString("CmdLineGridChoice"));
|
||||
}
|
||||
|
||||
|
||||
void HippoGridManager::parseUrl(const char *url, bool mergeIfNewer)
|
||||
{
|
||||
llinfos << "Loading grid info from '" << url << "'." << llendl;
|
||||
|
||||
// query update server
|
||||
std::string escaped_url = LLWeb::escapeURL(url);
|
||||
LLSD response = LLHTTPClient::blockingGet(url);
|
||||
|
||||
// check response, return on error
|
||||
S32 status = response["status"].asInteger();
|
||||
if ((status != 200) || !response["body"].isArray()) {
|
||||
llinfos << "GridInfo Update failed (" << status << "): "
|
||||
<< (response["body"].isString()? response["body"].asString(): "<unknown error>")
|
||||
<< llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
LLSD gridInfo = response["body"];
|
||||
parseData(gridInfo, mergeIfNewer);
|
||||
}
|
||||
|
||||
void HippoGridManager::parseFile(const std::string &fileName, bool mergeIfNewer)
|
||||
@@ -469,7 +489,7 @@ void HippoGridManager::parseFile(const std::string &fileName, bool mergeIfNewer)
|
||||
|
||||
LLSD gridInfo;
|
||||
if (LLSDSerialize::fromXML(gridInfo, infile) <= 0) {
|
||||
llwarns << "Unable to parse grid info file " << fileName << '.' << llendl;
|
||||
llwarns << "Unable to parse grid info file " << fileName << '.' << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -480,34 +500,25 @@ void HippoGridManager::parseFile(const std::string &fileName, bool mergeIfNewer)
|
||||
|
||||
void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
||||
{
|
||||
if (mergeIfNewer) {
|
||||
LLSD::array_const_iterator it, end = gridInfo.endArray();
|
||||
for (it = gridInfo.beginArray(); it != end; ++it) {
|
||||
LLSD gridMap = *it;
|
||||
if (gridMap.has("default_grids_version")) {
|
||||
int version = gridMap["default_grids_version"];
|
||||
if (version <= mDefaultGridsVersion) return;
|
||||
else break;
|
||||
}
|
||||
}
|
||||
if (it == end) {
|
||||
llwarns << "Grid data has no version number." << llendl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
llinfos << "Loading grid data." << llendl;
|
||||
|
||||
LLSD::array_const_iterator it, end = gridInfo.endArray();
|
||||
for (it = gridInfo.beginArray(); it != end; ++it) {
|
||||
LLSD gridMap = *it;
|
||||
if (gridMap.has("default_grids_version")) {
|
||||
mDefaultGridsVersion = gridMap["default_grids_version"];
|
||||
} else if (gridMap.has("gridnick") && gridMap.has("loginuri")) {
|
||||
if (gridMap.has("gridnick") && gridMap.has("loginuri")) {
|
||||
std::string gridnick = gridMap["gridnick"];
|
||||
HippoGridInfo *grid;
|
||||
GridIterator it = mGridInfo.find(gridnick);
|
||||
bool newGrid = (it == mGridInfo.end());
|
||||
if (gridMap.has("version")) {
|
||||
int version = gridMap["version"];
|
||||
if (version == -1) {
|
||||
// delete grid
|
||||
if (!newGrid) mGridInfo.erase(it);
|
||||
continue;
|
||||
} else if (mergeIfNewer && !newGrid && (version <= it->second->getVersion())) {
|
||||
// don't update if version is not newer
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (newGrid) {
|
||||
// create new grid info
|
||||
grid = new HippoGridInfo(gridnick);
|
||||
@@ -518,6 +529,8 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
||||
grid->setLoginUri(gridMap["loginuri"]);
|
||||
if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
|
||||
if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]);
|
||||
if (gridMap.has("lastlogin_fname")) grid->setLastFName(gridMap["lastlogin_fname"]);
|
||||
if (gridMap.has("lastlogin_lname")) grid->setLastLName(gridMap["lastlogin_lname"]);
|
||||
if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]);
|
||||
if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
|
||||
if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
|
||||
@@ -526,9 +539,7 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
||||
if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
|
||||
//if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
|
||||
if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
|
||||
if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
|
||||
if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
|
||||
if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
|
||||
if (gridMap.has("version")) grid->setVersion(gridMap["version"]);
|
||||
if (newGrid) addGrid(grid);
|
||||
}
|
||||
}
|
||||
@@ -542,33 +553,29 @@ void HippoGridManager::saveFile()
|
||||
|
||||
// build LLSD
|
||||
LLSD gridInfo;
|
||||
gridInfo[0]["default_grids_version"] = mDefaultGridsVersion;
|
||||
|
||||
// add grids
|
||||
S32 i = 1;
|
||||
S32 i = 0;
|
||||
GridIterator it, end = mGridInfo.end();
|
||||
for (it = mGridInfo.begin(); it != end; ++it, i++) {
|
||||
HippoGridInfo *grid = it->second;
|
||||
gridInfo[i]["gridnick"] = grid->getGridNick();
|
||||
gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform());
|
||||
gridInfo[i]["gridname"] = grid->getGridName();
|
||||
if (!grid->getLastFName().empty()) gridInfo[i]["lastlogin_fname"] = grid->getLastFName();
|
||||
if (!grid->getLastLName().empty()) gridInfo[i]["lastlogin_lname"] = grid->getLastLName();
|
||||
gridInfo[i]["loginuri"] = grid->getLoginUri();
|
||||
gridInfo[i]["loginpage"] = grid->getLoginPage();
|
||||
gridInfo[i]["helperuri"] = grid->getHelperUri();
|
||||
gridInfo[i]["website"] = grid->getWebSite();
|
||||
gridInfo[i]["support"] = grid->getSupportUrl();
|
||||
gridInfo[i]["support"] = grid->getSupportUrl();
|
||||
gridInfo[i]["register"] = grid->getRegisterUrl();
|
||||
gridInfo[i]["password"] = grid->getPasswordUrl();
|
||||
gridInfo[i]["firstname"] = grid->getFirstName();
|
||||
gridInfo[i]["lastname"] = grid->getLastName();
|
||||
gridInfo[i]["avatarpassword"] = grid->getAvatarPassword();
|
||||
|
||||
//gridInfo[i]["search"] = grid->getSearchUrl();
|
||||
gridInfo[i]["password"] = grid->getPasswordUrl();
|
||||
//gridInfo[i]["search"] = grid->getSearchUrl();
|
||||
gridInfo[i]["render_compat"] = grid->isRenderCompat();
|
||||
gridInfo[i]["version"] = grid->getVersion();
|
||||
}
|
||||
|
||||
// write client grid info file
|
||||
std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml");
|
||||
std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg1.xml");
|
||||
llofstream file;
|
||||
file.open(fileName.c_str());
|
||||
if (file.is_open()) {
|
||||
|
||||
@@ -8,11 +8,10 @@
|
||||
#ifndef XML_STATIC
|
||||
#define XML_STATIC
|
||||
#endif
|
||||
|
||||
#ifdef LL_STANDALONE
|
||||
#include <expat.h>
|
||||
# include "expat.h"
|
||||
#else
|
||||
#include "expat/expat.h"
|
||||
# include <expat/expat.h>
|
||||
#endif
|
||||
|
||||
class LLSD;
|
||||
@@ -20,153 +19,158 @@ class LLSD;
|
||||
|
||||
class HippoGridInfo
|
||||
{
|
||||
LOG_CLASS(HippoGridInfo);
|
||||
public:
|
||||
enum Platform {
|
||||
PLATFORM_OTHER = 0,
|
||||
PLATFORM_OPENSIM,
|
||||
PLATFORM_SECONDLIFE,
|
||||
PLATFORM_LAST
|
||||
};
|
||||
enum SearchType {
|
||||
SEARCH_ALL_EMPTY,
|
||||
SEARCH_ALL_QUERY,
|
||||
SEARCH_ALL_TEMPLATE
|
||||
};
|
||||
enum Platform {
|
||||
PLATFORM_OTHER = 0,
|
||||
PLATFORM_OPENSIM,
|
||||
PLATFORM_SECONDLIFE,
|
||||
PLATFORM_LAST
|
||||
};
|
||||
enum SearchType {
|
||||
SEARCH_ALL_EMPTY,
|
||||
SEARCH_ALL_QUERY,
|
||||
SEARCH_ALL_TEMPLATE
|
||||
};
|
||||
|
||||
explicit HippoGridInfo(const std::string &gridNick);
|
||||
explicit HippoGridInfo(const std::string &gridNick);
|
||||
|
||||
Platform getPlatform() const { return mPlatform; }
|
||||
const std::string &getGridNick() const { return mGridNick; }
|
||||
const std::string &getGridName() const { return mGridName; }
|
||||
const std::string &getLoginUri() const { return mLoginUri; }
|
||||
const std::string &getLoginPage() const { return mLoginPage; }
|
||||
const std::string &getHelperUri() const { return mHelperUri; }
|
||||
const std::string &getWebSite() const { return mWebSite; }
|
||||
const std::string &getSupportUrl() const { return mSupportUrl; }
|
||||
const std::string &getRegisterUrl() const { return mRegisterUrl; }
|
||||
const std::string &getPasswordUrl() const { return mPasswordUrl; }
|
||||
const std::string &getSearchUrl() const { return mSearchUrl; }
|
||||
const std::string &getFirstName() const { return mFirstName; }
|
||||
const std::string &getLastName() const { return mLastName; }
|
||||
const std::string &getAvatarPassword() const { return mAvatarPassword; }
|
||||
std::string getSearchUrl(SearchType ty) const;
|
||||
bool isRenderCompat() const { return mRenderCompat; }
|
||||
Platform getPlatform() const { return mPlatform; }
|
||||
const std::string &getGridNick() const { return mGridNick; }
|
||||
const std::string &getGridName() const { return mGridName; }
|
||||
const std::string &getLastFName() const { return mLastFName; }
|
||||
const std::string &getLastLName() const { return mLastLName; }
|
||||
const std::string &getLoginUri() const { return mLoginUri; }
|
||||
const std::string &getLoginPage() const { return mLoginPage; }
|
||||
const std::string &getHelperUri() const { return mHelperUri; }
|
||||
const std::string &getWebSite() const { return mWebSite; }
|
||||
const std::string &getSupportUrl() const { return mSupportUrl; }
|
||||
const std::string &getRegisterUrl() const { return mRegisterUrl; }
|
||||
const std::string &getPasswordUrl() const { return mPasswordUrl; }
|
||||
const std::string &getSearchUrl() const { return mSearchUrl; }
|
||||
const std::string &getVoiceConnector() const { return mVoiceConnector; }
|
||||
std::string getSearchUrl(SearchType ty) const;
|
||||
bool isRenderCompat() const { return mRenderCompat; }
|
||||
int getMaxAgentGroups() const { return mMaxAgentGroups; }
|
||||
int getVersion() const { return mVersion; }
|
||||
|
||||
const std::string &getCurrencySymbol() const { return mCurrencySymbol; }
|
||||
const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; }
|
||||
std::string getUploadFee() const;
|
||||
std::string getGroupCreationFee() const;
|
||||
std::string getDirectoryFee() const;
|
||||
int getRawDirectoryFee() const;
|
||||
const std::string &getCurrencySymbol() const { return mCurrencySymbol; }
|
||||
const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; }
|
||||
std::string getUploadFee() const;
|
||||
std::string getGroupCreationFee() const;
|
||||
std::string getDirectoryFee() const;
|
||||
|
||||
bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); }
|
||||
bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); }
|
||||
bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); }
|
||||
bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); }
|
||||
|
||||
void setPlatform (const std::string &platform);
|
||||
void setPlatform (Platform platform);
|
||||
void setGridName (const std::string &gridName) { mGridName = gridName; }
|
||||
void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); }
|
||||
void setLoginPage(const std::string &loginPage) { mLoginPage = loginPage; }
|
||||
void setHelperUri(const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); }
|
||||
void setWebSite (const std::string &website) { mWebSite = website; }
|
||||
void setSupportUrl(const std::string &url) { mSupportUrl = url; }
|
||||
void setRegisterUrl(const std::string &url) { mRegisterUrl = url; }
|
||||
void setPasswordUrl(const std::string &url) { mPasswordUrl = url; }
|
||||
void setSearchUrl(const std::string &url) { mSearchUrl = url; }
|
||||
void setRenderCompat(bool compat) { mRenderCompat = compat; }
|
||||
void setFirstName(const std::string &firstName) { mFirstName = firstName; } //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
void setLastName(const std::string &lastName) { mLastName = lastName; }
|
||||
void setAvatarPassword(const std::string &avatarPassword) { mAvatarPassword = avatarPassword; }
|
||||
void setPlatform (const std::string &platform);
|
||||
void setPlatform (Platform platform);
|
||||
void setGridName (const std::string &gridName) { mGridName = gridName; }
|
||||
void setLastFName (const std::string &firstName) { mLastFName = firstName; }
|
||||
void setLastLName (const std::string &lastName) { mLastLName = lastName; }
|
||||
void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); }
|
||||
void setLoginPage (const std::string &loginPage) { mLoginPage = loginPage; }
|
||||
void setHelperUri (const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); }
|
||||
void setWebSite (const std::string &website) { mWebSite = website; }
|
||||
void setSupportUrl (const std::string &url) { mSupportUrl = url; }
|
||||
void setRegisterUrl(const std::string &url) { mRegisterUrl = url; }
|
||||
void setPasswordUrl(const std::string &url) { mPasswordUrl = url; }
|
||||
void setSearchUrl (const std::string &url) { mSearchUrl = url; }
|
||||
void setRenderCompat(bool compat) { mRenderCompat = compat; }
|
||||
void setMaxAgentGroups(int max) { mMaxAgentGroups = max; }
|
||||
void setVersion(int version) { mVersion = version; }
|
||||
void setVoiceConnector(const std::string &vc) { mVoiceConnector = vc; }
|
||||
|
||||
void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); }
|
||||
void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); }
|
||||
void setDirectoryFee(int fee) { mDirectoryFee = fee; }
|
||||
void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); }
|
||||
void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); }
|
||||
void setDirectoryFee(int fee) { mDirectoryFee = fee; }
|
||||
|
||||
bool retrieveGridInfo();
|
||||
bool retrieveGridInfo();
|
||||
|
||||
static const char *getPlatformString(Platform platform);
|
||||
static void cleanUpGridNick(std::string &gridnick);
|
||||
static const char *getPlatformString(Platform platform);
|
||||
static void cleanUpGridNick(std::string &gridnick);
|
||||
|
||||
static HippoGridInfo FALLBACK_GRIDINFO;
|
||||
static void initFallback();
|
||||
static HippoGridInfo FALLBACK_GRIDINFO;
|
||||
static void initFallback();
|
||||
|
||||
private:
|
||||
Platform mPlatform;
|
||||
std::string mGridNick;
|
||||
std::string mGridName;
|
||||
std::string mLoginUri;
|
||||
std::string mLoginPage;
|
||||
std::string mHelperUri;
|
||||
std::string mWebSite;
|
||||
std::string mSupportUrl;
|
||||
std::string mRegisterUrl;
|
||||
std::string mPasswordUrl;
|
||||
std::string mSearchUrl;
|
||||
std::string mFirstName;
|
||||
std::string mLastName;
|
||||
std::string mAvatarPassword;
|
||||
bool mRenderCompat;
|
||||
Platform mPlatform;
|
||||
std::string mGridNick;
|
||||
std::string mGridName;
|
||||
std::string mLastFName;
|
||||
std::string mLastLName;
|
||||
std::string mLoginUri;
|
||||
std::string mLoginPage;
|
||||
std::string mHelperUri;
|
||||
std::string mWebSite;
|
||||
std::string mSupportUrl;
|
||||
std::string mRegisterUrl;
|
||||
std::string mPasswordUrl;
|
||||
std::string mSearchUrl;
|
||||
std::string mVoiceConnector;
|
||||
bool mRenderCompat;
|
||||
int mMaxAgentGroups;
|
||||
int mVersion;
|
||||
|
||||
std::string mCurrencySymbol;
|
||||
std::string mRealCurrencySymbol;
|
||||
int mDirectoryFee;
|
||||
std::string mCurrencySymbol;
|
||||
std::string mRealCurrencySymbol;
|
||||
int mDirectoryFee;
|
||||
|
||||
// for parsing grid info XML
|
||||
enum XmlState {
|
||||
XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME,
|
||||
XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
|
||||
XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH
|
||||
};
|
||||
XmlState mXmlState;
|
||||
// for parsing grid info XML
|
||||
enum XmlState {
|
||||
XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME,
|
||||
XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
|
||||
XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH
|
||||
};
|
||||
XmlState mXmlState;
|
||||
|
||||
static void cleanUpUri(std::string &uri);
|
||||
void formatFee(std::string &fee, int cost, bool showFree) const;
|
||||
static void cleanUpUri(std::string &uri);
|
||||
void formatFee(std::string &fee, int cost, bool showFree) const;
|
||||
|
||||
static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts);
|
||||
static void onXmlElementEnd(void *userData, const XML_Char *name);
|
||||
static void onXmlCharacterData(void *userData, const XML_Char *s, int len);
|
||||
static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts);
|
||||
static void onXmlElementEnd(void *userData, const XML_Char *name);
|
||||
static void onXmlCharacterData(void *userData, const XML_Char *s, int len);
|
||||
};
|
||||
|
||||
|
||||
class HippoGridManager
|
||||
{
|
||||
LOG_CLASS(HippoGridManager);
|
||||
public:
|
||||
HippoGridManager();
|
||||
~HippoGridManager();
|
||||
HippoGridManager();
|
||||
~HippoGridManager();
|
||||
|
||||
void init();
|
||||
void saveFile();
|
||||
void discardAndReload();
|
||||
void init();
|
||||
void saveFile();
|
||||
|
||||
HippoGridInfo *getGrid(const std::string &grid) const;
|
||||
HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); }
|
||||
HippoGridInfo *getCurrentGrid() const;
|
||||
const std::string &getDefaultGridNick() const { return mDefaultGrid; }
|
||||
const std::string &getCurrentGridNick() const { return mCurrentGrid; }
|
||||
HippoGridInfo *getGrid(const std::string &grid) const;
|
||||
HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); }
|
||||
HippoGridInfo *getCurrentGrid() const;
|
||||
const std::string &getDefaultGridNick() const { return mDefaultGrid; }
|
||||
const std::string &getCurrentGridNick() const { return mCurrentGrid; }
|
||||
|
||||
void setDefaultGrid(const std::string &grid);
|
||||
void setCurrentGrid(const std::string &grid);
|
||||
void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); }
|
||||
void setDefaultGrid(const std::string &grid);
|
||||
void setCurrentGrid(const std::string &grid);
|
||||
void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); }
|
||||
|
||||
void addGrid(HippoGridInfo *grid);
|
||||
void deleteGrid(const std::string &grid);
|
||||
void addGrid(HippoGridInfo *grid);
|
||||
void deleteGrid(const std::string &grid);
|
||||
|
||||
typedef std::map<std::string, HippoGridInfo*>::iterator GridIterator;
|
||||
GridIterator beginGrid() { return mGridInfo.begin(); }
|
||||
GridIterator endGrid() { return mGridInfo.end(); }
|
||||
typedef std::map<std::string, HippoGridInfo*>::iterator GridIterator;
|
||||
GridIterator beginGrid() { return mGridInfo.begin(); }
|
||||
GridIterator endGrid() { return mGridInfo.end(); }
|
||||
|
||||
private:
|
||||
std::map<std::string, HippoGridInfo*> mGridInfo;
|
||||
std::string mDefaultGrid;
|
||||
std::string mCurrentGrid;
|
||||
HippoGridInfo *mConnectedGrid;
|
||||
int mDefaultGridsVersion;
|
||||
std::map<std::string, HippoGridInfo*> mGridInfo;
|
||||
std::string mDefaultGrid;
|
||||
std::string mCurrentGrid;
|
||||
HippoGridInfo *mConnectedGrid;
|
||||
|
||||
void cleanup();
|
||||
void loadFromFile();
|
||||
void parseFile(const std::string &fileName, bool mergeIfNewer);
|
||||
void parseUrl(const char *url, bool mergeIfNewer);
|
||||
void parseData(LLSD &gridInfo, bool mergeIfNewer);
|
||||
void cleanup();
|
||||
void loadFromFile();
|
||||
void parseFile(const std::string &fileName, bool mergeIfNewer);
|
||||
void parseUrl(const char *url, bool mergeIfNewer);
|
||||
void parseData(LLSD &gridInfo, bool mergeIfNewer);
|
||||
};
|
||||
|
||||
|
||||
|
||||
64
indra/newview/hippolimits.cpp
Normal file
64
indra/newview/hippolimits.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "hippolimits.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
#include "llerror.h"
|
||||
|
||||
#include "llviewercontrol.h" // gSavedSettings
|
||||
|
||||
HippoLimits *gHippoLimits = 0;
|
||||
|
||||
|
||||
HippoLimits::HippoLimits()
|
||||
{
|
||||
setLimits();
|
||||
}
|
||||
|
||||
|
||||
void HippoLimits::setLimits()
|
||||
{
|
||||
if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) {
|
||||
setSecondLifeLimits();
|
||||
} else {
|
||||
setOpenSimLimits();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void HippoLimits::setOpenSimLimits()
|
||||
{
|
||||
mMaxAgentGroups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups();
|
||||
if (mMaxAgentGroups < 0) mMaxAgentGroups = 50;
|
||||
mMaxPrimScale = 256.0f;
|
||||
mMaxHeight = 10000.0f;
|
||||
if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) {
|
||||
llinfos << "Using rendering compatible OpenSim limits." << llendl;
|
||||
mMinHoleSize = 0.05f;
|
||||
mMaxHollow = 0.95f;
|
||||
} else {
|
||||
llinfos << "Using Hippo OpenSim limits." << llendl;
|
||||
mMinHoleSize = 0.01f;
|
||||
mMaxHollow = 0.99f;
|
||||
}
|
||||
}
|
||||
|
||||
void HippoLimits::setSecondLifeLimits()
|
||||
{
|
||||
llinfos << "Using Second Life limits." << llendl;
|
||||
|
||||
if (gHippoGridManager->getConnectedGrid())
|
||||
|
||||
//KC: new server defined max groups
|
||||
mMaxAgentGroups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups();
|
||||
if (mMaxAgentGroups <= 0)
|
||||
{
|
||||
mMaxAgentGroups = DEFAULT_MAX_AGENT_GROUPS;
|
||||
}
|
||||
|
||||
mMaxHeight = 4096.0f;
|
||||
mMinHoleSize = 0.05f;
|
||||
mMaxHollow = 0.95f;
|
||||
}
|
||||
|
||||
34
indra/newview/hippolimits.h
Normal file
34
indra/newview/hippolimits.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef __HIPPO_LIMITS_H__
|
||||
#define __HIPPO_LIMITS_H__
|
||||
|
||||
|
||||
class HippoLimits
|
||||
{
|
||||
LOG_CLASS(HippoLimits);
|
||||
public:
|
||||
HippoLimits();
|
||||
|
||||
int getMaxAgentGroups() const { return mMaxAgentGroups; }
|
||||
float getMaxHeight() const { return mMaxHeight; }
|
||||
float getMinHoleSize() const { return mMinHoleSize; }
|
||||
float getMaxHollow() const { return mMaxHollow; }
|
||||
float getMaxPrimScale() const { return mMaxPrimScale; }
|
||||
|
||||
void setLimits();
|
||||
|
||||
private:
|
||||
int mMaxAgentGroups;
|
||||
float mMaxHeight;
|
||||
float mMinHoleSize;
|
||||
float mMaxHollow;
|
||||
float mMaxPrimScale;
|
||||
|
||||
void setOpenSimLimits();
|
||||
void setSecondLifeLimits();
|
||||
};
|
||||
|
||||
|
||||
extern HippoLimits *gHippoLimits;
|
||||
|
||||
|
||||
#endif
|
||||
499
indra/newview/hippopanelgrids.cpp
Normal file
499
indra/newview/hippopanelgrids.cpp
Normal file
@@ -0,0 +1,499 @@
|
||||
/**
|
||||
* @file hippopanelgrids.cpp
|
||||
* @author Mana Janus
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2008, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "hippopanelgrids.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
#include "hippolimits.h"
|
||||
|
||||
#include "llcombobox.h"
|
||||
#include "llpanellogin.h"
|
||||
#include "llstartup.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llviewerwindow.h"
|
||||
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
|
||||
|
||||
class HippoPanelGridsImpl : public HippoPanelGrids
|
||||
{
|
||||
public:
|
||||
HippoPanelGridsImpl();
|
||||
virtual ~HippoPanelGridsImpl();
|
||||
|
||||
BOOL postBuild();
|
||||
void apply();
|
||||
void cancel();
|
||||
|
||||
private:
|
||||
enum State { NORMAL, ADD_NEW, ADD_COPY };
|
||||
State mState;
|
||||
std::string mCurGrid;
|
||||
|
||||
void loadCurGrid();
|
||||
bool saveCurGrid();
|
||||
|
||||
void refresh();
|
||||
void reset();
|
||||
void retrieveGridInfo();
|
||||
|
||||
static void onSelectGrid(LLUICtrl *ctrl, void *data);
|
||||
static void onSelectPlatform(LLUICtrl *ctrl, void *data);
|
||||
static void onClickDelete(void *data);
|
||||
static void onClickAdd(void *data);
|
||||
static void onClickCopy(void *data);
|
||||
static void onClickDefault(void *data);
|
||||
static void onClickGridInfo(void *data);
|
||||
static void onClickHelpRenderCompat(void *data);
|
||||
};
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
|
||||
|
||||
HippoPanelGrids::HippoPanelGrids()
|
||||
{
|
||||
}
|
||||
|
||||
HippoPanelGrids::~HippoPanelGrids()
|
||||
{
|
||||
}
|
||||
|
||||
// static
|
||||
HippoPanelGrids *HippoPanelGrids::create()
|
||||
{
|
||||
return new HippoPanelGridsImpl();
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
|
||||
|
||||
HippoPanelGridsImpl::HippoPanelGridsImpl() :
|
||||
mState(NORMAL)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_grids.xml");
|
||||
}
|
||||
|
||||
HippoPanelGridsImpl::~HippoPanelGridsImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
// panel interface
|
||||
|
||||
BOOL HippoPanelGridsImpl::postBuild()
|
||||
{
|
||||
requires<LLComboBox>("grid_selector");
|
||||
requires<LLLineEditor>("gridnick");
|
||||
requires<LLComboBox>("platform");
|
||||
requires<LLLineEditor>("gridname");
|
||||
requires<LLLineEditor>("loginuri");
|
||||
requires<LLLineEditor>("loginpage");
|
||||
requires<LLLineEditor>("helperuri");
|
||||
requires<LLLineEditor>("website");
|
||||
requires<LLLineEditor>("support");
|
||||
requires<LLLineEditor>("register");
|
||||
requires<LLLineEditor>("password");
|
||||
//requires<LLLineEditor>("search");
|
||||
requires<LLButton>("btn_delete");
|
||||
requires<LLButton>("btn_add");
|
||||
requires<LLButton>("btn_copy");
|
||||
requires<LLButton>("btn_default");
|
||||
requires<LLButton>("btn_gridinfo");
|
||||
requires<LLButton>("btn_help_render_compat");
|
||||
if (!checkRequirements()) return false;
|
||||
|
||||
LLComboBox *platform = getChild<LLComboBox>("platform");
|
||||
platform->removeall();
|
||||
for (int p=HippoGridInfo::PLATFORM_OTHER; p<HippoGridInfo::PLATFORM_LAST; p++)
|
||||
platform->add(HippoGridInfo::getPlatformString(static_cast<HippoGridInfo::Platform>(p)));
|
||||
|
||||
childSetAction("btn_delete", onClickDelete, this);
|
||||
childSetAction("btn_add", onClickAdd, this);
|
||||
childSetAction("btn_copy", onClickCopy, this);
|
||||
childSetAction("btn_default", onClickDefault, this);
|
||||
childSetAction("btn_gridinfo", onClickGridInfo, this);
|
||||
childSetAction("btn_help_render_compat", onClickHelpRenderCompat, this);
|
||||
|
||||
childSetCommitCallback("grid_selector", onSelectGrid, this);
|
||||
childSetCommitCallback("platform", onSelectPlatform, this);
|
||||
|
||||
// !!!### server_choice_combo->setFocusLostCallback(onServerComboLostFocus);
|
||||
|
||||
reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// called from setFocus()
|
||||
// called internally too
|
||||
void HippoPanelGridsImpl::refresh()
|
||||
{
|
||||
const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
|
||||
|
||||
LLComboBox *grids = getChild<LLComboBox>("grid_selector");
|
||||
S32 selectIndex = -1, i = 0;
|
||||
grids->removeall();
|
||||
if (defaultGrid != "") {
|
||||
grids->add(defaultGrid);
|
||||
selectIndex = i++;
|
||||
}
|
||||
HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
|
||||
for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
|
||||
const std::string &grid = it->second->getGridNick();
|
||||
if (grid != defaultGrid) {
|
||||
grids->add(grid);
|
||||
if (grid == mCurGrid) selectIndex = i;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
|
||||
grids->add("<new>");
|
||||
selectIndex = i++;
|
||||
}
|
||||
if (selectIndex >= 0) {
|
||||
grids->setCurrentByIndex(selectIndex);
|
||||
} else {
|
||||
grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label
|
||||
}
|
||||
|
||||
childSetTextArg("default_grid", "[DEFAULT]", (defaultGrid != "")? defaultGrid: " ");
|
||||
|
||||
childSetEnabled("btn_delete", (selectIndex >= 0));
|
||||
childSetEnabled("btn_copy", (mState == NORMAL) && (selectIndex >= 0));
|
||||
childSetEnabled("btn_default", (mState == NORMAL) && (selectIndex > 0));
|
||||
childSetEnabled("gridnick", (mState == ADD_NEW) || (mState == ADD_COPY));
|
||||
|
||||
if (childGetValue("platform").asString() == "SecondLife") {
|
||||
// disable platform selector, if logged into the grid edited and it is SL
|
||||
// so object export restrictions cannot be circumvented by changing the platform
|
||||
bool enablePlatform = (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) ||
|
||||
(mCurGrid != gHippoGridManager->getConnectedGrid()->getGridNick());
|
||||
childSetEnabled("platform", enablePlatform);
|
||||
//childSetEnabled("search", false);
|
||||
//childSetText("search", LLStringExplicit(""));
|
||||
childSetEnabled("render_compat", false);
|
||||
childSetValue("render_compat", false);
|
||||
} else {
|
||||
childSetEnabled("platform", true);
|
||||
//childSetEnabled("search", true);
|
||||
//childSetText("search", gridInfo->getSearchUrl());
|
||||
childSetEnabled("render_compat", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
// called from preferences floater
|
||||
|
||||
void HippoPanelGridsImpl::apply()
|
||||
{
|
||||
if (saveCurGrid()) {
|
||||
// adding new grid did not fail
|
||||
gHippoGridManager->setCurrentGrid(mCurGrid);
|
||||
}
|
||||
LLPanelLogin::refreshLoginPage();
|
||||
gHippoGridManager->saveFile();
|
||||
refresh();
|
||||
// update render compatibility
|
||||
if (mCurGrid == gHippoGridManager->getConnectedGrid()->getGridNick())
|
||||
gHippoLimits->setLimits();
|
||||
}
|
||||
|
||||
// called on close too
|
||||
void HippoPanelGridsImpl::cancel()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
// load/save current grid
|
||||
|
||||
void HippoPanelGridsImpl::loadCurGrid()
|
||||
{
|
||||
HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
|
||||
if (gridInfo && (mState != ADD_NEW)) {
|
||||
childSetText("gridnick", gridInfo->getGridNick());
|
||||
LLComboBox *platform = getChild<LLComboBox>("platform");
|
||||
if (platform) platform->setCurrentByIndex(gridInfo->getPlatform());
|
||||
childSetText("gridname", gridInfo->getGridName());
|
||||
childSetText("loginuri", gridInfo->getLoginUri());
|
||||
childSetText("loginpage", gridInfo->getLoginPage());
|
||||
childSetText("helperuri", gridInfo->getHelperUri());
|
||||
childSetText("website", gridInfo->getWebSite());
|
||||
childSetText("support", gridInfo->getSupportUrl());
|
||||
childSetText("register", gridInfo->getRegisterUrl());
|
||||
childSetText("password", gridInfo->getPasswordUrl());
|
||||
childSetValue("render_compat", gridInfo->isRenderCompat());
|
||||
} else {
|
||||
std::string empty = "";
|
||||
childSetText("gridnick", empty);
|
||||
LLComboBox *platform = getChild<LLComboBox>("platform");
|
||||
if (platform) platform->setCurrentByIndex(HippoGridInfo::PLATFORM_OTHER);
|
||||
childSetText("gridname", empty);
|
||||
childSetText("loginuri", empty);
|
||||
childSetText("loginpage", empty);
|
||||
childSetText("helperuri", empty);
|
||||
childSetText("website", empty);
|
||||
childSetText("support", empty);
|
||||
childSetText("register", empty);
|
||||
childSetText("password", empty);
|
||||
childSetEnabled("render_compat", true);
|
||||
childSetValue("render_compat", true);
|
||||
}
|
||||
|
||||
if (mState == ADD_NEW) {
|
||||
std::string required = "<required>";
|
||||
childSetText("gridnick", required);
|
||||
childSetText("loginuri", required);
|
||||
} else if (mState == ADD_COPY) {
|
||||
childSetText("gridnick", std::string("<required>"));
|
||||
} else if (mState != NORMAL) {
|
||||
llwarns << "Illegal state " << mState << '.' << llendl;
|
||||
}
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
||||
// returns false, if adding new grid failed
|
||||
bool HippoPanelGridsImpl::saveCurGrid()
|
||||
{
|
||||
HippoGridInfo *gridInfo = 0;
|
||||
|
||||
if (mState == NORMAL) {
|
||||
|
||||
gridInfo = gHippoGridManager->getGrid(mCurGrid);
|
||||
|
||||
} else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
|
||||
|
||||
// check nickname
|
||||
std::string gridnick = childGetValue("gridnick");
|
||||
if (gridnick == "<required>") gridnick = "";
|
||||
HippoGridInfo::cleanUpGridNick(gridnick);
|
||||
childSetValue("gridnick", (gridnick != "")? gridnick: "<required>");
|
||||
if (gridnick == "") {
|
||||
LLNotifications::instance().add("GridsNoNick");
|
||||
return false;
|
||||
}
|
||||
if (gHippoGridManager->getGrid(gridnick)) {
|
||||
LLSD args;
|
||||
args["NAME"] = gridnick;
|
||||
LLNotifications::instance().add("GridExists", args);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check login URI
|
||||
std::string loginuri = childGetValue("loginuri");
|
||||
if ((loginuri == "") || (loginuri == "<required>")) {
|
||||
LLSD args;
|
||||
args["NAME"] = gridnick;
|
||||
LLNotifications::instance().add("GridsNoLoginUri", args);
|
||||
return false;
|
||||
}
|
||||
|
||||
mState = NORMAL;
|
||||
mCurGrid = gridnick;
|
||||
gridInfo = new HippoGridInfo(gridnick);
|
||||
gHippoGridManager->addGrid(gridInfo);
|
||||
|
||||
} else {
|
||||
|
||||
llwarns << "Illegal state " << mState << '.' << llendl;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
if (!gridInfo) {
|
||||
llwarns << "Grid not found, ignoring changes." << llendl;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (gridInfo->getGridNick() != childGetValue("gridnick").asString()) {
|
||||
llwarns << "Grid nickname mismatch, ignoring changes." << llendl;
|
||||
return true;
|
||||
}
|
||||
|
||||
gridInfo->setPlatform(childGetValue("platform"));
|
||||
gridInfo->setGridName(childGetValue("gridname"));
|
||||
gridInfo->setLoginUri(childGetValue("loginuri"));
|
||||
gridInfo->setLoginPage(childGetValue("loginpage"));
|
||||
gridInfo->setHelperUri(childGetValue("helperuri"));
|
||||
gridInfo->setWebSite(childGetValue("website"));
|
||||
gridInfo->setSupportUrl(childGetValue("support"));
|
||||
gridInfo->setRegisterUrl(childGetValue("register"));
|
||||
gridInfo->setPasswordUrl(childGetValue("password"));
|
||||
//gridInfo->setSearchUrl(childGetValue("search"));
|
||||
gridInfo->setRenderCompat(childGetValue("render_compat"));
|
||||
|
||||
refresh();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
// local helper functions
|
||||
|
||||
void HippoPanelGridsImpl::reset()
|
||||
{
|
||||
mState = NORMAL;
|
||||
mCurGrid = gHippoGridManager->getCurrentGridNick();
|
||||
loadCurGrid();
|
||||
}
|
||||
|
||||
|
||||
void HippoPanelGridsImpl::retrieveGridInfo()
|
||||
{
|
||||
std::string loginuri = childGetValue("loginuri");
|
||||
if ((loginuri == "") || (loginuri == "<required>")) {
|
||||
LLNotifications::instance().add("GridInfoNoLoginUri");
|
||||
return;
|
||||
}
|
||||
|
||||
HippoGridInfo *grid = 0;
|
||||
bool cleanupGrid = false;
|
||||
if (mState == NORMAL) {
|
||||
grid = gHippoGridManager->getGrid(mCurGrid);
|
||||
} else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
|
||||
grid = new HippoGridInfo("");
|
||||
cleanupGrid = true;
|
||||
} else {
|
||||
llerrs << "Illegal state " << mState << '.' << llendl;
|
||||
return;
|
||||
}
|
||||
if (!grid) {
|
||||
llerrs << "Internal error retrieving grid info." << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
grid->setLoginUri(loginuri);
|
||||
if (grid->retrieveGridInfo()) {
|
||||
if (grid->getGridNick() != "") childSetText("gridnick", grid->getGridNick());
|
||||
if (grid->getPlatform() != HippoGridInfo::PLATFORM_OTHER)
|
||||
getChild<LLComboBox>("platform")->setCurrentByIndex(grid->getPlatform());
|
||||
if (grid->getGridName() != "") childSetText("gridname", grid->getGridName());
|
||||
if (grid->getLoginUri() != "") childSetText("loginuri", grid->getLoginUri());
|
||||
if (grid->getLoginPage() != "") childSetText("loginpage", grid->getLoginPage());
|
||||
if (grid->getHelperUri() != "") childSetText("helperuri", grid->getHelperUri());
|
||||
if (grid->getWebSite() != "") childSetText("website", grid->getWebSite());
|
||||
if (grid->getSupportUrl() != "") childSetText("support", grid->getSupportUrl());
|
||||
if (grid->getRegisterUrl() != "") childSetText("register", grid->getRegisterUrl());
|
||||
if (grid->getPasswordUrl() != "") childSetText("password", grid->getPasswordUrl());
|
||||
//if (grid->getSearchUrl() != "") childSetText("search", grid->getSearchUrl());
|
||||
} else {
|
||||
LLNotifications::instance().add("GridInfoError");
|
||||
}
|
||||
|
||||
if (cleanupGrid) delete grid;
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
// UI callbacks
|
||||
|
||||
// static
|
||||
void HippoPanelGridsImpl::onSelectGrid(LLUICtrl* ctrl, void *data)
|
||||
{
|
||||
HippoPanelGridsImpl *self = (HippoPanelGridsImpl*)data;
|
||||
std::string newGrid = ctrl->getValue().asString();
|
||||
if (!self->saveCurGrid()) {
|
||||
// creating new grid failed
|
||||
LLComboBox *grids = self->getChild<LLComboBox>("grid_selector");
|
||||
grids->setCurrentByIndex(grids->getItemCount() - 1);
|
||||
return;
|
||||
}
|
||||
self->mCurGrid = newGrid;
|
||||
self->loadCurGrid();
|
||||
}
|
||||
|
||||
// static
|
||||
void HippoPanelGridsImpl::onSelectPlatform(LLUICtrl *ctrl, void *data)
|
||||
{
|
||||
HippoPanelGridsImpl *self = (HippoPanelGridsImpl*)data;
|
||||
self->refresh();
|
||||
}
|
||||
|
||||
// static
|
||||
void HippoPanelGridsImpl::onClickDelete(void *data)
|
||||
{
|
||||
HippoPanelGridsImpl *self = (HippoPanelGridsImpl*)data;
|
||||
if (self->mState == NORMAL)
|
||||
gHippoGridManager->deleteGrid(self->mCurGrid);
|
||||
self->reset();
|
||||
}
|
||||
|
||||
// static
|
||||
void HippoPanelGridsImpl::onClickAdd(void *data)
|
||||
{
|
||||
HippoPanelGridsImpl *self = (HippoPanelGridsImpl*)data;
|
||||
self->mState = ADD_NEW;
|
||||
self->loadCurGrid();
|
||||
}
|
||||
|
||||
// static
|
||||
void HippoPanelGridsImpl::onClickCopy(void *data)
|
||||
{
|
||||
HippoPanelGridsImpl *self = (HippoPanelGridsImpl*)data;
|
||||
if (self->mState == NORMAL) {
|
||||
self->mState = ADD_COPY;
|
||||
self->loadCurGrid();
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void HippoPanelGridsImpl::onClickDefault(void *data)
|
||||
{
|
||||
HippoPanelGridsImpl *self = (HippoPanelGridsImpl*)data;
|
||||
if (self->mState == NORMAL) {
|
||||
self->saveCurGrid();
|
||||
gHippoGridManager->setDefaultGrid(self->mCurGrid);
|
||||
self->refresh();
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void HippoPanelGridsImpl::onClickGridInfo(void *data)
|
||||
{
|
||||
HippoPanelGridsImpl *self = (HippoPanelGridsImpl*)data;
|
||||
self->retrieveGridInfo();
|
||||
}
|
||||
|
||||
// static
|
||||
void HippoPanelGridsImpl::onClickHelpRenderCompat(void *data)
|
||||
{
|
||||
LLNotifications::instance().add("HelpRenderCompat");
|
||||
}
|
||||
52
indra/newview/hippopanelgrids.h
Normal file
52
indra/newview/hippopanelgrids.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @file hippopanelgrids.h
|
||||
* @author Mana Janus
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2008, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef HIPPO_PANELGRIDS_H
|
||||
#define HIPPO_PANELGRIDS_H
|
||||
|
||||
|
||||
#include "llpanel.h"
|
||||
|
||||
|
||||
class HippoPanelGrids : public LLPanel
|
||||
{
|
||||
public:
|
||||
HippoPanelGrids();
|
||||
virtual ~HippoPanelGrids();
|
||||
|
||||
virtual void apply() = 0;
|
||||
virtual void cancel() = 0;
|
||||
|
||||
static HippoPanelGrids *create();
|
||||
};
|
||||
|
||||
|
||||
#endif // HIPPO_PANELGRIDS_H
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "hipporestrequest.h"
|
||||
@@ -22,7 +20,7 @@ static size_t curlWrite(void *ptr, size_t size, size_t nmemb, void *userData)
|
||||
}
|
||||
|
||||
|
||||
//static
|
||||
// static
|
||||
int HippoRestRequest::getBlocking(const std::string &url, std::string *result)
|
||||
{
|
||||
llinfos << "Requesting: " << url << llendl;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __HIPPO_REST_REQTUEST_H__
|
||||
#define __HIPPO_REST_REQTUEST_H__
|
||||
#ifndef __HIPPO_REST_REQUEST_H__
|
||||
#define __HIPPO_REST_REQUEST_H__
|
||||
|
||||
|
||||
#include <string>
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
class HippoRestRequest
|
||||
{
|
||||
public:
|
||||
static int getBlocking(const std::string &url, std::string *result);
|
||||
public:
|
||||
static int getBlocking(const std::string &url, std::string *result);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
#include "llappviewer.h"
|
||||
#include "llprimitive.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
#include "hippolimits.h"
|
||||
|
||||
#include "llversionviewer.h"
|
||||
#include "llfeaturemanager.h"
|
||||
#include "lluictrlfactory.h"
|
||||
@@ -485,40 +488,6 @@ static void settings_modify()
|
||||
}
|
||||
}
|
||||
|
||||
void LLAppViewer::initGridChoice()
|
||||
{
|
||||
// Load up the initial grid choice from:
|
||||
// - hard coded defaults...
|
||||
// - command line settings...
|
||||
// - if dev build, persisted settings...
|
||||
|
||||
// Set the "grid choice", this is specified by command line.
|
||||
std::string grid_choice = gSavedSettings.getString("CmdLineGridChoice");
|
||||
LLViewerLogin* vl = LLViewerLogin::getInstance();
|
||||
vl->setGridChoice(grid_choice);
|
||||
|
||||
// Load last server choice by default
|
||||
// ignored if the command line grid choice has been set
|
||||
if(grid_choice.empty() && vl->getGridChoice() != GRID_INFO_OTHER)
|
||||
{
|
||||
S32 server = gSavedSettings.getS32("ServerChoice");
|
||||
std::string custom_server = gSavedSettings.getString("CustomServer");
|
||||
server = llclamp(server, 0, (S32)GRID_INFO_COUNT - 1);
|
||||
if(server == GRID_INFO_OTHER && !custom_server.empty())
|
||||
{
|
||||
vl->setGridChoice(custom_server);
|
||||
}
|
||||
else if(server != (S32)GRID_INFO_NONE && server != GRID_INFO_OTHER)
|
||||
{
|
||||
vl->setGridChoice((EGridInfo)server);
|
||||
}
|
||||
else
|
||||
{
|
||||
vl->setGridChoice(DEFAULT_GRID_CHOICE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//virtual
|
||||
bool LLAppViewer::initSLURLHandler()
|
||||
{
|
||||
@@ -1941,7 +1910,15 @@ bool LLAppViewer::initConfiguration()
|
||||
}
|
||||
}
|
||||
|
||||
initGridChoice();
|
||||
if (!gHippoGridManager)
|
||||
{
|
||||
gHippoGridManager = new HippoGridManager();
|
||||
gHippoGridManager->init();
|
||||
}
|
||||
if (!gHippoLimits)
|
||||
{
|
||||
gHippoLimits = new HippoLimits();
|
||||
}
|
||||
|
||||
// If we have specified crash on startup, set the global so we'll trigger the crash at the right time
|
||||
if(clp.hasOption("crashonstartup"))
|
||||
|
||||
@@ -177,7 +177,6 @@ private:
|
||||
|
||||
bool initThreads(); // Initialize viewer threads, return false on failure.
|
||||
bool initConfiguration(); // Initialize settings from the command line/config file.
|
||||
void initGridChoice();
|
||||
|
||||
bool initCache(); // Initialize local client cache.
|
||||
void purgeCache(); // Clear the local cache.
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
#include "llpanelmsgs.h"
|
||||
#include "llpanelweb.h"
|
||||
#include "llpanelskins.h"
|
||||
#include "hippopanelgrids.h"
|
||||
#include "llprefschat.h"
|
||||
#include "llprefsvoice.h"
|
||||
#include "llprefsim.h"
|
||||
@@ -78,6 +79,7 @@
|
||||
#include "llkeyboard.h"
|
||||
#include "llscrollcontainer.h"
|
||||
#include "llfloaterhardwaresettings.h"
|
||||
#include "hippopanelgrids.h"
|
||||
|
||||
const S32 PREF_BORDER = 4;
|
||||
const S32 PREF_PAD = 5;
|
||||
@@ -134,6 +136,7 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def
|
||||
mAudioPanel(NULL),
|
||||
mMsgPanel(NULL),
|
||||
mSkinsPanel(NULL),
|
||||
mGridsPanel(NULL),
|
||||
mLCDPanel(NULL),
|
||||
mPrefsAscentSys(NULL),
|
||||
mPrefsAscentVan(NULL)
|
||||
@@ -196,6 +199,10 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def
|
||||
mTabContainer->addTabPanel(mSkinsPanel, mSkinsPanel->getLabel(), FALSE, onTabChanged, mTabContainer);
|
||||
mSkinsPanel->setDefaultBtn(default_btn);
|
||||
|
||||
mGridsPanel = HippoPanelGrids::create();
|
||||
mTabContainer->addTabPanel(mGridsPanel, mGridsPanel->getLabel(), FALSE, onTabChanged, mTabContainer);
|
||||
mGridsPanel->setDefaultBtn(default_btn);
|
||||
|
||||
mPrefsAscentSys = new LLPrefsAscentSys();
|
||||
mTabContainer->addTabPanel(mPrefsAscentSys->getPanel(), mPrefsAscentSys->getPanel()->getLabel(), FALSE, onTabChanged, mTabContainer);
|
||||
mPrefsAscentSys->getPanel()->setDefaultBtn(default_btn);
|
||||
@@ -263,6 +270,11 @@ LLPreferenceCore::~LLPreferenceCore()
|
||||
delete mSkinsPanel;
|
||||
mSkinsPanel = NULL;
|
||||
}
|
||||
if (mGridsPanel)
|
||||
{
|
||||
delete mGridsPanel;
|
||||
mGridsPanel = NULL;
|
||||
}
|
||||
if (mPrefsAscentSys)
|
||||
{
|
||||
delete mPrefsAscentSys;
|
||||
@@ -288,6 +300,7 @@ void LLPreferenceCore::apply()
|
||||
mPrefsIM->apply();
|
||||
mMsgPanel->apply();
|
||||
mSkinsPanel->apply();
|
||||
mGridsPanel->apply();
|
||||
mPrefsAscentSys->apply();
|
||||
mPrefsAscentVan->apply();
|
||||
|
||||
@@ -318,6 +331,7 @@ void LLPreferenceCore::cancel()
|
||||
mPrefsIM->cancel();
|
||||
mMsgPanel->cancel();
|
||||
mSkinsPanel->cancel();
|
||||
mGridsPanel->cancel();
|
||||
mPrefsAscentSys->cancel();
|
||||
mPrefsAscentVan->cancel();
|
||||
|
||||
@@ -539,3 +553,9 @@ void LLFloaterPreference::refreshEnabledGraphics()
|
||||
{
|
||||
sInstance->mPreferenceCore->refreshEnabledGraphics();
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterPreference::switchTab(S32 i)
|
||||
{
|
||||
sInstance->mPreferenceCore->getTabContainer()->selectTab(i);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "llfloater.h"
|
||||
#include "lltabcontainervertical.h"
|
||||
|
||||
class HippoPanelGrids;
|
||||
class LLPanelGeneral;
|
||||
class LLPanelInput;
|
||||
class LLPanelLCD;
|
||||
@@ -64,6 +65,8 @@ class LLPreferenceCore
|
||||
{
|
||||
|
||||
public:
|
||||
enum { TAB_GRIDS = 11 };
|
||||
|
||||
LLPreferenceCore(LLTabContainer* tab_container, LLButton * default_btn);
|
||||
~LLPreferenceCore();
|
||||
|
||||
@@ -83,6 +86,7 @@ private:
|
||||
LLTabContainer *mTabContainer;
|
||||
LLPanelGeneral *mGeneralPanel;
|
||||
LLPanelSkins *mSkinsPanel;
|
||||
HippoPanelGrids *mGridsPanel;
|
||||
LLPanelInput *mInputPanel;
|
||||
LLPanelNetwork *mNetworkPanel;
|
||||
LLPanelDisplay *mDisplayPanel;
|
||||
@@ -115,6 +119,8 @@ public:
|
||||
|
||||
// refresh all the graphics preferences menus
|
||||
static void refreshEnabledGraphics();
|
||||
|
||||
static void switchTab(S32 i);
|
||||
|
||||
protected:
|
||||
LLPreferenceCore *mPreferenceCore;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* $LicenseInfo:firstyear=2008&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2008-2009, Linden Research, Inc.
|
||||
* Copyright (c) 2008-2010, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
@@ -75,81 +75,6 @@ void LLLoginHandler::parse(const LLSD& queryMap)
|
||||
mFirstName = queryMap["first_name"].asString();
|
||||
mLastName = queryMap["last_name"].asString();
|
||||
|
||||
EGridInfo grid_choice = GRID_INFO_NONE;
|
||||
if (queryMap["grid"].asString() == "aditi")
|
||||
{
|
||||
grid_choice = GRID_INFO_ADITI;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "agni")
|
||||
{
|
||||
grid_choice = GRID_INFO_AGNI;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "siva")
|
||||
{
|
||||
grid_choice = GRID_INFO_SIVA;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "damballah")
|
||||
{
|
||||
grid_choice = GRID_INFO_DAMBALLAH;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "durga")
|
||||
{
|
||||
grid_choice = GRID_INFO_DURGA;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "shakti")
|
||||
{
|
||||
grid_choice = GRID_INFO_SHAKTI;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "soma")
|
||||
{
|
||||
grid_choice = GRID_INFO_SOMA;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "ganga")
|
||||
{
|
||||
grid_choice = GRID_INFO_GANGA;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "vaak")
|
||||
{
|
||||
grid_choice = GRID_INFO_VAAK;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "uma")
|
||||
{
|
||||
grid_choice = GRID_INFO_UMA;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "mohini")
|
||||
{
|
||||
grid_choice = GRID_INFO_MOHINI;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "yami")
|
||||
{
|
||||
grid_choice = GRID_INFO_YAMI;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "nandi")
|
||||
{
|
||||
grid_choice = GRID_INFO_NANDI;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "mitra")
|
||||
{
|
||||
grid_choice = GRID_INFO_MITRA;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "radha")
|
||||
{
|
||||
grid_choice = GRID_INFO_RADHA;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "ravi")
|
||||
{
|
||||
grid_choice = GRID_INFO_RAVI;
|
||||
}
|
||||
else if (queryMap["grid"].asString() == "aruna")
|
||||
{
|
||||
grid_choice = GRID_INFO_ARUNA;
|
||||
}
|
||||
|
||||
if(grid_choice != GRID_INFO_NONE)
|
||||
{
|
||||
LLViewerLogin::getInstance()->setGridChoice(grid_choice);
|
||||
}
|
||||
|
||||
std::string startLocation = queryMap["location"].asString();
|
||||
|
||||
if (startLocation == "specify")
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
#include "llpanelgeneral.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
#include "indra_constants.h" // for key and mask constants
|
||||
#include "llfontgl.h"
|
||||
#include "llmd5.h"
|
||||
@@ -174,15 +176,13 @@ void set_start_location(LLUICtrl* ctrl, void* data)
|
||||
// Public methods
|
||||
//---------------------------------------------------------------------------
|
||||
LLPanelLogin::LLPanelLogin(const LLRect &rect,
|
||||
BOOL show_server,
|
||||
void (*callback)(S32 option, void* user_data),
|
||||
void *cb_data)
|
||||
: LLPanel(std::string("panel_login"), LLRect(0,600,800,0), FALSE), // not bordered
|
||||
mLogoImage(),
|
||||
mCallback(callback),
|
||||
mCallbackData(cb_data),
|
||||
mHtmlAvailable( TRUE ),
|
||||
mShowServerCombo(show_server)
|
||||
mHtmlAvailable( TRUE )
|
||||
{
|
||||
setFocusRoot(TRUE);
|
||||
|
||||
@@ -298,15 +298,13 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
|
||||
|
||||
combo->setCommitCallback( &set_start_location );
|
||||
|
||||
LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
|
||||
server_choice_combo->setCommitCallback(onSelectServer);
|
||||
server_choice_combo->setFocusLostCallback(onServerComboLostFocus);
|
||||
|
||||
childSetAction("connect_btn", onClickConnect, this);
|
||||
|
||||
setDefaultBtn("connect_btn");
|
||||
|
||||
// childSetAction("quit_btn", onClickQuit, this);
|
||||
childSetAction("grids_btn", onClickGrids, this);
|
||||
childSetCommitCallback("grids_combo", onSelectGrid, this);
|
||||
|
||||
std::string channel = LL_CHANNEL;
|
||||
|
||||
@@ -353,15 +351,14 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
|
||||
web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE );
|
||||
reshape( getRect().getWidth(), getRect().getHeight(), 1 );
|
||||
|
||||
// kick off a request to grab the url manually
|
||||
gResponsePtr = LLIamHereLogin::build( this );
|
||||
updateGridCombo();
|
||||
|
||||
std::string login_page = LLViewerLogin::getInstance()->getLoginPageURI();
|
||||
if (login_page.empty())
|
||||
{
|
||||
login_page = getString( "real_url" );
|
||||
}
|
||||
LLHTTPClient::head( login_page, gResponsePtr );
|
||||
childSetVisible("create_new_account_text",
|
||||
!gHippoGridManager->getConnectedGrid()->getRegisterUrl().empty());
|
||||
childSetVisible("forgot_password_text",
|
||||
!gHippoGridManager->getConnectedGrid()->getPasswordUrl().empty());
|
||||
|
||||
loadLoginPage();
|
||||
|
||||
#if !USE_VIEWER_AUTH
|
||||
// Initialize visibility (and don't force visibility - use prefs)
|
||||
@@ -370,46 +367,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
|
||||
|
||||
}
|
||||
|
||||
// <edit>
|
||||
void LLPanelLogin::fillMAC()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LLPanelLogin::fillID0()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LLPanelLogin::fillVer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::onCheckMAC(LLUICtrl* ctrl, void* userData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::onCheckID0(LLUICtrl* ctrl, void* userData)
|
||||
{
|
||||
|
||||
}
|
||||
// static
|
||||
void LLPanelLogin::onClickMACRandom(void* userData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::onClickID0Random(void* userData)
|
||||
{
|
||||
|
||||
}
|
||||
// </edit>
|
||||
|
||||
void LLPanelLogin::setSiteIsAlive( bool alive )
|
||||
{
|
||||
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
|
||||
@@ -419,6 +376,8 @@ void LLPanelLogin::setSiteIsAlive( bool alive )
|
||||
if ( web_browser )
|
||||
{
|
||||
loadLoginPage();
|
||||
|
||||
web_browser->setVisible(true);
|
||||
|
||||
// mark as available
|
||||
mHtmlAvailable = TRUE;
|
||||
@@ -647,11 +606,10 @@ void LLPanelLogin::giveFocus()
|
||||
|
||||
// static
|
||||
void LLPanelLogin::show(const LLRect &rect,
|
||||
BOOL show_server,
|
||||
void (*callback)(S32 option, void* user_data),
|
||||
void* callback_data)
|
||||
{
|
||||
new LLPanelLogin(rect, show_server, callback, callback_data);
|
||||
new LLPanelLogin(rect, callback, callback_data);
|
||||
|
||||
if( !gFocusMgr.getKeyboardFocus() )
|
||||
{
|
||||
@@ -749,51 +707,12 @@ void LLPanelLogin::setFields(const LLSavedLoginEntry& entry, bool takeFocus)
|
||||
remember_pass_check->setValue(LLSD(true));
|
||||
}
|
||||
|
||||
LLComboBox* server_combo = sInstance->getChild<LLComboBox>("server_combo");
|
||||
if (server_combo->getSimple() != entry.getGridName()) // Avoid loops.
|
||||
{
|
||||
server_combo->setSimple(entry.getGridName()); // Same string as used in login_show().
|
||||
}
|
||||
|
||||
LLViewerLogin* vl = LLViewerLogin::getInstance();
|
||||
|
||||
if (entry.getGrid() == GRID_INFO_OTHER)
|
||||
{
|
||||
vl->setGridURI(entry.getGridURI().asString());
|
||||
vl->setHelperURI(entry.getHelperURI().asString());
|
||||
vl->setLoginPageURI(entry.getLoginPageURI().asString());
|
||||
}
|
||||
|
||||
EGridInfo entry_grid = entry.getGrid();
|
||||
|
||||
if (entry_grid == GRID_INFO_OTHER || entry_grid != vl->getGridChoice())
|
||||
{
|
||||
vl->setGridChoice(entry_grid);
|
||||
|
||||
// grid changed so show new splash screen (possibly)
|
||||
loadLoginPage();
|
||||
}
|
||||
|
||||
if (takeFocus)
|
||||
{
|
||||
giveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::addServer(const std::string& server, S32 domain_name)
|
||||
{
|
||||
if (!sInstance)
|
||||
{
|
||||
llwarns << "Attempted addServer with no login view shown" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
|
||||
combo->add(server, LLSD(domain_name) );
|
||||
combo->setCurrentByIndex(0);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::getFields(std::string *firstname,
|
||||
std::string *lastname,
|
||||
@@ -829,22 +748,6 @@ void LLPanelLogin::getFields(std::string *firstname,
|
||||
*password = sInstance->mMungedPassword;
|
||||
}
|
||||
|
||||
// static
|
||||
BOOL LLPanelLogin::isGridComboDirty()
|
||||
{
|
||||
BOOL user_picked = FALSE;
|
||||
if (!sInstance)
|
||||
{
|
||||
llwarns << "Attempted getServer with no login view shown" << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
|
||||
user_picked = combo->isDirty();
|
||||
}
|
||||
return user_picked;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::getLocation(std::string &location)
|
||||
{
|
||||
@@ -912,9 +815,6 @@ void LLPanelLogin::refreshLocation( bool force_visible )
|
||||
sInstance->childSetVisible("regionuri_edit",FALSE); // Do Not show regionuri box if legacy
|
||||
}
|
||||
|
||||
BOOL show_server = sInstance->mShowServerCombo || gSavedSettings.getBOOL("ForceShowGrid");
|
||||
sInstance->childSetVisible("server_combo", show_server);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -945,23 +845,73 @@ void LLPanelLogin::setAlwaysRefresh(bool refresh)
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelLogin::updateGridCombo()
|
||||
{
|
||||
const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
|
||||
const std::string ¤tGrid = gHippoGridManager->getCurrentGridNick();
|
||||
LLComboBox *grids = getChild<LLComboBox>("grids_combo");
|
||||
S32 selectIndex = -1, i = 0;
|
||||
grids->removeall();
|
||||
if (defaultGrid != "") {
|
||||
grids->add(defaultGrid);
|
||||
selectIndex = i++;
|
||||
}
|
||||
HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
|
||||
for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
|
||||
const std::string &grid = it->second->getGridNick();
|
||||
if (grid != defaultGrid) {
|
||||
grids->add(grid);
|
||||
if (grid == currentGrid) selectIndex = i;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (selectIndex >= 0) {
|
||||
grids->setCurrentByIndex(selectIndex);
|
||||
} else {
|
||||
grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::refreshLoginPage()
|
||||
{
|
||||
if (!sInstance || (LLStartUp::getStartupState() >= STATE_LOGIN_CLEANUP))
|
||||
return;
|
||||
|
||||
sInstance->updateGridCombo();
|
||||
|
||||
sInstance->childSetVisible("create_new_account_text",
|
||||
!gHippoGridManager->getConnectedGrid()->getRegisterUrl().empty());
|
||||
sInstance->childSetVisible("forgot_password_text",
|
||||
!gHippoGridManager->getConnectedGrid()->getPasswordUrl().empty());
|
||||
|
||||
// kick off a request to grab the url manually
|
||||
gResponsePtr = LLIamHereLogin::build(sInstance);
|
||||
|
||||
std::string login_page = "http://phoenixviewer.com/app/login/"; //gHippoGridManager->getConnectedGrid()->getLoginPage();
|
||||
if (!login_page.empty()) {
|
||||
LLHTTPClient::head(login_page, gResponsePtr);
|
||||
} else {
|
||||
sInstance->setSiteIsAlive(false);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelLogin::loadLoginPage()
|
||||
{
|
||||
if (!sInstance) return;
|
||||
|
||||
|
||||
sInstance->updateGridCombo();
|
||||
std::ostringstream oStr;
|
||||
|
||||
LLViewerLogin* vl = LLViewerLogin::getInstance();
|
||||
std::string login_page = vl->getLoginPageURI();
|
||||
std::string login_page = gHippoGridManager->getConnectedGrid()->getLoginPage();
|
||||
if (login_page.empty())
|
||||
{
|
||||
login_page = sInstance->getString( "real_url" );
|
||||
vl->setLoginPageURI(login_page);
|
||||
sInstance->setSiteIsAlive(false);
|
||||
return;
|
||||
}
|
||||
|
||||
oStr << login_page;
|
||||
|
||||
|
||||
// Use the right delimeter depending on how LLURI parses the URL
|
||||
LLURI login_page_uri = LLURI(login_page);
|
||||
std::string first_query_delimiter = "&";
|
||||
@@ -973,13 +923,12 @@ void LLPanelLogin::loadLoginPage()
|
||||
// Language
|
||||
std::string language = LLUI::getLanguage();
|
||||
oStr << first_query_delimiter<<"lang=" << language;
|
||||
|
||||
|
||||
// First Login?
|
||||
if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
|
||||
{
|
||||
oStr << "&firstlogin=TRUE";
|
||||
}
|
||||
|
||||
|
||||
std::string version = llformat("%d.%d.%d (%d)",
|
||||
LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BUILD);
|
||||
@@ -999,6 +948,25 @@ void LLPanelLogin::loadLoginPage()
|
||||
oStr << "&grid=" << curl_grid;
|
||||
curl_free(curl_grid);
|
||||
|
||||
if (gHippoGridManager->getConnectedGrid()->isSecondLife()) {
|
||||
// find second life grid from login URI
|
||||
// yes, this is heuristic, but hey, it is just to get the right login page...
|
||||
std::string tmp = gHippoGridManager->getConnectedGrid()->getLoginUri();
|
||||
int i = tmp.find(".lindenlab.com");
|
||||
if (i != std::string::npos) {
|
||||
tmp = tmp.substr(0, i);
|
||||
i = tmp.rfind('.');
|
||||
if (i == std::string::npos)
|
||||
i = tmp.rfind('/');
|
||||
if (i != std::string::npos) {
|
||||
tmp = tmp.substr(i+1);
|
||||
char* curl_grid = curl_escape(tmp.c_str(), 0);
|
||||
oStr << "&grid=" << curl_grid;
|
||||
curl_free(curl_grid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid());
|
||||
gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());
|
||||
|
||||
@@ -1131,13 +1099,6 @@ bool LLPanelLogin::getRememberLogin()
|
||||
return remember;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::selectFirstElement(void)
|
||||
{
|
||||
sInstance->getChild<LLComboBox>("server_combo")->setCurrentByIndex(0);
|
||||
LLPanelLogin::onSelectServer(NULL, NULL);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Protected methods
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -1194,6 +1155,20 @@ void LLPanelLogin::onClickNewAccount(void*)
|
||||
LLWeb::loadURLExternal( CREATE_ACCOUNT_URL );
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::onClickGrids(void*)
|
||||
{
|
||||
//LLFloaterPreference::overrideLastTab(LLPreferenceCore::TAB_GRIDS);
|
||||
LLFloaterPreference::show(NULL);
|
||||
LLFloaterPreference::switchTab(LLPreferenceCore::TAB_GRIDS);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::onSelectGrid(LLUICtrl *ctrl, void*)
|
||||
{
|
||||
gHippoGridManager->setCurrentGrid(ctrl->getValue());
|
||||
LLPanelLogin::refreshLoginPage();
|
||||
}
|
||||
|
||||
// *NOTE: This function is dead as of 2008 August. I left it here in case
|
||||
// we suddenly decide to put the Quit button back. JC
|
||||
@@ -1236,116 +1211,6 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
|
||||
{
|
||||
// *NOTE: The parameters for this method are ignored.
|
||||
|
||||
// This function is only called by one thread, so we can use a static here.
|
||||
static bool looping;
|
||||
if (looping) return;
|
||||
looping = true;
|
||||
|
||||
// LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
|
||||
// calls this method.
|
||||
|
||||
// The user twiddled with the grid choice ui.
|
||||
// apply the selection to the grid setting.
|
||||
std::string grid_name;
|
||||
S32 grid_index;
|
||||
|
||||
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
|
||||
LLSD combo_val = combo->getValue();
|
||||
|
||||
if (LLSD::TypeInteger == combo_val.type())
|
||||
{
|
||||
grid_index = combo->getValue().asInteger();
|
||||
grid_name = combo->getSimple();
|
||||
}
|
||||
else
|
||||
{
|
||||
// no valid selection, return other
|
||||
grid_index = (S32)GRID_INFO_OTHER;
|
||||
grid_name = combo_val.asString();
|
||||
}
|
||||
|
||||
// This new selection will override preset uris
|
||||
// from the command line.
|
||||
LLViewerLogin* vl = LLViewerLogin::getInstance();
|
||||
|
||||
if(grid_index != GRID_INFO_OTHER)
|
||||
{
|
||||
vl->setGridChoice((EGridInfo)grid_index);
|
||||
}
|
||||
else
|
||||
{
|
||||
vl->setGridChoice(grid_name);
|
||||
}
|
||||
|
||||
// Find a saved login entry that uses this grid, if any.
|
||||
bool found = false;
|
||||
LLSavedLoginsList const& entries = sInstance->mLoginHistoryData.getEntries();
|
||||
for (LLSavedLoginsList::const_reverse_iterator i = entries.rbegin(); i != entries.rend(); ++i)
|
||||
{
|
||||
if (!i->asLLSD().isMap())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (i->getGridName() == grid_name)
|
||||
{
|
||||
if (!vl->nameEditted())
|
||||
{
|
||||
// Change the other fields to match this grid.
|
||||
LLPanelLogin::setFields(*i, false);
|
||||
}
|
||||
else // Probably creating a new account.
|
||||
{
|
||||
// Likely the current password is for a different grid.
|
||||
clearPassword();
|
||||
}
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
clearPassword();
|
||||
|
||||
// If the grid_name starts with 'http[s]://' then
|
||||
// we have to assume it's a new loginuri, set
|
||||
// on the commandline.
|
||||
if (grid_name.substr(0, 4) == "http")
|
||||
{
|
||||
// Use it as login uri.
|
||||
vl->setGridURI(grid_name);
|
||||
// And set the login page if it was given.
|
||||
std::string loginPage = gSavedSettings.getString("LoginPage");
|
||||
std::string helperURI = gSavedSettings.getString("CmdLineHelperURI");
|
||||
if (!loginPage.empty()) vl->setLoginPageURI(loginPage);
|
||||
if (!helperURI.empty()) vl->setHelperURI(helperURI);
|
||||
}
|
||||
}
|
||||
|
||||
// grid changed so show new splash screen (possibly)
|
||||
loadLoginPage();
|
||||
|
||||
looping = false;
|
||||
}
|
||||
|
||||
void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
|
||||
{
|
||||
if( !sInstance )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
|
||||
if(fe == combo)
|
||||
{
|
||||
onSelectServer(combo, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelLogin::onLastNameEditLostFocus(LLUICtrl* ctrl, void* data)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ class LLPanelLogin:
|
||||
{
|
||||
LOG_CLASS(LLPanelLogin);
|
||||
public:
|
||||
LLPanelLogin(const LLRect &rect, BOOL show_server,
|
||||
LLPanelLogin(const LLRect &rect,
|
||||
void (*callback)(S32 option, void* user_data),
|
||||
void *callback_data);
|
||||
~LLPanelLogin();
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
virtual void draw();
|
||||
virtual void setFocus( BOOL b );
|
||||
|
||||
static void show(const LLRect &rect, BOOL show_server,
|
||||
static void show(const LLRect &rect,
|
||||
void (*callback)(S32 option, void* user_data),
|
||||
void* callback_data);
|
||||
|
||||
@@ -81,20 +81,23 @@ public:
|
||||
*/
|
||||
static void setFields(const LLSavedLoginEntry& entry, bool takeFocus = true);
|
||||
|
||||
static void addServer(const std::string& server, S32 domain_name);
|
||||
//static void addServer(const std::string& server, S32 domain_name);
|
||||
static void refreshLocation( bool force_visible );
|
||||
|
||||
static void getFields(std::string *firstname, std::string *lastname,
|
||||
std::string *password);
|
||||
|
||||
static BOOL isGridComboDirty();
|
||||
//static BOOL isGridComboDirty();
|
||||
static void getLocation(std::string &location);
|
||||
|
||||
static void close();
|
||||
|
||||
void setSiteIsAlive( bool alive );
|
||||
|
||||
void updateGridCombo();
|
||||
|
||||
static void loadLoginPage();
|
||||
static void refreshLoginPage();
|
||||
static void giveFocus();
|
||||
static void setAlwaysRefresh(bool refresh);
|
||||
static void mungePassword(LLUICtrl* caller, void* user_data);
|
||||
@@ -106,26 +109,19 @@ private:
|
||||
static void onClickConnect(void*);
|
||||
static void onClickNewAccount(void*);
|
||||
static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response);
|
||||
static void onClickGrids(void*);
|
||||
static void onSelectGrid(LLUICtrl *ctrl, void*);
|
||||
static void onClickQuit(void*);
|
||||
static void onClickVersion(void*);
|
||||
static void onClickForgotPassword(void*);
|
||||
static void onPassKey(LLLineEditor* caller, void* user_data);
|
||||
static void onSelectServer(LLUICtrl*, void*);
|
||||
static void onServerComboLostFocus(LLFocusableElement*, void*);
|
||||
//static void onSelectServer(LLUICtrl*, void*);
|
||||
//static void onServerComboLostFocus(LLFocusableElement*, void*);
|
||||
static void onLastNameEditLostFocus(LLUICtrl* ctrl, void* data);
|
||||
static void onSelectLoginEntry(LLUICtrl*, void*);
|
||||
static void onLoginComboLostFocus(LLFocusableElement* fe, void*);
|
||||
static void onNameCheckChanged(LLUICtrl* ctrl, void* data);
|
||||
static void clearPassword();
|
||||
// <edit>
|
||||
void fillMAC();
|
||||
void fillID0();
|
||||
void fillVer();
|
||||
static void onCheckMAC(LLUICtrl* ctrl, void* userData);
|
||||
static void onCheckID0(LLUICtrl* ctrl, void* userData);
|
||||
static void onClickMACRandom(void* userData);
|
||||
static void onClickID0Random(void* userData);
|
||||
// </edit>
|
||||
|
||||
public:
|
||||
/**
|
||||
@@ -148,7 +144,7 @@ public:
|
||||
*/
|
||||
static bool getRememberLogin();
|
||||
|
||||
static void selectFirstElement(void);
|
||||
//static void selectFirstElement(void);
|
||||
|
||||
private:
|
||||
LLPointer<LLUIImage> mLogoImage;
|
||||
@@ -162,7 +158,6 @@ private:
|
||||
static LLPanelLogin* sInstance;
|
||||
static BOOL sCapslockDidNotification;
|
||||
BOOL mHtmlAvailable;
|
||||
BOOL mShowServerCombo;
|
||||
|
||||
LLSavedLogins mLoginHistoryData;
|
||||
};
|
||||
|
||||
@@ -53,18 +53,10 @@ LLSavedLoginEntry::LLSavedLoginEntry(const LLSD& entry_data)
|
||||
{
|
||||
throw std::invalid_argument("Missing lastname key.");
|
||||
}
|
||||
if (!entry_data.has("grid"))
|
||||
{
|
||||
throw std::invalid_argument("Missing grid key.");
|
||||
}
|
||||
if (!entry_data.has("password"))
|
||||
{
|
||||
throw std::invalid_argument("Missing password key.");
|
||||
}
|
||||
if (!entry_data.get("grid").isInteger())
|
||||
{
|
||||
throw std::invalid_argument("grid key is not integer.");
|
||||
}
|
||||
if (!entry_data.get("firstname").isString())
|
||||
{
|
||||
throw std::invalid_argument("firstname key is not string.");
|
||||
@@ -80,34 +72,16 @@ LLSavedLoginEntry::LLSavedLoginEntry(const LLSD& entry_data)
|
||||
mEntry = entry_data;
|
||||
}
|
||||
|
||||
LLSavedLoginEntry::LLSavedLoginEntry(const EGridInfo grid,
|
||||
const std::string& firstname,
|
||||
LLSavedLoginEntry::LLSavedLoginEntry(const std::string& firstname,
|
||||
const std::string& lastname,
|
||||
const std::string& password)
|
||||
{
|
||||
mEntry.clear();
|
||||
mEntry.insert("grid", LLSD(grid));
|
||||
mEntry.insert("firstname", LLSD(firstname));
|
||||
mEntry.insert("lastname", LLSD(lastname));
|
||||
setPassword(password);
|
||||
}
|
||||
|
||||
const std::string LLSavedLoginEntry::getGridName() const
|
||||
{
|
||||
std::string gridname = "";
|
||||
if (mEntry.has("griduri") && mEntry.get("griduri").isURI())
|
||||
{
|
||||
gridname = mEntry.get("griduri").asURI().hostName();
|
||||
LLStringUtil::toLower(gridname);
|
||||
}
|
||||
else if (mEntry.has("grid"))
|
||||
{
|
||||
LLViewerLogin* login_data = LLViewerLogin::getInstance();
|
||||
gridname = login_data->getKnownGridLabel(static_cast<EGridInfo>(mEntry.get("grid").asInteger()));
|
||||
}
|
||||
return gridname;
|
||||
}
|
||||
|
||||
LLSD LLSavedLoginEntry::asLLSD() const
|
||||
{
|
||||
return mEntry;
|
||||
@@ -116,7 +90,7 @@ LLSD LLSavedLoginEntry::asLLSD() const
|
||||
const std::string LLSavedLoginEntry::getDisplayString() const
|
||||
{
|
||||
std::ostringstream etitle;
|
||||
etitle << getFirstName() << " " << getLastName() << " (" << getGridName() << ")";
|
||||
etitle << getFirstName() << " " << getLastName();
|
||||
return etitle.str();
|
||||
}
|
||||
|
||||
@@ -202,18 +176,14 @@ void LLSavedLogins::addEntry(const LLSavedLoginEntry& entry)
|
||||
mEntries.push_back(entry);
|
||||
}
|
||||
|
||||
void LLSavedLogins::deleteEntry(const EGridInfo grid,
|
||||
const std::string& firstname,
|
||||
const std::string& lastname,
|
||||
const std::string& griduri)
|
||||
void LLSavedLogins::deleteEntry(const std::string& firstname,
|
||||
const std::string& lastname)
|
||||
{
|
||||
for (LLSavedLoginsList::iterator i = mEntries.begin();
|
||||
i != mEntries.end();)
|
||||
{
|
||||
if (i->getFirstName() == firstname &&
|
||||
i->getGrid() == grid &&
|
||||
i->getLastName() == lastname &&
|
||||
(grid != GRID_INFO_OTHER || i->getGridURI().asString() == griduri))
|
||||
i->getLastName() == lastname)
|
||||
{
|
||||
i = mEntries.erase(i);
|
||||
}
|
||||
|
||||
@@ -51,76 +51,12 @@ public:
|
||||
LLSavedLoginEntry(const LLSD& entry_data);
|
||||
/**
|
||||
* @brief Constructs a history entry from individual fields.
|
||||
* @param gridinfo Grid as EGridInfo enumeration.
|
||||
* @param firstname Resident first name.
|
||||
* @param lastname Resident last name.
|
||||
* @param password Munged password of PASSWORD_HASH_LENGTH.
|
||||
*/
|
||||
LLSavedLoginEntry(const EGridInfo gridinfo, const std::string& firstname,
|
||||
LLSavedLoginEntry(const std::string& firstname,
|
||||
const std::string& lastname, const std::string& password);
|
||||
/**
|
||||
* @brief Returns the display name of the grid ID associated with this entry.
|
||||
* @return String containing grid name.
|
||||
*/
|
||||
const std::string getGridName() const;
|
||||
|
||||
/**
|
||||
* @brief Gets the grid ID associated with this entry.
|
||||
* @return EGridInfo enumeration corresponding to grid.
|
||||
*/
|
||||
const EGridInfo getGrid() const
|
||||
{
|
||||
return (mEntry.has("grid") ? static_cast<EGridInfo>(mEntry.get("grid").asInteger()) : GRID_INFO_OTHER);
|
||||
}
|
||||
/**
|
||||
* @brief Sets the grid associated with the entry.
|
||||
*/
|
||||
void setGrid(EGridInfo value)
|
||||
{
|
||||
mEntry.insert("grid", LLSD(value));
|
||||
}
|
||||
/**
|
||||
* @brief Gets the grid URI associated with the entry, if any.
|
||||
*/
|
||||
const LLURI getGridURI() const
|
||||
{
|
||||
return (getGrid() == GRID_INFO_OTHER && mEntry.has("griduri") ? mEntry.get("griduri").asURI() : LLURI());
|
||||
}
|
||||
/**
|
||||
* @brief Sets the grid URI associated with the entry.
|
||||
*/
|
||||
void setGridURI(const LLURI& uri)
|
||||
{
|
||||
mEntry.insert("griduri", uri);
|
||||
}
|
||||
/**
|
||||
* @brief Gets the login page URI associated with the entry, if any.
|
||||
*/
|
||||
const LLURI getLoginPageURI() const
|
||||
{
|
||||
return (getGrid() == GRID_INFO_OTHER && mEntry.has("loginpageuri") ? mEntry.get("loginpageuri").asURI() : LLURI());
|
||||
}
|
||||
/**
|
||||
* @brief Sets the login page URI associated with the entry.
|
||||
*/
|
||||
void setLoginPageURI(const LLURI& uri)
|
||||
{
|
||||
mEntry.insert("loginpageuri", uri);
|
||||
}
|
||||
/**
|
||||
* @brief Gets the helper URI associated with the entry, if any.
|
||||
*/
|
||||
const LLURI getHelperURI() const
|
||||
{
|
||||
return (getGrid() == GRID_INFO_OTHER && mEntry.has("helperuri") ? mEntry.get("helperuri").asURI() : LLURI());
|
||||
}
|
||||
/**
|
||||
* @brief Sets the helper URI associated with the entry.
|
||||
*/
|
||||
void setHelperURI(const LLURI& uri)
|
||||
{
|
||||
mEntry.insert("helperuri", uri);
|
||||
}
|
||||
/**
|
||||
* @brief Returns the first name associated with this login entry.
|
||||
* @return First name as string.
|
||||
@@ -210,12 +146,10 @@ public:
|
||||
void addEntry(const LLSavedLoginEntry& entry);
|
||||
/**
|
||||
* @brief Deletes a login history entry by looking up its name and grid.
|
||||
* @param grid EGridInfo enumeration of the grid.
|
||||
* @param firstname First name to find and delete.
|
||||
* @param lastname Last name to find and delete.
|
||||
* @param griduri Full URI if grid is GRID_INFO_OTHER.
|
||||
*/
|
||||
void deleteEntry(const EGridInfo grid, const std::string& firstname, const std::string& lastname, const std::string& griduri);
|
||||
void deleteEntry(const std::string& firstname, const std::string& lastname);
|
||||
/**
|
||||
* @brief Access internal vector of login entries from the history.
|
||||
* @return Const reference to internal login history storage.
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
#include "llaudioengine_openal.h"
|
||||
#endif
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
#include "hippolimits.h"
|
||||
|
||||
#include "llares.h"
|
||||
#include "llcachename.h"
|
||||
#include "llviewercontrol.h"
|
||||
@@ -257,7 +260,7 @@ EStartupState LLStartUp::gStartupState = STATE_FIRST;
|
||||
// local function declaration
|
||||
//
|
||||
|
||||
bool login_show(LLSavedLogins const& saved_logins);
|
||||
void login_show(LLSavedLogins const& saved_logins);
|
||||
void login_callback(S32 option, void* userdata);
|
||||
void show_first_run_dialog();
|
||||
bool first_run_dialog_callback(const LLSD& notification, const LLSD& response);
|
||||
@@ -493,196 +496,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// OGPX handles the agent domain seed cap response. This is the spot in the login sequence where we
|
||||
// tuck away caps that the agent domain gives us on authenticate.
|
||||
class LLAgentHostSeedCapResponder :
|
||||
public LLHTTPClient::Responder
|
||||
{
|
||||
public:
|
||||
LLAgentHostSeedCapResponder()
|
||||
{
|
||||
}
|
||||
|
||||
~LLAgentHostSeedCapResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void error(U32 statusNum, const std::string& reason)
|
||||
{
|
||||
LL_INFOS("OGPX") << "LLAgentHostSeedCapResponder error "
|
||||
<< statusNum << " " << reason << LL_ENDL;
|
||||
|
||||
login_error("Agent Domain seed cap responded with an error " + reason);
|
||||
}
|
||||
|
||||
void result(const LLSD& content)
|
||||
{
|
||||
LL_DEBUGS("OGPX") << " Response to AgentHostSeedCap: " << LLSDOStreamer<LLSDXMLFormatter>(content) << LL_ENDL;
|
||||
std::string agentEventQueue = content["capabilities"]["event_queue"].asString();
|
||||
|
||||
LL_INFOS("OGPX") << "Agent Event queue is: " << agentEventQueue << LL_ENDL;
|
||||
|
||||
LLAgentEventPoll* agentPoll;
|
||||
// OGPX TODO: should this be inside an if OGPX login type check??
|
||||
if (!agentEventQueue.empty())
|
||||
{
|
||||
// OGPX TODO: figure out how to register certain services for certain eventqueues
|
||||
// ... stated another way... we no longer trust anything from region and Agent Domain and XYZ eq
|
||||
agentPoll = new LLAgentEventPoll(agentEventQueue);
|
||||
// Note: host in eventpoll gets shoved in to message llsd in LLEventPollResponder::handleMessage
|
||||
}
|
||||
|
||||
std::string regionuri = gSavedSettings.getString("CmdLineRegionURI");
|
||||
LL_INFOS("OGPX") << "llagenthostseedcapresponder content: " << LLSDOStreamer<LLSDXMLFormatter>(content) << LL_ENDL;
|
||||
// Can't we assume OGP only inside the agent seed cap responder?
|
||||
if (!regionuri.empty()&& gSavedSettings.getBOOL("OpenGridProtocol") )
|
||||
{
|
||||
// OGPX WFID grab the WFID cap (now called the agent/inventory cap) and skeleton cap
|
||||
gAgent.setCapability("agent/inventory",content["capabilities"]["agent/inventory"].asString());
|
||||
|
||||
//This allows both old and new namings for this cap. Moving towards underscore
|
||||
if ( content["capabilities"]["agent/inventory-skeleton"].isDefined())
|
||||
{
|
||||
gAgent.setCapability("agent/inventory_skeleton",content["capabilities"]["agent/inventory-skeleton"].asString());
|
||||
} else if ( content["capabilities"]["agent/inventory_skeleton"].isDefined())
|
||||
{
|
||||
gAgent.setCapability("agent/inventory_skeleton",content["capabilities"]["agent/inventory_skeleton"].asString());
|
||||
}
|
||||
gAgent.setCapability("agent/inventory_library",content["capabilities"]["agent/inventory_library"].asString());
|
||||
gAgent.setCapability("agent/inventory_library_skeleton",content["capabilities"]["agent/inventory_library_skeleton"].asString());
|
||||
std::string placeAvatarCap = content["capabilities"]["rez_avatar/place"].asString();
|
||||
LLSD args;
|
||||
|
||||
// OGPX TODO: Q: aren't we in an OGPX only block? If so, we shouldn't be trying to parse the LLURLSimString
|
||||
if (LLURLSimString::parse())
|
||||
{
|
||||
args["position"] = ll_sd_from_vector3(LLVector3(LLURLSimString::sInstance.mX, LLURLSimString::sInstance.mY, LLURLSimString::sInstance.mZ));
|
||||
}
|
||||
else
|
||||
{
|
||||
// OGPX : we don't currently have the /X/Y/Z semantics in our regionuris, so initial login always requests center
|
||||
// OGPX TODO: note that we could add X Y Z UI controls to the login panel and TP floater, or add logic to cope
|
||||
// with X/Y/Z being on the URI, if OGPX decides that is valid.
|
||||
args["position"] = ll_sd_from_vector3(LLVector3(128, 128, 128));
|
||||
}
|
||||
|
||||
args["public_region_seed_capability"] = regionuri;
|
||||
|
||||
if (placeAvatarCap.empty())
|
||||
{
|
||||
llwarns << "PlaceAvatarLogin capability not returned" << llendl;
|
||||
LL_INFOS("OGPX") << " agenthostseedcap content: " << LLSDOStreamer<LLSDXMLFormatter>(content) << LL_ENDL;
|
||||
login_error("Agent Domain didn't return a rez_avatar/place cap");
|
||||
}
|
||||
else
|
||||
{
|
||||
LLAppViewer::instance()->setPlaceAvatarCap(placeAvatarCap); // save so it can be used on tp
|
||||
LLHTTPClient::post(placeAvatarCap, args, new LLPlaceAvatarLoginResponder());
|
||||
LL_INFOS("OGPX") << " args to placeavatar on login: " << LLSDOStreamer<LLSDXMLFormatter>(args) << LL_ENDL;
|
||||
// we should have gotten back both rez_avatar/place and agent/info
|
||||
// TODO: do a GET here using "agent/info" seed cap after agent domain implements it.
|
||||
// after we are successfully getting agent,session,securesession via "agent/info"
|
||||
// we need to change login and teleport placeavatarresponders to not look for those
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Q: Is this leftover LLSD login path code? c'est possible, but i'm not sure.
|
||||
std::string legacyLoginCap = content["capabilities"]["legacy_login"].asString();
|
||||
if (legacyLoginCap.empty())
|
||||
{
|
||||
llwarns << "LegacyLogin capability not returned" << llendl;
|
||||
login_error("No Legacy login seed cap returned");
|
||||
}
|
||||
else
|
||||
{
|
||||
LLViewerLogin::getInstance()->setGridURIs(LLSRV::rewriteURI(content["capabilities"]["legacy_login"].asString()));
|
||||
LLStartUp::setStartupState(STATE_XMLRPC_LEGACY_LOGIN);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class LLAgentHostAuthResponder :
|
||||
public LLHTTPClient::Responder
|
||||
{
|
||||
public:
|
||||
LLAgentHostAuthResponder()
|
||||
{
|
||||
}
|
||||
|
||||
~LLAgentHostAuthResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void completed(U32 status, const std::string& reason, const LLSD& content) {
|
||||
|
||||
LL_INFOS("OGPX") << " Response From AgentHostAuth: " << LLSDOStreamer<LLSDXMLFormatter>(content) << LL_ENDL;
|
||||
if (content.has("authenticated") && (content["authenticated"].asBoolean() == true))
|
||||
{
|
||||
|
||||
if (content.has("agent_seed_capability"))
|
||||
{
|
||||
LLSD args;
|
||||
|
||||
// make sure content["agent_seed_capability"].asString() is a url
|
||||
|
||||
args["capabilities"]["event_queue"] = true;
|
||||
|
||||
if (gSavedSettings.getBOOL("OpenGridProtocol"))
|
||||
{
|
||||
args["capabilities"]["rez_avatar/place"] = true; // place_avatar
|
||||
args["capabilities"]["agent/info"] = true;
|
||||
args["capabilities"]["agent/inventory-skeleton"] = true;
|
||||
args["capabilities"]["agent/inventory_skeleton"] = true; //allow both namings for now
|
||||
args["capabilities"]["agent/inventory_library"] = true; //new name for FetchLibDescendents
|
||||
args["capabilities"]["agent/inventory_library_skeleton"] = true;
|
||||
args["capabilities"]["agent/inventory"] = true; // OGPX get from Agent Domain was WebFetchInventoryDescendents
|
||||
}
|
||||
else
|
||||
{
|
||||
// OGPX is this leftover LLSD login cruft?
|
||||
args["capabilities"]["legacy_login"] = true;
|
||||
}
|
||||
|
||||
LL_INFOS("OGPX") << "completedHeader content: " << LLSDOStreamer<LLSDXMLFormatter>(content) << LL_ENDL;
|
||||
LL_INFOS("OGPX") << " Post to AgentHostSeed Cap: " << LLSDOStreamer<LLSDXMLFormatter>(args) << LL_ENDL;
|
||||
LLHTTPClient::post(content["agent_seed_capability"].asString(), args, new LLAgentHostSeedCapResponder());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (content["reason"].asString() == "tos")
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "Need tos agreement" << LL_ENDL;
|
||||
LLStartUp::setStartupState( STATE_UPDATE_CHECK );
|
||||
LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_TOS,
|
||||
content["message"].asString());
|
||||
tos_dialog->startModal();
|
||||
return;
|
||||
}
|
||||
|
||||
if (content["reason"].asString() == "critical")
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "Need critical message" << LL_ENDL;
|
||||
LLStartUp::setStartupState( STATE_UPDATE_CHECK );
|
||||
LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_CRITICAL_MESSAGE,
|
||||
content["message"].asString());
|
||||
tos_dialog->startModal();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LL_INFOS("OGPX") << "LLAgentHostAuthResponder error " << status << " " << reason << LL_ENDL;
|
||||
LL_DEBUGS("OGPX") << "completedHeader content: " << LLSDOStreamer<LLSDXMLFormatter>(content) << LL_ENDL;
|
||||
login_error(reason+" "+content["reason"].asString()+": "+content["message"].asString());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data)
|
||||
{
|
||||
LLNameListCtrl::refreshAll(id, firstname, lastname, is_group);
|
||||
@@ -1252,19 +1065,13 @@ bool idle_startup()
|
||||
gViewerWindow->setShowProgress(FALSE);
|
||||
|
||||
// Load login history
|
||||
std::string login_hist_filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins.xml");
|
||||
std::string login_hist_filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg1.xml");
|
||||
LLSavedLogins login_history = LLSavedLogins::loadFile(login_hist_filepath);
|
||||
|
||||
// Show the login dialog.
|
||||
bool have_loginuri = login_show(login_history);
|
||||
login_show(login_history);
|
||||
|
||||
// Connect dialog is already shown, so fill in the names
|
||||
if (have_loginuri)
|
||||
{
|
||||
// We have a commandline -loginuri that was not recognized. Select it.
|
||||
LLPanelLogin::selectFirstElement();
|
||||
}
|
||||
else if (login_history.size() > 0)
|
||||
if (login_history.size() > 0)
|
||||
{
|
||||
LLPanelLogin::setFields(*login_history.getEntries().rbegin());
|
||||
}
|
||||
@@ -1377,6 +1184,9 @@ bool idle_startup()
|
||||
LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << LL_ENDL;
|
||||
gDebugInfo["LoginName"] = firstname + " " + lastname;
|
||||
}
|
||||
|
||||
gHippoGridManager->setCurrentGridAsConnected();
|
||||
gHippoLimits->setLimits();
|
||||
|
||||
// create necessary directories
|
||||
// *FIX: these mkdir's should error check
|
||||
@@ -1666,15 +1476,6 @@ bool idle_startup()
|
||||
LLViewerLogin* vl = LLViewerLogin::getInstance();
|
||||
std::string grid_uri = vl->getCurrentGridURI();
|
||||
|
||||
LL_INFOS("OGPX") << " URI to POST to : " << grid_uri << LL_ENDL;
|
||||
|
||||
LL_INFOS("OGPX") << " Post to AgentHostAuth: " << LLSDOStreamer<LLSDXMLFormatter>(args) << LL_ENDL;
|
||||
LLHTTPClient::post(
|
||||
grid_uri,
|
||||
args,
|
||||
new LLAgentHostAuthResponder()
|
||||
);
|
||||
|
||||
gAcceptTOS = FALSE;
|
||||
gAcceptCriticalMessage = FALSE;
|
||||
|
||||
@@ -1786,6 +1587,14 @@ bool idle_startup()
|
||||
// reset globals
|
||||
gAcceptTOS = FALSE;
|
||||
gAcceptCriticalMessage = FALSE;
|
||||
/*std::string temp_uri = sAuthUris[sAuthUriNum];
|
||||
LLStringUtil::toLower(temp_uri);
|
||||
// detect SecondLife and force platform setting
|
||||
if (temp_uri.find("aditi") != std::string::npos ||
|
||||
temp_uri.find("agni") != std::string::npos ||
|
||||
temp_uri.find("://216.82.") != std::string::npos)
|
||||
gHippoGridManager->getCurrentGrid()->setPlatform(HippoGridInfo::PLATFORM_SECONDLIFE);
|
||||
*/
|
||||
LLStartUp::setStartupState( STATE_LOGIN_NO_DATA_YET );
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1867,34 +1676,6 @@ bool idle_startup()
|
||||
// Yay, login!
|
||||
successful_login = true;
|
||||
}
|
||||
else if (login_response == "indeterminate") // OGPX : this is XML-RPC auth only, PlaceAV bails with alert if not successful
|
||||
{
|
||||
LL_INFOS("AppInit") << "Indeterminate login..." << LL_ENDL;
|
||||
LLViewerLogin::getInstance()->setGridURIs(LLSRV::rewriteURI(LLUserAuth::getInstance()->getResponse("next_url")));
|
||||
|
||||
auth_method = LLUserAuth::getInstance()->getResponse("next_method");
|
||||
auth_message = LLUserAuth::getInstance()->getResponse("message");
|
||||
if(auth_method.substr(0, 5) == "login")
|
||||
{
|
||||
auth_desc.assign(LLTrans::getString("LoginAuthenticating"));
|
||||
}
|
||||
else
|
||||
{
|
||||
auth_desc.assign(LLTrans::getString("LoginMaintenance"));
|
||||
}
|
||||
// ignoring the duration & options array for now.
|
||||
// Go back to authenticate.
|
||||
// OGPX hijacks AUTHENTICATE state, and XMLRPC uses XMLRPC_LEGACY
|
||||
if (gSavedSettings.getBOOL("OpenGridProtocol"))
|
||||
{
|
||||
LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE );
|
||||
}
|
||||
else
|
||||
{
|
||||
LLStartUp::setStartupState( STATE_XMLRPC_LEGACY_LOGIN );
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
emsg << "Login failed.\n";
|
||||
@@ -2271,25 +2052,13 @@ bool idle_startup()
|
||||
|
||||
{
|
||||
// Save the login history data to disk
|
||||
std::string history_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins.xml");
|
||||
std::string history_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg1.xml");
|
||||
|
||||
LLSavedLogins history_data = LLSavedLogins::loadFile(history_file);
|
||||
LLViewerLogin* login_data = LLViewerLogin::getInstance();
|
||||
EGridInfo grid_choice = login_data->getGridChoice();
|
||||
history_data.deleteEntry(grid_choice, firstname, lastname, login_data->getCurrentGridURI());
|
||||
history_data.deleteEntry(firstname, lastname);
|
||||
if (gSavedSettings.getBOOL("RememberLogin"))
|
||||
{
|
||||
LLSavedLoginEntry login_entry(grid_choice, firstname, lastname, password);
|
||||
if (grid_choice == GRID_INFO_OTHER)
|
||||
{
|
||||
std::string grid_uri = login_data->getCurrentGridURI();
|
||||
std::string login_uri = login_data->getLoginPageURI();
|
||||
std::string helper_uri = login_data->getHelperURI();
|
||||
|
||||
if (!grid_uri.empty()) login_entry.setGridURI(LLURI(grid_uri));
|
||||
if (!login_uri.empty()) login_entry.setLoginPageURI(LLURI(login_uri));
|
||||
if (!helper_uri.empty()) login_entry.setHelperURI(LLURI(helper_uri));
|
||||
}
|
||||
LLSavedLoginEntry login_entry(firstname, lastname, password);
|
||||
history_data.addEntry(login_entry);
|
||||
}
|
||||
else
|
||||
@@ -2479,22 +2248,56 @@ bool idle_startup()
|
||||
}
|
||||
}
|
||||
|
||||
std::string max_agent_groups = LLUserAuth::getInstance()->getResponse("max-agent-groups");
|
||||
if (!max_agent_groups.empty())
|
||||
{
|
||||
gMaxAgentGroups = atoi(max_agent_groups.c_str());
|
||||
LL_INFOS("LLStartup") << "gMaxAgentGroups read from login.cgi: " << gMaxAgentGroups << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
gMaxAgentGroups = DEFAULT_MAX_AGENT_GROUPS;
|
||||
}
|
||||
|
||||
std::string map_server_url = LLUserAuth::getInstance()->getResponse("map-server-url");
|
||||
if(!map_server_url.empty())
|
||||
{
|
||||
gSavedSettings.setString("MapServerURL", map_server_url);
|
||||
}
|
||||
|
||||
// Override grid info with anything sent in the login response
|
||||
std::string tmp = LLUserAuth::getInstance()->getResponse("gridname");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("loginuri");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("welcome");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("loginpage");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("economy");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("helperuri");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("about");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("website");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("help");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("support");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("register");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("account");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("password");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("search");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("currency");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("real_currency");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
|
||||
tmp = LLUserAuth::getInstance()->getResponse("directory_fee");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str()));
|
||||
tmp = LLUserAuth::getInstance()->getResponse("max_groups");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
|
||||
tmp = LLUserAuth::getInstance()->getResponse("max-agent-groups");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
|
||||
tmp = LLUserAuth::getInstance()->getResponse("VoiceConnector");
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setVoiceConnector(tmp);
|
||||
gHippoGridManager->saveFile();
|
||||
gHippoLimits->setLimits();
|
||||
|
||||
}
|
||||
|
||||
// OGPX : successful login path common to OGP and XML-RPC
|
||||
@@ -3602,26 +3405,13 @@ bool idle_startup()
|
||||
// local function definition
|
||||
//
|
||||
|
||||
bool login_show(LLSavedLogins const& saved_logins)
|
||||
void login_show(LLSavedLogins const& saved_logins)
|
||||
{
|
||||
LL_INFOS("AppInit") << "Initializing Login Screen" << LL_ENDL;
|
||||
|
||||
// Show server combo if there is a grid in saved_logins that isn't agni.
|
||||
BOOL show_server = FALSE;
|
||||
LLSavedLoginsList const& saved_login_entries = saved_logins.getEntries();
|
||||
for (std::list<LLSavedLoginEntry>::const_iterator iter = saved_login_entries.begin();
|
||||
iter != saved_login_entries.end(); ++iter)
|
||||
{
|
||||
if (iter->getGrid() != GRID_INFO_AGNI)
|
||||
{
|
||||
show_server = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This creates the LLPanelLogin instance.
|
||||
LLPanelLogin::show( gViewerWindow->getVirtualWindowRect(),
|
||||
show_server,
|
||||
login_callback, NULL );
|
||||
|
||||
// Now that the LLPanelLogin instance is created,
|
||||
@@ -3629,71 +3419,6 @@ bool login_show(LLSavedLogins const& saved_logins)
|
||||
LLPanelLogin::setLoginHistory(saved_logins);
|
||||
|
||||
// UI textures have been previously loaded in doPreloadImages()
|
||||
|
||||
LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL;
|
||||
|
||||
// Remember which servers are already listed.
|
||||
std::set<EGridInfo> listed;
|
||||
std::set<std::string> listed_name; // Only the 'other' grids.
|
||||
|
||||
// Add the commandline -loginuri's to the list at the top.
|
||||
bool have_loginuri = false;
|
||||
LLViewerLogin* vl = LLViewerLogin::getInstance();
|
||||
std::vector<std::string> const& commandLineURIs(vl->getCommandLineURIs());
|
||||
for (std::vector<std::string>::const_iterator iter = commandLineURIs.begin(); iter != commandLineURIs.end(); ++iter)
|
||||
{
|
||||
LLURI cli_uri(*iter);
|
||||
std::string cli_grid_name = cli_uri.hostName();
|
||||
LLStringUtil::toLower(cli_grid_name);
|
||||
if (listed_name.insert(cli_grid_name).second)
|
||||
{
|
||||
// If the loginuri already exists in the saved logins
|
||||
// then use just it's name, otherwise show the full uri.
|
||||
bool exists = false;
|
||||
for (LLSavedLoginsList::const_iterator saved_login_iter = saved_login_entries.begin();
|
||||
saved_login_iter != saved_login_entries.end(); ++saved_login_iter)
|
||||
{
|
||||
if (saved_login_iter->getGridName() == cli_grid_name)
|
||||
{
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
LLPanelLogin::addServer(exists ? cli_grid_name : *iter, GRID_INFO_OTHER);
|
||||
have_loginuri = true; // Causes the first server to be added here to be selected.
|
||||
}
|
||||
}
|
||||
// Only look at the name for 'other' grids.
|
||||
listed.insert(GRID_INFO_OTHER);
|
||||
|
||||
// Add the saved logins, last used grids first.
|
||||
for (LLSavedLoginsList::const_reverse_iterator saved_login_iter = saved_login_entries.rbegin();
|
||||
saved_login_iter != saved_login_entries.rend(); ++saved_login_iter)
|
||||
{
|
||||
LLSavedLoginEntry const& entry = *saved_login_iter;
|
||||
EGridInfo grid_index = entry.getGrid();
|
||||
std::string grid_name = entry.getGridName();
|
||||
// Only show non-duplicate entries. Duplicate entries can occur for ALTs.
|
||||
if (listed.insert(grid_index).second ||
|
||||
(grid_index == GRID_INFO_OTHER && listed_name.insert(grid_name).second))
|
||||
{
|
||||
LLPanelLogin::addServer(grid_name, grid_index);
|
||||
}
|
||||
}
|
||||
|
||||
// Finally show the other (mostly LL internal) Linden servers.
|
||||
for(int grid_index = GRID_INFO_ADITI; grid_index < GRID_INFO_OTHER; ++grid_index)
|
||||
{
|
||||
if (listed.find((EGridInfo)grid_index) == listed.end())
|
||||
{
|
||||
LLPanelLogin::addServer(vl->getKnownGridLabel((EGridInfo)grid_index), grid_index);
|
||||
}
|
||||
}
|
||||
|
||||
// Remember that the user didn't change anything yet.
|
||||
vl->setNameEditted(false);
|
||||
|
||||
return have_loginuri;
|
||||
}
|
||||
|
||||
// Callback for when login screen is closed. Option 0 = connect, option 1 = quit.
|
||||
@@ -3845,7 +3570,12 @@ bool first_run_dialog_callback(const LLSD& notification, const LLSD& response)
|
||||
if (0 == option)
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL;
|
||||
LLWeb::loadURL( CREATE_ACCOUNT_URL );
|
||||
const std::string &url = gHippoGridManager->getConnectedGrid()->getRegisterUrl();
|
||||
if (!url.empty()) {
|
||||
LLWeb::loadURL(url);
|
||||
} else {
|
||||
llwarns << "Account creation URL is empty" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
LLPanelLogin::giveFocus();
|
||||
@@ -3892,9 +3622,12 @@ bool login_alert_status(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
case 0: // OK
|
||||
break;
|
||||
case 1: // Help
|
||||
LLWeb::loadURL( SUPPORT_URL );
|
||||
case 1: // Help
|
||||
{
|
||||
const std::string &url = gHippoGridManager->getConnectedGrid()->getSupportUrl();
|
||||
if (!url.empty()) LLWeb::loadURL(url);
|
||||
break;
|
||||
}
|
||||
case 2: // Teleport
|
||||
// Restart the login process, starting at our home locaton
|
||||
LLURLSimString::setString(LLURLSimString::sLocationStringHome);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
/**
|
||||
* @file llviewernetwork.cpp
|
||||
* @author James Cook, Richard Nelson
|
||||
* @brief Networking constants and globals for viewer.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2006-2009, Linden Research, Inc.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2006-2010, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
@@ -14,17 +14,17 @@
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
@@ -36,370 +36,47 @@
|
||||
#include "llviewernetwork.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
||||
struct LLGridData
|
||||
{
|
||||
const char* mLabel;
|
||||
const char* mName;
|
||||
const char* mGridURI;
|
||||
const char* mHelperURI;
|
||||
};
|
||||
|
||||
static LLGridData gGridInfo[GRID_INFO_COUNT] =
|
||||
{
|
||||
{ "None", "", "", ""},
|
||||
{ "Aditi",
|
||||
"util.aditi.lindenlab.com",
|
||||
"https://login.aditi.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://aditi-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Agni",
|
||||
"util.agni.lindenlab.com",
|
||||
"https://login.agni.lindenlab.com/cgi-bin/login.cgi",
|
||||
"https://secondlife.com/helpers/" },
|
||||
{ "Aruna",
|
||||
"util.aruna.lindenlab.com",
|
||||
"https://login.aruna.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://aruna-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Bharati",
|
||||
"util.bharati.lindenlab.com",
|
||||
"https://login.bharati.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://bharati-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Chandra",
|
||||
"util.chandra.lindenlab.com",
|
||||
"https://login.chandra.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://chandra-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Damballah",
|
||||
"util.damballah.lindenlab.com",
|
||||
"https://login.damballah.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://damballah-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Danu",
|
||||
"util.danu.lindenlab.com",
|
||||
"https://login.danu.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://danu-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Durga",
|
||||
"util.durga.lindenlab.com",
|
||||
"https://login.durga.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://durga-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Ganga",
|
||||
"util.ganga.lindenlab.com",
|
||||
"https://login.ganga.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://ganga-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Mitra",
|
||||
"util.mitra.lindenlab.com",
|
||||
"https://login.mitra.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://mitra-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Mohini",
|
||||
"util.mohini.lindenlab.com",
|
||||
"https://login.mohini.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://mohini-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Nandi",
|
||||
"util.nandi.lindenlab.com",
|
||||
"https://login.nandi.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://nandi-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Parvati",
|
||||
"util.parvati.lindenlab.com",
|
||||
"https://login.parvati.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://parvati-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Radha",
|
||||
"util.radha.lindenlab.com",
|
||||
"https://login.radha.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://radha-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Ravi",
|
||||
"util.ravi.lindenlab.com",
|
||||
"https://login.ravi.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://ravi-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Siva",
|
||||
"util.siva.lindenlab.com",
|
||||
"https://login.siva.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://siva-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Shakti",
|
||||
"util.shakti.lindenlab.com",
|
||||
"https://login.shakti.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://shakti-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Skanda",
|
||||
"util.skanda.lindenlab.com",
|
||||
"https://login.skanda.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://skanda-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Soma",
|
||||
"util.soma.lindenlab.com",
|
||||
"https://login.soma.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://soma-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Uma",
|
||||
"util.uma.lindenlab.com",
|
||||
"https://login.uma.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://uma-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Vaak",
|
||||
"util.vaak.lindenlab.com",
|
||||
"https://login.vaak.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://vaak-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Yami",
|
||||
"util.yami.lindenlab.com",
|
||||
"https://login.yami.lindenlab.com/cgi-bin/login.cgi",
|
||||
"http://yami-secondlife.webdev.lindenlab.com/helpers/" },
|
||||
{ "Local",
|
||||
"localhost",
|
||||
"https://login.dmz.lindenlab.com/cgi-bin/login.cgi",
|
||||
"" },
|
||||
{ "Other",
|
||||
"",
|
||||
"https://login.dmz.lindenlab.com/cgi-bin/login.cgi",
|
||||
"" }
|
||||
};
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */
|
||||
|
||||
LLViewerLogin::LLViewerLogin() :
|
||||
mGridChoice(DEFAULT_GRID_CHOICE),
|
||||
mCurrentURI(0),
|
||||
mNameEditted(false)
|
||||
{
|
||||
parseCommandLineURIs();
|
||||
|
||||
const std::string LLViewerLogin::getCurrentGridURI() {
|
||||
return gHippoGridManager->getConnectedGrid()->getLoginUri();
|
||||
}
|
||||
|
||||
void LLViewerLogin::setGridChoice(EGridInfo grid)
|
||||
{
|
||||
if(grid < 0 || grid >= GRID_INFO_COUNT)
|
||||
{
|
||||
llerrs << "Invalid grid index specified." << llendl;
|
||||
void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
|
||||
{
|
||||
uris.push_back(gHippoGridManager->getConnectedGrid()->getLoginUri());
|
||||
}
|
||||
|
||||
const std::string &LLViewerLogin::getGridLabel() const
|
||||
{
|
||||
return gHippoGridManager->getConnectedGrid()->getGridNick();
|
||||
}
|
||||
|
||||
const std::string &LLViewerLogin::getLoginPage() const
|
||||
{
|
||||
return gHippoGridManager->getConnectedGrid()->getLoginPage();
|
||||
}
|
||||
|
||||
const std::string &LLViewerLogin::getHelperURI() const
|
||||
{
|
||||
return gHippoGridManager->getConnectedGrid()->getHelperUri();
|
||||
}
|
||||
|
||||
mGridChoice = grid;
|
||||
if(GRID_INFO_LOCAL == mGridChoice)
|
||||
{
|
||||
mGridName = LOOPBACK_ADDRESS_STRING;
|
||||
}
|
||||
else if (GRID_INFO_OTHER == mGridChoice)
|
||||
{
|
||||
// *FIX:Mani - could this possibly be valid?
|
||||
mGridName = "other";
|
||||
}
|
||||
else
|
||||
{
|
||||
mGridName = gGridInfo[mGridChoice].mLabel;
|
||||
setGridURI(getStaticGridURI(grid));
|
||||
setHelperURI(getStaticGridHelperURI(grid));
|
||||
setLoginPageURI(std::string());
|
||||
}
|
||||
|
||||
gSavedSettings.setS32("ServerChoice", mGridChoice);
|
||||
gSavedSettings.setString("CustomServer", "");
|
||||
bool LLViewerLogin::isOpenSimulator()
|
||||
{
|
||||
return gHippoGridManager->getConnectedGrid()->isOpenSimulator();
|
||||
}
|
||||
|
||||
void LLViewerLogin::setGridChoice(const std::string& grid_name)
|
||||
bool LLViewerLogin::isSecondLife()
|
||||
{
|
||||
// Set the grid choice based on a string.
|
||||
// The string can be:
|
||||
// - a grid label from the gGridInfo table
|
||||
// - an ip address
|
||||
if(!grid_name.empty())
|
||||
{
|
||||
// find the grid choice from the user setting.
|
||||
int grid_index = GRID_INFO_NONE;
|
||||
for(;grid_index < GRID_INFO_OTHER; ++grid_index)
|
||||
{
|
||||
if(0 == LLStringUtil::compareInsensitive(gGridInfo[grid_index].mLabel, grid_name))
|
||||
{
|
||||
// Founding a matching label in the list...
|
||||
setGridChoice((EGridInfo)grid_index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(GRID_INFO_OTHER == grid_index)
|
||||
{
|
||||
// *FIX:MEP Can and should we validate that this is an IP address?
|
||||
mGridChoice = GRID_INFO_OTHER;
|
||||
mGridName = grid_name;
|
||||
gSavedSettings.setS32("ServerChoice", mGridChoice);
|
||||
gSavedSettings.setString("CustomServer", mGridName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerLogin::setGridURI(const std::string& uri)
|
||||
{
|
||||
std::vector<std::string> uri_list;
|
||||
uri_list.push_back(uri);
|
||||
setGridURIs(uri_list);
|
||||
}
|
||||
|
||||
void LLViewerLogin::setGridURIs(const std::vector<std::string>& urilist)
|
||||
{
|
||||
mGridURIs.clear();
|
||||
mGridURIs.insert(mGridURIs.begin(), urilist.begin(), urilist.end());
|
||||
mCurrentURI = 0;
|
||||
}
|
||||
|
||||
EGridInfo LLViewerLogin::getGridChoice() const
|
||||
{
|
||||
return mGridChoice;
|
||||
}
|
||||
|
||||
std::string LLViewerLogin::getGridLabel()
|
||||
{
|
||||
if(mGridChoice == GRID_INFO_NONE)
|
||||
{
|
||||
return "None";
|
||||
}
|
||||
else if(mGridChoice < GRID_INFO_OTHER)
|
||||
{
|
||||
return gGridInfo[mGridChoice].mLabel;
|
||||
}
|
||||
else if (!mGridName.empty())
|
||||
{
|
||||
return mGridName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return LLURI(getCurrentGridURI()).hostName();
|
||||
}
|
||||
}
|
||||
|
||||
std::string LLViewerLogin::getKnownGridLabel(EGridInfo grid_index) const
|
||||
{
|
||||
if(grid_index > GRID_INFO_NONE && grid_index < GRID_INFO_OTHER)
|
||||
{
|
||||
return gGridInfo[grid_index].mLabel;
|
||||
}
|
||||
return gGridInfo[GRID_INFO_NONE].mLabel;
|
||||
}
|
||||
|
||||
const std::vector<std::string>& LLViewerLogin::getCommandLineURIs()
|
||||
{
|
||||
return mCommandLineURIs;
|
||||
}
|
||||
|
||||
const std::vector<std::string>& LLViewerLogin::getGridURIs()
|
||||
{
|
||||
return mGridURIs;
|
||||
}
|
||||
|
||||
void LLViewerLogin::parseCommandLineURIs()
|
||||
{
|
||||
// return the login uri set on the command line.
|
||||
LLControlVariable* c = gSavedSettings.getControl("CmdLineLoginURI");
|
||||
if(c)
|
||||
{
|
||||
LLSD v = c->getValue();
|
||||
if (!v.isUndefined())
|
||||
{
|
||||
bool foundRealURI = false;
|
||||
if(v.isArray())
|
||||
{
|
||||
for(LLSD::array_const_iterator itr = v.beginArray();
|
||||
itr != v.endArray(); ++itr)
|
||||
{
|
||||
std::string uri = itr->asString();
|
||||
if(!uri.empty())
|
||||
{
|
||||
foundRealURI = true;
|
||||
mCommandLineURIs.push_back(uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (v.isString())
|
||||
{
|
||||
std::string uri = v.asString();
|
||||
if(!uri.empty())
|
||||
{
|
||||
foundRealURI = true;
|
||||
mCommandLineURIs.push_back(uri);
|
||||
}
|
||||
}
|
||||
|
||||
if (foundRealURI)
|
||||
{
|
||||
mGridChoice = GRID_INFO_OTHER;
|
||||
mCurrentURI = 0;
|
||||
mGridName = getGridLabel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setLoginPageURI(gSavedSettings.getString("LoginPage"));
|
||||
setHelperURI(gSavedSettings.getString("CmdLineHelperURI"));
|
||||
}
|
||||
|
||||
const std::string LLViewerLogin::getCurrentGridURI()
|
||||
{
|
||||
return (((int)(mGridURIs.size()) > mCurrentURI) ? mGridURIs[mCurrentURI] : std::string());
|
||||
}
|
||||
|
||||
bool LLViewerLogin::tryNextURI()
|
||||
{
|
||||
if (++mCurrentURI < (int)(mGridURIs.size()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mCurrentURI = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const std::string LLViewerLogin::getStaticGridHelperURI(const EGridInfo grid) const
|
||||
{
|
||||
std::string helper_uri;
|
||||
// grab URI from selected grid
|
||||
if(grid > GRID_INFO_NONE && grid < GRID_INFO_OTHER)
|
||||
{
|
||||
helper_uri = gGridInfo[grid].mHelperURI;
|
||||
}
|
||||
|
||||
if (helper_uri.empty())
|
||||
{
|
||||
// what do we do with unnamed/miscellaneous grids?
|
||||
// for now, operations that rely on the helper URI (currency/land purchasing) will fail
|
||||
}
|
||||
return helper_uri;
|
||||
}
|
||||
|
||||
const std::string LLViewerLogin::getHelperURI() const
|
||||
{
|
||||
return mHelperURI;
|
||||
}
|
||||
|
||||
void LLViewerLogin::setHelperURI(const std::string& uri)
|
||||
{
|
||||
mHelperURI = uri;
|
||||
}
|
||||
|
||||
const std::string LLViewerLogin::getLoginPageURI() const
|
||||
{
|
||||
return mLoginPageURI;
|
||||
}
|
||||
|
||||
void LLViewerLogin::setLoginPageURI(const std::string& uri)
|
||||
{
|
||||
mLoginPageURI = uri;
|
||||
return gHippoGridManager->getConnectedGrid()->isSecondLife();
|
||||
}
|
||||
|
||||
bool LLViewerLogin::isInProductionGrid()
|
||||
{
|
||||
// *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice,
|
||||
// but it seems that loginURI trumps that.
|
||||
std::vector<std::string> uris = getGridURIs();
|
||||
if (uris.size() > 0)
|
||||
{
|
||||
if((getCurrentGridURI().find("agni") != std::string::npos))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
const std::string LLViewerLogin::getStaticGridURI(const EGridInfo grid) const
|
||||
{
|
||||
// If its a known grid choice, get the uri from the table,
|
||||
// else try the grid name.
|
||||
if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER)
|
||||
{
|
||||
return gGridInfo[mGridChoice].mGridURI;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mGridName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2006-2009, Linden Research, Inc.
|
||||
* Copyright (c) 2006-2010, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
@@ -34,37 +34,7 @@
|
||||
#ifndef LL_LLVIEWERNETWORK_H
|
||||
#define LL_LLVIEWERNETWORK_H
|
||||
|
||||
class LLHost;
|
||||
|
||||
enum EGridInfo
|
||||
{
|
||||
GRID_INFO_NONE,
|
||||
GRID_INFO_ADITI,
|
||||
GRID_INFO_AGNI,
|
||||
GRID_INFO_ARUNA,
|
||||
GRID_INFO_BHARATI,
|
||||
GRID_INFO_CHANDRA,
|
||||
GRID_INFO_DAMBALLAH,
|
||||
GRID_INFO_DANU,
|
||||
GRID_INFO_DURGA,
|
||||
GRID_INFO_GANGA,
|
||||
GRID_INFO_MITRA,
|
||||
GRID_INFO_MOHINI,
|
||||
GRID_INFO_NANDI,
|
||||
GRID_INFO_PARVATI,
|
||||
GRID_INFO_RADHA,
|
||||
GRID_INFO_RAVI,
|
||||
GRID_INFO_SIVA,
|
||||
GRID_INFO_SHAKTI,
|
||||
GRID_INFO_SKANDA,
|
||||
GRID_INFO_SOMA,
|
||||
GRID_INFO_UMA,
|
||||
GRID_INFO_VAAK,
|
||||
GRID_INFO_YAMI,
|
||||
GRID_INFO_LOCAL,
|
||||
GRID_INFO_OTHER, // IP address set via command line option
|
||||
GRID_INFO_COUNT
|
||||
};
|
||||
#define DYNAMIC_GRIDS
|
||||
|
||||
/**
|
||||
* @brief A class to manage the viewer's login state.
|
||||
@@ -73,60 +43,29 @@ enum EGridInfo
|
||||
class LLViewerLogin : public LLSingleton<LLViewerLogin>
|
||||
{
|
||||
public:
|
||||
LLViewerLogin();
|
||||
|
||||
void setGridChoice(EGridInfo grid);
|
||||
void setGridChoice(const std::string& grid_name);
|
||||
void setGridURI(const std::string& uri);
|
||||
void setGridURIs(const std::vector<std::string>& urilist);
|
||||
|
||||
/**
|
||||
* @brief Get the enumeration of the grid choice.
|
||||
* Should only return values > 0 && < GRID_INFO_COUNT
|
||||
**/
|
||||
EGridInfo getGridChoice() const;
|
||||
|
||||
/**
|
||||
* @brief Get a readable label for the grid choice.
|
||||
* Returns the readable name for the grid choice.
|
||||
* If the grid is 'other', returns something
|
||||
* the string used to specifiy the grid.
|
||||
**/
|
||||
std::string getGridLabel();
|
||||
|
||||
std::string getKnownGridLabel(EGridInfo grid_index) const;
|
||||
|
||||
const std::string getCurrentGridURI();
|
||||
bool tryNextURI();
|
||||
|
||||
const std::vector<std::string>& getCommandLineURIs();
|
||||
const std::vector<std::string>& getGridURIs();
|
||||
const std::string getHelperURI() const;
|
||||
void setHelperURI(const std::string& uri);
|
||||
const std::string getLoginPageURI() const;
|
||||
void setLoginPageURI(const std::string& uri);
|
||||
void getLoginURIs(std::vector<std::string>& uris) const;
|
||||
const std::string &getGridLabel() const;
|
||||
const std::string &getLoginPage() const;
|
||||
const std::string &getHelperURI() const;
|
||||
void setNameEditted(bool value) { mNameEditted = value; }
|
||||
|
||||
const std::string getCurrentGridURI();
|
||||
|
||||
bool tryNextURI() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isOpenSimulator();
|
||||
bool isSecondLife();
|
||||
bool isInProductionGrid();
|
||||
bool nameEditted(void) const { return mNameEditted; }
|
||||
|
||||
private:
|
||||
void parseCommandLineURIs();
|
||||
const std::string getStaticGridURI(const EGridInfo grid) const;
|
||||
const std::string getStaticGridHelperURI(const EGridInfo grid) const;
|
||||
|
||||
EGridInfo mGridChoice;
|
||||
std::string mGridName;
|
||||
std::string mHelperURI;
|
||||
std::string mLoginPageURI;
|
||||
std::vector<std::string> mCommandLineURIs;
|
||||
std::vector<std::string> mGridURIs;
|
||||
|
||||
int mCurrentURI; // Index into mGridURIs.
|
||||
//void parseCommandLineURIs();
|
||||
bool mNameEditted; // Set if the user edits/sets the First or Last name field.
|
||||
};
|
||||
|
||||
const EGridInfo DEFAULT_GRID_CHOICE = GRID_INFO_AGNI;
|
||||
|
||||
const S32 MAC_ADDRESS_BYTES = 6;
|
||||
extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
#include "llworldmap.h"
|
||||
#include "llagent.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
// <edit>
|
||||
|
||||
#include "llviewernetwork.h" //for isInProductionGrid()
|
||||
// </edit>
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
const U32 LAYER_FLAG = 2;
|
||||
|
||||
@@ -162,9 +162,8 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**)
|
||||
msg->getU32Fast(_PREHASH_AgentData, _PREHASH_Flags, agent_flags);
|
||||
|
||||
// There's only one flag that we ever use here
|
||||
if (agent_flags != LAYER_FLAG
|
||||
//<edit>
|
||||
&& LLViewerLogin::getInstance()->getGridChoice() < GRID_INFO_OTHER)
|
||||
if (agent_flags != LAYER_FLAG
|
||||
&& gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE)
|
||||
{
|
||||
llwarns << "Invalid map image type returned! layer = " << agent_flags << llendl;
|
||||
return;
|
||||
|
||||
@@ -38,10 +38,9 @@
|
||||
#include "llviewerimagelist.h"
|
||||
#include "math.h" // log()
|
||||
|
||||
// <edit>
|
||||
#include "llworldmap.h"
|
||||
#include "llviewernetwork.h" //for isProductionGrid();
|
||||
// </edit>
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
// Turn this on to output tile stats in the standard output
|
||||
#define DEBUG_TILES_STAT 0
|
||||
@@ -159,10 +158,10 @@ LLPointer<LLViewerImage> LLWorldMipmap::getObjectsTile(U32 grid_x, U32 grid_y, S
|
||||
{
|
||||
// Load it
|
||||
LLPointer<LLViewerImage> img;
|
||||
// <edit>
|
||||
//this is a hack for opensims.
|
||||
if(LLViewerLogin::getInstance()->getGridChoice() < GRID_INFO_OTHER)
|
||||
img = loadObjectsTile(grid_x, grid_y, level);
|
||||
|
||||
//hack for opensims.
|
||||
if(gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE)
|
||||
img = loadObjectsTile(grid_x, grid_y, level);
|
||||
else
|
||||
{
|
||||
LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(handle);
|
||||
|
||||
@@ -49,27 +49,32 @@
|
||||
follows="left|bottom" font="SansSerifSmall" height="16"
|
||||
initial_value="false" label="Remember password"
|
||||
left="292" mouse_opaque="true" name="remember_check" width="138" />
|
||||
<button bottom="28" follows="left|bottom" font="SansSerif" halign="center"
|
||||
height="24" label="Log In" label_selected="Log In"
|
||||
left="435" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
|
||||
width="120" />
|
||||
<combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18"
|
||||
left_delta="135" max_chars="20" mouse_opaque="true"
|
||||
name="server_combo" width="120" />
|
||||
|
||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="10" drop_shadow_visible="true" follows="left|bottom"
|
||||
font="SansSerif" h_pad="0" halign="left" height="16"
|
||||
left="470" mouse_opaque="true" name="start_location_text" v_pad="0"
|
||||
width="95">
|
||||
bottom="54" drop_shadow_visible="true" follows="left|bottom"
|
||||
font="SansSerifSmall" h_pad="0" halign="left" height="16"
|
||||
left="428" mouse_opaque="true" name="grids_combo_text" v_pad="0" width="120">
|
||||
Grid:
|
||||
</text>
|
||||
<combo_box allow_text_entry="false" bottom_delta="-24" follows="left|bottom" height="20"
|
||||
left="428" mouse_opaque="true" name="grids_combo" width="120" />
|
||||
|
||||
<button bottom_delta="-3" follows="left|bottom" font="SansSerif" halign="center"
|
||||
height="24" width="60" label="Grids" label_selected="Grids"
|
||||
left="550" mouse_opaque="true" name="grids_btn" scale_image="TRUE"/>
|
||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="54" drop_shadow_visible="true" follows="left|bottom"
|
||||
font="SansSerifSmall" h_pad="0" halign="left" height="16"
|
||||
left="624" mouse_opaque="true" name="start_location_text" v_pad="0" width="120">
|
||||
Start Location:
|
||||
</text>
|
||||
|
||||
<combo_box allow_text_entry="true" bevel_style="in" border_style="line" border_thickness="1"
|
||||
follows="left|bottom" font="SansSerif" handle_edit_keys_directly="true"
|
||||
height="18" hidden="false" left_delta="97" bottom="8" max_chars="256" mouse_opaque="true"
|
||||
height="20" hidden="false" left="619" bottom_delta="-24" max_chars="256" mouse_opaque="true"
|
||||
name="regionuri_edit" select_all_on_focus_received="true" width="240" />
|
||||
<combo_box allow_text_entry="true" bottom="8" follows="left|bottom" height="18"
|
||||
left="570" max_chars="128" mouse_opaque="true"
|
||||
name="start_location_combo" width="155">
|
||||
<combo_box allow_text_entry="true" bottom_delta="0" left="624" follows="left|bottom" height="20"
|
||||
max_chars="128" mouse_opaque="true" name="start_location_combo" width="155">
|
||||
<combo_item name="MyHome" value="My Home">
|
||||
My Home
|
||||
</combo_item>
|
||||
@@ -80,6 +85,12 @@
|
||||
<Type region name>
|
||||
</combo_item>
|
||||
</combo_box>
|
||||
|
||||
<button bottom_delta="-3" follows="left|bottom" font="SansSerif" halign="center"
|
||||
height="24" label="Log In" label_selected="Log In"
|
||||
left="782" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
|
||||
width="100" />
|
||||
|
||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="45" drop_shadow_visible="true" follows="right|bottom"
|
||||
font="SansSerifSmall" font-style="UNDERLINE" h_pad="0" halign="right" height="16"
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<panel enabled="true" label="Grids" name="Grids panel"
|
||||
height="408" width="517" left="102"
|
||||
follows="left|top|right|bottom" border="true" mouse_opaque="true">
|
||||
<!-- Grid Selector -->
|
||||
<text type="string" length="1" enabled="true" name="grid_selector_label"
|
||||
height="10" width="100" left="12" bottom="-20"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Select a grid:
|
||||
</text>
|
||||
<combo_box max_chars="20" allow_text_entry="false" name="grid_selector"
|
||||
height="18" width="200" left="120" bottom_delta="-4"
|
||||
follows="left|top" mouse_opaque="true" />
|
||||
<button label="Default" label_selected="Default" enabled="true" name="btn_default"
|
||||
height="18" width="75" left_delta="210" bottom_delta="0"
|
||||
halign="center"
|
||||
follows="left|top" scale_image="true"
|
||||
font="SansSerifSmall" mouse_opaque="true" />
|
||||
<text type="string" length="1" enabled="true" name="default_grid"
|
||||
height="10" width="200" left_delta="80" bottom_delta="5"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
([DEFAULT])
|
||||
</text>
|
||||
<!-- Buttons -->
|
||||
<button label="Delete" label_selected="Delete" enabled="true" name="btn_delete"
|
||||
height="18" width="75" left="120" bottom_delta="-27"
|
||||
halign="center"
|
||||
follows="left|top" scale_image="true"
|
||||
font="SansSerifSmall" mouse_opaque="true" />
|
||||
<button label="Add" label_selected="Add" enabled="true" name="btn_add"
|
||||
height="18" width="75" left_delta="78" bottom_delta="0"
|
||||
halign="center"
|
||||
follows="left|top" scale_image="true"
|
||||
font="SansSerifSmall" mouse_opaque="true" />
|
||||
<button label="Copy" label_selected="Copy" enabled="true" name="btn_copy"
|
||||
height="18" width="75" left_delta="78" bottom_delta="0"
|
||||
halign="center"
|
||||
follows="left|top" scale_image="true"
|
||||
font="SansSerifSmall" mouse_opaque="true" />
|
||||
<!-- Login URI -->
|
||||
<text type="string" length="1" enabled="true" name="loginuri_label"
|
||||
height="10" width="100" left="12" bottom_delta="-32"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Login URI:
|
||||
</text>
|
||||
<line_editor max_length="254" enabled="true" name="loginuri"
|
||||
handle_edit_keys_directly="true"
|
||||
height="18" left="120" right="-12" bottom_delta="-4"
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<button label="Get Grid Info" label_selected="Get Grid Info" enabled="true" name="btn_gridinfo"
|
||||
height="18" width="100" left="120" bottom_delta="-22"
|
||||
halign="center"
|
||||
follows="left|top" scale_image="true"
|
||||
font="SansSerifSmall" mouse_opaque="true" />
|
||||
<!-- Platform -->
|
||||
<text type="string" length="1" enabled="true" name="platform_label"
|
||||
height="10" width="100" left="12" bottom_delta="-32"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Platform:
|
||||
</text>
|
||||
<combo_box max_chars="20" allow_text_entry="false" name="platform"
|
||||
height="18" width="200" left="120" bottom_delta="-4"
|
||||
follows="left|top" mouse_opaque="true" />
|
||||
<!-- Grid Nickname -->
|
||||
<text type="string" length="1" enabled="true" name="gridnick_label"
|
||||
height="10" width="100" left="12" bottom_delta="-22"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Grid Nickname:
|
||||
</text>
|
||||
<line_editor max_length="25" enabled="false" name="gridnick"
|
||||
handle_edit_keys_directly="true"
|
||||
height="18" width="175" left="120" bottom_delta="-4"
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<!-- Grid Name -->
|
||||
<text type="string" length="1" enabled="true" name="gridname_label"
|
||||
height="10" width="100" left="12" bottom_delta="-20"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Grid Name:
|
||||
</text>
|
||||
<line_editor max_length="254" enabled="true" name="gridname"
|
||||
handle_edit_keys_directly="true"
|
||||
height="18" left="120" right="-12" bottom_delta="-4"
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<!-- Helper URI -->
|
||||
<text type="string" length="1" enabled="true" name="helperuri_label"
|
||||
height="10" width="100" left="12" bottom_delta="-20"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Helper URL:
|
||||
</text>
|
||||
<line_editor max_length="254" enabled="true" name="helperuri"
|
||||
handle_edit_keys_directly="true"
|
||||
height="18" left="120" right="-12" bottom_delta="-4"
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<!-- Web Site -->
|
||||
<text type="string" length="1" enabled="true" name="website_label"
|
||||
height="10" width="100" left="12" bottom_delta="-20"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Web Site:
|
||||
</text>
|
||||
<line_editor max_length="254" enabled="true" name="website"
|
||||
handle_edit_keys_directly="true"
|
||||
height="18" left="120" right="-12" bottom_delta="-4"
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<!-- Support URL -->
|
||||
<text type="string" length="1" enabled="true" name="support_label"
|
||||
height="10" width="100" left="12" bottom_delta="-20"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Support URL:
|
||||
</text>
|
||||
<line_editor max_length="254" enabled="true" name="support"
|
||||
handle_edit_keys_directly="true"
|
||||
height="18" left="120" right="-12" bottom_delta="-4"
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<!-- Account URL -->
|
||||
<text type="string" length="1" enabled="true" name="register_label"
|
||||
height="10" width="100" left="12" bottom_delta="-20"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Account URL:
|
||||
</text>
|
||||
<line_editor max_length="254" enabled="true" name="register"
|
||||
handle_edit_keys_directly="true"
|
||||
height="18" left="120" right="-12" bottom_delta="-4"
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<!-- Password URL -->
|
||||
<text type="string" length="1" enabled="true" name="password_label"
|
||||
height="10" width="100" left="12" bottom_delta="-20"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Password URL:
|
||||
</text>
|
||||
<line_editor max_length="254" enabled="true" name="password"
|
||||
handle_edit_keys_directly="true"
|
||||
height="18" left="120" right="-12" bottom_delta="-4"
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<!-- Search URL -->
|
||||
<!--
|
||||
<text type="string" length="1" enabled="true" name="search_label"
|
||||
height="10" width="100" left="12" bottom_delta="-20"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Search URL:
|
||||
</text>
|
||||
<line_editor max_length="254" enabled="true" name="search"
|
||||
handle_edit_keys_directly="true"
|
||||
height="18" left="120" right="-12" bottom_delta="-4"
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
-->
|
||||
<!-- Rendering Compatibility -->
|
||||
<check_box enabled="true" radio_style="false"
|
||||
label="Rendering Compatibility" name="render_compat"
|
||||
height="18" left="115" bottom_delta="-35"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<button label="?" label_selected="?" enabled="true" name="btn_help_render_compat"
|
||||
height="18" width="18" left_delta="160" bottom_delta="1"
|
||||
halign="center" follows="left|top"
|
||||
font="SansSerifSmall" mouse_opaque="true" />
|
||||
</panel>
|
||||
Reference in New Issue
Block a user