aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs
diff options
context:
space:
mode:
authorMelanie2010-03-30 23:29:03 +0100
committerMelanie2010-03-30 23:29:03 +0100
commit7d917e7c5c599549d2a87451fe3d6ca2bf6e62a4 (patch)
tree4fbeba0476276a867859d257d369689385d2b54c /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs
parentMerge branch 'master' into careminster-presence-refactor (diff)
downloadopensim-SC_OLD-7d917e7c5c599549d2a87451fe3d6ca2bf6e62a4.zip
opensim-SC_OLD-7d917e7c5c599549d2a87451fe3d6ca2bf6e62a4.tar.gz
opensim-SC_OLD-7d917e7c5c599549d2a87451fe3d6ca2bf6e62a4.tar.bz2
opensim-SC_OLD-7d917e7c5c599549d2a87451fe3d6ca2bf6e62a4.tar.xz
Rename Meta7Windlight to LightShare
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs116
1 files changed, 58 insertions, 58 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs
index 99973b4..4e8a3c4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs
@@ -7,7 +7,7 @@ using OpenMetaverse;
7using Nini.Config; 7using Nini.Config;
8using OpenSim; 8using OpenSim;
9using OpenSim.Framework; 9using OpenSim.Framework;
10using OpenSim.Region.CoreModules.World.Meta7Windlight; 10using OpenSim.Region.CoreModules.World.LightShare;
11using OpenSim.Region.Framework.Interfaces; 11using OpenSim.Region.Framework.Interfaces;
12using OpenSim.Region.Framework.Scenes; 12using OpenSim.Region.Framework.Scenes;
13using OpenSim.Region.ScriptEngine.Shared; 13using OpenSim.Region.ScriptEngine.Shared;
@@ -97,7 +97,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
97 return new LSL_List(); 97 return new LSL_List();
98 } 98 }
99 m_host.AddScriptLPS(1); 99 m_host.AddScriptLPS(1);
100 RegionMeta7WindlightData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings; 100 RegionLightShareData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings;
101 101
102 LSL_List values = new LSL_List(); 102 LSL_List values = new LSL_List();
103 int idx = 0; 103 int idx = 0;
@@ -229,11 +229,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
229 229
230 return values; 230 return values;
231 231
232 } 232 }
233 233
234 private RegionMeta7WindlightData getWindlightProfileFromRules(LSL_List rules) 234 private RegionLightShareData getWindlightProfileFromRules(LSL_List rules)
235 { 235 {
236 RegionMeta7WindlightData wl = (RegionMeta7WindlightData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone(); 236 RegionLightShareData wl = (RegionLightShareData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone();
237 237
238 LSL_List values = new LSL_List(); 238 LSL_List values = new LSL_List();
239 int idx = 0; 239 int idx = 0;
@@ -244,9 +244,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
244 LSL_Types.Vector3 iV; 244 LSL_Types.Vector3 iV;
245 switch (rule) 245 switch (rule)
246 { 246 {
247 case (int)ScriptBaseClass.WL_SUN_MOON_POSITION: 247 case (int)ScriptBaseClass.WL_SUN_MOON_POSITION:
248 idx++; 248 idx++;
249 wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx); 249 wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx);
250 break; 250 break;
251 case (int)ScriptBaseClass.WL_AMBIENT: 251 case (int)ScriptBaseClass.WL_AMBIENT:
252 idx++; 252 idx++;
@@ -419,58 +419,58 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
419 { 419 {
420 CMShoutError("Careminster functions are not enabled."); 420 CMShoutError("Careminster functions are not enabled.");
421 return 0; 421 return 0;
422 } 422 }
423 if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) 423 if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
424 { 424 {
425 CMShoutError("cmSetWindlightScene can only be used by estate managers or owners."); 425 CMShoutError("cmSetWindlightScene can only be used by estate managers or owners.");
426 return 0; 426 return 0;
427 } 427 }
428 int success = 0; 428 int success = 0;
429 m_host.AddScriptLPS(1); 429 m_host.AddScriptLPS(1);
430 if (Meta7WindlightModule.EnableWindlight) 430 if (LightShareModule.EnableWindlight)
431 { 431 {
432 RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules); 432 RegionLightShareData wl = getWindlightProfileFromRules(rules);
433 m_host.ParentGroup.Scene.StoreWindlightProfile(wl); 433 m_host.ParentGroup.Scene.StoreWindlightProfile(wl);
434 success = 1; 434 success = 1;
435 } 435 }
436 else 436 else
437 { 437 {
438 CMShoutError("Windlight module is disabled"); 438 CMShoutError("Windlight module is disabled");
439 return 0; 439 return 0;
440 }
441 return success;
442 }
443 /// <summary>
444 /// Set the current Windlight scene to a target avatar
445 /// </summary>
446 /// <param name="rules"></param>
447 /// <returns>success: true or false</returns>
448 public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target)
449 {
450 if (!m_CMFunctionsEnabled)
451 {
452 CMShoutError("Careminster functions are not enabled.");
453 return 0;
454 }
455 if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
456 {
457 CMShoutError("cmSetWindlightSceneTargeted can only be used by estate managers or owners.");
458 return 0;
459 }
460 int success = 0;
461 m_host.AddScriptLPS(1);
462 if (LightShareModule.EnableWindlight)
463 {
464 RegionLightShareData wl = getWindlightProfileFromRules(rules);
465 World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string));
466 success = 1;
467 }
468 else
469 {
470 CMShoutError("Windlight module is disabled");
471 return 0;
440 } 472 }
441 return success; 473 return success;
442 }
443 /// <summary>
444 /// Set the current Windlight scene to a target avatar
445 /// </summary>
446 /// <param name="rules"></param>
447 /// <returns>success: true or false</returns>
448 public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target)
449 {
450 if (!m_CMFunctionsEnabled)
451 {
452 CMShoutError("Careminster functions are not enabled.");
453 return 0;
454 }
455 if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
456 {
457 CMShoutError("cmSetWindlightSceneTargeted can only be used by estate managers or owners.");
458 return 0;
459 }
460 int success = 0;
461 m_host.AddScriptLPS(1);
462 if (Meta7WindlightModule.EnableWindlight)
463 {
464 RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules);
465 World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string));
466 success = 1;
467 }
468 else
469 {
470 CMShoutError("Windlight module is disabled");
471 return 0;
472 }
473 return success;
474 } 474 }
475 475
476 } 476 }