diff options
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/Null/NullDataStore.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteRegionData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs | 274 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs | 116 | ||||
-rw-r--r-- | bin/OpenSim.ini.example | 2 |
14 files changed, 94 insertions, 369 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs index b1339b6..d6cb91f 100644 --- a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs | |||
@@ -691,13 +691,13 @@ VALUES | |||
691 | cmd.ExecuteNonQuery(); | 691 | cmd.ExecuteNonQuery(); |
692 | } | 692 | } |
693 | } | 693 | } |
694 | public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) | 694 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) |
695 | { | 695 | { |
696 | //This connector doesn't support the windlight module yet | 696 | //This connector doesn't support the windlight module yet |
697 | //Return default LL windlight settings | 697 | //Return default LL windlight settings |
698 | return new RegionMeta7WindlightData(); | 698 | return new RegionLightShareData(); |
699 | } | 699 | } |
700 | public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) | 700 | public void StoreRegionWindlightSettings(RegionLightShareData wl) |
701 | { | 701 | { |
702 | //This connector doesn't support the windlight module yet | 702 | //This connector doesn't support the windlight module yet |
703 | } | 703 | } |
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index f84beb6..a395ddc 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | |||
@@ -711,9 +711,9 @@ namespace OpenSim.Data.MySQL | |||
711 | } | 711 | } |
712 | } | 712 | } |
713 | 713 | ||
714 | public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) | 714 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) |
715 | { | 715 | { |
716 | RegionMeta7WindlightData nWP = new RegionMeta7WindlightData(); | 716 | RegionLightShareData nWP = new RegionLightShareData(); |
717 | nWP.OnSave += StoreRegionWindlightSettings; | 717 | nWP.OnSave += StoreRegionWindlightSettings; |
718 | 718 | ||
719 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 719 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
@@ -845,7 +845,7 @@ namespace OpenSim.Data.MySQL | |||
845 | return rs; | 845 | return rs; |
846 | } | 846 | } |
847 | 847 | ||
848 | public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) | 848 | public void StoreRegionWindlightSettings(RegionLightShareData wl) |
849 | { | 849 | { |
850 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 850 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
851 | { | 851 | { |
diff --git a/OpenSim/Data/Null/NullDataStore.cs b/OpenSim/Data/Null/NullDataStore.cs index 4b6d0f3..3ba44bb 100644 --- a/OpenSim/Data/Null/NullDataStore.cs +++ b/OpenSim/Data/Null/NullDataStore.cs | |||
@@ -50,13 +50,13 @@ namespace OpenSim.Data.Null | |||
50 | public void StoreRegionSettings(RegionSettings rs) | 50 | public void StoreRegionSettings(RegionSettings rs) |
51 | { | 51 | { |
52 | } | 52 | } |
53 | public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) | 53 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) |
54 | { | 54 | { |
55 | //This connector doesn't support the windlight module yet | 55 | //This connector doesn't support the windlight module yet |
56 | //Return default LL windlight settings | 56 | //Return default LL windlight settings |
57 | return new RegionMeta7WindlightData(); | 57 | return new RegionLightShareData(); |
58 | } | 58 | } |
59 | public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) | 59 | public void StoreRegionWindlightSettings(RegionLightShareData wl) |
60 | { | 60 | { |
61 | //This connector doesn't support the windlight module yet | 61 | //This connector doesn't support the windlight module yet |
62 | } | 62 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 81c0703..d2ba9ae 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -272,13 +272,13 @@ namespace OpenSim.Data.SQLite | |||
272 | Commit(); | 272 | Commit(); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) | 275 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) |
276 | { | 276 | { |
277 | //This connector doesn't support the windlight module yet | 277 | //This connector doesn't support the windlight module yet |
278 | //Return default LL windlight settings | 278 | //Return default LL windlight settings |
279 | return new RegionMeta7WindlightData(); | 279 | return new RegionLightShareData(); |
280 | } | 280 | } |
281 | public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) | 281 | public void StoreRegionWindlightSettings(RegionLightShareData wl) |
282 | { | 282 | { |
283 | //This connector doesn't support the windlight module yet | 283 | //This connector doesn't support the windlight module yet |
284 | } | 284 | } |
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 05f9cf9..5eacd73 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -39,7 +39,7 @@ using OpenSim.Framework.Console; | |||
39 | 39 | ||
40 | namespace OpenSim.Framework | 40 | namespace OpenSim.Framework |
41 | { | 41 | { |
42 | public class RegionMeta7WindlightData : ICloneable | 42 | public class RegionLightShareData : ICloneable |
43 | { | 43 | { |
44 | public UUID regionID = UUID.Zero; | 44 | public UUID regionID = UUID.Zero; |
45 | public Vector3 waterColor = new Vector3(4.0f,38.0f,64.0f); | 45 | public Vector3 waterColor = new Vector3(4.0f,38.0f,64.0f); |
@@ -80,7 +80,7 @@ namespace OpenSim.Framework | |||
80 | public bool cloudScrollYLock = false; | 80 | public bool cloudScrollYLock = false; |
81 | public bool drawClassicClouds = true; | 81 | public bool drawClassicClouds = true; |
82 | 82 | ||
83 | public delegate void SaveDelegate(RegionMeta7WindlightData wl); | 83 | public delegate void SaveDelegate(RegionLightShareData wl); |
84 | public event SaveDelegate OnSave; | 84 | public event SaveDelegate OnSave; |
85 | public void Save() | 85 | public void Save() |
86 | { | 86 | { |
@@ -356,7 +356,7 @@ namespace OpenSim.Framework | |||
356 | private bool m_clampPrimSize = false; | 356 | private bool m_clampPrimSize = false; |
357 | private int m_objectCapacity = 0; | 357 | private int m_objectCapacity = 0; |
358 | private string m_regionType = String.Empty; | 358 | private string m_regionType = String.Empty; |
359 | private RegionMeta7WindlightData m_windlight = new RegionMeta7WindlightData(); | 359 | private RegionLightShareData m_windlight = new RegionLightShareData(); |
360 | protected uint m_httpPort; | 360 | protected uint m_httpPort; |
361 | protected string m_serverURI; | 361 | protected string m_serverURI; |
362 | protected string m_regionName = String.Empty; | 362 | protected string m_regionName = String.Empty; |
@@ -495,13 +495,13 @@ namespace OpenSim.Framework | |||
495 | set { m_regionSettings = value; } | 495 | set { m_regionSettings = value; } |
496 | } | 496 | } |
497 | 497 | ||
498 | public RegionMeta7WindlightData WindlightSettings | 498 | public RegionLightShareData WindlightSettings |
499 | { | 499 | { |
500 | get | 500 | get |
501 | { | 501 | { |
502 | if (m_windlight == null) | 502 | if (m_windlight == null) |
503 | { | 503 | { |
504 | m_windlight = new RegionMeta7WindlightData(); | 504 | m_windlight = new RegionLightShareData(); |
505 | } | 505 | } |
506 | 506 | ||
507 | return m_windlight; | 507 | return m_windlight; |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index b6afac6..7f6a0ad 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1532,7 +1532,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1532 | private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) | 1532 | private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) |
1533 | { | 1533 | { |
1534 | ScenePresence SP; | 1534 | ScenePresence SP; |
1535 | ((Scene)client.Scene).TryGetAvatar(client.AgentId, out SP); | 1535 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP); |
1536 | List<SceneObjectGroup> returns = new List<SceneObjectGroup>(); | 1536 | List<SceneObjectGroup> returns = new List<SceneObjectGroup>(); |
1537 | if (SP.GodLevel != 0) | 1537 | if (SP.GodLevel != 0) |
1538 | { | 1538 | { |
@@ -1597,9 +1597,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1597 | public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | 1597 | public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) |
1598 | { | 1598 | { |
1599 | ScenePresence targetAvatar = null; | 1599 | ScenePresence targetAvatar = null; |
1600 | ((Scene)client.Scene).TryGetAvatar(target, out targetAvatar); | 1600 | ((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar); |
1601 | ScenePresence parcelManager = null; | 1601 | ScenePresence parcelManager = null; |
1602 | ((Scene)client.Scene).TryGetAvatar(client.AgentId, out parcelManager); | 1602 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager); |
1603 | System.Threading.Timer Timer; | 1603 | System.Threading.Timer Timer; |
1604 | 1604 | ||
1605 | if (targetAvatar.GodLevel == 0) | 1605 | if (targetAvatar.GodLevel == 0) |
@@ -1641,9 +1641,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1641 | public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | 1641 | public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) |
1642 | { | 1642 | { |
1643 | ScenePresence targetAvatar = null; | 1643 | ScenePresence targetAvatar = null; |
1644 | ((Scene)client.Scene).TryGetAvatar(target, out targetAvatar); | 1644 | ((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar); |
1645 | ScenePresence parcelManager = null; | 1645 | ScenePresence parcelManager = null; |
1646 | ((Scene)client.Scene).TryGetAvatar(client.AgentId, out parcelManager); | 1646 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager); |
1647 | //Just eject | 1647 | //Just eject |
1648 | if (flags == 0) | 1648 | if (flags == 0) |
1649 | { | 1649 | { |
diff --git a/OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs b/OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs deleted file mode 100644 index 72b0b38..0000000 --- a/OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs +++ /dev/null | |||
@@ -1,274 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Thomas Grimshaw and Magne Metaverse Research | ||
3 | * | ||
4 | * This module is not open source. All rights reserved. | ||
5 | * Unauthorised copying, distribution or public display is prohibited. | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | using System; | ||
10 | using System.Collections.Generic; | ||
11 | using System.IO; | ||
12 | using System.Reflection; | ||
13 | using OpenMetaverse; | ||
14 | using log4net; | ||
15 | using Nini.Config; | ||
16 | using OpenSim.Data; | ||
17 | using OpenSim.Framework; | ||
18 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; | ||
19 | using OpenSim.Region.Framework.Interfaces; | ||
20 | using OpenSim.Region.Framework.Scenes; | ||
21 | |||
22 | |||
23 | namespace OpenSim.Region.CoreModules.World.Meta7Windlight | ||
24 | { | ||
25 | public class Meta7WindlightModule : IRegionModule, ICommandableModule | ||
26 | { | ||
27 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
28 | private readonly Commander m_commander = new Commander("windlight"); | ||
29 | private Scene m_scene; | ||
30 | private static bool m_enableWindlight; | ||
31 | |||
32 | #region ICommandableModule Members | ||
33 | |||
34 | public ICommander CommandInterface | ||
35 | { | ||
36 | get { return m_commander; } | ||
37 | } | ||
38 | |||
39 | #endregion | ||
40 | |||
41 | #region IRegionModule Members | ||
42 | |||
43 | public static bool EnableWindlight | ||
44 | { | ||
45 | get | ||
46 | { | ||
47 | return m_enableWindlight; | ||
48 | } | ||
49 | set | ||
50 | { | ||
51 | } | ||
52 | } | ||
53 | |||
54 | public void Initialise(Scene scene, IConfigSource config) | ||
55 | { | ||
56 | m_scene = scene; | ||
57 | m_scene.RegisterModuleInterface<IRegionModule>(this); | ||
58 | m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; | ||
59 | |||
60 | // ini file settings | ||
61 | try | ||
62 | { | ||
63 | m_enableWindlight = config.Configs["Meta7Windlight"].GetBoolean("enable_windlight", false); | ||
64 | } | ||
65 | catch (Exception) | ||
66 | { | ||
67 | m_log.Debug("[WINDLIGHT]: ini failure for enable_windlight - using default"); | ||
68 | } | ||
69 | |||
70 | if (m_enableWindlight) | ||
71 | { | ||
72 | m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent; | ||
73 | m_scene.EventManager.OnSaveNewWindlightProfile += EventManager_OnSaveNewWindlightProfile; | ||
74 | m_scene.EventManager.OnSendNewWindlightProfileTargeted += EventManager_OnSendNewWindlightProfileTargeted; | ||
75 | } | ||
76 | |||
77 | InstallCommands(); | ||
78 | |||
79 | m_log.Debug("[WINDLIGHT]: Initialised windlight module"); | ||
80 | } | ||
81 | |||
82 | private List<byte[]> compileWindlightSettings(RegionMeta7WindlightData wl) | ||
83 | { | ||
84 | byte[] mBlock = new Byte[249]; | ||
85 | int pos = 0; | ||
86 | |||
87 | wl.waterColor.ToBytes(mBlock, 0); pos += 12; | ||
88 | Utils.FloatToBytes(wl.waterFogDensityExponent).CopyTo(mBlock, pos); pos += 4; | ||
89 | Utils.FloatToBytes(wl.underwaterFogModifier).CopyTo(mBlock, pos); pos += 4; | ||
90 | wl.reflectionWaveletScale.ToBytes(mBlock, pos); pos += 12; | ||
91 | Utils.FloatToBytes(wl.fresnelScale).CopyTo(mBlock, pos); pos += 4; | ||
92 | Utils.FloatToBytes(wl.fresnelOffset).CopyTo(mBlock, pos); pos += 4; | ||
93 | Utils.FloatToBytes(wl.refractScaleAbove).CopyTo(mBlock, pos); pos += 4; | ||
94 | Utils.FloatToBytes(wl.refractScaleBelow).CopyTo(mBlock, pos); pos += 4; | ||
95 | Utils.FloatToBytes(wl.blurMultiplier).CopyTo(mBlock, pos); pos += 4; | ||
96 | wl.bigWaveDirection.ToBytes(mBlock, pos); pos += 8; | ||
97 | wl.littleWaveDirection.ToBytes(mBlock, pos); pos += 8; | ||
98 | wl.normalMapTexture.ToBytes(mBlock, pos); pos += 16; | ||
99 | wl.horizon.ToBytes(mBlock, pos); pos += 16; | ||
100 | Utils.FloatToBytes(wl.hazeHorizon).CopyTo(mBlock, pos); pos += 4; | ||
101 | wl.blueDensity.ToBytes(mBlock, pos); pos += 16; | ||
102 | Utils.FloatToBytes(wl.hazeDensity).CopyTo(mBlock, pos); pos += 4; | ||
103 | Utils.FloatToBytes(wl.densityMultiplier).CopyTo(mBlock, pos); pos += 4; | ||
104 | Utils.FloatToBytes(wl.distanceMultiplier).CopyTo(mBlock, pos); pos += 4; | ||
105 | wl.sunMoonColor.ToBytes(mBlock, pos); pos += 16; | ||
106 | Utils.FloatToBytes(wl.sunMoonPosition).CopyTo(mBlock, pos); pos += 4; | ||
107 | wl.ambient.ToBytes(mBlock, pos); pos += 16; | ||
108 | Utils.FloatToBytes(wl.eastAngle).CopyTo(mBlock, pos); pos += 4; | ||
109 | Utils.FloatToBytes(wl.sunGlowFocus).CopyTo(mBlock, pos); pos += 4; | ||
110 | Utils.FloatToBytes(wl.sunGlowSize).CopyTo(mBlock, pos); pos += 4; | ||
111 | Utils.FloatToBytes(wl.sceneGamma).CopyTo(mBlock, pos); pos += 4; | ||
112 | Utils.FloatToBytes(wl.starBrightness).CopyTo(mBlock, pos); pos += 4; | ||
113 | wl.cloudColor.ToBytes(mBlock, pos); pos += 16; | ||
114 | wl.cloudXYDensity.ToBytes(mBlock, pos); pos += 12; | ||
115 | Utils.FloatToBytes(wl.cloudCoverage).CopyTo(mBlock, pos); pos += 4; | ||
116 | Utils.FloatToBytes(wl.cloudScale).CopyTo(mBlock, pos); pos += 4; | ||
117 | wl.cloudDetailXYDensity.ToBytes(mBlock, pos); pos += 12; | ||
118 | Utils.FloatToBytes(wl.cloudScrollX).CopyTo(mBlock, pos); pos += 4; | ||
119 | Utils.FloatToBytes(wl.cloudScrollY).CopyTo(mBlock, pos); pos += 4; | ||
120 | Utils.UInt16ToBytes(wl.maxAltitude).CopyTo(mBlock, pos); pos += 2; | ||
121 | mBlock[pos] = Convert.ToByte(wl.cloudScrollXLock); pos++; | ||
122 | mBlock[pos] = Convert.ToByte(wl.cloudScrollYLock); pos++; | ||
123 | mBlock[pos] = Convert.ToByte(wl.drawClassicClouds); pos++; | ||
124 | List<byte[]> param = new List<byte[]>(); | ||
125 | param.Add(mBlock); | ||
126 | return param; | ||
127 | } | ||
128 | public void SendProfileToClient(ScenePresence presence) | ||
129 | { | ||
130 | IClientAPI client = presence.ControllingClient; | ||
131 | if (m_enableWindlight) | ||
132 | { | ||
133 | if (presence.IsChildAgent == false) | ||
134 | { | ||
135 | List<byte[]> param = compileWindlightSettings(m_scene.RegionInfo.WindlightSettings); | ||
136 | client.SendGenericMessage("Windlight", param); | ||
137 | } | ||
138 | } | ||
139 | else | ||
140 | { | ||
141 | //We probably don't want to spam chat with this.. probably | ||
142 | //m_log.Debug("[WINDLIGHT]: Module disabled"); | ||
143 | } | ||
144 | } | ||
145 | public void SendProfileToClient(ScenePresence presence, RegionMeta7WindlightData wl) | ||
146 | { | ||
147 | IClientAPI client = presence.ControllingClient; | ||
148 | if (m_enableWindlight) | ||
149 | { | ||
150 | if (presence.IsChildAgent == false) | ||
151 | { | ||
152 | List<byte[]> param = compileWindlightSettings(wl); | ||
153 | client.SendGenericMessage("Windlight", param); | ||
154 | } | ||
155 | } | ||
156 | else | ||
157 | { | ||
158 | //We probably don't want to spam chat with this.. probably | ||
159 | //m_log.Debug("[WINDLIGHT]: Module disabled"); | ||
160 | } | ||
161 | } | ||
162 | private void EventManager_OnMakeRootAgent(ScenePresence presence) | ||
163 | { | ||
164 | m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client"); | ||
165 | SendProfileToClient(presence); | ||
166 | } | ||
167 | private void EventManager_OnSendNewWindlightProfileTargeted(RegionMeta7WindlightData wl, UUID pUUID) | ||
168 | { | ||
169 | ScenePresence Sc; | ||
170 | if (m_scene.TryGetAvatar(pUUID,out Sc)) | ||
171 | { | ||
172 | SendProfileToClient(Sc,wl); | ||
173 | } | ||
174 | } | ||
175 | private void EventManager_OnSaveNewWindlightProfile() | ||
176 | { | ||
177 | m_scene.ForEachScenePresence(SendProfileToClient); | ||
178 | } | ||
179 | |||
180 | public void PostInitialise() | ||
181 | { | ||
182 | |||
183 | } | ||
184 | |||
185 | public void Close() | ||
186 | { | ||
187 | } | ||
188 | |||
189 | public string Name | ||
190 | { | ||
191 | get { return "Meta7WindlightModule"; } | ||
192 | } | ||
193 | |||
194 | public bool IsSharedModule | ||
195 | { | ||
196 | get { return false; } | ||
197 | } | ||
198 | |||
199 | #endregion | ||
200 | |||
201 | #region events | ||
202 | |||
203 | #endregion | ||
204 | |||
205 | #region ICommandableModule Members | ||
206 | |||
207 | private void InstallCommands() | ||
208 | { | ||
209 | Command wlload = new Command("load", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleLoad, "Load windlight profile from the database and broadcast"); | ||
210 | Command wlenable = new Command("enable", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleEnable, "Enable the windlight plugin"); | ||
211 | Command wldisable = new Command("disable", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleDisable, "Enable the windlight plugin"); | ||
212 | |||
213 | m_commander.RegisterCommand("load", wlload); | ||
214 | m_commander.RegisterCommand("enable", wlenable); | ||
215 | m_commander.RegisterCommand("disable", wldisable); | ||
216 | |||
217 | m_scene.RegisterModuleCommander(m_commander); | ||
218 | } | ||
219 | |||
220 | private void HandleLoad(Object[] args) | ||
221 | { | ||
222 | if (!m_enableWindlight) | ||
223 | { | ||
224 | m_log.InfoFormat("[WINDLIGHT]: Cannot load windlight profile, module disabled. Use 'windlight enable' first."); | ||
225 | } | ||
226 | else | ||
227 | { | ||
228 | m_log.InfoFormat("[WINDLIGHT]: Loading Windlight profile from database"); | ||
229 | m_scene.LoadWindlightProfile(); | ||
230 | m_log.InfoFormat("[WINDLIGHT]: Load complete"); | ||
231 | } | ||
232 | } | ||
233 | |||
234 | private void HandleDisable(Object[] args) | ||
235 | { | ||
236 | m_log.InfoFormat("[WINDLIGHT]: Plugin now disabled"); | ||
237 | m_enableWindlight=false; | ||
238 | } | ||
239 | |||
240 | private void HandleEnable(Object[] args) | ||
241 | { | ||
242 | m_log.InfoFormat("[WINDLIGHT]: Plugin now enabled"); | ||
243 | m_enableWindlight = true; | ||
244 | } | ||
245 | |||
246 | /// <summary> | ||
247 | /// Processes commandline input. Do not call directly. | ||
248 | /// </summary> | ||
249 | /// <param name="args">Commandline arguments</param> | ||
250 | private void EventManager_OnPluginConsole(string[] args) | ||
251 | { | ||
252 | if (args[0] == "windlight") | ||
253 | { | ||
254 | if (args.Length == 1) | ||
255 | { | ||
256 | m_commander.ProcessConsoleCommand("add", new string[0]); | ||
257 | return; | ||
258 | } | ||
259 | |||
260 | string[] tmpArgs = new string[args.Length - 2]; | ||
261 | int i; | ||
262 | for (i = 2; i < args.Length; i++) | ||
263 | { | ||
264 | tmpArgs[i - 2] = args[i]; | ||
265 | } | ||
266 | |||
267 | m_commander.ProcessConsoleCommand(args[1], tmpArgs); | ||
268 | } | ||
269 | } | ||
270 | #endregion | ||
271 | |||
272 | } | ||
273 | } | ||
274 | |||
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs index 7312799..3e8e196 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs | |||
@@ -103,8 +103,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
103 | 103 | ||
104 | void StoreRegionSettings(RegionSettings rs); | 104 | void StoreRegionSettings(RegionSettings rs); |
105 | RegionSettings LoadRegionSettings(UUID regionUUID); | 105 | RegionSettings LoadRegionSettings(UUID regionUUID); |
106 | RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID); | 106 | RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); |
107 | void StoreRegionWindlightSettings(RegionMeta7WindlightData wl); | 107 | void StoreRegionWindlightSettings(RegionLightShareData wl); |
108 | 108 | ||
109 | void Shutdown(); | 109 | void Shutdown(); |
110 | } | 110 | } |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 37a51d9..ef125cd 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -207,7 +207,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
207 | 207 | ||
208 | public delegate void OnMakeRootAgentDelegate(ScenePresence presence); | 208 | public delegate void OnMakeRootAgentDelegate(ScenePresence presence); |
209 | public delegate void OnSaveNewWindlightProfileDelegate(); | 209 | public delegate void OnSaveNewWindlightProfileDelegate(); |
210 | public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionMeta7WindlightData wl, UUID user); | 210 | public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user); |
211 | public event OnMakeRootAgentDelegate OnMakeRootAgent; | 211 | public event OnMakeRootAgentDelegate OnMakeRootAgent; |
212 | public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted; | 212 | public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted; |
213 | public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile; | 213 | public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile; |
@@ -1220,7 +1220,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1220 | } | 1220 | } |
1221 | } | 1221 | } |
1222 | 1222 | ||
1223 | public void TriggerOnSendNewWindlightProfileTargeted(RegionMeta7WindlightData wl, UUID user) | 1223 | public void TriggerOnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID user) |
1224 | { | 1224 | { |
1225 | OnSendNewWindlightProfileTargetedDelegate handlerSendNewWindlightProfileTargeted = OnSendNewWindlightProfileTargeted; | 1225 | OnSendNewWindlightProfileTargetedDelegate handlerSendNewWindlightProfileTargeted = OnSendNewWindlightProfileTargeted; |
1226 | if (handlerSendNewWindlightProfileTargeted != null) | 1226 | if (handlerSendNewWindlightProfileTargeted != null) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2b6f80b..1f604c5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1729,7 +1729,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1729 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); | 1729 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); |
1730 | } | 1730 | } |
1731 | 1731 | ||
1732 | public void StoreWindlightProfile(RegionMeta7WindlightData wl) | 1732 | public void StoreWindlightProfile(RegionLightShareData wl) |
1733 | { | 1733 | { |
1734 | m_regInfo.WindlightSettings = wl; | 1734 | m_regInfo.WindlightSettings = wl; |
1735 | m_storageManager.DataStore.StoreRegionWindlightSettings(wl); | 1735 | m_storageManager.DataStore.StoreRegionWindlightSettings(wl); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3895d93..7ed29a5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1370,21 +1370,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1370 | { | 1370 | { |
1371 | // part.Inventory.RemoveScriptInstances(); | 1371 | // part.Inventory.RemoveScriptInstances(); |
1372 | 1372 | ||
1373 | List<ScenePresence> avatars = Scene.GetScenePresences(); | 1373 | Scene.ForEachScenePresence(delegate (ScenePresence sp) |
1374 | for (int i = 0; i < avatars.Count; i++) | ||
1375 | { | 1374 | { |
1376 | if (avatars[i].ParentID == LocalId) | 1375 | if (sp.ParentID == LocalId) |
1377 | { | 1376 | { |
1378 | avatars[i].StandUp(); | 1377 | sp.StandUp(); |
1379 | } | 1378 | } |
1380 | 1379 | ||
1381 | if (!silent) | 1380 | if (!silent) |
1382 | { | 1381 | { |
1383 | part.UpdateFlag = 0; | 1382 | part.UpdateFlag = 0; |
1384 | if (part == m_rootPart) | 1383 | if (part == m_rootPart) |
1385 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | 1384 | sp.ControllingClient.SendKillObject(m_regionHandle, part.LocalId); |
1386 | } | 1385 | } |
1387 | } | 1386 | }); |
1388 | 1387 | ||
1389 | } | 1388 | } |
1390 | 1389 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs index 68035ca..8b2d387 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | |||
@@ -101,13 +101,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
101 | { | 101 | { |
102 | throw new NotImplementedException(); | 102 | throw new NotImplementedException(); |
103 | } | 103 | } |
104 | public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) | 104 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) |
105 | { | 105 | { |
106 | //This connector doesn't support the windlight module yet | 106 | //This connector doesn't support the windlight module yet |
107 | //Return default LL windlight settings | 107 | //Return default LL windlight settings |
108 | return new RegionMeta7WindlightData(); | 108 | return new RegionLightShareData(); |
109 | } | 109 | } |
110 | public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) | 110 | public void StoreRegionWindlightSettings(RegionLightShareData wl) |
111 | { | 111 | { |
112 | //This connector doesn't support the windlight module yet | 112 | //This connector doesn't support the windlight module yet |
113 | } | 113 | } |
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; | |||
7 | using Nini.Config; | 7 | using Nini.Config; |
8 | using OpenSim; | 8 | using OpenSim; |
9 | using OpenSim.Framework; | 9 | using OpenSim.Framework; |
10 | using OpenSim.Region.CoreModules.World.Meta7Windlight; | 10 | using OpenSim.Region.CoreModules.World.LightShare; |
11 | using OpenSim.Region.Framework.Interfaces; | 11 | using OpenSim.Region.Framework.Interfaces; |
12 | using OpenSim.Region.Framework.Scenes; | 12 | using OpenSim.Region.Framework.Scenes; |
13 | using OpenSim.Region.ScriptEngine.Shared; | 13 | using 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 | } |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index d660f36..9b0c09b 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -771,7 +771,7 @@ | |||
771 | ; default is 1000 | 771 | ; default is 1000 |
772 | cloud_update_rate = 1000 | 772 | cloud_update_rate = 1000 |
773 | 773 | ||
774 | [Meta7Windlight] | 774 | [LightShare] |
775 | 775 | ||
776 | ; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer. | 776 | ; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer. |
777 | ; It has no ill effect on viewers which do not support server-side windlight settings. | 777 | ; It has no ill effect on viewers which do not support server-side windlight settings. |