From 5c7ffdde0b9642a42e8f5987e06eb01220ff7776 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 11 Jul 2007 08:02:47 +0000 Subject: * Wiping trunk in prep for Sugilite --- Common/OpenSim.Framework.Console/AssemblyInfo.cs | 58 -- Common/OpenSim.Framework.Console/ConsoleBase.cs | 220 ------- .../ConsoleCallbacksBase.cs | 39 -- Common/OpenSim.Framework.Console/MainConsole.cs | 49 -- .../OpenSim.Framework.Console.csproj | 89 --- .../OpenSim.Framework.Console.dll.build | 42 -- Common/OpenSim.Framework/AgentInventory.cs | 278 --------- Common/OpenSim.Framework/BlockingQueue.cs | 60 -- Common/OpenSim.Framework/HeightMapGenHills.cs | 150 ----- .../OpenSim.Framework/Interfaces/IAssetServer.cs | 68 --- Common/OpenSim.Framework/Interfaces/IClientAPI.cs | 35 -- Common/OpenSim.Framework/Interfaces/IConfig.cs | 76 --- .../OpenSim.Framework/Interfaces/IGenericConfig.cs | 15 - Common/OpenSim.Framework/Interfaces/IGridConfig.cs | 64 -- Common/OpenSim.Framework/Interfaces/IGridServer.cs | 81 --- .../OpenSim.Framework/Interfaces/ILocalStorage.cs | 68 --- Common/OpenSim.Framework/Interfaces/IScriptAPI.cs | 14 - .../OpenSim.Framework/Interfaces/IScriptEngine.cs | 14 - Common/OpenSim.Framework/Interfaces/IUserConfig.cs | 58 -- Common/OpenSim.Framework/Interfaces/IUserServer.cs | 15 - .../OpenSim.Framework/Interfaces/LocalGridBase.cs | 24 - .../OpenSim.Framework/Interfaces/RemoteGridBase.cs | 37 -- Common/OpenSim.Framework/LoginService.cs | 42 -- Common/OpenSim.Framework/OpenSim.Framework.csproj | 200 ------ .../OpenSim.Framework/OpenSim.Framework.dll.build | 77 --- .../OpenSim.Framework/Properties/AssemblyInfo.cs | 33 - Common/OpenSim.Framework/Remoting.cs | 137 ----- Common/OpenSim.Framework/SimProfile.cs | 110 ---- Common/OpenSim.Framework/SimProfileBase.cs | 54 -- Common/OpenSim.Framework/Types/AgentCircuitData.cs | 50 -- Common/OpenSim.Framework/Types/AssetBase.cs | 49 -- Common/OpenSim.Framework/Types/AssetLandmark.cs | 61 -- Common/OpenSim.Framework/Types/AssetStorage.cs | 50 -- Common/OpenSim.Framework/Types/EstateSettings.cs | 96 --- Common/OpenSim.Framework/Types/Login.cs | 52 -- Common/OpenSim.Framework/Types/NeighbourInfo.cs | 47 -- Common/OpenSim.Framework/Types/OSVector3.cs | 46 -- Common/OpenSim.Framework/Types/ParcelData.cs | 115 ---- Common/OpenSim.Framework/Types/PrimData.cs | 201 ------- Common/OpenSim.Framework/UserProfile.cs | 89 --- Common/OpenSim.Framework/UserProfileManager.cs | 299 --------- Common/OpenSim.Framework/UserProfileManagerBase.cs | 152 ----- Common/OpenSim.Framework/Util.cs | 178 ------ .../Xml/OpenSim.GenericConfig.Xml.csproj | 93 --- .../Xml/OpenSim.GenericConfig.Xml.dll.build | 42 -- .../Xml/Properties/AssemblyInfo.cs | 35 -- Common/OpenSim.GenericConfig/Xml/XmlConfig.cs | 136 ----- Common/OpenSim.Servers/BaseHttpServer.cs | 283 --------- Common/OpenSim.Servers/BaseServer.cs | 37 -- Common/OpenSim.Servers/CheckSumServer.cs | 139 ----- Common/OpenSim.Servers/IRestHandler.cs | 35 -- Common/OpenSim.Servers/LocalUserProfileManager.cs | 124 ---- Common/OpenSim.Servers/LoginResponse.cs | 669 --------------------- Common/OpenSim.Servers/LoginServer.cs | 296 --------- Common/OpenSim.Servers/OpenSim.Servers.csproj | 133 ---- Common/OpenSim.Servers/OpenSim.Servers.dll.build | 53 -- Common/OpenSim.Servers/SocketRegistry.cs | 63 -- Common/OpenSim.Servers/UDPServerBase.cs | 103 ---- Common/OpenSim.Servers/XmlRpcMethod.cs | 34 -- Common/XmlRpcCS/Logger.cs | 46 -- Common/XmlRpcCS/SimpleHttpRequest.cs | 234 ------- Common/XmlRpcCS/XMLRPC.csproj | 138 ----- Common/XmlRpcCS/XMLRPC.dll.build | 58 -- Common/XmlRpcCS/XmlRpcBoxcarRequest.cs | 78 --- Common/XmlRpcCS/XmlRpcClientProxy.cs | 88 --- Common/XmlRpcCS/XmlRpcDeserializer.cs | 222 ------- Common/XmlRpcCS/XmlRpcErrorCodes.cs | 78 --- Common/XmlRpcCS/XmlRpcException.cs | 66 -- Common/XmlRpcCS/XmlRpcExposedAttribute.cs | 87 --- Common/XmlRpcCS/XmlRpcRequest.cs | 177 ------ Common/XmlRpcCS/XmlRpcRequestDeserializer.cs | 92 --- Common/XmlRpcCS/XmlRpcRequestSerializer.cs | 78 --- Common/XmlRpcCS/XmlRpcResponder.cs | 127 ---- Common/XmlRpcCS/XmlRpcResponse.cs | 112 ---- Common/XmlRpcCS/XmlRpcResponseDeserializer.cs | 92 --- Common/XmlRpcCS/XmlRpcResponseSerializer.cs | 84 --- Common/XmlRpcCS/XmlRpcSerializer.cs | 143 ----- Common/XmlRpcCS/XmlRpcServer.cs | 266 -------- Common/XmlRpcCS/XmlRpcSystemObject.cs | 279 --------- Common/XmlRpcCS/XmlRpcXmlTokens.cs | 103 ---- 80 files changed, 8615 deletions(-) delete mode 100644 Common/OpenSim.Framework.Console/AssemblyInfo.cs delete mode 100644 Common/OpenSim.Framework.Console/ConsoleBase.cs delete mode 100644 Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs delete mode 100644 Common/OpenSim.Framework.Console/MainConsole.cs delete mode 100644 Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj delete mode 100644 Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build delete mode 100644 Common/OpenSim.Framework/AgentInventory.cs delete mode 100644 Common/OpenSim.Framework/BlockingQueue.cs delete mode 100644 Common/OpenSim.Framework/HeightMapGenHills.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/IAssetServer.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/IClientAPI.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/IConfig.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/IGenericConfig.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/IGridConfig.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/IGridServer.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/ILocalStorage.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/IScriptAPI.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/IScriptEngine.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/IUserConfig.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/IUserServer.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/LocalGridBase.cs delete mode 100644 Common/OpenSim.Framework/Interfaces/RemoteGridBase.cs delete mode 100644 Common/OpenSim.Framework/LoginService.cs delete mode 100644 Common/OpenSim.Framework/OpenSim.Framework.csproj delete mode 100644 Common/OpenSim.Framework/OpenSim.Framework.dll.build delete mode 100644 Common/OpenSim.Framework/Properties/AssemblyInfo.cs delete mode 100644 Common/OpenSim.Framework/Remoting.cs delete mode 100644 Common/OpenSim.Framework/SimProfile.cs delete mode 100644 Common/OpenSim.Framework/SimProfileBase.cs delete mode 100644 Common/OpenSim.Framework/Types/AgentCircuitData.cs delete mode 100644 Common/OpenSim.Framework/Types/AssetBase.cs delete mode 100644 Common/OpenSim.Framework/Types/AssetLandmark.cs delete mode 100644 Common/OpenSim.Framework/Types/AssetStorage.cs delete mode 100644 Common/OpenSim.Framework/Types/EstateSettings.cs delete mode 100644 Common/OpenSim.Framework/Types/Login.cs delete mode 100644 Common/OpenSim.Framework/Types/NeighbourInfo.cs delete mode 100644 Common/OpenSim.Framework/Types/OSVector3.cs delete mode 100644 Common/OpenSim.Framework/Types/ParcelData.cs delete mode 100644 Common/OpenSim.Framework/Types/PrimData.cs delete mode 100644 Common/OpenSim.Framework/UserProfile.cs delete mode 100644 Common/OpenSim.Framework/UserProfileManager.cs delete mode 100644 Common/OpenSim.Framework/UserProfileManagerBase.cs delete mode 100644 Common/OpenSim.Framework/Util.cs delete mode 100644 Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj delete mode 100644 Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build delete mode 100644 Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs delete mode 100644 Common/OpenSim.GenericConfig/Xml/XmlConfig.cs delete mode 100644 Common/OpenSim.Servers/BaseHttpServer.cs delete mode 100644 Common/OpenSim.Servers/BaseServer.cs delete mode 100644 Common/OpenSim.Servers/CheckSumServer.cs delete mode 100644 Common/OpenSim.Servers/IRestHandler.cs delete mode 100644 Common/OpenSim.Servers/LocalUserProfileManager.cs delete mode 100644 Common/OpenSim.Servers/LoginResponse.cs delete mode 100644 Common/OpenSim.Servers/LoginServer.cs delete mode 100644 Common/OpenSim.Servers/OpenSim.Servers.csproj delete mode 100644 Common/OpenSim.Servers/OpenSim.Servers.dll.build delete mode 100644 Common/OpenSim.Servers/SocketRegistry.cs delete mode 100644 Common/OpenSim.Servers/UDPServerBase.cs delete mode 100644 Common/OpenSim.Servers/XmlRpcMethod.cs delete mode 100644 Common/XmlRpcCS/Logger.cs delete mode 100644 Common/XmlRpcCS/SimpleHttpRequest.cs delete mode 100644 Common/XmlRpcCS/XMLRPC.csproj delete mode 100644 Common/XmlRpcCS/XMLRPC.dll.build delete mode 100644 Common/XmlRpcCS/XmlRpcBoxcarRequest.cs delete mode 100644 Common/XmlRpcCS/XmlRpcClientProxy.cs delete mode 100644 Common/XmlRpcCS/XmlRpcDeserializer.cs delete mode 100644 Common/XmlRpcCS/XmlRpcErrorCodes.cs delete mode 100644 Common/XmlRpcCS/XmlRpcException.cs delete mode 100644 Common/XmlRpcCS/XmlRpcExposedAttribute.cs delete mode 100644 Common/XmlRpcCS/XmlRpcRequest.cs delete mode 100644 Common/XmlRpcCS/XmlRpcRequestDeserializer.cs delete mode 100644 Common/XmlRpcCS/XmlRpcRequestSerializer.cs delete mode 100644 Common/XmlRpcCS/XmlRpcResponder.cs delete mode 100644 Common/XmlRpcCS/XmlRpcResponse.cs delete mode 100644 Common/XmlRpcCS/XmlRpcResponseDeserializer.cs delete mode 100644 Common/XmlRpcCS/XmlRpcResponseSerializer.cs delete mode 100644 Common/XmlRpcCS/XmlRpcSerializer.cs delete mode 100644 Common/XmlRpcCS/XmlRpcServer.cs delete mode 100644 Common/XmlRpcCS/XmlRpcSystemObject.cs delete mode 100644 Common/XmlRpcCS/XmlRpcXmlTokens.cs (limited to 'Common') diff --git a/Common/OpenSim.Framework.Console/AssemblyInfo.cs b/Common/OpenSim.Framework.Console/AssemblyInfo.cs deleted file mode 100644 index 8f715d2..0000000 --- a/Common/OpenSim.Framework.Console/AssemblyInfo.cs +++ /dev/null @@ -1,58 +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.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("ServerConsole")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ServerConsole")] -[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/Common/OpenSim.Framework.Console/ConsoleBase.cs b/Common/OpenSim.Framework.Console/ConsoleBase.cs deleted file mode 100644 index 30854fe..0000000 --- a/Common/OpenSim.Framework.Console/ConsoleBase.cs +++ /dev/null @@ -1,220 +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; - -namespace OpenSim.Framework.Console -{ - public enum LogPriority : int - { - CRITICAL, - HIGH, - MEDIUM, - NORMAL, - LOW, - VERBOSE, - EXTRAVERBOSE - } - - public class ConsoleBase - { - StreamWriter Log; - public conscmd_callback cmdparser; - public string componentname; - private bool m_silent; - - public ConsoleBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent ) - { - this.componentname = componentname; - this.cmdparser = cmdparser; - this.m_silent = silent; - System.Console.WriteLine("ServerConsole.cs - creating new local console"); - System.Console.WriteLine("Logs will be saved to current directory in " + LogFile); - Log = File.AppendText(LogFile); - Log.WriteLine("========================================================================"); - Log.WriteLine(componentname + " Started at " + DateTime.Now.ToString()); - } - - public void Close() - { - Log.WriteLine("Shutdown at " + DateTime.Now.ToString()); - Log.Close(); - } - - public void Write(string format, params object[] args) - { - Notice(format,args); - return; - } - - public void Warn(string format, params object[] args) - { - WriteNewLine(ConsoleColor.Yellow, format, args); - return; - } - - public void Notice(string format, params object[] args) - { - WriteNewLine(ConsoleColor.White, format, args); - return; - } - - public void Error(string format, params object[] args) - { - WriteNewLine(ConsoleColor.Red, format, args); - return; - } - - public void Verbose(string format, params object[] args) - { - WriteNewLine(ConsoleColor.Gray, format, args); - return; - } - - public void Status(string format, params object[] args) - { - WriteNewLine(ConsoleColor.Blue, format, args); - return; - } - - private void WriteNewLine(System.ConsoleColor color, string format, params object[] args) - { - Log.WriteLine(format, args); - Log.Flush(); - if (!m_silent) - { - try - { - System.Console.ForegroundColor = color; - System.Console.WriteLine(format, args); - System.Console.ResetColor(); - } // Because mono and old debian sucks. - catch (System.ArgumentNullException) - { - System.Console.WriteLine(format, args); - } - } - return; - } - - public string ReadLine() - { - string TempStr = System.Console.ReadLine(); - Log.WriteLine(TempStr); - return TempStr; - } - - public int Read() - { - int TempInt = System.Console.Read(); - Log.Write((char)TempInt); - return TempInt; - } - - // Displays a prompt and waits for the user to enter a string, then returns that string - // Done with no echo and suitable for passwords - public string PasswdPrompt(string prompt) - { - // FIXME: Needs to be better abstracted - Log.WriteLine(prompt); - this.Write(prompt); - ConsoleColor oldfg = System.Console.ForegroundColor; - System.Console.ForegroundColor = System.Console.BackgroundColor; - string temp = System.Console.ReadLine(); - System.Console.ForegroundColor = oldfg; - return temp; - } - - // Displays a command prompt and waits for the user to enter a string, then returns that string - public string CmdPrompt(string prompt) - { - this.Write(String.Format("{0}: ", prompt)); - return this.ReadLine(); - } - - // Displays a command prompt and returns a default value if the user simply presses enter - public string CmdPrompt(string prompt, string defaultresponse) - { - string temp = CmdPrompt(String.Format( "{0} [{1}]", prompt, defaultresponse )); - if (temp == "") - { - return defaultresponse; - } - else - { - return temp; - } - } - - // Displays a command prompt and returns a default value, user may only enter 1 of 2 options - public string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB) - { - bool itisdone = false; - string temp = CmdPrompt(prompt, defaultresponse); - while (itisdone == false) - { - if ((temp == OptionA) || (temp == OptionB)) - { - itisdone = true; - } - else - { - Notice("Valid options are " + OptionA + " or " + OptionB); - temp = CmdPrompt(prompt, defaultresponse); - } - } - return temp; - } - - // Runs a command with a number of parameters - public Object RunCmd(string Cmd, string[] cmdparams) - { - cmdparser.RunCmd(Cmd, cmdparams); - return null; - } - - // Shows data about something - public void ShowCommands(string ShowWhat) - { - cmdparser.Show(ShowWhat); - } - - public void MainConsolePrompt() - { - string[] tempstrarray; - string tempstr = this.CmdPrompt(this.componentname + "# "); - tempstrarray = tempstr.Split(' '); - string cmd = tempstrarray[0]; - Array.Reverse(tempstrarray); - Array.Resize(ref tempstrarray, tempstrarray.Length - 1); - Array.Reverse(tempstrarray); - string[] cmdparams = (string[])tempstrarray; - RunCmd(cmd, cmdparams); - } - } -} diff --git a/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs b/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs deleted file mode 100644 index e3847be..0000000 --- a/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs +++ /dev/null @@ -1,39 +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.Collections.Generic; -using System.Text; - -namespace OpenSim.Framework.Console -{ - public interface conscmd_callback - { - void RunCmd(string cmd, string[] cmdparams); - void Show(string ShowWhat); - } -} diff --git a/Common/OpenSim.Framework.Console/MainConsole.cs b/Common/OpenSim.Framework.Console/MainConsole.cs deleted file mode 100644 index 01aa3d1..0000000 --- a/Common/OpenSim.Framework.Console/MainConsole.cs +++ /dev/null @@ -1,49 +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; - -namespace OpenSim.Framework.Console -{ - public class MainConsole { - - private static ConsoleBase instance; - - public static ConsoleBase Instance - { - get - { - return instance; - } - set - { - instance = value; - } - } - } - -} diff --git a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj deleted file mode 100644 index 7af0eca..0000000 --- a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {A7CD0630-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Framework.Console - JScript - Grid - IE50 - false - Library - - OpenSim.Framework.Console - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - System.dll - False - - - - - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build deleted file mode 100644 index 9a03b54..0000000 --- a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Common/OpenSim.Framework/AgentInventory.cs b/Common/OpenSim.Framework/AgentInventory.cs deleted file mode 100644 index b36982a..0000000 --- a/Common/OpenSim.Framework/AgentInventory.cs +++ /dev/null @@ -1,278 +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.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; -using OpenSim.Framework.Types; -using OpenSim.Framework.Utilities; - -namespace OpenSim.Framework.Inventory -{ - public class AgentInventory - { - //Holds the local copy of Inventory info for a agent - public Dictionary InventoryFolders; - public Dictionary InventoryItems; - public InventoryFolder InventoryRoot; - public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server - public LLUUID AgentID; - public AvatarWearable[] Wearables; - - public AgentInventory() - { - InventoryFolders = new Dictionary(); - InventoryItems = new Dictionary(); - this.Initialise(); - } - - public virtual void Initialise() - { - Wearables = new AvatarWearable[13]; //should be 12 of these - for (int i = 0; i < 13; i++) - { - Wearables[i] = new AvatarWearable(); - } - - } - - public bool CreateNewFolder(LLUUID folderID, ushort type) - { - InventoryFolder Folder = new InventoryFolder(); - Folder.FolderID = folderID; - Folder.OwnerID = this.AgentID; - Folder.DefaultType = type; - this.InventoryFolders.Add(Folder.FolderID, Folder); - return (true); - } - - public void CreateRootFolder(LLUUID newAgentID, bool createTextures) - { - this.AgentID = newAgentID; - InventoryRoot = new InventoryFolder(); - InventoryRoot.FolderID = LLUUID.Random(); - InventoryRoot.ParentID = new LLUUID(); - InventoryRoot.Version = 1; - InventoryRoot.DefaultType = 8; - InventoryRoot.OwnerID = this.AgentID; - InventoryRoot.FolderName = "My Inventory"; - InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot); - InventoryRoot.OwnerID = this.AgentID; - if (createTextures) - { - this.CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID); - } - } - - public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName) - { - InventoryFolder Folder = new InventoryFolder(); - Folder.FolderID = folderID; - Folder.OwnerID = this.AgentID; - Folder.DefaultType = type; - Folder.FolderName = folderName; - this.InventoryFolders.Add(Folder.FolderID, Folder); - - return (true); - } - - public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent) - { - if (!this.InventoryFolders.ContainsKey(folderID)) - { - Console.WriteLine("creating new folder called " + folderName + " in agents inventory"); - InventoryFolder Folder = new InventoryFolder(); - Folder.FolderID = folderID; - Folder.OwnerID = this.AgentID; - Folder.DefaultType = type; - Folder.FolderName = folderName; - Folder.ParentID = parent; - this.InventoryFolders.Add(Folder.FolderID, Folder); - } - - return (true); - } - - public bool HasFolder(LLUUID folderID) - { - if (this.InventoryFolders.ContainsKey(folderID)) - { - return true; - } - return false; - } - - public LLUUID GetFolderID(string folderName) - { - foreach (InventoryFolder inv in this.InventoryFolders.Values) - { - if (inv.FolderName == folderName) - { - return inv.FolderID; - } - } - - return LLUUID.Zero; - } - - public bool UpdateItemAsset(LLUUID itemID, AssetBase asset) - { - if(this.InventoryItems.ContainsKey(itemID)) - { - InventoryItem Item = this.InventoryItems[itemID]; - Item.AssetID = asset.FullID; - Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated()); - //TODO need to update the rest of the info - } - return true; - } - - public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet) - { - Console.WriteLine("updating inventory item details"); - if (this.InventoryItems.ContainsKey(itemID)) - { - Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name)); - InventoryItem Item = this.InventoryItems[itemID]; - Item.Name = Util.FieldToString(packet.Name); - Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated()); - //TODO need to update the rest of the info - } - return true; - } - - public LLUUID AddToInventory(LLUUID folderID, AssetBase asset) - { - if (this.InventoryFolders.ContainsKey(folderID)) - { - LLUUID NewItemID = LLUUID.Random(); - - InventoryItem Item = new InventoryItem(); - Item.FolderID = folderID; - Item.OwnerID = AgentID; - Item.AssetID = asset.FullID; - Item.ItemID = NewItemID; - Item.Type = asset.Type; - Item.Name = asset.Name; - Item.Description = asset.Description; - Item.InvType = asset.InvType; - this.InventoryItems.Add(Item.ItemID, Item); - InventoryFolder Folder = InventoryFolders[Item.FolderID]; - Folder.Items.Add(Item); - return (Item.ItemID); - } - else - { - return (null); - } - } - - public bool DeleteFromInventory(LLUUID itemID) - { - bool res = false; - if (this.InventoryItems.ContainsKey(itemID)) - { - InventoryItem item = this.InventoryItems[itemID]; - this.InventoryItems.Remove(itemID); - foreach (InventoryFolder fold in InventoryFolders.Values) - { - if (fold.Items.Contains(item)) - { - fold.Items.Remove(item); - break; - } - } - res = true; - - } - return res; - } - } - - public class InventoryFolder - { - public List Items; - //public List Subfolders; - public LLUUID FolderID; - public LLUUID OwnerID; - public LLUUID ParentID = LLUUID.Zero; - public string FolderName; - public ushort DefaultType; - public ushort Version; - - public InventoryFolder() - { - Items = new List(); - //Subfolders = new List(); - } - - } - - public class InventoryItem - { - public LLUUID FolderID; - public LLUUID OwnerID; - public LLUUID ItemID; - public LLUUID AssetID; - public LLUUID CreatorID; - public sbyte InvType; - public sbyte Type; - public string Name =""; - public string Description; - - public InventoryItem() - { - this.CreatorID = LLUUID.Zero; - } - - public string ExportString() - { - string typ = "notecard"; - string result = ""; - result += "\tinv_object\t0\n\t{\n"; - result += "\t\tobj_id\t%s\n"; - result += "\t\tparent_id\t"+ ItemID.ToString() +"\n"; - result += "\t\ttype\t"+ typ +"\n"; - result += "\t\tname\t" + Name+"|\n"; - result += "\t}\n"; - return result; - } - } - - public class AvatarWearable - { - public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000"); - public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); - - public AvatarWearable() - { - - } - } -} diff --git a/Common/OpenSim.Framework/BlockingQueue.cs b/Common/OpenSim.Framework/BlockingQueue.cs deleted file mode 100644 index 667b8d8..0000000 --- a/Common/OpenSim.Framework/BlockingQueue.cs +++ /dev/null @@ -1,60 +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.Threading; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Framework.Utilities -{ - 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/Common/OpenSim.Framework/HeightMapGenHills.cs b/Common/OpenSim.Framework/HeightMapGenHills.cs deleted file mode 100644 index 9777b82..0000000 --- a/Common/OpenSim.Framework/HeightMapGenHills.cs +++ /dev/null @@ -1,150 +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; - -namespace OpenSim.Framework.Terrain -{ - public class HeightmapGenHills - { - private Random Rand = new Random(); - private int NumHills; - private float HillMin; - private float HillMax; - private bool Island; - private float[] heightmap; - - public float[] GenerateHeightmap(int numHills, float hillMin, float hillMax, bool island) - { - NumHills = numHills; - HillMin = hillMin; - HillMax = hillMax; - Island = island; - - heightmap = new float[256 * 256]; - - for (int i = 0; i < numHills; i++) - { - AddHill(); - } - - Normalize(); - - return heightmap; - } - - private void AddHill() - { - float x, y; - float radius = RandomRange(HillMin, HillMax); - - if (Island) - { - // Which direction from the center of the map the hill is placed - float theta = RandomRange(0, 6.28f); - - // How far from the center of the map to place the hill. The radius - // is subtracted from the range to prevent any part of the hill from - // reaching the edge of the map - float distance = RandomRange(radius / 2.0f, 128.0f - radius); - - x = 128.0f + (float)Math.Cos(theta) * distance; - y = 128.0f + (float)Math.Sin(theta) * distance; - } - else - { - x = RandomRange(-radius, 256.0f + radius); - y = RandomRange(-radius, 256.0f + radius); - } - - float radiusSq = radius * radius; - float distSq; - float height; - - int xMin = (int)(x - radius) - 1; - int xMax = (int)(x + radius) + 1; - if (xMin < 0) xMin = 0; - if (xMax > 255) xMax = 255; - - int yMin = (int)(y - radius) - 1; - int yMax = (int)(y + radius) + 1; - if (yMin < 0) yMin = 0; - if (yMax > 255) yMax = 255; - - // Loop through each affected cell and determine the height at that point - for (int v = yMin; v <= yMax; ++v) - { - float fv = (float)v; - - for (int h = xMin; h <= xMax; ++h) - { - float fh = (float)h; - - // Determine how far from the center of this hill this point is - distSq = (x - fh) * (x - fh) + (y - fv) * (y - fv); - height = radiusSq - distSq; - - // Don't add negative hill values - if (height > 0.0f) heightmap[h + v * 256] += height; - } - } - } - - private void Normalize() - { - float min = heightmap[0]; - float max = heightmap[0]; - - for (int x = 0; x < 256; x++) - { - for (int y = 0; y < 256; y++) - { - if (heightmap[x + y * 256] < min) min = heightmap[x + y * 256]; - if (heightmap[x + y * 256] > max) max = heightmap[x + y * 256]; - } - } - - // Avoid a rare divide by zero - if (min != max) - { - for (int x = 0; x < 256; x++) - { - for (int y = 0; y < 256; y++) - { - heightmap[x + y * 256] = ((heightmap[x + y * 256] - min) / (max - min)) * (HillMax - HillMin); - } - } - } - } - - private float RandomRange(float min, float max) - { - return (float)Rand.NextDouble() * (max - min) + min; - } - } -} diff --git a/Common/OpenSim.Framework/Interfaces/IAssetServer.cs b/Common/OpenSim.Framework/Interfaces/IAssetServer.cs deleted file mode 100644 index 3f86acc..0000000 --- a/Common/OpenSim.Framework/Interfaces/IAssetServer.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* -* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ -using System; -using System.Net; -using System.Net.Sockets; -using System.IO; -using System.Threading; -using libsecondlife; -using OpenSim.Framework.Types; - -namespace OpenSim.Framework.Interfaces -{ - /// - /// Description of IAssetServer. - /// - - public interface IAssetServer - { - void SetReceiver(IAssetReceiver receiver); - void RequestAsset(LLUUID assetID, bool isTexture); - void UpdateAsset(AssetBase asset); - void UploadNewAsset(AssetBase asset); - void SetServerInfo(string ServerUrl, string ServerKey); - void Close(); - } - - // could change to delegate? - public interface IAssetReceiver - { - void AssetReceived(AssetBase asset, bool IsTexture); - void AssetNotFound(AssetBase asset); - } - - public interface IAssetPlugin - { - IAssetServer GetAssetServer(); - } - - public struct ARequest - { - public LLUUID AssetID; - public bool IsTexture; - } -} diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs deleted file mode 100644 index 9f7b619..0000000 --- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Inventory; -using libsecondlife; -using libsecondlife.Packets; -using OpenSim.Framework.Types; - -namespace OpenSim.Framework.Interfaces -{ - public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); - public delegate void RezObject(AssetBase primAsset, LLVector3 pos); - public delegate void ModifyTerrain(byte action, float north, float west); - public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); - public delegate void StartAnim(LLUUID animID, int seq); - public delegate void LinkObjects(uint parent, List children); - - public interface IClientAPI - { - event ChatFromViewer OnChatFromViewer; - event RezObject OnRezObject; - event ModifyTerrain OnModifyTerrain; - event SetAppearance OnSetAppearance; - event StartAnim OnStartAnim; - event LinkObjects OnLinkObjects; - - LLVector3 StartPos - { - get; - set; - } - void SendAppearance(AvatarWearable[] wearables); - void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); - } -} diff --git a/Common/OpenSim.Framework/Interfaces/IConfig.cs b/Common/OpenSim.Framework/Interfaces/IConfig.cs deleted file mode 100644 index 7b4c040..0000000 --- a/Common/OpenSim.Framework/Interfaces/IConfig.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (c) OpenSim project, http://osgrid.org/ - -* Copyright (c) , -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using libsecondlife; -//using OpenSim.world; - -namespace OpenSim.Framework.Interfaces -{ - /// - /// This class handles connection to the underlying database used for configuration of the region. - /// Region content is also stored by this class. The main entry point is InitConfig() which attempts to locate - /// opensim.yap in the current working directory. If opensim.yap can not be found, default settings are loaded from - /// what is hardcoded here and then saved into opensim.yap for future startups. - /// - - - public abstract class SimConfig - { - public string RegionName; - - public uint RegionLocX; - public uint RegionLocY; - public ulong RegionHandle; - - public int IPListenPort; - public string IPListenAddr; - - public string AssetURL; - public string AssetSendKey; - - public string GridURL; - public string GridSendKey; - public string GridRecvKey; - public string UserURL; - public string UserSendKey; - public string UserRecvKey; - - public abstract void InitConfig(bool sandboxMode); - public abstract void LoadFromGrid(); - - } - - public interface ISimConfig - { - SimConfig GetConfigObject(); - } -} diff --git a/Common/OpenSim.Framework/Interfaces/IGenericConfig.cs b/Common/OpenSim.Framework/Interfaces/IGenericConfig.cs deleted file mode 100644 index a853fe4..0000000 --- a/Common/OpenSim.Framework/Interfaces/IGenericConfig.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Framework.Interfaces -{ - public interface IGenericConfig - { - void LoadData(); - string GetAttribute(string attributeName); - bool SetAttribute(string attributeName, string attributeValue); - void Commit(); - void Close(); - } -} diff --git a/Common/OpenSim.Framework/Interfaces/IGridConfig.cs b/Common/OpenSim.Framework/Interfaces/IGridConfig.cs deleted file mode 100644 index b2f26da..0000000 --- a/Common/OpenSim.Framework/Interfaces/IGridConfig.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright (c) OpenSim project, http://osgrid.org/ - -* Copyright (c) , -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using libsecondlife; -//using OpenSim.world; - -namespace OpenSim.Framework.Interfaces -{ - /// - /// - - - public abstract class GridConfig - { - public string GridOwner; - public string DefaultStartupMsg; - public string DefaultAssetServer; - public string AssetSendKey; - public string AssetRecvKey; - public string DefaultUserServer; - public string UserSendKey; - public string UserRecvKey; - public string SimSendKey; - public string SimRecvKey; - - - public abstract void InitConfig(); - - } - - public interface IGridConfig - { - GridConfig GetConfigObject(); - } -} diff --git a/Common/OpenSim.Framework/Interfaces/IGridServer.cs b/Common/OpenSim.Framework/Interfaces/IGridServer.cs deleted file mode 100644 index e67ea98..0000000 --- a/Common/OpenSim.Framework/Interfaces/IGridServer.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* -* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; -using System.IO; -using libsecondlife; -using OpenSim; -using OpenSim.Framework.Types; - -namespace OpenSim.Framework.Interfaces -{ - /// - /// Handles connection to Grid Servers. - /// also Sim to Sim connections? - /// - - public interface IGridServer - { - UUIDBlock RequestUUIDBlock(); - NeighbourInfo[] RequestNeighbours(); //should return a array of neighbouring regions - AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode); - bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode); - string GetName(); - bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port); - void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); - IList RequestMapBlocks(int minX, int minY, int maxX, int maxY); - void Close(); - } - - public struct UUIDBlock - { - public LLUUID BlockStart; - public LLUUID BlockEnd; - } - - public class AuthenticateResponse - { - public bool Authorised; - public Login LoginInfo; - - public AuthenticateResponse() - { - - } - - } - - public interface IGridPlugin - { - IGridServer GetGridServer(); - } -} diff --git a/Common/OpenSim.Framework/Interfaces/ILocalStorage.cs b/Common/OpenSim.Framework/Interfaces/ILocalStorage.cs deleted file mode 100644 index dd17b72..0000000 --- a/Common/OpenSim.Framework/Interfaces/ILocalStorage.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* -* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ - -using System; -using libsecondlife; -using OpenSim.Framework.Types; - -namespace OpenSim.Framework.Interfaces -{ - /// - /// ILocalStorage. Really hacked together right now needs cleaning up - /// - public interface ILocalStorage - { - void Initialise(string datastore); - - void StorePrim(PrimData prim); - void RemovePrim(LLUUID primID); - void LoadPrimitives(ILocalStorageReceiver receiver); - - float[] LoadWorld(); - void SaveMap(float[] heightmap); - - void SaveParcels(ParcelData[] parcels); - void SaveParcel(ParcelData parcel); - void RemoveParcel(ParcelData parcel); - void RemoveAllParcels(); - void LoadParcels(ILocalStorageParcelReceiver recv); - - void ShutDown(); - } - - public interface ILocalStorageReceiver - { - void PrimFromStorage(PrimData prim); - } - - public interface ILocalStorageParcelReceiver - { - void ParcelFromStorage(ParcelData data); - void NoParcelDataFromStorage(); - } -} - diff --git a/Common/OpenSim.Framework/Interfaces/IScriptAPI.cs b/Common/OpenSim.Framework/Interfaces/IScriptAPI.cs deleted file mode 100644 index 3ad0f06..0000000 --- a/Common/OpenSim.Framework/Interfaces/IScriptAPI.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Types; - -namespace OpenSim.Framework.Interfaces -{ - public interface IScriptAPI - { - OSVector3 GetEntityPosition(uint localID); - void SetEntityPosition(uint localID, float x, float y, float z); - uint GetRandomAvatarID(); - } -} diff --git a/Common/OpenSim.Framework/Interfaces/IScriptEngine.cs b/Common/OpenSim.Framework/Interfaces/IScriptEngine.cs deleted file mode 100644 index ed8974c..0000000 --- a/Common/OpenSim.Framework/Interfaces/IScriptEngine.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Framework.Interfaces -{ - public interface IScriptEngine - { - bool Init(IScriptAPI api); - string GetName(); - void LoadScript(string script, string scriptName, uint entityID); - void OnFrame(); - } -} diff --git a/Common/OpenSim.Framework/Interfaces/IUserConfig.cs b/Common/OpenSim.Framework/Interfaces/IUserConfig.cs deleted file mode 100644 index e15867d..0000000 --- a/Common/OpenSim.Framework/Interfaces/IUserConfig.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright (c) OpenSim project, http://osgrid.org/ - -* Copyright (c) , -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using libsecondlife; -//using OpenSim.world; - -namespace OpenSim.Framework.Interfaces -{ - /// - /// - - - public abstract class UserConfig - { - public string DefaultStartupMsg; - public string GridServerURL; - public string GridSendKey; - public string GridRecvKey; - - - public abstract void InitConfig(); - - } - - public interface IUserConfig - { - UserConfig GetConfigObject(); - } -} diff --git a/Common/OpenSim.Framework/Interfaces/IUserServer.cs b/Common/OpenSim.Framework/Interfaces/IUserServer.cs deleted file mode 100644 index 21f2721..0000000 --- a/Common/OpenSim.Framework/Interfaces/IUserServer.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Inventory; -using libsecondlife; - -namespace OpenSim.Framework.Interfaces -{ - public interface IUserServer - { - AgentInventory RequestAgentsInventory(LLUUID agentID); - void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); - bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory); - } -} diff --git a/Common/OpenSim.Framework/Interfaces/LocalGridBase.cs b/Common/OpenSim.Framework/Interfaces/LocalGridBase.cs deleted file mode 100644 index ff46502..0000000 --- a/Common/OpenSim.Framework/Interfaces/LocalGridBase.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Types; -using System.Collections; - -namespace OpenSim.Framework.Interfaces -{ - public abstract class LocalGridBase : IGridServer - { - public abstract UUIDBlock RequestUUIDBlock(); - public abstract NeighbourInfo[] RequestNeighbours(); - public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode); - public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode); - public abstract string GetName(); - public abstract bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port); - public abstract void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); - public abstract void AddNewSession(Login session); - public abstract IList RequestMapBlocks(int minX, int minY, int maxX, int maxY); - public abstract void Close(); - } - -} diff --git a/Common/OpenSim.Framework/Interfaces/RemoteGridBase.cs b/Common/OpenSim.Framework/Interfaces/RemoteGridBase.cs deleted file mode 100644 index ed13ed5..0000000 --- a/Common/OpenSim.Framework/Interfaces/RemoteGridBase.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Types; - -namespace OpenSim.Framework.Interfaces -{ - public abstract class RemoteGridBase : IGridServer - { - public abstract Dictionary agentcircuits - { - get; - set; - } - - public abstract UUIDBlock RequestUUIDBlock(); - public abstract NeighbourInfo[] RequestNeighbours(); - public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode); - public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode); - public abstract string GetName(); - public abstract bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port); - public abstract void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); - public abstract IList RequestMapBlocks(int minX, int minY, int maxX, int maxY); - public abstract void Close(); - public abstract Hashtable GridData { - get; - set; - } - - public abstract ArrayList neighbours { - get; - set; - } - } -} diff --git a/Common/OpenSim.Framework/LoginService.cs b/Common/OpenSim.Framework/LoginService.cs deleted file mode 100644 index a4f3cc8..0000000 --- a/Common/OpenSim.Framework/LoginService.cs +++ /dev/null @@ -1,42 +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.Collections; -using System.Collections.Generic; -using System.Text; -using Nwc.XmlRpc; -using libsecondlife; - -namespace OpenSim.Framework.Grid -{ - public abstract class LoginService - { - - } -} \ No newline at end of file diff --git a/Common/OpenSim.Framework/OpenSim.Framework.csproj b/Common/OpenSim.Framework/OpenSim.Framework.csproj deleted file mode 100644 index 4cedbd9..0000000 --- a/Common/OpenSim.Framework/OpenSim.Framework.csproj +++ /dev/null @@ -1,200 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {8ACA2445-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Framework - JScript - Grid - IE50 - false - Library - - OpenSim.Framework - - - - - - 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 - - - System.dll - False - - - System.Xml.dll - False - - - - - XMLRPC - {8E81D43C-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/Common/OpenSim.Framework/OpenSim.Framework.dll.build b/Common/OpenSim.Framework/OpenSim.Framework.dll.build deleted file mode 100644 index 4d95c7d..0000000 --- a/Common/OpenSim.Framework/OpenSim.Framework.dll.build +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Common/OpenSim.Framework/Properties/AssemblyInfo.cs b/Common/OpenSim.Framework/Properties/AssemblyInfo.cs deleted file mode 100644 index 86f5cdb..0000000 --- a/Common/OpenSim.Framework/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OpenSim.FrameWork")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenSim.FrameWork")] -[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("a08e20c7-f191-4137-b1f0-9291408fa521")] - -// 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/Common/OpenSim.Framework/Remoting.cs b/Common/OpenSim.Framework/Remoting.cs deleted file mode 100644 index 660cdde..0000000 --- a/Common/OpenSim.Framework/Remoting.cs +++ /dev/null @@ -1,137 +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.Collections.Generic; -using System.Text; -using System.Security.Cryptography; - -namespace OpenSim.Framework -{ - /// - /// NEEDS AUDIT. - /// - /// - /// Suggested implementation - /// Store two digests for each foreign host. A local copy of the local hash using the local challenge (when issued), and a local copy of the remote hash using the remote challenge. - /// When sending data to the foreign host - run 'Sign' on the data and affix the returned byte[] to the message. - /// When recieving data from the foreign host - run 'Authenticate' against the data and the attached byte[]. - /// Both hosts should be performing these operations for this to be effective. - /// - class RemoteDigest - { - private byte[] currentHash; - private byte[] secret; - - private SHA512Managed SHA512; - - /// - /// Initialises a new RemoteDigest authentication mechanism - /// - /// Needs an audit by a cryptographic professional - was not "roll your own"'d by choice but rather a serious lack of decent authentication mechanisms in .NET remoting - /// The shared secret between systems (for inter-sim, this is provided in encrypted form during connection, for grid this is input manually in setup) - /// Binary salt - some common value - to be decided what - /// The challenge key provided by the third party - public RemoteDigest(string sharedSecret, byte[] salt, string challenge) - { - SHA512 = new SHA512Managed(); - Rfc2898DeriveBytes RFC2898 = new Rfc2898DeriveBytes(sharedSecret,salt); - secret = RFC2898.GetBytes(512); - ASCIIEncoding ASCII = new ASCIIEncoding(); - - currentHash = SHA512.ComputeHash(AppendArrays(secret, ASCII.GetBytes(challenge))); - } - - /// - /// Authenticates a piece of incoming data against the local digest. Upon successful authentication, digest string is incremented. - /// - /// The incoming data - /// The remote digest - /// - public bool Authenticate(byte[] data, byte[] digest) - { - byte[] newHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); - if (digest == newHash) - { - currentHash = newHash; - return true; - } - else - { - throw new Exception("Hash comparison failed. Key resync required."); - } - } - - /// - /// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message. - /// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the - /// hashes will get out of sync and throw an exception when validation is attempted. - /// - /// The outgoing data - /// The local digest - public byte[] Sign(byte[] data) - { - currentHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); - return currentHash; - } - - /// - /// Generates a new challenge string to be issued to a foreign host. Challenges are 1024-bit (effective strength of less than 512-bits) messages generated using the Crytographic Random Number Generator. - /// - /// A 128-character hexadecimal string containing the challenge. - public static string GenerateChallenge() - { - RNGCryptoServiceProvider RNG = new RNGCryptoServiceProvider(); - byte[] bytes = new byte[64]; - RNG.GetBytes(bytes); - - StringBuilder sb = new StringBuilder(bytes.Length * 2); - foreach (byte b in bytes) - { - sb.AppendFormat("{0:x2}", b); - } - return sb.ToString(); - } - - /// - /// Helper function, merges two byte arrays - /// - /// Sourced from MSDN Forum - /// A - /// B - /// C - private byte[] AppendArrays(byte[] a, byte[] b) - { - byte[] c = new byte[a.Length + b.Length]; - Buffer.BlockCopy(a, 0, c, 0, a.Length); - Buffer.BlockCopy(b, 0, c, a.Length, b.Length); - return c; - } - - } -} diff --git a/Common/OpenSim.Framework/SimProfile.cs b/Common/OpenSim.Framework/SimProfile.cs deleted file mode 100644 index 0d79ee9..0000000 --- a/Common/OpenSim.Framework/SimProfile.cs +++ /dev/null @@ -1,110 +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.Collections.Generic; -using System.Collections; -using System.Xml; -using System.Text; -using libsecondlife; -using Nwc.XmlRpc; - -namespace OpenSim.Framework.Sims -{ - public class SimProfile : SimProfileBase - { - public SimProfile LoadFromGrid(ulong region_handle, string GridURL, string SendKey, string RecvKey) - { - try - { - Hashtable GridReqParams = new Hashtable(); - GridReqParams["region_handle"] = region_handle.ToString(); - GridReqParams["authkey"] = SendKey; - ArrayList SendParams = new ArrayList(); - SendParams.Add(GridReqParams); - XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); - - XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); - - Hashtable RespData = (Hashtable)GridResp.Value; - this.UUID = new LLUUID((string)RespData["UUID"]); - this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256)); - this.regionname = (string)RespData["regionname"]; - this.sim_ip = (string)RespData["sim_ip"]; - this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); - this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/"; - this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]); - this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]); - this.sendkey = SendKey; - this.recvkey = RecvKey; - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - return this; - } - - public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey) - { - try - { - Hashtable GridReqParams = new Hashtable(); - GridReqParams["UUID"] = UUID.ToString(); - GridReqParams["authkey"] = SendKey; - ArrayList SendParams = new ArrayList(); - SendParams.Add(GridReqParams); - XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); - - XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); - - Hashtable RespData = (Hashtable)GridResp.Value; - this.UUID = new LLUUID((string)RespData["UUID"]); - this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256)); - this.regionname = (string)RespData["regionname"]; - this.sim_ip = (string)RespData["sim_ip"]; - this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); - this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/"; - this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]); - this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]); - this.sendkey = SendKey; - this.recvkey = RecvKey; - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - return this; - } - - - public SimProfile() - { - } - } - -} diff --git a/Common/OpenSim.Framework/SimProfileBase.cs b/Common/OpenSim.Framework/SimProfileBase.cs deleted file mode 100644 index bab18be..0000000 --- a/Common/OpenSim.Framework/SimProfileBase.cs +++ /dev/null @@ -1,54 +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.Collections.Generic; -using System.Text; -using libsecondlife; - -namespace OpenSim.Framework.Sims -{ - [System.Obsolete("Depreciated, use SimProfileData instead")] - public class SimProfileBase - { - public LLUUID UUID; - public ulong regionhandle; - public string regionname; - public string sim_ip; - public uint sim_port; - public string caps_url; - public uint RegionLocX; - public uint RegionLocY; - public string sendkey; - public string recvkey; - public bool online; - - public SimProfileBase() - { - } - } -} diff --git a/Common/OpenSim.Framework/Types/AgentCircuitData.cs b/Common/OpenSim.Framework/Types/AgentCircuitData.cs deleted file mode 100644 index de79ce2..0000000 --- a/Common/OpenSim.Framework/Types/AgentCircuitData.cs +++ /dev/null @@ -1,50 +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.Collections.Generic; -using System.Text; -using libsecondlife; - -namespace OpenSim.Framework.Types -{ - public class AgentCircuitData - { - public AgentCircuitData() { } - public LLUUID AgentID; - public LLUUID SessionID; - public LLUUID SecureSessionID; - public LLVector3 startpos; - public string firstname; - public string lastname; - public uint circuitcode; - public bool child; - public LLUUID InventoryFolder; - public LLUUID BaseFolder; - } -} diff --git a/Common/OpenSim.Framework/Types/AssetBase.cs b/Common/OpenSim.Framework/Types/AssetBase.cs deleted file mode 100644 index 86586a6..0000000 --- a/Common/OpenSim.Framework/Types/AssetBase.cs +++ /dev/null @@ -1,49 +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.Collections.Generic; -using System.Text; -using libsecondlife; - -namespace OpenSim.Framework.Types -{ - public class AssetBase - { - public byte[] Data; - public LLUUID FullID; - public sbyte Type; - public sbyte InvType; - public string Name; - public string Description; - - public AssetBase() - { - - } - } -} diff --git a/Common/OpenSim.Framework/Types/AssetLandmark.cs b/Common/OpenSim.Framework/Types/AssetLandmark.cs deleted file mode 100644 index 8a10b70..0000000 --- a/Common/OpenSim.Framework/Types/AssetLandmark.cs +++ /dev/null @@ -1,61 +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.Collections.Generic; -using System.Text; -using libsecondlife; - -namespace OpenSim.Framework.Types -{ - public class AssetLandmark : AssetBase - { - public int Version; - public LLVector3 Position; - public LLUUID RegionID; - - public AssetLandmark(AssetBase a) - { - this.Data = a.Data; - this.FullID = a.FullID; - this.Type = a.Type; - this.InvType = a.InvType; - this.Name = a.Name; - this.Description = a.Description; - InternData(); - } - - private void InternData() - { - string temp = System.Text.Encoding.UTF8.GetString(Data).Trim(); - string[] parts = temp.Split('\n'); - int.TryParse(parts[0].Substring(17, 1), out Version); - LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID); - LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position); - } - } -} diff --git a/Common/OpenSim.Framework/Types/AssetStorage.cs b/Common/OpenSim.Framework/Types/AssetStorage.cs deleted file mode 100644 index 8cac23a..0000000 --- a/Common/OpenSim.Framework/Types/AssetStorage.cs +++ /dev/null @@ -1,50 +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.Collections.Generic; -using System.Text; -using libsecondlife; - -namespace OpenSim.Framework.Types -{ - public class AssetStorage - { - - public AssetStorage() { - } - - public AssetStorage(LLUUID assetUUID) { - UUID=assetUUID; - } - - public byte[] Data; - public sbyte Type; - public string Name; - public LLUUID UUID; - } -} diff --git a/Common/OpenSim.Framework/Types/EstateSettings.cs b/Common/OpenSim.Framework/Types/EstateSettings.cs deleted file mode 100644 index baa3eef..0000000 --- a/Common/OpenSim.Framework/Types/EstateSettings.cs +++ /dev/null @@ -1,96 +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.Collections.Generic; -using System.Text; - -using libsecondlife; - -namespace OpenSim.Framework.Types -{ - public class EstateSettings - { - //Settings to this island - public float billableFactor = (float)0.0; - public uint estateID = 0; - public uint parentEstateID = 0; - - public byte maxAgents = 40; - public float objectBonusFactor = (float)1.0; - - public int redirectGridX = 0; //?? - public int redirectGridY = 0; //?? - public libsecondlife.Simulator.RegionFlags regionFlags = libsecondlife.Simulator.RegionFlags.None; //Booleam values of various region settings - public libsecondlife.Simulator.SimAccess simAccess = libsecondlife.Simulator.SimAccess.Mature; //Is sim PG, Mature, etc? Mature by default. - public float sunHour = 0; - - public float terrainRaiseLimit = 0; - public float terrainLowerLimit = 0; - - public bool useFixedSun = false; - public int pricePerMeter = 1; - - public ushort regionWaterHeight = 20; - public bool regionAllowTerraform = true; - - // Region Information - // Low resolution 'base' textures. No longer used. - public LLUUID terrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); // Default - public LLUUID terrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); // Default - public LLUUID terrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); // Default - public LLUUID terrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); // Default - - // Higher resolution terrain textures - public LLUUID terrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000"); - public LLUUID terrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000"); - public LLUUID terrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000"); - public LLUUID terrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000"); - - // First quad - each point is bilinearly interpolated at each meter of terrain - public float terrainStartHeight0 = 10.0f; - public float terrainStartHeight1 = 10.0f; - public float terrainStartHeight2 = 10.0f; - public float terrainStartHeight3 = 10.0f; - - // Second quad - also bilinearly interpolated. - // Terrain texturing is done that: - // 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y] - public float terrainHeightRange0 = 60.0f; //00 - public float terrainHeightRange1 = 60.0f; //01 - public float terrainHeightRange2 = 60.0f; //10 - public float terrainHeightRange3 = 60.0f; //11 - - // Terrain Default (Must be in F32 Format!) - public string terrainFile = "default.r32"; - public double terrainMultiplier = 60.0; - public float waterHeight = (float)20.0; - - - } -} diff --git a/Common/OpenSim.Framework/Types/Login.cs b/Common/OpenSim.Framework/Types/Login.cs deleted file mode 100644 index 2737cbb..0000000 --- a/Common/OpenSim.Framework/Types/Login.cs +++ /dev/null @@ -1,52 +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.Collections.Generic; -using System.Text; -using libsecondlife; - -namespace OpenSim.Framework.Types -{ - public class Login - { - public string First = "Test"; - public string Last = "User"; - public LLUUID Agent; - public LLUUID Session; - public LLUUID SecureSession = LLUUID.Zero; - public LLUUID InventoryFolder; - public LLUUID BaseFolder; - public uint CircuitCode; - - public Login() - { - - } - } -} diff --git a/Common/OpenSim.Framework/Types/NeighbourInfo.cs b/Common/OpenSim.Framework/Types/NeighbourInfo.cs deleted file mode 100644 index e3e9dbb..0000000 --- a/Common/OpenSim.Framework/Types/NeighbourInfo.cs +++ /dev/null @@ -1,47 +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.Collections.Generic; -using System.Text; - -namespace OpenSim.Framework.Types -{ - public class NeighbourInfo - { - public NeighbourInfo() - { - } - - public ulong regionhandle; - public uint RegionLocX; - public uint RegionLocY; - public string sim_ip; - public uint sim_port; - } -} diff --git a/Common/OpenSim.Framework/Types/OSVector3.cs b/Common/OpenSim.Framework/Types/OSVector3.cs deleted file mode 100644 index 7e3a849..0000000 --- a/Common/OpenSim.Framework/Types/OSVector3.cs +++ /dev/null @@ -1,46 +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.Collections.Generic; -using System.Text; - -namespace OpenSim.Framework.Types -{ - public class OSVector3 - { - public float X; - public float Y; - public float Z; - - public OSVector3() - { - - } - } -} diff --git a/Common/OpenSim.Framework/Types/ParcelData.cs b/Common/OpenSim.Framework/Types/ParcelData.cs deleted file mode 100644 index 40f128a..0000000 --- a/Common/OpenSim.Framework/Types/ParcelData.cs +++ /dev/null @@ -1,115 +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.Collections.Generic; -using System.Text; -using libsecondlife; - -namespace OpenSim.Framework.Types -{ - - public class ParcelData - { - public byte[] parcelBitmapByteArray = new byte[512]; - public string parcelName = ""; - public string parcelDesc = ""; - public LLUUID ownerID = new LLUUID(); - public bool isGroupOwned = false; - public LLVector3 AABBMin = new LLVector3(); - public LLVector3 AABBMax = new LLVector3(); - public int area = 0; - public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned - public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID - public libsecondlife.Parcel.ParcelCategory category = new libsecondlife.Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category - public int claimDate = 0; //Unemplemented - public int claimPrice = 0; //Unemplemented - public LLUUID groupID = new LLUUID(); //Unemplemented - public int groupPrims = 0; //Unemplemented - public int salePrice = 0; //Unemeplemented. Parcels price. - public libsecondlife.Parcel.ParcelStatus parcelStatus = libsecondlife.Parcel.ParcelStatus.None; - public libsecondlife.Parcel.ParcelFlags parcelFlags = libsecondlife.Parcel.ParcelFlags.None; - public byte landingType = 0; - public byte mediaAutoScale = 0; - public LLUUID mediaID = LLUUID.Zero; - public int localID = 0; - public LLUUID globalID = new LLUUID(); - - public string mediaURL = ""; - public string musicURL = ""; - public float passHours = 0; - public int passPrice = 0; - public LLUUID snapshotID = LLUUID.Zero; - public LLVector3 userLocation = new LLVector3(); - public LLVector3 userLookAt = new LLVector3(); - - public ParcelData() - { - globalID = LLUUID.Random(); - } - - public ParcelData Copy() - { - ParcelData parcelData = new ParcelData(); - - parcelData.AABBMax = this.AABBMax; - parcelData.AABBMin = this.AABBMin; - parcelData.area = this.area; - parcelData.auctionID = this.auctionID; - parcelData.authBuyerID = this.authBuyerID; - parcelData.category = this.category; - parcelData.claimDate = this.claimDate; - parcelData.claimPrice = this.claimPrice; - parcelData.globalID = this.globalID; - parcelData.groupID = this.groupID; - parcelData.groupPrims = this.groupPrims; - parcelData.isGroupOwned = this.isGroupOwned; - parcelData.localID = this.localID; - parcelData.landingType = this.landingType; - parcelData.mediaAutoScale = this.mediaAutoScale; - parcelData.mediaID = this.mediaID; - parcelData.mediaURL = this.mediaURL; - parcelData.musicURL = this.musicURL; - parcelData.ownerID = this.ownerID; - parcelData.parcelBitmapByteArray = (byte[])this.parcelBitmapByteArray.Clone(); - parcelData.parcelDesc = this.parcelDesc; - parcelData.parcelFlags = this.parcelFlags; - parcelData.parcelName = this.parcelName; - parcelData.parcelStatus = this.parcelStatus; - parcelData.passHours = this.passHours; - parcelData.passPrice = this.passPrice; - parcelData.salePrice = this.salePrice; - parcelData.snapshotID = this.snapshotID; - parcelData.userLocation = this.userLocation; - parcelData.userLookAt = this.userLookAt; - - return parcelData; - - } - } - -} diff --git a/Common/OpenSim.Framework/Types/PrimData.cs b/Common/OpenSim.Framework/Types/PrimData.cs deleted file mode 100644 index a63be76..0000000 --- a/Common/OpenSim.Framework/Types/PrimData.cs +++ /dev/null @@ -1,201 +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.Collections.Generic; -using System.Text; -using libsecondlife; - -namespace OpenSim.Framework.Types -{ - public class PrimData - { - private const uint FULL_MASK_PERMISSIONS = 2147483647; - - public LLUUID OwnerID; - public byte PCode; - public ushort PathBegin; - public ushort PathEnd; - public byte PathScaleX; - public byte PathScaleY; - public byte PathShearX; - public byte PathShearY; - public sbyte PathSkew; - public ushort ProfileBegin; - public ushort ProfileEnd; - public LLVector3 Scale; - public byte PathCurve; - public byte ProfileCurve; - public uint ParentID = 0; - public ushort ProfileHollow; - public sbyte PathRadiusOffset; - public byte PathRevolutions; - public sbyte PathTaperX; - public sbyte PathTaperY; - public sbyte PathTwist; - public sbyte PathTwistBegin; - public byte[] Texture; - - - public Int32 CreationDate; - public uint OwnerMask = FULL_MASK_PERMISSIONS; - public uint NextOwnerMask = FULL_MASK_PERMISSIONS; - public uint GroupMask = FULL_MASK_PERMISSIONS; - public uint EveryoneMask = FULL_MASK_PERMISSIONS; - public uint BaseMask = FULL_MASK_PERMISSIONS; - - //following only used during prim storage - public LLVector3 Position; - public LLQuaternion Rotation = new LLQuaternion(0,1,0,0); - public uint LocalID; - public LLUUID FullID; - - public PrimData() - { - - } - - public PrimData(byte[] data) - { - int i =0; - - this.OwnerID = new LLUUID(data, i); i += 16; - this.PCode = data[i++]; - this.PathBegin = (ushort)(data[i++] + (data[i++] << 8)); - this.PathEnd = (ushort)(data[i++] + (data[i++] << 8)); - this.PathScaleX = data[i++]; - this.PathScaleY = data[i++]; - this.PathShearX = data[i++]; - this.PathShearY = data[i++]; - this.PathSkew = (sbyte)data[i++]; - this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8)); - this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8)); - this.Scale = new LLVector3(data, i); i += 12; - this.PathCurve = data[i++]; - this.ProfileCurve = data[i++]; - this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8)); - this.PathRadiusOffset = (sbyte)data[i++]; - this.PathRevolutions = data[i++]; - this.PathTaperX = (sbyte)data[i++]; - this.PathTaperY =(sbyte) data[i++]; - this.PathTwist = (sbyte) data[i++]; - this.PathTwistBegin = (sbyte) data[i++]; - ushort length = (ushort)(data[i++] + (data[i++] << 8)); - this.Texture = new byte[length]; - Array.Copy(data, i, Texture, 0, length); i += length; - this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.Position = new LLVector3(data, i); i += 12; - this.Rotation = new LLQuaternion(data,i, true); i += 12; - this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); - this.FullID = new LLUUID(data, i); i += 16; - - } - - public byte[] ToBytes() - { - int i = 0; - byte[] bytes = new byte[126 + Texture.Length]; - Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16; - bytes[i++] = this.PCode; - bytes[i++] = (byte)(this.PathBegin % 256); - bytes[i++] = (byte)((this.PathBegin >> 8) % 256); - bytes[i++] = (byte)(this.PathEnd % 256); - bytes[i++] = (byte)((this.PathEnd >> 8) % 256); - bytes[i++] = this.PathScaleX; - bytes[i++] = this.PathScaleY; - bytes[i++] = this.PathShearX; - bytes[i++] = this.PathShearY; - bytes[i++] = (byte)this.PathSkew; - bytes[i++] = (byte)(this.ProfileBegin % 256); - bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256); - bytes[i++] = (byte)(this.ProfileEnd % 256); - bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256); - Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12; - bytes[i++] = this.PathCurve; - bytes[i++] = this.ProfileCurve; - bytes[i++] = (byte)(ParentID % 256); - bytes[i++] = (byte)((ParentID >> 8) % 256); - bytes[i++] = (byte)((ParentID >> 16) % 256); - bytes[i++] = (byte)((ParentID >> 24) % 256); - bytes[i++] = (byte)(this.ProfileHollow %256); - bytes[i++] = (byte)((this.ProfileHollow >> 8)% 256); - bytes[i++] = ((byte)this.PathRadiusOffset); - bytes[i++] = this.PathRevolutions; - bytes[i++] = ((byte) this.PathTaperX); - bytes[i++] = ((byte) this.PathTaperY); - bytes[i++] = ((byte) this.PathTwist); - bytes[i++] = ((byte) this.PathTwistBegin); - bytes[i++] = (byte)(Texture.Length % 256); - bytes[i++] = (byte)((Texture.Length >> 8) % 256); - Array.Copy(Texture, 0, bytes, i, Texture.Length); i += Texture.Length; - bytes[i++] = (byte)(this.CreationDate % 256); - bytes[i++] = (byte)((this.CreationDate >> 8) % 256); - bytes[i++] = (byte)((this.CreationDate >> 16) % 256); - bytes[i++] = (byte)((this.CreationDate >> 24) % 256); - bytes[i++] = (byte)(this.OwnerMask % 256); - bytes[i++] = (byte)((this.OwnerMask >> 8) % 256); - bytes[i++] = (byte)((this.OwnerMask >> 16) % 256); - bytes[i++] = (byte)((this.OwnerMask >> 24) % 256); - bytes[i++] = (byte)(this.NextOwnerMask % 256); - bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256); - bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256); - bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256); - bytes[i++] = (byte)(this.GroupMask % 256); - bytes[i++] = (byte)((this.GroupMask >> 8) % 256); - bytes[i++] = (byte)((this.GroupMask >> 16) % 256); - bytes[i++] = (byte)((this.GroupMask >> 24) % 256); - bytes[i++] = (byte)(this.EveryoneMask % 256); - bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256); - bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256); - bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256); - bytes[i++] = (byte)(this.BaseMask % 256); - bytes[i++] = (byte)((this.BaseMask >> 8) % 256); - bytes[i++] = (byte)((this.BaseMask >> 16) % 256); - bytes[i++] = (byte)((this.BaseMask >> 24) % 256); - Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12; - if (this.Rotation == new LLQuaternion(0,0,0,0)) - { - this.Rotation = new LLQuaternion(0, 1, 0, 0); - } - Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12; - bytes[i++] = (byte)(this.LocalID % 256); - bytes[i++] = (byte)((this.LocalID >> 8) % 256); - bytes[i++] = (byte)((this.LocalID >> 16) % 256); - bytes[i++] = (byte)((this.LocalID >> 24) % 256); - Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16; - - return bytes; - } - } -} diff --git a/Common/OpenSim.Framework/UserProfile.cs b/Common/OpenSim.Framework/UserProfile.cs deleted file mode 100644 index 04ff20b..0000000 --- a/Common/OpenSim.Framework/UserProfile.cs +++ /dev/null @@ -1,89 +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.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Inventory; -using System.Security.Cryptography; - -namespace OpenSim.Framework.User -{ - public class UserProfile - { - - public string firstname; - public string lastname; - public ulong homeregionhandle; - public LLVector3 homepos; - public LLVector3 homelookat; - - public bool IsGridGod = false; - public bool IsLocal = true; // will be used in future for visitors from foreign grids - public string AssetURL; - public string MD5passwd; - - public LLUUID CurrentSessionID; - public LLUUID CurrentSecureSessionID; - public LLUUID UUID; - public Dictionary Circuits = new Dictionary(); // tracks circuit codes - - public AgentInventory Inventory; - - public UserProfile() - { - Circuits = new Dictionary(); - Inventory = new AgentInventory(); - homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256)); - homepos = new LLVector3(); - homelookat = new LLVector3(); - } - - public void InitSessionData() - { - RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); - - byte[] randDataS = new byte[16]; - byte[] randDataSS = new byte[16]; - - rand.GetBytes(randDataS); - rand.GetBytes(randDataSS); - - CurrentSecureSessionID = new LLUUID(randDataSS,0); - CurrentSessionID = new LLUUID(randDataS,0); - - } - - public void AddSimCircuit(uint circuitCode, LLUUID regionUUID) - { - if (this.Circuits.ContainsKey(regionUUID) == false) - this.Circuits.Add(regionUUID, circuitCode); - } - - } -} diff --git a/Common/OpenSim.Framework/UserProfileManager.cs b/Common/OpenSim.Framework/UserProfileManager.cs deleted file mode 100644 index a4dac05..0000000 --- a/Common/OpenSim.Framework/UserProfileManager.cs +++ /dev/null @@ -1,299 +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.Collections.Generic; -using System.Collections; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml; -using libsecondlife; -using Nwc.XmlRpc; -using OpenSim.Framework.Sims; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; - -namespace OpenSim.Framework.User -{ - public class UserProfileManager : UserProfileManagerBase - { - public string GridURL; - public string GridSendKey; - public string GridRecvKey; - public string DefaultStartupMsg; - - public UserProfileManager() - { - - } - - public void SetKeys(string sendKey, string recvKey, string url, string message) - { - GridRecvKey = recvKey; - GridSendKey = sendKey; - GridURL = url; - DefaultStartupMsg = message; - } - - public virtual string ParseXMLRPC(string requestBody) - { - - XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody); - - switch (request.MethodName) - { - case "login_to_simulator": - XmlRpcResponse response = XmlRpcLoginMethod(request); - - return (Regex.Replace(XmlRpcResponseSerializer.Singleton.Serialize(response), "utf-16", "utf-8")); - } - - return ""; - } - - public string RestDeleteUserSessionMethod( string request, string path, string param ) - { - LLUUID sessionid = new LLUUID(param); // get usersessions/sessionid - foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys) - { - if ( UserProfiles[UUID].CurrentSessionID == sessionid) - { - UserProfiles[UUID].CurrentSessionID = null; - UserProfiles[UUID].CurrentSecureSessionID = null; - UserProfiles[UUID].Circuits.Clear(); - } - } - - return "OK"; - } - - public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable requestData = (Hashtable)request.Params[0]; - - bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd")); - bool GoodLogin = false; - string firstname = ""; - string lastname = ""; - string passwd = ""; - - if (GoodXML) - { - firstname = (string)requestData["first"]; - lastname = (string)requestData["last"]; - passwd = (string)requestData["passwd"]; - GoodLogin = AuthenticateUser(firstname, lastname, passwd); - } - - - if (!(GoodXML && GoodLogin)) - { - response = CreateErrorConnectingToGridResponse(); - } - else - { - UserProfile TheUser = GetProfileByName(firstname, lastname); - //we need to sort out how sessions are logged out , currently the sim tells the gridserver - //but if as this suggests the userserver handles it then please have the sim telling the userserver instead - //as it really makes things messy for sandbox mode - //if (!((TheUser.CurrentSessionID == null) && (TheUser.CurrentSecureSessionID == null))) - // { - // response = CreateAlreadyLoggedInResponse(); - // } - //else - //{ - try - { - Hashtable responseData = new Hashtable(); - - LLUUID AgentID = TheUser.UUID; - TheUser.InitSessionData(); - - //for loading data from a grid server, make any changes in CustomiseResponse() (or create a sub class of this and override that method) - //SimProfile SimInfo = new SimProfile(); - //SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey); - - - Hashtable GlobalT = new Hashtable(); - GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271"; - GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; - GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; - ArrayList GlobalTextures = new ArrayList(); - GlobalTextures.Add(GlobalT); - - Hashtable LoginFlagsHash = new Hashtable(); - LoginFlagsHash["daylight_savings"] = "N"; - LoginFlagsHash["stipend_since_login"] = "N"; - LoginFlagsHash["gendered"] = "Y"; - LoginFlagsHash["ever_logged_in"] = "Y"; - ArrayList LoginFlags = new ArrayList(); - LoginFlags.Add(LoginFlagsHash); - - Hashtable uiconfig = new Hashtable(); - uiconfig["allow_first_life"] = "Y"; - ArrayList ui_config = new ArrayList(); - ui_config.Add(uiconfig); - - Hashtable ClassifiedCategoriesHash = new Hashtable(); - ClassifiedCategoriesHash["category_name"] = "bla bla"; - ClassifiedCategoriesHash["category_id"] = (Int32)1; - ArrayList ClassifiedCategories = new ArrayList(); - ClassifiedCategories.Add(ClassifiedCategoriesHash); - - ArrayList AgentInventory = new ArrayList(); - Console.WriteLine("adding inventory to response"); - Hashtable TempHash; - foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values) - { - TempHash = new Hashtable(); - Console.WriteLine("adding folder " + InvFolder.FolderName + ", ID: " + InvFolder.FolderID.ToStringHyphenated() + " with parent: " + InvFolder.ParentID.ToStringHyphenated()); - TempHash["name"] = InvFolder.FolderName; - TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); - TempHash["version"] = (Int32)InvFolder.Version; - TempHash["type_default"] = (Int32)InvFolder.DefaultType; - TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); - AgentInventory.Add(TempHash); - } - - Hashtable InventoryRootHash = new Hashtable(); - InventoryRootHash["folder_id"] = TheUser.Inventory.InventoryRoot.FolderID.ToStringHyphenated(); - ArrayList InventoryRoot = new ArrayList(); - InventoryRoot.Add(InventoryRootHash); - - Hashtable InitialOutfitHash = new Hashtable(); - InitialOutfitHash["folder_name"] = "Nightclub Female"; - InitialOutfitHash["gender"] = "female"; - ArrayList InitialOutfit = new ArrayList(); - InitialOutfit.Add(InitialOutfitHash); - - uint circode = (uint)(Util.RandomClass.Next()); - //TheUser.AddSimCircuit(circode, SimInfo.UUID); - - responseData["last_name"] = TheUser.lastname; - responseData["ui-config"] = ui_config; - responseData["sim_ip"] = "127.0.0.1"; //SimInfo.sim_ip.ToString(); - responseData["login-flags"] = LoginFlags; - responseData["global-textures"] = GlobalTextures; - responseData["classified_categories"] = ClassifiedCategories; - responseData["event_categories"] = new ArrayList(); - responseData["inventory-skeleton"] = AgentInventory; - responseData["inventory-skel-lib"] = new ArrayList(); - responseData["inventory-root"] = InventoryRoot; - responseData["event_notifications"] = new ArrayList(); - responseData["gestures"] = new ArrayList(); - responseData["inventory-lib-owner"] = new ArrayList(); - responseData["initial-outfit"] = InitialOutfit; - responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; - responseData["start_location"] = "last"; - responseData["home"] = "{'region_handle':[r" + (0 * 256).ToString() + ",r" + (0 * 256).ToString() + "], 'position':[r" + TheUser.homepos.X.ToString() + ",r" + TheUser.homepos.Y.ToString() + ",r" + TheUser.homepos.Z.ToString() + "], 'look_at':[r" + TheUser.homelookat.X.ToString() + ",r" + TheUser.homelookat.Y.ToString() + ",r" + TheUser.homelookat.Z.ToString() + "]}"; - responseData["message"] = DefaultStartupMsg; - responseData["first_name"] = TheUser.firstname; - responseData["circuit_code"] = (Int32)circode; - responseData["sim_port"] = 0; //(Int32)SimInfo.sim_port; - responseData["secure_session_id"] = TheUser.CurrentSecureSessionID.ToStringHyphenated(); - responseData["look_at"] = "\n[r" + TheUser.homelookat.X.ToString() + ",r" + TheUser.homelookat.Y.ToString() + ",r" + TheUser.homelookat.Z.ToString() + "]\n"; - responseData["agent_id"] = AgentID.ToStringHyphenated(); - responseData["region_y"] = (Int32)0 * 256; // (Int32)SimInfo.RegionLocY * 256; - responseData["region_x"] = (Int32)0 * 256; //SimInfo.RegionLocX * 256; - responseData["seed_capability"] = ""; - responseData["agent_access"] = "M"; - responseData["session_id"] = TheUser.CurrentSessionID.ToStringHyphenated(); - responseData["login"] = "true"; - - this.CustomiseResponse(ref responseData, TheUser); - response.Value = responseData; - // TheUser.SendDataToSim(SimInfo); - return response; - - } - catch (Exception E) - { - Console.WriteLine(E.ToString()); - } - //} - } - return response; - - } - - private static XmlRpcResponse CreateErrorConnectingToGridResponse() - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable ErrorRespData = new Hashtable(); - ErrorRespData["reason"] = "key"; - ErrorRespData["message"] = "Error connecting to grid. Please double check your login details and check with the grid owner if you are sure these are correct"; - ErrorRespData["login"] = "false"; - response.Value = ErrorRespData; - return response; - } - - private static XmlRpcResponse CreateAlreadyLoggedInResponse() - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable PresenceErrorRespData = new Hashtable(); - PresenceErrorRespData["reason"] = "presence"; - PresenceErrorRespData["message"] = "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner"; - PresenceErrorRespData["login"] = "false"; - response.Value = PresenceErrorRespData; - return response; - } - - public virtual void CustomiseResponse(ref Hashtable response, UserProfile theUser) - { - //default method set up to act as ogs user server - SimProfile SimInfo= new SimProfile(); - //get siminfo from grid server - SimInfo = SimInfo.LoadFromGrid(theUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey); - Int32 circode = (Int32)Convert.ToUInt32(response["circuit_code"]); - theUser.AddSimCircuit((uint)circode, SimInfo.UUID); - response["home"] = "{'region_handle':[r" + (SimInfo.RegionLocX * 256).ToString() + ",r" + (SimInfo.RegionLocY * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}"; - response["sim_ip"] = SimInfo.sim_ip; - response["sim_port"] = (Int32)SimInfo.sim_port; - response["region_y"] = (Int32)SimInfo.RegionLocY * 256; - response["region_x"] = (Int32)SimInfo.RegionLocX * 256; - - //default is ogs user server, so let the sim know about the user via a XmlRpcRequest - Console.WriteLine(SimInfo.caps_url); - Hashtable SimParams = new Hashtable(); - SimParams["session_id"] = theUser.CurrentSessionID.ToString(); - SimParams["secure_session_id"] = theUser.CurrentSecureSessionID.ToString(); - SimParams["firstname"] = theUser.firstname; - SimParams["lastname"] = theUser.lastname; - SimParams["agent_id"] = theUser.UUID.ToString(); - SimParams["circuit_code"] = (Int32)circode; - SimParams["startpos_x"] = theUser.homepos.X.ToString(); - SimParams["startpos_y"] = theUser.homepos.Y.ToString(); - SimParams["startpos_z"] = theUser.homepos.Z.ToString(); - ArrayList SendParams = new ArrayList(); - SendParams.Add(SimParams); - - XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); - XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000); - } - } -} diff --git a/Common/OpenSim.Framework/UserProfileManagerBase.cs b/Common/OpenSim.Framework/UserProfileManagerBase.cs deleted file mode 100644 index e0c0174..0000000 --- a/Common/OpenSim.Framework/UserProfileManagerBase.cs +++ /dev/null @@ -1,152 +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.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Inventory; -using Db4objects.Db4o; - -namespace OpenSim.Framework.User -{ - public class UserProfileManagerBase - { - - public Dictionary UserProfiles = new Dictionary(); - - public UserProfileManagerBase() - { - } - - public virtual void InitUserProfiles() - { - IObjectContainer db; - db = Db4oFactory.OpenFile("userprofiles.yap"); - IObjectSet result = db.Get(typeof(UserProfile)); - foreach (UserProfile userprof in result) - { - UserProfiles.Add(userprof.UUID, userprof); - } - Console.WriteLine("UserProfiles.Cs:InitUserProfiles() - Successfully loaded " + result.Count.ToString() + " from database"); - db.Close(); - } - - public virtual void SaveUserProfiles() // ZOMG! INEFFICIENT! - { - IObjectContainer db; - db = Db4oFactory.OpenFile("userprofiles.yap"); - IObjectSet result = db.Get(typeof(UserProfile)); - foreach (UserProfile userprof in result) - { - db.Delete(userprof); - db.Commit(); - } - foreach (UserProfile userprof in UserProfiles.Values) - { - db.Set(userprof); - db.Commit(); - } - db.Close(); - } - - public UserProfile GetProfileByName(string firstname, string lastname) - { - foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys) - { - if (UserProfiles[UUID].firstname.Equals(firstname)) if (UserProfiles[UUID].lastname.Equals(lastname)) - { - return UserProfiles[UUID]; - } - } - return null; - } - - public UserProfile GetProfileByLLUUID(LLUUID ProfileLLUUID) - { - return UserProfiles[ProfileLLUUID]; - } - - public virtual bool AuthenticateUser(string firstname, string lastname, string passwd) - { - UserProfile TheUser = GetProfileByName(firstname, lastname); - passwd = passwd.Remove(0, 3); //remove $1$ - if (TheUser != null) - { - if (TheUser.MD5passwd == passwd) - { - Console.WriteLine("UserProfile - authorised " + firstname + " " + lastname); - return true; - } - else - { - Console.WriteLine("UserProfile - not authorised, password not match " + TheUser.MD5passwd + " and " + passwd); - return false; - } - } - else - { - Console.WriteLine("UserProfile - not authorised , unkown: " + firstname + " , " + lastname); - return false; - } - - } - - public void SetGod(LLUUID GodID) - { - this.UserProfiles[GodID].IsGridGod = true; - } - - public virtual UserProfile CreateNewProfile(string firstname, string lastname, string MD5passwd) - { - Console.WriteLine("creating new profile for : " + firstname + " , " + lastname); - UserProfile newprofile = new UserProfile(); - newprofile.homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256)); - newprofile.firstname = firstname; - newprofile.lastname = lastname; - newprofile.MD5passwd = MD5passwd; - newprofile.UUID = LLUUID.Random(); - newprofile.Inventory.CreateRootFolder(newprofile.UUID, true); - this.UserProfiles.Add(newprofile.UUID, newprofile); - SaveUserProfiles(); - return newprofile; - } - - public virtual AgentInventory GetUsersInventory(LLUUID agentID) - { - UserProfile user = this.GetProfileByLLUUID(agentID); - if (user != null) - { - return user.Inventory; - } - - return null; - } - - } -} diff --git a/Common/OpenSim.Framework/Util.cs b/Common/OpenSim.Framework/Util.cs deleted file mode 100644 index 10e3fdf..0000000 --- a/Common/OpenSim.Framework/Util.cs +++ /dev/null @@ -1,178 +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.Security.Cryptography; -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 UnixTimeSinceEpoch() - { - TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); - int timestamp = (int)t.TotalSeconds; - return timestamp; - } - - public static string Md5Hash(string pass) - { - MD5 md5 = MD5CryptoServiceProvider.Create(); - byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass)); - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < dataMd5.Length; i++) - sb.AppendFormat("{0:x2}", dataMd5[i]); - return sb.ToString(); - } - - //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/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj deleted file mode 100644 index df68722..0000000 --- a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {E88EF749-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.GenericConfig.Xml - JScript - Grid - IE50 - false - Library - - OpenSim.GenericConfig.Xml - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\ - False - False - False - 4 - - - - - System.dll - False - - - System.Xml.dll - False - - - - - OpenSim.Framework - {8ACA2445-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - - - - - - - - diff --git a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build deleted file mode 100644 index 075ea7f..0000000 --- a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs b/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs deleted file mode 100644 index de5f48d..0000000 --- a/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OpenSim.GenericConfig")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenSim.GenericConfig")] -[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("285a3047-f165-46c8-8767-b51428738a09")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs b/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs deleted file mode 100644 index 40c252f..0000000 --- a/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs +++ /dev/null @@ -1,136 +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.Collections.Generic; -using System.Text; -using System.Xml; -using OpenSim.Framework.Interfaces; - -namespace OpenSim.GenericConfig -{ - public class XmlConfig : IGenericConfig - { - private XmlDocument doc; - private XmlNode rootNode; - private XmlNode configNode; - private string fileName; - private bool createdFile = false; - - public XmlConfig(string filename) - { - fileName = filename; - } - - public void LoadData() - { - doc = new XmlDocument(); - try - { - if (System.IO.File.Exists(fileName)) - { - XmlTextReader reader = new XmlTextReader(fileName); - reader.WhitespaceHandling = WhitespaceHandling.None; - doc.Load(reader); - reader.Close(); - } - else - { - createdFile = true; - rootNode = doc.CreateNode(XmlNodeType.Element, "Root", ""); - doc.AppendChild(rootNode); - configNode = doc.CreateNode(XmlNodeType.Element, "Config", ""); - rootNode.AppendChild(configNode); - } - - } - catch (Exception e) - { - Console.WriteLine(e.Message); - return; - } - try - { - rootNode = doc.FirstChild; - if (rootNode.Name != "Root") - throw new Exception("Error: Invalid .xml File. Missing "); - - configNode = rootNode.FirstChild; - if (configNode.Name != "Config") - throw new Exception("Error: Invalid .xml File. first child should be "); - - } - catch (Exception e) - { - Console.WriteLine(e.Message); - } - if (createdFile) - { - this.Commit(); - } - } - - public string GetAttribute(string attributeName) - { - string result = ""; - if (configNode.Attributes[attributeName] != null) - { - result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value; - } - return result; - } - - public bool SetAttribute(string attributeName, string attributeValue) - { - if (configNode.Attributes[attributeName] != null) - { - ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue; - } - else - { - XmlAttribute attri; - attri = doc.CreateAttribute(attributeName); - attri.Value = attributeValue; - configNode.Attributes.Append(attri); - } - return true; - } - - public void Commit() - { - doc.Save(fileName); - } - - public void Close() - { - configNode = null; - rootNode = null; - doc = null; - } - - } -} diff --git a/Common/OpenSim.Servers/BaseHttpServer.cs b/Common/OpenSim.Servers/BaseHttpServer.cs deleted file mode 100644 index ec5a6d7..0000000 --- a/Common/OpenSim.Servers/BaseHttpServer.cs +++ /dev/null @@ -1,283 +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.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; - -namespace OpenSim.Servers -{ - public class BaseHttpServer - { - protected class RestMethodEntry - { - private string m_path; - public string Path - { - get { return m_path; } - } - - private RestMethod m_restMethod; - public RestMethod RestMethod - { - get { return m_restMethod; } - } - - public RestMethodEntry(string path, RestMethod restMethod) - { - m_path = path; - m_restMethod = restMethod; - } - } - - protected Thread m_workerThread; - protected HttpListener m_httpListener; - protected Dictionary m_restHandlers = new Dictionary(); - protected Dictionary m_rpcHandlers = new Dictionary(); - protected int m_port; - - public BaseHttpServer(int port) - { - m_port = port; - } - - public bool AddRestHandler(string method, string path, RestMethod handler) - { - string methodKey = String.Format("{0}: {1}", method, path); - - if (!this.m_restHandlers.ContainsKey(methodKey)) - { - this.m_restHandlers.Add(methodKey, new RestMethodEntry(path, handler)); - return true; - } - - //must already have a handler for that path so return false - return false; - } - - public bool AddXmlRPCHandler(string method, XmlRpcMethod handler) - { - if (!this.m_rpcHandlers.ContainsKey(method)) - { - this.m_rpcHandlers.Add(method, handler); - return true; - } - - //must already have a handler for that path so return false - return false; - } - - protected virtual string ProcessXMLRPCMethod(string methodName, XmlRpcRequest request) - { - XmlRpcResponse response; - - XmlRpcMethod method; - if (this.m_rpcHandlers.TryGetValue(methodName, out method)) - { - response = method(request); - } - else - { - response = new XmlRpcResponse(); - Hashtable unknownMethodError = new Hashtable(); - unknownMethodError["reason"] = "XmlRequest"; ; - unknownMethodError["message"] = "Unknown Rpc request"; - unknownMethodError["login"] = "false"; - response.Value = unknownMethodError; - } - - return XmlRpcResponseSerializer.Singleton.Serialize(response); - } - - protected virtual string ParseREST(string request, string path, string method) - { - string response; - - string requestKey = String.Format("{0}: {1}", method, path); - - string bestMatch = String.Empty; - foreach (string currentKey in m_restHandlers.Keys) - { - if (requestKey.StartsWith(currentKey)) - { - if (currentKey.Length > bestMatch.Length) - { - bestMatch = currentKey; - } - } - } - - RestMethodEntry restMethodEntry; - if (m_restHandlers.TryGetValue(bestMatch, out restMethodEntry)) - { - RestMethod restMethod = restMethodEntry.RestMethod; - - string param = path.Substring(restMethodEntry.Path.Length); - response = restMethod(request, path, param); - - } - else - { - response = String.Empty; - } - - return response; - } - - protected virtual string ParseLLSDXML(string requestBody) - { - // dummy function for now - IMPLEMENT ME! - return ""; - } - - protected virtual string ParseXMLRPC(string requestBody) - { - string responseString = String.Empty; - - try - { - XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody); - - string methodName = request.MethodName; - - responseString = ProcessXMLRPCMethod(methodName, request); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - return responseString; - } - - public virtual 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/html"); - 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/html"); - break; - - } - - byte[] buffer = System.Text.Encoding.UTF8.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()); - } - } - - public void Start() - { - MainConsole.Instance.Verbose("BaseHttpServer.cs: Starting up HTTP Server"); - - m_workerThread = new Thread(new ThreadStart(StartHTTP)); - m_workerThread.IsBackground = true; - m_workerThread.Start(); - } - - private void StartHTTP() - { - try - { - MainConsole.Instance.Verbose("BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); - m_httpListener = new HttpListener(); - - m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); - m_httpListener.Start(); - - HttpListenerContext context; - while (true) - { - context = m_httpListener.GetContext(); - ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context); - } - } - catch (Exception e) - { - MainConsole.Instance.Warn(e.Message); - } - } - } -} diff --git a/Common/OpenSim.Servers/BaseServer.cs b/Common/OpenSim.Servers/BaseServer.cs deleted file mode 100644 index f248186..0000000 --- a/Common/OpenSim.Servers/BaseServer.cs +++ /dev/null @@ -1,37 +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.Collections.Generic; -using System.Text; - -namespace OpenSim.Servers -{ - public class BaseServer - { - } -} diff --git a/Common/OpenSim.Servers/CheckSumServer.cs b/Common/OpenSim.Servers/CheckSumServer.cs deleted file mode 100644 index b6bfe3a..0000000 --- a/Common/OpenSim.Servers/CheckSumServer.cs +++ /dev/null @@ -1,139 +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.Text; -using System.IO; -using System.Threading; -using System.Net; -using System.Net.Sockets; -using System.Timers; -using System.Reflection; -using System.Collections; -using System.Collections.Generic; -using libsecondlife; -using libsecondlife.Packets; -using OpenSim.Framework.Console; - - -namespace OpenSim.Servers -{ - public class CheckSumServer : UDPServerBase - { - //protected ConsoleBase m_console; - - public CheckSumServer(int port) - : base(port) - { - } - - protected override void OnReceivedData(IAsyncResult result) - { - ipeSender = new IPEndPoint(IPAddress.Any, 0); - epSender = (EndPoint)ipeSender; - Packet packet = null; - int numBytes = Server.EndReceiveFrom(result, ref epSender); - int packetEnd = numBytes - 1; - - packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); - - if (packet.Type == PacketType.SecuredTemplateChecksumRequest) - { - SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet; - TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket(); - checkreply.DataBlock.Checksum = 3220703154;//180572585; - checkreply.DataBlock.Flags = 0; - checkreply.DataBlock.MajorVersion = 1; - checkreply.DataBlock.MinorVersion = 15; - checkreply.DataBlock.PatchVersion = 0; - checkreply.DataBlock.ServerVersion = 0; - checkreply.TokenBlock.Token = checksum.TokenBlock.Token; - this.SendPacket(checkreply, epSender); - - /* - //if we wanted to echo the the checksum/ version from the client (so that any client worked) - SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket(); - checkrequest.TokenBlock.Token = checksum.TokenBlock.Token; - this.SendPacket(checkrequest, epSender); - */ - } - else if (packet.Type == PacketType.TemplateChecksumReply) - { - //echo back the client checksum reply (Hegemon's method) - TemplateChecksumReplyPacket checksum2 = (TemplateChecksumReplyPacket)packet; - TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket(); - checkreply2.DataBlock.Checksum = checksum2.DataBlock.Checksum; - checkreply2.DataBlock.Flags = checksum2.DataBlock.Flags; - checkreply2.DataBlock.MajorVersion = checksum2.DataBlock.MajorVersion; - checkreply2.DataBlock.MinorVersion = checksum2.DataBlock.MinorVersion; - checkreply2.DataBlock.PatchVersion = checksum2.DataBlock.PatchVersion; - checkreply2.DataBlock.ServerVersion = checksum2.DataBlock.ServerVersion; - checkreply2.TokenBlock.Token = checksum2.TokenBlock.Token; - this.SendPacket(checkreply2, epSender); - } - else - { - } - - Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); - } - - private void SendPacket(Packet Pack, EndPoint endp) - { - if (!Pack.Header.Resent) - { - Pack.Header.Sequence = 1; - } - - byte[] ZeroOutBuffer = new byte[4096]; - byte[] sendbuffer; - sendbuffer = Pack.ToBytes(); - - try - { - if (Pack.Header.Zerocoded) - { - int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); - this.SendPackTo(ZeroOutBuffer, packetsize, SocketFlags.None, endp); - } - else - { - this.SendPackTo(sendbuffer, sendbuffer.Length, SocketFlags.None, endp); - } - } - catch (Exception) - { - MainConsole.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection "); - } - } - - private void SendPackTo(byte[] buffer, int size, SocketFlags flags, EndPoint endp) - { - this.Server.SendTo(buffer, size, flags, endp); - } - } -} \ No newline at end of file diff --git a/Common/OpenSim.Servers/IRestHandler.cs b/Common/OpenSim.Servers/IRestHandler.cs deleted file mode 100644 index 3aa508c..0000000 --- a/Common/OpenSim.Servers/IRestHandler.cs +++ /dev/null @@ -1,35 +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.Collections.Generic; -using System.Text; - -namespace OpenSim.Servers -{ - public delegate string RestMethod( string request, string path, string param ); -} diff --git a/Common/OpenSim.Servers/LocalUserProfileManager.cs b/Common/OpenSim.Servers/LocalUserProfileManager.cs deleted file mode 100644 index 6f65176..0000000 --- a/Common/OpenSim.Servers/LocalUserProfileManager.cs +++ /dev/null @@ -1,124 +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.Collections.Generic; -using System.Collections; -using System.Text; -using OpenSim.Framework.User; -using OpenSim.Framework.Grid; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using libsecondlife; - -namespace OpenSim.UserServer -{ - public class LocalUserProfileManager : UserProfileManager - { - private IGridServer m_gridServer; - private int m_port; - private string m_ipAddr; - private uint regionX; - private uint regionY; - private AddNewSessionHandler AddSession; - - public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY) - { - m_gridServer = gridServer; - m_port = simPort; - m_ipAddr = ipAddr; - regionX = regX; - regionY = regY; - } - - public void SetSessionHandler(AddNewSessionHandler sessionHandler) - { - this.AddSession = sessionHandler; - } - - public override void InitUserProfiles() - { - base.InitUserProfiles(); - } - - public override void CustomiseResponse(ref System.Collections.Hashtable response, UserProfile theUser) - { - Int32 circode = (Int32)response["circuit_code"]; - theUser.AddSimCircuit((uint)circode, LLUUID.Random()); - response["home"] = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}"; - response["sim_port"] = m_port; - response["sim_ip"] = m_ipAddr; - response["region_y"] = (Int32)regionY* 256; - response["region_x"] = (Int32)regionX* 256; - - string first; - string last; - if (response.Contains("first_name")) - { - first = (string)response["first_name"]; - } - else - { - first = "test"; - } - - if (response.Contains("last_name")) - { - last = (string)response["last_name"]; - } - else - { - last = "User"; - } - - ArrayList InventoryList = (ArrayList)response["inventory-skeleton"]; - Hashtable Inventory1 = (Hashtable)InventoryList[0]; - - Login _login = new Login(); - //copy data to login object - _login.First = first; - _login.Last = last; - _login.Agent = new LLUUID((string)response["agent_id"]) ; - _login.Session = new LLUUID((string)response["session_id"]); - _login.SecureSession = new LLUUID((string)response["secure_session_id"]); - _login.CircuitCode =(uint) circode; - _login.BaseFolder = null; - _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]); - - //working on local computer if so lets add to the gridserver's list of sessions? - /*if (m_gridServer.GetName() == "Local") - { - Console.WriteLine("adding login data to gridserver"); - ((LocalGridBase)this.m_gridServer).AddNewSession(_login); - }*/ - - this.AddSession(_login); - } - } -} diff --git a/Common/OpenSim.Servers/LoginResponse.cs b/Common/OpenSim.Servers/LoginResponse.cs deleted file mode 100644 index 9e37409..0000000 --- a/Common/OpenSim.Servers/LoginResponse.cs +++ /dev/null @@ -1,669 +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 Nwc.XmlRpc; -using System; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; -using System.Collections; -using System.Security.Cryptography; -using System.Xml; -using libsecondlife; -using OpenSim; -using OpenSim.Framework.User; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Interfaces; - -// ? -using OpenSim.Framework.Grid; - -namespace OpenSim.UserServer -{ - /// - /// A temp class to handle login response. - /// Should make use of UserProfileManager where possible. - /// - - public class LoginResponse - { - private Hashtable loginFlagsHash; - private Hashtable globalTexturesHash; - private Hashtable loginError; - private Hashtable eventCategoriesHash; - private Hashtable uiConfigHash; - private Hashtable classifiedCategoriesHash; - - private ArrayList loginFlags; - private ArrayList globalTextures; - private ArrayList eventCategories; - private ArrayList uiConfig; - private ArrayList classifiedCategories; - private ArrayList inventoryRoot; - private ArrayList initialOutfit; - private ArrayList agentInventory; - - private UserProfile userProfile; - - private LLUUID agentID; - private LLUUID sessionID; - private LLUUID secureSessionID; - private LLUUID baseFolderID; - private LLUUID inventoryFolderID; - - // Login Flags - private string dst; - private string stipendSinceLogin; - private string gendered; - private string everLoggedIn; - private string login; - private string simPort; - private string simAddress; - private string agentAccess; - private Int32 circuitCode; - private uint regionX; - private uint regionY; - - // Login - private string firstname; - private string lastname; - - // Global Textures - private string sunTexture; - private string cloudTexture; - private string moonTexture; - - // Error Flags - private string errorReason; - private string errorMessage; - - // Response - private XmlRpcResponse xmlRpcResponse; - private XmlRpcResponse defaultXmlRpcResponse; - - private string welcomeMessage; - private string startLocation; - private string allowFirstLife; - private string home; - private string seedCapability; - private string lookAt; - - public LoginResponse() - { - this.loginFlags = new ArrayList(); - this.globalTextures = new ArrayList(); - this.eventCategories = new ArrayList(); - this.uiConfig = new ArrayList(); - this.classifiedCategories = new ArrayList(); - - this.loginError = new Hashtable(); - this.eventCategoriesHash = new Hashtable(); - this.classifiedCategoriesHash = new Hashtable(); - this.uiConfigHash = new Hashtable(); - - this.defaultXmlRpcResponse = new XmlRpcResponse(); - this.userProfile = new UserProfile(); - this.inventoryRoot = new ArrayList(); - this.initialOutfit = new ArrayList(); - this.agentInventory = new ArrayList(); - - this.xmlRpcResponse = new XmlRpcResponse(); - this.defaultXmlRpcResponse = new XmlRpcResponse(); - - this.SetDefaultValues(); - } // LoginServer - - public void SetDefaultValues() - { - try - { - this.DST = "N"; - this.StipendSinceLogin = "N"; - this.Gendered = "Y"; - this.EverLoggedIn = "Y"; - this.login = "false"; - this.firstname = "Test"; - this.lastname = "User"; - this.agentAccess = "M"; - this.startLocation = "last"; - this.allowFirstLife = "Y"; - - this.SunTexture = "cce0f112-878f-4586-a2e2-a8f104bba271"; - this.CloudTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; - this.MoonTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; - - this.ErrorMessage = "You have entered an invalid name/password combination. Check Caps/lock."; - this.ErrorReason = "key"; - this.welcomeMessage = "Welcome to OpenSim!"; - this.seedCapability = ""; - this.home = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + this.userProfile.homepos.X.ToString() + ",r" + this.userProfile.homepos.Y.ToString() + ",r" + this.userProfile.homepos.Z.ToString() + "], 'look_at':[r" + this.userProfile.homelookat.X.ToString() + ",r" + this.userProfile.homelookat.Y.ToString() + ",r" + this.userProfile.homelookat.Z.ToString() + "]}"; - this.lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; - this.RegionX = (uint)255232; - this.RegionY = (uint)254976; - - // Classifieds; - this.AddClassifiedCategory((Int32)1, "Shopping"); - this.AddClassifiedCategory((Int32)2, "Land Rental"); - this.AddClassifiedCategory((Int32)3, "Property Rental"); - this.AddClassifiedCategory((Int32)4, "Special Attraction"); - this.AddClassifiedCategory((Int32)5, "New Products"); - this.AddClassifiedCategory((Int32)6, "Employment"); - this.AddClassifiedCategory((Int32)7, "Wanted"); - this.AddClassifiedCategory((Int32)8, "Service"); - this.AddClassifiedCategory((Int32)9, "Personal"); - - int SessionRand = Util.RandomClass.Next(1, 999); - this.SessionID = new LLUUID("aaaabbbb-0200-" + SessionRand.ToString("0000") + "-8664-58f53e442797"); - this.SecureSessionID = LLUUID.Random(); - - this.userProfile.Inventory.CreateRootFolder(this.userProfile.UUID, true); - this.baseFolderID = this.userProfile.Inventory.GetFolderID("Textures"); - this.inventoryFolderID = this.userProfile.Inventory.GetFolderID("My Inventory-"); - Hashtable InventoryRootHash = new Hashtable(); - InventoryRootHash["folder_id"] = this.userProfile.Inventory.InventoryRoot.FolderID.ToStringHyphenated(); - this.inventoryRoot.Add(InventoryRootHash); - - Hashtable TempHash; - foreach (InventoryFolder InvFolder in this.userProfile.Inventory.InventoryFolders.Values) - { - TempHash = new Hashtable(); - TempHash["name"] = InvFolder.FolderName; - TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); - TempHash["version"] = (Int32)InvFolder.Version; - TempHash["type_default"] = (Int32)InvFolder.DefaultType; - TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); - this.agentInventory.Add(TempHash); - } - - Hashtable InitialOutfitHash = new Hashtable(); - InitialOutfitHash["folder_name"] = "Nightclub Female"; - InitialOutfitHash["gender"] = "female"; - this.initialOutfit.Add(InitialOutfitHash); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Warn( - "LoginResponse: Unable to set default values: " + e.Message - ); - } - - } // SetDefaultValues - - protected virtual LLUUID GetAgentId() - { - // todo - LLUUID Agent; - int AgentRand = Util.RandomClass.Next(1, 9999); - Agent = new LLUUID("99998888-0100-" + AgentRand.ToString("0000") + "-8ec1-0b1d5cd6aead"); - return Agent; - } // GetAgentId - - private XmlRpcResponse GenerateFailureResponse(string reason, string message, string login) - { - // Overwrite any default values; - this.xmlRpcResponse = new XmlRpcResponse(); - - // Ensure Login Failed message/reason; - this.ErrorMessage = message; - this.ErrorReason = reason; - - this.loginError["reason"] = this.ErrorReason; - this.loginError["message"] = this.ErrorMessage; - this.loginError["login"] = login; - this.xmlRpcResponse.Value = this.loginError; - return (this.xmlRpcResponse); - } // GenerateResponse - - public XmlRpcResponse LoginFailedResponse() - { - return (this.GenerateFailureResponse("key", "You have entered an invalid name/password combination. Check Caps/lock.", "false")); - } // LoginFailedResponse - - public XmlRpcResponse ConnectionFailedResponse() - { - return (this.LoginFailedResponse()); - } // CreateErrorConnectingToGridResponse() - - public XmlRpcResponse CreateAlreadyLoggedInResponse() - { - return (this.GenerateFailureResponse("presence", "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner", "false")); - } // CreateAlreadyLoggedInResponse() - - public XmlRpcResponse ToXmlRpcResponse() - { - try - { - - Hashtable responseData = new Hashtable(); - - this.loginFlagsHash = new Hashtable(); - this.loginFlagsHash["daylight_savings"] = this.DST; - this.loginFlagsHash["stipend_since_login"] = this.StipendSinceLogin; - this.loginFlagsHash["gendered"] = this.Gendered; - this.loginFlagsHash["ever_logged_in"] = this.EverLoggedIn; - this.loginFlags.Add(this.loginFlagsHash); - - responseData["first_name"] = this.Firstname; - responseData["last_name"] = this.Lastname; - responseData["agent_access"] = this.agentAccess; - - this.globalTexturesHash = new Hashtable(); - this.globalTexturesHash["sun_texture_id"] = this.SunTexture; - this.globalTexturesHash["cloud_texture_id"] = this.CloudTexture; - this.globalTexturesHash["moon_texture_id"] = this.MoonTexture; - this.globalTextures.Add(this.globalTexturesHash); - this.eventCategories.Add(this.eventCategoriesHash); - - this.AddToUIConfig("allow_first_life", this.allowFirstLife); - this.uiConfig.Add(this.uiConfigHash); - - // Create a agent and session LLUUID - this.agentID = this.GetAgentId(); - - responseData["sim_port"] = this.SimPort; - responseData["sim_ip"] = this.SimAddress; - responseData["agent_id"] = this.AgentID.ToStringHyphenated(); - responseData["session_id"] = this.SessionID.ToStringHyphenated(); - responseData["secure_session_id"] = this.SecureSessionID.ToStringHyphenated(); - responseData["circuit_code"] = this.CircuitCode; - responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; - responseData["login-flags"] = this.loginFlags; - responseData["global-textures"] = this.globalTextures; - responseData["seed_capability"] = this.seedCapability; - - responseData["event_categories"] = this.eventCategories; - responseData["event_notifications"] = new ArrayList(); // todo - responseData["classified_categories"] = this.classifiedCategories; - responseData["ui-config"] = this.uiConfig; - - responseData["inventory-skeleton"] = this.agentInventory; - responseData["inventory-skel-lib"] = new ArrayList(); // todo - responseData["inventory-root"] = this.inventoryRoot; - responseData["gestures"] = new ArrayList(); // todo - responseData["inventory-lib-owner"] = new ArrayList(); // todo - responseData["initial-outfit"] = this.initialOutfit; - responseData["start_location"] = this.startLocation; - responseData["seed_capability"] = this.seedCapability; - responseData["home"] = this.home; - responseData["look_at"] = this.lookAt; - responseData["message"] = this.welcomeMessage; - responseData["region_x"] = (Int32)this.RegionX * 256; - responseData["region_y"] = (Int32)this.RegionY * 256; - - responseData["login"] = "true"; - this.xmlRpcResponse.Value = responseData; - - return (this.xmlRpcResponse); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Error( - "LoginResponse: Error creating XML-RPC Response: " + e.Message - ); - return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); - - } - - } // ToXmlRpcResponse - - public void SetEventCategories(string category, string value) - { - this.eventCategoriesHash[category] = value; - } // SetEventCategories - - public void AddToUIConfig(string itemName, string item) - { - this.uiConfigHash[itemName] = item; - } // SetUIConfig - - public void AddClassifiedCategory(Int32 ID, string categoryName) - { - this.classifiedCategoriesHash["category_name"] = categoryName; - this.classifiedCategoriesHash["category_id"] = ID; - this.classifiedCategories.Add(this.classifiedCategoriesHash); - // this.classifiedCategoriesHash.Clear(); - } // SetClassifiedCategory - - public string Login - { - get - { - return this.login; - } - set - { - this.login = value; - } - } // Login - - public string DST - { - get - { - return this.dst; - } - set - { - this.dst = value; - } - } // DST - - public string StipendSinceLogin - { - get - { - return this.stipendSinceLogin; - } - set - { - this.stipendSinceLogin = value; - } - } // StipendSinceLogin - - public string Gendered - { - get - { - return this.gendered; - } - set - { - this.gendered = value; - } - } // Gendered - - public string EverLoggedIn - { - get - { - return this.everLoggedIn; - } - set - { - this.everLoggedIn = value; - } - } // EverLoggedIn - - public string SimPort - { - get - { - return this.simPort; - } - set - { - this.simPort = value; - } - } // SimPort - - public string SimAddress - { - get - { - return this.simAddress; - } - set - { - this.simAddress = value; - } - } // SimAddress - - public LLUUID AgentID - { - get - { - return this.agentID; - } - set - { - this.agentID = value; - } - } // AgentID - - public LLUUID SessionID - { - get - { - return this.sessionID; - } - set - { - this.sessionID = value; - } - } // SessionID - - public LLUUID SecureSessionID - { - get - { - return this.secureSessionID; - } - set - { - this.secureSessionID = value; - } - } // SecureSessionID - - public LLUUID BaseFolderID - { - get - { - return this.baseFolderID; - } - set - { - this.baseFolderID = value; - } - } // BaseFolderID - - public LLUUID InventoryFolderID - { - get - { - return this.inventoryFolderID; - } - set - { - this.inventoryFolderID = value; - } - } // InventoryFolderID - - public Int32 CircuitCode - { - get - { - return this.circuitCode; - } - set - { - this.circuitCode = value; - } - } // CircuitCode - - public uint RegionX - { - get - { - return this.regionX; - } - set - { - this.regionX = value; - } - } // RegionX - - public uint RegionY - { - get - { - return this.regionY; - } - set - { - this.regionY = value; - } - } // RegionY - - public string SunTexture - { - get - { - return this.sunTexture; - } - set - { - this.sunTexture = value; - } - } // SunTexture - - public string CloudTexture - { - get - { - return this.cloudTexture; - } - set - { - this.cloudTexture = value; - } - } // CloudTexture - - public string MoonTexture - { - get - { - return this.moonTexture; - } - set - { - this.moonTexture = value; - } - } // MoonTexture - - public string Firstname - { - get - { - return this.firstname; - } - set - { - this.firstname = value; - } - } // Firstname - - public string Lastname - { - get - { - return this.lastname; - } - set - { - this.lastname = value; - } - } // Lastname - - public string AgentAccess - { - get - { - return this.agentAccess; - } - set - { - this.agentAccess = value; - } - } - - public string StartLocation - { - get - { - return this.startLocation; - } - set - { - this.startLocation = value; - } - } // StartLocation - - public string LookAt - { - get - { - return this.lookAt; - } - set - { - this.lookAt = value; - } - } - - public string SeedCapability - { - get - { - return this.seedCapability; - } - set - { - this.seedCapability = value; - } - } // SeedCapability - - public string ErrorReason - { - get - { - return this.errorReason; - } - set - { - this.errorReason = value; - } - } // ErrorReason - - public string ErrorMessage - { - get - { - return this.errorMessage; - } - set - { - this.errorMessage = value; - } - } // ErrorMessage - - } // LoginResponse -} // namespace OpenSim.UserServer \ No newline at end of file diff --git a/Common/OpenSim.Servers/LoginServer.cs b/Common/OpenSim.Servers/LoginServer.cs deleted file mode 100644 index 4f4d76f..0000000 --- a/Common/OpenSim.Servers/LoginServer.cs +++ /dev/null @@ -1,296 +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 Nwc.XmlRpc; -using System; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; -using System.Collections; -using System.Security.Cryptography; -using System.Xml; -using libsecondlife; -using OpenSim; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Grid; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.User; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Types; - -namespace OpenSim.UserServer -{ - public delegate void AddNewSessionHandler(Login loginData); - /// - /// When running in local (default) mode , handles client logins. - /// - public class LoginServer : LoginService, IUserServer - { - private IGridServer m_gridServer; - public IPAddress clientAddress = IPAddress.Loopback; - public IPAddress remoteAddress = IPAddress.Any; - private int NumClients; - private bool userAccounts = false; - private string _mpasswd; - private bool _needPasswd = false; - private LocalUserProfileManager userManager; - private int m_simPort; - private string m_simAddr; - private uint regionX; - private uint regionY; - private AddNewSessionHandler AddSession; - - public LocalUserProfileManager LocalUserManager - { - get - { - return userManager; - } - } - - public LoginServer( string simAddr, int simPort, uint regX, uint regY, bool useAccounts) - { - m_simPort = simPort; - m_simAddr = simAddr; - regionX = regX; - regionY = regY; - this.userAccounts = useAccounts; - } - - public void SetSessionHandler(AddNewSessionHandler sessionHandler) - { - this.AddSession = sessionHandler; - this.userManager.SetSessionHandler(sessionHandler); - } - - public void Startup() - { - this._needPasswd = false; - - this._mpasswd = EncodePassword("testpass"); - - userManager = new LocalUserProfileManager(this.m_gridServer, m_simPort, m_simAddr, regionX, regionY); - userManager.InitUserProfiles(); - userManager.SetKeys("", "", "", "Welcome to OpenSim"); - } - - public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) - { - Console.WriteLine("login attempt"); - Hashtable requestData = (Hashtable)request.Params[0]; - string first; - string last; - string passwd; - - LoginResponse loginResponse = new LoginResponse(); - loginResponse.RegionX = regionX; - loginResponse.RegionY = regionY; - - //get login name - if (requestData.Contains("first")) - { - first = (string)requestData["first"]; - } - else - { - first = "test"; - } - - if (requestData.Contains("last")) - { - last = (string)requestData["last"]; - } - else - { - last = "User" + NumClients.ToString(); - } - - if (requestData.Contains("passwd")) - { - passwd = (string)requestData["passwd"]; - } - else - { - passwd = "notfound"; - } - - if (!Authenticate(first, last, passwd)) - { - return loginResponse.LoginFailedResponse(); - } - - NumClients++; - - // Create a agent and session LLUUID - // Agent = GetAgentId(first, last); - // int SessionRand = Util.RandomClass.Next(1, 999); - // Session = new LLUUID("aaaabbbb-0200-" + SessionRand.ToString("0000") + "-8664-58f53e442797"); - // LLUUID secureSess = LLUUID.Random(); - - loginResponse.SimPort = m_simPort.ToString(); - // 7 June 2007, AJD: - // [10:03:05] (@AdamZaius) Sandbox should work listening on 0.0.0.0 if you can fix the login XML reply - // OLD: loginResponse.SimAddress = m_simAddr.ToString(); - loginResponse.SimAddress = "0.0.0.0"; - - // loginResponse.AgentID = Agent.ToStringHyphenated(); - // loginResponse.SessionID = Session.ToStringHyphenated(); - // loginResponse.SecureSessionID = secureSess.ToStringHyphenated(); - loginResponse.CircuitCode = (Int32)(Util.RandomClass.Next()); - XmlRpcResponse response = loginResponse.ToXmlRpcResponse(); - Hashtable responseData = (Hashtable)response.Value; - - //inventory - /* ArrayList InventoryList = (ArrayList)responseData["inventory-skeleton"]; - Hashtable Inventory1 = (Hashtable)InventoryList[0]; - Hashtable Inventory2 = (Hashtable)InventoryList[1]; - LLUUID BaseFolderID = LLUUID.Random(); - LLUUID InventoryFolderID = LLUUID.Random(); - Inventory2["name"] = "Textures"; - Inventory2["folder_id"] = BaseFolderID.ToStringHyphenated(); - Inventory2["type_default"] = 0; - Inventory1["folder_id"] = InventoryFolderID.ToStringHyphenated(); - - ArrayList InventoryRoot = (ArrayList)responseData["inventory-root"]; - Hashtable Inventoryroot = (Hashtable)InventoryRoot[0]; - Inventoryroot["folder_id"] = InventoryFolderID.ToStringHyphenated(); - */ - CustomiseLoginResponse(responseData, first, last); - - Login _login = new Login(); - //copy data to login object - _login.First = first; - _login.Last = last; - _login.Agent = loginResponse.AgentID; - _login.Session = loginResponse.SessionID; - _login.SecureSession = loginResponse.SecureSessionID; - _login.CircuitCode = (uint) loginResponse.CircuitCode; - _login.BaseFolder = loginResponse.BaseFolderID; - _login.InventoryFolder = loginResponse.InventoryFolderID; - - //working on local computer if so lets add to the gridserver's list of sessions? - /* if (m_gridServer.GetName() == "Local") - { - ((LocalGridBase)m_gridServer).AddNewSession(_login); - }*/ - AddSession(_login); - - return response; - } - - protected virtual void CustomiseLoginResponse(Hashtable responseData, string first, string last) - { - } - - protected virtual LLUUID GetAgentId(string firstName, string lastName) - { - LLUUID Agent; - int AgentRand = Util.RandomClass.Next(1, 9999); - Agent = new LLUUID("99998888-0100-" + AgentRand.ToString("0000") + "-8ec1-0b1d5cd6aead"); - return Agent; - } - - protected virtual bool Authenticate(string first, string last, string passwd) - { - if (this._needPasswd) - { - //every user needs the password to login - string encodedPass = passwd.Remove(0, 3); //remove $1$ - if (encodedPass == this._mpasswd) - { - return true; - } - else - { - return false; - } - } - else - { - //do not need password to login - return true; - } - } - - private static string EncodePassword(string passwd) - { - Byte[] originalBytes; - Byte[] encodedBytes; - MD5 md5; - - md5 = new MD5CryptoServiceProvider(); - originalBytes = ASCIIEncoding.Default.GetBytes(passwd); - encodedBytes = md5.ComputeHash(originalBytes); - - return Regex.Replace(BitConverter.ToString(encodedBytes), "-", "").ToLower(); - } - - public bool CreateUserAccount(string firstName, string lastName, string password) - { - Console.WriteLine("creating new user account"); - string mdPassword = EncodePassword(password); - Console.WriteLine("with password: " + mdPassword); - this.userManager.CreateNewProfile(firstName, lastName, mdPassword); - - return true; - } - - public UserProfile GetProfileByName(string firstName, string lastName) - { - return this.userManager.GetProfileByName(firstName, lastName); - } - - - //IUserServer implementation - public AgentInventory RequestAgentsInventory(LLUUID agentID) - { - AgentInventory aInventory = null; - if (this.userAccounts) - { - aInventory = this.userManager.GetUsersInventory(agentID); - } - - return aInventory; - } - - public bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory) - { - return true; - } - - public void SetServerInfo(string ServerUrl, string SendKey, string RecvKey) - { - - } - } - - -} diff --git a/Common/OpenSim.Servers/OpenSim.Servers.csproj b/Common/OpenSim.Servers/OpenSim.Servers.csproj deleted file mode 100644 index 7a99206..0000000 --- a/Common/OpenSim.Servers/OpenSim.Servers.csproj +++ /dev/null @@ -1,133 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {8BB20F0A-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Servers - JScript - Grid - IE50 - false - Library - - OpenSim.Servers - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - ..\..\bin\libsecondlife.dll - False - - - System.dll - False - - - System.Xml.dll - False - - - - - OpenSim.Framework - {8ACA2445-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Framework.Console - {A7CD0630-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - XMLRPC - {8E81D43C-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/Common/OpenSim.Servers/OpenSim.Servers.dll.build b/Common/OpenSim.Servers/OpenSim.Servers.dll.build deleted file mode 100644 index 6147ea7..0000000 --- a/Common/OpenSim.Servers/OpenSim.Servers.dll.build +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Common/OpenSim.Servers/SocketRegistry.cs b/Common/OpenSim.Servers/SocketRegistry.cs deleted file mode 100644 index 2ebf80c..0000000 --- a/Common/OpenSim.Servers/SocketRegistry.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Created by SharpDevelop. - * User: Adam Stevenson - * Date: 6/13/2007 - * Time: 12:55 AM - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; - -namespace OpenSim.Servers -{ - /// - /// - /// - public class SocketRegistry - { - static List _Sockets; - - static SocketRegistry() - { - _Sockets = new List(); - } - - private SocketRegistry() - { - - } - - public static void Register(Socket pSocket) - { - _Sockets.Add(pSocket); - } - - public static void Unregister(Socket pSocket) - { - _Sockets.Remove(pSocket); - } - - public static void UnregisterAllAndClose() - { - int iSockets = _Sockets.Count; - - for (int i = 0; i < iSockets; i++) - { - try - { - _Sockets[i].Close(); - } - catch - { - - } - } - - _Sockets.Clear(); - } - } -} diff --git a/Common/OpenSim.Servers/UDPServerBase.cs b/Common/OpenSim.Servers/UDPServerBase.cs deleted file mode 100644 index b763315..0000000 --- a/Common/OpenSim.Servers/UDPServerBase.cs +++ /dev/null @@ -1,103 +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.Text; -using System.IO; -using System.Threading; -using System.Net; -using System.Net.Sockets; -using System.Timers; -using System.Reflection; -using System.Collections; -using System.Collections.Generic; -using libsecondlife; -using libsecondlife.Packets; - -namespace OpenSim.Servers -{ - public class UDPServerBase - { - public Socket Server; - protected IPEndPoint ServerIncoming; - protected byte[] RecvBuffer = new byte[4096]; - protected byte[] ZeroBuffer = new byte[8192]; - protected IPEndPoint ipeSender; - protected EndPoint epSender; - protected AsyncCallback ReceivedData; - protected int listenPort; - - public UDPServerBase(int port) - { - listenPort = port; - } - - protected virtual void OnReceivedData(IAsyncResult result) - { - ipeSender = new IPEndPoint(IPAddress.Any, 0); - epSender = (EndPoint)ipeSender; - Packet packet = null; - int numBytes = Server.EndReceiveFrom(result, ref epSender); - int packetEnd = numBytes - 1; - - packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); - - Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); - } - - protected virtual void AddNewClient(Packet packet) - { - } - - public virtual void ServerListener() - { - - ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort); - Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); - - /// Add this new socket to the list of sockets that was opened by the application. When the application - /// closes, either gracefully or not, all sockets can be cleaned up. Right now I am not aware of any method - /// to get all of the sockets for a process within .NET, but if so, this process can be refactored, as - /// socket registration would not be neccessary. - SocketRegistry.Register(Server); - - Server.Bind(ServerIncoming); - - ipeSender = new IPEndPoint(IPAddress.Any, 0); - epSender = (EndPoint)ipeSender; - ReceivedData = new AsyncCallback(this.OnReceivedData); - Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); - } - - public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode) - { - - } - } -} - - diff --git a/Common/OpenSim.Servers/XmlRpcMethod.cs b/Common/OpenSim.Servers/XmlRpcMethod.cs deleted file mode 100644 index 05cbf2e..0000000 --- a/Common/OpenSim.Servers/XmlRpcMethod.cs +++ /dev/null @@ -1,34 +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 Nwc.XmlRpc; - -namespace OpenSim.Servers -{ - public delegate XmlRpcResponse XmlRpcMethod( XmlRpcRequest request ); -} diff --git a/Common/XmlRpcCS/Logger.cs b/Common/XmlRpcCS/Logger.cs deleted file mode 100644 index ebf804b..0000000 --- a/Common/XmlRpcCS/Logger.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace Nwc.XmlRpc -{ - using System; - - /// Define levels of logging. This duplicates - /// similar enumerations in System.Diagnostics.EventLogEntryType. The - /// duplication was merited because .NET Compact Framework lacked the EventLogEntryType enum. - public enum LogLevel - { - /// Information level, log entry for informational reasons only. - Information, - /// Warning level, indicates a possible problem. - Warning, - /// Error level, implies a significant problem. - Error - } - - /// - ///Logging singleton with swappable output delegate. - /// - /// - ///This singleton provides a centralized log. The actual WriteEntry calls are passed - ///off to a delegate however. Having a delegate do the actual logginh allows you to - ///implement different logging mechanism and have them take effect throughout the system. - /// - public class Logger - { - ///Delegate definition for logging. - ///The message String to log. - ///The LogLevel of your message. - public delegate void LoggerDelegate(String message, LogLevel level); - ///The LoggerDelegate that will recieve WriteEntry requests. - static public LoggerDelegate Delegate = null; - - /// - ///Method logging events are sent to. - /// - ///The message String to log. - ///The LogLevel of your message. - static public void WriteEntry(String message, LogLevel level) - { - if (Delegate != null) - Delegate(message, level); - } - } -} diff --git a/Common/XmlRpcCS/SimpleHttpRequest.cs b/Common/XmlRpcCS/SimpleHttpRequest.cs deleted file mode 100644 index b331ce0..0000000 --- a/Common/XmlRpcCS/SimpleHttpRequest.cs +++ /dev/null @@ -1,234 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.IO; - using System.Net.Sockets; - using System.Collections; - using System.Text; - - ///Very basic HTTP request handler. - ///This class is designed to accept a TcpClient and treat it as an HTTP request. - /// It will do some basic header parsing and manage the input and output streams associated - /// with the request. - public class SimpleHttpRequest - { - private String _httpMethod = null; - private String _protocol; - private String _filePathFile = null; - private String _filePathDir = null; - private String __filePath; - private TcpClient _client; - private StreamReader _input; - private StreamWriter _output; - private Hashtable _headers; - - /// A constructor which accepts the TcpClient. - /// It creates the associated input and output streams, determines the request type, - /// and parses the remaining HTTP header. - /// The TcpClient associated with the HTTP connection. - public SimpleHttpRequest(TcpClient client) - { - _client = client; - - _output = new StreamWriter(client.GetStream() ); - _input = new StreamReader(client.GetStream() ); - - GetRequestMethod(); - GetRequestHeaders(); - } - - /// The output StreamWriter associated with the request. - public StreamWriter Output - { - get { return _output; } - } - - /// The input StreamReader associated with the request. - public StreamReader Input - { - get { return _input; } - } - - /// The TcpClient with the request. - public TcpClient Client - { - get { return _client; } - } - - private String _filePath - { - get { return __filePath; } - set - { - __filePath = value; - _filePathDir = null; - _filePathFile = null; - } - } - - /// The type of HTTP request (i.e. PUT, GET, etc.). - public String HttpMethod - { - get { return _httpMethod; } - } - - /// The level of the HTTP protocol. - public String Protocol - { - get { return _protocol; } - } - - /// The "path" which is part of any HTTP request. - public String FilePath - { - get { return _filePath; } - } - - /// The file portion of the "path" which is part of any HTTP request. - public String FilePathFile - { - get - { - if (_filePathFile != null) - return _filePathFile; - - int i = FilePath.LastIndexOf("/"); - - if (i == -1) - return ""; - - i++; - _filePathFile = FilePath.Substring(i, FilePath.Length - i); - return _filePathFile; - } - } - - /// The directory portion of the "path" which is part of any HTTP request. - public String FilePathDir - { - get - { - if (_filePathDir != null) - return _filePathDir; - - int i = FilePath.LastIndexOf("/"); - - if (i == -1) - return ""; - - i++; - _filePathDir = FilePath.Substring(0, i); - return _filePathDir; - } - } - - private void GetRequestMethod() - { - string req = _input.ReadLine(); - if (req == null) - throw new ApplicationException("Void request."); - - if (0 == String.Compare("GET ", req.Substring(0, 4), true)) - _httpMethod = "GET"; - else if (0 == String.Compare("POST ", req.Substring(0, 5), true)) - _httpMethod = "POST"; - else - throw new InvalidOperationException("Unrecognized method in query: " + req); - - req = req.TrimEnd(); - int idx = req.IndexOf(' ') + 1; - if (idx >= req.Length) - throw new ApplicationException("What do you want?"); - - string page_protocol = req.Substring(idx); - int idx2 = page_protocol.IndexOf(' '); - if (idx2 == -1) - idx2 = page_protocol.Length; - - _filePath = page_protocol.Substring(0, idx2).Trim(); - _protocol = page_protocol.Substring(idx2).Trim(); - } - - private void GetRequestHeaders() - { - String line; - int idx; - - _headers = new Hashtable(); - - while ((line = _input.ReadLine()) != "") - { - if (line == null) - { - break; - } - - idx = line.IndexOf(':'); - if (idx == -1 || idx == line.Length - 1) - { - Logger.WriteEntry("Malformed header line: " + line, LogLevel.Information); - continue; - } - - String key = line.Substring(0, idx); - String value = line.Substring(idx + 1); - - try - { - _headers.Add(key, value); - } - catch (Exception) - { - Logger.WriteEntry("Duplicate header key in line: " + line, LogLevel.Information); - } - } - } - - /// - /// Format the object contents into a useful string representation. - /// - ///String representation of the SimpleHttpRequest as the HttpMethod FilePath Protocol. - override public String ToString() - { - return HttpMethod + " " + FilePath + " " + Protocol; - } - - /// - /// Close the SimpleHttpRequest. This flushes and closes all associated io streams. - /// - public void Close() - { - _output.Flush(); - _output.Close(); - _input.Close(); - _client.Close(); - } - } -} diff --git a/Common/XmlRpcCS/XMLRPC.csproj b/Common/XmlRpcCS/XMLRPC.csproj deleted file mode 100644 index 61f8be0..0000000 --- a/Common/XmlRpcCS/XMLRPC.csproj +++ /dev/null @@ -1,138 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {8E81D43C-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - XMLRPC - JScript - Grid - IE50 - false - Library - - XMLRPC - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - System.dll - False - - - System.Xml.dll - False - - - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/Common/XmlRpcCS/XMLRPC.dll.build b/Common/XmlRpcCS/XMLRPC.dll.build deleted file mode 100644 index 2eabfcd..0000000 --- a/Common/XmlRpcCS/XMLRPC.dll.build +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Common/XmlRpcCS/XmlRpcBoxcarRequest.cs b/Common/XmlRpcCS/XmlRpcBoxcarRequest.cs deleted file mode 100644 index 064c165..0000000 --- a/Common/XmlRpcCS/XmlRpcBoxcarRequest.cs +++ /dev/null @@ -1,78 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.IO; - using System.Xml; - using System.Net; - using System.Text; - using System.Reflection; - - /// Class that collects individual XmlRpcRequest objects and submits them as a boxcarred request. - /// A boxcared request is when a number of request are collected before being sent via XML-RPC, and then are sent via - /// a single HTTP connection. This results in a speed up from reduced connection time. The results are then retuned collectively - /// as well. - /// - /// - public class XmlRpcBoxcarRequest : XmlRpcRequest - { - /// ArrayList to collect the requests to boxcar. - public IList Requests = new ArrayList(); - - /// Basic constructor. - public XmlRpcBoxcarRequest() - { - } - - /// Returns the String "system.multiCall" which is the server method that handles boxcars. - public override String MethodName - { - get { return "system.multiCall"; } - } - - /// The ArrayList of boxcarred Requests as properly formed parameters. - public override IList Params - { - get { - _params.Clear(); - ArrayList reqArray = new ArrayList(); - foreach (XmlRpcRequest request in Requests) - { - Hashtable requestEntry = new Hashtable(); - requestEntry.Add(XmlRpcXmlTokens.METHOD_NAME, request.MethodName); - requestEntry.Add(XmlRpcXmlTokens.PARAMS, request.Params); - reqArray.Add(requestEntry); - } - _params.Add(reqArray); - return _params; - } - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcClientProxy.cs b/Common/XmlRpcCS/XmlRpcClientProxy.cs deleted file mode 100644 index e9af1ac..0000000 --- a/Common/XmlRpcCS/XmlRpcClientProxy.cs +++ /dev/null @@ -1,88 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Runtime.Remoting.Proxies; - using System.Runtime.Remoting.Messaging; - - /// This class provides support for creating local proxies of XML-RPC remote objects - /// - /// To create a local proxy you need to create a local C# interface and then, via createProxy - /// associate that interface with a remote object at a given URL. - /// -public class XmlRpcClientProxy : RealProxy -{ - private String _remoteObjectName; - private String _url; - private XmlRpcRequest _client = new XmlRpcRequest(); - - /// Factory method to create proxies. - /// - /// To create a local proxy you need to create a local C# interface with methods that mirror those of the server object. - /// Next, pass that interface into createProxy along with the object name and URL of the remote object and - /// cast the resulting object to the specifice interface. - /// - /// String The name of the remote object. - /// String The URL of the remote object. - /// Type The typeof() of a C# interface. - /// Object A proxy for your specified interface. Cast to appropriate type. - public static Object createProxy(String remoteObjectName, String url, Type anInterface) - { - return new XmlRpcClientProxy(remoteObjectName, url, anInterface).GetTransparentProxy(); - } - - private XmlRpcClientProxy(String remoteObjectName, String url, Type t) : base(t) - { - _remoteObjectName = remoteObjectName; - _url = url; - } - - /// The local method dispatcher - do not invoke. - override public IMessage Invoke(IMessage msg) - { - IMethodCallMessage methodMessage = (IMethodCallMessage)msg; - - _client.MethodName = _remoteObjectName + "." + methodMessage.MethodName; - _client.Params.Clear(); - foreach (Object o in methodMessage.Args) - _client.Params.Add(o); - - try - { - Object ret = _client.Invoke(_url); - return new ReturnMessage(ret,null,0, - methodMessage.LogicalCallContext, methodMessage); - } - catch (Exception e) - { - return new ReturnMessage(e, methodMessage); - } - } -} -} diff --git a/Common/XmlRpcCS/XmlRpcDeserializer.cs b/Common/XmlRpcCS/XmlRpcDeserializer.cs deleted file mode 100644 index bffda57..0000000 --- a/Common/XmlRpcCS/XmlRpcDeserializer.cs +++ /dev/null @@ -1,222 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.IO; - using System.Xml; - using System.Globalization; - - /// Parser context, we maintain contexts in a stack to avoiding recursion. - struct Context - { - public String Name; - public Object Container; - } - - /// Basic XML-RPC data deserializer. - /// Uses XmlTextReader to parse the XML data. This level of the class - /// only handles the tokens common to both Requests and Responses. This class is not useful in and of itself - /// but is designed to be subclassed. - public class XmlRpcDeserializer : XmlRpcXmlTokens - { - private static DateTimeFormatInfo _dateFormat = new DateTimeFormatInfo(); - - private Object _container; - private Stack _containerStack; - - /// Protected reference to last text. - protected String _text; - /// Protected reference to last deserialized value. - protected Object _value; - /// Protected reference to last name field. - protected String _name; - - - /// Basic constructor. - public XmlRpcDeserializer() - { - Reset(); - _dateFormat.FullDateTimePattern = ISO_DATETIME; - } - - /// Static method that parses XML data into a response using the Singleton. - /// StreamReader containing an XML-RPC response. - /// Object object resulting from the deserialization. - virtual public Object Deserialize(TextReader xmlData) - { - return null; - } - - /// Protected method to parse a node in an XML-RPC XML stream. - /// Method deals with elements common to all XML-RPC data, subclasses of - /// this object deal with request/response spefic elements. - /// XmlTextReader of the in progress parsing data stream. - protected void DeserializeNode(XmlTextReader reader) - { - switch (reader.NodeType) - { - case XmlNodeType.Element: - if (Logger.Delegate != null) - Logger.WriteEntry("START " + reader.Name, LogLevel.Information); - switch (reader.Name) - { - case VALUE: - _value = null; - _text = null; - break; - case STRUCT: - PushContext(); - _container = new Hashtable(); - break; - case ARRAY: - PushContext(); - _container = new ArrayList(); - break; - } - break; - case XmlNodeType.EndElement: - if (Logger.Delegate != null) - Logger.WriteEntry("END " + reader.Name, LogLevel.Information); - switch (reader.Name) - { - case BASE64: - _value = Convert.FromBase64String(_text); - break; - case BOOLEAN: - int val = Int16.Parse(_text); - if (val == 0) - _value = false; - else if (val == 1) - _value = true; - break; - case STRING: - _value = _text; - break; - case DOUBLE: - _value = Double.Parse(_text); - break; - case INT: - case ALT_INT: - _value = Int32.Parse(_text); - break; - case DATETIME: -#if __MONO__ - _value = DateParse(_text); -#else - _value = DateTime.ParseExact(_text, "F", _dateFormat); -#endif - break; - case NAME: - _name = _text; - break; - case VALUE: - if (_value == null) - _value = _text; // some kits don't use tag, they just do - - if ((_container != null) && (_container is IList)) // in an array? If so add value to it. - ((IList)_container).Add(_value); - break; - case MEMBER: - if ((_container != null) && (_container is IDictionary)) // in an struct? If so add value to it. - ((IDictionary)_container).Add(_name, _value); - break; - case ARRAY: - case STRUCT: - _value = _container; - PopContext(); - break; - } - break; - case XmlNodeType.Text: - if (Logger.Delegate != null) - Logger.WriteEntry("Text " + reader.Value, LogLevel.Information); - _text = reader.Value; - break; - default: - break; - } - } - - /// Static method that parses XML in a String into a - /// request using the Singleton. - /// String containing an XML-RPC request. - /// XmlRpcRequest object resulting from the parse. - public Object Deserialize(String xmlData) - { - StringReader sr = new StringReader(xmlData); - return Deserialize(sr); - } - - /// Pop a Context of the stack, an Array or Struct has closed. - private void PopContext() - { - Context c = (Context)_containerStack.Pop(); - _container = c.Container; - _name = c.Name; - } - - /// Push a Context on the stack, an Array or Struct has opened. - private void PushContext() - { - Context context; - - context.Container = _container; - context.Name = _name; - - _containerStack.Push(context); - } - - /// Reset the internal state of the deserializer. - protected void Reset() - { - _text = null; - _value = null; - _name = null; - _container = null; - _containerStack = new Stack(); - } - -#if __MONO__ - private DateTime DateParse(String str) - { - int year = Int32.Parse(str.Substring(0,4)); - int month = Int32.Parse(str.Substring(4,2)); - int day = Int32.Parse(str.Substring(6,2)); - int hour = Int32.Parse(str.Substring(9,2)); - int min = Int32.Parse(str.Substring(12,2)); - int sec = Int32.Parse(str.Substring(15,2)); - return new DateTime(year,month,day,hour,min,sec); - } -#endif - - } -} - - diff --git a/Common/XmlRpcCS/XmlRpcErrorCodes.cs b/Common/XmlRpcCS/XmlRpcErrorCodes.cs deleted file mode 100644 index 258ebe6..0000000 --- a/Common/XmlRpcCS/XmlRpcErrorCodes.cs +++ /dev/null @@ -1,78 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - - /// Standard XML-RPC error codes. - public class XmlRpcErrorCodes - { - /// - public const int PARSE_ERROR_MALFORMED = -32700; - /// - public const String PARSE_ERROR_MALFORMED_MSG = "Parse Error, not well formed"; - - /// - public const int PARSE_ERROR_ENCODING = -32701; - /// - public const String PARSE_ERROR_ENCODING_MSG = "Parse Error, unsupported encoding"; - - // - // -32702 ---> parse error. invalid character for encoding - // -32600 ---> server error. invalid xml-rpc. not conforming to spec. - // - - /// - public const int SERVER_ERROR_METHOD = -32601; - /// - public const String SERVER_ERROR_METHOD_MSG = "Server Error, requested method not found"; - - /// - public const int SERVER_ERROR_PARAMS = -32602; - /// - public const String SERVER_ERROR_PARAMS_MSG = "Server Error, invalid method parameters"; - - // - // -32603 ---> server error. internal xml-rpc error - // - - /// - public const int APPLICATION_ERROR = -32500; - /// - public const String APPLICATION_ERROR_MSG = "Application Error"; - - // - // -32400 ---> system error - // - - /// - public const int TRANSPORT_ERROR = -32300; - /// - public const String TRANSPORT_ERROR_MSG = "Transport Layer Error"; - } -} diff --git a/Common/XmlRpcCS/XmlRpcException.cs b/Common/XmlRpcCS/XmlRpcException.cs deleted file mode 100644 index f728f90..0000000 --- a/Common/XmlRpcCS/XmlRpcException.cs +++ /dev/null @@ -1,66 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - - /// An XML-RPC Exception. - /// Maps a C# exception to an XML-RPC fault. Normal exceptions - /// include a message so this adds the code needed by XML-RPC. - public class XmlRpcException : Exception - { - private int _code; - - /// Instantiate an XmlRpcException with a code and message. - /// Int faultCode associated with this exception. - /// String faultMessage associated with this exception. - public XmlRpcException(int code, String message) - : base(message) - { - _code = code; - } - - /// The value of the faults message, i.e. the faultString. - public String FaultString - { - get { return Message; } - } - - /// The value of the faults code, i.e. the faultCode. - public int FaultCode - { - get { return _code; } - } - - /// Format the message to include the code. - override public String ToString() - { - return "Code: " + FaultCode + " Message: " + base.ToString(); - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcExposedAttribute.cs b/Common/XmlRpcCS/XmlRpcExposedAttribute.cs deleted file mode 100644 index 261ade3..0000000 --- a/Common/XmlRpcCS/XmlRpcExposedAttribute.cs +++ /dev/null @@ -1,87 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Reflection; - - /// - /// Simple tagging attribute to indicate participation is XML-RPC exposure. - /// - /// - /// If present at the class level it indicates that this class does explicitly - /// expose methods. If present at the method level it denotes that the method - /// is exposed. - /// - [AttributeUsage( - AttributeTargets.Class | AttributeTargets.Method, - AllowMultiple = false, - Inherited = true - )] - public class XmlRpcExposedAttribute : Attribute - { - /// Check if obj is an object utilizing the XML-RPC exposed Attribute. - /// Object of a class or method to check for attribute. - /// Boolean true if attribute present. - public static Boolean ExposedObject(Object obj) - { - return IsExposed(obj.GetType()); - } - - /// Check if obj.methodName is an XML-RPC exposed method. - /// A method is considered to be exposed if it exists and, either, the object does not use the XmlRpcExposed attribute, - /// or the object does use the XmlRpcExposed attribute and the method has the XmlRpcExposed attribute as well. - /// Boolean true if the method is exposed. - public static Boolean ExposedMethod(Object obj, String methodName) - { - Type type = obj.GetType(); - MethodInfo method = type.GetMethod(methodName); - - if (method == null) - throw new MissingMethodException("Method " + methodName + " not found."); - - if (!IsExposed(type)) - return true; - - return IsExposed(method); - } - - /// Check if mi is XML-RPC exposed. - /// MemberInfo of a class or method to check for attribute. - /// Boolean true if attribute present. - public static Boolean IsExposed(MemberInfo mi) - { - foreach (Attribute attr in mi.GetCustomAttributes(true)) - { - if (attr is XmlRpcExposedAttribute) - return true; - } - return false; - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcRequest.cs b/Common/XmlRpcCS/XmlRpcRequest.cs deleted file mode 100644 index 71a0dc9..0000000 --- a/Common/XmlRpcCS/XmlRpcRequest.cs +++ /dev/null @@ -1,177 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.IO; - using System.Xml; - using System.Net; - using System.Text; - using System.Reflection; - using System.Net.Security; - using System.Security.Cryptography.X509Certificates; - - internal class AcceptAllCertificatePolicy : ICertificatePolicy - { - public AcceptAllCertificatePolicy() - { - } - - public bool CheckValidationResult(ServicePoint sPoint, - System.Security.Cryptography.X509Certificates.X509Certificate cert, - WebRequest wRequest, int certProb) - { - // Always accept - return true; - } - } - - /// Class supporting the request side of an XML-RPC transaction. - public class XmlRpcRequest - { - private String _methodName = null; - private Encoding _encoding = new UTF8Encoding(); - private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer(); - private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer(); - - /// ArrayList containing the parameters. - protected IList _params = null; - - /// Instantiate an XmlRpcRequest - public XmlRpcRequest() - { - _params = new ArrayList(); - } - - /// Instantiate an XmlRpcRequest for a specified method and parameters. - /// String designating the object.method on the server the request - /// should be directed to. - /// ArrayList of XML-RPC type parameters to invoke the request with. - public XmlRpcRequest(String methodName, IList parameters) - { - MethodName = methodName; - _params = parameters; - } - - /// ArrayList conntaining the parameters for the request. - public virtual IList Params - { - get { return _params; } - } - - /// String conntaining the method name, both object and method, that the request will be sent to. - public virtual String MethodName - { - get { return _methodName; } - set { _methodName = value; } - } - - /// String object name portion of the method name. - public String MethodNameObject - { - get - { - int index = MethodName.IndexOf("."); - - if (index == -1) - return MethodName; - - return MethodName.Substring(0, index); - } - } - - /// String method name portion of the object.method name. - public String MethodNameMethod - { - get - { - int index = MethodName.IndexOf("."); - - if (index == -1) - return MethodName; - - return MethodName.Substring(index + 1, MethodName.Length - index - 1); - } - } - - /// Invoke this request on the server. - /// String The url of the XML-RPC server. - /// Object The value returned from the method invocation on the server. - /// If an exception generated on the server side. - public Object Invoke(String url) - { - XmlRpcResponse res = Send(url, 10000); - - if (res.IsFault) - throw new XmlRpcException(res.FaultCode, res.FaultString); - - return res.Value; - } - - /// Send the request to the server. - /// String The url of the XML-RPC server. - /// Milliseconds before the connection times out. - /// XmlRpcResponse The response generated. - public XmlRpcResponse Send(String url, int timeout) - { - // Override SSL authentication mechanisms - ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy(); - - HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); - if (request == null) - throw new XmlRpcException(XmlRpcErrorCodes.TRANSPORT_ERROR, - XmlRpcErrorCodes.TRANSPORT_ERROR_MSG + ": Could not create request with " + url); - request.Method = "POST"; - request.ContentType = "text/xml"; - request.AllowWriteStreamBuffering = true; - request.Timeout = timeout; - - Stream stream = request.GetRequestStream(); - XmlTextWriter xml = new XmlTextWriter(stream, _encoding); - _serializer.Serialize(xml, this); - xml.Flush(); - xml.Close(); - - HttpWebResponse response = (HttpWebResponse)request.GetResponse(); - StreamReader input = new StreamReader(response.GetResponseStream()); - - XmlRpcResponse resp = (XmlRpcResponse)_deserializer.Deserialize(input); - input.Close(); - response.Close(); - return resp; - } - - /// Produce String representation of the object. - /// String representation of the object. - override public String ToString() - { - return _serializer.Serialize(this); - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcRequestDeserializer.cs b/Common/XmlRpcCS/XmlRpcRequestDeserializer.cs deleted file mode 100644 index 126a172..0000000 --- a/Common/XmlRpcCS/XmlRpcRequestDeserializer.cs +++ /dev/null @@ -1,92 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.Diagnostics; - using System.IO; - using System.Xml; - - /// Class to deserialize XML data representing a request. - public class XmlRpcRequestDeserializer : XmlRpcDeserializer - { - static private XmlRpcRequestDeserializer _singleton; - /// A static singleton instance of this deserializer. - [Obsolete("This object is now thread safe, just use an instance.", false)] - static public XmlRpcRequestDeserializer Singleton - { - get - { - if (_singleton == null) - _singleton = new XmlRpcRequestDeserializer(); - - return _singleton; - } - } - - /// Static method that parses XML data into a request using the Singleton. - /// StreamReader containing an XML-RPC request. - /// XmlRpcRequest object resulting from the parse. - override public Object Deserialize(TextReader xmlData) - { - XmlTextReader reader = new XmlTextReader(xmlData); - - XmlRpcRequest request = new XmlRpcRequest(); - bool done = false; - - lock (this) - { - Reset(); - while (!done && reader.Read()) - { - DeserializeNode(reader); // Parent parse... - switch (reader.NodeType) - { - case XmlNodeType.EndElement: - switch (reader.Name) - { - case METHOD_NAME: - request.MethodName = _text; - break; - case METHOD_CALL: - done = true; - break; - case PARAM: - request.Params.Add(_value); - _text = null; - break; - } - break; - } - } - } - return request; - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcRequestSerializer.cs b/Common/XmlRpcCS/XmlRpcRequestSerializer.cs deleted file mode 100644 index 9bf95c7..0000000 --- a/Common/XmlRpcCS/XmlRpcRequestSerializer.cs +++ /dev/null @@ -1,78 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.Xml; - using System.IO; - - /// Class responsible for serializing an XML-RPC request. - /// This class handles the request envelope, depending on XmlRpcSerializer - /// to serialize the payload. - /// - public class XmlRpcRequestSerializer : XmlRpcSerializer - { - static private XmlRpcRequestSerializer _singleton; - /// A static singleton instance of this deserializer. - static public XmlRpcRequestSerializer Singleton - { - get - { - if (_singleton == null) - _singleton = new XmlRpcRequestSerializer(); - - return _singleton; - } - } - - /// Serialize the XmlRpcRequest to the output stream. - /// An XmlTextWriter stream to write data to. - /// An XmlRpcRequest to serialize. - /// - override public void Serialize(XmlTextWriter output, Object obj) - { - XmlRpcRequest request = (XmlRpcRequest)obj; - output.WriteStartDocument(); - output.WriteStartElement(METHOD_CALL); - output.WriteElementString(METHOD_NAME, request.MethodName); - output.WriteStartElement(PARAMS); - foreach (Object param in request.Params) - { - output.WriteStartElement(PARAM); - output.WriteStartElement(VALUE); - SerializeObject(output, param); - output.WriteEndElement(); - output.WriteEndElement(); - } - - output.WriteEndElement(); - output.WriteEndElement(); - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcResponder.cs b/Common/XmlRpcCS/XmlRpcResponder.cs deleted file mode 100644 index 05377a2..0000000 --- a/Common/XmlRpcCS/XmlRpcResponder.cs +++ /dev/null @@ -1,127 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Xml; - using System.Net.Sockets; - using System.Text; - - /// The class is a container of the context of an XML-RPC dialog on the server side. - /// Instances of this class maintain the context for an individual XML-RPC server - /// side dialog. Namely they manage an inbound deserializer and an outbound serializer. - public class XmlRpcResponder - { - private XmlRpcRequestDeserializer _deserializer = new XmlRpcRequestDeserializer(); - private XmlRpcResponseSerializer _serializer = new XmlRpcResponseSerializer(); - private XmlRpcServer _server; - private TcpClient _client; - private SimpleHttpRequest _httpReq; - - /// The SimpleHttpRequest based on the TcpClient. - public SimpleHttpRequest HttpReq - { - get { return _httpReq; } - } - - /// Basic constructor. - /// XmlRpcServer that this XmlRpcResponder services. - /// TcpClient with the connection. - public XmlRpcResponder(XmlRpcServer server, TcpClient client) - { - _server = server; - _client = client; - _httpReq = new SimpleHttpRequest(_client); - } - - /// Call close to insure proper shutdown. - ~XmlRpcResponder() - { - Close(); - } - - ///Respond using this responders HttpReq. - public void Respond() - { - Respond(HttpReq); - } - - /// Handle an HTTP request containing an XML-RPC request. - /// This method deserializes the XML-RPC request, invokes the - /// described method, serializes the response (or fault) and sends the XML-RPC response - /// back as a valid HTTP page. - /// - /// SimpleHttpRequest containing the request. - public void Respond(SimpleHttpRequest httpReq) - { - XmlRpcRequest xmlRpcReq = (XmlRpcRequest)_deserializer.Deserialize(httpReq.Input); - XmlRpcResponse xmlRpcResp = new XmlRpcResponse(); - - try - { - xmlRpcResp.Value = _server.Invoke(xmlRpcReq); - } - catch (XmlRpcException e) - { - xmlRpcResp.SetFault(e.FaultCode, e.FaultString); - } - catch (Exception e2) - { - xmlRpcResp.SetFault(XmlRpcErrorCodes.APPLICATION_ERROR, - XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": " + e2.Message); - } - - if (Logger.Delegate != null) - Logger.WriteEntry(xmlRpcResp.ToString(), LogLevel.Information); - - XmlRpcServer.HttpHeader(httpReq.Protocol, "text/xml", 0, " 200 OK", httpReq.Output); - httpReq.Output.Flush(); - - XmlTextWriter xml = new XmlTextWriter(httpReq.Output); - _serializer.Serialize(xml, xmlRpcResp); - xml.Flush(); - httpReq.Output.Flush(); - } - - ///Close all contained resources, both the HttpReq and client. - public void Close() - { - if (_httpReq != null) - { - _httpReq.Close(); - _httpReq = null; - } - - if (_client != null) - { - _client.Close(); - _client = null; - } - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcResponse.cs b/Common/XmlRpcCS/XmlRpcResponse.cs deleted file mode 100644 index 414998e..0000000 --- a/Common/XmlRpcCS/XmlRpcResponse.cs +++ /dev/null @@ -1,112 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.IO; - using System.Xml; - - /// Class designed to represent an XML-RPC response. - public class XmlRpcResponse - { - private Object _value; - /// bool indicating if this response represents a fault. - public bool IsFault; - - /// Basic constructor - public XmlRpcResponse() - { - Value = null; - IsFault = false; - } - - /// Constructor for a fault. - /// int the numeric faultCode value. - /// String the faultString value. - public XmlRpcResponse(int code, String message) - : this() - { - SetFault(code, message); - } - - /// The data value of the response, may be fault data. - public Object Value - { - get { return _value; } - set - { - IsFault = false; - _value = value; - } - } - - /// The faultCode if this is a fault. - public int FaultCode - { - get - { - if (!IsFault) - return 0; - else - return (int)((Hashtable)_value)[XmlRpcXmlTokens.FAULT_CODE]; - } - } - - /// The faultString if this is a fault. - public String FaultString - { - get - { - if (!IsFault) - return ""; - else - return (String)((Hashtable)_value)[XmlRpcXmlTokens.FAULT_STRING]; - } - } - - /// Set this response to be a fault. - /// int the numeric faultCode value. - /// String the faultString value. - public void SetFault(int code, String message) - { - Hashtable fault = new Hashtable(); - fault.Add("faultCode", code); - fault.Add("faultString", message); - Value = fault; - IsFault = true; - } - - /// Form a useful string representation of the object, in this case the XML response. - /// String The XML serialized XML-RPC response. - override public String ToString() - { - return XmlRpcResponseSerializer.Singleton.Serialize(this); - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcResponseDeserializer.cs b/Common/XmlRpcCS/XmlRpcResponseDeserializer.cs deleted file mode 100644 index 46c5742..0000000 --- a/Common/XmlRpcCS/XmlRpcResponseDeserializer.cs +++ /dev/null @@ -1,92 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.IO; - using System.Xml; - - /// Class to deserialize XML data representing a response. - public class XmlRpcResponseDeserializer : XmlRpcDeserializer - { - static private XmlRpcResponseDeserializer _singleton; - /// A static singleton instance of this deserializer. - [Obsolete("This object is now thread safe, just use an instance.", false)] - static public XmlRpcResponseDeserializer Singleton - { - get - { - if (_singleton == null) - _singleton = new XmlRpcResponseDeserializer(); - - return _singleton; - } - } - - /// Static method that parses XML data into a response using the Singleton. - /// StreamReader containing an XML-RPC response. - /// XmlRpcResponse object resulting from the parse. - override public Object Deserialize(TextReader xmlData) - { - XmlTextReader reader = new XmlTextReader(xmlData); - XmlRpcResponse response = new XmlRpcResponse(); - bool done = false; - - lock (this) - { - Reset(); - - while (!done && reader.Read()) - { - DeserializeNode(reader); // Parent parse... - switch (reader.NodeType) - { - case XmlNodeType.EndElement: - switch (reader.Name) - { - case FAULT: - response.Value = _value; - response.IsFault = true; - break; - case PARAM: - response.Value = _value; - _value = null; - _text = null; - break; - } - break; - default: - break; - } - } - } - return response; - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcResponseSerializer.cs b/Common/XmlRpcCS/XmlRpcResponseSerializer.cs deleted file mode 100644 index 5ee4954..0000000 --- a/Common/XmlRpcCS/XmlRpcResponseSerializer.cs +++ /dev/null @@ -1,84 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.Xml; - - /// Class responsible for serializing an XML-RPC response. - /// This class handles the response envelope, depending on XmlRpcSerializer - /// to serialize the payload. - /// - public class XmlRpcResponseSerializer : XmlRpcSerializer - { - static private XmlRpcResponseSerializer _singleton; - /// A static singleton instance of this deserializer. - static public XmlRpcResponseSerializer Singleton - { - get - { - if (_singleton == null) - _singleton = new XmlRpcResponseSerializer(); - - return _singleton; - } - } - - /// Serialize the XmlRpcResponse to the output stream. - /// An XmlTextWriter stream to write data to. - /// An Object to serialize. - /// - override public void Serialize(XmlTextWriter output, Object obj) - { - XmlRpcResponse response = (XmlRpcResponse)obj; - - output.WriteStartDocument(); - output.WriteStartElement(METHOD_RESPONSE); - - if (response.IsFault) - output.WriteStartElement(FAULT); - else - { - output.WriteStartElement(PARAMS); - output.WriteStartElement(PARAM); - } - - output.WriteStartElement(VALUE); - - SerializeObject(output, response.Value); - - output.WriteEndElement(); - - output.WriteEndElement(); - if (!response.IsFault) - output.WriteEndElement(); - output.WriteEndElement(); - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcSerializer.cs b/Common/XmlRpcCS/XmlRpcSerializer.cs deleted file mode 100644 index b3b9af3..0000000 --- a/Common/XmlRpcCS/XmlRpcSerializer.cs +++ /dev/null @@ -1,143 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.IO; - using System.Xml; - using System.Text; - - /// Base class of classes serializing data to XML-RPC's XML format. - /// This class handles the basic type conversions like Integer to <i4>. - /// - public class XmlRpcSerializer : XmlRpcXmlTokens - { - - /// Serialize the XmlRpcRequest to the output stream. - /// An XmlTextWriter stream to write data to. - /// An Object to serialize. - /// - virtual public void Serialize(XmlTextWriter output, Object obj) - { - } - - /// Serialize the XmlRpcRequest to a String. - /// Note this may represent a real memory hog for a large request. - /// An Object to serialize. - /// String containing XML-RPC representation of the request. - /// - public String Serialize(Object obj) - { - using (MemoryStream memStream = new MemoryStream(4096)) - { - XmlTextWriter xml = new XmlTextWriter( memStream, null ); - xml.Formatting = Formatting.Indented; - xml.Indentation = 4; - Serialize(xml, obj); - xml.Flush(); - - byte[] resultBytes = memStream.ToArray(); - - UTF8Encoding encoder = new UTF8Encoding(); - String returns = encoder.GetString( resultBytes, 0, resultBytes.Length ); - xml.Close(); - return returns; - } - } - - /// Serialize the object to the output stream. - /// An XmlTextWriter stream to write data to. - /// An Object to serialize. - public void SerializeObject(XmlTextWriter output, Object obj) - { - if (obj == null) - return; - - if (obj is byte[]) - { - byte[] ba = (byte[])obj; - output.WriteStartElement(BASE64); - output.WriteBase64(ba, 0, ba.Length); - output.WriteEndElement(); - } - else if (obj is String) - { - output.WriteElementString(STRING, obj.ToString()); - } - else if (obj is Int32) - { - output.WriteElementString(INT, obj.ToString()); - } - else if (obj is DateTime) - { - output.WriteElementString(DATETIME, ((DateTime)obj).ToString(ISO_DATETIME)); - } - else if (obj is Double) - { - output.WriteElementString(DOUBLE, obj.ToString()); - } - else if (obj is Boolean) - { - output.WriteElementString(BOOLEAN, ((((Boolean)obj) == true) ? "1" : "0")); - } - else if (obj is IList) - { - output.WriteStartElement(ARRAY); - output.WriteStartElement(DATA); - if (((ArrayList)obj).Count > 0) - { - foreach (Object member in ((IList)obj)) - { - output.WriteStartElement(VALUE); - SerializeObject(output, member); - output.WriteEndElement(); - } - } - output.WriteEndElement(); - output.WriteEndElement(); - } - else if (obj is IDictionary) - { - IDictionary h = (IDictionary)obj; - output.WriteStartElement(STRUCT); - foreach (String key in h.Keys) - { - output.WriteStartElement(MEMBER); - output.WriteElementString(NAME, key); - output.WriteStartElement(VALUE); - SerializeObject(output, h[key]); - output.WriteEndElement(); - output.WriteEndElement(); - } - output.WriteEndElement(); - } - - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcServer.cs b/Common/XmlRpcCS/XmlRpcServer.cs deleted file mode 100644 index 6d1f33a..0000000 --- a/Common/XmlRpcCS/XmlRpcServer.cs +++ /dev/null @@ -1,266 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.IO; - using System.Net; - using System.Net.Sockets; - using System.Text; - using System.Threading; - using System.Xml; - - /// A restricted HTTP server for use with XML-RPC. - /// It only handles POST requests, and only POSTs representing XML-RPC calls. - /// In addition to dispatching requests it also provides a registry for request handlers. - /// - public class XmlRpcServer : IEnumerable - { -#pragma warning disable 0414 // disable "private field assigned but not used" - const int RESPONDER_COUNT = 10; - private TcpListener _myListener; - private int _port; - private IPAddress _address; - private IDictionary _handlers; - private XmlRpcSystemObject _system; - private WaitCallback _wc; -#pragma warning restore 0414 - - ///Constructor with port and address. - ///This constructor sets up a TcpListener listening on the - ///given port and address. It also calls a Thread on the method StartListen(). - ///IPAddress value of the address to listen on. - ///Int value of the port to listen on. - public XmlRpcServer(IPAddress address, int port) - { - _port = port; - _address = address; - _handlers = new Hashtable(); - _system = new XmlRpcSystemObject(this); - _wc = new WaitCallback(WaitCallback); - } - - ///Basic constructor. - ///This constructor sets up a TcpListener listening on the - ///given port. It also calls a Thread on the method StartListen(). IPAddress.Any - ///is assumed as the address here. - ///Int value of the port to listen on. - public XmlRpcServer(int port) : this(IPAddress.Any, port) { } - - /// Start the server. - public void Start() - { - try - { - Stop(); - //start listing on the given port - // IPAddress addr = IPAddress.Parse("127.0.0.1"); - lock (this) - { - _myListener = new TcpListener(IPAddress.Any, _port); - _myListener.Start(); - //start the thread which calls the method 'StartListen' - Thread th = new Thread(new ThreadStart(StartListen)); - th.Start(); - } - } - catch (Exception e) - { - Logger.WriteEntry("An Exception Occurred while Listening :" + e.ToString(), LogLevel.Error); - } - } - - /// Stop the server. - public void Stop() - { - try - { - if (_myListener != null) - { - lock (this) - { - _myListener.Stop(); - _myListener = null; - } - } - } - catch (Exception e) - { - Logger.WriteEntry("An Exception Occurred while stopping :" + - e.ToString(), LogLevel.Error); - } - } - - /// Get an enumeration of my XML-RPC handlers. - /// IEnumerable the handler enumeration. - public IEnumerator GetEnumerator() - { - return _handlers.GetEnumerator(); - } - - /// Retrieve a handler by name. - /// String naming a handler - /// Object that is the handler. - public Object this[String name] - { - get { return _handlers[name]; } - } - - /// - ///This method Accepts new connections and dispatches them when appropriate. - /// - public void StartListen() - { - while (true && _myListener != null) - { - //Accept a new connection - XmlRpcResponder responder = new XmlRpcResponder(this, _myListener.AcceptTcpClient()); - ThreadPool.QueueUserWorkItem(_wc, responder); - } - } - - - /// - ///Add an XML-RPC handler object by name. - /// - ///String XML-RPC dispatch name of this object. - ///Object The object that is the XML-RPC handler. - public void Add(String name, Object obj) - { - _handlers.Add(name, obj); - } - - ///Return a C# object.method name for and XML-RPC object.method name pair. - ///The XML-RPC object.method. - ///String of form object.method for the underlying C# method. - public String MethodName(String methodName) - { - int dotAt = methodName.LastIndexOf('.'); - - if (dotAt == -1) - { - throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD, - XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Bad method name " + methodName); - } - - String objectName = methodName.Substring(0, dotAt); - Object target = _handlers[objectName]; - - if (target == null) - { - throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD, - XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found"); - } - - return target.GetType().FullName + "." + methodName.Substring(dotAt + 1); - } - - ///Invoke a method described in a request. - ///XmlRpcRequest containing a method descriptions. - /// - /// - public Object Invoke(XmlRpcRequest req) - { - return Invoke(req.MethodNameObject, req.MethodNameMethod, req.Params); - } - - ///Invoke a method on a named handler. - ///String The name of the handler. - ///String The name of the method to invoke on the handler. - ///IList The parameters to invoke the method with. - /// - public Object Invoke(String objectName, String methodName, IList parameters) - { - Object target = _handlers[objectName]; - - if (target == null) - { - throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD, - XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found"); - } - - return XmlRpcSystemObject.Invoke(target, methodName, parameters); - } - - /// The method the thread pool invokes when a thread is available to handle an HTTP request. - /// TcpClient from the socket accept. - public void WaitCallback(object responder) - { - XmlRpcResponder resp = (XmlRpcResponder)responder; - - if (resp.HttpReq.HttpMethod == "POST") - { - try - { - resp.Respond(); - } - catch (Exception e) - { - Logger.WriteEntry("Failed on post: " + e, LogLevel.Error); - } - } - else - { - Logger.WriteEntry("Only POST methods are supported: " + resp.HttpReq.HttpMethod + - " ignored", LogLevel.Error); - } - - resp.Close(); - } - - /// - /// This function send the Header Information to the client (Browser) - /// - /// HTTP Version - /// Mime Type - /// Total Bytes to be sent in the body - /// - /// Socket reference - static public void HttpHeader(string sHttpVersion, string sMIMEHeader, long iTotBytes, string sStatusCode, TextWriter output) - { - String sBuffer = ""; - - // if Mime type is not provided set default to text/html - if (sMIMEHeader.Length == 0) - { - sMIMEHeader = "text/html"; // Default Mime Type is text/html - } - - sBuffer += sHttpVersion + sStatusCode + "\r\n"; - sBuffer += "Connection: close\r\n"; - if (iTotBytes > 0) - sBuffer += "Content-Length: " + iTotBytes + "\r\n"; - sBuffer += "Server: XmlRpcServer \r\n"; - sBuffer += "Content-Type: " + sMIMEHeader + "\r\n"; - sBuffer += "\r\n"; - - output.Write(sBuffer); - } - } -} diff --git a/Common/XmlRpcCS/XmlRpcSystemObject.cs b/Common/XmlRpcCS/XmlRpcSystemObject.cs deleted file mode 100644 index 4055d29..0000000 --- a/Common/XmlRpcCS/XmlRpcSystemObject.cs +++ /dev/null @@ -1,279 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - using System.Collections; - using System.Reflection; - - /// XML-RPC System object implementation of extended specifications. - [XmlRpcExposed] - public class XmlRpcSystemObject - { - private XmlRpcServer _server; - static private IDictionary _methodHelp = new Hashtable(); - - /// Static IDictionary to hold mappings of method name to associated documentation String - static public IDictionary MethodHelp - { - get { return _methodHelp; } - } - - /// Constructor. - /// XmlRpcServer server to be the system object for. - public XmlRpcSystemObject(XmlRpcServer server) - { - _server = server; - server.Add("system", this); - _methodHelp.Add(this.GetType().FullName + ".methodHelp", "Return a string description."); - } - - /// Invoke a method on a given object. - /// Using reflection, and respecting the XmlRpcExposed attribute, - /// invoke the methodName method on the target - /// instance with the parameters provided. All this packages other Invoke methods - /// end up calling this. - /// Object the value the invoked method returns. - /// If method does not exist, is not exposed, parameters invalid, or invocation - /// results in an exception. Note, the XmlRpcException.Code will indicate cause. - static public Object Invoke(Object target, String methodName, IList parameters) - { - if (target == null) - throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD, - XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Invalid target object."); - - Type type = target.GetType(); - MethodInfo method = type.GetMethod(methodName); - - try - { - if (!XmlRpcExposedAttribute.ExposedMethod(target, methodName)) - throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD, - XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Method " + methodName + " is not exposed."); - } - catch (MissingMethodException me) - { - throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD, - XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": " + me.Message); - } - - Object[] args = new Object[parameters.Count]; - - int index = 0; - foreach (Object arg in parameters) - { - args[index] = arg; - index++; - } - - try - { - Object retValue = method.Invoke(target, args); - if (retValue == null) - throw new XmlRpcException(XmlRpcErrorCodes.APPLICATION_ERROR, - XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": Method returned NULL."); - return retValue; - } - catch (XmlRpcException e) - { - throw e; - } - catch (ArgumentException ae) - { - Logger.WriteEntry(XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": " + ae.Message, - LogLevel.Information); - String call = methodName + "( "; - foreach (Object o in args) - { - call += o.GetType().Name; - call += " "; - } - call += ")"; - throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_PARAMS, - XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": Arguement type mismatch invoking " + call); - } - catch (TargetParameterCountException tpce) - { - Logger.WriteEntry(XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": " + tpce.Message, - LogLevel.Information); - throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_PARAMS, - XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": Arguement count mismatch invoking " + methodName); - } - catch (TargetInvocationException tie) - { - throw new XmlRpcException(XmlRpcErrorCodes.APPLICATION_ERROR, - XmlRpcErrorCodes.APPLICATION_ERROR_MSG + " Invoked method " + methodName + ": " + tie.Message); - } - } - - /// List methods available on all handlers of this server. - /// IList An array of Strings, each String will have form "object.method". - [XmlRpcExposed] - public IList listMethods() - { - IList methods = new ArrayList(); - Boolean considerExposure; - - foreach (DictionaryEntry handlerEntry in _server) - { - considerExposure = XmlRpcExposedAttribute.IsExposed(handlerEntry.Value.GetType()); - - foreach (MemberInfo mi in handlerEntry.Value.GetType().GetMembers()) - { - if (mi.MemberType != MemberTypes.Method) - continue; - - if (!((MethodInfo)mi).IsPublic) - continue; - - if (considerExposure && !XmlRpcExposedAttribute.IsExposed(mi)) - continue; - - methods.Add(handlerEntry.Key + "." + mi.Name); - } - } - - return methods; - } - - /// Given a method name return the possible signatures for it. - /// String The object.method name to look up. - /// IList Of arrays of signatures. - [XmlRpcExposed] - public IList methodSignature(String name) - { - IList signatures = new ArrayList(); - int index = name.IndexOf('.'); - - if (index < 0) - return signatures; - - String oName = name.Substring(0, index); - Object obj = _server[oName]; - - if (obj == null) - return signatures; - - MemberInfo[] mi = obj.GetType().GetMember(name.Substring(index + 1)); - - if (mi == null || mi.Length != 1) // for now we want a single signature - return signatures; - - MethodInfo method; - - try - { - method = (MethodInfo)mi[0]; - } - catch (Exception e) - { - Logger.WriteEntry("Attempted methodSignature call on " + mi[0] + " caused: " + e, - LogLevel.Information); - return signatures; - } - - if (!method.IsPublic) - return signatures; - - IList signature = new ArrayList(); - signature.Add(method.ReturnType.Name); - - foreach (ParameterInfo param in method.GetParameters()) - { - signature.Add(param.ParameterType.Name); - } - - - signatures.Add(signature); - - return signatures; - } - - /// Help for given method signature. Not implemented yet. - /// String The object.method name to look up. - /// String help text. Rich HTML text. - [XmlRpcExposed] - public String methodHelp(String name) - { - String help = null; - - try - { - help = (String)_methodHelp[_server.MethodName(name)]; - } - catch (XmlRpcException e) - { - throw e; - } - catch (Exception) { /* ignored */ }; - - if (help == null) - help = "No help available for: " + name; - - return help; - } - - /// Boxcarring support method. - /// IList of calls - /// ArrayList of results/faults. - [XmlRpcExposed] - public IList multiCall(IList calls) - { - IList responses = new ArrayList(); - XmlRpcResponse fault = new XmlRpcResponse(); - - foreach (IDictionary call in calls) - { - try - { - XmlRpcRequest req = new XmlRpcRequest((String)call[XmlRpcXmlTokens.METHOD_NAME], - (ArrayList)call[XmlRpcXmlTokens.PARAMS]); - Object results = _server.Invoke(req); - IList response = new ArrayList(); - response.Add(results); - responses.Add(response); - } - catch (XmlRpcException e) - { - fault.SetFault(e.FaultCode, e.FaultString); - responses.Add(fault.Value); - } - catch (Exception e2) - { - fault.SetFault(XmlRpcErrorCodes.APPLICATION_ERROR, - XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": " + e2.Message); - responses.Add(fault.Value); - } - } - - return responses; - } - - } -} - diff --git a/Common/XmlRpcCS/XmlRpcXmlTokens.cs b/Common/XmlRpcCS/XmlRpcXmlTokens.cs deleted file mode 100644 index 27447bb..0000000 --- a/Common/XmlRpcCS/XmlRpcXmlTokens.cs +++ /dev/null @@ -1,103 +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. -* -*/ -namespace Nwc.XmlRpc -{ - using System; - - /// Class collecting String tokens that are part of XML-RPC files. - public class XmlRpcXmlTokens - { - /// C# formatting string to describe an ISO 8601 date. - public const String ISO_DATETIME = "yyyyMMdd\\THH\\:mm\\:ss"; - /// Base64 field indicator. - /// Corresponds to the <base64> tag. - public const String BASE64 = "base64"; - /// String field indicator. - /// Corresponds to the <string> tag. - public const String STRING = "string"; - /// Integer field integer. - /// Corresponds to the <i4> tag. - public const String INT = "i4"; - /// Alternate integer field indicator. - /// Corresponds to the <int> tag. - public const String ALT_INT = "int"; - /// Date field indicator. - /// Corresponds to the <dateTime.iso8601> tag. - public const String DATETIME = "dateTime.iso8601"; - /// Boolean field indicator. - /// Corresponds to the <boolean> tag. - public const String BOOLEAN = "boolean"; - /// Value token. - /// Corresponds to the <value> tag. - public const String VALUE = "value"; - /// Name token. - /// Corresponds to the <name> tag. - public const String NAME = "name"; - /// Array field indicator.. - /// Corresponds to the <array> tag. - public const String ARRAY = "array"; - /// Data token. - /// Corresponds to the <data> tag. - public const String DATA = "data"; - /// Member token. - /// Corresponds to the <member> tag. - public const String MEMBER = "member"; - /// Stuct field indicator. - /// Corresponds to the <struct> tag. - public const String STRUCT = "struct"; - /// Double field indicator. - /// Corresponds to the <double> tag. - public const String DOUBLE = "double"; - /// Param token. - /// Corresponds to the <param> tag. - public const String PARAM = "param"; - /// Params token. - /// Corresponds to the <params> tag. - public const String PARAMS = "params"; - /// MethodCall token. - /// Corresponds to the <methodCall> tag. - public const String METHOD_CALL = "methodCall"; - /// MethodName token. - /// Corresponds to the <methodName> tag. - public const String METHOD_NAME = "methodName"; - /// MethodResponse token - /// Corresponds to the <methodResponse> tag. - public const String METHOD_RESPONSE = "methodResponse"; - /// Fault response token. - /// Corresponds to the <fault> tag. - public const String FAULT = "fault"; - /// FaultCode token. - /// Corresponds to the <faultCode> tag. - public const String FAULT_CODE = "faultCode"; - /// FaultString token. - /// Corresponds to the <faultString> tag. - public const String FAULT_STRING = "faultString"; - } -} - - -- cgit v1.1