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
Melanie Thielker 2009-05-18 21:04:25 +00:00
parent d0d4f7afde
commit f7dbfe63e5
5 changed files with 60 additions and 11 deletions

View File

@ -30,14 +30,16 @@ using Nini.Config;
using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Server.Handlers.Base;
namespace OpenSim.Server.Handlers.Asset
{
public class AssetServiceConnector
public class AssetServiceConnector : ServiceConnector
{
private IAssetService m_AssetService;
public AssetServiceConnector(IConfigSource config, IHttpServer server)
public AssetServiceConnector(IConfigSource config, IHttpServer server) :
base(config, server)
{
IConfig serverConfig = config.Configs["AssetService"];
if (serverConfig == null)

View File

@ -25,25 +25,69 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using Nini.Config;
using log4net;
using System.Reflection;
using System;
using System.Collections.Generic;
using OpenSim.Server.Base;
using OpenSim.Server.Handlers.Base;
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 AssetServiceConnector m_AssetServiceConnector;
protected static List<IServiceConnector> m_ServiceConnectors =
new List<IServiceConnector>();
static int Main(string[] args)
{
m_Server = new HttpServerBase("Asset", args);
m_AssetServiceConnector = new AssetServiceConnector(m_Server.Config,
m_Server.HttpServer);
IConfig serverConfig = m_Server.Config.Configs["Startup"];
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();
}
}

View File

@ -5,6 +5,9 @@
; inifile = "OpenSim.Servers.AssetServer.ini"
; logfile = "AssetServer.log" ; Also read from application config file
; Connectors, comma separated
ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector"
[Network]
port = 8003

View File

@ -1418,19 +1418,19 @@
</Files>
</Project>
<Project name="OpenSim.Server.AssetServer" path="OpenSim/Server/AssetServer" type="Exe">
<Project name="OpenSim.Server" path="OpenSim/Server" type="Exe">
<Configuration name="Debug">
<Options>
<OutputPath>../../../bin/</OutputPath>
<OutputPath>../../bin/</OutputPath>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<OutputPath>../../../bin/</OutputPath>
<OutputPath>../../bin/</OutputPath>
</Options>
</Configuration>
<ReferencePath>../../../bin/</ReferencePath>
<ReferencePath>../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Xml"/>
<Reference name="OpenMetaverseTypes.dll"/>