From 564a97b508fd23601cd41075aa6a1f7de0800b41 Mon Sep 17 00:00:00 2001
From: MW
Date: Thu, 31 May 2007 15:31:31 +0000
Subject: Implementing a test Communications manager to test some of the
interfaces (likely this test version will morph into the sandbox version)
---
OpenSim/OpenSim.World/OpenSim.World.csproj | 4 ++++
OpenSim/OpenSim.World/World.cs | 29 ++++++++++++++++++++++++++++-
OpenSim/OpenSim/OpenSim.csproj | 4 ++++
OpenSim/OpenSim/OpenSimMain.cs | 10 +++++++---
4 files changed, 43 insertions(+), 4 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/OpenSim.World/OpenSim.World.csproj b/OpenSim/OpenSim.World/OpenSim.World.csproj
index 37293e1..78025d3 100644
--- a/OpenSim/OpenSim.World/OpenSim.World.csproj
+++ b/OpenSim/OpenSim.World/OpenSim.World.csproj
@@ -87,6 +87,10 @@
+
+ {C9702041-922C-452A-A1B4-7880AF53149A}
+ OpenGrid.Framework.Communications
+
OpenSim.Terrain.BasicTerrain
{2270B8FE-0000-0000-0000-000000000000}
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs
index c731dbc..69d4646 100644
--- a/OpenSim/OpenSim.World/World.cs
+++ b/OpenSim/OpenSim.World/World.cs
@@ -14,6 +14,7 @@ using OpenSim.Framework.Inventory;
using OpenSim.Framework;
using OpenSim.RegionServer.world.scripting;
using OpenSim.Terrain;
+using OpenGrid.Framework.Communications;
namespace OpenSim.world
{
@@ -36,6 +37,8 @@ namespace OpenSim.world
private Mutex updateLock;
public string m_datastore;
protected AuthenticateSessionsBase authenticateHandler;
+ protected RegionCommsHostBase regionCommsHost;
+ protected RegionServerCommsManager commsManager;
#region Properties
///
@@ -61,17 +64,19 @@ namespace OpenSim.world
/// Dictionary to contain client threads
/// Region Handle for this region
/// Region Name for this region
- public World(Dictionary clientThreads, RegionInfo regInfo, AuthenticateSessionsBase authen)
+ public World(Dictionary clientThreads, RegionInfo regInfo, AuthenticateSessionsBase authen, RegionServerCommsManager commsMan)
{
try
{
updateLock = new Mutex(false);
this.authenticateHandler = authen;
+ this.commsManager = commsMan;
m_clientThreads = clientThreads;
m_regInfo = regInfo;
m_regionHandle = m_regInfo.RegionHandle;
m_regionName = m_regInfo.RegionName;
this.m_datastore = m_regInfo.DataStore;
+ this.RegisterRegionWithComms();
m_scriptHandlers = new Dictionary();
m_scripts = new Dictionary();
@@ -540,5 +545,27 @@ namespace OpenSim.world
}
#endregion
+ #region RegionCommsHost
+
+ public void RegisterRegionWithComms()
+ {
+ this.regionCommsHost = this.commsManager.RegisterRegion(this.m_regInfo);
+ if (this.regionCommsHost != null)
+ {
+ this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection);
+ }
+ }
+
+ public void NewUserConnection(ulong regionHandle,AgentCircuitData agent)
+ {
+ Console.WriteLine("World.cs - add new user connection");
+ //should just check that its meant for this region
+ if (regionHandle == this.m_regInfo.RegionHandle)
+ {
+ this.authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
+ }
+ }
+
+ #endregion
}
}
diff --git a/OpenSim/OpenSim/OpenSim.csproj b/OpenSim/OpenSim/OpenSim.csproj
index 79abd9e..03ae6ab 100644
--- a/OpenSim/OpenSim/OpenSim.csproj
+++ b/OpenSim/OpenSim/OpenSim.csproj
@@ -87,6 +87,10 @@
+
+ {C9702041-922C-452A-A1B4-7880AF53149A}
+ OpenGrid.Framework.Communications
+
OpenSim.Terrain.BasicTerrain
{2270B8FE-0000-0000-0000-000000000000}
diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs
index 4aa48bd..66aadb0 100644
--- a/OpenSim/OpenSim/OpenSimMain.cs
+++ b/OpenSim/OpenSim/OpenSimMain.cs
@@ -51,6 +51,7 @@ using OpenSim.Physics.Manager;
using Nwc.XmlRpc;
using OpenSim.Servers;
using OpenSim.GenericConfig;
+using OpenGrid.Framework.Communications;
namespace OpenSim
{
@@ -58,6 +59,7 @@ namespace OpenSim
public class OpenSimMain : RegionServerBase, conscmd_callback
{
private CheckSumServer checkServer;
+ protected RegionServerCommsManager commsManager;
public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
{
@@ -101,10 +103,12 @@ namespace OpenSim
this.SetupLocalGridServers();
this.checkServer = new CheckSumServer(12036);
this.checkServer.ServerListener();
+ this.commsManager = new TestLocalCommsManager();
}
else
{
this.SetupRemoteGridServers();
+ this.commsManager = new TestLocalCommsManager(); //should be a remote comms manager class
}
startuptime = DateTime.Now;
@@ -126,8 +130,8 @@ namespace OpenSim
{
loginServer = new LoginServer(regionData[0].IPListenAddr, regionData[0].IPListenPort, regionData[0].RegionLocX, regionData[0].RegionLocY, false);
loginServer.Startup();
- loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler[0]).AddNewSession);
-
+ //loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler[0]).AddNewSession);
+ loginServer.SetSessionHandler(((TestLocalCommsManager)this.commsManager).AddNewSession);
//sandbox mode with loginserver not using accounts
httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
}
@@ -234,7 +238,7 @@ namespace OpenSim
m_console.componentname = "Region " + regionData.RegionName;
*/
- LocalWorld = new World(udpServer.PacketServer.ClientAPIs, regionDat, authenBase);
+ LocalWorld = new World(udpServer.PacketServer.ClientAPIs, regionDat, authenBase, commsManager);
this.m_localWorld.Add(LocalWorld);
//LocalWorld.InventoryCache = InventoryCache;
//LocalWorld.AssetCache = AssetCache;
--
cgit v1.1