diff options
Diffstat (limited to 'linden/indra/newview/llworldmap.cpp')
-rw-r--r-- | linden/indra/newview/llworldmap.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp index 16a8be7..6ba10ea 100644 --- a/linden/indra/newview/llworldmap.cpp +++ b/linden/indra/newview/llworldmap.cpp | |||
@@ -106,7 +106,11 @@ LLWorldMap::LLWorldMap() : | |||
106 | mNeighborMap(NULL), | 106 | mNeighborMap(NULL), |
107 | mTelehubCoverageMap(NULL), | 107 | mTelehubCoverageMap(NULL), |
108 | mNeighborMapWidth(0), | 108 | mNeighborMapWidth(0), |
109 | mNeighborMapHeight(0) | 109 | mNeighborMapHeight(0), |
110 | mSLURLRegionName(), | ||
111 | mSLURL(), | ||
112 | mSLURLCallback(0), | ||
113 | mSLURLTeleport(false) | ||
110 | { | 114 | { |
111 | for (S32 map=0; map<MAP_SIM_IMAGE_TYPES; ++map) | 115 | for (S32 map=0; map<MAP_SIM_IMAGE_TYPES; ++map) |
112 | { | 116 | { |
@@ -398,6 +402,19 @@ void LLWorldMap::sendNamedRegionRequest(std::string region_name) | |||
398 | msg->addStringFast(_PREHASH_Name, region_name); | 402 | msg->addStringFast(_PREHASH_Name, region_name); |
399 | gAgent.sendReliableMessage(); | 403 | gAgent.sendReliableMessage(); |
400 | } | 404 | } |
405 | // public | ||
406 | void LLWorldMap::sendNamedRegionRequest(std::string region_name, | ||
407 | url_callback_t callback, | ||
408 | const std::string& callback_url, | ||
409 | bool teleport) // immediately teleport when result returned | ||
410 | { | ||
411 | mSLURLRegionName = region_name; | ||
412 | mSLURL = callback_url; | ||
413 | mSLURLCallback = callback; | ||
414 | mSLURLTeleport = teleport; | ||
415 | |||
416 | sendNamedRegionRequest(region_name); | ||
417 | } | ||
401 | 418 | ||
402 | // public | 419 | // public |
403 | void LLWorldMap::sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent) | 420 | void LLWorldMap::sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent) |
@@ -532,6 +549,8 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) | |||
532 | U32 x_meters = x_regions * REGION_WIDTH_UNITS; | 549 | U32 x_meters = x_regions * REGION_WIDTH_UNITS; |
533 | U32 y_meters = y_regions * REGION_WIDTH_UNITS; | 550 | U32 y_meters = y_regions * REGION_WIDTH_UNITS; |
534 | 551 | ||
552 | U64 handle = to_region_handle(x_meters, y_meters); | ||
553 | |||
535 | if (access == 255) | 554 | if (access == 255) |
536 | { | 555 | { |
537 | // This region doesn't exist | 556 | // This region doesn't exist |
@@ -547,13 +566,23 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) | |||
547 | 566 | ||
548 | found_null_sim = true; | 567 | found_null_sim = true; |
549 | } | 568 | } |
569 | else if(gWorldMap->mSLURLCallback != NULL) | ||
570 | { | ||
571 | // Server returns definitive capitalization, SLURL might | ||
572 | // not have that. | ||
573 | if (!stricmp(gWorldMap->mSLURLRegionName.c_str(), name)) | ||
574 | { | ||
575 | gWorldMap->mSLURLCallback(handle, gWorldMap->mSLURL, image_id, gWorldMap->mSLURLTeleport); | ||
576 | gWorldMap->mSLURLCallback = NULL; | ||
577 | gWorldMap->mSLURLRegionName.clear(); | ||
578 | } | ||
579 | } | ||
550 | else | 580 | else |
551 | { | 581 | { |
552 | adjust = gWorldMap->extendAABB(x_meters, | 582 | adjust = gWorldMap->extendAABB(x_meters, |
553 | y_meters, | 583 | y_meters, |
554 | x_meters+REGION_WIDTH_UNITS, | 584 | x_meters+REGION_WIDTH_UNITS, |
555 | y_meters+REGION_WIDTH_UNITS) || adjust; | 585 | y_meters+REGION_WIDTH_UNITS) || adjust; |
556 | U64 handle = to_region_handle(x_meters, y_meters); | ||
557 | 586 | ||
558 | // llinfos << "Map sim " << name << " image layer " << agent_flags << " ID " << image_id.getString() << llendl; | 587 | // llinfos << "Map sim " << name << " image layer " << agent_flags << " ID " << image_id.getString() << llendl; |
559 | 588 | ||
@@ -614,6 +643,7 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) | |||
614 | } | 643 | } |
615 | } | 644 | } |
616 | } | 645 | } |
646 | |||
617 | if(adjust) gFloaterWorldMap->adjustZoomSliderBounds(); | 647 | if(adjust) gFloaterWorldMap->adjustZoomSliderBounds(); |
618 | gFloaterWorldMap->updateSims(found_null_sim); | 648 | gFloaterWorldMap->updateSims(found_null_sim); |
619 | } | 649 | } |