From ac2f98b846eba85ab3d9acb5bd0f355a404de86c Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 03:32:30 -0400 Subject: * A hacky attempt at resolving mantis #4260. I think ODE was unable to allocate memory, and therefore the unmanaged wrapper call fails or worse.. there's some unmanaged resource accounting in the ODEPlugin for ODECharacter that isn't being done properly now. * The broken avatar may not be able to move, but it won't stop simulate from pressing on now. And, the simulator will try to destroy the avatar's physics proxy and recreate it again... but if this is what I think it is, it may not help. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 +++++++++ OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 24 ++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 646a483..96fa467 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3410,11 +3410,20 @@ namespace OpenSim.Region.Framework.Scenes scene.AddPhysicsActorTaint(m_physicsActor); //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; + m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong m_physicsActor.SubscribeEvents(500); m_physicsActor.LocalID = LocalId; } + private void OutOfBoundsCall(PhysicsVector pos) + { + bool flying = m_physicsActor.Flying; + RemoveFromPhysicalScene(); + + AddToPhysicalScene(flying); + } + // Event called by the physics plugin to tell the avatar about a collision. private void PhysicsCollisionUpdate(EventArgs e) { diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index bd81d50..bd05c92 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -1105,7 +1105,18 @@ namespace OpenSim.Region.Physics.OdePlugin public void UpdatePositionAndVelocity() { // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! - d.Vector3 vec = d.BodyGetPosition(Body); + d.Vector3 vec; + try + { + vec = d.BodyGetPosition(Body); + //throw new NullReferenceException("foo!"); + } + catch (NullReferenceException) + { + vec = new d.Vector3(Position.X, Position.Y, Position.Z); + base.RaiseOutOfBounds(_position); + } + // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) if (vec.X < 0.0f) vec.X = 0.0f; @@ -1137,7 +1148,16 @@ namespace OpenSim.Region.Physics.OdePlugin else { m_lastUpdateSent = false; - vec = d.BodyGetLinearVel(Body); + try + { + vec = d.BodyGetLinearVel(Body); + } + catch (NullReferenceException) + { + vec.X = _velocity.X; + vec.Y = _velocity.Y; + vec.Z = _velocity.Z; + } _velocity.X = (vec.X); _velocity.Y = (vec.Y); -- cgit v1.1 From 1f28c6208be1b3be1acca69f0ac8056d0ceecc06 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 03:40:44 -0400 Subject: * Added a message for when the null reference exception occurs to make debugging easier. Without this, from the user's perspective.. they cannot move, fly or otherwise do anything physical and without a message on the console, it would be hard to tell that this is what is occurring. --- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index bd05c92..e5458d4 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -1109,12 +1109,13 @@ namespace OpenSim.Region.Physics.OdePlugin try { vec = d.BodyGetPosition(Body); - //throw new NullReferenceException("foo!"); + } catch (NullReferenceException) { - vec = new d.Vector3(Position.X, Position.Y, Position.Z); - base.RaiseOutOfBounds(_position); + vec = new d.Vector3(_position.X, _position.Y, _position.Z); + base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! + m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name); } -- cgit v1.1 From 67afa9e633b6b5c9c8be8f50eeecc5177c05119b Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 03:52:57 -0400 Subject: * Make sure to unregister the OutOfBounds Physics event in RemoveFromPhysicalScene or we'll be leaking --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 96fa467..b468dde 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -908,6 +908,7 @@ namespace OpenSim.Region.Framework.Scenes if (PhysicsActor != null) { m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; + m_physicsActor.OnOutOfBounds -= OutOfBoundsCall; m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); m_physicsActor.UnSubscribeEvents(); m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; -- cgit v1.1 From 0487092d15e6e456d8516bd7ae2487809c50ffc6 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 16 Oct 2009 13:28:40 +0100 Subject: Thank you, Fly man, for plumbing the AvatarInterestsUpdate packet --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 4b27fa2..05a2a63 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -9969,11 +9969,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP Utils.BytesToString(avatarNotesUpdate.Data.Notes)); break; -// case PacketType.AvatarInterestsUpdate: -// AvatarInterestsUpdatePacket avatarInterestUpdate = -// (AvatarInterestsUpdatePacket)Pack; -// -// break; + case PacketType.AvatarInterestsUpdate: + AvatarInterestsUpdatePacket avatarInterestUpdate = + (AvatarInterestsUpdatePacket)Pack; + + #region Packet Session and User Check + if (m_checkPackets) + { + if (avatarInterestUpdate.AgentData.SessionID != SessionId || + avatarInterestUpdate.AgentData.AgentID != AgentId) + break; + } + #endregion + + AvatarInterestUpdate handlerAvatarInterestUpdate = OnAvatarInterestUpdate; + if (handlerAvatarInterestUpdate != null) + handlerAvatarInterestUpdate(this, + avatarInterestUpdate.PropertiesData.WantToMask, + Utils.BytesToString(avatarInterestUpdate.PropertiesData.WantToText), + avatarInterestUpdate.PropertiesData.SkillsMask, + Utils.BytesToString(avatarInterestUpdate.PropertiesData.SkillsText), + Utils.BytesToString(avatarInterestUpdate.PropertiesData.LanguagesText)); + break; case PacketType.PlacesQuery: PlacesQueryPacket placesQueryPacket = -- cgit v1.1 From 0079d0a7c423db6e95c04b9055127b53ae6a3622 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 14:30:55 -0400 Subject: * One more attempt at the NullRef In The OdePlugin. This might fix it, but it will definitely get us closer to the root cause. --- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 2 +- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index e5458d4..1fff846 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -1109,10 +1109,10 @@ namespace OpenSim.Region.Physics.OdePlugin try { vec = d.BodyGetPosition(Body); - } catch (NullReferenceException) { + _parent_scene.BadCharacter(this); vec = new d.Vector3(_position.X, _position.Y, _position.Z); base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name); diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 083b7db..0e03e81 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -242,6 +242,7 @@ namespace OpenSim.Region.Physics.OdePlugin private readonly HashSet _taintedActors = new HashSet(); private readonly List _perloopContact = new List(); private readonly List _collisionEventPrim = new List(); + private readonly HashSet _badCharacter = new HashSet(); public Dictionary geom_name_map = new Dictionary(); public Dictionary actor_name_map = new Dictionary(); private bool m_NINJA_physics_joints_enabled = false; @@ -1677,6 +1678,14 @@ namespace OpenSim.Region.Physics.OdePlugin } } } + public void BadCharacter(OdeCharacter chr) + { + lock (_badCharacter) + { + if (!_badCharacter.Contains(chr)) + _badCharacter.Add(chr); + } + } public override void RemoveAvatar(PhysicsActor actor) { @@ -2975,6 +2984,18 @@ namespace OpenSim.Region.Physics.OdePlugin } } + lock (_badCharacter) + { + if (_badCharacter.Count > 0) + { + foreach (OdeCharacter chr in _badCharacter) + { + RemoveCharacter(chr); + } + _badCharacter.Clear(); + } + } + lock (_activeprims) { //if (timeStep < 0.2f) -- cgit v1.1 From ac31cb89d59b1d9be84df94ef3f26cad8624c452 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 16:22:10 -0400 Subject: * Ensure that at least 20 frames run before letting avatar in. --- OpenSim/Region/Framework/Scenes/Scene.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d3d397d..c4622cd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -128,6 +128,7 @@ namespace OpenSim.Region.Framework.Scenes public CommunicationsManager CommsManager; protected SceneCommunicationService m_sceneGridService; + public bool loginsdisabled = true; public SceneCommunicationService SceneGridService { @@ -1062,6 +1063,11 @@ namespace OpenSim.Region.Framework.Scenes StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount()); StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); } + if (loginsdisabled && ((m_frame % 20) == 0)) + { + m_log.Debug("[REGION]: Enabling Logins"); + loginsdisabled = false; + } } catch (NotImplementedException) { @@ -3227,6 +3233,11 @@ namespace OpenSim.Region.Framework.Scenes /// also return a reason. public bool NewUserConnection(AgentCircuitData agent, out string reason) { + if (loginsdisabled) + { + reason = "Logins Disabled"; + return false; + } // Don't disable this log message - it's too helpful m_log.InfoFormat( "[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5})", -- cgit v1.1 From f5964347bdb7df75ec41dcdfc7e9f648caa18ee2 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 16:25:48 -0400 Subject: * fix previous commit --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c4622cd..29d2a84 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1063,7 +1063,7 @@ namespace OpenSim.Region.Framework.Scenes StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount()); StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); } - if (loginsdisabled && ((m_frame % 20) == 0)) + if (loginsdisabled && (m_frame > 20)) { m_log.Debug("[REGION]: Enabling Logins"); loginsdisabled = false; -- cgit v1.1 From d49424c4211cb9128c116c8a0a13d9873eee5176 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 21:20:55 -0400 Subject: * After seeing it repeat over and over again.. again, We won't inform the scenepresence that there was an issue so it doesn't try to make the capsule again. I have a feeling that this is some kind of object leak. We'll know for sure.. soon. --- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 1fff846..8002eb2 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -1114,7 +1114,7 @@ namespace OpenSim.Region.Physics.OdePlugin { _parent_scene.BadCharacter(this); vec = new d.Vector3(_position.X, _position.Y, _position.Z); - base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! + //base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name); } -- cgit v1.1 From 01051daaab27cf4c4b5e3d5e8066caa61cf769a6 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 21:24:08 -0400 Subject: * One more tweak to inform the user that they may not be able to move until relogging. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 +++++--- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b468dde..c25fa55 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3419,10 +3419,12 @@ namespace OpenSim.Region.Framework.Scenes private void OutOfBoundsCall(PhysicsVector pos) { - bool flying = m_physicsActor.Flying; - RemoveFromPhysicalScene(); + //bool flying = m_physicsActor.Flying; + //RemoveFromPhysicalScene(); - AddToPhysicalScene(flying); + //AddToPhysicalScene(flying); + if (ControllingClient != null) + ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.",true); } // Event called by the physics plugin to tell the avatar about a collision. diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 8002eb2..1fff846 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -1114,7 +1114,7 @@ namespace OpenSim.Region.Physics.OdePlugin { _parent_scene.BadCharacter(this); vec = new d.Vector3(_position.X, _position.Y, _position.Z); - //base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! + base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name); } -- cgit v1.1 From c7da13eb234d22c4d1b111fb51a4093ce49de0b7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 17 Oct 2009 14:50:21 +0100 Subject: Adds SendAvatarInterestsUpdate to IClientAPI Thank you, Fly-Man --- .../Agent/InternetRelayClientView/Server/IRCClientView.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index a8acf0d..434da0a 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -831,7 +831,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public event PickInfoUpdate OnPickInfoUpdate; public event AvatarNotesUpdate OnAvatarNotesUpdate; public event MuteListRequest OnMuteListRequest; + public event AvatarInterestUpdate OnAvatarInterestUpdate; public event PlacesQuery OnPlacesQuery; + #pragma warning restore 67 public void SetDebugPacketLevel(int newDebug) @@ -1570,6 +1572,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } + public void SendAvatarInterestUpdate(IClientAPI client, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages) + { + + } + public void SendParcelDwellReply(int localID, UUID parcelID, float dwell) { -- cgit v1.1 From 66923983a7e5214843e59ae40f3c4ad7587feed8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 17 Oct 2009 22:36:44 +0100 Subject: Add support for display of the script compilation errors in the script editor's debug pane. This will still use DEBUG_CHANNEL currently, since it is not fully implemented. This also removes the "Compiled successfully" message that pops up in the viewer. --- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 13 +++---- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 45 +++++++++++++++------- 2 files changed, 38 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 97166cf..2b858ec 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -353,15 +353,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance // m_log.ErrorFormat("[Script] Unable to load script state from xml: {0}\n"+e.ToString(), xml); } } - else - { - ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID); +// else +// { +// ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID); - if (presence != null && (!postOnRez)) - presence.ControllingClient.SendAgentAlertMessage("Compile successful", false); +// if (presence != null && (!postOnRez)) +// presence.ControllingClient.SendAgentAlertMessage("Compile successful", false); -// // m_log.ErrorFormat("[Script] Unable to load script state, file not found"); - } +// } } public void Init() diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 847da8c..7b19ce3 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -604,9 +604,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (warnings != null && warnings.Length != 0) { - if (presence != null && (!postOnRez)) - presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false); - foreach (string warning in warnings) { try @@ -615,10 +612,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine string text = "Warning:\n" + warning; if (text.Length > 1000) text = text.Substring(0, 1000); - World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.DebugChannel, 2147483647, - part.AbsolutePosition, - part.Name, part.UUID, false); + if (!ShowScriptSaveResponse(item.OwnerID, + assetID, text, true)) + { + if (presence != null && (!postOnRez)) + presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false); + + World.SimChat(Utils.StringToBytes(text), + ChatTypeEnum.DebugChannel, 2147483647, + part.AbsolutePosition, + part.Name, part.UUID, false); + } } catch (Exception e2) // LEGIT: User Scripting { @@ -634,8 +638,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine } catch (Exception e) { - if (presence != null && (!postOnRez)) - presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false); try { // DISPLAY ERROR INWORLD @@ -645,10 +647,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString(); if (text.Length > 1000) text = text.Substring(0, 1000); - World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.DebugChannel, 2147483647, - part.AbsolutePosition, - part.Name, part.UUID, false); + if (!ShowScriptSaveResponse(item.OwnerID, + assetID, text, false)) + { + if (presence != null && (!postOnRez)) + presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false); + World.SimChat(Utils.StringToBytes(text), + ChatTypeEnum.DebugChannel, 2147483647, + part.AbsolutePosition, + part.Name, part.UUID, false); + } } catch (Exception e2) // LEGIT: User Scripting { @@ -732,6 +740,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); + if (presence != null) + { + ShowScriptSaveResponse(item.OwnerID, + assetID, "Compile successful", true); + } + instance.AppDomain = appDomain; instance.LineMap = linemap; @@ -1250,5 +1264,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine return instance.CanBeDeleted(); } + + private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled) + { + return false; + } } } -- cgit v1.1 From 0d29614ca129a044f6fad01f5600c52a922b702c Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 19 Oct 2009 08:58:03 +0900 Subject: Formatting cleanup. --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 4 ++-- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- OpenSim/Region/Physics/Manager/IMesher.cs | 2 +- OpenSim/Region/Physics/Meshing/Mesh.cs | 6 +++--- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 4 ++-- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 4041b63..5ca4178 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -730,7 +730,7 @@ namespace Flotsam.RegionModules.AssetCache int fileCount = GetFileCacheCount(m_CacheDirectory); m_log.InfoFormat("[FLOTSAM ASSET CACHE] File Cache : {0} assets", fileCount); - foreach ( string s in Directory.GetFiles(m_CacheDirectory, "*.fac" ) ) + foreach (string s in Directory.GetFiles(m_CacheDirectory, "*.fac")) { m_log.Info("[FLOTSAM ASSET CACHE] Deep Scans were performed on the following regions:"); @@ -770,7 +770,7 @@ namespace Flotsam.RegionModules.AssetCache int assetsCached = CacheScenes(); m_log.InfoFormat("[FLOTSAM ASSET CACHE] Completed Scene Caching, {0} assets found.", assetsCached); - }); + }); break; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 29d2a84..151df27 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1116,13 +1116,13 @@ namespace OpenSim.Region.Framework.Scenes public void AddGroupTarget(SceneObjectGroup grp) { - lock(m_groupsWithTargets) + lock (m_groupsWithTargets) m_groupsWithTargets[grp.UUID] = grp; } public void RemoveGroupTarget(SceneObjectGroup grp) { - lock(m_groupsWithTargets) + lock (m_groupsWithTargets) m_groupsWithTargets.Remove(grp.UUID); } diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/Physics/Manager/IMesher.cs index ac14292..1a8c948 100644 --- a/OpenSim/Region/Physics/Manager/IMesher.cs +++ b/OpenSim/Region/Physics/Manager/IMesher.cs @@ -48,7 +48,7 @@ namespace OpenSim.Region.Physics.Manager int[] getIndexListAsIntLocked(); float[] getVertexListAsFloatLocked(); void getIndexListAsPtrToIntArray(out IntPtr indices, out int triStride, out int indexCount); - void getVertexListAsPtrToFloatArray( out IntPtr vertexList, out int vertexStride, out int vertexCount ); + void getVertexListAsPtrToFloatArray(out IntPtr vertexList, out int vertexStride, out int vertexCount); void releaseSourceMeshData(); void releasePinned(); void Append(IMesh newMesh); diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs index 94d926a..4c3cf33 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/Physics/Meshing/Mesh.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.Physics.Meshing throw new NotSupportedException("Attempt to Add to a pinned Mesh"); // If a vertex of the triangle is not yet in the vertices list, // add it and set its index to the current index count - if( !m_vertices.ContainsKey(triangle.v1) ) + if (!m_vertices.ContainsKey(triangle.v1)) m_vertices[triangle.v1] = m_vertices.Count; if (!m_vertices.ContainsKey(triangle.v2)) m_vertices[triangle.v2] = m_vertices.Count; @@ -153,7 +153,7 @@ namespace OpenSim.Region.Physics.Meshing private float[] getVertexListAsFloat() { - if(m_vertices == null) + if (m_vertices == null) throw new NotSupportedException(); float[] result = new float[m_vertices.Count * 3]; foreach (KeyValuePair kvp in m_vertices) @@ -169,7 +169,7 @@ namespace OpenSim.Region.Physics.Meshing public float[] getVertexListAsFloatLocked() { - if( m_pinnedVertexes.IsAllocated ) + if (m_pinnedVertexes.IsAllocated) return (float[])(m_pinnedVertexes.Target); float[] result = getVertexListAsFloat(); diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 496e097..63bfc90 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -816,8 +816,8 @@ namespace OpenSim.Region.Physics.OdePlugin IntPtr vertices, indices; int vertexCount, indexCount; int vertexStride, triStride; - mesh.getVertexListAsPtrToFloatArray( out vertices, out vertexStride, out vertexCount ); // Note, that vertices are fixed in unmanaged heap - mesh.getIndexListAsPtrToIntArray( out indices, out triStride, out indexCount ); // Also fixed, needs release after usage + mesh.getVertexListAsPtrToFloatArray(out vertices, out vertexStride, out vertexCount); // Note, that vertices are fixed in unmanaged heap + mesh.getIndexListAsPtrToIntArray(out indices, out triStride, out indexCount); // Also fixed, needs release after usage mesh.releaseSourceMeshData(); // free up the original mesh data to save memory diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 0e03e81..92afe39 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -3799,7 +3799,7 @@ namespace OpenSim.Region.Physics.OdePlugin } public void start(int unused) - { + { ds.SetViewpoint(ref xyz, ref hpr); } #endif -- cgit v1.1