mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 22:05:36 +08:00
Rename Meta7Windlight to LightShare
This commit is contained in:
@@ -7,7 +7,7 @@ using OpenMetaverse;
|
||||
using Nini.Config;
|
||||
using OpenSim;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.CoreModules.World.Meta7Windlight;
|
||||
using OpenSim.Region.CoreModules.World.LightShare;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.ScriptEngine.Shared;
|
||||
@@ -97,7 +97,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return new LSL_List();
|
||||
}
|
||||
m_host.AddScriptLPS(1);
|
||||
RegionMeta7WindlightData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings;
|
||||
RegionLightShareData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings;
|
||||
|
||||
LSL_List values = new LSL_List();
|
||||
int idx = 0;
|
||||
@@ -229,11 +229,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
return values;
|
||||
|
||||
}
|
||||
|
||||
private RegionMeta7WindlightData getWindlightProfileFromRules(LSL_List rules)
|
||||
{
|
||||
RegionMeta7WindlightData wl = (RegionMeta7WindlightData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone();
|
||||
}
|
||||
|
||||
private RegionLightShareData getWindlightProfileFromRules(LSL_List rules)
|
||||
{
|
||||
RegionLightShareData wl = (RegionLightShareData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone();
|
||||
|
||||
LSL_List values = new LSL_List();
|
||||
int idx = 0;
|
||||
@@ -244,9 +244,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
LSL_Types.Vector3 iV;
|
||||
switch (rule)
|
||||
{
|
||||
case (int)ScriptBaseClass.WL_SUN_MOON_POSITION:
|
||||
idx++;
|
||||
wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx);
|
||||
case (int)ScriptBaseClass.WL_SUN_MOON_POSITION:
|
||||
idx++;
|
||||
wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx);
|
||||
break;
|
||||
case (int)ScriptBaseClass.WL_AMBIENT:
|
||||
idx++;
|
||||
@@ -419,58 +419,58 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
CMShoutError("Careminster 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.");
|
||||
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.");
|
||||
return 0;
|
||||
}
|
||||
int success = 0;
|
||||
m_host.AddScriptLPS(1);
|
||||
if (Meta7WindlightModule.EnableWindlight)
|
||||
{
|
||||
RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules);
|
||||
m_host.ParentGroup.Scene.StoreWindlightProfile(wl);
|
||||
success = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
CMShoutError("Windlight module is disabled");
|
||||
return 0;
|
||||
m_host.AddScriptLPS(1);
|
||||
if (LightShareModule.EnableWindlight)
|
||||
{
|
||||
RegionLightShareData wl = getWindlightProfileFromRules(rules);
|
||||
m_host.ParentGroup.Scene.StoreWindlightProfile(wl);
|
||||
success = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
CMShoutError("Windlight module is disabled");
|
||||
return 0;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
/// <summary>
|
||||
/// Set the current Windlight scene to a target avatar
|
||||
/// </summary>
|
||||
/// <param name="rules"></param>
|
||||
/// <returns>success: true or false</returns>
|
||||
public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target)
|
||||
{
|
||||
if (!m_CMFunctionsEnabled)
|
||||
{
|
||||
CMShoutError("Careminster 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.");
|
||||
return 0;
|
||||
}
|
||||
int success = 0;
|
||||
m_host.AddScriptLPS(1);
|
||||
if (LightShareModule.EnableWindlight)
|
||||
{
|
||||
RegionLightShareData wl = getWindlightProfileFromRules(rules);
|
||||
World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string));
|
||||
success = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
CMShoutError("Windlight module is disabled");
|
||||
return 0;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
/// <summary>
|
||||
/// Set the current Windlight scene to a target avatar
|
||||
/// </summary>
|
||||
/// <param name="rules"></param>
|
||||
/// <returns>success: true or false</returns>
|
||||
public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target)
|
||||
{
|
||||
if (!m_CMFunctionsEnabled)
|
||||
{
|
||||
CMShoutError("Careminster 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.");
|
||||
return 0;
|
||||
}
|
||||
int success = 0;
|
||||
m_host.AddScriptLPS(1);
|
||||
if (Meta7WindlightModule.EnableWindlight)
|
||||
{
|
||||
RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules);
|
||||
World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string));
|
||||
success = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
CMShoutError("Windlight module is disabled");
|
||||
return 0;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user