From e41eedc9aeba3eb36cdba4fcdf1e57bea976cab4 Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 27 Jun 2007 16:39:11 +0000 Subject: *Some more restructuring/fixing -- should compile, but high chance I forgot to add/remove something --- .../Communications.OGS1/GridCommsManager.cs | 18 -- .../Communications.OGS1/OGS1GridServices.cs | 248 --------------------- .../Communications.OGS1/OGSInterSimComms.cs | 70 ------ .../Communications.OGS1/OGSUserServices.cs | 25 --- .../OpenSim.Framework.Communications.OGS1.csproj | 142 ------------ ...enSim.Framework.Communications.OGS1.csproj.user | 12 - .../Communications.OGS1/Properties/AssemblyInfo.cs | 35 --- 7 files changed, 550 deletions(-) delete mode 100644 OpenSim/Framework/Communications.OGS1/GridCommsManager.cs delete mode 100644 OpenSim/Framework/Communications.OGS1/OGS1GridServices.cs delete mode 100644 OpenSim/Framework/Communications.OGS1/OGSInterSimComms.cs delete mode 100644 OpenSim/Framework/Communications.OGS1/OGSUserServices.cs delete mode 100644 OpenSim/Framework/Communications.OGS1/OpenSim.Framework.Communications.OGS1.csproj delete mode 100644 OpenSim/Framework/Communications.OGS1/OpenSim.Framework.Communications.OGS1.csproj.user delete mode 100644 OpenSim/Framework/Communications.OGS1/Properties/AssemblyInfo.cs (limited to 'OpenSim/Framework/Communications.OGS1') diff --git a/OpenSim/Framework/Communications.OGS1/GridCommsManager.cs b/OpenSim/Framework/Communications.OGS1/GridCommsManager.cs deleted file mode 100644 index 6687380..0000000 --- a/OpenSim/Framework/Communications.OGS1/GridCommsManager.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Types; -using OpenSim.Framework.Communications; -namespace OpenSim.Framework.Communications.OGS1 -{ - public class GridCommsManager : CommunicationsManager - { - private OGS1GridServices gridInterComms = new OGS1GridServices(); - public GridCommsManager(NetworkServersInfo serversInfo) :base(serversInfo) - { - GridServer = gridInterComms; - InterRegion = gridInterComms; - UserServer = new OGSUserServices(); - } - } -} diff --git a/OpenSim/Framework/Communications.OGS1/OGS1GridServices.cs b/OpenSim/Framework/Communications.OGS1/OGS1GridServices.cs deleted file mode 100644 index 408643f..0000000 --- a/OpenSim/Framework/Communications.OGS1/OGS1GridServices.cs +++ /dev/null @@ -1,248 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections; -using System.Text; -using System.Runtime.Remoting; -using System.Runtime.Remoting.Channels; -using System.Runtime.Remoting.Channels.Tcp; - -using OpenSim.Servers; -using OpenSim.Framework; -using OpenSim.Framework.Types; -using OpenSim.Framework.Communications; - -using Nwc.XmlRpc; -using libsecondlife; - -namespace OpenSim.Framework.Communications.OGS1 -{ - public class OGS1GridServices : IGridServices, IInterRegionCommunications - { - public Dictionary listeners = new Dictionary(); - public GridInfo grid; - public BaseHttpServer httpListener; - private bool initialised = false; - - public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo) - { - Hashtable GridParams = new Hashtable(); - - grid = gridInfo; - - // Login / Authentication - GridParams["authkey"] = gridInfo.GridServerSendKey; - GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated(); - GridParams["sim_ip"] = regionInfo.CommsExternalAddress; - GridParams["sim_port"] = regionInfo.CommsIPListenPort.ToString(); - - // Package into an XMLRPC Request - ArrayList SendParams = new ArrayList(); - SendParams.Add(GridParams); - - // Send Request - XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); - XmlRpcResponse GridResp = GridReq.Send(gridInfo.GridServerURI, 3000); - Hashtable GridRespData = (Hashtable)GridResp.Value; - Hashtable griddatahash = GridRespData; - - // Process Response - if (GridRespData.ContainsKey("error")) - { - string errorstring = (string)GridRespData["error"]; - OpenSim.Framework.Console.MainLog.Instance.Error("Unable to connect to grid: " + errorstring); - return null; - } - - if (!this.listeners.ContainsKey(regionInfo.RegionHandle)) - { - // initialised = true; - httpListener = new BaseHttpServer(regionInfo.CommsIPListenPort); - httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); - httpListener.Start(); - } - - // Initialise the background listeners - listeners[regionInfo.RegionHandle] = new RegionCommsListener(); - - return listeners[regionInfo.RegionHandle]; - } - - public List RequestNeighbours(RegionInfo regionInfo) - { - Hashtable respData = MapBlockQuery((int)regionInfo.RegionLocX - 1, (int)regionInfo.RegionLocY - 1, (int)regionInfo.RegionLocX + 1, (int)regionInfo.RegionLocY + 1); - - List neighbours = new List(); - - foreach (Hashtable n in (Hashtable)respData.Values) - { - RegionInfo neighbour = new RegionInfo(); - - //OGS1 - neighbour.RegionHandle = (ulong)n["regionhandle"]; - neighbour.RegionLocX = (uint)n["x"]; - neighbour.RegionLocY = (uint)n["y"]; - neighbour.RegionName = (string)n["name"]; - - //OGS1+ - neighbour.CommsIPListenAddr = (string)n["sim_ip"]; - neighbour.CommsIPListenPort = (int)n["sim_port"]; - neighbour.CommsExternalAddress = (string)n["sim_uri"]; - neighbour.SimUUID = (string)n["uuid"]; - - neighbours.Add(neighbour); - } - - return neighbours; - } - - public RegionInfo RequestNeighbourInfo(ulong regionHandle) - { - OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented - RequestNeighbourInfo()"); - return null; - } - - public List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) - { - Hashtable respData = MapBlockQuery(minX, minY, maxX, maxY); - - List neighbours = new List(); - - foreach (Hashtable n in (Hashtable)respData.Values) - { - MapBlockData neighbour = new MapBlockData(); - - neighbour.X = (ushort)n["x"]; - neighbour.Y = (ushort)n["y"]; - - neighbour.Name = (string)n["name"]; - neighbour.Access = (byte)n["access"]; - neighbour.RegionFlags = (uint)n["region-flags"]; - neighbour.WaterHeight = (byte)n["water-height"]; - neighbour.MapImageId = (string)n["map-image-id"]; - - neighbours.Add(neighbour); - } - - return neighbours; - } - - /// - /// Performs a XML-RPC query against the grid server returning mapblock information in the specified coordinates - /// - /// REDUNDANT - OGS1 is to be phased out in favour of OGS2 - /// Minimum X value - /// Minimum Y value - /// Maximum X value - /// Maximum Y value - /// Hashtable of hashtables containing map data elements - private Hashtable MapBlockQuery(int minX, int minY, int maxX, int maxY) - { - Hashtable param = new Hashtable(); - param["xmin"] = minX; - param["ymin"] = minY; - param["xmax"] = maxX; - param["ymax"] = maxY; - IList parameters = new ArrayList(); - parameters.Add(param); - XmlRpcRequest req = new XmlRpcRequest("map_block", parameters); - XmlRpcResponse resp = req.Send(grid.GridServerURI, 3000); - Hashtable respData = (Hashtable)resp.Value; - return respData; - } - - // Grid Request Processing - public XmlRpcResponse ExpectUser(XmlRpcRequest request) - { - Hashtable requestData = (Hashtable)request.Params[0]; - AgentCircuitData agentData = new AgentCircuitData(); - agentData.SessionID = new LLUUID((string)requestData["session_id"]); - agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]); - agentData.firstname = (string)requestData["firstname"]; - agentData.lastname = (string)requestData["lastname"]; - agentData.AgentID = new LLUUID((string)requestData["agent_id"]); - agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); - if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) - { - agentData.child = true; - } - else - { - agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"])); - agentData.child = false; - - } - - if (listeners.ContainsKey((ulong)requestData["regionhandle"])) - { - this.listeners[(ulong)requestData["regionhandle"]].TriggerExpectUser((ulong)requestData["regionhandle"], agentData); - } - else - { - OpenSim.Framework.Console.MainLog.Instance.Error("ExpectUser() - Unknown region " + ((ulong)requestData["regionhandle"]).ToString()); - } - - return new XmlRpcResponse(); - } - - #region InterRegion Comms - private void StartRemoting() - { - TcpChannel ch = new TcpChannel(8895); - ChannelServices.RegisterChannel(ch); - - WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry( Type.GetType("OGS1InterRegionRemoting"), "InterRegions", WellKnownObjectMode.Singleton); - RemotingConfiguration.RegisterWellKnownServiceType(wellType); - InterRegionSingleton.Instance.OnArrival += this.IncomingArrival; - InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent; - } - - #region Methods called by regions in this instance - public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) - { - if (this.listeners.ContainsKey(regionHandle)) - { - this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData); - return true; - } - //TODO need to see if we know about where this region is and use .net remoting - // to inform it. - return false; - } - - public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) - { - if (this.listeners.ContainsKey(regionHandle)) - { - this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position); - return true; - } - //TODO need to see if we know about where this region is and use .net remoting - // to inform it. - return false; - } - #endregion - - #region Methods triggered by calls from external instances - public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) - { - if (this.listeners.ContainsKey(regionHandle)) - { - this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData); - return true; - } - return false; - } - - public bool IncomingArrival(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) - { - if (this.listeners.ContainsKey(regionHandle)) - { - this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position); - return true; - } - return false; - } - #endregion - #endregion - } -} diff --git a/OpenSim/Framework/Communications.OGS1/OGSInterSimComms.cs b/OpenSim/Framework/Communications.OGS1/OGSInterSimComms.cs deleted file mode 100644 index 8ba257e..0000000 --- a/OpenSim/Framework/Communications.OGS1/OGSInterSimComms.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Types; -using OpenSim.Framework.Communications; -namespace OpenSim.Framework.Communications.OGS1 -{ - public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData); - public delegate bool ExpectArrival(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); - - public sealed class InterRegionSingleton - { - static readonly InterRegionSingleton instance = new InterRegionSingleton(); - - public event InformRegionChild OnChildAgent; - public event ExpectArrival OnArrival; - - static InterRegionSingleton() - { - } - - InterRegionSingleton() - { - } - - public static InterRegionSingleton Instance - { - get - { - return instance; - } - } - - public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) - { - if (OnChildAgent != null) - { - return OnChildAgent(regionHandle, agentData); - } - return false; - } - - public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) - { - if (OnArrival != null) - { - return OnArrival(regionHandle, agentID, position); - } - return false; - } - } - - public class OGS1InterRegionRemoting : MarshalByRefObject - { - - public OGS1InterRegionRemoting() - { - } - - public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) - { - return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData); - } - - public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) - { - return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position); - } - } -} diff --git a/OpenSim/Framework/Communications.OGS1/OGSUserServices.cs b/OpenSim/Framework/Communications.OGS1/OGSUserServices.cs deleted file mode 100644 index ff5fbbb..0000000 --- a/OpenSim/Framework/Communications.OGS1/OGSUserServices.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Data; -using libsecondlife; - -namespace OpenSim.Framework.Communications.OGS1 -{ - public class OGSUserServices :IUserServices - { - public UserProfileData GetUserProfile(string firstName, string lastName) - { - return null; - } - public UserProfileData GetUserProfile(string name) - { - return null; - } - public UserProfileData GetUserProfile(LLUUID avatarID) - { - return null; - } - } -} diff --git a/OpenSim/Framework/Communications.OGS1/OpenSim.Framework.Communications.OGS1.csproj b/OpenSim/Framework/Communications.OGS1/OpenSim.Framework.Communications.OGS1.csproj deleted file mode 100644 index 3985ee5..0000000 --- a/OpenSim/Framework/Communications.OGS1/OpenSim.Framework.Communications.OGS1.csproj +++ /dev/null @@ -1,142 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {6109024D-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Framework.Communications.OGS1 - JScript - Grid - IE50 - false - Library - - OpenSim.Framework.Communications.OGS1 - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\ - False - False - False - 4 - - - - - ..\..\..\bin\libsecondlife.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Runtime.Remoting.dll - False - - - System.Xml.dll - False - - - ..\..\..\bin\XMLRPC.dll - False - - - - - OpenSim.Framework - {8ACA2445-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Framework.Communications - {CB52B7E7-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Framework.Console - {A7CD0630-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Framework.Data - {36B72A9B-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Framework.Servers - {2CC71860-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/Framework/Communications.OGS1/OpenSim.Framework.Communications.OGS1.csproj.user b/OpenSim/Framework/Communications.OGS1/OpenSim.Framework.Communications.OGS1.csproj.user deleted file mode 100644 index 6841907..0000000 --- a/OpenSim/Framework/Communications.OGS1/OpenSim.Framework.Communications.OGS1.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - Debug - AnyCPU - C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ - 8.0.50727 - ProjectFiles - 0 - - - - diff --git a/OpenSim/Framework/Communications.OGS1/Properties/AssemblyInfo.cs b/OpenSim/Framework/Communications.OGS1/Properties/AssemblyInfo.cs deleted file mode 100644 index 0c6f965..0000000 --- a/OpenSim/Framework/Communications.OGS1/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OpenGrid.Framework.Communications.OGS1")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenGrid.Framework.Communications.OGS1")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a8b2b39b-c83b-41e2-b0b5-7ccfc1fddae7")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -- cgit v1.1