diff options
author | Melanie | 2010-06-09 16:48:37 +0100 |
---|---|---|
committer | Melanie | 2010-06-09 16:48:37 +0100 |
commit | 6b2d2413f7026c41e7abb55c72c583670cb6011d (patch) | |
tree | 6596f0132d36f74f2e57c9b1bd891d95eb0e5a33 /OpenSim/Region | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
parent | Add the BEGIN; I had missed (diff) | |
download | opensim-SC_OLD-6b2d2413f7026c41e7abb55c72c583670cb6011d.zip opensim-SC_OLD-6b2d2413f7026c41e7abb55c72c583670cb6011d.tar.gz opensim-SC_OLD-6b2d2413f7026c41e7abb55c72c583670cb6011d.tar.bz2 opensim-SC_OLD-6b2d2413f7026c41e7abb55c72c583670cb6011d.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region')
8 files changed, 82 insertions, 67 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 7090855..b2df0bd 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3426,7 +3426,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3426 | CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); | 3426 | CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); |
3427 | loc.Header.Reliable = false; | 3427 | loc.Header.Reliable = false; |
3428 | 3428 | ||
3429 | // Each packet can only hold around 62 avatar positions and the client clears the mini-map each time | 3429 | // Each packet can only hold around 60 avatar positions and the client clears the mini-map each time |
3430 | // a CoarseLocationUpdate packet is received. Oh well. | 3430 | // a CoarseLocationUpdate packet is received. Oh well. |
3431 | int total = Math.Min(CoarseLocations.Count, 60); | 3431 | int total = Math.Min(CoarseLocations.Count, 60); |
3432 | 3432 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 66c5a72..266621f 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -869,9 +869,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
869 | 869 | ||
870 | CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); | 870 | CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); |
871 | 871 | ||
872 | // m_scene.SendKillObject(m_localId); | ||
873 | |||
874 | agent.Scene.NotifyMyCoarseLocationChange(); | ||
875 | // the user may change their profile information in other region, | 872 | // the user may change their profile information in other region, |
876 | // so the userinfo in UserProfileCache is not reliable any more, delete it | 873 | // so the userinfo in UserProfileCache is not reliable any more, delete it |
877 | // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! | 874 | // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 58ce550..c1e92f5 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |||
@@ -95,6 +95,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
95 | try | 95 | try |
96 | { | 96 | { |
97 | asset1.ID = url + "/" + asset.ID; | 97 | asset1.ID = url + "/" + asset.ID; |
98 | UUID temp = UUID.Zero; | ||
99 | // TODO: if the creator is local, stick this grid's URL in front | ||
100 | //if (UUID.TryParse(asset.Metadata.CreatorID, out temp)) | ||
101 | // asset1.Metadata.CreatorID = ??? + "/" + asset.Metadata.CreatorID; | ||
98 | } | 102 | } |
99 | catch | 103 | catch |
100 | { | 104 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 48ffbce..e80dff7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -362,6 +362,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
362 | private int m_update_backup = 200; | 362 | private int m_update_backup = 200; |
363 | private int m_update_terrain = 50; | 363 | private int m_update_terrain = 50; |
364 | private int m_update_land = 1; | 364 | private int m_update_land = 1; |
365 | private int m_update_coarse_locations = 50; | ||
365 | 366 | ||
366 | private int frameMS; | 367 | private int frameMS; |
367 | private int physicsMS2; | 368 | private int physicsMS2; |
@@ -1445,6 +1446,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1445 | if (m_frame % m_update_objects == 0) | 1446 | if (m_frame % m_update_objects == 0) |
1446 | m_sceneGraph.UpdateObjectGroups(); | 1447 | m_sceneGraph.UpdateObjectGroups(); |
1447 | 1448 | ||
1449 | if (m_frame % m_update_coarse_locations == 0) | ||
1450 | { | ||
1451 | List<Vector3> coarseLocations; | ||
1452 | List<UUID> avatarUUIDs; | ||
1453 | SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60); | ||
1454 | // Send coarse locations to clients | ||
1455 | ForEachScenePresence(delegate(ScenePresence presence) | ||
1456 | { | ||
1457 | presence.SendCoarseLocations(coarseLocations, avatarUUIDs); | ||
1458 | }); | ||
1459 | } | ||
1460 | |||
1448 | int tmpPhysicsMS2 = Util.EnvironmentTickCount(); | 1461 | int tmpPhysicsMS2 = Util.EnvironmentTickCount(); |
1449 | if ((m_frame % m_update_physics == 0) && m_physics_enabled) | 1462 | if ((m_frame % m_update_physics == 0) && m_physics_enabled) |
1450 | m_sceneGraph.UpdatePreparePhysics(); | 1463 | m_sceneGraph.UpdatePreparePhysics(); |
@@ -3329,9 +3342,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3329 | catch (NullReferenceException) { } | 3342 | catch (NullReferenceException) { } |
3330 | }); | 3343 | }); |
3331 | 3344 | ||
3332 | ForEachScenePresence( | ||
3333 | delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); | ||
3334 | |||
3335 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); | 3345 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); |
3336 | if (agentTransactions != null) | 3346 | if (agentTransactions != null) |
3337 | { | 3347 | { |
@@ -3383,14 +3393,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3383 | } | 3393 | } |
3384 | } | 3394 | } |
3385 | 3395 | ||
3386 | /// <summary> | ||
3387 | /// Inform all other ScenePresences on this Scene that someone else has changed position on the minimap. | ||
3388 | /// </summary> | ||
3389 | public void NotifyMyCoarseLocationChange() | ||
3390 | { | ||
3391 | ForEachScenePresence(delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); | ||
3392 | } | ||
3393 | |||
3394 | #endregion | 3396 | #endregion |
3395 | 3397 | ||
3396 | #region Entities | 3398 | #region Entities |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1dab4df..80f9114 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -211,6 +211,43 @@ namespace OpenSim.Region.Framework.Scenes | |||
211 | }); | 211 | }); |
212 | } | 212 | } |
213 | 213 | ||
214 | public void GetCoarseLocations(out List<Vector3> coarseLocations, out List<UUID> avatarUUIDs, uint maxLocations) | ||
215 | { | ||
216 | coarseLocations = new List<Vector3>(); | ||
217 | avatarUUIDs = new List<UUID>(); | ||
218 | |||
219 | List<ScenePresence> presences = GetScenePresences(); | ||
220 | for (int i = 0; i < Math.Min(presences.Count, maxLocations); ++i) | ||
221 | { | ||
222 | ScenePresence sp = presences[i]; | ||
223 | // If this presence is a child agent, we don't want its coarse locations | ||
224 | if (sp.IsChildAgent) | ||
225 | return; | ||
226 | |||
227 | if (sp.ParentID != 0) | ||
228 | { | ||
229 | // sitting avatar | ||
230 | SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID); | ||
231 | if (sop != null) | ||
232 | { | ||
233 | coarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition); | ||
234 | avatarUUIDs.Add(sp.UUID); | ||
235 | } | ||
236 | else | ||
237 | { | ||
238 | // we can't find the parent.. ! arg! | ||
239 | coarseLocations.Add(sp.AbsolutePosition); | ||
240 | avatarUUIDs.Add(sp.UUID); | ||
241 | } | ||
242 | } | ||
243 | else | ||
244 | { | ||
245 | coarseLocations.Add(sp.AbsolutePosition); | ||
246 | avatarUUIDs.Add(sp.UUID); | ||
247 | } | ||
248 | } | ||
249 | } | ||
250 | |||
214 | #endregion | 251 | #endregion |
215 | 252 | ||
216 | #region Entity Methods | 253 | #region Entity Methods |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e3bbe8a..8cd3ac6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
66 | public ScriptControlled eventControls; | 66 | public ScriptControlled eventControls; |
67 | } | 67 | } |
68 | 68 | ||
69 | public delegate void SendCourseLocationsMethod(UUID scene, ScenePresence presence); | 69 | public delegate void SendCourseLocationsMethod(UUID scene, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs); |
70 | 70 | ||
71 | public class ScenePresence : EntityBase, ISceneEntity | 71 | public class ScenePresence : EntityBase, ISceneEntity |
72 | { | 72 | { |
@@ -178,8 +178,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
178 | 178 | ||
179 | public string JID = String.Empty; | 179 | public string JID = String.Empty; |
180 | 180 | ||
181 | // Agent moves with a PID controller causing a force to be exerted. | ||
182 | private bool m_newCoarseLocations = true; | ||
183 | private float m_health = 100f; | 181 | private float m_health = 100f; |
184 | 182 | ||
185 | // Default AV Height | 183 | // Default AV Height |
@@ -2548,12 +2546,6 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); | |||
2548 | 2546 | ||
2549 | 2547 | ||
2550 | 2548 | ||
2551 | if (m_newCoarseLocations) | ||
2552 | { | ||
2553 | SendCoarseLocations(); | ||
2554 | m_newCoarseLocations = false; | ||
2555 | } | ||
2556 | |||
2557 | if (m_isChildAgent == false) | 2549 | if (m_isChildAgent == false) |
2558 | { | 2550 | { |
2559 | // PhysicsActor actor = m_physicsActor; | 2551 | // PhysicsActor actor = m_physicsActor; |
@@ -2630,12 +2622,12 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); | |||
2630 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); | 2622 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); |
2631 | } | 2623 | } |
2632 | 2624 | ||
2633 | public void SendCoarseLocations() | 2625 | public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs) |
2634 | { | 2626 | { |
2635 | SendCourseLocationsMethod d = m_sendCourseLocationsMethod; | 2627 | SendCourseLocationsMethod d = m_sendCourseLocationsMethod; |
2636 | if (d != null) | 2628 | if (d != null) |
2637 | { | 2629 | { |
2638 | d.Invoke(m_scene.RegionInfo.originRegionID, this); | 2630 | d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs); |
2639 | } | 2631 | } |
2640 | } | 2632 | } |
2641 | 2633 | ||
@@ -2645,50 +2637,13 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); | |||
2645 | m_sendCourseLocationsMethod = d; | 2637 | m_sendCourseLocationsMethod = d; |
2646 | } | 2638 | } |
2647 | 2639 | ||
2648 | public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p) | 2640 | public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) |
2649 | { | 2641 | { |
2650 | m_perfMonMS = Util.EnvironmentTickCount(); | 2642 | m_perfMonMS = Util.EnvironmentTickCount(); |
2651 | 2643 | m_controllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); | |
2652 | List<Vector3> CoarseLocations = new List<Vector3>(); | ||
2653 | List<UUID> AvatarUUIDs = new List<UUID>(); | ||
2654 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) | ||
2655 | { | ||
2656 | if (sp.IsChildAgent) | ||
2657 | return; | ||
2658 | |||
2659 | if (sp.ParentID != 0) | ||
2660 | { | ||
2661 | // sitting avatar | ||
2662 | SceneObjectPart sop = m_scene.GetSceneObjectPart(sp.ParentID); | ||
2663 | if (sop != null) | ||
2664 | { | ||
2665 | CoarseLocations.Add(sop.AbsolutePosition + sp.m_pos); | ||
2666 | AvatarUUIDs.Add(sp.UUID); | ||
2667 | } | ||
2668 | else | ||
2669 | { | ||
2670 | // we can't find the parent.. ! arg! | ||
2671 | CoarseLocations.Add(sp.m_pos); | ||
2672 | AvatarUUIDs.Add(sp.UUID); | ||
2673 | } | ||
2674 | } | ||
2675 | else | ||
2676 | { | ||
2677 | CoarseLocations.Add(sp.m_pos); | ||
2678 | AvatarUUIDs.Add(sp.UUID); | ||
2679 | } | ||
2680 | }); | ||
2681 | |||
2682 | m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); | ||
2683 | |||
2684 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); | 2644 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); |
2685 | } | 2645 | } |
2686 | 2646 | ||
2687 | public void CoarseLocationChange() | ||
2688 | { | ||
2689 | m_newCoarseLocations = true; | ||
2690 | } | ||
2691 | |||
2692 | /// <summary> | 2647 | /// <summary> |
2693 | /// Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar) | 2648 | /// Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar) |
2694 | /// </summary> | 2649 | /// </summary> |
@@ -2923,7 +2878,6 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); | |||
2923 | { | 2878 | { |
2924 | posLastSignificantMove = AbsolutePosition; | 2879 | posLastSignificantMove = AbsolutePosition; |
2925 | m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient); | 2880 | m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient); |
2926 | m_scene.NotifyMyCoarseLocationChange(); | ||
2927 | } | 2881 | } |
2928 | 2882 | ||
2929 | // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m | 2883 | // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index b42d3bf..d854176 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | |||
@@ -614,7 +614,9 @@ namespace OpenSim.Region.RegionCombinerModule | |||
614 | presence.SetSendCourseLocationMethod(SendCourseLocationUpdates); | 614 | presence.SetSendCourseLocationMethod(SendCourseLocationUpdates); |
615 | } | 615 | } |
616 | 616 | ||
617 | private void SendCourseLocationUpdates(UUID sceneId, ScenePresence presence) | 617 | // This delegate was refactored for non-combined regions. |
618 | // This combined region version will not use the pre-compiled lists of locations and ids | ||
619 | private void SendCourseLocationUpdates(UUID sceneId, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) | ||
618 | { | 620 | { |
619 | RegionConnections connectiondata = null; | 621 | RegionConnections connectiondata = null; |
620 | lock (m_regions) | 622 | lock (m_regions) |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 463b052..30e127d 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -125,6 +125,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
125 | 125 | ||
126 | private ScriptCompileQueue m_CompileQueue = new ScriptCompileQueue(); | 126 | private ScriptCompileQueue m_CompileQueue = new ScriptCompileQueue(); |
127 | IWorkItemResult m_CurrentCompile = null; | 127 | IWorkItemResult m_CurrentCompile = null; |
128 | private Dictionary<UUID, int> m_CompileDict = new Dictionary<UUID, int>(); | ||
128 | 129 | ||
129 | private void lockScriptsForRead(bool locked) | 130 | private void lockScriptsForRead(bool locked) |
130 | { | 131 | { |
@@ -560,6 +561,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
560 | else | 561 | else |
561 | { | 562 | { |
562 | m_CompileQueue.Enqueue(parms); | 563 | m_CompileQueue.Enqueue(parms); |
564 | lock (m_CompileDict) | ||
565 | { | ||
566 | m_CompileDict[itemID] = 0; | ||
567 | } | ||
563 | 568 | ||
564 | if (m_CurrentCompile == null) | 569 | if (m_CurrentCompile == null) |
565 | { | 570 | { |
@@ -622,6 +627,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
622 | bool postOnRez = (bool)p[4]; | 627 | bool postOnRez = (bool)p[4]; |
623 | StateSource stateSource = (StateSource)p[5]; | 628 | StateSource stateSource = (StateSource)p[5]; |
624 | 629 | ||
630 | lock(m_CompileDict) | ||
631 | { | ||
632 | if (!m_CompileDict.ContainsKey(itemID)) | ||
633 | return false; | ||
634 | m_CompileDict.Remove(itemID); | ||
635 | } | ||
636 | |||
625 | // Get the asset ID of the script, so we can check if we | 637 | // Get the asset ID of the script, so we can check if we |
626 | // already have it. | 638 | // already have it. |
627 | 639 | ||
@@ -868,6 +880,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
868 | 880 | ||
869 | public void OnRemoveScript(uint localID, UUID itemID) | 881 | public void OnRemoveScript(uint localID, UUID itemID) |
870 | { | 882 | { |
883 | // If it's not yet been compiled, make sure we don't try | ||
884 | lock (m_CompileDict) | ||
885 | { | ||
886 | if (m_CompileDict.ContainsKey(itemID)) | ||
887 | m_CompileDict.Remove(itemID); | ||
888 | } | ||
889 | |||
871 | lockScriptsForRead(true); | 890 | lockScriptsForRead(true); |
872 | // Do we even have it? | 891 | // Do we even have it? |
873 | if (!m_Scripts.ContainsKey(itemID)) | 892 | if (!m_Scripts.ContainsKey(itemID)) |