Transformed the LLUDP ad-hoc plugin into a region module. It works.
parent
0235e58fff
commit
dac8edd5dd
|
@ -55,7 +55,7 @@ namespace OpenSim
|
|||
base.Startup();
|
||||
|
||||
m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}",
|
||||
m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : "");
|
||||
SceneManager.Scenes.Count, SceneManager.Scenes.Count > 1 ? "s" : "");
|
||||
|
||||
WorldHasComeToAnEnd.WaitOne();
|
||||
WorldHasComeToAnEnd.Close();
|
||||
|
|
|
@ -41,7 +41,6 @@ using OpenSim.Framework.Console;
|
|||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Framework.Monitoring;
|
||||
using OpenSim.Region.ClientStack;
|
||||
using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
|
||||
using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
@ -117,19 +116,12 @@ namespace OpenSim
|
|||
/// </value>
|
||||
public OpenSimConfigSource ConfigSource { get; private set; }
|
||||
|
||||
public List<IClientNetworkServer> ClientServers
|
||||
{
|
||||
get { return m_clientServers; }
|
||||
}
|
||||
|
||||
protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource();
|
||||
|
||||
public EnvConfigSource envConfigSource
|
||||
{
|
||||
get { return m_EnvConfigSource; }
|
||||
}
|
||||
|
||||
protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>();
|
||||
|
||||
public uint HttpServerPort
|
||||
{
|
||||
|
@ -359,9 +351,9 @@ namespace OpenSim
|
|||
/// <param name="regionInfo"></param>
|
||||
/// <param name="portadd_flag"></param>
|
||||
/// <returns></returns>
|
||||
public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene)
|
||||
public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene)
|
||||
{
|
||||
return CreateRegion(regionInfo, portadd_flag, false, out scene);
|
||||
CreateRegion(regionInfo, portadd_flag, false, out scene);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -369,9 +361,9 @@ namespace OpenSim
|
|||
/// </summary>
|
||||
/// <param name="regionInfo"></param>
|
||||
/// <returns></returns>
|
||||
public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, out IScene scene)
|
||||
public void CreateRegion(RegionInfo regionInfo, out IScene scene)
|
||||
{
|
||||
return CreateRegion(regionInfo, false, true, out scene);
|
||||
CreateRegion(regionInfo, false, true, out scene);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -381,7 +373,7 @@ namespace OpenSim
|
|||
/// <param name="portadd_flag"></param>
|
||||
/// <param name="do_post_init"></param>
|
||||
/// <returns></returns>
|
||||
public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene)
|
||||
public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene)
|
||||
{
|
||||
int port = regionInfo.InternalEndPoint.Port;
|
||||
|
||||
|
@ -406,8 +398,7 @@ namespace OpenSim
|
|||
Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName);
|
||||
}
|
||||
|
||||
List<IClientNetworkServer> clientServers;
|
||||
Scene scene = SetupScene(regionInfo, proxyOffset, Config, out clientServers);
|
||||
Scene scene = SetupScene(regionInfo, proxyOffset, Config);
|
||||
|
||||
m_log.Info("[MODULES]: Loading Region's modules (old style)");
|
||||
|
||||
|
@ -455,20 +446,20 @@ namespace OpenSim
|
|||
|
||||
SceneManager.Add(scene);
|
||||
|
||||
if (m_autoCreateClientStack)
|
||||
{
|
||||
foreach (IClientNetworkServer clientserver in clientServers)
|
||||
{
|
||||
m_clientServers.Add(clientserver);
|
||||
clientserver.Start();
|
||||
}
|
||||
}
|
||||
//if (m_autoCreateClientStack)
|
||||
//{
|
||||
// foreach (IClientNetworkServer clientserver in clientServers)
|
||||
// {
|
||||
// m_clientServers.Add(clientserver);
|
||||
// clientserver.Start();
|
||||
// }
|
||||
//}
|
||||
|
||||
scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
|
||||
|
||||
mscene = scene;
|
||||
|
||||
return clientServers;
|
||||
//return clientServers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -602,7 +593,7 @@ namespace OpenSim
|
|||
|
||||
scene.DeleteAllSceneObjects();
|
||||
SceneManager.CloseScene(scene);
|
||||
ShutdownClientServer(scene.RegionInfo);
|
||||
//ShutdownClientServer(scene.RegionInfo);
|
||||
|
||||
if (!cleanup)
|
||||
return;
|
||||
|
@ -663,7 +654,7 @@ namespace OpenSim
|
|||
}
|
||||
|
||||
SceneManager.CloseScene(scene);
|
||||
ShutdownClientServer(scene.RegionInfo);
|
||||
//ShutdownClientServer(scene.RegionInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -684,9 +675,9 @@ namespace OpenSim
|
|||
/// <param name="regionInfo"></param>
|
||||
/// <param name="clientServer"> </param>
|
||||
/// <returns></returns>
|
||||
protected Scene SetupScene(RegionInfo regionInfo, out List<IClientNetworkServer> clientServer)
|
||||
protected Scene SetupScene(RegionInfo regionInfo)
|
||||
{
|
||||
return SetupScene(regionInfo, 0, null, out clientServer);
|
||||
return SetupScene(regionInfo, 0, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -697,51 +688,45 @@ namespace OpenSim
|
|||
/// <param name="configSource"></param>
|
||||
/// <param name="clientServer"> </param>
|
||||
/// <returns></returns>
|
||||
protected Scene SetupScene(
|
||||
RegionInfo regionInfo, int proxyOffset, IConfigSource configSource, out List<IClientNetworkServer> clientServer)
|
||||
protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, IConfigSource configSource)
|
||||
{
|
||||
List<IClientNetworkServer> clientNetworkServers = null;
|
||||
//List<IClientNetworkServer> clientNetworkServers = null;
|
||||
|
||||
AgentCircuitManager circuitManager = new AgentCircuitManager();
|
||||
IPAddress listenIP = regionInfo.InternalEndPoint.Address;
|
||||
//if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP))
|
||||
// listenIP = IPAddress.Parse("0.0.0.0");
|
||||
//IPAddress listenIP = regionInfo.InternalEndPoint.Address;
|
||||
////if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP))
|
||||
//// listenIP = IPAddress.Parse("0.0.0.0");
|
||||
|
||||
uint port = (uint) regionInfo.InternalEndPoint.Port;
|
||||
//uint port = (uint) regionInfo.InternalEndPoint.Port;
|
||||
|
||||
if (m_autoCreateClientStack)
|
||||
{
|
||||
clientNetworkServers = m_clientStackManager.CreateServers(
|
||||
listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource,
|
||||
circuitManager);
|
||||
}
|
||||
else
|
||||
{
|
||||
clientServer = null;
|
||||
}
|
||||
//if (m_autoCreateClientStack)
|
||||
//{
|
||||
// clientNetworkServers = m_clientStackManager.CreateServers(
|
||||
// listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource,
|
||||
// circuitManager);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// clientServer = null;
|
||||
//}
|
||||
|
||||
regionInfo.InternalEndPoint.Port = (int) port;
|
||||
//regionInfo.InternalEndPoint.Port = (int) port;
|
||||
|
||||
Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager);
|
||||
|
||||
if (m_autoCreateClientStack)
|
||||
{
|
||||
foreach (IClientNetworkServer clientnetserver in clientNetworkServers)
|
||||
{
|
||||
clientnetserver.AddScene(scene);
|
||||
}
|
||||
}
|
||||
clientServer = clientNetworkServers;
|
||||
//if (m_autoCreateClientStack)
|
||||
//{
|
||||
// foreach (IClientNetworkServer clientnetserver in clientNetworkServers)
|
||||
// {
|
||||
// clientnetserver.AddScene(scene);
|
||||
// }
|
||||
//}
|
||||
//clientServer = clientNetworkServers;
|
||||
scene.LoadWorldMap();
|
||||
|
||||
return scene;
|
||||
}
|
||||
|
||||
protected override ClientStackManager CreateClientStackManager()
|
||||
{
|
||||
return new ClientStackManager(m_configSettings.ClientstackDll);
|
||||
}
|
||||
|
||||
protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService,
|
||||
IEstateDataService estateDataService, AgentCircuitManager circuitManager)
|
||||
{
|
||||
|
@ -751,29 +736,29 @@ namespace OpenSim
|
|||
Config, m_version);
|
||||
}
|
||||
|
||||
protected void ShutdownClientServer(RegionInfo whichRegion)
|
||||
{
|
||||
// Close and remove the clientserver for a region
|
||||
bool foundClientServer = false;
|
||||
int clientServerElement = 0;
|
||||
Location location = new Location(whichRegion.RegionHandle);
|
||||
//protected void ShutdownClientServer(RegionInfo whichRegion)
|
||||
//{
|
||||
// // Close and remove the clientserver for a region
|
||||
// bool foundClientServer = false;
|
||||
// int clientServerElement = 0;
|
||||
// Location location = new Location(whichRegion.RegionHandle);
|
||||
|
||||
for (int i = 0; i < m_clientServers.Count; i++)
|
||||
{
|
||||
if (m_clientServers[i].HandlesRegion(location))
|
||||
{
|
||||
clientServerElement = i;
|
||||
foundClientServer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// for (int i = 0; i < m_clientServers.Count; i++)
|
||||
// {
|
||||
// if (m_clientServers[i].HandlesRegion(location))
|
||||
// {
|
||||
// clientServerElement = i;
|
||||
// foundClientServer = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
if (foundClientServer)
|
||||
{
|
||||
m_clientServers[clientServerElement].Stop();
|
||||
m_clientServers.RemoveAt(clientServerElement);
|
||||
}
|
||||
}
|
||||
// if (foundClientServer)
|
||||
// {
|
||||
// m_clientServers[clientServerElement].Stop();
|
||||
// m_clientServers.RemoveAt(clientServerElement);
|
||||
// }
|
||||
//}
|
||||
|
||||
protected virtual void HandleRestartRegion(RegionInfo whichRegion)
|
||||
{
|
||||
|
@ -781,7 +766,7 @@ namespace OpenSim
|
|||
"[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})",
|
||||
whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY);
|
||||
|
||||
ShutdownClientServer(whichRegion);
|
||||
//ShutdownClientServer(whichRegion);
|
||||
IScene scene;
|
||||
CreateRegion(whichRegion, true, out scene);
|
||||
scene.Start();
|
||||
|
|
|
@ -41,7 +41,7 @@ using OpenSim.Region.Framework.Scenes;
|
|||
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.ClientStack
|
||||
namespace OpenSim
|
||||
{
|
||||
public abstract class RegionApplicationBase : BaseOpenSimServer
|
||||
{
|
||||
|
@ -53,7 +53,6 @@ namespace OpenSim.Region.ClientStack
|
|||
protected uint m_httpServerPort;
|
||||
protected ISimulationDataService m_simulationDataService;
|
||||
protected IEstateDataService m_estateDataService;
|
||||
protected ClientStackManager m_clientStackManager;
|
||||
|
||||
public SceneManager SceneManager { get; protected set; }
|
||||
public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } }
|
||||
|
@ -62,13 +61,11 @@ namespace OpenSim.Region.ClientStack
|
|||
|
||||
protected abstract void Initialize();
|
||||
|
||||
protected abstract ClientStackManager CreateClientStackManager();
|
||||
protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager);
|
||||
|
||||
protected override void StartupSpecific()
|
||||
{
|
||||
SceneManager = SceneManager.Instance;
|
||||
m_clientStackManager = CreateClientStackManager();
|
||||
|
||||
Initialize();
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Region.ClientStack
|
||||
{
|
||||
public class ClientStackManager
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private List<Type> plugin = new List<Type>();
|
||||
private List<Assembly> pluginAssembly = new List<Assembly>();
|
||||
|
||||
public ClientStackManager(string pDllName)
|
||||
{
|
||||
List<string> clientstacks = new List<string>();
|
||||
if (pDllName.Contains(","))
|
||||
{
|
||||
clientstacks = new List<string>(pDllName.Split(','));
|
||||
}
|
||||
else
|
||||
{
|
||||
clientstacks.Add(pDllName);
|
||||
}
|
||||
foreach (string dllName in clientstacks)
|
||||
{
|
||||
m_log.Info("[CLIENTSTACK]: Attempting to load " + dllName);
|
||||
|
||||
try
|
||||
{
|
||||
//plugin = null;
|
||||
Assembly itemAssembly = Assembly.LoadFrom(dllName);
|
||||
pluginAssembly.Add(itemAssembly);
|
||||
|
||||
foreach (Type pluginType in itemAssembly.GetTypes())
|
||||
{
|
||||
if (pluginType.IsPublic)
|
||||
{
|
||||
Type typeInterface = pluginType.GetInterface("IClientNetworkServer");
|
||||
|
||||
if (typeInterface != null)
|
||||
{
|
||||
m_log.Info("[CLIENTSTACK]: Added IClientNetworkServer Interface");
|
||||
plugin.Add(pluginType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ReflectionTypeLoadException e)
|
||||
{
|
||||
foreach (Exception e2 in e.LoaderExceptions)
|
||||
{
|
||||
m_log.Error(e2.ToString());
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a server that can set up sessions for virtual world client <-> server communications
|
||||
/// </summary>
|
||||
/// <param name="_listenIP"></param>
|
||||
/// <param name="port"></param>
|
||||
/// <param name="proxyPortOffset"></param>
|
||||
/// <param name="allow_alternate_port"></param>
|
||||
/// <param name="assetCache"></param>
|
||||
/// <param name="authenticateClass"></param>
|
||||
/// <returns></returns>
|
||||
public List<IClientNetworkServer> CreateServers(
|
||||
IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port,
|
||||
AgentCircuitManager authenticateClass)
|
||||
{
|
||||
return CreateServers(
|
||||
_listenIP, ref port, proxyPortOffset, allow_alternate_port, null, authenticateClass);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a server that can set up sessions for virtual world client <-> server communications
|
||||
/// </summary>
|
||||
/// <param name="_listenIP"></param>
|
||||
/// <param name="port"></param>
|
||||
/// <param name="proxyPortOffset"></param>
|
||||
/// <param name="allow_alternate_port"></param>
|
||||
/// <param name="configSource">
|
||||
/// Can be null, in which case default values are used
|
||||
/// </param>
|
||||
/// <param name="assetCache"></param>
|
||||
/// <param name="authenticateClass"></param>
|
||||
/// <returns></returns>
|
||||
public List<IClientNetworkServer> CreateServers(
|
||||
IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IConfigSource configSource,
|
||||
AgentCircuitManager authenticateClass)
|
||||
{
|
||||
List<IClientNetworkServer> servers = new List<IClientNetworkServer>();
|
||||
if (plugin != null)
|
||||
{
|
||||
for (int i = 0; i < plugin.Count; i++)
|
||||
{
|
||||
IClientNetworkServer server =
|
||||
(IClientNetworkServer) Activator.CreateInstance(pluginAssembly[i].GetType(plugin[i].ToString()));
|
||||
|
||||
server.Initialise(
|
||||
_listenIP, ref port, proxyPortOffset, allow_alternate_port,
|
||||
configSource, authenticateClass);
|
||||
servers.Add(server);
|
||||
}
|
||||
return servers;
|
||||
}
|
||||
|
||||
m_log.Error("[CLIENTSTACK]: Couldn't initialize a new server");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Region.ClientStack
|
||||
{
|
||||
public interface IClientNetworkServer
|
||||
{
|
||||
void Initialise(
|
||||
IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource,
|
||||
AgentCircuitManager authenticateClass);
|
||||
|
||||
bool HandlesRegion(Location x);
|
||||
|
||||
/// <summary>
|
||||
/// Add the given scene to be handled by this IClientNetworkServer.
|
||||
/// </summary>
|
||||
/// <param name='scene'></param>
|
||||
void AddScene(IScene scene);
|
||||
|
||||
/// <summary>
|
||||
/// Start sending and receiving data.
|
||||
/// </summary>
|
||||
void Start();
|
||||
|
||||
/// <summary>
|
||||
/// Stop sending and receiving data.
|
||||
/// </summary>
|
||||
void Stop();
|
||||
}
|
||||
}
|
|
@ -40,8 +40,9 @@ using OpenSim.Framework;
|
|||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Monitoring;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenMetaverse;
|
||||
|
||||
using Mono.Addins;
|
||||
using TokenBucket = OpenSim.Region.ClientStack.LindenUDP.TokenBucket;
|
||||
|
||||
namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
@ -49,14 +50,55 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
/// <summary>
|
||||
/// A shim around LLUDPServer that implements the IClientNetworkServer interface
|
||||
/// </summary>
|
||||
public sealed class LLUDPServerShim : IClientNetworkServer
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LLUDPServerShim")]
|
||||
public sealed class LLUDPServerShim : INonSharedRegionModule
|
||||
{
|
||||
private bool m_Enabled = true;
|
||||
private IConfigSource m_Config;
|
||||
LLUDPServer m_udpServer;
|
||||
|
||||
public LLUDPServerShim()
|
||||
#region INonSharedRegionModule
|
||||
public string Name
|
||||
{
|
||||
get { return "LLUDPServerShim"; }
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
m_Config = source;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
uint port = (uint)scene.RegionInfo.InternalEndPoint.Port;
|
||||
|
||||
IPAddress listenIP = scene.RegionInfo.InternalEndPoint.Address;
|
||||
Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, scene.RegionInfo.m_allow_alternate_ports, m_Config, scene.AuthenticateHandler);
|
||||
scene.RegionInfo.InternalEndPoint.Port = (int)port;
|
||||
|
||||
AddScene(scene);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
Start();
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager)
|
||||
{
|
||||
m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager);
|
||||
|
@ -200,6 +242,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
{
|
||||
m_udpServer.Stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Mono.Addins;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
|
@ -31,3 +32,5 @@ using System.Runtime.InteropServices;
|
|||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
|
||||
[assembly: Addin("LindenUDP", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
43
prebuild.xml
43
prebuild.xml
|
@ -1375,41 +1375,6 @@
|
|||
</Files>
|
||||
</Project>
|
||||
|
||||
<Project frameworkVersion="v4_0" name="OpenSim.Region.ClientStack" path="OpenSim/Region/ClientStack" type="Library">
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>../../../bin/</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>../../../bin/</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<ReferencePath>../../../bin/</ReferencePath>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Xml"/>
|
||||
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
|
||||
<Reference name="OpenSim.Region.Framework"/>
|
||||
<Reference name="OpenSim.Framework"/>
|
||||
<Reference name="OpenSim.Data"/>
|
||||
<Reference name="OpenSim.Framework.Console"/>
|
||||
<Reference name="OpenSim.Framework.Monitoring"/>
|
||||
<Reference name="OpenSim.Framework.Servers"/>
|
||||
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
||||
<Reference name="OpenSim.Framework.Communications"/>
|
||||
<Reference name="OpenSim.Region.PhysicsModules.SharedBase"/>
|
||||
<Reference name="OpenSim.Services.Interfaces"/>
|
||||
<Reference name="XMLRPC" path="../../../bin/"/>
|
||||
<Reference name="Nini" path="../../../bin/"/>
|
||||
<Reference name="log4net" path="../../../bin/"/>
|
||||
|
||||
<Files>
|
||||
<Match pattern="*.cs" recurse="false"/>
|
||||
</Files>
|
||||
</Project>
|
||||
|
||||
<!-- ClientStack Plugins -->
|
||||
<Project frameworkVersion="v4_0" name="OpenSim.Region.ClientStack.LindenUDP" path="OpenSim/Region/ClientStack/Linden/UDP" type="Library">
|
||||
<Configuration name="Debug">
|
||||
|
@ -1440,13 +1405,13 @@
|
|||
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
||||
<Reference name="OpenSim.Framework.Console"/>
|
||||
<Reference name="OpenSim.Framework.Communications"/>
|
||||
<Reference name="OpenSim.Region.ClientStack"/>
|
||||
<Reference name="OpenSim.Region.Framework"/>
|
||||
<Reference name="OpenSim.Services.Interfaces"/>
|
||||
<Reference name="Nini" path="../../../../../bin/"/>
|
||||
<Reference name="log4net" path="../../../../../bin/"/>
|
||||
<Reference name="C5" path="../../../../../bin/"/>
|
||||
<Reference name="Nini" path="../../../../../bin/"/>
|
||||
<Reference name="Mono.Addins" path="../../../../../bin/"/>
|
||||
|
||||
<Files>
|
||||
<Match pattern="*.cs" recurse="true">
|
||||
|
@ -1902,7 +1867,6 @@
|
|||
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
||||
<Reference name="OpenSim.Region.Framework"/>
|
||||
<Reference name="OpenSim.Region.CoreModules"/>
|
||||
<Reference name="OpenSim.Region.ClientStack"/>
|
||||
<Reference name="OpenSim.Region.PhysicsModules.SharedBase"/>
|
||||
<Reference name="OpenSim.Server.Base"/>
|
||||
<Reference name="OpenSim.Services.Base"/>
|
||||
|
@ -1936,7 +1900,6 @@
|
|||
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
|
||||
<Reference name="Nini" path="../../../bin/"/>
|
||||
<Reference name="OpenSim"/>
|
||||
<Reference name="OpenSim.Region.ClientStack"/>
|
||||
<Reference name="OpenSim.Region.CoreModules"/>
|
||||
<Reference name="OpenSim.Region.Framework"/>
|
||||
<Reference name="OpenSim.Framework"/>
|
||||
|
@ -1972,7 +1935,6 @@
|
|||
<Reference name="OpenSim.Framework"/>
|
||||
<Reference name="OpenSim.Framework.Servers"/>
|
||||
<Reference name="OpenSim.Region.Framework"/>
|
||||
<Reference name="OpenSim.Region.ClientStack"/>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Xml"/>
|
||||
<Reference name="log4net" path="../../../bin/"/>
|
||||
|
@ -2006,7 +1968,6 @@
|
|||
<Reference name="Nini" path="../../../bin/"/>
|
||||
<Reference name="XMLRPC" path="../../../bin/"/>
|
||||
<Reference name="OpenSim"/>
|
||||
<Reference name="OpenSim.Region.ClientStack"/>
|
||||
<Reference name="OpenSim.Region.Framework"/>
|
||||
<Reference name="OpenSim.Region.CoreModules"/>
|
||||
<Reference name="OpenSim.Framework.Communications"/>
|
||||
|
@ -3206,7 +3167,6 @@
|
|||
<Reference name="OpenSim.Framework.Servers"/>
|
||||
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
||||
<Reference name="OpenSim.Framework.Serialization"/>
|
||||
<Reference name="OpenSim.Region.ClientStack"/>
|
||||
<Reference name="OpenSim.Region.ClientStack.LindenCaps"/>
|
||||
<Reference name="OpenSim.Region.Framework"/>
|
||||
<Reference name="OpenSim.Region.CoreModules"/>
|
||||
|
@ -3304,7 +3264,6 @@
|
|||
<Reference name="OpenSim.Framework"/>
|
||||
<Reference name="OpenSim.Framework.Communications"/>
|
||||
<Reference name="OpenSim.Framework.Monitoring"/>
|
||||
<Reference name="OpenSim.Region.ClientStack"/>
|
||||
<Reference name="OpenSim.Region.ClientStack.LindenUDP"/>
|
||||
<Reference name="OpenSim.Region.CoreModules"/>
|
||||
<Reference name="OpenSim.Region.Framework"/>
|
||||
|
|
Loading…
Reference in New Issue