diff options
Diffstat (limited to 'OpenSim')
14 files changed, 226 insertions, 55 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index bfbc480..760d63a 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -1830,6 +1830,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1830 | HTTPDRunning = false; | 1830 | HTTPDRunning = false; |
1831 | try | 1831 | try |
1832 | { | 1832 | { |
1833 | // m_PollServiceManager.Stop(); | ||
1834 | |||
1833 | m_httpListener2.ExceptionThrown -= httpServerException; | 1835 | m_httpListener2.ExceptionThrown -= httpServerException; |
1834 | //m_httpListener2.DisconnectHandler = null; | 1836 | //m_httpListener2.DisconnectHandler = null; |
1835 | 1837 | ||
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 4be8bf4..07bd48a 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -50,19 +50,26 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
50 | private uint m_WorkerThreadCount = 0; | 50 | private uint m_WorkerThreadCount = 0; |
51 | private Thread[] m_workerThreads; | 51 | private Thread[] m_workerThreads; |
52 | private PollServiceWorkerThread[] m_PollServiceWorkerThreads; | 52 | private PollServiceWorkerThread[] m_PollServiceWorkerThreads; |
53 | private bool m_running = true; | 53 | private volatile bool m_running = true; |
54 | private int m_pollTimeout; | ||
54 | 55 | ||
55 | public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout) | 56 | public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout) |
56 | { | 57 | { |
57 | m_server = pSrv; | 58 | m_server = pSrv; |
58 | m_WorkerThreadCount = pWorkerThreadCount; | 59 | m_WorkerThreadCount = pWorkerThreadCount; |
60 | m_pollTimeout = pTimeout; | ||
61 | } | ||
62 | |||
63 | public void Start() | ||
64 | { | ||
65 | m_running = true; | ||
59 | m_workerThreads = new Thread[m_WorkerThreadCount]; | 66 | m_workerThreads = new Thread[m_WorkerThreadCount]; |
60 | m_PollServiceWorkerThreads = new PollServiceWorkerThread[m_WorkerThreadCount]; | 67 | m_PollServiceWorkerThreads = new PollServiceWorkerThread[m_WorkerThreadCount]; |
61 | 68 | ||
62 | //startup worker threads | 69 | //startup worker threads |
63 | for (uint i = 0; i < m_WorkerThreadCount; i++) | 70 | for (uint i = 0; i < m_WorkerThreadCount; i++) |
64 | { | 71 | { |
65 | m_PollServiceWorkerThreads[i] = new PollServiceWorkerThread(m_server, pTimeout); | 72 | m_PollServiceWorkerThreads[i] = new PollServiceWorkerThread(m_server, m_pollTimeout); |
66 | m_PollServiceWorkerThreads[i].ReQueue += ReQueueEvent; | 73 | m_PollServiceWorkerThreads[i].ReQueue += ReQueueEvent; |
67 | 74 | ||
68 | m_workerThreads[i] | 75 | m_workerThreads[i] |
@@ -141,8 +148,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
141 | 148 | ||
142 | } | 149 | } |
143 | 150 | ||
144 | ~PollServiceRequestManager() | 151 | public void Stop() |
145 | { | 152 | { |
153 | m_running = false; | ||
154 | |||
146 | foreach (object o in m_requests) | 155 | foreach (object o in m_requests) |
147 | { | 156 | { |
148 | PollServiceHttpRequest req = (PollServiceHttpRequest) o; | 157 | PollServiceHttpRequest req = (PollServiceHttpRequest) o; |
@@ -157,7 +166,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
157 | { | 166 | { |
158 | t.Abort(); | 167 | t.Abort(); |
159 | } | 168 | } |
160 | m_running = false; | ||
161 | } | 169 | } |
162 | } | 170 | } |
163 | } | 171 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 65ae445..66edfed 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | |||
@@ -87,13 +87,24 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
87 | return false; | 87 | return false; |
88 | } | 88 | } |
89 | 89 | ||
90 | public bool Remove(UUID animID) | 90 | /// <summary> |
91 | /// Remove the specified animation | ||
92 | /// </summary> | ||
93 | /// <param name='animID'></param> | ||
94 | /// <param name='allowNoDefault'> | ||
95 | /// If true, then the default animation can be entirely removed. | ||
96 | /// If false, then removing the default animation will reset it to the simulator default (currently STAND). | ||
97 | /// </param> | ||
98 | public bool Remove(UUID animID, bool allowNoDefault) | ||
91 | { | 99 | { |
92 | lock (m_animations) | 100 | lock (m_animations) |
93 | { | 101 | { |
94 | if (m_defaultAnimation.AnimID == animID) | 102 | if (m_defaultAnimation.AnimID == animID) |
95 | { | 103 | { |
96 | m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero); | 104 | if (allowNoDefault) |
105 | m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero); | ||
106 | else | ||
107 | ResetDefaultAnimation(); | ||
97 | } | 108 | } |
98 | else if (HasAnimation(animID)) | 109 | else if (HasAnimation(animID)) |
99 | { | 110 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index d18571c..65c279e 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -87,6 +87,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
87 | return; | 87 | return; |
88 | 88 | ||
89 | // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name); | 89 | // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name); |
90 | if (m_scenePresence.Scene.DebugAnimations) | ||
91 | m_log.DebugFormat( | ||
92 | "[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}", | ||
93 | GetAnimName(animID), animID, m_scenePresence.Name); | ||
90 | 94 | ||
91 | if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) | 95 | if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) |
92 | SendAnimPack(); | 96 | SendAnimPack(); |
@@ -109,14 +113,25 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
109 | AddAnimation(animID, objectID); | 113 | AddAnimation(animID, objectID); |
110 | } | 114 | } |
111 | 115 | ||
112 | public void RemoveAnimation(UUID animID) | 116 | /// <summary> |
117 | /// Remove the specified animation | ||
118 | /// </summary> | ||
119 | /// <param name='animID'></param> | ||
120 | /// <param name='allowNoDefault'> | ||
121 | /// If true, then the default animation can be entirely removed. | ||
122 | /// If false, then removing the default animation will reset it to the simulator default (currently STAND). | ||
123 | /// </param> | ||
124 | public void RemoveAnimation(UUID animID, bool allowNoDefault) | ||
113 | { | 125 | { |
114 | if (m_scenePresence.IsChildAgent) | 126 | if (m_scenePresence.IsChildAgent) |
115 | return; | 127 | return; |
116 | 128 | ||
117 | // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name); | 129 | if (m_scenePresence.Scene.DebugAnimations) |
130 | m_log.DebugFormat( | ||
131 | "[SCENE PRESENCE ANIMATOR]: Removing animation {0} {1} for {2}", | ||
132 | GetAnimName(animID), animID, m_scenePresence.Name); | ||
118 | 133 | ||
119 | if (m_animations.Remove(animID)) | 134 | if (m_animations.Remove(animID, allowNoDefault)) |
120 | SendAnimPack(); | 135 | SendAnimPack(); |
121 | } | 136 | } |
122 | 137 | ||
@@ -130,7 +145,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
130 | if (addRemove) | 145 | if (addRemove) |
131 | m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero); | 146 | m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero); |
132 | else | 147 | else |
133 | m_animations.Remove(animID); | 148 | m_animations.Remove(animID, true); |
134 | } | 149 | } |
135 | if(sendPack) | 150 | if(sendPack) |
136 | SendAnimPack(); | 151 | SendAnimPack(); |
@@ -148,14 +163,15 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
148 | if (animID == UUID.Zero) | 163 | if (animID == UUID.Zero) |
149 | return; | 164 | return; |
150 | 165 | ||
151 | RemoveAnimation(animID); | 166 | RemoveAnimation(animID, true); |
152 | } | 167 | } |
153 | 168 | ||
154 | public void ResetAnimations() | 169 | public void ResetAnimations() |
155 | { | 170 | { |
156 | // m_log.DebugFormat( | 171 | if (m_scenePresence.Scene.DebugAnimations) |
157 | // "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}", | 172 | m_log.DebugFormat( |
158 | // m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName); | 173 | "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}", |
174 | m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName); | ||
159 | 175 | ||
160 | m_animations.Clear(); | 176 | m_animations.Clear(); |
161 | } | 177 | } |
@@ -566,5 +582,21 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
566 | 582 | ||
567 | SendAnimPack(animIDs, sequenceNums, objectIDs); | 583 | SendAnimPack(animIDs, sequenceNums, objectIDs); |
568 | } | 584 | } |
585 | |||
586 | public string GetAnimName(UUID animId) | ||
587 | { | ||
588 | string animName; | ||
589 | |||
590 | if (!DefaultAvatarAnimations.AnimsNames.TryGetValue(animId, out animName)) | ||
591 | { | ||
592 | AssetMetadata amd = m_scenePresence.Scene.AssetService.GetMetadata(animId.ToString()); | ||
593 | if (amd != null) | ||
594 | animName = amd.Name; | ||
595 | else | ||
596 | animName = "Unknown"; | ||
597 | } | ||
598 | |||
599 | return animName; | ||
600 | } | ||
569 | } | 601 | } |
570 | } | 602 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 784fc91..6ca7ef2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -68,6 +68,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
68 | public bool EmergencyMonitoring = false; | 68 | public bool EmergencyMonitoring = false; |
69 | 69 | ||
70 | /// <summary> | 70 | /// <summary> |
71 | /// Show debug information about animations. | ||
72 | /// </summary> | ||
73 | public bool DebugAnimations { get; set; } | ||
74 | |||
75 | /// <summary> | ||
71 | /// Show debug information about teleports. | 76 | /// Show debug information about teleports. |
72 | /// </summary> | 77 | /// </summary> |
73 | public bool DebugTeleporting { get; set; } | 78 | public bool DebugTeleporting { get; set; } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c2ff110..9d18352 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2435,7 +2435,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2435 | 2435 | ||
2436 | public void HandleStopAnim(IClientAPI remoteClient, UUID animID) | 2436 | public void HandleStopAnim(IClientAPI remoteClient, UUID animID) |
2437 | { | 2437 | { |
2438 | Animator.RemoveAnimation(animID); | 2438 | Animator.RemoveAnimation(animID, false); |
2439 | } | 2439 | } |
2440 | 2440 | ||
2441 | public void avnHandleChangeAnim(UUID animID, bool addRemove,bool sendPack) | 2441 | public void avnHandleChangeAnim(UUID animID, bool addRemove,bool sendPack) |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs b/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs index e951d9e..84211a9 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs | |||
@@ -161,12 +161,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations | |||
161 | UUID defaultAnimId = anims.DefaultAnimation.AnimID; | 161 | UUID defaultAnimId = anims.DefaultAnimation.AnimID; |
162 | cdl.AddRow( | 162 | cdl.AddRow( |
163 | "Default anim", | 163 | "Default anim", |
164 | string.Format("{0}, {1}", defaultAnimId, GetAnimName(sp.Scene.AssetService, defaultAnimId))); | 164 | string.Format("{0}, {1}", defaultAnimId, sp.Animator.GetAnimName(defaultAnimId))); |
165 | 165 | ||
166 | UUID implicitDefaultAnimId = anims.ImplicitDefaultAnimation.AnimID; | 166 | UUID implicitDefaultAnimId = anims.ImplicitDefaultAnimation.AnimID; |
167 | cdl.AddRow( | 167 | cdl.AddRow( |
168 | "Implicit default anim", | 168 | "Implicit default anim", |
169 | string.Format("{0}, {1}", implicitDefaultAnimId, GetAnimName(sp.Scene.AssetService, implicitDefaultAnimId))); | 169 | string.Format("{0}, {1}", |
170 | implicitDefaultAnimId, sp.Animator.GetAnimName(implicitDefaultAnimId))); | ||
170 | 171 | ||
171 | cdl.AddToStringBuilder(sb); | 172 | cdl.AddToStringBuilder(sb); |
172 | 173 | ||
@@ -185,7 +186,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations | |||
185 | for (int i = 0; i < animIds.Length; i++) | 186 | for (int i = 0; i < animIds.Length; i++) |
186 | { | 187 | { |
187 | UUID animId = animIds[i]; | 188 | UUID animId = animIds[i]; |
188 | string animName = GetAnimName(sp.Scene.AssetService, animId); | 189 | string animName = sp.Animator.GetAnimName(animId); |
189 | int seq = sequenceNumbers[i]; | 190 | int seq = sequenceNumbers[i]; |
190 | UUID objectId = objectIds[i]; | 191 | UUID objectId = objectIds[i]; |
191 | 192 | ||
@@ -195,21 +196,5 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations | |||
195 | cdt.AddToStringBuilder(sb); | 196 | cdt.AddToStringBuilder(sb); |
196 | sb.Append("\n"); | 197 | sb.Append("\n"); |
197 | } | 198 | } |
198 | |||
199 | private string GetAnimName(IAssetService assetService, UUID animId) | ||
200 | { | ||
201 | string animName; | ||
202 | |||
203 | if (!DefaultAvatarAnimations.AnimsNames.TryGetValue(animId, out animName)) | ||
204 | { | ||
205 | AssetMetadata amd = assetService.GetMetadata(animId.ToString()); | ||
206 | if (amd != null) | ||
207 | animName = amd.Name; | ||
208 | else | ||
209 | animName = "Unknown"; | ||
210 | } | ||
211 | |||
212 | return animName; | ||
213 | } | ||
214 | } | 199 | } |
215 | } \ No newline at end of file | 200 | } \ No newline at end of file |
diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs index 8b8758e..12169ab 100644 --- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs +++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs | |||
@@ -94,6 +94,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
94 | "debug scene get", | 94 | "debug scene get", |
95 | "List current scene options.", | 95 | "List current scene options.", |
96 | "If active is false then main scene update and maintenance loops are suspended.\n" | 96 | "If active is false then main scene update and maintenance loops are suspended.\n" |
97 | + "If animations is true then extra animations debug information is logged.\n" | ||
97 | + "If collisions is false then collisions with other objects are turned off.\n" | 98 | + "If collisions is false then collisions with other objects are turned off.\n" |
98 | + "If pbackup is false then periodic scene backup is turned off.\n" | 99 | + "If pbackup is false then periodic scene backup is turned off.\n" |
99 | + "If physics is false then all physics objects are non-physical.\n" | 100 | + "If physics is false then all physics objects are non-physical.\n" |
@@ -107,6 +108,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
107 | "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false", | 108 | "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false", |
108 | "Turn on scene debugging options.", | 109 | "Turn on scene debugging options.", |
109 | "If active is false then main scene update and maintenance loops are suspended.\n" | 110 | "If active is false then main scene update and maintenance loops are suspended.\n" |
111 | + "If animations is true then extra animations debug information is logged.\n" | ||
110 | + "If collisions is false then collisions with other objects are turned off.\n" | 112 | + "If collisions is false then collisions with other objects are turned off.\n" |
111 | + "If pbackup is false then periodic scene backup is turned off.\n" | 113 | + "If pbackup is false then periodic scene backup is turned off.\n" |
112 | + "If physics is false then all physics objects are non-physical.\n" | 114 | + "If physics is false then all physics objects are non-physical.\n" |
@@ -120,10 +122,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
120 | { | 122 | { |
121 | if (args.Length == 3) | 123 | if (args.Length == 3) |
122 | { | 124 | { |
123 | if (MainConsole.Instance.ConsoleScene == null) | 125 | if (MainConsole.Instance.ConsoleScene != m_scene && MainConsole.Instance.ConsoleScene != null) |
124 | MainConsole.Instance.Output("Please use 'change region <regioname>' first"); | 126 | return; |
125 | else | 127 | |
126 | OutputSceneDebugOptions(); | 128 | OutputSceneDebugOptions(); |
127 | } | 129 | } |
128 | else | 130 | else |
129 | { | 131 | { |
@@ -135,12 +137,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
135 | { | 137 | { |
136 | ConsoleDisplayList cdl = new ConsoleDisplayList(); | 138 | ConsoleDisplayList cdl = new ConsoleDisplayList(); |
137 | cdl.AddRow("active", m_scene.Active); | 139 | cdl.AddRow("active", m_scene.Active); |
140 | cdl.AddRow("animations", m_scene.DebugAnimations); | ||
138 | cdl.AddRow("pbackup", m_scene.PeriodicBackup); | 141 | cdl.AddRow("pbackup", m_scene.PeriodicBackup); |
139 | cdl.AddRow("physics", m_scene.PhysicsEnabled); | 142 | cdl.AddRow("physics", m_scene.PhysicsEnabled); |
140 | cdl.AddRow("scripting", m_scene.ScriptsEnabled); | 143 | cdl.AddRow("scripting", m_scene.ScriptsEnabled); |
141 | cdl.AddRow("teleport", m_scene.DebugTeleporting); | 144 | cdl.AddRow("teleport", m_scene.DebugTeleporting); |
142 | cdl.AddRow("updates", m_scene.DebugUpdates); | 145 | cdl.AddRow("updates", m_scene.DebugUpdates); |
143 | 146 | ||
147 | MainConsole.Instance.OutputFormat("Scene {0} options:", m_scene.Name); | ||
144 | MainConsole.Instance.Output(cdl.ToString()); | 148 | MainConsole.Instance.Output(cdl.ToString()); |
145 | } | 149 | } |
146 | 150 | ||
@@ -148,18 +152,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
148 | { | 152 | { |
149 | if (args.Length == 5) | 153 | if (args.Length == 5) |
150 | { | 154 | { |
151 | if (MainConsole.Instance.ConsoleScene == null) | 155 | if (MainConsole.Instance.ConsoleScene != m_scene && MainConsole.Instance.ConsoleScene != null) |
152 | { | 156 | return; |
153 | MainConsole.Instance.Output("Please use 'change region <regioname>' first"); | ||
154 | } | ||
155 | else | ||
156 | { | ||
157 | string key = args[3]; | ||
158 | string value = args[4]; | ||
159 | SetSceneDebugOptions(new Dictionary<string, string>() { { key, value } }); | ||
160 | 157 | ||
161 | MainConsole.Instance.OutputFormat("Set debug scene {0} = {1}", key, value); | 158 | string key = args[3]; |
162 | } | 159 | string value = args[4]; |
160 | SetSceneDebugOptions(new Dictionary<string, string>() { { key, value } }); | ||
161 | |||
162 | MainConsole.Instance.OutputFormat("Set {0} debug scene {1} = {2}", m_scene.Name, key, value); | ||
163 | } | 163 | } |
164 | else | 164 | else |
165 | { | 165 | { |
@@ -178,6 +178,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
178 | m_scene.Active = active; | 178 | m_scene.Active = active; |
179 | } | 179 | } |
180 | 180 | ||
181 | if (options.ContainsKey("animations")) | ||
182 | { | ||
183 | bool active; | ||
184 | |||
185 | if (bool.TryParse(options["animations"], out active)) | ||
186 | m_scene.DebugAnimations = active; | ||
187 | } | ||
188 | |||
181 | if (options.ContainsKey("pbackup")) | 189 | if (options.ContainsKey("pbackup")) |
182 | { | 190 | { |
183 | bool active; | 191 | bool active; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 6d5e23f..478aeab 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -853,7 +853,14 @@ public sealed class BSCharacter : BSPhysObject | |||
853 | { | 853 | { |
854 | _position = entprop.Position; | 854 | _position = entprop.Position; |
855 | _orientation = entprop.Rotation; | 855 | _orientation = entprop.Rotation; |
856 | _velocity = entprop.Velocity; | 856 | |
857 | // Smooth velocity. OpenSimulator is very sensitive to changes in velocity of the avatar | ||
858 | // and will send agent updates to the clients if velocity changes by more than | ||
859 | // 0.001m/s. Bullet introduces a lot of jitter in the velocity which causes many | ||
860 | // extra updates. | ||
861 | if (!entprop.Velocity.ApproxEquals(_velocity, 0.1f)) | ||
862 | _velocity = entprop.Velocity; | ||
863 | |||
857 | _acceleration = entprop.Acceleration; | 864 | _acceleration = entprop.Acceleration; |
858 | _rotationalVelocity = entprop.RotationalVelocity; | 865 | _rotationalVelocity = entprop.RotationalVelocity; |
859 | 866 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index bac0427..5353c75 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -141,7 +141,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
141 | 141 | ||
142 | // It can be confusing for an actor to know if it should move or update an object | 142 | // It can be confusing for an actor to know if it should move or update an object |
143 | // depeneding on the setting of 'selected', 'physical, ... | 143 | // depeneding on the setting of 'selected', 'physical, ... |
144 | // This flag is the true test -- if true, the object is being acted on in the physical world | 144 | // This flag is the true test -- if true, the object is being acted on in the physical world |
145 | public abstract bool IsPhysicallyActive { get; } | 145 | public abstract bool IsPhysicallyActive { get; } |
146 | 146 | ||
147 | // Materialness | 147 | // Materialness |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 7aa2d92..aaa6fe5 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -502,6 +502,12 @@ public sealed class BSPrim : BSPhysObject | |||
502 | RegisterPreStepAction("BSPrim.setForce", LocalID, | 502 | RegisterPreStepAction("BSPrim.setForce", LocalID, |
503 | delegate(float timeStep) | 503 | delegate(float timeStep) |
504 | { | 504 | { |
505 | if (!IsPhysicallyActive) | ||
506 | { | ||
507 | UnRegisterPreStepAction("BSPrim.setForce", LocalID); | ||
508 | return; | ||
509 | } | ||
510 | |||
505 | DetailLog("{0},BSPrim.setForce,preStep,force={1}", LocalID, _force); | 511 | DetailLog("{0},BSPrim.setForce,preStep,force={1}", LocalID, _force); |
506 | if (PhysBody.HasPhysicalBody) | 512 | if (PhysBody.HasPhysicalBody) |
507 | { | 513 | { |
@@ -627,6 +633,12 @@ public sealed class BSPrim : BSPhysObject | |||
627 | RegisterPreStepAction("BSPrim.setTorque", LocalID, | 633 | RegisterPreStepAction("BSPrim.setTorque", LocalID, |
628 | delegate(float timeStep) | 634 | delegate(float timeStep) |
629 | { | 635 | { |
636 | if (!IsPhysicallyActive) | ||
637 | { | ||
638 | UnRegisterPreStepAction("BSPrim.setTorque", LocalID); | ||
639 | return; | ||
640 | } | ||
641 | |||
630 | if (PhysBody.HasPhysicalBody) | 642 | if (PhysBody.HasPhysicalBody) |
631 | AddAngularForce(_torque, false, true); | 643 | AddAngularForce(_torque, false, true); |
632 | } | 644 | } |
@@ -1061,6 +1073,12 @@ public sealed class BSPrim : BSPhysObject | |||
1061 | 1073 | ||
1062 | RegisterPreStepAction("BSPrim.PIDTarget", LocalID, delegate(float timeStep) | 1074 | RegisterPreStepAction("BSPrim.PIDTarget", LocalID, delegate(float timeStep) |
1063 | { | 1075 | { |
1076 | if (!IsPhysicallyActive) | ||
1077 | { | ||
1078 | UnRegisterPreStepAction("BSPrim.PIDTarget", LocalID); | ||
1079 | return; | ||
1080 | } | ||
1081 | |||
1064 | OMV.Vector3 origPosition = RawPosition; // DEBUG DEBUG (for printout below) | 1082 | OMV.Vector3 origPosition = RawPosition; // DEBUG DEBUG (for printout below) |
1065 | 1083 | ||
1066 | // 'movePosition' is where we'd like the prim to be at this moment. | 1084 | // 'movePosition' is where we'd like the prim to be at this moment. |
@@ -1108,6 +1126,9 @@ public sealed class BSPrim : BSPhysObject | |||
1108 | 1126 | ||
1109 | RegisterPreStepAction("BSPrim.Hover", LocalID, delegate(float timeStep) | 1127 | RegisterPreStepAction("BSPrim.Hover", LocalID, delegate(float timeStep) |
1110 | { | 1128 | { |
1129 | if (!IsPhysicallyActive) | ||
1130 | return; | ||
1131 | |||
1111 | _hoverMotor.SetCurrent(RawPosition.Z); | 1132 | _hoverMotor.SetCurrent(RawPosition.Z); |
1112 | _hoverMotor.SetTarget(ComputeCurrentPIDHoverHeight()); | 1133 | _hoverMotor.SetTarget(ComputeCurrentPIDHoverHeight()); |
1113 | float targetHeight = _hoverMotor.Step(timeStep); | 1134 | float targetHeight = _hoverMotor.Step(timeStep); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index da2a90f..5cbb9c7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3708,7 +3708,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3708 | if (animID == UUID.Zero) | 3708 | if (animID == UUID.Zero) |
3709 | presence.Animator.RemoveAnimation(anim); | 3709 | presence.Animator.RemoveAnimation(anim); |
3710 | else | 3710 | else |
3711 | presence.Animator.RemoveAnimation(animID); | 3711 | presence.Animator.RemoveAnimation(animID, true); |
3712 | } | 3712 | } |
3713 | } | 3713 | } |
3714 | } | 3714 | } |
@@ -6228,13 +6228,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6228 | if (parcelOwned && land.LandData.OwnerID == id || | 6228 | if (parcelOwned && land.LandData.OwnerID == id || |
6229 | parcel && land.LandData.GlobalID == id) | 6229 | parcel && land.LandData.GlobalID == id) |
6230 | { | 6230 | { |
6231 | result.Add(ssp.UUID.ToString()); | 6231 | result.Add(new LSL_Key(ssp.UUID.ToString())); |
6232 | } | 6232 | } |
6233 | } | 6233 | } |
6234 | } | 6234 | } |
6235 | else | 6235 | else |
6236 | { | 6236 | { |
6237 | result.Add(ssp.UUID.ToString()); | 6237 | result.Add(new LSL_Key(ssp.UUID.ToString())); |
6238 | } | 6238 | } |
6239 | } | 6239 | } |
6240 | // Maximum of 100 results | 6240 | // Maximum of 100 results |
@@ -11528,6 +11528,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11528 | case ScriptBaseClass.OBJECT_PHYSICS_COST: | 11528 | case ScriptBaseClass.OBJECT_PHYSICS_COST: |
11529 | ret.Add(new LSL_Float(0)); | 11529 | ret.Add(new LSL_Float(0)); |
11530 | break; | 11530 | break; |
11531 | case ScriptBaseClass.OBJECT_CHARACTER_TIME: // Pathfinding | ||
11532 | ret.Add(new LSL_Float(0)); | ||
11533 | break; | ||
11534 | case ScriptBaseClass.OBJECT_ROOT: | ||
11535 | SceneObjectPart p = av.ParentPart; | ||
11536 | if (p != null) | ||
11537 | { | ||
11538 | ret.Add(new LSL_String(p.ParentGroup.RootPart.UUID.ToString())); | ||
11539 | } | ||
11540 | else | ||
11541 | { | ||
11542 | ret.Add(new LSL_String(id)); | ||
11543 | } | ||
11544 | break; | ||
11545 | case ScriptBaseClass.OBJECT_ATTACHED_POINT: | ||
11546 | ret.Add(new LSL_Integer(0)); | ||
11547 | break; | ||
11548 | case ScriptBaseClass.OBJECT_PATHFINDING_TYPE: // Pathfinding | ||
11549 | ret.Add(new LSL_Integer(ScriptBaseClass.OPT_AVATAR)); | ||
11550 | break; | ||
11551 | case ScriptBaseClass.OBJECT_PHYSICS: | ||
11552 | ret.Add(new LSL_Integer(0)); | ||
11553 | break; | ||
11554 | case ScriptBaseClass.OBJECT_PHANTOM: | ||
11555 | ret.Add(new LSL_Integer(0)); | ||
11556 | break; | ||
11557 | case ScriptBaseClass.OBJECT_TEMP_ON_REZ: | ||
11558 | ret.Add(new LSL_Integer(0)); | ||
11559 | break; | ||
11531 | default: | 11560 | default: |
11532 | // Invalid or unhandled constant. | 11561 | // Invalid or unhandled constant. |
11533 | ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); | 11562 | ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); |
@@ -11619,6 +11648,52 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11619 | // The value returned in SL for normal prims is prim count | 11648 | // The value returned in SL for normal prims is prim count |
11620 | ret.Add(new LSL_Float(obj.PhysicsCost)); | 11649 | ret.Add(new LSL_Float(obj.PhysicsCost)); |
11621 | break; | 11650 | break; |
11651 | case ScriptBaseClass.OBJECT_CHARACTER_TIME: // Pathfinding | ||
11652 | ret.Add(new LSL_Float(0)); | ||
11653 | break; | ||
11654 | case ScriptBaseClass.OBJECT_ROOT: | ||
11655 | ret.Add(new LSL_String(obj.ParentGroup.RootPart.UUID.ToString())); | ||
11656 | break; | ||
11657 | case ScriptBaseClass.OBJECT_ATTACHED_POINT: | ||
11658 | ret.Add(new LSL_Integer(obj.ParentGroup.AttachmentPoint)); | ||
11659 | break; | ||
11660 | case ScriptBaseClass.OBJECT_PATHFINDING_TYPE: | ||
11661 | byte pcode = obj.Shape.PCode; | ||
11662 | if (obj.ParentGroup.AttachmentPoint != 0 | ||
11663 | || pcode == (byte)PCode.Grass | ||
11664 | || pcode == (byte)PCode.Tree | ||
11665 | || pcode == (byte)PCode.NewTree) | ||
11666 | { | ||
11667 | ret.Add(new LSL_Integer(ScriptBaseClass.OPT_OTHER)); | ||
11668 | } | ||
11669 | else | ||
11670 | { | ||
11671 | ret.Add(new LSL_Integer(ScriptBaseClass.OPT_LEGACY_LINKSET)); | ||
11672 | } | ||
11673 | break; | ||
11674 | case ScriptBaseClass.OBJECT_PHYSICS: | ||
11675 | if (obj.ParentGroup.AttachmentPoint != 0) | ||
11676 | { | ||
11677 | ret.Add(new LSL_Integer(0)); // Always false if attached | ||
11678 | } | ||
11679 | else | ||
11680 | { | ||
11681 | ret.Add(new LSL_Integer(obj.ParentGroup.UsesPhysics ? 1 : 0)); | ||
11682 | } | ||
11683 | break; | ||
11684 | case ScriptBaseClass.OBJECT_PHANTOM: | ||
11685 | if (obj.ParentGroup.AttachmentPoint != 0) | ||
11686 | { | ||
11687 | ret.Add(new LSL_Integer(0)); // Always false if attached | ||
11688 | } | ||
11689 | else | ||
11690 | { | ||
11691 | ret.Add(new LSL_Integer(obj.ParentGroup.IsPhantom ? 1 : 0)); | ||
11692 | } | ||
11693 | break; | ||
11694 | case ScriptBaseClass.OBJECT_TEMP_ON_REZ: | ||
11695 | ret.Add(new LSL_Integer(obj.ParentGroup.IsTemporary ? 1 : 0)); | ||
11696 | break; | ||
11622 | default: | 11697 | default: |
11623 | // Invalid or unhandled constant. | 11698 | // Invalid or unhandled constant. |
11624 | ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); | 11699 | ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 49857cf..d6ce069 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -995,7 +995,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
995 | if (animID == UUID.Zero) | 995 | if (animID == UUID.Zero) |
996 | target.Animator.RemoveAnimation(animation); | 996 | target.Animator.RemoveAnimation(animation); |
997 | else | 997 | else |
998 | target.Animator.RemoveAnimation(animID); | 998 | target.Animator.RemoveAnimation(animID, true); |
999 | } | 999 | } |
1000 | } | 1000 | } |
1001 | } | 1001 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 0dd5a57..da3b31f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -557,6 +557,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
557 | public const int OBJECT_SERVER_COST = 14; | 557 | public const int OBJECT_SERVER_COST = 14; |
558 | public const int OBJECT_STREAMING_COST = 15; | 558 | public const int OBJECT_STREAMING_COST = 15; |
559 | public const int OBJECT_PHYSICS_COST = 16; | 559 | public const int OBJECT_PHYSICS_COST = 16; |
560 | public const int OBJECT_CHARACTER_TIME = 17; | ||
561 | public const int OBJECT_ROOT = 18; | ||
562 | public const int OBJECT_ATTACHED_POINT = 19; | ||
563 | public const int OBJECT_PATHFINDING_TYPE = 20; | ||
564 | public const int OBJECT_PHYSICS = 21; | ||
565 | public const int OBJECT_PHANTOM = 22; | ||
566 | public const int OBJECT_TEMP_ON_REZ = 23; | ||
567 | |||
568 | // Pathfinding types | ||
569 | public const int OPT_OTHER = -1; | ||
570 | public const int OPT_LEGACY_LINKSET = 0; | ||
571 | public const int OPT_AVATAR = 1; | ||
572 | public const int OPT_CHARACTER = 2; | ||
573 | public const int OPT_WALKABLE = 3; | ||
574 | public const int OPT_STATIC_OBSTACLE = 4; | ||
575 | public const int OPT_MATERIAL_VOLUME = 5; | ||
576 | public const int OPT_EXCLUSION_VOLUME = 6; | ||
560 | 577 | ||
561 | // for llGetAgentList | 578 | // for llGetAgentList |
562 | public const int AGENT_LIST_PARCEL = 1; | 579 | public const int AGENT_LIST_PARCEL = 1; |