Deleted the userserver project. As now the gridserver plugins and userserver plugins are loadable from the single server exe (gridserver.exe).

Which plugins it loads (either those for gridserver or those for userserver or both) is defined in the opensim.grid.ini file (see opensim.grid.ini.example). Also all config settings are now in that ini file rather than the old xml files. So edit that file with your changes, as the server no longer asks startup questions for those values.
And finally note all this is in a branch so no need for anyone to panic about all these changes.
GenericGridServerConcept
MW 2009-02-28 16:04:11 +00:00
parent 9b9456c985
commit aa5b4b6437
7 changed files with 78 additions and 264 deletions

View File

@ -6,6 +6,6 @@
<Addin id="OpenSim.Grid.GridServer" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/GridServer">
<Plugin id="GridServerModules" type="OpenSim.Grid.GridServer.Modules.GridServerPlugin" />
<Plugin id="GridServerPlugin" type="OpenSim.Grid.GridServer.Modules.GridServerPlugin" />
</Extension>
</Addin>

View File

@ -96,23 +96,42 @@ namespace OpenSim.Grid.GridServer
{
uint httpPort = 8051;
m_gconfig = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml")));
// m_gconfig = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml")));
m_uconfig = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml")));
//m_uconfig = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml")));
m_uconfig = new UserConfig();
m_uconfig.LoadConfigurationFromNini(m_configSource.Source);
m_gconfig = new GridConfig();
m_gconfig.LoadConfigurationFromNini(m_configSource.Source);
Console.WriteLine("grid server database provider is {0} ", m_gconfig.DatabaseProvider);
IConfig startupConfig = m_configSource.Source.Configs["Startup"];
if (startupConfig != null)
{
Convert.ToUInt32(startupConfig.GetString("HttpPort", "8051"));
m_log.Info("[GRID]: Starting HTTP process");
m_httpServer = new BaseHttpServer(httpPort);
string pluginsToLoad = startupConfig.GetString("LoadPlugins", "");
if (!String.IsNullOrEmpty(pluginsToLoad))
{
LoadPlugins(pluginsToLoad);
}
else
{
LoadPlugins();
}
m_httpServer.Start();
}
m_log.Info("[GRID]: Starting HTTP process");
m_httpServer = new BaseHttpServer(httpPort);
LoadPlugins();
m_httpServer.Start();
base.StartupSpecific();
}
@ -125,6 +144,18 @@ namespace OpenSim.Grid.GridServer
m_plugins = loader.Plugins;
}
protected virtual void LoadPlugins(string pluginNames)
{
PluginLoader<IGridPlugin> loader =
new PluginLoader<IGridPlugin>(new GridPluginInitialiser(this));
PluginIdFilter filer = new PluginIdFilter(pluginNames);
loader.Add("/OpenSim/GridServer", filer);
loader.Load();
m_plugins = loader.Plugins;
}
public override void ShutdownSpecific()
{
foreach (IGridPlugin plugin in m_plugins) plugin.Dispose();

View File

@ -1,150 +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 OpenSim 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.IO;
using System.Reflection;
using log4net;
using log4net.Config;
using OpenMetaverse;
using OpenSim.Data;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Statistics;
using OpenSim.Grid.Communications.OGS1;
using OpenSim.Grid.Framework;
using OpenSim.Grid.UserServer.Modules;
namespace OpenSim.Grid.UserServer
{
/// <summary>
/// Grid user server main class
/// </summary>
public class OpenUser_Main : BaseOpenSimServer, IGridServiceCore
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected UserConfig Cfg;
protected UserServerPlugin m_serverPlugin;
public static void Main(string[] args)
{
XmlConfigurator.Configure();
m_log.Info("Launching UserServer...");
OpenUser_Main userserver = new OpenUser_Main();
userserver.Startup();
userserver.Work();
}
public OpenUser_Main()
{
m_console = new ConsoleBase("User");
MainConsole.Instance = m_console;
}
public void Work()
{
m_console.Notice("Enter help for a list of commands\n");
while (true)
{
m_console.Prompt();
}
}
protected override void StartupSpecific()
{
Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml")));
m_stats = StatsManager.StartCollectingUserStats();
m_httpServer = new BaseHttpServer(Cfg.HttpPort);
m_serverPlugin = new UserServerPlugin();
m_serverPlugin.Initialise(m_httpServer, this, Cfg);
m_httpServer.Start();
base.StartupSpecific();
}
public override void ShutdownSpecific()
{
}
#region IUGAIMCore
protected Dictionary<Type, object> m_moduleInterfaces = new Dictionary<Type, object>();
/// <summary>
/// Register an Module interface.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="iface"></param>
public void RegisterInterface<T>(T iface)
{
lock (m_moduleInterfaces)
{
if (!m_moduleInterfaces.ContainsKey(typeof(T)))
{
m_moduleInterfaces.Add(typeof(T), iface);
}
}
}
public bool TryGet<T>(out T iface)
{
if (m_moduleInterfaces.ContainsKey(typeof(T)))
{
iface = (T)m_moduleInterfaces[typeof(T)];
return true;
}
iface = default(T);
return false;
}
public T Get<T>()
{
return (T)m_moduleInterfaces[typeof(T)];
}
public BaseHttpServer GetHttpServer()
{
return m_httpServer;
}
#endregion
}
}

