aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llworldmap.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llworldmap.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llworldmap.cpp')
-rw-r--r--linden/indra/newview/llworldmap.cpp53
1 files changed, 22 insertions, 31 deletions
diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp
index 231f5dc..1048fe9 100644
--- a/linden/indra/newview/llworldmap.cpp
+++ b/linden/indra/newview/llworldmap.cpp
@@ -67,6 +67,7 @@ LLSimInfo::LLSimInfo()
67: mHandle(0), 67: mHandle(0),
68 mName(), 68 mName(),
69 mAgentsUpdateTime(0), 69 mAgentsUpdateTime(0),
70 mShowAgentLocations(FALSE),
70 mAccess(0x0), 71 mAccess(0x0),
71 mRegionFlags(0x0), 72 mRegionFlags(0x0),
72 mWaterHeight(0.f), 73 mWaterHeight(0.f),
@@ -178,7 +179,6 @@ void LLWorldMap::eraseItems()
178 mPGEvents.clear(); 179 mPGEvents.clear();
179 mMatureEvents.clear(); 180 mMatureEvents.clear();
180 mLandForSale.clear(); 181 mLandForSale.clear();
181 mClassifieds.clear();
182 } 182 }
183// mAgentLocationsMap.clear(); // persists 183// mAgentLocationsMap.clear(); // persists
184// mNumAgents.clear(); // persists 184// mNumAgents.clear(); // persists
@@ -236,7 +236,7 @@ LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 handle)
236} 236}
237 237
238 238
239LLSimInfo* LLWorldMap::simInfoFromName(const LLString& sim_name) 239LLSimInfo* LLWorldMap::simInfoFromName(const std::string& sim_name)
240{ 240{
241 LLSimInfo* sim_info = NULL; 241 LLSimInfo* sim_info = NULL;
242 if (!sim_name.empty()) 242 if (!sim_name.empty())
@@ -245,7 +245,7 @@ LLSimInfo* LLWorldMap::simInfoFromName(const LLString& sim_name)
245 { 245 {
246 sim_info = (*it).second; 246 sim_info = (*it).second;
247 if (sim_info 247 if (sim_info
248 && (0 == LLString::compareInsensitive(sim_name.c_str(), sim_info->mName.c_str())) ) 248 && (0 == LLStringUtil::compareInsensitive(sim_name, sim_info->mName)) )
249 { 249 {
250 break; 250 break;
251 } 251 }
@@ -255,7 +255,7 @@ LLSimInfo* LLWorldMap::simInfoFromName(const LLString& sim_name)
255 return sim_info; 255 return sim_info;
256} 256}
257 257
258bool LLWorldMap::simNameFromPosGlobal(const LLVector3d& pos_global, LLString & outSimName ) 258bool LLWorldMap::simNameFromPosGlobal(const LLVector3d& pos_global, std::string & outSimName )
259{ 259{
260 bool gotSimName = true; 260 bool gotSimName = true;
261 261
@@ -265,7 +265,7 @@ bool LLWorldMap::simNameFromPosGlobal(const LLVector3d& pos_global, LLString & o
265 if (it != mSimInfoMap.end()) 265 if (it != mSimInfoMap.end())
266 { 266 {
267 LLSimInfo* info = (*it).second; 267 LLSimInfo* info = (*it).second;
268 outSimName = info->mName.c_str(); 268 outSimName = info->mName;
269 } 269 }
270 else 270 else
271 { 271 {
@@ -309,11 +309,6 @@ void LLWorldMap::setCurrentLayer(S32 layer, bool request_layer)
309 sendItemRequest(MAP_ITEM_LAND_FOR_SALE); 309 sendItemRequest(MAP_ITEM_LAND_FOR_SALE);
310 } 310 }
311 311
312 if (mClassifieds.size() == 0)
313 {
314 sendItemRequest(MAP_ITEM_CLASSIFIED);
315 }
316
317 clearImageRefs(); 312 clearImageRefs();
318 clearSimFlags(); 313 clearSimFlags();
319} 314}
@@ -551,16 +546,16 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
551 { 546 {
552 U16 x_regions; 547 U16 x_regions;
553 U16 y_regions; 548 U16 y_regions;
554 char name[MAX_STRING]; /* Flawfinder: ignore */ 549 std::string name;
555 U8 access; /* Flawfinder: ignore */ 550 U8 accesscode;
556 U32 region_flags; 551 U32 region_flags;
557 U8 water_height; 552 U8 water_height;
558 U8 agents; 553 U8 agents;
559 LLUUID image_id; 554 LLUUID image_id;
560 msg->getU16Fast(_PREHASH_Data, _PREHASH_X, x_regions, block); 555 msg->getU16Fast(_PREHASH_Data, _PREHASH_X, x_regions, block);
561 msg->getU16Fast(_PREHASH_Data, _PREHASH_Y, y_regions, block); 556 msg->getU16Fast(_PREHASH_Data, _PREHASH_Y, y_regions, block);
562 msg->getStringFast(_PREHASH_Data, _PREHASH_Name, MAX_STRING, name, block); 557 msg->getStringFast(_PREHASH_Data, _PREHASH_Name, name, block);
563 msg->getU8Fast(_PREHASH_Data, _PREHASH_Access, access, block); /* Flawfinder: ignore */ 558 msg->getU8Fast(_PREHASH_Data, _PREHASH_Access, accesscode, block);
564 msg->getU32Fast(_PREHASH_Data, _PREHASH_RegionFlags, region_flags, block); 559 msg->getU32Fast(_PREHASH_Data, _PREHASH_RegionFlags, region_flags, block);
565 msg->getU8Fast(_PREHASH_Data, _PREHASH_WaterHeight, water_height, block); 560 msg->getU8Fast(_PREHASH_Data, _PREHASH_WaterHeight, water_height, block);
566 msg->getU8Fast(_PREHASH_Data, _PREHASH_Agents, agents, block); 561 msg->getU8Fast(_PREHASH_Data, _PREHASH_Agents, agents, block);
@@ -571,7 +566,7 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
571 566
572 U64 handle = to_region_handle(x_meters, y_meters); 567 U64 handle = to_region_handle(x_meters, y_meters);
573 568
574 if (access == 255) 569 if (accesscode == 255)
575 { 570 {
576 // This region doesn't exist 571 // This region doesn't exist
577 if (LLWorldMap::getInstance()->mIsTrackingUnknownLocation && 572 if (LLWorldMap::getInstance()->mIsTrackingUnknownLocation &&
@@ -610,7 +605,7 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
610 605
611 siminfo->mHandle = handle; 606 siminfo->mHandle = handle;
612 siminfo->mName.assign( name ); 607 siminfo->mName.assign( name );
613 siminfo->mAccess = access; /* Flawfinder: ignore */ 608 siminfo->mAccess = accesscode;
614 siminfo->mRegionFlags = region_flags; 609 siminfo->mRegionFlags = region_flags;
615 siminfo->mWaterHeight = (F32) water_height; 610 siminfo->mWaterHeight = (F32) water_height;
616 siminfo->mMapImageID[agent_flags] = image_id; 611 siminfo->mMapImageID[agent_flags] = image_id;
@@ -654,9 +649,9 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
654 649
655 if(LLWorldMap::getInstance()->mSLURLCallback != NULL) 650 if(LLWorldMap::getInstance()->mSLURLCallback != NULL)
656 { 651 {
657 // Server returns definitive capitalization, SLURL might 652 // Server returns definitive capitalization, SLURL might not have that.
658 // not have that. 653 if ((LLStringUtil::compareInsensitive(LLWorldMap::getInstance()->mSLURLRegionName, name)==0)
659 if (!stricmp(LLWorldMap::getInstance()->mSLURLRegionName.c_str(), name) || (LLWorldMap::getInstance()->mSLURLRegionHandle == handle)) 654 || (LLWorldMap::getInstance()->mSLURLRegionHandle == handle))
660 { 655 {
661 url_callback_t callback = LLWorldMap::getInstance()->mSLURLCallback; 656 url_callback_t callback = LLWorldMap::getInstance()->mSLURLCallback;
662 657
@@ -684,12 +679,12 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
684 for (S32 block=0; block<num_blocks; ++block) 679 for (S32 block=0; block<num_blocks; ++block)
685 { 680 {
686 U32 X, Y; 681 U32 X, Y;
687 char name[MAX_STRING]; /* Flawfinder: ignore */ 682 std::string name;
688 S32 extra, extra2; 683 S32 extra, extra2;
689 LLUUID uuid; 684 LLUUID uuid;
690 msg->getU32Fast(_PREHASH_Data, _PREHASH_X, X, block); 685 msg->getU32Fast(_PREHASH_Data, _PREHASH_X, X, block);
691 msg->getU32Fast(_PREHASH_Data, _PREHASH_Y, Y, block); 686 msg->getU32Fast(_PREHASH_Data, _PREHASH_Y, Y, block);
692 msg->getStringFast(_PREHASH_Data, _PREHASH_Name, MAX_STRING, name, block); 687 msg->getStringFast(_PREHASH_Data, _PREHASH_Name, name, block);
693 msg->getUUIDFast(_PREHASH_Data, _PREHASH_ID, uuid, block); 688 msg->getUUIDFast(_PREHASH_Data, _PREHASH_ID, uuid, block);
694 msg->getS32Fast(_PREHASH_Data, _PREHASH_Extra, extra, block); 689 msg->getS32Fast(_PREHASH_Data, _PREHASH_Extra, extra, block);
695 msg->getS32Fast(_PREHASH_Data, _PREHASH_Extra2, extra2, block); 690 msg->getS32Fast(_PREHASH_Data, _PREHASH_Extra2, extra2, block);
@@ -734,7 +729,6 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
734 case MAP_ITEM_PG_EVENT: // events 729 case MAP_ITEM_PG_EVENT: // events
735 case MAP_ITEM_MATURE_EVENT: 730 case MAP_ITEM_MATURE_EVENT:
736 { 731 {
737 char buffer[32]; /* Flawfinder: ignore */
738 struct tm* timep; 732 struct tm* timep;
739 // Convert to Pacific, based on server's opinion of whether 733 // Convert to Pacific, based on server's opinion of whether
740 // it's daylight savings time there. 734 // it's daylight savings time there.
@@ -743,11 +737,10 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
743 S32 display_hour = timep->tm_hour % 12; 737 S32 display_hour = timep->tm_hour % 12;
744 if (display_hour == 0) display_hour = 12; 738 if (display_hour == 0) display_hour = 12;
745 739
746 snprintf(buffer, sizeof(buffer), "%d:%02d %s", /* Flawfinder: ignore */ 740 new_item.mToolTip = llformat( "%d:%02d %s",
747 display_hour, 741 display_hour,
748 timep->tm_min, 742 timep->tm_min,
749 (timep->tm_hour < 12 ? "AM" : "PM") ); 743 (timep->tm_hour < 12 ? "AM" : "PM") );
750 new_item.mToolTip.assign( buffer );
751 744
752 // HACK: store Z in extra2 745 // HACK: store Z in extra2
753 new_item.mPosGlobal.mdV[VZ] = (F64)extra2; 746 new_item.mPosGlobal.mdV[VZ] = (F64)extra2;
@@ -769,9 +762,7 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
769 } 762 }
770 case MAP_ITEM_CLASSIFIED: // classifieds 763 case MAP_ITEM_CLASSIFIED: // classifieds
771 { 764 {
772 // HACK: Z-height is in Extra2 field. 765 //DEPRECATED: no longer used
773 new_item.mPosGlobal.mdV[VZ] = (F64)extra2;
774 LLWorldMap::getInstance()->mClassifieds.push_back(new_item);
775 break; 766 break;
776 } 767 }
777 case MAP_ITEM_AGENT_LOCATIONS: // agent locations 768 case MAP_ITEM_AGENT_LOCATIONS: // agent locations
@@ -823,7 +814,7 @@ void LLWorldMap::dump()
823 from_region_handle(handle, &x_pos, &y_pos); 814 from_region_handle(handle, &x_pos, &y_pos);
824 815
825 llinfos << x_pos << "," << y_pos 816 llinfos << x_pos << "," << y_pos
826 << " " << info->mName.c_str() 817 << " " << info->mName
827 << " " << (S32)info->mAccess 818 << " " << (S32)info->mAccess
828 << " " << std::hex << info->mRegionFlags << std::dec 819 << " " << std::hex << info->mRegionFlags << std::dec
829 << " " << info->mWaterHeight 820 << " " << info->mWaterHeight