From e392e222a83ee04ee25c00e26dfad5f47ffa69b8 Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 27 Jun 2007 16:55:27 +0000 Subject: *Added some missing files I forgot to add...OpenSim.sln should compile now --- .../Communications/Local/CommunicationsLocal.cs | 61 +++++ .../Communications/Local/LocalBackEndServices.cs | 209 +++++++++++++++++ .../Communications/Local/LocalUserServices.cs | 118 ++++++++++ .../OpenSim.Region.Communications.Local.csproj | 128 +++++++++++ .../Local/Properties/AssemblyInfo.cs | 35 +++ .../Region/Communications/OGS1/GridCommsManager.cs | 18 ++ .../Region/Communications/OGS1/OGS1GridServices.cs | 248 +++++++++++++++++++++ .../Region/Communications/OGS1/OGSInterSimComms.cs | 70 ++++++ .../Region/Communications/OGS1/OGSUserServices.cs | 25 +++ .../OGS1/OpenSim.Region.Communications.OGS1.csproj | 149 +++++++++++++ .../Communications/OGS1/Properties/AssemblyInfo.cs | 35 +++ 11 files changed, 1096 insertions(+) create mode 100644 OpenSim/Region/Communications/Local/CommunicationsLocal.cs create mode 100644 OpenSim/Region/Communications/Local/LocalBackEndServices.cs create mode 100644 OpenSim/Region/Communications/Local/LocalUserServices.cs create mode 100644 OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj create mode 100644 OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs create mode 100644 OpenSim/Region/Communications/OGS1/GridCommsManager.cs create mode 100644 OpenSim/Region/Communications/OGS1/OGS1GridServices.cs create mode 100644 OpenSim/Region/Communications/OGS1/OGSInterSimComms.cs create mode 100644 OpenSim/Region/Communications/OGS1/OGSUserServices.cs create mode 100644 OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj create mode 100644 OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs new file mode 100644 index 0000000..c98cd11 --- /dev/null +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -0,0 +1,61 @@ +/* +* Copyright (c) Contributors, http://www.openmetaverse.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using OpenSim.Framework; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Types; +using OpenSim.Framework.Communications; + + +namespace OpenSim.Region.Communications.Local +{ + public class CommunicationsLocal : CommunicationsManager + { + public LocalBackEndServices SandBoxServices = new LocalBackEndServices(); + public LocalUserServices UserServices; + + public CommunicationsLocal(NetworkServersInfo serversInfo) + : base(serversInfo) + { + UserServices = new LocalUserServices(this , serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY); + UserServices.AddPlugin("OpenGrid.Framework.Data.DB4o.dll"); + UserServer = UserServices; + GridServer = SandBoxServices; + InterRegion = SandBoxServices; + } + + internal void InformRegionOfLogin(ulong regionHandle, Login login) + { + this.SandBoxServices.AddNewSession(regionHandle, login); + } + } +} diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs new file mode 100644 index 0000000..ae47890 --- /dev/null +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -0,0 +1,209 @@ +/* +* Copyright (c) Contributors, http://www.openmetaverse.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using OpenSim.Framework.Types; +using OpenSim.Framework; +using OpenSim.Framework.Communications; + +namespace OpenSim.Region.Communications.Local +{ + + public class LocalBackEndServices : IGridServices, IInterRegionCommunications + { + protected Dictionary regions = new Dictionary(); + protected Dictionary regionHosts = new Dictionary(); + + public LocalBackEndServices() + { + + } + + /// + /// Register a region method with the BackEnd Services. + /// + /// + /// + public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo) + { + //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); + RegionCommsListener regionHost = new RegionCommsListener(); + 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 RegionInfo RequestNeighbourInfo(ulong regionHandle) + { + if (this.regions.ContainsKey(regionHandle)) + { + return this.regions[regionHandle]; + } + return null; + } + + /// + /// + /// + /// + /// + /// + /// + /// + public List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) + { + List mapBlocks = new List(); + foreach(RegionInfo regInfo in this.regions.Values) + { + if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY))) + { + MapBlockData map = new MapBlockData(); + map.Name = regInfo.RegionName; + map.X = (ushort)regInfo.RegionLocX; + map.Y = (ushort)regInfo.RegionLocY; + map.WaterHeight =(byte) regInfo.estateSettings.waterHeight; + map.MapImageId = regInfo.estateSettings.terrainImageID; //new LLUUID("00000000-0000-0000-9999-000000000007"); + map.Agents = 1; + map.RegionFlags = 72458694; + map.Access = 13; + mapBlocks.Add(map); + } + } + return mapBlocks; + } + + /// + /// + /// + /// + /// + public bool InformRegionOfChildAgent(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; + } + + /// + /// + /// + /// + /// + /// + /// + public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + { + if (this.regionHosts.ContainsKey(regionHandle)) + { + // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); + this.regionHosts[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position); + 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); + agent.CapsPath = loginData.CapsPath; + + if (this.regionHosts.ContainsKey(regionHandle)) + { + this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent); + return true; + } + + // region not found + return false; + } + } +} + diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs new file mode 100644 index 0000000..1eb574c --- /dev/null +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +using OpenSim.Framework.Communications; +//using OpenSim.Framework.User; +using OpenSim.Framework.UserManagement; +using OpenSim.Framework.Data; +using OpenSim.Framework.Types; +using OpenSim.Framework.Utilities; + +using libsecondlife; + +namespace OpenSim.Region.Communications.Local +{ + public class LocalUserServices : UserManagerBase, IUserServices + { + private CommunicationsLocal m_Parent; + + private uint defaultHomeX ; + private uint defaultHomeY; + public LocalUserServices(CommunicationsLocal parent, uint defHomeX, uint defHomeY) + { + m_Parent = parent; + defaultHomeX = defHomeX; + defaultHomeY = defHomeY; + } + + public UserProfileData GetUserProfile(string firstName, string lastName) + { + return GetUserProfile(firstName + " " + lastName); + } + + public UserProfileData GetUserProfile(string name) + { + return this.getUserProfile(name); + } + public UserProfileData GetUserProfile(LLUUID avatarID) + { + return this.getUserProfile(avatarID); + } + + /// + /// + /// + /// + public override string GetMessage() + { + return "Welcome to OpenSim"; + } + + public override UserProfileData GetTheUser(string firstname, string lastname) + { + UserProfileData profile = getUserProfile(firstname, lastname); + if (profile != null) + { + + return profile; + } + + //no current user account so make one + Console.WriteLine("No User account found so creating a new one "); + this.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY); + + profile = getUserProfile(firstname, lastname); + + return profile; + } + + public override bool AuthenticateUser(ref UserProfileData profile, string password) + { + //for now we will accept any password in sandbox mode + Console.WriteLine("authorising user"); + return true; + } + + public override void CustomiseResponse(ref LoginResponse response, ref UserProfileData theUser) + { + ulong currentRegion = theUser.currentAgent.currentHandle; + RegionInfo reg = m_Parent.GridServer.RequestNeighbourInfo(currentRegion); + + + if (reg != null) + { + response.Home = "{'region_handle':[r" + (reg.RegionLocX * 256).ToString() + ",r" + (reg.RegionLocY * 256).ToString() + "], " + + "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + + "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; + string capsPath = Util.GetRandomCapsPath(); + response.SimAddress = reg.CommsIPListenAddr; + response.SimPort = (Int32)reg.CommsIPListenPort; + response.RegionX = reg.RegionLocX ; + response.RegionY = reg.RegionLocY ; + response.SeedCapability = "http://" + reg.CommsIPListenAddr + ":" + "9000" + "/CAPS/" + capsPath + "0000/"; + theUser.currentAgent.currentRegion = reg.SimUUID; + theUser.currentAgent.currentHandle = reg.RegionHandle; + + Login _login = new Login(); + //copy data to login object + _login.First = response.Firstname; + _login.Last = response.Lastname; + _login.Agent = response.AgentID; + _login.Session = response.SessionID; + _login.SecureSession = response.SecureSessionID; + _login.CircuitCode = (uint)response.CircuitCode; + _login.CapsPath = capsPath; + + m_Parent.InformRegionOfLogin(currentRegion, _login); + } + else + { + Console.WriteLine("not found region " + currentRegion); + } + + } + + } +} diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj new file mode 100644 index 0000000..1a20965 --- /dev/null +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -0,0 +1,128 @@ + + + Local + 8.0.50727 + 2.0 + {EB3A1BA8-0000-0000-0000-000000000000} + Debug + AnyCPU + + + + + OpenSim.Region.Communications.Local + JScript + Grid + IE50 + false + Library + + + OpenSim.Region.Communications.Local + + + + + + + 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.Xml.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.Data + {36B72A9B-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + + + OpenSim.Framework.UserManagement + {586E2916-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + + + + + Code + + + Code + + + Code + + + Code + + + + + + + + + + \ No newline at end of file diff --git a/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1eb7107 --- /dev/null +++ b/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +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("OpenSim.Region.Communications.Local")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenSim.Region.Communications.Local")] +[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("fb173926-bd0a-4cd0-bb45-185b2f72ddfb")] + +// 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")] diff --git a/OpenSim/Region/Communications/OGS1/GridCommsManager.cs b/OpenSim/Region/Communications/OGS1/GridCommsManager.cs new file mode 100644 index 0000000..77848fa --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/GridCommsManager.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Types; +using OpenSim.Framework.Communications; +namespace OpenSim.Region.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/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs new file mode 100644 index 0000000..5f0c80c --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -0,0 +1,248 @@ +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.Framework.Servers; +using OpenSim.Framework; +using OpenSim.Framework.Types; +using OpenSim.Framework.Communications; + +using Nwc.XmlRpc; +using libsecondlife; + +namespace OpenSim.Region.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/Region/Communications/OGS1/OGSInterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGSInterSimComms.cs new file mode 100644 index 0000000..51b33e9 --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/OGSInterSimComms.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Types; +using OpenSim.Framework.Communications; +namespace OpenSim.Region.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/Region/Communications/OGS1/OGSUserServices.cs b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs new file mode 100644 index 0000000..012774d --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Data; +using libsecondlife; + +namespace OpenSim.Region.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/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj new file mode 100644 index 0000000..4bda6c9 --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -0,0 +1,149 @@ + + + Local + 8.0.50727 + 2.0 + {6109024D-0000-0000-0000-000000000000} + Debug + AnyCPU + + + + + OpenSim.Region.Communications.OGS1 + JScript + Grid + IE50 + false + Library + + + OpenSim.Region.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 + + + + + + False + ..\..\..\..\bin\libsecondlife.dll + + + System.dll + False + + + System.Data.dll + False + + + System.Runtime.Remoting.dll + False + + + System.Xml.dll + False + + + False + ..\..\..\..\bin\XMLRPC.dll + + + + + 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 + + + + + + + + + + \ No newline at end of file diff --git a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0c6f965 --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +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 From fe120533efd0ec6b2248d96b9a1f8b7637c5dadd Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 27 Jun 2007 17:12:32 +0000 Subject: *Updated prebuild.xml and ran prebuild again *Removed .user, .suo, and unneccessary files in /bin/Physics/ *OpenSim.sln should compile with nant and on windows now --- .../OpenSim.Region.Communications.Local.csproj | 45 ++++++++---------- .../OGS1/OpenSim.Region.Communications.OGS1.csproj | 55 ++++++++++------------ 2 files changed, 43 insertions(+), 57 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj index 1a20965..0a15a49 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -1,13 +1,12 @@ - + Local 8.0.50727 2.0 - {EB3A1BA8-0000-0000-0000-000000000000} + {BFB5D807-0000-0000-0000-000000000000} Debug AnyCPU - - + OpenSim.Region.Communications.Local @@ -16,11 +15,9 @@ IE50 false Library - - + OpenSim.Region.Communications.Local - - + @@ -31,18 +28,16 @@ TRACE;DEBUG - - + True 4096 False - ..\..\..\bin\ + ..\..\..\..\bin\ False False False 4 - - + False @@ -51,8 +46,7 @@ TRACE - - + False 4096 True @@ -61,19 +55,18 @@ False False 4 - - + - - ..\..\..\bin\libsecondlife.dll + + ..\..\..\..\bin\libsecondlife.dll False - + System.dll False - + System.Xml.dll False @@ -83,25 +76,25 @@ OpenSim.Framework {8ACA2445-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Communications {CB52B7E7-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Data {36B72A9B-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.UserManagement {586E2916-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False @@ -125,4 +118,4 @@ - \ No newline at end of file + diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index 4bda6c9..8cc5641 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -1,13 +1,12 @@ - + Local 8.0.50727 2.0 - {6109024D-0000-0000-0000-000000000000} + {4806E378-0000-0000-0000-000000000000} Debug AnyCPU - - + OpenSim.Region.Communications.OGS1 @@ -16,11 +15,9 @@ IE50 false Library - - + OpenSim.Region.Communications.OGS1 - - + @@ -31,18 +28,16 @@ TRACE;DEBUG - - + True 4096 False - ..\..\..\bin\ + ..\..\..\..\bin\ False False False 4 - - + False @@ -51,8 +46,7 @@ TRACE - - + False 4096 True @@ -61,33 +55,32 @@ False False 4 - - + - - False + ..\..\..\..\bin\libsecondlife.dll + False - + System.dll False - + System.Data.dll False - + System.Runtime.Remoting.dll False - + System.Xml.dll False - - False + ..\..\..\..\bin\XMLRPC.dll + False @@ -95,31 +88,31 @@ OpenSim.Framework {8ACA2445-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Communications {CB52B7E7-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Data {36B72A9B-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Servers {2CC71860-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False @@ -146,4 +139,4 @@ - \ No newline at end of file + -- cgit v1.1 From 1dcc814b703771c4dd96592b73727db2b54028a3 Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 27 Jun 2007 17:20:45 +0000 Subject: *More compile fixes (should be it on OpenSim.sln) --- .../Communications/Local/OpenSim.Region.Communications.Local.csproj | 6 +++--- .../Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj index 0a15a49..f9f6b7d 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -98,13 +98,13 @@ - + Code - + Code - + Code diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index 8cc5641..1aa7019 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -116,16 +116,16 @@ - + Code - + Code Code - + Code -- cgit v1.1 From 14ea54b44158a68aed767bbf5cc3497b4f64850c Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 28 Jun 2007 11:54:51 +0000 Subject: should now work. --- OpenSim/Region/Communications/Local/CommunicationsLocal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index c98cd11..8837bdb 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.Communications.Local : base(serversInfo) { UserServices = new LocalUserServices(this , serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY); - UserServices.AddPlugin("OpenGrid.Framework.Data.DB4o.dll"); + UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll"); UserServer = UserServices; GridServer = SandBoxServices; InterRegion = SandBoxServices; -- cgit v1.1 From 3456d951d89fbc83f742d40ca8ca2a1a79d414eb Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 28 Jun 2007 13:13:17 +0000 Subject: Imported the scripting changes, so now should be up to date with sugilite. --- .../Communications/Local/CommunicationsLocal.cs | 1 - .../OpenSim.Region.Communications.Local.csproj | 6 +-- .../OpenSim.Region.Communications.Local.dll.build | 48 ++++++++++++++++++++ .../OGS1/OpenSim.Region.Communications.OGS1.csproj | 6 +-- .../OpenSim.Region.Communications.OGS1.dll.build | 53 ++++++++++++++++++++++ 5 files changed, 107 insertions(+), 7 deletions(-) create mode 100644 OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build create mode 100644 OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 8837bdb..f5aa8ae 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -35,7 +35,6 @@ using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; using OpenSim.Framework.Communications; - namespace OpenSim.Region.Communications.Local { public class CommunicationsLocal : CommunicationsManager diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj index f9f6b7d..0a15a49 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -98,15 +98,15 @@ - - Code - Code Code + + Code + Code diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build new file mode 100644 index 0000000..3cac9d3 --- /dev/null +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index 1aa7019..8cc5641 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -116,16 +116,16 @@ - + Code - + Code Code - + Code diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build new file mode 100644 index 0000000..21bb15c --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.1 From bee543300fc812277e9a9478dc05b986e00ed44e Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 28 Jun 2007 14:45:46 +0000 Subject: *User Profile requests on OGS UserServer now uses XMLRPC instead of REST *Added base support for setting up a master user --- .../Communications/Local/LocalUserServices.cs | 25 ++++++++++++++++++++++ .../Region/Communications/OGS1/OGSUserServices.cs | 17 ++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 1eb574c..2097870 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -114,5 +114,30 @@ namespace OpenSim.Region.Communications.Local } + public UserProfileData SetupMasterUser(string firstName, string lastName) + { + return SetupMasterUser(firstName, lastName, ""); + } + public UserProfileData SetupMasterUser(string firstName, string lastName, string password) + { + UserProfileData profile = getUserProfile(firstName, lastName); + if (profile != null) + { + + return profile; + } + + Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account"); + this.AddUserProfile(firstName, lastName, password, defaultHomeX, defaultHomeY); + + profile = getUserProfile(firstName, lastName); + + if (profile == null) + { + Console.WriteLine("Unknown Master User after creation attempt. No clue what to do here."); + } + + return profile; + } } } diff --git a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs index 012774d..48d3018 100644 --- a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs @@ -11,7 +11,7 @@ namespace OpenSim.Region.Communications.OGS1 { public UserProfileData GetUserProfile(string firstName, string lastName) { - return null; + return GetUserProfile(firstName + " " + lastName); } public UserProfileData GetUserProfile(string name) { @@ -21,5 +21,20 @@ namespace OpenSim.Region.Communications.OGS1 { return null; } + + public UserProfileData SetupMasterUser(string firstName, string lastName) + { + return SetupMasterUser(firstName, lastName, ""); + } + + public UserProfileData SetupMasterUser(string firstName, string lastName, string password) + { + UserProfileData profile = GetUserProfile(firstName, lastName); + if (profile == null) + { + Console.WriteLine("Unknown Master User. Grid Mode: No clue what I should do. Probably would choose the grid owner UUID when that is implemented"); + } + return null; + } } } -- cgit v1.1 From 108d89f89436556c8f4662197903c374db943f7d Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 28 Jun 2007 16:17:20 +0000 Subject: *Master User is now set up *Added support for getting user profile information from remote grid server (untested) *Updated prebuild.xml --- .../Communications/Local/CommunicationsLocal.cs | 2 +- .../OpenSim.Region.Communications.Local.csproj | 6 +-- .../OpenSim.Region.Communications.Local.dll.build | 2 +- .../Region/Communications/OGS1/GridCommsManager.cs | 2 +- .../Region/Communications/OGS1/OGSUserServices.cs | 63 ++++++++++++++++++++++ .../OGS1/OpenSim.Region.Communications.OGS1.csproj | 4 +- .../OpenSim.Region.Communications.OGS1.dll.build | 4 +- 7 files changed, 73 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index f5aa8ae..bacaa3e 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -45,7 +45,7 @@ namespace OpenSim.Region.Communications.Local public CommunicationsLocal(NetworkServersInfo serversInfo) : base(serversInfo) { - UserServices = new LocalUserServices(this , serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY); + UserServices = new LocalUserServices(this,this.ServersInfo.DefaultHomeLocX,this.ServersInfo.DefaultHomeLocY); UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll"); UserServer = UserServices; GridServer = SandBoxServices; diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj index 0a15a49..200fa3a 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -98,15 +98,15 @@ - - Code - Code Code + + Code + Code diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build index 3cac9d3..60a90bd 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build @@ -11,9 +11,9 @@ - + diff --git a/OpenSim/Region/Communications/OGS1/GridCommsManager.cs b/OpenSim/Region/Communications/OGS1/GridCommsManager.cs index 77848fa..2bf9536 100644 --- a/OpenSim/Region/Communications/OGS1/GridCommsManager.cs +++ b/OpenSim/Region/Communications/OGS1/GridCommsManager.cs @@ -12,7 +12,7 @@ namespace OpenSim.Region.Communications.OGS1 { GridServer = gridInterComms; InterRegion = gridInterComms; - UserServer = new OGSUserServices(); + UserServer = new OGSUserServices(this); } } } diff --git a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs index 48d3018..d41bdaf 100644 --- a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs @@ -1,24 +1,87 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Text; +using OpenSim.Framework.Types; using OpenSim.Framework.Communications; using OpenSim.Framework.Data; using libsecondlife; +using Nwc.XmlRpc; + namespace OpenSim.Region.Communications.OGS1 { public class OGSUserServices :IUserServices { + GridCommsManager m_parent; + public OGSUserServices(GridCommsManager parent) + { + m_parent = parent; + } + + public UserProfileData ConvertXMLRPCDataToUserProfile(Hashtable data) + { + UserProfileData userData = new UserProfileData(); + userData.username = (string)data["firstname"]; + userData.surname = (string)data["lastname"]; + userData.UUID = new LLUUID((string)data["uuid"]); + userData.userInventoryURI = (string)data["server_inventory"]; + userData.userAssetURI = (string)data["server_asset"]; + userData.profileFirstText = (string)data["profile_firstlife_about"]; + userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]); + userData.profileCanDoMask = (uint)data["profile_can_do"]; + userData.profileWantDoMask = (uint)data["profile_want_do"]; + userData.profileImage = new LLUUID((string)data["profile_image"]); + userData.lastLogin = (int)data["profile_lastlogin"]; + userData.homeLocation = new LLVector3(); + userData.homeLookAt = new LLVector3(); + + return userData; + } public UserProfileData GetUserProfile(string firstName, string lastName) { return GetUserProfile(firstName + " " + lastName); } public UserProfileData GetUserProfile(string name) { + + try + { + Hashtable param = new Hashtable(); + param["avatar_name"] = name; + IList parameters = new ArrayList(); + parameters.Add(param); + XmlRpcRequest req = new XmlRpcRequest("get_user_by_name", parameters); + XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000); + Hashtable respData = (Hashtable)resp.Value; + + return ConvertXMLRPCDataToUserProfile(respData); + } + catch (Exception e) + { + Console.WriteLine("Error when trying to fetch profile data by name from remote user server: " + e.Message); + } return null; } public UserProfileData GetUserProfile(LLUUID avatarID) { + try + { + + Hashtable param = new Hashtable(); + param["avatar_uuid"] = avatarID.ToString(); + IList parameters = new ArrayList(); + parameters.Add(param); + XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", parameters); + XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000); + Hashtable respData = (Hashtable)resp.Value; + + return ConvertXMLRPCDataToUserProfile(respData); + } + catch (Exception e) + { + Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " + e.Message); + } return null; } diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index 8cc5641..2124bd9 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -116,13 +116,13 @@ - + Code Code - + Code diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build index 21bb15c..1a7cf69 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build @@ -11,9 +11,9 @@ - - + + -- cgit v1.1 From d3363bbc28442d70ea8c196e47e6c734f4c01a92 Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 28 Jun 2007 17:03:09 +0000 Subject: *Renamed GridCommsManager to CommunicationsOGS1 to match CommunicationsLocal -- its sandbox mode counterpart --- .../Communications/OGS1/CommunicationsOGS1.cs | 18 ++++++++ .../Region/Communications/OGS1/GridCommsManager.cs | 18 -------- .../Region/Communications/OGS1/OGSUserServices.cs | 4 +- .../OGS1/OpenSim.Region.Communications.OGS1.csproj | 49 ++++++++++++---------- 4 files changed, 48 insertions(+), 41 deletions(-) create mode 100644 OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs delete mode 100644 OpenSim/Region/Communications/OGS1/GridCommsManager.cs (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs new file mode 100644 index 0000000..f2b3b92 --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Types; +using OpenSim.Framework.Communications; +namespace OpenSim.Region.Communications.OGS1 +{ + public class CommunicationsOGS1 : CommunicationsManager + { + private OGS1GridServices gridInterComms = new OGS1GridServices(); + public CommunicationsOGS1(NetworkServersInfo serversInfo) :base(serversInfo) + { + GridServer = gridInterComms; + InterRegion = gridInterComms; + UserServer = new OGSUserServices(this); + } + } +} diff --git a/OpenSim/Region/Communications/OGS1/GridCommsManager.cs b/OpenSim/Region/Communications/OGS1/GridCommsManager.cs deleted file mode 100644 index 2bf9536..0000000 --- a/OpenSim/Region/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.Region.Communications.OGS1 -{ - public class GridCommsManager : CommunicationsManager - { - private OGS1GridServices gridInterComms = new OGS1GridServices(); - public GridCommsManager(NetworkServersInfo serversInfo) :base(serversInfo) - { - GridServer = gridInterComms; - InterRegion = gridInterComms; - UserServer = new OGSUserServices(this); - } - } -} diff --git a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs index d41bdaf..56a7837 100644 --- a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs @@ -13,8 +13,8 @@ namespace OpenSim.Region.Communications.OGS1 { public class OGSUserServices :IUserServices { - GridCommsManager m_parent; - public OGSUserServices(GridCommsManager parent) + CommunicationsOGS1 m_parent; + public OGSUserServices(CommunicationsOGS1 parent) { m_parent = parent; } diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index 2124bd9..b03ac7e 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,7 +6,8 @@ {4806E378-0000-0000-0000-000000000000} Debug AnyCPU - + + OpenSim.Region.Communications.OGS1 @@ -15,9 +16,11 @@ IE50 false Library - + + OpenSim.Region.Communications.OGS1 - + + @@ -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,30 +61,31 @@ 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 @@ -88,31 +95,31 @@ OpenSim.Framework {8ACA2445-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Communications {CB52B7E7-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Data {36B72A9B-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Servers {2CC71860-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False @@ -122,7 +129,7 @@ Code - + Code @@ -139,4 +146,4 @@ - + \ No newline at end of file -- cgit v1.1 From 41f26668d93dd871056ba506a306cd23e8573503 Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 28 Jun 2007 17:48:45 +0000 Subject: enabled physics plugin flying flags. --- OpenSim/Region/Communications/Local/LocalUserServices.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 2097870..508a3f9 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -36,6 +36,7 @@ namespace OpenSim.Region.Communications.Local { return this.getUserProfile(name); } + public UserProfileData GetUserProfile(LLUUID avatarID) { return this.getUserProfile(avatarID); @@ -118,6 +119,7 @@ namespace OpenSim.Region.Communications.Local { return SetupMasterUser(firstName, lastName, ""); } + public UserProfileData SetupMasterUser(string firstName, string lastName, string password) { UserProfileData profile = getUserProfile(firstName, lastName); -- cgit v1.1 From fe0528b98cfc13d26ac7f1bf6bc23655be1f52e5 Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 28 Jun 2007 19:09:50 +0000 Subject: *Added UUIDNameRequest packet support (untested, but should work -- at least in sandbox mode) *Various small renamings --- .../Communications/OGS1/CommunicationsOGS1.cs | 2 +- .../Communications/OGS1/OGS1InterSimComms.cs | 70 +++++++++++++ .../Region/Communications/OGS1/OGS1UserServices.cs | 109 +++++++++++++++++++++ .../Region/Communications/OGS1/OGSInterSimComms.cs | 70 ------------- .../Region/Communications/OGS1/OGSUserServices.cs | 103 ------------------- .../OGS1/OpenSim.Region.Communications.OGS1.csproj | 51 +++++----- .../OpenSim.Region.Communications.OGS1.dll.build | 6 +- 7 files changed, 205 insertions(+), 206 deletions(-) create mode 100644 OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs create mode 100644 OpenSim/Region/Communications/OGS1/OGS1UserServices.cs delete mode 100644 OpenSim/Region/Communications/OGS1/OGSInterSimComms.cs delete mode 100644 OpenSim/Region/Communications/OGS1/OGSUserServices.cs (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs index f2b3b92..870f577 100644 --- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs @@ -12,7 +12,7 @@ namespace OpenSim.Region.Communications.OGS1 { GridServer = gridInterComms; InterRegion = gridInterComms; - UserServer = new OGSUserServices(this); + UserServer = new OGS1UserServices(this); } } } diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs new file mode 100644 index 0000000..51b33e9 --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Types; +using OpenSim.Framework.Communications; +namespace OpenSim.Region.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/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs new file mode 100644 index 0000000..856c447 --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Types; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Data; +using libsecondlife; + +using Nwc.XmlRpc; + +namespace OpenSim.Region.Communications.OGS1 +{ + public class OGS1UserServices :IUserServices + { + CommunicationsOGS1 m_parent; + public OGS1UserServices(CommunicationsOGS1 parent) + { + m_parent = parent; + } + + public UserProfileData ConvertXMLRPCDataToUserProfile(Hashtable data) + { + if (data.Contains("error_type")) + { + Console.WriteLine("Error sent by user server when trying to get user profile: (" + data["error_type"] + "): " + data["error_desc"]); + return null; + } + + UserProfileData userData = new UserProfileData(); + userData.username = (string)data["firstname"]; + userData.surname = (string)data["lastname"]; + userData.UUID = new LLUUID((string)data["uuid"]); + userData.userInventoryURI = (string)data["server_inventory"]; + userData.userAssetURI = (string)data["server_asset"]; + userData.profileFirstText = (string)data["profile_firstlife_about"]; + userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]); + userData.profileCanDoMask = (uint)data["profile_can_do"]; + userData.profileWantDoMask = (uint)data["profile_want_do"]; + userData.profileImage = new LLUUID((string)data["profile_image"]); + userData.lastLogin = (int)data["profile_lastlogin"]; + userData.homeLocation = new LLVector3(); + userData.homeLookAt = new LLVector3(); + + return userData; + } + public UserProfileData GetUserProfile(string firstName, string lastName) + { + return GetUserProfile(firstName + " " + lastName); + } + public UserProfileData GetUserProfile(string name) + { + + try + { + Hashtable param = new Hashtable(); + param["avatar_name"] = name; + IList parameters = new ArrayList(); + parameters.Add(param); + XmlRpcRequest req = new XmlRpcRequest("get_user_by_name", parameters); + XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000); + Hashtable respData = (Hashtable)resp.Value; + + return ConvertXMLRPCDataToUserProfile(respData); + } + catch (Exception e) + { + Console.WriteLine("Error when trying to fetch profile data by name from remote user server: " + e.Message); + } + return null; + } + public UserProfileData GetUserProfile(LLUUID avatarID) + { + try + { + + Hashtable param = new Hashtable(); + param["avatar_uuid"] = avatarID.ToString(); + IList parameters = new ArrayList(); + parameters.Add(param); + XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", parameters); + XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000); + Hashtable respData = (Hashtable)resp.Value; + + return ConvertXMLRPCDataToUserProfile(respData); + } + catch (Exception e) + { + Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " + e.Message); + } + return null; + } + + public UserProfileData SetupMasterUser(string firstName, string lastName) + { + return SetupMasterUser(firstName, lastName, ""); + } + + public UserProfileData SetupMasterUser(string firstName, string lastName, string password) + { + UserProfileData profile = GetUserProfile(firstName, lastName); + if (profile == null) + { + Console.WriteLine("Unknown Master User. Grid Mode: No clue what I should do. Probably would choose the grid owner UUID when that is implemented"); + } + return null; + } + } +} diff --git a/OpenSim/Region/Communications/OGS1/OGSInterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGSInterSimComms.cs deleted file mode 100644 index 51b33e9..0000000 --- a/OpenSim/Region/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.Region.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/Region/Communications/OGS1/OGSUserServices.cs b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs deleted file mode 100644 index 56a7837..0000000 --- a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Types; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Data; -using libsecondlife; - -using Nwc.XmlRpc; - -namespace OpenSim.Region.Communications.OGS1 -{ - public class OGSUserServices :IUserServices - { - CommunicationsOGS1 m_parent; - public OGSUserServices(CommunicationsOGS1 parent) - { - m_parent = parent; - } - - public UserProfileData ConvertXMLRPCDataToUserProfile(Hashtable data) - { - UserProfileData userData = new UserProfileData(); - userData.username = (string)data["firstname"]; - userData.surname = (string)data["lastname"]; - userData.UUID = new LLUUID((string)data["uuid"]); - userData.userInventoryURI = (string)data["server_inventory"]; - userData.userAssetURI = (string)data["server_asset"]; - userData.profileFirstText = (string)data["profile_firstlife_about"]; - userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]); - userData.profileCanDoMask = (uint)data["profile_can_do"]; - userData.profileWantDoMask = (uint)data["profile_want_do"]; - userData.profileImage = new LLUUID((string)data["profile_image"]); - userData.lastLogin = (int)data["profile_lastlogin"]; - userData.homeLocation = new LLVector3(); - userData.homeLookAt = new LLVector3(); - - return userData; - } - public UserProfileData GetUserProfile(string firstName, string lastName) - { - return GetUserProfile(firstName + " " + lastName); - } - public UserProfileData GetUserProfile(string name) - { - - try - { - Hashtable param = new Hashtable(); - param["avatar_name"] = name; - IList parameters = new ArrayList(); - parameters.Add(param); - XmlRpcRequest req = new XmlRpcRequest("get_user_by_name", parameters); - XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000); - Hashtable respData = (Hashtable)resp.Value; - - return ConvertXMLRPCDataToUserProfile(respData); - } - catch (Exception e) - { - Console.WriteLine("Error when trying to fetch profile data by name from remote user server: " + e.Message); - } - return null; - } - public UserProfileData GetUserProfile(LLUUID avatarID) - { - try - { - - Hashtable param = new Hashtable(); - param["avatar_uuid"] = avatarID.ToString(); - IList parameters = new ArrayList(); - parameters.Add(param); - XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", parameters); - XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000); - Hashtable respData = (Hashtable)resp.Value; - - return ConvertXMLRPCDataToUserProfile(respData); - } - catch (Exception e) - { - Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " + e.Message); - } - return null; - } - - public UserProfileData SetupMasterUser(string firstName, string lastName) - { - return SetupMasterUser(firstName, lastName, ""); - } - - public UserProfileData SetupMasterUser(string firstName, string lastName, string password) - { - UserProfileData profile = GetUserProfile(firstName, lastName); - if (profile == null) - { - Console.WriteLine("Unknown Master User. Grid Mode: No clue what I should do. Probably would choose the grid owner UUID when that is implemented"); - } - return null; - } - } -} diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index b03ac7e..0a9e5fb 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,8 +6,7 @@ {4806E378-0000-0000-0000-000000000000} Debug AnyCPU - - + OpenSim.Region.Communications.OGS1 @@ -16,11 +15,9 @@ IE50 false Library - - + OpenSim.Region.Communications.OGS1 - - + @@ -31,8 +28,7 @@ TRACE;DEBUG - - + True 4096 False @@ -41,8 +37,7 @@ False False 4 - - + False @@ -51,8 +46,7 @@ TRACE - - + False 4096 True @@ -61,31 +55,30 @@ 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 @@ -95,35 +88,35 @@ OpenSim.Framework {8ACA2445-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Communications {CB52B7E7-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Data {36B72A9B-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Servers {2CC71860-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False - + Code @@ -132,7 +125,7 @@ Code - + Code @@ -146,4 +139,4 @@ - \ No newline at end of file + diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build index 1a7cf69..2176b14 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build @@ -11,10 +11,10 @@ - + - - + + -- cgit v1.1 From 135e9b1f538ae77dfd8bf68139c960fb8e016c16 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 28 Jun 2007 19:35:20 +0000 Subject: * Removed J# language support because it has issues with Mono. --- .../Communications/Local/OpenSim.Region.Communications.Local.csproj | 6 +++--- .../Local/OpenSim.Region.Communications.Local.dll.build | 2 +- .../Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj | 4 ++-- .../OGS1/OpenSim.Region.Communications.OGS1.dll.build | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj index 200fa3a..0a15a49 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -98,13 +98,13 @@ - + Code - + Code - + Code diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build index 60a90bd..3cac9d3 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build @@ -11,9 +11,9 @@ + - diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index 0a9e5fb..d6abd13 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -116,13 +116,13 @@ - + Code Code - + Code diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build index 2176b14..04d61b9 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build @@ -11,9 +11,9 @@ - - + + -- cgit v1.1 From 90b01ba80ccaa69bf7cf76be6ce0a6ca05717d6c Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 29 Jun 2007 01:58:16 +0000 Subject: *Hopefully fixed the empty dialog box error on client when logging in on sandbox mode --- OpenSim/Region/Communications/Local/LocalBackEndServices.cs | 1 - OpenSim/Region/Communications/Local/LocalUserServices.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index ae47890..26834be 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -182,7 +182,6 @@ namespace OpenSim.Region.Communications.Local /// 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; diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 508a3f9..6cf254b 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -88,7 +88,7 @@ namespace OpenSim.Region.Communications.Local "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; string capsPath = Util.GetRandomCapsPath(); - response.SimAddress = reg.CommsIPListenAddr; + response.SimAddress = reg.CommsExternalAddress; response.SimPort = (Int32)reg.CommsIPListenPort; response.RegionX = reg.RegionLocX ; response.RegionY = reg.RegionLocY ; -- cgit v1.1 From 6b3777d3db323f2054aeff1ba4be3e78edef21b8 Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 29 Jun 2007 16:43:48 +0000 Subject: *Deleted Logger.cs from OpenSim.Framework --- .../Communications/Local/OpenSim.Region.Communications.Local.csproj | 6 +++--- .../Local/OpenSim.Region.Communications.Local.dll.build | 2 +- .../Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj | 6 +++--- .../OGS1/OpenSim.Region.Communications.OGS1.dll.build | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj index 0a15a49..f9f6b7d 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -98,13 +98,13 @@ - + Code - + Code - + Code diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build index 3cac9d3..bfefabf 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build @@ -11,9 +11,9 @@ + - diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index d6abd13..90a01b6 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -116,6 +116,9 @@ + + Code + Code @@ -125,9 +128,6 @@ Code - - Code - Code diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build index 04d61b9..960a84a 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build @@ -11,10 +11,10 @@ + - -- cgit v1.1 From 5e805656db1215518a344d6d5364629a4997fd47 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 1 Jul 2007 13:17:27 +0000 Subject: Fixed SimpleApp - aka thankgoditssundaycommit * Updated SimpleApp with various introduced dependencies * Extracted ScenePrescence creation in Scene * removed try-catchall from UserManagerBase (that actually hid a bug) * Refactored RegionInfo * handle is calculated * it will explode upon accessing x,y,ip,port,externalip if not explicitly initialized * Removed superfluous 'ref' keywords * Removed a shitload of 'catch Exception e' that causes build warnings * Lots of small refactorings, renames et c * Ignored some bins --- OpenSim/Region/Communications/Local/LocalUserServices.cs | 4 ++-- .../Local/OpenSim.Region.Communications.Local.csproj | 6 +++--- .../Local/OpenSim.Region.Communications.Local.dll.build | 2 +- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 10 +++------- .../OGS1/OpenSim.Region.Communications.OGS1.csproj | 6 +++--- .../OGS1/OpenSim.Region.Communications.OGS1.dll.build | 2 +- 6 files changed, 13 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 6cf254b..5a2a5c8 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -69,14 +69,14 @@ namespace OpenSim.Region.Communications.Local return profile; } - public override bool AuthenticateUser(ref UserProfileData profile, string password) + public override bool AuthenticateUser(UserProfileData profile, string password) { //for now we will accept any password in sandbox mode Console.WriteLine("authorising user"); return true; } - public override void CustomiseResponse(ref LoginResponse response, ref UserProfileData theUser) + public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) { ulong currentRegion = theUser.currentAgent.currentHandle; RegionInfo reg = m_Parent.GridServer.RequestNeighbourInfo(currentRegion); diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj index f9f6b7d..0a15a49 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -98,15 +98,15 @@ - - Code - Code Code + + Code + Code diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build index bfefabf..3cac9d3 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build @@ -11,9 +11,9 @@ - + diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 5f0c80c..2ac7297 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -75,18 +75,14 @@ namespace OpenSim.Region.Communications.OGS1 foreach (Hashtable n in (Hashtable)respData.Values) { - RegionInfo neighbour = new RegionInfo(); + RegionInfo neighbour = new RegionInfo( (uint)n["x"], (uint)n["y"], (string)n["sim_ip"], (int)n["sim_port"], (string)n["sim_uri"] ); //OGS1 - neighbour.RegionHandle = (ulong)n["regionhandle"]; - neighbour.RegionLocX = (uint)n["x"]; - neighbour.RegionLocY = (uint)n["y"]; + //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally + 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); diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index 90a01b6..d6abd13 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -116,9 +116,6 @@ - - Code - Code @@ -128,6 +125,9 @@ Code + + Code + Code diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build index 960a84a..04d61b9 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build @@ -11,10 +11,10 @@ - + -- cgit v1.1 From 06a8c132005b4ab804f25d54c0c0f899fc98e3a1 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 1 Jul 2007 16:07:41 +0000 Subject: MAJOR IP RESTRUCTURING * moving towards IPEndPoints all over the place * trying to make the internal/external division --- .../Region/Communications/Local/LocalUserServices.cs | 6 +++--- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 5a2a5c8..db9d9b9 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -88,11 +88,11 @@ namespace OpenSim.Region.Communications.Local "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; string capsPath = Util.GetRandomCapsPath(); - response.SimAddress = reg.CommsExternalAddress; - response.SimPort = (Int32)reg.CommsIPListenPort; + response.SimAddress = reg.ExternalEndPoint.Address.ToString(); + response.SimPort = (Int32)reg.ExternalEndPoint.Port; response.RegionX = reg.RegionLocX ; response.RegionY = reg.RegionLocY ; - response.SeedCapability = "http://" + reg.CommsIPListenAddr + ":" + "9000" + "/CAPS/" + capsPath + "0000/"; + response.SeedCapability = "http://" + reg.ExternalHostName + ":" + reg.ExternalEndPoint.Port.ToString() + "/CAPS/" + capsPath + "0000/"; theUser.currentAgent.currentRegion = reg.SimUUID; theUser.currentAgent.currentHandle = reg.RegionHandle; diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 2ac7297..977b131 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -13,6 +13,7 @@ using OpenSim.Framework.Communications; using Nwc.XmlRpc; using libsecondlife; +using System.Net; namespace OpenSim.Region.Communications.OGS1 { @@ -32,13 +33,15 @@ namespace OpenSim.Region.Communications.OGS1 // Login / Authentication GridParams["authkey"] = gridInfo.GridServerSendKey; GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated(); - GridParams["sim_ip"] = regionInfo.CommsExternalAddress; - GridParams["sim_port"] = regionInfo.CommsIPListenPort.ToString(); + GridParams["sim_ip"] = regionInfo.InternalEndPoint.Address.ToString(); + GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.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); @@ -56,7 +59,7 @@ namespace OpenSim.Region.Communications.OGS1 if (!this.listeners.ContainsKey(regionInfo.RegionHandle)) { // initialised = true; - httpListener = new BaseHttpServer(regionInfo.CommsIPListenPort); + httpListener = new BaseHttpServer( regionInfo.InternalEndPoint.Port ); httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); httpListener.Start(); } @@ -75,7 +78,14 @@ namespace OpenSim.Region.Communications.OGS1 foreach (Hashtable n in (Hashtable)respData.Values) { - RegionInfo neighbour = new RegionInfo( (uint)n["x"], (uint)n["y"], (string)n["sim_ip"], (int)n["sim_port"], (string)n["sim_uri"] ); + string internalIpStr = (string)n["sim_ip"]; + int port = (int)n["sim_port"]; + string externalUri = (string)n["sim_uri"]; + + IPEndPoint neighbourInternalEndPoint = new IPEndPoint( IPAddress.Parse( internalIpStr ), port); + string neighbourExternalUri = externalUri; + + RegionInfo neighbour = new RegionInfo((uint)n["x"], (uint)n["y"], neighbourInternalEndPoint, neighbourExternalUri ); //OGS1 //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally -- cgit v1.1 From 9800c05c1b3c7804466d6f3a9c38a739156625fd Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 1 Jul 2007 17:26:33 +0000 Subject: Started change to having SceneObject and then that having child Primitives which in turn have a Shape object (currently PrimitiveBaseShape). The plan is only for the SceneObject to interface with the physics engines. As a physics Entity should be able to have mulitple shapes connected to it. --- OpenSim/Region/Communications/Local/CommunicationsLocal.cs | 2 +- OpenSim/Region/Communications/Local/LocalUserServices.cs | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index bacaa3e..7c7c389 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -45,7 +45,7 @@ namespace OpenSim.Region.Communications.Local public CommunicationsLocal(NetworkServersInfo serversInfo) : base(serversInfo) { - UserServices = new LocalUserServices(this,this.ServersInfo.DefaultHomeLocX,this.ServersInfo.DefaultHomeLocY); + UserServices = new LocalUserServices(this, serversInfo); UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll"); UserServer = UserServices; GridServer = SandBoxServices; diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index db9d9b9..b441a8d 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -18,13 +18,15 @@ namespace OpenSim.Region.Communications.Local { private CommunicationsLocal m_Parent; + private NetworkServersInfo serversInfo; private uint defaultHomeX ; private uint defaultHomeY; - public LocalUserServices(CommunicationsLocal parent, uint defHomeX, uint defHomeY) + public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversData) { m_Parent = parent; - defaultHomeX = defHomeX; - defaultHomeY = defHomeY; + this.serversInfo = serversData; + defaultHomeX = this.serversInfo.DefaultHomeLocX; + defaultHomeY = this.serversInfo.DefaultHomeLocY; } public UserProfileData GetUserProfile(string firstName, string lastName) @@ -81,7 +83,6 @@ namespace OpenSim.Region.Communications.Local ulong currentRegion = theUser.currentAgent.currentHandle; RegionInfo reg = m_Parent.GridServer.RequestNeighbourInfo(currentRegion); - if (reg != null) { response.Home = "{'region_handle':[r" + (reg.RegionLocX * 256).ToString() + ",r" + (reg.RegionLocY * 256).ToString() + "], " + @@ -92,7 +93,9 @@ namespace OpenSim.Region.Communications.Local response.SimPort = (Int32)reg.ExternalEndPoint.Port; response.RegionX = reg.RegionLocX ; response.RegionY = reg.RegionLocY ; - response.SeedCapability = "http://" + reg.ExternalHostName + ":" + reg.ExternalEndPoint.Port.ToString() + "/CAPS/" + capsPath + "0000/"; + + //following port needs changing as we don't want a http listener for every region (or do we?) + response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; theUser.currentAgent.currentRegion = reg.SimUUID; theUser.currentAgent.currentHandle = reg.RegionHandle; -- cgit v1.1 From 67af17fdd185e4a70046ac3583d3c64e6c3c8fb9 Mon Sep 17 00:00:00 2001 From: mingchen Date: Mon, 2 Jul 2007 21:02:11 +0000 Subject: *OGS1 Key2Name/Name2Key works *OGS1 doesnt crash on startup anymore --- .../Region/Communications/OGS1/OGS1UserServices.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 856c447..6d428d0 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -35,10 +35,10 @@ namespace OpenSim.Region.Communications.OGS1 userData.userAssetURI = (string)data["server_asset"]; userData.profileFirstText = (string)data["profile_firstlife_about"]; userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]); - userData.profileCanDoMask = (uint)data["profile_can_do"]; - userData.profileWantDoMask = (uint)data["profile_want_do"]; + userData.profileCanDoMask = Convert.ToUInt32((string)data["profile_can_do"]); + userData.profileWantDoMask = Convert.ToUInt32(data["profile_want_do"]); userData.profileImage = new LLUUID((string)data["profile_image"]); - userData.lastLogin = (int)data["profile_lastlogin"]; + userData.lastLogin = Convert.ToInt32((string)data["profile_lastlogin"]); userData.homeLocation = new LLVector3(); userData.homeLookAt = new LLVector3(); @@ -51,8 +51,8 @@ namespace OpenSim.Region.Communications.OGS1 public UserProfileData GetUserProfile(string name) { - try - { + //try + //{ Hashtable param = new Hashtable(); param["avatar_name"] = name; IList parameters = new ArrayList(); @@ -62,12 +62,12 @@ namespace OpenSim.Region.Communications.OGS1 Hashtable respData = (Hashtable)resp.Value; return ConvertXMLRPCDataToUserProfile(respData); - } - catch (Exception e) - { - Console.WriteLine("Error when trying to fetch profile data by name from remote user server: " + e.Message); - } - return null; + //} + //catch (Exception e) + //{ + // Console.WriteLine("Error when trying to fetch profile data by name from remote user server: " + e.Message); + //} + //return null; } public UserProfileData GetUserProfile(LLUUID avatarID) { -- cgit v1.1 From 9b6b6d05d45cf0f754a0b26bf6240ef50be66563 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 3 Jul 2007 14:37:29 +0000 Subject: * Optimized usings (the 'LL ate my scripts' commit) * added some licensing info --- .../Communications/Local/CommunicationsLocal.cs | 9 +------- .../Communications/Local/LocalBackEndServices.cs | 6 ++--- .../Communications/Local/LocalUserServices.cs | 10 ++------- .../Local/Properties/AssemblyInfo.cs | 2 -- .../Communications/OGS1/CommunicationsOGS1.cs | 6 ++--- .../Region/Communications/OGS1/OGS1GridServices.cs | 26 ++++++++++------------ .../Communications/OGS1/OGS1InterSimComms.cs | 11 +++++---- .../Region/Communications/OGS1/OGS1UserServices.cs | 8 ++----- .../Communications/OGS1/Properties/AssemblyInfo.cs | 2 -- 9 files changed, 26 insertions(+), 54 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 7c7c389..5d6ede8 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -25,15 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; using OpenSim.Framework.Communications; +using OpenSim.Framework.Types; namespace OpenSim.Region.Communications.Local { diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 26834be..43bdd03 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -25,13 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; using System.Collections.Generic; -using System.Text; using libsecondlife; -using OpenSim.Framework.Types; using OpenSim.Framework; using OpenSim.Framework.Communications; +using OpenSim.Framework.Types; namespace OpenSim.Region.Communications.Local { @@ -163,7 +161,7 @@ namespace OpenSim.Region.Communications.Local /// /// /// - public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) { if (this.regionHosts.ContainsKey(regionHandle)) { diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index b441a8d..592b36c 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -1,17 +1,11 @@ using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; - +using libsecondlife; using OpenSim.Framework.Communications; -//using OpenSim.Framework.User; -using OpenSim.Framework.UserManagement; using OpenSim.Framework.Data; using OpenSim.Framework.Types; +using OpenSim.Framework.UserManagement; using OpenSim.Framework.Utilities; -using libsecondlife; - namespace OpenSim.Region.Communications.Local { public class LocalUserServices : UserManagerBase, IUserServices diff --git a/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs index 1eb7107..9afb75e 100644 --- a/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/Communications/Local/Properties/AssemblyInfo.cs @@ -1,7 +1,5 @@ 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. diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs index 870f577..0a0847e 100644 --- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs @@ -1,8 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Types; using OpenSim.Framework.Communications; +using OpenSim.Framework.Types; + namespace OpenSim.Region.Communications.OGS1 { public class CommunicationsOGS1 : CommunicationsManager diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 977b131..1706c6d 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -1,19 +1,17 @@ using System; -using System.Collections.Generic; using System.Collections; -using System.Text; +using System.Collections.Generic; +using System.Net; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; - -using OpenSim.Framework.Servers; +using libsecondlife; +using Nwc.XmlRpc; using OpenSim.Framework; -using OpenSim.Framework.Types; using OpenSim.Framework.Communications; - -using Nwc.XmlRpc; -using libsecondlife; -using System.Net; +using OpenSim.Framework.Console; +using OpenSim.Framework.Servers; +using OpenSim.Framework.Types; namespace OpenSim.Region.Communications.OGS1 { @@ -52,7 +50,7 @@ namespace OpenSim.Region.Communications.OGS1 if (GridRespData.ContainsKey("error")) { string errorstring = (string)GridRespData["error"]; - OpenSim.Framework.Console.MainLog.Instance.Error("Unable to connect to grid: " + errorstring); + MainLog.Instance.Error("Unable to connect to grid: " + errorstring); return null; } @@ -103,7 +101,7 @@ namespace OpenSim.Region.Communications.OGS1 public RegionInfo RequestNeighbourInfo(ulong regionHandle) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented - RequestNeighbourInfo()"); + MainLog.Instance.Warn("Unimplemented - RequestNeighbourInfo()"); return null; } @@ -184,7 +182,7 @@ namespace OpenSim.Region.Communications.OGS1 } else { - OpenSim.Framework.Console.MainLog.Instance.Error("ExpectUser() - Unknown region " + ((ulong)requestData["regionhandle"]).ToString()); + MainLog.Instance.Error("ExpectUser() - Unknown region " + ((ulong)requestData["regionhandle"]).ToString()); } return new XmlRpcResponse(); @@ -215,7 +213,7 @@ namespace OpenSim.Region.Communications.OGS1 return false; } - public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) { if (this.listeners.ContainsKey(regionHandle)) { @@ -239,7 +237,7 @@ namespace OpenSim.Region.Communications.OGS1 return false; } - public bool IncomingArrival(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + public bool IncomingArrival(ulong regionHandle, LLUUID agentID, LLVector3 position) { if (this.listeners.ContainsKey(regionHandle)) { diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs index 51b33e9..f514a29 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs @@ -1,12 +1,11 @@ using System; -using System.Collections.Generic; -using System.Text; +using libsecondlife; using OpenSim.Framework.Types; -using OpenSim.Framework.Communications; + namespace OpenSim.Region.Communications.OGS1 { public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData); - public delegate bool ExpectArrival(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); + public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position); public sealed class InterRegionSingleton { @@ -40,7 +39,7 @@ namespace OpenSim.Region.Communications.OGS1 return false; } - public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) { if (OnArrival != null) { @@ -62,7 +61,7 @@ namespace OpenSim.Region.Communications.OGS1 return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData); } - public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) + public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) { return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position); } diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 6d428d0..7c7db03 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -1,13 +1,9 @@ using System; using System.Collections; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Types; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Data; using libsecondlife; - using Nwc.XmlRpc; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Data; namespace OpenSim.Region.Communications.OGS1 { diff --git a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs index 0c6f965..41f811a 100644 --- a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs @@ -1,7 +1,5 @@ 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. -- cgit v1.1 From 898b48464a288e963fc588afc5fb0c9d51bdc755 Mon Sep 17 00:00:00 2001 From: mingchen Date: Tue, 3 Jul 2007 14:56:00 +0000 Subject: *Renamed OGS1 XmlRpcLoginToSimulatorMethod to the more appropriate XmlRpcSimulatorLoginMethod *Attempt to fix the "sim not found" issue by adding sim if...well...not found (OGS1) --- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 1706c6d..0ef327e 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -20,7 +20,6 @@ namespace OpenSim.Region.Communications.OGS1 public Dictionary listeners = new Dictionary(); public GridInfo grid; public BaseHttpServer httpListener; - private bool initialised = false; public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo) { @@ -44,6 +43,7 @@ namespace OpenSim.Region.Communications.OGS1 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); XmlRpcResponse GridResp = GridReq.Send(gridInfo.GridServerURI, 3000); Hashtable GridRespData = (Hashtable)GridResp.Value; + Hashtable griddatahash = GridRespData; // Process Response -- cgit v1.1 From e06ffb3981d29ddb3383690b4a05dc684813b6d9 Mon Sep 17 00:00:00 2001 From: mingchen Date: Tue, 3 Jul 2007 17:03:14 +0000 Subject: *Removed GridInfo class as it has been previously replaced with the much better NetworkServersInfo class *Got the GridServer in OGS1 to go through with registering the region, but the actual storage of the region isnt working right now. **After this is fixed, grid mode should work! --- .../Communications/Local/LocalBackEndServices.cs | 2 +- .../Region/Communications/OGS1/CommunicationsOGS1.cs | 3 ++- .../Region/Communications/OGS1/OGS1GridServices.cs | 20 ++++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 43bdd03..d0cd991 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.Communications.Local /// /// /// - public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo) + public RegionCommsListener RegisterRegion(RegionInfo regionInfo) { //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs index 0a0847e..1118726 100644 --- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs @@ -5,9 +5,10 @@ namespace OpenSim.Region.Communications.OGS1 { public class CommunicationsOGS1 : CommunicationsManager { - private OGS1GridServices gridInterComms = new OGS1GridServices(); + public CommunicationsOGS1(NetworkServersInfo serversInfo) :base(serversInfo) { + OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo); GridServer = gridInterComms; InterRegion = gridInterComms; UserServer = new OGS1UserServices(this); diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 0ef327e..5fff777 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -18,20 +18,28 @@ namespace OpenSim.Region.Communications.OGS1 public class OGS1GridServices : IGridServices, IInterRegionCommunications { public Dictionary listeners = new Dictionary(); - public GridInfo grid; public BaseHttpServer httpListener; + public NetworkServersInfo serversInfo; - public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo) + public OGS1GridServices(NetworkServersInfo servers_info) + { + serversInfo = servers_info; + } + + public RegionCommsListener RegisterRegion(RegionInfo regionInfo) { Hashtable GridParams = new Hashtable(); - grid = gridInfo; // Login / Authentication - GridParams["authkey"] = gridInfo.GridServerSendKey; + + GridParams["authkey"] = serversInfo.GridSendKey; GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated(); GridParams["sim_ip"] = regionInfo.InternalEndPoint.Address.ToString(); GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString(); + GridParams["region_locx"] = regionInfo.RegionLocX.ToString(); + GridParams["region_locy"] = regionInfo.RegionLocY.ToString(); + GridParams["sim_name"] = regionInfo.RegionName; // Package into an XMLRPC Request ArrayList SendParams = new ArrayList(); @@ -41,7 +49,7 @@ namespace OpenSim.Region.Communications.OGS1 // Send Request XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); - XmlRpcResponse GridResp = GridReq.Send(gridInfo.GridServerURI, 3000); + XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000); Hashtable GridRespData = (Hashtable)GridResp.Value; Hashtable griddatahash = GridRespData; @@ -149,7 +157,7 @@ namespace OpenSim.Region.Communications.OGS1 IList parameters = new ArrayList(); parameters.Add(param); XmlRpcRequest req = new XmlRpcRequest("map_block", parameters); - XmlRpcResponse resp = req.Send(grid.GridServerURI, 3000); + XmlRpcResponse resp = req.Send(serversInfo.GridURL, 3000); Hashtable respData = (Hashtable)resp.Value; return respData; } -- cgit v1.1 From 249ce4cf6f353dd59ebec27689e74a527c39a090 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 4 Jul 2007 05:49:12 +0000 Subject: * More cleaning - Sugilite now only has build errors for "value is never used" properties (which I presume will be filled in over time) --- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 5fff777..a11995a 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -200,7 +200,7 @@ namespace OpenSim.Region.Communications.OGS1 private void StartRemoting() { TcpChannel ch = new TcpChannel(8895); - ChannelServices.RegisterChannel(ch); + ChannelServices.RegisterChannel(ch, true); WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry( Type.GetType("OGS1InterRegionRemoting"), "InterRegions", WellKnownObjectMode.Singleton); RemotingConfiguration.RegisterWellKnownServiceType(wellType); -- cgit v1.1 From 827cccb99c39b7dd3ee0ccc3defb9d88e449db52 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 4 Jul 2007 07:45:42 +0000 Subject: Grid Servers: * Sugilite grid server now works with older regions properly (using it on deepgrid for testing) * Sugilite user server still broken with sugilite region server * Reduced the number of compiler warnings to zero Region Servers: * Added debug information to OGS1 Comms to help debug user server connectivity issues. --- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index a11995a..99e9c96 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -64,6 +64,7 @@ namespace OpenSim.Region.Communications.OGS1 if (!this.listeners.ContainsKey(regionInfo.RegionHandle)) { + MainLog.Instance.Verbose("OGS1 - Registering new HTTP listener on port " + regionInfo.InternalEndPoint.Port.ToString()); // initialised = true; httpListener = new BaseHttpServer( regionInfo.InternalEndPoint.Port ); httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); @@ -193,6 +194,8 @@ namespace OpenSim.Region.Communications.OGS1 MainLog.Instance.Error("ExpectUser() - Unknown region " + ((ulong)requestData["regionhandle"]).ToString()); } + MainLog.Instance.Verbose("ExpectUser() - Welcoming new user..."); + return new XmlRpcResponse(); } -- cgit v1.1 From 583f2a9de8e503773a427facd5f81a82b40bd585 Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 5 Jul 2007 15:15:28 +0000 Subject: *Removed SimProfile.cs as it is no longer needed (in favor of SimProfileData) *Added simulator_data_request XMLRPC method to request data from the grid server about a sim instead of faking its login *Login is progressing, now just getting an XML error (http://pastebin.com/942515) -- if you can fix this, throw MingChen in IRC a Private Message --- .../Communications/Local/OpenSim.Region.Communications.Local.csproj | 6 +++--- .../Local/OpenSim.Region.Communications.Local.dll.build | 2 +- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 3 ++- .../Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj | 6 +++--- .../OGS1/OpenSim.Region.Communications.OGS1.dll.build | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj index 0a15a49..f9f6b7d 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -98,13 +98,13 @@ - + Code - + Code - + Code diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build index 3cac9d3..bfefabf 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build @@ -11,9 +11,9 @@ + - diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 99e9c96..e8ed7f4 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -35,7 +35,7 @@ namespace OpenSim.Region.Communications.OGS1 GridParams["authkey"] = serversInfo.GridSendKey; GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated(); - GridParams["sim_ip"] = regionInfo.InternalEndPoint.Address.ToString(); + GridParams["sim_ip"] = regionInfo.ExternalHostName; GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString(); GridParams["region_locx"] = regionInfo.RegionLocX.ToString(); GridParams["region_locy"] = regionInfo.RegionLocY.ToString(); @@ -166,6 +166,7 @@ namespace OpenSim.Region.Communications.OGS1 // Grid Request Processing public XmlRpcResponse ExpectUser(XmlRpcRequest request) { + Console.WriteLine("Expecting User..."); Hashtable requestData = (Hashtable)request.Params[0]; AgentCircuitData agentData = new AgentCircuitData(); agentData.SessionID = new LLUUID((string)requestData["session_id"]); diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index d6abd13..390326e 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -116,16 +116,16 @@ - + Code - + Code Code - + Code diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build index 04d61b9..06f0b9e 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build @@ -11,10 +11,10 @@ + - - + -- cgit v1.1 From e2bafc8d6c37d48c7af6a30c28696adb145d3f00 Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 5 Jul 2007 20:46:37 +0000 Subject: *Fixed crash of OpenSim client when in grid mode from a recent commit *The XML issue is now fixed (yay lbsa71) -- but I am still getting a "login packet never received", but that is probably an issue on my end, and not it the code --- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index e8ed7f4..4d93cc9 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -186,9 +186,9 @@ namespace OpenSim.Region.Communications.OGS1 } - if (listeners.ContainsKey((ulong)requestData["regionhandle"])) + if (listeners.ContainsKey(Convert.ToUInt64((string)requestData["regionhandle"]))) { - this.listeners[(ulong)requestData["regionhandle"]].TriggerExpectUser((ulong)requestData["regionhandle"], agentData); + this.listeners[Convert.ToUInt64((string)requestData["regionhandle"])].TriggerExpectUser(Convert.ToUInt64((string)requestData["regionhandle"]), agentData); } else { -- cgit v1.1 From bc02ddf5231d7731af33cc0aa5dc914cbdeb5ee7 Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 6 Jul 2007 20:40:03 +0000 Subject: *Fixed several bugs that crashed the viewer and opensim server when logging in on grid mode *Note: Grid Mode now works in sugilite, but is still unstable **Known bug in which the grid server crashes after being relaunched from a previously create configuration **Crashing of the viewer crashes the OpenSim server which then crashes the grid server -- needs better handling of exceptions **Multiple sims is still untested, but should connect correctly. Moving between the sims may be a different story --- .../Region/Communications/OGS1/OGS1GridServices.cs | 31 ++++++++++++---------- .../Region/Communications/OGS1/OGS1UserServices.cs | 5 ++-- 2 files changed, 20 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 4d93cc9..b7d62ed 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -83,26 +83,29 @@ namespace OpenSim.Region.Communications.OGS1 List neighbours = new List(); - foreach (Hashtable n in (Hashtable)respData.Values) + foreach (ArrayList a in respData.Values) { - string internalIpStr = (string)n["sim_ip"]; - int port = (int)n["sim_port"]; - string externalUri = (string)n["sim_uri"]; - - IPEndPoint neighbourInternalEndPoint = new IPEndPoint( IPAddress.Parse( internalIpStr ), port); - string neighbourExternalUri = externalUri; + foreach (Hashtable n in a) + { + string internalIpStr = (string)n["sim_ip"]; + int port = (int)n["sim_port"]; + string externalUri = (string)n["sim_uri"]; - RegionInfo neighbour = new RegionInfo((uint)n["x"], (uint)n["y"], neighbourInternalEndPoint, neighbourExternalUri ); + IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), port); + string neighbourExternalUri = externalUri; - //OGS1 - //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally + RegionInfo neighbour = new RegionInfo((uint)n["x"], (uint)n["y"], neighbourInternalEndPoint, neighbourExternalUri); - neighbour.RegionName = (string)n["name"]; + //OGS1 + //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally - //OGS1+ - neighbour.SimUUID = (string)n["uuid"]; + neighbour.RegionName = (string)n["name"]; - neighbours.Add(neighbour); + //OGS1+ + neighbour.SimUUID = (string)n["uuid"]; + + neighbours.Add(neighbour); + } } return neighbours; diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 7c7db03..3a3bccb 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -35,8 +35,9 @@ namespace OpenSim.Region.Communications.OGS1 userData.profileWantDoMask = Convert.ToUInt32(data["profile_want_do"]); userData.profileImage = new LLUUID((string)data["profile_image"]); userData.lastLogin = Convert.ToInt32((string)data["profile_lastlogin"]); - userData.homeLocation = new LLVector3(); - userData.homeLookAt = new LLVector3(); + userData.homeRegion = Convert.ToUInt64((string)data["home_region"]); + userData.homeLocation = new LLVector3((float)Convert.ToDecimal((string)data["home_coordinates_x"]), (float)Convert.ToDecimal((string)data["home_coordinates_y"]), (float)Convert.ToDecimal((string)data["home_coordinates_z"])); + userData.homeLookAt = new LLVector3((float)Convert.ToDecimal((string)data["home_look_x"]), (float)Convert.ToDecimal((string)data["home_look_y"]), (float)Convert.ToDecimal((string)data["home_look_z"])); return userData; } -- cgit v1.1 From 10ece46cf681f389b9ecce5e89b94d749a44e9c1 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 8 Jul 2007 02:58:01 +0000 Subject: * Updating prebuild --- .../Communications/Local/OpenSim.Region.Communications.Local.csproj | 6 +++--- .../Local/OpenSim.Region.Communications.Local.dll.build | 2 +- .../Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj | 6 +++--- .../OGS1/OpenSim.Region.Communications.OGS1.dll.build | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj index f9f6b7d..0a15a49 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -98,15 +98,15 @@ - - Code - Code Code + + Code + Code diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build index bfefabf..3cac9d3 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build @@ -11,9 +11,9 @@ - + diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index 390326e..d6abd13 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -116,16 +116,16 @@ - + Code - + Code Code - + Code diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build index 06f0b9e..04d61b9 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build @@ -11,10 +11,10 @@ - - + + -- cgit v1.1 From 5f8de1e7045b9daa2d4f3b21ca826987e32efe6e Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 8 Jul 2007 19:27:04 +0000 Subject: * By popular demand, all generated build files are now deleted. Somebody should make sure the wiki is updated. --- .../OpenSim.Region.Communications.Local.csproj | 121 ------------------ .../OpenSim.Region.Communications.Local.dll.build | 48 ------- .../OGS1/OpenSim.Region.Communications.OGS1.csproj | 142 --------------------- .../OpenSim.Region.Communications.OGS1.dll.build | 53 -------- 4 files changed, 364 deletions(-) delete mode 100644 OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj delete mode 100644 OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build delete mode 100644 OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj delete mode 100644 OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj deleted file mode 100644 index 0a15a49..0000000 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {BFB5D807-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Region.Communications.Local - JScript - Grid - IE50 - false - Library - - OpenSim.Region.Communications.Local - - - - - - 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.Xml.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.Data - {36B72A9B-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Framework.UserManagement - {586E2916-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build deleted file mode 100644 index 3cac9d3..0000000 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj deleted file mode 100644 index d6abd13..0000000 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ /dev/null @@ -1,142 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {4806E378-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Region.Communications.OGS1 - JScript - Grid - IE50 - false - Library - - OpenSim.Region.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/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build deleted file mode 100644 index 04d61b9..0000000 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.1 From 7f03246653a6f277505d2055528cbb8dd2e1f4c1 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 10 Jul 2007 17:56:31 +0000 Subject: Gird mode in sugilite should now work in so far as you should be able to login and move between regions in the same instance. Moving to regions in a different instance of opensim still needs implementing (working on it now). Also trying to look at the map in grid mode will crash the server. --- .../Communications/Local/CommunicationsLocal.cs | 5 +- .../Communications/OGS1/CommunicationsOGS1.cs | 5 +- .../Region/Communications/OGS1/OGS1GridServices.cs | 93 ++++++++++++++-------- .../Region/Communications/OGS1/OGS1UserServices.cs | 1 - 4 files changed, 67 insertions(+), 37 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 5d6ede8..a047843 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -27,6 +27,7 @@ */ using OpenSim.Framework.Communications; using OpenSim.Framework.Types; +using OpenSim.Framework.Servers; namespace OpenSim.Region.Communications.Local { @@ -35,8 +36,8 @@ namespace OpenSim.Region.Communications.Local public LocalBackEndServices SandBoxServices = new LocalBackEndServices(); public LocalUserServices UserServices; - public CommunicationsLocal(NetworkServersInfo serversInfo) - : base(serversInfo) + public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer ) + : base(serversInfo, httpServer) { UserServices = new LocalUserServices(this, serversInfo); UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll"); diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs index 1118726..cc05845 100644 --- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs @@ -1,14 +1,15 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Types; +using OpenSim.Framework.Servers; namespace OpenSim.Region.Communications.OGS1 { public class CommunicationsOGS1 : CommunicationsManager { - public CommunicationsOGS1(NetworkServersInfo serversInfo) :base(serversInfo) + public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer ) :base(serversInfo, httpServer) { - OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo); + OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); GridServer = gridInterComms; InterRegion = gridInterComms; UserServer = new OGS1UserServices(this); diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index b7d62ed..50a31c6 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -18,40 +18,50 @@ namespace OpenSim.Region.Communications.OGS1 public class OGS1GridServices : IGridServices, IInterRegionCommunications { public Dictionary listeners = new Dictionary(); + protected Dictionary regions = new Dictionary(); + public BaseHttpServer httpListener; public NetworkServersInfo serversInfo; + public BaseHttpServer httpServer; - public OGS1GridServices(NetworkServersInfo servers_info) + public OGS1GridServices(NetworkServersInfo servers_info, BaseHttpServer httpServe) { serversInfo = servers_info; + httpServer = httpServe; + httpServer.AddXmlRPCHandler("expect_user", this.ExpectUser); } public RegionCommsListener RegisterRegion(RegionInfo regionInfo) { + if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) + { + this.regions.Add(regionInfo.RegionHandle, regionInfo); + } + Hashtable GridParams = new Hashtable(); // Login / Authentication - - GridParams["authkey"] = serversInfo.GridSendKey; + + GridParams["authkey"] = serversInfo.GridSendKey; GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated(); GridParams["sim_ip"] = regionInfo.ExternalHostName; GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString(); GridParams["region_locx"] = regionInfo.RegionLocX.ToString(); GridParams["region_locy"] = regionInfo.RegionLocY.ToString(); GridParams["sim_name"] = regionInfo.RegionName; + GridParams["http_port"] = serversInfo.HttpListenerPort.ToString(); + GridParams["remoting_port"] = serversInfo.RemotingListenerPort.ToString(); // Package into an XMLRPC Request - ArrayList SendParams = new ArrayList(); + ArrayList SendParams = new ArrayList(); SendParams.Add(GridParams); - - // Send Request XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000); Hashtable GridRespData = (Hashtable)GridResp.Value; - + Hashtable griddatahash = GridRespData; // Process Response @@ -60,25 +70,34 @@ namespace OpenSim.Region.Communications.OGS1 string errorstring = (string)GridRespData["error"]; MainLog.Instance.Error("Unable to connect to grid: " + errorstring); return null; - } - - if (!this.listeners.ContainsKey(regionInfo.RegionHandle)) - { - MainLog.Instance.Verbose("OGS1 - Registering new HTTP listener on port " + regionInfo.InternalEndPoint.Port.ToString()); - // initialised = true; - httpListener = new BaseHttpServer( regionInfo.InternalEndPoint.Port ); - httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); - httpListener.Start(); } + /* if (!this.listeners.ContainsKey(regionInfo.RegionHandle)) + { + MainLog.Instance.Verbose("OGS1 - Registering new HTTP listener on port " + regionInfo.InternalEndPoint.Port.ToString()); + // initialised = true; + httpListener = new BaseHttpServer( regionInfo.InternalEndPoint.Port ); + httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); + httpListener.Start(); + }*/ + // Initialise the background listeners - listeners[regionInfo.RegionHandle] = new RegionCommsListener(); + RegionCommsListener regListener = new RegionCommsListener(); + if (this.listeners.ContainsKey(regionInfo.RegionHandle)) + { + this.listeners.Add(regionInfo.RegionHandle, regListener); + } + else + { + listeners[regionInfo.RegionHandle] = regListener; + } - return listeners[regionInfo.RegionHandle]; + return regListener; } 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(); @@ -87,24 +106,28 @@ namespace OpenSim.Region.Communications.OGS1 { foreach (Hashtable n in a) { - string internalIpStr = (string)n["sim_ip"]; - int port = (int)n["sim_port"]; - string externalUri = (string)n["sim_uri"]; - - IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), port); - string neighbourExternalUri = externalUri; + uint regX = Convert.ToUInt32(n["x"]); + uint regY = Convert.ToUInt32(n["y"]); + if ((regionInfo.RegionLocX != regX) || (regionInfo.RegionLocY != regY)) + { + string internalIpStr = (string)n["sim_ip"]; + uint port = Convert.ToUInt32(n["sim_port"]); + string externalUri = (string)n["sim_uri"]; - RegionInfo neighbour = new RegionInfo((uint)n["x"], (uint)n["y"], neighbourInternalEndPoint, neighbourExternalUri); + IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int)port); + string neighbourExternalUri = externalUri; + RegionInfo neighbour = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr); - //OGS1 - //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally + //OGS1 + //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally - neighbour.RegionName = (string)n["name"]; + neighbour.RegionName = (string)n["name"]; - //OGS1+ - neighbour.SimUUID = (string)n["uuid"]; + //OGS1+ + neighbour.SimUUID = (string)n["uuid"]; - neighbours.Add(neighbour); + neighbours.Add(neighbour); + } } } @@ -113,6 +136,11 @@ namespace OpenSim.Region.Communications.OGS1 public RegionInfo RequestNeighbourInfo(ulong regionHandle) { + if (this.regions.ContainsKey(regionHandle)) + { + return this.regions[regionHandle]; + } + //TODO not a region in this instance so ask remote grid server MainLog.Instance.Warn("Unimplemented - RequestNeighbourInfo()"); return null; } @@ -209,7 +237,7 @@ namespace OpenSim.Region.Communications.OGS1 TcpChannel ch = new TcpChannel(8895); ChannelServices.RegisterChannel(ch, true); - WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry( Type.GetType("OGS1InterRegionRemoting"), "InterRegions", WellKnownObjectMode.Singleton); + WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(Type.GetType("OGS1InterRegionRemoting"), "InterRegions", WellKnownObjectMode.Singleton); RemotingConfiguration.RegisterWellKnownServiceType(wellType); InterRegionSingleton.Instance.OnArrival += this.IncomingArrival; InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent; @@ -225,6 +253,7 @@ namespace OpenSim.Region.Communications.OGS1 } //TODO need to see if we know about where this region is and use .net remoting // to inform it. + Console.WriteLine("Inform remote region of child agent not implemented yet"); return false; } diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 3a3bccb..2bbaf9d 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -47,7 +47,6 @@ namespace OpenSim.Region.Communications.OGS1 } public UserProfileData GetUserProfile(string name) { - //try //{ Hashtable param = new Hashtable(); -- cgit v1.1 From ebdc64730a832a6e5dc2dc7d304eff813c73e933 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 10 Jul 2007 18:58:42 +0000 Subject: Fixed the crashing when trying to look at the map in grid mode. Although the textures for the regions don't seem to show up, about to look into that. --- .../Region/Communications/OGS1/OGS1GridServices.cs | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 50a31c6..1cadf9b 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -151,20 +151,23 @@ namespace OpenSim.Region.Communications.OGS1 List neighbours = new List(); - foreach (Hashtable n in (Hashtable)respData.Values) + foreach (ArrayList a in respData.Values) { - MapBlockData neighbour = new MapBlockData(); + foreach (Hashtable n in a) + { + MapBlockData neighbour = new MapBlockData(); - neighbour.X = (ushort)n["x"]; - neighbour.Y = (ushort)n["y"]; + neighbour.X = Convert.ToUInt16(n["x"]); + neighbour.Y = Convert.ToUInt16(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"]; + neighbour.Name = (string)n["name"]; + neighbour.Access = Convert.ToByte(n["access"]); + neighbour.RegionFlags = Convert.ToUInt32(n["region-flags"]); + neighbour.WaterHeight = Convert.ToByte(n["water-height"]); + neighbour.MapImageId = (string)n["map-image-id"]; - neighbours.Add(neighbour); + neighbours.Add(neighbour); + } } return neighbours; -- cgit v1.1 From f0ecc1de4ccb40ed23b5bc925130bda3ff07c1a6 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 10 Jul 2007 20:52:43 +0000 Subject: preliminary inter region communications (between regions in different instances) now works, so child agents and border crossings (and teleporting) now work. The .net remoting is still very basic: we need security sinks added. And we really need the OGS 2 protocol as soon as possible. --- .../Region/Communications/OGS1/OGS1GridServices.cs | 97 ++++++++++++++++++++-- 1 file changed, 88 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 1cadf9b..66c1739 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -29,6 +29,7 @@ namespace OpenSim.Region.Communications.OGS1 serversInfo = servers_info; httpServer = httpServe; httpServer.AddXmlRPCHandler("expect_user", this.ExpectUser); + this.StartRemoting(); } public RegionCommsListener RegisterRegion(RegionInfo regionInfo) @@ -52,6 +53,7 @@ namespace OpenSim.Region.Communications.OGS1 GridParams["sim_name"] = regionInfo.RegionName; GridParams["http_port"] = serversInfo.HttpListenerPort.ToString(); GridParams["remoting_port"] = serversInfo.RemotingListenerPort.ToString(); + GridParams["map-image-id"] = regionInfo.estateSettings.terrainImageID.ToStringHyphenated(); // Package into an XMLRPC Request ArrayList SendParams = new ArrayList(); @@ -97,7 +99,7 @@ namespace OpenSim.Region.Communications.OGS1 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(); @@ -141,8 +143,40 @@ namespace OpenSim.Region.Communications.OGS1 return this.regions[regionHandle]; } //TODO not a region in this instance so ask remote grid server - MainLog.Instance.Warn("Unimplemented - RequestNeighbourInfo()"); - return null; + + Hashtable requestData = new Hashtable(); + requestData["region_handle"] = regionHandle.ToString(); + requestData["authkey"] = this.serversInfo.GridSendKey; + ArrayList SendParams = new ArrayList(); + SendParams.Add(requestData); + XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); + XmlRpcResponse GridResp = GridReq.Send(this.serversInfo.GridURL, 3000); + + Hashtable responseData = (Hashtable)GridResp.Value; + + if (responseData.ContainsKey("error")) + { + Console.WriteLine("error received from grid server" + responseData["error"]); + return null; + } + + uint regX = Convert.ToUInt32((string)responseData["region_locx"]); + uint regY = Convert.ToUInt32((string)responseData["region_locy"]); + string internalIpStr = (string)responseData["sim_ip"]; + uint port = Convert.ToUInt32(responseData["sim_port"]); + string externalUri = (string)responseData["sim_uri"]; + + IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int)port); + string neighbourExternalUri = externalUri; + RegionInfo regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr); + + regionInfo.RemotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); + regionInfo.RemotingAddress = internalIpStr; + + regionInfo.SimUUID = new LLUUID((string)responseData["region_UUID"]); + regionInfo.RegionName = (string)responseData["region_name"]; + + return regionInfo; } public List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) @@ -164,7 +198,7 @@ namespace OpenSim.Region.Communications.OGS1 neighbour.Access = Convert.ToByte(n["access"]); neighbour.RegionFlags = Convert.ToUInt32(n["region-flags"]); neighbour.WaterHeight = Convert.ToByte(n["water-height"]); - neighbour.MapImageId = (string)n["map-image-id"]; + neighbour.MapImageId = new LLUUID((string)n["map-image-id"]); neighbours.Add(neighbour); } @@ -237,10 +271,10 @@ namespace OpenSim.Region.Communications.OGS1 #region InterRegion Comms private void StartRemoting() { - TcpChannel ch = new TcpChannel(8895); + TcpChannel ch = new TcpChannel(this.serversInfo.RemotingListenerPort); ChannelServices.RegisterChannel(ch, true); - WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(Type.GetType("OGS1InterRegionRemoting"), "InterRegions", WellKnownObjectMode.Singleton); + WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton); RemotingConfiguration.RegisterWellKnownServiceType(wellType); InterRegionSingleton.Instance.OnArrival += this.IncomingArrival; InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent; @@ -254,9 +288,31 @@ namespace OpenSim.Region.Communications.OGS1 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. - Console.WriteLine("Inform remote region of child agent not implemented yet"); + RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); + if (regInfo != null) + { + //don't want to be creating a new link to the remote instance every time like we are here + bool retValue = false; + + + OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( + typeof(OGS1InterRegionRemoting), + "tcp://"+ regInfo.RemotingAddress+":"+regInfo.RemotingPort+"/InterRegions"); + if (remObject != null) + { + + retValue = remObject.InformRegionOfChildAgent(regionHandle, agentData); + } + else + { + Console.WriteLine("remoting object not found"); + } + remObject = null; + + + return retValue; + } + return false; } @@ -267,6 +323,29 @@ namespace OpenSim.Region.Communications.OGS1 this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position); return true; } + RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); + if (regInfo != null) + { + bool retValue = false; + + + OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( + typeof(OGS1InterRegionRemoting), + "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions"); + if (remObject != null) + { + + retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position); + } + else + { + Console.WriteLine("remoting object not found"); + } + remObject = null; + + + return retValue; + } //TODO need to see if we know about where this region is and use .net remoting // to inform it. return false; -- cgit v1.1