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/World.cs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'OpenSim/OpenSim.World/World.cs') 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 } } -- cgit v1.1