From c07a4170324b61fc51e38ec72d44b26a52fc326e Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Tue, 25 Nov 2008 18:18:52 -0600 Subject: Added "code name" field for grid selections. The code name is used to fetch the proper splash page. This decouples the user-visible label from the name expected by the SL web server. --- linden/indra/newview/llpanellogin.cpp | 2 +- linden/indra/newview/llviewernetwork.cpp | 21 ++++++++++++++++----- linden/indra/newview/llviewernetwork.h | 14 ++++++++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 86dab63..1dff8e7 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp @@ -877,7 +877,7 @@ void LLPanelLogin::loadLoginPage() curl_free(curl_version); // Grid - char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridLabel().c_str(), 0); + char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridCodeName().c_str(), 0); oStr << "&grid=" << curl_grid; curl_free(curl_grid); diff --git a/linden/indra/newview/llviewernetwork.cpp b/linden/indra/newview/llviewernetwork.cpp index 7d1d351..7fb19af 100644 --- a/linden/indra/newview/llviewernetwork.cpp +++ b/linden/indra/newview/llviewernetwork.cpp @@ -38,6 +38,7 @@ struct LLGridData { const char* mLabel; + const char* mCodeName; const char* mName; const char* mLoginURI; const char* mHelperURI; @@ -45,23 +46,23 @@ struct LLGridData static LLGridData gGridInfo[GRID_INFO_COUNT] = { - { "None", "", "", ""}, + { "None", "", "", "", "" }, { "SL Beta Grid", + "Aditi", "util.aditi.lindenlab.com", "https://login.aditi.lindenlab.com/cgi-bin/login.cgi", "http://aditi-secondlife.webdev.lindenlab.com/helpers/" }, { "SL Main Grid", + "Agni", "util.agni.lindenlab.com", "https://login.agni.lindenlab.com/cgi-bin/login.cgi", "https://secondlife.com/helpers/" }, { "Local OpenSim", + "", "localhost", "http://0.0.0.0:9000", "" }, - { "Other", - "", - "", - "" } + { "Other", "", "", "", "" } }; const EGridInfo DEFAULT_GRID_CHOICE = GRID_INFO_AGNI; @@ -160,6 +161,16 @@ std::string LLViewerLogin::getGridLabel() const return mGridName; } +std::string LLViewerLogin::getGridCodeName() const +{ + if( gGridInfo[mGridChoice].mCodeName == "" ) + { + return getGridLabel(); + } + + return gGridInfo[mGridChoice].mCodeName; +} + std::string LLViewerLogin::getKnownGridLabel(EGridInfo grid_index) const { if(grid_index > GRID_INFO_NONE && grid_index < GRID_INFO_OTHER) diff --git a/linden/indra/newview/llviewernetwork.h b/linden/indra/newview/llviewernetwork.h index e39507d..39ac879 100644 --- a/linden/indra/newview/llviewernetwork.h +++ b/linden/indra/newview/llviewernetwork.h @@ -72,6 +72,20 @@ public: **/ std::string getGridLabel() const; + /** + * @brief Get the code name for the grid choice. + * + * Returns the code name for the grid choice, as designated + * by Linden Lab. The SL main grid is Agni, and the beta + * grid is Aditi. There are other LL testing grids with code + * names, but we don't care about those. + * + * This string is used primarily for fetching the proper + * login splash page, since the web server expects "Agni" + * and "Aditi", not "SL Main Grid" and "SL Beta Grid". + */ + std::string getGridCodeName() const; + std::string getKnownGridLabel(EGridInfo grid_index) const; void getLoginURIs(std::vector& uris) const; -- cgit v1.1