From d93031b2dc2b86c194a12d9170acb9e1d7cb0aff Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 11 Jun 2007 09:53:34 +0000 Subject: Renamed sandBoxManager to LocalBackEndServices --- .../GridServer/GridCommsManagerLocal.cs | 4 +- .../InterSimComms/InterSimsCommsLocal.cs | 4 +- .../LocalBackEndServices.cs | 117 +++++++++++++++++++++ .../OpenGrid.Framework.Communications.csproj | 35 +++--- .../OpenGrid.Framework.Communications.dll.build | 2 +- .../RegionServerCommsLocal.cs | 2 +- .../SandBoxManager.cs | 117 --------------------- 7 files changed, 144 insertions(+), 137 deletions(-) create mode 100644 Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs delete mode 100644 Common/OpenGrid.Framework.Communications/SandBoxManager.cs (limited to 'Common') diff --git a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs index bf7d5b9..54c62d6 100644 --- a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs +++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs @@ -11,9 +11,9 @@ namespace OpenGrid.Framework.Communications.GridServer { public class GridCommsManagerLocal : GridCommsManagerBase { - private SandBoxManager sandBoxManager; + private LocalBackEndServices sandBoxManager; - public GridCommsManagerLocal(SandBoxManager sandManager) + public GridCommsManagerLocal(LocalBackEndServices sandManager) { sandBoxManager = sandManager; } diff --git a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs index bce146f..a56e1f0 100644 --- a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs +++ b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs @@ -8,9 +8,9 @@ namespace OpenGrid.Framework.Communications { public class InterSimsCommsLocal : InterSimsCommsBase { - private SandBoxManager sandBoxManager; + private LocalBackEndServices sandBoxManager; - public InterSimsCommsLocal(SandBoxManager sandManager) + public InterSimsCommsLocal(LocalBackEndServices sandManager) { sandBoxManager = sandManager; } diff --git a/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs b/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs new file mode 100644 index 0000000..b213213 --- /dev/null +++ b/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework; +using OpenSim.Framework.Types; + +using libsecondlife; + +namespace OpenGrid.Framework.Communications +{ + public class LocalBackEndServices + { + protected Dictionary regions = new Dictionary(); + protected Dictionary regionHosts = new Dictionary(); + + public LocalBackEndServices() + { + + } + + /// + /// Register a region method with the BackEnd Services. + /// + /// + /// + public RegionCommsHostBase RegisterRegion(RegionInfo regionInfo) + { + //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); + if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) + { + //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); + this.regions.Add(regionInfo.RegionHandle, regionInfo); + RegionCommsHostBase regionHost = new RegionCommsHostBase(); + this.regionHosts.Add(regionInfo.RegionHandle, regionHost); + + return regionHost; + } + + //already in our list of regions so for now lets return null + return null; + } + + /// + /// + /// + /// + public List RequestNeighbours(RegionInfo regionInfo) + { + // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle); + List neighbours = new List(); + + foreach (RegionInfo reg in this.regions.Values) + { + // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY); + if (reg.RegionHandle != regionInfo.RegionHandle) + { + //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location"); + if ((reg.RegionLocX > (regionInfo.RegionLocX - 2)) && (reg.RegionLocX < (regionInfo.RegionLocX + 2))) + { + if ((reg.RegionLocY > (regionInfo.RegionLocY - 2)) && (reg.RegionLocY < (regionInfo.RegionLocY + 2))) + { + neighbours.Add(reg); + } + } + } + } + return neighbours; + } + + /// + /// + /// + /// + /// + public bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData + { + //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); + if (this.regionHosts.ContainsKey(regionHandle)) + { + // Console.WriteLine("CommsManager- Informing a region to expect child agent"); + this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData); + return true; + } + return false; + } + + /// + /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session + /// + /// + /// + /// + 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; + agent.lastname = loginData.Last; + agent.SessionID = loginData.Session; + agent.SecureSessionID = loginData.SecureSession; + agent.circuitcode = loginData.CircuitCode; + agent.BaseFolder = loginData.BaseFolder; + agent.InventoryFolder = loginData.InventoryFolder; + agent.startpos = new LLVector3(128, 128, 70); + + if (this.regionHosts.ContainsKey(regionHandle)) + { + this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent); + return true; + } + + // region not found + return false; + } + } +} diff --git a/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj b/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj index e8f10f0..dcf09d9 100644 --- a/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj +++ b/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,7 +6,8 @@ {683344D5-0000-0000-0000-000000000000} Debug AnyCPU - + + OpenGrid.Framework.Communications @@ -15,9 +16,11 @@ IE50 false Library - + + OpenGrid.Framework.Communications - + + @@ -28,7 +31,8 @@ TRACE;DEBUG - + + True 4096 False @@ -37,7 +41,8 @@ False False 4 - + + False @@ -46,7 +51,8 @@ TRACE - + + False 4096 True @@ -55,18 +61,19 @@ False False 4 - + + - + System.dll False - + System.Xml.dll False - + ..\..\bin\libsecondlife.dll False @@ -76,7 +83,7 @@ OpenSim.Framework {8ACA2445-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False @@ -89,7 +96,7 @@ Code - + Code @@ -130,4 +137,4 @@ - + \ No newline at end of file diff --git a/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.dll.build b/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.dll.build index 069983c..4036747 100644 --- a/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.dll.build +++ b/Common/OpenGrid.Framework.Communications/OpenGrid.Framework.Communications.dll.build @@ -11,10 +11,10 @@ + - diff --git a/Common/OpenGrid.Framework.Communications/RegionServerCommsLocal.cs b/Common/OpenGrid.Framework.Communications/RegionServerCommsLocal.cs index aeaeb7b..02ac43b 100644 --- a/Common/OpenGrid.Framework.Communications/RegionServerCommsLocal.cs +++ b/Common/OpenGrid.Framework.Communications/RegionServerCommsLocal.cs @@ -11,7 +11,7 @@ namespace OpenGrid.Framework.Communications { public class RegionServerCommsLocal : RegionServerCommsManager { - public SandBoxManager SandManager = new SandBoxManager(); + public LocalBackEndServices SandManager = new LocalBackEndServices(); public RegionServerCommsLocal() { UserServer = new UserServer.UserCommsManagerLocal(); //Local User Server diff --git a/Common/OpenGrid.Framework.Communications/SandBoxManager.cs b/Common/OpenGrid.Framework.Communications/SandBoxManager.cs deleted file mode 100644 index dc2c3cb..0000000 --- a/Common/OpenGrid.Framework.Communications/SandBoxManager.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework; -using OpenSim.Framework.Types; - -using libsecondlife; - -namespace OpenGrid.Framework.Communications -{ - public class SandBoxManager - { - protected Dictionary regions = new Dictionary(); - protected Dictionary regionHosts = new Dictionary(); - - public SandBoxManager() - { - - } - - /// - /// Register a region method with the SandBoxManager. - /// - /// - /// - public RegionCommsHostBase RegisterRegion(RegionInfo regionInfo) - { - //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); - if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) - { - //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); - this.regions.Add(regionInfo.RegionHandle, regionInfo); - RegionCommsHostBase regionHost = new RegionCommsHostBase(); - this.regionHosts.Add(regionInfo.RegionHandle, regionHost); - - return regionHost; - } - - //already in our list of regions so for now lets return null - return null; - } - - /// - /// - /// - /// - public List RequestNeighbours(RegionInfo regionInfo) - { - // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle); - List neighbours = new List(); - - foreach (RegionInfo reg in this.regions.Values) - { - // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY); - if (reg.RegionHandle != regionInfo.RegionHandle) - { - //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location"); - if ((reg.RegionLocX > (regionInfo.RegionLocX - 2)) && (reg.RegionLocX < (regionInfo.RegionLocX + 2))) - { - if ((reg.RegionLocY > (regionInfo.RegionLocY - 2)) && (reg.RegionLocY < (regionInfo.RegionLocY + 2))) - { - neighbours.Add(reg); - } - } - } - } - return neighbours; - } - - /// - /// - /// - /// - /// - public bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData - { - //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); - if (this.regionHosts.ContainsKey(regionHandle)) - { - // Console.WriteLine("CommsManager- Informing a region to expect child agent"); - this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData); - return true; - } - return false; - } - - /// - /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session - /// - /// - /// - /// - 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; - agent.lastname = loginData.Last; - agent.SessionID = loginData.Session; - agent.SecureSessionID = loginData.SecureSession; - agent.circuitcode = loginData.CircuitCode; - agent.BaseFolder = loginData.BaseFolder; - agent.InventoryFolder = loginData.InventoryFolder; - agent.startpos = new LLVector3(128, 128, 70); - - if (this.regionHosts.ContainsKey(regionHandle)) - { - this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent); - return true; - } - - // region not found - return false; - } - } -} -- cgit v1.1