From 328c9ccb24053b6e8d9d4bba82cec2b433db7bcd Mon Sep 17 00:00:00 2001 From: gareth Date: Sun, 29 Apr 2007 23:58:57 +0000 Subject: [PATCH] Copied gridserver ready to convert to asset server I'M THAT NUTS!!!!!!!! --- .../OpenGrid.Config.GridConfigDb4o.dll.build | 92 ++--- OpenGridServices.AssetServer/Main.cs | 213 ++++++++++++ .../OpenGridServices.GridServer.csproj | 126 +++++++ .../OpenGridServices.GridServer.exe.build | 49 +++ .../Properties/AssemblyInfo.cs | 33 ++ OpenGridServices.AssetServer/SimProfiles.cs | 328 ++++++++++++++++++ .../OpenGridServices.GridServer.exe.build | 98 +++--- .../OpenGridServices.UserServer.exe.build | 96 ++--- .../OpenSim.Framework.Console.dll.build | 84 ++--- OpenSim.Framework/OpenSim.Framework.dll.build | 143 ++++---- .../Xml/OpenSim.GenericConfig.Xml.dll.build | 84 ++--- .../OpenSim.GridInterfaces.Local.dll.build | 92 ++--- .../OpenSim.GridInterfaces.Remote.dll.build | 92 ++--- ...enSim.Physics.BasicPhysicsPlugin.dll.build | 84 ++--- .../Manager/OpenSim.Physics.Manager.dll.build | 94 ++--- .../OpenSim.Physics.OdePlugin.dll.build | 86 ++--- .../OpenSim.Physics.PhysXPlugin.dll.build | 86 ++--- .../OpenSim.RegionServer.dll.build | 158 ++++----- .../OpenSim.Scripting.EmbeddedJVM.dll.build | 124 +++---- OpenSim.Servers/OpenSim.Servers.dll.build | 102 +++--- ...m.Storage.LocalStorageBerkeleyDB.dll.build | 92 ++--- ...OpenSim.Storage.LocalStorageDb4o.dll.build | 94 ++--- ...enSim.Storage.LocalStorageSQLite.dll.build | 92 ++--- .../OpenSim.Terrain.BasicTerrain.dll.build | 86 ++--- OpenSim.build | 260 +++++++------- OpenSim/OpenSim.exe.build | 96 ++--- .../OpenUser.Config.UserConfigDb4o.dll.build | 92 ++--- Prebuild/Prebuild.build | 134 +++---- Prebuild/src/Prebuild.exe.build | 160 ++++----- XmlRpcCS/XMLRPC.dll.build | 116 +++---- 30 files changed, 2118 insertions(+), 1368 deletions(-) create mode 100644 OpenGridServices.AssetServer/Main.cs create mode 100644 OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj create mode 100644 OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build create mode 100644 OpenGridServices.AssetServer/Properties/AssemblyInfo.cs create mode 100644 OpenGridServices.AssetServer/SimProfiles.cs diff --git a/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build b/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build index 61d3efdd8d..73e09cee24 100644 --- a/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build +++ b/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenGridServices.AssetServer/Main.cs b/OpenGridServices.AssetServer/Main.cs new file mode 100644 index 0000000000..69cba9c9dd --- /dev/null +++ b/OpenGridServices.AssetServer/Main.cs @@ -0,0 +1,213 @@ +/* +Copyright (c) OpenSim project, http://osgrid.org/ + + +* All rights reserved. +* +* 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 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 ``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 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.IO; +using System.Text; +using System.Timers; +using System.Net; +using System.Reflection; +using libsecondlife; +using OpenSim.Framework; +using OpenSim.Framework.Sims; +using OpenSim.Framework.Console; +using OpenSim.Framework.Interfaces; +using OpenSim.Servers; + +namespace OpenGridServices.GridServer +{ + /// + /// + public class OpenGrid_Main : BaseServer, conscmd_callback + { + private string ConfigDll = "OpenGrid.Config.GridConfigDb4o.dll"; + public GridConfig Cfg; + + public static OpenGrid_Main thegrid; + + //public LLUUID highestUUID; + + private SimProfileManager m_simProfileManager; + + private ConsoleBase m_console; + + [STAThread] + public static void Main(string[] args) + { + Console.WriteLine("Starting...\n"); + + thegrid = new OpenGrid_Main(); + thegrid.Startup(); + + thegrid.Work(); + } + + private void Work() + { + m_console.WriteLine("\nEnter help for a list of commands\n"); + + while (true) + { + m_console.MainConsolePrompt(); + } + } + + private OpenGrid_Main() + { + m_console = new ConsoleBase("opengrid-gridserver-console.log", "OpenGrid", this, false); + MainConsole.Instance = m_console; + } + + public void Startup() + { + m_console.WriteLine("Main.cs:Startup() - Loading configuration"); + Cfg = this.LoadConfigDll(this.ConfigDll); + Cfg.InitConfig(); + + m_console.WriteLine("Main.cs:Startup() - Loading sim profiles from database"); + m_simProfileManager = new SimProfileManager( this ); + m_simProfileManager.LoadProfiles(); + + m_console.WriteLine("Main.cs:Startup() - Starting HTTP process"); + BaseHttpServer httpServer = new BaseHttpServer(8001); + + httpServer.AddXmlRPCHandler("simulator_login", m_simProfileManager.XmlRpcLoginToSimulatorMethod); + + httpServer.AddRestHandler("GET", "/sims/", m_simProfileManager.RestGetSimMethod); + httpServer.AddRestHandler("POST", "/sims/", m_simProfileManager.RestSetSimMethod); + httpServer.AddRestHandler("GET", "/regions/", m_simProfileManager.RestGetRegionMethod); + httpServer.AddRestHandler("POST", "/regions/", m_simProfileManager.RestSetRegionMethod); + + + // lbsa71 : This code snippet taken from old http server. + // I have no idea what this was supposed to do - looks like an infinite recursion to me. + // case "regions": + //// DIRTY HACK ALERT + //Console.WriteLine("/regions/ accessed"); + //TheSim = OpenGrid_Main.thegrid._regionmanager.GetProfileByHandle((ulong)Convert.ToUInt64(rest_params[1])); + //respstring = ParseREST("/regions/" + rest_params[1], requestBody, HTTPmethod); + //break; + + // lbsa71 : I guess these were never used? + //Listener.Prefixes.Add("http://+:8001/gods/"); + //Listener.Prefixes.Add("http://+:8001/highestuuid/"); + //Listener.Prefixes.Add("http://+:8001/uuidblocks/"); + + httpServer.Start(); + + m_console.WriteLine("Main.cs:Startup() - Starting sim status checker"); + + Timer simCheckTimer = new Timer( 300000 ); // 5 minutes + simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); + simCheckTimer.Enabled = true; + } + + private GridConfig LoadConfigDll(string dllName) + { + Assembly pluginAssembly = Assembly.LoadFrom(dllName); + GridConfig config = null; + + foreach (Type pluginType in pluginAssembly.GetTypes()) + { + if (pluginType.IsPublic) + { + if (!pluginType.IsAbstract) + { + Type typeInterface = pluginType.GetInterface("IGridConfig", true); + + if (typeInterface != null) + { + IGridConfig plug = (IGridConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + config = plug.GetConfigObject(); + break; + } + + typeInterface = null; + } + } + } + pluginAssembly = null; + return config; + } + + public void CheckSims(object sender, ElapsedEventArgs e) + { + foreach (SimProfileBase sim in m_simProfileManager.SimProfiles.Values) + { + string SimResponse = ""; + try + { + WebRequest CheckSim = WebRequest.Create("http://" + sim.sim_ip + ":" + sim.sim_port.ToString() + "/checkstatus/"); + CheckSim.Method = "GET"; + CheckSim.ContentType = "text/plaintext"; + CheckSim.ContentLength = 0; + + StreamWriter stOut = new StreamWriter(CheckSim.GetRequestStream(), System.Text.Encoding.ASCII); + stOut.Write(""); + stOut.Close(); + + StreamReader stIn = new StreamReader(CheckSim.GetResponse().GetResponseStream()); + SimResponse = stIn.ReadToEnd(); + stIn.Close(); + } + catch + { + } + + if (SimResponse == "OK") + { + m_simProfileManager.SimProfiles[sim.UUID].online = true; + } + else + { + m_simProfileManager.SimProfiles[sim.UUID].online = false; + } + } + } + + public void RunCmd(string cmd, string[] cmdparams) + { + switch (cmd) + { + case "help": + m_console.WriteLine("shutdown - shutdown the grid (USE CAUTION!)"); + break; + + case "shutdown": + m_console.Close(); + Environment.Exit(0); + break; + } + } + + public void Show(string ShowWhat) + { + } + } +} diff --git a/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj b/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj new file mode 100644 index 0000000000..9b8cc87b34 --- /dev/null +++ b/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj @@ -0,0 +1,126 @@ + + + Local + 8.0.50727 + 2.0 + {21BFC8E2-0000-0000-0000-000000000000} + Debug + AnyCPU + + + + OpenGridServices.GridServer + JScript + Grid + IE50 + false + Exe + + OpenGridServices.GridServer + + + + + + 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 + + + + + System.dll + False + + + System.Data.dll + False + + + System.Xml.dll + False + + + ..\bin\libsecondlife.dll + False + + + ..\bin\Db4objects.Db4o.dll + False + + + + + OpenSim.Framework + {8ACA2445-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.Servers + {8BB20F0A-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + + + XMLRPC + {8E81D43C-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + + + + + Code + + + Code + + + Code + + + + + + + + + + diff --git a/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build b/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build new file mode 100644 index 0000000000..6bef534866 --- /dev/null +++ b/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenGridServices.AssetServer/Properties/AssemblyInfo.cs b/OpenGridServices.AssetServer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..8471e6b067 --- /dev/null +++ b/OpenGridServices.AssetServer/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +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("OGS-GridServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OGS-GridServer")] +[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("b541b244-3d1d-4625-9003-bc2a3a6a39a4")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenGridServices.AssetServer/SimProfiles.cs b/OpenGridServices.AssetServer/SimProfiles.cs new file mode 100644 index 0000000000..ae40133ec4 --- /dev/null +++ b/OpenGridServices.AssetServer/SimProfiles.cs @@ -0,0 +1,328 @@ +/* +Copyright (c) OpenGrid project, http://osgrid.org/ + + +* All rights reserved. +* +* 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 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 ``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 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.Text; +using System.Collections; +using System.Collections.Generic; +using libsecondlife; +using OpenSim.Framework.Utilities; +using OpenSim.Framework.Console; +using OpenSim.Framework.Sims; +using Db4objects.Db4o; +using Nwc.XmlRpc; +using System.Xml; + +namespace OpenGridServices.GridServer +{ + /// + /// + public class SimProfileManager + { + + public Dictionary SimProfiles = new Dictionary(); + private OpenGrid_Main m_gridManager; + + public SimProfileManager(OpenGrid_Main gridManager) + { + m_gridManager = gridManager; + } + + public void LoadProfiles() + { // should abstract this out + IObjectContainer db; + db = Db4oFactory.OpenFile("simprofiles.yap"); + IObjectSet result = db.Get(typeof(SimProfileBase)); + foreach (SimProfileBase simprof in result) + { + SimProfiles.Add(simprof.UUID, simprof); + } + MainConsole.Instance.WriteLine("SimProfiles.Cs:LoadProfiles() - Successfully loaded " + result.Count.ToString() + " from database"); + db.Close(); + } + + public SimProfileBase GetProfileByHandle(ulong reqhandle) + { + foreach (libsecondlife.LLUUID UUID in SimProfiles.Keys) + { + if (SimProfiles[UUID].regionhandle == reqhandle) return SimProfiles[UUID]; + } + return null; + } + + public SimProfileBase GetProfileByLLUUID(LLUUID ProfileLLUUID) + { + foreach (libsecondlife.LLUUID UUID in SimProfiles.Keys) + { + if (SimProfiles[UUID].UUID == ProfileLLUUID) return SimProfiles[UUID]; + } + return null; + } + + public bool AuthenticateSim(LLUUID RegionUUID, uint regionhandle, string simrecvkey) + { + SimProfileBase TheSim = GetProfileByHandle(regionhandle); + if (TheSim != null) + if (TheSim.recvkey == simrecvkey) + { + return true; + } + else + { + return false; + } + else return false; + + } + + public string GetXMLNeighbours(ulong reqhandle) + { + string response = ""; + SimProfileBase central_region = GetProfileByHandle(reqhandle); + SimProfileBase neighbour; + for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++) + { + if (GetProfileByHandle(Util.UIntsToLong((uint)((central_region.RegionLocX + x) * 256), (uint)(central_region.RegionLocY + y) * 256)) != null) + { + neighbour = GetProfileByHandle(Util.UIntsToLong((uint)((central_region.RegionLocX + x) * 256), (uint)(central_region.RegionLocY + y) * 256)); + response += ""; + response += "" + neighbour.sim_ip + ""; + response += "" + neighbour.sim_port.ToString() + ""; + response += "" + neighbour.RegionLocX.ToString() + ""; + response += "" + neighbour.RegionLocY.ToString() + ""; + response += "" + neighbour.regionhandle.ToString() + ""; + response += ""; + + } + } + return response; + } + + public SimProfileBase CreateNewProfile(string regionname, string caps_url, string sim_ip, uint sim_port, uint RegionLocX, uint RegionLocY, string sendkey, string recvkey) + { + SimProfileBase newprofile = new SimProfileBase(); + newprofile.regionname = regionname; + newprofile.sim_ip = sim_ip; + newprofile.sim_port = sim_port; + newprofile.RegionLocX = RegionLocX; + newprofile.RegionLocY = RegionLocY; + newprofile.caps_url = "http://" + sim_ip + ":9000/"; + newprofile.sendkey = sendkey; + newprofile.recvkey = recvkey; + newprofile.regionhandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); + newprofile.UUID = LLUUID.Random(); + this.SimProfiles.Add(newprofile.UUID, newprofile); + return newprofile; + } + + public XmlRpcResponse XmlRpcLoginToSimulatorMethod(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable responseData = new Hashtable(); + response.Value = responseData; + + SimProfileBase TheSim = null; + Hashtable requestData = (Hashtable)request.Params[0]; + + if (requestData.ContainsKey("UUID")) + { + TheSim = GetProfileByLLUUID(new LLUUID((string)requestData["UUID"])); + } + else if (requestData.ContainsKey("region_handle")) + { + TheSim = GetProfileByHandle((ulong)Convert.ToUInt64(requestData["region_handle"])); + } + + if (TheSim == null) + { + responseData["error"] = "sim not found"; + } + else + { + + ArrayList SimNeighboursData = new ArrayList(); + + SimProfileBase neighbour; + Hashtable NeighbourBlock; + for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++) + { + if (GetProfileByHandle(Helpers.UIntsToLong((uint)((TheSim.RegionLocX + x) * 256), (uint)(TheSim.RegionLocY + y) * 256)) != null) + { + neighbour = GetProfileByHandle(Helpers.UIntsToLong((uint)((TheSim.RegionLocX + x) * 256), (uint)(TheSim.RegionLocY + y) * 256)); + + NeighbourBlock = new Hashtable(); + NeighbourBlock["sim_ip"] = neighbour.sim_ip; + NeighbourBlock["sim_port"] = neighbour.sim_port.ToString(); + NeighbourBlock["region_locx"] = neighbour.RegionLocX.ToString(); + NeighbourBlock["region_locy"] = neighbour.RegionLocY.ToString(); + NeighbourBlock["UUID"] = neighbour.UUID.ToString(); + + if (neighbour.UUID != TheSim.UUID) SimNeighboursData.Add(NeighbourBlock); + } + } + + responseData["UUID"] = TheSim.UUID.ToString(); + responseData["region_locx"] = TheSim.RegionLocX.ToString(); + responseData["region_locy"] = TheSim.RegionLocY.ToString(); + responseData["regionname"] = TheSim.regionname; + responseData["estate_id"] = "1"; + responseData["neighbours"] = SimNeighboursData; + + responseData["sim_ip"] = TheSim.sim_ip; + responseData["sim_port"] = TheSim.sim_port.ToString(); + responseData["asset_url"] = m_gridManager.Cfg.DefaultAssetServer; + responseData["asset_sendkey"] = m_gridManager.Cfg.AssetSendKey; + responseData["asset_recvkey"] = m_gridManager.Cfg.AssetRecvKey; + responseData["user_url"] = m_gridManager.Cfg.DefaultUserServer; + responseData["user_sendkey"] = m_gridManager.Cfg.UserSendKey; + responseData["user_recvkey"] = m_gridManager.Cfg.UserRecvKey; + responseData["authkey"] = m_gridManager.Cfg.SimSendKey; + } + + return response; + } + + public string RestSetSimMethod(string request, string path, string param) + { + Console.WriteLine("SimProfiles.cs:RestSetSimMethod() - processing request......"); + SimProfileBase TheSim; + TheSim = GetProfileByLLUUID(new LLUUID(param)); + if ((TheSim) == null) + { + TheSim = new SimProfileBase(); + LLUUID UUID = new LLUUID(param); + TheSim.UUID = UUID; + } + + XmlDocument doc = new XmlDocument(); + doc.LoadXml(request); + XmlNode rootnode = doc.FirstChild; + XmlNode authkeynode = rootnode.ChildNodes[0]; + if (authkeynode.Name != "authkey") + { + return "ERROR! bad XML - expected authkey tag"; + } + + XmlNode simnode = rootnode.ChildNodes[1]; + if (simnode.Name != "sim") + { + return "ERROR! bad XML - expected sim tag"; + } + + if (authkeynode.InnerText != m_gridManager.Cfg.SimRecvKey) + { + return "ERROR! invalid key"; + } + for (int i = 0; i < simnode.ChildNodes.Count; i++) + { + switch (simnode.ChildNodes[i].Name) + { + case "regionname": + TheSim.regionname = simnode.ChildNodes[i].InnerText; + break; + + case "sim_ip": + TheSim.sim_ip = simnode.ChildNodes[i].InnerText; + break; + + case "sim_port": + TheSim.sim_port = Convert.ToUInt32(simnode.ChildNodes[i].InnerText); + break; + + case "region_locx": + TheSim.RegionLocX = Convert.ToUInt32((string)simnode.ChildNodes[i].InnerText); + TheSim.regionhandle = Helpers.UIntsToLong((TheSim.RegionLocX * 256), (TheSim.RegionLocY * 256)); + break; + + case "region_locy": + TheSim.RegionLocY = Convert.ToUInt32((string)simnode.ChildNodes[i].InnerText); + TheSim.regionhandle = Helpers.UIntsToLong((TheSim.RegionLocX * 256), (TheSim.RegionLocY * 256)); + break; + } + } + + try + { + SimProfiles.Add(TheSim.UUID, TheSim); + IObjectContainer db; + db = Db4oFactory.OpenFile("simprofiles.yap"); + db.Set(TheSim); + db.Close(); + return "OK"; + } + catch (Exception e) + { + return "ERROR! could not save to database!"; + } + + } + + public string RestGetRegionMethod(string request, string path, string param) + { + SimProfileBase TheSim = GetProfileByHandle((ulong)Convert.ToUInt64(param)); + return RestGetSimMethod("", "/sims/", param); + } + + public string RestSetRegionMethod(string request, string path, string param) + { + SimProfileBase TheSim = GetProfileByHandle((ulong)Convert.ToUInt64(param)); + return RestSetSimMethod("", "/sims/", param); + } + + public string RestGetSimMethod(string request, string path, string param) + { + string respstring = String.Empty; + + SimProfileBase TheSim; + LLUUID UUID = new LLUUID(param); + TheSim = GetProfileByLLUUID(UUID); + + if (!(TheSim == null)) + { + respstring = ""; + respstring += "" + m_gridManager.Cfg.SimSendKey + ""; + respstring += ""; + respstring += "" + TheSim.UUID.ToString() + ""; + respstring += "" + TheSim.regionname + ""; + respstring += "" + TheSim.sim_ip + ""; + respstring += "" + TheSim.sim_port.ToString() + ""; + respstring += "" + TheSim.RegionLocX.ToString() + ""; + respstring += "" + TheSim.RegionLocY.ToString() + ""; + respstring += "1"; + respstring += ""; + respstring += ""; + } + + return respstring; + } + + } + + +} diff --git a/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build b/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build index ae1e8897ab..6bef534866 100644 --- a/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build +++ b/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build @@ -1,49 +1,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build b/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build index 8dd9443eef..0d02f7b886 100644 --- a/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build +++ b/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build @@ -1,48 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build b/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build index fa90bb60cc..a3019ee83e 100644 --- a/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build +++ b/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Framework/OpenSim.Framework.dll.build b/OpenSim.Framework/OpenSim.Framework.dll.build index 2ed56437b3..84f7e1f391 100644 --- a/OpenSim.Framework/OpenSim.Framework.dll.build +++ b/OpenSim.Framework/OpenSim.Framework.dll.build @@ -1,71 +1,72 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build b/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build index f34e4acbd5..63359857bb 100644 --- a/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build +++ b/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build b/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build index 6bf398e574..c7a19667e2 100644 --- a/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build +++ b/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build b/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build index 96272dd72e..18571dc3a5 100644 --- a/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build +++ b/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build b/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build index 3497a55352..7b063a3634 100644 --- a/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build +++ b/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build b/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build index 4b5ee51cc6..15544852b9 100644 --- a/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build +++ b/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build @@ -1,47 +1,47 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build b/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build index f25361a432..098472aac4 100644 --- a/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build +++ b/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build b/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build index 5ab70bb7c1..3ae7013826 100644 --- a/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build +++ b/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build index 982f45cb9b..871d639d3a 100644 --- a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build +++ b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build @@ -1,79 +1,79 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build b/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build index ae79c834ce..cf6c71d4d0 100644 --- a/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build +++ b/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build @@ -1,62 +1,62 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Servers/OpenSim.Servers.dll.build b/OpenSim.Servers/OpenSim.Servers.dll.build index 61475ecac9..17a233e218 100644 --- a/OpenSim.Servers/OpenSim.Servers.dll.build +++ b/OpenSim.Servers/OpenSim.Servers.dll.build @@ -1,51 +1,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build b/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build index 885b088d6e..530861de6d 100644 --- a/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build +++ b/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build b/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build index 8be321dda7..439f440097 100644 --- a/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build +++ b/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build @@ -1,47 +1,47 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build b/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build index 79c27fc108..0e27131e8e 100644 --- a/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build +++ b/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build b/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build index d2e6c9f77a..2c43aa01e8 100644 --- a/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build +++ b/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.build b/OpenSim.build index 06743ed37d..15b6371736 100644 --- a/OpenSim.build +++ b/OpenSim.build @@ -1,130 +1,130 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim/OpenSim.exe.build b/OpenSim/OpenSim.exe.build index 02445dfb79..54b7a3b64d 100644 --- a/OpenSim/OpenSim.exe.build +++ b/OpenSim/OpenSim.exe.build @@ -1,48 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build b/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build index 8494a0b814..0abcfa125c 100644 --- a/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build +++ b/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Prebuild/Prebuild.build b/Prebuild/Prebuild.build index 395fb31e54..743b8263b6 100644 --- a/Prebuild/Prebuild.build +++ b/Prebuild/Prebuild.build @@ -1,67 +1,67 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Prebuild/src/Prebuild.exe.build b/Prebuild/src/Prebuild.exe.build index 43f5516127..628e7e160d 100644 --- a/Prebuild/src/Prebuild.exe.build +++ b/Prebuild/src/Prebuild.exe.build @@ -1,80 +1,80 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlRpcCS/XMLRPC.dll.build b/XmlRpcCS/XMLRPC.dll.build index d734d198cb..fdd12058b7 100644 --- a/XmlRpcCS/XMLRPC.dll.build +++ b/XmlRpcCS/XMLRPC.dll.build @@ -1,58 +1,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +