aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs (renamed from OpenSim/Region/CoreModules/LightShare/EnvironmentModule.cs)20
-rw-r--r--OpenSim/Region/CoreModules/World/LightShare/LightShareModule.cs (renamed from OpenSim/Region/CoreModules/LightShare/LightShareModule.cs)122
-rw-r--r--OpenSim/Region/Framework/Interfaces/ILightShareModule.cs33
-rw-r--r--bin/OpenSimDefaults.ini10
4 files changed, 111 insertions, 74 deletions
diff --git a/OpenSim/Region/CoreModules/LightShare/EnvironmentModule.cs b/OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs
index 1526886..c3cea7a 100644
--- a/OpenSim/Region/CoreModules/LightShare/EnvironmentModule.cs
+++ b/OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs
@@ -51,10 +51,10 @@ namespace OpenSim.Region.CoreModules.World.LightShare
51 private Scene m_scene = null; 51 private Scene m_scene = null;
52 private UUID regionID = UUID.Zero; 52 private UUID regionID = UUID.Zero;
53 private static bool Enabled = false; 53 private static bool Enabled = false;
54 54
55 private static readonly string capsName = "EnvironmentSettings"; 55 private static readonly string capsName = "EnvironmentSettings";
56 private static readonly string capsBase = "/CAPS/0020/"; 56 private static readonly string capsBase = "/CAPS/0020/";
57 57
58 private LLSDEnvironmentSetResponse setResponse = null; 58 private LLSDEnvironmentSetResponse setResponse = null;
59 59
60 #region INonSharedRegionModule 60 #region INonSharedRegionModule
@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
72 } 72 }
73 73
74 Enabled = true; 74 Enabled = true;
75 75
76 m_log.InfoFormat("[{0}]: Module is enabled.", Name); 76 m_log.InfoFormat("[{0}]: Module is enabled.", Name);
77 } 77 }
78 78
@@ -132,8 +132,8 @@ namespace OpenSim.Region.CoreModules.World.LightShare
132 #region Events 132 #region Events
133 private void OnRegisterCaps(UUID agentID, Caps caps) 133 private void OnRegisterCaps(UUID agentID, Caps caps)
134 { 134 {
135// m_log.DebugFormat("[{0}]: Register capability for agentID {1} in region {2}", 135 // m_log.DebugFormat("[{0}]: Register capability for agentID {1} in region {2}",
136// Name, agentID, caps.RegionName); 136 // Name, agentID, caps.RegionName);
137 137
138 string capsPath = capsBase + UUID.Random(); 138 string capsPath = capsBase + UUID.Random();
139 139
@@ -163,8 +163,8 @@ namespace OpenSim.Region.CoreModules.World.LightShare
163 private string GetEnvironmentSettings(string request, string path, string param, 163 private string GetEnvironmentSettings(string request, string path, string param,
164 UUID agentID, Caps caps) 164 UUID agentID, Caps caps)
165 { 165 {
166// m_log.DebugFormat("[{0}]: Environment GET handle for agentID {1} in region {2}", 166 // m_log.DebugFormat("[{0}]: Environment GET handle for agentID {1} in region {2}",
167// Name, agentID, caps.RegionName); 167 // Name, agentID, caps.RegionName);
168 168
169 string env = String.Empty; 169 string env = String.Empty;
170 170
@@ -188,8 +188,8 @@ namespace OpenSim.Region.CoreModules.World.LightShare
188 UUID agentID, Caps caps) 188 UUID agentID, Caps caps)
189 { 189 {
190 190
191// m_log.DebugFormat("[{0}]: Environment SET handle from agentID {1} in region {2}", 191 // m_log.DebugFormat("[{0}]: Environment SET handle from agentID {1} in region {2}",
192// Name, agentID, caps.RegionName); 192 // Name, agentID, caps.RegionName);
193 193
194 setResponse.regionID = regionID; 194 setResponse.regionID = regionID;
195 setResponse.success = false; 195 setResponse.success = false;
@@ -204,7 +204,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
204 { 204 {
205 m_scene.SimulationDataService.StoreRegionEnvironmentSettings(regionID, request); 205 m_scene.SimulationDataService.StoreRegionEnvironmentSettings(regionID, request);
206 setResponse.success = true; 206 setResponse.success = true;
207 207
208 m_log.InfoFormat("[{0}]: New Environment settings has been saved from agentID {1} in region {2}", 208 m_log.InfoFormat("[{0}]: New Environment settings has been saved from agentID {1} in region {2}",
209 Name, agentID, caps.RegionName); 209 Name, agentID, caps.RegionName);
210 } 210 }
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/World/LightShare/LightShareModule.cs
index f524490..1fcddd2 100644
--- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
+++ b/OpenSim/Region/CoreModules/World/LightShare/LightShareModule.cs
@@ -27,21 +27,20 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO;
31using System.Reflection; 30using System.Reflection;
32using OpenMetaverse; 31using OpenMetaverse;
33using log4net;
34using Nini.Config;
35using OpenSim.Data;
36using OpenSim.Framework; 32using OpenSim.Framework;
37using OpenSim.Region.CoreModules.Framework.InterfaceCommander; 33using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
38using OpenSim.Region.Framework.Interfaces; 34using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
40 36using log4net;
37using Nini.Config;
38using Mono.Addins;
41 39
42namespace OpenSim.Region.CoreModules.World.LightShare 40namespace OpenSim.Region.CoreModules.World.LightShare
43{ 41{
44 public class LightShareModule : IRegionModule, ICommandableModule 42 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
43 public class LightShareModule : INonSharedRegionModule, ILightShareModule, ICommandableModule
45 { 44 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 private readonly Commander m_commander = new Commander("windlight"); 46 private readonly Commander m_commander = new Commander("windlight");
@@ -57,48 +56,86 @@ namespace OpenSim.Region.CoreModules.World.LightShare
57 56
58 #endregion 57 #endregion
59 58
60 #region IRegionModule Members 59 #region INonSharedRegionModule Members
61 60
62 public static bool EnableWindlight 61 public void Initialise(IConfigSource config)
63 { 62 {
64 get 63 try
65 { 64 {
66 return m_enableWindlight; 65 m_enableWindlight = config.Configs["LightShare"].GetBoolean("enable_windlight", false);
67 } 66 }
68 set 67 catch (Exception)
69 { 68 {
69 m_log.Debug("[WINDLIGHT]: ini failure for enable_windlight - using default");
70 } 70 }
71
72 m_log.DebugFormat("[WINDLIGHT]: windlight module {0}", (m_enableWindlight ? "enabled" : "disabled"));
71 } 73 }
72 74
73 public void Initialise(Scene scene, IConfigSource config) 75 public void AddRegion(Scene scene)
74 { 76 {
77 if (!m_enableWindlight)
78 return;
79
75 m_scene = scene; 80 m_scene = scene;
76 m_scene.RegisterModuleInterface<IRegionModule>(this); 81 m_scene.RegisterModuleInterface<ILightShareModule>(this);
77 m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; 82 m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
78 83
79 // ini file settings 84 m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent;
80 try 85 m_scene.EventManager.OnSaveNewWindlightProfile += EventManager_OnSaveNewWindlightProfile;
81 { 86 m_scene.EventManager.OnSendNewWindlightProfileTargeted += EventManager_OnSendNewWindlightProfileTargeted;
82 m_enableWindlight = config.Configs["LightShare"].GetBoolean("enable_windlight", false); 87 m_scene.LoadWindlightProfile();
83 } 88
84 catch (Exception) 89 InstallCommands();
90 }
91
92 public void RemoveRegion(Scene scene)
93 {
94 if (!m_enableWindlight)
95 return;
96
97 m_scene.EventManager.OnPluginConsole -= EventManager_OnPluginConsole;
98
99 m_scene.EventManager.OnMakeRootAgent -= EventManager_OnMakeRootAgent;
100 m_scene.EventManager.OnSaveNewWindlightProfile -= EventManager_OnSaveNewWindlightProfile;
101 m_scene.EventManager.OnSendNewWindlightProfileTargeted -= EventManager_OnSendNewWindlightProfileTargeted;
102
103 m_scene = null;
104 }
105
106 public void Close()
107 {
108 }
109
110 public string Name
111 {
112 get { return "LightShareModule"; }
113 }
114
115 public void RegionLoaded(Scene scene)
116 {
117 }
118
119 public Type ReplaceableInterface
120 {
121 get { return null; }
122 }
123
124 #endregion
125
126 public static bool EnableWindlight
127 {
128 get
85 { 129 {
86 m_log.Debug("[WINDLIGHT]: ini failure for enable_windlight - using default"); 130 return m_enableWindlight;
87 } 131 }
88 132 set
89 if (m_enableWindlight)
90 { 133 {
91 m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent;
92 m_scene.EventManager.OnSaveNewWindlightProfile += EventManager_OnSaveNewWindlightProfile;
93 m_scene.EventManager.OnSendNewWindlightProfileTargeted += EventManager_OnSendNewWindlightProfileTargeted;
94 m_scene.LoadWindlightProfile();
95 } 134 }
96
97 InstallCommands();
98
99 m_log.Debug("[WINDLIGHT]: Initialised windlight module");
100 } 135 }
101 136
137 #region events
138
102 private List<byte[]> compileWindlightSettings(RegionLightShareData wl) 139 private List<byte[]> compileWindlightSettings(RegionLightShareData wl)
103 { 140 {
104 byte[] mBlock = new Byte[249]; 141 byte[] mBlock = new Byte[249];
@@ -190,29 +227,6 @@ namespace OpenSim.Region.CoreModules.World.LightShare
190 m_scene.ForEachRootClient(SendProfileToClient); 227 m_scene.ForEachRootClient(SendProfileToClient);
191 } 228 }
192 229
193 public void PostInitialise()
194 {
195
196 }
197
198 public void Close()
199 {
200 }
201
202 public string Name
203 {
204 get { return "LightShareModule"; }
205 }
206
207 public bool IsSharedModule
208 {
209 get { return false; }
210 }
211
212 #endregion
213
214 #region events
215
216 #endregion 230 #endregion
217 231
218 #region ICommandableModule Members 232 #region ICommandableModule Members
@@ -247,7 +261,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
247 private void HandleDisable(Object[] args) 261 private void HandleDisable(Object[] args)
248 { 262 {
249 m_log.InfoFormat("[WINDLIGHT]: Plugin now disabled"); 263 m_log.InfoFormat("[WINDLIGHT]: Plugin now disabled");
250 m_enableWindlight=false; 264 m_enableWindlight = false;
251 } 265 }
252 266
253 private void HandleEnable(Object[] args) 267 private void HandleEnable(Object[] args)
diff --git a/OpenSim/Region/Framework/Interfaces/ILightShareModule.cs b/OpenSim/Region/Framework/Interfaces/ILightShareModule.cs
new file mode 100644
index 0000000..b5fd24f
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/ILightShareModule.cs
@@ -0,0 +1,33 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28namespace OpenSim.Region.Framework.Interfaces
29{
30 public interface ILightShareModule
31 {
32 }
33} \ No newline at end of file
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 45682a0..16cde7e 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -1414,16 +1414,6 @@
1414 ; DeleteScriptsOnStartup = false 1414 ; DeleteScriptsOnStartup = false
1415 1415
1416 1416
1417[OpenGridProtocol]
1418 ;These are the settings for the Open Grid Protocol.. the Agent Domain, Region Domain, you know..
1419 ;On/true or Off/false
1420 ogp_enabled=false
1421
1422 ;Name Prefix/suffix when using OGP
1423 ogp_firstname_prefix=""
1424 ogp_lastname_suffix="_EXTERNAL"
1425
1426
1427[Concierge] 1417[Concierge]
1428 ; Enable concierge module 1418 ; Enable concierge module
1429 ; Default is false 1419 ; Default is false