diff options
author | Robert Adams | 2014-01-19 07:38:53 -0800 |
---|---|---|
committer | Robert Adams | 2014-01-19 07:38:53 -0800 |
commit | f127e4b4ee916a429ef1d9922432869d4138e214 (patch) | |
tree | be90e6cea8d61088e8380e7027881a8d13f67849 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | |
parent | varregion: Update Warp3D to properly handle varregions. (diff) | |
parent | Fix casting error for float type INI file parameter parsing. (diff) | |
download | opensim-SC_OLD-f127e4b4ee916a429ef1d9922432869d4138e214.zip opensim-SC_OLD-f127e4b4ee916a429ef1d9922432869d4138e214.tar.gz opensim-SC_OLD-f127e4b4ee916a429ef1d9922432869d4138e214.tar.bz2 opensim-SC_OLD-f127e4b4ee916a429ef1d9922432869d4138e214.tar.xz |
Merge branch 'master' into varregion
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 1d6cb6d..b13a5ae 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | |||
@@ -434,6 +434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
434 | } | 434 | } |
435 | return wl; | 435 | return wl; |
436 | } | 436 | } |
437 | |||
437 | /// <summary> | 438 | /// <summary> |
438 | /// Set the current Windlight scene | 439 | /// Set the current Windlight scene |
439 | /// </summary> | 440 | /// </summary> |
@@ -446,13 +447,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
446 | LSShoutError("LightShare functions are not enabled."); | 447 | LSShoutError("LightShare functions are not enabled."); |
447 | return 0; | 448 | return 0; |
448 | } | 449 | } |
449 | if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) | 450 | |
451 | if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID)) | ||
450 | { | 452 | { |
451 | LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); | 453 | ScenePresence sp = World.GetScenePresence(m_host.OwnerID); |
452 | return 0; | 454 | |
455 | if (sp == null || sp.GodLevel < 200) | ||
456 | { | ||
457 | LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); | ||
458 | return 0; | ||
459 | } | ||
453 | } | 460 | } |
461 | |||
454 | int success = 0; | 462 | int success = 0; |
455 | m_host.AddScriptLPS(1); | 463 | m_host.AddScriptLPS(1); |
464 | |||
456 | if (LightShareModule.EnableWindlight) | 465 | if (LightShareModule.EnableWindlight) |
457 | { | 466 | { |
458 | RegionLightShareData wl = getWindlightProfileFromRules(rules); | 467 | RegionLightShareData wl = getWindlightProfileFromRules(rules); |
@@ -465,8 +474,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
465 | LSShoutError("Windlight module is disabled"); | 474 | LSShoutError("Windlight module is disabled"); |
466 | return 0; | 475 | return 0; |
467 | } | 476 | } |
477 | |||
468 | return success; | 478 | return success; |
469 | } | 479 | } |
480 | |||
470 | public void lsClearWindlightScene() | 481 | public void lsClearWindlightScene() |
471 | { | 482 | { |
472 | if (!m_LSFunctionsEnabled) | 483 | if (!m_LSFunctionsEnabled) |
@@ -474,17 +485,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
474 | LSShoutError("LightShare functions are not enabled."); | 485 | LSShoutError("LightShare functions are not enabled."); |
475 | return; | 486 | return; |
476 | } | 487 | } |
477 | if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) | 488 | |
489 | if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID)) | ||
478 | { | 490 | { |
479 | LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); | 491 | ScenePresence sp = World.GetScenePresence(m_host.OwnerID); |
480 | return; | 492 | |
493 | if (sp == null || sp.GodLevel < 200) | ||
494 | { | ||
495 | LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); | ||
496 | return; | ||
497 | } | ||
481 | } | 498 | } |
482 | 499 | ||
483 | m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; | 500 | m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; |
484 | if (m_host.ParentGroup.Scene.SimulationDataService != null) | 501 | if (m_host.ParentGroup.Scene.SimulationDataService != null) |
485 | m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); | 502 | m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); |
503 | |||
486 | m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile(); | 504 | m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile(); |
487 | } | 505 | } |
506 | |||
488 | /// <summary> | 507 | /// <summary> |
489 | /// Set the current Windlight scene to a target avatar | 508 | /// Set the current Windlight scene to a target avatar |
490 | /// </summary> | 509 | /// </summary> |
@@ -497,13 +516,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
497 | LSShoutError("LightShare functions are not enabled."); | 516 | LSShoutError("LightShare functions are not enabled."); |
498 | return 0; | 517 | return 0; |
499 | } | 518 | } |
500 | if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) | 519 | |
520 | if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID)) | ||
501 | { | 521 | { |
502 | LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); | 522 | ScenePresence sp = World.GetScenePresence(m_host.OwnerID); |
503 | return 0; | 523 | |
524 | if (sp == null || sp.GodLevel < 200) | ||
525 | { | ||
526 | LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); | ||
527 | return 0; | ||
528 | } | ||
504 | } | 529 | } |
530 | |||
505 | int success = 0; | 531 | int success = 0; |
506 | m_host.AddScriptLPS(1); | 532 | m_host.AddScriptLPS(1); |
533 | |||
507 | if (LightShareModule.EnableWindlight) | 534 | if (LightShareModule.EnableWindlight) |
508 | { | 535 | { |
509 | RegionLightShareData wl = getWindlightProfileFromRules(rules); | 536 | RegionLightShareData wl = getWindlightProfileFromRules(rules); |
@@ -515,8 +542,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
515 | LSShoutError("Windlight module is disabled"); | 542 | LSShoutError("Windlight module is disabled"); |
516 | return 0; | 543 | return 0; |
517 | } | 544 | } |
545 | |||
518 | return success; | 546 | return success; |
519 | } | 547 | } |
520 | |||
521 | } | 548 | } |
522 | } | 549 | } \ No newline at end of file |