From 9c668558d43f4eeac10c1753825ad643fe4b8721 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 11 Jan 2010 15:00:16 +0000 Subject: minor: formatting --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index d8b9159..2c8b0ea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1983,6 +1983,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return (int)pws; } + public void osSetSpeed(string UUID, float SpeedModifier) { CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); @@ -1990,6 +1991,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); avatar.SpeedModifier = SpeedModifier; } + public void osKickAvatar(string FirstName,string SurName,string alert) { CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); @@ -2010,6 +2012,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } + public void osCauseDamage(string avatar, double damage) { CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); @@ -2037,6 +2040,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } + public void osCauseHealing(string avatar, double healing) { CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); @@ -2061,4 +2065,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } -} +} \ No newline at end of file -- cgit v1.1 From d86c0d406a3fcabae2fe2c70f76507796152eb74 Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Mon, 11 Jan 2010 17:15:49 +0100 Subject: more specific config error logging --- OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs index 3c5e8c9..b3fa07f 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs @@ -220,8 +220,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat // Fail if fundamental information is still missing - if (cs.Server == null || cs.IrcChannel == null || cs.BaseNickname == null || cs.User == null) - throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}", cs.idn, rs.Region)); + if (cs.Server == null) + throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: server missing", cs.idn, rs.Region)); + else if (cs.IrcChannel == null) + throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: channel missing", cs.idn, rs.Region)); + else if (cs.BaseNickname == null) + throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: nick missing", cs.idn, rs.Region)); + else if (cs.User == null) + throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: user missing", cs.idn, rs.Region)); m_log.InfoFormat("[IRC-Channel-{0}] Configuration for Region {1} is valid", cs.idn, rs.Region); m_log.InfoFormat("[IRC-Channel-{0}] Server = {1}", cs.idn, cs.Server); -- cgit v1.1 From b88bee9d48c2f953867737520f9ed731dc84cc2a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 11 Jan 2010 17:17:58 +0000 Subject: add interface/method documentatio nto IScriptModuleComms --- .../Framework/Interfaces/IScriptModuleComms.cs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs index 5cdf191..d7fa316 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs @@ -32,13 +32,29 @@ namespace OpenSim.Region.Framework.Interfaces { public delegate void ScriptCommand(UUID script, string id, string module, string command, string k); + /// + /// Interface for communication between OpenSim modules and in-world scripts + /// + /// + /// See OpenSim.Region.ScriptEngine.Shared.Api.MOD_Api.modSendCommand() for information on receiving messages + /// from scripts in OpenSim modules. public interface IScriptModuleComms { + /// + /// Modules can subscribe to this event to receive command invocations from in-world scripts + /// event ScriptCommand OnScriptCommand; - void DispatchReply(UUID script, int code, string text, string k); + /// + /// Send a link_message event to an in-world script + /// + /// + /// + /// + /// + void DispatchReply(UUID scriptId, int code, string text, string key); // For use ONLY by the script API - void RaiseEvent(UUID script, string id, string module, string command, string k); + void RaiseEvent(UUID script, string id, string module, string command, string key); } } -- cgit v1.1 From a4a0512011d53a0d8ed64151fd8500481768e2c7 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Mon, 11 Jan 2010 17:28:27 -0800 Subject: Bug in llGetNumberOfPrims always returns to script when no clients are connected to the simulator. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 39b597e..b9defbe 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7286,23 +7286,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetNumberOfPrims() { m_host.AddScriptLPS(1); - ScenePresence[] presences = World.GetScenePresences(); - if (presences.Length == 0) - return 0; - int avatarCount = 0; - for (int i = 0; i < presences.Length; i++) + World.ForEachScenePresence(delegate(ScenePresence presence) { - ScenePresence presence = presences[i]; - - if (!presence.IsChildAgent && presence.ParentID != 0) - { - if (m_host.ParentGroup.HasChildPrim(presence.ParentID)) - { + if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) avatarCount++; - } - } - } + }); return m_host.ParentGroup.PrimCount + avatarCount; } -- cgit v1.1 From e3a04fcb7b6510b46bc4e24b9a1bc6e321774ac3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 13 Jan 2010 03:08:34 +0000 Subject: Change the error messages on region region registration. This changes URM and region. The non-error case should be compatible, so no version bump. Untested. --- .../CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | 8 ++++---- .../ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | 2 +- .../ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | 8 +++++--- OpenSim/Region/Framework/Scenes/Scene.cs | 6 +++--- 4 files changed, 13 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs index f9cd90f..131febd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs @@ -200,7 +200,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid #region IGridService - public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) + public string RegisterRegion(UUID scopeID, GridRegion regionInfo) { // Region doesn't exist here. Trying to link remote region if (regionInfo.RegionID.Equals(UUID.Zero)) @@ -215,12 +215,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid // Try get the map image m_HypergridServiceConnector.GetMapImage(regionInfo); - return true; + return String.Empty; } else { m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")"); - return false; + return "No such region"; } // Note that these remote regions aren't registered in localBackend, so return null, no local listeners } @@ -469,7 +469,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid } // Finally, link it - if (!RegisterRegion(UUID.Zero, regInfo)) + if (RegisterRegion(UUID.Zero, regInfo) != String.Empty) { m_log.Warn("[HGrid]: Unable to link region"); return false; diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 1c72488..144b5a4 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs @@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid #region IGridService - public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) + public string RegisterRegion(UUID scopeID, GridRegion regionInfo) { return m_GridService.RegisterRegion(scopeID, regionInfo); } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 72c00fc..391e7c8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs @@ -135,12 +135,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid #region IGridService - public override bool RegisterRegion(UUID scopeID, GridRegion regionInfo) + public override string RegisterRegion(UUID scopeID, GridRegion regionInfo) { - if (m_LocalGridService.RegisterRegion(scopeID, regionInfo)) + string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo); + + if (msg == String.Empty) return base.RegisterRegion(scopeID, regionInfo); - return false; + return msg; } public override bool DeregisterRegion(UUID regionID) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index bc9301b..234554e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1562,9 +1562,9 @@ namespace OpenSim.Region.Framework.Scenes //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); GridRegion region = new GridRegion(RegionInfo); - bool success = GridService.RegisterRegion(RegionInfo.ScopeID, region); - if (!success) - throw new Exception("Can't register with grid"); + string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); + if (error != String.Empty) + throw new Exception(error); m_sceneGridService.SetScene(this); m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface(), RegionInfo); -- cgit v1.1