aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs9
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs61
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs9
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs34
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs6
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs5
11 files changed, 95 insertions, 58 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 771038e..9d8082b 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -41,8 +41,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
41 /// </summary> 41 /// </summary>
42 public class AgentAssetTransactions 42 public class AgentAssetTransactions
43 { 43 {
44// private static readonly ILog m_log = LogManager.GetLogger( 44// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45// MethodBase.GetCurrentMethod().DeclaringType);
46 45
47 // Fields 46 // Fields
48 private bool m_dumpAssetsToFile; 47 private bool m_dumpAssetsToFile;
@@ -149,6 +148,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
149 148
150 if (asset != null) 149 if (asset != null)
151 { 150 {
151// m_log.DebugFormat(
152// "[AGENT ASSETS TRANSACTIONS]: Updating item {0} in {1} for transaction {2}",
153// item.Name, part.Name, transactionID);
154
152 asset.FullID = UUID.Random(); 155 asset.FullID = UUID.Random();
153 asset.Name = item.Name; 156 asset.Name = item.Name;
154 asset.Description = item.Description; 157 asset.Description = item.Description;
@@ -156,8 +159,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
156 item.AssetID = asset.FullID; 159 item.AssetID = asset.FullID;
157 160
158 m_Scene.AssetService.Store(asset); 161 m_Scene.AssetService.Store(asset);
159
160 part.Inventory.UpdateInventoryItem(item);
161 } 162 }
162 } 163 }
163 } 164 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
index deec444..fc1ddef 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
70 if (meshConfig == null) 70 if (meshConfig == null)
71 return; 71 return;
72 72
73 m_enabled = meshConfig.GetBoolean("ColladaMesh", true); 73 m_enabled = meshConfig.GetBoolean("AllowMeshUpload", true);
74 } 74 }
75 75
76 public void AddRegion(Scene pScene) 76 public void AddRegion(Scene pScene)
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
index d651cb2..3d4c7b7 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
72 if (meshConfig == null) 72 if (meshConfig == null)
73 return; 73 return;
74 74
75 m_enabled = meshConfig.GetBoolean("ColladaMesh", true); 75 m_enabled = meshConfig.GetBoolean("AllowMeshUpload", true);
76 } 76 }
77 77
78 public void AddRegion(Scene pScene) 78 public void AddRegion(Scene pScene)
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index ff26264..520d794 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -562,14 +562,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
562 /// <param name="sp"></param> 562 /// <param name="sp"></param>
563 /// <param name="so"></param> 563 /// <param name="so"></param>
564 /// <param name="attachmentpoint"></param> 564 /// <param name="attachmentpoint"></param>
565 /// <param name="AttachOffset"></param> 565 /// <param name="attachOffset"></param>
566 /// <param name="silent"></param> 566 /// <param name="silent"></param>
567 protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 AttachOffset, bool silent) 567 protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent)
568 { 568 {
569 // don't attach attachments to child agents
570 if (avatar.IsChildAgent) return;
571 569
572// m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1}", Name, avatar.Name); 570 m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", Name, avatar.Name,
571 attachmentpoint, attachOffset, so.RootPart.AttachedPos);
573 572
574 so.DetachFromBackup(); 573 so.DetachFromBackup();
575 574
@@ -590,8 +589,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
590 so.RootPart.PhysActor = null; 589 so.RootPart.PhysActor = null;
591 } 590 }
592 591
593 so.AbsolutePosition = AttachOffset; 592 so.AbsolutePosition = attachOffset;
594 so.RootPart.AttachedPos = AttachOffset; 593 so.RootPart.AttachedPos = attachOffset;
595 so.RootPart.IsAttachment = true; 594 so.RootPart.IsAttachment = true;
596 595
597 so.RootPart.SetParentLocalId(avatar.LocalId); 596 so.RootPart.SetParentLocalId(avatar.LocalId);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index c88be7d..1054785 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -285,11 +285,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
285 } 285 }
286 286
287 string reason; 287 string reason;
288 if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out reason)) 288 string version;
289 if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out version, out reason))
289 { 290 {
290 sp.ControllingClient.SendTeleportFailed("Teleport failed: " + reason); 291 sp.ControllingClient.SendTeleportFailed("Teleport failed: " + reason);
291 return; 292 return;
292 } 293 }
294 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Destination is running version {0}", version);
293 295
294 sp.ControllingClient.SendTeleportStart(teleportFlags); 296 sp.ControllingClient.SendTeleportStart(teleportFlags);
295 297
@@ -371,20 +373,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
371 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); 373 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
372 } 374 }
373 375
374 // Expect avatar crossing is a heavy-duty function at the destination.
375 // That is where MakeRoot is called, which fetches appearance and inventory.
376 // Plus triggers OnMakeRoot, which spawns a series of asynchronous updates.
377 //m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId,
378 // position, false);
379
380 //{
381 // avatar.ControllingClient.SendTeleportFailed("Problem with destination.");
382 // // We should close that agent we just created over at destination...
383 // List<ulong> lst = new List<ulong>();
384 // lst.Add(reg.RegionHandle);
385 // SendCloseChildAgentAsync(avatar.UUID, lst);
386 // return;
387 //}
388 376
389 SetInTransit(sp.UUID); 377 SetInTransit(sp.UUID);
390 378
@@ -426,7 +414,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
426 414
427 // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which 415 // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which
428 // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation 416 // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation
429 // that the client contacted the destination before we send the attachments and close things here. 417 // that the client contacted the destination before we close things here.
430 if (!WaitForCallback(sp.UUID)) 418 if (!WaitForCallback(sp.UUID))
431 { 419 {
432 m_log.WarnFormat( 420 m_log.WarnFormat(
@@ -437,14 +425,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
437 return; 425 return;
438 } 426 }
439 427
440 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it 428 // For backwards compatibility
441 CrossAttachmentsIntoNewRegion(finalDestination, sp, true); 429 if (version == "Unknown" || version == string.Empty)
430 {
431 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
432 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one...");
433 CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
434 }
435
436 // May need to logout or other cleanup
437 AgentHasMovedAway(sp, logout);
442 438
443 // Well, this is it. The agent is over there. 439 // Well, this is it. The agent is over there.
444 KillEntity(sp.Scene, sp.LocalId); 440 KillEntity(sp.Scene, sp.LocalId);
445 441
446 // May need to logout or other cleanup
447 AgentHasMovedAway(sp.ControllingClient.SessionId, logout);
448 442
449 // Now let's make it officially a child agent 443 // Now let's make it officially a child agent
450 sp.MakeChildAgent(); 444 sp.MakeChildAgent();
@@ -513,8 +507,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
513 507
514 } 508 }
515 509
516 protected virtual void AgentHasMovedAway(UUID sessionID, bool logout) 510 protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout)
517 { 511 {
512 foreach (SceneObjectGroup sop in sp.Attachments)
513 {
514 sop.Scene.DeleteSceneObject(sop, true);
515 }
516 sp.Attachments.Clear();
518 } 517 }
519 518
520 protected void KillEntity(Scene scene, uint localID) 519 protected void KillEntity(Scene scene, uint localID)
@@ -784,7 +783,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
784 GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); 783 GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
785 784
786 string reason; 785 string reason;
787 if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos, out reason)) 786 string version;
787 if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos, out version, out reason))
788 { 788 {
789 agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel"); 789 agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel");
790 if (r == null) 790 if (r == null)
@@ -804,7 +804,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
804 agent.InTransit(); 804 agent.InTransit();
805 805
806 CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync; 806 CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync;
807 d.BeginInvoke(agent, newpos, neighbourx, neighboury, neighbourRegion, isFlying, CrossAgentToNewRegionCompleted, d); 807 d.BeginInvoke(agent, newpos, neighbourx, neighboury, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d);
808 808
809 return true; 809 return true;
810 } 810 }
@@ -861,17 +861,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
861 icon.EndInvoke(iar); 861 icon.EndInvoke(iar);
862 } 862 }
863 863
864 public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying); 864 public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying, string version);
865 865
866 /// <summary> 866 /// <summary>
867 /// This Closes child agents on neighbouring regions 867 /// This Closes child agents on neighbouring regions
868 /// Calls an asynchronous method to do so.. so it doesn't lag the sim. 868 /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
869 /// </summary> 869 /// </summary>
870 protected ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying) 870 protected ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying, string version)
871 { 871 {
872 ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); 872 ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
873 873
874 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} to {2}-{3}", agent.Firstname, agent.Lastname, neighbourx, neighboury); 874 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} to {2}-{3} running version {4}", agent.Firstname, agent.Lastname, neighbourx, neighboury, version);
875 875
876 Scene m_scene = agent.Scene; 876 Scene m_scene = agent.Scene;
877 877
@@ -945,7 +945,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
945 agent.SendOtherAgentsAvatarDataToMe(); 945 agent.SendOtherAgentsAvatarDataToMe();
946 agent.SendOtherAgentsAppearanceToMe(); 946 agent.SendOtherAgentsAppearanceToMe();
947 947
948 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); 948 // Backwards compatibility
949 if (version == "Unknown" || version == string.Empty)
950 {
951 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one...");
952 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
953 }
954
955 AgentHasMovedAway(agent, false);
949 956
950 // the user may change their profile information in other region, 957 // the user may change their profile information in other region,
951 // so the userinfo in UserProfileCache is not reliable any more, delete it 958 // so the userinfo in UserProfileCache is not reliable any more, delete it
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 79e76b4..5c53f78 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -142,11 +142,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
142 return false; 142 return false;
143 } 143 }
144 144
145 protected override void AgentHasMovedAway(UUID sessionID, bool logout) 145 protected override void AgentHasMovedAway(ScenePresence sp, bool logout)
146 { 146 {
147 base.AgentHasMovedAway(sp, logout);
147 if (logout) 148 if (logout)
148 // Log them out of this grid 149 // Log them out of this grid
149 m_aScene.PresenceService.LogoutAgent(sessionID); 150 m_aScene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId);
150 } 151 }
151 152
152 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) 153 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index c7244c8..6dd871f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -182,9 +182,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
182 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 182 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
183 { 183 {
184 InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID); 184 InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID);
185 if (UserManager != null) 185 Util.FireAndForget(delegate
186 foreach (InventoryItemBase item in invCol.Items) 186 {
187 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); 187 if (UserManager != null)
188 foreach (InventoryItemBase item in invCol.Items)
189 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
190 });
188 191
189 return invCol; 192 return invCol;
190 } 193 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
index bd01bb9..8f1f257 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
@@ -46,10 +46,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
46 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 private bool m_Enabled = false; 48 private bool m_Enabled = false;
49 private bool m_Initialized = false; 49 private Scene m_Scene;
50// private Scene m_Scene;
51 private XInventoryServicesConnector m_RemoteConnector; 50 private XInventoryServicesConnector m_RemoteConnector;
52 51
52 private IUserManagement m_UserManager;
53 private IUserManagement UserManager
54 {
55 get
56 {
57 if (m_UserManager == null)
58 {
59 m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>();
60 }
61 return m_UserManager;
62 }
63 }
64
53 public Type ReplaceableInterface 65 public Type ReplaceableInterface
54 { 66 {
55 get { return null; } 67 get { return null; }
@@ -114,12 +126,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
114 if (!m_Enabled) 126 if (!m_Enabled)
115 return; 127 return;
116 128
117 if (!m_Initialized)
118 {
119 m_Initialized = true;
120 }
121
122 scene.RegisterModuleInterface<IInventoryService>(this); 129 scene.RegisterModuleInterface<IInventoryService>(this);
130
131 if (m_Scene == null)
132 m_Scene = scene;
123 } 133 }
124 134
125 public void RemoveRegion(Scene scene) 135 public void RemoveRegion(Scene scene)
@@ -173,7 +183,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
173 183
174 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 184 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
175 { 185 {
176 return m_RemoteConnector.GetFolderContent(userID, folderID); 186 InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID);
187 Util.FireAndForget(delegate
188 {
189 if (UserManager != null)
190 foreach (InventoryItemBase item in invCol.Items)
191 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
192 });
193
194 return invCol;
177 } 195 }
178 196
179 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 197 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index a298b65..2cf02b5 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -41,6 +41,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
41 public class LocalSimulationConnectorModule : ISharedRegionModule, ISimulationService 41 public class LocalSimulationConnectorModule : ISharedRegionModule, ISimulationService
42 { 42 {
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 // Version of this service
45 private const string m_Version = "SIMULATION/0.1";
46
44 private List<Scene> m_sceneList = new List<Scene>(); 47 private List<Scene> m_sceneList = new List<Scene>();
45 48
46 private IEntityTransferModule m_AgentTransferModule; 49 private IEntityTransferModule m_AgentTransferModule;
@@ -257,9 +260,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
257 return false; 260 return false;
258 } 261 }
259 262
260 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string reason) 263 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
261 { 264 {
262 reason = "Communications failure"; 265 reason = "Communications failure";
266 version = m_Version;
263 if (destination == null) 267 if (destination == null)
264 return false; 268 return false;
265 269
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index 67f4d60..7858f2a 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
@@ -229,19 +229,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
229 229
230 } 230 }
231 231
232 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string reason) 232 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
233 { 233 {
234 reason = "Communications failure"; 234 reason = "Communications failure";
235 version = "Unknown";
235 if (destination == null) 236 if (destination == null)
236 return false; 237 return false;
237 238
238 // Try local first 239 // Try local first
239 if (m_localBackend.QueryAccess(destination, id, position, out reason)) 240 if (m_localBackend.QueryAccess(destination, id, position, out version, out reason))
240 return true; 241 return true;
241 242
242 // else do the remote thing 243 // else do the remote thing
243 if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) 244 if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
244 return m_remoteConnector.QueryAccess(destination, id, position, out reason); 245 return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason);
245 246
246 return false; 247 return false;
247 248
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index ab90e90..3aed6ba 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -125,7 +125,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
125 else 125 else
126 Scene.RegionInfo.RegionSettings.AllowLandResell = true; 126 Scene.RegionInfo.RegionSettings.AllowLandResell = true;
127 127
128 Scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents; 128 if((byte)maxAgents <= Scene.RegionInfo.AgentCapacity)
129 Scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents;
130 else
131 Scene.RegionInfo.RegionSettings.AgentLimit = Scene.RegionInfo.AgentCapacity;
129 132
130 Scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor; 133 Scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor;
131 134