diff options
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 84 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 59 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs (renamed from OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs) | 38 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs (renamed from OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs) | 8 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs (renamed from OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs) | 29 |
5 files changed, 122 insertions, 96 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 2979e29..4c01985 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -221,8 +221,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
221 | 221 | ||
222 | client.OnGrantUserRights += OnGrantUserRights; | 222 | client.OnGrantUserRights += OnGrantUserRights; |
223 | 223 | ||
224 | client.OnLogout += OnLogout; | ||
225 | |||
226 | lock (m_Friends) | 224 | lock (m_Friends) |
227 | { | 225 | { |
228 | if (m_Friends.ContainsKey(client.AgentId)) | 226 | if (m_Friends.ContainsKey(client.AgentId)) |
@@ -241,11 +239,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
241 | m_Friends.Add(client.AgentId, newFriends); | 239 | m_Friends.Add(client.AgentId, newFriends); |
242 | } | 240 | } |
243 | 241 | ||
244 | //StatusChange(client.AgentId, true); | ||
245 | } | 242 | } |
246 | 243 | ||
247 | private void OnClientClosed(UUID agentID, Scene scene) | 244 | private void OnClientClosed(UUID agentID, Scene scene) |
248 | { | 245 | { |
246 | ScenePresence sp = scene.GetScenePresence(agentID); | ||
247 | if (sp != null && !sp.IsChildAgent) | ||
248 | // do this for root agents closing out | ||
249 | StatusChange(agentID, false); | ||
250 | |||
249 | lock (m_Friends) | 251 | lock (m_Friends) |
250 | if (m_Friends.ContainsKey(agentID)) | 252 | if (m_Friends.ContainsKey(agentID)) |
251 | { | 253 | { |
@@ -256,23 +258,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
256 | } | 258 | } |
257 | } | 259 | } |
258 | 260 | ||
259 | private void OnLogout(IClientAPI client) | ||
260 | { | ||
261 | StatusChange(client.AgentId, false); | ||
262 | m_Friends.Remove(client.AgentId); | ||
263 | } | ||
264 | |||
265 | private void OnMakeRootAgent(ScenePresence sp) | 261 | private void OnMakeRootAgent(ScenePresence sp) |
266 | { | 262 | { |
267 | UUID agentID = sp.ControllingClient.AgentId; | 263 | UUID agentID = sp.ControllingClient.AgentId; |
268 | 264 | ||
269 | if (m_Friends.ContainsKey(agentID)) | 265 | if (m_Friends.ContainsKey(agentID)) |
270 | { | 266 | { |
271 | if (m_Friends[agentID].RegionID == UUID.Zero) | 267 | // This is probably an overkill, but just |
272 | { | 268 | // to make sure we have the latest and greatest |
273 | m_Friends[agentID].Friends = | 269 | // friends list -- always pull OnMakeRoot |
270 | m_Friends[agentID].Friends = | ||
274 | m_FriendsService.GetFriends(agentID); | 271 | m_FriendsService.GetFriends(agentID); |
275 | } | 272 | |
276 | m_Friends[agentID].RegionID = | 273 | m_Friends[agentID].RegionID = |
277 | sp.ControllingClient.Scene.RegionInfo.RegionID; | 274 | sp.ControllingClient.Scene.RegionInfo.RegionID; |
278 | } | 275 | } |
@@ -438,56 +435,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
438 | /// <param name="online"></param> | 435 | /// <param name="online"></param> |
439 | private void StatusChange(UUID agentID, bool online) | 436 | private void StatusChange(UUID agentID, bool online) |
440 | { | 437 | { |
438 | //m_log.DebugFormat("[FRIENDS]: StatusChange {0}", online); | ||
441 | if (m_Friends.ContainsKey(agentID)) | 439 | if (m_Friends.ContainsKey(agentID)) |
442 | { | 440 | { |
441 | //m_log.DebugFormat("[FRIENDS]: # of friends: {0}", m_Friends[agentID].Friends.Length); | ||
443 | List<FriendInfo> friendList = new List<FriendInfo>(); | 442 | List<FriendInfo> friendList = new List<FriendInfo>(); |
444 | foreach (FriendInfo fi in m_Friends[agentID].Friends) | 443 | foreach (FriendInfo fi in m_Friends[agentID].Friends) |
445 | { | 444 | { |
446 | if (((fi.MyFlags & 1) != 0) && (fi.TheirFlags != -1)) | 445 | if (((fi.MyFlags & 1) != 0) && (fi.TheirFlags != -1)) |
447 | friendList.Add(fi); | 446 | friendList.Add(fi); |
448 | } | 447 | } |
449 | /* | ||
450 | foreach (FriendInfo fi in friendList) | ||
451 | { | ||
452 | // Notify about this user status | ||
453 | StatusNotify(fi, agentID, online); | ||
454 | } | ||
455 | */ | ||
456 | 448 | ||
457 | StatusNotifyMass(friendList, agentID, online); | 449 | Util.FireAndForget(delegate |
458 | } | ||
459 | } | ||
460 | |||
461 | private void StatusNotifyMass(List<FriendInfo> friendList, UUID userID, bool online) | ||
462 | { | ||
463 | int fct = friendList.Count; | ||
464 | string[] friendIDs = new string[fct]; | ||
465 | int notlocal = 0; | ||
466 | for (int x = 0 ; x < fct ; x++) | ||
467 | { | ||
468 | UUID friendID = UUID.Zero; | ||
469 | if (UUID.TryParse(friendList[x].Friend, out friendID)) | ||
470 | { | 450 | { |
471 | if (!LocalStatusNotification(userID, friendID, online)) | 451 | foreach (FriendInfo fi in friendList) |
472 | { | 452 | { |
473 | friendIDs[notlocal++] = friendID.ToString(); | 453 | //m_log.DebugFormat("[FRIENDS]: Notifying {0}", fi.PrincipalID); |
454 | // Notify about this user status | ||
455 | StatusNotify(fi, agentID, online); | ||
474 | } | 456 | } |
475 | } | 457 | }); |
476 | } | ||
477 | |||
478 | PresenceInfo[] friendSessions = PresenceService.GetAgents(friendIDs); | ||
479 | |||
480 | for (int x = 0; x < friendSessions.GetLength(0); x++) | ||
481 | { | ||
482 | if (friendIDs.Length <= x) | ||
483 | continue; | ||
484 | PresenceInfo friendSession = friendSessions[x]; | ||
485 | if (friendSession != null) | ||
486 | { | ||
487 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | ||
488 | m_FriendsSimConnector.StatusNotify(region, userID, new UUID(friendIDs[x]), online); | ||
489 | } | ||
490 | } | 458 | } |
459 | else | ||
460 | m_log.WarnFormat("[FRIENDS]: {0} not found in cache", agentID); | ||
491 | } | 461 | } |
492 | 462 | ||
493 | private void StatusNotify(FriendInfo friend, UUID userID, bool online) | 463 | private void StatusNotify(FriendInfo friend, UUID userID, bool online) |
@@ -504,16 +474,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
504 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); | 474 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); |
505 | if (friendSessions != null && friendSessions.Length > 0) | 475 | if (friendSessions != null && friendSessions.Length > 0) |
506 | { | 476 | { |
507 | PresenceInfo friendSession = friendSessions[0]; | 477 | PresenceInfo friendSession = null; |
478 | foreach (PresenceInfo pinfo in friendSessions) | ||
479 | if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad | ||
480 | { | ||
481 | friendSession = pinfo; | ||
482 | break; | ||
483 | } | ||
484 | |||
508 | if (friendSession != null) | 485 | if (friendSession != null) |
509 | { | 486 | { |
510 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 487 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); |
488 | //m_log.DebugFormat("[FRIENDS]: Remote Notify to region {0}", region.RegionName); | ||
511 | m_FriendsSimConnector.StatusNotify(region, userID, friendID, online); | 489 | m_FriendsSimConnector.StatusNotify(region, userID, friendID, online); |
512 | } | 490 | } |
513 | } | 491 | } |
514 | 492 | ||
515 | // Friend is not online. Ignore. | 493 | // Friend is not online. Ignore. |
516 | } | 494 | } |
495 | else | ||
496 | m_log.WarnFormat("[FRIENDS]: Error parsing friend ID {0}", friend.Friend); | ||
517 | } | 497 | } |
518 | 498 | ||
519 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) | 499 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) |
@@ -800,7 +780,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
800 | IClientAPI friendClient = LocateClientObject(friendID); | 780 | IClientAPI friendClient = LocateClientObject(friendID); |
801 | if (friendClient != null) | 781 | if (friendClient != null) |
802 | { | 782 | { |
803 | //m_log.DebugFormat("[FRIENDS]: Notify {0} that user {1} is {2}", friend.Friend, userID, online); | 783 | //m_log.DebugFormat("[FRIENDS]: Local Status Notify {0} that user {1} is {2}", friendID, userID, online); |
804 | // the friend in this sim as root agent | 784 | // the friend in this sim as root agent |
805 | if (online) | 785 | if (online) |
806 | friendClient.SendAgentOnline(new UUID[] { userID }); | 786 | friendClient.SendAgentOnline(new UUID[] { userID }); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e80dff7..7bea166 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3485,11 +3485,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
3485 | agent.AgentID, agent.circuitcode, teleportFlags); | 3485 | agent.AgentID, agent.circuitcode, teleportFlags); |
3486 | 3486 | ||
3487 | reason = String.Empty; | 3487 | reason = String.Empty; |
3488 | if (!VerifyUserPresence(agent, out reason)) | 3488 | try |
3489 | { | ||
3490 | if (!VerifyUserPresence(agent, out reason)) | ||
3491 | return false; | ||
3492 | } | ||
3493 | catch (Exception e) | ||
3494 | { | ||
3495 | m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message); | ||
3489 | return false; | 3496 | return false; |
3497 | } | ||
3490 | 3498 | ||
3491 | if (!AuthorizeUser(agent, out reason)) | 3499 | try |
3500 | { | ||
3501 | if (!AuthorizeUser(agent, out reason)) | ||
3502 | return false; | ||
3503 | } | ||
3504 | catch (Exception e) | ||
3505 | { | ||
3506 | m_log.DebugFormat("[CONNECTION BEGIN]: Exception authorizing user {0}", e.Message); | ||
3492 | return false; | 3507 | return false; |
3508 | } | ||
3493 | 3509 | ||
3494 | m_log.InfoFormat( | 3510 | m_log.InfoFormat( |
3495 | "[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", | 3511 | "[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", |
@@ -3699,14 +3715,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
3699 | } | 3715 | } |
3700 | } | 3716 | } |
3701 | 3717 | ||
3702 | if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) | 3718 | if (m_regInfo.EstateSettings != null) |
3703 | { | 3719 | { |
3704 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", | 3720 | if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) |
3705 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); | 3721 | { |
3706 | reason = String.Format("Denied access to region {0}: You have been banned from that region.", | 3722 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", |
3707 | RegionInfo.RegionName); | 3723 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); |
3708 | return false; | 3724 | reason = String.Format("Denied access to region {0}: You have been banned from that region.", |
3725 | RegionInfo.RegionName); | ||
3726 | return false; | ||
3727 | } | ||
3709 | } | 3728 | } |
3729 | else | ||
3730 | m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); | ||
3710 | 3731 | ||
3711 | IGroupsModule groupsModule = | 3732 | IGroupsModule groupsModule = |
3712 | RequestModuleInterface<IGroupsModule>(); | 3733 | RequestModuleInterface<IGroupsModule>(); |
@@ -3718,21 +3739,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
3718 | GroupMembershipData[] GroupMembership = | 3739 | GroupMembershipData[] GroupMembership = |
3719 | groupsModule.GetMembershipData(agent.AgentID); | 3740 | groupsModule.GetMembershipData(agent.AgentID); |
3720 | 3741 | ||
3721 | for (int i = 0; i < GroupMembership.Length; i++) | 3742 | if (GroupMembership != null) |
3722 | agentGroups.Add(GroupMembership[i].GroupID); | 3743 | { |
3744 | for (int i = 0; i < GroupMembership.Length; i++) | ||
3745 | agentGroups.Add(GroupMembership[i].GroupID); | ||
3746 | } | ||
3747 | else | ||
3748 | m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!"); | ||
3723 | } | 3749 | } |
3724 | 3750 | ||
3725 | bool groupAccess = false; | 3751 | bool groupAccess = false; |
3726 | UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; | 3752 | UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; |
3727 | 3753 | ||
3728 | foreach (UUID group in estateGroups) | 3754 | if (estateGroups != null) |
3729 | { | 3755 | { |
3730 | if (agentGroups.Contains(group)) | 3756 | foreach (UUID group in estateGroups) |
3731 | { | 3757 | { |
3732 | groupAccess = true; | 3758 | if (agentGroups.Contains(group)) |
3733 | break; | 3759 | { |
3760 | groupAccess = true; | ||
3761 | break; | ||
3762 | } | ||
3734 | } | 3763 | } |
3735 | } | 3764 | } |
3765 | else | ||
3766 | m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); | ||
3736 | 3767 | ||
3737 | if (!m_regInfo.EstateSettings.PublicAccess && | 3768 | if (!m_regInfo.EstateSettings.PublicAccess && |
3738 | !m_regInfo.EstateSettings.HasAccess(agent.AgentID) && | 3769 | !m_regInfo.EstateSettings.HasAccess(agent.AgentID) && |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 880ca1b..fe71ed5 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; | |||
54 | namespace OpenSim.Region.ScriptEngine.Shared.Api | 54 | namespace OpenSim.Region.ScriptEngine.Shared.Api |
55 | { | 55 | { |
56 | [Serializable] | 56 | [Serializable] |
57 | public class CM_Api : MarshalByRefObject, ICM_Api, IScriptApi | 57 | public class LS_Api : MarshalByRefObject, ILS_Api, IScriptApi |
58 | { | 58 | { |
59 | internal IScriptEngine m_ScriptEngine; | 59 | internal IScriptEngine m_ScriptEngine; |
60 | internal SceneObjectPart m_host; | 60 | internal SceneObjectPart m_host; |
61 | internal uint m_localID; | 61 | internal uint m_localID; |
62 | internal UUID m_itemID; | 62 | internal UUID m_itemID; |
63 | internal bool m_CMFunctionsEnabled = false; | 63 | internal bool m_LSFunctionsEnabled = false; |
64 | internal IScriptModuleComms m_comms = null; | 64 | internal IScriptModuleComms m_comms = null; |
65 | 65 | ||
66 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) | 66 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) |
@@ -70,12 +70,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
70 | m_localID = localID; | 70 | m_localID = localID; |
71 | m_itemID = itemID; | 71 | m_itemID = itemID; |
72 | 72 | ||
73 | if (m_ScriptEngine.Config.GetBoolean("AllowCareminsterFunctions", false)) | 73 | if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) |
74 | m_CMFunctionsEnabled = true; | 74 | m_LSFunctionsEnabled = true; |
75 | 75 | ||
76 | m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>(); | 76 | m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>(); |
77 | if (m_comms == null) | 77 | if (m_comms == null) |
78 | m_CMFunctionsEnabled = false; | 78 | m_LSFunctionsEnabled = false; |
79 | } | 79 | } |
80 | 80 | ||
81 | public override Object InitializeLifetimeService() | 81 | public override Object InitializeLifetimeService() |
@@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
100 | //Dumps an error message on the debug console. | 100 | //Dumps an error message on the debug console. |
101 | // | 101 | // |
102 | 102 | ||
103 | internal void CMShoutError(string message) | 103 | internal void LSShoutError(string message) |
104 | { | 104 | { |
105 | if (message.Length > 1023) | 105 | if (message.Length > 1023) |
106 | message = message.Substring(0, 1023); | 106 | message = message.Substring(0, 1023); |
@@ -116,11 +116,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
116 | /// Get the current Windlight scene | 116 | /// Get the current Windlight scene |
117 | /// </summary> | 117 | /// </summary> |
118 | /// <returns>List of windlight parameters</returns> | 118 | /// <returns>List of windlight parameters</returns> |
119 | public LSL_List cmGetWindlightScene(LSL_List rules) | 119 | public LSL_List lsGetWindlightScene(LSL_List rules) |
120 | { | 120 | { |
121 | if (!m_CMFunctionsEnabled) | 121 | if (!m_LSFunctionsEnabled) |
122 | { | 122 | { |
123 | CMShoutError("Careminster functions are not enabled."); | 123 | LSShoutError("LightShare functions are not enabled."); |
124 | return new LSL_List(); | 124 | return new LSL_List(); |
125 | } | 125 | } |
126 | m_host.AddScriptLPS(1); | 126 | m_host.AddScriptLPS(1); |
@@ -440,16 +440,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
440 | /// </summary> | 440 | /// </summary> |
441 | /// <param name="rules"></param> | 441 | /// <param name="rules"></param> |
442 | /// <returns>success: true or false</returns> | 442 | /// <returns>success: true or false</returns> |
443 | public int cmSetWindlightScene(LSL_List rules) | 443 | public int lsSetWindlightScene(LSL_List rules) |
444 | { | 444 | { |
445 | if (!m_CMFunctionsEnabled) | 445 | if (!m_LSFunctionsEnabled) |
446 | { | 446 | { |
447 | CMShoutError("Careminster functions are not enabled."); | 447 | LSShoutError("LightShare functions are not enabled."); |
448 | return 0; | 448 | return 0; |
449 | } | 449 | } |
450 | if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) | 450 | if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) |
451 | { | 451 | { |
452 | CMShoutError("cmSetWindlightScene can only be used by estate managers or owners."); | 452 | LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); |
453 | return 0; | 453 | return 0; |
454 | } | 454 | } |
455 | int success = 0; | 455 | int success = 0; |
@@ -462,7 +462,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
462 | } | 462 | } |
463 | else | 463 | else |
464 | { | 464 | { |
465 | CMShoutError("Windlight module is disabled"); | 465 | LSShoutError("Windlight module is disabled"); |
466 | return 0; | 466 | return 0; |
467 | } | 467 | } |
468 | return success; | 468 | return success; |
@@ -472,16 +472,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
472 | /// </summary> | 472 | /// </summary> |
473 | /// <param name="rules"></param> | 473 | /// <param name="rules"></param> |
474 | /// <returns>success: true or false</returns> | 474 | /// <returns>success: true or false</returns> |
475 | public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target) | 475 | public int lsSetWindlightSceneTargeted(LSL_List rules, LSL_Key target) |
476 | { | 476 | { |
477 | if (!m_CMFunctionsEnabled) | 477 | if (!m_LSFunctionsEnabled) |
478 | { | 478 | { |
479 | CMShoutError("Careminster functions are not enabled."); | 479 | LSShoutError("LightShare functions are not enabled."); |
480 | return 0; | 480 | return 0; |
481 | } | 481 | } |
482 | if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) | 482 | if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) |
483 | { | 483 | { |
484 | CMShoutError("cmSetWindlightSceneTargeted can only be used by estate managers or owners."); | 484 | LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); |
485 | return 0; | 485 | return 0; |
486 | } | 486 | } |
487 | int success = 0; | 487 | int success = 0; |
@@ -494,7 +494,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
494 | } | 494 | } |
495 | else | 495 | else |
496 | { | 496 | { |
497 | CMShoutError("Windlight module is disabled"); | 497 | LSShoutError("Windlight module is disabled"); |
498 | return 0; | 498 | return 0; |
499 | } | 499 | } |
500 | return success; | 500 | return success; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs index f13b6e5..9aa437b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs | |||
@@ -38,11 +38,11 @@ using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; | |||
38 | 38 | ||
39 | namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | 39 | namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces |
40 | { | 40 | { |
41 | public interface ICM_Api | 41 | public interface ILS_Api |
42 | { | 42 | { |
43 | // Windlight Functions | 43 | // Windlight Functions |
44 | LSL_List cmGetWindlightScene(LSL_List rules); | 44 | LSL_List lsGetWindlightScene(LSL_List rules); |
45 | int cmSetWindlightScene(LSL_List rules); | 45 | int lsSetWindlightScene(LSL_List rules); |
46 | int cmSetWindlightSceneTargeted(LSL_List rules, key target); | 46 | int lsSetWindlightSceneTargeted(LSL_List rules, key target); |
47 | } | 47 | } |
48 | } | 48 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs index c0edaae..8280ca5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs | |||
@@ -48,29 +48,44 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
48 | { | 48 | { |
49 | public partial class ScriptBaseClass : MarshalByRefObject | 49 | public partial class ScriptBaseClass : MarshalByRefObject |
50 | { | 50 | { |
51 | public ICM_Api m_CM_Functions; | 51 | public ILS_Api m_LS_Functions; |
52 | 52 | ||
53 | public void ApiTypeCM(IScriptApi api) | 53 | public void ApiTypeLS(IScriptApi api) |
54 | { | 54 | { |
55 | if (!(api is ICM_Api)) | 55 | if (!(api is ILS_Api)) |
56 | return; | 56 | return; |
57 | 57 | ||
58 | m_CM_Functions = (ICM_Api)api; | 58 | m_LS_Functions = (ILS_Api)api; |
59 | } | ||
60 | |||
61 | public LSL_List lsGetWindlightScene(LSL_List rules) | ||
62 | { | ||
63 | return m_LS_Functions.lsGetWindlightScene(rules); | ||
64 | } | ||
65 | |||
66 | public int lsSetWindlightScene(LSL_List rules) | ||
67 | { | ||
68 | return m_LS_Functions.lsSetWindlightScene(rules); | ||
69 | } | ||
70 | |||
71 | public int lsSetWindlightSceneTargeted(LSL_List rules, key target) | ||
72 | { | ||
73 | return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); | ||
59 | } | 74 | } |
60 | 75 | ||
61 | public LSL_List cmGetWindlightScene(LSL_List rules) | 76 | public LSL_List cmGetWindlightScene(LSL_List rules) |
62 | { | 77 | { |
63 | return m_CM_Functions.cmGetWindlightScene(rules); | 78 | return m_LS_Functions.lsGetWindlightScene(rules); |
64 | } | 79 | } |
65 | 80 | ||
66 | public int cmSetWindlightScene(LSL_List rules) | 81 | public int cmSetWindlightScene(LSL_List rules) |
67 | { | 82 | { |
68 | return m_CM_Functions.cmSetWindlightScene(rules); | 83 | return m_LS_Functions.lsSetWindlightScene(rules); |
69 | } | 84 | } |
70 | 85 | ||
71 | public int cmSetWindlightSceneTargeted(LSL_List rules, key target) | 86 | public int cmSetWindlightSceneTargeted(LSL_List rules, key target) |
72 | { | 87 | { |
73 | return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target); | 88 | return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); |
74 | } | 89 | } |
75 | } | 90 | } |
76 | } | 91 | } |