This commit changes the way the new server works. There is no longer a server
exe for each function, rather each function is a connector and the server ini loads them. If you like your multiple processes, use -inifile with the server. Otherwise, you get one server process that serves all configured funcions, see example .ini. The new exe is OpenSim.Server.exe. Clean your bin, loads of names have changed!0.6.6-post-fixes
parent
d0d4f7afde
commit
f7dbfe63e5
|
@ -30,14 +30,16 @@ using Nini.Config;
|
||||||
using OpenSim.Server.Base;
|
using OpenSim.Server.Base;
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
using OpenSim.Framework.Servers.HttpServer;
|
using OpenSim.Framework.Servers.HttpServer;
|
||||||
|
using OpenSim.Server.Handlers.Base;
|
||||||
|
|
||||||
namespace OpenSim.Server.Handlers.Asset
|
namespace OpenSim.Server.Handlers.Asset
|
||||||
{
|
{
|
||||||
public class AssetServiceConnector
|
public class AssetServiceConnector : ServiceConnector
|
||||||
{
|
{
|
||||||
private IAssetService m_AssetService;
|
private IAssetService m_AssetService;
|
||||||
|
|
||||||
public AssetServiceConnector(IConfigSource config, IHttpServer server)
|
public AssetServiceConnector(IConfigSource config, IHttpServer server) :
|
||||||
|
base(config, server)
|
||||||
{
|
{
|
||||||
IConfig serverConfig = config.Configs["AssetService"];
|
IConfig serverConfig = config.Configs["AssetService"];
|
||||||
if (serverConfig == null)
|
if (serverConfig == null)
|
||||||
|
|
|
@ -25,25 +25,69 @@
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
using Nini.Config;
|
||||||
|
using log4net;
|
||||||
|
using System.Reflection;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using OpenSim.Server.Base;
|
using OpenSim.Server.Base;
|
||||||
|
using OpenSim.Server.Handlers.Base;
|
||||||
using OpenSim.Server.Handlers.Asset;
|
using OpenSim.Server.Handlers.Asset;
|
||||||
|
|
||||||
namespace OpenSim.Server.AssetServer
|
namespace OpenSim.Server
|
||||||
{
|
{
|
||||||
public class AssetServer
|
public class OpenSimServer
|
||||||
{
|
{
|
||||||
|
private static readonly ILog m_log =
|
||||||
|
LogManager.GetLogger(
|
||||||
|
MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
protected static HttpServerBase m_Server = null;
|
protected static HttpServerBase m_Server = null;
|
||||||
|
|
||||||
protected static AssetServiceConnector m_AssetServiceConnector;
|
protected static List<IServiceConnector> m_ServiceConnectors =
|
||||||
|
new List<IServiceConnector>();
|
||||||
|
|
||||||
static int Main(string[] args)
|
static int Main(string[] args)
|
||||||
{
|
{
|
||||||
m_Server = new HttpServerBase("Asset", args);
|
m_Server = new HttpServerBase("Asset", args);
|
||||||
|
|
||||||
m_AssetServiceConnector = new AssetServiceConnector(m_Server.Config,
|
IConfig serverConfig = m_Server.Config.Configs["Startup"];
|
||||||
m_Server.HttpServer);
|
if (serverConfig == null)
|
||||||
|
{
|
||||||
|
System.Console.WriteLine("Startup config section missing in .ini file");
|
||||||
|
throw new Exception("Configuration error");
|
||||||
|
}
|
||||||
|
|
||||||
|
string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
|
||||||
|
string[] conns = connList.Split(new char[] {',', ' '});
|
||||||
|
|
||||||
|
foreach (string conn in conns)
|
||||||
|
{
|
||||||
|
if (conn == String.Empty)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string[] parts = conn.Split(new char[] {':'});
|
||||||
|
string friendlyName = parts[0];
|
||||||
|
if (parts.Length > 1)
|
||||||
|
friendlyName = parts[1];
|
||||||
|
|
||||||
|
m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName);
|
||||||
|
|
||||||
|
Object[] modargs = new Object[] { m_Server.Config, m_Server.HttpServer };
|
||||||
|
IServiceConnector connector =
|
||||||
|
ServerUtils.LoadPlugin<IServiceConnector>(conn,
|
||||||
|
modargs);
|
||||||
|
|
||||||
|
if (connector != null)
|
||||||
|
{
|
||||||
|
m_ServiceConnectors.Add(connector);
|
||||||
|
m_log.InfoFormat("[SERVER]: {0} loaded successfully", friendlyName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.InfoFormat("[SERVER]: Failed to load {0}", conn);
|
||||||
|
}
|
||||||
|
}
|
||||||
return m_Server.Run();
|
return m_Server.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,6 +5,9 @@
|
||||||
; inifile = "OpenSim.Servers.AssetServer.ini"
|
; inifile = "OpenSim.Servers.AssetServer.ini"
|
||||||
; logfile = "AssetServer.log" ; Also read from application config file
|
; logfile = "AssetServer.log" ; Also read from application config file
|
||||||
|
|
||||||
|
; Connectors, comma separated
|
||||||
|
ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector"
|
||||||
|
|
||||||
[Network]
|
[Network]
|
||||||
port = 8003
|
port = 8003
|
||||||
|
|
|
@ -1418,19 +1418,19 @@
|
||||||
</Files>
|
</Files>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
<Project name="OpenSim.Server.AssetServer" path="OpenSim/Server/AssetServer" type="Exe">
|
<Project name="OpenSim.Server" path="OpenSim/Server" type="Exe">
|
||||||
<Configuration name="Debug">
|
<Configuration name="Debug">
|
||||||
<Options>
|
<Options>
|
||||||
<OutputPath>../../../bin/</OutputPath>
|
<OutputPath>../../bin/</OutputPath>
|
||||||
</Options>
|
</Options>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration name="Release">
|
<Configuration name="Release">
|
||||||
<Options>
|
<Options>
|
||||||
<OutputPath>../../../bin/</OutputPath>
|
<OutputPath>../../bin/</OutputPath>
|
||||||
</Options>
|
</Options>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
|
|
||||||
<ReferencePath>../../../bin/</ReferencePath>
|
<ReferencePath>../../bin/</ReferencePath>
|
||||||
<Reference name="System"/>
|
<Reference name="System"/>
|
||||||
<Reference name="System.Xml"/>
|
<Reference name="System.Xml"/>
|
||||||
<Reference name="OpenMetaverseTypes.dll"/>
|
<Reference name="OpenMetaverseTypes.dll"/>
|
||||||
|
|
Loading…
Reference in New Issue