* Restructured the RegionApplicationBase.

afrisby
lbsa71 2007-07-16 18:10:27 +00:00
parent ddf73763db
commit 4a17587b8d
3 changed files with 23 additions and 67 deletions

View File

@ -9,7 +9,7 @@ using libsecondlife.Packets;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
public class NpcClientBase :IClientAPI public class NpcClientBase : IClientAPI
{ {
public event ImprovedInstantMessage OnInstantMessage; public event ImprovedInstantMessage OnInstantMessage;
public event ChatFromViewer OnChatFromViewer; public event ChatFromViewer OnChatFromViewer;

View File

@ -52,6 +52,15 @@ namespace OpenSim
public class OpenSimMain : RegionApplicationBase, conscmd_callback public class OpenSimMain : RegionApplicationBase, conscmd_callback
{ {
public string m_physicsEngine;
protected IGenericConfig localConfig;
public bool m_sandbox = false;
public bool m_loginserver;
public bool user_accounts = false;
public bool gridLocalAsset = false;
protected bool configFileSetup = false;
public string m_config;
protected CommunicationsManager commsManager; protected CommunicationsManager commsManager;
// private CheckSumServer checkServer; // private CheckSumServer checkServer;
@ -59,6 +68,7 @@ namespace OpenSim
private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log"; private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log";
public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile) public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
:base( )
{ {
this.configFileSetup = useConfigFile; this.configFileSetup = useConfigFile;
m_sandbox = sandBoxMode; m_sandbox = sandBoxMode;
@ -71,7 +81,7 @@ namespace OpenSim
/// <summary> /// <summary>
/// Performs initialisation of the world, such as loading configuration from disk. /// Performs initialisation of the world, such as loading configuration from disk.
/// </summary> /// </summary>
public override void StartUp() public void StartUp()
{ {
this.serversData = new NetworkServersInfo(); this.serversData = new NetworkServersInfo();
@ -109,8 +119,8 @@ namespace OpenSim
startuptime = DateTime.Now; startuptime = DateTime.Now;
this.physManager = new PhysicsManager(); this.m_physicsManager = new PhysicsManager();
this.physManager.LoadPlugins(); this.m_physicsManager.LoadPlugins();
this.SetupScene(); this.SetupScene();
@ -129,7 +139,7 @@ namespace OpenSim
} }
# region Setup methods # region Setup methods
protected override void SetupLocalGridServers() protected void SetupLocalGridServers()
{ {
try try
{ {
@ -145,7 +155,7 @@ namespace OpenSim
} }
protected override void SetupRemoteGridServers() protected void SetupRemoteGridServers()
{ {
try try
{ {
@ -160,7 +170,7 @@ namespace OpenSim
} }
} }
protected override void SetupScene() protected void SetupScene()
{ {
IGenericConfig regionConfig; IGenericConfig regionConfig;
Scene scene; Scene scene;
@ -221,8 +231,7 @@ namespace OpenSim
scene.LoadStorageDLL("OpenSim.Region.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded. scene.LoadStorageDLL("OpenSim.Region.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded.
scene.LoadWorldMap(); scene.LoadWorldMap();
m_log.Verbose("Main.cs:Startup() - Starting up messaging system"); scene.PhysScene = this.m_physicsManager.GetPhysicsScene( this.m_physicsEngine );
scene.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
scene.PhysScene.SetTerrain(scene.Terrain.getHeights1D()); scene.PhysScene.SetTerrain(scene.Terrain.getHeights1D());
scene.LoadPrimsFromStorage(); scene.LoadPrimsFromStorage();
@ -268,7 +277,7 @@ namespace OpenSim
} }
} }
protected override void SetupHttpListener() protected void SetupHttpListener()
{ {
httpServer = new BaseHttpServer(this.serversData.HttpListenerPort); //regionData[0].IPListenPort); httpServer = new BaseHttpServer(this.serversData.HttpListenerPort); //regionData[0].IPListenPort);
@ -278,7 +287,7 @@ namespace OpenSim
} }
} }
protected override void ConnectToRemoteGridServer() protected void ConnectToRemoteGridServer()
{ {
} }

View File

@ -42,22 +42,13 @@ namespace OpenSim.Region.ClientStack
{ {
public class RegionApplicationBase public class RegionApplicationBase
{ {
protected IGenericConfig localConfig; protected PhysicsManager m_physicsManager;
protected PhysicsManager physManager;
protected AssetCache AssetCache; protected AssetCache AssetCache;
protected InventoryCache InventoryCache; protected InventoryCache InventoryCache;
protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
protected DateTime startuptime; protected DateTime startuptime;
protected NetworkServersInfo serversData; protected NetworkServersInfo serversData;
public string m_physicsEngine;
public bool m_sandbox = false;
public bool m_loginserver;
public bool user_accounts = false;
public bool gridLocalAsset = false;
protected bool configFileSetup = false;
public string m_config;
protected List<UDPServer> m_udpServer = new List<UDPServer>(); protected List<UDPServer> m_udpServer = new List<UDPServer>();
protected List<RegionInfo> regionData = new List<RegionInfo>(); protected List<RegionInfo> regionData = new List<RegionInfo>();
protected List<IWorld> m_localWorld = new List<IWorld>(); protected List<IWorld> m_localWorld = new List<IWorld>();
@ -66,53 +57,9 @@ namespace OpenSim.Region.ClientStack
protected LogBase m_log; protected LogBase m_log;
public RegionApplicationBase() public RegionApplicationBase( )
{ {
}
public RegionApplicationBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
{
this.configFileSetup = useConfigFile;
m_sandbox = sandBoxMode;
m_loginserver = startLoginServer;
m_physicsEngine = physicsEngine;
m_config = configFile;
}
/*protected World m_localWorld;
public World LocalWorld
{
get { return m_localWorld; }
}*/
/// <summary>
/// Performs initialisation of the world, such as loading configuration from disk.
/// </summary>
public virtual void StartUp()
{
}
protected virtual void SetupLocalGridServers()
{
}
protected virtual void SetupRemoteGridServers()
{
}
protected virtual void SetupScene()
{
}
protected virtual void SetupHttpListener()
{
}
protected virtual void ConnectToRemoteGridServer()
{
} }
} }
} }