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) --- .../TestLocalCommsManager.cs | 17 +++++++++-------- Common/OpenSim.Framework/IRegionCommsHost.cs | 2 +- Common/OpenSim.Framework/RegionCommsHostBase.cs | 4 ++-- Common/OpenSim.Servers/LocalUserProfileManager.cs | 4 ++-- Common/OpenSim.Servers/LoginServer.cs | 5 +++-- 5 files changed, 17 insertions(+), 15 deletions(-) (limited to 'Common') diff --git a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs b/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs index 57049fc..b4fe696 100644 --- a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs +++ b/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs @@ -11,8 +11,8 @@ namespace OpenGrid.Framework.Communications { public class TestLocalCommsManager : RegionServerCommsManager { - protected Dictionary regions = new Dictionary(); - protected Dictionary regionHosts = new Dictionary(); + protected Dictionary regions = new Dictionary(); + protected Dictionary regionHosts = new Dictionary(); public TestLocalCommsManager() { @@ -28,9 +28,9 @@ namespace OpenGrid.Framework.Communications { if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) { - this.regions.Add((uint)regionInfo.RegionHandle, regionInfo); + this.regions.Add(regionInfo.RegionHandle, regionInfo); RegionCommsHostBase regionHost = new RegionCommsHostBase(); - this.regionHosts.Add((uint)regionInfo.RegionHandle, regionHost); + this.regionHosts.Add(regionInfo.RegionHandle, regionHost); return regionHost; } @@ -59,13 +59,14 @@ namespace OpenGrid.Framework.Communications } /// - /// + /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session /// /// /// /// - public bool AddNewSession(uint regionHandle, Login loginData) + public bool AddNewSession(ulong regionHandle, Login loginData) { + Console.WriteLine(" comms manager been told to expect new user"); AgentCircuitData agent = new AgentCircuitData(); agent.AgentID = loginData.Agent; agent.firstname = loginData.First; @@ -77,9 +78,9 @@ namespace OpenGrid.Framework.Communications agent.InventoryFolder = loginData.InventoryFolder; agent.startpos = new LLVector3(128, 128, 70); - if (this.regionHosts.ContainsKey((uint)regionHandle)) + if (this.regionHosts.ContainsKey(regionHandle)) { - this.regionHosts[(uint)regionHandle].TriggerExpectUser(agent); + this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent); return true; } diff --git a/Common/OpenSim.Framework/IRegionCommsHost.cs b/Common/OpenSim.Framework/IRegionCommsHost.cs index d115bb7..c56383e 100644 --- a/Common/OpenSim.Framework/IRegionCommsHost.cs +++ b/Common/OpenSim.Framework/IRegionCommsHost.cs @@ -6,7 +6,7 @@ using OpenSim.Framework.Types; namespace OpenSim.Framework { - public delegate void ExpectUserDelegate(AgentCircuitData agent); + public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); public delegate void UpdateNeighbours(List neighbours); public interface IRegionCommsHost diff --git a/Common/OpenSim.Framework/RegionCommsHostBase.cs b/Common/OpenSim.Framework/RegionCommsHostBase.cs index 782755e..41babe7 100644 --- a/Common/OpenSim.Framework/RegionCommsHostBase.cs +++ b/Common/OpenSim.Framework/RegionCommsHostBase.cs @@ -18,11 +18,11 @@ namespace OpenSim.Framework /// /// /// - public virtual bool TriggerExpectUser(AgentCircuitData agent) + public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) { if(OnExpectUser != null) { - OnExpectUser(agent); + OnExpectUser(regionHandle, agent); return true; } diff --git a/Common/OpenSim.Servers/LocalUserProfileManager.cs b/Common/OpenSim.Servers/LocalUserProfileManager.cs index a8b5f1f..99c640a 100644 --- a/Common/OpenSim.Servers/LocalUserProfileManager.cs +++ b/Common/OpenSim.Servers/LocalUserProfileManager.cs @@ -116,8 +116,8 @@ namespace OpenSim.UserServer Console.WriteLine("adding login data to gridserver"); ((LocalGridBase)this.m_gridServer).AddNewSession(_login); }*/ - - this.AddSession(_login); + ulong reghand = Helpers.UIntsToLong((regionX * 256), (regionY * 256)); + this.AddSession(reghand, _login); } } } diff --git a/Common/OpenSim.Servers/LoginServer.cs b/Common/OpenSim.Servers/LoginServer.cs index 6fd174b..d02c41e 100644 --- a/Common/OpenSim.Servers/LoginServer.cs +++ b/Common/OpenSim.Servers/LoginServer.cs @@ -47,7 +47,7 @@ using OpenSim.Framework.Types; namespace OpenSim.UserServer { - public delegate void AddNewSessionHandler(Login loginData); + public delegate bool AddNewSessionHandler(ulong regionHandle, Login loginData); /// /// When running in local (default) mode , handles client logins. /// @@ -196,7 +196,8 @@ namespace OpenSim.UserServer { ((LocalGridBase)m_gridServer).AddNewSession(_login); }*/ - AddSession(_login); + ulong reghand = Helpers.UIntsToLong((regionX * 256), (regionY * 256)); + AddSession(reghand,_login); return response; } -- cgit v1.1