From b2b6799f1cc4637f4253386e61fdce9297a20ba6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 10 Jun 2010 18:26:04 -0700 Subject: [PATCH 1/6] Added more debug messages to try to pinpoint where login is failing for nebadon. --- OpenSim/Region/Framework/Scenes/Scene.cs | 59 ++++++++++++++++++------ 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9a3b0c9752..9594e6bfbf 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3457,11 +3457,27 @@ namespace OpenSim.Region.Framework.Scenes agent.AgentID, agent.circuitcode, teleportFlags); reason = String.Empty; - if (!VerifyUserPresence(agent, out reason)) + try + { + if (!VerifyUserPresence(agent, out reason)) + return false; + } + catch (Exception e) + { + m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message); return false; + } - if (!AuthorizeUser(agent, out reason)) + try + { + if (!AuthorizeUser(agent, out reason)) + return false; + } + catch (Exception e) + { + m_log.DebugFormat("[CONNECTION BEGIN]: Exception authorizing user {0}", e.Message); return false; + } m_log.InfoFormat( "[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", @@ -3665,14 +3681,19 @@ namespace OpenSim.Region.Framework.Scenes } } - if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) + if (m_regInfo.EstateSettings != null) { - m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", - agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); - reason = String.Format("Denied access to region {0}: You have been banned from that region.", - RegionInfo.RegionName); - return false; + if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) + { + m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", + agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); + reason = String.Format("Denied access to region {0}: You have been banned from that region.", + RegionInfo.RegionName); + return false; + } } + else + m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); IGroupsModule groupsModule = RequestModuleInterface(); @@ -3684,21 +3705,31 @@ namespace OpenSim.Region.Framework.Scenes GroupMembershipData[] GroupMembership = groupsModule.GetMembershipData(agent.AgentID); - for (int i = 0; i < GroupMembership.Length; i++) - agentGroups.Add(GroupMembership[i].GroupID); + if (GroupMembership != null) + { + for (int i = 0; i < GroupMembership.Length; i++) + agentGroups.Add(GroupMembership[i].GroupID); + } + else + m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!"); } bool groupAccess = false; UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; - foreach (UUID group in estateGroups) + if (estateGroups != null) { - if (agentGroups.Contains(group)) + foreach (UUID group in estateGroups) { - groupAccess = true; - break; + if (agentGroups.Contains(group)) + { + groupAccess = true; + break; + } } } + else + m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); if (!m_regInfo.EstateSettings.PublicAccess && !m_regInfo.EstateSettings.HasAccess(agent.AgentID) && From 2e1269e4cac8542dbf74854ec4d3196f4e0cd372 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 10 Jun 2010 21:59:12 -0700 Subject: [PATCH 2/6] Bug fix on friends notifications. OnClientClose and OnLogout ordering are unpredictable; when OnClientClosed happened first, it was removing the friends list, which would prevent OnLogout notifications to go out. --- .../Avatar/Friends/FriendsModule.cs | 41 +++++++++++++++---- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 3590f27fe7..4f0487bd71 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -245,11 +245,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends private void OnClientClosed(UUID agentID, Scene scene) { + ScenePresence sp = scene.GetScenePresence(agentID); lock (m_Friends) if (m_Friends.ContainsKey(agentID)) { if (m_Friends[agentID].Refcount == 1) - m_Friends.Remove(agentID); + { + if (sp != null && sp.IsChildAgent) + // we do this only for child agents + // Root agents' closing = logout; that's + // processed with OnLogout + { + m_Friends.Remove(agentID); + } + } else m_Friends[agentID].Refcount--; } @@ -267,11 +276,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (m_Friends.ContainsKey(agentID)) { - if (m_Friends[agentID].RegionID == UUID.Zero) - { - m_Friends[agentID].Friends = + // This is probably an overkill, but just + // to make sure we have the latest and greatest + // friends list -- always pull OnMakeRoot + m_Friends[agentID].Friends = m_FriendsService.GetFriends(agentID); - } + m_Friends[agentID].RegionID = sp.ControllingClient.Scene.RegionInfo.RegionID; } @@ -437,8 +447,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends /// private void StatusChange(UUID agentID, bool online) { + //m_log.DebugFormat("[FRIENDS]: StatusChange {0}", online); if (m_Friends.ContainsKey(agentID)) { + //m_log.DebugFormat("[FRIENDS]: # of friends: {0}", m_Friends[agentID].Friends.Length); List friendList = new List(); foreach (FriendInfo fi in m_Friends[agentID].Friends) { @@ -447,10 +459,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends } foreach (FriendInfo fi in friendList) { + //m_log.DebugFormat("[FRIENDS]: Notifying {0}", fi.PrincipalID); // Notify about this user status StatusNotify(fi, agentID, online); } } + else + m_log.WarnFormat("[FRIENDS]: {0} not found in cache", agentID); } private void StatusNotify(FriendInfo friend, UUID userID, bool online) @@ -462,21 +477,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // Try local if (LocalStatusNotification(userID, friendID, online)) return; - + // The friend is not here [as root]. Let's forward. PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); if (friendSessions != null && friendSessions.Length > 0) { - PresenceInfo friendSession = friendSessions[0]; + PresenceInfo friendSession = null; + foreach (PresenceInfo pinfo in friendSessions) + if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad + { + friendSession = pinfo; + break; + } + if (friendSession != null) { GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); + //m_log.DebugFormat("[FRIENDS]: Remote Notify to region {0}", region.RegionName); m_FriendsSimConnector.StatusNotify(region, userID, friendID, online); } } // Friend is not online. Ignore. } + else + m_log.WarnFormat("[FRIENDS]: Error parsing friend ID {0}", friend.Friend); } private void OnInstantMessage(IClientAPI client, GridInstantMessage im) @@ -763,7 +788,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends IClientAPI friendClient = LocateClientObject(friendID); if (friendClient != null) { - //m_log.DebugFormat("[FRIENDS]: Notify {0} that user {1} is {2}", friend.Friend, userID, online); + //m_log.DebugFormat("[FRIENDS]: Local Status Notify {0} that user {1} is {2}", friendID, userID, online); // the friend in this sim as root agent if (online) friendClient.SendAgentOnline(new UUID[] { userID }); From 7f349d61cb8251a1c13811f5ff7bd95b2311706c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 11 Jun 2010 06:32:24 -0700 Subject: [PATCH 3/6] Better friends notification: get rid of OnLogout and use OnClientClose for sending notifications. This takes care of crashed sessions. Also, made the notifications themselves asynchronous. --- .../Avatar/Friends/FriendsModule.cs | 37 +++++++------------ 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 4f0487bd71..80982fd577 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -220,8 +220,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends client.OnGrantUserRights += OnGrantUserRights; - client.OnLogout += OnLogout; - lock (m_Friends) { if (m_Friends.ContainsKey(client.AgentId)) @@ -240,36 +238,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends m_Friends.Add(client.AgentId, newFriends); } - //StatusChange(client.AgentId, true); } private void OnClientClosed(UUID agentID, Scene scene) { ScenePresence sp = scene.GetScenePresence(agentID); + if (sp != null && !sp.IsChildAgent) + // do this for root agents closing out + StatusChange(agentID, false); + lock (m_Friends) if (m_Friends.ContainsKey(agentID)) { if (m_Friends[agentID].Refcount == 1) - { - if (sp != null && sp.IsChildAgent) - // we do this only for child agents - // Root agents' closing = logout; that's - // processed with OnLogout - { - m_Friends.Remove(agentID); - } - } + m_Friends.Remove(agentID); else m_Friends[agentID].Refcount--; } } - private void OnLogout(IClientAPI client) - { - StatusChange(client.AgentId, false); - m_Friends.Remove(client.AgentId); - } - private void OnMakeRootAgent(ScenePresence sp) { UUID agentID = sp.ControllingClient.AgentId; @@ -457,12 +444,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (((fi.MyFlags & 1) != 0) && (fi.TheirFlags != -1)) friendList.Add(fi); } - foreach (FriendInfo fi in friendList) + + Util.FireAndForget(delegate { - //m_log.DebugFormat("[FRIENDS]: Notifying {0}", fi.PrincipalID); - // Notify about this user status - StatusNotify(fi, agentID, online); - } + foreach (FriendInfo fi in friendList) + { + //m_log.DebugFormat("[FRIENDS]: Notifying {0}", fi.PrincipalID); + // Notify about this user status + StatusNotify(fi, agentID, online); + } + }); } else m_log.WarnFormat("[FRIENDS]: {0} not found in cache", agentID); From b64f42fa4142a71dffa2639769b9bf2d4584ec30 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 11 Jun 2010 17:04:54 +0200 Subject: [PATCH 4/6] Clone cmGetAvatarList into osGetAvatarList for more generic use. --- .../Shared/Api/Implementation/OSSL_Api.cs | 27 +++++++++++++++++++ .../Shared/Api/Interface/IOSSL_Api.cs | 1 + .../Shared/Api/Runtime/OSSL_Stub.cs | 5 ++++ 3 files changed, 33 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index dde664e49e..cd6d3a3fca 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2202,5 +2202,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_LSL_Api.SetPrimitiveParamsEx(prim, rules); } + + /// + /// Like osGetAgents but returns enough info for a radar + /// + /// Strided list of the UUID, position and name of each avatar in the region + public LSL_List osGetAvatarList() + { + CheckThreatLevel(ThreatLevel.None, "osGetAvatarList"); + + LSL_List result = new LSL_List(); + World.ForEachScenePresence(delegate (ScenePresence avatar) + { + if (avatar != null && avatar.UUID != m_host.OwnerID) + { + if (avatar.IsChildAgent == false) + { + if (avatar.PhysicsActor != null && avatar.PhysicsActor.Position != null) + { + result.Add(avatar.UUID); + result.Add(avatar.PhysicsActor.Position); + result.Add(avatar.Name); + } + } + } + }); + return result; + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 9785b24016..78ee43cc08 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -176,6 +176,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osCauseDamage(string avatar, double damage); LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules); void osSetPrimitiveParams(LSL_Key prim, LSL_List rules); + LSL_List osGetAvatarList(); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 7af5d432c8..6cc5f518ae 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -687,5 +687,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { m_OSSL_Functions.osSetPrimitiveParams(prim, rules); } + + public LSL_List osGetAvatarList() + { + return m_OSSL_Functions.osGetAvatarList(); + } } } From ad87bab27192a54249eecde0260ccda565d87e5c Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 11 Jun 2010 17:23:06 +0200 Subject: [PATCH 5/6] Rename cm* function set to ls* (for LightShare) --- .../Shared/Api/Implementation/CM_Api.cs | 18 ++++++++-------- .../Shared/Api/Interface/ICM_Api.cs | 6 +++--- .../Shared/Api/Runtime/CM_Stub.cs | 21 ++++++++++++++++--- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs index 880ca1bb7d..9a99f5ee33 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_localID = localID; m_itemID = itemID; - if (m_ScriptEngine.Config.GetBoolean("AllowCareminsterFunctions", false)) + if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) m_CMFunctionsEnabled = true; m_comms = m_ScriptEngine.World.RequestModuleInterface(); @@ -116,11 +116,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// Get the current Windlight scene /// /// List of windlight parameters - public LSL_List cmGetWindlightScene(LSL_List rules) + public LSL_List lsGetWindlightScene(LSL_List rules) { if (!m_CMFunctionsEnabled) { - CMShoutError("Careminster functions are not enabled."); + CMShoutError("LightShare functions are not enabled."); return new LSL_List(); } m_host.AddScriptLPS(1); @@ -440,16 +440,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// success: true or false - public int cmSetWindlightScene(LSL_List rules) + public int lsSetWindlightScene(LSL_List rules) { if (!m_CMFunctionsEnabled) { - CMShoutError("Careminster functions are not enabled."); + CMShoutError("LightShare functions are not enabled."); return 0; } if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) { - CMShoutError("cmSetWindlightScene can only be used by estate managers or owners."); + CMShoutError("lsSetWindlightScene can only be used by estate managers or owners."); return 0; } int success = 0; @@ -472,16 +472,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// success: true or false - public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target) + public int lsSetWindlightSceneTargeted(LSL_List rules, LSL_Key target) { if (!m_CMFunctionsEnabled) { - CMShoutError("Careminster functions are not enabled."); + CMShoutError("LightShare functions are not enabled."); return 0; } if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) { - CMShoutError("cmSetWindlightSceneTargeted can only be used by estate managers or owners."); + CMShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); return 0; } int success = 0; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs index f13b6e50e3..f47ae7d485 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs @@ -41,8 +41,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces public interface ICM_Api { // Windlight Functions - LSL_List cmGetWindlightScene(LSL_List rules); - int cmSetWindlightScene(LSL_List rules); - int cmSetWindlightSceneTargeted(LSL_List rules, key target); + LSL_List lsGetWindlightScene(LSL_List rules); + int lsSetWindlightScene(LSL_List rules); + int lsSetWindlightSceneTargeted(LSL_List rules, key target); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs index c0edaae6bc..92c3d982d2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs @@ -58,19 +58,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_CM_Functions = (ICM_Api)api; } + public LSL_List lsGetWindlightScene(LSL_List rules) + { + return m_CM_Functions.lsGetWindlightScene(rules); + } + + public int lsSetWindlightScene(LSL_List rules) + { + return m_CM_Functions.lsSetWindlightScene(rules); + } + + public int lsSetWindlightSceneTargeted(LSL_List rules, key target) + { + return m_CM_Functions.lsSetWindlightSceneTargeted(rules, target); + } + public LSL_List cmGetWindlightScene(LSL_List rules) { - return m_CM_Functions.cmGetWindlightScene(rules); + return m_CM_Functions.lsGetWindlightScene(rules); } public int cmSetWindlightScene(LSL_List rules) { - return m_CM_Functions.cmSetWindlightScene(rules); + return m_CM_Functions.lsSetWindlightScene(rules); } public int cmSetWindlightSceneTargeted(LSL_List rules, key target) { - return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target); + return m_CM_Functions.lsSetWindlightSceneTargeted(rules, target); } } } From 7c4cf46bacadae56e7cfcc07d243b1c5f5cb98ce Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 11 Jun 2010 17:42:16 +0200 Subject: [PATCH 6/6] Rename CM files to LS --- .../Implementation/{CM_Api.cs => LS_Api.cs} | 30 +++++++++---------- .../Api/Interface/{ICM_Api.cs => ILS_Api.cs} | 2 +- .../Api/Runtime/{CM_Stub.cs => LS_Stub.cs} | 20 ++++++------- 3 files changed, 26 insertions(+), 26 deletions(-) rename OpenSim/Region/ScriptEngine/Shared/Api/Implementation/{CM_Api.cs => LS_Api.cs} (96%) rename OpenSim/Region/ScriptEngine/Shared/Api/Interface/{ICM_Api.cs => ILS_Api.cs} (98%) rename OpenSim/Region/ScriptEngine/Shared/Api/Runtime/{CM_Stub.cs => LS_Stub.cs} (85%) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs similarity index 96% rename from OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs rename to OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 9a99f5ee33..fe71ed54cd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -54,13 +54,13 @@ using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; namespace OpenSim.Region.ScriptEngine.Shared.Api { [Serializable] - public class CM_Api : MarshalByRefObject, ICM_Api, IScriptApi + public class LS_Api : MarshalByRefObject, ILS_Api, IScriptApi { internal IScriptEngine m_ScriptEngine; internal SceneObjectPart m_host; internal uint m_localID; internal UUID m_itemID; - internal bool m_CMFunctionsEnabled = false; + internal bool m_LSFunctionsEnabled = false; internal IScriptModuleComms m_comms = null; public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) @@ -71,11 +71,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_itemID = itemID; if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) - m_CMFunctionsEnabled = true; + m_LSFunctionsEnabled = true; m_comms = m_ScriptEngine.World.RequestModuleInterface(); if (m_comms == null) - m_CMFunctionsEnabled = false; + m_LSFunctionsEnabled = false; } public override Object InitializeLifetimeService() @@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //Dumps an error message on the debug console. // - internal void CMShoutError(string message) + internal void LSShoutError(string message) { if (message.Length > 1023) message = message.Substring(0, 1023); @@ -118,9 +118,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// List of windlight parameters public LSL_List lsGetWindlightScene(LSL_List rules) { - if (!m_CMFunctionsEnabled) + if (!m_LSFunctionsEnabled) { - CMShoutError("LightShare functions are not enabled."); + LSShoutError("LightShare functions are not enabled."); return new LSL_List(); } m_host.AddScriptLPS(1); @@ -442,14 +442,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// success: true or false public int lsSetWindlightScene(LSL_List rules) { - if (!m_CMFunctionsEnabled) + if (!m_LSFunctionsEnabled) { - CMShoutError("LightShare functions are not enabled."); + LSShoutError("LightShare functions are not enabled."); return 0; } if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) { - CMShoutError("lsSetWindlightScene can only be used by estate managers or owners."); + LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); return 0; } int success = 0; @@ -462,7 +462,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - CMShoutError("Windlight module is disabled"); + LSShoutError("Windlight module is disabled"); return 0; } return success; @@ -474,14 +474,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// success: true or false public int lsSetWindlightSceneTargeted(LSL_List rules, LSL_Key target) { - if (!m_CMFunctionsEnabled) + if (!m_LSFunctionsEnabled) { - CMShoutError("LightShare functions are not enabled."); + LSShoutError("LightShare functions are not enabled."); return 0; } if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) { - CMShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); + LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); return 0; } int success = 0; @@ -494,7 +494,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - CMShoutError("Windlight module is disabled"); + LSShoutError("Windlight module is disabled"); return 0; } return success; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs similarity index 98% rename from OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs rename to OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs index f47ae7d485..9aa437b37e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs @@ -38,7 +38,7 @@ using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces { - public interface ICM_Api + public interface ILS_Api { // Windlight Functions LSL_List lsGetWindlightScene(LSL_List rules); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs similarity index 85% rename from OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs rename to OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs index 92c3d982d2..8280ca5b5c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs @@ -48,44 +48,44 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { public partial class ScriptBaseClass : MarshalByRefObject { - public ICM_Api m_CM_Functions; + public ILS_Api m_LS_Functions; - public void ApiTypeCM(IScriptApi api) + public void ApiTypeLS(IScriptApi api) { - if (!(api is ICM_Api)) + if (!(api is ILS_Api)) return; - m_CM_Functions = (ICM_Api)api; + m_LS_Functions = (ILS_Api)api; } public LSL_List lsGetWindlightScene(LSL_List rules) { - return m_CM_Functions.lsGetWindlightScene(rules); + return m_LS_Functions.lsGetWindlightScene(rules); } public int lsSetWindlightScene(LSL_List rules) { - return m_CM_Functions.lsSetWindlightScene(rules); + return m_LS_Functions.lsSetWindlightScene(rules); } public int lsSetWindlightSceneTargeted(LSL_List rules, key target) { - return m_CM_Functions.lsSetWindlightSceneTargeted(rules, target); + return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); } public LSL_List cmGetWindlightScene(LSL_List rules) { - return m_CM_Functions.lsGetWindlightScene(rules); + return m_LS_Functions.lsGetWindlightScene(rules); } public int cmSetWindlightScene(LSL_List rules) { - return m_CM_Functions.lsSetWindlightScene(rules); + return m_LS_Functions.lsSetWindlightScene(rules); } public int cmSetWindlightSceneTargeted(LSL_List rules, key target) { - return m_CM_Functions.lsSetWindlightSceneTargeted(rules, target); + return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); } } }