diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 089a7a27b4..e3f9d898a5 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -72,10 +72,12 @@ what it is today. * Allen Kerensky * BigFootAg * BlueWall Slade +* bobshaffer2 * brianw/Sir_Ahzz * CharlieO * ChrisDown * Chris Yeoh (IBM) +* cinderblocks * controlbreak * coyled * ctrlaltdavid (David Rowe) @@ -88,6 +90,7 @@ what it is today. * DoranZemlja * dr0b3rts * dslake +* eeyore * FredoChaplin * Garmin Kawaguichi * Gerhard diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index e095801f2a..a7cb2a6ae9 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs @@ -171,7 +171,8 @@ namespace OpenSim.Framework.Monitoring foreach (char c in DisallowedShortNameCharacters) { if (shortName.IndexOf(c) != -1) - throw new Exception(string.Format("Stat name {0} cannot contain character {1}", shortName, c)); + shortName = shortName.Replace(c, '#'); +// throw new Exception(string.Format("Stat name {0} cannot contain character {1}", shortName, c)); } ShortName = shortName; diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs index e9e7bd21c0..e9f22f1b07 100644 --- a/OpenSim/Framework/Monitoring/Watchdog.cs +++ b/OpenSim/Framework/Monitoring/Watchdog.cs @@ -87,7 +87,7 @@ namespace OpenSim.Framework.Monitoring /// public Stat Stat { get; set; } - public ThreadWatchdogInfo(Thread thread, int timeout) + public ThreadWatchdogInfo(Thread thread, int timeout, string name) { Thread = thread; Timeout = timeout; @@ -96,8 +96,8 @@ namespace OpenSim.Framework.Monitoring Stat = new Stat( - thread.Name, - string.Format("Last update of thread {0}", thread.Name), + name, + string.Format("Last update of thread {0}", name), "", "ms", "server", @@ -216,12 +216,11 @@ namespace OpenSim.Framework.Monitoring bool alarmIfTimeout, Func alarmMethod, int timeout, bool log = true) { Thread thread = new Thread(start); - thread.Name = name; thread.Priority = priority; thread.IsBackground = isBackground; ThreadWatchdogInfo twi - = new ThreadWatchdogInfo(thread, timeout) + = new ThreadWatchdogInfo(thread, timeout, name) { AlarmIfTimeout = alarmIfTimeout, AlarmMethod = alarmMethod }; if (log) @@ -230,8 +229,10 @@ namespace OpenSim.Framework.Monitoring lock (m_threads) m_threads.Add(twi.Thread.ManagedThreadId, twi); - + thread.Start(); + thread.Name = name; + return thread; } diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpRequestPump.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpRequestPump.cs index 77cfb7e472..bdea278810 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpRequestPump.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpRequestPump.cs @@ -70,9 +70,9 @@ namespace OpenSim.Framework.Servers.HttpServer _id = id; _engine = new Thread(new ThreadStart(Engine)); - _engine.Name = EngineID; _engine.IsBackground = true; _engine.Start(); + _engine.Name = string.Format ("Engine:{0}",EngineID); ThreadTracker.Add(_engine); } @@ -91,9 +91,9 @@ namespace OpenSim.Framework.Servers.HttpServer public void Start() { _engine = new Thread(new ThreadStart(Engine)); - _engine.Name = EngineID; _engine.IsBackground = true; _engine.Start(); + _engine.Name = string.Format ("Engine:{0}",EngineID); ThreadTracker.Add(_engine); } diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpServer.cs index 84aa31b824..cd6284259a 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpServer.cs @@ -150,9 +150,9 @@ namespace OpenSim.Framework.Servers.HttpServer public void Start() { _engine = new Thread(new ThreadStart(Engine)); - _engine.Name = _engineId; _engine.IsBackground = true; _engine.Start(); + _engine.Name = string.Format ("Engine:{0}",_engineId); ThreadTracker.Add(_engine); diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index cddf8189b1..ea242f5609 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -144,6 +144,21 @@ namespace OpenSim.Region.Framework.Scenes SimChat(message, ChatTypeEnum.Say, 0, fromPos, fromName, fromID, targetID, fromAgent, false); } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void SimChatToAgent(UUID targetID, byte[] message, int channel, Vector3 fromPos, string fromName, UUID fromID, bool fromAgent) + { + SimChat(message, ChatTypeEnum.Region, channel, fromPos, fromName, fromID, targetID, fromAgent, false); + } + /// /// Invoked when the client requests a prim. /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 28dbccb95f..19cb0f8fca 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1079,6 +1079,7 @@ namespace OpenSim.Region.Framework.Scenes StatsReporter = new SimStatsReporter(this); StatsReporter.OnSendStatsResult += SendSimStatsPackets; StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; + } public Scene(RegionInfo regInfo, PhysicsScene physicsScene) : base(regInfo) @@ -1396,7 +1397,7 @@ namespace OpenSim.Region.Framework.Scenes m_heartbeatThread = Watchdog.StartThread( - Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false); + Heartbeat, string.Format("Heartbeat-({0})", RegionInfo.RegionName.Replace(" ", "_")), ThreadPriority.Normal, false, false); StartScripts(); } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8785ca97d8..c587b2aff4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1589,20 +1589,29 @@ namespace OpenSim.Region.Framework.Scenes public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim) { - byte[] data = new byte[16]; - int pos = 0; + byte[] data; - // The flags don't like conversion from uint to byte, so we have to do - // it the crappy way. See the above function :( + if (pTexAnim.Flags == Primitive.TextureAnimMode.ANIM_OFF) + { + data = Utils.EmptyBytes; + } + else + { + data = new byte[16]; + int pos = 0; - data[pos] = ConvertScriptUintToByte((uint)pTexAnim.Flags); pos++; - data[pos] = (byte)pTexAnim.Face; pos++; - data[pos] = (byte)pTexAnim.SizeX; pos++; - data[pos] = (byte)pTexAnim.SizeY; pos++; + // The flags don't like conversion from uint to byte, so we have to do + // it the crappy way. See the above function :( - Utils.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); - Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); - Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); + data[pos] = ConvertScriptUintToByte((uint)pTexAnim.Flags); pos++; + data[pos] = (byte)pTexAnim.Face; pos++; + data[pos] = (byte)pTexAnim.SizeX; pos++; + data[pos] = (byte)pTexAnim.SizeY; pos++; + + Utils.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); + Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); + Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); + } m_TextureAnimation = data; } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 59b521db5f..87063c6d4c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2618,7 +2618,6 @@ namespace OpenSim.Region.Framework.Scenes } } - Vector3 sitPartWorldPosition = part.GetWorldPosition(); ControllingClient.SendClearFollowCamProperties(part.ParentUUID); ParentID = 0; @@ -2647,13 +2646,13 @@ namespace OpenSim.Region.Framework.Scenes // Vector3 standPositionAdjustment // = part.SitTargetPosition + new Vector3(0.5f, 0f, m_sitAvatarHeight / 2f); - Vector3 adjustmentForSitPosition = (part.SitTargetPosition + OffsetPosition) * part.GetWorldRotation(); + Vector3 adjustmentForSitPosition = (OffsetPosition - SIT_TARGET_ADJUSTMENT) * part.GetWorldRotation(); // XXX: This is based on the physics capsule sizes. Need to find a better way to read this rather than // hardcoding here. Vector3 adjustmentForSitPose = new Vector3(0.74f, 0f, 0f) * standRotation; - Vector3 standPos = sitPartWorldPosition + adjustmentForSitPosition + adjustmentForSitPose; + Vector3 standPos = part.ParentGroup.AbsolutePosition + adjustmentForSitPosition + adjustmentForSitPose; // m_log.DebugFormat( // "[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 03c6265fec..95e59ab38e 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 ScenePresence sp; if (scene.TryGetScenePresence(agentID, out sp)) { + if (sp.IsSatOnObject || sp.SitGround) + return false; + // m_log.DebugFormat( // "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", // 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 7c384b268f..e7ba7a4f1e 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 m_host.AddScriptLPS(1); + World.SimChat(Utils.StringToBytes(text), + ChatTypeEnum.Region, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); + IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); if (wComm != null) wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); @@ -988,6 +991,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api UUID TargetID; UUID.TryParse(target, out TargetID); + World.SimChatToAgent(TargetID, Utils.StringToBytes(msg), + channel, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true); + IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); if (wComm != null) wComm.DeliverMessageTo(TargetID, channel, m_host.AbsolutePosition, m_host.Name, m_host.UUID, msg); diff --git a/ThirdParty/SmartThreadPool/SmartThreadPool.cs b/ThirdParty/SmartThreadPool/SmartThreadPool.cs index a4f4ce5695..615518ecf1 100644 --- a/ThirdParty/SmartThreadPool/SmartThreadPool.cs +++ b/ThirdParty/SmartThreadPool/SmartThreadPool.cs @@ -677,7 +677,6 @@ namespace Amib.Threading : new Thread(ProcessQueuedItems); #endif // Configure the new thread and start it - workerThread.Name = "STP " + Name + " Thread #" + _threadCounter; workerThread.IsBackground = _stpStartInfo.AreThreadsBackground; #if !(_SILVERLIGHT) && !(_WINDOWS_CE) && !(WINDOWS_PHONE) @@ -691,6 +690,7 @@ namespace Amib.Threading workerThread.Priority = _stpStartInfo.ThreadPriority; #endif workerThread.Start(); + workerThread.Name = string.Format("STP:{0}:{1}", Name, _threadCounter); ++_threadCounter; // Add it to the dictionary and update its creation time.