Transformed the LLUDP ad-hoc plugin into a region module. It works.
parent
0235e58fff
commit
dac8edd5dd
|
@ -55,7 +55,7 @@ namespace OpenSim
|
||||||
base.Startup();
|
base.Startup();
|
||||||
|
|
||||||
m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}",
|
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.WaitOne();
|
||||||
WorldHasComeToAnEnd.Close();
|
WorldHasComeToAnEnd.Close();
|
||||||
|
|
|
@ -41,7 +41,6 @@ using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
using OpenSim.Framework.Servers.HttpServer;
|
using OpenSim.Framework.Servers.HttpServer;
|
||||||
using OpenSim.Framework.Monitoring;
|
using OpenSim.Framework.Monitoring;
|
||||||
using OpenSim.Region.ClientStack;
|
|
||||||
using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
|
using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
|
||||||
using OpenSim.Region.Framework;
|
using OpenSim.Region.Framework;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
|
@ -117,11 +116,6 @@ namespace OpenSim
|
||||||
/// </value>
|
/// </value>
|
||||||
public OpenSimConfigSource ConfigSource { get; private set; }
|
public OpenSimConfigSource ConfigSource { get; private set; }
|
||||||
|
|
||||||
public List<IClientNetworkServer> ClientServers
|
|
||||||
{
|
|
||||||
get { return m_clientServers; }
|
|
||||||
}
|
|
||||||
|
|
||||||
protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource();
|
protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource();
|
||||||
|
|
||||||
public EnvConfigSource envConfigSource
|
public EnvConfigSource envConfigSource
|
||||||
|
@ -129,8 +123,6 @@ namespace OpenSim
|
||||||
get { return m_EnvConfigSource; }
|
get { return m_EnvConfigSource; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>();
|
|
||||||
|
|
||||||
public uint HttpServerPort
|
public uint HttpServerPort
|
||||||
{
|
{
|
||||||
get { return m_httpServerPort; }
|
get { return m_httpServerPort; }
|
||||||
|
@ -359,9 +351,9 @@ namespace OpenSim
|
||||||
/// <param name="regionInfo"></param>
|
/// <param name="regionInfo"></param>
|
||||||
/// <param name="portadd_flag"></param>
|
/// <param name="portadd_flag"></param>
|
||||||
/// <returns></returns>
|
/// <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>
|
/// <summary>
|
||||||
|
@ -369,9 +361,9 @@ namespace OpenSim
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="regionInfo"></param>
|
/// <param name="regionInfo"></param>
|
||||||
/// <returns></returns>
|
/// <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>
|
/// <summary>
|
||||||
|
@ -381,7 +373,7 @@ namespace OpenSim
|
||||||
/// <param name="portadd_flag"></param>
|
/// <param name="portadd_flag"></param>
|
||||||
/// <param name="do_post_init"></param>
|
/// <param name="do_post_init"></param>
|
||||||
/// <returns></returns>
|
/// <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;
|
int port = regionInfo.InternalEndPoint.Port;
|
||||||
|
|
||||||
|
@ -406,8 +398,7 @@ namespace OpenSim
|
||||||
Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName);
|
Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<IClientNetworkServer> clientServers;
|
Scene scene = SetupScene(regionInfo, proxyOffset, Config);
|
||||||
Scene scene = SetupScene(regionInfo, proxyOffset, Config, out clientServers);
|
|
||||||
|
|
||||||
m_log.Info("[MODULES]: Loading Region's modules (old style)");
|
m_log.Info("[MODULES]: Loading Region's modules (old style)");
|
||||||
|
|
||||||
|
@ -455,20 +446,20 @@ namespace OpenSim
|
||||||
|
|
||||||
SceneManager.Add(scene);
|
SceneManager.Add(scene);
|
||||||
|
|
||||||
if (m_autoCreateClientStack)
|
//if (m_autoCreateClientStack)
|
||||||
{
|
//{
|
||||||
foreach (IClientNetworkServer clientserver in clientServers)
|
// foreach (IClientNetworkServer clientserver in clientServers)
|
||||||
{
|
// {
|
||||||
m_clientServers.Add(clientserver);
|
// m_clientServers.Add(clientserver);
|
||||||
clientserver.Start();
|
// clientserver.Start();
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
|
scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
|
||||||
|
|
||||||
mscene = scene;
|
mscene = scene;
|
||||||
|
|
||||||
return clientServers;
|
//return clientServers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -602,7 +593,7 @@ namespace OpenSim
|
||||||
|
|
||||||
scene.DeleteAllSceneObjects();
|
scene.DeleteAllSceneObjects();
|
||||||
SceneManager.CloseScene(scene);
|
SceneManager.CloseScene(scene);
|
||||||
ShutdownClientServer(scene.RegionInfo);
|
//ShutdownClientServer(scene.RegionInfo);
|
||||||
|
|
||||||
if (!cleanup)
|
if (!cleanup)
|
||||||
return;
|
return;
|
||||||
|
@ -663,7 +654,7 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneManager.CloseScene(scene);
|
SceneManager.CloseScene(scene);
|
||||||
ShutdownClientServer(scene.RegionInfo);
|
//ShutdownClientServer(scene.RegionInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -684,9 +675,9 @@ namespace OpenSim
|
||||||
/// <param name="regionInfo"></param>
|
/// <param name="regionInfo"></param>
|
||||||
/// <param name="clientServer"> </param>
|
/// <param name="clientServer"> </param>
|
||||||
/// <returns></returns>
|
/// <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>
|
/// <summary>
|
||||||
|
@ -697,51 +688,45 @@ namespace OpenSim
|
||||||
/// <param name="configSource"></param>
|
/// <param name="configSource"></param>
|
||||||
/// <param name="clientServer"> </param>
|
/// <param name="clientServer"> </param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected Scene SetupScene(
|
protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, IConfigSource configSource)
|
||||||
RegionInfo regionInfo, int proxyOffset, IConfigSource configSource, out List<IClientNetworkServer> clientServer)
|
|
||||||
{
|
{
|
||||||
List<IClientNetworkServer> clientNetworkServers = null;
|
//List<IClientNetworkServer> clientNetworkServers = null;
|
||||||
|
|
||||||
AgentCircuitManager circuitManager = new AgentCircuitManager();
|
AgentCircuitManager circuitManager = new AgentCircuitManager();
|
||||||
IPAddress listenIP = regionInfo.InternalEndPoint.Address;
|
//IPAddress listenIP = regionInfo.InternalEndPoint.Address;
|
||||||
//if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP))
|
////if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP))
|
||||||
// listenIP = IPAddress.Parse("0.0.0.0");
|
//// listenIP = IPAddress.Parse("0.0.0.0");
|
||||||
|
|
||||||
uint port = (uint) regionInfo.InternalEndPoint.Port;
|
//uint port = (uint) regionInfo.InternalEndPoint.Port;
|
||||||
|
|
||||||
if (m_autoCreateClientStack)
|
//if (m_autoCreateClientStack)
|
||||||
{
|
//{
|
||||||
clientNetworkServers = m_clientStackManager.CreateServers(
|
// clientNetworkServers = m_clientStackManager.CreateServers(
|
||||||
listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource,
|
// listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource,
|
||||||
circuitManager);
|
// circuitManager);
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
clientServer = null;
|
// clientServer = null;
|
||||||
}
|
//}
|
||||||
|
|
||||||
regionInfo.InternalEndPoint.Port = (int) port;
|
//regionInfo.InternalEndPoint.Port = (int) port;
|
||||||
|
|
||||||
Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager);
|
Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager);
|
||||||
|
|
||||||
if (m_autoCreateClientStack)
|
//if (m_autoCreateClientStack)
|
||||||
{
|
//{
|
||||||
foreach (IClientNetworkServer clientnetserver in clientNetworkServers)
|
// foreach (IClientNetworkServer clientnetserver in clientNetworkServers)
|
||||||
{
|
// {
|
||||||
clientnetserver.AddScene(scene);
|
// clientnetserver.AddScene(scene);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
clientServer = clientNetworkServers;
|
//clientServer = clientNetworkServers;
|
||||||
scene.LoadWorldMap();
|
scene.LoadWorldMap();
|
||||||
|
|
||||||
return scene;
|
return scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override ClientStackManager CreateClientStackManager()
|
|
||||||
{
|
|
||||||
return new ClientStackManager(m_configSettings.ClientstackDll);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService,
|
protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService,
|
||||||
IEstateDataService estateDataService, AgentCircuitManager circuitManager)
|
IEstateDataService estateDataService, AgentCircuitManager circuitManager)
|
||||||
{
|
{
|
||||||
|
@ -751,29 +736,29 @@ namespace OpenSim
|
||||||
Config, m_version);
|
Config, m_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ShutdownClientServer(RegionInfo whichRegion)
|
//protected void ShutdownClientServer(RegionInfo whichRegion)
|
||||||
{
|
//{
|
||||||
// Close and remove the clientserver for a region
|
// // Close and remove the clientserver for a region
|
||||||
bool foundClientServer = false;
|
// bool foundClientServer = false;
|
||||||
int clientServerElement = 0;
|
// int clientServerElement = 0;
|
||||||
Location location = new Location(whichRegion.RegionHandle);
|
// Location location = new Location(whichRegion.RegionHandle);
|
||||||
|
|
||||||
for (int i = 0; i < m_clientServers.Count; i++)
|
// for (int i = 0; i < m_clientServers.Count; i++)
|
||||||
{
|
// {
|
||||||
if (m_clientServers[i].HandlesRegion(location))
|
// if (m_clientServers[i].HandlesRegion(location))
|
||||||
{
|
// {
|
||||||
clientServerElement = i;
|
// clientServerElement = i;
|
||||||
foundClientServer = true;
|
// foundClientServer = true;
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (foundClientServer)
|
// if (foundClientServer)
|
||||||
{
|
// {
|
||||||
m_clientServers[clientServerElement].Stop();
|
// m_clientServers[clientServerElement].Stop();
|
||||||
m_clientServers.RemoveAt(clientServerElement);
|
// m_clientServers.RemoveAt(clientServerElement);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
protected virtual void HandleRestartRegion(RegionInfo whichRegion)
|
protected virtual void HandleRestartRegion(RegionInfo whichRegion)
|
||||||
{
|
{
|
||||||
|
@ -781,7 +766,7 @@ namespace OpenSim
|
||||||
"[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})",
|
"[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})",
|
||||||
whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY);
|
whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY);
|
||||||
|
|
||||||
ShutdownClientServer(whichRegion);
|
//ShutdownClientServer(whichRegion);
|
||||||
IScene scene;
|
IScene scene;
|
||||||
CreateRegion(whichRegion, true, out scene);
|
CreateRegion(whichRegion, true, out scene);
|
||||||
scene.Start();
|
scene.Start();
|
||||||
|
|
|
@ -41,7 +41,7 @@ using OpenSim.Region.Framework.Scenes;
|
||||||
using OpenSim.Region.PhysicsModules.SharedBase;
|
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.ClientStack
|
namespace OpenSim
|
||||||
{
|
{
|
||||||
public abstract class RegionApplicationBase : BaseOpenSimServer
|
public abstract class RegionApplicationBase : BaseOpenSimServer
|
||||||
{
|
{
|
||||||
|
@ -53,7 +53,6 @@ namespace OpenSim.Region.ClientStack
|
||||||
protected uint m_httpServerPort;
|
protected uint m_httpServerPort;
|
||||||
protected ISimulationDataService m_simulationDataService;
|
protected ISimulationDataService m_simulationDataService;
|
||||||
protected IEstateDataService m_estateDataService;
|
protected IEstateDataService m_estateDataService;
|
||||||
protected ClientStackManager m_clientStackManager;
|
|
||||||
|
|
||||||
public SceneManager SceneManager { get; protected set; }
|
public SceneManager SceneManager { get; protected set; }
|
||||||
public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } }
|
public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } }
|
||||||
|
@ -62,13 +61,11 @@ namespace OpenSim.Region.ClientStack
|
||||||
|
|
||||||
protected abstract void Initialize();
|
protected abstract void Initialize();
|
||||||
|
|
||||||
protected abstract ClientStackManager CreateClientStackManager();
|
|
||||||
protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager);
|
protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager);
|
||||||
|
|
||||||
protected override void StartupSpecific()
|
protected override void StartupSpecific()
|
||||||
{
|
{
|
||||||
SceneManager = SceneManager.Instance;
|
SceneManager = SceneManager.Instance;
|
||||||
m_clientStackManager = CreateClientStackManager();
|
|
||||||
|
|
||||||
Initialize();
|
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.Console;
|
||||||
using OpenSim.Framework.Monitoring;
|
using OpenSim.Framework.Monitoring;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
using Mono.Addins;
|
||||||
using TokenBucket = OpenSim.Region.ClientStack.LindenUDP.TokenBucket;
|
using TokenBucket = OpenSim.Region.ClientStack.LindenUDP.TokenBucket;
|
||||||
|
|
||||||
namespace OpenSim.Region.ClientStack.LindenUDP
|
namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
@ -49,14 +50,55 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A shim around LLUDPServer that implements the IClientNetworkServer interface
|
/// A shim around LLUDPServer that implements the IClientNetworkServer interface
|
||||||
/// </summary>
|
/// </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;
|
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)
|
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);
|
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();
|
m_udpServer.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using Mono.Addins;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// 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: 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>
|
</Files>
|
||||||
</Project>
|
</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 -->
|
<!-- ClientStack Plugins -->
|
||||||
<Project frameworkVersion="v4_0" name="OpenSim.Region.ClientStack.LindenUDP" path="OpenSim/Region/ClientStack/Linden/UDP" type="Library">
|
<Project frameworkVersion="v4_0" name="OpenSim.Region.ClientStack.LindenUDP" path="OpenSim/Region/ClientStack/Linden/UDP" type="Library">
|
||||||
<Configuration name="Debug">
|
<Configuration name="Debug">
|
||||||
|
@ -1440,13 +1405,13 @@
|
||||||
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
||||||
<Reference name="OpenSim.Framework.Console"/>
|
<Reference name="OpenSim.Framework.Console"/>
|
||||||
<Reference name="OpenSim.Framework.Communications"/>
|
<Reference name="OpenSim.Framework.Communications"/>
|
||||||
<Reference name="OpenSim.Region.ClientStack"/>
|
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
<Reference name="OpenSim.Services.Interfaces"/>
|
<Reference name="OpenSim.Services.Interfaces"/>
|
||||||
<Reference name="Nini" path="../../../../../bin/"/>
|
<Reference name="Nini" path="../../../../../bin/"/>
|
||||||
<Reference name="log4net" path="../../../../../bin/"/>
|
<Reference name="log4net" path="../../../../../bin/"/>
|
||||||
<Reference name="C5" path="../../../../../bin/"/>
|
<Reference name="C5" path="../../../../../bin/"/>
|
||||||
<Reference name="Nini" path="../../../../../bin/"/>
|
<Reference name="Nini" path="../../../../../bin/"/>
|
||||||
|
<Reference name="Mono.Addins" path="../../../../../bin/"/>
|
||||||
|
|
||||||
<Files>
|
<Files>
|
||||||
<Match pattern="*.cs" recurse="true">
|
<Match pattern="*.cs" recurse="true">
|
||||||
|
@ -1902,7 +1867,6 @@
|
||||||
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
<Reference name="OpenSim.Region.CoreModules"/>
|
<Reference name="OpenSim.Region.CoreModules"/>
|
||||||
<Reference name="OpenSim.Region.ClientStack"/>
|
|
||||||
<Reference name="OpenSim.Region.PhysicsModules.SharedBase"/>
|
<Reference name="OpenSim.Region.PhysicsModules.SharedBase"/>
|
||||||
<Reference name="OpenSim.Server.Base"/>
|
<Reference name="OpenSim.Server.Base"/>
|
||||||
<Reference name="OpenSim.Services.Base"/>
|
<Reference name="OpenSim.Services.Base"/>
|
||||||
|
@ -1936,7 +1900,6 @@
|
||||||
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
|
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
|
||||||
<Reference name="Nini" path="../../../bin/"/>
|
<Reference name="Nini" path="../../../bin/"/>
|
||||||
<Reference name="OpenSim"/>
|
<Reference name="OpenSim"/>
|
||||||
<Reference name="OpenSim.Region.ClientStack"/>
|
|
||||||
<Reference name="OpenSim.Region.CoreModules"/>
|
<Reference name="OpenSim.Region.CoreModules"/>
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
<Reference name="OpenSim.Framework"/>
|
<Reference name="OpenSim.Framework"/>
|
||||||
|
@ -1972,7 +1935,6 @@
|
||||||
<Reference name="OpenSim.Framework"/>
|
<Reference name="OpenSim.Framework"/>
|
||||||
<Reference name="OpenSim.Framework.Servers"/>
|
<Reference name="OpenSim.Framework.Servers"/>
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
<Reference name="OpenSim.Region.ClientStack"/>
|
|
||||||
<Reference name="System"/>
|
<Reference name="System"/>
|
||||||
<Reference name="System.Xml"/>
|
<Reference name="System.Xml"/>
|
||||||
<Reference name="log4net" path="../../../bin/"/>
|
<Reference name="log4net" path="../../../bin/"/>
|
||||||
|
@ -2006,7 +1968,6 @@
|
||||||
<Reference name="Nini" path="../../../bin/"/>
|
<Reference name="Nini" path="../../../bin/"/>
|
||||||
<Reference name="XMLRPC" path="../../../bin/"/>
|
<Reference name="XMLRPC" path="../../../bin/"/>
|
||||||
<Reference name="OpenSim"/>
|
<Reference name="OpenSim"/>
|
||||||
<Reference name="OpenSim.Region.ClientStack"/>
|
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
<Reference name="OpenSim.Region.CoreModules"/>
|
<Reference name="OpenSim.Region.CoreModules"/>
|
||||||
<Reference name="OpenSim.Framework.Communications"/>
|
<Reference name="OpenSim.Framework.Communications"/>
|
||||||
|
@ -3206,7 +3167,6 @@
|
||||||
<Reference name="OpenSim.Framework.Servers"/>
|
<Reference name="OpenSim.Framework.Servers"/>
|
||||||
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
||||||
<Reference name="OpenSim.Framework.Serialization"/>
|
<Reference name="OpenSim.Framework.Serialization"/>
|
||||||
<Reference name="OpenSim.Region.ClientStack"/>
|
|
||||||
<Reference name="OpenSim.Region.ClientStack.LindenCaps"/>
|
<Reference name="OpenSim.Region.ClientStack.LindenCaps"/>
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
<Reference name="OpenSim.Region.CoreModules"/>
|
<Reference name="OpenSim.Region.CoreModules"/>
|
||||||
|
@ -3304,7 +3264,6 @@
|
||||||
<Reference name="OpenSim.Framework"/>
|
<Reference name="OpenSim.Framework"/>
|
||||||
<Reference name="OpenSim.Framework.Communications"/>
|
<Reference name="OpenSim.Framework.Communications"/>
|
||||||
<Reference name="OpenSim.Framework.Monitoring"/>
|
<Reference name="OpenSim.Framework.Monitoring"/>
|
||||||
<Reference name="OpenSim.Region.ClientStack"/>
|
|
||||||
<Reference name="OpenSim.Region.ClientStack.LindenUDP"/>
|
<Reference name="OpenSim.Region.ClientStack.LindenUDP"/>
|
||||||
<Reference name="OpenSim.Region.CoreModules"/>
|
<Reference name="OpenSim.Region.CoreModules"/>
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
|
|
Loading…
Reference in New Issue