diff options
Added OpenSim.Client.Linden which is a (non shared) region module that creates and initialises the LindenClientStack (or actually whatever client stack was set in opensim.ini) for that region. Currently this module is still at a early stage so just for testing, so its hardcoded to be disabled. To enable first turn off auto creation of the client stack in opensimbase (see last revision) and then in OpenSim.Client.Linden.LLClientStackModule change bool m_createClientStack = false; to true.
Diffstat (limited to 'OpenSim/Client/Linden')
-rw-r--r-- | OpenSim/Client/Linden/LLClientStackModule.cs | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/OpenSim/Client/Linden/LLClientStackModule.cs b/OpenSim/Client/Linden/LLClientStackModule.cs new file mode 100644 index 0000000..57331e5 --- /dev/null +++ b/OpenSim/Client/Linden/LLClientStackModule.cs | |||
@@ -0,0 +1,81 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Reflection; | ||
4 | using System.Text; | ||
5 | using log4net; | ||
6 | using Nini.Config; | ||
7 | using OpenMetaverse; | ||
8 | using OpenSim.Region.ClientStack; | ||
9 | using OpenSim.Region.ClientStack.LindenUDP; | ||
10 | using OpenSim.Framework; | ||
11 | using OpenSim.Region.Framework.Scenes; | ||
12 | using OpenSim.Region.Framework.Interfaces; | ||
13 | |||
14 | namespace OpenSim.Client.Linden | ||
15 | { | ||
16 | public class LLClientStackModule : IRegionModule | ||
17 | { | ||
18 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
19 | |||
20 | #region IRegionModule Members | ||
21 | |||
22 | protected Scene m_scene; | ||
23 | protected bool m_createClientStack = false; | ||
24 | protected IClientNetworkServer m_clientServer; | ||
25 | protected ClientStackManager m_clientStackManager; | ||
26 | protected IConfigSource m_source; | ||
27 | |||
28 | protected string m_clientStackDll = "OpenSim.Region.ClientStack.LindenUDP.dll"; | ||
29 | |||
30 | public void Initialise(Scene scene, IConfigSource source) | ||
31 | { | ||
32 | if (m_scene == null) | ||
33 | { | ||
34 | m_scene = scene; | ||
35 | m_source = source; | ||
36 | |||
37 | IConfig startupConfig = m_source.Configs["Startup"]; | ||
38 | if (startupConfig != null) | ||
39 | { | ||
40 | m_clientStackDll = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); | ||
41 | } | ||
42 | } | ||
43 | } | ||
44 | |||
45 | public void PostInitialise() | ||
46 | { | ||
47 | if ((m_scene != null) && (m_createClientStack)) | ||
48 | { | ||
49 | m_log.Info("[LLClientStackModule] Starting up LLClientStack."); | ||
50 | uint port = (uint)m_scene.RegionInfo.InternalEndPoint.Port; | ||
51 | m_clientStackManager = new ClientStackManager(m_clientStackDll); | ||
52 | |||
53 | m_clientServer | ||
54 | = m_clientStackManager.CreateServer(m_scene.RegionInfo.InternalEndPoint.Address, | ||
55 | ref port, m_scene.RegionInfo.ProxyOffset, m_scene.RegionInfo.m_allow_alternate_ports, m_source, | ||
56 | m_scene.CommsManager.AssetCache, m_scene.AuthenticateHandler); | ||
57 | |||
58 | m_clientServer.AddScene(m_scene); | ||
59 | |||
60 | m_clientServer.Start(); | ||
61 | } | ||
62 | } | ||
63 | |||
64 | public void Close() | ||
65 | { | ||
66 | |||
67 | } | ||
68 | |||
69 | public string Name | ||
70 | { | ||
71 | get { return "LLClientStackModule"; } | ||
72 | } | ||
73 | |||
74 | public bool IsSharedModule | ||
75 | { | ||
76 | get { return false; } | ||
77 | } | ||
78 | |||
79 | #endregion | ||
80 | } | ||
81 | } | ||