aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorMelanie2011-06-09 02:05:04 +0100
committerMelanie2011-06-09 02:05:04 +0100
commit326c46ba70cea70ddfe4aef9a6b73edff63e126a (patch)
tree5e76347b0d77f58717d8e5e4f3b8787ff01a18d7 /OpenSim/Region/CoreModules/World
parentMake the last otem in a list created with llCSV2List findable (diff)
parentConsistency fix on the last commit. (diff)
downloadopensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.zip
opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.gz
opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.bz2
opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs41
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs83
3 files changed, 78 insertions, 50 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
index 5da1656..eb00de8 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
@@ -230,6 +230,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
230 /// <param name="asset"></param> 230 /// <param name="asset"></param>
231 public void AssetRequestCallback(string id, object sender, AssetBase asset) 231 public void AssetRequestCallback(string id, object sender, AssetBase asset)
232 { 232 {
233 Culture.SetCurrentCulture();
234
233 try 235 try
234 { 236 {
235 lock (this) 237 lock (this)
@@ -289,6 +291,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
289 /// </summary> 291 /// </summary>
290 protected void PerformAssetsRequestCallback(object o) 292 protected void PerformAssetsRequestCallback(object o)
291 { 293 {
294 Culture.SetCurrentCulture();
295
292 try 296 try
293 { 297 {
294 m_assetsRequestCallback(m_foundAssetUuids, m_notFoundAssetUuids); 298 m_assetsRequestCallback(m_foundAssetUuids, m_notFoundAssetUuids);
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index a098ff6..43b37c7 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -548,18 +548,18 @@ namespace OpenSim.Region.CoreModules.World.Permissions
548 548
549 // libomv will moan about PrimFlags.ObjectYouOfficer being 549 // libomv will moan about PrimFlags.ObjectYouOfficer being
550 // deprecated 550 // deprecated
551 #pragma warning disable 0612 551#pragma warning disable 0612
552 objflags &= (uint) 552 objflags &= (uint)
553 ~(PrimFlags.ObjectCopy | // Tells client you can copy the object 553 ~(PrimFlags.ObjectCopy | // Tells client you can copy the object
554 PrimFlags.ObjectModify | // tells client you can modify the object 554 PrimFlags.ObjectModify | // tells client you can modify the object
555 PrimFlags.ObjectMove | // tells client that you can move the object (only, no mod) 555 PrimFlags.ObjectMove | // tells client that you can move the object (only, no mod)
556 PrimFlags.ObjectTransfer | // tells the client that you can /take/ the object if you don't own it 556 PrimFlags.ObjectTransfer | // tells the client that you can /take/ the object if you don't own it
557 PrimFlags.ObjectYouOwner | // Tells client that you're the owner of the object 557 PrimFlags.ObjectYouOwner | // Tells client that you're the owner of the object
558 PrimFlags.ObjectAnyOwner | // Tells client that someone owns the object 558 PrimFlags.ObjectAnyOwner | // Tells client that someone owns the object
559 PrimFlags.ObjectOwnerModify | // Tells client that you're the owner of the object 559 PrimFlags.ObjectOwnerModify | // Tells client that you're the owner of the object
560 PrimFlags.ObjectYouOfficer // Tells client that you've got group object editing permission. Used when ObjectGroupOwned is set 560 PrimFlags.ObjectYouOfficer // Tells client that you've got group object editing permission. Used when ObjectGroupOwned is set
561 ); 561 );
562 #pragma warning restore 0612 562#pragma warning restore 0612
563 563
564 // Creating the three ObjectFlags options for this method to choose from. 564 // Creating the three ObjectFlags options for this method to choose from.
565 // Customize the OwnerMask 565 // Customize the OwnerMask
@@ -576,22 +576,27 @@ namespace OpenSim.Region.CoreModules.World.Permissions
576 576
577 if (m_bypassPermissions) 577 if (m_bypassPermissions)
578 return objectOwnerMask; 578 return objectOwnerMask;
579 579
580 // Object owners should be able to edit their own content 580 // Object owners should be able to edit their own content
581 if (user == objectOwner) 581 if (user == objectOwner)
582 return objectOwnerMask; 582 return objectOwnerMask;
583 583
584 if (IsFriendWithPerms(user, objectOwner)) 584 if (IsFriendWithPerms(user, objectOwner))
585 {
585 return objectOwnerMask; 586 return objectOwnerMask;
586 587 }
587 // Estate users should be able to edit anything in the sim if RegionOwnerIsGod is set 588 // Estate users should be able to edit anything in the sim if RegionOwnerIsGod is set
588 if (m_RegionOwnerIsGod && IsEstateManager(user) && !IsAdministrator(objectOwner)) 589 if (m_RegionOwnerIsGod && IsEstateManager(user) && !IsAdministrator(objectOwner))
590 {
589 return objectOwnerMask; 591 return objectOwnerMask;
592 }
590 593
591 // Admin should be able to edit anything in the sim (including admin objects) 594 // Admin should be able to edit anything in the sim (including admin objects)
592 if (IsAdministrator(user)) 595 if (IsAdministrator(user))
596 {
593 return objectOwnerMask; 597 return objectOwnerMask;
594 598 }
599
595 // Users should be able to edit what is over their land. 600 // Users should be able to edit what is over their land.
596 Vector3 taskPos = task.AbsolutePosition; 601 Vector3 taskPos = task.AbsolutePosition;
597 ILandObject parcel = m_scene.LandChannel.GetLandObject(taskPos.X, taskPos.Y); 602 ILandObject parcel = m_scene.LandChannel.GetLandObject(taskPos.X, taskPos.Y);
@@ -599,13 +604,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions
599 { 604 {
600 // Admin objects should not be editable by the above 605 // Admin objects should not be editable by the above
601 if (!IsAdministrator(objectOwner)) 606 if (!IsAdministrator(objectOwner))
607 {
602 return objectOwnerMask; 608 return objectOwnerMask;
609 }
603 } 610 }
604 611
605 // Group permissions 612 // Group permissions
606 if ((task.GroupID != UUID.Zero) && IsGroupMember(task.GroupID, user, 0)) 613 if ((task.GroupID != UUID.Zero) && IsGroupMember(task.GroupID, user, 0))
607 return objectGroupMask | objectEveryoneMask; 614 return objectGroupMask | objectEveryoneMask;
608 615
609 return objectEveryoneMask; 616 return objectEveryoneMask;
610 } 617 }
611 618
@@ -673,7 +680,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
673 // 680 //
674 // Nobody but the object owner can set permissions on an object 681 // Nobody but the object owner can set permissions on an object
675 // 682 //
676
677 if (locked && (!IsAdministrator(currentUser)) && denyOnLocked) 683 if (locked && (!IsAdministrator(currentUser)) && denyOnLocked)
678 { 684 {
679 return false; 685 return false;
@@ -704,6 +710,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions
704 // Return immediately, so that the administrator can shares group objects 710 // Return immediately, so that the administrator can shares group objects
705 return true; 711 return true;
706 } 712 }
713
714 // Friends with benefits should be able to edit the objects too
715 if (IsFriendWithPerms(currentUser, objectOwner))
716 // Return immediately, so that the administrator can share objects with friends
717 return true;
707 718
708 // Users should be able to edit what is over their land. 719 // Users should be able to edit what is over their land.
709 ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); 720 ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y);
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index cd40c5d..3f6f359 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -208,52 +208,65 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
208 //m_log.DebugFormat("[MAPLAYER]: path: {0}, param: {1}, agent:{2}", 208 //m_log.DebugFormat("[MAPLAYER]: path: {0}, param: {1}, agent:{2}",
209 // path, param, agentID.ToString()); 209 // path, param, agentID.ToString());
210 210
211 // this is here because CAPS map requests work even beyond the 10,000 limit. 211 // There is a major hack going on in this method. The viewer doesn't request
212 ScenePresence avatarPresence = null; 212 // map blocks (RequestMapBlocks) above 4096. That means that if we don't hack,
213 213 // grids above that cell don't have a map at all. So, here's the hack: we wait
214 m_scene.TryGetScenePresence(agentID, out avatarPresence); 214 // for this CAP request to come, and we inject the map blocks at this point.
215 215 // In a normal scenario, this request simply sends back the MapLayer (the blue color).
216 if (avatarPresence != null) 216 // In the hacked scenario, it also sends the map blocks via UDP.
217 //
218 // 6/8/2011 -- I'm adding an explicit 4096 check, so that we never forget that there is
219 // a hack here, and so that regions below 4096 don't get spammed with unnecessary map blocks.
220
221 if (m_scene.RegionInfo.RegionLocX >= 4096 || m_scene.RegionInfo.RegionLocY >= 4096)
217 { 222 {
218 bool lookup = false; 223 ScenePresence avatarPresence = null;
219 224
220 lock (cachedMapBlocks) 225 m_scene.TryGetScenePresence(agentID, out avatarPresence);
221 {
222 if (cachedMapBlocks.Count > 0 && ((cachedTime + 1800) > Util.UnixTimeSinceEpoch()))
223 {
224 List<MapBlockData> mapBlocks;
225 226
226 mapBlocks = cachedMapBlocks; 227 if (avatarPresence != null)
227 avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0);
228 }
229 else
230 {
231 lookup = true;
232 }
233 }
234 if (lookup)
235 { 228 {
236 List<MapBlockData> mapBlocks = new List<MapBlockData>(); ; 229 bool lookup = false;
237 230
238 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, 231 lock (cachedMapBlocks)
239 (int)(m_scene.RegionInfo.RegionLocX - 8) * (int)Constants.RegionSize,
240 (int)(m_scene.RegionInfo.RegionLocX + 8) * (int)Constants.RegionSize,
241 (int)(m_scene.RegionInfo.RegionLocY - 8) * (int)Constants.RegionSize,
242 (int)(m_scene.RegionInfo.RegionLocY + 8) * (int)Constants.RegionSize);
243 foreach (GridRegion r in regions)
244 { 232 {
245 MapBlockData block = new MapBlockData(); 233 if (cachedMapBlocks.Count > 0 && ((cachedTime + 1800) > Util.UnixTimeSinceEpoch()))
246 MapBlockFromGridRegion(block, r); 234 {
247 mapBlocks.Add(block); 235 List<MapBlockData> mapBlocks;
236
237 mapBlocks = cachedMapBlocks;
238 avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0);
239 }
240 else
241 {
242 lookup = true;
243 }
248 } 244 }
249 avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0); 245 if (lookup)
246 {
247 List<MapBlockData> mapBlocks = new List<MapBlockData>(); ;
248
249 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
250 (int)(m_scene.RegionInfo.RegionLocX - 8) * (int)Constants.RegionSize,
251 (int)(m_scene.RegionInfo.RegionLocX + 8) * (int)Constants.RegionSize,
252 (int)(m_scene.RegionInfo.RegionLocY - 8) * (int)Constants.RegionSize,
253 (int)(m_scene.RegionInfo.RegionLocY + 8) * (int)Constants.RegionSize);
254 foreach (GridRegion r in regions)
255 {
256 MapBlockData block = new MapBlockData();
257 MapBlockFromGridRegion(block, r);
258 mapBlocks.Add(block);
259 }
260 avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0);
250 261
251 lock (cachedMapBlocks) 262 lock (cachedMapBlocks)
252 cachedMapBlocks = mapBlocks; 263 cachedMapBlocks = mapBlocks;
253 264
254 cachedTime = Util.UnixTimeSinceEpoch(); 265 cachedTime = Util.UnixTimeSinceEpoch();
266 }
255 } 267 }
256 } 268 }
269
257 LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); 270 LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse();
258 mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse()); 271 mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse());
259 return mapResponse.ToString(); 272 return mapResponse.ToString();