aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDiva Canto2010-06-11 12:48:06 -0700
committerDiva Canto2010-06-11 12:48:06 -0700
commit556e91d33cad4e7b4b0c57b4010e77cd4ab27773 (patch)
treeef9078ae7cdb04a5f99ac920832e8d2161df6b6b /OpenSim/Region
parentInventory offers and subsequent notifications of acceptance/decline now worki... (diff)
parentAdd the AllowLightShareFunctions example (diff)
downloadopensim-SC-556e91d33cad4e7b4b0c57b4010e77cd4ab27773.zip
opensim-SC-556e91d33cad4e7b4b0c57b4010e77cd4ab27773.tar.gz
opensim-SC-556e91d33cad4e7b4b0c57b4010e77cd4ab27773.tar.bz2
opensim-SC-556e91d33cad4e7b4b0c57b4010e77cd4ab27773.tar.xz
Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
-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/Implementation/OSSL_Api.cs27
-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/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs (renamed from OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs)20
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp2
7 files changed, 67 insertions, 34 deletions
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;
54namespace OpenSim.Region.ScriptEngine.Shared.Api 54namespace 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/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index dde664e..cd6d3a3 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
2202 2202
2203 m_LSL_Api.SetPrimitiveParamsEx(prim, rules); 2203 m_LSL_Api.SetPrimitiveParamsEx(prim, rules);
2204 } 2204 }
2205
2206 /// <summary>
2207 /// Like osGetAgents but returns enough info for a radar
2208 /// </summary>
2209 /// <returns>Strided list of the UUID, position and name of each avatar in the region</returns>
2210 public LSL_List osGetAvatarList()
2211 {
2212 CheckThreatLevel(ThreatLevel.None, "osGetAvatarList");
2213
2214 LSL_List result = new LSL_List();
2215 World.ForEachScenePresence(delegate (ScenePresence avatar)
2216 {
2217 if (avatar != null && avatar.UUID != m_host.OwnerID)
2218 {
2219 if (avatar.IsChildAgent == false)
2220 {
2221 if (avatar.PhysicsActor != null && avatar.PhysicsActor.Position != null)
2222 {
2223 result.Add(avatar.UUID);
2224 result.Add(avatar.PhysicsActor.Position);
2225 result.Add(avatar.Name);
2226 }
2227 }
2228 }
2229 });
2230 return result;
2231 }
2205 } 2232 }
2206} 2233}
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
39namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces 39namespace 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/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 9785b24..78ee43c 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
176 void osCauseDamage(string avatar, double damage); 176 void osCauseDamage(string avatar, double damage);
177 LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules); 177 LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);
178 void osSetPrimitiveParams(LSL_Key prim, LSL_List rules); 178 void osSetPrimitiveParams(LSL_Key prim, LSL_List rules);
179 LSL_List osGetAvatarList();
179 180
180 } 181 }
181} 182}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs
index c0edaae..f8dbe03 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs
@@ -48,29 +48,29 @@ 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 } 59 }
60 60
61 public LSL_List cmGetWindlightScene(LSL_List rules) 61 public LSL_List lsGetWindlightScene(LSL_List rules)
62 { 62 {
63 return m_CM_Functions.cmGetWindlightScene(rules); 63 return m_LS_Functions.lsGetWindlightScene(rules);
64 } 64 }
65 65
66 public int cmSetWindlightScene(LSL_List rules) 66 public int lsSetWindlightScene(LSL_List rules)
67 { 67 {
68 return m_CM_Functions.cmSetWindlightScene(rules); 68 return m_LS_Functions.lsSetWindlightScene(rules);
69 } 69 }
70 70
71 public int cmSetWindlightSceneTargeted(LSL_List rules, key target) 71 public int lsSetWindlightSceneTargeted(LSL_List rules, key target)
72 { 72 {
73 return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target); 73 return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target);
74 } 74 }
75 } 75 }
76} 76}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 7af5d43..6cc5f51 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
687 { 687 {
688 m_OSSL_Functions.osSetPrimitiveParams(prim, rules); 688 m_OSSL_Functions.osSetPrimitiveParams(prim, rules);
689 } 689 }
690
691 public LSL_List osGetAvatarList()
692 {
693 return m_OSSL_Functions.osGetAvatarList();
694 }
690 } 695 }
691} 696}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp
index 23138ef..f02d2d9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp
@@ -18,10 +18,10 @@
18 </DeploymentInformation> 18 </DeploymentInformation>
19 <Contents> 19 <Contents>
20 <File name="./CM_Constants.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 20 <File name="./CM_Constants.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
21 <File name="./CM_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
22 <File name="./Executor.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 21 <File name="./Executor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
23 <File name="./LSL_Constants.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 22 <File name="./LSL_Constants.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
24 <File name="./LSL_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 23 <File name="./LSL_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
24 <File name="./LS_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
25 <File name="./MOD_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 25 <File name="./MOD_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
26 <File name="./OSSL_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 26 <File name="./OSSL_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
27 <File name="./ScriptBase.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 27 <File name="./ScriptBase.cs" subtype="Code" buildaction="Compile" dependson="" data="" />