From 646bbbc84b8010e0dacbeed5342cdb045f46cc49 Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 27 Jun 2007 15:28:52 +0000 Subject: Some work on restructuring the namespaces / project names. Note this doesn't compile yet as not all the code has been changed to use the new namespaces. Am committing it now for feedback on the namespaces. --- OpenSim/Grid/AssetServer/AssetHttpServer.cs | 130 +++++ OpenSim/Grid/AssetServer/Main.cs | 337 ++++++++++++ .../AssetServer/OpenSim.Grid.AssetServer.csproj | 118 ++++ .../OpenSim.Grid.AssetServer.csproj.user | 12 + .../Grid/AssetServer/Properties/AssemblyInfo.cs | 60 +++ .../Grid/Framework.Manager/GridManagementAgent.cs | 140 +++++ .../Grid/Framework.Manager/GridServerManager.cs | 94 ++++ .../OpenSim.Grid.Framework.Manager.csproj | 99 ++++ .../OpenSim.Grid.Framework.Manager.csproj.user | 12 + OpenSim/Grid/GridServer.Config/AssemblyInfo.cs | 58 ++ OpenSim/Grid/GridServer.Config/DbGridConfig.cs | 161 ++++++ .../OpenSim.Grid.GridServer.Config.csproj | 107 ++++ .../OpenSim.Grid.GridServer.Config.csproj.user | 12 + OpenSim/Grid/GridServer/GridManager.cs | 599 +++++++++++++++++++++ OpenSim/Grid/GridServer/Main.cs | 271 ++++++++++ .../Grid/GridServer/OpenSim.Grid.GridServer.csproj | 134 +++++ .../GridServer/OpenSim.Grid.GridServer.csproj.user | 12 + OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs | 60 +++ OpenSim/Grid/InventoryServer/InventoryManager.cs | 125 +++++ OpenSim/Grid/InventoryServer/Main.cs | 87 +++ OpenSim/Grid/Manager/OpenGridServices.Manager.mds | 16 + .../Manager/OpenGridServices.Manager.userprefs | 39 ++ .../Manager/OpenGridServices.Manager.usertasks | 2 + .../OpenGridServices.Manager/AssemblyInfo.cs | 32 ++ .../OpenGridServices.Manager/BlockingQueue.cs | 33 ++ .../Connect to grid server.cs | 16 + .../ConnectToGridServerDialog.cs | 29 + .../GridServerConnectionManager.cs | 106 ++++ .../Grid/Manager/OpenGridServices.Manager/Main.cs | 96 ++++ .../Manager/OpenGridServices.Manager/MainWindow.cs | 76 +++ .../OpenGridServices.Manager.mdp | 43 ++ .../OpenGridServices.Manager.pidb | Bin 0 -> 12308 bytes .../OpenGridServices.Manager/RegionBlock.cs | 37 ++ .../Grid/Manager/OpenGridServices.Manager/Util.cs | 133 +++++ ...idServices.Manager.ConnectToGridServerDialog.cs | 226 ++++++++ .../gtk-gui/OpenGridServices.Manager.MainWindow.cs | 256 +++++++++ .../OpenGridServices.Manager/gtk-gui/generated.cs | 35 ++ .../OpenGridServices.Manager/gtk-gui/gui.stetic | 502 +++++++++++++++++ OpenSim/Grid/UserServer.Config/AssemblyInfo.cs | 58 ++ OpenSim/Grid/UserServer.Config/DbUserConfig.cs | 96 ++++ .../OpenSim.Grid.UserServer.Config.csproj | 107 ++++ .../OpenSim.Grid.UserServer.Config.csproj.user | 12 + OpenSim/Grid/UserServer/Main.cs | 219 ++++++++ .../Grid/UserServer/OpenSim.Grid.UserServer.csproj | 132 +++++ .../UserServer/OpenSim.Grid.UserServer.csproj.user | 12 + OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs | 33 ++ OpenSim/Grid/UserServer/UserManager.cs | 103 ++++ 47 files changed, 5077 insertions(+) create mode 100644 OpenSim/Grid/AssetServer/AssetHttpServer.cs create mode 100644 OpenSim/Grid/AssetServer/Main.cs create mode 100644 OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj create mode 100644 OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj.user create mode 100644 OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs create mode 100644 OpenSim/Grid/Framework.Manager/GridManagementAgent.cs create mode 100644 OpenSim/Grid/Framework.Manager/GridServerManager.cs create mode 100644 OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj create mode 100644 OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj.user create mode 100644 OpenSim/Grid/GridServer.Config/AssemblyInfo.cs create mode 100644 OpenSim/Grid/GridServer.Config/DbGridConfig.cs create mode 100644 OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj create mode 100644 OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj.user create mode 100644 OpenSim/Grid/GridServer/GridManager.cs create mode 100644 OpenSim/Grid/GridServer/Main.cs create mode 100644 OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj create mode 100644 OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj.user create mode 100644 OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs create mode 100644 OpenSim/Grid/InventoryServer/InventoryManager.cs create mode 100644 OpenSim/Grid/InventoryServer/Main.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager.mds create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager.userprefs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager.usertasks create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/AssemblyInfo.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/Connect to grid server.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/OpenGridServices.Manager.pidb create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/RegionBlock.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/Util.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/generated.cs create mode 100644 OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/gui.stetic create mode 100644 OpenSim/Grid/UserServer.Config/AssemblyInfo.cs create mode 100644 OpenSim/Grid/UserServer.Config/DbUserConfig.cs create mode 100644 OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj create mode 100644 OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj.user create mode 100644 OpenSim/Grid/UserServer/Main.cs create mode 100644 OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj create mode 100644 OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj.user create mode 100644 OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs create mode 100644 OpenSim/Grid/UserServer/UserManager.cs (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/AssetHttpServer.cs b/OpenSim/Grid/AssetServer/AssetHttpServer.cs new file mode 100644 index 0000000..6fc6bf8 --- /dev/null +++ b/OpenSim/Grid/AssetServer/AssetHttpServer.cs @@ -0,0 +1,130 @@ +/* +* 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.Net; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; +//using OpenSim.CAPS; +using Nwc.XmlRpc; +using System.Collections; +using OpenSim.Framework.Console; +using OpenSim.Servers; + +namespace OpenGridServices.AssetServer +{ + /// + /// An HTTP server for sending assets + /// + public class AssetHttpServer :BaseHttpServer + { + /// + /// Creates the new asset server + /// + /// Port to initalise on + public AssetHttpServer(int port) + : base(port) + { + } + + /// + /// Handles an HTTP request + /// + /// HTTP State Info + public override void HandleRequest(Object stateinfo) + { + try + { + HttpListenerContext context = (HttpListenerContext)stateinfo; + + HttpListenerRequest request = context.Request; + HttpListenerResponse response = context.Response; + + response.KeepAlive = false; + response.SendChunked = false; + + System.IO.Stream body = request.InputStream; + System.Text.Encoding encoding = System.Text.Encoding.UTF8; + System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding); + + string requestBody = reader.ReadToEnd(); + body.Close(); + reader.Close(); + + //Console.WriteLine(request.HttpMethod + " " + request.RawUrl + " Http/" + request.ProtocolVersion.ToString() + " content type: " + request.ContentType); + //Console.WriteLine(requestBody); + + string responseString = ""; + switch (request.ContentType) + { + case "text/xml": + // must be XML-RPC, so pass to the XML-RPC parser + + responseString = ParseXMLRPC(requestBody); + responseString = Regex.Replace(responseString, "utf-16", "utf-8"); + + response.AddHeader("Content-type", "text/xml"); + break; + + case "application/xml": + // probably LLSD we hope, otherwise it should be ignored by the parser + responseString = ParseLLSDXML(requestBody); + response.AddHeader("Content-type", "application/xml"); + break; + + case "application/x-www-form-urlencoded": + // a form data POST so send to the REST parser + responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); + response.AddHeader("Content-type", "text/plain"); + break; + + case null: + // must be REST or invalid crap, so pass to the REST parser + responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); + response.AddHeader("Content-type", "text/plain"); + break; + + } + + Encoding Windows1252Encoding = Encoding.GetEncoding(1252); + byte[] buffer = Windows1252Encoding.GetBytes(responseString); + System.IO.Stream output = response.OutputStream; + response.SendChunked = false; + response.ContentLength64 = buffer.Length; + output.Write(buffer, 0, buffer.Length); + output.Close(); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + } + } + + } +} diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs new file mode 100644 index 0000000..96c9dba --- /dev/null +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -0,0 +1,337 @@ +/* +* 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.IO; +using System.Text; +using System.Timers; +using System.Net; +using System.Reflection; +using System.Threading; +using libsecondlife; +using OpenSim.Framework; +using OpenSim.Framework.Sims; +using OpenSim.Framework.Console; +using OpenSim.Framework.Types; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Utilities; +using OpenSim.Servers; +using Db4objects.Db4o; +using Db4objects.Db4o.Query; + +namespace OpenGridServices.AssetServer +{ + /// + /// An asset server + /// + public class OpenAsset_Main : conscmd_callback + { + private IObjectContainer db; + + public static OpenAsset_Main assetserver; + + private LogBase m_console; + + [STAThread] + public static void Main(string[] args) + { + Console.WriteLine("Starting...\n"); + + assetserver = new OpenAsset_Main(); + assetserver.Startup(); + + assetserver.Work(); + } + + private void Work() + { + m_console.Notice("Enter help for a list of commands"); + + while (true) + { + m_console.MainLogPrompt(); + } + } + + private OpenAsset_Main() + { + m_console = new LogBase("opengrid-AssetServer-console.log", "OpenAsset", this, false); + OpenSim.Framework.Console.MainLog.Instance = m_console; + } + + public void Startup() + { + m_console.Verbose( "Main.cs:Startup() - Setting up asset DB"); + setupDB(); + + m_console.Verbose( "Main.cs:Startup() - Starting HTTP process"); + AssetHttpServer httpServer = new AssetHttpServer(8003); + + + httpServer.AddRestHandler("GET", "/assets/", this.assetGetMethod); + httpServer.AddRestHandler("POST", "/assets/", this.assetPostMethod); + + httpServer.Start(); + + } + + public string assetPostMethod(string requestBody, string path, string param) + { + AssetBase asset = new AssetBase(); + asset.Name = ""; + asset.FullID = new LLUUID(param); + Encoding Windows1252Encoding = Encoding.GetEncoding(1252); + byte[] buffer = Windows1252Encoding.GetBytes(requestBody); + asset.Data = buffer; + AssetStorage store = new AssetStorage(); + store.Data = asset.Data; + store.Name = asset.Name; + store.UUID = asset.FullID; + db.Set(store); + db.Commit(); + return ""; + } + + public string assetGetMethod(string request, string path, string param) + { + Console.WriteLine("got a request " + param); + byte[] assetdata = getAssetData(new LLUUID(param), false); + if (assetdata != null) + { + Encoding Windows1252Encoding = Encoding.GetEncoding(1252); + string ret = Windows1252Encoding.GetString(assetdata); + //string ret = System.Text.Encoding.Unicode.GetString(assetdata); + + return ret; + + } + else + { + return ""; + } + + } + + public byte[] getAssetData(LLUUID assetID, bool isTexture) + { + bool found = false; + AssetStorage foundAsset = null; + + IObjectSet result = db.Get(new AssetStorage(assetID)); + if (result.Count > 0) + { + foundAsset = (AssetStorage)result.Next(); + found = true; + } + + if (found) + { + return foundAsset.Data; + } + else + { + return null; + } + } + + public void setupDB() + { + bool yapfile = System.IO.File.Exists("assets.yap"); + try + { + db = Db4oFactory.OpenFile("assets.yap"); + OpenSim.Framework.Console.MainLog.Instance.Verbose( "Main.cs:setupDB() - creation"); + } + catch (Exception e) + { + db.Close(); + OpenSim.Framework.Console.MainLog.Instance.Warn("Main.cs:setupDB() - Exception occured"); + OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + } + if (!yapfile) + { + this.LoadDB(); + } + } + + public void LoadDB() + { + try + { + + Console.WriteLine("setting up Asset database"); + + AssetBase Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001"); + Image.Name = "Bricks"; + this.LoadAsset(Image, true, "bricks.jp2"); + AssetStorage store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000002"); + Image.Name = "Plywood"; + this.LoadAsset(Image, true, "plywood.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000003"); + Image.Name = "Rocks"; + this.LoadAsset(Image, true, "rocks.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000004"); + Image.Name = "Granite"; + this.LoadAsset(Image, true, "granite.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000005"); + Image.Name = "Hardwood"; + this.LoadAsset(Image, true, "hardwood.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("00000000-0000-0000-5005-000000000005"); + Image.Name = "Prim Base Texture"; + this.LoadAsset(Image, true, "plywood.jp2"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + + Image = new AssetBase(); + Image.FullID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); + Image.Name = "Shape"; + this.LoadAsset(Image, false, "base_shape.dat"); + store = new AssetStorage(); + store.Data = Image.Data; + store.Name = Image.Name; + store.UUID = Image.FullID; + db.Set(store); + db.Commit(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + } + + private void LoadAsset(AssetBase info, bool image, string filename) + { + + + string dataPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder; + string fileName = Path.Combine(dataPath, filename); + FileInfo fInfo = new FileInfo(fileName); + long numBytes = fInfo.Length; + FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); + byte[] idata = new byte[numBytes]; + BinaryReader br = new BinaryReader(fStream); + idata = br.ReadBytes((int)numBytes); + br.Close(); + fStream.Close(); + info.Data = idata; + //info.loaded=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 RunCmd(string cmd, string[] cmdparams) + { + switch (cmd) + { + case "help": + m_console.Notice("shutdown - shutdown this asset server (USE CAUTION!)"); + break; + + case "shutdown": + m_console.Close(); + Environment.Exit(0); + break; + } + } + + public void Show(string ShowWhat) + { + } + } +} diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj new file mode 100644 index 0000000..caebca3 --- /dev/null +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj @@ -0,0 +1,118 @@ + + + Local + 8.0.50727 + 2.0 + {E5F1A03B-0000-0000-0000-000000000000} + Debug + AnyCPU + + + + OpenSim.Grid.AssetServer + JScript + Grid + IE50 + false + Exe + + OpenSim.Grid.AssetServer + + + + + + 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\Db4objects.Db4o.dll + False + + + ..\..\..\bin\libsecondlife.dll + False + + + OpenSim.Framework.dll + False + + + OpenSim.Framework.Console.dll + False + + + OpenSim.Framework.Servers.dll + False + + + System.dll + False + + + System.Data.dll + False + + + System.Xml.dll + False + + + ..\..\..\bin\XMLRPC.dll + False + + + + + + + Code + + + Code + + + Code + + + + + + + + + + diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj.user b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj.user new file mode 100644 index 0000000..6841907 --- /dev/null +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj.user @@ -0,0 +1,12 @@ + + + Debug + AnyCPU + C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ + 8.0.50727 + ProjectFiles + 0 + + + + diff --git a/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f9a18a8 --- /dev/null +++ b/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs @@ -0,0 +1,60 @@ +/* +* 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.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-AssetServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OGS-AssetServer")] +[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/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs b/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs new file mode 100644 index 0000000..dfc572a --- /dev/null +++ b/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs @@ -0,0 +1,140 @@ +/* +* 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 Nwc.XmlRpc; +using OpenSim.Framework; +using OpenSim.Servers; +using System.Collections; +using System.Collections.Generic; +using libsecondlife; + +namespace OpenGrid.Framework.Manager +{ + /// + /// Used to pass messages to the gridserver + /// + /// Pass this argument + public delegate void GridManagerCallback(string param); + + /// + /// Serverside listener for grid commands + /// + public class GridManagementAgent + { + /// + /// Passes grid server messages + /// + private GridManagerCallback thecallback; + + /// + /// Security keys + /// + private string sendkey; + private string recvkey; + + /// + /// Our component type + /// + private string component_type; + + /// + /// List of active sessions + /// + private static ArrayList Sessions; + + /// + /// Initialises a new GridManagementAgent + /// + /// HTTP Daemon for this server + /// What component type are we? + /// Security send key + /// Security recieve key + /// Message callback + public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback) + { + this.sendkey = sendkey; + this.recvkey = recvkey; + this.component_type = component_type; + this.thecallback = thecallback; + Sessions = new ArrayList(); + + app_httpd.AddXmlRPCHandler("manager_login", XmlRpcLoginMethod); + + switch (component_type) + { + case "gridserver": + GridServerManager.sendkey = this.sendkey; + GridServerManager.recvkey = this.recvkey; + GridServerManager.thecallback = thecallback; + app_httpd.AddXmlRPCHandler("shutdown", GridServerManager.XmlRpcShutdownMethod); + break; + } + } + + /// + /// Checks if a session exists + /// + /// The session ID + /// Exists? + public static bool SessionExists(LLUUID sessionID) + { + return Sessions.Contains(sessionID); + } + + /// + /// Logs a new session to the grid manager + /// + /// the XMLRPC request + /// An XMLRPC reply + public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable requestData = (Hashtable)request.Params[0]; + Hashtable responseData = new Hashtable(); + + // TODO: Switch this over to using OpenGrid.Framework.Data + if (requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret")) + { + response.IsFault = false; + LLUUID new_session = LLUUID.Random(); + Sessions.Add(new_session); + responseData["session_id"] = new_session.ToString(); + responseData["msg"] = "Login OK"; + } + else + { + response.IsFault = true; + responseData["error"] = "Invalid username or password"; + } + + response.Value = responseData; + return response; + + } + + } +} diff --git a/OpenSim/Grid/Framework.Manager/GridServerManager.cs b/OpenSim/Grid/Framework.Manager/GridServerManager.cs new file mode 100644 index 0000000..e276556 --- /dev/null +++ b/OpenSim/Grid/Framework.Manager/GridServerManager.cs @@ -0,0 +1,94 @@ +/* +* 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 Nwc.XmlRpc; +using System.Threading; +using libsecondlife; + +namespace OpenGrid.Framework.Manager { + + /// + /// A remote management system for the grid server + /// + public class GridServerManager + { + /// + /// Triggers events from the grid manager + /// + public static GridManagerCallback thecallback; + + /// + /// Security keys + /// + public static string sendkey; + public static string recvkey; + + /// + /// Disconnects the grid server and shuts it down + /// + /// XmlRpc Request + /// An XmlRpc response containing either a "msg" or an "error" + public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable requestData = (Hashtable)request.Params[0]; + Hashtable responseData = new Hashtable(); + + if(requestData.ContainsKey("session_id")) { + if(GridManagementAgent.SessionExists(new LLUUID((string)requestData["session_id"]))) { + responseData["msg"]="Shutdown command accepted"; + (new Thread(new ThreadStart(ShutdownServer))).Start(); + } else { + response.IsFault=true; + responseData["error"]="bad session ID"; + } + } else { + response.IsFault=true; + responseData["error"]="no session ID"; + } + + response.Value = responseData; + return response; + } + + /// + /// Shuts down the grid server + /// + public static void ShutdownServer() + { + Console.WriteLine("Shutting down the grid server - recieved a grid manager request"); + Console.WriteLine("Terminating in three seconds..."); + Thread.Sleep(3000); + thecallback("shutdown"); + } + } +} + diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj new file mode 100644 index 0000000..9a98ff4 --- /dev/null +++ b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj @@ -0,0 +1,99 @@ + + + Local + 8.0.50727 + 2.0 + {4B7BFD1C-0000-0000-0000-000000000000} + Debug + AnyCPU + + + + OpenSim.Grid.Framework.Manager + JScript + Grid + IE50 + false + Library + + OpenSim.Grid.Framework.Manager + + + + + + 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 + + + OpenSim.Framework.dll + False + + + OpenSim.Framework.Servers.dll + False + + + System.dll + False + + + ..\..\..\bin\XMLRPC.dll + False + + + + + + + Code + + + Code + + + + + + + + + + diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj.user b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj.user new file mode 100644 index 0000000..6841907 --- /dev/null +++ b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj.user @@ -0,0 +1,12 @@ + + + Debug + AnyCPU + C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ + 8.0.50727 + ProjectFiles + 0 + + + + diff --git a/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs b/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs new file mode 100644 index 0000000..c9701d6 --- /dev/null +++ b/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs @@ -0,0 +1,58 @@ +/* +* 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.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("GridConfig")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("GridConfig")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// This sets the default COM visibility of types in the assembly to invisible. +// If you need to expose a type to COM, use [ComVisible(true)] on that type. +[assembly: ComVisible(false)] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("1.0.*")] diff --git a/OpenSim/Grid/GridServer.Config/DbGridConfig.cs b/OpenSim/Grid/GridServer.Config/DbGridConfig.cs new file mode 100644 index 0000000..2218004 --- /dev/null +++ b/OpenSim/Grid/GridServer.Config/DbGridConfig.cs @@ -0,0 +1,161 @@ +/* +* 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 OpenSim.Framework.Console; +using OpenSim.Framework.Interfaces; +using Db4objects.Db4o; + +namespace OpenGrid.Config.GridConfigDb4o +{ + /// + /// A grid configuration interface for returning the DB4o Config Provider + /// + public class Db40ConfigPlugin: IGridConfig + { + /// + /// Loads and returns a configuration objeect + /// + /// A grid configuration object + public GridConfig GetConfigObject() + { + OpenSim.Framework.Console.MainLog.Instance.Verbose("Loading Db40Config dll"); + return ( new DbGridConfig()); + } + } + + /// + /// A DB4o based Gridserver configuration object + /// + public class DbGridConfig : GridConfig + { + /// + /// The DB4o Database + /// + private IObjectContainer db; + + /// + /// User configuration for the Grid Config interfaces + /// + public void LoadDefaults() { + OpenSim.Framework.Console.MainLog.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); + + // About the grid options + this.GridOwner = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid owner", "OGS development team"); + + // Asset Options + this.DefaultAssetServer = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default asset server","http://127.0.0.1:8003/"); + this.AssetSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to asset server","null"); + this.AssetRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from asset server","null"); + + // User Server Options + this.DefaultUserServer = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default user server","http://127.0.0.1:8002/"); + this.UserSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to user server","null"); + this.UserRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from user server","null"); + + // Region Server Options + this.SimSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to sims","null"); + this.SimRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from sims","null"); + } + + /// + /// Initialises a new configuration object + /// + public override void InitConfig() { + try { + // Perform Db4o initialisation + db = Db4oFactory.OpenFile("opengrid.yap"); + + // Locate the grid configuration object + IObjectSet result = db.Get(typeof(DbGridConfig)); + // Found? + if(result.Count==1) { + OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Found a GridConfig object in the local database, loading"); + foreach (DbGridConfig cfg in result) { + // Import each setting into this class + // Grid Settings + this.GridOwner=cfg.GridOwner; + // Asset Settings + this.DefaultAssetServer=cfg.DefaultAssetServer; + this.AssetSendKey=cfg.AssetSendKey; + this.AssetRecvKey=cfg.AssetRecvKey; + // User Settings + this.DefaultUserServer=cfg.DefaultUserServer; + this.UserSendKey=cfg.UserSendKey; + this.UserRecvKey=cfg.UserRecvKey; + // Region Settings + this.SimSendKey=cfg.SimSendKey; + this.SimRecvKey=cfg.SimRecvKey; + } + // Create a new configuration object from this class + } else { + OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); + + // Load default settings into this class + LoadDefaults(); + + // Saves to the database file... + OpenSim.Framework.Console.MainLog.Instance.Verbose( "Writing out default settings to local database"); + db.Set(this); + + // Closes file locks + db.Close(); + } + } catch(Exception e) { + OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); + OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + } + + // Grid Settings + OpenSim.Framework.Console.MainLog.Instance.Verbose("Grid settings loaded:"); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Grid owner: " + this.GridOwner); + + // Asset Settings + OpenSim.Framework.Console.MainLog.Instance.Verbose("Default asset server: " + this.DefaultAssetServer); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to asset server: " + this.AssetSendKey); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from asset server: " + this.AssetRecvKey); + + // User Settings + OpenSim.Framework.Console.MainLog.Instance.Verbose("Default user server: " + this.DefaultUserServer); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to user server: " + this.UserSendKey); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from user server: " + this.UserRecvKey); + + // Region Settings + OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to sims: " + this.SimSendKey); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from sims: " + this.SimRecvKey); + } + + /// + /// Closes down the database and releases filesystem locks + /// + public void Shutdown() { + db.Close(); + } + } + +} diff --git a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj new file mode 100644 index 0000000..24e845c --- /dev/null +++ b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj @@ -0,0 +1,107 @@ + + + Local + 8.0.50727 + 2.0 + {1442B635-0000-0000-0000-000000000000} + Debug + AnyCPU + + + + OpenSim.Grid.GridServer.Config + JScript + Grid + IE50 + false + Library + + OpenSim.Grid.GridServer.Config + + + + + + 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\Db4objects.Db4o.dll + False + + + ..\..\..\bin\libsecondlife.dll + False + + + OpenSim.Framework.dll + False + + + OpenSim.Framework.Console.dll + False + + + System.dll + False + + + ..\..\..\bin\System.Data.dll + False + + + System.Xml.dll + False + + + + + + + Code + + + Code + + + + + + + + + + diff --git a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj.user b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj.user new file mode 100644 index 0000000..6841907 --- /dev/null +++ b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj.user @@ -0,0 +1,12 @@ + + + Debug + AnyCPU + C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ + 8.0.50727 + ProjectFiles + 0 + + + + diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs new file mode 100644 index 0000000..bf80652 --- /dev/null +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -0,0 +1,599 @@ +/* +* 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 System.Reflection; +using OpenGrid.Framework.Data; +using OpenSim.Framework.Utilities; +using OpenSim.Framework.Console; +using OpenSim.Framework.Sims; +using libsecondlife; +using Nwc.XmlRpc; +using System.Xml; + +namespace OpenGridServices.GridServer +{ + class GridManager + { + Dictionary _plugins = new Dictionary(); + Dictionary _logplugins = new Dictionary(); + + public OpenSim.Framework.Interfaces.GridConfig config; + + /// + /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded. + /// + /// The filename to the grid server plugin DLL + public void AddPlugin(string FileName) + { + OpenSim.Framework.Console.MainLog.Instance.Verbose("Storage: Attempting to load " + FileName); + Assembly pluginAssembly = Assembly.LoadFrom(FileName); + + OpenSim.Framework.Console.MainLog.Instance.Verbose("Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); + foreach (Type pluginType in pluginAssembly.GetTypes()) + { + if (!pluginType.IsAbstract) + { + // Regions go here + Type typeInterface = pluginType.GetInterface("IGridData", true); + + if (typeInterface != null) + { + IGridData plug = (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + plug.Initialise(); + this._plugins.Add(plug.getName(), plug); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Storage: Added IGridData Interface"); + } + + typeInterface = null; + + // Logs go here + typeInterface = pluginType.GetInterface("ILogData", true); + + if (typeInterface != null) + { + ILogData plug = (ILogData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + plug.Initialise(); + this._logplugins.Add(plug.getName(), plug); + OpenSim.Framework.Console.MainLog.Instance.Verbose( "Storage: Added ILogData Interface"); + } + + typeInterface = null; + } + } + + pluginAssembly = null; + } + + /// + /// Logs a piece of information to the database + /// + /// What you were operating on (in grid server, this will likely be the region UUIDs) + /// Which method is being called? + /// What arguments are being passed? + /// How high priority is this? 1 = Max, 6 = Verbose + /// The message to log + private void logToDB(string target, string method, string args, int priority, string message) + { + foreach (KeyValuePair kvp in _logplugins) + { + try + { + kvp.Value.saveLog("Gridserver", target, method, args, priority, message); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: unable to write log via " + kvp.Key); + } + } + } + + /// + /// Returns a region by argument + /// + /// A UUID key of the region to return + /// A SimProfileData for the region + public SimProfileData getRegion(libsecondlife.LLUUID uuid) + { + foreach(KeyValuePair kvp in _plugins) { + try + { + return kvp.Value.GetProfileByLLUUID(uuid); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key); + } + } + return null; + } + + /// + /// Returns a region by argument + /// + /// A regionHandle of the region to return + /// A SimProfileData for the region + public SimProfileData getRegion(ulong handle) + { + foreach (KeyValuePair kvp in _plugins) + { + try + { + return kvp.Value.GetProfileByHandle(handle); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key); + } + } + return null; + } + + public Dictionary getRegions(uint xmin, uint ymin, uint xmax, uint ymax) + { + Dictionary regions = new Dictionary(); + + SimProfileData[] neighbours; + + foreach (KeyValuePair kvp in _plugins) + { + try + { + neighbours = kvp.Value.GetProfilesInRange(xmin, ymin, xmax, ymax); + foreach (SimProfileData neighbour in neighbours) + { + regions[neighbour.regionHandle] = neighbour; + } + } + catch (Exception e) + { + OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to query regionblock via " + kvp.Key); + } + } + + return regions; + } + + /// + /// Returns a XML String containing a list of the neighbouring regions + /// + /// The regionhandle for the center sim + /// An XML string containing neighbour entities + public string GetXMLNeighbours(ulong reqhandle) + { + string response = ""; + SimProfileData central_region = getRegion(reqhandle); + SimProfileData neighbour; + for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++) + { + if (getRegion(Util.UIntsToLong((uint)((central_region.regionLocX + x) * 256), (uint)(central_region.regionLocY + y) * 256)) != null) + { + neighbour = getRegion(Util.UIntsToLong((uint)((central_region.regionLocX + x) * 256), (uint)(central_region.regionLocY + y) * 256)); + response += ""; + response += "" + neighbour.serverIP + ""; + response += "" + neighbour.serverPort.ToString() + ""; + response += "" + neighbour.regionLocX.ToString() + ""; + response += "" + neighbour.regionLocY.ToString() + ""; + response += "" + neighbour.regionHandle.ToString() + ""; + response += ""; + + } + } + return response; + } + + /// + /// Performed when a region connects to the grid server initially. + /// + /// The XMLRPC Request + /// Startup parameters + public XmlRpcResponse XmlRpcLoginToSimulatorMethod(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable responseData = new Hashtable(); + response.Value = responseData; + + SimProfileData TheSim = null; + Hashtable requestData = (Hashtable)request.Params[0]; + + if (requestData.ContainsKey("UUID")) + { + TheSim = getRegion(new LLUUID((string)requestData["UUID"])); + logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcLoginToSimulatorMethod","", 5,"Region attempting login with UUID."); + } + else if (requestData.ContainsKey("region_handle")) + { + TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"])); + logToDB((string)requestData["region_handle"], "XmlRpcLoginToSimulatorMethod", "", 5, "Region attempting login with regionHandle."); + } + else + { + responseData["error"] = "No UUID or region_handle passed to grid server - unable to connect you"; + return response; + } + + if (TheSim == null) + { + responseData["error"] = "sim not found"; + return response; + } + else + { + + ArrayList SimNeighboursData = new ArrayList(); + + SimProfileData neighbour; + Hashtable NeighbourBlock; + + bool fastMode = false; // Only compatible with MySQL right now + + if (fastMode) + { + Dictionary neighbours = getRegions(TheSim.regionLocX - 1, TheSim.regionLocY - 1, TheSim.regionLocX + 1, TheSim.regionLocY + 1); + + foreach (KeyValuePair aSim in neighbours) + { + NeighbourBlock = new Hashtable(); + NeighbourBlock["sim_ip"] = aSim.Value.serverIP.ToString(); + NeighbourBlock["sim_port"] = aSim.Value.serverPort.ToString(); + NeighbourBlock["region_locx"] = aSim.Value.regionLocX.ToString(); + NeighbourBlock["region_locy"] = aSim.Value.regionLocY.ToString(); + NeighbourBlock["UUID"] = aSim.Value.UUID.ToString(); + + if (aSim.Value.UUID != TheSim.UUID) + SimNeighboursData.Add(NeighbourBlock); + } + } + else + { + for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++) + { + if (getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)) != null) + { + neighbour = getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)); + + NeighbourBlock = new Hashtable(); + NeighbourBlock["sim_ip"] = neighbour.serverIP; + NeighbourBlock["sim_port"] = neighbour.serverPort.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.serverIP; + responseData["sim_port"] = TheSim.serverPort.ToString(); + responseData["asset_url"] = TheSim.regionAssetURI; + responseData["asset_sendkey"] = TheSim.regionAssetSendKey; + responseData["asset_recvkey"] = TheSim.regionAssetRecvKey; + responseData["user_url"] = TheSim.regionUserURI; + responseData["user_sendkey"] = TheSim.regionUserSendKey; + responseData["user_recvkey"] = TheSim.regionUserRecvKey; + responseData["authkey"] = TheSim.regionSecret; + + // New! If set, use as URL to local sim storage (ie http://remotehost/region.yap) + responseData["data_uri"] = TheSim.regionDataURI; + } + + return response; + } + + public XmlRpcResponse XmlRpcMapBlockMethod(XmlRpcRequest request) + { + int xmin=980, ymin=980, xmax=1020, ymax=1020; + + Hashtable requestData = (Hashtable)request.Params[0]; + if (requestData.ContainsKey("xmin")) + { + xmin = (Int32)requestData["xmin"]; + } + if (requestData.ContainsKey("ymin")) + { + ymin = (Int32)requestData["ymin"]; + } + if (requestData.ContainsKey("xmax")) + { + xmax = (Int32)requestData["xmax"]; + } + if (requestData.ContainsKey("ymax")) + { + ymax = (Int32)requestData["ymax"]; + } + + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable responseData = new Hashtable(); + response.Value = responseData; + IList simProfileList = new ArrayList(); + + bool fastMode = true; // MySQL Only + + if (fastMode) + { + Dictionary neighbours = getRegions((uint)xmin, (uint)ymin, (uint)xmax, (uint)ymax); + + foreach (KeyValuePair aSim in neighbours) + { + Hashtable simProfileBlock = new Hashtable(); + simProfileBlock["x"] = aSim.Value.regionLocX.ToString(); + simProfileBlock["y"] = aSim.Value.regionLocY.ToString(); + simProfileBlock["name"] = aSim.Value.regionName; + simProfileBlock["access"] = 21; + simProfileBlock["region-flags"] = 512; + simProfileBlock["water-height"] = 0; + simProfileBlock["agents"] = 1; + simProfileBlock["map-image-id"] = aSim.Value.regionMapTextureID.ToString(); + + // For Sugilite compatibility + simProfileBlock["regionhandle"] = aSim.Value.regionHandle.ToString(); + simProfileBlock["sim_ip"] = aSim.Value.serverIP.ToString(); + simProfileBlock["sim_port"] = aSim.Value.serverPort.ToString(); + simProfileBlock["sim_uri"] = aSim.Value.serverURI.ToString(); + simProfileBlock["uuid"] = aSim.Value.UUID.ToStringHyphenated(); + + simProfileList.Add(simProfileBlock); + } + OpenSim.Framework.Console.MainLog.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via FastMode"); + } + else + { + SimProfileData simProfile; + for (int x = xmin; x < xmax; x++) + { + for (int y = ymin; y < ymax; y++) + { + simProfile = getRegion(Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256))); + if (simProfile != null) + { + Hashtable simProfileBlock = new Hashtable(); + simProfileBlock["x"] = x; + simProfileBlock["y"] = y; + simProfileBlock["name"] = simProfile.regionName; + simProfileBlock["access"] = 0; + simProfileBlock["region-flags"] = 0; + simProfileBlock["water-height"] = 20; + simProfileBlock["agents"] = 1; + simProfileBlock["map-image-id"] = simProfile.regionMapTextureID.ToString(); + + // For Sugilite compatibility + simProfileBlock["regionhandle"] = simProfile.regionHandle.ToString(); + simProfileBlock["sim_ip"] = simProfile.serverIP.ToString(); + simProfileBlock["sim_port"] = simProfile.serverPort.ToString(); + simProfileBlock["sim_uri"] = simProfile.serverURI.ToString(); + simProfileBlock["uuid"] = simProfile.UUID.ToStringHyphenated(); + + simProfileList.Add(simProfileBlock); + } + } + } + OpenSim.Framework.Console.MainLog.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via Standard Mode"); + } + + responseData["sim-profiles"] = simProfileList; + + return response; + } + + + + /// + /// Performs a REST Get Operation + /// + /// + /// + /// + /// + public string RestGetRegionMethod(string request, string path, string param) + { + return RestGetSimMethod("", "/sims/", param); + } + + /// + /// Performs a REST Set Operation + /// + /// + /// + /// + /// + public string RestSetRegionMethod(string request, string path, string param) + { + return RestSetSimMethod("", "/sims/", param); + } + + /// + /// Returns information about a sim via a REST Request + /// + /// + /// + /// + /// Information about the sim in XML + public string RestGetSimMethod(string request, string path, string param) + { + string respstring = String.Empty; + + SimProfileData TheSim; + LLUUID UUID = new LLUUID(param); + TheSim = getRegion(UUID); + + if (!(TheSim == null)) + { + respstring = ""; + respstring += "" + TheSim.regionSendKey + ""; + respstring += ""; + respstring += "" + TheSim.UUID.ToString() + ""; + respstring += "" + TheSim.regionName + ""; + respstring += "" + TheSim.serverIP + ""; + respstring += "" + TheSim.serverPort.ToString() + ""; + respstring += "" + TheSim.regionLocX.ToString() + ""; + respstring += "" + TheSim.regionLocY.ToString() + ""; + respstring += "1"; + respstring += ""; + respstring += ""; + } + + return respstring; + } + + /// + /// Creates or updates a sim via a REST Method Request + /// BROKEN with SQL Update + /// + /// + /// + /// + /// "OK" or an error + public string RestSetSimMethod(string request, string path, string param) + { + Console.WriteLine("Processing region update"); + SimProfileData TheSim; + TheSim = getRegion(new LLUUID(param)); + if ((TheSim) == null) + { + TheSim = new SimProfileData(); + LLUUID UUID = new LLUUID(param); + TheSim.UUID = UUID; + TheSim.regionRecvKey = config.SimRecvKey; + } + + 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 != TheSim.regionRecvKey) + { + return "ERROR! invalid key"; + } + + //TheSim.regionSendKey = Cfg; + TheSim.regionRecvKey = config.SimRecvKey; + TheSim.regionSendKey = config.SimSendKey; + TheSim.regionSecret = config.SimRecvKey; + TheSim.regionDataURI = ""; + TheSim.regionAssetURI = config.DefaultAssetServer; + TheSim.regionAssetRecvKey = config.AssetRecvKey; + TheSim.regionAssetSendKey = config.AssetSendKey; + TheSim.regionUserURI = config.DefaultUserServer; + TheSim.regionUserSendKey = config.UserSendKey; + TheSim.regionUserRecvKey = config.UserRecvKey; + + + 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.serverIP = simnode.ChildNodes[i].InnerText; + break; + + case "sim_port": + TheSim.serverPort = 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; + } + } + + TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; + + bool requirePublic = false; + + if (requirePublic && (TheSim.serverIP.StartsWith("172.16") || TheSim.serverIP.StartsWith("192.168") || TheSim.serverIP.StartsWith("10.") || TheSim.serverIP.StartsWith("0.") || TheSim.serverIP.StartsWith("255."))) + { + return "ERROR! Servers must register with public addresses."; + } + + + try + { + OpenSim.Framework.Console.MainLog.Instance.Verbose("Updating / adding via " + _plugins.Count + " storage provider(s) registered."); + foreach (KeyValuePair kvp in _plugins) + { + try + { + //Check reservations + ReservationData reserveData = kvp.Value.GetReservationAtPoint(TheSim.regionLocX, TheSim.regionLocY); + if ((reserveData != null && reserveData.gridRecvKey == TheSim.regionRecvKey) || (reserveData == null)) + { + kvp.Value.AddProfile(TheSim); + OpenSim.Framework.Console.MainLog.Instance.Verbose("New sim added to grid (" + TheSim.regionName + ")"); + logToDB(TheSim.UUID.ToStringHyphenated(), "RestSetSimMethod", "", 5, "Region successfully updated and connected to grid."); + } + else + { + return "Unable to update region (RestSetSimMethod): Incorrect auth key."; + } + } + catch (Exception e) + { + OpenSim.Framework.Console.MainLog.Instance.Verbose("getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + e.ToString()); + } + } + return "OK"; + } + catch (Exception e) + { + return "ERROR! Could not save to database! (" + e.ToString() + ")"; + } + } + + } +} diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs new file mode 100644 index 0000000..b948fd6 --- /dev/null +++ b/OpenSim/Grid/GridServer/Main.cs @@ -0,0 +1,271 @@ +/* +* 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.IO; +using System.Text; +using System.Timers; +using System.Net; +using System.Threading; +using System.Reflection; +using libsecondlife; +using OpenGrid.Framework.Manager; +using OpenSim.Framework; +using OpenSim.Framework.Sims; +using OpenSim.Framework.Console; +using OpenSim.Framework.Interfaces; +using OpenSim.Servers; +using OpenSim.GenericConfig; + +namespace OpenGridServices.GridServer +{ + /// + /// + public class OpenGrid_Main : conscmd_callback + { + private string ConfigDll = "OpenGrid.Config.GridConfigDb4o.dll"; + private string GridDll = "OpenGrid.Framework.Data.MySQL.dll"; + public GridConfig Cfg; + + public static OpenGrid_Main thegrid; + protected IGenericConfig localXMLConfig; + + public static bool setuponly; + + //public LLUUID highestUUID; + + // private SimProfileManager m_simProfileManager; + + private GridManager m_gridManager; + + private LogBase m_console; + + [STAThread] + public static void Main(string[] args) + { + if (args.Length > 0) + { + if (args[0] == "-setuponly") setuponly = true; + } + Console.WriteLine("Starting...\n"); + + thegrid = new OpenGrid_Main(); + thegrid.Startup(); + + thegrid.Work(); + } + + private void Work() + { + while (true) + { + Thread.Sleep(5000); + // should flush the DB etc here + } + } + + private OpenGrid_Main() + { + m_console = new LogBase("opengrid-gridserver-console.log", "OpenGrid", this, false); + MainLog.Instance = m_console; + + + } + + public void managercallback(string cmd) + { + switch (cmd) + { + case "shutdown": + RunCmd("shutdown", new string[0]); + break; + } + } + + + public void Startup() + { + this.localXMLConfig = new XmlConfig("GridServerConfig.xml"); + this.localXMLConfig.LoadData(); + this.ConfigDB(this.localXMLConfig); + this.localXMLConfig.Close(); + + m_console.Verbose( "Main.cs:Startup() - Loading configuration"); + Cfg = this.LoadConfigDll(this.ConfigDll); + Cfg.InitConfig(); + if (setuponly) Environment.Exit(0); + + m_console.Verbose( "Main.cs:Startup() - Connecting to Storage Server"); + m_gridManager = new GridManager(); + m_gridManager.AddPlugin(GridDll); // Made of win + m_gridManager.config = Cfg; + + m_console.Verbose( "Main.cs:Startup() - Starting HTTP process"); + BaseHttpServer httpServer = new BaseHttpServer(8001); + //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); + + httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcLoginToSimulatorMethod); + httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod); + + httpServer.AddRestHandler("GET", "/sims/", m_gridManager.RestGetSimMethod); + httpServer.AddRestHandler("POST", "/sims/", m_gridManager.RestSetSimMethod); + httpServer.AddRestHandler("GET", "/regions/", m_gridManager.RestGetRegionMethod); + httpServer.AddRestHandler("POST", "/regions/", m_gridManager.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.Notice("/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.Verbose( "Main.cs:Startup() - Starting sim status checker"); + + System.Timers.Timer simCheckTimer = new System.Timers.Timer(3600000 * 3); // 3 Hours between updates. + 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.Notice("shutdown - shutdown the grid (USE CAUTION!)"); + break; + + case "shutdown": + m_console.Close(); + Environment.Exit(0); + break; + } + } + + public void Show(string ShowWhat) + { + } + + private void ConfigDB(IGenericConfig configData) + { + try + { + string attri = ""; + attri = configData.GetAttribute("DataBaseProvider"); + if (attri == "") + { + GridDll = "OpenGrid.Framework.Data.DB4o.dll"; + configData.SetAttribute("DataBaseProvider", "OpenGrid.Framework.Data.DB4o.dll"); + } + else + { + GridDll = attri; + } + configData.Commit(); + } + catch (Exception e) + { + + } + } + } +} diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj new file mode 100644 index 0000000..424072e --- /dev/null +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj @@ -0,0 +1,134 @@ + + + Local + 8.0.50727 + 2.0 + {60FCC3A6-0000-0000-0000-000000000000} + Debug + AnyCPU + + + + OpenSim.Grid.GridServer + JScript + Grid + IE50 + false + Exe + + OpenSim.Grid.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 + + + + + ..\..\..\bin\Db4objects.Db4o.dll + False + + + ..\..\..\bin\libsecondlife.dll + False + + + OpenSim.Framework.dll + False + + + OpenSim.Framework.Console.dll + False + + + OpenSim.Framework.GenericConfig.Xml.dll + False + + + OpenSim.Framework.Servers.dll + False + + + System.dll + False + + + System.Data.dll + False + + + System.Xml.dll + False + + + ..\..\..\bin\XMLRPC.dll + False + + + + + OpenSim.Framework.Data + {36B72A9B-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + + + OpenSim.Grid.Framework.Manager + {4B7BFD1C-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + + + + + Code + + + Code + + + Code + + + + + + + + + + diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj.user b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj.user new file mode 100644 index 0000000..6841907 --- /dev/null +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj.user @@ -0,0 +1,12 @@ + + + Debug + AnyCPU + C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ + 8.0.50727 + ProjectFiles + 0 + + + + diff --git a/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..303dddf --- /dev/null +++ b/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs @@ -0,0 +1,60 @@ +/* +* 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.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/OpenSim/Grid/InventoryServer/InventoryManager.cs b/OpenSim/Grid/InventoryServer/InventoryManager.cs new file mode 100644 index 0000000..9ca9b5e --- /dev/null +++ b/OpenSim/Grid/InventoryServer/InventoryManager.cs @@ -0,0 +1,125 @@ +/* +* 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 OpenGrid.Framework.Data; +using libsecondlife; +using System.Reflection; + +using System.Xml; +using Nwc.XmlRpc; +using OpenSim.Framework.Sims; +using OpenSim.Framework.Inventory; +using OpenSim.Framework.Utilities; + +using System.Security.Cryptography; + +namespace OpenGridServices.InventoryServer +{ + class InventoryManager + { + Dictionary _plugins = new Dictionary(); + + /// + /// Adds a new inventory server plugin - user servers will be requested in the order they were loaded. + /// + /// The filename to the inventory server plugin DLL + public void AddPlugin(string FileName) + { + OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Attempting to load " + FileName); + Assembly pluginAssembly = Assembly.LoadFrom(FileName); + + OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); + foreach (Type pluginType in pluginAssembly.GetTypes()) + { + if (!pluginType.IsAbstract) + { + Type typeInterface = pluginType.GetInterface("IInventoryData", true); + + if (typeInterface != null) + { + IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + plug.Initialise(); + this._plugins.Add(plug.getName(), plug); + OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Added IUserData Interface"); + } + + typeInterface = null; + } + } + + pluginAssembly = null; + } + + public List getRootFolders(LLUUID user) + { + foreach (KeyValuePair kvp in _plugins) + { + try + { + return kvp.Value.getUserRootFolders(user); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainConsole.Instance.Notice("Unable to get root folders via " + kvp.Key + " (" + e.ToString() + ")"); + } + } + return null; + } + + public XmlRpcResponse XmlRpcInventoryRequest(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable requestData = (Hashtable)request.Params[0]; + + Hashtable responseData = new Hashtable(); + + // Stuff happens here + + if (requestData.ContainsKey("Access-type")) + { + if (requestData["access-type"] == "rootfolders") + { +// responseData["rootfolders"] = + } + } + else + { + responseData["error"] = "No access-type specified."; + } + + + // Stuff stops happening here + + response.Value = responseData; + return response; + } + } +} diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs new file mode 100644 index 0000000..f479a79 --- /dev/null +++ b/OpenSim/Grid/InventoryServer/Main.cs @@ -0,0 +1,87 @@ +/* +* 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.Reflection; +using System.IO; +using System.Text; +using libsecondlife; +using OpenSim.Framework.User; +using OpenSim.Framework.Sims; +using OpenSim.Framework.Inventory; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Console; +using OpenSim.Servers; +using OpenSim.Framework.Utilities; + +namespace OpenGridServices.InventoryServer +{ + public class OpenInventory_Main : BaseServer, conscmd_callback + { + ConsoleBase m_console; + InventoryManager m_inventoryManager; + + public static void Main(string[] args) + { + } + + public OpenInventory_Main() + { + m_console = new ConsoleBase("opengrid-inventory-console.log", "OpenInventory", this, false); + MainConsole.Instance = m_console; + } + + public void Startup() + { + MainConsole.Instance.Notice("Initialising inventory manager..."); + m_inventoryManager = new InventoryManager(); + + MainConsole.Instance.Notice("Starting HTTP server"); + BaseHttpServer httpServer = new BaseHttpServer(8004); + + httpServer.AddXmlRPCHandler("rootfolders", m_inventoryManager.XmlRpcInventoryRequest); + //httpServer.AddRestHandler("GET","/rootfolders/",Rest + } + + public void RunCmd(string cmd, string[] cmdparams) + { + switch (cmd) + { + case "shutdown": + m_console.Close(); + Environment.Exit(0); + break; + } + } + + public void Show(string ShowWhat) + { + } + } +} diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager.mds b/OpenSim/Grid/Manager/OpenGridServices.Manager.mds new file mode 100644 index 0000000..ed7bc24 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager.mds @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager.userprefs b/OpenSim/Grid/Manager/OpenGridServices.Manager.userprefs new file mode 100644 index 0000000..f221509 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager.userprefs @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager.usertasks b/OpenSim/Grid/Manager/OpenGridServices.Manager.usertasks new file mode 100644 index 0000000..d887d0e --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager.usertasks @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/AssemblyInfo.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/AssemblyInfo.cs new file mode 100644 index 0000000..af4e275 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/AssemblyInfo.cs @@ -0,0 +1,32 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes specify the key for the sign of your assembly. See the +// .NET Framework documentation for more information about signing. +// This is not required, if you don't want signing let these attributes like they're. +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs new file mode 100644 index 0000000..83685fc --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs @@ -0,0 +1,33 @@ +using System; +using System.Threading; +using System.Collections.Generic; +using System.Text; + +namespace OpenGridServices.Manager +{ + public class BlockingQueue + { + private Queue _queue = new Queue(); + private object _queueSync = new object(); + + public void Enqueue(T value) + { + lock (_queueSync) + { + _queue.Enqueue(value); + Monitor.Pulse(_queueSync); + } + } + + public T Dequeue() + { + lock (_queueSync) + { + if (_queue.Count < 1) + Monitor.Wait(_queueSync); + + return _queue.Dequeue(); + } + } + } +} diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/Connect to grid server.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/Connect to grid server.cs new file mode 100644 index 0000000..0d509ef --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/Connect to grid server.cs @@ -0,0 +1,16 @@ + +using System; + +namespace OpenGridServices.Manager +{ + + + public partial class Connect to grid server : Gtk.Dialog + { + + public Connect to grid server() + { + this.Build(); + } + } +} diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs new file mode 100644 index 0000000..8a80b1d --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs @@ -0,0 +1,29 @@ +using Gtk; +using System; + +namespace OpenGridServices.Manager { + public partial class ConnectToGridServerDialog : Gtk.Dialog + { + + public ConnectToGridServerDialog() + { + this.Build(); + } + + protected virtual void OnResponse(object o, Gtk.ResponseArgs args) + { + switch(args.ResponseId) { + case Gtk.ResponseType.Ok: + MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text); + break; + + case Gtk.ResponseType.Cancel: + break; + } + this.Hide(); + + } + + } + +} \ No newline at end of file diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs new file mode 100644 index 0000000..6b632d6 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs @@ -0,0 +1,106 @@ +using Nwc.XmlRpc; +using System; +using System.Net; +using System.IO; +using System.Xml; +using System.Collections; +using System.Collections.Generic; +using libsecondlife; + +namespace OpenGridServices.Manager +{ + public class GridServerConnectionManager + { + private string ServerURL; + public LLUUID SessionID; + public bool connected=false; + + public RegionBlock[][] WorldMap; + + public bool Connect(string GridServerURL, string username, string password) + { + try { + this.ServerURL=GridServerURL; + Hashtable LoginParamsHT = new Hashtable(); + LoginParamsHT["username"]=username; + LoginParamsHT["password"]=password; + ArrayList LoginParams = new ArrayList(); + LoginParams.Add(LoginParamsHT); + XmlRpcRequest GridLoginReq = new XmlRpcRequest("manager_login",LoginParams); + XmlRpcResponse GridResp = GridLoginReq.Send(ServerURL,3000); + if(GridResp.IsFault) { + connected=false; + return false; + } else { + Hashtable gridrespData = (Hashtable)GridResp.Value; + this.SessionID = new LLUUID((string)gridrespData["session_id"]); + connected=true; + return true; + } + } catch(Exception e) { + Console.WriteLine(e.ToString()); + connected=false; + return false; + } + } + + public void DownloadMap() + { + System.Net.WebClient mapdownloader = new WebClient(); + Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist"); + + RegionBlock TempRegionData; + + XmlDocument doc = new XmlDocument(); + doc.Load(regionliststream); + regionliststream.Close(); + XmlNode rootnode = doc.FirstChild; + if (rootnode.Name != "regions") + { + // TODO - ERROR! + } + + for(int i=0; i<=rootnode.ChildNodes.Count; i++) + { + if(rootnode.ChildNodes.Item(i).Name != "region") { + // TODO - ERROR! + } else { + TempRegionData = new RegionBlock(); + + + } + } + } + + public bool RestartServer() + { + return true; + } + + public bool ShutdownServer() + { + try { + Hashtable ShutdownParamsHT = new Hashtable(); + ArrayList ShutdownParams = new ArrayList(); + ShutdownParamsHT["session_id"]=this.SessionID.ToString(); + ShutdownParams.Add(ShutdownParamsHT); + XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams); + XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL,3000); + if(GridResp.IsFault) { + return false; + } else { + connected=false; + return true; + } + } catch(Exception e) { + Console.WriteLine(e.ToString()); + return false; + } + } + + public void DisconnectServer() + { + this.connected=false; + } + } +} diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs new file mode 100644 index 0000000..42e09e0 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs @@ -0,0 +1,96 @@ +// project created on 5/14/2007 at 2:04 PM +using System; +using System.Threading; +using Gtk; + +namespace OpenGridServices.Manager +{ + class MainClass + { + + public static bool QuitReq=false; + public static BlockingQueue PendingOperations = new BlockingQueue(); + + private static Thread OperationsRunner; + + private static GridServerConnectionManager gridserverConn; + + private static MainWindow win; + + public static void DoMainLoop() + { + while(!QuitReq) + { + Application.RunIteration(); + } + } + + public static void RunOperations() + { + string operation; + string cmd; + char[] sep = new char[1]; + sep[0]=' '; + while(!QuitReq) + { + operation=PendingOperations.Dequeue(); + Console.WriteLine(operation); + cmd = operation.Split(sep)[0]; + switch(cmd) { + case "connect_to_gridserver": + win.SetStatus("Connecting to grid server..."); + if(gridserverConn.Connect(operation.Split(sep)[1],operation.Split(sep)[2],operation.Split(sep)[3])) { + win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID); + win.SetGridServerConnected(true); + Thread.Sleep(3000); + win.SetStatus("Downloading region maps..."); + gridserverConn.DownloadMap(); + } else { + win.SetStatus("Could not connect"); + } + break; + + case "restart_gridserver": + win.SetStatus("Restarting grid server..."); + if(gridserverConn.RestartServer()) { + win.SetStatus("Restarted server OK"); + Thread.Sleep(3000); + win.SetStatus(""); + } else { + win.SetStatus("Error restarting grid server!!!"); + } + break; + + case "shutdown_gridserver": + win.SetStatus("Shutting down grid server..."); + if(gridserverConn.ShutdownServer()) { + win.SetStatus("Grid server shutdown"); + win.SetGridServerConnected(false); + Thread.Sleep(3000); + win.SetStatus(""); + } else { + win.SetStatus("Could not shutdown grid server!!!"); + } + break; + + case "disconnect_gridserver": + gridserverConn.DisconnectServer(); + win.SetGridServerConnected(false); + break; + } + } + } + + public static void Main (string[] args) + { + gridserverConn = new GridServerConnectionManager(); + Application.Init (); + win = new MainWindow (); + win.Show (); + OperationsRunner = new Thread(new ThreadStart(RunOperations)); + OperationsRunner.IsBackground=true; + OperationsRunner.Start(); + DoMainLoop(); + } + } +} \ No newline at end of file diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs new file mode 100644 index 0000000..1db38f0 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs @@ -0,0 +1,76 @@ +using System; +using Gtk; + +namespace OpenGridServices.Manager { + public partial class MainWindow: Gtk.Window + { + public MainWindow (): base (Gtk.WindowType.Toplevel) + { + Build (); + } + + public void SetStatus(string statustext) + { + this.statusbar1.Pop(0); + this.statusbar1.Push(0,statustext); + } + + public void DrawGrid(RegionBlock[][] regions) + { + for(int x=0; x<=regions.GetUpperBound(0); x++) { + for(int y=0; y<=regions.GetUpperBound(1); y++) { + Gdk.Image themap = new Gdk.Image(Gdk.ImageType.Fastest,Gdk.Visual.System,256,256); + this.drawingarea1.GdkWindow.DrawImage(new Gdk.GC(this.drawingarea1.GdkWindow),themap,0,0,x*256,y*256,256,256); + } + } + } + + public void SetGridServerConnected(bool connected) + { + if(connected) { + this.ConnectToGridserver.Visible=false; + this.DisconnectFromGridServer.Visible=true; + } else { + this.ConnectToGridserver.Visible=true; + this.DisconnectFromGridServer.Visible=false; + } + } + + protected void OnDeleteEvent (object sender, DeleteEventArgs a) + { + Application.Quit (); + MainClass.QuitReq=true; + a.RetVal = true; + } + + protected virtual void QuitMenu(object sender, System.EventArgs e) + { + MainClass.QuitReq=true; + Application.Quit(); + } + + protected virtual void ConnectToGridServerMenu(object sender, System.EventArgs e) + { + ConnectToGridServerDialog griddialog = new ConnectToGridServerDialog (); + griddialog.Show(); + } + + protected virtual void RestartGridserverMenu(object sender, System.EventArgs e) + { + MainClass.PendingOperations.Enqueue("restart_gridserver"); + } + + protected virtual void ShutdownGridserverMenu(object sender, System.EventArgs e) + { + MainClass.PendingOperations.Enqueue("shutdown_gridserver"); + } + + protected virtual void DisconnectGridServerMenu(object sender, System.EventArgs e) + { + MainClass.PendingOperations.Enqueue("disconnect_gridserver"); + } + + } +} + + \ No newline at end of file diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp b/OpenSim/Grid/Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp new file mode 100644 index 0000000..cfdc085 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/OpenGridServices.Manager.pidb b/OpenSim/Grid/Manager/OpenGridServices.Manager/OpenGridServices.Manager.pidb new file mode 100644 index 0000000..44e7a61 Binary files /dev/null and b/OpenSim/Grid/Manager/OpenGridServices.Manager/OpenGridServices.Manager.pidb differ diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/RegionBlock.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/RegionBlock.cs new file mode 100644 index 0000000..00f7c65 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/RegionBlock.cs @@ -0,0 +1,37 @@ +using System; +using System.Xml; +using libsecondlife; +using OpenSim.Framework.Utilities; + +namespace OpenGridServices.Manager +{ + + + public class RegionBlock + { + public uint regloc_x; + public uint regloc_y; + + public string httpd_url; + + public string region_name; + + public ulong regionhandle { + get { return Util.UIntsToLong(regloc_x*256,regloc_y*256); } + } + + public Gdk.Pixbuf MiniMap; + + public RegionBlock() + { + } + + public void LoadFromXmlNode(XmlNode sourcenode) + { + this.regloc_x=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_x").Value); + this.regloc_y=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_y").Value); + this.region_name=sourcenode.Attributes.GetNamedItem("region_name").Value; + this.httpd_url=sourcenode.Attributes.GetNamedItem("httpd_url").Value; + } + } +} diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/Util.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/Util.cs new file mode 100644 index 0000000..5bf7ff9 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/Util.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; + +namespace OpenSim.Framework.Utilities +{ + public class Util + { + private static Random randomClass = new Random(); + private static uint nextXferID = 5000; + private static object XferLock = new object(); + + public static ulong UIntsToLong(uint X, uint Y) + { + return Helpers.UIntsToLong(X, Y); + } + + public static Random RandomClass + { + get + { + return randomClass; + } + } + + public static uint GetNextXferID() + { + uint id = 0; + lock(XferLock) + { + id = nextXferID; + nextXferID++; + } + return id; + } + + //public static int fast_distance2d(int x, int y) + //{ + // x = System.Math.Abs(x); + // y = System.Math.Abs(y); + + // int min = System.Math.Min(x, y); + + // return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); + //} + + public static string FieldToString(byte[] bytes) + { + return FieldToString(bytes, String.Empty); + } + + /// + /// Convert a variable length field (byte array) to a string, with a + /// field name prepended to each line of the output + /// + /// If the byte array has unprintable characters in it, a + /// hex dump will be put in the string instead + /// The byte array to convert to a string + /// A field name to prepend to each line of output + /// An ASCII string or a string containing a hex dump, minus + /// the null terminator + public static string FieldToString(byte[] bytes, string fieldName) + { + // Check for a common case + if (bytes.Length == 0) return String.Empty; + + StringBuilder output = new StringBuilder(); + bool printable = true; + + for (int i = 0; i < bytes.Length; ++i) + { + // Check if there are any unprintable characters in the array + if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09 + && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00) + { + printable = false; + break; + } + } + + if (printable) + { + if (fieldName.Length > 0) + { + output.Append(fieldName); + output.Append(": "); + } + + if (bytes[bytes.Length - 1] == 0x00) + output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1)); + else + output.Append(UTF8Encoding.UTF8.GetString(bytes)); + } + else + { + for (int i = 0; i < bytes.Length; i += 16) + { + if (i != 0) + output.Append(Environment.NewLine); + if (fieldName.Length > 0) + { + output.Append(fieldName); + output.Append(": "); + } + + for (int j = 0; j < 16; j++) + { + if ((i + j) < bytes.Length) + output.Append(String.Format("{0:X2} ", bytes[i + j])); + else + output.Append(" "); + } + + for (int j = 0; j < 16 && (i + j) < bytes.Length; j++) + { + if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E) + output.Append((char)bytes[i + j]); + else + output.Append("."); + } + } + } + + return output.ToString(); + } + public Util() + { + + } + } +} diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs new file mode 100644 index 0000000..da6739e --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs @@ -0,0 +1,226 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Mono Runtime Version: 2.0.50727.42 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ + +namespace OpenGridServices.Manager { + + + public partial class ConnectToGridServerDialog { + + private Gtk.VBox vbox2; + + private Gtk.VBox vbox3; + + private Gtk.HBox hbox1; + + private Gtk.Label label1; + + private Gtk.Entry entry1; + + private Gtk.HBox hbox2; + + private Gtk.Label label2; + + private Gtk.Entry entry2; + + private Gtk.HBox hbox3; + + private Gtk.Label label3; + + private Gtk.Entry entry3; + + private Gtk.Button button2; + + private Gtk.Button button8; + + protected virtual void Build() { + Stetic.Gui.Initialize(); + // Widget OpenGridServices.Manager.ConnectToGridServerDialog + this.Events = ((Gdk.EventMask)(256)); + this.Name = "OpenGridServices.Manager.ConnectToGridServerDialog"; + this.Title = Mono.Unix.Catalog.GetString("Connect to Grid server"); + this.WindowPosition = ((Gtk.WindowPosition)(4)); + this.HasSeparator = false; + // Internal child OpenGridServices.Manager.ConnectToGridServerDialog.VBox + Gtk.VBox w1 = this.VBox; + w1.Events = ((Gdk.EventMask)(256)); + w1.Name = "dialog_VBox"; + w1.BorderWidth = ((uint)(2)); + // Container child dialog_VBox.Gtk.Box+BoxChild + this.vbox2 = new Gtk.VBox(); + this.vbox2.Name = "vbox2"; + // Container child vbox2.Gtk.Box+BoxChild + this.vbox3 = new Gtk.VBox(); + this.vbox3.Name = "vbox3"; + // Container child vbox3.Gtk.Box+BoxChild + this.hbox1 = new Gtk.HBox(); + this.hbox1.Name = "hbox1"; + // Container child hbox1.Gtk.Box+BoxChild + this.label1 = new Gtk.Label(); + this.label1.Name = "label1"; + this.label1.Xalign = 1F; + this.label1.LabelProp = Mono.Unix.Catalog.GetString("Grid server URL: "); + this.label1.Justify = ((Gtk.Justification)(1)); + this.hbox1.Add(this.label1); + Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.label1])); + w2.Position = 0; + // Container child hbox1.Gtk.Box+BoxChild + this.entry1 = new Gtk.Entry(); + this.entry1.CanFocus = true; + this.entry1.Name = "entry1"; + this.entry1.Text = Mono.Unix.Catalog.GetString("http://gridserver:8001"); + this.entry1.IsEditable = true; + this.entry1.MaxLength = 255; + this.entry1.InvisibleChar = '•'; + this.hbox1.Add(this.entry1); + Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.hbox1[this.entry1])); + w3.Position = 1; + this.vbox3.Add(this.hbox1); + Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox1])); + w4.Position = 0; + w4.Expand = false; + w4.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild + this.hbox2 = new Gtk.HBox(); + this.hbox2.Name = "hbox2"; + // Container child hbox2.Gtk.Box+BoxChild + this.label2 = new Gtk.Label(); + this.label2.Name = "label2"; + this.label2.Xalign = 1F; + this.label2.LabelProp = Mono.Unix.Catalog.GetString("Username:"); + this.label2.Justify = ((Gtk.Justification)(1)); + this.hbox2.Add(this.label2); + Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(this.hbox2[this.label2])); + w5.Position = 0; + // Container child hbox2.Gtk.Box+BoxChild + this.entry2 = new Gtk.Entry(); + this.entry2.CanFocus = true; + this.entry2.Name = "entry2"; + this.entry2.IsEditable = true; + this.entry2.InvisibleChar = '•'; + this.hbox2.Add(this.entry2); + Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.hbox2[this.entry2])); + w6.Position = 1; + this.vbox3.Add(this.hbox2); + Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox2])); + w7.Position = 1; + w7.Expand = false; + w7.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild + this.hbox3 = new Gtk.HBox(); + this.hbox3.Name = "hbox3"; + // Container child hbox3.Gtk.Box+BoxChild + this.label3 = new Gtk.Label(); + this.label3.Name = "label3"; + this.label3.Xalign = 1F; + this.label3.LabelProp = Mono.Unix.Catalog.GetString("Password:"); + this.label3.Justify = ((Gtk.Justification)(1)); + this.hbox3.Add(this.label3); + Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.hbox3[this.label3])); + w8.Position = 0; + // Container child hbox3.Gtk.Box+BoxChild + this.entry3 = new Gtk.Entry(); + this.entry3.CanFocus = true; + this.entry3.Name = "entry3"; + this.entry3.IsEditable = true; + this.entry3.InvisibleChar = '•'; + this.hbox3.Add(this.entry3); + Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.hbox3[this.entry3])); + w9.Position = 1; + this.vbox3.Add(this.hbox3); + Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox3])); + w10.Position = 2; + w10.Expand = false; + w10.Fill = false; + this.vbox2.Add(this.vbox3); + Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(this.vbox2[this.vbox3])); + w11.Position = 2; + w11.Expand = false; + w11.Fill = false; + w1.Add(this.vbox2); + Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(w1[this.vbox2])); + w12.Position = 0; + // Internal child OpenGridServices.Manager.ConnectToGridServerDialog.ActionArea + Gtk.HButtonBox w13 = this.ActionArea; + w13.Events = ((Gdk.EventMask)(256)); + w13.Name = "OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea"; + w13.Spacing = 6; + w13.BorderWidth = ((uint)(5)); + w13.LayoutStyle = ((Gtk.ButtonBoxStyle)(4)); + // Container child OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.button2 = new Gtk.Button(); + this.button2.CanDefault = true; + this.button2.CanFocus = true; + this.button2.Name = "button2"; + this.button2.UseUnderline = true; + // Container child button2.Gtk.Container+ContainerChild + Gtk.Alignment w14 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F); + w14.Name = "GtkAlignment"; + // Container child GtkAlignment.Gtk.Container+ContainerChild + Gtk.HBox w15 = new Gtk.HBox(); + w15.Name = "GtkHBox"; + w15.Spacing = 2; + // Container child GtkHBox.Gtk.Container+ContainerChild + Gtk.Image w16 = new Gtk.Image(); + w16.Name = "image1"; + w16.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-apply", 16, 0); + w15.Add(w16); + // Container child GtkHBox.Gtk.Container+ContainerChild + Gtk.Label w18 = new Gtk.Label(); + w18.Name = "GtkLabel"; + w18.LabelProp = Mono.Unix.Catalog.GetString("Connect"); + w18.UseUnderline = true; + w15.Add(w18); + w14.Add(w15); + this.button2.Add(w14); + this.AddActionWidget(this.button2, -5); + Gtk.ButtonBox.ButtonBoxChild w22 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.button2])); + w22.Expand = false; + w22.Fill = false; + // Container child OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.button8 = new Gtk.Button(); + this.button8.CanDefault = true; + this.button8.CanFocus = true; + this.button8.Name = "button8"; + this.button8.UseUnderline = true; + // Container child button8.Gtk.Container+ContainerChild + Gtk.Alignment w23 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F); + w23.Name = "GtkAlignment1"; + // Container child GtkAlignment1.Gtk.Container+ContainerChild + Gtk.HBox w24 = new Gtk.HBox(); + w24.Name = "GtkHBox1"; + w24.Spacing = 2; + // Container child GtkHBox1.Gtk.Container+ContainerChild + Gtk.Image w25 = new Gtk.Image(); + w25.Name = "image2"; + w25.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-cancel", 16, 0); + w24.Add(w25); + // Container child GtkHBox1.Gtk.Container+ContainerChild + Gtk.Label w27 = new Gtk.Label(); + w27.Name = "GtkLabel1"; + w27.LabelProp = Mono.Unix.Catalog.GetString("Cancel"); + w27.UseUnderline = true; + w24.Add(w27); + w23.Add(w24); + this.button8.Add(w23); + this.AddActionWidget(this.button8, -6); + Gtk.ButtonBox.ButtonBoxChild w31 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.button8])); + w31.Position = 1; + w31.Expand = false; + w31.Fill = false; + if ((this.Child != null)) { + this.Child.ShowAll(); + } + this.DefaultWidth = 476; + this.DefaultHeight = 137; + this.Show(); + this.Response += new Gtk.ResponseHandler(this.OnResponse); + } + } +} diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs new file mode 100644 index 0000000..8798dac --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs @@ -0,0 +1,256 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Mono Runtime Version: 2.0.50727.42 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ + +namespace OpenGridServices.Manager { + + + public partial class MainWindow { + + private Gtk.Action Grid; + + private Gtk.Action User; + + private Gtk.Action Asset; + + private Gtk.Action Region; + + private Gtk.Action Services; + + private Gtk.Action ConnectToGridserver; + + private Gtk.Action RestartWholeGrid; + + private Gtk.Action ShutdownWholeGrid; + + private Gtk.Action ExitGridManager; + + private Gtk.Action ConnectToUserserver; + + private Gtk.Action AccountManagment; + + private Gtk.Action GlobalNotice; + + private Gtk.Action DisableAllLogins; + + private Gtk.Action DisableNonGodUsersOnly; + + private Gtk.Action ShutdownUserServer; + + private Gtk.Action ShutdownGridserverOnly; + + private Gtk.Action RestartGridserverOnly; + + private Gtk.Action DefaultLocalGridUserserver; + + private Gtk.Action CustomUserserver; + + private Gtk.Action RemoteGridDefaultUserserver; + + private Gtk.Action DisconnectFromGridServer; + + private Gtk.Action UploadAsset; + + private Gtk.Action AssetManagement; + + private Gtk.Action ConnectToAssetServer; + + private Gtk.Action ConnectToDefaultAssetServerForGrid; + + private Gtk.Action DefaultForLocalGrid; + + private Gtk.Action DefaultForRemoteGrid; + + private Gtk.Action CustomAssetServer; + + private Gtk.VBox vbox1; + + private Gtk.MenuBar menubar2; + + private Gtk.HBox hbox1; + + private Gtk.ScrolledWindow scrolledwindow1; + + private Gtk.DrawingArea drawingarea1; + + private Gtk.TreeView treeview1; + + private Gtk.Statusbar statusbar1; + + protected virtual void Build() { + Stetic.Gui.Initialize(); + // Widget OpenGridServices.Manager.MainWindow + Gtk.UIManager w1 = new Gtk.UIManager(); + Gtk.ActionGroup w2 = new Gtk.ActionGroup("Default"); + this.Grid = new Gtk.Action("Grid", Mono.Unix.Catalog.GetString("Grid"), null, null); + this.Grid.HideIfEmpty = false; + this.Grid.ShortLabel = Mono.Unix.Catalog.GetString("Grid"); + w2.Add(this.Grid, "g"); + this.User = new Gtk.Action("User", Mono.Unix.Catalog.GetString("User"), null, null); + this.User.HideIfEmpty = false; + this.User.ShortLabel = Mono.Unix.Catalog.GetString("User"); + w2.Add(this.User, null); + this.Asset = new Gtk.Action("Asset", Mono.Unix.Catalog.GetString("Asset"), null, null); + this.Asset.HideIfEmpty = false; + this.Asset.ShortLabel = Mono.Unix.Catalog.GetString("Asset"); + w2.Add(this.Asset, null); + this.Region = new Gtk.Action("Region", Mono.Unix.Catalog.GetString("Region"), null, null); + this.Region.ShortLabel = Mono.Unix.Catalog.GetString("Region"); + w2.Add(this.Region, null); + this.Services = new Gtk.Action("Services", Mono.Unix.Catalog.GetString("Services"), null, null); + this.Services.ShortLabel = Mono.Unix.Catalog.GetString("Services"); + w2.Add(this.Services, null); + this.ConnectToGridserver = new Gtk.Action("ConnectToGridserver", Mono.Unix.Catalog.GetString("Connect to gridserver..."), null, "gtk-connect"); + this.ConnectToGridserver.HideIfEmpty = false; + this.ConnectToGridserver.ShortLabel = Mono.Unix.Catalog.GetString("Connect to gridserver"); + w2.Add(this.ConnectToGridserver, null); + this.RestartWholeGrid = new Gtk.Action("RestartWholeGrid", Mono.Unix.Catalog.GetString("Restart whole grid"), null, "gtk-refresh"); + this.RestartWholeGrid.ShortLabel = Mono.Unix.Catalog.GetString("Restart whole grid"); + w2.Add(this.RestartWholeGrid, null); + this.ShutdownWholeGrid = new Gtk.Action("ShutdownWholeGrid", Mono.Unix.Catalog.GetString("Shutdown whole grid"), null, "gtk-stop"); + this.ShutdownWholeGrid.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown whole grid"); + w2.Add(this.ShutdownWholeGrid, null); + this.ExitGridManager = new Gtk.Action("ExitGridManager", Mono.Unix.Catalog.GetString("Exit grid manager"), null, "gtk-close"); + this.ExitGridManager.ShortLabel = Mono.Unix.Catalog.GetString("Exit grid manager"); + w2.Add(this.ExitGridManager, null); + this.ConnectToUserserver = new Gtk.Action("ConnectToUserserver", Mono.Unix.Catalog.GetString("Connect to userserver"), null, "gtk-connect"); + this.ConnectToUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Connect to userserver"); + w2.Add(this.ConnectToUserserver, null); + this.AccountManagment = new Gtk.Action("AccountManagment", Mono.Unix.Catalog.GetString("Account managment"), null, "gtk-properties"); + this.AccountManagment.ShortLabel = Mono.Unix.Catalog.GetString("Account managment"); + w2.Add(this.AccountManagment, null); + this.GlobalNotice = new Gtk.Action("GlobalNotice", Mono.Unix.Catalog.GetString("Global notice"), null, "gtk-network"); + this.GlobalNotice.ShortLabel = Mono.Unix.Catalog.GetString("Global notice"); + w2.Add(this.GlobalNotice, null); + this.DisableAllLogins = new Gtk.Action("DisableAllLogins", Mono.Unix.Catalog.GetString("Disable all logins"), null, "gtk-no"); + this.DisableAllLogins.ShortLabel = Mono.Unix.Catalog.GetString("Disable all logins"); + w2.Add(this.DisableAllLogins, null); + this.DisableNonGodUsersOnly = new Gtk.Action("DisableNonGodUsersOnly", Mono.Unix.Catalog.GetString("Disable non-god users only"), null, "gtk-no"); + this.DisableNonGodUsersOnly.ShortLabel = Mono.Unix.Catalog.GetString("Disable non-god users only"); + w2.Add(this.DisableNonGodUsersOnly, null); + this.ShutdownUserServer = new Gtk.Action("ShutdownUserServer", Mono.Unix.Catalog.GetString("Shutdown user server"), null, "gtk-stop"); + this.ShutdownUserServer.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown user server"); + w2.Add(this.ShutdownUserServer, null); + this.ShutdownGridserverOnly = new Gtk.Action("ShutdownGridserverOnly", Mono.Unix.Catalog.GetString("Shutdown gridserver only"), null, "gtk-stop"); + this.ShutdownGridserverOnly.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown gridserver only"); + w2.Add(this.ShutdownGridserverOnly, null); + this.RestartGridserverOnly = new Gtk.Action("RestartGridserverOnly", Mono.Unix.Catalog.GetString("Restart gridserver only"), null, "gtk-refresh"); + this.RestartGridserverOnly.ShortLabel = Mono.Unix.Catalog.GetString("Restart gridserver only"); + w2.Add(this.RestartGridserverOnly, null); + this.DefaultLocalGridUserserver = new Gtk.Action("DefaultLocalGridUserserver", Mono.Unix.Catalog.GetString("Default local grid userserver"), null, null); + this.DefaultLocalGridUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Default local grid userserver"); + w2.Add(this.DefaultLocalGridUserserver, null); + this.CustomUserserver = new Gtk.Action("CustomUserserver", Mono.Unix.Catalog.GetString("Custom userserver..."), null, null); + this.CustomUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Custom userserver"); + w2.Add(this.CustomUserserver, null); + this.RemoteGridDefaultUserserver = new Gtk.Action("RemoteGridDefaultUserserver", Mono.Unix.Catalog.GetString("Remote grid default userserver..."), null, null); + this.RemoteGridDefaultUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Remote grid default userserver"); + w2.Add(this.RemoteGridDefaultUserserver, null); + this.DisconnectFromGridServer = new Gtk.Action("DisconnectFromGridServer", Mono.Unix.Catalog.GetString("Disconnect from grid server"), null, "gtk-disconnect"); + this.DisconnectFromGridServer.ShortLabel = Mono.Unix.Catalog.GetString("Disconnect from grid server"); + this.DisconnectFromGridServer.Visible = false; + w2.Add(this.DisconnectFromGridServer, null); + this.UploadAsset = new Gtk.Action("UploadAsset", Mono.Unix.Catalog.GetString("Upload asset"), null, null); + this.UploadAsset.ShortLabel = Mono.Unix.Catalog.GetString("Upload asset"); + w2.Add(this.UploadAsset, null); + this.AssetManagement = new Gtk.Action("AssetManagement", Mono.Unix.Catalog.GetString("Asset management"), null, null); + this.AssetManagement.ShortLabel = Mono.Unix.Catalog.GetString("Asset management"); + w2.Add(this.AssetManagement, null); + this.ConnectToAssetServer = new Gtk.Action("ConnectToAssetServer", Mono.Unix.Catalog.GetString("Connect to asset server"), null, null); + this.ConnectToAssetServer.ShortLabel = Mono.Unix.Catalog.GetString("Connect to asset server"); + w2.Add(this.ConnectToAssetServer, null); + this.ConnectToDefaultAssetServerForGrid = new Gtk.Action("ConnectToDefaultAssetServerForGrid", Mono.Unix.Catalog.GetString("Connect to default asset server for grid"), null, null); + this.ConnectToDefaultAssetServerForGrid.ShortLabel = Mono.Unix.Catalog.GetString("Connect to default asset server for grid"); + w2.Add(this.ConnectToDefaultAssetServerForGrid, null); + this.DefaultForLocalGrid = new Gtk.Action("DefaultForLocalGrid", Mono.Unix.Catalog.GetString("Default for local grid"), null, null); + this.DefaultForLocalGrid.ShortLabel = Mono.Unix.Catalog.GetString("Default for local grid"); + w2.Add(this.DefaultForLocalGrid, null); + this.DefaultForRemoteGrid = new Gtk.Action("DefaultForRemoteGrid", Mono.Unix.Catalog.GetString("Default for remote grid..."), null, null); + this.DefaultForRemoteGrid.ShortLabel = Mono.Unix.Catalog.GetString("Default for remote grid..."); + w2.Add(this.DefaultForRemoteGrid, null); + this.CustomAssetServer = new Gtk.Action("CustomAssetServer", Mono.Unix.Catalog.GetString("Custom asset server..."), null, null); + this.CustomAssetServer.ShortLabel = Mono.Unix.Catalog.GetString("Custom asset server..."); + w2.Add(this.CustomAssetServer, null); + w1.InsertActionGroup(w2, 0); + this.AddAccelGroup(w1.AccelGroup); + this.WidthRequest = 800; + this.HeightRequest = 600; + this.Name = "OpenGridServices.Manager.MainWindow"; + this.Title = Mono.Unix.Catalog.GetString("Open Grid Services Manager"); + this.Icon = Gtk.IconTheme.Default.LoadIcon("gtk-network", 48, 0); + // Container child OpenGridServices.Manager.MainWindow.Gtk.Container+ContainerChild + this.vbox1 = new Gtk.VBox(); + this.vbox1.Name = "vbox1"; + // Container child vbox1.Gtk.Box+BoxChild + w1.AddUiFromString(""); + this.menubar2 = ((Gtk.MenuBar)(w1.GetWidget("/menubar2"))); + this.menubar2.HeightRequest = 25; + this.menubar2.Name = "menubar2"; + this.vbox1.Add(this.menubar2); + Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.vbox1[this.menubar2])); + w3.Position = 0; + w3.Expand = false; + w3.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.hbox1 = new Gtk.HBox(); + this.hbox1.Name = "hbox1"; + // Container child hbox1.Gtk.Box+BoxChild + this.scrolledwindow1 = new Gtk.ScrolledWindow(); + this.scrolledwindow1.CanFocus = true; + this.scrolledwindow1.Name = "scrolledwindow1"; + this.scrolledwindow1.VscrollbarPolicy = ((Gtk.PolicyType)(1)); + this.scrolledwindow1.HscrollbarPolicy = ((Gtk.PolicyType)(1)); + // Container child scrolledwindow1.Gtk.Container+ContainerChild + Gtk.Viewport w4 = new Gtk.Viewport(); + w4.Name = "GtkViewport"; + w4.ShadowType = ((Gtk.ShadowType)(0)); + // Container child GtkViewport.Gtk.Container+ContainerChild + this.drawingarea1 = new Gtk.DrawingArea(); + this.drawingarea1.Name = "drawingarea1"; + w4.Add(this.drawingarea1); + this.scrolledwindow1.Add(w4); + this.hbox1.Add(this.scrolledwindow1); + Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.hbox1[this.scrolledwindow1])); + w7.Position = 1; + // Container child hbox1.Gtk.Box+BoxChild + this.treeview1 = new Gtk.TreeView(); + this.treeview1.CanFocus = true; + this.treeview1.Name = "treeview1"; + this.hbox1.Add(this.treeview1); + Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.hbox1[this.treeview1])); + w8.Position = 2; + this.vbox1.Add(this.hbox1); + Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbox1])); + w9.Position = 1; + // Container child vbox1.Gtk.Box+BoxChild + this.statusbar1 = new Gtk.Statusbar(); + this.statusbar1.Name = "statusbar1"; + this.statusbar1.Spacing = 5; + this.vbox1.Add(this.statusbar1); + Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1])); + w10.PackType = ((Gtk.PackType)(1)); + w10.Position = 2; + w10.Expand = false; + w10.Fill = false; + this.Add(this.vbox1); + if ((this.Child != null)) { + this.Child.ShowAll(); + } + this.DefaultWidth = 800; + this.DefaultHeight = 800; + this.Show(); + this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent); + this.ConnectToGridserver.Activated += new System.EventHandler(this.ConnectToGridServerMenu); + this.ExitGridManager.Activated += new System.EventHandler(this.QuitMenu); + this.ShutdownGridserverOnly.Activated += new System.EventHandler(this.ShutdownGridserverMenu); + this.RestartGridserverOnly.Activated += new System.EventHandler(this.RestartGridserverMenu); + this.DisconnectFromGridServer.Activated += new System.EventHandler(this.DisconnectGridServerMenu); + } + } +} diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/generated.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/generated.cs new file mode 100644 index 0000000..dd4abdd --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/generated.cs @@ -0,0 +1,35 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Mono Runtime Version: 2.0.50727.42 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ + +namespace Stetic { + + + internal class Gui { + + private static bool initialized; + + internal static void Initialize() { + if ((Stetic.Gui.initialized == false)) { + Stetic.Gui.initialized = true; + } + } + } + + internal class ActionGroups { + + public static Gtk.ActionGroup GetActionGroup(System.Type type) { + return Stetic.ActionGroups.GetActionGroup(type.FullName); + } + + public static Gtk.ActionGroup GetActionGroup(string name) { + return null; + } + } +} diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/gui.stetic b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/gui.stetic new file mode 100644 index 0000000..c883f08 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/gui.stetic @@ -0,0 +1,502 @@ + + + + + + Action + <Alt><Mod2>g + False + Grid + Grid + + + Action + False + User + User + + + Action + False + Asset + Asset + + + Action + Region + Region + + + Action + Services + Services + + + Action + False + Connect to gridserver... + Connect to gridserver + gtk-connect + + + + Action + Restart whole grid + Restart whole grid + gtk-refresh + + + Action + Shutdown whole grid + Shutdown whole grid + gtk-stop + + + Action + Exit grid manager + Exit grid manager + gtk-close + + + + Action + Connect to userserver + Connect to userserver + gtk-connect + + + Action + Account managment + Account managment + gtk-properties + + + Action + Global notice + Global notice + gtk-network + + + Action + Disable all logins + Disable all logins + gtk-no + + + Action + Disable non-god users only + Disable non-god users only + gtk-no + + + Action + Shutdown user server + Shutdown user server + gtk-stop + + + Action + Shutdown gridserver only + Shutdown gridserver only + gtk-stop + + + + Action + Restart gridserver only + Restart gridserver only + gtk-refresh + + + + Action + Default local grid userserver + Default local grid userserver + + + Action + Custom userserver... + Custom userserver + + + Action + Remote grid default userserver... + Remote grid default userserver + + + Action + Disconnect from grid server + Disconnect from grid server + gtk-disconnect + False + + + + Action + Upload asset + Upload asset + + + Action + Asset management + Asset management + + + Action + Connect to asset server + Connect to asset server + + + Action + Connect to default asset server for grid + Connect to default asset server for grid + + + Action + Default for local grid + Default for local grid + + + Action + Default for remote grid... + Default for remote grid... + + + Action + Custom asset server... + Custom asset server... + + + + 800 + 600 + Open Grid Services Manager + stock:gtk-network Dialog + + + + + + + + 25 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + False + False + False + + + + + + + + + + + + True + Automatic + Automatic + + + + None + + + + + + + + + + 1 + True + + + + + + True + + + 2 + True + + + + + 1 + True + + + + + statusBar1 + 5 + + + + + + + + + End + 2 + False + False + False + + + + + + + + ButtonPressMask + Connect to Grid server + CenterOnParent + 2 + False + False + + + + + ButtonPressMask + 2 + + + + + + + + + + + + + + + + + + + 1 + Grid server URL: + Right + + + 0 + False + + + + + + True + http://gridserver:8001 + True + 255 + + + + 1 + False + + + + + + + + 0 + True + False + False + + + + + + + + + 1 + Username: + Right + + + 0 + False + + + + + + True + True + + + + 1 + True + + + + + + + + 1 + False + False + False + + + + + + + + + 1 + Password: + Right + + + 0 + False + + + + + + True + True + + + + 1 + True + + + + + + + + 2 + True + False + False + + + + + 2 + True + False + False + + + + + 0 + True + + + + + + + + ButtonPressMask + 6 + 5 + 2 + End + + + + True + True + TextAndIcon + stock:gtk-apply Menu + Connect + True + True + -5 + + + False + False + + + + + + True + True + TextAndIcon + stock:gtk-cancel Menu + Cancel + True + True + -6 + + + 1 + False + False + + + + + + \ No newline at end of file diff --git a/OpenSim/Grid/UserServer.Config/AssemblyInfo.cs b/OpenSim/Grid/UserServer.Config/AssemblyInfo.cs new file mode 100644 index 0000000..25e0211 --- /dev/null +++ b/OpenSim/Grid/UserServer.Config/AssemblyInfo.cs @@ -0,0 +1,58 @@ +/* +* 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.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("UserConfig")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("UserConfig")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// This sets the default COM visibility of types in the assembly to invisible. +// If you need to expose a type to COM, use [ComVisible(true)] on that type. +[assembly: ComVisible(false)] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("1.0.*")] diff --git a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs new file mode 100644 index 0000000..770a6b9 --- /dev/null +++ b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs @@ -0,0 +1,96 @@ +/* +* 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 OpenSim.Framework.Console; +using OpenSim.Framework.Interfaces; +using Db4objects.Db4o; + +namespace OpenUser.Config.UserConfigDb4o +{ + public class Db4oConfigPlugin: IUserConfig + { + public UserConfig GetConfigObject() + { + OpenSim.Framework.Console.MainLog.Instance.Verbose("Loading Db40Config dll"); + return ( new DbUserConfig()); + } + } + + public class DbUserConfig : UserConfig + { + private IObjectContainer db; + + public void LoadDefaults() { + OpenSim.Framework.Console.MainLog.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); + + this.DefaultStartupMsg = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); + + this.GridServerURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/"); + this.GridSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to grid server","null"); + this.GridRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from grid server","null"); + } + + public override void InitConfig() { + try { + db = Db4oFactory.OpenFile("openuser.yap"); + IObjectSet result = db.Get(typeof(DbUserConfig)); + if(result.Count==1) { + OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Found a UserConfig object in the local database, loading"); + foreach (DbUserConfig cfg in result) { + this.GridServerURL=cfg.GridServerURL; + this.GridSendKey=cfg.GridSendKey; + this.GridRecvKey=cfg.GridRecvKey; + this.DefaultStartupMsg=cfg.DefaultStartupMsg; + } + } else { + OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); + LoadDefaults(); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Writing out default settings to local database"); + db.Set(this); + db.Close(); + } + } catch(Exception e) { + OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); + OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + } + + OpenSim.Framework.Console.MainLog.Instance.Verbose("User settings loaded:"); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Default startup message: " + this.DefaultStartupMsg); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Grid server URL: " + this.GridServerURL); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to grid: " + this.GridSendKey); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from grid: " + this.GridRecvKey); + } + + + public void Shutdown() { + db.Close(); + } + } + +} diff --git a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj new file mode 100644 index 0000000..1ae9589 --- /dev/null +++ b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj @@ -0,0 +1,107 @@ + + + Local + 8.0.50727 + 2.0 + {08F87229-0000-0000-0000-000000000000} + Debug + AnyCPU + + + + OpenSim.Grid.UserServer.Config + JScript + Grid + IE50 + false + Library + + OpenSim.Grid.UserServer.Config + + + + + + 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\Db4objects.Db4o.dll + False + + + ..\..\..\bin\libsecondlife.dll + False + + + OpenSim.Framework.dll + False + + + OpenSim.Framework.Console.dll + False + + + System.dll + False + + + ..\..\..\bin\System.Data.dll + False + + + System.Xml.dll + False + + + + + + + Code + + + Code + + + + + + + + + + diff --git a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj.user b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj.user new file mode 100644 index 0000000..6841907 --- /dev/null +++ b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj.user @@ -0,0 +1,12 @@ + + + Debug + AnyCPU + C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ + 8.0.50727 + ProjectFiles + 0 + + + + diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs new file mode 100644 index 0000000..5c27d57 --- /dev/null +++ b/OpenSim/Grid/UserServer/Main.cs @@ -0,0 +1,219 @@ +/* +* 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.Reflection; +using System.IO; +using System.Text; +using libsecondlife; +using OpenSim.Framework.User; +using OpenSim.Framework.Sims; +using OpenSim.Framework.Inventory; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Console; +using OpenSim.Servers; +using OpenSim.Framework.Utilities; +using OpenSim.GenericConfig; + +namespace OpenGridServices.UserServer +{ + /// + /// + public class OpenUser_Main : conscmd_callback + { + private string ConfigDll = "OpenUser.Config.UserConfigDb4o.dll"; + private string StorageDll = "OpenGrid.Framework.Data.MySQL.dll"; + private UserConfig Cfg; + protected IGenericConfig localXMLConfig; + + public UserManager m_userManager; + + public Dictionary UserSessions = new Dictionary(); + + LogBase m_console; + + [STAThread] + public static void Main(string[] args) + { + Console.WriteLine("Launching UserServer..."); + + OpenUser_Main userserver = new OpenUser_Main(); + + userserver.Startup(); + userserver.Work(); + } + + private OpenUser_Main() + { + m_console = new LogBase("opengrid-userserver-console.log", "OpenUser", this , false); + OpenSim.Framework.Console.MainLog.Instance = m_console; + } + + private void Work() + { + m_console.Notice("Enter help for a list of commands\n"); + + while (true) + { + m_console.MainLogPrompt(); + } + } + + public void Startup() + { + this.localXMLConfig = new XmlConfig("UserServerConfig.xml"); + this.localXMLConfig.LoadData(); + this.ConfigDB(this.localXMLConfig); + this.localXMLConfig.Close(); + + OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Loading configuration"); + Cfg = this.LoadConfigDll(this.ConfigDll); + Cfg.InitConfig(); + + OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Establishing data connection"); + m_userManager = new UserManager(); + m_userManager._config = Cfg; + m_userManager.AddPlugin(StorageDll); + + OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Starting HTTP process"); + BaseHttpServer httpServer = new BaseHttpServer(8002); + + httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod); + + httpServer.AddRestHandler("GET", "/user/name/", m_userManager.RestGetUserMethodName); + httpServer.AddRestHandler("GET", "/user/uuid/", m_userManager.RestGetUserMethodUUID); + + httpServer.AddRestHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod); + + httpServer.Start(); + m_console.Status("Userserver 0.3 - Startup complete"); + } + + + public void do_create(string what) + { + switch (what) + { + case "user": + string tempfirstname; + string templastname; + string tempMD5Passwd; + uint regX = 997; + uint regY = 996; + + tempfirstname = m_console.CmdPrompt("First name"); + templastname = m_console.CmdPrompt("Last name"); + tempMD5Passwd = m_console.PasswdPrompt("Password"); + regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X")); + regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y")); + + tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + ""); + + m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); + break; + } + } + + public void RunCmd(string cmd, string[] cmdparams) + { + switch (cmd) + { + case "help": + m_console.Notice("create user - create a new user"); + m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); + break; + + case "create": + do_create(cmdparams[0]); + break; + + case "shutdown": + m_console.Close(); + Environment.Exit(0); + break; + } + } + + private void ConfigDB(IGenericConfig configData) + { + try + { + string attri = ""; + attri = configData.GetAttribute("DataBaseProvider"); + if (attri == "") + { + StorageDll = "OpenGrid.Framework.Data.DB4o.dll"; + configData.SetAttribute("DataBaseProvider", "OpenGrid.Framework.Data.DB4o.dll"); + } + else + { + StorageDll = attri; + } + configData.Commit(); + } + catch (Exception e) + { + + } + } + + private UserConfig LoadConfigDll(string dllName) + { + Assembly pluginAssembly = Assembly.LoadFrom(dllName); + UserConfig config = null; + + foreach (Type pluginType in pluginAssembly.GetTypes()) + { + if (pluginType.IsPublic) + { + if (!pluginType.IsAbstract) + { + Type typeInterface = pluginType.GetInterface("IUserConfig", true); + + if (typeInterface != null) + { + IUserConfig plug = (IUserConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + config = plug.GetConfigObject(); + break; + } + + typeInterface = null; + } + } + } + pluginAssembly = null; + return config; + } + + public void Show(string ShowWhat) + { + } + } +} diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj new file mode 100644 index 0000000..3c93b78 --- /dev/null +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj @@ -0,0 +1,132 @@ + + + Local + 8.0.50727 + 2.0 + {2FC96F92-0000-0000-0000-000000000000} + Debug + AnyCPU + + + + OpenSim.Grid.UserServer + JScript + Grid + IE50 + false + Exe + + OpenSim.Grid.UserServer + + + + + + 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\Db4objects.Db4o.dll + False + + + ..\..\..\bin\libsecondlife.dll + False + + + OpenSim.Framework.dll + False + + + OpenSim.Framework.Console.dll + False + + + OpenSim.Framework.GenericConfig.Xml.dll + False + + + OpenSim.Framework.Servers.dll + False + + + OpenSim.Framework.UserManager.dll + False + + + System.dll + False + + + System.Data.dll + False + + + System.Xml.dll + False + + + ..\..\..\bin\XMLRPC.dll + False + + + + + OpenSim.Framework.Data + {36B72A9B-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + + + + + Code + + + Code + + + Code + + + + + + + + + + diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj.user b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj.user new file mode 100644 index 0000000..6841907 --- /dev/null +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj.user @@ -0,0 +1,12 @@ + + + Debug + AnyCPU + C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ + 8.0.50727 + ProjectFiles + 0 + + + + diff --git a/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5d5ce8d --- /dev/null +++ b/OpenSim/Grid/UserServer/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-UserServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OGS-UserServer")] +[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("e266513a-090b-4d38-80f6-8599eef68c8c")] + +// 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/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs new file mode 100644 index 0000000..0704de1 --- /dev/null +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -0,0 +1,103 @@ +/* +* 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 OpenGrid.Framework.Data; +using libsecondlife; +using System.Reflection; + +using System.Xml; +using Nwc.XmlRpc; +using OpenSim.Framework.Sims; +using OpenSim.Framework.Inventory; +using OpenSim.Framework.Utilities; +using OpenGrid.Framework.UserManagement; + +using System.Security.Cryptography; + +namespace OpenGridServices.UserServer +{ + public class UserManager : UserManagerBase + { + public UserManager() + { + } + + /// + /// Customises the login response and fills in missing values. + /// + /// The existing response + /// The user profile + public override void CustomiseResponse(ref LoginResponse response, ref UserProfileData theUser) + { + // Load information from the gridserver + SimProfile SimInfo = new SimProfile(); + SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); + + // Customise the response + // Home Location + response.Home = "{'region_handle':[r" + (SimInfo.RegionLocX * 256).ToString() + ",r" + (SimInfo.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() + "]}"; + + // Destination + response.SimAddress = SimInfo.sim_ip; + response.SimPort = (Int32)SimInfo.sim_port; + response.RegionX = SimInfo.RegionLocY ; + response.RegionY = SimInfo.RegionLocX ; + + // Notify the target of an incoming user + Console.WriteLine("Notifying " + SimInfo.regionname + " (" + SimInfo.caps_url + ")"); + + // Prepare notification + Hashtable SimParams = new Hashtable(); + SimParams["session_id"] = theUser.currentAgent.sessionID.ToString(); + SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString(); + SimParams["firstname"] = theUser.username; + SimParams["lastname"] = theUser.surname; + SimParams["agent_id"] = theUser.UUID.ToString(); + SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response.CircuitCode); + SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); + SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); + SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); + SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString(); + ArrayList SendParams = new ArrayList(); + SendParams.Add(SimParams); + + // Update agent with target sim + theUser.currentAgent.currentRegion = SimInfo.UUID; + theUser.currentAgent.currentHandle = SimInfo.regionhandle; + + // Send + XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); + XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000); + } + } +} -- 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/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj | 4 ++-- .../Grid/AssetServer/OpenSim.Grid.AssetServer.csproj.user | 12 ------------ .../OpenSim.Grid.Framework.Manager.csproj.user | 12 ------------ .../OpenSim.Grid.GridServer.Config.csproj.user | 12 ------------ OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj.user | 12 ------------ .../OpenSim.Grid.UserServer.Config.csproj.user | 12 ------------ OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj.user | 12 ------------ 7 files changed, 2 insertions(+), 74 deletions(-) delete mode 100644 OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj.user delete mode 100644 OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj.user delete mode 100644 OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj.user delete mode 100644 OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj.user delete mode 100644 OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj.user delete mode 100644 OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj.user (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj index caebca3..945b7a5 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj @@ -98,10 +98,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj.user b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj.user deleted file mode 100644 index 6841907..0000000 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - Debug - AnyCPU - C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ - 8.0.50727 - ProjectFiles - 0 - - - - diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj.user b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj.user deleted file mode 100644 index 6841907..0000000 --- a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - Debug - AnyCPU - C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ - 8.0.50727 - ProjectFiles - 0 - - - - diff --git a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj.user b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj.user deleted file mode 100644 index 6841907..0000000 --- a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - Debug - AnyCPU - C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ - 8.0.50727 - ProjectFiles - 0 - - - - diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj.user b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj.user deleted file mode 100644 index 6841907..0000000 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - Debug - AnyCPU - C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ - 8.0.50727 - ProjectFiles - 0 - - - - diff --git a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj.user b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj.user deleted file mode 100644 index 6841907..0000000 --- a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - Debug - AnyCPU - C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ - 8.0.50727 - ProjectFiles - 0 - - - - diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj.user b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj.user deleted file mode 100644 index 6841907..0000000 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - Debug - AnyCPU - C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-06\NameSpaceChanges\bin\ - 8.0.50727 - ProjectFiles - 0 - - - - -- cgit v1.1 From 2261e4ec2a43a56dbb74168a169f39b2c6c1f054 Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 27 Jun 2007 18:04:07 +0000 Subject: *Fixed all renaming for OpenGridServices.sln, still a reference issue in prebuild.xml though --- OpenSim/Grid/AssetServer/AssetHttpServer.cs | 4 ++-- OpenSim/Grid/AssetServer/Main.cs | 4 ++-- OpenSim/Grid/Framework.Manager/GridManagementAgent.cs | 6 +++--- OpenSim/Grid/Framework.Manager/GridServerManager.cs | 2 +- .../Framework.Manager/OpenSim.Grid.Framework.Manager.csproj | 4 ++-- OpenSim/Grid/GridServer/GridManager.cs | 4 ++-- OpenSim/Grid/GridServer/Main.cs | 12 ++++++------ OpenSim/Grid/UserServer/Main.cs | 10 +++++----- OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj | 4 ++-- OpenSim/Grid/UserServer/UserManager.cs | 7 ++++--- 10 files changed, 29 insertions(+), 28 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/AssetHttpServer.cs b/OpenSim/Grid/AssetServer/AssetHttpServer.cs index 6fc6bf8..ad8733f 100644 --- a/OpenSim/Grid/AssetServer/AssetHttpServer.cs +++ b/OpenSim/Grid/AssetServer/AssetHttpServer.cs @@ -35,9 +35,9 @@ using System.Threading; using Nwc.XmlRpc; using System.Collections; using OpenSim.Framework.Console; -using OpenSim.Servers; +using OpenSim.Framework.Servers; -namespace OpenGridServices.AssetServer +namespace OpenSim.Grid.AssetServer { /// /// An HTTP server for sending assets diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 96c9dba..d06998d 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -40,11 +40,11 @@ using OpenSim.Framework.Console; using OpenSim.Framework.Types; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Utilities; -using OpenSim.Servers; +using OpenSim.Framework.Servers; using Db4objects.Db4o; using Db4objects.Db4o.Query; -namespace OpenGridServices.AssetServer +namespace OpenSim.Grid.AssetServer { /// /// An asset server diff --git a/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs b/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs index dfc572a..3f5d7dd 100644 --- a/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs +++ b/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs @@ -27,12 +27,12 @@ */ using Nwc.XmlRpc; using OpenSim.Framework; -using OpenSim.Servers; +using OpenSim.Framework.Servers; using System.Collections; using System.Collections.Generic; using libsecondlife; -namespace OpenGrid.Framework.Manager +namespace OpenSim.Framework.Manager { /// /// Used to pass messages to the gridserver @@ -116,7 +116,7 @@ namespace OpenGrid.Framework.Manager Hashtable requestData = (Hashtable)request.Params[0]; Hashtable responseData = new Hashtable(); - // TODO: Switch this over to using OpenGrid.Framework.Data + // TODO: Switch this over to using OpenSim.Framework.Data if (requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret")) { response.IsFault = false; diff --git a/OpenSim/Grid/Framework.Manager/GridServerManager.cs b/OpenSim/Grid/Framework.Manager/GridServerManager.cs index e276556..d5eaf6f 100644 --- a/OpenSim/Grid/Framework.Manager/GridServerManager.cs +++ b/OpenSim/Grid/Framework.Manager/GridServerManager.cs @@ -33,7 +33,7 @@ using Nwc.XmlRpc; using System.Threading; using libsecondlife; -namespace OpenGrid.Framework.Manager { +namespace OpenSim.Framework.Manager { /// /// A remote management system for the grid server diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj index 9a98ff4..12edcd0 100644 --- a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj +++ b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj @@ -82,10 +82,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index bf80652..c78d14a 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -30,7 +30,7 @@ using System.Collections; using System.Collections.Generic; using System.Text; using System.Reflection; -using OpenGrid.Framework.Data; +using OpenSim.Framework.Data; using OpenSim.Framework.Utilities; using OpenSim.Framework.Console; using OpenSim.Framework.Sims; @@ -38,7 +38,7 @@ using libsecondlife; using Nwc.XmlRpc; using System.Xml; -namespace OpenGridServices.GridServer +namespace OpenSim.Grid.GridServer { class GridManager { diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index b948fd6..b225214 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -34,22 +34,22 @@ using System.Net; using System.Threading; using System.Reflection; using libsecondlife; -using OpenGrid.Framework.Manager; +using OpenSim.Framework.Manager; using OpenSim.Framework; using OpenSim.Framework.Sims; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; -using OpenSim.Servers; +using OpenSim.Framework.Servers; using OpenSim.GenericConfig; -namespace OpenGridServices.GridServer +namespace OpenSim.Grid.GridServer { /// /// public class OpenGrid_Main : conscmd_callback { private string ConfigDll = "OpenGrid.Config.GridConfigDb4o.dll"; - private string GridDll = "OpenGrid.Framework.Data.MySQL.dll"; + private string GridDll = "OpenSim.Framework.Data.MySQL.dll"; public GridConfig Cfg; public static OpenGrid_Main thegrid; @@ -253,8 +253,8 @@ namespace OpenGridServices.GridServer attri = configData.GetAttribute("DataBaseProvider"); if (attri == "") { - GridDll = "OpenGrid.Framework.Data.DB4o.dll"; - configData.SetAttribute("DataBaseProvider", "OpenGrid.Framework.Data.DB4o.dll"); + GridDll = "OpenSim.Framework.Data.DB4o.dll"; + configData.SetAttribute("DataBaseProvider", "OpenSim.Framework.Data.DB4o.dll"); } else { diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 5c27d57..c0ff649 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -38,18 +38,18 @@ using OpenSim.Framework.Sims; using OpenSim.Framework.Inventory; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Console; -using OpenSim.Servers; +using OpenSim.Framework.Servers; using OpenSim.Framework.Utilities; using OpenSim.GenericConfig; -namespace OpenGridServices.UserServer +namespace OpenSim.Grid.UserServer { /// /// public class OpenUser_Main : conscmd_callback { private string ConfigDll = "OpenUser.Config.UserConfigDb4o.dll"; - private string StorageDll = "OpenGrid.Framework.Data.MySQL.dll"; + private string StorageDll = "OpenSim.Framework.Data.MySQL.dll"; private UserConfig Cfg; protected IGenericConfig localXMLConfig; @@ -169,8 +169,8 @@ namespace OpenGridServices.UserServer attri = configData.GetAttribute("DataBaseProvider"); if (attri == "") { - StorageDll = "OpenGrid.Framework.Data.DB4o.dll"; - configData.SetAttribute("DataBaseProvider", "OpenGrid.Framework.Data.DB4o.dll"); + StorageDll = "OpenSim.Framework.Data.DB4o.dll"; + configData.SetAttribute("DataBaseProvider", "OpenSim.Framework.Data.DB4o.dll"); } else { diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj index 3c93b78..e5cb92c 100644 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj @@ -112,10 +112,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 0704de1..c99cf87 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -29,7 +29,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Text; -using OpenGrid.Framework.Data; +using OpenSim.Framework.Data; using libsecondlife; using System.Reflection; @@ -38,11 +38,12 @@ using Nwc.XmlRpc; using OpenSim.Framework.Sims; using OpenSim.Framework.Inventory; using OpenSim.Framework.Utilities; -using OpenGrid.Framework.UserManagement; + +using OpenSim.Framework.UserManagement; using System.Security.Cryptography; -namespace OpenGridServices.UserServer +namespace OpenSim.Grid.UserServer { public class UserManager : UserManagerBase { -- cgit v1.1 From 1a6f58f3378e28199056577e58c5177f23515138 Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 27 Jun 2007 18:28:45 +0000 Subject: *Fixed OpenGridServices.sln and prebuild.xml *NameSpaceChanges branch now fully compiles! --- OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj index e5cb92c..e822c18 100644 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj @@ -82,10 +82,6 @@ OpenSim.Framework.Servers.dll False - - OpenSim.Framework.UserManager.dll - False - System.dll False @@ -110,6 +106,12 @@ {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} False + + OpenSim.Framework.UserManagement + {586E2916-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + -- cgit v1.1 From 9eaecabdd0884cfe17d249440badce1ecdbcc142 Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 27 Jun 2007 19:04:23 +0000 Subject: *Moved VersionInfo.cs to its correct place in OpenSim.csproj *Added OpenSim.Region.Caps *Updated prebuild.xml and ran prebuild --- OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj | 4 ++-- OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj index 12edcd0..9a98ff4 100644 --- a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj +++ b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj @@ -82,10 +82,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj index e822c18..1146b17 100644 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj @@ -114,10 +114,10 @@ - + Code - + Code -- cgit v1.1 From 440bb4a358cdc01559f624dbcbb7391d260616e0 Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 28 Jun 2007 02:07:59 +0000 Subject: *Fixed UserServer and OpenSim so now they start without crashing. --- OpenSim/Grid/UserServer/Main.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index c0ff649..8ae4dbf 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -48,7 +48,7 @@ namespace OpenSim.Grid.UserServer /// public class OpenUser_Main : conscmd_callback { - private string ConfigDll = "OpenUser.Config.UserConfigDb4o.dll"; + private string ConfigDll = "OpenSim.Grid.UserServer.Config.dll"; private string StorageDll = "OpenSim.Framework.Data.MySQL.dll"; private UserConfig Cfg; protected IGenericConfig localXMLConfig; -- 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. --- .../AssetServer/OpenSim.Grid.AssetServer.csproj | 4 +- .../AssetServer/OpenSim.Grid.AssetServer.exe.build | 49 ++++++++++++++++++++ .../OpenSim.Grid.Framework.Manager.dll.build | 44 ++++++++++++++++++ .../OpenSim.Grid.GridServer.Config.dll.build | 46 +++++++++++++++++++ .../GridServer/OpenSim.Grid.GridServer.exe.build | 52 ++++++++++++++++++++++ .../OpenSim.Grid.UserServer.Config.dll.build | 46 +++++++++++++++++++ .../UserServer/OpenSim.Grid.UserServer.exe.build | 52 ++++++++++++++++++++++ 7 files changed, 291 insertions(+), 2 deletions(-) create mode 100644 OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build create mode 100644 OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build create mode 100644 OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build create mode 100644 OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build create mode 100644 OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build create mode 100644 OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj index 945b7a5..caebca3 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj @@ -98,10 +98,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build new file mode 100644 index 0000000..88724f6 --- /dev/null +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build new file mode 100644 index 0000000..8e9f026 --- /dev/null +++ b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build new file mode 100644 index 0000000..cdf09e1 --- /dev/null +++ b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build new file mode 100644 index 0000000..4cadf1d --- /dev/null +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build new file mode 100644 index 0000000..a427765 --- /dev/null +++ b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build new file mode 100644 index 0000000..50c9788 --- /dev/null +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 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 --- OpenSim/Grid/UserServer/Main.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 8ae4dbf..640f91a 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -107,8 +107,8 @@ namespace OpenSim.Grid.UserServer httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod); - httpServer.AddRestHandler("GET", "/user/name/", m_userManager.RestGetUserMethodName); - httpServer.AddRestHandler("GET", "/user/uuid/", m_userManager.RestGetUserMethodUUID); + httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); + httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID); httpServer.AddRestHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod); -- 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 --- OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj | 4 ++-- OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build | 2 +- OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj | 4 ++-- OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj index caebca3..945b7a5 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj @@ -98,10 +98,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build index 88724f6..0a1b533 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build @@ -11,8 +11,8 @@ - + diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj index 1146b17..e822c18 100644 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj @@ -114,10 +114,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build index 50c9788..b0333f1 100644 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build @@ -11,8 +11,8 @@ - + -- 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. --- OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj | 4 ++-- OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build | 8 ++++---- .../Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build | 4 ++-- .../GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build | 4 ++-- OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build | 8 ++++---- .../UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build | 4 ++-- OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj | 4 ++-- OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build | 10 +++++----- 8 files changed, 23 insertions(+), 23 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj index 945b7a5..caebca3 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj @@ -98,10 +98,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build index 0a1b533..0f9540e 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build @@ -11,8 +11,8 @@ - + @@ -22,9 +22,9 @@ - - - + + + diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build index 8e9f026..119967d 100644 --- a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build +++ b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build @@ -20,8 +20,8 @@ - - + + diff --git a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build index cdf09e1..ff57dac 100644 --- a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build +++ b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build @@ -21,8 +21,8 @@ - - + + diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build index 4cadf1d..3573e89 100644 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build @@ -22,11 +22,11 @@ - - + + - - + + diff --git a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build index a427765..fc7e00b 100644 --- a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build +++ b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build @@ -21,8 +21,8 @@ - - + + diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj index e822c18..1146b17 100644 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj @@ -114,10 +114,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build index b0333f1..8bc1fc1 100644 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build @@ -11,8 +11,8 @@ - + @@ -22,11 +22,11 @@ - - + + - - + + -- cgit v1.1 From b2883faddf4b91a56f9fb63344be0c434f55561c Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 29 Jun 2007 16:28:03 +0000 Subject: * just making sure build files are latest --- OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build | 6 +++--- .../Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build | 4 ++-- .../GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build | 4 ++-- OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build | 8 ++++---- .../UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build | 4 ++-- OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build index 0f9540e..88724f6 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build @@ -22,9 +22,9 @@ - - - + + + diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build index 119967d..8e9f026 100644 --- a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build +++ b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build @@ -20,8 +20,8 @@ - - + + diff --git a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build index ff57dac..cdf09e1 100644 --- a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build +++ b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build @@ -21,8 +21,8 @@ - - + + diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build index 3573e89..4cadf1d 100644 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build @@ -22,11 +22,11 @@ - - + + - - + + diff --git a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build index fc7e00b..a427765 100644 --- a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build +++ b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build @@ -21,8 +21,8 @@ - - + + diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build index 8bc1fc1..50c9788 100644 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build @@ -22,11 +22,11 @@ - - + + - - + + -- 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 --- OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj | 4 ++-- OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj index caebca3..945b7a5 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj @@ -98,10 +98,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build index 88724f6..0a1b533 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build @@ -11,8 +11,8 @@ - + -- cgit v1.1 From bacf90b5d8dd638383f7f293f621b16027b9f886 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 1 Jul 2007 11:40:48 +0000 Subject: * Project files fixed for OGS. --- .../OpenSim.Grid.Framework.Manager.csproj | 37 +++++++++++++--------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj index 9a98ff4..4864994 100644 --- a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj +++ b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,7 +6,8 @@ {4B7BFD1C-0000-0000-0000-000000000000} Debug AnyCPU - + + OpenSim.Grid.Framework.Manager @@ -15,9 +16,11 @@ IE50 false Library - + + OpenSim.Grid.Framework.Manager - + + @@ -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,26 +61,27 @@ False False 4 - + + - + ..\..\..\bin\libsecondlife.dll False - + OpenSim.Framework.dll False - - OpenSim.Framework.Servers.dll + + ..\..\..\bin\OpenSim.Framework.Servers.dll False - + System.dll False - + ..\..\..\bin\XMLRPC.dll False @@ -96,4 +103,4 @@ - + \ No newline at end of file -- 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/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj | 4 ++-- OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build | 2 +- OpenSim/Grid/GridServer/GridManager.cs | 8 ++++---- OpenSim/Grid/GridServer/Main.cs | 2 +- OpenSim/Grid/UserServer/Main.cs | 2 +- OpenSim/Grid/UserServer/UserManager.cs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj index 945b7a5..caebca3 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj @@ -98,10 +98,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build index 0a1b533..88724f6 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build @@ -11,8 +11,8 @@ - + diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index c78d14a..47f7d00 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -108,7 +108,7 @@ namespace OpenSim.Grid.GridServer { kvp.Value.saveLog("Gridserver", target, method, args, priority, message); } - catch (Exception e) + catch (Exception) { OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: unable to write log via " + kvp.Key); } @@ -127,7 +127,7 @@ namespace OpenSim.Grid.GridServer { return kvp.Value.GetProfileByLLUUID(uuid); } - catch (Exception e) + catch (Exception) { OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key); } @@ -148,7 +148,7 @@ namespace OpenSim.Grid.GridServer { return kvp.Value.GetProfileByHandle(handle); } - catch (Exception e) + catch { OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key); } @@ -172,7 +172,7 @@ namespace OpenSim.Grid.GridServer regions[neighbour.regionHandle] = neighbour; } } - catch (Exception e) + catch { OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to query regionblock via " + kvp.Key); } diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index b225214..5ac64b2 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -262,7 +262,7 @@ namespace OpenSim.Grid.GridServer } configData.Commit(); } - catch (Exception e) + catch { } diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 640f91a..c65bb97 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -178,7 +178,7 @@ namespace OpenSim.Grid.UserServer } configData.Commit(); } - catch (Exception e) + catch { } diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index c99cf87..a3e3322 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -56,7 +56,7 @@ namespace OpenSim.Grid.UserServer /// /// The existing response /// The user profile - public override void CustomiseResponse(ref LoginResponse response, ref UserProfileData theUser) + public override void CustomiseResponse( LoginResponse response, UserProfileData theUser) { // Load information from the gridserver SimProfile SimInfo = new SimProfile(); -- 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.Grid.Framework.Manager.csproj | 37 +++++++++------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj index 4864994..9a98ff4 100644 --- a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj +++ b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,8 +6,7 @@ {4B7BFD1C-0000-0000-0000-000000000000} Debug AnyCPU - - + OpenSim.Grid.Framework.Manager @@ -16,11 +15,9 @@ IE50 false Library - - + OpenSim.Grid.Framework.Manager - - + @@ -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,27 +55,26 @@ False False 4 - - + - + ..\..\..\bin\libsecondlife.dll False - + OpenSim.Framework.dll False - - ..\..\..\bin\OpenSim.Framework.Servers.dll + + OpenSim.Framework.Servers.dll False - + System.dll False - + ..\..\..\bin\XMLRPC.dll False @@ -103,4 +96,4 @@ - \ No newline at end of file + -- cgit v1.1 From 686f6a83319eaccd27f426eda82c020246566963 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 2 Jul 2007 08:03:11 +0000 Subject: * Fixed Issue #161 by using PhysicsScene.Null instead of BasePhysicsScene * Hid NullPhysicsScene for great justice * Fixed broken Grid build --- OpenSim/Grid/AssetServer/AssetHttpServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/AssetHttpServer.cs b/OpenSim/Grid/AssetServer/AssetHttpServer.cs index ad8733f..31cb379 100644 --- a/OpenSim/Grid/AssetServer/AssetHttpServer.cs +++ b/OpenSim/Grid/AssetServer/AssetHttpServer.cs @@ -94,7 +94,7 @@ namespace OpenSim.Grid.AssetServer case "application/xml": // probably LLSD we hope, otherwise it should be ignored by the parser - responseString = ParseLLSDXML(requestBody); + responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); response.AddHeader("Content-type", "application/xml"); break; -- 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 --- OpenSim/Grid/GridServer/GridManager.cs | 1 + OpenSim/Grid/GridServer/Main.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 47f7d00..e562721 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -223,6 +223,7 @@ namespace OpenSim.Grid.GridServer SimProfileData TheSim = null; Hashtable requestData = (Hashtable)request.Params[0]; + Console.WriteLine("WOOT: " + requestData.ToString()); if (requestData.ContainsKey("UUID")) { TheSim = getRegion(new LLUUID((string)requestData["UUID"])); diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 5ac64b2..490f757 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -48,7 +48,7 @@ namespace OpenSim.Grid.GridServer /// public class OpenGrid_Main : conscmd_callback { - private string ConfigDll = "OpenGrid.Config.GridConfigDb4o.dll"; + private string ConfigDll = "OpenSim.Grid.GridServer.Config.dll"; private string GridDll = "OpenSim.Framework.Data.MySQL.dll"; public GridConfig Cfg; -- 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 --- OpenSim/Grid/AssetServer/AssetHttpServer.cs | 15 ++---- OpenSim/Grid/AssetServer/Main.cs | 24 +++------- .../Grid/AssetServer/Properties/AssemblyInfo.cs | 2 - .../Grid/Framework.Manager/GridManagementAgent.cs | 6 +-- .../Grid/Framework.Manager/GridServerManager.cs | 3 +- OpenSim/Grid/GridServer.Config/AssemblyInfo.cs | 2 - OpenSim/Grid/GridServer.Config/DbGridConfig.cs | 55 +++++++++++----------- OpenSim/Grid/GridServer/GridManager.cs | 41 ++++++++-------- OpenSim/Grid/GridServer/Main.cs | 14 ++---- OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs | 2 - OpenSim/Grid/UserServer.Config/AssemblyInfo.cs | 2 - OpenSim/Grid/UserServer.Config/DbUserConfig.cs | 35 +++++++------- OpenSim/Grid/UserServer/Main.cs | 17 +++---- OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs | 2 - OpenSim/Grid/UserServer/UserManager.cs | 13 +---- 15 files changed, 90 insertions(+), 143 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/AssetHttpServer.cs b/OpenSim/Grid/AssetServer/AssetHttpServer.cs index 31cb379..9546891 100644 --- a/OpenSim/Grid/AssetServer/AssetHttpServer.cs +++ b/OpenSim/Grid/AssetServer/AssetHttpServer.cs @@ -26,15 +26,10 @@ * */ using System; -using System.Collections.Generic; +using System.IO; using System.Net; using System.Text; using System.Text.RegularExpressions; -using System.Threading; -//using OpenSim.CAPS; -using Nwc.XmlRpc; -using System.Collections; -using OpenSim.Framework.Console; using OpenSim.Framework.Servers; namespace OpenSim.Grid.AssetServer @@ -69,9 +64,9 @@ namespace OpenSim.Grid.AssetServer response.KeepAlive = false; response.SendChunked = false; - System.IO.Stream body = request.InputStream; - System.Text.Encoding encoding = System.Text.Encoding.UTF8; - System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding); + Stream body = request.InputStream; + Encoding encoding = Encoding.UTF8; + StreamReader reader = new StreamReader(body, encoding); string requestBody = reader.ReadToEnd(); body.Close(); @@ -114,7 +109,7 @@ namespace OpenSim.Grid.AssetServer Encoding Windows1252Encoding = Encoding.GetEncoding(1252); byte[] buffer = Windows1252Encoding.GetBytes(responseString); - System.IO.Stream output = response.OutputStream; + Stream output = response.OutputStream; response.SendChunked = false; response.ContentLength64 = buffer.Length; output.Write(buffer, 0, buffer.Length); diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index d06998d..112d72f 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -29,20 +29,10 @@ using System; using System.IO; using System.Text; -using System.Timers; -using System.Net; -using System.Reflection; -using System.Threading; +using Db4objects.Db4o; using libsecondlife; -using OpenSim.Framework; -using OpenSim.Framework.Sims; using OpenSim.Framework.Console; using OpenSim.Framework.Types; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Servers; -using Db4objects.Db4o; -using Db4objects.Db4o.Query; namespace OpenSim.Grid.AssetServer { @@ -81,7 +71,7 @@ namespace OpenSim.Grid.AssetServer private OpenAsset_Main() { m_console = new LogBase("opengrid-AssetServer-console.log", "OpenAsset", this, false); - OpenSim.Framework.Console.MainLog.Instance = m_console; + MainLog.Instance = m_console; } public void Startup() @@ -161,17 +151,17 @@ namespace OpenSim.Grid.AssetServer public void setupDB() { - bool yapfile = System.IO.File.Exists("assets.yap"); + bool yapfile = File.Exists("assets.yap"); try { db = Db4oFactory.OpenFile("assets.yap"); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Main.cs:setupDB() - creation"); + MainLog.Instance.Verbose( "Main.cs:setupDB() - creation"); } catch (Exception e) { db.Close(); - OpenSim.Framework.Console.MainLog.Instance.Warn("Main.cs:setupDB() - Exception occured"); - OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + MainLog.Instance.Warn("Main.cs:setupDB() - Exception occured"); + MainLog.Instance.Warn(e.ToString()); } if (!yapfile) { @@ -273,7 +263,7 @@ namespace OpenSim.Grid.AssetServer { - string dataPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder; + string dataPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder; string fileName = Path.Combine(dataPath, filename); FileInfo fInfo = new FileInfo(fileName); long numBytes = fInfo.Length; diff --git a/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs index f9a18a8..dc39ce2 100644 --- a/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs @@ -26,9 +26,7 @@ * */ 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/Grid/Framework.Manager/GridManagementAgent.cs b/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs index 3f5d7dd..6c916a2 100644 --- a/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs +++ b/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs @@ -25,12 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using Nwc.XmlRpc; -using OpenSim.Framework; -using OpenSim.Framework.Servers; using System.Collections; -using System.Collections.Generic; using libsecondlife; +using Nwc.XmlRpc; +using OpenSim.Framework.Servers; namespace OpenSim.Framework.Manager { diff --git a/OpenSim/Grid/Framework.Manager/GridServerManager.cs b/OpenSim/Grid/Framework.Manager/GridServerManager.cs index d5eaf6f..67cd35d 100644 --- a/OpenSim/Grid/Framework.Manager/GridServerManager.cs +++ b/OpenSim/Grid/Framework.Manager/GridServerManager.cs @@ -28,10 +28,9 @@ using System; using System.Collections; -using System.Collections.Generic; -using Nwc.XmlRpc; using System.Threading; using libsecondlife; +using Nwc.XmlRpc; namespace OpenSim.Framework.Manager { diff --git a/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs b/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs index c9701d6..39c9e8f 100644 --- a/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs +++ b/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs @@ -26,9 +26,7 @@ * */ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - // Information about this assembly is defined by the following // attributes. // diff --git a/OpenSim/Grid/GridServer.Config/DbGridConfig.cs b/OpenSim/Grid/GridServer.Config/DbGridConfig.cs index 2218004..4acf81d 100644 --- a/OpenSim/Grid/GridServer.Config/DbGridConfig.cs +++ b/OpenSim/Grid/GridServer.Config/DbGridConfig.cs @@ -26,10 +26,9 @@ * */ using System; -using System.Collections.Generic; +using Db4objects.Db4o; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; -using Db4objects.Db4o; namespace OpenGrid.Config.GridConfigDb4o { @@ -44,7 +43,7 @@ namespace OpenGrid.Config.GridConfigDb4o /// A grid configuration object public GridConfig GetConfigObject() { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Loading Db40Config dll"); + MainLog.Instance.Verbose("Loading Db40Config dll"); return ( new DbGridConfig()); } } @@ -63,24 +62,24 @@ namespace OpenGrid.Config.GridConfigDb4o /// User configuration for the Grid Config interfaces /// public void LoadDefaults() { - OpenSim.Framework.Console.MainLog.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); + MainLog.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); // About the grid options - this.GridOwner = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid owner", "OGS development team"); + this.GridOwner = MainLog.Instance.CmdPrompt("Grid owner", "OGS development team"); // Asset Options - this.DefaultAssetServer = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default asset server","http://127.0.0.1:8003/"); - this.AssetSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to asset server","null"); - this.AssetRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from asset server","null"); + this.DefaultAssetServer = MainLog.Instance.CmdPrompt("Default asset server","http://127.0.0.1:8003/"); + this.AssetSendKey = MainLog.Instance.CmdPrompt("Key to send to asset server","null"); + this.AssetRecvKey = MainLog.Instance.CmdPrompt("Key to expect from asset server","null"); // User Server Options - this.DefaultUserServer = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default user server","http://127.0.0.1:8002/"); - this.UserSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to user server","null"); - this.UserRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from user server","null"); + this.DefaultUserServer = MainLog.Instance.CmdPrompt("Default user server","http://127.0.0.1:8002/"); + this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server","null"); + this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server","null"); // Region Server Options - this.SimSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to sims","null"); - this.SimRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from sims","null"); + this.SimSendKey = MainLog.Instance.CmdPrompt("Key to send to sims","null"); + this.SimRecvKey = MainLog.Instance.CmdPrompt("Key to expect from sims","null"); } /// @@ -95,7 +94,7 @@ namespace OpenGrid.Config.GridConfigDb4o IObjectSet result = db.Get(typeof(DbGridConfig)); // Found? if(result.Count==1) { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Found a GridConfig object in the local database, loading"); + MainLog.Instance.Verbose("Config.cs:InitConfig() - Found a GridConfig object in the local database, loading"); foreach (DbGridConfig cfg in result) { // Import each setting into this class // Grid Settings @@ -114,40 +113,40 @@ namespace OpenGrid.Config.GridConfigDb4o } // Create a new configuration object from this class } else { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); + MainLog.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); // Load default settings into this class LoadDefaults(); // Saves to the database file... - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Writing out default settings to local database"); + MainLog.Instance.Verbose( "Writing out default settings to local database"); db.Set(this); // Closes file locks db.Close(); } } catch(Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); - OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); + MainLog.Instance.Warn(e.ToString()); } // Grid Settings - OpenSim.Framework.Console.MainLog.Instance.Verbose("Grid settings loaded:"); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Grid owner: " + this.GridOwner); + MainLog.Instance.Verbose("Grid settings loaded:"); + MainLog.Instance.Verbose("Grid owner: " + this.GridOwner); // Asset Settings - OpenSim.Framework.Console.MainLog.Instance.Verbose("Default asset server: " + this.DefaultAssetServer); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to asset server: " + this.AssetSendKey); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from asset server: " + this.AssetRecvKey); + MainLog.Instance.Verbose("Default asset server: " + this.DefaultAssetServer); + MainLog.Instance.Verbose("Key to send to asset server: " + this.AssetSendKey); + MainLog.Instance.Verbose("Key to expect from asset server: " + this.AssetRecvKey); // User Settings - OpenSim.Framework.Console.MainLog.Instance.Verbose("Default user server: " + this.DefaultUserServer); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to user server: " + this.UserSendKey); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from user server: " + this.UserRecvKey); + MainLog.Instance.Verbose("Default user server: " + this.DefaultUserServer); + MainLog.Instance.Verbose("Key to send to user server: " + this.UserSendKey); + MainLog.Instance.Verbose("Key to expect from user server: " + this.UserRecvKey); // Region Settings - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to sims: " + this.SimSendKey); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from sims: " + this.SimRecvKey); + MainLog.Instance.Verbose("Key to send to sims: " + this.SimSendKey); + MainLog.Instance.Verbose("Key to expect from sims: " + this.SimRecvKey); } /// diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index e562721..7986591 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -28,15 +28,14 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Text; using System.Reflection; -using OpenSim.Framework.Data; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Console; -using OpenSim.Framework.Sims; +using System.Xml; using libsecondlife; using Nwc.XmlRpc; -using System.Xml; +using OpenSim.Framework.Console; +using OpenSim.Framework.Data; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Utilities; namespace OpenSim.Grid.GridServer { @@ -45,7 +44,7 @@ namespace OpenSim.Grid.GridServer Dictionary _plugins = new Dictionary(); Dictionary _logplugins = new Dictionary(); - public OpenSim.Framework.Interfaces.GridConfig config; + public GridConfig config; /// /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded. @@ -53,10 +52,10 @@ namespace OpenSim.Grid.GridServer /// The filename to the grid server plugin DLL public void AddPlugin(string FileName) { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Storage: Attempting to load " + FileName); + MainLog.Instance.Verbose("Storage: Attempting to load " + FileName); Assembly pluginAssembly = Assembly.LoadFrom(FileName); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); + MainLog.Instance.Verbose("Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); foreach (Type pluginType in pluginAssembly.GetTypes()) { if (!pluginType.IsAbstract) @@ -69,7 +68,7 @@ namespace OpenSim.Grid.GridServer IGridData plug = (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); plug.Initialise(); this._plugins.Add(plug.getName(), plug); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Storage: Added IGridData Interface"); + MainLog.Instance.Verbose("Storage: Added IGridData Interface"); } typeInterface = null; @@ -82,7 +81,7 @@ namespace OpenSim.Grid.GridServer ILogData plug = (ILogData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); plug.Initialise(); this._logplugins.Add(plug.getName(), plug); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Storage: Added ILogData Interface"); + MainLog.Instance.Verbose( "Storage: Added ILogData Interface"); } typeInterface = null; @@ -110,7 +109,7 @@ namespace OpenSim.Grid.GridServer } catch (Exception) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: unable to write log via " + kvp.Key); + MainLog.Instance.Warn("Storage: unable to write log via " + kvp.Key); } } } @@ -120,7 +119,7 @@ namespace OpenSim.Grid.GridServer /// /// A UUID key of the region to return /// A SimProfileData for the region - public SimProfileData getRegion(libsecondlife.LLUUID uuid) + public SimProfileData getRegion(LLUUID uuid) { foreach(KeyValuePair kvp in _plugins) { try @@ -129,7 +128,7 @@ namespace OpenSim.Grid.GridServer } catch (Exception) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key); + MainLog.Instance.Warn("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key); } } return null; @@ -150,7 +149,7 @@ namespace OpenSim.Grid.GridServer } catch { - OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key); + MainLog.Instance.Warn("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key); } } return null; @@ -174,7 +173,7 @@ namespace OpenSim.Grid.GridServer } catch { - OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to query regionblock via " + kvp.Key); + MainLog.Instance.Warn("Storage: Unable to query regionblock via " + kvp.Key); } } @@ -370,7 +369,7 @@ namespace OpenSim.Grid.GridServer simProfileList.Add(simProfileBlock); } - OpenSim.Framework.Console.MainLog.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via FastMode"); + MainLog.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via FastMode"); } else { @@ -403,7 +402,7 @@ namespace OpenSim.Grid.GridServer } } } - OpenSim.Framework.Console.MainLog.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via Standard Mode"); + MainLog.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via Standard Mode"); } responseData["sim-profiles"] = simProfileList; @@ -565,7 +564,7 @@ namespace OpenSim.Grid.GridServer try { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Updating / adding via " + _plugins.Count + " storage provider(s) registered."); + MainLog.Instance.Verbose("Updating / adding via " + _plugins.Count + " storage provider(s) registered."); foreach (KeyValuePair kvp in _plugins) { try @@ -575,7 +574,7 @@ namespace OpenSim.Grid.GridServer if ((reserveData != null && reserveData.gridRecvKey == TheSim.regionRecvKey) || (reserveData == null)) { kvp.Value.AddProfile(TheSim); - OpenSim.Framework.Console.MainLog.Instance.Verbose("New sim added to grid (" + TheSim.regionName + ")"); + MainLog.Instance.Verbose("New sim added to grid (" + TheSim.regionName + ")"); logToDB(TheSim.UUID.ToStringHyphenated(), "RestSetSimMethod", "", 5, "Region successfully updated and connected to grid."); } else @@ -585,7 +584,7 @@ namespace OpenSim.Grid.GridServer } catch (Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Verbose("getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + e.ToString()); + MainLog.Instance.Verbose("getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + e.ToString()); } } return "OK"; diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 490f757..20c4905 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -27,20 +27,14 @@ */ using System; -using System.IO; -using System.Text; -using System.Timers; -using System.Net; -using System.Threading; using System.Reflection; -using libsecondlife; -using OpenSim.Framework.Manager; -using OpenSim.Framework; -using OpenSim.Framework.Sims; +using System.Threading; +using System.Timers; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Servers; using OpenSim.GenericConfig; +using Timer=System.Timers.Timer; namespace OpenSim.Grid.GridServer { @@ -156,7 +150,7 @@ namespace OpenSim.Grid.GridServer m_console.Verbose( "Main.cs:Startup() - Starting sim status checker"); - System.Timers.Timer simCheckTimer = new System.Timers.Timer(3600000 * 3); // 3 Hours between updates. + Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates. simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); simCheckTimer.Enabled = true; } diff --git a/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs index 303dddf..62a68a8 100644 --- a/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs @@ -26,9 +26,7 @@ * */ 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/Grid/UserServer.Config/AssemblyInfo.cs b/OpenSim/Grid/UserServer.Config/AssemblyInfo.cs index 25e0211..15298e8 100644 --- a/OpenSim/Grid/UserServer.Config/AssemblyInfo.cs +++ b/OpenSim/Grid/UserServer.Config/AssemblyInfo.cs @@ -26,9 +26,7 @@ * */ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - // Information about this assembly is defined by the following // attributes. // diff --git a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs index 770a6b9..c7f8255 100644 --- a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs +++ b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs @@ -26,10 +26,9 @@ * */ using System; -using System.Collections.Generic; +using Db4objects.Db4o; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; -using Db4objects.Db4o; namespace OpenUser.Config.UserConfigDb4o { @@ -37,7 +36,7 @@ namespace OpenUser.Config.UserConfigDb4o { public UserConfig GetConfigObject() { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Loading Db40Config dll"); + MainLog.Instance.Verbose("Loading Db40Config dll"); return ( new DbUserConfig()); } } @@ -47,13 +46,13 @@ namespace OpenUser.Config.UserConfigDb4o private IObjectContainer db; public void LoadDefaults() { - OpenSim.Framework.Console.MainLog.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); + MainLog.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); - this.DefaultStartupMsg = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); + this.DefaultStartupMsg = MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); - this.GridServerURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/"); - this.GridSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to grid server","null"); - this.GridRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from grid server","null"); + this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/"); + this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server","null"); + this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server","null"); } public override void InitConfig() { @@ -61,7 +60,7 @@ namespace OpenUser.Config.UserConfigDb4o db = Db4oFactory.OpenFile("openuser.yap"); IObjectSet result = db.Get(typeof(DbUserConfig)); if(result.Count==1) { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Found a UserConfig object in the local database, loading"); + MainLog.Instance.Verbose("Config.cs:InitConfig() - Found a UserConfig object in the local database, loading"); foreach (DbUserConfig cfg in result) { this.GridServerURL=cfg.GridServerURL; this.GridSendKey=cfg.GridSendKey; @@ -69,22 +68,22 @@ namespace OpenUser.Config.UserConfigDb4o this.DefaultStartupMsg=cfg.DefaultStartupMsg; } } else { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); + MainLog.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); LoadDefaults(); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Writing out default settings to local database"); + MainLog.Instance.Verbose("Writing out default settings to local database"); db.Set(this); db.Close(); } } catch(Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); - OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); + MainLog.Instance.Warn(e.ToString()); } - OpenSim.Framework.Console.MainLog.Instance.Verbose("User settings loaded:"); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Default startup message: " + this.DefaultStartupMsg); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Grid server URL: " + this.GridServerURL); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to grid: " + this.GridSendKey); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from grid: " + this.GridRecvKey); + MainLog.Instance.Verbose("User settings loaded:"); + MainLog.Instance.Verbose("Default startup message: " + this.DefaultStartupMsg); + MainLog.Instance.Verbose("Grid server URL: " + this.GridServerURL); + MainLog.Instance.Verbose("Key to send to grid: " + this.GridSendKey); + MainLog.Instance.Verbose("Key to expect from grid: " + this.GridRecvKey); } diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index c65bb97..5560e7d 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -27,18 +27,13 @@ */ using System; -using System.Collections; using System.Collections.Generic; using System.Reflection; -using System.IO; -using System.Text; using libsecondlife; -using OpenSim.Framework.User; -using OpenSim.Framework.Sims; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Interfaces; using OpenSim.Framework.Console; +using OpenSim.Framework.Interfaces; using OpenSim.Framework.Servers; +using OpenSim.Framework.User; using OpenSim.Framework.Utilities; using OpenSim.GenericConfig; @@ -73,7 +68,7 @@ namespace OpenSim.Grid.UserServer private OpenUser_Main() { m_console = new LogBase("opengrid-userserver-console.log", "OpenUser", this , false); - OpenSim.Framework.Console.MainLog.Instance = m_console; + MainLog.Instance = m_console; } private void Work() @@ -93,16 +88,16 @@ namespace OpenSim.Grid.UserServer this.ConfigDB(this.localXMLConfig); this.localXMLConfig.Close(); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Loading configuration"); + MainLog.Instance.Verbose("Main.cs:Startup() - Loading configuration"); Cfg = this.LoadConfigDll(this.ConfigDll); Cfg.InitConfig(); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Establishing data connection"); + MainLog.Instance.Verbose("Main.cs:Startup() - Establishing data connection"); m_userManager = new UserManager(); m_userManager._config = Cfg; m_userManager.AddPlugin(StorageDll); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Starting HTTP process"); + MainLog.Instance.Verbose("Main.cs:Startup() - Starting HTTP process"); BaseHttpServer httpServer = new BaseHttpServer(8002); httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod); diff --git a/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs index 5d5ce8d..a0a6f3c 100644 --- a/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/UserServer/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/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index a3e3322..4610a9d 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -27,22 +27,11 @@ */ using System; using System.Collections; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Data; -using libsecondlife; -using System.Reflection; - -using System.Xml; using Nwc.XmlRpc; +using OpenSim.Framework.Data; using OpenSim.Framework.Sims; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; - using OpenSim.Framework.UserManagement; -using System.Security.Cryptography; - namespace OpenSim.Grid.UserServer { public class UserManager : UserManagerBase -- 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/Grid/GridServer/GridManager.cs | 177 +++++++++++++++++++++------------ OpenSim/Grid/GridServer/Main.cs | 2 +- 2 files changed, 113 insertions(+), 66 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 7986591..824a39e 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -180,6 +180,8 @@ namespace OpenSim.Grid.GridServer return regions; } + + /// /// Returns a XML String containing a list of the neighbouring regions /// @@ -213,8 +215,10 @@ namespace OpenSim.Grid.GridServer /// /// The XMLRPC Request /// Startup parameters - public XmlRpcResponse XmlRpcLoginToSimulatorMethod(XmlRpcRequest request) + public XmlRpcResponse XmlRpcSimulatorLoginMethod(XmlRpcRequest request) { + Console.WriteLine("XMLRPC SIMULATOR LOGIN METHOD CALLED"); + XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); response.Value = responseData; @@ -222,16 +226,18 @@ namespace OpenSim.Grid.GridServer SimProfileData TheSim = null; Hashtable requestData = (Hashtable)request.Params[0]; - Console.WriteLine("WOOT: " + requestData.ToString()); + Console.WriteLine(requestData.ToString()); if (requestData.ContainsKey("UUID")) { + Console.WriteLine("...VIA UUID"); TheSim = getRegion(new LLUUID((string)requestData["UUID"])); - logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcLoginToSimulatorMethod","", 5,"Region attempting login with UUID."); + logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcSimulatorLoginMethod","", 5,"Region attempting login with UUID."); } else if (requestData.ContainsKey("region_handle")) { + TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"])); - logToDB((string)requestData["region_handle"], "XmlRpcLoginToSimulatorMethod", "", 5, "Region attempting login with regionHandle."); + logToDB((string)requestData["region_handle"], "XmlRpcSimulatorLoginMethod", "", 5, "Region attempting login with regionHandle."); } else { @@ -241,78 +247,119 @@ namespace OpenSim.Grid.GridServer if (TheSim == null) { - responseData["error"] = "sim not found"; - return response; - } - else - { - - ArrayList SimNeighboursData = new ArrayList(); - - SimProfileData neighbour; - Hashtable NeighbourBlock; + //NEW REGION + Console.WriteLine("THIS IS A NEW REGION...ADDING"); + TheSim = new SimProfileData(); - bool fastMode = false; // Only compatible with MySQL right now + TheSim.regionRecvKey = config.SimRecvKey; + TheSim.regionSendKey = config.SimSendKey; + TheSim.regionSecret = config.SimRecvKey; + TheSim.regionDataURI = ""; + TheSim.regionAssetURI = config.DefaultAssetServer; + TheSim.regionAssetRecvKey = config.AssetRecvKey; + TheSim.regionAssetSendKey = config.AssetSendKey; + TheSim.regionUserURI = config.DefaultUserServer; + TheSim.regionUserSendKey = config.UserSendKey; + TheSim.regionUserRecvKey = config.UserRecvKey; + + TheSim.serverIP = (string)requestData["sim_ip"]; + TheSim.serverPort = Convert.ToUInt32((string)requestData["sim_port"]); + TheSim.regionLocX = Convert.ToUInt32((string)requestData["region_locx"]); + TheSim.regionLocY = Convert.ToUInt32((string)requestData["region_locy"]); + TheSim.regionLocZ = 0; + + TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256)); + TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; + + TheSim.regionName = (string)requestData["sim_name"]; - if (fastMode) + foreach (KeyValuePair kvp in _plugins) { - Dictionary neighbours = getRegions(TheSim.regionLocX - 1, TheSim.regionLocY - 1, TheSim.regionLocX + 1, TheSim.regionLocY + 1); - - foreach (KeyValuePair aSim in neighbours) + try + { + Console.WriteLine("ADDED");kvp.Value.AddProfile(TheSim); + } + catch (Exception) { - NeighbourBlock = new Hashtable(); - NeighbourBlock["sim_ip"] = aSim.Value.serverIP.ToString(); - NeighbourBlock["sim_port"] = aSim.Value.serverPort.ToString(); - NeighbourBlock["region_locx"] = aSim.Value.regionLocX.ToString(); - NeighbourBlock["region_locy"] = aSim.Value.regionLocY.ToString(); - NeighbourBlock["UUID"] = aSim.Value.UUID.ToString(); - - if (aSim.Value.UUID != TheSim.UUID) - SimNeighboursData.Add(NeighbourBlock); + OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to add region " + TheSim.UUID.ToStringHyphenated() + " via " + kvp.Key); } } - else + + + if (getRegion(TheSim.regionHandle) == null) { - for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++) - { - if (getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)) != null) - { - neighbour = getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)); - - NeighbourBlock = new Hashtable(); - NeighbourBlock["sim_ip"] = neighbour.serverIP; - NeighbourBlock["sim_port"] = neighbour.serverPort.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["error"] = "Unable to add new region"; + return response; } + } + - 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.serverIP; - responseData["sim_port"] = TheSim.serverPort.ToString(); - responseData["asset_url"] = TheSim.regionAssetURI; - responseData["asset_sendkey"] = TheSim.regionAssetSendKey; - responseData["asset_recvkey"] = TheSim.regionAssetRecvKey; - responseData["user_url"] = TheSim.regionUserURI; - responseData["user_sendkey"] = TheSim.regionUserSendKey; - responseData["user_recvkey"] = TheSim.regionUserRecvKey; - responseData["authkey"] = TheSim.regionSecret; - - // New! If set, use as URL to local sim storage (ie http://remotehost/region.yap) - responseData["data_uri"] = TheSim.regionDataURI; + ArrayList SimNeighboursData = new ArrayList(); + + SimProfileData neighbour; + Hashtable NeighbourBlock; + + bool fastMode = false; // Only compatible with MySQL right now + + if (fastMode) + { + Dictionary neighbours = getRegions(TheSim.regionLocX - 1, TheSim.regionLocY - 1, TheSim.regionLocX + 1, TheSim.regionLocY + 1); + + foreach (KeyValuePair aSim in neighbours) + { + NeighbourBlock = new Hashtable(); + NeighbourBlock["sim_ip"] = aSim.Value.serverIP.ToString(); + NeighbourBlock["sim_port"] = aSim.Value.serverPort.ToString(); + NeighbourBlock["region_locx"] = aSim.Value.regionLocX.ToString(); + NeighbourBlock["region_locy"] = aSim.Value.regionLocY.ToString(); + NeighbourBlock["UUID"] = aSim.Value.UUID.ToString(); + + if (aSim.Value.UUID != TheSim.UUID) + SimNeighboursData.Add(NeighbourBlock); + } } + else + { + for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++) + { + if (getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)) != null) + { + neighbour = getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)); - return response; + NeighbourBlock = new Hashtable(); + NeighbourBlock["sim_ip"] = neighbour.serverIP; + NeighbourBlock["sim_port"] = neighbour.serverPort.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.serverIP; + responseData["sim_port"] = TheSim.serverPort.ToString(); + responseData["asset_url"] = TheSim.regionAssetURI; + responseData["asset_sendkey"] = TheSim.regionAssetSendKey; + responseData["asset_recvkey"] = TheSim.regionAssetRecvKey; + responseData["user_url"] = TheSim.regionUserURI; + responseData["user_sendkey"] = TheSim.regionUserSendKey; + responseData["user_recvkey"] = TheSim.regionUserRecvKey; + responseData["authkey"] = TheSim.regionSecret; + + // New! If set, use as URL to local sim storage (ie http://remotehost/region.yap) + responseData["data_uri"] = TheSim.regionDataURI; + + + return response; } public XmlRpcResponse XmlRpcMapBlockMethod(XmlRpcRequest request) diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 20c4905..509549e 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -123,7 +123,7 @@ namespace OpenSim.Grid.GridServer BaseHttpServer httpServer = new BaseHttpServer(8001); //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); - httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcLoginToSimulatorMethod); + httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod); httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod); httpServer.AddRestHandler("GET", "/sims/", m_gridManager.RestGetSimMethod); -- 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! --- OpenSim/Grid/GridServer/GridManager.cs | 21 +++++++++++++++++---- OpenSim/Grid/GridServer/Main.cs | 13 +++++++------ OpenSim/Grid/UserServer.Config/DbUserConfig.cs | 2 +- 3 files changed, 25 insertions(+), 11 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 824a39e..816c9fd 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -217,7 +217,6 @@ namespace OpenSim.Grid.GridServer /// Startup parameters public XmlRpcResponse XmlRpcSimulatorLoginMethod(XmlRpcRequest request) { - Console.WriteLine("XMLRPC SIMULATOR LOGIN METHOD CALLED"); XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -229,7 +228,6 @@ namespace OpenSim.Grid.GridServer Console.WriteLine(requestData.ToString()); if (requestData.ContainsKey("UUID")) { - Console.WriteLine("...VIA UUID"); TheSim = getRegion(new LLUUID((string)requestData["UUID"])); logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcSimulatorLoginMethod","", 5,"Region attempting login with UUID."); } @@ -248,7 +246,6 @@ namespace OpenSim.Grid.GridServer if (TheSim == null) { //NEW REGION - Console.WriteLine("THIS IS A NEW REGION...ADDING"); TheSim = new SimProfileData(); TheSim.regionRecvKey = config.SimRecvKey; @@ -277,7 +274,23 @@ namespace OpenSim.Grid.GridServer { try { - Console.WriteLine("ADDED");kvp.Value.AddProfile(TheSim); + DataResponse insertResponse = kvp.Value.AddProfile(TheSim); + switch(insertResponse) + { + case DataResponse.RESPONSE_OK: + Console.WriteLine("New sim creation successful: " + TheSim.regionName); + break; + case DataResponse.RESPONSE_ERROR: + Console.WriteLine("New sim creation failed (Error): " + TheSim.regionName); + break; + case DataResponse.RESPONSE_INVALIDCREDENTIALS: + Console.WriteLine("New sim creation failed (Invalid Credentials): " + TheSim.regionName); + break; + case DataResponse.RESPONSE_AUTHREQUIRED: + Console.WriteLine("New sim creation failed (Authentication Required): " + TheSim.regionName); + break; + } + } catch (Exception) { diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 509549e..404c252 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -76,10 +76,11 @@ namespace OpenSim.Grid.GridServer private void Work() { + m_console.Notice("Enter help for a list of commands\n"); + while (true) { - Thread.Sleep(5000); - // should flush the DB etc here + m_console.MainLogPrompt(); } } @@ -120,7 +121,7 @@ namespace OpenSim.Grid.GridServer m_gridManager.config = Cfg; m_console.Verbose( "Main.cs:Startup() - Starting HTTP process"); - BaseHttpServer httpServer = new BaseHttpServer(8001); + BaseHttpServer httpServer = new BaseHttpServer(13801); //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod); @@ -142,9 +143,9 @@ namespace OpenSim.Grid.GridServer //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/"); + //Listener.Prefixes.Add("http://+:13801/gods/"); + //Listener.Prefixes.Add("http://+:13801/highestuuid/"); + //Listener.Prefixes.Add("http://+:13801/uuidblocks/"); httpServer.Start(); diff --git a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs index c7f8255..f57ac52 100644 --- a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs +++ b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs @@ -50,7 +50,7 @@ namespace OpenUser.Config.UserConfigDb4o this.DefaultStartupMsg = MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); - this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/"); + this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:13801/"); this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server","null"); this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server","null"); } -- cgit v1.1 From 78e420f48bc8ce79f45c5a90d8ebb4004d7993e7 Mon Sep 17 00:00:00 2001 From: mingchen Date: Tue, 3 Jul 2007 19:26:35 +0000 Subject: *Fixed storage issue as noted in last commit of the OGS1 GridServer *Reverted the default remote grid server port back to 8001 (from a port change to debug a previous issue) --- OpenSim/Grid/GridServer/GridManager.cs | 7 ++++--- OpenSim/Grid/GridServer/Main.cs | 8 ++++---- OpenSim/Grid/UserServer.Config/DbUserConfig.cs | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 816c9fd..4c60852 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -126,9 +126,9 @@ namespace OpenSim.Grid.GridServer { return kvp.Value.GetProfileByLLUUID(uuid); } - catch (Exception) + catch (Exception e) { - MainLog.Instance.Warn("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key); + MainLog.Instance.Warn("Message from Storage: " + e.Message); } } return null; @@ -225,10 +225,10 @@ namespace OpenSim.Grid.GridServer SimProfileData TheSim = null; Hashtable requestData = (Hashtable)request.Params[0]; - Console.WriteLine(requestData.ToString()); if (requestData.ContainsKey("UUID")) { TheSim = getRegion(new LLUUID((string)requestData["UUID"])); + logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcSimulatorLoginMethod","", 5,"Region attempting login with UUID."); } else if (requestData.ContainsKey("region_handle")) @@ -269,6 +269,7 @@ namespace OpenSim.Grid.GridServer TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; TheSim.regionName = (string)requestData["sim_name"]; + TheSim.UUID = new LLUUID((string)requestData["UUID"]); foreach (KeyValuePair kvp in _plugins) { diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 404c252..2e76cee 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -121,7 +121,7 @@ namespace OpenSim.Grid.GridServer m_gridManager.config = Cfg; m_console.Verbose( "Main.cs:Startup() - Starting HTTP process"); - BaseHttpServer httpServer = new BaseHttpServer(13801); + BaseHttpServer httpServer = new BaseHttpServer(8001); //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod); @@ -143,9 +143,9 @@ namespace OpenSim.Grid.GridServer //break; // lbsa71 : I guess these were never used? - //Listener.Prefixes.Add("http://+:13801/gods/"); - //Listener.Prefixes.Add("http://+:13801/highestuuid/"); - //Listener.Prefixes.Add("http://+:13801/uuidblocks/"); + //Listener.Prefixes.Add("http://+:8001/gods/"); + //Listener.Prefixes.Add("http://+:8001/highestuuid/"); + //Listener.Prefixes.Add("http://+:8001/uuidblocks/"); httpServer.Start(); diff --git a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs index f57ac52..c7f8255 100644 --- a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs +++ b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs @@ -50,7 +50,7 @@ namespace OpenUser.Config.UserConfigDb4o this.DefaultStartupMsg = MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); - this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:13801/"); + this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/"); this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server","null"); this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server","null"); } -- 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/Grid/GridServer/GridManager.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 4c60852..1e457b3 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -243,7 +243,7 @@ namespace OpenSim.Grid.GridServer return response; } - if (TheSim == null) + if (TheSim == null) // Shouldnt this be in the REST Simulator Set method? { //NEW REGION TheSim = new SimProfileData(); @@ -279,21 +279,21 @@ namespace OpenSim.Grid.GridServer switch(insertResponse) { case DataResponse.RESPONSE_OK: - Console.WriteLine("New sim creation successful: " + TheSim.regionName); + OpenSim.Framework.Console.MainLog.Instance.Verbose("New sim creation successful: " + TheSim.regionName); break; case DataResponse.RESPONSE_ERROR: - Console.WriteLine("New sim creation failed (Error): " + TheSim.regionName); + OpenSim.Framework.Console.MainLog.Instance.Warn("New sim creation failed (Error): " + TheSim.regionName); break; case DataResponse.RESPONSE_INVALIDCREDENTIALS: - Console.WriteLine("New sim creation failed (Invalid Credentials): " + TheSim.regionName); + OpenSim.Framework.Console.MainLog.Instance.Warn("New sim creation failed (Invalid Credentials): " + TheSim.regionName); break; case DataResponse.RESPONSE_AUTHREQUIRED: - Console.WriteLine("New sim creation failed (Authentication Required): " + TheSim.regionName); + OpenSim.Framework.Console.MainLog.Instance.Warn("New sim creation failed (Authentication Required): " + TheSim.regionName); break; } } - catch (Exception) + catch (Exception e) { OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to add region " + TheSim.UUID.ToStringHyphenated() + " via " + kvp.Key); } @@ -541,7 +541,7 @@ namespace OpenSim.Grid.GridServer /// "OK" or an error public string RestSetSimMethod(string request, string path, string param) { - Console.WriteLine("Processing region update"); + Console.WriteLine("Processing region update via REST method"); SimProfileData TheSim; TheSim = getRegion(new LLUUID(param)); if ((TheSim) == null) @@ -569,6 +569,7 @@ namespace OpenSim.Grid.GridServer if (authkeynode.InnerText != TheSim.regionRecvKey) { + MainLog.Instance.Warn("Invalid Key Attempt on region update"); return "ERROR! invalid key"; } @@ -640,6 +641,7 @@ namespace OpenSim.Grid.GridServer } else { + MainLog.Instance.Warn("Unable to update region (RestSetSimMethod): Incorrect reservation auth key.");// Wanted: " + reserveData.gridRecvKey + ", Got: " + TheSim.regionRecvKey + "."); return "Unable to update region (RestSetSimMethod): Incorrect auth key."; } } -- cgit v1.1 From 6a2588454a1ac4bb484ad0b9ee648e9ac156f8db Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 4 Jul 2007 14:12:32 +0000 Subject: * Removed AssetHttpServer, using BaseHttpServer instead * Removed legacy REST handling * Created two custom IStreamHandlers for asset up/download * Removed quite a lot of double and triple encodings, trying to work towards binary only and direct write into storage. * Introduced BaseStreamHandler with GetParam() and some other goodies --- OpenSim/Grid/AssetServer/AssetHttpServer.cs | 125 --------------- OpenSim/Grid/AssetServer/Main.cs | 169 +++++++++++++++------ .../AssetServer/OpenSim.Grid.AssetServer.csproj | 3 - .../AssetServer/OpenSim.Grid.AssetServer.exe.build | 1 - OpenSim/Grid/GridServer/Main.cs | 29 ++-- OpenSim/Grid/UserServer/Main.cs | 4 +- 6 files changed, 136 insertions(+), 195 deletions(-) delete mode 100644 OpenSim/Grid/AssetServer/AssetHttpServer.cs (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/AssetHttpServer.cs b/OpenSim/Grid/AssetServer/AssetHttpServer.cs deleted file mode 100644 index 9546891..0000000 --- a/OpenSim/Grid/AssetServer/AssetHttpServer.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* -* 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.IO; -using System.Net; -using System.Text; -using System.Text.RegularExpressions; -using OpenSim.Framework.Servers; - -namespace OpenSim.Grid.AssetServer -{ - /// - /// An HTTP server for sending assets - /// - public class AssetHttpServer :BaseHttpServer - { - /// - /// Creates the new asset server - /// - /// Port to initalise on - public AssetHttpServer(int port) - : base(port) - { - } - - /// - /// Handles an HTTP request - /// - /// HTTP State Info - public override void HandleRequest(Object stateinfo) - { - try - { - HttpListenerContext context = (HttpListenerContext)stateinfo; - - HttpListenerRequest request = context.Request; - HttpListenerResponse response = context.Response; - - response.KeepAlive = false; - response.SendChunked = false; - - Stream body = request.InputStream; - Encoding encoding = Encoding.UTF8; - StreamReader reader = new StreamReader(body, encoding); - - string requestBody = reader.ReadToEnd(); - body.Close(); - reader.Close(); - - //Console.WriteLine(request.HttpMethod + " " + request.RawUrl + " Http/" + request.ProtocolVersion.ToString() + " content type: " + request.ContentType); - //Console.WriteLine(requestBody); - - string responseString = ""; - switch (request.ContentType) - { - case "text/xml": - // must be XML-RPC, so pass to the XML-RPC parser - - responseString = ParseXMLRPC(requestBody); - responseString = Regex.Replace(responseString, "utf-16", "utf-8"); - - response.AddHeader("Content-type", "text/xml"); - break; - - case "application/xml": - // probably LLSD we hope, otherwise it should be ignored by the parser - responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); - response.AddHeader("Content-type", "application/xml"); - break; - - case "application/x-www-form-urlencoded": - // a form data POST so send to the REST parser - responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); - response.AddHeader("Content-type", "text/plain"); - break; - - case null: - // must be REST or invalid crap, so pass to the REST parser - responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); - response.AddHeader("Content-type", "text/plain"); - break; - - } - - Encoding Windows1252Encoding = Encoding.GetEncoding(1252); - byte[] buffer = Windows1252Encoding.GetBytes(responseString); - Stream output = response.OutputStream; - response.SendChunked = false; - response.ContentLength64 = buffer.Length; - output.Write(buffer, 0, buffer.Length); - output.Close(); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - } - - } -} diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 112d72f..3e302d8 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -33,13 +33,14 @@ using Db4objects.Db4o; using libsecondlife; using OpenSim.Framework.Console; using OpenSim.Framework.Types; +using OpenSim.Framework.Servers; namespace OpenSim.Grid.AssetServer { /// /// An asset server /// - public class OpenAsset_Main : conscmd_callback + public class OpenAsset_Main : conscmd_callback { private IObjectContainer db; @@ -76,58 +77,60 @@ namespace OpenSim.Grid.AssetServer public void Startup() { - m_console.Verbose( "Main.cs:Startup() - Setting up asset DB"); + m_console.Verbose("Main.cs:Startup() - Setting up asset DB"); setupDB(); - m_console.Verbose( "Main.cs:Startup() - Starting HTTP process"); - AssetHttpServer httpServer = new AssetHttpServer(8003); + m_console.Verbose("Main.cs:Startup() - Starting HTTP process"); + BaseHttpServer httpServer = new BaseHttpServer(8003); + httpServer.AddStreamHandler( new GetAssetStreamHandler(this)); + httpServer.AddStreamHandler(new PostAssetStreamHandler( this )); - httpServer.AddRestHandler("GET", "/assets/", this.assetGetMethod); - httpServer.AddRestHandler("POST", "/assets/", this.assetPostMethod); + //httpServer.AddRestHandler("GET", "/assets/", this.assetGetMethod); + //httpServer.AddRestHandler("POST", "/assets/", this.assetPostMethod); httpServer.Start(); } - public string assetPostMethod(string requestBody, string path, string param) - { - AssetBase asset = new AssetBase(); - asset.Name = ""; - asset.FullID = new LLUUID(param); - Encoding Windows1252Encoding = Encoding.GetEncoding(1252); - byte[] buffer = Windows1252Encoding.GetBytes(requestBody); - asset.Data = buffer; - AssetStorage store = new AssetStorage(); - store.Data = asset.Data; - store.Name = asset.Name; - store.UUID = asset.FullID; - db.Set(store); - db.Commit(); - return ""; - } - - public string assetGetMethod(string request, string path, string param) - { - Console.WriteLine("got a request " + param); - byte[] assetdata = getAssetData(new LLUUID(param), false); - if (assetdata != null) - { - Encoding Windows1252Encoding = Encoding.GetEncoding(1252); - string ret = Windows1252Encoding.GetString(assetdata); - //string ret = System.Text.Encoding.Unicode.GetString(assetdata); - - return ret; - - } - else - { - return ""; - } - - } - - public byte[] getAssetData(LLUUID assetID, bool isTexture) + //public string AssetPostMethod(string requestBody, string path, string param) + //{ + // AssetBase asset = new AssetBase(); + // asset.Name = ""; + // asset.FullID = new LLUUID(param); + // Encoding Windows1252Encoding = Encoding.GetEncoding(1252); + // byte[] buffer = Windows1252Encoding.GetBytes(requestBody); + // asset.Data = buffer; + // AssetStorage store = new AssetStorage(); + // store.Data = asset.Data; + // store.Name = asset.Name; + // store.UUID = asset.FullID; + // db.Set(store); + // db.Commit(); + // return ""; + //} + + //public string AssetGetMethod(string request, string path, string param) + //{ + // Console.WriteLine("got a request " + param); + // byte[] assetdata = GetAssetData(new LLUUID(param), false); + // if (assetdata != null) + // { + // Encoding Windows1252Encoding = Encoding.GetEncoding(1252); + // string ret = Windows1252Encoding.GetString(assetdata); + // //string ret = System.Text.Encoding.Unicode.GetString(assetdata); + + // return ret; + + // } + // else + // { + // return ""; + // } + + //} + + public byte[] GetAssetData(LLUUID assetID, bool isTexture) { bool found = false; AssetStorage foundAsset = null; @@ -155,7 +158,7 @@ namespace OpenSim.Grid.AssetServer try { db = Db4oFactory.OpenFile("assets.yap"); - MainLog.Instance.Verbose( "Main.cs:setupDB() - creation"); + MainLog.Instance.Verbose("Main.cs:setupDB() - creation"); } catch (Exception e) { @@ -305,6 +308,21 @@ namespace OpenSim.Grid.AssetServer return config; }*/ + public void CreateAsset(LLUUID assetId, byte[] assetData) + { + AssetBase asset = new AssetBase(); + asset.Name = ""; + asset.FullID = assetId; + asset.Data = assetData; + + AssetStorage store = new AssetStorage(); + store.Data = asset.Data; + store.Name = asset.Name; + store.UUID = asset.FullID; + db.Set(store); + db.Commit(); + } + public void RunCmd(string cmd, string[] cmdparams) { switch (cmd) @@ -324,4 +342,65 @@ namespace OpenSim.Grid.AssetServer { } } + + public class GetAssetStreamHandler : BaseStreamHandler + { + OpenAsset_Main m_assetManager; + + override public byte[] Handle(string path, Stream request) + { + string param = GetParam(path); + + byte[] assetdata = m_assetManager.GetAssetData(new LLUUID(param), false); + if (assetdata != null) + { + return assetdata; + } + else + { + return new byte[]{}; + } + } + + public GetAssetStreamHandler(OpenAsset_Main assetManager):base( "/assets/", "GET") + { + m_assetManager = assetManager; + } + } + + public class PostAssetStreamHandler : BaseStreamHandler + { + OpenAsset_Main m_assetManager; + + override public byte[] Handle(string path, Stream request) + { + string param = GetParam(path); + LLUUID assetId = new LLUUID(param); + byte[] txBuffer = new byte[4096]; + + using( BinaryReader binReader = new BinaryReader( request ) ) + { + using (MemoryStream memoryStream = new MemoryStream(4096)) + { + int count; + while ((count = binReader.Read(txBuffer, 0, 4096)) > 0) + { + memoryStream.Write(txBuffer, 0, count); + } + + byte[] assetData = memoryStream.ToArray(); + + m_assetManager.CreateAsset(assetId, assetData); + } + } + + return new byte[]{}; + } + + public PostAssetStreamHandler( OpenAsset_Main assetManager ) + : base("/assets/", "POST") + { + m_assetManager = assetManager; + } + } } diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj index caebca3..5ba4642 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj @@ -98,9 +98,6 @@ - - Code - Code diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build index 88724f6..a922fe7 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build @@ -11,7 +11,6 @@ - diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 2e76cee..a990ff7 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -127,25 +127,16 @@ namespace OpenSim.Grid.GridServer httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod); httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod); - httpServer.AddRestHandler("GET", "/sims/", m_gridManager.RestGetSimMethod); - httpServer.AddRestHandler("POST", "/sims/", m_gridManager.RestSetSimMethod); - httpServer.AddRestHandler("GET", "/regions/", m_gridManager.RestGetRegionMethod); - httpServer.AddRestHandler("POST", "/regions/", m_gridManager.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.Notice("/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.AddStreamHandler(new RestStreamHandler("GET", "/sims/", m_gridManager.RestGetSimMethod )); + httpServer.AddStreamHandler(new RestStreamHandler("POST", "/sims/", m_gridManager.RestSetSimMethod )); + + httpServer.AddStreamHandler( new RestStreamHandler("GET", "/regions/", m_gridManager.RestGetRegionMethod )); + httpServer.AddStreamHandler( new RestStreamHandler("POST","/regions/", m_gridManager.RestSetRegionMethod )); + + //httpServer.AddRestHandler("GET", "/sims/", m_gridManager.RestGetSimMethod); + //httpServer.AddRestHandler("POST", "/sims/", m_gridManager.RestSetSimMethod); + //httpServer.AddRestHandler("GET", "/regions/", m_gridManager.RestGetRegionMethod); + //httpServer.AddRestHandler("POST", "/regions/", m_gridManager.RestSetRegionMethod); httpServer.Start(); diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 5560e7d..30465a3 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -105,8 +105,8 @@ namespace OpenSim.Grid.UserServer httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID); - httpServer.AddRestHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod); - + httpServer.AddStreamHandler( new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod )); + httpServer.Start(); m_console.Status("Userserver 0.3 - Startup complete"); } -- 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 --- OpenSim/Grid/GridServer/GridManager.cs | 35 ++++++++++++++++++++++ OpenSim/Grid/GridServer/Main.cs | 1 + .../Grid/GridServer/OpenSim.Grid.GridServer.csproj | 4 +-- .../GridServer/OpenSim.Grid.GridServer.exe.build | 2 +- OpenSim/Grid/UserServer/UserManager.cs | 21 +++++++------ 5 files changed, 49 insertions(+), 14 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 1e457b3..422385d 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -268,6 +268,7 @@ namespace OpenSim.Grid.GridServer TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256)); TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; + Console.WriteLine("NEW SIM: " + TheSim.serverURI); TheSim.regionName = (string)requestData["sim_name"]; TheSim.UUID = new LLUUID((string)requestData["UUID"]); @@ -376,6 +377,40 @@ namespace OpenSim.Grid.GridServer return response; } + public XmlRpcResponse XmlRpcSimulatorDataRequestMethod(XmlRpcRequest request) + { + Hashtable requestData = (Hashtable)request.Params[0]; + Hashtable responseData = new Hashtable(); + SimProfileData simData = null; + if (requestData.ContainsKey("region_UUID")) + { + simData = getRegion(new LLUUID((string)requestData["region_UUID"])); + } + else if (requestData.ContainsKey("region_handle")) + { + simData = getRegion(Convert.ToUInt64((string)requestData["region_handle"])); + } + + if (simData == null) + { + //Sim does not exist + responseData["error"] = "Sim does not exist"; + } + else + { + responseData["sim_ip"] = simData.serverIP; + responseData["sim_port"] = simData.serverPort.ToString(); + responseData["region_locx"] = simData.regionLocX; + responseData["region_locy"] = simData.regionLocY; + responseData["region_UUID"] = simData.UUID.UUID.ToString(); + responseData["region_name"] = simData.regionName; + } + + XmlRpcResponse response = new XmlRpcResponse(); + response.Value = responseData; + return response; + } + public XmlRpcResponse XmlRpcMapBlockMethod(XmlRpcRequest request) { int xmin=980, ymin=980, xmax=1020, ymax=1020; diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index a990ff7..dc5e4fa 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -125,6 +125,7 @@ namespace OpenSim.Grid.GridServer //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod); + httpServer.AddXmlRPCHandler("simulator_data_request", m_gridManager.XmlRpcSimulatorDataRequestMethod); httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod); httpServer.AddStreamHandler(new RestStreamHandler("GET", "/sims/", m_gridManager.RestGetSimMethod )); diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj index 424072e..7fbb581 100644 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj @@ -114,10 +114,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build index 4cadf1d..45cf353 100644 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build @@ -11,8 +11,8 @@ - + diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 4610a9d..4216515 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -29,7 +29,6 @@ using System; using System.Collections; using Nwc.XmlRpc; using OpenSim.Framework.Data; -using OpenSim.Framework.Sims; using OpenSim.Framework.UserManagement; namespace OpenSim.Grid.UserServer @@ -48,23 +47,23 @@ namespace OpenSim.Grid.UserServer public override void CustomiseResponse( LoginResponse response, UserProfileData theUser) { // Load information from the gridserver - SimProfile SimInfo = new SimProfile(); - SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); + SimProfileData SimInfo = new SimProfileData(); + SimInfo = SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); // Customise the response // Home Location - response.Home = "{'region_handle':[r" + (SimInfo.RegionLocX * 256).ToString() + ",r" + (SimInfo.RegionLocY * 256).ToString() + "], " + + response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + (SimInfo.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() + "]}"; // Destination - response.SimAddress = SimInfo.sim_ip; - response.SimPort = (Int32)SimInfo.sim_port; - response.RegionX = SimInfo.RegionLocY ; - response.RegionY = SimInfo.RegionLocX ; + response.SimAddress = SimInfo.serverIP; + response.SimPort = (Int32)SimInfo.serverPort; + response.RegionX = SimInfo.regionLocX; + response.RegionY = SimInfo.regionLocX; // Notify the target of an incoming user - Console.WriteLine("Notifying " + SimInfo.regionname + " (" + SimInfo.caps_url + ")"); + Console.WriteLine("Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI+ ")"); // Prepare notification Hashtable SimParams = new Hashtable(); @@ -83,11 +82,11 @@ namespace OpenSim.Grid.UserServer // Update agent with target sim theUser.currentAgent.currentRegion = SimInfo.UUID; - theUser.currentAgent.currentHandle = SimInfo.regionhandle; + theUser.currentAgent.currentHandle = SimInfo.regionHandle; // Send XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); - XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000); + XmlRpcResponse GridResp = GridReq.Send(SimInfo.serverURI, 3000); } } } -- 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 --- OpenSim/Grid/GridServer/GridManager.cs | 4 ++-- OpenSim/Grid/UserServer/Main.cs | 4 ++-- OpenSim/Grid/UserServer/UserManager.cs | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 422385d..814d7c1 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -400,8 +400,8 @@ namespace OpenSim.Grid.GridServer { responseData["sim_ip"] = simData.serverIP; responseData["sim_port"] = simData.serverPort.ToString(); - responseData["region_locx"] = simData.regionLocX; - responseData["region_locy"] = simData.regionLocY; + responseData["region_locx"] = simData.regionLocX.ToString() ; + responseData["region_locy"] = simData.regionLocY.ToString(); responseData["region_UUID"] = simData.UUID.UUID.ToString(); responseData["region_name"] = simData.regionName; } diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 30465a3..c792918 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -120,8 +120,8 @@ namespace OpenSim.Grid.UserServer string tempfirstname; string templastname; string tempMD5Passwd; - uint regX = 997; - uint regY = 996; + uint regX = 1000; + uint regY = 1000; tempfirstname = m_console.CmdPrompt("First name"); templastname = m_console.CmdPrompt("Last name"); diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 4216515..7ae7853 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -57,6 +57,7 @@ namespace OpenSim.Grid.UserServer "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; // Destination + Console.WriteLine("CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + SimInfo.regionLocY); response.SimAddress = SimInfo.serverIP; response.SimPort = (Int32)SimInfo.serverPort; response.RegionX = SimInfo.regionLocX; -- cgit v1.1 From 7b0bb7c616fcbbd06b3eb5154fa83479036101c8 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 8 Jul 2007 00:54:13 +0000 Subject: * Fixed reservation handling for existing region authkey situations. Reservation key now overrides old sim key, however if reservation not found, sim key is used instead. --- OpenSim/Grid/GridServer/GridManager.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 814d7c1..06e83f8 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -602,12 +602,6 @@ namespace OpenSim.Grid.GridServer return "ERROR! bad XML - expected sim tag"; } - if (authkeynode.InnerText != TheSim.regionRecvKey) - { - MainLog.Instance.Warn("Invalid Key Attempt on region update"); - return "ERROR! invalid key"; - } - //TheSim.regionSendKey = Cfg; TheSim.regionRecvKey = config.SimRecvKey; TheSim.regionSendKey = config.SimSendKey; @@ -668,7 +662,7 @@ namespace OpenSim.Grid.GridServer { //Check reservations ReservationData reserveData = kvp.Value.GetReservationAtPoint(TheSim.regionLocX, TheSim.regionLocY); - if ((reserveData != null && reserveData.gridRecvKey == TheSim.regionRecvKey) || (reserveData == null)) + if ((reserveData != null && reserveData.gridRecvKey == TheSim.regionRecvKey) || (reserveData == null && authkeynode.InnerText != TheSim.regionRecvKey)) { kvp.Value.AddProfile(TheSim); MainLog.Instance.Verbose("New sim added to grid (" + TheSim.regionName + ")"); -- 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 --- OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj | 4 ++-- OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj index 7fbb581..424072e 100644 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj @@ -114,10 +114,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build index 45cf353..4cadf1d 100644 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build @@ -11,8 +11,8 @@ - + -- cgit v1.1 From 4adf4c57d481369af0d98d8addab2f7b54ce21a5 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 8 Jul 2007 12:10:32 +0000 Subject: --- OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj | 10 ++++------ OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build | 2 +- OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj | 10 ++++------ OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj index 424072e..550e2f8 100644 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj @@ -74,6 +74,10 @@ OpenSim.Framework.Console.dll False + + OpenSim.Framework.Data.dll + False + OpenSim.Framework.GenericConfig.Xml.dll False @@ -100,12 +104,6 @@ - - OpenSim.Framework.Data - {36B72A9B-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - OpenSim.Grid.Framework.Manager {4B7BFD1C-0000-0000-0000-000000000000} diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build index 4cadf1d..fdf0922 100644 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build +++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build @@ -24,7 +24,7 @@ - + diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj index 1146b17..62d67f7 100644 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj @@ -74,6 +74,10 @@ OpenSim.Framework.Console.dll False + + OpenSim.Framework.Data.dll + False + OpenSim.Framework.GenericConfig.Xml.dll False @@ -100,12 +104,6 @@ - - OpenSim.Framework.Data - {36B72A9B-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - OpenSim.Framework.UserManagement {586E2916-0000-0000-0000-000000000000} diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build index 50c9788..8a5d1e6 100644 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build +++ b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build @@ -24,7 +24,7 @@ - + -- 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. --- .../AssetServer/OpenSim.Grid.AssetServer.csproj | 115 ------------------ .../AssetServer/OpenSim.Grid.AssetServer.exe.build | 48 -------- .../OpenSim.Grid.Framework.Manager.csproj | 99 ---------------- .../OpenSim.Grid.Framework.Manager.dll.build | 44 ------- .../OpenSim.Grid.GridServer.Config.csproj | 107 ----------------- .../OpenSim.Grid.GridServer.Config.dll.build | 46 ------- .../Grid/GridServer/OpenSim.Grid.GridServer.csproj | 132 --------------------- .../GridServer/OpenSim.Grid.GridServer.exe.build | 52 -------- .../OpenSim.Grid.UserServer.Config.csproj | 107 ----------------- .../OpenSim.Grid.UserServer.Config.dll.build | 46 ------- .../Grid/UserServer/OpenSim.Grid.UserServer.csproj | 132 --------------------- .../UserServer/OpenSim.Grid.UserServer.exe.build | 52 -------- 12 files changed, 980 deletions(-) delete mode 100644 OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj delete mode 100644 OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build delete mode 100644 OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj delete mode 100644 OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build delete mode 100644 OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj delete mode 100644 OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build delete mode 100644 OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj delete mode 100644 OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build delete mode 100644 OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj delete mode 100644 OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build delete mode 100644 OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj delete mode 100644 OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj deleted file mode 100644 index 5ba4642..0000000 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {E5F1A03B-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Grid.AssetServer - JScript - Grid - IE50 - false - Exe - - OpenSim.Grid.AssetServer - - - - - - 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\Db4objects.Db4o.dll - False - - - ..\..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - OpenSim.Framework.Servers.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - ..\..\..\bin\XMLRPC.dll - False - - - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build deleted file mode 100644 index a922fe7..0000000 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj deleted file mode 100644 index 9a98ff4..0000000 --- a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {4B7BFD1C-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Grid.Framework.Manager - JScript - Grid - IE50 - false - Library - - OpenSim.Grid.Framework.Manager - - - - - - 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 - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Servers.dll - False - - - System.dll - False - - - ..\..\..\bin\XMLRPC.dll - False - - - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build b/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build deleted file mode 100644 index 8e9f026..0000000 --- a/OpenSim/Grid/Framework.Manager/OpenSim.Grid.Framework.Manager.dll.build +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj deleted file mode 100644 index 24e845c..0000000 --- a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {1442B635-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Grid.GridServer.Config - JScript - Grid - IE50 - false - Library - - OpenSim.Grid.GridServer.Config - - - - - - 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\Db4objects.Db4o.dll - False - - - ..\..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - System.dll - False - - - ..\..\..\bin\System.Data.dll - False - - - System.Xml.dll - False - - - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build b/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build deleted file mode 100644 index cdf09e1..0000000 --- a/OpenSim/Grid/GridServer.Config/OpenSim.Grid.GridServer.Config.dll.build +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj deleted file mode 100644 index 550e2f8..0000000 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj +++ /dev/null @@ -1,132 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {60FCC3A6-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Grid.GridServer - JScript - Grid - IE50 - false - Exe - - OpenSim.Grid.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 - - - - - ..\..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - OpenSim.Framework.Data.dll - False - - - OpenSim.Framework.GenericConfig.Xml.dll - False - - - OpenSim.Framework.Servers.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - ..\..\..\bin\XMLRPC.dll - False - - - - - OpenSim.Grid.Framework.Manager - {4B7BFD1C-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build deleted file mode 100644 index fdf0922..0000000 --- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj deleted file mode 100644 index 1ae9589..0000000 --- a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {08F87229-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Grid.UserServer.Config - JScript - Grid - IE50 - false - Library - - OpenSim.Grid.UserServer.Config - - - - - - 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\Db4objects.Db4o.dll - False - - - ..\..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - System.dll - False - - - ..\..\..\bin\System.Data.dll - False - - - System.Xml.dll - False - - - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build b/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build deleted file mode 100644 index a427765..0000000 --- a/OpenSim/Grid/UserServer.Config/OpenSim.Grid.UserServer.Config.dll.build +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj deleted file mode 100644 index 62d67f7..0000000 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.csproj +++ /dev/null @@ -1,132 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {2FC96F92-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Grid.UserServer - JScript - Grid - IE50 - false - Exe - - OpenSim.Grid.UserServer - - - - - - 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\Db4objects.Db4o.dll - False - - - ..\..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - OpenSim.Framework.Data.dll - False - - - OpenSim.Framework.GenericConfig.Xml.dll - False - - - OpenSim.Framework.Servers.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - ..\..\..\bin\XMLRPC.dll - False - - - - - OpenSim.Framework.UserManagement - {586E2916-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build b/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build deleted file mode 100644 index 8a5d1e6..0000000 --- a/OpenSim/Grid/UserServer/OpenSim.Grid.UserServer.exe.build +++ /dev/null @@ -1,52 +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. --- OpenSim/Grid/GridServer/GridManager.cs | 16 ++++++++++++---- OpenSim/Grid/UserServer/UserManager.cs | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 06e83f8..6ddb921 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -261,12 +261,16 @@ namespace OpenSim.Grid.GridServer TheSim.serverIP = (string)requestData["sim_ip"]; TheSim.serverPort = Convert.ToUInt32((string)requestData["sim_port"]); + TheSim.httpPort = Convert.ToUInt32((string)requestData["http_port"]); + TheSim.remotingPort = Convert.ToUInt32((string)requestData["remoting_port"]); TheSim.regionLocX = Convert.ToUInt32((string)requestData["region_locx"]); TheSim.regionLocY = Convert.ToUInt32((string)requestData["region_locy"]); TheSim.regionLocZ = 0; TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256)); + System.Console.WriteLine("adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " + TheSim.regionHandle); TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; + TheSim.httpServerURI = "http://" + TheSim.serverIP + ":" + TheSim.httpPort + "/"; Console.WriteLine("NEW SIM: " + TheSim.serverURI); TheSim.regionName = (string)requestData["sim_name"]; @@ -400,6 +404,8 @@ namespace OpenSim.Grid.GridServer { responseData["sim_ip"] = simData.serverIP; responseData["sim_port"] = simData.serverPort.ToString(); + responseData["http_port"] = simData.httpPort.ToString(); + responseData["remoting_port"] = simData.remotingPort.ToString(); responseData["region_locx"] = simData.regionLocX.ToString() ; responseData["region_locy"] = simData.regionLocY.ToString(); responseData["region_UUID"] = simData.UUID.UUID.ToString(); @@ -438,7 +444,7 @@ namespace OpenSim.Grid.GridServer response.Value = responseData; IList simProfileList = new ArrayList(); - bool fastMode = true; // MySQL Only + bool fastMode = false; // MySQL Only if (fastMode) { @@ -449,6 +455,7 @@ namespace OpenSim.Grid.GridServer Hashtable simProfileBlock = new Hashtable(); simProfileBlock["x"] = aSim.Value.regionLocX.ToString(); simProfileBlock["y"] = aSim.Value.regionLocY.ToString(); + System.Console.WriteLine("send neighbour info for " + aSim.Value.regionLocX.ToString() + " , " + aSim.Value.regionLocY.ToString()); simProfileBlock["name"] = aSim.Value.regionName; simProfileBlock["access"] = 21; simProfileBlock["region-flags"] = 512; @@ -470,11 +477,12 @@ namespace OpenSim.Grid.GridServer else { SimProfileData simProfile; - for (int x = xmin; x < xmax; x++) + for (int x = xmin; x < xmax+1; x++) { - for (int y = ymin; y < ymax; y++) + for (int y = ymin; y < ymax+1; y++) { - simProfile = getRegion(Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256))); + ulong regHandle = Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256)); + simProfile = getRegion(regHandle); if (simProfile != null) { Hashtable simProfileBlock = new Hashtable(); diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 7ae7853..04bf64a 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -85,9 +85,10 @@ namespace OpenSim.Grid.UserServer theUser.currentAgent.currentRegion = SimInfo.UUID; theUser.currentAgent.currentHandle = SimInfo.regionHandle; + System.Console.WriteLine("sending reply"); // Send XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); - XmlRpcResponse GridResp = GridReq.Send(SimInfo.serverURI, 3000); + XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 3000); } } } -- 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. --- OpenSim/Grid/GridServer/GridManager.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 6ddb921..1f97f53 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -266,6 +266,7 @@ namespace OpenSim.Grid.GridServer TheSim.regionLocX = Convert.ToUInt32((string)requestData["region_locx"]); TheSim.regionLocY = Convert.ToUInt32((string)requestData["region_locy"]); TheSim.regionLocZ = 0; + TheSim.regionMapTextureID = new LLUUID((string)requestData["map-image-id"]); TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256)); System.Console.WriteLine("adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " + TheSim.regionHandle); @@ -392,16 +393,19 @@ namespace OpenSim.Grid.GridServer } else if (requestData.ContainsKey("region_handle")) { + Console.WriteLine("requesting data for region " + (string)requestData["region_handle"]); simData = getRegion(Convert.ToUInt64((string)requestData["region_handle"])); } if (simData == null) { //Sim does not exist + Console.WriteLine("region not found"); responseData["error"] = "Sim does not exist"; } else { + Console.WriteLine("found region"); responseData["sim_ip"] = simData.serverIP; responseData["sim_port"] = simData.serverPort.ToString(); responseData["http_port"] = simData.httpPort.ToString(); @@ -493,7 +497,7 @@ namespace OpenSim.Grid.GridServer simProfileBlock["region-flags"] = 0; simProfileBlock["water-height"] = 20; simProfileBlock["agents"] = 1; - simProfileBlock["map-image-id"] = simProfile.regionMapTextureID.ToString(); + simProfileBlock["map-image-id"] = simProfile.regionMapTextureID.ToStringHyphenated(); // For Sugilite compatibility simProfileBlock["regionhandle"] = simProfile.regionHandle.ToString(); -- cgit v1.1