aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDiva Canto2015-09-03 15:59:06 -0700
committerDiva Canto2015-09-03 15:59:06 -0700
commitdac8edd5dddb5f3d2a2447fb479144429e32ea68 (patch)
tree5a68dcaa0f4cd75c97d16abb0a3c0bcb65b49d51 /OpenSim/Region
parentMoved ExtendedPhysics from OptionalModules to Bullet project, because it's ve... (diff)
downloadopensim-SC-dac8edd5dddb5f3d2a2447fb479144429e32ea68.zip
opensim-SC-dac8edd5dddb5f3d2a2447fb479144429e32ea68.tar.gz
opensim-SC-dac8edd5dddb5f3d2a2447fb479144429e32ea68.tar.bz2
opensim-SC-dac8edd5dddb5f3d2a2447fb479144429e32ea68.tar.xz
Transformed the LLUDP ad-hoc plugin into a region module. It works.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimBackground.cs2
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs151
-rw-r--r--OpenSim/Region/Application/RegionApplicationBase.cs (renamed from OpenSim/Region/ClientStack/RegionApplicationBase.cs)5
-rw-r--r--OpenSim/Region/ClientStack/ClientStackManager.cs147
-rw-r--r--OpenSim/Region/ClientStack/IClientNetworkServer.cs59
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs49
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs3
7 files changed, 119 insertions, 297 deletions
diff --git a/OpenSim/Region/Application/OpenSimBackground.cs b/OpenSim/Region/Application/OpenSimBackground.cs
index 008c6b0..15d9065 100644
--- a/OpenSim/Region/Application/OpenSimBackground.cs
+++ b/OpenSim/Region/Application/OpenSimBackground.cs
@@ -55,7 +55,7 @@ namespace OpenSim
55 base.Startup(); 55 base.Startup();
56 56
57 m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", 57 m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}",
58 m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); 58 SceneManager.Scenes.Count, SceneManager.Scenes.Count > 1 ? "s" : "");
59 59
60 WorldHasComeToAnEnd.WaitOne(); 60 WorldHasComeToAnEnd.WaitOne();
61 WorldHasComeToAnEnd.Close(); 61 WorldHasComeToAnEnd.Close();
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 980fa85..6e984d8 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -41,7 +41,6 @@ using OpenSim.Framework.Console;
41using OpenSim.Framework.Servers; 41using OpenSim.Framework.Servers;
42using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
43using OpenSim.Framework.Monitoring; 43using OpenSim.Framework.Monitoring;
44using OpenSim.Region.ClientStack;
45using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; 44using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
46using OpenSim.Region.Framework; 45using OpenSim.Region.Framework;
47using OpenSim.Region.Framework.Interfaces; 46using OpenSim.Region.Framework.Interfaces;
@@ -117,19 +116,12 @@ namespace OpenSim
117 /// </value> 116 /// </value>
118 public OpenSimConfigSource ConfigSource { get; private set; } 117 public OpenSimConfigSource ConfigSource { get; private set; }
119 118
120 public List<IClientNetworkServer> ClientServers
121 {
122 get { return m_clientServers; }
123 }
124
125 protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource(); 119 protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource();
126 120
127 public EnvConfigSource envConfigSource 121 public EnvConfigSource envConfigSource
128 { 122 {
129 get { return m_EnvConfigSource; } 123 get { return m_EnvConfigSource; }
130 } 124 }
131
132 protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>();
133 125
134 public uint HttpServerPort 126 public uint HttpServerPort
135 { 127 {
@@ -359,9 +351,9 @@ namespace OpenSim
359 /// <param name="regionInfo"></param> 351 /// <param name="regionInfo"></param>
360 /// <param name="portadd_flag"></param> 352 /// <param name="portadd_flag"></param>
361 /// <returns></returns> 353 /// <returns></returns>
362 public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene) 354 public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene)
363 { 355 {
364 return CreateRegion(regionInfo, portadd_flag, false, out scene); 356 CreateRegion(regionInfo, portadd_flag, false, out scene);
365 } 357 }
366 358
367 /// <summary> 359 /// <summary>
@@ -369,9 +361,9 @@ namespace OpenSim
369 /// </summary> 361 /// </summary>
370 /// <param name="regionInfo"></param> 362 /// <param name="regionInfo"></param>
371 /// <returns></returns> 363 /// <returns></returns>
372 public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, out IScene scene) 364 public void CreateRegion(RegionInfo regionInfo, out IScene scene)
373 { 365 {
374 return CreateRegion(regionInfo, false, true, out scene); 366 CreateRegion(regionInfo, false, true, out scene);
375 } 367 }
376 368
377 /// <summary> 369 /// <summary>
@@ -381,7 +373,7 @@ namespace OpenSim
381 /// <param name="portadd_flag"></param> 373 /// <param name="portadd_flag"></param>
382 /// <param name="do_post_init"></param> 374 /// <param name="do_post_init"></param>
383 /// <returns></returns> 375 /// <returns></returns>
384 public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene) 376 public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene)
385 { 377 {
386 int port = regionInfo.InternalEndPoint.Port; 378 int port = regionInfo.InternalEndPoint.Port;
387 379
@@ -406,8 +398,7 @@ namespace OpenSim
406 Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); 398 Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName);
407 } 399 }
408 400
409 List<IClientNetworkServer> clientServers; 401 Scene scene = SetupScene(regionInfo, proxyOffset, Config);
410 Scene scene = SetupScene(regionInfo, proxyOffset, Config, out clientServers);
411 402
412 m_log.Info("[MODULES]: Loading Region's modules (old style)"); 403 m_log.Info("[MODULES]: Loading Region's modules (old style)");
413 404
@@ -455,20 +446,20 @@ namespace OpenSim
455 446
456 SceneManager.Add(scene); 447 SceneManager.Add(scene);
457 448
458 if (m_autoCreateClientStack) 449 //if (m_autoCreateClientStack)
459 { 450 //{
460 foreach (IClientNetworkServer clientserver in clientServers) 451 // foreach (IClientNetworkServer clientserver in clientServers)
461 { 452 // {
462 m_clientServers.Add(clientserver); 453 // m_clientServers.Add(clientserver);
463 clientserver.Start(); 454 // clientserver.Start();
464 } 455 // }
465 } 456 //}
466 457
467 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; 458 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
468 459
469 mscene = scene; 460 mscene = scene;
470 461
471 return clientServers; 462 //return clientServers;
472 } 463 }
473 464
474 /// <summary> 465 /// <summary>
@@ -602,7 +593,7 @@ namespace OpenSim
602 593
603 scene.DeleteAllSceneObjects(); 594 scene.DeleteAllSceneObjects();
604 SceneManager.CloseScene(scene); 595 SceneManager.CloseScene(scene);
605 ShutdownClientServer(scene.RegionInfo); 596 //ShutdownClientServer(scene.RegionInfo);
606 597
607 if (!cleanup) 598 if (!cleanup)
608 return; 599 return;
@@ -663,7 +654,7 @@ namespace OpenSim
663 } 654 }
664 655
665 SceneManager.CloseScene(scene); 656 SceneManager.CloseScene(scene);
666 ShutdownClientServer(scene.RegionInfo); 657 //ShutdownClientServer(scene.RegionInfo);
667 } 658 }
668 659
669 /// <summary> 660 /// <summary>
@@ -684,9 +675,9 @@ namespace OpenSim
684 /// <param name="regionInfo"></param> 675 /// <param name="regionInfo"></param>
685 /// <param name="clientServer"> </param> 676 /// <param name="clientServer"> </param>
686 /// <returns></returns> 677 /// <returns></returns>
687 protected Scene SetupScene(RegionInfo regionInfo, out List<IClientNetworkServer> clientServer) 678 protected Scene SetupScene(RegionInfo regionInfo)
688 { 679 {
689 return SetupScene(regionInfo, 0, null, out clientServer); 680 return SetupScene(regionInfo, 0, null);
690 } 681 }
691 682
692 /// <summary> 683 /// <summary>
@@ -697,51 +688,45 @@ namespace OpenSim
697 /// <param name="configSource"></param> 688 /// <param name="configSource"></param>
698 /// <param name="clientServer"> </param> 689 /// <param name="clientServer"> </param>
699 /// <returns></returns> 690 /// <returns></returns>
700 protected Scene SetupScene( 691 protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, IConfigSource configSource)
701 RegionInfo regionInfo, int proxyOffset, IConfigSource configSource, out List<IClientNetworkServer> clientServer)
702 { 692 {
703 List<IClientNetworkServer> clientNetworkServers = null; 693 //List<IClientNetworkServer> clientNetworkServers = null;
704 694
705 AgentCircuitManager circuitManager = new AgentCircuitManager(); 695 AgentCircuitManager circuitManager = new AgentCircuitManager();
706 IPAddress listenIP = regionInfo.InternalEndPoint.Address; 696 //IPAddress listenIP = regionInfo.InternalEndPoint.Address;
707 //if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP)) 697 ////if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP))
708 // listenIP = IPAddress.Parse("0.0.0.0"); 698 //// listenIP = IPAddress.Parse("0.0.0.0");
709 699
710 uint port = (uint) regionInfo.InternalEndPoint.Port; 700 //uint port = (uint) regionInfo.InternalEndPoint.Port;
711 701
712 if (m_autoCreateClientStack) 702 //if (m_autoCreateClientStack)
713 { 703 //{
714 clientNetworkServers = m_clientStackManager.CreateServers( 704 // clientNetworkServers = m_clientStackManager.CreateServers(
715 listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource, 705 // listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource,
716 circuitManager); 706 // circuitManager);
717 } 707 //}
718 else 708 //else
719 { 709 //{
720 clientServer = null; 710 // clientServer = null;
721 } 711 //}
722 712
723 regionInfo.InternalEndPoint.Port = (int) port; 713 //regionInfo.InternalEndPoint.Port = (int) port;
724 714
725 Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager); 715 Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager);
726 716
727 if (m_autoCreateClientStack) 717 //if (m_autoCreateClientStack)
728 { 718 //{
729 foreach (IClientNetworkServer clientnetserver in clientNetworkServers) 719 // foreach (IClientNetworkServer clientnetserver in clientNetworkServers)
730 { 720 // {
731 clientnetserver.AddScene(scene); 721 // clientnetserver.AddScene(scene);
732 } 722 // }
733 } 723 //}
734 clientServer = clientNetworkServers; 724 //clientServer = clientNetworkServers;
735 scene.LoadWorldMap(); 725 scene.LoadWorldMap();
736 726
737 return scene; 727 return scene;
738 } 728 }
739 729
740 protected override ClientStackManager CreateClientStackManager()
741 {
742 return new ClientStackManager(m_configSettings.ClientstackDll);
743 }
744
745 protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, 730 protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService,
746 IEstateDataService estateDataService, AgentCircuitManager circuitManager) 731 IEstateDataService estateDataService, AgentCircuitManager circuitManager)
747 { 732 {
@@ -751,29 +736,29 @@ namespace OpenSim
751 Config, m_version); 736 Config, m_version);
752 } 737 }
753 738
754 protected void ShutdownClientServer(RegionInfo whichRegion) 739 //protected void ShutdownClientServer(RegionInfo whichRegion)
755 { 740 //{
756 // Close and remove the clientserver for a region 741 // // Close and remove the clientserver for a region
757 bool foundClientServer = false; 742 // bool foundClientServer = false;
758 int clientServerElement = 0; 743 // int clientServerElement = 0;
759 Location location = new Location(whichRegion.RegionHandle); 744 // Location location = new Location(whichRegion.RegionHandle);
760 745
761 for (int i = 0; i < m_clientServers.Count; i++) 746 // for (int i = 0; i < m_clientServers.Count; i++)
762 { 747 // {
763 if (m_clientServers[i].HandlesRegion(location)) 748 // if (m_clientServers[i].HandlesRegion(location))
764 { 749 // {
765 clientServerElement = i; 750 // clientServerElement = i;
766 foundClientServer = true; 751 // foundClientServer = true;
767 break; 752 // break;
768 } 753 // }
769 } 754 // }
770 755
771 if (foundClientServer) 756 // if (foundClientServer)
772 { 757 // {
773 m_clientServers[clientServerElement].Stop(); 758 // m_clientServers[clientServerElement].Stop();
774 m_clientServers.RemoveAt(clientServerElement); 759 // m_clientServers.RemoveAt(clientServerElement);
775 } 760 // }
776 } 761 //}
777 762
778 protected virtual void HandleRestartRegion(RegionInfo whichRegion) 763 protected virtual void HandleRestartRegion(RegionInfo whichRegion)
779 { 764 {
@@ -781,7 +766,7 @@ namespace OpenSim
781 "[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})", 766 "[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})",
782 whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY); 767 whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY);
783 768
784 ShutdownClientServer(whichRegion); 769 //ShutdownClientServer(whichRegion);
785 IScene scene; 770 IScene scene;
786 CreateRegion(whichRegion, true, out scene); 771 CreateRegion(whichRegion, true, out scene);
787 scene.Start(); 772 scene.Start();
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs
index 343780b..b58c998 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/Application/RegionApplicationBase.cs
@@ -41,7 +41,7 @@ using OpenSim.Region.Framework.Scenes;
41using OpenSim.Region.PhysicsModules.SharedBase; 41using OpenSim.Region.PhysicsModules.SharedBase;
42using OpenSim.Services.Interfaces; 42using OpenSim.Services.Interfaces;
43 43
44namespace OpenSim.Region.ClientStack 44namespace OpenSim
45{ 45{
46 public abstract class RegionApplicationBase : BaseOpenSimServer 46 public abstract class RegionApplicationBase : BaseOpenSimServer
47 { 47 {
@@ -53,7 +53,6 @@ namespace OpenSim.Region.ClientStack
53 protected uint m_httpServerPort; 53 protected uint m_httpServerPort;
54 protected ISimulationDataService m_simulationDataService; 54 protected ISimulationDataService m_simulationDataService;
55 protected IEstateDataService m_estateDataService; 55 protected IEstateDataService m_estateDataService;
56 protected ClientStackManager m_clientStackManager;
57 56
58 public SceneManager SceneManager { get; protected set; } 57 public SceneManager SceneManager { get; protected set; }
59 public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } } 58 public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } }
@@ -62,13 +61,11 @@ namespace OpenSim.Region.ClientStack
62 61
63 protected abstract void Initialize(); 62 protected abstract void Initialize();
64 63
65 protected abstract ClientStackManager CreateClientStackManager();
66 protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager); 64 protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager);
67 65
68 protected override void StartupSpecific() 66 protected override void StartupSpecific()
69 { 67 {
70 SceneManager = SceneManager.Instance; 68 SceneManager = SceneManager.Instance;
71 m_clientStackManager = CreateClientStackManager();
72 69
73 Initialize(); 70 Initialize();
74 71
diff --git a/OpenSim/Region/ClientStack/ClientStackManager.cs b/OpenSim/Region/ClientStack/ClientStackManager.cs
deleted file mode 100644
index 3ec968f..0000000
--- a/OpenSim/Region/ClientStack/ClientStackManager.cs
+++ /dev/null
@@ -1,147 +0,0 @@
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
28using System;
29using System.Collections.Generic;
30using System.Net;
31using System.Reflection;
32using log4net;
33using Nini.Config;
34using OpenSim.Framework;
35
36namespace OpenSim.Region.ClientStack
37{
38 public class ClientStackManager
39 {
40 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41
42 private List<Type> plugin = new List<Type>();
43 private List<Assembly> pluginAssembly = new List<Assembly>();
44
45 public ClientStackManager(string pDllName)
46 {
47 List<string> clientstacks = new List<string>();
48 if (pDllName.Contains(","))
49 {
50 clientstacks = new List<string>(pDllName.Split(','));
51 }
52 else
53 {
54 clientstacks.Add(pDllName);
55 }
56 foreach (string dllName in clientstacks)
57 {
58 m_log.Info("[CLIENTSTACK]: Attempting to load " + dllName);
59
60 try
61 {
62 //plugin = null;
63 Assembly itemAssembly = Assembly.LoadFrom(dllName);
64 pluginAssembly.Add(itemAssembly);
65
66 foreach (Type pluginType in itemAssembly.GetTypes())
67 {
68 if (pluginType.IsPublic)
69 {
70 Type typeInterface = pluginType.GetInterface("IClientNetworkServer");
71
72 if (typeInterface != null)
73 {
74 m_log.Info("[CLIENTSTACK]: Added IClientNetworkServer Interface");
75 plugin.Add(pluginType);
76 break;
77 }
78 }
79 }
80 }
81 catch (ReflectionTypeLoadException e)
82 {
83 foreach (Exception e2 in e.LoaderExceptions)
84 {
85 m_log.Error(e2.ToString());
86 }
87 throw e;
88 }
89 }
90 }
91
92 /// <summary>
93 /// Create a server that can set up sessions for virtual world client <-> server communications
94 /// </summary>
95 /// <param name="_listenIP"></param>
96 /// <param name="port"></param>
97 /// <param name="proxyPortOffset"></param>
98 /// <param name="allow_alternate_port"></param>
99 /// <param name="assetCache"></param>
100 /// <param name="authenticateClass"></param>
101 /// <returns></returns>
102 public List<IClientNetworkServer> CreateServers(
103 IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port,
104 AgentCircuitManager authenticateClass)
105 {
106 return CreateServers(
107 _listenIP, ref port, proxyPortOffset, allow_alternate_port, null, authenticateClass);
108 }
109
110 /// <summary>
111 /// Create a server that can set up sessions for virtual world client <-> server communications
112 /// </summary>
113 /// <param name="_listenIP"></param>
114 /// <param name="port"></param>
115 /// <param name="proxyPortOffset"></param>
116 /// <param name="allow_alternate_port"></param>
117 /// <param name="configSource">
118 /// Can be null, in which case default values are used
119 /// </param>
120 /// <param name="assetCache"></param>
121 /// <param name="authenticateClass"></param>
122 /// <returns></returns>
123 public List<IClientNetworkServer> CreateServers(
124 IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IConfigSource configSource,
125 AgentCircuitManager authenticateClass)
126 {
127 List<IClientNetworkServer> servers = new List<IClientNetworkServer>();
128 if (plugin != null)
129 {
130 for (int i = 0; i < plugin.Count; i++)
131 {
132 IClientNetworkServer server =
133 (IClientNetworkServer) Activator.CreateInstance(pluginAssembly[i].GetType(plugin[i].ToString()));
134
135 server.Initialise(
136 _listenIP, ref port, proxyPortOffset, allow_alternate_port,
137 configSource, authenticateClass);
138 servers.Add(server);
139 }
140 return servers;
141 }
142
143 m_log.Error("[CLIENTSTACK]: Couldn't initialize a new server");
144 return null;
145 }
146 }
147}
diff --git a/OpenSim/Region/ClientStack/IClientNetworkServer.cs b/OpenSim/Region/ClientStack/IClientNetworkServer.cs
deleted file mode 100644
index bb7e6d0..0000000
--- a/OpenSim/Region/ClientStack/IClientNetworkServer.cs
+++ /dev/null
@@ -1,59 +0,0 @@
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
28using System.Net;
29using System.Net.Sockets;
30using Nini.Config;
31using OpenSim.Framework;
32
33namespace OpenSim.Region.ClientStack
34{
35 public interface IClientNetworkServer
36 {
37 void Initialise(
38 IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource,
39 AgentCircuitManager authenticateClass);
40
41 bool HandlesRegion(Location x);
42
43 /// <summary>
44 /// Add the given scene to be handled by this IClientNetworkServer.
45 /// </summary>
46 /// <param name='scene'></param>
47 void AddScene(IScene scene);
48
49 /// <summary>
50 /// Start sending and receiving data.
51 /// </summary>
52 void Start();
53
54 /// <summary>
55 /// Stop sending and receiving data.
56 /// </summary>
57 void Stop();
58 }
59}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 76be91a..4528714 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>
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs b/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs
index 8795c0c..a1ff69e 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs
@@ -1,6 +1,7 @@
1using System.Reflection; 1using System.Reflection;
2using System.Runtime.CompilerServices; 2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices; 3using System.Runtime.InteropServices;
4using Mono.Addins;
4 5
5// General Information about an assembly is controlled through the following 6// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information 7// set of attributes. Change these attribute values to modify the information
@@ -31,3 +32,5 @@ using System.Runtime.InteropServices;
31// 32//
32[assembly: AssemblyVersion("0.8.2.*")] 33[assembly: AssemblyVersion("0.8.2.*")]
33 34
35[assembly: Addin("LindenUDP", OpenSim.VersionInfo.VersionNumber)]
36[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]