diff options
Diffstat (limited to 'linden/indra/newview/llviewerparcelmgr.cpp')
-rw-r--r-- | linden/indra/newview/llviewerparcelmgr.cpp | 62 |
1 files changed, 37 insertions, 25 deletions
diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp index a62af15..6ec29ae 100644 --- a/linden/indra/newview/llviewerparcelmgr.cpp +++ b/linden/indra/newview/llviewerparcelmgr.cpp | |||
@@ -12,12 +12,12 @@ | |||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlife.com/developers/opensource/gplv2 | 15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 16 | * |
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://secondlife.com/developers/opensource/flossexception | 20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception |
21 | * | 21 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 22 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 23 | * that you have read and understood your obligations described above, |
@@ -66,6 +66,7 @@ | |||
66 | #include "llworld.h" | 66 | #include "llworld.h" |
67 | #include "lloverlaybar.h" | 67 | #include "lloverlaybar.h" |
68 | #include "roles_constants.h" | 68 | #include "roles_constants.h" |
69 | #include "llweb.h" | ||
69 | 70 | ||
70 | const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; | 71 | const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; |
71 | 72 | ||
@@ -265,23 +266,6 @@ void LLViewerParcelMgr::getDisplayInfo(S32* area_out, S32* claim_out, | |||
265 | *dwell_out = dwell; | 266 | *dwell_out = dwell; |
266 | } | 267 | } |
267 | 268 | ||
268 | void LLViewerParcelMgr::getPrimInfo(S32 &sw_max, S32 &sw_total, S32 &max, S32 &total, S32 &owner, S32 &group, S32 &other, S32& selected, F32 &parcel_object_bonus, S32 &other_clean) | ||
269 | { | ||
270 | if (mSelected && mCurrentParcel) | ||
271 | { | ||
272 | sw_max = mCurrentParcel->getSimWideMaxPrimCapacity(); | ||
273 | sw_total = mCurrentParcel->getSimWidePrimCount(); | ||
274 | max = llround(mCurrentParcel->getMaxPrimCapacity()*mCurrentParcel->getParcelPrimBonus()); | ||
275 | total = mCurrentParcel->getPrimCount(); | ||
276 | owner = mCurrentParcel->getOwnerPrimCount(); | ||
277 | group = mCurrentParcel->getGroupPrimCount(); | ||
278 | other = mCurrentParcel->getOtherPrimCount(); | ||
279 | selected = mCurrentParcel->getSelectedPrimCount(); | ||
280 | parcel_object_bonus = mCurrentParcel->getParcelPrimBonus(); | ||
281 | other_clean = mCurrentParcel->getCleanOtherTime(); | ||
282 | } | ||
283 | } | ||
284 | |||
285 | S32 LLViewerParcelMgr::getSelectedArea() const | 269 | S32 LLViewerParcelMgr::getSelectedArea() const |
286 | { | 270 | { |
287 | S32 rv = 0; | 271 | S32 rv = 0; |
@@ -703,6 +687,7 @@ F32 LLViewerParcelMgr::agentDrawDistance() const | |||
703 | 687 | ||
704 | BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const | 688 | BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const |
705 | { | 689 | { |
690 | if (!gWorldp) return FALSE; | ||
706 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); | 691 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); |
707 | if (!region) return FALSE; | 692 | if (!region) return FALSE; |
708 | 693 | ||
@@ -716,6 +701,7 @@ BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const | |||
716 | 701 | ||
717 | BOOL LLViewerParcelMgr::isOwnedSelfAt(const LLVector3d& pos_global) const | 702 | BOOL LLViewerParcelMgr::isOwnedSelfAt(const LLVector3d& pos_global) const |
718 | { | 703 | { |
704 | if (!gWorldp) return FALSE; | ||
719 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); | 705 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); |
720 | if (!region) return FALSE; | 706 | if (!region) return FALSE; |
721 | 707 | ||
@@ -729,6 +715,7 @@ BOOL LLViewerParcelMgr::isOwnedSelfAt(const LLVector3d& pos_global) const | |||
729 | 715 | ||
730 | BOOL LLViewerParcelMgr::isOwnedOtherAt(const LLVector3d& pos_global) const | 716 | BOOL LLViewerParcelMgr::isOwnedOtherAt(const LLVector3d& pos_global) const |
731 | { | 717 | { |
718 | if (!gWorldp) return FALSE; | ||
732 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); | 719 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); |
733 | if (!region) return FALSE; | 720 | if (!region) return FALSE; |
734 | 721 | ||
@@ -742,6 +729,7 @@ BOOL LLViewerParcelMgr::isOwnedOtherAt(const LLVector3d& pos_global) const | |||
742 | 729 | ||
743 | BOOL LLViewerParcelMgr::isSoundLocal(const LLVector3d& pos_global) const | 730 | BOOL LLViewerParcelMgr::isSoundLocal(const LLVector3d& pos_global) const |
744 | { | 731 | { |
732 | if (!gWorldp) return FALSE; | ||
745 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); | 733 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); |
746 | if (!region) return FALSE; | 734 | if (!region) return FALSE; |
747 | 735 | ||
@@ -785,6 +773,7 @@ BOOL LLViewerParcelMgr::canHearSound(const LLVector3d &pos_global) const | |||
785 | 773 | ||
786 | BOOL LLViewerParcelMgr::inAgentParcel(const LLVector3d &pos_global) const | 774 | BOOL LLViewerParcelMgr::inAgentParcel(const LLVector3d &pos_global) const |
787 | { | 775 | { |
776 | if (!gWorldp) return FALSE; | ||
788 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(pos_global); | 777 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(pos_global); |
789 | if (region != gAgent.getRegion()) | 778 | if (region != gAgent.getRegion()) |
790 | { | 779 | { |
@@ -842,7 +831,8 @@ void LLViewerParcelMgr::render() | |||
842 | { | 831 | { |
843 | // Rendering is done in agent-coordinates, so need to supply | 832 | // Rendering is done in agent-coordinates, so need to supply |
844 | // an appropriate offset to the render code. | 833 | // an appropriate offset to the render code. |
845 | LLViewerRegion *regionp = gWorldp->getRegionFromPosGlobal( mWestSouth ); | 834 | if (!gWorldp) return; |
835 | LLViewerRegion* regionp = gWorldp->getRegionFromPosGlobal(mWestSouth); | ||
846 | if (!regionp) return; | 836 | if (!regionp) return; |
847 | 837 | ||
848 | renderHighlightSegments(mHighlightSegments, regionp); | 838 | renderHighlightSegments(mHighlightSegments, regionp); |
@@ -874,6 +864,7 @@ void LLViewerParcelMgr::sendParcelAccessListRequest(U32 flags) | |||
874 | return; | 864 | return; |
875 | } | 865 | } |
876 | 866 | ||
867 | if(!gWorldp) return; | ||
877 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | 868 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); |
878 | if (!region) return; | 869 | if (!region) return; |
879 | 870 | ||
@@ -909,6 +900,7 @@ void LLViewerParcelMgr::sendParcelDwellRequest() | |||
909 | return; | 900 | return; |
910 | } | 901 | } |
911 | 902 | ||
903 | if(!gWorldp) return; | ||
912 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | 904 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); |
913 | if (!region) return; | 905 | if (!region) return; |
914 | 906 | ||
@@ -941,6 +933,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id) | |||
941 | east_north_region_check.mdV[VX] -= 0.5; | 933 | east_north_region_check.mdV[VX] -= 0.5; |
942 | east_north_region_check.mdV[VY] -= 0.5; | 934 | east_north_region_check.mdV[VY] -= 0.5; |
943 | 935 | ||
936 | if(!gWorldp) return; | ||
944 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | 937 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); |
945 | if (!region) | 938 | if (!region) |
946 | { | 939 | { |
@@ -997,7 +990,8 @@ void LLViewerParcelMgr::sendParcelGodForceToContent() | |||
997 | gViewerWindow->alertXml("CannotContentifyNothingSelected"); | 990 | gViewerWindow->alertXml("CannotContentifyNothingSelected"); |
998 | return; | 991 | return; |
999 | } | 992 | } |
1000 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | 993 | if(!gWorldp) return; |
994 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
1001 | if (!region) | 995 | if (!region) |
1002 | { | 996 | { |
1003 | gViewerWindow->alertXml("CannotContentifyNoRegion"); | 997 | gViewerWindow->alertXml("CannotContentifyNoRegion"); |
@@ -1022,6 +1016,7 @@ void LLViewerParcelMgr::sendParcelRelease() | |||
1022 | return; | 1016 | return; |
1023 | } | 1017 | } |
1024 | 1018 | ||
1019 | if(!gWorldp) return; | ||
1025 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | 1020 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); |
1026 | if (!region) | 1021 | if (!region) |
1027 | { | 1022 | { |
@@ -1084,6 +1079,7 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy( | |||
1084 | return NULL; | 1079 | return NULL; |
1085 | } | 1080 | } |
1086 | 1081 | ||
1082 | if(!gWorldp) return NULL; | ||
1087 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | 1083 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); |
1088 | if (!region) | 1084 | if (!region) |
1089 | { | 1085 | { |
@@ -1194,6 +1190,7 @@ void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id) | |||
1194 | gViewerWindow->alertXml("CannotDeedLandNoGroup"); | 1190 | gViewerWindow->alertXml("CannotDeedLandNoGroup"); |
1195 | return; | 1191 | return; |
1196 | } | 1192 | } |
1193 | if(!gWorldp) return; | ||
1197 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | 1194 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); |
1198 | if (!region) | 1195 | if (!region) |
1199 | { | 1196 | { |
@@ -1261,7 +1258,7 @@ const LLString& LLViewerParcelMgr::getAgentParcelName() const | |||
1261 | void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel) | 1258 | void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel) |
1262 | { | 1259 | { |
1263 | if (!parcel) return; | 1260 | if (!parcel) return; |
1264 | 1261 | if(!gWorldp) return; | |
1265 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | 1262 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); |
1266 | if (!region) return; | 1263 | if (!region) return; |
1267 | 1264 | ||
@@ -1287,7 +1284,8 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel) | |||
1287 | 1284 | ||
1288 | void LLViewerParcelMgr::requestHoverParcelProperties(const LLVector3d& pos) | 1285 | void LLViewerParcelMgr::requestHoverParcelProperties(const LLVector3d& pos) |
1289 | { | 1286 | { |
1290 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( pos ); | 1287 | if(!gWorldp) return; |
1288 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos ); | ||
1291 | if (!region) | 1289 | if (!region) |
1292 | { | 1290 | { |
1293 | return; | 1291 | return; |
@@ -1539,7 +1537,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use | |||
1539 | (request_result == PARCEL_RESULT_MULTIPLE); | 1537 | (request_result == PARCEL_RESULT_MULTIPLE); |
1540 | 1538 | ||
1541 | // Select the whole parcel | 1539 | // Select the whole parcel |
1542 | LLViewerRegion *region = gWorldp->getRegion( msg->getSender() ); | 1540 | if(!gWorldp) return; |
1541 | LLViewerRegion* region = gWorldp->getRegion( msg->getSender() ); | ||
1543 | if (region) | 1542 | if (region) |
1544 | { | 1543 | { |
1545 | if (!snap_selection) | 1544 | if (!snap_selection) |
@@ -1724,6 +1723,10 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use | |||
1724 | std::string mediaUrl = std::string ( parcel->getMediaURL () ); | 1723 | std::string mediaUrl = std::string ( parcel->getMediaURL () ); |
1725 | LLString::trim(mediaUrl); | 1724 | LLString::trim(mediaUrl); |
1726 | 1725 | ||
1726 | // clean spaces and whatnot | ||
1727 | mediaUrl = LLWeb::escapeURL(mediaUrl); | ||
1728 | |||
1729 | |||
1727 | // something changed | 1730 | // something changed |
1728 | LLMediaEngine* me = LLMediaEngine::getInstance(); | 1731 | LLMediaEngine* me = LLMediaEngine::getInstance(); |
1729 | if ( ( me->getUrl () != mediaUrl ) | 1732 | if ( ( me->getUrl () != mediaUrl ) |
@@ -1841,6 +1844,10 @@ void prepare_video(const LLParcel *parcel) | |||
1841 | { | 1844 | { |
1842 | mediaUrl = std::string ( parcel->getMediaURL () ); | 1845 | mediaUrl = std::string ( parcel->getMediaURL () ); |
1843 | } | 1846 | } |
1847 | |||
1848 | // clean spaces and whatnot | ||
1849 | mediaUrl = LLWeb::escapeURL(mediaUrl); | ||
1850 | |||
1844 | LLMediaEngine::getInstance ()->setUrl ( mediaUrl ); | 1851 | LLMediaEngine::getInstance ()->setUrl ( mediaUrl ); |
1845 | LLMediaEngine::getInstance ()->setImageUUID ( parcel->getMediaID () ); | 1852 | LLMediaEngine::getInstance ()->setImageUUID ( parcel->getMediaID () ); |
1846 | LLMediaEngine::getInstance ()->setAutoScaled ( parcel->getMediaAutoScale () ? TRUE : FALSE ); // (U8 instead of BOOL for future expansion) | 1853 | LLMediaEngine::getInstance ()->setAutoScaled ( parcel->getMediaAutoScale () ? TRUE : FALSE ); // (U8 instead of BOOL for future expansion) |
@@ -1987,7 +1994,8 @@ void LLViewerParcelMgr::sendParcelAccessListUpdate(U32 which) | |||
1987 | return; | 1994 | return; |
1988 | } | 1995 | } |
1989 | 1996 | ||
1990 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | 1997 | if(!gWorldp) return; |
1998 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
1991 | if (!region) return; | 1999 | if (!region) return; |
1992 | 2000 | ||
1993 | LLMessageSystem* msg = gMessageSystem; | 2001 | LLMessageSystem* msg = gMessageSystem; |
@@ -2178,6 +2186,7 @@ void LLViewerParcelMgr::startReleaseLand() | |||
2178 | } | 2186 | } |
2179 | 2187 | ||
2180 | LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; | 2188 | LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; |
2189 | if(!gWorldp) return; | ||
2181 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); | 2190 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); |
2182 | if (!region) | 2191 | if (!region) |
2183 | { | 2192 | { |
@@ -2282,6 +2291,7 @@ void LLViewerParcelMgr::callbackDivideLand(S32 option, void* data) | |||
2282 | LLViewerParcelMgr* self = (LLViewerParcelMgr*)data; | 2291 | LLViewerParcelMgr* self = (LLViewerParcelMgr*)data; |
2283 | 2292 | ||
2284 | LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; | 2293 | LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; |
2294 | if(!gWorldp) return; | ||
2285 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); | 2295 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); |
2286 | if (!region) | 2296 | if (!region) |
2287 | { | 2297 | { |
@@ -2340,6 +2350,7 @@ void LLViewerParcelMgr::callbackJoinLand(S32 option, void* data) | |||
2340 | LLViewerParcelMgr* self = (LLViewerParcelMgr*)data; | 2350 | LLViewerParcelMgr* self = (LLViewerParcelMgr*)data; |
2341 | 2351 | ||
2342 | LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; | 2352 | LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; |
2353 | if(!gWorldp) return; | ||
2343 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); | 2354 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); |
2344 | if (!region) | 2355 | if (!region) |
2345 | { | 2356 | { |
@@ -2388,6 +2399,7 @@ void LLViewerParcelMgr::startDeedLandToGroup() | |||
2388 | } | 2399 | } |
2389 | 2400 | ||
2390 | LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; | 2401 | LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; |
2402 | if(!gWorldp) return; | ||
2391 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); | 2403 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); |
2392 | if (!region) | 2404 | if (!region) |
2393 | { | 2405 | { |