Rename Meta7Windlight to LightShare

avinationmerge
Melanie 2010-03-30 23:29:03 +01:00
parent 5693870fe2
commit 7d917e7c5c
14 changed files with 94 additions and 369 deletions

View File

@ -691,13 +691,13 @@ VALUES
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
} }
public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
{ {
//This connector doesn't support the windlight module yet //This connector doesn't support the windlight module yet
//Return default LL windlight settings //Return default LL windlight settings
return new RegionMeta7WindlightData(); return new RegionLightShareData();
} }
public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) public void StoreRegionWindlightSettings(RegionLightShareData wl)
{ {
//This connector doesn't support the windlight module yet //This connector doesn't support the windlight module yet
} }

View File

@ -711,9 +711,9 @@ namespace OpenSim.Data.MySQL
} }
} }
public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
{ {
RegionMeta7WindlightData nWP = new RegionMeta7WindlightData(); RegionLightShareData nWP = new RegionLightShareData();
nWP.OnSave += StoreRegionWindlightSettings; nWP.OnSave += StoreRegionWindlightSettings;
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
@ -845,7 +845,7 @@ namespace OpenSim.Data.MySQL
return rs; return rs;
} }
public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) public void StoreRegionWindlightSettings(RegionLightShareData wl)
{ {
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{ {

View File

@ -50,13 +50,13 @@ namespace OpenSim.Data.Null
public void StoreRegionSettings(RegionSettings rs) public void StoreRegionSettings(RegionSettings rs)
{ {
} }
public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
{ {
//This connector doesn't support the windlight module yet //This connector doesn't support the windlight module yet
//Return default LL windlight settings //Return default LL windlight settings
return new RegionMeta7WindlightData(); return new RegionLightShareData();
} }
public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) public void StoreRegionWindlightSettings(RegionLightShareData wl)
{ {
//This connector doesn't support the windlight module yet //This connector doesn't support the windlight module yet
} }

View File

@ -272,13 +272,13 @@ namespace OpenSim.Data.SQLite
Commit(); Commit();
} }
} }
public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
{ {
//This connector doesn't support the windlight module yet //This connector doesn't support the windlight module yet
//Return default LL windlight settings //Return default LL windlight settings
return new RegionMeta7WindlightData(); return new RegionLightShareData();
} }
public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) public void StoreRegionWindlightSettings(RegionLightShareData wl)
{ {
//This connector doesn't support the windlight module yet //This connector doesn't support the windlight module yet
} }

View File

