diff options
author | Melanie | 2011-05-14 21:09:52 +0100 |
---|---|---|
committer | Melanie | 2011-05-14 21:09:52 +0100 |
commit | 37a7b8786248e3af9774b8051dc29001b49179bd (patch) | |
tree | 18f5ae3490fe16ddf906482ef578bb590291d592 /OpenSim | |
parent | Globally throttle script channel 0 comms to 5/s with 10s burst to prevent lag (diff) | |
parent | Also changed a couple of messages in WebUtil from Wanr/Info to Debug. (diff) | |
download | opensim-SC-37a7b8786248e3af9774b8051dc29001b49179bd.zip opensim-SC-37a7b8786248e3af9774b8051dc29001b49179bd.tar.gz opensim-SC-37a7b8786248e3af9774b8051dc29001b49179bd.tar.bz2 opensim-SC-37a7b8786248e3af9774b8051dc29001b49179bd.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim')
12 files changed, 109 insertions, 89 deletions
diff --git a/OpenSim/Framework/ILandObject.cs b/OpenSim/Framework/ILandObject.cs index 5a55b02..0316944 100644 --- a/OpenSim/Framework/ILandObject.cs +++ b/OpenSim/Framework/ILandObject.cs | |||
@@ -35,8 +35,8 @@ namespace OpenSim.Framework | |||
35 | 35 | ||
36 | public interface ILandObject | 36 | public interface ILandObject |
37 | { | 37 | { |
38 | int GetParcelMaxPrimCount(ILandObject thisObject); | 38 | int GetParcelMaxPrimCount(); |
39 | int GetSimulatorMaxPrimCount(ILandObject thisObject); | 39 | int GetSimulatorMaxPrimCount(); |
40 | int GetPrimsFree(); | 40 | int GetPrimsFree(); |
41 | 41 | ||
42 | LandData LandData { get; set; } | 42 | LandData LandData { get; set; } |
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 5211157..f8691dc 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -251,11 +251,11 @@ namespace OpenSim.Framework | |||
251 | // This just dumps a warning for any operation that takes more than 100 ms | 251 | // This just dumps a warning for any operation that takes more than 100 ms |
252 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); | 252 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); |
253 | if (tickdiff > LongCallTime) | 253 | if (tickdiff > LongCallTime) |
254 | m_log.InfoFormat("[WEB UTIL]: osd request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing", | 254 | m_log.DebugFormat("[WEB UTIL]: osd request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing", |
255 | reqnum,url,method,tickdiff,tickdata); | 255 | reqnum,url,method,tickdiff,tickdata); |
256 | } | 256 | } |
257 | 257 | ||
258 | m_log.WarnFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage); | 258 | m_log.DebugFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage); |
259 | return ErrorResponseMap(errorMessage); | 259 | return ErrorResponseMap(errorMessage); |
260 | } | 260 | } |
261 | 261 | ||
@@ -986,8 +986,11 @@ namespace OpenSim.Framework | |||
986 | 986 | ||
987 | try | 987 | try |
988 | { | 988 | { |
989 | using (WebResponse resp = request.GetResponse()) | 989 | using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse()) |
990 | { | 990 | { |
991 | if (resp.StatusCode == HttpStatusCode.NotFound) | ||
992 | return deserial; | ||
993 | |||
991 | if (resp.ContentLength != 0) | 994 | if (resp.ContentLength != 0) |
992 | { | 995 | { |
993 | Stream respStream = resp.GetResponseStream(); | 996 | Stream respStream = resp.GetResponseStream(); |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 930a117..d11d677 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -365,12 +365,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
365 | 365 | ||
366 | landData.Add(parcel); | 366 | landData.Add(parcel); |
367 | } | 367 | } |
368 | 368 | ||
369 | if (!m_merge) | 369 | if (!m_merge) |
370 | m_scene.LandChannel.Clear(false); | 370 | { |
371 | bool setupDefaultParcel = (landData.Count == 0); | ||
372 | m_scene.LandChannel.Clear(setupDefaultParcel); | ||
373 | } | ||
371 | 374 | ||
372 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); | 375 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); |
373 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); | 376 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); |
374 | } | 377 | } |
375 | 378 | ||
376 | /// <summary> | 379 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 2307c8e..729e9f7 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -313,6 +313,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
313 | Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null"); | 313 | Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null"); |
314 | Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match"); | 314 | Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match"); |
315 | 315 | ||
316 | Assert.Greater(m_scene.LandChannel.AllParcels().Count, 0, "incorrect number of parcels"); | ||
317 | |||
316 | // Temporary | 318 | // Temporary |
317 | Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); | 319 | Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); |
318 | } | 320 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index f28faed..4e7c76f 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -437,8 +437,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
437 | } | 437 | } |
438 | } | 438 | } |
439 | 439 | ||
440 | /// <summary> | ||
441 | /// Like handleEventManagerOnSignificantClientMovement, but called with an AgentUpdate regardless of distance. | ||
442 | /// </summary> | ||
443 | /// <param name="avatar"></param> | ||
440 | public void EventManagerOnClientMovement(ScenePresence avatar) | 444 | public void EventManagerOnClientMovement(ScenePresence avatar) |
441 | //Like handleEventManagerOnSignificantClientMovement, but called with an AgentUpdate regardless of distance. | 445 | // |
442 | { | 446 | { |
443 | ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 447 | ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
444 | if (over != null) | 448 | if (over != null) |
@@ -451,7 +455,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
451 | } | 455 | } |
452 | } | 456 | } |
453 | 457 | ||
454 | |||
455 | public void ClientOnParcelAccessListRequest(UUID agentID, UUID sessionID, uint flags, int sequenceID, | 458 | public void ClientOnParcelAccessListRequest(UUID agentID, UUID sessionID, uint flags, int sequenceID, |
456 | int landLocalID, IClientAPI remote_client) | 459 | int landLocalID, IClientAPI remote_client) |
457 | { | 460 | { |
@@ -585,14 +588,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
585 | //m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID); | 588 | //m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID); |
586 | m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID); | 589 | m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID); |
587 | } | 590 | } |
588 | 591 | ||
589 | m_landList.Clear(); | 592 | m_landList.Clear(); |
593 | |||
594 | ResetSimLandObjects(); | ||
595 | |||
596 | if (setupDefaultParcel) | ||
597 | CreateDefaultParcel(); | ||
590 | } | 598 | } |
591 | |||
592 | ResetSimLandObjects(); | ||
593 | |||
594 | if (setupDefaultParcel) | ||
595 | CreateDefaultParcel(); | ||
596 | } | 599 | } |
597 | 600 | ||
598 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 601 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
@@ -1324,8 +1327,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1324 | 1327 | ||
1325 | public void EventManagerOnNoLandDataFromStorage() | 1328 | public void EventManagerOnNoLandDataFromStorage() |
1326 | { | 1329 | { |
1327 | ResetSimLandObjects(); | 1330 | lock (m_landList) |
1328 | CreateDefaultParcel(); | 1331 | { |
1332 | ResetSimLandObjects(); | ||
1333 | CreateDefaultParcel(); | ||
1334 | } | ||
1329 | } | 1335 | } |
1330 | 1336 | ||
1331 | #endregion | 1337 | #endregion |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 0fbc93c..6c9bb10 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
67 | public int GetPrimsFree() | 67 | public int GetPrimsFree() |
68 | { | 68 | { |
69 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); | 69 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); |
70 | int free = GetSimulatorMaxPrimCount(this) - m_landData.SimwidePrims; | 70 | int free = GetSimulatorMaxPrimCount() - m_landData.SimwidePrims; |
71 | return free; | 71 | return free; |
72 | } | 72 | } |
73 | 73 | ||
@@ -181,11 +181,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
181 | overrideSimulatorMaxPrimCount = overrideDel; | 181 | overrideSimulatorMaxPrimCount = overrideDel; |
182 | } | 182 | } |
183 | 183 | ||
184 | public int GetParcelMaxPrimCount(ILandObject thisObject) | 184 | public int GetParcelMaxPrimCount() |
185 | { | 185 | { |
186 | if (overrideParcelMaxPrimCount != null) | 186 | if (overrideParcelMaxPrimCount != null) |
187 | { | 187 | { |
188 | return overrideParcelMaxPrimCount(thisObject); | 188 | return overrideParcelMaxPrimCount(this); |
189 | } | 189 | } |
190 | else | 190 | else |
191 | { | 191 | { |
@@ -197,11 +197,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
197 | return parcelMax; | 197 | return parcelMax; |
198 | } | 198 | } |
199 | } | 199 | } |
200 | public int GetSimulatorMaxPrimCount(ILandObject thisObject) | 200 | |
201 | public int GetSimulatorMaxPrimCount() | ||
201 | { | 202 | { |
202 | if (overrideSimulatorMaxPrimCount != null) | 203 | if (overrideSimulatorMaxPrimCount != null) |
203 | { | 204 | { |
204 | return overrideSimulatorMaxPrimCount(thisObject); | 205 | return overrideSimulatorMaxPrimCount(this); |
205 | } | 206 | } |
206 | else | 207 | else |
207 | { | 208 | { |
@@ -244,8 +245,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
244 | remote_client.SendLandProperties(seq_id, | 245 | remote_client.SendLandProperties(seq_id, |
245 | snap_selection, request_result, this, | 246 | snap_selection, request_result, this, |
246 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, | 247 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, |
247 | GetParcelMaxPrimCount(this), | 248 | GetParcelMaxPrimCount(), |
248 | GetSimulatorMaxPrimCount(this), regionFlags); | 249 | GetSimulatorMaxPrimCount(), regionFlags); |
249 | } | 250 | } |
250 | 251 | ||
251 | public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client) | 252 | public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client) |
diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs index c2934cd..7f6f4df 100644 --- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs | |||
@@ -82,14 +82,14 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
82 | false, "region restart bluebox", | 82 | false, "region restart bluebox", |
83 | "region restart bluebox <message> <delta seconds>+", | 83 | "region restart bluebox <message> <delta seconds>+", |
84 | "Schedule a region restart", | 84 | "Schedule a region restart", |
85 | "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.", | 85 | "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.", |
86 | HandleRegionRestart); | 86 | HandleRegionRestart); |
87 | 87 | ||
88 | MainConsole.Instance.Commands.AddCommand("RestartModule", | 88 | MainConsole.Instance.Commands.AddCommand("RestartModule", |
89 | false, "region restart notice", | 89 | false, "region restart notice", |
90 | "region restart notice <message> <delta seconds>+", | 90 | "region restart notice <message> <delta seconds>+", |
91 | "Schedule a region restart", | 91 | "Schedule a region restart", |
92 | "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.", | 92 | "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.", |
93 | HandleRegionRestart); | 93 | HandleRegionRestart); |
94 | 94 | ||
95 | MainConsole.Instance.Commands.AddCommand("RestartModule", | 95 | MainConsole.Instance.Commands.AddCommand("RestartModule", |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 1c30a35..17242dc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -927,9 +927,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
927 | uint callbackID, string description, string name, | 927 | uint callbackID, string description, string name, |
928 | sbyte invType, sbyte type, UUID olditemID) | 928 | sbyte invType, sbyte type, UUID olditemID) |
929 | { | 929 | { |
930 | m_log.DebugFormat( | 930 | // m_log.DebugFormat( |
931 | "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}", | 931 | // "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}", |
932 | remoteClient.Name, name, folderID, olditemID); | 932 | // remoteClient.Name, name, folderID, olditemID); |
933 | 933 | ||
934 | if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) | 934 | if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) |
935 | return; | 935 | return; |
@@ -937,20 +937,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
937 | ScenePresence presence; | 937 | ScenePresence presence; |
938 | if (TryGetScenePresence(remoteClient.AgentId, out presence)) | 938 | if (TryGetScenePresence(remoteClient.AgentId, out presence)) |
939 | { | 939 | { |
940 | bool linkAlreadyExists = false; | 940 | // Disabled the check for duplicate links. |
941 | List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID); | 941 | // |
942 | foreach (InventoryItemBase item in existingItems) | 942 | // When outfits are being adjusted, the viewer rapidly sends delete link messages followed by |
943 | if (item.AssetID == olditemID) | 943 | // create links. However, since these are handled asynchronously, the deletes do not complete before |
944 | linkAlreadyExists = true; | 944 | // the creates are handled. Therefore, we cannot enforce a duplicate link check. |
945 | 945 | // InventoryItemBase existingLink = null; | |
946 | if (linkAlreadyExists) | 946 | // List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID); |
947 | { | 947 | // foreach (InventoryItemBase item in existingItems) |
948 | m_log.WarnFormat( | 948 | // if (item.AssetID == olditemID) |
949 | "[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link already exists", | 949 | // existingLink = item; |
950 | remoteClient.Name, name, folderID, olditemID); | 950 | // |
951 | 951 | // if (existingLink != null) | |
952 | return; | 952 | // { |
953 | } | 953 | // m_log.WarnFormat( |
954 | // "[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link named {4} with id {5} already exists", | ||
955 | // remoteClient.Name, name, folderID, olditemID, existingLink.Name, existingLink.ID); | ||
956 | // | ||
957 | // return; | ||
958 | // } | ||
954 | 959 | ||
955 | AssetBase asset = new AssetBase(); | 960 | AssetBase asset = new AssetBase(); |
956 | asset.FullID = olditemID; | 961 | asset.FullID = olditemID; |
@@ -978,7 +983,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
978 | /// <param name="itemID"></param> | 983 | /// <param name="itemID"></param> |
979 | private void RemoveInventoryItem(IClientAPI remoteClient, List<UUID> itemIDs) | 984 | private void RemoveInventoryItem(IClientAPI remoteClient, List<UUID> itemIDs) |
980 | { | 985 | { |
981 | //m_log.Debug("[SCENE INVENTORY]: user " + remoteClient.AgentId); | 986 | // m_log.DebugFormat( |
987 | // "[AGENT INVENTORY]: Removing inventory items {0} for {1}", | ||
988 | // string.Join(",", itemIDs.ConvertAll<string>(uuid => uuid.ToString()).ToArray()), | ||
989 | // remoteClient.Name); | ||
990 | |||
982 | InventoryService.DeleteItems(remoteClient.AgentId, itemIDs); | 991 | InventoryService.DeleteItems(remoteClient.AgentId, itemIDs); |
983 | } | 992 | } |
984 | 993 | ||
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index 471b90f..c1957e2 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | |||
@@ -76,22 +76,24 @@ namespace OpenSim.Region.OptionalModules | |||
76 | 76 | ||
77 | public void AddRegion(Scene scene) | 77 | public void AddRegion(Scene scene) |
78 | { | 78 | { |
79 | if(!m_enabled) | 79 | if (!m_enabled) |
80 | { | 80 | { |
81 | return; | 81 | return; |
82 | } | 82 | } |
83 | scene.Permissions.OnRezObject += CanRezObject; | 83 | scene.Permissions.OnRezObject += CanRezObject; |
84 | scene.Permissions.OnObjectEntry += CanObjectEnter; | 84 | scene.Permissions.OnObjectEntry += CanObjectEnter; |
85 | scene.Permissions.OnDuplicateObject += CanDuplicateObject; | 85 | scene.Permissions.OnDuplicateObject += CanDuplicateObject; |
86 | |||
86 | m_log.DebugFormat("[PRIM LIMITS]: Region {0} added", scene.RegionInfo.RegionName); | 87 | m_log.DebugFormat("[PRIM LIMITS]: Region {0} added", scene.RegionInfo.RegionName); |
87 | } | 88 | } |
88 | 89 | ||
89 | public void RemoveRegion(Scene scene) | 90 | public void RemoveRegion(Scene scene) |
90 | { | 91 | { |
91 | if(m_enabled) | 92 | if (m_enabled) |
92 | { | 93 | { |
93 | return; | 94 | return; |
94 | } | 95 | } |
96 | |||
95 | scene.Permissions.OnRezObject -= CanRezObject; | 97 | scene.Permissions.OnRezObject -= CanRezObject; |
96 | scene.Permissions.OnObjectEntry -= CanObjectEnter; | 98 | scene.Permissions.OnObjectEntry -= CanObjectEnter; |
97 | scene.Permissions.OnDuplicateObject -= CanDuplicateObject; | 99 | scene.Permissions.OnDuplicateObject -= CanDuplicateObject; |
@@ -104,13 +106,11 @@ namespace OpenSim.Region.OptionalModules | |||
104 | 106 | ||
105 | private bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene) | 107 | private bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene) |
106 | { | 108 | { |
107 | // This may be a little long winded and can probably be optomized | 109 | ILandObject lo = scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); |
108 | int usedPrims = scene.LandChannel.GetLandObject(objectPosition.X,objectPosition.Y).PrimCounts.Total; | 110 | int usedPrims = lo.PrimCounts.Total; |
109 | LandData landData = scene.LandChannel.GetLandObject(objectPosition.X,objectPosition.Y).LandData; | 111 | int simulatorCapacity = lo.GetSimulatorMaxPrimCount(); |
110 | int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) * | ||
111 | (float)scene.RegionInfo.ObjectCapacity * (float)scene.RegionInfo.RegionSettings.ObjectBonus); | ||
112 | 112 | ||
113 | if(objectCount + usedPrims > simulatorCapacity) | 113 | if (objectCount + usedPrims > simulatorCapacity) |
114 | { | 114 | { |
115 | m_dialogModule.SendAlertToUser(owner, "Unable to rez object because the parcel is too full"); | 115 | m_dialogModule.SendAlertToUser(owner, "Unable to rez object because the parcel is too full"); |
116 | return false; | 116 | return false; |
@@ -118,7 +118,7 @@ namespace OpenSim.Region.OptionalModules | |||
118 | 118 | ||
119 | return true; | 119 | return true; |
120 | } | 120 | } |
121 | //OnMoveObject | 121 | |
122 | private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) | 122 | private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) |
123 | { | 123 | { |
124 | SceneObjectPart obj = scene.GetSceneObjectPart(objectID); | 124 | SceneObjectPart obj = scene.GetSceneObjectPart(objectID); |
@@ -126,11 +126,9 @@ namespace OpenSim.Region.OptionalModules | |||
126 | int objectCount = obj.ParentGroup.PrimCount; | 126 | int objectCount = obj.ParentGroup.PrimCount; |
127 | ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); | 127 | ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); |
128 | ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); | 128 | ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); |
129 | 129 | ||
130 | int usedPrims=newParcel.PrimCounts.Total; | 130 | int usedPrims = newParcel.PrimCounts.Total; |
131 | LandData landData = newParcel.LandData; | 131 | int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); |
132 | int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) * | ||
133 | (float)scene.RegionInfo.ObjectCapacity * (float)scene.RegionInfo.RegionSettings.ObjectBonus); | ||
134 | 132 | ||
135 | // The prim hasn't crossed a region boundry so we don't need to worry | 133 | // The prim hasn't crossed a region boundry so we don't need to worry |
136 | // about prim counts here | 134 | // about prim counts here |
@@ -138,36 +136,39 @@ namespace OpenSim.Region.OptionalModules | |||
138 | { | 136 | { |
139 | return true; | 137 | return true; |
140 | } | 138 | } |
139 | |||
141 | // Prim counts are determined by the location of the root prim. if we're | 140 | // Prim counts are determined by the location of the root prim. if we're |
142 | // moving a child prim, just let it pass | 141 | // moving a child prim, just let it pass |
143 | if(!obj.IsRoot) | 142 | if(!obj.IsRoot) |
144 | { | 143 | { |
145 | return true; | 144 | return true; |
146 | } | 145 | } |
147 | // Add Special Case here for temporary prims | 146 | |
147 | // TODO: Add Special Case here for temporary prims | ||
148 | 148 | ||
149 | if(objectCount + usedPrims > simulatorCapacity) | 149 | if(objectCount + usedPrims > simulatorCapacity) |
150 | { | 150 | { |
151 | m_dialogModule.SendAlertToUser(obj.OwnerID, "Unable to move object because the destination parcel is too full"); | 151 | m_dialogModule.SendAlertToUser(obj.OwnerID, "Unable to move object because the destination parcel is too full"); |
152 | return false; | 152 | return false; |
153 | } | 153 | } |
154 | |||
154 | return true; | 155 | return true; |
155 | } | 156 | } |
157 | |||
156 | //OnDuplicateObject | 158 | //OnDuplicateObject |
157 | private bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition) | 159 | private bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition) |
158 | { | 160 | { |
159 | // This may be a little long winded and can probably be optomized | 161 | ILandObject lo = scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); |
160 | int usedPrims = scene.LandChannel.GetLandObject(objectPosition.X,objectPosition.Y).PrimCounts.Total; | 162 | int usedPrims = lo.PrimCounts.Total; |
161 | LandData landData = scene.LandChannel.GetLandObject(objectPosition.X,objectPosition.Y).LandData; | 163 | int simulatorCapacity = lo.GetSimulatorMaxPrimCount(); |
162 | int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) * | ||
163 | (float)scene.RegionInfo.ObjectCapacity * (float)scene.RegionInfo.RegionSettings.ObjectBonus); | ||
164 | 164 | ||
165 | if(objectCount + usedPrims > simulatorCapacity) | 165 | if(objectCount + usedPrims > simulatorCapacity) |
166 | { | 166 | { |
167 | m_dialogModule.SendAlertToUser(owner, "Unable to duplicate object because the parcel is too full"); | 167 | m_dialogModule.SendAlertToUser(owner, "Unable to duplicate object because the parcel is too full"); |
168 | return false; | 168 | return false; |
169 | } | 169 | } |
170 | |||
170 | return true; | 171 | return true; |
171 | } | 172 | } |
172 | } | 173 | } |
173 | } | 174 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1f60a7b..48a7953 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -10587,31 +10587,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10587 | public LSL_Integer llGetParcelMaxPrims(LSL_Vector pos, int sim_wide) | 10587 | public LSL_Integer llGetParcelMaxPrims(LSL_Vector pos, int sim_wide) |
10588 | { | 10588 | { |
10589 | m_host.AddScriptLPS(1); | 10589 | m_host.AddScriptLPS(1); |
10590 | // Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation | ||
10591 | // Which probably will be irrelevent in OpenSim.... | ||
10592 | LandData land = World.GetLandData((float)pos.x, (float)pos.y); | ||
10593 | 10590 | ||
10594 | float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus; | 10591 | ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); |
10595 | 10592 | ||
10596 | if (land == null) | 10593 | if (lo == null) |
10597 | { | ||
10598 | return 0; | 10594 | return 0; |
10599 | } | ||
10600 | 10595 | ||
10601 | if (sim_wide != 0) | 10596 | if (sim_wide != 0) |
10602 | { | 10597 | return lo.GetSimulatorMaxPrimCount(); |
10603 | decimal v = land.SimwideArea * (decimal)(0.22) * (decimal)bonusfactor; | ||
10604 | |||
10605 | return (int)v; | ||
10606 | } | ||
10607 | |||
10608 | else | 10598 | else |
10609 | { | 10599 | return lo.GetParcelMaxPrimCount(); |
10610 | decimal v = land.Area * (decimal)(0.22) * (decimal)bonusfactor; | ||
10611 | |||
10612 | return (int)v; | ||
10613 | } | ||
10614 | |||
10615 | } | 10600 | } |
10616 | 10601 | ||
10617 | public LSL_List llGetParcelDetails(LSL_Vector pos, LSL_List param) | 10602 | public LSL_List llGetParcelDetails(LSL_Vector pos, LSL_List param) |
diff --git a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs index cdab49e..0da9fc1 100644 --- a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs +++ b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs | |||
@@ -30,6 +30,7 @@ using System.Collections; | |||
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Security; | ||
33 | using System.Text; | 34 | using System.Text; |
34 | using log4net; | 35 | using log4net; |
35 | using Nini.Config; | 36 | using Nini.Config; |
@@ -143,7 +144,7 @@ namespace OpenSim.Server.Handlers.Grid | |||
143 | sb.Append("<gridinfo>\n"); | 144 | sb.Append("<gridinfo>\n"); |
144 | foreach (string k in _info.Keys) | 145 | foreach (string k in _info.Keys) |
145 | { | 146 | { |
146 | sb.AppendFormat("<{0}>{1}</{0}>\n", k, _info[k]); | 147 | sb.AppendFormat("<{0}>{1}</{0}>\n", k, SecurityElement.Escape(_info[k].ToString())); |
147 | } | 148 | } |
148 | sb.Append("</gridinfo>\n"); | 149 | sb.Append("</gridinfo>\n"); |
149 | 150 | ||
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index c3134b3..0e4dfb9 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs | |||
@@ -40,10 +40,12 @@ namespace OpenSim.Tests.Common.Mock | |||
40 | public class TestLandChannel : ILandChannel | 40 | public class TestLandChannel : ILandChannel |
41 | { | 41 | { |
42 | private Scene m_scene; | 42 | private Scene m_scene; |
43 | private List<ILandObject> m_parcels; | ||
43 | 44 | ||
44 | public TestLandChannel(Scene scene) | 45 | public TestLandChannel(Scene scene) |
45 | { | 46 | { |
46 | m_scene = scene; | 47 | m_scene = scene; |
48 | m_parcels = new List<ILandObject>(); | ||
47 | } | 49 | } |
48 | 50 | ||
49 | public List<ILandObject> ParcelsNearPoint(Vector3 position) | 51 | public List<ILandObject> ParcelsNearPoint(Vector3 position) |
@@ -53,12 +55,19 @@ namespace OpenSim.Tests.Common.Mock | |||
53 | 55 | ||
54 | public List<ILandObject> AllParcels() | 56 | public List<ILandObject> AllParcels() |
55 | { | 57 | { |
56 | return new List<ILandObject>(); | 58 | return m_parcels; |
57 | } | 59 | } |
58 | 60 | ||
59 | public void Clear(bool setupDefaultParcel) | 61 | public void Clear(bool setupDefaultParcel) |
60 | { | 62 | { |
61 | // Intentionally blank since we don't save any parcel data in the test channel | 63 | m_parcels.Clear(); |
64 | |||
65 | if (setupDefaultParcel) | ||
66 | { | ||
67 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | ||
68 | obj.LandData.Name = "Your Parcel"; | ||
69 | m_parcels.Add(obj); | ||
70 | } | ||
62 | } | 71 | } |
63 | 72 | ||
64 | protected ILandObject GetNoLand() | 73 | protected ILandObject GetNoLand() |