aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS.txt1
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs5
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs15
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs19
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs33
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs25
-rw-r--r--OpenSim/Server/Handlers/Map/MapAddServerConnector.cs79
-rw-r--r--ThirdPartyLicenses/DotNetZip-bzip2.txt29
-rw-r--r--ThirdPartyLicenses/DotNetZip-zlib.txt70
-rw-r--r--ThirdPartyLicenses/DotNetZip.txt33
-rw-r--r--bin/Ionic.Zip.dllbin0 -> 462336 bytes
-rw-r--r--bin/Robust.HG.ini.example7
-rw-r--r--bin/Robust.ini.example8
-rw-r--r--prebuild.xml1
19 files changed, 341 insertions, 45 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 1370449..ad95cf7 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -143,6 +143,7 @@ what it is today.
143* sempuki 143* sempuki
144* SignpostMarv 144* SignpostMarv
145* SpotOn3D 145* SpotOn3D
146* Stefan_Boom / stoehr
146* Strawberry Fride 147* Strawberry Fride
147* Talun 148* Talun
148* tglion 149* tglion
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 0ee7606..6587ead 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -39,6 +39,9 @@ using OpenSim.Framework.Serialization.External;
39using OpenSim.Region.CoreModules.World.Archiver; 39using OpenSim.Region.CoreModules.World.Archiver;
40using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
41using OpenSim.Services.Interfaces; 41using OpenSim.Services.Interfaces;
42using Ionic.Zlib;
43using GZipStream = Ionic.Zlib.GZipStream;
44using CompressionMode = Ionic.Zlib.CompressionMode;
42 45
43namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver 46namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
44{ 47{
@@ -99,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
99 scene, 102 scene,
100 userInfo, 103 userInfo,
101 invPath, 104 invPath,
102 new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress)) 105 new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress, CompressionLevel.BestCompression))
103 { 106 {
104 } 107 }
105 108
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index eb581b4..07ea35e 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -161,6 +161,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
161 161
162 public void Teleport(ScenePresence sp, ulong regionHandle, Vector3 position, Vector3 lookAt, uint teleportFlags) 162 public void Teleport(ScenePresence sp, ulong regionHandle, Vector3 position, Vector3 lookAt, uint teleportFlags)
163 { 163 {
164 if (sp.Scene.Permissions.IsGridGod(sp.UUID))
165 {
166 // This user will be a God in the destination scene, too
167 teleportFlags |= (uint)TeleportFlags.Godlike;
168 }
169
164 if (!sp.Scene.Permissions.CanTeleport(sp.UUID)) 170 if (!sp.Scene.Permissions.CanTeleport(sp.UUID))
165 return; 171 return;
166 172
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 12bd6bc..a9ffd8f 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
173 if (sp.UserLevel < m_levelHGTeleport) 173 if (sp.UserLevel < m_levelHGTeleport)
174 { 174 {
175 m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: Unable to HG teleport agent due to insufficient UserLevel."); 175 m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: Unable to HG teleport agent due to insufficient UserLevel.");
176 reason = "HyperGrid teleport not permitted"; 176 reason = "Hypergrid teleport not allowed";
177 return false; 177 return false;
178 } 178 }
179 179
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
index 3b862da..6cd077a 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
@@ -149,9 +149,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
149 lock (m_scenes) 149 lock (m_scenes)
150 m_scenes[scene.RegionInfo.RegionID] = scene; 150 m_scenes[scene.RegionInfo.RegionID] = scene;
151 151
152 scene.EventManager.OnPrimsLoaded += new EventManager.PrimsLoaded(EventManager_OnPrimsLoaded); 152 scene.EventManager.OnLoginsEnabled += OnLoginsEnabled;
153 } 153 }
154 154
155
155 ///<summary> 156 ///<summary>
156 /// 157 ///
157 ///</summary> 158 ///</summary>
@@ -166,9 +167,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
166 167
167 #endregion ISharedRegionModule 168 #endregion ISharedRegionModule
168 169
169 void EventManager_OnPrimsLoaded(Scene s) 170 void OnLoginsEnabled(string regionName)
170 { 171 {
171 UploadMapTile(s); 172 Scene scene = null;
173 foreach (Scene s in m_scenes.Values)
174 if (s.RegionInfo.RegionName == regionName)
175 {
176 scene = s;
177 break;
178 }
179 if (scene != null)
180 UploadMapTile(scene);
172 } 181 }
173 182
174 183
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index ab3cc41..eabe46e 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -40,6 +40,9 @@ using OpenSim.Framework.Serialization;
40using OpenSim.Region.CoreModules.World.Terrain; 40using OpenSim.Region.CoreModules.World.Terrain;
41using OpenSim.Region.Framework.Interfaces; 41using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.Framework.Scenes; 42using OpenSim.Region.Framework.Scenes;
43using Ionic.Zlib;
44using GZipStream = Ionic.Zlib.GZipStream;
45using CompressionMode = Ionic.Zlib.CompressionMode;
43 46
44namespace OpenSim.Region.CoreModules.World.Archiver 47namespace OpenSim.Region.CoreModules.World.Archiver
45{ 48{
@@ -82,7 +85,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
82 { 85 {
83 try 86 try
84 { 87 {
85 m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress); 88 m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress, CompressionLevel.BestCompression);
86 } 89 }
87 catch (EntryPointNotFoundException e) 90 catch (EntryPointNotFoundException e)
88 { 91 {
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 881b24a..190f63b 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -166,6 +166,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
166 m_scene.Permissions.OnDeedParcel += CanDeedParcel; 166 m_scene.Permissions.OnDeedParcel += CanDeedParcel;
167 m_scene.Permissions.OnDeedObject += CanDeedObject; 167 m_scene.Permissions.OnDeedObject += CanDeedObject;
168 m_scene.Permissions.OnIsGod += IsGod; 168 m_scene.Permissions.OnIsGod += IsGod;
169 m_scene.Permissions.OnIsGridGod += IsGridGod;
169 m_scene.Permissions.OnIsAdministrator += IsAdministrator; 170 m_scene.Permissions.OnIsAdministrator += IsAdministrator;
170 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; 171 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
171 m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED 172 m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
@@ -466,22 +467,34 @@ namespace OpenSim.Region.CoreModules.World.Permissions
466 if (IsEstateManager(user) && m_RegionManagerIsGod) 467 if (IsEstateManager(user) && m_RegionManagerIsGod)
467 return true; 468 return true;
468 469
470 if (IsGridGod(user, null))
471 return true;
472
473 return false;
474 }
475
476 /// <summary>
477 /// Is the given user a God throughout the grid (not just in the current scene)?
478 /// </summary>
479 /// <param name="user">The user</param>
480 /// <param name="scene">Unused, can be null</param>
481 /// <returns></returns>
482 protected bool IsGridGod(UUID user, Scene scene)
483 {
484 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
485 if (m_bypassPermissions) return m_bypassPermissionsValue;
486
487 if (user == UUID.Zero) return false;
488
469 if (m_allowGridGods) 489 if (m_allowGridGods)
470 { 490 {
471 ScenePresence sp = m_scene.GetScenePresence(user); 491 ScenePresence sp = m_scene.GetScenePresence(user);
472 if (sp != null) 492 if (sp != null)
473 { 493 return (sp.UserLevel >= 200);
474 if (sp.UserLevel >= 200)
475 return true;
476 return false;
477 }
478 494
479 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user); 495 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user);
480 if (account != null) 496 if (account != null)
481 { 497 return (account.UserLevel >= 200);
482 if (account.UserLevel >= 200)
483 return true;
484 }
485 } 498 }
486 499
487 return false; 500 return false;
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index f5623bd..14ae287 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -278,6 +278,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
278 return "FALLDOWN"; 278 return "FALLDOWN";
279 } 279 }
280 280
281 // Check if the user has stopped walking just now
282 if (CurrentMovementAnimation == "WALK" && (move == Vector3.Zero))
283 return "STAND";
284
281 return CurrentMovementAnimation; 285 return CurrentMovementAnimation;
282 } 286 }
283 287
@@ -402,13 +406,16 @@ namespace OpenSim.Region.Framework.Scenes.Animation
402 /// </summary> 406 /// </summary>
403 public void UpdateMovementAnimations() 407 public void UpdateMovementAnimations()
404 { 408 {
405 CurrentMovementAnimation = DetermineMovementAnimation(); 409 lock (m_animations)
410 {
411 CurrentMovementAnimation = DetermineMovementAnimation();
406 412
407// m_log.DebugFormat( 413// m_log.DebugFormat(
408// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()", 414// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
409// CurrentMovementAnimation, m_scenePresence.Name); 415// CurrentMovementAnimation, m_scenePresence.Name);
410 416
411 TrySetMovementAnimation(CurrentMovementAnimation); 417 TrySetMovementAnimation(CurrentMovementAnimation);
418 }
412 } 419 }
413 420
414 public UUID[] GetAnimationArray() 421 public UUID[] GetAnimationArray()
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index e1fedf4..535d87a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -67,6 +67,7 @@ namespace OpenSim.Region.Framework.Scenes
67 public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene); 67 public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene);
68 public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand); 68 public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand);
69 public delegate bool IsGodHandler(UUID user, Scene requestFromScene); 69 public delegate bool IsGodHandler(UUID user, Scene requestFromScene);
70 public delegate bool IsGridGodHandler(UUID user, Scene requestFromScene);
70 public delegate bool IsAdministratorHandler(UUID user); 71 public delegate bool IsAdministratorHandler(UUID user);
71 public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); 72 public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene);
72 public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene); 73 public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene);
@@ -134,6 +135,7 @@ namespace OpenSim.Region.Framework.Scenes
134 public event RunConsoleCommandHandler OnRunConsoleCommand; 135 public event RunConsoleCommandHandler OnRunConsoleCommand;
135 public event IssueEstateCommandHandler OnIssueEstateCommand; 136 public event IssueEstateCommandHandler OnIssueEstateCommand;
136 public event IsGodHandler OnIsGod; 137 public event IsGodHandler OnIsGod;
138 public event IsGridGodHandler OnIsGridGod;
137 public event IsAdministratorHandler OnIsAdministrator; 139 public event IsAdministratorHandler OnIsAdministrator;
138// public event EditParcelHandler OnEditParcel; 140// public event EditParcelHandler OnEditParcel;
139 public event EditParcelPropertiesHandler OnEditParcelProperties; 141 public event EditParcelPropertiesHandler OnEditParcelProperties;
@@ -728,6 +730,21 @@ namespace OpenSim.Region.Framework.Scenes
728 return true; 730 return true;
729 } 731 }
730 732
733 public bool IsGridGod(UUID user)
734 {
735 IsGridGodHandler handler = OnIsGridGod;
736 if (handler != null)
737 {
738 Delegate[] list = handler.GetInvocationList();
739 foreach (IsGridGodHandler h in list)
740 {
741 if (h(user, m_scene) == false)
742 return false;
743 }
744 }
745 return true;
746 }
747
731 public bool IsAdministrator(UUID user) 748 public bool IsAdministrator(UUID user)
732 { 749 {
733 IsAdministratorHandler handler = OnIsAdministrator; 750 IsAdministratorHandler handler = OnIsAdministrator;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e0d5055..311ba6a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -45,6 +45,7 @@ using TeleportFlags = OpenSim.Framework.Constants.TeleportFlags;
45 45
46namespace OpenSim.Region.Framework.Scenes 46namespace OpenSim.Region.Framework.Scenes
47{ 47{
48 [Flags]
48 enum ScriptControlled : uint 49 enum ScriptControlled : uint
49 { 50 {
50 CONTROL_ZERO = 0, 51 CONTROL_ZERO = 0,
@@ -1295,7 +1296,7 @@ namespace OpenSim.Region.Framework.Scenes
1295 { 1296 {
1296// m_log.DebugFormat( 1297// m_log.DebugFormat(
1297// "[SCENE PRESENCE]: In {0} received agent update from {1}, flags {2}", 1298// "[SCENE PRESENCE]: In {0} received agent update from {1}, flags {2}",
1298// Scene.RegionInfo.RegionName, remoteClient.Name, agentData.ControlFlags); 1299// Scene.RegionInfo.RegionName, remoteClient.Name, (AgentManager.ControlFlags)agentData.ControlFlags);
1299 1300
1300 if (IsChildAgent) 1301 if (IsChildAgent)
1301 { 1302 {
@@ -1405,14 +1406,8 @@ namespace OpenSim.Region.Framework.Scenes
1405 } 1406 }
1406 } 1407 }
1407 1408
1408 lock (scriptedcontrols) 1409 uint flagsForScripts = (uint)flags;
1409 { 1410 flags = RemoveIgnoredControls(flags, IgnoredControls);
1410 if (scriptedcontrols.Count > 0)
1411 {
1412 SendControlToScripts((uint)flags);
1413 flags = RemoveIgnoredControls(flags, IgnoredControls);
1414 }
1415 }
1416 1411
1417 if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0) 1412 if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0)
1418 HandleAgentSitOnGround(); 1413 HandleAgentSitOnGround();
@@ -1505,7 +1500,7 @@ namespace OpenSim.Region.Framework.Scenes
1505 MovementFlag |= (byte)nudgehack; 1500 MovementFlag |= (byte)nudgehack;
1506 } 1501 }
1507 1502
1508// m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with {1}", Name, DCF); 1503 //m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with {1}", Name, DCF);
1509 MovementFlag += (byte)(uint)DCF; 1504 MovementFlag += (byte)(uint)DCF;
1510 update_movementflag = true; 1505 update_movementflag = true;
1511 } 1506 }
@@ -1518,7 +1513,7 @@ namespace OpenSim.Region.Framework.Scenes
1518 && ((MovementFlag & (byte)nudgehack) == nudgehack)) 1513 && ((MovementFlag & (byte)nudgehack) == nudgehack))
1519 ) // This or is for Nudge forward 1514 ) // This or is for Nudge forward
1520 { 1515 {
1521// m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with lack of {1}", Name, DCF); 1516 //m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with lack of {1}", Name, DCF);
1522 MovementFlag -= ((byte)(uint)DCF); 1517 MovementFlag -= ((byte)(uint)DCF);
1523 update_movementflag = true; 1518 update_movementflag = true;
1524 1519
@@ -1599,8 +1594,18 @@ namespace OpenSim.Region.Framework.Scenes
1599// } 1594// }
1600// } 1595// }
1601 1596
1602// if (update_movementflag && ParentID == 0) 1597 if (update_movementflag && ParentID == 0)
1603// Animator.UpdateMovementAnimations(); 1598 Animator.UpdateMovementAnimations();
1599
1600 lock (scriptedcontrols)
1601 {
1602 if (scriptedcontrols.Count > 0)
1603 {
1604 // Notify the scripts only after calling UpdateMovementAnimations(), so that if a script
1605 // (e.g., a walking script) checks which animation is active it will be the correct animation.
1606 SendControlToScripts(flagsForScripts);
1607 }
1608 }
1604 } 1609 }
1605 1610
1606 m_scene.EventManager.TriggerOnClientMovement(this); 1611 m_scene.EventManager.TriggerOnClientMovement(this);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 1373971..19f3ce1 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -308,7 +308,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
308 } 308 }
309 SceneObjectPart SensePoint = ts.host; 309 SceneObjectPart SensePoint = ts.host;
310 310
311 Vector3 fromRegionPos = SensePoint.AbsolutePosition; 311 Vector3 fromRegionPos = SensePoint.GetWorldPosition();
312 312
313 // pre define some things to avoid repeated definitions in the loop body 313 // pre define some things to avoid repeated definitions in the loop body
314 Vector3 toRegionPos; 314 Vector3 toRegionPos;
@@ -323,13 +323,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
323 Quaternion q = SensePoint.GetWorldRotation(); // non-attached prim Sensor *always* uses World rotation! 323 Quaternion q = SensePoint.GetWorldRotation(); // non-attached prim Sensor *always* uses World rotation!
324 if (SensePoint.ParentGroup.IsAttachment) 324 if (SensePoint.ParentGroup.IsAttachment)
325 { 325 {
326 // In attachments, the sensor cone always orients with the 326 // In attachments, rotate the sensor cone with the
327 // avatar rotation. This may include a nonzero elevation if 327 // avatar rotation. This may include a nonzero elevation if
328 // in mouselook. 328 // in mouselook.
329 // This will not include the rotation and position of the
330 // attachment point (e.g. your head when a sensor is in your
331 // hair attached to your scull. Your hair will turn with
332 // your head but the sensor will stay with your (global)
333 // avatar rotation and position.
334 // Position of a sensor in a child prim attached to an avatar
335 // will be still wrong.
329 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); 336 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
330 fromRegionPos = avatar.AbsolutePosition; 337 fromRegionPos = avatar.AbsolutePosition;
331 q = avatar.Rotation; 338 q = avatar.Rotation;
332 } 339 }
340
333 LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); 341 LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
334 LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); 342 LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
335 double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); 343 double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);
@@ -441,14 +449,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
441 return sensedEntities; 449 return sensedEntities;
442 450
443 SceneObjectPart SensePoint = ts.host; 451 SceneObjectPart SensePoint = ts.host;
444 Vector3 fromRegionPos = SensePoint.AbsolutePosition; 452 Vector3 fromRegionPos = SensePoint.GetWorldPosition();
445 453
446 Quaternion q = SensePoint.RotationOffset; 454 Quaternion q = SensePoint.GetWorldRotation();
447 if (SensePoint.ParentGroup.IsAttachment) 455 if (SensePoint.ParentGroup.IsAttachment)
448 { 456 {
449 // In attachments, the sensor cone always orients with the 457 // In attachments, rotate the sensor cone with the
450 // avatar rotation. This may include a nonzero elevation if 458 // avatar rotation. This may include a nonzero elevation if
451 // in mouselook. 459 // in mouselook.
460 // This will not include the rotation and position of the
461 // attachment point (e.g. your head when a sensor is in your
462 // hair attached to your scull. Your hair will turn with
463 // your head but the sensor will stay with your (global)
464 // avatar rotation and position.
465 // Position of a sensor in a child prim attached to an avatar
466 // will be still wrong.
452 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); 467 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
453 if (avatar == null) 468 if (avatar == null)
454 return sensedEntities; 469 return sensedEntities;
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
index 75dd711..4a61969 100644
--- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
@@ -33,17 +33,24 @@ using System.Xml;
33 33
34using Nini.Config; 34using Nini.Config;
35using log4net; 35using log4net;
36using OpenMetaverse;
36 37
38using OpenSim.Framework;
37using OpenSim.Server.Base; 39using OpenSim.Server.Base;
38using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
39using OpenSim.Framework.Servers.HttpServer; 41using OpenSim.Framework.Servers.HttpServer;
40using OpenSim.Server.Handlers.Base; 42using OpenSim.Server.Handlers.Base;
41 43
44using GridRegion = OpenSim.Services.Interfaces.GridRegion;
45
42namespace OpenSim.Server.Handlers.MapImage 46namespace OpenSim.Server.Handlers.MapImage
43{ 47{
44 public class MapAddServiceConnector : ServiceConnector 48 public class MapAddServiceConnector : ServiceConnector
45 { 49 {
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51
46 private IMapImageService m_MapService; 52 private IMapImageService m_MapService;
53 private IGridService m_GridService;
47 private string m_ConfigName = "MapImageService"; 54 private string m_ConfigName = "MapImageService";
48 55
49 public MapAddServiceConnector(IConfigSource config, IHttpServer server, string configName) : 56 public MapAddServiceConnector(IConfigSource config, IHttpServer server, string configName) :
@@ -53,16 +60,27 @@ namespace OpenSim.Server.Handlers.MapImage
53 if (serverConfig == null) 60 if (serverConfig == null)
54 throw new Exception(String.Format("No section {0} in config file", m_ConfigName)); 61 throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
55 62
56 string gridService = serverConfig.GetString("LocalServiceModule", 63 string mapService = serverConfig.GetString("LocalServiceModule",
57 String.Empty); 64 String.Empty);
58 65
59 if (gridService == String.Empty) 66 if (mapService == String.Empty)
60 throw new Exception("No LocalServiceModule in config file"); 67 throw new Exception("No LocalServiceModule in config file");
61 68
62 Object[] args = new Object[] { config }; 69 Object[] args = new Object[] { config };
63 m_MapService = ServerUtils.LoadPlugin<IMapImageService>(gridService, args); 70 m_MapService = ServerUtils.LoadPlugin<IMapImageService>(mapService, args);
71
72 string gridService = serverConfig.GetString("GridService", String.Empty);
73 if (gridService != string.Empty)
74 m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
75
76 if (m_GridService != null)
77 m_log.InfoFormat("[MAP IMAGE HANDLER]: GridService check is ON");
78 else
79 m_log.InfoFormat("[MAP IMAGE HANDLER]: GridService check is OFF");
80
81 bool proxy = serverConfig.GetBoolean("HasProxy", false);
82 server.AddStreamHandler(new MapServerPostHandler(m_MapService, m_GridService, proxy));
64 83
65 server.AddStreamHandler(new MapServerPostHandler(m_MapService));
66 } 84 }
67 } 85 }
68 86
@@ -70,11 +88,15 @@ namespace OpenSim.Server.Handlers.MapImage
70 { 88 {
71 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 89 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
72 private IMapImageService m_MapService; 90 private IMapImageService m_MapService;
91 private IGridService m_GridService;
92 bool m_Proxy;
73 93
74 public MapServerPostHandler(IMapImageService service) : 94 public MapServerPostHandler(IMapImageService service, IGridService grid, bool proxy) :
75 base("POST", "/map") 95 base("POST", "/map")
76 { 96 {
77 m_MapService = service; 97 m_MapService = service;
98 m_GridService = grid;
99 m_Proxy = proxy;
78 } 100 }
79 101
80 public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 102 public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
@@ -105,6 +127,27 @@ namespace OpenSim.Server.Handlers.MapImage
105// if (request.ContainsKey("TYPE")) 127// if (request.ContainsKey("TYPE"))
106// type = request["TYPE"].ToString(); 128// type = request["TYPE"].ToString();
107 129
130 if (m_GridService != null)
131 {
132 System.Net.IPAddress ipAddr = GetCallerIP(httpRequest);
133 GridRegion r = m_GridService.GetRegionByPosition(UUID.Zero, x * (int)Constants.RegionSize, y * (int)Constants.RegionSize);
134 if (r != null)
135 {
136 if (r.ExternalEndPoint.Address.ToString() != ipAddr.ToString())
137 {
138 m_log.WarnFormat("[MAP IMAGE HANDLER]: IP address {0} may be trying to impersonate region in IP {1}", ipAddr, r.ExternalEndPoint.Address);
139 return FailureResult("IP address of caller does not match IP address of registered region");
140 }
141
142 }
143 else
144 {
145 m_log.WarnFormat("[MAP IMAGE HANDLER]: IP address {0} may be rogue. Region not found at coordinates {1}-{2}",
146 ipAddr, x, y);
147 return FailureResult("Region not found at given coordinates");
148 }
149 }
150
108 byte[] data = Convert.FromBase64String(request["DATA"].ToString()); 151 byte[] data = Convert.FromBase64String(request["DATA"].ToString());
109 152
110 string reason = string.Empty; 153 string reason = string.Empty;
@@ -183,5 +226,31 @@ namespace OpenSim.Server.Handlers.MapImage
183 226
184 return ms.ToArray(); 227 return ms.ToArray();
185 } 228 }
229
230 private System.Net.IPAddress GetCallerIP(IOSHttpRequest request)
231 {
232 if (!m_Proxy)
233 return request.RemoteIPEndPoint.Address;
234
235 // We're behind a proxy
236 string xff = "X-Forwarded-For";
237 string xffValue = request.Headers[xff.ToLower()];
238 if (xffValue == null || (xffValue != null && xffValue == string.Empty))
239 xffValue = request.Headers[xff];
240
241 if (xffValue == null || (xffValue != null && xffValue == string.Empty))
242 {
243 m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header");
244 return request.RemoteIPEndPoint.Address;
245 }
246
247 System.Net.IPEndPoint ep = Util.GetClientIPFromXFF(xffValue);
248 if (ep != null)
249 return ep.Address;
250
251 // Oops
252 return request.RemoteIPEndPoint.Address;
253 }
254
186 } 255 }
187} 256}
diff --git a/ThirdPartyLicenses/DotNetZip-bzip2.txt b/ThirdPartyLicenses/DotNetZip-bzip2.txt
new file mode 100644
index 0000000..f8b4346
--- /dev/null
+++ b/ThirdPartyLicenses/DotNetZip-bzip2.txt
@@ -0,0 +1,29 @@
1
2The managed BZIP2 code included in Ionic.BZip2.dll and Ionic.Zip.dll is
3modified code, based on the bzip2 code in the Apache commons compress
4library.
5
6The original BZip2 was created by Julian Seward, and is licensed under
7the BSD license.
8
9The following license applies to the Apache code:
10-----------------------------------------------------------------------
11
12/*
13 * Licensed to the Apache Software Foundation (ASF) under one
14 * or more contributor license agreements. See the NOTICE file
15 * distributed with this work for additional information
16 * regarding copyright ownership. The ASF licenses this file
17 * to you under the Apache License, Version 2.0 (the
18 * "License"); you may not use this file except in compliance
19 * with the License. You may obtain a copy of the License at
20 *
21 * http://www.apache.org/licenses/LICENSE-2.0
22 *
23 * Unless required by applicable law or agreed to in writing,
24 * software distributed under the License is distributed on an
25 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
26 * KIND, either express or implied. See the License for the
27 * specific language governing permissions and limitations
28 * under the License.
29 */
diff --git a/ThirdPartyLicenses/DotNetZip-zlib.txt b/ThirdPartyLicenses/DotNetZip-zlib.txt
new file mode 100644
index 0000000..801e941
--- /dev/null
+++ b/ThirdPartyLicenses/DotNetZip-zlib.txt
@@ -0,0 +1,70 @@
1
2The following licenses govern use of the accompanying software, the
3DotNetZip library ("the software"). If you use the software, you accept
4these licenses. If you do not accept the license, do not use the software.
5
6The managed ZLIB code included in Ionic.Zlib.dll and Ionic.Zip.dll is
7modified code, based on jzlib.
8
9
10
11The following notice applies to jzlib:
12-----------------------------------------------------------------------
13
14Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved.
15
16Redistribution and use in source and binary forms, with or without
17modification, are permitted provided that the following conditions are met:
18
191. Redistributions of source code must retain the above copyright notice,
20this list of conditions and the following disclaimer.
21
222. Redistributions in binary form must reproduce the above copyright
23notice, this list of conditions and the following disclaimer in
24the documentation and/or other materials provided with the distribution.
25
263. The names of the authors may not be used to endorse or promote products
27derived from this software without specific prior written permission.
28
29THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
30INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
31FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
32INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
33INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
35OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
36LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
37NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
38EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
40-----------------------------------------------------------------------
41
42jzlib is based on zlib-1.1.3.
43
44The following notice applies to zlib:
45
46-----------------------------------------------------------------------
47
48Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler
49
50 The ZLIB software is provided 'as-is', without any express or implied
51 warranty. In no event will the authors be held liable for any damages
52 arising from the use of this software.
53
54 Permission is granted to anyone to use this software for any purpose,
55 including commercial applications, and to alter it and redistribute it
56 freely, subject to the following restrictions:
57
58 1. The origin of this software must not be misrepresented; you must not
59 claim that you wrote the original software. If you use this software
60 in a product, an acknowledgment in the product documentation would be
61 appreciated but is not required.
62 2. Altered source versions must be plainly marked as such, and must not be
63 misrepresented as being the original software.
64 3. This notice may not be removed or altered from any source distribution.
65
66 Jean-loup Gailly jloup@gzip.org
67 Mark Adler madler@alumni.caltech.edu
68
69
70-----------------------------------------------------------------------
diff --git a/ThirdPartyLicenses/DotNetZip.txt b/ThirdPartyLicenses/DotNetZip.txt
new file mode 100644
index 0000000..c3103fd
--- /dev/null
+++ b/ThirdPartyLicenses/DotNetZip.txt
@@ -0,0 +1,33 @@
1Microsoft Public License (Ms-PL)
2
3This license governs use of the accompanying software, the DotNetZip library ("the software"). If you use the software, you accept this license. If you do not accept the license, do not use the software.
4
51. Definitions
6
7The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
8
9A "contribution" is the original software, or any additions or changes to the software.
10
11A "contributor" is any person that distributes its contribution under this license.
12
13"Licensed patents" are a contributor's patent claims that read directly on its contribution.
14
152. Grant of Rights
16
17(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
18
19(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
20
213. Conditions and Limitations
22
23(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
24
25(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
26
27(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
28
29(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
30
31(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
32
33
diff --git a/bin/Ionic.Zip.dll b/bin/Ionic.Zip.dll
new file mode 100644
index 0000000..95fa928
--- /dev/null
+++ b/bin/Ionic.Zip.dll
Binary files differ
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example
index 4ea5ffd..be75407 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -279,6 +279,13 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
279 LocalServiceModule = "OpenSim.Services.MapImageService.dll:MapImageService" 279 LocalServiceModule = "OpenSim.Services.MapImageService.dll:MapImageService"
280 ; Set this if you want to change the default 280 ; Set this if you want to change the default
281 ; TilesStoragePath = "maptiles" 281 ; TilesStoragePath = "maptiles"
282 ;
283 ; If for some reason you have the AddMapTile service outside the firewall (e.g. 8002),
284 ; you may want to set this. Otherwise, don't set it, because it's already protected.
285 ; GridService = "OpenSim.Services.GridService.dll:GridService"
286 ;
287 ; Additionally, if you run this server behind a proxy, set this to true
288 ; HasProxy = false
282 289
283[GridInfoService] 290[GridInfoService]
284 ; These settings are used to return information on a get_grid_info call. 291 ; These settings are used to return information on a get_grid_info call.
diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example
index 69e94a5..582af27 100644
--- a/bin/Robust.ini.example
+++ b/bin/Robust.ini.example
@@ -254,6 +254,14 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
254 LocalServiceModule = "OpenSim.Services.MapImageService.dll:MapImageService" 254 LocalServiceModule = "OpenSim.Services.MapImageService.dll:MapImageService"
255 ; Set this if you want to change the default 255 ; Set this if you want to change the default
256 ; TilesStoragePath = "maptiles" 256 ; TilesStoragePath = "maptiles"
257 ;
258 ; If for some reason you have the AddMapTile service outside the firewall (e.g. 8002),
259 ; you may want to set this. Otherwise, don't set it, because it's already protected.
260 ; GridService = "OpenSim.Services.GridService.dll:GridService"
261 ;
262 ; Additionally, if you run this server behind a proxy, set this to true
263 ; HasProxy = false
264
257 265
258 266
259[GridInfoService] 267[GridInfoService]
diff --git a/prebuild.xml b/prebuild.xml
index b908649..c840f03 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -1567,6 +1567,7 @@
1567 <Reference name="OpenSim.Services.Connectors"/> 1567 <Reference name="OpenSim.Services.Connectors"/>
1568 <Reference name="OpenSim.Services.Base"/> 1568 <Reference name="OpenSim.Services.Base"/>
1569 <Reference name="OpenSim.Services.Interfaces"/> 1569 <Reference name="OpenSim.Services.Interfaces"/>
1570 <Reference name="Ionic.Zip" path="../../../bin/"/>
1570 1571
1571 <Reference name="GlynnTucker.Cache" path="../../../bin/"/> 1572 <Reference name="GlynnTucker.Cache" path="../../../bin/"/>
1572 1573