aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llviewerregion.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerregion.cpp87
1 files changed, 48 insertions, 39 deletions
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp
index 697b1d0..7e30cfc 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -53,9 +54,9 @@
53#include "llfloaterreporter.h" 54#include "llfloaterreporter.h"
54#include "llfloaterregioninfo.h" 55#include "llfloaterregioninfo.h"
55#include "llhttpnode.h" 56#include "llhttpnode.h"
56#include "llnetmap.h"
57#include "llsdutil.h" 57#include "llsdutil.h"
58#include "llstartup.h" 58#include "llstartup.h"
59#include "lltrans.h"
59#include "llviewerobjectlist.h" 60#include "llviewerobjectlist.h"
60#include "llviewerparceloverlay.h" 61#include "llviewerparceloverlay.h"
61#include "llvlmanager.h" 62#include "llvlmanager.h"
@@ -162,6 +163,11 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
162 mSimAccess( SIM_ACCESS_MIN ), 163 mSimAccess( SIM_ACCESS_MIN ),
163 mBillableFactor(1.0), 164 mBillableFactor(1.0),
164 mMaxTasks(DEFAULT_MAX_REGION_WIDE_PRIM_COUNT), 165 mMaxTasks(DEFAULT_MAX_REGION_WIDE_PRIM_COUNT),
166 mClassID(0),
167 mCPURatio(0),
168 mColoName("unknown"),
169 mProductSKU("unknown"),
170 mProductName("unknown"),
165 mCacheLoaded(FALSE), 171 mCacheLoaded(FALSE),
166 mCacheEntriesCount(0), 172 mCacheEntriesCount(0),
167 mCacheID(), 173 mCacheID(),
@@ -539,56 +545,30 @@ std::string LLViewerRegion::regionFlagsToString(U32 flags)
539 return result; 545 return result;
540} 546}
541 547
542// *TODO:Translate
543const char* SIM_ACCESS_STR[] = { "Free Trial",
544 "PG",
545 "Mature",
546 "Offline",
547 "Unknown" };
548
549// static 548// static
550std::string LLViewerRegion::accessToString(U8 sim_access) 549std::string LLViewerRegion::accessToString(U8 sim_access)
551{ 550{
552 switch(sim_access) 551 switch(sim_access)
553 { 552 {
554 case SIM_ACCESS_TRIAL:
555 return SIM_ACCESS_STR[0];
556
557 case SIM_ACCESS_PG: 553 case SIM_ACCESS_PG:
558 return SIM_ACCESS_STR[1]; 554 return LLTrans::getString("SIM_ACCESS_PG");
559 555
560 case SIM_ACCESS_MATURE: 556 case SIM_ACCESS_MATURE:
561 return SIM_ACCESS_STR[2]; 557 return LLTrans::getString("SIM_ACCESS_MATURE");
558
559 case SIM_ACCESS_ADULT:
560 return LLTrans::getString("SIM_ACCESS_ADULT");
562 561
563 case SIM_ACCESS_DOWN: 562 case SIM_ACCESS_DOWN:
564 return SIM_ACCESS_STR[3]; 563 return LLTrans::getString("SIM_ACCESS_DOWN");
565 564
566 case SIM_ACCESS_MIN: 565 case SIM_ACCESS_MIN:
567 default: 566 default:
568 return SIM_ACCESS_STR[4]; 567 return LLTrans::getString("SIM_ACCESS_MIN");
569 } 568 }
570} 569}
571 570
572// static 571// static
573U8 LLViewerRegion::stringToAccess(const std::string& access_str)
574{
575 U8 sim_access = SIM_ACCESS_MIN;
576 if (access_str == SIM_ACCESS_STR[0])
577 {
578 sim_access = SIM_ACCESS_TRIAL;
579 }
580 else if (access_str == SIM_ACCESS_STR[1])
581 {
582 sim_access = SIM_ACCESS_PG;
583 }
584 else if (access_str == SIM_ACCESS_STR[2])
585 {
586 sim_access = SIM_ACCESS_MATURE;
587 }
588 return sim_access;
589}
590
591// static
592std::string LLViewerRegion::accessToShortString(U8 sim_access) 572std::string LLViewerRegion::accessToShortString(U8 sim_access)
593{ 573{
594 switch(sim_access) /* Flawfinder: ignore */ 574 switch(sim_access) /* Flawfinder: ignore */
@@ -596,12 +576,12 @@ std::string LLViewerRegion::accessToShortString(U8 sim_access)
596 case SIM_ACCESS_PG: 576 case SIM_ACCESS_PG:
597 return "PG"; 577 return "PG";
598 578
599 case SIM_ACCESS_TRIAL:
600 return "TR";
601
602 case SIM_ACCESS_MATURE: 579 case SIM_ACCESS_MATURE:
603 return "M"; 580 return "M";
604 581
582 case SIM_ACCESS_ADULT:
583 return "A";
584
605 case SIM_ACCESS_MIN: 585 case SIM_ACCESS_MIN:
606 default: 586 default:
607 return "U"; 587 return "U";
@@ -1315,6 +1295,32 @@ void LLViewerRegion::unpackRegionHandshake()
1315 LLUUID region_id; 1295 LLUUID region_id;
1316 msg->getUUID("RegionInfo2", "RegionID", region_id); 1296 msg->getUUID("RegionInfo2", "RegionID", region_id);
1317 setRegionID(region_id); 1297 setRegionID(region_id);
1298
1299 // Retrieve the CR-53 (Homestead/Land SKU) information
1300 S32 classID = 0;
1301 S32 cpuRatio = 0;
1302 std::string coloName;
1303 std::string productSKU;
1304 std::string productName;
1305
1306 // the only reasonable way to decide if we actually have any data is to
1307 // check to see if any of these fields have positive sizes
1308 if (msg->getSize("RegionInfo3", "ColoName") > 0 ||
1309 msg->getSize("RegionInfo3", "ProductSKU") > 0 ||
1310 msg->getSize("RegionInfo3", "ProductName") > 0)
1311 {
1312 msg->getS32 ("RegionInfo3", "CPUClassID", classID);
1313 msg->getS32 ("RegionInfo3", "CPURatio", cpuRatio);
1314 msg->getString ("RegionInfo3", "ColoName", coloName);
1315 msg->getString ("RegionInfo3", "ProductSKU", productSKU);
1316 msg->getString ("RegionInfo3", "ProductName", productName);
1317
1318 mClassID = classID;
1319 mCPURatio = cpuRatio;
1320 mColoName = coloName;
1321 mProductSKU = productSKU;
1322 mProductName = productName;
1323 }
1318 1324
1319 LLVLComposition *compp = getComposition(); 1325 LLVLComposition *compp = getComposition();
1320 if (compp) 1326 if (compp)
@@ -1409,6 +1415,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1409 capabilityNames.append("NewFileAgentInventory"); 1415 capabilityNames.append("NewFileAgentInventory");
1410 capabilityNames.append("ParcelPropertiesUpdate"); 1416 capabilityNames.append("ParcelPropertiesUpdate");
1411 capabilityNames.append("ParcelVoiceInfoRequest"); 1417 capabilityNames.append("ParcelVoiceInfoRequest");
1418 capabilityNames.append("ProductInfoRequest");
1412 capabilityNames.append("ProvisionVoiceAccountRequest"); 1419 capabilityNames.append("ProvisionVoiceAccountRequest");
1413 capabilityNames.append("RemoteParcelRequest"); 1420 capabilityNames.append("RemoteParcelRequest");
1414 capabilityNames.append("RequestTextureDownload"); 1421 capabilityNames.append("RequestTextureDownload");
@@ -1419,6 +1426,8 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1419 capabilityNames.append("SendUserReportWithScreenshot"); 1426 capabilityNames.append("SendUserReportWithScreenshot");
1420 capabilityNames.append("ServerReleaseNotes"); 1427 capabilityNames.append("ServerReleaseNotes");
1421 capabilityNames.append("StartGroupProposal"); 1428 capabilityNames.append("StartGroupProposal");
1429 capabilityNames.append("UntrustedSimulatorMessage");
1430 capabilityNames.append("UpdateAgentInformation");
1422 capabilityNames.append("UpdateAgentLanguage"); 1431 capabilityNames.append("UpdateAgentLanguage");
1423 capabilityNames.append("UpdateGestureAgentInventory"); 1432 capabilityNames.append("UpdateGestureAgentInventory");
1424 capabilityNames.append("UpdateNotecardAgentInventory"); 1433 capabilityNames.append("UpdateNotecardAgentInventory");
@@ -1426,8 +1435,8 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1426 capabilityNames.append("UpdateGestureTaskInventory"); 1435 capabilityNames.append("UpdateGestureTaskInventory");
1427 capabilityNames.append("UpdateNotecardTaskInventory"); 1436 capabilityNames.append("UpdateNotecardTaskInventory");
1428 capabilityNames.append("UpdateScriptTask"); 1437 capabilityNames.append("UpdateScriptTask");
1438 capabilityNames.append("UploadBakedTexture");
1429 capabilityNames.append("ViewerStartAuction"); 1439 capabilityNames.append("ViewerStartAuction");
1430 capabilityNames.append("UntrustedSimulatorMessage");
1431 capabilityNames.append("ViewerStats"); 1440 capabilityNames.append("ViewerStats");
1432 // Please add new capabilities alphabetically to reduce 1441 // Please add new capabilities alphabetically to reduce
1433 // merge conflicts. 1442 // merge conflicts.