@ -39,7 +39,7 @@ using OpenSim.Framework.Console;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
public class RegionMeta7WindlightData : ICloneable public class RegionLightShareData : ICloneable
{ {
public UUID regionID = UUID.Zero; public UUID regionID = UUID.Zero;
public Vector3 waterColor = new Vector3(4.0f,38.0f,64.0f); public Vector3 waterColor = new Vector3(4.0f,38.0f,64.0f);
@ -80,7 +80,7 @@ namespace OpenSim.Framework
public bool cloudScrollYLock = false; public bool cloudScrollYLock = false;
public bool drawClassicClouds = true; public bool drawClassicClouds = true;
public delegate void SaveDelegate(RegionMeta7WindlightData wl); public delegate void SaveDelegate(RegionLightShareData wl);
public event SaveDelegate OnSave; public event SaveDelegate OnSave;
public void Save() public void Save()
{ {
@ -356,7 +356,7 @@ namespace OpenSim.Framework
private bool m_clampPrimSize = false; private bool m_clampPrimSize = false;
private int m_objectCapacity = 0; private int m_objectCapacity = 0;
private string m_regionType = String.Empty; private string m_regionType = String.Empty;
private RegionMeta7WindlightData m_windlight = new RegionMeta7WindlightData(); private RegionLightShareData m_windlight = new RegionLightShareData();
protected uint m_httpPort; protected uint m_httpPort;
protected string m_serverURI; protected string m_serverURI;
protected string m_regionName = String.Empty; protected string m_regionName = String.Empty;
@ -495,13 +495,13 @@ namespace OpenSim.Framework
set { m_regionSettings = value; } set { m_regionSettings = value; }
} }
public RegionMeta7WindlightData WindlightSettings public RegionLightShareData WindlightSettings
{ {
get get
{ {
if (m_windlight == null) if (m_windlight == null)
{ {
m_windlight = new RegionMeta7WindlightData(); m_windlight = new RegionLightShareData();
} }
return m_windlight; return m_windlight;

View File

@ -1532,7 +1532,7 @@ namespace OpenSim.Region.CoreModules.World.Land
private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID)
{ {
ScenePresence SP; ScenePresence SP;
((Scene)client.Scene).TryGetAvatar(client.AgentId, out SP); ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP);
List<SceneObjectGroup> returns = new List<SceneObjectGroup>(); List<SceneObjectGroup> returns = new List<SceneObjectGroup>();
if (SP.GodLevel != 0) if (SP.GodLevel != 0)
{ {
@ -1597,9 +1597,9 @@ namespace OpenSim.Region.CoreModules.World.Land
public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
{ {
ScenePresence targetAvatar = null; ScenePresence targetAvatar = null;
((Scene)client.Scene).TryGetAvatar(target, out targetAvatar); ((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
ScenePresence parcelManager = null; ScenePresence parcelManager = null;
((Scene)client.Scene).TryGetAvatar(client.AgentId, out parcelManager); ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
System.Threading.Timer Timer; System.Threading.Timer Timer;
if (targetAvatar.GodLevel == 0) if (targetAvatar.GodLevel == 0)
@ -1641,9 +1641,9 @@ namespace OpenSim.Region.CoreModules.World.Land
public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
{ {
ScenePresence targetAvatar = null; ScenePresence targetAvatar = null;
((Scene)client.Scene).TryGetAvatar(target, out targetAvatar); ((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
ScenePresence parcelManager = null; ScenePresence parcelManager = null;
((Scene)client.Scene).TryGetAvatar(client.AgentId, out parcelManager); ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
//Just eject //Just eject
if (flags == 0) if (flags == 0)
{ {

View File

@ -1,274 +0,0 @@
/*
* Copyright (c) Thomas Grimshaw and Magne Metaverse Research
*
* This module is not open source. All rights reserved.
* Unauthorised copying, distribution or public display is prohibited.
*
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using OpenMetaverse;
using log4net;
using Nini.Config;
using OpenSim.Data;
using OpenSim.Framework;
using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.CoreModules.World.Meta7Windlight
{
public class Meta7WindlightModule : IRegionModule, ICommandableModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private readonly Commander m_commander = new Commander("windlight");
private Scene m_scene;
private static bool m_enableWindlight;
#region ICommandableModule Members
public ICommander CommandInterface
{
get { return m_commander; }
}
#endregion
#region IRegionModule Members
public static bool EnableWindlight
{
get
{
return m_enableWindlight;
}
set
{
}
}
public void Initialise(Scene scene, IConfigSource config)
{
m_scene = scene;
m_scene.RegisterModuleInterface<IRegionModule>(this);
m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
// ini file settings
try
{
m_enableWindlight = config.Configs["Meta7Windlight"].GetBoolean("enable_windlight", false);
}
catch (Exception)
{
m_log.Debug("[WINDLIGHT]: ini failure for enable_windlight - using default");
}
if (m_enableWindlight)
{
m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent;
m_scene.EventManager.OnSaveNewWindlightProfile += EventManager_OnSaveNewWindlightProfile;
m_scene.EventManager.OnSendNewWindlightProfileTargeted += EventManager_OnSendNewWindlightProfileTargeted;
}
InstallCommands();
m_log.Debug("[WINDLIGHT]: Initialised windlight module");
}
private List<byte[]> compileWindlightSettings(RegionMeta7WindlightData wl)
{
byte[] mBlock = new Byte[249];
int pos = 0;
wl.waterColor.ToBytes(mBlock, 0); pos += 12;
Utils.FloatToBytes(wl.waterFogDensityExponent).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.underwaterFogModifier).CopyTo(mBlock, pos); pos += 4;
wl.reflectionWaveletScale.ToBytes(mBlock, pos); pos += 12;
Utils.FloatToBytes(wl.fresnelScale).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.fresnelOffset).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.refractScaleAbove).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.refractScaleBelow).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.blurMultiplier).CopyTo(mBlock, pos); pos += 4;
wl.bigWaveDirection.ToBytes(mBlock, pos); pos += 8;
wl.littleWaveDirection.ToBytes(mBlock, pos); pos += 8;
wl.normalMapTexture.ToBytes(mBlock, pos); pos += 16;
wl.horizon.ToBytes(mBlock, pos); pos += 16;
Utils.FloatToBytes(wl.hazeHorizon).CopyTo(mBlock, pos); pos += 4;
wl.blueDensity.ToBytes(mBlock, pos); pos += 16;
Utils.FloatToBytes(wl.hazeDensity).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.densityMultiplier).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.distanceMultiplier).CopyTo(mBlock, pos); pos += 4;
wl.sunMoonColor.ToBytes(mBlock, pos); pos += 16;
Utils.FloatToBytes(wl.sunMoonPosition).CopyTo(mBlock, pos); pos += 4;
wl.ambient.ToBytes(mBlock, pos); pos += 16;
Utils.FloatToBytes(wl.eastAngle).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.sunGlowFocus).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.sunGlowSize).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.sceneGamma).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.starBrightness).CopyTo(mBlock, pos); pos += 4;
wl.cloudColor.ToBytes(mBlock, pos); pos += 16;
wl.cloudXYDensity.ToBytes(mBlock, pos); pos += 12;
Utils.FloatToBytes(wl.cloudCoverage).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.cloudScale).CopyTo(mBlock, pos); pos += 4;
wl.cloudDetailXYDensity.ToBytes(mBlock, pos); pos += 12;
Utils.FloatToBytes(wl.cloudScrollX).CopyTo(mBlock, pos); pos += 4;
Utils.FloatToBytes(wl.cloudScrollY).CopyTo(mBlock, pos); pos += 4;
Utils.UInt16ToBytes(wl.maxAltitude).CopyTo(mBlock, pos); pos += 2;
mBlock[pos] = Convert.ToByte(wl.cloudScrollXLock); pos++;
mBlock[pos] = Convert.ToByte(wl.cloudScrollYLock); pos++;
mBlock[pos] = Convert.ToByte(wl.drawClassicClouds); pos++;
List<byte[]> param = new List<byte[]>();
param.Add(mBlock);
return param;
}
public void SendProfileToClient(ScenePresence presence)
{
IClientAPI client = presence.ControllingClient;
if (m_enableWindlight)
{
if (presence.IsChildAgent == false)
{
List<byte[]> param = compileWindlightSettings(m_scene.RegionInfo.WindlightSettings);
client.SendGenericMessage("Windlight", param);
}
}
else
{
//We probably don't want to spam chat with this.. probably
//m_log.Debug("[WINDLIGHT]: Module disabled");
}
}
public void SendProfileToClient(ScenePresence presence, RegionMeta7WindlightData wl)
{
IClientAPI client = presence.ControllingClient;
if (m_enableWindlight)
{
if (presence.IsChildAgent == false)
{
List<byte[]> param = compileWindlightSettings(wl);
client.SendGenericMessage("Windlight", param);
}
}
else
{
//We probably don't want to spam chat with this.. probably
//m_log.Debug("[WINDLIGHT]: Module disabled");
}
}
private void EventManager_OnMakeRootAgent(ScenePresence presence)
{
m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client");
SendProfileToClient(presence);
}
private void EventManager_OnSendNewWindlightProfileTargeted(RegionMeta7WindlightData wl, UUID pUUID)
{
ScenePresence Sc;
if (m_scene.TryGetAvatar(pUUID,out Sc))
{
SendProfileToClient(Sc,wl);
}
}
private void EventManager_OnSaveNewWindlightProfile()
{
m_scene.ForEachScenePresence(SendProfileToClient);
}
public void PostInitialise()
{
}
public void Close()
{
}
public string Name
{
get { return "Meta7WindlightModule"; }
}
public bool IsSharedModule
{
get { return false; }
}
#endregion
#region events
#endregion
#region ICommandableModule Members
private void InstallCommands()
{
Command wlload = new Command("load", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleLoad, "Load windlight profile from the database and broadcast");
Command wlenable = new Command("enable", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleEnable, "Enable the windlight plugin");
Command wldisable = new Command("disable", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleDisable, "Enable the windlight plugin");
m_commander.RegisterCommand("load", wlload);
m_commander.RegisterCommand("enable", wlenable);
m_commander.RegisterCommand("disable", wldisable);
m_scene.RegisterModuleCommander(m_commander);
}
private void HandleLoad(Object[] args)
{
if (!m_enableWindlight)
{
m_log.InfoFormat("[WINDLIGHT]: Cannot load windlight profile, module disabled. Use 'windlight enable' first.");
}
else
{
m_log.InfoFormat("[WINDLIGHT]: Loading Windlight profile from database");
m_scene.LoadWindlightProfile();
m_log.InfoFormat("[WINDLIGHT]: Load complete");
}
}
private void HandleDisable(Object[] args)
{
m_log.InfoFormat("[WINDLIGHT]: Plugin now disabled");
m_enableWindlight=false;
}
private void HandleEnable(Object[] args)
{
m_log.InfoFormat("[WINDLIGHT]: Plugin now enabled");
m_enableWindlight = true;
}
/// <summary>
/// Processes commandline input. Do not call directly.
/// </summary>
/// <param name="args">Commandline arguments</param>
private void EventManager_OnPluginConsole(string[] args)
{
if (args[0] == "windlight")
{
if (args.Length == 1)
{
m_commander.ProcessConsoleCommand("add", new string[0]);
return;
}
string[] tmpArgs = new string[args.Length - 2];
int i;
for (i = 2; i < args.Length; i++)
{
tmpArgs[i - 2] = args[i];
}
m_commander.ProcessConsoleCommand(args[1], tmpArgs);
}
}
#endregion
}
}

View File

@ -103,8 +103,8 @@ namespace OpenSim.Region.Framework.Interfaces
void StoreRegionSettings(RegionSettings rs); void StoreRegionSettings(RegionSettings rs);
RegionSettings LoadRegionSettings(UUID regionUUID); RegionSettings LoadRegionSettings(UUID regionUUID);
RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID); RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID);
void StoreRegionWindlightSettings(RegionMeta7WindlightData wl); void StoreRegionWindlightSettings(RegionLightShareData wl);
void Shutdown(); void Shutdown();
} }

View File

@ -207,7 +207,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void OnMakeRootAgentDelegate(ScenePresence presence); public delegate void OnMakeRootAgentDelegate(ScenePresence presence);
public delegate void OnSaveNewWindlightProfileDelegate(); public delegate void OnSaveNewWindlightProfileDelegate();
public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionMeta7WindlightData wl, UUID user); public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user);
public event OnMakeRootAgentDelegate OnMakeRootAgent; public event OnMakeRootAgentDelegate OnMakeRootAgent;
public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted; public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted;
public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile; public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile;
@ -1220,7 +1220,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerOnSendNewWindlightProfileTargeted(RegionMeta7WindlightData wl, UUID user) public void TriggerOnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID user)
{ {
OnSendNewWindlightProfileTargetedDelegate handlerSendNewWindlightProfileTargeted = OnSendNewWindlightProfileTargeted; OnSendNewWindlightProfileTargetedDelegate handlerSendNewWindlightProfileTargeted = OnSendNewWindlightProfileTargeted;
if (handlerSendNewWindlightProfileTargeted != null) if (handlerSendNewWindlightProfileTargeted != null)

View File

@ -1729,7 +1729,7 @@ namespace OpenSim.Region.Framework.Scenes
m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
} }
public void StoreWindlightProfile(RegionMeta7WindlightData wl) public void StoreWindlightProfile(RegionLightShareData wl)
{ {
m_regInfo.WindlightSettings = wl; m_regInfo.WindlightSettings = wl;
m_storageManager.DataStore.StoreRegionWindlightSettings(wl); m_storageManager.DataStore.StoreRegionWindlightSettings(wl);

View File

@ -1370,21 +1370,20 @@ namespace OpenSim.Region.Framework.Scenes
{ {
// part.Inventory.RemoveScriptInstances(); // part.Inventory.RemoveScriptInstances();
List<ScenePresence> avatars = Scene.GetScenePresences(); Scene.ForEachScenePresence(delegate (ScenePresence sp)
for (int i = 0; i < avatars.Count; i++)
{ {
if (avatars[i].ParentID == LocalId) if (sp.ParentID == LocalId)
{ {
avatars[i].StandUp(); sp.StandUp();
} }
if (!silent) if (!silent)
{ {
part.UpdateFlag = 0; part.UpdateFlag = 0;
if (part == m_rootPart) if (part == m_rootPart)
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); sp.ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
} }
} });
} }

View File

@ -101,13 +101,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
{ {
//This connector doesn't support the windlight module yet //This connector doesn't support the windlight module yet
//Return default LL windlight settings //Return default LL windlight settings
return new RegionMeta7WindlightData(); return new RegionLightShareData();
} }
public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) public void StoreRegionWindlightSettings(RegionLightShareData wl)
{ {
//This connector doesn't support the windlight module yet //This connector doesn't support the windlight module yet
} }

View File

@ -7,7 +7,7 @@ using OpenMetaverse;
using Nini.Config; using Nini.Config;
using OpenSim; using OpenSim;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.CoreModules.World.Meta7Windlight; using OpenSim.Region.CoreModules.World.LightShare;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.ScriptEngine.Shared;
@ -97,7 +97,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return new LSL_List(); return new LSL_List();
} }
m_host.AddScriptLPS(1); 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(); LSL_List values = new LSL_List();
int idx = 0; int idx = 0;
@ -229,11 +229,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return values; return values;
} }
private RegionMeta7WindlightData getWindlightProfileFromRules(LSL_List rules) private RegionLightShareData getWindlightProfileFromRules(LSL_List rules)
{ {
RegionMeta7WindlightData wl = (RegionMeta7WindlightData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone(); RegionLightShareData wl = (RegionLightShareData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone();
LSL_List values = new LSL_List(); LSL_List values = new LSL_List();
int idx = 0; int idx = 0;
@ -244,9 +244,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSL_Types.Vector3 iV; LSL_Types.Vector3 iV;
switch (rule) switch (rule)
{ {
case (int)ScriptBaseClass.WL_SUN_MOON_POSITION: case (int)ScriptBaseClass.WL_SUN_MOON_POSITION:
idx++; idx++;
wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx); wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx);
break; break;
case (int)ScriptBaseClass.WL_AMBIENT: case (int)ScriptBaseClass.WL_AMBIENT:
idx++; idx++;
@ -419,58 +419,58 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
CMShoutError("Careminster functions are not enabled."); CMShoutError("Careminster functions are not enabled.");
return 0; return 0;
} }
if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) 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."); CMShoutError("cmSetWindlightScene can only be used by estate managers or owners.");
return 0; return 0;
} }
int success = 0; int success = 0;
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (Meta7WindlightModule.EnableWindlight) if (LightShareModule.EnableWindlight)
{ {
RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules); RegionLightShareData wl = getWindlightProfileFromRules(rules);
m_host.ParentGroup.Scene.StoreWindlightProfile(wl); m_host.ParentGroup.Scene.StoreWindlightProfile(wl);
success = 1; success = 1;
} }
else else
{ {
CMShoutError("Windlight module is disabled"); CMShoutError("Windlight module is disabled");
return 0; 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; 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;
} }
} }

View File

@ -771,7 +771,7 @@
; default is 1000 ; default is 1000
cloud_update_rate = 1000 cloud_update_rate = 1000
[Meta7Windlight] [LightShare]
; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer. ; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer.
; It has no ill effect on viewers which do not support server-side windlight settings. ; It has no ill effect on viewers which do not support server-side windlight settings.