aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs49
1 files changed, 46 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index cb05e8f..b5bdd46 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -40,8 +40,9 @@ using OpenSim.Framework;
40using OpenSim.Framework.Console; 40using OpenSim.Framework.Console;
41using OpenSim.Framework.Monitoring; 41using OpenSim.Framework.Monitoring;
42using OpenSim.Region.Framework.Scenes; 42using OpenSim.Region.Framework.Scenes;
43using OpenSim.Region.Framework.Interfaces;
43using OpenMetaverse; 44using OpenMetaverse;
44 45using Mono.Addins;
45using TokenBucket = OpenSim.Region.ClientStack.LindenUDP.TokenBucket; 46using TokenBucket = OpenSim.Region.ClientStack.LindenUDP.TokenBucket;
46 47
47namespace OpenSim.Region.ClientStack.LindenUDP 48namespace OpenSim.Region.ClientStack.LindenUDP
@@ -49,14 +50,55 @@ namespace OpenSim.Region.ClientStack.LindenUDP
49 /// <summary> 50 /// <summary>
50 /// A shim around LLUDPServer that implements the IClientNetworkServer interface 51 /// A shim around LLUDPServer that implements the IClientNetworkServer interface
51 /// </summary> 52 /// </summary>
52 public sealed class LLUDPServerShim : IClientNetworkServer 53 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LLUDPServerShim")]
54 public sealed class LLUDPServerShim : INonSharedRegionModule
53 { 55 {
56 private bool m_Enabled = true;
57 private IConfigSource m_Config;
54 LLUDPServer m_udpServer; 58 LLUDPServer m_udpServer;
55 59
56 public LLUDPServerShim() 60 #region INonSharedRegionModule
61 public string Name
62 {
63 get { return "LLUDPServerShim"; }
64 }
65
66 public Type ReplaceableInterface
67 {
68 get { return null; }
69 }
70
71 public void Initialise(IConfigSource source)
72 {
73 m_Config = source;
74 }
75
76 public void Close()
77 {
78 }
79
80 public void AddRegion(Scene scene)
57 { 81 {
82 uint port = (uint)scene.RegionInfo.InternalEndPoint.Port;
83
84 IPAddress listenIP = scene.RegionInfo.InternalEndPoint.Address;
85 Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, scene.RegionInfo.m_allow_alternate_ports, m_Config, scene.AuthenticateHandler);
86 scene.RegionInfo.InternalEndPoint.Port = (int)port;
87
88 AddScene(scene);
58 } 89 }
59 90
91 public void RemoveRegion(Scene scene)
92 {
93 Stop();
94 }
95
96 public void RegionLoaded(Scene scene)
97 {
98 Start();
99 }
100 #endregion
101
60 public void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) 102 public void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager)
61 { 103 {
62 m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager); 104 m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager);
@@ -200,6 +242,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
200 { 242 {
201 m_udpServer.Stop(); 243 m_udpServer.Stop();
202 } 244 }
245
203 } 246 }
204 247
205 /// <summary> 248 /// <summary>