View File

@ -1,63 +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 OpenSim 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.Reflection;
using System.Runtime.InteropServices;
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly : AssemblyTitle("OGS-UserServer")]
[assembly : AssemblyDescription("")]
[assembly : AssemblyConfiguration("")]
[assembly : AssemblyCompany("http://opensimulator.org")]
[assembly : AssemblyProduct("OGS-UserServer")]
[assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers 2007-2009")]
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly : Guid("e266513a-090b-4d38-80f6-8599eef68c8c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly : AssemblyVersion("0.6.3.*")]
[assembly : AssemblyFileVersion("1.0.0.0")]

View File

@ -93,8 +93,11 @@ namespace OpenSim
string[] fileEntries = Directory.GetFiles(iniDirName);
foreach (string filePath in fileEntries)
{
// m_log.InfoFormat("reading ini file < {0} > from config dir", filePath);
ReadConfig(Path.GetFileName(filePath), filePath, m_config, false);
if (Path.GetExtension(filePath).ToLower() == ".ini")
{
// m_log.InfoFormat("reading ini file < {0} > from config dir", filePath);
ReadConfig(Path.GetFileName(filePath), filePath, m_config, false);
}
}
}

View File

@ -0,0 +1,30 @@
[Startup]
HttpPort = 8001
LoadPlugins = "GridServerPlugin,UserServerPlugin"
[UserServerConfig]
DatabaseProvider = "OpenSim.Data.MySql.dll"
DatabaseConnect = ""
DefaultStartupMsg = "Welcome to opensim"
DefaultX = 1000
DefaultY = 1000
GridRecvKey = "key"
GridSendKey = "key"
HttpSSL = false
DefaultUserLevel = 0
LibraryXmlfile = ".\inventory\Libraries.xml"
InventoryUrl = "http://127.0.0.1:8004/"
GridServerURL = "http://127.0.0.1:8001/"
EnableLLSDLogin = true
[GridServerConfig]
DatabaseProvider = "OpenSim.Data.MySql.dll"
DatabaseConnect = ""
DefaultAssetServer = "http://127.0.0.1:8003/"
DefaultUserServer = "http://127.0.0.1:8001/"
SimRecvKey = "key"
SimSendKey = "key"
UserRecvKey = "key"
UserSendKey = "key"
AssetRecvKey = "key"
AssetSendKey = "key"

View File

@ -742,6 +742,7 @@
<Reference name="OpenMetaverse.dll"/>
<Reference name="XMLRPC.dll"/>
<Reference name="log4net.dll"/>
<Reference name="Nini.dll" />
<Files>
<Match pattern="*.cs" recurse="true"/>
@ -969,44 +970,6 @@
</Project>
<Project name="OpenSim.Grid.UserServer" path="OpenSim/Grid/UserServer" type="Exe">
<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.Data"/>
<Reference name="System.Xml"/>
<Reference name="System.Web"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Framework.Communications"/>
<Reference name="OpenSim.Data"/>
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Framework.Statistics"/>
<Reference name="OpenSim.Grid.Communications.OGS1"/>
<Reference name="OpenSim.Grid.Framework"/>
<Reference name="OpenSim.Grid.GridServer"/>
<Reference name="OpenSim.Grid.UserServer.Modules"/>
<Reference name="OpenMetaverseTypes.dll"/>
<Reference name="OpenMetaverse.StructuredData.dll"/>
<Reference name="XMLRPC.dll"/>
<Reference name="log4net.dll"/>
<Reference name="DotNetOpenId.dll"/>
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>
<Project name="OpenSim.Grid.InventoryServer" path="OpenSim/Grid/InventoryServer" type="Exe">
<Configuration name="Debug">
<Options>