aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Client/Linden/LLClientStackModule.cs81
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 @@
1using System;
2using System.Collections.Generic;
3using System.Reflection;
4using System.Text;
5using log4net;
6using Nini.Config;
7using OpenMetaverse;
8using OpenSim.Region.ClientStack;
9using OpenSim.Region.ClientStack.LindenUDP;
10using OpenSim.Framework;
11using OpenSim.Region.Framework.Scenes;
12using OpenSim.Region.Framework.Interfaces;
13
14namespace 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}