diff options
author | Robert Adams | 2014-09-21 07:11:00 -0700 |
---|---|---|
committer | Robert Adams | 2014-09-21 07:11:00 -0700 |
commit | 2ed3a918bd88ad427899e3fdfe65afca7aad95e8 (patch) | |
tree | f49bce49520a5632f147acc75f1dcdf7d4611861 /OpenSim | |
parent | Merge branch 'master' into bullet-2.82 (diff) | |
parent | This fixes the Scene thread renaming issue (diff) | |
download | opensim-SC-2ed3a918bd88ad427899e3fdfe65afca7aad95e8.zip opensim-SC-2ed3a918bd88ad427899e3fdfe65afca7aad95e8.tar.gz opensim-SC-2ed3a918bd88ad427899e3fdfe65afca7aad95e8.tar.bz2 opensim-SC-2ed3a918bd88ad427899e3fdfe65afca7aad95e8.tar.xz |
Merge branch 'master' into bullet-2.82
Diffstat (limited to 'OpenSim')
10 files changed, 60 insertions, 25 deletions
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index e095801..a7cb2a6 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs | |||
@@ -171,7 +171,8 @@ namespace OpenSim.Framework.Monitoring | |||
171 | foreach (char c in DisallowedShortNameCharacters) | 171 | foreach (char c in DisallowedShortNameCharacters) |
172 | { | 172 | { |
173 | if (shortName.IndexOf(c) != -1) | 173 | if (shortName.IndexOf(c) != -1) |
174 | throw new Exception(string.Format("Stat name {0} cannot contain character {1}", shortName, c)); | 174 | shortName = shortName.Replace(c, '#'); |
175 | // throw new Exception(string.Format("Stat name {0} cannot contain character {1}", shortName, c)); | ||
175 | } | 176 | } |
176 | 177 | ||
177 | ShortName = shortName; | 178 | ShortName = shortName; |
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs index e9e7bd2..e9f22f1 100644 --- a/OpenSim/Framework/Monitoring/Watchdog.cs +++ b/OpenSim/Framework/Monitoring/Watchdog.cs | |||
@@ -87,7 +87,7 @@ namespace OpenSim.Framework.Monitoring | |||
87 | /// </summary> | 87 | /// </summary> |
88 | public Stat Stat { get; set; } | 88 | public Stat Stat { get; set; } |
89 | 89 | ||
90 | public ThreadWatchdogInfo(Thread thread, int timeout) | 90 | public ThreadWatchdogInfo(Thread thread, int timeout, string name) |
91 | { | 91 | { |
92 | Thread = thread; | 92 | Thread = thread; |
93 | Timeout = timeout; | 93 | Timeout = timeout; |
@@ -96,8 +96,8 @@ namespace OpenSim.Framework.Monitoring | |||
96 | 96 | ||
97 | Stat | 97 | Stat |
98 | = new Stat( | 98 | = new Stat( |
99 | thread.Name, | 99 | name, |
100 | string.Format("Last update of thread {0}", thread.Name), | 100 | string.Format("Last update of thread {0}", name), |
101 | "", | 101 | "", |
102 | "ms", | 102 | "ms", |
103 | "server", | 103 | "server", |
@@ -216,12 +216,11 @@ namespace OpenSim.Framework.Monitoring | |||
216 | bool alarmIfTimeout, Func<string> alarmMethod, int timeout, bool log = true) | 216 | bool alarmIfTimeout, Func<string> alarmMethod, int timeout, bool log = true) |
217 | { | 217 | { |
218 | Thread thread = new Thread(start); | 218 | Thread thread = new Thread(start); |
219 | thread.Name = name; | ||
220 | thread.Priority = priority; | 219 | thread.Priority = priority; |
221 | thread.IsBackground = isBackground; | 220 | thread.IsBackground = isBackground; |
222 | 221 | ||
223 | ThreadWatchdogInfo twi | 222 | ThreadWatchdogInfo twi |
224 | = new ThreadWatchdogInfo(thread, timeout) | 223 | = new ThreadWatchdogInfo(thread, timeout, name) |
225 | { AlarmIfTimeout = alarmIfTimeout, AlarmMethod = alarmMethod }; | 224 | { AlarmIfTimeout = alarmIfTimeout, AlarmMethod = alarmMethod }; |
226 | 225 | ||
227 | if (log) | 226 | if (log) |
@@ -230,8 +229,10 @@ namespace OpenSim.Framework.Monitoring | |||
230 | 229 | ||
231 | lock (m_threads) | 230 | lock (m_threads) |
232 | m_threads.Add(twi.Thread.ManagedThreadId, twi); | 231 | m_threads.Add(twi.Thread.ManagedThreadId, twi); |
233 | 232 | ||
234 | thread.Start(); | 233 | thread.Start(); |
234 | thread.Name = name; | ||
235 | |||
235 | 236 | ||
236 | return thread; | 237 | return thread; |
237 | } | 238 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpRequestPump.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpRequestPump.cs index 77cfb7e..bdea278 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpRequestPump.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpRequestPump.cs | |||
@@ -70,9 +70,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
70 | _id = id; | 70 | _id = id; |
71 | 71 | ||
72 | _engine = new Thread(new ThreadStart(Engine)); | 72 | _engine = new Thread(new ThreadStart(Engine)); |
73 | _engine.Name = EngineID; | ||
74 | _engine.IsBackground = true; | 73 | _engine.IsBackground = true; |
75 | _engine.Start(); | 74 | _engine.Start(); |
75 | _engine.Name = string.Format ("Engine:{0}",EngineID); | ||
76 | 76 | ||
77 | ThreadTracker.Add(_engine); | 77 | ThreadTracker.Add(_engine); |
78 | } | 78 | } |
@@ -91,9 +91,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
91 | public void Start() | 91 | public void Start() |
92 | { | 92 | { |
93 | _engine = new Thread(new ThreadStart(Engine)); | 93 | _engine = new Thread(new ThreadStart(Engine)); |
94 | _engine.Name = EngineID; | ||
95 | _engine.IsBackground = true; | 94 | _engine.IsBackground = true; |
96 | _engine.Start(); | 95 | _engine.Start(); |
96 | _engine.Name = string.Format ("Engine:{0}",EngineID); | ||
97 | 97 | ||
98 | ThreadTracker.Add(_engine); | 98 | ThreadTracker.Add(_engine); |
99 | } | 99 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpServer.cs index 84aa31b..cd62842 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpServer.cs | |||
@@ -150,9 +150,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
150 | public void Start() | 150 | public void Start() |
151 | { | 151 | { |
152 | _engine = new Thread(new ThreadStart(Engine)); | 152 | _engine = new Thread(new ThreadStart(Engine)); |
153 | _engine.Name = _engineId; | ||
154 | _engine.IsBackground = true; | 153 | _engine.IsBackground = true; |
155 | _engine.Start(); | 154 | _engine.Start(); |
155 | _engine.Name = string.Format ("Engine:{0}",_engineId); | ||
156 | 156 | ||
157 | ThreadTracker.Add(_engine); | 157 | ThreadTracker.Add(_engine); |
158 | 158 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index cddf818..ea242f5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -145,6 +145,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
145 | } | 145 | } |
146 | 146 | ||
147 | /// <summary> | 147 | /// <summary> |
148 | /// | ||
149 | /// </summary> | ||
150 | /// <param name="message"></param> | ||
151 | /// <param name="type"></param> | ||
152 | /// <param name="channel"></param> | ||
153 | /// <param name="fromPos"></param> | ||
154 | /// <param name="fromName"></param> | ||
155 | /// <param name="fromAgentID"></param> | ||
156 | /// <param name="targetID"></param> | ||
157 | public void SimChatToAgent(UUID targetID, byte[] message, int channel, Vector3 fromPos, string fromName, UUID fromID, bool fromAgent) | ||
158 | { | ||
159 | SimChat(message, ChatTypeEnum.Region, channel, fromPos, fromName, fromID, targetID, fromAgent, false); | ||
160 | } | ||
161 | |||
162 | /// <summary> | ||
148 | /// Invoked when the client requests a prim. | 163 | /// Invoked when the client requests a prim. |
149 | /// </summary> | 164 | /// </summary> |
150 | /// <param name="primLocalID"></param> | 165 | /// <param name="primLocalID"></param> |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 28dbccb..19cb0f8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1079,6 +1079,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1079 | StatsReporter = new SimStatsReporter(this); | 1079 | StatsReporter = new SimStatsReporter(this); |
1080 | StatsReporter.OnSendStatsResult += SendSimStatsPackets; | 1080 | StatsReporter.OnSendStatsResult += SendSimStatsPackets; |
1081 | StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; | 1081 | StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; |
1082 | |||
1082 | } | 1083 | } |
1083 | 1084 | ||
1084 | public Scene(RegionInfo regInfo, PhysicsScene physicsScene) : base(regInfo) | 1085 | public Scene(RegionInfo regInfo, PhysicsScene physicsScene) : base(regInfo) |
@@ -1396,7 +1397,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1396 | 1397 | ||
1397 | m_heartbeatThread | 1398 | m_heartbeatThread |
1398 | = Watchdog.StartThread( | 1399 | = Watchdog.StartThread( |
1399 | Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false); | 1400 | Heartbeat, string.Format("Heartbeat-({0})", RegionInfo.RegionName.Replace(" ", "_")), ThreadPriority.Normal, false, false); |
1400 | 1401 | ||
1401 | StartScripts(); | 1402 | StartScripts(); |
1402 | } | 1403 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8785ca9..c587b2a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1589,20 +1589,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
1589 | 1589 | ||
1590 | public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim) | 1590 | public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim) |
1591 | { | 1591 | { |
1592 | byte[] data = new byte[16]; | 1592 | byte[] data; |
1593 | int pos = 0; | ||
1594 | 1593 | ||
1595 | // The flags don't like conversion from uint to byte, so we have to do | 1594 | if (pTexAnim.Flags == Primitive.TextureAnimMode.ANIM_OFF) |
1596 | // it the crappy way. See the above function :( | 1595 | { |
1596 | data = Utils.EmptyBytes; | ||
1597 | } | ||
1598 | else | ||
1599 | { | ||
1600 | data = new byte[16]; | ||
1601 | int pos = 0; | ||
1602 | |||
1603 | // The flags don't like conversion from uint to byte, so we have to do | ||
1604 | // it the crappy way. See the above function :( | ||
1597 | 1605 | ||
1598 | data[pos] = ConvertScriptUintToByte((uint)pTexAnim.Flags); pos++; | 1606 | data[pos] = ConvertScriptUintToByte((uint)pTexAnim.Flags); pos++; |
1599 | data[pos] = (byte)pTexAnim.Face; pos++; | 1607 | data[pos] = (byte)pTexAnim.Face; pos++; |
1600 | data[pos] = (byte)pTexAnim.SizeX; pos++; | 1608 | data[pos] = (byte)pTexAnim.SizeX; pos++; |
1601 | data[pos] = (byte)pTexAnim.SizeY; pos++; | 1609 | data[pos] = (byte)pTexAnim.SizeY; pos++; |
1602 | 1610 | ||
1603 | Utils.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); | 1611 | Utils.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); |
1604 | Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); | 1612 | Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); |
1605 | Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); | 1613 | Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); |
1614 | } | ||
1606 | 1615 | ||
1607 | m_TextureAnimation = data; | 1616 | m_TextureAnimation = data; |
1608 | } | 1617 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 59b521d..87063c6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2618,7 +2618,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2618 | } | 2618 | } |
2619 | } | 2619 | } |
2620 | 2620 | ||
2621 | Vector3 sitPartWorldPosition = part.GetWorldPosition(); | ||
2622 | ControllingClient.SendClearFollowCamProperties(part.ParentUUID); | 2621 | ControllingClient.SendClearFollowCamProperties(part.ParentUUID); |
2623 | 2622 | ||
2624 | ParentID = 0; | 2623 | ParentID = 0; |
@@ -2647,13 +2646,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2647 | 2646 | ||
2648 | // Vector3 standPositionAdjustment | 2647 | // Vector3 standPositionAdjustment |
2649 | // = part.SitTargetPosition + new Vector3(0.5f, 0f, m_sitAvatarHeight / 2f); | 2648 | // = part.SitTargetPosition + new Vector3(0.5f, 0f, m_sitAvatarHeight / 2f); |
2650 | Vector3 adjustmentForSitPosition = (part.SitTargetPosition + OffsetPosition) * part.GetWorldRotation(); | 2649 | Vector3 adjustmentForSitPosition = (OffsetPosition - SIT_TARGET_ADJUSTMENT) * part.GetWorldRotation(); |
2651 | 2650 | ||
2652 | // XXX: This is based on the physics capsule sizes. Need to find a better way to read this rather than | 2651 | // XXX: This is based on the physics capsule sizes. Need to find a better way to read this rather than |
2653 | // hardcoding here. | 2652 | // hardcoding here. |
2654 | Vector3 adjustmentForSitPose = new Vector3(0.74f, 0f, 0f) * standRotation; | 2653 | Vector3 adjustmentForSitPose = new Vector3(0.74f, 0f, 0f) * standRotation; |
2655 | 2654 | ||
2656 | Vector3 standPos = sitPartWorldPosition + adjustmentForSitPosition + adjustmentForSitPose; | 2655 | Vector3 standPos = part.ParentGroup.AbsolutePosition + adjustmentForSitPosition + adjustmentForSitPose; |
2657 | 2656 | ||
2658 | // m_log.DebugFormat( | 2657 | // m_log.DebugFormat( |
2659 | // "[SCENE PRESENCE]: Setting stand to pos {0}, (adjustmentForSitPosition {1}, adjustmentForSitPose {2}) rotation {3} for {4} in {5}", | 2658 | // "[SCENE PRESENCE]: Setting stand to pos {0}, (adjustmentForSitPosition {1}, adjustmentForSitPose {2}) rotation {3} for {4} in {5}", |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 03c6265..95e59ab 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -234,6 +234,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
234 | ScenePresence sp; | 234 | ScenePresence sp; |
235 | if (scene.TryGetScenePresence(agentID, out sp)) | 235 | if (scene.TryGetScenePresence(agentID, out sp)) |
236 | { | 236 | { |
237 | if (sp.IsSatOnObject || sp.SitGround) | ||
238 | return false; | ||
239 | |||
237 | // m_log.DebugFormat( | 240 | // m_log.DebugFormat( |
238 | // "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", | 241 | // "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", |
239 | // sp.Name, pos, scene.RegionInfo.RegionName, | 242 | // sp.Name, pos, scene.RegionInfo.RegionName, |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7c384b2..e7ba7a4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -968,6 +968,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
968 | 968 | ||
969 | m_host.AddScriptLPS(1); | 969 | m_host.AddScriptLPS(1); |
970 | 970 | ||
971 | World.SimChat(Utils.StringToBytes(text), | ||
972 | ChatTypeEnum.Region, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); | ||
973 | |||
971 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 974 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
972 | if (wComm != null) | 975 | if (wComm != null) |
973 | wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); | 976 | wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); |
@@ -988,6 +991,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
988 | UUID TargetID; | 991 | UUID TargetID; |
989 | UUID.TryParse(target, out TargetID); | 992 | UUID.TryParse(target, out TargetID); |
990 | 993 | ||
994 | World.SimChatToAgent(TargetID, Utils.StringToBytes(msg), | ||
995 | channel, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true); | ||
996 | |||
991 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 997 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
992 | if (wComm != null) | 998 | if (wComm != null) |
993 | wComm.DeliverMessageTo(TargetID, channel, m_host.AbsolutePosition, m_host.Name, m_host.UUID, msg); | 999 | wComm.DeliverMessageTo(TargetID, channel, m_host.AbsolutePosition, m_host.Name, m_host.UUID, msg); |