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 --- CONTRIBUTORS.txt | 30 - 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 - OpenGridServices.build | 103 - OpenGridServices.sln | 91 - .../OpenGrid.Config/GridConfigDb4o/AssemblyInfo.cs | 58 - .../OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs | 161 - .../OpenGrid.Config.GridConfigDb4o.csproj | 107 - .../OpenGrid.Config.GridConfigDb4o.dll.build | 46 - .../OpenGrid.Framework.Data.DB4o/DB4oGridData.cs | 161 - .../OpenGrid.Framework.Data.DB4o/DB4oManager.cs | 165 - .../OpenGrid.Framework.Data.DB4o/DB4oUserData.cs | 205 - .../OpenGrid.Framework.Data.DB4o.csproj | 111 - .../OpenGrid.Framework.Data.DB4o.dll.build | 47 - .../Properties/AssemblyInfo.cs | 35 - .../OpenGrid.Framework.Data.MSSQL/MSSQLGridData.cs | 190 - .../OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs | 214 - .../OpenGrid.Framework.Data.MSSQL.csproj | 104 - .../OpenGrid.Framework.Data.MSSQL.dll.build | 45 - .../Properties/AssemblyInfo.cs | 35 - .../OpenGrid.Framework.Data.MySQL/MySQLGridData.cs | 258 - .../MySQLInventoryData.cs | 309 - .../OpenGrid.Framework.Data.MySQL/MySQLLogData.cs | 107 - .../OpenGrid.Framework.Data.MySQL/MySQLManager.cs | 665 -- .../OpenGrid.Framework.Data.MySQL/MySQLUserData.cs | 271 - .../OpenGrid.Framework.Data.MySQL.csproj | 117 - .../OpenGrid.Framework.Data.MySQL.dll.build | 49 - .../Properties/AssemblyInfo.cs | 35 - .../OpenGrid.Framework.Data.SQLite.csproj | 108 - .../OpenGrid.Framework.Data.SQLite.dll.build | 46 - .../Properties/AssemblyInfo.cs | 35 - .../SQLiteGridData.cs | 190 - .../SQLiteManager.cs | 209 - .../OpenGrid.Framework.Data/GridData.cs | 110 - .../OpenGrid.Framework.Data/ILogData.cs | 94 - .../OpenGrid.Framework.Data/IniConfig.cs | 100 - .../OpenGrid.Framework.Data/InventoryData.cs | 187 - .../OpenGrid.Framework.Data.csproj | 113 - .../OpenGrid.Framework.Data.dll.build | 49 - .../Properties/AssemblyInfo.cs | 35 - .../OpenGrid.Framework.Data/SimProfileData.cs | 114 - .../OpenGrid.Framework.Data/UserData.cs | 131 - .../OpenGrid.Framework.Data/UserProfileData.cs | 182 - .../GridManagementAgent.cs | 140 - .../GridServerManager.cs | 94 - .../OpenGrid.Framework.Manager.csproj | 99 - .../OpenGrid.Framework.Manager.dll.build | 44 - .../AssetHttpServer.cs | 130 - .../OpenGridServices.AssetServer/Main.cs | 338 - .../OpenGridServices.AssetServer.csproj | 122 - .../OpenGridServices.AssetServer.exe.build | 50 - .../OpenGridServices.GridServer.csproj | 126 - .../OpenGridServices.GridServer.exe.build | 49 - .../Properties/AssemblyInfo.cs | 33 - .../OpenGridServices.GridServer/GridManager.cs | 589 -- .../OpenGridServices.GridServer/Main.cs | 271 - .../OpenGridServices.GridServer.csproj | 134 - .../OpenGridServices.GridServer.exe.build | 52 - .../Properties/AssemblyInfo.cs | 33 - .../InventoryManager.cs | 126 - .../OpenGridServices.InventoryServer/Main.cs | 87 - .../OpenGridServices.InventoryServer.csproj | 125 - .../OpenGridServices.InventoryServer.csproj.user | 12 - .../OpenGridServices.InventoryServer.exe.build | 50 - .../OpenGridServices.Manager.mds | 16 - .../OpenGridServices.Manager.userprefs | 39 - .../OpenGridServices.Manager.usertasks | 2 - .../OpenGridServices.Manager/AssemblyInfo.cs | 32 - .../OpenGridServices.Manager/BlockingQueue.cs | 33 - .../Connect to grid server.cs | 16 - .../ConnectToGridServerDialog.cs | 29 - .../GridServerConnectionManager.cs | 106 - .../OpenGridServices.Manager/Main.cs | 96 - .../OpenGridServices.Manager/MainWindow.cs | 76 - .../OpenGridServices.Manager.mdp | 43 - .../OpenGridServices.Manager.pidb | Bin 12308 -> 0 bytes .../OpenGridServices.Manager/RegionBlock.cs | 37 - .../OpenGridServices.Manager/Util.cs | 133 - ...idServices.Manager.ConnectToGridServerDialog.cs | 226 - .../gtk-gui/OpenGridServices.Manager.MainWindow.cs | 256 - .../OpenGridServices.Manager/gtk-gui/generated.cs | 35 - .../OpenGridServices.Manager/gtk-gui/gui.stetic | 502 -- .../OpenGridServices.UserServer/Main.cs | 216 - .../OGS-UserServer.csproj | 63 - .../OpenGridServices.UserServer.csproj | 128 - .../OpenGridServices.UserServer.exe.build | 51 - .../Properties/AssemblyInfo.cs | 33 - .../OpenGridServices.UserServer/UserManager.cs | 660 -- .../OpenUser.Config/UserConfigDb4o/AssemblyInfo.cs | 58 - .../OpenUser.Config/UserConfigDb4o/DbUserConfig.cs | 96 - .../OpenUser.Config.UserConfigDb4o.csproj | 107 - .../OpenUser.Config.UserConfigDb4o.dll.build | 46 - OpenGridServices/ServiceManager/ServiceManager.cs | 259 - .../ServiceManager/ServiceManager.csproj | 107 - .../ServiceManager/ServiceManager.exe.build | 44 - OpenSim.FxCop | 7241 -------------------- OpenSim.build | 118 - OpenSim.sln | 121 - .../OpenSim.GridInterfaces/Local/AssemblyInfo.cs | 58 - .../Local/LocalAssetServer.cs | 298 - .../Local/LocalGridServer.cs | 158 - .../Local/OpenSim.GridInterfaces.Local.csproj | 110 - .../Local/OpenSim.GridInterfaces.Local.dll.build | 46 - .../OpenSim.GridInterfaces/Remote/AssemblyInfo.cs | 58 - .../Remote/OpenSim.GridInterfaces.Remote.csproj | 112 - .../Remote/OpenSim.GridInterfaces.Remote.dll.build | 46 - .../Remote/RemoteAssetServer.cs | 135 - .../Remote/RemoteGridServer.cs | 212 - .../BasicPhysicsPlugin/AssemblyInfo.cs | 58 - .../BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 278 - .../OpenSim.Physics.BasicPhysicsPlugin.csproj | 93 - .../OpenSim.Physics.BasicPhysicsPlugin.dll.build | 42 - OpenSim/OpenSim.Physics/Manager/AssemblyInfo.cs | 58 - .../Manager/OpenSim.Physics.Manager.csproj | 112 - .../Manager/OpenSim.Physics.Manager.dll.build | 47 - OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs | 162 - OpenSim/OpenSim.Physics/Manager/PhysicsManager.cs | 117 - OpenSim/OpenSim.Physics/Manager/PhysicsScene.cs | 114 - OpenSim/OpenSim.Physics/Manager/PhysicsVector.cs | 55 - OpenSim/OpenSim.Physics/OdePlugin/AssemblyInfo.cs | 58 - OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs | 457 -- .../OdePlugin/OpenSim.Physics.OdePlugin.csproj | 97 - .../OdePlugin/OpenSim.Physics.OdePlugin.dll.build | 43 - .../OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs | 58 - .../PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj | 97 - .../OpenSim.Physics.PhysXPlugin.dll.build | 43 - OpenSim/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs | 424 -- OpenSim/OpenSim.RegionServer/AgentAssetUpload.cs | 259 - OpenSim/OpenSim.RegionServer/Assets/AssetCache.cs | 572 -- .../OpenSim.RegionServer/Assets/InventoryCache.cs | 338 - .../AuthenticateSessionsBase.cs | 131 - .../AuthenticateSessionsLocal.cs | 58 - .../AuthenticateSessionsRemote.cs | 72 - OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs | 281 - .../OpenSim.RegionServer/Client/ClientView.Grid.cs | 192 - .../Client/ClientView.PacketHandlers.cs | 196 - .../Client/ClientView.ProcessPackets.cs | 523 -- OpenSim/OpenSim.RegionServer/Client/ClientView.cs | 461 -- .../OpenSim.RegionServer/Client/ClientViewBase.cs | 326 - .../OpenSim.RegionServer/Estate/EstateManager.cs | 293 - OpenSim/OpenSim.RegionServer/Grid.cs | 117 - .../OpenSim.RegionServer.csproj | 264 - .../OpenSim.RegionServer.dll.build | 92 - OpenSim/OpenSim.RegionServer/OpenSimMain.cs | 531 -- .../OpenSim.RegionServer/OpenSimNetworkHandler.cs | 45 - OpenSim/OpenSim.RegionServer/PacketServer.cs | 116 - OpenSim/OpenSim.RegionServer/RegionInfo.cs | 380 - OpenSim/OpenSim.RegionServer/RegionInfoBase.cs | 62 - OpenSim/OpenSim.RegionServer/RegionServerBase.cs | 130 - .../Scripting/IScriptContext.cs | 40 - .../Scripting/IScriptEntity.cs | 46 - .../Scripting/IScriptHandler.cs | 125 - OpenSim/OpenSim.RegionServer/Scripting/Script.cs | 53 - .../Scripting/ScriptFactory.cs | 35 - .../Scripting/Scripts/FollowRandomAvatar.cs | 64 - .../Simulator/Avatar.Client.cs | 60 - .../Simulator/Avatar.Update.cs | 371 - OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs | 435 -- .../Simulator/AvatarAnimations.cs | 73 - OpenSim/OpenSim.RegionServer/Simulator/Entity.cs | 151 - .../Simulator/ParcelManager.cs | 837 --- .../OpenSim.RegionServer/Simulator/Primitive.cs | 598 -- .../OpenSim.RegionServer/Simulator/Primitive2.cs | 519 -- .../OpenSim.RegionServer/Simulator/SceneObject.cs | 102 - .../Simulator/World.PacketHandlers.cs | 449 -- .../Simulator/World.Scripting.cs | 151 - OpenSim/OpenSim.RegionServer/Simulator/World.cs | 737 -- .../OpenSim.RegionServer/Simulator/WorldBase.cs | 205 - OpenSim/OpenSim.RegionServer/Types/Mesh.cs | 55 - OpenSim/OpenSim.RegionServer/Types/Triangle.cs | 55 - OpenSim/OpenSim.RegionServer/UDPServer.cs | 265 - OpenSim/OpenSim.RegionServer/VersionInfo.cs | 39 - .../OpenSim.Scripting/EmbeddedJVM/ClassInstance.cs | 45 - .../OpenSim.Scripting/EmbeddedJVM/ClassRecord.cs | 503 -- OpenSim/OpenSim.Scripting/EmbeddedJVM/Heap.cs | 43 - .../OpenSim.Scripting/EmbeddedJVM/Interpreter.cs | 135 - .../EmbeddedJVM/InterpreterLogic.cs | 427 -- .../EmbeddedJVM/InterpreterMethods.cs | 161 - .../EmbeddedJVM/InterpreterReturn.cs | 40 - .../OpenSim.Scripting/EmbeddedJVM/MainMemory.cs | 45 - .../OpenSim.Scripting/EmbeddedJVM/MethodMemory.cs | 46 - OpenSim/OpenSim.Scripting/EmbeddedJVM/Object.cs | 37 - .../OpenSim.Scripting.EmbeddedJVM.csproj | 153 - .../OpenSim.Scripting.EmbeddedJVM.dll.build | 62 - .../OpenSim.Scripting/EmbeddedJVM/OpenSimJVM.cs | 161 - .../EmbeddedJVM/Properties/AssemblyInfo.cs | 33 - OpenSim/OpenSim.Scripting/EmbeddedJVM/Stack.cs | 42 - .../OpenSim.Scripting/EmbeddedJVM/StackFrame.cs | 49 - OpenSim/OpenSim.Scripting/EmbeddedJVM/Thread.cs | 115 - .../EmbeddedJVM/Types/ArrayReference.cs | 10 - .../EmbeddedJVM/Types/BaseType.cs | 10 - .../EmbeddedJVM/Types/ObjectReference.cs | 16 - .../EmbeddedJVM/Types/PrimitiveTypes/Byte.cs | 10 - .../EmbeddedJVM/Types/PrimitiveTypes/Char.cs | 10 - .../EmbeddedJVM/Types/PrimitiveTypes/Float.cs | 16 - .../EmbeddedJVM/Types/PrimitiveTypes/Int.cs | 16 - .../LocalStorageBerkeleyDB/BDBLocalStorage.cs | 118 - .../OpenSim.Storage.LocalStorageBerkeleyDB.csproj | 112 - ...penSim.Storage.LocalStorageBerkeleyDB.dll.build | 46 - .../LocalStorageDb4o/AssemblyInfo.cs | 58 - .../LocalStorageDb4o/Db4LocalStorage.cs | 271 - .../OpenSim.Storage/LocalStorageDb4o/MapStorage.cs | 43 - .../OpenSim.Storage.LocalStorageDb4o.csproj | 116 - .../OpenSim.Storage.LocalStorageDb4o.dll.build | 48 - .../LocalStorageDb4o/UUIDParcelQuery.cs | 52 - .../LocalStorageDb4o/UUIDPrimQuery.cs | 52 - .../OpenSim.Storage.LocalStorageSQLite.csproj | 111 - .../OpenSim.Storage.LocalStorageSQLite.dll.build | 46 - .../LocalStorageSQLite/Properties/AssemblyInfo.cs | 35 - .../LocalStorageSQLite/SQLiteLocalStorage.cs | 199 - .../OpenSim.Terrain.BasicTerrain.csproj | 99 - .../OpenSim.Terrain.BasicTerrain.dll.build | 44 - .../Properties/AssemblyInfo.cs | 35 - .../OpenSim.Terrain.BasicTerrain/TerrainEngine.cs | 533 -- OpenSim/OpenSim/Application.cs | 137 - OpenSim/OpenSim/OpenSim.csproj | 147 - OpenSim/OpenSim/OpenSim.exe.build | 52 - OpenSim/OpenSim/OpenSimMain.cs | 552 -- Prebuild/Prebuild.build | 67 - Prebuild/Prebuild.sln | 19 - Prebuild/README | 230 - Prebuild/TODO | 21 - Prebuild/doc/prebuild-example1.xml | 300 - Prebuild/doc/prebuild-example2.xml | 72 - Prebuild/doc/prebuild-example3.xml | 113 - Prebuild/doc/prebuild-example4.xml | 715 -- Prebuild/doc/prebuild-example5.xml | 187 - Prebuild/prebuild | 2 - Prebuild/scripts/Clean.bat | 2 - Prebuild/scripts/Help.bat | 2 - Prebuild/scripts/MonoDevelop.sh | 2 - Prebuild/scripts/Prebuild.nsi | 231 - Prebuild/scripts/SharpDevelop.bat | 4 - Prebuild/scripts/SharpDevelop2.bat | 4 - Prebuild/scripts/VS2002.bat | 4 - Prebuild/scripts/VS2003.bat | 4 - Prebuild/scripts/VS2005.bat | 4 - Prebuild/scripts/autotools.bat | 4 - Prebuild/scripts/autotools.sh | 2 - Prebuild/scripts/nant.bat | 4 - Prebuild/scripts/nant.sh | 2 - Prebuild/src/App.ico | Bin 4286 -> 0 bytes Prebuild/src/Core/Attributes/DataNodeAttribute.cs | 81 - .../src/Core/Attributes/OptionNodeAttribute.cs | 80 - Prebuild/src/Core/Attributes/TargetAttribute.cs | 80 - Prebuild/src/Core/FatalException.cs | 94 - Prebuild/src/Core/Interfaces/IDataNode.cs | 56 - Prebuild/src/Core/Interfaces/ITarget.cs | 60 - Prebuild/src/Core/Kernel.cs | 758 -- Prebuild/src/Core/Nodes/ConfigurationNode.cs | 187 - Prebuild/src/Core/Nodes/DataNode.cs | 82 - Prebuild/src/Core/Nodes/ExcludeNode.cs | 85 - Prebuild/src/Core/Nodes/FileNode.cs | 238 - Prebuild/src/Core/Nodes/FilesNode.cs | 223 - Prebuild/src/Core/Nodes/MatchNode.cs | 299 - Prebuild/src/Core/Nodes/OptionsNode.cs | 655 -- Prebuild/src/Core/Nodes/ProcessNode.cs | 119 - Prebuild/src/Core/Nodes/ProjectNode.cs | 510 -- Prebuild/src/Core/Nodes/ReferenceNode.cs | 153 - Prebuild/src/Core/Nodes/ReferencePathNode.cs | 108 - Prebuild/src/Core/Nodes/SolutionNode.cs | 288 - Prebuild/src/Core/Parse/IfContext.cs | 163 - Prebuild/src/Core/Parse/Preprocessor.cs | 519 -- Prebuild/src/Core/Targets/AutotoolsTarget.cs | 926 --- Prebuild/src/Core/Targets/DebugTarget.cs | 102 - Prebuild/src/Core/Targets/MonoDevelopTarget.cs | 458 -- Prebuild/src/Core/Targets/NAntTarget.cs | 621 -- Prebuild/src/Core/Targets/SharpDevelop2Target.cs | 90 - Prebuild/src/Core/Targets/SharpDevelopTarget.cs | 437 -- Prebuild/src/Core/Targets/VS2002Target.cs | 96 - Prebuild/src/Core/Targets/VS2003Target.cs | 633 -- Prebuild/src/Core/Targets/VS2005Target.cs | 883 --- Prebuild/src/Core/UnknownLanguageException.cs | 63 - .../src/Core/Utilities/CommandLineCollection.cs | 162 - Prebuild/src/Core/Utilities/CurrentDirectory.cs | 89 - Prebuild/src/Core/Utilities/Helper.cs | 661 -- Prebuild/src/Core/Utilities/Log.cs | 279 - Prebuild/src/Core/WarningException.cs | 93 - Prebuild/src/Prebuild.cs | 165 - Prebuild/src/Prebuild.csproj | 205 - Prebuild/src/Prebuild.exe.build | 80 - Prebuild/src/Prebuild.snk | Bin 596 -> 0 bytes Prebuild/src/Properties/AssemblyInfo.cs | 101 - Prebuild/src/data/dnpb-1.0.xsd | 183 - Prebuild/src/data/dnpb-1.1.xsd | 184 - Prebuild/src/data/dnpb-1.2.xsd | 198 - Prebuild/src/data/dnpb-1.3.xsd | 206 - Prebuild/src/data/dnpb-1.4.xsd | 212 - Prebuild/src/data/dnpb-1.5.xsd | 215 - Prebuild/src/data/prebuild-1.6.xsd | 231 - Prebuild/src/data/prebuild-1.7.xsd | 261 - bin/Axiom.MathLib.dll | Bin 69632 -> 0 bytes bin/Db4objects.Db4o.dll | Bin 593408 -> 0 bytes bin/Kds.Serialization.dll | Bin 40960 -> 0 bytes bin/MySql.Data.dll | Bin 143360 -> 0 bytes bin/Ode.NET.dll | Bin 57344 -> 0 bytes bin/OpenSimAPI.java | 36 - bin/PhysX-wrapper.dll | Bin 57344 -> 0 bytes bin/PhysX_Wrapper_Dotnet.dll | Bin 8704 -> 0 bytes bin/Prebuild.exe | Bin 176128 -> 0 bytes bin/System.Data.SQLite.dll | Bin 568832 -> 0 bytes bin/TerrainDatafiles/Alien/HOWTO.txt | 19 - bin/TerrainDatafiles/Alien/alienworld.bmp | Bin 1048630 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_0_0.bmp | Bin 262198 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_0_0.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_0_1.bmp | Bin 262198 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_0_1.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_0_2.bmp | Bin 262198 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_0_2.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_1_0.bmp | Bin 262198 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_1_0.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_1_1.bmp | Bin 262198 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_1_1.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_1_2.bmp | Bin 262198 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_1_2.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_2_0.bmp | Bin 262198 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_2_0.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_2_1.bmp | Bin 262198 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_2_1.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_2_2.bmp | Bin 262198 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_2_2.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Alien/alienworld_gray.bmp | Bin 786486 -> 0 bytes bin/TerrainDatafiles/Coastal/HOWTO.txt | 9 - bin/TerrainDatafiles/Coastal/output.bmp | Bin 786486 -> 0 bytes bin/TerrainDatafiles/Coastal/output_x0_y0.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Coastal/output_x0_y1.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Coastal/output_x1_y0.r32 | Bin 262144 -> 0 bytes bin/TerrainDatafiles/Coastal/output_x1_y1.r32 | Bin 262144 -> 0 bytes bin/assets/base_shape.dat | 105 - bin/assets/bricks.jp2 | Bin 32865 -> 0 bytes bin/assets/granite.jp2 | Bin 32897 -> 0 bytes bin/assets/hardwood.jp2 | Bin 32876 -> 0 bytes bin/assets/map1.jp2 | Bin 570 -> 0 bytes bin/assets/map_base.jp2 | Bin 153 -> 0 bytes bin/assets/plywood.jp2 | Bin 32794 -> 0 bytes bin/assets/rocks.jp2 | Bin 32731 -> 0 bytes bin/assets/testpic2.jp2 | Bin 291 -> 0 bytes bin/avatar-texture.dat | Bin 268 -> 0 bytes bin/data/LICENSE-README-IMPORTANT.txt | 5 - bin/data/avataranimations.xml | 10 - bin/defaultstripe.png | Bin 887 -> 0 bytes bin/libTerrain-BSD.dll | Bin 32768 -> 0 bytes bin/libdb_dotNET43.dll | Bin 221184 -> 0 bytes bin/libode.a | Bin 8041800 -> 0 bytes bin/libode.so | Bin 4474949 -> 0 bytes bin/libsecondlife.dll | Bin 2150400 -> 0 bytes bin/log4net.dll | Bin 270336 -> 0 bytes bin/login.htm | 5 - bin/mysql_connection.ini | 7 - bin/newaccountform.htm | 9 - bin/ode.dll | Bin 409600 -> 0 bytes bin/openjpegnet.dll | Bin 17408 -> 0 bytes bin/script1.txt | 34 - bin/testadmin.htm | 125 - libraries/libLSL/Properties/AssemblyInfo.cs | 35 - libraries/libLSL/libLSL.csproj | 49 - libraries/libLSL/lsl.cs | 329 - libraries/libLSL/lslByteCode.cs | 133 - libraries/libLSL/lslscript.cs | 10 - prebuild.xml | 916 --- releng/CAUTION | 4 - releng/README | 3 - releng/createreldir.sh | 9 - releng/dist/INSTALL | 33 - releng/dist/README | 70 - releng/dist/SQL/mysql-agents.sql | 24 - releng/dist/SQL/mysql-inventoryfolders.sql | 9 - releng/dist/SQL/mysql-inventoryitems.sql | 14 - releng/dist/SQL/mysql-logs.sql | 10 - releng/dist/SQL/mysql-regions.sql | 29 - releng/dist/SQL/mysql-users.sql | 34 - releng/dist/bin/OpenSim | 3 - releng/dobuild.sh | 22 - releng/makerel.sh | 30 - releng/parsetmpl.sh | 5 - releng/templates/VersionInfo.cs.tmpl | 37 - runprebuild.bat | 2 - share/php/generateUserFunction.php | 46 - share/sql/mysql-agents.sql | 24 - share/sql/mysql-inventoryfolders.sql | 9 - share/sql/mysql-inventoryitems.sql | 14 - share/sql/mysql-logs.sql | 10 - share/sql/mysql-regions.sql | 29 - share/sql/mysql-users.sql | 34 - 462 files changed, 64414 deletions(-) delete mode 100644 CONTRIBUTORS.txt 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 delete mode 100644 OpenGridServices.build delete mode 100644 OpenGridServices.sln delete mode 100644 OpenGridServices/OpenGrid.Config/GridConfigDb4o/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs delete mode 100644 OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj delete mode 100644 OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oManager.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLGridData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MSSQL/Properties/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLLogData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.MySQL/Properties/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.csproj delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.SQLite/Properties/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteGridData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteManager.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data/GridData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data/ILogData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj delete mode 100644 OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build delete mode 100644 OpenGridServices/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data/UserData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Manager/GridManagementAgent.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs delete mode 100644 OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj delete mode 100644 OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build delete mode 100644 OpenGridServices/OpenGridServices.AssetServer/AssetHttpServer.cs delete mode 100644 OpenGridServices/OpenGridServices.AssetServer/Main.cs delete mode 100644 OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj delete mode 100644 OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build delete mode 100644 OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj delete mode 100644 OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build delete mode 100644 OpenGridServices/OpenGridServices.AssetServer/Properties/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenGridServices.GridServer/GridManager.cs delete mode 100644 OpenGridServices/OpenGridServices.GridServer/Main.cs delete mode 100644 OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj delete mode 100644 OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build delete mode 100644 OpenGridServices/OpenGridServices.GridServer/Properties/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenGridServices.InventoryServer/InventoryManager.cs delete mode 100644 OpenGridServices/OpenGridServices.InventoryServer/Main.cs delete mode 100644 OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj delete mode 100644 OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj.user delete mode 100644 OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.exe.build delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.mds delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.userprefs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.usertasks delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/BlockingQueue.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Connect to grid server.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.pidb delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/RegionBlock.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/generated.cs delete mode 100644 OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic delete mode 100644 OpenGridServices/OpenGridServices.UserServer/Main.cs delete mode 100644 OpenGridServices/OpenGridServices.UserServer/OGS-UserServer.csproj delete mode 100644 OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj delete mode 100644 OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build delete mode 100644 OpenGridServices/OpenGridServices.UserServer/Properties/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenGridServices.UserServer/UserManager.cs delete mode 100644 OpenGridServices/OpenUser.Config/UserConfigDb4o/AssemblyInfo.cs delete mode 100644 OpenGridServices/OpenUser.Config/UserConfigDb4o/DbUserConfig.cs delete mode 100644 OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj delete mode 100644 OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build delete mode 100644 OpenGridServices/ServiceManager/ServiceManager.cs delete mode 100644 OpenGridServices/ServiceManager/ServiceManager.csproj delete mode 100644 OpenGridServices/ServiceManager/ServiceManager.exe.build delete mode 100644 OpenSim.FxCop delete mode 100644 OpenSim.build delete mode 100644 OpenSim.sln delete mode 100644 OpenSim/OpenSim.GridInterfaces/Local/AssemblyInfo.cs delete mode 100644 OpenSim/OpenSim.GridInterfaces/Local/LocalAssetServer.cs delete mode 100644 OpenSim/OpenSim.GridInterfaces/Local/LocalGridServer.cs delete mode 100644 OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj delete mode 100644 OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build delete mode 100644 OpenSim/OpenSim.GridInterfaces/Remote/AssemblyInfo.cs delete mode 100644 OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj delete mode 100644 OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build delete mode 100644 OpenSim/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs delete mode 100644 OpenSim/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs delete mode 100644 OpenSim/OpenSim.Physics/BasicPhysicsPlugin/AssemblyInfo.cs delete mode 100644 OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs delete mode 100644 OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj delete mode 100644 OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build delete mode 100644 OpenSim/OpenSim.Physics/Manager/AssemblyInfo.cs delete mode 100644 OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj delete mode 100644 OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build delete mode 100644 OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs delete mode 100644 OpenSim/OpenSim.Physics/Manager/PhysicsManager.cs delete mode 100644 OpenSim/OpenSim.Physics/Manager/PhysicsScene.cs delete mode 100644 OpenSim/OpenSim.Physics/Manager/PhysicsVector.cs delete mode 100644 OpenSim/OpenSim.Physics/OdePlugin/AssemblyInfo.cs delete mode 100644 OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs delete mode 100644 OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj delete mode 100644 OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build delete mode 100644 OpenSim/OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs delete mode 100644 OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj delete mode 100644 OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build delete mode 100644 OpenSim/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs delete mode 100644 OpenSim/OpenSim.RegionServer/AgentAssetUpload.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Assets/AssetCache.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Assets/InventoryCache.cs delete mode 100644 OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs delete mode 100644 OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs delete mode 100644 OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs delete mode 100644 OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Client/ClientView.Grid.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Client/ClientView.PacketHandlers.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Client/ClientView.ProcessPackets.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Client/ClientView.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Client/ClientViewBase.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Grid.cs delete mode 100644 OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj delete mode 100644 OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build delete mode 100644 OpenSim/OpenSim.RegionServer/OpenSimMain.cs delete mode 100644 OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs delete mode 100644 OpenSim/OpenSim.RegionServer/PacketServer.cs delete mode 100644 OpenSim/OpenSim.RegionServer/RegionInfo.cs delete mode 100644 OpenSim/OpenSim.RegionServer/RegionInfoBase.cs delete mode 100644 OpenSim/OpenSim.RegionServer/RegionServerBase.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Scripting/IScriptContext.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Scripting/IScriptEntity.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Scripting/IScriptHandler.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Scripting/Script.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Scripting/ScriptFactory.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Scripting/Scripts/FollowRandomAvatar.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/Avatar.Client.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/AvatarAnimations.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/Entity.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/Primitive.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/Primitive2.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/SceneObject.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/World.PacketHandlers.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/World.Scripting.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/World.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Simulator/WorldBase.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Types/Mesh.cs delete mode 100644 OpenSim/OpenSim.RegionServer/Types/Triangle.cs delete mode 100644 OpenSim/OpenSim.RegionServer/UDPServer.cs delete mode 100644 OpenSim/OpenSim.RegionServer/VersionInfo.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassInstance.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassRecord.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Heap.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Interpreter.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterLogic.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterMethods.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterReturn.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/MainMemory.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/MethodMemory.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Object.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSimJVM.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Properties/AssemblyInfo.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Stack.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/StackFrame.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Thread.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ArrayReference.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/BaseType.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ObjectReference.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Byte.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Char.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Float.cs delete mode 100644 OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Int.cs delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageDb4o/AssemblyInfo.cs delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.cs delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.cs delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs delete mode 100644 OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs delete mode 100644 OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.csproj delete mode 100644 OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build delete mode 100644 OpenSim/OpenSim.Terrain.BasicTerrain/Properties/AssemblyInfo.cs delete mode 100644 OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs delete mode 100644 OpenSim/OpenSim/Application.cs delete mode 100644 OpenSim/OpenSim/OpenSim.csproj delete mode 100644 OpenSim/OpenSim/OpenSim.exe.build delete mode 100644 OpenSim/OpenSim/OpenSimMain.cs delete mode 100644 Prebuild/Prebuild.build delete mode 100644 Prebuild/Prebuild.sln delete mode 100644 Prebuild/README delete mode 100644 Prebuild/TODO delete mode 100644 Prebuild/doc/prebuild-example1.xml delete mode 100644 Prebuild/doc/prebuild-example2.xml delete mode 100644 Prebuild/doc/prebuild-example3.xml delete mode 100644 Prebuild/doc/prebuild-example4.xml delete mode 100644 Prebuild/doc/prebuild-example5.xml delete mode 100644 Prebuild/prebuild delete mode 100644 Prebuild/scripts/Clean.bat delete mode 100644 Prebuild/scripts/Help.bat delete mode 100644 Prebuild/scripts/MonoDevelop.sh delete mode 100644 Prebuild/scripts/Prebuild.nsi delete mode 100644 Prebuild/scripts/SharpDevelop.bat delete mode 100644 Prebuild/scripts/SharpDevelop2.bat delete mode 100644 Prebuild/scripts/VS2002.bat delete mode 100644 Prebuild/scripts/VS2003.bat delete mode 100644 Prebuild/scripts/VS2005.bat delete mode 100644 Prebuild/scripts/autotools.bat delete mode 100644 Prebuild/scripts/autotools.sh delete mode 100644 Prebuild/scripts/nant.bat delete mode 100644 Prebuild/scripts/nant.sh delete mode 100644 Prebuild/src/App.ico delete mode 100644 Prebuild/src/Core/Attributes/DataNodeAttribute.cs delete mode 100644 Prebuild/src/Core/Attributes/OptionNodeAttribute.cs delete mode 100644 Prebuild/src/Core/Attributes/TargetAttribute.cs delete mode 100644 Prebuild/src/Core/FatalException.cs delete mode 100644 Prebuild/src/Core/Interfaces/IDataNode.cs delete mode 100644 Prebuild/src/Core/Interfaces/ITarget.cs delete mode 100644 Prebuild/src/Core/Kernel.cs delete mode 100644 Prebuild/src/Core/Nodes/ConfigurationNode.cs delete mode 100644 Prebuild/src/Core/Nodes/DataNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ExcludeNode.cs delete mode 100644 Prebuild/src/Core/Nodes/FileNode.cs delete mode 100644 Prebuild/src/Core/Nodes/FilesNode.cs delete mode 100644 Prebuild/src/Core/Nodes/MatchNode.cs delete mode 100644 Prebuild/src/Core/Nodes/OptionsNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ProcessNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ProjectNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ReferenceNode.cs delete mode 100644 Prebuild/src/Core/Nodes/ReferencePathNode.cs delete mode 100644 Prebuild/src/Core/Nodes/SolutionNode.cs delete mode 100644 Prebuild/src/Core/Parse/IfContext.cs delete mode 100644 Prebuild/src/Core/Parse/Preprocessor.cs delete mode 100644 Prebuild/src/Core/Targets/AutotoolsTarget.cs delete mode 100644 Prebuild/src/Core/Targets/DebugTarget.cs delete mode 100644 Prebuild/src/Core/Targets/MonoDevelopTarget.cs delete mode 100644 Prebuild/src/Core/Targets/NAntTarget.cs delete mode 100644 Prebuild/src/Core/Targets/SharpDevelop2Target.cs delete mode 100644 Prebuild/src/Core/Targets/SharpDevelopTarget.cs delete mode 100644 Prebuild/src/Core/Targets/VS2002Target.cs delete mode 100644 Prebuild/src/Core/Targets/VS2003Target.cs delete mode 100644 Prebuild/src/Core/Targets/VS2005Target.cs delete mode 100644 Prebuild/src/Core/UnknownLanguageException.cs delete mode 100644 Prebuild/src/Core/Utilities/CommandLineCollection.cs delete mode 100644 Prebuild/src/Core/Utilities/CurrentDirectory.cs delete mode 100644 Prebuild/src/Core/Utilities/Helper.cs delete mode 100644 Prebuild/src/Core/Utilities/Log.cs delete mode 100644 Prebuild/src/Core/WarningException.cs delete mode 100644 Prebuild/src/Prebuild.cs delete mode 100644 Prebuild/src/Prebuild.csproj delete mode 100644 Prebuild/src/Prebuild.exe.build delete mode 100644 Prebuild/src/Prebuild.snk delete mode 100644 Prebuild/src/Properties/AssemblyInfo.cs delete mode 100644 Prebuild/src/data/dnpb-1.0.xsd delete mode 100644 Prebuild/src/data/dnpb-1.1.xsd delete mode 100644 Prebuild/src/data/dnpb-1.2.xsd delete mode 100644 Prebuild/src/data/dnpb-1.3.xsd delete mode 100644 Prebuild/src/data/dnpb-1.4.xsd delete mode 100644 Prebuild/src/data/dnpb-1.5.xsd delete mode 100644 Prebuild/src/data/prebuild-1.6.xsd delete mode 100644 Prebuild/src/data/prebuild-1.7.xsd delete mode 100644 bin/Axiom.MathLib.dll delete mode 100644 bin/Db4objects.Db4o.dll delete mode 100644 bin/Kds.Serialization.dll delete mode 100644 bin/MySql.Data.dll delete mode 100644 bin/Ode.NET.dll delete mode 100644 bin/OpenSimAPI.java delete mode 100644 bin/PhysX-wrapper.dll delete mode 100644 bin/PhysX_Wrapper_Dotnet.dll delete mode 100644 bin/Prebuild.exe delete mode 100644 bin/System.Data.SQLite.dll delete mode 100644 bin/TerrainDatafiles/Alien/HOWTO.txt delete mode 100644 bin/TerrainDatafiles/Alien/alienworld.bmp delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_0_0.bmp delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_0_0.r32 delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_0_1.bmp delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_0_1.r32 delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_0_2.bmp delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_0_2.r32 delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_1_0.bmp delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_1_0.r32 delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_1_1.bmp delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_1_1.r32 delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_1_2.bmp delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_1_2.r32 delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_2_0.bmp delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_2_0.r32 delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_2_1.bmp delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_2_1.r32 delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_2_2.bmp delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_2_2.r32 delete mode 100644 bin/TerrainDatafiles/Alien/alienworld_gray.bmp delete mode 100644 bin/TerrainDatafiles/Coastal/HOWTO.txt delete mode 100644 bin/TerrainDatafiles/Coastal/output.bmp delete mode 100644 bin/TerrainDatafiles/Coastal/output_x0_y0.r32 delete mode 100644 bin/TerrainDatafiles/Coastal/output_x0_y1.r32 delete mode 100644 bin/TerrainDatafiles/Coastal/output_x1_y0.r32 delete mode 100644 bin/TerrainDatafiles/Coastal/output_x1_y1.r32 delete mode 100644 bin/assets/base_shape.dat delete mode 100644 bin/assets/bricks.jp2 delete mode 100644 bin/assets/granite.jp2 delete mode 100644 bin/assets/hardwood.jp2 delete mode 100644 bin/assets/map1.jp2 delete mode 100644 bin/assets/map_base.jp2 delete mode 100644 bin/assets/plywood.jp2 delete mode 100644 bin/assets/rocks.jp2 delete mode 100644 bin/assets/testpic2.jp2 delete mode 100644 bin/avatar-texture.dat delete mode 100644 bin/data/LICENSE-README-IMPORTANT.txt delete mode 100644 bin/data/avataranimations.xml delete mode 100644 bin/defaultstripe.png delete mode 100644 bin/libTerrain-BSD.dll delete mode 100644 bin/libdb_dotNET43.dll delete mode 100644 bin/libode.a delete mode 100755 bin/libode.so delete mode 100644 bin/libsecondlife.dll delete mode 100644 bin/log4net.dll delete mode 100644 bin/login.htm delete mode 100644 bin/mysql_connection.ini delete mode 100644 bin/newaccountform.htm delete mode 100644 bin/ode.dll delete mode 100755 bin/openjpegnet.dll delete mode 100644 bin/script1.txt delete mode 100644 bin/testadmin.htm delete mode 100644 libraries/libLSL/Properties/AssemblyInfo.cs delete mode 100644 libraries/libLSL/libLSL.csproj delete mode 100644 libraries/libLSL/lsl.cs delete mode 100644 libraries/libLSL/lslByteCode.cs delete mode 100644 libraries/libLSL/lslscript.cs delete mode 100644 prebuild.xml delete mode 100644 releng/CAUTION delete mode 100644 releng/README delete mode 100755 releng/createreldir.sh delete mode 100644 releng/dist/INSTALL delete mode 100644 releng/dist/README delete mode 100644 releng/dist/SQL/mysql-agents.sql delete mode 100644 releng/dist/SQL/mysql-inventoryfolders.sql delete mode 100644 releng/dist/SQL/mysql-inventoryitems.sql delete mode 100644 releng/dist/SQL/mysql-logs.sql delete mode 100644 releng/dist/SQL/mysql-regions.sql delete mode 100644 releng/dist/SQL/mysql-users.sql delete mode 100755 releng/dist/bin/OpenSim delete mode 100755 releng/dobuild.sh delete mode 100755 releng/makerel.sh delete mode 100755 releng/parsetmpl.sh delete mode 100644 releng/templates/VersionInfo.cs.tmpl delete mode 100644 runprebuild.bat delete mode 100644 share/php/generateUserFunction.php delete mode 100644 share/sql/mysql-agents.sql delete mode 100644 share/sql/mysql-inventoryfolders.sql delete mode 100644 share/sql/mysql-inventoryitems.sql delete mode 100644 share/sql/mysql-logs.sql delete mode 100644 share/sql/mysql-regions.sql delete mode 100644 share/sql/mysql-users.sql diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt deleted file mode 100644 index 86fa8f3..0000000 --- a/CONTRIBUTORS.txt +++ /dev/null @@ -1,30 +0,0 @@ - -The following people have contributed to OpenSim (Thankyou for your effort!) -Add your name in here if you have committed to OpenSim - -OpenSim Developers -(in order of appearance) - -* MW -* Gareth -* AdamZaius -* MingChen -* lbsa71 -* Andy- -* MorphW -* CW - -This software uses components from the following developers: -* Sleepycat Software (Berkeley DB) -* DB4objects, Inc. (DB4o) -* SQLite (Public Domain) -* XmlRpcCS (http://xmlrpccs.sf.net/) -* MySQL, Inc. (MySQL Connector/NET) -* AGEIA Inc. (PhysX) -* Russel L. Smith (ODE) -* Prebuild ( http://sourceforge.net/projects/dnpb/ ) - -In addition, we would like to thank: -* The Mono Project -* The NANT Developers -* Microsoft (.NET, MSSQL-Adapters) \ No newline at end of file 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"; - } -} - - diff --git a/OpenGridServices.build b/OpenGridServices.build deleted file mode 100644 index 76874bd..0000000 --- a/OpenGridServices.build +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices.sln b/OpenGridServices.sln deleted file mode 100644 index 73e53c0..0000000 --- a/OpenGridServices.sln +++ /dev/null @@ -1,91 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Config.GridConfigDb4o", "OpenGridServices\OpenGrid.Config\GridConfigDb4o\OpenGrid.Config.GridConfigDb4o.csproj", "{B0027747-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Data", "OpenGridServices\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj", "{62CDF671-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Data.DB4o", "OpenGridServices\OpenGrid.Framework.Data.DB4o\OpenGrid.Framework.Data.DB4o.csproj", "{39BD9497-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Data.MSSQL", "OpenGridServices\OpenGrid.Framework.Data.MSSQL\OpenGrid.Framework.Data.MSSQL.csproj", "{0A563AC1-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Data.MySQL", "OpenGridServices\OpenGrid.Framework.Data.MySQL\OpenGrid.Framework.Data.MySQL.csproj", "{0F3C3AC1-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Data.SQLite", "OpenGridServices\OpenGrid.Framework.Data.SQLite\OpenGrid.Framework.Data.SQLite.csproj", "{1E3F341A-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Manager", "OpenGridServices\OpenGrid.Framework.Manager\OpenGrid.Framework.Manager.csproj", "{7924FD35-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGridServices.AssetServer", "OpenGridServices\OpenGridServices.AssetServer\OpenGridServices.AssetServer.csproj", "{0021261B-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGridServices.GridServer", "OpenGridServices\OpenGridServices.GridServer\OpenGridServices.GridServer.csproj", "{21BFC8E2-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGridServices.InventoryServer", "OpenGridServices\OpenGridServices.InventoryServer\OpenGridServices.InventoryServer.csproj", "{338FA00B-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGridServices.UserServer", "OpenGridServices\OpenGridServices.UserServer\OpenGridServices.UserServer.csproj", "{66591469-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenUser.Config.UserConfigDb4o", "OpenGridServices\OpenUser.Config\UserConfigDb4o\OpenUser.Config.UserConfigDb4o.csproj", "{7E494328-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceManager", "OpenGridServices\ServiceManager\ServiceManager.csproj", "{E141F4EE-0000-0000-0000-000000000000}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B0027747-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B0027747-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0027747-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B0027747-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {62CDF671-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {62CDF671-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {62CDF671-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62CDF671-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {39BD9497-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {39BD9497-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {39BD9497-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {39BD9497-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {0A563AC1-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0A563AC1-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0A563AC1-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0A563AC1-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {0F3C3AC1-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0F3C3AC1-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0F3C3AC1-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0F3C3AC1-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {1E3F341A-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E3F341A-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E3F341A-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E3F341A-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {7924FD35-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7924FD35-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7924FD35-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7924FD35-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {0021261B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0021261B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0021261B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0021261B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {21BFC8E2-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {21BFC8E2-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {21BFC8E2-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {21BFC8E2-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {338FA00B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {338FA00B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {338FA00B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {338FA00B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {66591469-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66591469-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66591469-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66591469-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {7E494328-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7E494328-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7E494328-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7E494328-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {E141F4EE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E141F4EE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E141F4EE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E141F4EE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/AssemblyInfo.cs deleted file mode 100644 index c9701d6..0000000 --- a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/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("GridConfig")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GridConfig")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("1.0.*")] diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs deleted file mode 100644 index e69515a..0000000 --- a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs +++ /dev/null @@ -1,161 +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 OpenSim.Framework.Console; -using OpenSim.Framework.Interfaces; -using Db4objects.Db4o; - -namespace OpenGrid.Config.GridConfigDb4o -{ - /// - /// A grid configuration interface for returning the DB4o Config Provider - /// - public class Db40ConfigPlugin: IGridConfig - { - /// - /// Loads and returns a configuration objeect - /// - /// A grid configuration object - public GridConfig GetConfigObject() - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Loading Db40Config dll"); - return ( new DbGridConfig()); - } - } - - /// - /// A DB4o based Gridserver configuration object - /// - public class DbGridConfig : GridConfig - { - /// - /// The DB4o Database - /// - private IObjectContainer db; - - /// - /// User configuration for the Grid Config interfaces - /// - public void LoadDefaults() { - OpenSim.Framework.Console.MainConsole.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); - - // About the grid options - this.GridOwner = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid owner", "OGS development team"); - - // Asset Options - this.DefaultAssetServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default asset server","http://127.0.0.1:8003/"); - this.AssetSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to asset server","null"); - this.AssetRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from asset server","null"); - - // User Server Options - this.DefaultUserServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default user server","http://127.0.0.1:8002/"); - this.UserSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to user server","null"); - this.UserRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from user server","null"); - - // Region Server Options - this.SimSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to sims","null"); - this.SimRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from sims","null"); - } - - /// - /// Initialises a new configuration object - /// - public override void InitConfig() { - try { - // Perform Db4o initialisation - db = Db4oFactory.OpenFile("opengrid.yap"); - - // Locate the grid configuration object - IObjectSet result = db.Get(typeof(DbGridConfig)); - // Found? - if(result.Count==1) { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Config.cs:InitConfig() - Found a GridConfig object in the local database, loading"); - foreach (DbGridConfig cfg in result) { - // Import each setting into this class - // Grid Settings - this.GridOwner=cfg.GridOwner; - // Asset Settings - this.DefaultAssetServer=cfg.DefaultAssetServer; - this.AssetSendKey=cfg.AssetSendKey; - this.AssetRecvKey=cfg.AssetRecvKey; - // User Settings - this.DefaultUserServer=cfg.DefaultUserServer; - this.UserSendKey=cfg.UserSendKey; - this.UserRecvKey=cfg.UserRecvKey; - // Region Settings - this.SimSendKey=cfg.SimSendKey; - this.SimRecvKey=cfg.SimRecvKey; - } - // Create a new configuration object from this class - } else { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); - - // Load default settings into this class - LoadDefaults(); - - // Saves to the database file... - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Writing out default settings to local database"); - db.Set(this); - - // Closes file locks - db.Close(); - } - } catch(Exception e) { - OpenSim.Framework.Console.MainConsole.Instance.Warn("Config.cs:InitConfig() - Exception occured"); - OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); - } - - // Grid Settings - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Grid settings loaded:"); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Grid owner: " + this.GridOwner); - - // Asset Settings - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Default asset server: " + this.DefaultAssetServer); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Key to send to asset server: " + this.AssetSendKey); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Key to expect from asset server: " + this.AssetRecvKey); - - // User Settings - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Default user server: " + this.DefaultUserServer); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Key to send to user server: " + this.UserSendKey); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Key to expect from user server: " + this.UserRecvKey); - - // Region Settings - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Key to send to sims: " + this.SimSendKey); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Key to expect from sims: " + this.SimRecvKey); - } - - /// - /// Closes down the database and releases filesystem locks - /// - public void Shutdown() { - db.Close(); - } - } - -} diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj deleted file mode 100644 index ddb48af..0000000 --- a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {B0027747-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGrid.Config.GridConfigDb4o - JScript - Grid - IE50 - false - Library - - OpenGrid.Config.GridConfigDb4o - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\ - False - False - False - 4 - - - - - ..\..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - System.dll - False - - - ..\..\..\bin\System.Data.dll - False - - - System.Xml.dll - False - - - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build deleted file mode 100644 index 075593b..0000000 --- a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs deleted file mode 100644 index 2b23131..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs +++ /dev/null @@ -1,161 +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 OpenGrid.Framework.Data; -using libsecondlife; - - -namespace OpenGrid.Framework.Data.DB4o -{ - /// - /// A grid server storage mechanism employing the DB4o database system - /// - class DB4oGridData : IGridData - { - /// - /// The database manager object - /// - DB4oGridManager manager; - - /// - /// Called when the plugin is first loaded (as constructors are not called) - /// - public void Initialise() { - manager = new DB4oGridManager("gridserver.yap"); - } - - /// - /// Returns a list of regions within the specified ranges - /// - /// minimum X coordinate - /// minimum Y coordinate - /// maximum X coordinate - /// maximum Y coordinate - /// An array of region profiles - public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d) - { - return null; - } - - /// - /// Returns a region located at the specified regionHandle (warning multiple regions may occupy the one spot, first found is returned) - /// - /// The handle to search for - /// A region profile - public SimProfileData GetProfileByHandle(ulong handle) { - lock (manager.simProfiles) - { - foreach (LLUUID UUID in manager.simProfiles.Keys) - { - if (manager.simProfiles[UUID].regionHandle == handle) - { - return manager.simProfiles[UUID]; - } - } - } - throw new Exception("Unable to find profile with handle (" + handle.ToString() + ")"); - } - - /// - /// Returns a specific region - /// - /// The region ID code - /// A region profile - public SimProfileData GetProfileByLLUUID(LLUUID uuid) - { - lock (manager.simProfiles) - { - if (manager.simProfiles.ContainsKey(uuid)) - return manager.simProfiles[uuid]; - } - throw new Exception("Unable to find profile with UUID (" + uuid.ToStringHyphenated() + ")"); - } - - /// - /// Adds a new specified region to the database - /// - /// The profile to add - /// A dataresponse enum indicating success - public DataResponse AddProfile(SimProfileData profile) - { - lock (manager.simProfiles) - { - if (manager.AddRow(profile)) - { - return DataResponse.RESPONSE_OK; - } - else - { - return DataResponse.RESPONSE_ERROR; - } - } - } - - /// - /// Authenticates a new region using the shared secrets. NOT SECURE. - /// - /// The UUID the region is authenticating with - /// The location the region is logging into (unused in Db4o) - /// The shared secret - /// Authenticated? - public bool AuthenticateSim(LLUUID uuid, ulong handle, string key) { - if (manager.simProfiles[uuid].regionRecvKey == key) - return true; - return false; - } - - /// - /// Shuts down the database - /// - public void Close() - { - manager = null; - } - - /// - /// Returns the providers name - /// - /// The name of the storage system - public string getName() - { - return "DB4o Grid Provider"; - } - - /// - /// Returns the providers version - /// - /// The version of the storage system - public string getVersion() - { - return "0.1"; - } - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oManager.cs b/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oManager.cs deleted file mode 100644 index 356a49c..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oManager.cs +++ /dev/null @@ -1,165 +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 Db4objects.Db4o; -using OpenGrid.Framework.Data; -using libsecondlife; - -namespace OpenGrid.Framework.Data.DB4o -{ - /// - /// A Database manager for Db4o - /// - class DB4oGridManager - { - /// - /// A list of the current regions connected (in-memory cache) - /// - public Dictionary simProfiles = new Dictionary(); - /// - /// Database File Name - /// - string dbfl; - - /// - /// Creates a new grid storage manager - /// - /// Filename to the database file - public DB4oGridManager(string db4odb) - { - dbfl = db4odb; - IObjectContainer database; - database = Db4oFactory.OpenFile(dbfl); - IObjectSet result = database.Get(typeof(SimProfileData)); - // Loads the file into the in-memory cache - foreach(SimProfileData row in result) { - simProfiles.Add(row.UUID, row); - } - database.Close(); - } - - /// - /// Adds a new profile to the database (Warning: Probably slow.) - /// - /// The profile to add - /// Successful? - public bool AddRow(SimProfileData row) - { - if (simProfiles.ContainsKey(row.UUID)) - { - simProfiles[row.UUID] = row; - } - else - { - simProfiles.Add(row.UUID, row); - } - - try - { - IObjectContainer database; - database = Db4oFactory.OpenFile(dbfl); - database.Set(row); - database.Close(); - return true; - } - catch (Exception e) - { - return false; - } - } - - - } - - /// - /// A manager for the DB4o database (user profiles) - /// - class DB4oUserManager - { - /// - /// A list of the user profiles (in memory cache) - /// - public Dictionary userProfiles = new Dictionary(); - /// - /// Database filename - /// - string dbfl; - - /// - /// Initialises a new DB manager - /// - /// The filename to the database - public DB4oUserManager(string db4odb) - { - dbfl = db4odb; - IObjectContainer database; - database = Db4oFactory.OpenFile(dbfl); - // Load to cache - IObjectSet result = database.Get(typeof(UserProfileData)); - foreach (UserProfileData row in result) - { - userProfiles.Add(row.UUID, row); - } - database.Close(); - } - - /// - /// Adds a new profile to the database (Warning: Probably slow.) - /// - /// The profile to add - /// Successful? - public bool AddRow(UserProfileData row) - { - if (userProfiles.ContainsKey(row.UUID)) - { - userProfiles[row.UUID] = row; - } - else - { - userProfiles.Add(row.UUID, row); - } - - try - { - IObjectContainer database; - database = Db4oFactory.OpenFile(dbfl); - database.Set(row); - database.Close(); - return true; - } - catch (Exception e) - { - return false; - } - } - - - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs b/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs deleted file mode 100644 index 315f48d..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs +++ /dev/null @@ -1,205 +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 OpenGrid.Framework.Data; -using libsecondlife; - -namespace OpenGrid.Framework.Data.DB4o -{ - /// - /// A User storage interface for the DB4o database system - /// - public class DB4oUserData : IUserData - { - /// - /// The database manager - /// - DB4oUserManager manager; - - /// - /// Artificial constructor called upon plugin load - /// - public void Initialise() - { - manager = new DB4oUserManager("userprofiles.yap"); - } - - /// - /// Loads a specified user profile from a UUID - /// - /// The users UUID - /// A user profile - public UserProfileData getUserByUUID(LLUUID uuid) - { - if(manager.userProfiles.ContainsKey(uuid)) - return manager.userProfiles[uuid]; - return null; - } - - /// - /// Returns a user by searching for its name - /// - /// The users account name - /// A matching users profile - public UserProfileData getUserByName(string name) - { - return getUserByName(name.Split(' ')[0], name.Split(' ')[1]); - } - - /// - /// Returns a user by searching for its name - /// - /// The first part of the users account name - /// The second part of the users account name - /// A matching users profile - public UserProfileData getUserByName(string fname, string lname) - { - foreach (UserProfileData profile in manager.userProfiles.Values) - { - if (profile.username == fname && profile.surname == lname) - return profile; - } - return null; - } - - /// - /// Returns a user by UUID direct - /// - /// The users account ID - /// A matching users profile - public UserAgentData getAgentByUUID(LLUUID uuid) - { - try - { - return getUserByUUID(uuid).currentAgent; - } - catch (Exception e) - { - return null; - } - } - - /// - /// Returns a session by account name - /// - /// The account name - /// The users session agent - public UserAgentData getAgentByName(string name) - { - return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]); - } - - /// - /// Returns a session by account name - /// - /// The first part of the users account name - /// The second part of the users account name - /// A user agent - public UserAgentData getAgentByName(string fname, string lname) - { - try - { - return getUserByName(fname,lname).currentAgent; - } - catch (Exception e) - { - return null; - } - } - - /// - /// Creates a new user profile - /// - /// The profile to add to the database - public void addNewUserProfile(UserProfileData user) - { - try - { - manager.AddRow(user); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - } - - /// - /// Creates a new user agent - /// - /// The agent to add to the database - public void addNewUserAgent(UserAgentData agent) - { - // Do nothing. yet. - } - - /// - /// Transfers money between two user accounts - /// - /// Starting account - /// End account - /// The amount to move - /// Success? - public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount) - { - return true; - } - - /// - /// Transfers inventory between two accounts - /// - /// Move to inventory server - /// Senders account - /// Recievers account - /// Inventory item - /// Success? - public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item) - { - return true; - } - - /// - /// Returns the name of the storage provider - /// - /// Storage provider name - public string getName() - { - return "DB4o Userdata"; - } - - /// - /// Returns the version of the storage provider - /// - /// Storage provider version - public string getVersion() - { - return "0.1"; - } - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj b/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj deleted file mode 100644 index d2d6140..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {39BD9497-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGrid.Framework.Data.DB4o - JScript - Grid - IE50 - false - Library - - OpenGrid.Framework.Data.DB4o - - - - - - 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.Data.dll - False - - - System.Xml.dll - False - - - - - OpenGrid.Framework.Data - {62CDF671-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build b/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build deleted file mode 100644 index d82d751..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs deleted file mode 100644 index dc4a9a1..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OpenGrid.Framework.Data.DB4o")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenGrid.Framework.Data.DB4o")] -[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("57991e15-79da-41b7-aa06-2e6b49165a63")] - -// 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/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLGridData.cs deleted file mode 100644 index 92169c4..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLGridData.cs +++ /dev/null @@ -1,190 +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 OpenGrid.Framework.Data; - -namespace OpenGrid.Framework.Data.MSSQL -{ - /// - /// A grid data interface for Microsoft SQL Server - /// - public class SqlGridData : IGridData - { - /// - /// Database manager - /// - private MSSqlManager database; - - /// - /// Initialises the Grid Interface - /// - public void Initialise() - { - database = new MSSqlManager("localhost", "db", "user", "password", "false"); - } - - /// - /// Shuts down the grid interface - /// - public void Close() - { - database.Close(); - } - - /// - /// Returns the storage system name - /// - /// A string containing the storage system name - public string getName() - { - return "Sql OpenGridData"; - } - - /// - /// Returns the storage system version - /// - /// A string containing the storage system version - public string getVersion() - { - return "0.1"; - } - - /// - /// Returns a list of regions within the specified ranges - /// - /// minimum X coordinate - /// minimum Y coordinate - /// maximum X coordinate - /// maximum Y coordinate - /// An array of region profiles - public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d) - { - return null; - } - - /// - /// Returns a sim profile from it's location - /// - /// Region location handle - /// Sim profile - public SimProfileData GetProfileByHandle(ulong handle) - { - Dictionary param = new Dictionary(); - param["handle"] = handle.ToString(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - SimProfileData row = database.getRow(reader); - reader.Close(); - result.Dispose(); - - return row; - } - - /// - /// Returns a sim profile from it's UUID - /// - /// The region UUID - /// The sim profile - public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid) - { - Dictionary param = new Dictionary(); - param["uuid"] = uuid.ToStringHyphenated(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - SimProfileData row = database.getRow(reader); - reader.Close(); - result.Dispose(); - - return row; - } - - /// - /// Adds a new specified region to the database - /// - /// The profile to add - /// A dataresponse enum indicating success - public DataResponse AddProfile(SimProfileData profile) - { - if (database.insertRow(profile)) - { - return DataResponse.RESPONSE_OK; - } - else - { - return DataResponse.RESPONSE_ERROR; - } - } - - /// - /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. - /// - /// The UUID of the challenger - /// The attempted regionHandle of the challenger - /// The secret - /// Whether the secret and regionhandle match the database entry for UUID - public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey) - { - bool throwHissyFit = false; // Should be true by 1.0 - - if (throwHissyFit) - throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); - - SimProfileData data = GetProfileByLLUUID(uuid); - - return (handle == data.regionHandle && authkey == data.regionSecret); - } - - /// - /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region - /// - /// This requires a security audit. - /// - /// - /// - /// - /// - public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge) - { - System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed(); - System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding(); - - byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); - byte[] hash = HashProvider.ComputeHash(stream); - - return false; - } - } - - -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs deleted file mode 100644 index 475a3e7..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs +++ /dev/null @@ -1,214 +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.Data; - -using System.Data.SqlClient; - -using OpenGrid.Framework.Data; - -namespace OpenGrid.Framework.Data.MSSQL -{ - /// - /// A management class for the MS SQL Storage Engine - /// - class MSSqlManager - { - /// - /// The database connection object - /// - IDbConnection dbcon; - - /// - /// Initialises and creates a new Sql connection and maintains it. - /// - /// The Sql server being connected to - /// The name of the Sql database being used - /// The username logging into the database - /// The password for the user logging in - /// Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'. - public MSSqlManager(string hostname, string database, string username, string password, string cpooling) - { - try - { - string connectionString = "Server=" + hostname + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";"; - dbcon = new SqlConnection(connectionString); - - dbcon.Open(); - } - catch (Exception e) - { - throw new Exception("Error initialising Sql Database: " + e.ToString()); - } - } - - /// - /// Shuts down the database connection - /// - public void Close() - { - dbcon.Close(); - dbcon = null; - } - - /// - /// Runs a query with protection against SQL Injection by using parameterised input. - /// - /// The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y - /// The parameters - index so that @y is indexed as 'y' - /// A Sql DB Command - public IDbCommand Query(string sql, Dictionary parameters) - { - SqlCommand dbcommand = (SqlCommand)dbcon.CreateCommand(); - dbcommand.CommandText = sql; - foreach (KeyValuePair param in parameters) - { - dbcommand.Parameters.AddWithValue(param.Key, param.Value); - } - - return (IDbCommand)dbcommand; - } - - /// - /// Runs a database reader object and returns a region row - /// - /// An active database reader - /// A region row - public SimProfileData getRow(IDataReader reader) - { - SimProfileData regionprofile = new SimProfileData(); - - if (reader.Read()) - { - // Region Main - regionprofile.regionHandle = (ulong)reader["regionHandle"]; - regionprofile.regionName = (string)reader["regionName"]; - regionprofile.UUID = new libsecondlife.LLUUID((string)reader["uuid"]); - - // Secrets - regionprofile.regionRecvKey = (string)reader["regionRecvKey"]; - regionprofile.regionSecret = (string)reader["regionSecret"]; - regionprofile.regionSendKey = (string)reader["regionSendKey"]; - - // Region Server - regionprofile.regionDataURI = (string)reader["regionDataURI"]; - regionprofile.regionOnline = false; // Needs to be pinged before this can be set. - regionprofile.serverIP = (string)reader["serverIP"]; - regionprofile.serverPort = (uint)reader["serverPort"]; - regionprofile.serverURI = (string)reader["serverURI"]; - - // Location - regionprofile.regionLocX = (uint)((int)reader["locX"]); - regionprofile.regionLocY = (uint)((int)reader["locY"]); - regionprofile.regionLocZ = (uint)((int)reader["locZ"]); - - // Neighbours - 0 = No Override - regionprofile.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"]; - regionprofile.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"]; - regionprofile.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"]; - regionprofile.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"]; - - // Assets - regionprofile.regionAssetURI = (string)reader["regionAssetURI"]; - regionprofile.regionAssetRecvKey = (string)reader["regionAssetRecvKey"]; - regionprofile.regionAssetSendKey = (string)reader["regionAssetSendKey"]; - - // Userserver - regionprofile.regionUserURI = (string)reader["regionUserURI"]; - regionprofile.regionUserRecvKey = (string)reader["regionUserRecvKey"]; - regionprofile.regionUserSendKey = (string)reader["regionUserSendKey"]; - } - else - { - throw new Exception("No rows to return"); - } - return regionprofile; - } - - /// - /// Creates a new region in the database - /// - /// The region profile to insert - /// Successful? - public bool insertRow(SimProfileData profile) - { - string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; - sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; - sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES "; - - sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, "; - sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, "; - sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);"; - - Dictionary parameters = new Dictionary(); - - parameters["regionHandle"] = profile.regionHandle.ToString(); - parameters["regionName"] = profile.regionName; - parameters["uuid"] = profile.UUID.ToString(); - parameters["regionRecvKey"] = profile.regionRecvKey; - parameters["regionSendKey"] = profile.regionSendKey; - parameters["regionDataURI"] = profile.regionDataURI; - parameters["serverIP"] = profile.serverIP; - parameters["serverPort"] = profile.serverPort.ToString(); - parameters["serverURI"] = profile.serverURI; - parameters["locX"] = profile.regionLocX.ToString(); - parameters["locY"] = profile.regionLocY.ToString(); - parameters["locZ"] = profile.regionLocZ.ToString(); - parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString(); - parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString(); - parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString(); - parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString(); - parameters["regionAssetURI"] = profile.regionAssetURI; - parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey; - parameters["regionAssetSendKey"] = profile.regionAssetSendKey; - parameters["regionUserURI"] = profile.regionUserURI; - parameters["regionUserRecvKey"] = profile.regionUserRecvKey; - parameters["regionUserSendKey"] = profile.regionUserSendKey; - - bool returnval = false; - - try - { - IDbCommand result = Query(sql, parameters); - - if (result.ExecuteNonQuery() == 1) - returnval = true; - - result.Dispose(); - } - catch (Exception e) - { - return false; - } - - return returnval; - } - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj deleted file mode 100644 index fa18c28..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {0A563AC1-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGrid.Framework.Data.MSSQL - JScript - Grid - IE50 - false - Library - - OpenGrid.Framework.Data.MSSQL - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - ..\..\bin\libsecondlife.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - - - OpenGrid.Framework.Data - {62CDF671-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build deleted file mode 100644 index 577da4b..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/Properties/AssemblyInfo.cs deleted file mode 100644 index bbe3cdf..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OpenGrid.Framework.Data.MSSQL")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenGrid.Framework.Data.MSSQL")] -[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("0e1c1ca4-2cf2-4315-b0e7-432c02feea8a")] - -// 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/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs deleted file mode 100644 index d9a517d..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs +++ /dev/null @@ -1,258 +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 OpenGrid.Framework.Data; - -namespace OpenGrid.Framework.Data.MySQL -{ - /// - /// A MySQL Interface for the Grid Server - /// - public class MySQLGridData : IGridData - { - /// - /// MySQL Database Manager - /// - private MySQLManager database; - - /// - /// Initialises the Grid Interface - /// - public void Initialise() - { - IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); - string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); - string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); - string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); - string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); - string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); - string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); - - database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); - } - - /// - /// Shuts down the grid interface - /// - public void Close() - { - database.Close(); - } - - /// - /// Returns the plugin name - /// - /// Plugin name - public string getName() - { - return "MySql OpenGridData"; - } - - /// - /// Returns the plugin version - /// - /// Plugin version - public string getVersion() - { - return "0.1"; - } - - /// - /// Returns all the specified region profiles within coordates -- coordinates are inclusive - /// - /// Minimum X coordinate - /// Minimum Y coordinate - /// Maximum X coordinate - /// Maximum Y coordinate - /// - public SimProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?xmin"] = xmin.ToString(); - param["?ymin"] = ymin.ToString(); - param["?xmax"] = xmax.ToString(); - param["?ymax"] = ymax.ToString(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - SimProfileData row; - - List rows = new List(); - - while ((row = database.readSimRow(reader)) != null) - { - rows.Add(row); - } - reader.Close(); - result.Dispose(); - - return rows.ToArray(); - - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Returns a sim profile from it's location - /// - /// Region location handle - /// Sim profile - public SimProfileData GetProfileByHandle(ulong handle) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?handle"] = handle.ToString(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - SimProfileData row = database.readSimRow(reader); - reader.Close(); - result.Dispose(); - - return row; - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Returns a sim profile from it's UUID - /// - /// The region UUID - /// The sim profile - public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?uuid"] = uuid.ToStringHyphenated(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - SimProfileData row = database.readSimRow(reader); - reader.Close(); - result.Dispose(); - - return row; - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Adds a new profile to the database - /// - /// The profile to add - /// Successful? - public DataResponse AddProfile(SimProfileData profile) - { - lock (database) - { - if (database.insertRegion(profile)) - { - return DataResponse.RESPONSE_OK; - } - else - { - return DataResponse.RESPONSE_ERROR; - } - } - } - - /// - /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. - /// - /// The UUID of the challenger - /// The attempted regionHandle of the challenger - /// The secret - /// Whether the secret and regionhandle match the database entry for UUID - public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey) - { - bool throwHissyFit = false; // Should be true by 1.0 - - if (throwHissyFit) - throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); - - SimProfileData data = GetProfileByLLUUID(uuid); - - return (handle == data.regionHandle && authkey == data.regionSecret); - } - - /// - /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region - /// - /// This requires a security audit. - /// - /// - /// - /// - /// - public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge) - { - System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed(); - System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding(); - - byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); - byte[] hash = HashProvider.ComputeHash(stream); - - return false; - } - } - - -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs deleted file mode 100644 index fb429e4..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs +++ /dev/null @@ -1,309 +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 OpenGrid.Framework.Data.MySQL -{ - /// - /// A MySQL interface for the inventory server - /// - class MySQLInventoryData : IInventoryData - { - /// - /// The database manager - /// - public MySQLManager database; - - /// - /// Loads and initialises this database plugin - /// - public void Initialise() - { - IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); - string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); - string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); - string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); - string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); - string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); - string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); - - database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); - } - - /// - /// The name of this DB provider - /// - /// Name of DB provider - public string getName() - { - return "MySQL Inventory Data Interface"; - } - - /// - /// Closes this DB provider - /// - public void Close() - { - // Do nothing. - } - - /// - /// Returns the version of this DB provider - /// - /// A string containing the DB provider - public string getVersion() - { - return "0.1"; - } - - /// - /// Returns a list of items in a specified folder - /// - /// The folder to search - /// A list containing inventory items - public List getInventoryInFolder(LLUUID folderID) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?uuid"] = folderID.ToStringHyphenated(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM inventoryitems WHERE parentFolderID = ?uuid", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - List items = database.readInventoryItems(reader); - - reader.Close(); - result.Dispose(); - - return items; - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Returns a list of the root folders within a users inventory - /// - /// The user whos inventory is to be searched - /// A list of folder objects - public List getUserRootFolders(LLUUID user) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?uuid"] = user.ToStringHyphenated(); - param["?zero"] = LLUUID.Zero.ToStringHyphenated(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - List items = database.readInventoryFolders(reader); - - reader.Close(); - result.Dispose(); - - return items; - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Returns a list of folders in a users inventory contained within the specified folder - /// - /// The folder to search - /// A list of inventory folders - public List getInventoryFolders(LLUUID parentID) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?uuid"] = parentID.ToStringHyphenated(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?uuid", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - List items = database.readInventoryFolders(reader); - - reader.Close(); - result.Dispose(); - - return items; - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Returns a specified inventory item - /// - /// The item to return - /// An inventory item - public InventoryItemBase getInventoryItem(LLUUID item) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?uuid"] = item.ToStringHyphenated(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM inventoryitems WHERE inventoryID = ?uuid", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - List items = database.readInventoryItems(reader); - - reader.Close(); - result.Dispose(); - - if (items.Count > 0) - { - return items[0]; - } - else - { - return null; - } - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Returns a specified inventory folder - /// - /// The folder to return - /// A folder class - public InventoryFolderBase getInventoryFolder(LLUUID folder) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?uuid"] = folder.ToStringHyphenated(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE folderID = ?uuid", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - List items = database.readInventoryFolders(reader); - - reader.Close(); - result.Dispose(); - - if (items.Count > 0) - { - return items[0]; - } - else - { - return null; - } - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Adds a specified item to the database - /// - /// The inventory item - public void addInventoryItem(InventoryItemBase item) - { - lock (database) - { - database.insertItem(item); - } - } - - /// - /// Updates the specified inventory item - /// - /// Inventory item to update - public void updateInventoryItem(InventoryItemBase item) - { - addInventoryItem(item); - } - - /// - /// Creates a new inventory folder - /// - /// Folder to create - public void addInventoryFolder(InventoryFolderBase folder) - { - lock (database) - { - database.insertFolder(folder); - } - } - - /// - /// Updates an inventory folder - /// - /// Folder to update - public void updateInventoryFolder(InventoryFolderBase folder) - { - addInventoryFolder(folder); - } - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLLogData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLLogData.cs deleted file mode 100644 index c88b39f..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLLogData.cs +++ /dev/null @@ -1,107 +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 OpenGrid.Framework.Data.MySQL -{ - /// - /// An interface to the log database for MySQL - /// - class MySQLLogData : ILogData - { - /// - /// The database manager - /// - public MySQLManager database; - - /// - /// Artificial constructor called when the plugin is loaded - /// - public void Initialise() - { - IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); - string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); - string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); - string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); - string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); - string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); - string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); - - database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); - } - - /// - /// Saves a log item to the database - /// - /// The daemon triggering the event - /// The target of the action (region / agent UUID, etc) - /// The method call where the problem occured - /// The arguments passed to the method - /// How critical is this? - /// The message to log - public void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) - { - try - { - database.insertLogRow(serverDaemon, target, methodCall, arguments, priority, logMessage); - } - catch (Exception e) - { - database.Reconnect(); - } - } - - /// - /// Returns the name of this DB provider - /// - /// A string containing the DB provider name - public string getName() - { - return "MySQL Logdata Interface"; - } - - /// - /// Closes the database provider - /// - public void Close() - { - // Do nothing. - } - - /// - /// Returns the version of this DB provider - /// - /// A string containing the provider version - public string getVersion() - { - return "0.1"; - } - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs deleted file mode 100644 index b42ec09..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs +++ /dev/null @@ -1,665 +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.Data; - -// MySQL Native -using MySql; -using MySql.Data; -using MySql.Data.Types; -using MySql.Data.MySqlClient; - -using OpenGrid.Framework.Data; - -namespace OpenGrid.Framework.Data.MySQL -{ - /// - /// A MySQL Database manager - /// - class MySQLManager - { - /// - /// The database connection object - /// - IDbConnection dbcon; - /// - /// Connection string for ADO.net - /// - string connectionString; - - /// - /// Initialises and creates a new MySQL connection and maintains it. - /// - /// The MySQL server being connected to - /// The name of the MySQL database being used - /// The username logging into the database - /// The password for the user logging in - /// Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'. - public MySQLManager(string hostname, string database, string username, string password, string cpooling, string port) - { - try - { - connectionString = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";"; - dbcon = new MySqlConnection(connectionString); - - dbcon.Open(); - - System.Console.WriteLine("MySQL connection established"); - } - catch (Exception e) - { - throw new Exception("Error initialising MySql Database: " + e.ToString()); - } - } - - /// - /// Shuts down the database connection - /// - public void Close() - { - dbcon.Close(); - dbcon = null; - } - - /// - /// Reconnects to the database - /// - public void Reconnect() - { - lock (dbcon) - { - try - { - // Close the DB connection - dbcon.Close(); - // Try reopen it - dbcon = new MySqlConnection(connectionString); - dbcon.Open(); - } - catch (Exception e) - { - Console.WriteLine("Unable to reconnect to database " + e.ToString()); - } - } - } - - /// - /// Runs a query with protection against SQL Injection by using parameterised input. - /// - /// The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y - /// The parameters - index so that @y is indexed as 'y' - /// A MySQL DB Command - public IDbCommand Query(string sql, Dictionary parameters) - { - try - { - MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand(); - dbcommand.CommandText = sql; - foreach (KeyValuePair param in parameters) - { - dbcommand.Parameters.Add(param.Key, param.Value); - } - - return (IDbCommand)dbcommand; - } - catch - { - lock (dbcon) - { - // Close the DB connection - try - { - dbcon.Close(); - } - catch { } - - // Try reopen it - try - { - dbcon = new MySqlConnection(connectionString); - dbcon.Open(); - } - catch (Exception e) - { - Console.WriteLine("Unable to reconnect to database " + e.ToString()); - } - - // Run the query again - try - { - MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand(); - dbcommand.CommandText = sql; - foreach (KeyValuePair param in parameters) - { - dbcommand.Parameters.Add(param.Key, param.Value); - } - - return (IDbCommand)dbcommand; - } - catch (Exception e) - { - // Return null if it fails. - Console.WriteLine("Failed during Query generation: " + e.ToString()); - return null; - } - } - } - } - - /// - /// Reads a region row from a database reader - /// - /// An active database reader - /// A region profile - public SimProfileData readSimRow(IDataReader reader) - { - SimProfileData retval = new SimProfileData(); - - if (reader.Read()) - { - // Region Main - retval.regionHandle = Convert.ToUInt64(reader["regionHandle"].ToString()); - retval.regionName = (string)reader["regionName"]; - retval.UUID = new libsecondlife.LLUUID((string)reader["uuid"]); - - // Secrets - retval.regionRecvKey = (string)reader["regionRecvKey"]; - retval.regionSecret = (string)reader["regionSecret"]; - retval.regionSendKey = (string)reader["regionSendKey"]; - - // Region Server - retval.regionDataURI = (string)reader["regionDataURI"]; - retval.regionOnline = false; // Needs to be pinged before this can be set. - retval.serverIP = (string)reader["serverIP"]; - retval.serverPort = (uint)reader["serverPort"]; - retval.serverURI = (string)reader["serverURI"]; - - // Location - retval.regionLocX = Convert.ToUInt32(reader["locX"].ToString()); - retval.regionLocY = Convert.ToUInt32(reader["locY"].ToString()); - retval.regionLocZ = Convert.ToUInt32(reader["locZ"].ToString()); - - // Neighbours - 0 = No Override - retval.regionEastOverrideHandle = Convert.ToUInt64(reader["eastOverrideHandle"].ToString()); - retval.regionWestOverrideHandle = Convert.ToUInt64(reader["westOverrideHandle"].ToString()); - retval.regionSouthOverrideHandle = Convert.ToUInt64(reader["southOverrideHandle"].ToString()); - retval.regionNorthOverrideHandle = Convert.ToUInt64(reader["northOverrideHandle"].ToString()); - - // Assets - retval.regionAssetURI = (string)reader["regionAssetURI"]; - retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"]; - retval.regionAssetSendKey = (string)reader["regionAssetSendKey"]; - - // Userserver - retval.regionUserURI = (string)reader["regionUserURI"]; - retval.regionUserRecvKey = (string)reader["regionUserRecvKey"]; - retval.regionUserSendKey = (string)reader["regionUserSendKey"]; - - // World Map Addition - string tempRegionMap = reader["regionMapTexture"].ToString(); - if (tempRegionMap != "") - { - retval.regionMapTextureID = new libsecondlife.LLUUID(tempRegionMap); - } - else - { - retval.regionMapTextureID = new libsecondlife.LLUUID(); - } - } - else - { - return null; - } - return retval; - } - - /// - /// Reads an agent row from a database reader - /// - /// An active database reader - /// A user session agent - public UserAgentData readAgentRow(IDataReader reader) - { - UserAgentData retval = new UserAgentData(); - - if (reader.Read()) - { - // Agent IDs - retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]); - retval.sessionID = new libsecondlife.LLUUID((string)reader["sessionID"]); - retval.secureSessionID = new libsecondlife.LLUUID((string)reader["secureSessionID"]); - - // Agent Who? - retval.agentIP = (string)reader["agentIP"]; - retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString()); - retval.agentOnline = Convert.ToBoolean(reader["agentOnline"].ToString()); - - // Login/Logout times (UNIX Epoch) - retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString()); - retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); - - // Current position - retval.currentRegion = (string)reader["currentRegion"]; - retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); - libsecondlife.LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos); - } - else - { - return null; - } - return retval; - } - - /// - /// Reads a user profile from an active data reader - /// - /// An active database reader - /// A user profile - public UserProfileData readUserRow(IDataReader reader) - { - UserProfileData retval = new UserProfileData(); - - if (reader.Read()) - { - retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]); - retval.username = (string)reader["username"]; - retval.surname = (string)reader["lastname"]; - - retval.passwordHash = (string)reader["passwordHash"]; - retval.passwordSalt = (string)reader["passwordSalt"]; - - retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); - retval.homeLocation = new libsecondlife.LLVector3( - Convert.ToSingle(reader["homeLocationX"].ToString()), - Convert.ToSingle(reader["homeLocationY"].ToString()), - Convert.ToSingle(reader["homeLocationZ"].ToString())); - retval.homeLookAt = new libsecondlife.LLVector3( - Convert.ToSingle(reader["homeLookAtX"].ToString()), - Convert.ToSingle(reader["homeLookAtY"].ToString()), - Convert.ToSingle(reader["homeLookAtZ"].ToString())); - - retval.created = Convert.ToInt32(reader["created"].ToString()); - retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); - - retval.userInventoryURI = (string)reader["userInventoryURI"]; - retval.userAssetURI = (string)reader["userAssetURI"]; - - retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); - retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); - - retval.profileAboutText = (string)reader["profileAboutText"]; - retval.profileFirstText = (string)reader["profileFirstText"]; - - retval.profileImage = new libsecondlife.LLUUID((string)reader["profileImage"]); - retval.profileFirstImage = new libsecondlife.LLUUID((string)reader["profileFirstImage"]); - - } - else - { - return null; - } - return retval; - } - - /// - /// Reads a list of inventory folders returned by a query. - /// - /// A MySQL Data Reader - /// A List containing inventory folders - public List readInventoryFolders(IDataReader reader) - { - List rows = new List(); - - while(reader.Read()) - { - try - { - InventoryFolderBase folder = new InventoryFolderBase(); - - folder.agentID = new libsecondlife.LLUUID((string)reader["agentID"]); - folder.parentID = new libsecondlife.LLUUID((string)reader["parentFolderID"]); - folder.folderID = new libsecondlife.LLUUID((string)reader["folderID"]); - folder.name = (string)reader["folderName"]; - - rows.Add(folder); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - } - - return rows; - } - - /// - /// Reads a collection of items from an SQL result - /// - /// The SQL Result - /// A List containing Inventory Items - public List readInventoryItems(IDataReader reader) - { - List rows = new List(); - - while (reader.Read()) - { - try - { - InventoryItemBase item = new InventoryItemBase(); - - item.assetID = new libsecondlife.LLUUID((string)reader["assetID"]); - item.avatarID = new libsecondlife.LLUUID((string)reader["avatarID"]); - item.inventoryCurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"].ToString()); - item.inventoryDescription = (string)reader["inventoryDescription"]; - item.inventoryID = new libsecondlife.LLUUID((string)reader["inventoryID"]); - item.inventoryName = (string)reader["inventoryName"]; - item.inventoryNextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"].ToString()); - item.parentFolderID = new libsecondlife.LLUUID((string)reader["parentFolderID"]); - item.type = Convert.ToInt32(reader["type"].ToString()); - - rows.Add(item); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - } - - return rows; - } - - /// - /// Inserts a new row into the log database - /// - /// The daemon which triggered this event - /// Who were we operating on when this occured (region UUID, user UUID, etc) - /// The method call where the problem occured - /// The arguments passed to the method - /// How critical is this? - /// Extra message info - /// Saved successfully? - public bool insertLogRow(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) - { - string sql = "INSERT INTO logs (`target`, `server`, `method`, `arguments`, `priority`, `message`) VALUES "; - sql += "(?target, ?server, ?method, ?arguments, ?priority, ?message)"; - - Dictionary parameters = new Dictionary(); - parameters["?server"] = serverDaemon; - parameters["?target"] = target; - parameters["?method"] = methodCall; - parameters["?arguments"] = arguments; - parameters["?priority"] = priority.ToString(); - parameters["?message"] = logMessage; - - bool returnval = false; - - try - { - IDbCommand result = Query(sql, parameters); - - if (result.ExecuteNonQuery() == 1) - returnval = true; - - result.Dispose(); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - return false; - } - - return returnval; - } - - /// - /// Inserts a new item into the database - /// - /// The item - /// Success? - public bool insertItem(InventoryItemBase item) - { - string sql = "REPLACE INTO inventoryitems (inventoryID, assetID, type, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions) VALUES "; - sql += "(?inventoryID, ?assetID, ?type, ?parentFolderID, ?avatarID, ?inventoryName, ?inventoryDescription, ?inventoryNextPermissions, ?inventoryCurrentPermissions)"; - - Dictionary parameters = new Dictionary(); - parameters["?inventoryID"] = item.inventoryID.ToStringHyphenated(); - parameters["?assetID"] = item.assetID.ToStringHyphenated(); - parameters["?type"] = item.type.ToString(); - parameters["?parentFolderID"] = item.parentFolderID.ToStringHyphenated(); - parameters["?avatarID"] = item.avatarID.ToStringHyphenated(); - parameters["?inventoryName"] = item.inventoryName; - parameters["?inventoryDescription"] = item.inventoryDescription; - parameters["?inventoryNextPermissions"] = item.inventoryNextPermissions.ToString(); - parameters["?inventoryCurrentPermissions"] = item.inventoryCurrentPermissions.ToString(); - - bool returnval = false; - - try - { - IDbCommand result = Query(sql, parameters); - - if (result.ExecuteNonQuery() == 1) - returnval = true; - - result.Dispose(); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - return false; - } - - return returnval; - } - - /// - /// Inserts a new folder into the database - /// - /// The folder - /// Success? - public bool insertFolder(InventoryFolderBase folder) - { - string sql = "REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName) VALUES "; - sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName)"; - - Dictionary parameters = new Dictionary(); - parameters["?folderID"] = folder.folderID.ToStringHyphenated(); - parameters["?agentID"] = folder.agentID.ToStringHyphenated(); - parameters["?parentFolderID"] = folder.parentID.ToStringHyphenated(); - parameters["?folderName"] = folder.name; - - bool returnval = false; - try - { - IDbCommand result = Query(sql, parameters); - - if (result.ExecuteNonQuery() == 1) - returnval = true; - - result.Dispose(); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - return false; - } - return returnval; - } - - /// - /// Creates a new user and inserts it into the database - /// - /// User ID - /// First part of the login - /// Second part of the login - /// A salted hash of the users password - /// The salt used for the password hash - /// A regionHandle of the users home region - /// Home region position vector - /// Home region position vector - /// Home region position vector - /// Home region 'look at' vector - /// Home region 'look at' vector - /// Home region 'look at' vector - /// Account created (unix timestamp) - /// Last login (unix timestamp) - /// Users inventory URI - /// Users asset URI - /// I can do mask - /// I want to do mask - /// Profile text - /// Firstlife text - /// UUID for profile image - /// UUID for firstlife image - /// Success? - public bool insertUserRow(libsecondlife.LLUUID uuid, string username, string lastname, string passwordHash, string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, - float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, string aboutText, string firstText, - libsecondlife.LLUUID profileImage, libsecondlife.LLUUID firstImage) - { - string sql = "INSERT INTO users (`UUID`, `username`, `lastname`, `passwordHash`, `passworldSalt`, `homeRegion`, "; - sql += "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, "; - sql += "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, "; - sql += "`profileFirstText`, `profileImage`, profileFirstImage`) VALUES "; - - sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passworldSalt, ?homeRegion, "; - sql += "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX`, ?homeLookAtY, ?homeLookAtZ, ?created, "; - sql += "?lastLogin`, ?userInventoryURI, ?userAssetURI, ?profileCanDoMask, ?profileWantDoMask, ?profileAboutText, "; - sql += "?profileFirstText, ?profileImage, ?profileFirstImage)"; - - Dictionary parameters = new Dictionary(); - parameters["?UUID"] = uuid.ToStringHyphenated(); - parameters["?username"] = username.ToString(); - parameters["?lastname"] = lastname.ToString(); - parameters["?passwordHash"] = passwordHash.ToString(); - parameters["?passworldSalt"] = passwordSalt.ToString(); - parameters["?homeRegion"] = homeRegion.ToString(); - parameters["?homeLocationX"] = homeLocX.ToString(); - parameters["?homeLocationY"] = homeLocY.ToString(); - parameters["?homeLocationZ"] = homeLocZ.ToString(); - parameters["?homeLookAtX"] = homeLookAtX.ToString(); - parameters["?homeLookAtY"] = homeLookAtY.ToString(); - parameters["?homeLookAtZ"] = homeLookAtZ.ToString(); - parameters["?created"] = created.ToString(); - parameters["?lastLogin"] = lastlogin.ToString(); - parameters["?userInventoryURI"] = inventoryURI.ToString(); - parameters["?userAssetURI"] = assetURI.ToString(); - parameters["?profileCanDoMask"] = canDoMask.ToString(); - parameters["?profileWantDoMask"] = wantDoMask.ToString(); - parameters["?profileAboutText"] = aboutText.ToString(); - parameters["?profileFirstText"] = firstText.ToString(); - parameters["?profileImage"] = profileImage.ToStringHyphenated(); - parameters["?profileFirstImage"] = firstImage.ToStringHyphenated(); - - bool returnval = false; - - try - { - IDbCommand result = Query(sql, parameters); - - if (result.ExecuteNonQuery() == 1) - returnval = true; - - result.Dispose(); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - return false; - } - - return returnval; - } - - /// - /// Inserts a new region into the database - /// - /// The region to insert - /// Success? - public bool insertRegion(SimProfileData regiondata) - { - string sql = "REPLACE INTO regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; - sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; - sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture) VALUES "; - - sql += "(?regionHandle, ?regionName, ?uuid, ?regionRecvKey, ?regionSecret, ?regionSendKey, ?regionDataURI, "; - sql += "?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, "; - sql += "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture);"; - - Dictionary parameters = new Dictionary(); - - parameters["?regionHandle"] = regiondata.regionHandle.ToString(); - parameters["?regionName"] = regiondata.regionName.ToString(); - parameters["?uuid"] = regiondata.UUID.ToStringHyphenated(); - parameters["?regionRecvKey"] = regiondata.regionRecvKey.ToString(); - parameters["?regionSecret"] = regiondata.regionSecret.ToString(); - parameters["?regionSendKey"] = regiondata.regionSendKey.ToString(); - parameters["?regionDataURI"] = regiondata.regionDataURI.ToString(); - parameters["?serverIP"] = regiondata.serverIP.ToString(); - parameters["?serverPort"] = regiondata.serverPort.ToString(); - parameters["?serverURI"] = regiondata.serverURI.ToString(); - parameters["?locX"] = regiondata.regionLocX.ToString(); - parameters["?locY"] = regiondata.regionLocY.ToString(); - parameters["?locZ"] = regiondata.regionLocZ.ToString(); - parameters["?eastOverrideHandle"] = regiondata.regionEastOverrideHandle.ToString(); - parameters["?westOverrideHandle"] = regiondata.regionWestOverrideHandle.ToString(); - parameters["?northOverrideHandle"] = regiondata.regionNorthOverrideHandle.ToString(); - parameters["?southOverrideHandle"] = regiondata.regionSouthOverrideHandle.ToString(); - parameters["?regionAssetURI"] = regiondata.regionAssetURI.ToString(); - parameters["?regionAssetRecvKey"] = regiondata.regionAssetRecvKey.ToString(); - parameters["?regionAssetSendKey"] = regiondata.regionAssetSendKey.ToString(); - parameters["?regionUserURI"] = regiondata.regionUserURI.ToString(); - parameters["?regionUserRecvKey"] = regiondata.regionUserRecvKey.ToString(); - parameters["?regionUserSendKey"] = regiondata.regionUserSendKey.ToString(); - parameters["?regionMapTexture"] = regiondata.regionMapTextureID.ToStringHyphenated(); - - bool returnval = false; - - try - { - - IDbCommand result = Query(sql, parameters); - - //Console.WriteLine(result.CommandText); - - if (result.ExecuteNonQuery() == 1) - returnval = true; - - result.Dispose(); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - return false; - } - - return returnval; - } - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs deleted file mode 100644 index e988c94..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs +++ /dev/null @@ -1,271 +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 OpenGrid.Framework.Data; -using libsecondlife; - -namespace OpenGrid.Framework.Data.MySQL -{ - /// - /// A database interface class to a user profile storage system - /// - class MySQLUserData : IUserData - { - /// - /// Database manager for MySQL - /// - public MySQLManager database; - - /// - /// Loads and initialises the MySQL storage plugin - /// - public void Initialise() - { - // Load from an INI file connection details - // TODO: move this to XML? - IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); - string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); - string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); - string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); - string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); - string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); - string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); - - database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); - } - - /// - /// Searches the database for a specified user profile - /// - /// The account name of the user - /// A user profile - public UserProfileData getUserByName(string name) - { - return getUserByName(name.Split(' ')[0], name.Split(' ')[1]); - } - - /// - /// Searches the database for a specified user profile by name components - /// - /// The first part of the account name - /// The second part of the account name - /// A user profile - public UserProfileData getUserByName(string user, string last) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?first"] = user; - param["?second"] = last; - - System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE username = ?first AND lastname = ?second", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - UserProfileData row = database.readUserRow(reader); - - reader.Close(); - result.Dispose(); - - return row; - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Searches the database for a specified user profile by UUID - /// - /// The account ID - /// The users profile - public UserProfileData getUserByUUID(LLUUID uuid) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?uuid"] = uuid.ToStringHyphenated(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE UUID = ?uuid", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - UserProfileData row = database.readUserRow(reader); - - reader.Close(); - result.Dispose(); - - return row; - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Returns a user session searching by name - /// - /// The account name - /// The users session - public UserAgentData getAgentByName(string name) - { - return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]); - } - - /// - /// Returns a user session by account name - /// - /// First part of the users account name - /// Second part of the users account name - /// The users session - public UserAgentData getAgentByName(string user, string last) - { - UserProfileData profile = getUserByName(user, last); - return getAgentByUUID(profile.UUID); - } - - /// - /// Returns an agent session by account UUID - /// - /// The accounts UUID - /// The users session - public UserAgentData getAgentByUUID(LLUUID uuid) - { - try - { - lock (database) - { - Dictionary param = new Dictionary(); - param["?uuid"] = uuid.ToStringHyphenated(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - UserAgentData row = database.readAgentRow(reader); - - reader.Close(); - result.Dispose(); - - return row; - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - return null; - } - } - - /// - /// Creates a new users profile - /// - /// The user profile to create - public void addNewUserProfile(UserProfileData user) - { - try - { - lock (database) - { - database.insertUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, user.homeRegion, user.homeLocation.X, user.homeLocation.Y, user.homeLocation.Z, - user.homeLookAt.X, user.homeLookAt.Y, user.homeLookAt.Z, user.created, user.lastLogin, user.userInventoryURI, user.userAssetURI, user.profileCanDoMask, user.profileWantDoMask, - user.profileAboutText, user.profileFirstText, user.profileImage, user.profileFirstImage); - } - } - catch (Exception e) - { - database.Reconnect(); - Console.WriteLine(e.ToString()); - } - } - - /// - /// Creates a new agent - /// - /// The agent to create - public void addNewUserAgent(UserAgentData agent) - { - // Do nothing. - } - - /// - /// Performs a money transfer request between two accounts - /// - /// The senders account ID - /// The recievers account ID - /// The amount to transfer - /// Success? - public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount) - { - return false; - } - - /// - /// Performs an inventory transfer request between two accounts - /// - /// TODO: Move to inventory server - /// The senders account ID - /// The recievers account ID - /// The item to transfer - /// Success? - public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item) - { - return false; - } - - /// - /// Database provider name - /// - /// Provider name - public string getName() - { - return "MySQL Userdata Interface"; - } - - /// - /// Database provider version - /// - /// provider version - public string getVersion() - { - return "0.1"; - } - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj b/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj deleted file mode 100644 index cc3aacb..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {0F3C3AC1-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGrid.Framework.Data.MySQL - JScript - Grid - IE50 - false - Library - - OpenGrid.Framework.Data.MySQL - - - - - - 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 - - - ..\..\bin\MySql.Data.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - - - OpenGrid.Framework.Data - {62CDF671-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build b/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build deleted file mode 100644 index a5f4028..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/Properties/AssemblyInfo.cs deleted file mode 100644 index 0bfd1d6..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OpenGrid.Framework.Data.MySQL")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenGrid.Framework.Data.MySQL")] -[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("e49826b2-dcef-41be-a5bd-596733fa3304")] - -// 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/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.csproj b/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.csproj deleted file mode 100644 index 63d0bd9..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {1E3F341A-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGrid.Framework.Data.SQLite - JScript - Grid - IE50 - false - Library - - OpenGrid.Framework.Data.SQLite - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - ..\..\bin\libsecondlife.dll - False - - - System.dll - False - - - System.Data.dll - False - - - ..\..\bin\System.Data.SQLite.dll - False - - - System.Xml.dll - False - - - - - OpenGrid.Framework.Data - {62CDF671-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build b/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build deleted file mode 100644 index 79b0edf..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data.SQLite/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Framework.Data.SQLite/Properties/AssemblyInfo.cs deleted file mode 100644 index 57c4bae..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.SQLite/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OpenGrid.Framework.Data.SQLite")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenGrid.Framework.Data.SQLite")] -[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("6113d5ce-4547-49f4-9236-0dcc503457b1")] - -// 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/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteGridData.cs deleted file mode 100644 index 94ed46f..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteGridData.cs +++ /dev/null @@ -1,190 +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 OpenGrid.Framework.Data; - -namespace OpenGrid.Framework.Data.SQLite -{ - /// - /// A Grid Interface to the SQLite database - /// - public class SQLiteGridData : IGridData - { - /// - /// A database manager - /// - private SQLiteManager database; - - /// - /// Initialises the Grid Interface - /// - public void Initialise() - { - database = new SQLiteManager("localhost", "db", "user", "password", "false"); - } - - /// - /// Shuts down the grid interface - /// - public void Close() - { - database.Close(); - } - - /// - /// Returns the name of this grid interface - /// - /// A string containing the grid interface - public string getName() - { - return "SQLite OpenGridData"; - } - - /// - /// Returns the version of this grid interface - /// - /// A string containing the version - public string getVersion() - { - return "0.1"; - } - - /// - /// Returns a list of regions within the specified ranges - /// - /// minimum X coordinate - /// minimum Y coordinate - /// maximum X coordinate - /// maximum Y coordinate - /// An array of region profiles - public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d) - { - return null; - } - - /// - /// Returns a sim profile from it's location - /// - /// Region location handle - /// Sim profile - public SimProfileData GetProfileByHandle(ulong handle) - { - Dictionary param = new Dictionary(); - param["handle"] = handle.ToString(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - SimProfileData row = database.getRow(reader); - reader.Close(); - result.Dispose(); - - return row; - } - - /// - /// Returns a sim profile from it's UUID - /// - /// The region UUID - /// The sim profile - public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid) - { - Dictionary param = new Dictionary(); - param["uuid"] = uuid.ToStringHyphenated(); - - System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param); - System.Data.IDataReader reader = result.ExecuteReader(); - - SimProfileData row = database.getRow(reader); - reader.Close(); - result.Dispose(); - - return row; - } - - /// - /// Adds a new specified region to the database - /// - /// The profile to add - /// A dataresponse enum indicating success - public DataResponse AddProfile(SimProfileData profile) - { - if (database.insertRow(profile)) - { - return DataResponse.RESPONSE_OK; - } - else - { - return DataResponse.RESPONSE_ERROR; - } - } - - /// - /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. - /// - /// The UUID of the challenger - /// The attempted regionHandle of the challenger - /// The secret - /// Whether the secret and regionhandle match the database entry for UUID - public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey) - { - bool throwHissyFit = false; // Should be true by 1.0 - - if (throwHissyFit) - throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); - - SimProfileData data = GetProfileByLLUUID(uuid); - - return (handle == data.regionHandle && authkey == data.regionSecret); - } - - /// - /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region - /// - /// This requires a security audit. - /// - /// - /// - /// - /// - public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge) - { - System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed(); - System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding(); - - byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); - byte[] hash = HashProvider.ComputeHash(stream); - - return false; - } - } - - -} diff --git a/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteManager.cs b/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteManager.cs deleted file mode 100644 index 9689356..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteManager.cs +++ /dev/null @@ -1,209 +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.Data; - -using System.Data.SQLite; - -using OpenGrid.Framework.Data; - -namespace OpenGrid.Framework.Data.SQLite -{ - class SQLiteManager - { - IDbConnection dbcon; - - /// - /// Initialises and creates a new SQLite connection and maintains it. - /// - /// The SQLite server being connected to - /// The name of the SQLite database being used - /// The username logging into the database - /// The password for the user logging in - /// Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'. - public SQLiteManager(string hostname, string database, string username, string password, string cpooling) - { - try - { - string connectionString = "URI=file:GridServerSqlite.db;"; - dbcon = new SQLiteConnection(connectionString); - - dbcon.Open(); - } - catch (Exception e) - { - throw new Exception("Error initialising SQLite Database: " + e.ToString()); - } - } - - /// - /// Shuts down the database connection - /// - public void Close() - { - dbcon.Close(); - dbcon = null; - } - - /// - /// Runs a query with protection against SQL Injection by using parameterised input. - /// - /// The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y - /// The parameters - index so that @y is indexed as 'y' - /// A SQLite DB Command - public IDbCommand Query(string sql, Dictionary parameters) - { - SQLiteCommand dbcommand = (SQLiteCommand)dbcon.CreateCommand(); - dbcommand.CommandText = sql; - foreach (KeyValuePair param in parameters) - { - SQLiteParameter paramx = new SQLiteParameter(param.Key,param.Value); - dbcommand.Parameters.Add(paramx); - } - - return (IDbCommand)dbcommand; - } - - /// - /// Reads a region row from a database reader - /// - /// An active database reader - /// A region profile - public SimProfileData getRow(IDataReader reader) - { - SimProfileData retval = new SimProfileData(); - - if (reader.Read()) - { - // Region Main - retval.regionHandle = (ulong)reader["regionHandle"]; - retval.regionName = (string)reader["regionName"]; - retval.UUID = new libsecondlife.LLUUID((string)reader["uuid"]); - - // Secrets - retval.regionRecvKey = (string)reader["regionRecvKey"]; - retval.regionSecret = (string)reader["regionSecret"]; - retval.regionSendKey = (string)reader["regionSendKey"]; - - // Region Server - retval.regionDataURI = (string)reader["regionDataURI"]; - retval.regionOnline = false; // Needs to be pinged before this can be set. - retval.serverIP = (string)reader["serverIP"]; - retval.serverPort = (uint)reader["serverPort"]; - retval.serverURI = (string)reader["serverURI"]; - - // Location - retval.regionLocX = (uint)((int)reader["locX"]); - retval.regionLocY = (uint)((int)reader["locY"]); - retval.regionLocZ = (uint)((int)reader["locZ"]); - - // Neighbours - 0 = No Override - retval.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"]; - retval.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"]; - retval.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"]; - retval.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"]; - - // Assets - retval.regionAssetURI = (string)reader["regionAssetURI"]; - retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"]; - retval.regionAssetSendKey = (string)reader["regionAssetSendKey"]; - - // Userserver - retval.regionUserURI = (string)reader["regionUserURI"]; - retval.regionUserRecvKey = (string)reader["regionUserRecvKey"]; - retval.regionUserSendKey = (string)reader["regionUserSendKey"]; - } - else - { - throw new Exception("No rows to return"); - } - return retval; - } - - /// - /// Inserts a new region into the database - /// - /// The region to insert - /// Success? - public bool insertRow(SimProfileData profile) - { - string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; - sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; - sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES "; - - sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, "; - sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, "; - sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);"; - - Dictionary parameters = new Dictionary(); - - parameters["regionHandle"] = profile.regionHandle.ToString(); - parameters["regionName"] = profile.regionName; - parameters["uuid"] = profile.UUID.ToString(); - parameters["regionRecvKey"] = profile.regionRecvKey; - parameters["regionSendKey"] = profile.regionSendKey; - parameters["regionDataURI"] = profile.regionDataURI; - parameters["serverIP"] = profile.serverIP; - parameters["serverPort"] = profile.serverPort.ToString(); - parameters["serverURI"] = profile.serverURI; - parameters["locX"] = profile.regionLocX.ToString(); - parameters["locY"] = profile.regionLocY.ToString(); - parameters["locZ"] = profile.regionLocZ.ToString(); - parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString(); - parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString(); - parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString(); - parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString(); - parameters["regionAssetURI"] = profile.regionAssetURI; - parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey; - parameters["regionAssetSendKey"] = profile.regionAssetSendKey; - parameters["regionUserURI"] = profile.regionUserURI; - parameters["regionUserRecvKey"] = profile.regionUserRecvKey; - parameters["regionUserSendKey"] = profile.regionUserSendKey; - - bool returnval = false; - - try - { - IDbCommand result = Query(sql, parameters); - - if (result.ExecuteNonQuery() == 1) - returnval = true; - - result.Dispose(); - } - catch (Exception e) - { - return false; - } - - return returnval; - } - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data/GridData.cs b/OpenGridServices/OpenGrid.Framework.Data/GridData.cs deleted file mode 100644 index e9fb215..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data/GridData.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.Text; - -namespace OpenGrid.Framework.Data -{ - public enum DataResponse - { - RESPONSE_OK, - RESPONSE_AUTHREQUIRED, - RESPONSE_INVALIDCREDENTIALS, - RESPONSE_ERROR - } - - /// - /// A standard grid interface - /// - public interface IGridData - { - /// - /// Returns a sim profile from a regionHandle - /// - /// A 64bit Region Handle - /// A simprofile - SimProfileData GetProfileByHandle(ulong regionHandle); - - /// - /// Returns a sim profile from a UUID - /// - /// A 128bit UUID - /// A sim profile - SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID UUID); - - /// - /// Returns all profiles within the specified range - /// - /// Minimum sim coordinate (X) - /// Minimum sim coordinate (Y) - /// Maximum sim coordinate (X) - /// Maximum sim coordinate (Y) - /// An array containing all the sim profiles in the specified range - SimProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax); - - /// - /// Authenticates a sim by use of it's recv key. - /// WARNING: Insecure - /// - /// The UUID sent by the sim - /// The regionhandle sent by the sim - /// The recieving key sent by the sim - /// Whether the sim has been authenticated - bool AuthenticateSim(libsecondlife.LLUUID UUID, ulong regionHandle, string simrecvkey); - - /// - /// Initialises the interface - /// - void Initialise(); - - /// - /// Closes the interface - /// - void Close(); - - /// - /// The plugin being loaded - /// - /// A string containing the plugin name - string getName(); - - /// - /// The plugins version - /// - /// A string containing the plugin version - string getVersion(); - - /// - /// Adds a new profile to the database - /// - /// The profile to add - /// RESPONSE_OK if successful, error if not. - DataResponse AddProfile(SimProfileData profile); - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data/ILogData.cs b/OpenGridServices/OpenGrid.Framework.Data/ILogData.cs deleted file mode 100644 index 2ac0bfe..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data/ILogData.cs +++ /dev/null @@ -1,94 +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 OpenGrid.Framework.Data -{ - /// - /// The severity of an individual log message - /// - public enum LogSeverity : int - { - /// - /// Critical: systems failure - /// - CRITICAL = 1, - /// - /// Major: warning prior to systems failure - /// - MAJOR = 2, - /// - /// Medium: an individual non-critical task failed - /// - MEDIUM = 3, - /// - /// Low: Informational warning - /// - LOW = 4, - /// - /// Info: Information - /// - INFO = 5, - /// - /// Verbose: Debug Information - /// - VERBOSE = 6 - } - - /// - /// An interface to a LogData storage system - /// - public interface ILogData - { - void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority,string logMessage); - /// - /// Initialises the interface - /// - void Initialise(); - - /// - /// Closes the interface - /// - void Close(); - - /// - /// The plugin being loaded - /// - /// A string containing the plugin name - string getName(); - - /// - /// The plugins version - /// - /// A string containing the plugin version - string getVersion(); - } - -} diff --git a/OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs b/OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs deleted file mode 100644 index d17afac..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs +++ /dev/null @@ -1,100 +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.IO; -using System.Text.RegularExpressions; - -/* - Taken from public code listing at by Alex Pinsker - http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html - */ - -namespace OpenGrid.Framework.Data -{ - /// - /// Parse settings from ini-like files - /// - public class IniFile - { - static IniFile() - { - _iniKeyValuePatternRegex = new Regex( - @"((\s)*(?([^\=^\s^\n]+))[\s^\n]* - # key part (surrounding whitespace stripped) - \= - (\s)*(?([^\n^\s]+(\n){0,1}))) - # value part (surrounding whitespace stripped) - ", - RegexOptions.IgnorePatternWhitespace | - RegexOptions.Compiled | - RegexOptions.CultureInvariant); - } - static private Regex _iniKeyValuePatternRegex; - - public IniFile(string iniFileName) - { - _iniFileName = iniFileName; - } - - public string ParseFileReadValue(string key) - { - using (StreamReader reader = - new StreamReader(_iniFileName)) - { - do - { - string line = reader.ReadLine(); - Match match = - _iniKeyValuePatternRegex.Match(line); - if (match.Success) - { - string currentKey = - match.Groups["Key"].Value as string; - if (currentKey != null && - currentKey.Trim().CompareTo(key) == 0) - { - string value = - match.Groups["Value"].Value as string; - return value; - } - } - - } - while (reader.Peek() != -1); - } - return null; - } - - public string IniFileName - { - get { return _iniFileName; } - } private string _iniFileName; - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs b/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs deleted file mode 100644 index 12f559b..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs +++ /dev/null @@ -1,187 +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 OpenGrid.Framework.Data -{ - /// - /// Inventory Item - contains all the properties associated with an individual inventory piece. - /// - public class InventoryItemBase - { - /// - /// A UUID containing the ID for the inventory item itself - /// - public LLUUID inventoryID; - /// - /// The UUID of the associated asset on the asset server - /// - public LLUUID assetID; - /// - /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) - /// - public int type; - /// - /// The folder this item is contained in (NULL_KEY = Inventory Root) - /// - public LLUUID parentFolderID; - /// - /// The owner of this inventory item - /// - public LLUUID avatarID; - /// - /// The name of the inventory item (must be less than 64 characters) - /// - public string inventoryName; - /// - /// The description of the inventory item (must be less than 64 characters) - /// - public string inventoryDescription; - /// - /// A mask containing the permissions for the next owner (cannot be enforced) - /// - public uint inventoryNextPermissions; - /// - /// A mask containing permissions for the current owner (cannot be enforced) - /// - public uint inventoryCurrentPermissions; - } - - /// - /// A Class for folders which contain users inventory - /// - public class InventoryFolderBase - { - /// - /// The name of the folder (64 characters or less) - /// - public string name; - /// - /// The agent who's inventory this is contained by - /// - public LLUUID agentID; - /// - /// The folder this folder is contained in (NULL_KEY for root) - /// - public LLUUID parentID; - /// - /// The UUID for this folder - /// - public LLUUID folderID; - } - - /// - /// An interface for accessing inventory data from a storage server - /// - public interface IInventoryData - { - /// - /// Initialises the interface - /// - void Initialise(); - - /// - /// Closes the interface - /// - void Close(); - - /// - /// The plugin being loaded - /// - /// A string containing the plugin name - string getName(); - - /// - /// The plugins version - /// - /// A string containing the plugin version - string getVersion(); - - /// - /// Returns a list of inventory items contained within the specified folder - /// - /// The UUID of the target folder - /// A List of InventoryItemBase items - List getInventoryInFolder(LLUUID folderID); - - /// - /// Returns a list of folders in the users inventory root. - /// - /// The UUID of the user who is having inventory being returned - /// A list of folders - List getUserRootFolders(LLUUID user); - - /// - /// Returns a list of inventory folders contained in the folder 'parentID' - /// - /// The folder to get subfolders for - /// A list of inventory folders - List getInventoryFolders(LLUUID parentID); - - /// - /// Returns an inventory item by its UUID - /// - /// The UUID of the item to be returned - /// A class containing item information - InventoryItemBase getInventoryItem(LLUUID item); - - /// - /// Returns a specified inventory folder by its UUID - /// - /// The UUID of the folder to be returned - /// A class containing folder information - InventoryFolderBase getInventoryFolder(LLUUID folder); - - /// - /// Creates a new inventory item based on item - /// - /// The item to be created - void addInventoryItem(InventoryItemBase item); - - /// - /// Updates an inventory item with item (updates based on ID) - /// - /// The updated item - void updateInventoryItem(InventoryItemBase item); - - /// - /// Adds a new folder specified by folder - /// - /// The inventory folder - void addInventoryFolder(InventoryFolderBase folder); - - /// - /// Updates a folder based on its ID with folder - /// - /// The inventory folder - void updateInventoryFolder(InventoryFolderBase folder); - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj deleted file mode 100644 index 0b53b02..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj +++ /dev/null @@ -1,113 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {62CDF671-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGrid.Framework.Data - JScript - Grid - IE50 - false - Library - - OpenGrid.Framework.Data - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - ..\..\bin\libsecondlife.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build deleted file mode 100644 index 7abebeb..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs deleted file mode 100644 index 1446673..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OpenGrid.Framework.Data")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenGrid.Framework.Data")] -[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("3a711c34-b0c0-4264-b0fe-f366eabf9d7b")] - -// 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/OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs b/OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs deleted file mode 100644 index a3e7cb7..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs +++ /dev/null @@ -1,114 +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 OpenGrid.Framework.Data -{ - /// - /// A class which contains information known to the grid server about a region - /// - public class SimProfileData - { - /// - /// The name of the region - /// - public string regionName = ""; - - /// - /// A 64-bit number combining map position into a (mostly) unique ID - /// - public ulong regionHandle; - - /// - /// OGS/OpenSim Specific ID for a region - /// - public libsecondlife.LLUUID UUID; - - /// - /// Coordinates of the region - /// - public uint regionLocX; - public uint regionLocY; - public uint regionLocZ; // Reserved (round-robin, layers, etc) - - /// - /// Authentication secrets - /// - /// Not very secure, needs improvement. - public string regionSendKey = ""; - public string regionRecvKey = ""; - public string regionSecret = ""; - - /// - /// Whether the region is online - /// - public bool regionOnline; - - /// - /// Information about the server that the region is currently hosted on - /// - public string serverIP = ""; - public uint serverPort; - public string serverURI = ""; - - /// - /// Set of optional overrides. Can be used to create non-eulicidean spaces. - /// - public ulong regionNorthOverrideHandle; - public ulong regionSouthOverrideHandle; - public ulong regionEastOverrideHandle; - public ulong regionWestOverrideHandle; - - /// - /// Optional: URI Location of the region database - /// - /// Used for floating sim pools where the region data is not nessecarily coupled to a specific server - public string regionDataURI = ""; - - /// - /// Region Asset Details - /// - public string regionAssetURI = ""; - public string regionAssetSendKey = ""; - public string regionAssetRecvKey = ""; - - /// - /// Region Userserver Details - /// - public string regionUserURI = ""; - public string regionUserSendKey = ""; - public string regionUserRecvKey = ""; - - /// - /// Region Map Texture Asset - /// - public libsecondlife.LLUUID regionMapTextureID = new libsecondlife.LLUUID("00000000-0000-0000-9999-000000000006"); - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data/UserData.cs b/OpenGridServices/OpenGrid.Framework.Data/UserData.cs deleted file mode 100644 index c2d5a72..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data/UserData.cs +++ /dev/null @@ -1,131 +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 OpenGrid.Framework.Data -{ - /// - /// An interface for connecting to user storage servers. - /// - public interface IUserData - { - /// - /// Returns a user profile from a database via their UUID - /// - /// The accounts UUID - /// The user data profile - UserProfileData getUserByUUID(LLUUID user); - - /// - /// Returns a users profile by searching their username - /// - /// The users username - /// The user data profile - UserProfileData getUserByName(string name); - - /// - /// Returns a users profile by searching their username parts - /// - /// Account firstname - /// Account lastname - /// The user data profile - UserProfileData getUserByName(string fname, string lname); - - /// - /// Returns the current agent for a user searching by it's UUID - /// - /// The users UUID - /// The current agent session - UserAgentData getAgentByUUID(LLUUID user); - - /// - /// Returns the current session agent for a user searching by username - /// - /// The users account name - /// The current agent session - UserAgentData getAgentByName(string name); - - /// - /// Returns the current session agent for a user searching by username parts - /// - /// The users first account name - /// The users account surname - /// The current agent session - UserAgentData getAgentByName(string fname, string lname); - - /// - /// Adds a new User profile to the database - /// - /// UserProfile to add - void addNewUserProfile(UserProfileData user); - - /// - /// Adds a new agent to the database - /// - /// The agent to add - void addNewUserAgent(UserAgentData agent); - - /// - /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES) - /// - /// The account to transfer from - /// The account to transfer to - /// The amount to transfer - /// Successful? - bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount); - - /// - /// Attempts to move inventory between accounts, if inventory is copyable it will be copied into the target account. - /// - /// User to transfer from - /// User to transfer to - /// Specified inventory item - /// Successful? - bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory); - - /// - /// Returns the plugin version - /// - /// Plugin version in MAJOR.MINOR.REVISION.BUILD format - string getVersion(); - - /// - /// Returns the plugin name - /// - /// Plugin name, eg MySQL User Provider - string getName(); - - /// - /// Initialises the plugin (artificial constructor) - /// - void Initialise(); - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs b/OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs deleted file mode 100644 index 82633e1..0000000 --- a/OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs +++ /dev/null @@ -1,182 +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 OpenGrid.Framework.Data -{ - /// - /// Information about a particular user known to the userserver - /// - public class UserProfileData - { - /// - /// The ID value for this user - /// - public LLUUID UUID; - - /// - /// The first component of a users account name - /// - public string username; - /// - /// The second component of a users account name - /// - public string surname; - - /// - /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) - /// - /// This is double MD5'd because the client sends an unsalted MD5 to the loginserver - public string passwordHash; - /// - /// The salt used for the users hash, should be 32 bytes or longer - /// - public string passwordSalt; - - /// - /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into - /// - public ulong homeRegion; - /// - /// The coordinates inside the region of the home location - /// - public LLVector3 homeLocation; - /// - /// Where the user will be looking when they rez. - /// - public LLVector3 homeLookAt; - - /// - /// A UNIX Timestamp (seconds since epoch) for the users creation - /// - public int created; - /// - /// A UNIX Timestamp for the users last login date / time - /// - public int lastLogin; - - /// - /// A URI to the users inventory server, used for foreigners and large grids - /// - public string userInventoryURI; - /// - /// A URI to the users asset server, used for foreigners and large grids. - /// - public string userAssetURI; - - /// - /// A uint mask containing the "I can do" fields of the users profile - /// - public uint profileCanDoMask; - /// - /// A uint mask containing the "I want to do" part of the users profile - /// - public uint profileWantDoMask; // Profile window "I want to" mask - - /// - /// The about text listed in a users profile. - /// - public string profileAboutText; - /// - /// The first life about text listed in a users profile - /// - public string profileFirstText; - - /// - /// The profile image for an avatar stored on the asset server - /// - public LLUUID profileImage; - /// - /// The profile image for the users first life tab - /// - public LLUUID profileFirstImage; - /// - /// The users last registered agent (filled in on the user server) - /// - public UserAgentData currentAgent; - } - - /// - /// Information about a users session - /// - public class UserAgentData - { - /// - /// The UUID of the users avatar (not the agent!) - /// - public LLUUID UUID; - /// - /// The IP address of the user - /// - public string agentIP; - /// - /// The port of the user - /// - public uint agentPort; - /// - /// Is the user online? - /// - public bool agentOnline; - /// - /// The session ID for the user (also the agent ID) - /// - public LLUUID sessionID; - /// - /// The "secure" session ID for the user - /// - /// Not very secure. Dont rely on it for anything more than Linden Lab does. - public LLUUID secureSessionID; - /// - /// The region the user logged into initially - /// - public LLUUID regionID; - /// - /// A unix timestamp from when the user logged in - /// - public int loginTime; - /// - /// When this agent expired and logged out, 0 if still online - /// - public int logoutTime; - /// - /// Current region the user is logged into - /// - public LLUUID currentRegion; - /// - /// Region handle of the current region the user is in - /// - public ulong currentHandle; - /// - /// The position of the user within the region - /// - public LLVector3 currentPos; - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Manager/GridManagementAgent.cs b/OpenGridServices/OpenGrid.Framework.Manager/GridManagementAgent.cs deleted file mode 100644 index dfc572a..0000000 --- a/OpenGridServices/OpenGrid.Framework.Manager/GridManagementAgent.cs +++ /dev/null @@ -1,140 +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 OpenSim.Framework; -using OpenSim.Servers; -using System.Collections; -using System.Collections.Generic; -using libsecondlife; - -namespace OpenGrid.Framework.Manager -{ - /// - /// Used to pass messages to the gridserver - /// - /// Pass this argument - public delegate void GridManagerCallback(string param); - - /// - /// Serverside listener for grid commands - /// - public class GridManagementAgent - { - /// - /// Passes grid server messages - /// - private GridManagerCallback thecallback; - - /// - /// Security keys - /// - private string sendkey; - private string recvkey; - - /// - /// Our component type - /// - private string component_type; - - /// - /// List of active sessions - /// - private static ArrayList Sessions; - - /// - /// Initialises a new GridManagementAgent - /// - /// HTTP Daemon for this server - /// What component type are we? - /// Security send key - /// Security recieve key - /// Message callback - public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback) - { - this.sendkey = sendkey; - this.recvkey = recvkey; - this.component_type = component_type; - this.thecallback = thecallback; - Sessions = new ArrayList(); - - app_httpd.AddXmlRPCHandler("manager_login", XmlRpcLoginMethod); - - switch (component_type) - { - case "gridserver": - GridServerManager.sendkey = this.sendkey; - GridServerManager.recvkey = this.recvkey; - GridServerManager.thecallback = thecallback; - app_httpd.AddXmlRPCHandler("shutdown", GridServerManager.XmlRpcShutdownMethod); - break; - } - } - - /// - /// Checks if a session exists - /// - /// The session ID - /// Exists? - public static bool SessionExists(LLUUID sessionID) - { - return Sessions.Contains(sessionID); - } - - /// - /// Logs a new session to the grid manager - /// - /// the XMLRPC request - /// An XMLRPC reply - public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable requestData = (Hashtable)request.Params[0]; - Hashtable responseData = new Hashtable(); - - // TODO: Switch this over to using OpenGrid.Framework.Data - if (requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret")) - { - response.IsFault = false; - LLUUID new_session = LLUUID.Random(); - Sessions.Add(new_session); - responseData["session_id"] = new_session.ToString(); - responseData["msg"] = "Login OK"; - } - else - { - response.IsFault = true; - responseData["error"] = "Invalid username or password"; - } - - response.Value = responseData; - return response; - - } - - } -} diff --git a/OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs b/OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs deleted file mode 100644 index d665ab4..0000000 --- a/OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs +++ /dev/null @@ -1,94 +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 Nwc.XmlRpc; -using System.Threading; -using libsecondlife; - -namespace OpenGrid.Framework.Manager { - - /// - /// A remote management system for the grid server - /// - public class GridServerManager - { - /// - /// Triggers events from the grid manager - /// - public static GridManagerCallback thecallback; - - /// - /// Security keys - /// - public static string sendkey; - public static string recvkey; - - /// - /// Disconnects the grid server and shuts it down - /// - /// XmlRpc Request - /// An XmlRpc response containing either a "msg" or an "error" - public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request) - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable requestData = (Hashtable)request.Params[0]; - Hashtable responseData = new Hashtable(); - - if(requestData.ContainsKey("session_id")) { - if(GridManagementAgent.SessionExists(new LLUUID((string)requestData["session_id"]))) { - responseData["msg"]="Shutdown command accepted"; - (new Thread(new ThreadStart(ShutdownServer))).Start(); - } else { - response.IsFault=true; - responseData["error"]="bad session ID"; - } - } else { - response.IsFault=true; - responseData["error"]="no session ID"; - } - - response.Value = responseData; - return response; - } - - /// - /// Shuts down the grid server - /// - public static void ShutdownServer() - { - Console.WriteLine("Shutting down the grid server - recieved a grid manager request"); - Console.WriteLine("Terminating in three seconds..."); - Thread.Sleep(3000); - thecallback("shutdown"); - } - } -} - diff --git a/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj b/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj deleted file mode 100644 index 83ba00f..0000000 --- a/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {7924FD35-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGrid.Framework.Manager - JScript - Grid - IE50 - false - Library - - OpenGrid.Framework.Manager - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - ..\..\bin\libsecondlife.dll - False - - - ..\..\bin\OpenSim.Framework.dll - False - - - ..\..\bin\OpenSim.Servers.dll - False - - - System.dll - False - - - XMLRPC.dll - False - - - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build b/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build deleted file mode 100644 index 9430ab9..0000000 --- a/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.AssetServer/AssetHttpServer.cs b/OpenGridServices/OpenGridServices.AssetServer/AssetHttpServer.cs deleted file mode 100644 index 6fc6bf8..0000000 --- a/OpenGridServices/OpenGridServices.AssetServer/AssetHttpServer.cs +++ /dev/null @@ -1,130 +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; -using OpenSim.Servers; - -namespace OpenGridServices.AssetServer -{ - /// - /// An HTTP server for sending assets - /// - public class AssetHttpServer :BaseHttpServer - { - /// - /// Creates the new asset server - /// - /// Port to initalise on - public AssetHttpServer(int port) - : base(port) - { - } - - /// - /// Handles an HTTP request - /// - /// HTTP State Info - public override void HandleRequest(Object stateinfo) - { - try - { - HttpListenerContext context = (HttpListenerContext)stateinfo; - - HttpListenerRequest request = context.Request; - HttpListenerResponse response = context.Response; - - response.KeepAlive = false; - response.SendChunked = false; - - System.IO.Stream body = request.InputStream; - System.Text.Encoding encoding = System.Text.Encoding.UTF8; - System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding); - - string requestBody = reader.ReadToEnd(); - body.Close(); - reader.Close(); - - //Console.WriteLine(request.HttpMethod + " " + request.RawUrl + " Http/" + request.ProtocolVersion.ToString() + " content type: " + request.ContentType); - //Console.WriteLine(requestBody); - - string responseString = ""; - switch (request.ContentType) - { - case "text/xml": - // must be XML-RPC, so pass to the XML-RPC parser - - responseString = ParseXMLRPC(requestBody); - responseString = Regex.Replace(responseString, "utf-16", "utf-8"); - - response.AddHeader("Content-type", "text/xml"); - break; - - case "application/xml": - // probably LLSD we hope, otherwise it should be ignored by the parser - responseString = ParseLLSDXML(requestBody); - response.AddHeader("Content-type", "application/xml"); - break; - - case "application/x-www-form-urlencoded": - // a form data POST so send to the REST parser - responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); - response.AddHeader("Content-type", "text/plain"); - break; - - case null: - // must be REST or invalid crap, so pass to the REST parser - responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); - response.AddHeader("Content-type", "text/plain"); - break; - - } - - Encoding Windows1252Encoding = Encoding.GetEncoding(1252); - byte[] buffer = Windows1252Encoding.GetBytes(responseString); - System.IO.Stream output = response.OutputStream; - response.SendChunked = false; - response.ContentLength64 = buffer.Length; - output.Write(buffer, 0, buffer.Length); - output.Close(); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - } - - } -} diff --git a/OpenGridServices/OpenGridServices.AssetServer/Main.cs b/OpenGridServices/OpenGridServices.AssetServer/Main.cs deleted file mode 100644 index e9b94ea..0000000 --- a/OpenGridServices/OpenGridServices.AssetServer/Main.cs +++ /dev/null @@ -1,338 +0,0 @@ -/* -* Copyright (c) Contributors, http://www.openmetaverse.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ - -using System; -using System.IO; -using System.Text; -using System.Timers; -using System.Net; -using System.Reflection; -using System.Threading; -using libsecondlife; -using OpenSim.Framework; -using OpenSim.Framework.Sims; -using OpenSim.Framework.Console; -using OpenSim.Framework.Types; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; -using OpenSim.GridInterfaces.Local; // REFACTORING IS NEEDED!!!!!!!!!!! -using OpenSim.Servers; -using Db4objects.Db4o; -using Db4objects.Db4o.Query; - -namespace OpenGridServices.AssetServer -{ - /// - /// An asset server - /// - public class OpenAsset_Main : BaseServer, conscmd_callback - { - private IObjectContainer db; - - public static OpenAsset_Main assetserver; - - private ConsoleBase m_console; - - [STAThread] - public static void Main(string[] args) - { - Console.WriteLine("Starting...\n"); - - assetserver = new OpenAsset_Main(); - assetserver.Startup(); - - assetserver.Work(); - } - - private void Work() - { - m_console.Notice("Enter help for a list of commands"); - - while (true) - { - m_console.MainConsolePrompt(); - } - } - - private OpenAsset_Main() - { - m_console = new ConsoleBase("opengrid-AssetServer-console.log", "OpenAsset", this, false); - MainConsole.Instance = m_console; - } - - public void Startup() - { - m_console.Verbose( "Main.cs:Startup() - Setting up asset DB"); - setupDB(); - - m_console.Verbose( "Main.cs:Startup() - Starting HTTP process"); - AssetHttpServer httpServer = new AssetHttpServer(8003); - - - httpServer.AddRestHandler("GET", "/assets/", this.assetGetMethod); - httpServer.AddRestHandler("POST", "/assets/", this.assetPostMethod); - - httpServer.Start(); - - } - - public string assetPostMethod(string requestBody, string path, string param) - { - AssetBase asset = new AssetBase(); - asset.Name = ""; - asset.FullID = new LLUUID(param); - Encoding Windows1252Encoding = Encoding.GetEncoding(1252); - byte[] buffer = Windows1252Encoding.GetBytes(requestBody); - asset.Data = buffer; - AssetStorage store = new AssetStorage(); - store.Data = asset.Data; - store.Name = asset.Name; - store.UUID = asset.FullID; - db.Set(store); - db.Commit(); - return ""; - } - - public string assetGetMethod(string request, string path, string param) - { - Console.WriteLine("got a request " + param); - byte[] assetdata = getAssetData(new LLUUID(param), false); - if (assetdata != null) - { - Encoding Windows1252Encoding = Encoding.GetEncoding(1252); - string ret = Windows1252Encoding.GetString(assetdata); - //string ret = System.Text.Encoding.Unicode.GetString(assetdata); - - return ret; - - } - else - { - return ""; - } - - } - - public byte[] getAssetData(LLUUID assetID, bool isTexture) - { - bool found = false; - AssetStorage foundAsset = null; - - IObjectSet result = db.Get(new AssetStorage(assetID)); - if (result.Count > 0) - { - foundAsset = (AssetStorage)result.Next(); - found = true; - } - - if (found) - { - return foundAsset.Data; - } - else - { - return null; - } - } - - public void setupDB() - { - bool yapfile = System.IO.File.Exists("assets.yap"); - try - { - db = Db4oFactory.OpenFile("assets.yap"); - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Main.cs:setupDB() - creation"); - } - catch (Exception e) - { - db.Close(); - OpenSim.Framework.Console.MainConsole.Instance.Warn("Main.cs:setupDB() - Exception occured"); - OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); - } - if (!yapfile) - { - this.LoadDB(); - } - } - - public void LoadDB() - { - try - { - - Console.WriteLine("setting up Asset database"); - - AssetBase Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001"); - Image.Name = "Bricks"; - this.LoadAsset(Image, true, "bricks.jp2"); - AssetStorage store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000002"); - Image.Name = "Plywood"; - this.LoadAsset(Image, true, "plywood.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000003"); - Image.Name = "Rocks"; - this.LoadAsset(Image, true, "rocks.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000004"); - Image.Name = "Granite"; - this.LoadAsset(Image, true, "granite.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000005"); - Image.Name = "Hardwood"; - this.LoadAsset(Image, true, "hardwood.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-5005-000000000005"); - Image.Name = "Prim Base Texture"; - this.LoadAsset(Image, true, "plywood.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); - Image.Name = "Shape"; - this.LoadAsset(Image, false, "base_shape.dat"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - } - catch (Exception e) - { - Console.WriteLine(e.Message); - } - } - - private void LoadAsset(AssetBase info, bool image, string filename) - { - - - string dataPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder; - string fileName = Path.Combine(dataPath, filename); - FileInfo fInfo = new FileInfo(fileName); - long numBytes = fInfo.Length; - FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); - byte[] idata = new byte[numBytes]; - BinaryReader br = new BinaryReader(fStream); - idata = br.ReadBytes((int)numBytes); - br.Close(); - fStream.Close(); - info.Data = idata; - //info.loaded=true; - } - - /*private GridConfig LoadConfigDll(string dllName) - { - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - GridConfig config = null; - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IGridConfig", true); - - if (typeInterface != null) - { - IGridConfig plug = (IGridConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - config = plug.GetConfigObject(); - break; - } - - typeInterface = null; - } - } - } - pluginAssembly = null; - return config; - }*/ - - public void RunCmd(string cmd, string[] cmdparams) - { - switch (cmd) - { - case "help": - m_console.Notice("shutdown - shutdown this asset server (USE CAUTION!)"); - break; - - case "shutdown": - m_console.Close(); - Environment.Exit(0); - break; - } - } - - public void Show(string ShowWhat) - { - } - } -} diff --git a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj deleted file mode 100644 index 50ffb36..0000000 --- a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {0021261B-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGridServices.AssetServer - JScript - Grid - IE50 - false - Exe - - OpenGridServices.AssetServer - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - ..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - OpenSim.GridInterfaces.Local.dll - False - - - OpenSim.Servers.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - XMLRPC.dll - False - - - - - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build deleted file mode 100644 index 808f015..0000000 --- a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj deleted file mode 100644 index 9b8cc87..0000000 --- a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {21BFC8E2-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGridServices.GridServer - JScript - Grid - IE50 - false - Exe - - OpenGridServices.GridServer - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\bin\ - False - False - False - 4 - - - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - ..\bin\libsecondlife.dll - False - - - ..\bin\Db4objects.Db4o.dll - False - - - - - OpenSim.Framework - {8ACA2445-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Framework.Console - {A7CD0630-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Servers - {8BB20F0A-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - XMLRPC - {8E81D43C-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build deleted file mode 100644 index 6bef534..0000000 --- a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.AssetServer/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGridServices.AssetServer/Properties/AssemblyInfo.cs deleted file mode 100644 index 7014284..0000000 --- a/OpenGridServices/OpenGridServices.AssetServer/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("OGS-AssetServer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OGS-AssetServer")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b541b244-3d1d-4625-9003-bc2a3a6a39a4")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenGridServices/OpenGridServices.GridServer/GridManager.cs b/OpenGridServices/OpenGridServices.GridServer/GridManager.cs deleted file mode 100644 index 45d3676..0000000 --- a/OpenGridServices/OpenGridServices.GridServer/GridManager.cs +++ /dev/null @@ -1,589 +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 System.Reflection; -using OpenGrid.Framework.Data; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Console; -using OpenSim.Framework.Sims; -using libsecondlife; -using Nwc.XmlRpc; -using System.Xml; - -namespace OpenGridServices.GridServer -{ - class GridManager - { - Dictionary _plugins = new Dictionary(); - Dictionary _logplugins = new Dictionary(); - - public OpenSim.Framework.Interfaces.GridConfig config; - - /// - /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded. - /// - /// The filename to the grid server plugin DLL - public void AddPlugin(string FileName) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Storage: Attempting to load " + FileName); - Assembly pluginAssembly = Assembly.LoadFrom(FileName); - - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (!pluginType.IsAbstract) - { - // Regions go here - Type typeInterface = pluginType.GetInterface("IGridData", true); - - if (typeInterface != null) - { - IGridData plug = (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(); - this._plugins.Add(plug.getName(), plug); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Storage: Added IGridData Interface"); - } - - typeInterface = null; - - // Logs go here - typeInterface = pluginType.GetInterface("ILogData", true); - - if (typeInterface != null) - { - ILogData plug = (ILogData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(); - this._logplugins.Add(plug.getName(), plug); - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Storage: Added ILogData Interface"); - } - - typeInterface = null; - } - } - - pluginAssembly = null; - } - - /// - /// Logs a piece of information to the database - /// - /// What you were operating on (in grid server, this will likely be the region UUIDs) - /// Which method is being called? - /// What arguments are being passed? - /// How high priority is this? 1 = Max, 6 = Verbose - /// The message to log - private void logToDB(string target, string method, string args, int priority, string message) - { - foreach (KeyValuePair kvp in _logplugins) - { - try - { - kvp.Value.saveLog("Gridserver", target, method, args, priority, message); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Warn("Storage: unable to write log via " + kvp.Key); - } - } - } - - /// - /// Returns a region by argument - /// - /// A UUID key of the region to return - /// A SimProfileData for the region - public SimProfileData getRegion(libsecondlife.LLUUID uuid) - { - foreach(KeyValuePair kvp in _plugins) { - try - { - return kvp.Value.GetProfileByLLUUID(uuid); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Warn("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key); - } - } - return null; - } - - /// - /// Returns a region by argument - /// - /// A regionHandle of the region to return - /// A SimProfileData for the region - public SimProfileData getRegion(ulong handle) - { - foreach (KeyValuePair kvp in _plugins) - { - try - { - return kvp.Value.GetProfileByHandle(handle); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Warn("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key); - } - } - return null; - } - - public Dictionary getRegions(uint xmin, uint ymin, uint xmax, uint ymax) - { - Dictionary regions = new Dictionary(); - - SimProfileData[] neighbours; - - foreach (KeyValuePair kvp in _plugins) - { - try - { - neighbours = kvp.Value.GetProfilesInRange(xmin, ymin, xmax, ymax); - foreach (SimProfileData neighbour in neighbours) - { - regions[neighbour.regionHandle] = neighbour; - } - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Warn("Storage: Unable to query regionblock via " + kvp.Key); - } - } - - return regions; - } - - /// - /// Returns a XML String containing a list of the neighbouring regions - /// - /// The regionhandle for the center sim - /// An XML string containing neighbour entities - public string GetXMLNeighbours(ulong reqhandle) - { - string response = ""; - SimProfileData central_region = getRegion(reqhandle); - SimProfileData neighbour; - for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++) - { - if (getRegion(Util.UIntsToLong((uint)((central_region.regionLocX + x) * 256), (uint)(central_region.regionLocY + y) * 256)) != null) - { - neighbour = getRegion(Util.UIntsToLong((uint)((central_region.regionLocX + x) * 256), (uint)(central_region.regionLocY + y) * 256)); - response += ""; - response += "" + neighbour.serverIP + ""; - response += "" + neighbour.serverPort.ToString() + ""; - response += "" + neighbour.regionLocX.ToString() + ""; - response += "" + neighbour.regionLocY.ToString() + ""; - response += "" + neighbour.regionHandle.ToString() + ""; - response += ""; - - } - } - return response; - } - - /// - /// Performed when a region connects to the grid server initially. - /// - /// The XMLRPC Request - /// Startup parameters - public XmlRpcResponse XmlRpcLoginToSimulatorMethod(XmlRpcRequest request) - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable responseData = new Hashtable(); - response.Value = responseData; - - SimProfileData TheSim = null; - Hashtable requestData = (Hashtable)request.Params[0]; - - if (requestData.ContainsKey("UUID")) - { - TheSim = getRegion(new LLUUID((string)requestData["UUID"])); - logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcLoginToSimulatorMethod","", 5,"Region attempting login with UUID."); - } - else if (requestData.ContainsKey("region_handle")) - { - TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"])); - logToDB((string)requestData["region_handle"], "XmlRpcLoginToSimulatorMethod", "", 5, "Region attempting login with regionHandle."); - } - else - { - responseData["error"] = "No UUID or region_handle passed to grid server - unable to connect you"; - return response; - } - - if (TheSim == null) - { - responseData["error"] = "sim not found"; - return response; - } - else - { - - ArrayList SimNeighboursData = new ArrayList(); - - SimProfileData neighbour; - Hashtable NeighbourBlock; - - bool fastMode = false; // Only compatible with MySQL right now - - if (fastMode) - { - Dictionary neighbours = getRegions(TheSim.regionLocX - 1, TheSim.regionLocY - 1, TheSim.regionLocX + 1, TheSim.regionLocY + 1); - - foreach (KeyValuePair aSim in neighbours) - { - NeighbourBlock = new Hashtable(); - NeighbourBlock["sim_ip"] = aSim.Value.serverIP.ToString(); - NeighbourBlock["sim_port"] = aSim.Value.serverPort.ToString(); - NeighbourBlock["region_locx"] = aSim.Value.regionLocX.ToString(); - NeighbourBlock["region_locy"] = aSim.Value.regionLocY.ToString(); - NeighbourBlock["UUID"] = aSim.Value.UUID.ToString(); - - if (aSim.Value.UUID != TheSim.UUID) - SimNeighboursData.Add(NeighbourBlock); - } - } - else - { - for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++) - { - if (getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)) != null) - { - neighbour = getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)); - - NeighbourBlock = new Hashtable(); - NeighbourBlock["sim_ip"] = neighbour.serverIP; - NeighbourBlock["sim_port"] = neighbour.serverPort.ToString(); - NeighbourBlock["region_locx"] = neighbour.regionLocX.ToString(); - NeighbourBlock["region_locy"] = neighbour.regionLocY.ToString(); - NeighbourBlock["UUID"] = neighbour.UUID.ToString(); - - if (neighbour.UUID != TheSim.UUID) SimNeighboursData.Add(NeighbourBlock); - } - } - } - - responseData["UUID"] = TheSim.UUID.ToString(); - responseData["region_locx"] = TheSim.regionLocX.ToString(); - responseData["region_locy"] = TheSim.regionLocY.ToString(); - responseData["regionname"] = TheSim.regionName; - responseData["estate_id"] = "1"; - responseData["neighbours"] = SimNeighboursData; - - responseData["sim_ip"] = TheSim.serverIP; - responseData["sim_port"] = TheSim.serverPort.ToString(); - responseData["asset_url"] = TheSim.regionAssetURI; - responseData["asset_sendkey"] = TheSim.regionAssetSendKey; - responseData["asset_recvkey"] = TheSim.regionAssetRecvKey; - responseData["user_url"] = TheSim.regionUserURI; - responseData["user_sendkey"] = TheSim.regionUserSendKey; - responseData["user_recvkey"] = TheSim.regionUserRecvKey; - responseData["authkey"] = TheSim.regionSecret; - - // New! If set, use as URL to local sim storage (ie http://remotehost/region.yap) - responseData["data_uri"] = TheSim.regionDataURI; - } - - return response; - } - - public XmlRpcResponse XmlRpcMapBlockMethod(XmlRpcRequest request) - { - int xmin=980, ymin=980, xmax=1020, ymax=1020; - - Hashtable requestData = (Hashtable)request.Params[0]; - if (requestData.ContainsKey("xmin")) - { - xmin = (Int32)requestData["xmin"]; - } - if (requestData.ContainsKey("ymin")) - { - ymin = (Int32)requestData["ymin"]; - } - if (requestData.ContainsKey("xmax")) - { - xmax = (Int32)requestData["xmax"]; - } - if (requestData.ContainsKey("ymax")) - { - ymax = (Int32)requestData["ymax"]; - } - - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable responseData = new Hashtable(); - response.Value = responseData; - IList simProfileList = new ArrayList(); - - bool fastMode = true; // MySQL Only - - if (fastMode) - { - Dictionary neighbours = getRegions((uint)xmin, (uint)ymin, (uint)xmax, (uint)ymax); - - foreach (KeyValuePair aSim in neighbours) - { - Hashtable simProfileBlock = new Hashtable(); - simProfileBlock["x"] = aSim.Value.regionLocX.ToString(); - simProfileBlock["y"] = aSim.Value.regionLocY.ToString(); - simProfileBlock["name"] = aSim.Value.regionName; - simProfileBlock["access"] = 21; - simProfileBlock["region-flags"] = 512; - simProfileBlock["water-height"] = 0; - simProfileBlock["agents"] = 1; - simProfileBlock["map-image-id"] = aSim.Value.regionMapTextureID.ToString(); - - // For Sugilite compatibility - simProfileBlock["regionhandle"] = aSim.Value.regionHandle.ToString(); - simProfileBlock["sim_ip"] = aSim.Value.serverIP.ToString(); - simProfileBlock["sim_port"] = aSim.Value.serverPort.ToString(); - simProfileBlock["sim_uri"] = aSim.Value.serverURI.ToString(); - simProfileBlock["uuid"] = aSim.Value.UUID.ToStringHyphenated(); - - simProfileList.Add(simProfileBlock); - } - OpenSim.Framework.Console.MainConsole.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via FastMode"); - } - else - { - SimProfileData simProfile; - for (int x = xmin; x < xmax; x++) - { - for (int y = ymin; y < ymax; y++) - { - simProfile = getRegion(Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256))); - if (simProfile != null) - { - Hashtable simProfileBlock = new Hashtable(); - simProfileBlock["x"] = x; - simProfileBlock["y"] = y; - simProfileBlock["name"] = simProfile.regionName; - simProfileBlock["access"] = 0; - simProfileBlock["region-flags"] = 0; - simProfileBlock["water-height"] = 20; - simProfileBlock["agents"] = 1; - simProfileBlock["map-image-id"] = simProfile.regionMapTextureID.ToString(); - - // For Sugilite compatibility - simProfileBlock["regionhandle"] = simProfile.regionHandle.ToString(); - simProfileBlock["sim_ip"] = simProfile.serverIP.ToString(); - simProfileBlock["sim_port"] = simProfile.serverPort.ToString(); - simProfileBlock["sim_uri"] = simProfile.serverURI.ToString(); - simProfileBlock["uuid"] = simProfile.UUID.ToStringHyphenated(); - - simProfileList.Add(simProfileBlock); - } - } - } - OpenSim.Framework.Console.MainConsole.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via Standard Mode"); - } - - responseData["sim-profiles"] = simProfileList; - - return response; - } - - - - /// - /// Performs a REST Get Operation - /// - /// - /// - /// - /// - public string RestGetRegionMethod(string request, string path, string param) - { - return RestGetSimMethod("", "/sims/", param); - } - - /// - /// Performs a REST Set Operation - /// - /// - /// - /// - /// - public string RestSetRegionMethod(string request, string path, string param) - { - return RestSetSimMethod("", "/sims/", param); - } - - /// - /// Returns information about a sim via a REST Request - /// - /// - /// - /// - /// Information about the sim in XML - public string RestGetSimMethod(string request, string path, string param) - { - string respstring = String.Empty; - - SimProfileData TheSim; - LLUUID UUID = new LLUUID(param); - TheSim = getRegion(UUID); - - if (!(TheSim == null)) - { - respstring = ""; - respstring += "" + TheSim.regionSendKey + ""; - respstring += ""; - respstring += "" + TheSim.UUID.ToString() + ""; - respstring += "" + TheSim.regionName + ""; - respstring += "" + TheSim.serverIP + ""; - respstring += "" + TheSim.serverPort.ToString() + ""; - respstring += "" + TheSim.regionLocX.ToString() + ""; - respstring += "" + TheSim.regionLocY.ToString() + ""; - respstring += "1"; - respstring += ""; - respstring += ""; - } - - return respstring; - } - - /// - /// Creates or updates a sim via a REST Method Request - /// BROKEN with SQL Update - /// - /// - /// - /// - /// "OK" or an error - public string RestSetSimMethod(string request, string path, string param) - { - Console.WriteLine("Processing region update"); - SimProfileData TheSim; - TheSim = getRegion(new LLUUID(param)); - if ((TheSim) == null) - { - TheSim = new SimProfileData(); - LLUUID UUID = new LLUUID(param); - TheSim.UUID = UUID; - TheSim.regionRecvKey = config.SimRecvKey; - } - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(request); - XmlNode rootnode = doc.FirstChild; - XmlNode authkeynode = rootnode.ChildNodes[0]; - if (authkeynode.Name != "authkey") - { - return "ERROR! bad XML - expected authkey tag"; - } - - XmlNode simnode = rootnode.ChildNodes[1]; - if (simnode.Name != "sim") - { - return "ERROR! bad XML - expected sim tag"; - } - - if (authkeynode.InnerText != TheSim.regionRecvKey) - { - return "ERROR! invalid key"; - } - - //TheSim.regionSendKey = Cfg; - TheSim.regionRecvKey = config.SimRecvKey; - TheSim.regionSendKey = config.SimSendKey; - TheSim.regionSecret = config.SimRecvKey; - TheSim.regionDataURI = ""; - TheSim.regionAssetURI = config.DefaultAssetServer; - TheSim.regionAssetRecvKey = config.AssetRecvKey; - TheSim.regionAssetSendKey = config.AssetSendKey; - TheSim.regionUserURI = config.DefaultUserServer; - TheSim.regionUserSendKey = config.UserSendKey; - TheSim.regionUserRecvKey = config.UserRecvKey; - - - for (int i = 0; i < simnode.ChildNodes.Count; i++) - { - switch (simnode.ChildNodes[i].Name) - { - case "regionname": - TheSim.regionName = simnode.ChildNodes[i].InnerText; - break; - - case "sim_ip": - TheSim.serverIP = simnode.ChildNodes[i].InnerText; - break; - - case "sim_port": - TheSim.serverPort = Convert.ToUInt32(simnode.ChildNodes[i].InnerText); - break; - - case "region_locx": - TheSim.regionLocX = Convert.ToUInt32((string)simnode.ChildNodes[i].InnerText); - TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256)); - break; - - case "region_locy": - TheSim.regionLocY = Convert.ToUInt32((string)simnode.ChildNodes[i].InnerText); - TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256)); - break; - } - } - - TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; - - bool requirePublic = false; - - if (requirePublic && (TheSim.serverIP.StartsWith("172.16") || TheSim.serverIP.StartsWith("192.168") || TheSim.serverIP.StartsWith("10.") || TheSim.serverIP.StartsWith("0.") || TheSim.serverIP.StartsWith("255."))) - { - return "ERROR! Servers must register with public addresses."; - } - - try - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Updating / adding via " + _plugins.Count + " storage provider(s) registered."); - foreach (KeyValuePair kvp in _plugins) - { - try - { - kvp.Value.AddProfile(TheSim); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("New sim added to grid (" + TheSim.regionName + ")"); - logToDB(TheSim.UUID.ToStringHyphenated(), "RestSetSimMethod", "", 5, "Region successfully updated and connected to grid."); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + e.ToString()); - } - } - return "OK"; - } - catch (Exception e) - { - return "ERROR! Could not save to database! (" + e.ToString() + ")"; - } - } - - } -} diff --git a/OpenGridServices/OpenGridServices.GridServer/Main.cs b/OpenGridServices/OpenGridServices.GridServer/Main.cs deleted file mode 100644 index 9a7eb00..0000000 --- a/OpenGridServices/OpenGridServices.GridServer/Main.cs +++ /dev/null @@ -1,271 +0,0 @@ -/* -* Copyright (c) Contributors, http://www.openmetaverse.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ - -using System; -using System.IO; -using System.Text; -using System.Timers; -using System.Net; -using System.Threading; -using System.Reflection; -using libsecondlife; -using OpenGrid.Framework.Manager; -using OpenSim.Framework; -using OpenSim.Framework.Sims; -using OpenSim.Framework.Console; -using OpenSim.Framework.Interfaces; -using OpenSim.Servers; -using OpenSim.GenericConfig; - -namespace OpenGridServices.GridServer -{ - /// - /// - public class OpenGrid_Main : BaseServer, conscmd_callback - { - private string ConfigDll = "OpenGrid.Config.GridConfigDb4o.dll"; - private string GridDll = "OpenGrid.Framework.Data.MySQL.dll"; - public GridConfig Cfg; - - public static OpenGrid_Main thegrid; - protected IGenericConfig localXMLConfig; - - public static bool setuponly; - - //public LLUUID highestUUID; - - // private SimProfileManager m_simProfileManager; - - private GridManager m_gridManager; - - private ConsoleBase m_console; - - [STAThread] - public static void Main(string[] args) - { - if (args.Length > 0) - { - if (args[0] == "-setuponly") setuponly = true; - } - Console.WriteLine("Starting...\n"); - - thegrid = new OpenGrid_Main(); - thegrid.Startup(); - - thegrid.Work(); - } - - private void Work() - { - while (true) - { - Thread.Sleep(5000); - // should flush the DB etc here - } - } - - private OpenGrid_Main() - { - m_console = new ConsoleBase("opengrid-gridserver-console.log", "OpenGrid", this, false); - MainConsole.Instance = m_console; - - - } - - public void managercallback(string cmd) - { - switch (cmd) - { - case "shutdown": - RunCmd("shutdown", new string[0]); - break; - } - } - - - public void Startup() - { - this.localXMLConfig = new XmlConfig("GridServerConfig.xml"); - this.localXMLConfig.LoadData(); - this.ConfigDB(this.localXMLConfig); - this.localXMLConfig.Close(); - - m_console.Verbose( "Main.cs:Startup() - Loading configuration"); - Cfg = this.LoadConfigDll(this.ConfigDll); - Cfg.InitConfig(); - if (setuponly) Environment.Exit(0); - - m_console.Verbose( "Main.cs:Startup() - Connecting to Storage Server"); - m_gridManager = new GridManager(); - m_gridManager.AddPlugin(GridDll); // Made of win - m_gridManager.config = Cfg; - - m_console.Verbose( "Main.cs:Startup() - Starting HTTP process"); - BaseHttpServer httpServer = new BaseHttpServer(8001); - //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); - - httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcLoginToSimulatorMethod); - httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod); - - httpServer.AddRestHandler("GET", "/sims/", m_gridManager.RestGetSimMethod); - httpServer.AddRestHandler("POST", "/sims/", m_gridManager.RestSetSimMethod); - httpServer.AddRestHandler("GET", "/regions/", m_gridManager.RestGetRegionMethod); - httpServer.AddRestHandler("POST", "/regions/", m_gridManager.RestSetRegionMethod); - - - // lbsa71 : This code snippet taken from old http server. - // I have no idea what this was supposed to do - looks like an infinite recursion to me. - // case "regions": - //// DIRTY HACK ALERT - //Console.Notice("/regions/ accessed"); - //TheSim = OpenGrid_Main.thegrid._regionmanager.GetProfileByHandle((ulong)Convert.ToUInt64(rest_params[1])); - //respstring = ParseREST("/regions/" + rest_params[1], requestBody, HTTPmethod); - //break; - - // lbsa71 : I guess these were never used? - //Listener.Prefixes.Add("http://+:8001/gods/"); - //Listener.Prefixes.Add("http://+:8001/highestuuid/"); - //Listener.Prefixes.Add("http://+:8001/uuidblocks/"); - - httpServer.Start(); - - m_console.Verbose( "Main.cs:Startup() - Starting sim status checker"); - - System.Timers.Timer simCheckTimer = new System.Timers.Timer(3600000 * 3); // 3 Hours between updates. - simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); - simCheckTimer.Enabled = true; - } - - private GridConfig LoadConfigDll(string dllName) - { - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - GridConfig config = null; - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IGridConfig", true); - - if (typeInterface != null) - { - IGridConfig plug = (IGridConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - config = plug.GetConfigObject(); - break; - } - - typeInterface = null; - } - } - } - pluginAssembly = null; - return config; - } - - public void CheckSims(object sender, ElapsedEventArgs e) - { - /* - foreach (SimProfileBase sim in m_simProfileManager.SimProfiles.Values) - { - string SimResponse = ""; - try - { - WebRequest CheckSim = WebRequest.Create("http://" + sim.sim_ip + ":" + sim.sim_port.ToString() + "/checkstatus/"); - CheckSim.Method = "GET"; - CheckSim.ContentType = "text/plaintext"; - CheckSim.ContentLength = 0; - - StreamWriter stOut = new StreamWriter(CheckSim.GetRequestStream(), System.Text.Encoding.ASCII); - stOut.Write(""); - stOut.Close(); - - StreamReader stIn = new StreamReader(CheckSim.GetResponse().GetResponseStream()); - SimResponse = stIn.ReadToEnd(); - stIn.Close(); - } - catch - { - } - - if (SimResponse == "OK") - { - m_simProfileManager.SimProfiles[sim.UUID].online = true; - } - else - { - m_simProfileManager.SimProfiles[sim.UUID].online = false; - } - } - */ - } - - public void RunCmd(string cmd, string[] cmdparams) - { - switch (cmd) - { - case "help": - m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); - break; - - case "shutdown": - m_console.Close(); - Environment.Exit(0); - break; - } - } - - public void Show(string ShowWhat) - { - } - - private void ConfigDB(IGenericConfig configData) - { - try - { - string attri = ""; - attri = configData.GetAttribute("DataBaseProvider"); - if (attri == "") - { - GridDll = "OpenGrid.Framework.Data.DB4o.dll"; - configData.SetAttribute("DataBaseProvider", "OpenGrid.Framework.Data.DB4o.dll"); - } - else - { - GridDll = attri; - } - configData.Commit(); - } - catch (Exception e) - { - - } - } - } -} diff --git a/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj b/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj deleted file mode 100644 index 55a0e02..0000000 --- a/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj +++ /dev/null @@ -1,134 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {21BFC8E2-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGridServices.GridServer - JScript - Grid - IE50 - false - Exe - - OpenGridServices.GridServer - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - ..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - OpenSim.GenericConfig.Xml.dll - False - - - OpenSim.Servers.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - XMLRPC.dll - False - - - - - OpenGrid.Framework.Data - {62CDF671-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenGrid.Framework.Manager - {7924FD35-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build b/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build deleted file mode 100644 index 60c0f85..0000000 --- a/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.GridServer/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGridServices.GridServer/Properties/AssemblyInfo.cs deleted file mode 100644 index 8471e6b..0000000 --- a/OpenGridServices/OpenGridServices.GridServer/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("OGS-GridServer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OGS-GridServer")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b541b244-3d1d-4625-9003-bc2a3a6a39a4")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenGridServices/OpenGridServices.InventoryServer/InventoryManager.cs b/OpenGridServices/OpenGridServices.InventoryServer/InventoryManager.cs deleted file mode 100644 index 928e7c6..0000000 --- a/OpenGridServices/OpenGridServices.InventoryServer/InventoryManager.cs +++ /dev/null @@ -1,126 +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 OpenGrid.Framework.Data; -using libsecondlife; -using System.Reflection; - -using System.Xml; -using Nwc.XmlRpc; -using OpenSim.Framework.Sims; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; - -using System.Security.Cryptography; - -namespace OpenGridServices.InventoryServer -{ - class InventoryManager - { - Dictionary _plugins = new Dictionary(); - - /// - /// Adds a new inventory server plugin - user servers will be requested in the order they were loaded. - /// - /// The filename to the inventory server plugin DLL - public void AddPlugin(string FileName) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Attempting to load " + FileName); - Assembly pluginAssembly = Assembly.LoadFrom(FileName); - - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IInventoryData", true); - - if (typeInterface != null) - { - IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(); - this._plugins.Add(plug.getName(), plug); - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Added IUserData Interface"); - } - - typeInterface = null; - } - } - - pluginAssembly = null; - } - - public List getRootFolders(LLUUID user) - { - foreach (KeyValuePair kvp in _plugins) - { - try - { - return kvp.Value.getUserRootFolders(user); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Notice("Unable to get root folders via " + kvp.Key + " (" + e.ToString() + ")"); - } - } - return null; - } - - public XmlRpcResponse XmlRpcInventoryRequest(XmlRpcRequest request) - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable requestData = (Hashtable)request.Params[0]; - - Hashtable responseData = new Hashtable(); - - // Stuff happens here - - if (requestData.ContainsKey("Access-type")) - { - if (requestData["access-type"] == "rootfolders") - { - -// responseData["rootfolders"] = - } - } - else - { - responseData["error"] = "No access-type specified."; - } - - - // Stuff stops happening here - - response.Value = responseData; - return response; - } - } -} diff --git a/OpenGridServices/OpenGridServices.InventoryServer/Main.cs b/OpenGridServices/OpenGridServices.InventoryServer/Main.cs deleted file mode 100644 index f479a79..0000000 --- a/OpenGridServices/OpenGridServices.InventoryServer/Main.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. -* -*/ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using System.IO; -using System.Text; -using libsecondlife; -using OpenSim.Framework.User; -using OpenSim.Framework.Sims; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Console; -using OpenSim.Servers; -using OpenSim.Framework.Utilities; - -namespace OpenGridServices.InventoryServer -{ - public class OpenInventory_Main : BaseServer, conscmd_callback - { - ConsoleBase m_console; - InventoryManager m_inventoryManager; - - public static void Main(string[] args) - { - } - - public OpenInventory_Main() - { - m_console = new ConsoleBase("opengrid-inventory-console.log", "OpenInventory", this, false); - MainConsole.Instance = m_console; - } - - public void Startup() - { - MainConsole.Instance.Notice("Initialising inventory manager..."); - m_inventoryManager = new InventoryManager(); - - MainConsole.Instance.Notice("Starting HTTP server"); - BaseHttpServer httpServer = new BaseHttpServer(8004); - - httpServer.AddXmlRPCHandler("rootfolders", m_inventoryManager.XmlRpcInventoryRequest); - //httpServer.AddRestHandler("GET","/rootfolders/",Rest - } - - public void RunCmd(string cmd, string[] cmdparams) - { - switch (cmd) - { - case "shutdown": - m_console.Close(); - Environment.Exit(0); - break; - } - } - - public void Show(string ShowWhat) - { - } - } -} diff --git a/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj b/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj deleted file mode 100644 index b5a25bf..0000000 --- a/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj +++ /dev/null @@ -1,125 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {338FA00B-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGridServices.InventoryServer - JScript - Grid - IE50 - false - Exe - - OpenGridServices.InventoryServer - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - ..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - OpenSim.GridInterfaces.Local.dll - False - - - OpenSim.Servers.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - XMLRPC.dll - False - - - - - OpenGrid.Framework.Data - {62CDF671-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj.user b/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj.user deleted file mode 100644 index 179959e..0000000 --- a/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - Debug - AnyCPU - E:\work\oslauth\sim\trunk\bin\ - 8.0.50727 - ProjectFiles - 0 - - - - diff --git a/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.exe.build b/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.exe.build deleted file mode 100644 index 5e67af1..0000000 --- a/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.exe.build +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.mds b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.mds deleted file mode 100644 index ed7bc24..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.mds +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.userprefs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.userprefs deleted file mode 100644 index f221509..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.userprefs +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.usertasks b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.usertasks deleted file mode 100644 index d887d0e..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.usertasks +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/AssemblyInfo.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/AssemblyInfo.cs deleted file mode 100644 index af4e275..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/AssemblyInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following -// attributes. -// -// change them to the information which is associated with the assembly -// you compile. - -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("1.0.*")] - -// The following attributes specify the key for the sign of your assembly. See the -// .NET Framework documentation for more information about signing. -// This is not required, if you don't want signing let these attributes like they're. -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/BlockingQueue.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/BlockingQueue.cs deleted file mode 100644 index 83685fc..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/BlockingQueue.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Threading; -using System.Collections.Generic; -using System.Text; - -namespace OpenGridServices.Manager -{ - public class BlockingQueue - { - private Queue _queue = new Queue(); - private object _queueSync = new object(); - - public void Enqueue(T value) - { - lock (_queueSync) - { - _queue.Enqueue(value); - Monitor.Pulse(_queueSync); - } - } - - public T Dequeue() - { - lock (_queueSync) - { - if (_queue.Count < 1) - Monitor.Wait(_queueSync); - - return _queue.Dequeue(); - } - } - } -} diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Connect to grid server.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Connect to grid server.cs deleted file mode 100644 index 0d509ef..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Connect to grid server.cs +++ /dev/null @@ -1,16 +0,0 @@ - -using System; - -namespace OpenGridServices.Manager -{ - - - public partial class Connect to grid server : Gtk.Dialog - { - - public Connect to grid server() - { - this.Build(); - } - } -} diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs deleted file mode 100644 index 8a80b1d..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Gtk; -using System; - -namespace OpenGridServices.Manager { - public partial class ConnectToGridServerDialog : Gtk.Dialog - { - - public ConnectToGridServerDialog() - { - this.Build(); - } - - protected virtual void OnResponse(object o, Gtk.ResponseArgs args) - { - switch(args.ResponseId) { - case Gtk.ResponseType.Ok: - MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text); - break; - - case Gtk.ResponseType.Cancel: - break; - } - this.Hide(); - - } - - } - -} \ No newline at end of file diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs deleted file mode 100644 index 6b632d6..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs +++ /dev/null @@ -1,106 +0,0 @@ -using Nwc.XmlRpc; -using System; -using System.Net; -using System.IO; -using System.Xml; -using System.Collections; -using System.Collections.Generic; -using libsecondlife; - -namespace OpenGridServices.Manager -{ - public class GridServerConnectionManager - { - private string ServerURL; - public LLUUID SessionID; - public bool connected=false; - - public RegionBlock[][] WorldMap; - - public bool Connect(string GridServerURL, string username, string password) - { - try { - this.ServerURL=GridServerURL; - Hashtable LoginParamsHT = new Hashtable(); - LoginParamsHT["username"]=username; - LoginParamsHT["password"]=password; - ArrayList LoginParams = new ArrayList(); - LoginParams.Add(LoginParamsHT); - XmlRpcRequest GridLoginReq = new XmlRpcRequest("manager_login",LoginParams); - XmlRpcResponse GridResp = GridLoginReq.Send(ServerURL,3000); - if(GridResp.IsFault) { - connected=false; - return false; - } else { - Hashtable gridrespData = (Hashtable)GridResp.Value; - this.SessionID = new LLUUID((string)gridrespData["session_id"]); - connected=true; - return true; - } - } catch(Exception e) { - Console.WriteLine(e.ToString()); - connected=false; - return false; - } - } - - public void DownloadMap() - { - System.Net.WebClient mapdownloader = new WebClient(); - Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist"); - - RegionBlock TempRegionData; - - XmlDocument doc = new XmlDocument(); - doc.Load(regionliststream); - regionliststream.Close(); - XmlNode rootnode = doc.FirstChild; - if (rootnode.Name != "regions") - { - // TODO - ERROR! - } - - for(int i=0; i<=rootnode.ChildNodes.Count; i++) - { - if(rootnode.ChildNodes.Item(i).Name != "region") { - // TODO - ERROR! - } else { - TempRegionData = new RegionBlock(); - - - } - } - } - - public bool RestartServer() - { - return true; - } - - public bool ShutdownServer() - { - try { - Hashtable ShutdownParamsHT = new Hashtable(); - ArrayList ShutdownParams = new ArrayList(); - ShutdownParamsHT["session_id"]=this.SessionID.ToString(); - ShutdownParams.Add(ShutdownParamsHT); - XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams); - XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL,3000); - if(GridResp.IsFault) { - return false; - } else { - connected=false; - return true; - } - } catch(Exception e) { - Console.WriteLine(e.ToString()); - return false; - } - } - - public void DisconnectServer() - { - this.connected=false; - } - } -} diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs deleted file mode 100644 index 42e09e0..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs +++ /dev/null @@ -1,96 +0,0 @@ -// project created on 5/14/2007 at 2:04 PM -using System; -using System.Threading; -using Gtk; - -namespace OpenGridServices.Manager -{ - class MainClass - { - - public static bool QuitReq=false; - public static BlockingQueue PendingOperations = new BlockingQueue(); - - private static Thread OperationsRunner; - - private static GridServerConnectionManager gridserverConn; - - private static MainWindow win; - - public static void DoMainLoop() - { - while(!QuitReq) - { - Application.RunIteration(); - } - } - - public static void RunOperations() - { - string operation; - string cmd; - char[] sep = new char[1]; - sep[0]=' '; - while(!QuitReq) - { - operation=PendingOperations.Dequeue(); - Console.WriteLine(operation); - cmd = operation.Split(sep)[0]; - switch(cmd) { - case "connect_to_gridserver": - win.SetStatus("Connecting to grid server..."); - if(gridserverConn.Connect(operation.Split(sep)[1],operation.Split(sep)[2],operation.Split(sep)[3])) { - win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID); - win.SetGridServerConnected(true); - Thread.Sleep(3000); - win.SetStatus("Downloading region maps..."); - gridserverConn.DownloadMap(); - } else { - win.SetStatus("Could not connect"); - } - break; - - case "restart_gridserver": - win.SetStatus("Restarting grid server..."); - if(gridserverConn.RestartServer()) { - win.SetStatus("Restarted server OK"); - Thread.Sleep(3000); - win.SetStatus(""); - } else { - win.SetStatus("Error restarting grid server!!!"); - } - break; - - case "shutdown_gridserver": - win.SetStatus("Shutting down grid server..."); - if(gridserverConn.ShutdownServer()) { - win.SetStatus("Grid server shutdown"); - win.SetGridServerConnected(false); - Thread.Sleep(3000); - win.SetStatus(""); - } else { - win.SetStatus("Could not shutdown grid server!!!"); - } - break; - - case "disconnect_gridserver": - gridserverConn.DisconnectServer(); - win.SetGridServerConnected(false); - break; - } - } - } - - public static void Main (string[] args) - { - gridserverConn = new GridServerConnectionManager(); - Application.Init (); - win = new MainWindow (); - win.Show (); - OperationsRunner = new Thread(new ThreadStart(RunOperations)); - OperationsRunner.IsBackground=true; - OperationsRunner.Start(); - DoMainLoop(); - } - } -} \ No newline at end of file diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs deleted file mode 100644 index 1db38f0..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using Gtk; - -namespace OpenGridServices.Manager { - public partial class MainWindow: Gtk.Window - { - public MainWindow (): base (Gtk.WindowType.Toplevel) - { - Build (); - } - - public void SetStatus(string statustext) - { - this.statusbar1.Pop(0); - this.statusbar1.Push(0,statustext); - } - - public void DrawGrid(RegionBlock[][] regions) - { - for(int x=0; x<=regions.GetUpperBound(0); x++) { - for(int y=0; y<=regions.GetUpperBound(1); y++) { - Gdk.Image themap = new Gdk.Image(Gdk.ImageType.Fastest,Gdk.Visual.System,256,256); - this.drawingarea1.GdkWindow.DrawImage(new Gdk.GC(this.drawingarea1.GdkWindow),themap,0,0,x*256,y*256,256,256); - } - } - } - - public void SetGridServerConnected(bool connected) - { - if(connected) { - this.ConnectToGridserver.Visible=false; - this.DisconnectFromGridServer.Visible=true; - } else { - this.ConnectToGridserver.Visible=true; - this.DisconnectFromGridServer.Visible=false; - } - } - - protected void OnDeleteEvent (object sender, DeleteEventArgs a) - { - Application.Quit (); - MainClass.QuitReq=true; - a.RetVal = true; - } - - protected virtual void QuitMenu(object sender, System.EventArgs e) - { - MainClass.QuitReq=true; - Application.Quit(); - } - - protected virtual void ConnectToGridServerMenu(object sender, System.EventArgs e) - { - ConnectToGridServerDialog griddialog = new ConnectToGridServerDialog (); - griddialog.Show(); - } - - protected virtual void RestartGridserverMenu(object sender, System.EventArgs e) - { - MainClass.PendingOperations.Enqueue("restart_gridserver"); - } - - protected virtual void ShutdownGridserverMenu(object sender, System.EventArgs e) - { - MainClass.PendingOperations.Enqueue("shutdown_gridserver"); - } - - protected virtual void DisconnectGridServerMenu(object sender, System.EventArgs e) - { - MainClass.PendingOperations.Enqueue("disconnect_gridserver"); - } - - } -} - - \ No newline at end of file diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp deleted file mode 100644 index cfdc085..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.pidb b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.pidb deleted file mode 100644 index 44e7a61..0000000 Binary files a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.pidb and /dev/null differ diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/RegionBlock.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/RegionBlock.cs deleted file mode 100644 index 00f7c65..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/RegionBlock.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Xml; -using libsecondlife; -using OpenSim.Framework.Utilities; - -namespace OpenGridServices.Manager -{ - - - public class RegionBlock - { - public uint regloc_x; - public uint regloc_y; - - public string httpd_url; - - public string region_name; - - public ulong regionhandle { - get { return Util.UIntsToLong(regloc_x*256,regloc_y*256); } - } - - public Gdk.Pixbuf MiniMap; - - public RegionBlock() - { - } - - public void LoadFromXmlNode(XmlNode sourcenode) - { - this.regloc_x=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_x").Value); - this.regloc_y=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_y").Value); - this.region_name=sourcenode.Attributes.GetNamedItem("region_name").Value; - this.httpd_url=sourcenode.Attributes.GetNamedItem("httpd_url").Value; - } - } -} diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs deleted file mode 100644 index 5bf7ff9..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace OpenSim.Framework.Utilities -{ - public class Util - { - private static Random randomClass = new Random(); - private static uint nextXferID = 5000; - private static object XferLock = new object(); - - public static ulong UIntsToLong(uint X, uint Y) - { - return Helpers.UIntsToLong(X, Y); - } - - public static Random RandomClass - { - get - { - return randomClass; - } - } - - public static uint GetNextXferID() - { - uint id = 0; - lock(XferLock) - { - id = nextXferID; - nextXferID++; - } - return id; - } - - //public static int fast_distance2d(int x, int y) - //{ - // x = System.Math.Abs(x); - // y = System.Math.Abs(y); - - // int min = System.Math.Min(x, y); - - // return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); - //} - - public static string FieldToString(byte[] bytes) - { - return FieldToString(bytes, String.Empty); - } - - /// - /// Convert a variable length field (byte array) to a string, with a - /// field name prepended to each line of the output - /// - /// If the byte array has unprintable characters in it, a - /// hex dump will be put in the string instead - /// The byte array to convert to a string - /// A field name to prepend to each line of output - /// An ASCII string or a string containing a hex dump, minus - /// the null terminator - public static string FieldToString(byte[] bytes, string fieldName) - { - // Check for a common case - if (bytes.Length == 0) return String.Empty; - - StringBuilder output = new StringBuilder(); - bool printable = true; - - for (int i = 0; i < bytes.Length; ++i) - { - // Check if there are any unprintable characters in the array - if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09 - && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00) - { - printable = false; - break; - } - } - - if (printable) - { - if (fieldName.Length > 0) - { - output.Append(fieldName); - output.Append(": "); - } - - if (bytes[bytes.Length - 1] == 0x00) - output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1)); - else - output.Append(UTF8Encoding.UTF8.GetString(bytes)); - } - else - { - for (int i = 0; i < bytes.Length; i += 16) - { - if (i != 0) - output.Append(Environment.NewLine); - if (fieldName.Length > 0) - { - output.Append(fieldName); - output.Append(": "); - } - - for (int j = 0; j < 16; j++) - { - if ((i + j) < bytes.Length) - output.Append(String.Format("{0:X2} ", bytes[i + j])); - else - output.Append(" "); - } - - for (int j = 0; j < 16 && (i + j) < bytes.Length; j++) - { - if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E) - output.Append((char)bytes[i + j]); - else - output.Append("."); - } - } - } - - return output.ToString(); - } - public Util() - { - - } - } -} diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs deleted file mode 100644 index da6739e..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs +++ /dev/null @@ -1,226 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Mono Runtime Version: 2.0.50727.42 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -namespace OpenGridServices.Manager { - - - public partial class ConnectToGridServerDialog { - - private Gtk.VBox vbox2; - - private Gtk.VBox vbox3; - - private Gtk.HBox hbox1; - - private Gtk.Label label1; - - private Gtk.Entry entry1; - - private Gtk.HBox hbox2; - - private Gtk.Label label2; - - private Gtk.Entry entry2; - - private Gtk.HBox hbox3; - - private Gtk.Label label3; - - private Gtk.Entry entry3; - - private Gtk.Button button2; - - private Gtk.Button button8; - - protected virtual void Build() { - Stetic.Gui.Initialize(); - // Widget OpenGridServices.Manager.ConnectToGridServerDialog - this.Events = ((Gdk.EventMask)(256)); - this.Name = "OpenGridServices.Manager.ConnectToGridServerDialog"; - this.Title = Mono.Unix.Catalog.GetString("Connect to Grid server"); - this.WindowPosition = ((Gtk.WindowPosition)(4)); - this.HasSeparator = false; - // Internal child OpenGridServices.Manager.ConnectToGridServerDialog.VBox - Gtk.VBox w1 = this.VBox; - w1.Events = ((Gdk.EventMask)(256)); - w1.Name = "dialog_VBox"; - w1.BorderWidth = ((uint)(2)); - // Container child dialog_VBox.Gtk.Box+BoxChild - this.vbox2 = new Gtk.VBox(); - this.vbox2.Name = "vbox2"; - // Container child vbox2.Gtk.Box+BoxChild - this.vbox3 = new Gtk.VBox(); - this.vbox3.Name = "vbox3"; - // Container child vbox3.Gtk.Box+BoxChild - this.hbox1 = new Gtk.HBox(); - this.hbox1.Name = "hbox1"; - // Container child hbox1.Gtk.Box+BoxChild - this.label1 = new Gtk.Label(); - this.label1.Name = "label1"; - this.label1.Xalign = 1F; - this.label1.LabelProp = Mono.Unix.Catalog.GetString("Grid server URL: "); - this.label1.Justify = ((Gtk.Justification)(1)); - this.hbox1.Add(this.label1); - Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.label1])); - w2.Position = 0; - // Container child hbox1.Gtk.Box+BoxChild - this.entry1 = new Gtk.Entry(); - this.entry1.CanFocus = true; - this.entry1.Name = "entry1"; - this.entry1.Text = Mono.Unix.Catalog.GetString("http://gridserver:8001"); - this.entry1.IsEditable = true; - this.entry1.MaxLength = 255; - this.entry1.InvisibleChar = '•'; - this.hbox1.Add(this.entry1); - Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.hbox1[this.entry1])); - w3.Position = 1; - this.vbox3.Add(this.hbox1); - Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox1])); - w4.Position = 0; - w4.Expand = false; - w4.Fill = false; - // Container child vbox3.Gtk.Box+BoxChild - this.hbox2 = new Gtk.HBox(); - this.hbox2.Name = "hbox2"; - // Container child hbox2.Gtk.Box+BoxChild - this.label2 = new Gtk.Label(); - this.label2.Name = "label2"; - this.label2.Xalign = 1F; - this.label2.LabelProp = Mono.Unix.Catalog.GetString("Username:"); - this.label2.Justify = ((Gtk.Justification)(1)); - this.hbox2.Add(this.label2); - Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(this.hbox2[this.label2])); - w5.Position = 0; - // Container child hbox2.Gtk.Box+BoxChild - this.entry2 = new Gtk.Entry(); - this.entry2.CanFocus = true; - this.entry2.Name = "entry2"; - this.entry2.IsEditable = true; - this.entry2.InvisibleChar = '•'; - this.hbox2.Add(this.entry2); - Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.hbox2[this.entry2])); - w6.Position = 1; - this.vbox3.Add(this.hbox2); - Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox2])); - w7.Position = 1; - w7.Expand = false; - w7.Fill = false; - // Container child vbox3.Gtk.Box+BoxChild - this.hbox3 = new Gtk.HBox(); - this.hbox3.Name = "hbox3"; - // Container child hbox3.Gtk.Box+BoxChild - this.label3 = new Gtk.Label(); - this.label3.Name = "label3"; - this.label3.Xalign = 1F; - this.label3.LabelProp = Mono.Unix.Catalog.GetString("Password:"); - this.label3.Justify = ((Gtk.Justification)(1)); - this.hbox3.Add(this.label3); - Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.hbox3[this.label3])); - w8.Position = 0; - // Container child hbox3.Gtk.Box+BoxChild - this.entry3 = new Gtk.Entry(); - this.entry3.CanFocus = true; - this.entry3.Name = "entry3"; - this.entry3.IsEditable = true; - this.entry3.InvisibleChar = '•'; - this.hbox3.Add(this.entry3); - Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.hbox3[this.entry3])); - w9.Position = 1; - this.vbox3.Add(this.hbox3); - Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox3])); - w10.Position = 2; - w10.Expand = false; - w10.Fill = false; - this.vbox2.Add(this.vbox3); - Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(this.vbox2[this.vbox3])); - w11.Position = 2; - w11.Expand = false; - w11.Fill = false; - w1.Add(this.vbox2); - Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(w1[this.vbox2])); - w12.Position = 0; - // Internal child OpenGridServices.Manager.ConnectToGridServerDialog.ActionArea - Gtk.HButtonBox w13 = this.ActionArea; - w13.Events = ((Gdk.EventMask)(256)); - w13.Name = "OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea"; - w13.Spacing = 6; - w13.BorderWidth = ((uint)(5)); - w13.LayoutStyle = ((Gtk.ButtonBoxStyle)(4)); - // Container child OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.button2 = new Gtk.Button(); - this.button2.CanDefault = true; - this.button2.CanFocus = true; - this.button2.Name = "button2"; - this.button2.UseUnderline = true; - // Container child button2.Gtk.Container+ContainerChild - Gtk.Alignment w14 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F); - w14.Name = "GtkAlignment"; - // Container child GtkAlignment.Gtk.Container+ContainerChild - Gtk.HBox w15 = new Gtk.HBox(); - w15.Name = "GtkHBox"; - w15.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - Gtk.Image w16 = new Gtk.Image(); - w16.Name = "image1"; - w16.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-apply", 16, 0); - w15.Add(w16); - // Container child GtkHBox.Gtk.Container+ContainerChild - Gtk.Label w18 = new Gtk.Label(); - w18.Name = "GtkLabel"; - w18.LabelProp = Mono.Unix.Catalog.GetString("Connect"); - w18.UseUnderline = true; - w15.Add(w18); - w14.Add(w15); - this.button2.Add(w14); - this.AddActionWidget(this.button2, -5); - Gtk.ButtonBox.ButtonBoxChild w22 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.button2])); - w22.Expand = false; - w22.Fill = false; - // Container child OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.button8 = new Gtk.Button(); - this.button8.CanDefault = true; - this.button8.CanFocus = true; - this.button8.Name = "button8"; - this.button8.UseUnderline = true; - // Container child button8.Gtk.Container+ContainerChild - Gtk.Alignment w23 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F); - w23.Name = "GtkAlignment1"; - // Container child GtkAlignment1.Gtk.Container+ContainerChild - Gtk.HBox w24 = new Gtk.HBox(); - w24.Name = "GtkHBox1"; - w24.Spacing = 2; - // Container child GtkHBox1.Gtk.Container+ContainerChild - Gtk.Image w25 = new Gtk.Image(); - w25.Name = "image2"; - w25.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-cancel", 16, 0); - w24.Add(w25); - // Container child GtkHBox1.Gtk.Container+ContainerChild - Gtk.Label w27 = new Gtk.Label(); - w27.Name = "GtkLabel1"; - w27.LabelProp = Mono.Unix.Catalog.GetString("Cancel"); - w27.UseUnderline = true; - w24.Add(w27); - w23.Add(w24); - this.button8.Add(w23); - this.AddActionWidget(this.button8, -6); - Gtk.ButtonBox.ButtonBoxChild w31 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.button8])); - w31.Position = 1; - w31.Expand = false; - w31.Fill = false; - if ((this.Child != null)) { - this.Child.ShowAll(); - } - this.DefaultWidth = 476; - this.DefaultHeight = 137; - this.Show(); - this.Response += new Gtk.ResponseHandler(this.OnResponse); - } - } -} diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs deleted file mode 100644 index 8798dac..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs +++ /dev/null @@ -1,256 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Mono Runtime Version: 2.0.50727.42 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -namespace OpenGridServices.Manager { - - - public partial class MainWindow { - - private Gtk.Action Grid; - - private Gtk.Action User; - - private Gtk.Action Asset; - - private Gtk.Action Region; - - private Gtk.Action Services; - - private Gtk.Action ConnectToGridserver; - - private Gtk.Action RestartWholeGrid; - - private Gtk.Action ShutdownWholeGrid; - - private Gtk.Action ExitGridManager; - - private Gtk.Action ConnectToUserserver; - - private Gtk.Action AccountManagment; - - private Gtk.Action GlobalNotice; - - private Gtk.Action DisableAllLogins; - - private Gtk.Action DisableNonGodUsersOnly; - - private Gtk.Action ShutdownUserServer; - - private Gtk.Action ShutdownGridserverOnly; - - private Gtk.Action RestartGridserverOnly; - - private Gtk.Action DefaultLocalGridUserserver; - - private Gtk.Action CustomUserserver; - - private Gtk.Action RemoteGridDefaultUserserver; - - private Gtk.Action DisconnectFromGridServer; - - private Gtk.Action UploadAsset; - - private Gtk.Action AssetManagement; - - private Gtk.Action ConnectToAssetServer; - - private Gtk.Action ConnectToDefaultAssetServerForGrid; - - private Gtk.Action DefaultForLocalGrid; - - private Gtk.Action DefaultForRemoteGrid; - - private Gtk.Action CustomAssetServer; - - private Gtk.VBox vbox1; - - private Gtk.MenuBar menubar2; - - private Gtk.HBox hbox1; - - private Gtk.ScrolledWindow scrolledwindow1; - - private Gtk.DrawingArea drawingarea1; - - private Gtk.TreeView treeview1; - - private Gtk.Statusbar statusbar1; - - protected virtual void Build() { - Stetic.Gui.Initialize(); - // Widget OpenGridServices.Manager.MainWindow - Gtk.UIManager w1 = new Gtk.UIManager(); - Gtk.ActionGroup w2 = new Gtk.ActionGroup("Default"); - this.Grid = new Gtk.Action("Grid", Mono.Unix.Catalog.GetString("Grid"), null, null); - this.Grid.HideIfEmpty = false; - this.Grid.ShortLabel = Mono.Unix.Catalog.GetString("Grid"); - w2.Add(this.Grid, "g"); - this.User = new Gtk.Action("User", Mono.Unix.Catalog.GetString("User"), null, null); - this.User.HideIfEmpty = false; - this.User.ShortLabel = Mono.Unix.Catalog.GetString("User"); - w2.Add(this.User, null); - this.Asset = new Gtk.Action("Asset", Mono.Unix.Catalog.GetString("Asset"), null, null); - this.Asset.HideIfEmpty = false; - this.Asset.ShortLabel = Mono.Unix.Catalog.GetString("Asset"); - w2.Add(this.Asset, null); - this.Region = new Gtk.Action("Region", Mono.Unix.Catalog.GetString("Region"), null, null); - this.Region.ShortLabel = Mono.Unix.Catalog.GetString("Region"); - w2.Add(this.Region, null); - this.Services = new Gtk.Action("Services", Mono.Unix.Catalog.GetString("Services"), null, null); - this.Services.ShortLabel = Mono.Unix.Catalog.GetString("Services"); - w2.Add(this.Services, null); - this.ConnectToGridserver = new Gtk.Action("ConnectToGridserver", Mono.Unix.Catalog.GetString("Connect to gridserver..."), null, "gtk-connect"); - this.ConnectToGridserver.HideIfEmpty = false; - this.ConnectToGridserver.ShortLabel = Mono.Unix.Catalog.GetString("Connect to gridserver"); - w2.Add(this.ConnectToGridserver, null); - this.RestartWholeGrid = new Gtk.Action("RestartWholeGrid", Mono.Unix.Catalog.GetString("Restart whole grid"), null, "gtk-refresh"); - this.RestartWholeGrid.ShortLabel = Mono.Unix.Catalog.GetString("Restart whole grid"); - w2.Add(this.RestartWholeGrid, null); - this.ShutdownWholeGrid = new Gtk.Action("ShutdownWholeGrid", Mono.Unix.Catalog.GetString("Shutdown whole grid"), null, "gtk-stop"); - this.ShutdownWholeGrid.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown whole grid"); - w2.Add(this.ShutdownWholeGrid, null); - this.ExitGridManager = new Gtk.Action("ExitGridManager", Mono.Unix.Catalog.GetString("Exit grid manager"), null, "gtk-close"); - this.ExitGridManager.ShortLabel = Mono.Unix.Catalog.GetString("Exit grid manager"); - w2.Add(this.ExitGridManager, null); - this.ConnectToUserserver = new Gtk.Action("ConnectToUserserver", Mono.Unix.Catalog.GetString("Connect to userserver"), null, "gtk-connect"); - this.ConnectToUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Connect to userserver"); - w2.Add(this.ConnectToUserserver, null); - this.AccountManagment = new Gtk.Action("AccountManagment", Mono.Unix.Catalog.GetString("Account managment"), null, "gtk-properties"); - this.AccountManagment.ShortLabel = Mono.Unix.Catalog.GetString("Account managment"); - w2.Add(this.AccountManagment, null); - this.GlobalNotice = new Gtk.Action("GlobalNotice", Mono.Unix.Catalog.GetString("Global notice"), null, "gtk-network"); - this.GlobalNotice.ShortLabel = Mono.Unix.Catalog.GetString("Global notice"); - w2.Add(this.GlobalNotice, null); - this.DisableAllLogins = new Gtk.Action("DisableAllLogins", Mono.Unix.Catalog.GetString("Disable all logins"), null, "gtk-no"); - this.DisableAllLogins.ShortLabel = Mono.Unix.Catalog.GetString("Disable all logins"); - w2.Add(this.DisableAllLogins, null); - this.DisableNonGodUsersOnly = new Gtk.Action("DisableNonGodUsersOnly", Mono.Unix.Catalog.GetString("Disable non-god users only"), null, "gtk-no"); - this.DisableNonGodUsersOnly.ShortLabel = Mono.Unix.Catalog.GetString("Disable non-god users only"); - w2.Add(this.DisableNonGodUsersOnly, null); - this.ShutdownUserServer = new Gtk.Action("ShutdownUserServer", Mono.Unix.Catalog.GetString("Shutdown user server"), null, "gtk-stop"); - this.ShutdownUserServer.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown user server"); - w2.Add(this.ShutdownUserServer, null); - this.ShutdownGridserverOnly = new Gtk.Action("ShutdownGridserverOnly", Mono.Unix.Catalog.GetString("Shutdown gridserver only"), null, "gtk-stop"); - this.ShutdownGridserverOnly.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown gridserver only"); - w2.Add(this.ShutdownGridserverOnly, null); - this.RestartGridserverOnly = new Gtk.Action("RestartGridserverOnly", Mono.Unix.Catalog.GetString("Restart gridserver only"), null, "gtk-refresh"); - this.RestartGridserverOnly.ShortLabel = Mono.Unix.Catalog.GetString("Restart gridserver only"); - w2.Add(this.RestartGridserverOnly, null); - this.DefaultLocalGridUserserver = new Gtk.Action("DefaultLocalGridUserserver", Mono.Unix.Catalog.GetString("Default local grid userserver"), null, null); - this.DefaultLocalGridUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Default local grid userserver"); - w2.Add(this.DefaultLocalGridUserserver, null); - this.CustomUserserver = new Gtk.Action("CustomUserserver", Mono.Unix.Catalog.GetString("Custom userserver..."), null, null); - this.CustomUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Custom userserver"); - w2.Add(this.CustomUserserver, null); - this.RemoteGridDefaultUserserver = new Gtk.Action("RemoteGridDefaultUserserver", Mono.Unix.Catalog.GetString("Remote grid default userserver..."), null, null); - this.RemoteGridDefaultUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Remote grid default userserver"); - w2.Add(this.RemoteGridDefaultUserserver, null); - this.DisconnectFromGridServer = new Gtk.Action("DisconnectFromGridServer", Mono.Unix.Catalog.GetString("Disconnect from grid server"), null, "gtk-disconnect"); - this.DisconnectFromGridServer.ShortLabel = Mono.Unix.Catalog.GetString("Disconnect from grid server"); - this.DisconnectFromGridServer.Visible = false; - w2.Add(this.DisconnectFromGridServer, null); - this.UploadAsset = new Gtk.Action("UploadAsset", Mono.Unix.Catalog.GetString("Upload asset"), null, null); - this.UploadAsset.ShortLabel = Mono.Unix.Catalog.GetString("Upload asset"); - w2.Add(this.UploadAsset, null); - this.AssetManagement = new Gtk.Action("AssetManagement", Mono.Unix.Catalog.GetString("Asset management"), null, null); - this.AssetManagement.ShortLabel = Mono.Unix.Catalog.GetString("Asset management"); - w2.Add(this.AssetManagement, null); - this.ConnectToAssetServer = new Gtk.Action("ConnectToAssetServer", Mono.Unix.Catalog.GetString("Connect to asset server"), null, null); - this.ConnectToAssetServer.ShortLabel = Mono.Unix.Catalog.GetString("Connect to asset server"); - w2.Add(this.ConnectToAssetServer, null); - this.ConnectToDefaultAssetServerForGrid = new Gtk.Action("ConnectToDefaultAssetServerForGrid", Mono.Unix.Catalog.GetString("Connect to default asset server for grid"), null, null); - this.ConnectToDefaultAssetServerForGrid.ShortLabel = Mono.Unix.Catalog.GetString("Connect to default asset server for grid"); - w2.Add(this.ConnectToDefaultAssetServerForGrid, null); - this.DefaultForLocalGrid = new Gtk.Action("DefaultForLocalGrid", Mono.Unix.Catalog.GetString("Default for local grid"), null, null); - this.DefaultForLocalGrid.ShortLabel = Mono.Unix.Catalog.GetString("Default for local grid"); - w2.Add(this.DefaultForLocalGrid, null); - this.DefaultForRemoteGrid = new Gtk.Action("DefaultForRemoteGrid", Mono.Unix.Catalog.GetString("Default for remote grid..."), null, null); - this.DefaultForRemoteGrid.ShortLabel = Mono.Unix.Catalog.GetString("Default for remote grid..."); - w2.Add(this.DefaultForRemoteGrid, null); - this.CustomAssetServer = new Gtk.Action("CustomAssetServer", Mono.Unix.Catalog.GetString("Custom asset server..."), null, null); - this.CustomAssetServer.ShortLabel = Mono.Unix.Catalog.GetString("Custom asset server..."); - w2.Add(this.CustomAssetServer, null); - w1.InsertActionGroup(w2, 0); - this.AddAccelGroup(w1.AccelGroup); - this.WidthRequest = 800; - this.HeightRequest = 600; - this.Name = "OpenGridServices.Manager.MainWindow"; - this.Title = Mono.Unix.Catalog.GetString("Open Grid Services Manager"); - this.Icon = Gtk.IconTheme.Default.LoadIcon("gtk-network", 48, 0); - // Container child OpenGridServices.Manager.MainWindow.Gtk.Container+ContainerChild - this.vbox1 = new Gtk.VBox(); - this.vbox1.Name = "vbox1"; - // Container child vbox1.Gtk.Box+BoxChild - w1.AddUiFromString(""); - this.menubar2 = ((Gtk.MenuBar)(w1.GetWidget("/menubar2"))); - this.menubar2.HeightRequest = 25; - this.menubar2.Name = "menubar2"; - this.vbox1.Add(this.menubar2); - Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.vbox1[this.menubar2])); - w3.Position = 0; - w3.Expand = false; - w3.Fill = false; - // Container child vbox1.Gtk.Box+BoxChild - this.hbox1 = new Gtk.HBox(); - this.hbox1.Name = "hbox1"; - // Container child hbox1.Gtk.Box+BoxChild - this.scrolledwindow1 = new Gtk.ScrolledWindow(); - this.scrolledwindow1.CanFocus = true; - this.scrolledwindow1.Name = "scrolledwindow1"; - this.scrolledwindow1.VscrollbarPolicy = ((Gtk.PolicyType)(1)); - this.scrolledwindow1.HscrollbarPolicy = ((Gtk.PolicyType)(1)); - // Container child scrolledwindow1.Gtk.Container+ContainerChild - Gtk.Viewport w4 = new Gtk.Viewport(); - w4.Name = "GtkViewport"; - w4.ShadowType = ((Gtk.ShadowType)(0)); - // Container child GtkViewport.Gtk.Container+ContainerChild - this.drawingarea1 = new Gtk.DrawingArea(); - this.drawingarea1.Name = "drawingarea1"; - w4.Add(this.drawingarea1); - this.scrolledwindow1.Add(w4); - this.hbox1.Add(this.scrolledwindow1); - Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.hbox1[this.scrolledwindow1])); - w7.Position = 1; - // Container child hbox1.Gtk.Box+BoxChild - this.treeview1 = new Gtk.TreeView(); - this.treeview1.CanFocus = true; - this.treeview1.Name = "treeview1"; - this.hbox1.Add(this.treeview1); - Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.hbox1[this.treeview1])); - w8.Position = 2; - this.vbox1.Add(this.hbox1); - Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbox1])); - w9.Position = 1; - // Container child vbox1.Gtk.Box+BoxChild - this.statusbar1 = new Gtk.Statusbar(); - this.statusbar1.Name = "statusbar1"; - this.statusbar1.Spacing = 5; - this.vbox1.Add(this.statusbar1); - Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1])); - w10.PackType = ((Gtk.PackType)(1)); - w10.Position = 2; - w10.Expand = false; - w10.Fill = false; - this.Add(this.vbox1); - if ((this.Child != null)) { - this.Child.ShowAll(); - } - this.DefaultWidth = 800; - this.DefaultHeight = 800; - this.Show(); - this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent); - this.ConnectToGridserver.Activated += new System.EventHandler(this.ConnectToGridServerMenu); - this.ExitGridManager.Activated += new System.EventHandler(this.QuitMenu); - this.ShutdownGridserverOnly.Activated += new System.EventHandler(this.ShutdownGridserverMenu); - this.RestartGridserverOnly.Activated += new System.EventHandler(this.RestartGridserverMenu); - this.DisconnectFromGridServer.Activated += new System.EventHandler(this.DisconnectGridServerMenu); - } - } -} diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/generated.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/generated.cs deleted file mode 100644 index dd4abdd..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/generated.cs +++ /dev/null @@ -1,35 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Mono Runtime Version: 2.0.50727.42 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -namespace Stetic { - - - internal class Gui { - - private static bool initialized; - - internal static void Initialize() { - if ((Stetic.Gui.initialized == false)) { - Stetic.Gui.initialized = true; - } - } - } - - internal class ActionGroups { - - public static Gtk.ActionGroup GetActionGroup(System.Type type) { - return Stetic.ActionGroups.GetActionGroup(type.FullName); - } - - public static Gtk.ActionGroup GetActionGroup(string name) { - return null; - } - } -} diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic deleted file mode 100644 index c883f08..0000000 --- a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic +++ /dev/null @@ -1,502 +0,0 @@ - - - - - - Action - <Alt><Mod2>g - False - Grid - Grid - - - Action - False - User - User - - - Action - False - Asset - Asset - - - Action - Region - Region - - - Action - Services - Services - - - Action - False - Connect to gridserver... - Connect to gridserver - gtk-connect - - - - Action - Restart whole grid - Restart whole grid - gtk-refresh - - - Action - Shutdown whole grid - Shutdown whole grid - gtk-stop - - - Action - Exit grid manager - Exit grid manager - gtk-close - - - - Action - Connect to userserver - Connect to userserver - gtk-connect - - - Action - Account managment - Account managment - gtk-properties - - - Action - Global notice - Global notice - gtk-network - - - Action - Disable all logins - Disable all logins - gtk-no - - - Action - Disable non-god users only - Disable non-god users only - gtk-no - - - Action - Shutdown user server - Shutdown user server - gtk-stop - - - Action - Shutdown gridserver only - Shutdown gridserver only - gtk-stop - - - - Action - Restart gridserver only - Restart gridserver only - gtk-refresh - - - - Action - Default local grid userserver - Default local grid userserver - - - Action - Custom userserver... - Custom userserver - - - Action - Remote grid default userserver... - Remote grid default userserver - - - Action - Disconnect from grid server - Disconnect from grid server - gtk-disconnect - False - - - - Action - Upload asset - Upload asset - - - Action - Asset management - Asset management - - - Action - Connect to asset server - Connect to asset server - - - Action - Connect to default asset server for grid - Connect to default asset server for grid - - - Action - Default for local grid - Default for local grid - - - Action - Default for remote grid... - Default for remote grid... - - - Action - Custom asset server... - Custom asset server... - - - - 800 - 600 - Open Grid Services Manager - stock:gtk-network Dialog - - - - - - - - 25 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - False - False - False - - - - - - - - - - - - True - Automatic - Automatic - - - - None - - - - - - - - - - 1 - True - - - - - - True - - - 2 - True - - - - - 1 - True - - - - - statusBar1 - 5 - - - - - - - - - End - 2 - False - False - False - - - - - - - - ButtonPressMask - Connect to Grid server - CenterOnParent - 2 - False - False - - - - - ButtonPressMask - 2 - - - - - - - - - - - - - - - - - - - 1 - Grid server URL: - Right - - - 0 - False - - - - - - True - http://gridserver:8001 - True - 255 - • - - - 1 - False - - - - - - - - 0 - True - False - False - - - - - - - - - 1 - Username: - Right - - - 0 - False - - - - - - True - True - • - - - 1 - True - - - - - - - - 1 - False - False - False - - - - - - - - - 1 - Password: - Right - - - 0 - False - - - - - - True - True - • - - - 1 - True - - - - - - - - 2 - True - False - False - - - - - 2 - True - False - False - - - - - 0 - True - - - - - - - - ButtonPressMask - 6 - 5 - 2 - End - - - - True - True - TextAndIcon - stock:gtk-apply Menu - Connect - True - True - -5 - - - False - False - - - - - - True - True - TextAndIcon - stock:gtk-cancel Menu - Cancel - True - True - -6 - - - 1 - False - False - - - - - - \ No newline at end of file diff --git a/OpenGridServices/OpenGridServices.UserServer/Main.cs b/OpenGridServices/OpenGridServices.UserServer/Main.cs deleted file mode 100644 index bb20576..0000000 --- a/OpenGridServices/OpenGridServices.UserServer/Main.cs +++ /dev/null @@ -1,216 +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.Reflection; -using System.IO; -using System.Text; -using libsecondlife; -using OpenSim.Framework.User; -using OpenSim.Framework.Sims; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Console; -using OpenSim.Servers; -using OpenSim.Framework.Utilities; -using OpenSim.GenericConfig; - -namespace OpenGridServices.UserServer -{ - /// - /// - public class OpenUser_Main : BaseServer, conscmd_callback - { - private string ConfigDll = "OpenUser.Config.UserConfigDb4o.dll"; - private string StorageDll = "OpenGrid.Framework.Data.MySQL.dll"; - private UserConfig Cfg; - protected IGenericConfig localXMLConfig; - - public UserManager m_userManager; // Replaces below. - - //private UserProfileManager m_userProfileManager; // Depreciated - - public Dictionary UserSessions = new Dictionary(); - - ConsoleBase m_console; - - [STAThread] - public static void Main(string[] args) - { - Console.WriteLine("Starting...\n"); - - OpenUser_Main userserver = new OpenUser_Main(); - - userserver.Startup(); - userserver.Work(); - } - - private OpenUser_Main() - { - m_console = new ConsoleBase("opengrid-userserver-console.log", "OpenUser", this , false); - MainConsole.Instance = m_console; - } - - private void Work() - { - m_console.Notice("Enter help for a list of commands\n"); - - while (true) - { - m_console.MainConsolePrompt(); - } - } - - public void Startup() - { - this.localXMLConfig = new XmlConfig("UserServerConfig.xml"); - this.localXMLConfig.LoadData(); - this.ConfigDB(this.localXMLConfig); - this.localXMLConfig.Close(); - - MainConsole.Instance.Verbose("Main.cs:Startup() - Loading configuration"); - Cfg = this.LoadConfigDll(this.ConfigDll); - Cfg.InitConfig(); - - MainConsole.Instance.Verbose( "Main.cs:Startup() - Establishing data connection"); - m_userManager = new UserManager(); - m_userManager._config = Cfg; - m_userManager.AddPlugin(StorageDll); - - MainConsole.Instance.Verbose("Main.cs:Startup() - Starting HTTP process"); - BaseHttpServer httpServer = new BaseHttpServer(8002); - - httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod); - httpServer.AddRestHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod); - - httpServer.Start(); - } - - - public void do_create(string what) - { - switch (what) - { - case "user": - string tempfirstname; - string templastname; - string tempMD5Passwd; - uint regX = 997; - uint regY = 996; - - tempfirstname = m_console.CmdPrompt("First name"); - templastname = m_console.CmdPrompt("Last name"); - tempMD5Passwd = m_console.PasswdPrompt("Password"); - regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X")); - regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y")); - - tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + ""); - - m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); - break; - } - } - - public void RunCmd(string cmd, string[] cmdparams) - { - switch (cmd) - { - case "help": - m_console.Notice("create user - create a new user"); - m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); - break; - - case "create": - do_create(cmdparams[0]); - break; - - case "shutdown": - m_console.Close(); - Environment.Exit(0); - break; - } - } - - private void ConfigDB(IGenericConfig configData) - { - try - { - string attri = ""; - attri = configData.GetAttribute("DataBaseProvider"); - if (attri == "") - { - StorageDll = "OpenGrid.Framework.Data.DB4o.dll"; - configData.SetAttribute("DataBaseProvider", "OpenGrid.Framework.Data.DB4o.dll"); - } - else - { - StorageDll = attri; - } - configData.Commit(); - } - catch (Exception e) - { - - } - } - - private UserConfig LoadConfigDll(string dllName) - { - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - UserConfig config = null; - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IUserConfig", true); - - if (typeInterface != null) - { - IUserConfig plug = (IUserConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - config = plug.GetConfigObject(); - break; - } - - typeInterface = null; - } - } - } - pluginAssembly = null; - return config; - } - - public void Show(string ShowWhat) - { - } - } -} diff --git a/OpenGridServices/OpenGridServices.UserServer/OGS-UserServer.csproj b/OpenGridServices/OpenGridServices.UserServer/OGS-UserServer.csproj deleted file mode 100644 index f4fa8b6..0000000 --- a/OpenGridServices/OpenGridServices.UserServer/OGS-UserServer.csproj +++ /dev/null @@ -1,63 +0,0 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {D45B6E48-5668-478D-B9CB-6D46E665FACF} - Exe - Properties - OGS_UserServer - OGS-UserServer - OpenGridServices.OpenUser_Main - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\common\bin\libsecondlife.dll - - - - - - - - OGS-Console.cs - - - VersionInfo.cs - - - - - - - - - {2E46A825-3168-492F-93BC-637126B5B72B} - OpenSim.Framework - - - {7667E6E2-F227-41A2-B1B2-315613E1BAFC} - ServerConsole - - - - \ No newline at end of file diff --git a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj deleted file mode 100644 index b3d318c..0000000 --- a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj +++ /dev/null @@ -1,128 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {66591469-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenGridServices.UserServer - JScript - Grid - IE50 - false - Exe - - OpenGridServices.UserServer - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\bin\ - False - False - False - 4 - - - - - ..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - OpenSim.GenericConfig.Xml.dll - False - - - OpenSim.Servers.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Xml.dll - False - - - XMLRPC.dll - False - - - - - OpenGrid.Framework.Data - {62CDF671-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build deleted file mode 100644 index 68cbef7..0000000 --- a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/OpenGridServices.UserServer/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGridServices.UserServer/Properties/AssemblyInfo.cs deleted file mode 100644 index 5d5ce8d..0000000 --- a/OpenGridServices/OpenGridServices.UserServer/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("OGS-UserServer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OGS-UserServer")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("e266513a-090b-4d38-80f6-8599eef68c8c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs deleted file mode 100644 index 4fb7984..0000000 --- a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs +++ /dev/null @@ -1,660 +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 OpenGrid.Framework.Data; -using libsecondlife; -using System.Reflection; - -using System.Xml; -using Nwc.XmlRpc; -using OpenSim.Framework.Sims; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; - -using System.Security.Cryptography; - -namespace OpenGridServices.UserServer -{ - public class UserManager - { - public OpenSim.Framework.Interfaces.UserConfig _config; - Dictionary _plugins = new Dictionary(); - - /// - /// Adds a new user server plugin - user servers will be requested in the order they were loaded. - /// - /// The filename to the user server plugin DLL - public void AddPlugin(string FileName) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Userstorage: Attempting to load " + FileName); - Assembly pluginAssembly = Assembly.LoadFrom(FileName); - - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Userstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IUserData", true); - - if (typeInterface != null) - { - IUserData plug = (IUserData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(); - this._plugins.Add(plug.getName(), plug); - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Userstorage: Added IUserData Interface"); - } - - typeInterface = null; - } - } - - pluginAssembly = null; - } - - /// - /// - /// - /// - public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) - { - UserProfileData user = new UserProfileData(); - user.homeLocation = new LLVector3(128, 128, 100); - user.UUID = LLUUID.Random(); - user.username = firstName; - user.surname = lastName; - user.passwordHash = pass; - user.passwordSalt = ""; - user.created = Util.UnixTimeSinceEpoch(); - user.homeLookAt = new LLVector3(100, 100, 100); - user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256)); - - foreach (KeyValuePair plugin in _plugins) - { - try - { - plugin.Value.addNewUserProfile(user); - - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); - } - } - } - - /// - /// Loads a user profile from a database by UUID - /// - /// The target UUID - /// A user profile - public UserProfileData getUserProfile(LLUUID uuid) - { - foreach (KeyValuePair plugin in _plugins) - { - try - { - UserProfileData profile = plugin.Value.getUserByUUID(uuid); - profile.currentAgent = getUserAgent(profile.UUID); - return profile; - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); - } - } - - return null; - } - - - /// - /// Loads a user profile by name - /// - /// The target name - /// A user profile - public UserProfileData getUserProfile(string name) - { - foreach (KeyValuePair plugin in _plugins) - { - try - { - UserProfileData profile = plugin.Value.getUserByName(name); - profile.currentAgent = getUserAgent(profile.UUID); - return profile; - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); - } - } - - return null; - } - - /// - /// Loads a user profile by name - /// - /// First name - /// Last name - /// A user profile - public UserProfileData getUserProfile(string fname, string lname) - { - foreach (KeyValuePair plugin in _plugins) - { - try - { - UserProfileData profile = plugin.Value.getUserByName(fname,lname); - try - { - profile.currentAgent = getUserAgent(profile.UUID); - } - catch (Exception e) - { - // Ignore - } - return profile; - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); - } - } - - return null; - } - - /// - /// Loads a user agent by uuid (not called directly) - /// - /// The agents UUID - /// Agent profiles - public UserAgentData getUserAgent(LLUUID uuid) - { - foreach (KeyValuePair plugin in _plugins) - { - try - { - return plugin.Value.getAgentByUUID(uuid); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); - } - } - - return null; - } - - /// - /// Loads a user agent by name (not called directly) - /// - /// The agents name - /// A user agent - public UserAgentData getUserAgent(string name) - { - foreach (KeyValuePair plugin in _plugins) - { - try - { - return plugin.Value.getAgentByName(name); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); - } - } - - return null; - } - - /// - /// Loads a user agent by name (not called directly) - /// - /// The agents firstname - /// The agents lastname - /// A user agent - public UserAgentData getUserAgent(string fname, string lname) - { - foreach (KeyValuePair plugin in _plugins) - { - try - { - return plugin.Value.getAgentByName(fname,lname); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); - } - } - - return null; - } - - /// - /// Creates a error response caused by invalid XML - /// - /// An XMLRPC response - private static XmlRpcResponse CreateErrorConnectingToGridResponse() - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable ErrorRespData = new Hashtable(); - ErrorRespData["reason"] = "key"; - ErrorRespData["message"] = "Error connecting to grid. Could not percieve credentials from login XML."; - ErrorRespData["login"] = "false"; - response.Value = ErrorRespData; - return response; - } - - /// - /// Creates an error response caused by bad login credentials - /// - /// An XMLRPC response - private static XmlRpcResponse CreateLoginErrorResponse() - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable ErrorRespData = new Hashtable(); - ErrorRespData["reason"] = "key"; - ErrorRespData["message"] = "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist."; - ErrorRespData["login"] = "false"; - response.Value = ErrorRespData; - return response; - } - - /// - /// Creates an error response caused by being logged in already - /// - /// An XMLRPC 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; - } - - /// - /// Creates an error response caused by target region being down - /// - /// An XMLRPC Response - private static XmlRpcResponse CreateDeadRegionResponse() - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable PresenceErrorRespData = new Hashtable(); - PresenceErrorRespData["reason"] = "key"; - PresenceErrorRespData["message"] = "The region you are attempting to log into is not responding. Please select another region and try again."; - PresenceErrorRespData["login"] = "false"; - response.Value = PresenceErrorRespData; - return response; - } - - /// - /// Customises the login response and fills in missing values. - /// - /// The existing response - /// The user profile - public virtual void CustomiseResponse(ref Hashtable response, ref UserProfileData theUser) - { - // Load information from the gridserver - SimProfile SimInfo = new SimProfile(); - SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); - - // Customise the response - // Home Location - response["home"] = "{'region_handle':[r" + (SimInfo.RegionLocX * 256).ToString() + ",r" + (SimInfo.RegionLocY * 256).ToString() + "], " + - "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + - "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; - - // Destination - response["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; - - // Notify the target of an incoming user - Console.WriteLine("Notifying " + SimInfo.regionname + " (" + SimInfo.caps_url + ")"); - - // Prepare notification - Hashtable SimParams = new Hashtable(); - SimParams["session_id"] = theUser.currentAgent.sessionID.ToString(); - SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString(); - SimParams["firstname"] = theUser.username; - SimParams["lastname"] = theUser.surname; - SimParams["agent_id"] = theUser.UUID.ToString(); - SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response["circuit_code"]); - SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); - SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); - SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); - SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString(); - ArrayList SendParams = new ArrayList(); - SendParams.Add(SimParams); - - // Update agent with target sim - theUser.currentAgent.currentRegion = SimInfo.UUID; - theUser.currentAgent.currentHandle = SimInfo.regionhandle; - - // Send - XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); - XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000); - } - - /// - /// Checks a user against it's password hash - /// - /// The users profile - /// The supplied password - /// Authenticated? - public bool AuthenticateUser(ref UserProfileData profile, string password) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose( - "Authenticating " + profile.username + " " + profile.surname); - - password = password.Remove(0, 3); //remove $1$ - - string s = Util.Md5Hash(password + ":" + profile.passwordSalt); - - return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase); - } - - /// - /// Creates and initialises a new user agent - make sure to use CommitAgent when done to submit to the DB - /// - /// The users profile - /// The users loginrequest - public void CreateAgent(ref UserProfileData profile, XmlRpcRequest request) - { - Hashtable requestData = (Hashtable)request.Params[0]; - - UserAgentData agent = new UserAgentData(); - - // User connection - agent.agentIP = ""; - agent.agentOnline = true; - agent.agentPort = 0; - - // Generate sessions - RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); - byte[] randDataS = new byte[16]; - byte[] randDataSS = new byte[16]; - rand.GetBytes(randDataS); - rand.GetBytes(randDataSS); - - agent.secureSessionID = new LLUUID(randDataSS, 0); - agent.sessionID = new LLUUID(randDataS, 0); - - // Profile UUID - agent.UUID = profile.UUID; - - // Current position (from Home) - agent.currentHandle = profile.homeRegion; - agent.currentPos = profile.homeLocation; - - // If user specified additional start, use that - if (requestData.ContainsKey("start")) - { - string startLoc = ((string)requestData["start"]).Trim(); - if (!(startLoc == "last" || startLoc == "home")) - { - // Format: uri:Ahern&162&213&34 - try - { - string[] parts = startLoc.Remove(0, 4).Split('&'); - string region = parts[0]; - - //////////////////////////////////////////////////// - //SimProfile SimInfo = new SimProfile(); - //SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); - } - catch (Exception e) - { - - } - } - } - - // What time did the user login? - agent.loginTime = Util.UnixTimeSinceEpoch(); - agent.logoutTime = 0; - - // Current location - agent.regionID = new LLUUID(); // Fill in later - agent.currentRegion = new LLUUID(); // Fill in later - - profile.currentAgent = agent; - } - - /// - /// Saves a target agent to the database - /// - /// The users profile - /// Successful? - public bool CommitAgent(ref UserProfileData profile) - { - // Saves the agent to database - return true; - } - - /// - /// Main user login function - /// - /// The XMLRPC request - /// The response to send - 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 = ""; - - UserProfileData TheUser; - - if (GoodXML) - { - firstname = (string)requestData["first"]; - lastname = (string)requestData["last"]; - passwd = (string)requestData["passwd"]; - - TheUser = getUserProfile(firstname, lastname); - if (TheUser == null) - return CreateLoginErrorResponse(); - - GoodLogin = AuthenticateUser(ref TheUser, passwd); - } - else - { - return CreateErrorConnectingToGridResponse(); - } - - if (!GoodLogin) - { - return CreateLoginErrorResponse(); - } - else - { - // If we already have a session... - if (TheUser.currentAgent != null && TheUser.currentAgent.agentOnline) - { - // Reject the login - return CreateAlreadyLoggedInResponse(); - } - // Otherwise... - // Create a new agent session - CreateAgent(ref TheUser, request); - - try - { - Hashtable responseData = new Hashtable(); - - LLUUID AgentID = TheUser.UUID; - - // Global Texture Section - 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); - - // Login Flags Section - Hashtable LoginFlagsHash = new Hashtable(); - LoginFlagsHash["daylight_savings"] = "N"; - LoginFlagsHash["stipend_since_login"] = "N"; - LoginFlagsHash["gendered"] = "Y"; // Needs to be combined with below... - LoginFlagsHash["ever_logged_in"] = "Y"; // Should allow male/female av selection - ArrayList LoginFlags = new ArrayList(); - LoginFlags.Add(LoginFlagsHash); - - // UI Customisation Section - Hashtable uiconfig = new Hashtable(); - uiconfig["allow_first_life"] = "Y"; - ArrayList ui_config = new ArrayList(); - ui_config.Add(uiconfig); - - // Classified Categories Section - Hashtable ClassifiedCategoriesHash = new Hashtable(); - ClassifiedCategoriesHash["category_name"] = "Generic"; - ClassifiedCategoriesHash["category_id"] = (Int32)1; - ArrayList ClassifiedCategories = new ArrayList(); - ClassifiedCategories.Add(ClassifiedCategoriesHash); - - // Inventory Library Section - ArrayList AgentInventoryArray = new ArrayList(); - Hashtable TempHash; - - AgentInventory Library = new AgentInventory(); - Library.CreateRootFolder(AgentID, true); - - foreach (InventoryFolder InvFolder in Library.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(); - AgentInventoryArray.Add(TempHash); - } - - Hashtable InventoryRootHash = new Hashtable(); - InventoryRootHash["folder_id"] = Library.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); - - // Circuit Code - uint circode = (uint)(Util.RandomClass.Next()); - - // Generics - responseData["last_name"] = TheUser.surname; - 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"] = AgentInventoryArray; - 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"] = "!!null temporary value {home}!!"; // Overwritten - responseData["message"] = _config.DefaultStartupMsg; - responseData["first_name"] = TheUser.username; - responseData["circuit_code"] = (Int32)circode; - responseData["sim_port"] = 0; //(Int32)SimInfo.sim_port; - responseData["secure_session_id"] = TheUser.currentAgent.secureSessionID.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; // Overwritten - responseData["region_x"] = (Int32)0; // Overwritten - responseData["seed_capability"] = ""; - responseData["agent_access"] = "M"; - responseData["session_id"] = TheUser.currentAgent.sessionID.ToStringHyphenated(); - responseData["login"] = "true"; - - try - { - this.CustomiseResponse(ref responseData, ref TheUser); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - return CreateDeadRegionResponse(); - } - - CommitAgent(ref TheUser); - - response.Value = responseData; - // TheUser.SendDataToSim(SimInfo); - return response; - - } - catch (Exception E) - { - Console.WriteLine(E.ToString()); - } - //} - } - return response; - - } - - /// - /// Deletes an active agent session - /// - /// The request - /// The path (eg /bork/narf/test) - /// Parameters sent - /// Success "OK" else error - public string RestDeleteUserSessionMethod(string request, string path, string param) - { - // TODO! Important! - - return "OK"; - } - - } -} diff --git a/OpenGridServices/OpenUser.Config/UserConfigDb4o/AssemblyInfo.cs b/OpenGridServices/OpenUser.Config/UserConfigDb4o/AssemblyInfo.cs deleted file mode 100644 index 25e0211..0000000 --- a/OpenGridServices/OpenUser.Config/UserConfigDb4o/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("UserConfig")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UserConfig")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("1.0.*")] diff --git a/OpenGridServices/OpenUser.Config/UserConfigDb4o/DbUserConfig.cs b/OpenGridServices/OpenUser.Config/UserConfigDb4o/DbUserConfig.cs deleted file mode 100644 index fe0e7aa..0000000 --- a/OpenGridServices/OpenUser.Config/UserConfigDb4o/DbUserConfig.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 OpenSim.Framework.Console; -using OpenSim.Framework.Interfaces; -using Db4objects.Db4o; - -namespace OpenUser.Config.UserConfigDb4o -{ - public class Db4oConfigPlugin: IUserConfig - { - public UserConfig GetConfigObject() - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Loading Db40Config dll"); - return ( new DbUserConfig()); - } - } - - public class DbUserConfig : UserConfig - { - private IObjectContainer db; - - public void LoadDefaults() { - OpenSim.Framework.Console.MainConsole.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); - - this.DefaultStartupMsg = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); - - this.GridServerURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/"); - this.GridSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to grid server","null"); - this.GridRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from grid server","null"); - } - - public override void InitConfig() { - try { - db = Db4oFactory.OpenFile("openuser.yap"); - IObjectSet result = db.Get(typeof(DbUserConfig)); - if(result.Count==1) { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Config.cs:InitConfig() - Found a UserConfig object in the local database, loading"); - foreach (DbUserConfig cfg in result) { - this.GridServerURL=cfg.GridServerURL; - this.GridSendKey=cfg.GridSendKey; - this.GridRecvKey=cfg.GridRecvKey; - this.DefaultStartupMsg=cfg.DefaultStartupMsg; - } - } else { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); - LoadDefaults(); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Writing out default settings to local database"); - db.Set(this); - db.Close(); - } - } catch(Exception e) { - OpenSim.Framework.Console.MainConsole.Instance.Warn("Config.cs:InitConfig() - Exception occured"); - OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); - } - - OpenSim.Framework.Console.MainConsole.Instance.Verbose("User settings loaded:"); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Default startup message: " + this.DefaultStartupMsg); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Grid server URL: " + this.GridServerURL); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Key to send to grid: " + this.GridSendKey); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Key to expect from grid: " + this.GridRecvKey); - } - - - public void Shutdown() { - db.Close(); - } - } - -} diff --git a/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj b/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj deleted file mode 100644 index a89a38d..0000000 --- a/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {7E494328-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenUser.Config.UserConfigDb4o - JScript - Grid - IE50 - false - Library - - OpenUser.Config.UserConfigDb4o - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\ - False - False - False - 4 - - - - - ..\..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\..\bin\libsecondlife.dll - False - - - OpenSim.Framework.dll - False - - - OpenSim.Framework.Console.dll - False - - - System.dll - False - - - ..\..\..\bin\System.Data.dll - False - - - System.Xml.dll - False - - - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build b/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build deleted file mode 100644 index bd5d49f..0000000 --- a/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenGridServices/ServiceManager/ServiceManager.cs b/OpenGridServices/ServiceManager/ServiceManager.cs deleted file mode 100644 index 8cb9c80..0000000 --- a/OpenGridServices/ServiceManager/ServiceManager.cs +++ /dev/null @@ -1,259 +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.Diagnostics; -using System.Threading; -using System.ServiceProcess; -using System.Xml; -using System.IO; -using libsecondlife; -using OpenSim.GenericConfig; - -public class OpenGridMasterService : System.ServiceProcess.ServiceBase { - - private Thread ServiceWorkerThread; - private static string GridURL; // URL of grid server - private static string GridSimKey; // key sent from Grid>Sim - private static string SimGridKey; // key sent Sim>Grid - private static string AssetURL; // URL of asset server - private static string UserSendKey; // key sent from user>sim - private static string UserRecvKey; // key sent from sim>user - - public OpenGridMasterService() - { - CanPauseAndContinue = false; - ServiceName = "OpenGridServices-master"; - } - - private void InitializeComponent() - { - this.CanPauseAndContinue = false; - this.CanShutdown = true; - this.ServiceName = "OpenGridServices-master"; - } - - protected override void OnStart(string[] args) - { - ServiceWorkerThread = new Thread(new ThreadStart(MainServiceThread)); - ServiceWorkerThread.Start(); - } - - protected override void OnStop() - { - ServiceWorkerThread.Abort(); - } - - private void MainServiceThread() - { - try { - StreamReader reader=new StreamReader("opengrid-master-cfg.xml"); - - string configxml = reader.ReadToEnd(); - XmlDocument doc = new XmlDocument(); - doc.LoadXml(configxml); - XmlNode rootnode = doc.FirstChild; - if (rootnode.Name != "regions") - { - EventLog.WriteEntry("ERROR! bad XML in opengrid-master-cfg.xml - expected regions tag"); - Console.WriteLine("Sorry, could not startup the service - please check your opengrid-master-cfg.xml file: missing regions tag"); - (new ServiceController("OpenGridServices-master")).Stop(); - } - - for(int i=0; i<=rootnode.ChildNodes.Count; i++) - { - if(rootnode.ChildNodes.Item(i).Name != "region") { - EventLog.WriteEntry("nonfatal error - unexpected tag inside regions block of opengrid-master-cfg.xml"); - (new ServiceController("OpenGridServices-master")).Stop(); - } - } - } catch(Exception e) { - Console.WriteLine(e.ToString()); - (new ServiceController("OpenGridServices-master")).Stop(); - } - - } - - private static string SetupGrid() - { - Console.WriteLine("Running external program (OpenGridServices.GridServer.exe) to configure the grid server"); - try { - Process p = new Process(); - - p.StartInfo.Arguments = "-setuponly"; - p.StartInfo.FileName = "OpenGridServices.GridServer.exe"; - p.Start(); - - p.StartInfo.Arguments = "-dumpxmlconf"; - p.Start(); - - XmlConfig GridConf = new XmlConfig("opengrid-cfg.xml"); - GridConf.LoadData(); - GridURL="http://" + GridConf.GetAttribute("ListenAddr") + ":" + GridConf.GetAttribute("ListenPort") + "/"; - - StreamReader reader=new StreamReader("opengrid-cfg.xml"); - string configxml = reader.ReadToEnd(); - - return configxml; - } catch(Exception e) { - Console.WriteLine("An error occurred while running the grid server, please rectify it and try again"); - Console.WriteLine(e.ToString()); - Environment.Exit(1); - } - return ""; - } - - private static string SetupUser() - { - return ""; - } - - private static string SetupAsset() - { - return ""; - } - - private static string SetupRegion() - { - string regionname; - ulong regionlocx; - ulong regionlocy; - string default_terrain; - uint terrain_multiplier; - uint baseport; - - string listenaddr; - string simconfigxml; - LLUUID SimUUID; - - Console.WriteLine("Setting up region servers"); - Console.Write("Please specify a path to store your region data (e.g /etc/opensim/regions: "); - string regionpath=Console.ReadLine(); - - Console.Write("How many regions would you like to configure now? "); - int numofregions=Convert.ToInt16(Console.ReadLine()); - - Console.Write("What port should the region servers start listening at (first region is normally 9000, then 9001 the second etc, both TCP+UDP): "); - baseport=Convert.ToUInt16(Console.ReadLine()); - - - listenaddr=Console.ReadLine(); - - Console.WriteLine("Now ready to configure regions, please answer the questions about each region in turn"); - for(int i=0; i<=numofregions; i++) { - Console.WriteLine("Configuring region number " + i.ToString()); - - Console.Write("Region name: "); - regionname=Console.ReadLine(); - - Console.Write("Region location X: "); - regionlocx=(ulong)Convert.ToUInt32(Console.ReadLine()); - - Console.Write("Region location Y: "); - regionlocy=(ulong)Convert.ToUInt32(Console.ReadLine()); - - Console.Write("Default terrain file: "); - default_terrain=Console.ReadLine(); - terrain_multiplier=Convert.ToUInt16(Console.ReadLine()); - - SimUUID=LLUUID.Random(); - - simconfigxml=""; - - } - - return ""; - } - - public static void InitSetup() - { - string choice=""; - - string GridInfo; - string UserInfo; - string AssetInfo; - string RegionInfo; - - bool grid=false; - bool user=false; - bool asset=false; - bool region=false; - while(choice!="OK") - { - Console.Clear(); - Console.WriteLine("Please select the components you would like to run on this server:\n"); - - Console.WriteLine("1 - [" + (grid ? "X" : " ") + "] Grid server - this service handles co-ordinates of regions/sims on the grid"); - Console.WriteLine("2 - [" + (user ? "X" : " ") + "] User server - this service handles user login, profiles, inventory and IM"); - Console.WriteLine("3 - [" + (asset ? "X" : " ") + "] Asset server - this service handles storage of assets such as textures, objects, sounds, scripts"); - Console.WriteLine("4 - [" + (region ? "X" : " ") + "] Region server - this is the main opensim server and can run without the above services, it handles physics simulation, terrain, building and other such features"); - - - Console.Write("Type a number to toggle a choice or type OK to accept your current choices: "); - choice = Console.ReadLine(); - switch(choice) - { - case "1": - grid = (!grid); - break; - - case "2": - user = (!user); - break; - - case "3": - asset = (!asset); - break; - - case "4": - region = (!region); - break; - } - } - - if(grid) GridInfo = SetupGrid(); - if(user) UserInfo = SetupUser(); - if(asset) AssetInfo = SetupAsset(); - if(region) RegionInfo = SetupRegion(); - } - - public static void Main() - { - if(!File.Exists("opengrid-master-cfg.xml")) - { - Console.WriteLine("Could not find a config file, running initial setup"); - InitSetup(); - } - Console.WriteLine("Starting up OGS master service"); - try { - ServiceBase.Run(new OpenGridMasterService()); - } catch(Exception e) { - Console.WriteLine("An error occured while initialising OGS master service."); - Console.WriteLine(e.ToString()); - } - } -} diff --git a/OpenGridServices/ServiceManager/ServiceManager.csproj b/OpenGridServices/ServiceManager/ServiceManager.csproj deleted file mode 100644 index e07e5be..0000000 --- a/OpenGridServices/ServiceManager/ServiceManager.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {E141F4EE-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - - ServiceManager - JScript - Grid - IE50 - false - Exe - - - ServiceManager - - - - - - - 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 - - - ..\..\bin\OpenSim.Framework.dll - False - - - OpenSim.GenericConfig.Xml.dll - False - - - System.dll - False - - - System.ServiceProcess.dll - False - - - System.Xml.dll - False - - - - - - - Component - - - - - - - - - - \ No newline at end of file diff --git a/OpenGridServices/ServiceManager/ServiceManager.exe.build b/OpenGridServices/ServiceManager/ServiceManager.exe.build deleted file mode 100644 index e0502c6..0000000 --- a/OpenGridServices/ServiceManager/ServiceManager.exe.build +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim.FxCop b/OpenSim.FxCop deleted file mode 100644 index 1e2ea2d..0000000 --- a/OpenSim.FxCop +++ /dev/null @@ -1,7241 +0,0 @@ - - - - True - http://www.gotdotnet.com/team/fxcop//xsl/1.35/FxCopReport.xsl - - - - - - True - True - True - 10 - 1 - - False - False - - False - 120 - - - - $(ProjectDir)/lib/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sim - OpenSim - - - - - - - - - Sim - OpenSim.Assets - - - - - - - - - OpenSim.CAPS - - - - - Sim - OpenSim.CAPS - - - - - OpenSim.CAPS - - - - - - - - - Sim - OpenSim.Config.SimConfigDb4o - - - Sim - OpenSim.Config.SimConfigDb4o - - - - - - - - - OpenSim.Framework.Assets - - - - - Sim - OpenSim.Framework.Assets - - - - - - - - - Sim - OpenSim.Framework.Console - - - - - - - - - OpenSim.Framework.Grid - - - - - Sim - OpenSim.Framework.Grid - - - - - - - - - Sim - OpenSim.Framework.Interfaces - - - - - - - - - OpenSim.Framework.Inventory - - - - - Sim - OpenSim.Framework.Inventory - - - - - - - - - OpenSim.Framework.Sims - - - - - Sim - OpenSim.Framework.Sims - - - - - - - - - OpenSim.Framework.Terrain - - - - - Sim - OpenSim.Framework.Terrain - - - - - - - - - OpenSim.Framework.User - - - - - Sim - OpenSim.Framework.User - - - - - - - - - OpenSim.Framework.Utilities - - - - - Sim - OpenSim.Framework.Utilities - - - - - - - - - Sim - OpenSim.GridInterfaces.Local - - - - - - - - - OpenSim.GridInterfaces.Remote - - - - - Sim - OpenSim.GridInterfaces.Remote - - - - - - - - - Plugin - OpenSim.Physics.BasicPhysicsPlugin - - - - - Sim - OpenSim.Physics.BasicPhysicsPlugin - - - - - - - - - Sim - OpenSim.Physics.Manager - - - - - - - - - OpenSim.Physics.OdePlugin - - - - - Plugin - OpenSim.Physics.OdePlugin - - - - - Sim - OpenSim.Physics.OdePlugin - - - - - - - - - OpenSim.Physics.PhysXPlugin - - - - - Plugin - OpenSim.Physics.PhysXPlugin - - - - - Sim - OpenSim.Physics.PhysXPlugin - - - - - - - - - Sim - OpenSim.Storage.LocalStorageDb4o - - - - - - - - - OpenSim.types - - - - - OpenSim.types - - - - - Sim - OpenSim.types - - - - - - - - - OpenSim.UserServer - - - - - Sim - OpenSim.UserServer - - - - - - - - - OpenSim.world - - - - - Sim - OpenSim.world - - - - - - - - - OpenSim.world.scripting - - - - - OpenSim.world.scripting - - - OpenSim.world.scripting - - - - - Sim - OpenSim.world.scripting - - - - - - - - - - - - - OpenGridServices.ServerConsole - - - - - OpenGridServices.ServerConsole - - - - - OpenGridServices.ServerConsole - - - - - - - - - - - conscmd_callback - - - - - conscmd - ServerConsole.conscmd_callback - - - - - conscmd_callback - - - - - - - - - conscmd_callback.RunCmd(String, String[]):Void - cmdparams - cmdparams - - - - - - - - - ShowWhat - - - - - - - - - - - - - ConsoleBase.CmdPrompt(String, String):String - defaultresponse - defaultresponse - - - - - - - - - OptionA - - - - - OptionB - - - - - ConsoleBase.CmdPrompt(String, String, String, String):String - defaultresponse - defaultresponse - - - - - - - - - Passwd - ConsoleBase.PasswdPrompt(String):String - - - - - - - - - Cmd - - - - - ConsoleBase.RunCmd(String, String[]):Object - cmdparams - cmdparams - - - - - - - - - ShowWhat - - - - - - - - - Line - - - - - - - - - Line - - - - - - - - - - - - - Sim - ConsoleType.SimChat - - - - - - - - - ConsoleType.TCP - - - - - - - - - - - MainConsole - - - - - - - - - - - - - - - - - OpenSim.Config.SimConfigDb4o - - - - - OpenSim.Config.SimConfigDb4o - - - - - OpenSim.Config.SimConfigDb4o - - - - - - - - - - - Plugin - OpenSim.Config.SimConfigDb4o.Db40ConfigPlugin - - - - - - - - - Sim - OpenSim.Config.SimConfigDb4o.DbSimConfig - - - - - Db - OpenSim.Config.SimConfigDb4o.DbSimConfig - - - - - - - - - DbSimConfig.InitConfig(Boolean):Void - System.Exception - - - - - DbSimConfig.InitConfig(Boolean):Void - System.UInt32.ToString - System.UInt32.ToString(System.IFormatProvider) - - - - - DbSimConfig.InitConfig(Boolean):Void - System.UInt64.ToString - System.UInt64.ToString(System.IFormatProvider) - - - - - - - - - DbSimConfig.LoadDefaults():Void - System.Convert.ToInt32(System.String) - System.Convert.ToInt32(System.String,System.IFormatProvider) - - - DbSimConfig.LoadDefaults():Void - System.Convert.ToInt32(System.String) - System.Convert.ToInt32(System.String,System.IFormatProvider) - - - DbSimConfig.LoadDefaults():Void - System.Convert.ToInt32(System.String) - System.Convert.ToInt32(System.String,System.IFormatProvider) - - - - - - - - - - - - - Map - - - - - - - - - - - - - - - - - - - OpenSim - - - - - OpenSim - - - - - OpenSim - - - - - OpenSim - - - - - OpenSim - - - - - - - - - - - - - 'args' - RegionServer.Main(String[]):Void - - - 'args' - RegionServer.Main(String[]):Void - - - - - - - - - - - - - - - - - - - OpenSim.Framework.Console - - - - - OpenSim.Framework.Console - - - - - OpenSim.Framework.Console - - - - - - - - - - - - - ConsoleBase.CmdPrompt(String, String):String - defaultresponse - defaultresponse - - - - - - - - - OptionA - - - - - OptionB - - - - - ConsoleBase.CmdPrompt(String, String, String, String):String - defaultresponse - defaultresponse - - - - - - - - - Cmd - - - - - ConsoleBase.RunCmd(String, String[]):Object - cmdparams - cmdparams - - - - - - - - - ShowWhat - - - - - - - - - - - - - Sim - ConsoleType.SimChat - - - - - - - - - ConsoleType.TCP - - - - - - - - - - - MainConsole - - - - - - - - - - - - - - - - - OpenSim.Framework - - - - - OpenSim.Framework - - - - - OpenSim.Framework - - - - - - - - - - - - - Data - - - - - - - - - Description - - - - - - - - - FullID - - - - - - - - - InvType - - - - - - - - - Name - - - - - - - - - Type - - - - - - - - - - - - - PrimData.PrimData() - ParentID - System.UInt32 - 0 - - - - - - - - - FullID - - - - - - - - - LocalID - - - - - - - - - OwnerID - - - - - - - - - ParentID - - - - - - - - - PathBegin - - - - - - - - - PathCurve - - - - - - - - - PathEnd - - - - - - - - - PathRadiusOffset - - - - - - - - - PathRevolutions - - - - - - - - - PathScaleX - - - - - - - - - PathScaleY - - - - - - - - - PathShearX - - - - - - - - - PathShearY - - - - - - - - - PathSkew - - - - - - - - - PathTaperX - - - - - - - - - PathTaperY - - - - - - - - - PathTwist - - - - - - - - - PathTwistBegin - - - - - - - - - PCode - - - - - - - - - Position - - - - - - - - - ProfileBegin - - - - - - - - - ProfileCurve - - - - - - - - - ProfileEnd - - - - - - - - - ProfileHollow - - - - - - - - - Rotation - - - - - - - - - Scale - - - - - - - - - Texture - - - - - - - - - - - - - - - Login - LoginService - LogOn - - - - - - - - - - - - - - - AgentID - - - - - - - - - circuitcode - - - - - circuitcode - AgentCircuitData.circuitcode - - - - - - - - - firstname - - - - - firstname - AgentCircuitData.firstname - - - - - - - - - lastname - - - - - lastname - AgentCircuitData.lastname - - - - - - - - - SecureSessionID - - - - - - - - - SessionID - - - - - - - - - - - OpenSim.Framework.Interfaces.ARequest - - - OpenSim.Framework.Interfaces.ARequest - - - - - - - - - AssetID - - - - - - - - - IsTexture - - - - - - - - - - - - - Authorised - - - - - Authorised - AuthenticateResponse.Authorised - - - - - - - - - LoginInfo - - - - - Login - LoginInfo - LogOn - - - - - - - - - - - Plugin - OpenSim.Framework.Interfaces.IAssetPlugin - - - - - - - - - GetAssetServer - - - - - - - - - - - - - IsTexture - - - - - - - - - - - - - ID - assetID - Id - - - - - - - - - ServerUrl - - - - - ServerKey - - - - - ServerUrl - IAssetServer.SetServerInfo(String, String):Void - - - - - - - - - - - Plugin - OpenSim.Framework.Interfaces.IGridPlugin - - - - - - - - - GetGridServer - - - - - - - - - - - - - ID - sessionID - Id - - - - - ID - agentID - Id - - - - - - - - - GetName - - - - - - - - - ID - sessionID - Id - - - - - ID - agentID - Id - - - - - Logout - LogoutSession - LogOff - - - - - - - - - Neighbours - IGridServer.RequestNeighbours():NeighbourInfo[] - - - - - - - - - IGridServer.RequestUUIDBlock():UUIDBlock - - - - - - - - - ServerUrl - - - - - SendKey - - - - - RecvKey - - - - - IGridServer.SetServerInfo(String, String, String):Void - Recv - RecvKey - - - - - ServerUrl - IGridServer.SetServerInfo(String, String, String):Void - - - - - - - - - - - - - ID - primID - Id - - - - - - - - - ShutDown - method - ShutDown - Shutdown - - - - - - - - - - - Sim - OpenSim.Framework.Interfaces.ISimConfig - - - - - - - - - GetConfigObject - - - - - - - - - - - - - ID - agentID - Id - - - - - - - - - ServerUrl - - - - - SendKey - - - - - RecvKey - - - - - IUserServer.SetServerInfo(String, String, String):Void - Recv - RecvKey - - - - - ServerUrl - IUserServer.SetServerInfo(String, String, String):Void - - - - - - - - - - - - - Logout - LogoutSession - LogOff - - - - - - - - - - - Login - Login - LogOn - - - - - - - - - Agent - - - - - - - - - BaseFolder - - - - - - - - - First - - - - - - - - - InventoryFolder - - - - - - - - - Last - - - - - - - - - SecureSession - - - - - - - - - Session - - - - - - - - - - - Neighbour - OpenSim.Framework.Interfaces.NeighbourInfo - - - - - - - - - regionhandle - - - - - regionhandle - NeighbourInfo.regionhandle - - - - - - - - - RegionLocX - - - - - - - - - RegionLocY - - - - - - - - - sim_ip - - - - - sim - NeighbourInfo.sim_ip - - - - - sim_ip - - - - - - - - - sim_port - - - - - sim - NeighbourInfo.sim_port - - - - - sim_port - - - - - - - - - - - - - agentcircuits - - - - - agentcircuits - - - - - agentcircuits - RemoteGridBase.agentcircuits:Dictionary`2<System.UInt32,OpenSim.Framework.Interfaces.AgentCircuitData> - - - - - - - - - Logout - LogoutSession - LogOff - - - - - - - - - - - Sim - OpenSim.Framework.Interfaces.SimConfig - - - - - - - - - AssetSendKey - - - - - - - - - AssetURL - - - - - - - - - GridRecvKey - - - - - Recv - SimConfig.GridRecvKey - - - - - - - - - GridSendKey - - - - - - - - - GridURL - - - - - - - - - IPListenAddr - - - - - Addr - SimConfig.IPListenAddr - - - - - - - - - IPListenPort - - - - - - - - - RegionHandle - - - - - - - - - RegionLocX - - - - - - - - - RegionLocY - - - - - - - - - RegionName - - - - - - - - - SimConfig.SaveMap(Single[]):Void - heightmap - heightmap - - - - - - - - - UserRecvKey - - - - - Recv - SimConfig.UserRecvKey - - - - - - - - - UserSendKey - - - - - - - - - UserURL - - - - - - - - - - - UUIDBlock - - - - - OpenSim.Framework.Interfaces.UUIDBlock - - - OpenSim.Framework.Interfaces.UUIDBlock - - - - - - - - - BlockEnd - - - - - - - - - BlockStart - - - - - - - - - - - - - - - - - AgentInventory.AgentInventory() - AgentInventory.AgentInventory() AgentInventory.Initialise():Void - - - - - - - - - ID - folderID - Id - - - - - - - - - AgentID - - - - - - - - - ID - folderID - Id - - - - - - - - - Initialise - AgentInventory.Initialise():Void - - - - - - - - - InventoryFolders - - - - - - - - - InventoryItems - - - - - - - - - InventoryRoot - - - - - - - - - LastCached - - - - - - - - - ID - itemID - Id - - - - - - - - - Wearables - - - - - Wearables - AgentInventory.Wearables - - - - - - - - - - - - - AssetID - - - - - - - - - ItemID - - - - - - - - - - - - - DefaultType - - - - - - - - - FolderID - - - - - - - - - FolderName - - - - - - - - - Items - - - - - System.Collections.Generic.List`1<OpenSim.Framework.Inventory.InventoryItem> - InventoryFolder.Items - - - - - - - - - OwnerID - - - - - - - - - ParentID - - - - - - - - - Version - - - - - - - - - - - - - AssetID - - - - - - - - - CreatorID - - - - - - - - - Description - - - - - - - - - FolderID - - - - - - - - - InvType - - - - - - - - - ItemID - - - - - - - - - Name - - - - - - - - - OwnerID - - - - - - - - - Type - - - - - - - - - - - - - - - Sim - OpenSim.Framework.Sims.SimProfile - - - - - - - - - SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile - System.Exception - - - - - GridURL - - - - - SendKey - - - - - RecvKey - - - - - SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile - Recv - RecvKey - - - - - region_handle - - - - - GridURL - - - - - RecvKey - SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile - - - - - SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile - System.Convert.ToUInt16(System.Object) - System.Convert.ToUInt16(System.Object,System.IFormatProvider) - - - - - SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile - System.Convert.ToUInt32(System.Object) - System.Convert.ToUInt32(System.Object,System.IFormatProvider) - - - SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile - System.Convert.ToUInt32(System.Object) - System.Convert.ToUInt32(System.Object,System.IFormatProvider) - - - - - SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile - System.Convert.ToUInt64(System.Object) - System.Convert.ToUInt64(System.Object,System.IFormatProvider) - - - - - SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile - System.UInt64.ToString - System.UInt64.ToString(System.IFormatProvider) - - - - - - - - - - - Sim - OpenSim.Framework.Sims.SimProfileBase - - - - - - - - - caps_url - - - - - caps_url - - - - - - - - - recvkey - - - - - recvkey - SimProfileBase.recvkey - - - - - - - - - regionhandle - - - - - regionhandle - SimProfileBase.regionhandle - - - - - - - - - RegionLocX - - - - - - - - - RegionLocY - - - - - - - - - regionname - - - - - regionname - SimProfileBase.regionname - - - - - - - - - sendkey - - - - - sendkey - SimProfileBase.sendkey - - - - - - - - - sim_ip - - - - - sim - SimProfileBase.sim_ip - - - - - sim_ip - - - - - - - - - sim_port - - - - - sim - SimProfileBase.sim_port - - - - - sim_port - - - - - - - - - UUID - - - - - - - - - - - - - - - Heightmap - OpenSim.Framework.Terrain.HeightmapGenHills - - - - - - - - - HeightmapGenHills.GenerateHeightmap(Int32, Single, Single, Boolean):Single[] - num - numHills - - - - - Heightmap - HeightmapGenHills.GenerateHeightmap(Int32, Single, Single, Boolean):Single[] - - - - - - - - - HeightmapGenHills.NumHills - - - - - - - - - - - - - - - - - UserProfile.UserProfile() - IsGridGod - System.Boolean - false - - - - - - - - - Sim - UserProfile.AddSimCircuit(UInt32, LLUUID):Void - - - - - regionUUID - - - - - - - - - AssetURL - - - - - - - - - Circuits - - - - - - - - - CurrentSecureSessionID - - - - - - - - - CurrentSessionID - - - - - - - - - firstname - - - - - firstname - UserProfile.firstname - - - - - - - - - homelookat - - - - - homelookat - UserProfile.homelookat - - - - - - - - - homepos - - - - - homepos - UserProfile.homepos - - - - - - - - - homeregionhandle - - - - - homeregionhandle - UserProfile.homeregionhandle - - - - - - - - - Inventory - - - - - - - - - IsGridGod - - - - - - - - - IsLocal - - - - - - - - - lastname - - - - - lastname - UserProfile.lastname - - - - - - - - - MD5passwd - - - - - - - - - UUID - - - - - - - - - - - - - response - - - - - Customise - UserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - - - - - UserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - GridResp - Nwc.XmlRpc.XmlRpcResponse - - - - - UserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - - - UserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.UInt32.ToString - System.UInt32.ToString(System.IFormatProvider) - - - UserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.UInt32.ToString - System.UInt32.ToString(System.IFormatProvider) - - - - - - - - - DefaultStartupMsg - - - - - - - - - GridRecvKey - - - - - Recv - UserProfileManager.GridRecvKey - - - - - - - - - GridSendKey - - - - - - - - - GridURL - - - - - - - - - UserProfileManager.ParseXMLRPC(String):String - System.Exception - - - - - UserProfileManager.ParseXMLRPC(String):String - - - - - UserProfileManager.ParseXMLRPC(String):String - System.Int32.ToString - System.Int32.ToString(System.IFormatProvider) - - - UserProfileManager.ParseXMLRPC(String):String - System.Int32.ToString - System.Int32.ToString(System.IFormatProvider) - - - - - UserProfileManager.ParseXMLRPC(String):String - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.ParseXMLRPC(String):String - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.ParseXMLRPC(String):String - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.ParseXMLRPC(String):String - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.ParseXMLRPC(String):String - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.ParseXMLRPC(String):String - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.ParseXMLRPC(String):String - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.ParseXMLRPC(String):String - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - UserProfileManager.ParseXMLRPC(String):String - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - - - - - - - UserProfileManager.SetKeys(String, String, String, String):Void - recv - recvKey - - - - - url - UserProfileManager.SetKeys(String, String, String, String):Void - - - - - - - - - - - - - UserProfileManagerBase.AuthenticateUser(String, String, String):Boolean - firstname - firstname - - - - - UserProfileManagerBase.AuthenticateUser(String, String, String):Boolean - lastname - lastname - - - - - UserProfileManagerBase.AuthenticateUser(String, String, String):Boolean - passwd - passwd - - - - - - - - - MD5passwd - - - - - UserProfileManagerBase.CreateNewProfile(String, String, String):UserProfile - firstname - firstname - - - - - UserProfileManagerBase.CreateNewProfile(String, String, String):UserProfile - lastname - lastname - - - - - UserProfileManagerBase.CreateNewProfile(String, String, String):UserProfile - M - MD5passwd - - - - - - - - - ProfileLLUUID - - - - - ProfileLLUUID - - - - - UserProfileManagerBase.GetProfileByLLUUID(LLUUID):UserProfile - - - - - - - - - UserProfileManagerBase.GetProfileByName(String, String):UserProfile - firstname - firstname - - - - - UserProfileManagerBase.GetProfileByName(String, String):UserProfile - lastname - lastname - - - - - - - - - ID - agentID - Id - - - - - - - - - GodID - - - - - ID - GodID - Id - - - - - - - - - UserProfiles - - - - - - - - - - - - - - - OpenSim.Framework.Utilities.BlockingQueue`1 - Queue - - - - - - - - - Util - OpenSim.Framework.Utilities.Util - - - - - Util - - - - - Util - System.Web.Util - - - - - - - - - Xfer - Util.GetNextXferID():UInt32 - - - - - Util.GetNextXferID():UInt32 - - - - - GetNextXferID - - - - - - - - - X - - - - - Y - - - - - Util.UIntsToLong(UInt32, UInt32):UInt64 - X - - - - - Util.UIntsToLong(UInt32, UInt32):UInt64 - Y - - - - - Ints - Util.UIntsToLong(UInt32, UInt32):UInt64 - - - - - - - - - - - - - - - - - - - OpenSim.GridInterfaces.Local - - - - - OpenSim.GridInterfaces.Local - - - - - OpenSim.GridInterfaces.Local - - - - - - - - - - - - - Data - - - - - - - - - Name - - - - - - - - - Type - - - - - - - - - UUID - - - - - - - - - - - AssetUUIDQuery - - - - - - - - - 'asset' - AssetUUIDQuery.Match(AssetStorage):Boolean - - - - - - - - - - - Plugin - OpenSim.GridInterfaces.Local.LocalAssetPlugin - - - - - - - - - - - LocalAssetServer.LocalAssetServer() - System.Exception - - - - - - - - - LocalAssetServer.LoadAsset(AssetBase, Boolean, String):Void - - - - - image - LocalAssetServer.LoadAsset(AssetBase, Boolean, String):Void - - - - - - - - - 'asset' - LocalAssetServer.UploadNewAsset(AssetBase):Void - - - - - - - - - - - Plugin - OpenSim.GridInterfaces.Local.LocalGridPlugin - - - - - - - - - - - Logout - LogoutSession - LogOff - - - - - - - - - Sessions - - - - - System.Collections.Generic.List`1<OpenSim.Framework.Interfaces.Login> - LocalGridServer.Sessions - - - - - - - - - - - - - - - - - - - OpenSim.GridInterfaces.Remote - - - - - OpenSim.GridInterfaces.Remote - - - - - OpenSim.GridInterfaces.Remote - - - - - - - - - - - Plugin - OpenSim.GridInterfaces.Remote.RemoteAssetPlugin - - - - - - - - - Plugin - OpenSim.GridInterfaces.Remote.RemoteGridPlugin - - - - - - - - - - - agentcircuits - - - - - - - - - circuitcode - RemoteGridServer.AuthenticateSession(LLUUID, LLUUID, UInt32):AuthenticateResponse - circuitCode - IGridServer.AuthenticateSession(LLUUID, LLUUID, UInt32):AuthenticateResponse - - - - - - - - - RemoteGridServer.GridRecvKey - - - - - - - - - RemoteGridServer.GridSendKey - - - - - - - - - RemoteGridServer.LogoutSession(LLUUID, LLUUID, UInt32):Boolean - WebRequest.Create(Uri):WebRequest - WebRequest.Create(String):WebRequest - - - - - RemoteGridServer.LogoutSession(LLUUID, LLUUID, UInt32):Boolean - GridResponse - System.String - - - - - Logout - LogoutSession - LogOff - - - - - 'sessionID' - RemoteGridServer.LogoutSession(LLUUID, LLUUID, UInt32):Boolean - - - - - - - - - - - - - - - - - - - OpenSim.Physics.Manager - - - - - OpenSim.Physics.Manager - - - - - OpenSim.Physics.Manager - - - - - - - - - - - Plugin - OpenSim.Physics.Manager.IPhysicsPlugin - - - - - - - - - GetName - - - - - - - - - GetScene - - - - - - - - - - - - - 'heightMap' - NullPhysicsScene.SetTerrain(Single[]):Void - - - - - - - - - NullPhysicsScene.Simulate(Single):Void - System.Int32.ToString - System.Int32.ToString(System.IFormatProvider) - - - - - - - - - - - - - Kinematic - PhysicsActor.Kinematic:Boolean - - - - - - - - - - - - - PhysicsManager.GetPhysicsScene(String):PhysicsScene - System.String.Format(System.String,System.Object) - System.String.Format(System.IFormatProvider,System.String,System.Object[]) - - - - - - - - - Plugins - PhysicsManager.LoadPlugins():Void - - - - - - - - - - - - - PhysicsVector.PhysicsVector(Single, Single, Single) - x - - - - - PhysicsVector.PhysicsVector(Single, Single, Single) - y - - - - - PhysicsVector.PhysicsVector(Single, Single, Single) - z - - - - - - - - - X - - - - - X - PhysicsVector.X - - - - - - - - - Y - - - - - Y - PhysicsVector.Y - - - - - - - - - Z - - - - - Z - PhysicsVector.Z - - - - - - - - - PhysicsVector.Zero - OpenSim.Physics.Manager.PhysicsVector - - - - - - - - - - - - - - - - - - - OpenSim.RegionServer - - - - - OpenSim.RegionServer - - - - - OpenSim.RegionServer - - - - - OpenSim.RegionServer - - - - - OpenSim.RegionServer - - - - - - - - - - - - - ID - transactionID - Id - - - - - - - - - ID - transactionID - Id - - - - - - - - - ID - transactionID - Id - - - - - - - - - ID - assetID - Id - - - - - AgentAssetUpload.HandleUploadPacket(AssetUploadRequestPacket, LLUUID):Void - System.Int32.ToString(System.String) - System.Int32.ToString(System.String,System.IFormatProvider) - - - AgentAssetUpload.HandleUploadPacket(AssetUploadRequestPacket, LLUUID):Void - System.Int32.ToString(System.String) - System.Int32.ToString(System.String,System.IFormatProvider) - - - - - 'assetID' - AgentAssetUpload.HandleUploadPacket(AssetUploadRequestPacket, LLUUID):Void - - - 'pack' - AgentAssetUpload.HandleUploadPacket(AssetUploadRequestPacket, LLUUID):Void - - - - - - - - - AgentAssetUpload.HandleXferPacket(SendXferPacketPacket):Void - xfer - xferPacket - - - - - Xfer - AgentAssetUpload.HandleXferPacket(SendXferPacketPacket):Void - - - - - - - - - - - - - AssetTransaction.AssetTransaction() - UploadComplete - System.Boolean - false - - - - - - - - - AddToInventory - - - - - - - - - Asset - - - - - - - - - InventFolder - - - - - - - - - TransactionID - - - - - - - - - UploadComplete - - - - - - - - - XferID - - - - - Xfer - AssetTransaction.XferID - - - - - - - - - - - Grid - OpenSim.Framework.Grid - - - - - - - - - AssetDll - - - - - - - - - AssetServer - - - - - - - - - GridDll - - - - - - - - - GridServer - - - - - - - - - Initialise - Grid.Initialise():Void - - - - - - - - - Grid.LoadAssetDll(String):IAssetServer - - - - - - - - - Grid.LoadGridDll(String):IGridServer - - - - - - - - - - - Sim - OpenSim.OpenSimApplication - - - - - - - - - OpenSimApplication.RemoveClientCircuit(UInt32):Void - circuitcode - circuitcode - - - - - - - - - OpenSimApplication.SendPacketTo(Byte[], Int32, SocketFlags, UInt32):Void - circuitcode - circuitcode - - - - - - - - - StartUp - method - StartUp - Startup - - - - - - - - - - - Sim - OpenSim.OpenSimMain - - - - - OpenSim.OpenSimMain - System.Timers.Timer, System.Net.Sockets.Socket - - - - - - - - - OpenSimMain.OpenSimMain() - loginserver - System.Boolean - false - - - OpenSimMain.OpenSimMain() - sandbox - System.Boolean - false - - - - - - - - - _physicsEngine - - - - - _physicsEngine - - - - - - - - - OpenSimMain.LoadConfigDll(String):SimConfig - - - - - - - - - loginserver - - - - - loginserver - OpenSimMain.loginserver - - - - - - - - - sandbox - - - - - - - - - Server - - - - - - - - - Timer.set_Interval(Double):Void - OpenSimMain.StartUp():Void - - - - - OpenSimMain.StartUp():Void - System.UInt32.ToString - System.UInt32.ToString(System.IFormatProvider) - - - OpenSimMain.StartUp():Void - System.UInt32.ToString - System.UInt32.ToString(System.IFormatProvider) - - - - - - - - - - - Sim - OpenSim.OpenSimRoot - - - - - - - - - OpenSimRoot.OpenSimRoot() - Sandbox - System.Boolean - false - - - - - - - - - Application - - - - - - - - - AssetCache - - - - - - - - - Cfg - - - - - Cfg - OpenSimRoot.Cfg - - - - - - - - - ClientThreads - - - - - - - - - GridServers - - - - - - - - - HttpServer - - - - - - - - - InventoryCache - - - - - - - - - LocalWorld - - - - - - - - - Sandbox - - - - - - - - - StartUp - method - StartUp - Startup - - - - - - - - - startuptime - - - - - startuptime - OpenSimRoot.startuptime - - - - - - - - - - - Que - OpenSim.QueItem - - - - - - - - - Incoming - - - - - - - - - Packet - - - - - - - - - - - Sim - OpenSim.SimClient - - - - - OpenSim.SimClient - System.Timers.Timer - - - - - - - - - SimClient.SimClient(EndPoint, UseCircuitCodePacket) - Sequence - System.UInt32 - 0 - - - SimClient.SimClient(EndPoint, UseCircuitCodePacket) - debug - System.Boolean - false - - - - - Timer.Timer(Double) - SimClient.SimClient(EndPoint, UseCircuitCodePacket) - - - - - SimClient.SimClient(EndPoint, UseCircuitCodePacket) - initialcirpack - initialcirpack - - - - - - - - - AgentID - - - - - - - - - CircuitCode - - - - - - - - - ClientAvatar - - - - - - - - - NewPack - - - - - - - - - SimClient.newAssetFolder - - - - - - - - - NewPack - - - - - - - - - Pack - - - - - SimClient.ProcessInPacket(Packet):Void - wear - libsecondlife.Packets.AgentIsNowWearingPacket - - - - - op_Equality - "" - SimClient.ProcessInPacket(Packet):Void - - - - - - - - - SimClient.ProcessOutPacket(Packet):Void - System.Exception - - - - - Pack - - - - - - - - - SecureSessionID - - - - - - - - - SessionID - - - - - - - - - userEP - - - - - - - - - - - OpenSim.SimConsole - OpenSim.Framework.Console.ConsoleBase - - - - - Sim - OpenSim.SimConsole - - - - - - - - - SimConsole.SimConsole(ConsoleType, String, Int32) - constype - constype - - - - - SimConsole.SimConsole(ConsoleType, String, Int32) - sparam - sparam - - - - - SimConsole.SimConsole(ConsoleType, String, Int32) - iparam - iparam - - - - - iparam - SimConsole.SimConsole(ConsoleType, String, Int32) - - - - - sparam - SimConsole.SimConsole(ConsoleType, String, Int32) - - - - - - - - - op_Equality - "" - SimConsole.CmdPrompt(String, String):String - - - - - - - - - SimConsole.ConsType - - - - - - - - - SimConsole.MainConsolePrompt():Void - System.UInt64.ToString - System.UInt64.ToString(System.IFormatProvider) - - - - - - - - - 'cmdparams' - SimConsole.RunCmd(String, String[]):Object - - - - - - - - - SimConsole.ShowCommands(String):Void - System.String.Format(System.String,System.Object[]) - System.String.Format(System.IFormatProvider,System.String,System.Object[]) - - - SimConsole.ShowCommands(String):Void - System.String.Format(System.String,System.Object[]) - System.String.Format(System.IFormatProvider,System.String,System.Object[]) - - - - - - - - - - - - - Version - - - - - - - - - - - - - - - - - ID - imageID - Id - - - - - - - - - AssetRequests - - - - - System.Collections.Generic.List`1<OpenSim.Assets.AssetRequest> - AssetCache.AssetRequests - - - - - - - - - Assets - - - - - - - - - sourceAsset - AssetCache.CloneAsset(LLUUID, AssetInfo):AssetInfo - OpenSim.Assets.AssetInfo - OpenSim.Framework.Assets.AssetBase - - - - - AssetCache.CloneAsset(LLUUID, AssetInfo):AssetInfo - - - - - newOwner - AssetCache.CloneAsset(LLUUID, AssetInfo):AssetInfo - - - - - 'sourceAsset' - AssetCache.CloneAsset(LLUUID, AssetInfo):AssetInfo - - - - - - - - - source - AssetCache.CloneImage(LLUUID, TextureImage):TextureImage - OpenSim.Assets.TextureImage - OpenSim.Framework.Assets.AssetBase - - - - - AssetCache.CloneImage(LLUUID, TextureImage):TextureImage - - - - - newOwner - AssetCache.CloneImage(LLUUID, TextureImage):TextureImage - - - - - 'source' - AssetCache.CloneImage(LLUUID, TextureImage):TextureImage - - - - - - - - - ID - agentID - Id - - - - - - - - - ID - assetID - Id - - - - - - - - - RequestedAssets - - - - - - - - - RequestedTextures - - - - - - - - - AssetCache.RunAssetManager():Void - System.Exception - - - - - - - - - TextureRequests - - - - - System.Collections.Generic.List`1<OpenSim.Assets.AssetRequest> - AssetCache.TextureRequests - - - - - - - - - Textures - - - - - - - - - - - OpenSim.Assets.AssetInfo - OpenSim.Framework.Assets.AssetBase - - - - - - - - - AssetInfo.AssetInfo(AssetBase) - a - aBase - - - - - 'aBase' - AssetInfo.AssetInfo(AssetBase) - - - - - - - - - - - - - AssetRequest.AssetRequest() - DataPointer - System.Int64 - 0 - - - AssetRequest.AssetRequest() - NumPackets - System.Int32 - 0 - - - AssetRequest.AssetRequest() - PacketCounter - System.Int32 - 0 - - - - - - - - - AssetInf - - - - - - - - - DataPointer - - - - - - - - - ImageInfo - - - - - - - - - IsTextureRequest - - - - - - - - - NumPackets - - - - - Num - AssetRequest.NumPackets - - - - - - - - - PacketCounter - - - - - - - - - RequestAssetID - - - - - - - - - RequestUser - - - - - - - - - TransferRequestID - - - - - - - - - - - - - ID - folderID - Id - - - - - - - - - ID - clientID - Id - - - - - - - - - ID - folderID - Id - - - - - - - - - ID - folderID - Id - - - - - - - - - FetchItems - - - - - - - - - FetchDescend - - - - - - - - - ID - agentID - Id - - - - - - - - - ID - itemID - Id - - - - - - - - - - - OpenSim.Assets.TextureImage - OpenSim.Framework.Assets.AssetBase - - - - - - - - - TextureImage.TextureImage(AssetBase) - a - aBase - - - - - 'aBase' - TextureImage.TextureImage(AssetBase) - - - - - - - - - - - - - - - Sim - OpenSim.CAPS.SimCAPSHTTPServer - - - - - SimCAPSHTTPServer - - - - - OpenSim.CAPS.SimCAPSHTTPServer - System.Net.HttpListener - - - - - - - - - SimCAPSHTTPServer.HandleRequest(Object):Void - stateinfo - stateinfo - - - - - - - - - HTTPD - - - - - - - - - Listener - - - - - - - - - SimCAPSHTTPServer.LoadAdminPage():Void - System.Exception - - - - - - - - - SimCAPSHTTPServer.ParseLLSDXML(String):String - - - - - requestBody - SimCAPSHTTPServer.ParseLLSDXML(String):String - - - - - - - - - SimCAPSHTTPServer.ParseREST(String, String, String):String - System.Exception - - - - - SimCAPSHTTPServer.ParseREST(String, String, String):String - System.String.Format(System.String,System.Object[]) - System.String.Format(System.IFormatProvider,System.String,System.Object[]) - - - - - - - - - SimCAPSHTTPServer.ParseXMLRPC(String):String - System.Exception - - - - - SimCAPSHTTPServer.ParseXMLRPC(String):String - - - - - SimCAPSHTTPServer.ParseXMLRPC(String):String - System.Convert.ToUInt32(System.Object) - System.Convert.ToUInt32(System.Object,System.IFormatProvider) - - - - - - - - - SimCAPSHTTPServer.StartHTTP():Void - System.Exception - - - - - SimCAPSHTTPServer.StartHTTP():Void - - - - - - - - - - - - - - - - - mesh - - - - - System.Collections.Generic.List`1<OpenSim.types.Triangle> - Mesh.mesh - - - - - - - - - Mesh.op_Addition(Mesh, Mesh):Mesh - a - - - - - Mesh.op_Addition(Mesh, Mesh):Mesh - b - - - - - Add - Mesh.op_Addition(Mesh, Mesh):Mesh - - - - - Mesh - Mesh.op_Addition(Mesh, Mesh):Mesh - - - - - - - - - - - - - A - - - - - B - - - - - C - - - - - Triangle.Triangle(Vector3, Vector3, Vector3) - A - - - - - Triangle.Triangle(Vector3, Vector3, Vector3) - B - - - - - Triangle.Triangle(Vector3, Vector3, Vector3) - C - - - - - - - - - - - - - - - - - LocalUserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Int32.ToString - System.Int32.ToString(System.IFormatProvider) - - - LocalUserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Int32.ToString - System.Int32.ToString(System.IFormatProvider) - - - - - LocalUserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - LocalUserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - LocalUserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - LocalUserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - LocalUserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - LocalUserProfileManager.CustomiseResponse(Hashtable&, UserProfile):Void - System.Single.ToString - System.Single.ToString(System.IFormatProvider) - - - - - - - - - - - OpenSim.UserServer.LoginServer - OpenSim.Framework.Grid.LoginService - - - - - OpenSim.UserServer.LoginServer - System.Net.Sockets.Socket - - - - - Login - LoginServer - LogOn - - - - - - - - - LoginServer.LoginServer(IGridServer) - _needPasswd - System.Boolean - false - - - LoginServer.LoginServer(IGridServer) - userAccounts - System.Boolean - false - - - - - - - - - LoginServer.Authenticate(String, String, String):Boolean - passwd - passwd - - - - - - - - - clientAddress - - - - - - - - - Customise - LoginServer.CustomiseLoginResponse(Hashtable, String, String):Void - - - - - Login - CustomiseLoginResponse - LogOn - - - - - - - - - LoginServer.EncodePassword(String):String - System.String.ToLower - System.String.ToLower(System.Globalization.CultureInfo) - - - - - - - - - LoginServer.GetAgentId(String, String):LLUUID - System.Int32.ToString(System.String) - System.Int32.ToString(System.String,System.IFormatProvider) - - - - - - - - - LoginServer.InitializeLogin():Void - 4 - UserProfileManager.SetKeys(String, String, String, String):Void - Welcome to OpenSim - - - - - Sim - OpenSim - - - - - - - - - LoginServer.LoginRequest(StreamReader, StreamWriter):Void - System.Exception - - - - - LoginServer.LoginRequest(StreamReader, StreamWriter):Void - System.Convert.ToInt32(System.String) - System.Convert.ToInt32(System.String,System.IFormatProvider) - - - - - op_Inequality - "" - LoginServer.LoginRequest(StreamReader, StreamWriter):Void - - - - - - - - - writer - LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean - System.IO.StreamWriter - System.IO.TextWriter - - - - - LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean - System.Int32.ToString - System.Int32.ToString(System.IFormatProvider) - - - - - LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean - System.Int32.ToString(System.String) - System.Int32.ToString(System.String,System.IFormatProvider) - - - - - 'request' - LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean - - - 'writer' - LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean - - - 'writer' - LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean - - - - - - - - - remoteAddress - - - - - - - - - LoginServer.RunLogin():Void - System.Exception - - - LoginServer.RunLogin():Void - System.Exception - - - - - LoginServer.RunLogin():Void - clientEndPoint - System.Net.IPEndPoint - - - - - - - - - - - - - - - - - Avatar.Avatar() - PhysicsEngineFlying - System.Boolean - false - - - - - - - - - Avatar.Avatar(SimClient) - _updateCount - System.Int16 - 0 - - - Avatar.Avatar(SimClient) - avatarAppearanceTexture - libsecondlife.LLObject+TextureEntry - null - - - Avatar.Avatar(SimClient) - movementflag - System.Byte - 0 - - - Avatar.Avatar(SimClient) - updateflag - System.Boolean - false - - - - - TheClient - - - - - - - - - anim_seq - - - - - anim - Avatar.anim_seq - - - - - anim_seq - - - - - - - - - Animations - - - - - - - - - RegionInfo - - - - - RegionInfo - Avatar.CompleteMovement(World):Void - - - - - - - - - ControllingClient - - - - - - - - - current_anim - - - - - anim - Avatar.current_anim - - - - - current_anim - - - - - - - - - firstname - - - - - firstname - Avatar.firstname - - - - - - - - - lastname - - - - - lastname - Avatar.lastname - - - - - - - - - Anims - Avatar.LoadAnims():Void - - - - - - - - - PhysActor - - - - - - - - - PhysicsEngineFlying - - - - - - - - - Anim - Avatar.SendAnimPack():Void - - - - - - - - - 'userInfo' - Avatar.SendAppearanceToOtherAgent(SimClient):Void - - - - - - - - - RegionInfo - - - - - RegionInfo - Avatar.SendRegionHandshake(World):Void - - - - - - - - - - - - - AnimsLLUUID - - - - - Anims - AvatarAnimations.AnimsLLUUID - - - - - - - - - AnimsNames - - - - - Anims - AvatarAnimations.AnimsNames - - - - - - - - - Anims - AvatarAnimations.LoadAnims():Void - - - - - - - - - - - - - Entity.Entity() - localid - System.UInt32 - 0 - - - - - - - - - addForces - - - - - - - - - BackUp - method - BackUp - Backup - - - - - - - - - children - - - - - System.Collections.Generic.List`1<OpenSim.world.Entity> - Entity.children - - - - - - - - - getMesh - - - - - - - - - getName - - - - - - - - - localid - - - - - localid - Entity.localid - - - - - - - - - name - - - - - - - - - position - - - - - - - - - rotation - - - - - - - - - update - - - - - - - - - uuid - - - - - uuid - Entity.uuid - - - - - - - - - velocity - - - - - - - - - - - - - X - - - - - X - NewForce.X - - - - - - - - - Y - - - - - Y - NewForce.Y - - - - - - - - - Z - - - - - Z - NewForce.Z - - - - - - - - - - - 'UpdateFlag' - updateFlag - - - - - - - - - Primitive.Primitive() - dirtyFlag - System.Boolean - false - - - Primitive.Primitive() - mesh_cutbegin - System.Single - 0.0 - - - Primitive.Primitive() - newPrimFlag - System.Boolean - false - - - Primitive.Primitive() - physicsEnabled - System.Boolean - false - - - Primitive.Primitive() - physicstest - System.Boolean - false - - - Primitive.Primitive() - updateFlag - System.Boolean - false - - - - - - - - - localID-702000 - Primitive.CreateFromPacket(ObjectAddPacket, LLUUID, UInt32):Void - - - - - ID - agentID - Id - - - - - ID - localID - Id - - - - - Primitive.CreateFromPacket(ObjectAddPacket, LLUUID, UInt32):Void - System.UInt32.ToString(System.String) - System.UInt32.ToString(System.String,System.IFormatProvider) - - - - - 'addPacket' - Primitive.CreateFromPacket(ObjectAddPacket, LLUUID, UInt32):Void - - - - - - - - - 'store' - Primitive.CreateFromStorage(PrimData):Void - - - - - - - - - dirtyFlag - - - - - - - - - mesh_cutbegin - - - - - cutbegin - Primitive.mesh_cutbegin - - - - - mesh_cutbegin - - - - - - - - - mesh_cutend - - - - - cutend - Primitive.mesh_cutend - - - - - mesh_cutend - - - - - - - - - newPrimFlag - - - - - - - - - PhysActor - - - - - - - - - primData - - - - - - - - - RemoteClient - - - - - 'RemoteClient' - Primitive.UpdateClient(SimClient):Void - - - - - - - - - updateFlag - - - - - - - - - 'pack' - Primitive.UpdateObjectFlags(ObjectFlagUpdatePacket):Void - - - - - - - - - 'addPacket' - Primitive.UpdateShape(ObjectDataBlock):Void - - - - - - - - - - - - - ScriptEngine.ScriptEngine(World) - env - env - - - - - env - ScriptEngine.ScriptEngine(World) - - - - - - - - - ScriptEngine.LoadScript():Void - - - - - - - - - - - - - HeightMap - - - - - - - - - - - World - OpenSim.world - - - - - - - - - World.World() - _localNumber - System.UInt32 - 0 - - - - - - - - - _localNumber - - - - - _localNumber - - - - - - - - - AgentClient - - - - - - - - - AgentClient - - - - - - - - - DeRezPacket - - - - - AgentClient - - - - - World.DeRezObject(DeRezObjectPacket, SimClient):Void - Rez - DeRezPacket - - - - - Rez - World.DeRezObject(DeRezObjectPacket, SimClient):Void - - - - - AgentClient - World.DeRezObject(DeRezObjectPacket, SimClient):Void - - - - - De - World.DeRezObject(DeRezObjectPacket, SimClient):Void - - - - - - - - - Entities - - - - - - - - - RemoteClient - - - - - Prims - World.GetInitialPrims(SimClient):Void - - - - - - - - - LandMap - - - - - - - - - Prims - World.LoadPrimsFromStorage():Void - - - - - - - - - World.LoadStorageDLL(String):Boolean - - - - - - - - - localStorage - - - - - - - - - World.Rand - - - - - - - - - Scripts - - - - - - - - - RemoteClient - - - - - 'RemoteClient' - World.SendLayerData(SimClient):Void - - - 'RemoteClient' - World.SendLayerData(SimClient):Void - - - 'RemoteClient' - World.SendLayerData(SimClient):Void - - - - - - - - - - - - - - - - - IScriptHost.Register(IScript):Boolean - iscript - iscript - - - - - - - - - - - - - - - - - - - OpenSim.Storage.LocalStorageDb4o - - - - - OpenSim.Storage.LocalStorageDb4o - - - - - OpenSim.Storage.LocalStorageDb4o - - - - - - - - - - - - - Db4LocalStorage.Db4LocalStorage() - System.Exception - - - - - - - - - 'receiver' - Db4LocalStorage.LoadPrimitives(ILocalStorageReceiver):Void - - - - - - - - - 'prim' - Db4LocalStorage.StorePrim(PrimData):Void - - - - - - - - - - - UUIDQuery - - - - - - - - - 'prim' - UUIDQuery.Match(PrimData):Boolean - - - - - - - - - - - - - - - - - - - OpenSim.Physics.BasicPhysicsPlugin - - - - - - - - - - OpenSim.Physics.BasicPhysicsPlugin - - - - - - - - - - OpenSim.Physics.BasicPhysicsPlugin - - - - - - - - - - - - - - - - - - BasicActor.flying - - - - - - - - - BasicActor.SetAcceleration(PhysicsVector):Void - accel - accel - - - - - - - - - - - Plugin - OpenSim.Physics.BasicPhysicsPlugin.BasicPhysicsPlugin - - - - - BasicPhysicsPlugin - OpenSim.Physics.BasicPhysicsPlugin - - - - - - - - - - - - - - - - - OpenSim.Physics.OdePlugin - - - - - OpenSim.Physics.OdePlugin - - - - - OpenSim.Physics.OdePlugin - - - - - - - - - - - OdeCharacter - - - - - - - - - parent_scene - OdeCharacter.OdeCharacter(OdeScene, PhysicsVector) - - - - - 'pos' - OdeCharacter.OdeCharacter(OdeScene, PhysicsVector) - - - - - - - - - OdeCharacter.capsule_geom - - - - - - - - - OdeCharacter.gravityAccel - - - - - - - - - OdeCharacter.SetAcceleration(PhysicsVector):Void - accel - accel - - - - - - - - - - - Plugin - OpenSim.Physics.OdePlugin.OdePlugin - - - - - OdePlugin - OpenSim.Physics.OdePlugin - - - - - - - - - - - OdePrim._position - - - - - - - - - OdePrim.SetAcceleration(PhysicsVector):Void - accel - accel - - - - - - - - - - - - - 'position' - OdeScene.AddPrim(PhysicsVector, PhysicsVector):PhysicsActor - - - 'size' - OdeScene.AddPrim(PhysicsVector, PhysicsVector):PhysicsActor - - - - - - - - - OdeScene.Land - - - - - - - - - OdeScene.LandGeom - - - - - - - - - 'heightMap' - OdeScene.SetTerrain(Single[]):Void - - - 'heightMap' - OdeScene.SetTerrain(Single[]):Void - - - - - - - - - space - - - - - space - - - - - - - - - world - - - - - world - - - - - - - - - - - - - - - - - - - OpenSim.Physics.PhysXPlugin - - - - - OpenSim.Physics.PhysXPlugin - - - - - OpenSim.Physics.PhysXPlugin - - - - - - - - - - - - - PhysXCharacter.SetAcceleration(PhysicsVector):Void - accel - accel - - - - - - - - - - - Plugin - OpenSim.Physics.PhysXPlugin.PhysXPlugin - - - - - PhysXPlugin - OpenSim.Physics.PhysXPlugin - - - - - - - - - - - PhysXPrim._position - - - - - - - - - PhysXPrim.SetAcceleration(PhysicsVector):Void - accel - accel - - - - - - - - - - - - - - - - Save it for a rainy day. - Save it for a rainy day. - Save it for a rainy day. - - - - - No valid permission requests were found for assembly '{0}'. You should always specify the minimum security permissions using SecurityAction.RequestMinimum. - - - Sign '{0}' with a strong name key. - - - Consider merging the types defined in '{0}' with another namespace. - - - It appears that field '{0}' is never used or is only ever assigned to. Use this field or remove it. - - - Change '{0}' to be read-only by removing the property setter. - - - The compound word '{0}' in {1} '{2}' exists as a discrete term. If your usage is intended to be single word, case it as '{3}'. - - - '{0}' is marked ComVisible(true) but has the following ComVisible(false) types in its object hierarchy: {1} - - - Consider changing the type of parameter '{0}' in {1} from {2} to its base type {3}. This method appears to only require base class members in its implementation. Suppress this violation if there is a compelling reason to require the more derived type in the method signature. - - - '{0}' contains a call chain that results in a call to a virtual method defined by the class. Review the following call stack for unintended consequences: {1} - - - Modify '{0}' to catch a more specific exception than '{1}' or rethrow the exception. - - - Remove the readonly declaration from '{0}' or change the field to one that is an immutable reference type. If the reference type '{1}' is, in fact, immutable, exclude this message. - - - Make '{0}' private or internal (Friend in VB, public private in C++) and provide a public or protected property to access it. - - - Change '{0}' in {1} to use Collection<T>, ReadOnlyCollection<T> or KeyedCollection<K,V> - - - {0} initializes field {1} of type {2} to {3}. Remove this initialization as it will be done automatically by the runtime. - - - {0} passes a literal as parameter {1} of a call to {2}. Retrieve the following string argument from a resource table instead: '{3}' - - - Consider a design that does not require that '{0}' be a reference parameter. - - - {0} creates an exception of type '{1}', an exception type that is not sufficiently specific and should never be raised by user code. If this exception instance might be thrown, use a different exception type. - - - Modify the call to {0} in method {1} to set the timer interval to a value that's greater than or equal to one second. - - - Correct the casing of member name '{0}'. - Correct the casing of namespace name '{0}'. - Correct the casing of parameter name '{0}'. - Correct the casing of type name '{0}'. - - - Correct the spelling of the unrecognized token '{0}' in member name '{1}'. - Consider providing a more meaningful name than the one-letter token '{0}' in member name '{1}'. - Correct the spelling of the unrecognized token '{0}' in namespace '{1}'. - In method {0}, correct the spelling of the unrecognized token '{1}' in parameter name '{2}' or strip it entirely if it represents any sort of hungarian notation. - In method {0}, consider providing a more meaningful name than the one-letter parameter name '{1}'. - Correct the spelling of the unrecognized token '{0}' in type name '{1}'. - - - Change member names {0} and '{1}' so that they differ by more than case. - - - Remove all underscores from member '{0}'. - Remove all underscores from parameter '{0}'. - Remove all underscores from type '{0}'. - - - Rename '{0}' so that it does not end in '{1}'. - - - Correct the spelling of the unrecognized token '{0}' in the literal '{1}'. - - - Correct the capitalization of member name '{0}'. - Correct the capitalization of namespace name '{0}'. - Correct the capitalization of parameter name '{0}'. - Correct the capitalization of type name '{0}'. - - - Add an AssemblyVersion attribute to '{0}'. - - - '{0}' should be marked with CLSCompliantAttribute and its value should be true. - - - Mark '{0}' as ComVisible(false) at the assembly level, then mark all types within the assembly that should be exposed to Com clients as ComVisible(true). - - - The 'this' parameter (or 'Me' in VB) of {0} is never used. Mark the member as static (or Shared in VB) or use 'this'/'Me' in the method body or at least one property accessor, if appropriate. - - - Consider making '{0}' non-public or a constant. - - - Correct the potential overflow in the operation '{0}' in '{1}'. - - - Provide a method named '{0}' as a friendly alternate for operator {1}. - - - Consider adding an overload of the equality operator for '{0}' that takes the same parameters as {1}. - - - '{0}' should override Equals. - '{0}' should override the equality (==) and inequality (!=) operators. - - - Change parameter name '{0}' of method {1} to '{2}' in order to match the identifier as it has been declared in {3}. - - - Modify {0} to call {1} instead of {2}. - - - Make '{0}' private. - - - Add a property getter to '{0}'. - - - {0} declares a local, '{1}', of type {2}, which is never used or is only assigned to. Use this local or remove it. - - - Parameter '{0}' of {1} is never used. Remove the parameter or use it in the method body. - - - Correct the capitalization of '{0}' in member name '{1}'. - 'Id' is an abbreviation and therefore is not subject to acronym casing guidelines. Correct the capitalization of 'ID' in member name '{0}' by changing it to 'Id'. - 'Id' is an abbreviation and therefore is not subject to acronym casing guidelines. Correct the capitalization of '{0}' in parameter name '{1}' by changing it to '{2}'. - Correct the capitalization of '{0}' in type name '{1}'. - - - {0} makes a call to {1} that does not explicitly provide a CultureInfo. This should be replaced with a call to {2}. - - - {0} makes a call to {1} that does not explicitly provide an IFormatProvider. This should be replaced with a call to {2}. - - - Remove the public constructors from '{0}'. - - - Replace the call to String.{0}({1}) in '{2}' with a call to String.IsNullOrEmpty. - - - The type name '{0}' conflicts in whole or in part with the namespace name '{1}'. Change either name to eliminate the conflict. - - - Implement IDisposable on '{0}' as it instantiates members of the following IDisposable types: {1} - - - Implement IDisposable on '{0}'. - - - Change the type of parameter '{0}' of method {1} from string to System.Uri, or provide an overload of {1}, that allows '{0}' to be passed as a System.Uri object. - - - Replace the term '{0}' in member name '{1}' with the preferred alternate '{2}'. - Replace the term '{0}' in type name '{1}' with the preferred alternate '{2}'. - - - Change '{0}' to a property if appropriate. - - - Validate parameter {0} passed to externally visible method {1}. - - - - diff --git a/OpenSim.build b/OpenSim.build deleted file mode 100644 index 87dc0de..0000000 --- a/OpenSim.build +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim.sln b/OpenSim.sln deleted file mode 100644 index ed2eac9..0000000 --- a/OpenSim.sln +++ /dev/null @@ -1,121 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim\OpenSim\OpenSim.csproj", "{438A9556-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework", "Common\OpenSim.Framework\OpenSim.Framework.csproj", "{8ACA2445-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Console", "Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj", "{A7CD0630-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.GenericConfig.Xml", "Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj", "{E88EF749-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.GridInterfaces.Local", "OpenSim\OpenSim.GridInterfaces\Local\OpenSim.GridInterfaces.Local.csproj", "{546099CD-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.GridInterfaces.Remote", "OpenSim\OpenSim.GridInterfaces\Remote\OpenSim.GridInterfaces.Remote.csproj", "{B55C0B5D-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.BasicPhysicsPlugin", "OpenSim\OpenSim.Physics\BasicPhysicsPlugin\OpenSim.Physics.BasicPhysicsPlugin.csproj", "{4F874463-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.Manager", "OpenSim\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj", "{8BE16150-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.OdePlugin", "OpenSim\OpenSim.Physics\OdePlugin\OpenSim.Physics.OdePlugin.csproj", "{63A05FE9-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.PhysXPlugin", "OpenSim\OpenSim.Physics\PhysXPlugin\OpenSim.Physics.PhysXPlugin.csproj", "{988F0AC4-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.RegionServer", "OpenSim\OpenSim.RegionServer\OpenSim.RegionServer.csproj", "{632E1BFD-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Scripting.EmbeddedJVM", "OpenSim\OpenSim.Scripting\EmbeddedJVM\OpenSim.Scripting.EmbeddedJVM.csproj", "{97A82740-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Servers", "Common\OpenSim.Servers\OpenSim.Servers.csproj", "{8BB20F0A-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageBerkeleyDB", "OpenSim\OpenSim.Storage\LocalStorageBerkeleyDB\OpenSim.Storage.LocalStorageBerkeleyDB.csproj", "{EE9E5D96-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageDb4o", "OpenSim\OpenSim.Storage\LocalStorageDb4o\OpenSim.Storage.LocalStorageDb4o.csproj", "{E1B79ECF-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageSQLite", "OpenSim\OpenSim.Storage\LocalStorageSQLite\OpenSim.Storage.LocalStorageSQLite.csproj", "{6B20B603-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Terrain.BasicTerrain", "OpenSim\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj", "{2270B8FE-0000-0000-0000-000000000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLRPC", "Common\XmlRpcCS\XMLRPC.csproj", "{8E81D43C-0000-0000-0000-000000000000}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {438A9556-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {438A9556-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {8ACA2445-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8ACA2445-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8ACA2445-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8ACA2445-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {A7CD0630-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A7CD0630-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A7CD0630-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A7CD0630-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {E88EF749-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E88EF749-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E88EF749-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E88EF749-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {546099CD-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {546099CD-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {546099CD-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {546099CD-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {B55C0B5D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B55C0B5D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B55C0B5D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B55C0B5D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {4F874463-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4F874463-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4F874463-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4F874463-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {8BE16150-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8BE16150-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8BE16150-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8BE16150-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {63A05FE9-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {63A05FE9-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {63A05FE9-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {63A05FE9-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {988F0AC4-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {988F0AC4-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {988F0AC4-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {988F0AC4-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {632E1BFD-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {632E1BFD-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {632E1BFD-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {632E1BFD-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {97A82740-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97A82740-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97A82740-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97A82740-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {8BB20F0A-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8BB20F0A-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8BB20F0A-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8BB20F0A-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {EE9E5D96-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE9E5D96-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE9E5D96-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE9E5D96-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {E1B79ECF-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E1B79ECF-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E1B79ECF-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E1B79ECF-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {6B20B603-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6B20B603-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6B20B603-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6B20B603-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {2270B8FE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2270B8FE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2270B8FE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2270B8FE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/OpenSim/OpenSim.GridInterfaces/Local/AssemblyInfo.cs b/OpenSim/OpenSim.GridInterfaces/Local/AssemblyInfo.cs deleted file mode 100644 index 52ecd6b..0000000 --- a/OpenSim/OpenSim.GridInterfaces/Local/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("LocalGridServers")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("LocalGridServers")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("1.0.*")] diff --git a/OpenSim/OpenSim.GridInterfaces/Local/LocalAssetServer.cs b/OpenSim/OpenSim.GridInterfaces/Local/LocalAssetServer.cs deleted file mode 100644 index ea4cbc7..0000000 --- a/OpenSim/OpenSim.GridInterfaces/Local/LocalAssetServer.cs +++ /dev/null @@ -1,298 +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.Threading; -using System.IO; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Console; -using libsecondlife; -using Db4objects.Db4o; -using Db4objects.Db4o.Query; - -namespace OpenSim.GridInterfaces.Local -{ - public class LocalAssetPlugin : IAssetPlugin - { - public LocalAssetPlugin() - { - - } - - public IAssetServer GetAssetServer() - { - return (new LocalAssetServer()); - } - } - - public class LocalAssetServer : IAssetServer - { - private IAssetReceiver _receiver; - private BlockingQueue _assetRequests; - private IObjectContainer db; - private Thread _localAssetServerThread; - - public LocalAssetServer() - { - bool yapfile; - this._assetRequests = new BlockingQueue(); - yapfile = System.IO.File.Exists("assets.yap"); - - MainConsole.Instance.Verbose("Local Asset Server class created"); - try - { - db = Db4oFactory.OpenFile("assets.yap"); - MainConsole.Instance.Verbose("Db4 Asset database creation"); - } - catch (Exception e) - { - db.Close(); - MainConsole.Instance.Warn("Db4 Asset server :Constructor - Exception occured"); - MainConsole.Instance.Warn(e.ToString()); - } - if (!yapfile) - { - this.SetUpAssetDatabase(); - } - this._localAssetServerThread = new Thread(new ThreadStart(RunRequests)); - this._localAssetServerThread.IsBackground = true; - this._localAssetServerThread.Start(); - - } - - public void SetReceiver(IAssetReceiver receiver) - { - this._receiver = receiver; - } - - public void RequestAsset(LLUUID assetID, bool isTexture) - { - ARequest req = new ARequest(); - req.AssetID = assetID; - req.IsTexture = isTexture; - this._assetRequests.Enqueue(req); - } - - public void UpdateAsset(AssetBase asset) - { - - } - - public void UploadNewAsset(AssetBase asset) - { - AssetStorage store = new AssetStorage(); - store.Data = asset.Data; - store.Name = asset.Name; - store.UUID = asset.FullID; - db.Set(store); - db.Commit(); - } - - public void SetServerInfo(string ServerUrl, string ServerKey) - { - - } - public void Close() - { - if (db != null) - { - MainConsole.Instance.Verbose( "Closing local asset server database"); - db.Close(); - } - } - - private void RunRequests() - { - while (true) - { - byte[] idata = null; - bool found = false; - AssetStorage foundAsset = null; - ARequest req = this._assetRequests.Dequeue(); - IObjectSet result = db.Query(new AssetUUIDQuery(req.AssetID)); - if (result.Count > 0) - { - foundAsset = (AssetStorage)result.Next(); - found = true; - } - - AssetBase asset = new AssetBase(); - if (found) - { - asset.FullID = foundAsset.UUID; - asset.Type = foundAsset.Type; - asset.InvType = foundAsset.Type; - asset.Name = foundAsset.Name; - idata = foundAsset.Data; - } - else - { - asset.FullID = LLUUID.Zero; - } - asset.Data = idata; - _receiver.AssetReceived(asset, req.IsTexture); - } - - } - - private void SetUpAssetDatabase() - { - try - { - - MainConsole.Instance.Verbose( "Setting up asset database"); - - AssetBase Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001"); - Image.Name = "Bricks"; - this.LoadAsset(Image, true, "bricks.jp2"); - AssetStorage store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000002"); - Image.Name = "Plywood"; - this.LoadAsset(Image, true, "plywood.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000003"); - Image.Name = "Rocks"; - this.LoadAsset(Image, true, "rocks.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000004"); - Image.Name = "Granite"; - this.LoadAsset(Image, true, "granite.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000005"); - Image.Name = "Hardwood"; - this.LoadAsset(Image, true, "hardwood.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-5005-000000000005"); - Image.Name = "Prim Base Texture"; - this.LoadAsset(Image, true, "plywood.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000006"); - Image.Name = "Map Base Texture"; - this.LoadAsset(Image, true, "map_base.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000007"); - Image.Name = "Map Texture"; - this.LoadAsset(Image, true, "map1.jp2"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - - Image = new AssetBase(); - Image.FullID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); - Image.Name = "Shape"; - this.LoadAsset(Image, false, "base_shape.dat"); - store = new AssetStorage(); - store.Data = Image.Data; - store.Name = Image.Name; - store.UUID = Image.FullID; - db.Set(store); - db.Commit(); - } - catch (Exception e) - { - MainConsole.Instance.Error(e.Message); - } - - } - - private void LoadAsset(AssetBase info, bool image, string filename) - { - //should request Asset from storage manager - //but for now read from file - - string dataPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder; - string fileName = Path.Combine(dataPath, filename); - FileInfo fInfo = new FileInfo(fileName); - long numBytes = fInfo.Length; - FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); - byte[] idata = new byte[numBytes]; - BinaryReader br = new BinaryReader(fStream); - idata = br.ReadBytes((int)numBytes); - br.Close(); - fStream.Close(); - info.Data = idata; - //info.loaded=true; - } - } -} diff --git a/OpenSim/OpenSim.GridInterfaces/Local/LocalGridServer.cs b/OpenSim/OpenSim.GridInterfaces/Local/LocalGridServer.cs deleted file mode 100644 index 9b6a9ff..0000000 --- a/OpenSim/OpenSim.GridInterfaces/Local/LocalGridServer.cs +++ /dev/null @@ -1,158 +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.Threading; -using System.IO; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Console; -using libsecondlife; -using Db4objects.Db4o; -using Db4objects.Db4o.Query; -using System.Collections; - -namespace OpenSim.GridInterfaces.Local -{ - /// - /// - /// - /// - public class LocalGridPlugin : IGridPlugin - { - public LocalGridPlugin() - { - - } - - public IGridServer GetGridServer() - { - return(new LocalGridServer()); - } - } - - public class LocalGridServer : LocalGridBase - { - public List Sessions = new List(); - - public LocalGridServer() - { - Sessions = new List(); - MainConsole.Instance.Verbose("Local Grid Server class created"); - } - - public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port) - { - return true; - } - - public override string GetName() - { - return "Local"; - } - - public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode) - { - //we are running local - AuthenticateResponse user = new AuthenticateResponse(); - - lock(this.Sessions) - { - - for(int i = 0; i < Sessions.Count; i++) - { - if((Sessions[i].Agent == agentID) && (Sessions[i].Session == sessionID)) - { - user.Authorised = true; - user.LoginInfo = Sessions[i]; - } - } - } - return(user); - } - - public override bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode) - { - return(true); - } - - public override UUIDBlock RequestUUIDBlock() - { - UUIDBlock uuidBlock = new UUIDBlock(); - return(uuidBlock); - } - - public override NeighbourInfo[] RequestNeighbours() - { - return null; - } - - public override void SetServerInfo(string ServerUrl, string SendKey, string RecvKey) - { - - } - - public override IList RequestMapBlocks(int minX, int minY, int maxX, int maxY) - { - return new ArrayList(); - } - - - public override void Close() - { - - } - - /// - /// used by the local login server to inform us of new sessions - /// - /// - public override void AddNewSession(Login session) - { - lock(this.Sessions) - { - this.Sessions.Add(session); - } - } - } - - public class AssetUUIDQuery : Predicate - { - private LLUUID _findID; - - public AssetUUIDQuery(LLUUID find) - { - _findID = find; - } - public bool Match(AssetStorage asset) - { - return (asset.UUID == _findID); - } - } - -} diff --git a/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj b/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj deleted file mode 100644 index 1acd1b5..0000000 --- a/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {546099CD-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.GridInterfaces.Local - JScript - Grid - IE50 - false - Library - - OpenSim.GridInterfaces.Local - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\ - False - False - False - 4 - - - - - ..\..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\..\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 - - - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build b/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build deleted file mode 100644 index c3c4ae4..0000000 --- a/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/AssemblyInfo.cs b/OpenSim/OpenSim.GridInterfaces/Remote/AssemblyInfo.cs deleted file mode 100644 index 51596d0..0000000 --- a/OpenSim/OpenSim.GridInterfaces/Remote/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("RemoteGridServers")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("RemoteGridServers")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("1.0.*")] diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj b/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj deleted file mode 100644 index 11aacac..0000000 --- a/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {B55C0B5D-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.GridInterfaces.Remote - JScript - Grid - IE50 - false - Library - - OpenSim.GridInterfaces.Remote - - - - - - 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 - - - - - - - - - - diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build b/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build deleted file mode 100644 index 860251f..0000000 --- a/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs b/OpenSim/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs deleted file mode 100644 index 550fec6..0000000 --- a/OpenSim/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs +++ /dev/null @@ -1,135 +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.Threading; -using System.Net; -using System.Net.Sockets; -using System.IO; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Utilities; - -namespace OpenSim.GridInterfaces.Remote -{ - public class RemoteAssetServer : IAssetServer - { - private IAssetReceiver _receiver; - private BlockingQueue _assetRequests; - private Thread _remoteAssetServerThread; - private string AssetServerUrl; - private string AssetSendKey; - - public RemoteAssetServer() - { - this._assetRequests = new BlockingQueue(); - this._remoteAssetServerThread = new Thread(new ThreadStart(RunRequests)); - this._remoteAssetServerThread.IsBackground = true; - this._remoteAssetServerThread.Start(); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Remote Asset Server class created"); - } - - public void SetReceiver(IAssetReceiver receiver) - { - this._receiver = receiver; - } - - public void RequestAsset(LLUUID assetID, bool isTexture) - { - ARequest req = new ARequest(); - req.AssetID = assetID; - req.IsTexture = isTexture; - this._assetRequests.Enqueue(req); - } - - public void UpdateAsset(AssetBase asset) - { - - } - - public void UploadNewAsset(AssetBase asset) - { - Encoding Windows1252Encoding = Encoding.GetEncoding(1252); - string ret = Windows1252Encoding.GetString(asset.Data); - byte[] buffer = Windows1252Encoding.GetBytes(ret); - WebClient client = new WebClient(); - client.UploadData(this.AssetServerUrl + "assets/" + asset.FullID, buffer); - - } - - public void SetServerInfo(string ServerUrl, string ServerKey) - { - this.AssetServerUrl = ServerUrl; - this.AssetSendKey = ServerKey; - } - - private void RunRequests() - { - while (true) - { - //we need to add support for the asset server not knowing about a requested asset - // 404... THE MAGIC FILE NOT FOUND ERROR, very useful for telling you things such as a file (or asset ;) ) not being found!!!!!!!!!!! it's 2:22AM - ARequest req = this._assetRequests.Dequeue(); - LLUUID assetID = req.AssetID; - // OpenSim.Framework.Console.MainConsole.Instance.Verbose(" RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "assets/" + assetID); - WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "assets/" + assetID); - WebResponse AssetResponse = AssetLoad.GetResponse(); - byte[] idata = new byte[(int)AssetResponse.ContentLength]; - BinaryReader br = new BinaryReader(AssetResponse.GetResponseStream()); - idata = br.ReadBytes((int)AssetResponse.ContentLength); - br.Close(); - - AssetBase asset = new AssetBase(); - asset.FullID = assetID; - asset.Data = idata; - _receiver.AssetReceived(asset, req.IsTexture); - } - } - - public void Close() - { - - } - } - - public class RemoteAssetPlugin : IAssetPlugin - { - public RemoteAssetPlugin() - { - - } - - public IAssetServer GetAssetServer() - { - return (new RemoteAssetServer()); - } - } - -} diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs b/OpenSim/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs deleted file mode 100644 index 7c93d43..0000000 --- a/OpenSim/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs +++ /dev/null @@ -1,212 +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.Threading; -using System.Net; -using System.Net.Sockets; -using System.IO; -using libsecondlife; -using Nwc.XmlRpc; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Console; - -namespace OpenSim.GridInterfaces.Remote -{ - public class RemoteGridServer : RemoteGridBase - { - private string GridServerUrl; - private string GridSendKey; - private string GridRecvKey; - private Dictionary AgentCircuits = new Dictionary(); - private ArrayList simneighbours = new ArrayList(); - private Hashtable griddatahash; - - public override Dictionary agentcircuits - { - get { return AgentCircuits; } - set { AgentCircuits = value; } - } - - public override ArrayList neighbours - { - get { return simneighbours; } - set { simneighbours = value; } - } - - public override Hashtable GridData - { - get { return griddatahash; } - set { griddatahash = value; } - } - - - public RemoteGridServer() - { - MainConsole.Instance.Notice("Remote Grid Server class created"); - } - - public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port) - { - Hashtable GridParams = new Hashtable(); - GridParams["authkey"] = GridSendKey; - GridParams["UUID"] = SimUUID.ToString(); - GridParams["sim_ip"] = sim_ip; - GridParams["sim_port"] = sim_port.ToString(); - ArrayList SendParams = new ArrayList(); - SendParams.Add(GridParams); - - XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); - XmlRpcResponse GridResp = GridReq.Send(this.GridServerUrl, 3000); - Hashtable GridRespData = (Hashtable)GridResp.Value; - this.griddatahash = GridRespData; - - if (GridRespData.ContainsKey("error")) - { - string errorstring = (string)GridRespData["error"]; - MainConsole.Instance.Warn("Error connecting to grid:"); - MainConsole.Instance.Warn(errorstring); - return false; - } - this.neighbours = (ArrayList)GridRespData["neighbours"]; - Console.WriteLine(simneighbours.Count); - return true; - } - - public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode) - { - AgentCircuitData validcircuit = null; - if (this.AgentCircuits.ContainsKey(circuitcode)) - { - validcircuit = this.AgentCircuits[circuitcode]; - } - AuthenticateResponse user = new AuthenticateResponse(); - if (validcircuit == null) - { - //don't have this circuit code in our list - user.Authorised = false; - return (user); - } - - if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) - { - // YAY! Valid login - user.Authorised = true; - user.LoginInfo = new Login(); - user.LoginInfo.Agent = agentID; - user.LoginInfo.Session = sessionID; - user.LoginInfo.SecureSession = validcircuit.SecureSessionID; - user.LoginInfo.First = validcircuit.firstname; - user.LoginInfo.Last = validcircuit.lastname; - } - else - { - // Invalid - user.Authorised = false; - } - - return (user); - } - - public override bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode) - { - WebRequest DeleteSession = WebRequest.Create(GridServerUrl + "/usersessions/" + sessionID.ToString()); - DeleteSession.Method = "DELETE"; - DeleteSession.ContentType = "text/plaintext"; - DeleteSession.ContentLength = 0; - - StreamWriter stOut = new StreamWriter(DeleteSession.GetRequestStream(), System.Text.Encoding.ASCII); - stOut.Write(""); - stOut.Close(); - - StreamReader stIn = new StreamReader(DeleteSession.GetResponse().GetResponseStream()); - string GridResponse = stIn.ReadToEnd(); - stIn.Close(); - return (true); - } - - public override UUIDBlock RequestUUIDBlock() - { - UUIDBlock uuidBlock = new UUIDBlock(); - return (uuidBlock); - } - - public override NeighbourInfo[] RequestNeighbours() - { - return null; - } - - public override IList RequestMapBlocks(int minX, int minY, int maxX, int maxY) - { - Hashtable param = new Hashtable(); - param["xmin"] = minX; - param["ymin"] = minY; - param["xmax"] = maxX; - param["ymax"] = maxY; - IList parameters = new ArrayList(); - parameters.Add(param); - XmlRpcRequest req = new XmlRpcRequest("map_block", parameters); - XmlRpcResponse resp = req.Send(GridServerUrl, 3000); - Hashtable respData = (Hashtable)resp.Value; - return (IList)respData["sim-profiles"]; - } - - public override void SetServerInfo(string ServerUrl, string SendKey, string RecvKey) - { - this.GridServerUrl = ServerUrl; - this.GridSendKey = SendKey; - this.GridRecvKey = RecvKey; - } - - public override string GetName() - { - return "Remote"; - } - - public override void Close() - { - - } - } - - public class RemoteGridPlugin : IGridPlugin - { - public RemoteGridPlugin() - { - - } - - public IGridServer GetGridServer() - { - return (new RemoteGridServer()); - } - } - -} diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/AssemblyInfo.cs b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/AssemblyInfo.cs deleted file mode 100644 index 177c49d..0000000 --- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/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("PhysXplugin")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PhysXplugin")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("1.0.*")] diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs deleted file mode 100644 index 3d8c9aa..0000000 --- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.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 OpenSim.Physics.Manager; - -namespace OpenSim.Physics.BasicPhysicsPlugin -{ - /// - /// Will be the PhysX plugin but for now will be a very basic physics engine - /// - public class BasicPhysicsPlugin : IPhysicsPlugin - { - private BasicScene _mScene; - - public BasicPhysicsPlugin() - { - - } - - public bool Init() - { - return true; - } - - public PhysicsScene GetScene() - { - if(_mScene == null) - { - _mScene = new BasicScene(); - } - return(_mScene); - } - - public string GetName() - { - return("basicphysics"); - } - - public void Dispose() - { - - } - } - - public class BasicScene :PhysicsScene - { - private List _actors = new List(); - private float[] _heightMap; - - public BasicScene() - { - - } - - public override PhysicsActor AddAvatar(PhysicsVector position) - { - BasicActor act = new BasicActor(); - act.Position = position; - _actors.Add(act); - return act; - } - - public override void RemoveAvatar(PhysicsActor actor) - { - BasicActor act = (BasicActor)actor; - if(_actors.Contains(act)) - { - _actors.Remove(act); - } - - } - - public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) - { - return null; - } - - public override void Simulate(float timeStep) - { - foreach (BasicActor actor in _actors) - { - actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep); - actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep); - actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); - /*if(actor.Flying) - { - actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); - } - else - { - actor.Position.Z = actor.Position.Z + ((-9.8f + actor.Velocity.Z) * timeStep); - } - if(actor.Position.Z < (_heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X]+1)) - {*/ - if ((actor.Position.Y > 0 && actor.Position.Y < 256) && (actor.Position.X > 0 && actor.Position.X < 256)) - { - actor.Position.Z = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1; - } - //} - - - - // This code needs sorting out - border crossings etc -/* if(actor.Position.X<0) - { - ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z)); - actor.Position.X = 0; - actor.Velocity.X = 0; - } - if(actor.Position.Y < 0) - { - ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z)); - actor.Position.Y = 0; - actor.Velocity.Y = 0; - } - if(actor.Position.X > 255) - { - ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z)); - actor.Position.X = 255; - actor.Velocity.X = 0; - } - if(actor.Position.Y > 255) - { - ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z)); - actor.Position.Y = 255; - actor.Velocity.X = 0; - }*/ - } - } - - public override void GetResults() - { - - } - - public override bool IsThreaded - { - get - { - return(false); // for now we won't be multithreaded - } - } - - public override void SetTerrain(float[] heightMap) - { - this._heightMap = heightMap; - } - - public override void DeleteTerrain() - { - - } - } - - public class BasicActor : PhysicsActor - { - private PhysicsVector _position; - private PhysicsVector _velocity; - private PhysicsVector _acceleration; - private bool flying; - public BasicActor() - { - _velocity = new PhysicsVector(); - _position = new PhysicsVector(); - _acceleration = new PhysicsVector(); - } - - public override bool Flying - { - get - { - return false; - } - set - { - flying= value; - } - } - - public override PhysicsVector Position - { - get - { - return _position; - } - set - { - _position = value; - } - } - - public override PhysicsVector Velocity - { - get - { - return _velocity; - } - set - { - _velocity = value; - } - } - - public override Axiom.MathLib.Quaternion Orientation - { - get - { - return Axiom.MathLib.Quaternion.Identity; - } - set - { - - } - } - - public override PhysicsVector Acceleration - { - get - { - return _acceleration; - } - - } - - public override bool Kinematic - { - get - { - return true; - } - set - { - - } - } - public void SetAcceleration (PhysicsVector accel) - { - this._acceleration = accel; - } - - public override void AddForce(PhysicsVector force) - { - - } - - public override void SetMomentum(PhysicsVector momentum) - { - - } - } - -} diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj deleted file mode 100644 index f88eb32..0000000 --- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {4F874463-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Physics.BasicPhysicsPlugin - JScript - Grid - IE50 - false - Library - - OpenSim.Physics.BasicPhysicsPlugin - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\Physics\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\Physics\ - False - False - False - 4 - - - - - ..\..\..\bin\Axiom.MathLib.dll - False - - - System.dll - False - - - - - OpenSim.Physics.Manager - {8BE16150-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build deleted file mode 100644 index 00ca3f9..0000000 --- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.Physics/Manager/AssemblyInfo.cs b/OpenSim/OpenSim.Physics/Manager/AssemblyInfo.cs deleted file mode 100644 index 132f64a..0000000 --- a/OpenSim/OpenSim.Physics/Manager/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("PhysicsManager")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PhysicsManager")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("1.0.*")] diff --git a/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj b/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj deleted file mode 100644 index 347a649..0000000 --- a/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {8BE16150-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Physics.Manager - JScript - Grid - IE50 - false - Library - - OpenSim.Physics.Manager - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\ - False - False - False - 4 - - - - - ..\..\..\bin\Axiom.MathLib.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 - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build b/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build deleted file mode 100644 index fc3e1e6..0000000 --- a/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs b/OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs deleted file mode 100644 index 9ff94c4..0000000 --- a/OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs +++ /dev/null @@ -1,162 +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.Physics.Manager -{ - public abstract class PhysicsActor - { - public static PhysicsActor Null - { - get - { - return new NullPhysicsActor(); - } - } - - public abstract PhysicsVector Position - { - get; - set; - } - - public abstract PhysicsVector Velocity - { - get; - set; - } - - public abstract PhysicsVector Acceleration - { - get; - } - - public abstract Axiom.MathLib.Quaternion Orientation - { - get; - set; - } - - public abstract bool Flying - { - get; - set; - } - - public abstract bool Kinematic - { - get; - set; - } - - public abstract void AddForce(PhysicsVector force); - - public abstract void SetMomentum(PhysicsVector momentum); - } - - public class NullPhysicsActor : PhysicsActor - { - public override PhysicsVector Position - { - get - { - return PhysicsVector.Zero; - } - set - { - return; - } - } - - public override PhysicsVector Velocity - { - get - { - return PhysicsVector.Zero; - } - set - { - return; - } - } - - public override Axiom.MathLib.Quaternion Orientation - { - get - { - return Axiom.MathLib.Quaternion.Identity; - } - set - { - - } - } - - public override PhysicsVector Acceleration - { - get { return PhysicsVector.Zero; } - } - - public override bool Flying - { - get - { - return false; - } - set - { - return; - } - } - - public override bool Kinematic - { - get - { - return true; - } - set - { - return; - } - } - - public override void AddForce(PhysicsVector force) - { - return; - } - - public override void SetMomentum(PhysicsVector momentum) - { - return; - } - } -} diff --git a/OpenSim/OpenSim.Physics/Manager/PhysicsManager.cs b/OpenSim/OpenSim.Physics/Manager/PhysicsManager.cs deleted file mode 100644 index f85c098..0000000 --- a/OpenSim/OpenSim.Physics/Manager/PhysicsManager.cs +++ /dev/null @@ -1,117 +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.IO; -using System.Reflection; -using Axiom.MathLib; -using OpenSim.Framework.Console; - -namespace OpenSim.Physics.Manager -{ - /// - /// Description of MyClass. - /// - public class PhysicsManager - { - private Dictionary _plugins=new Dictionary(); - - public PhysicsManager() - { - - } - - public PhysicsScene GetPhysicsScene(string engineName) - { - if (String.IsNullOrEmpty(engineName)) - { - return new NullPhysicsScene(); - } - - if(_plugins.ContainsKey(engineName)) - { - MainConsole.Instance.Notice("creating "+engineName); - return _plugins[engineName].GetScene(); - } - else - { - MainConsole.Instance.Warn("couldn't find physicsEngine: {0}",engineName); - throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}",engineName)); - } - } - - public void LoadPlugins() - { - string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory ,"Physics"); - string[] pluginFiles = Directory.GetFiles(path, "*.dll"); - - - for(int i= 0; i - /// ODE plugin - /// - public class OdePlugin : IPhysicsPlugin - { - private OdeScene _mScene; - - public OdePlugin() - { - - } - - public bool Init() - { - return true; - } - - public PhysicsScene GetScene() - { - if (_mScene == null) - { - _mScene = new OdeScene(); - } - return (_mScene); - } - - public string GetName() - { - return ("OpenDynamicsEngine"); - } - - public void Dispose() - { - - } - } - - public class OdeScene : PhysicsScene - { - static public IntPtr world; - static public IntPtr space; - static private IntPtr contactgroup; - static private IntPtr LandGeom; - //static private IntPtr Land; - private double[] _heightmap; - static private d.NearCallback nearCallback = near; - private List _characters = new List(); - private static d.ContactGeom[] contacts = new d.ContactGeom[30]; - private static d.Contact contact; - - public OdeScene() - { - contact.surface.mode |= d.ContactFlags.Approx1 | d.ContactFlags.SoftCFM | d.ContactFlags.SoftERP; - contact.surface.mu = 10.0f; - contact.surface.bounce = 0.9f; - contact.surface.soft_erp = 0.005f; - contact.surface.soft_cfm = 0.00003f; - - world = d.WorldCreate(); - space = d.HashSpaceCreate(IntPtr.Zero); - contactgroup = d.JointGroupCreate(0); - d.WorldSetGravity(world, 0.0f, 0.0f, -10.0f); - d.WorldSetAutoDisableFlag(world, false); - d.WorldSetContactSurfaceLayer(world, 0.001f); - this._heightmap = new double[65536]; - } - - // This function blatantly ripped off from BoxStack.cs - static private void near(IntPtr space, IntPtr g1, IntPtr g2) - { - IntPtr b1 = d.GeomGetBody(g1); - IntPtr b2 = d.GeomGetBody(g2); - if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact)) - return; - - int count = d.Collide(g1, g2, 500, contacts, d.ContactGeom.SizeOf); - for (int i = 0; i < count; ++i) - { - contact.geom = contacts[i]; - IntPtr joint = d.JointCreateContact(world, contactgroup, ref contact); - d.JointAttach(joint, b1, b2); - } - - } - - public override PhysicsActor AddAvatar(PhysicsVector position) - { - PhysicsVector pos = new PhysicsVector(); - pos.X = position.X; - pos.Y = position.Y; - pos.Z = position.Z + 20; - OdeCharacter newAv = new OdeCharacter(this, pos); - this._characters.Add(newAv); - return newAv; - } - - public override void RemoveAvatar(PhysicsActor actor) - { - - } - - public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) - { - PhysicsVector pos = new PhysicsVector(); - pos.X = position.X; - pos.Y = position.Y; - pos.Z = position.Z; - PhysicsVector siz = new PhysicsVector(); - siz.X = size.X; - siz.Y = size.Y; - siz.Z = size.Z; - return new OdePrim(); - } - - public override void Simulate(float timeStep) - { - foreach (OdeCharacter actor in _characters) - { - actor.Move(timeStep); - } - d.SpaceCollide(space, IntPtr.Zero, nearCallback); - for (int i = 0; i < 50; i++) - { - d.WorldQuickStep(world, timeStep * 0.02f); - } - - d.JointGroupEmpty(contactgroup); - foreach (OdeCharacter actor in _characters) - { - actor.UpdatePosition(); - } - } - - public override void GetResults() - { - - } - - public override bool IsThreaded - { - get - { - return (false); // for now we won't be multithreaded - } - } - - public override void SetTerrain(float[] heightMap) - { - for (int i = 0; i < 65536; i++) - { - // this._heightmap[i] = (double)heightMap[i]; - // dbm (danx0r) -- heightmap x,y must be swapped for Ode (should fix ODE, but for now...) - int x = i & 0xff; - int y = i >> 8; - this._heightmap[i] = (double)heightMap[x * 256 + y]; - } - IntPtr HeightmapData = d.GeomHeightfieldDataCreate(); - d.GeomHeightfieldDataBuildDouble(HeightmapData, _heightmap, 0, 256, 256, 256, 256, 1.0f, 0.0f, 2.0f, 0); - d.GeomHeightfieldDataSetBounds(HeightmapData, 256, 256); - LandGeom = d.CreateHeightfield(space, HeightmapData, 1); - d.Matrix3 R = new d.Matrix3(); - - Axiom.MathLib.Quaternion q1 =Axiom.MathLib.Quaternion.FromAngleAxis(1.5707f, new Axiom.MathLib.Vector3(1,0,0)); - Axiom.MathLib.Quaternion q2 =Axiom.MathLib.Quaternion.FromAngleAxis(1.5707f, new Axiom.MathLib.Vector3(0,1,0)); - //Axiom.MathLib.Quaternion q3 = Axiom.MathLib.Quaternion.FromAngleAxis(3.14f, new Axiom.MathLib.Vector3(0, 0, 1)); - - q1 = q1 * q2; - //q1 = q1 * q3; - Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(); - float angle = 0; - q1.ToAngleAxis(ref angle, ref v3); - - d.RFromAxisAndAngle(out R, v3.x, v3.y, v3.z, angle); - d.GeomSetRotation(LandGeom, ref R); - d.GeomSetPosition(LandGeom, 128, 128, 0); - } - - public override void DeleteTerrain() - { - - } - } - - public class OdeCharacter : PhysicsActor - { - private PhysicsVector _position; - private PhysicsVector _velocity; - private PhysicsVector _acceleration; - private bool flying = false; - //private float gravityAccel; - private IntPtr BoundingCapsule; - IntPtr capsule_geom; - d.Mass capsule_mass; - - public OdeCharacter(OdeScene parent_scene, PhysicsVector pos) - { - _velocity = new PhysicsVector(); - _position = pos; - _acceleration = new PhysicsVector(); - d.MassSetCapsule(out capsule_mass, 50.0f, 3, 0.5f, 2f); - capsule_geom = d.CreateSphere(OdeScene.space, 1.0f); /// not a typo! Spheres roll, capsules tumble - this.BoundingCapsule = d.BodyCreate(OdeScene.world); - d.BodySetMass(BoundingCapsule, ref capsule_mass); - d.BodySetPosition(BoundingCapsule, pos.X, pos.Y, pos.Z); - d.GeomSetBody(capsule_geom, BoundingCapsule); - } - - public override bool Flying - { - get - { - return flying; - } - set - { - flying = value; - } - } - - public override PhysicsVector Position - { - get - { - return _position; - } - set - { - _position = value; - } - } - - public override PhysicsVector Velocity - { - get - { - return _velocity; - } - set - { - _velocity = value; - } - } - - public override bool Kinematic - { - get - { - return false; - } - set - { - - } - } - - public override Axiom.MathLib.Quaternion Orientation - { - get - { - return Axiom.MathLib.Quaternion.Identity; - } - set - { - - } - } - - public override PhysicsVector Acceleration - { - get - { - return _acceleration; - } - - } - public void SetAcceleration(PhysicsVector accel) - { - this._acceleration = accel; - } - - public override void AddForce(PhysicsVector force) - { - - } - - public override void SetMomentum(PhysicsVector momentum) - { - - } - - public void Move(float timeStep) - { - PhysicsVector vec = new PhysicsVector(); - d.Vector3 vel = d.BodyGetLinearVel(BoundingCapsule); - vec.X = (vel.X - this._velocity.X) * -75000.0f; - vec.Y = (vel.Y - this._velocity.Y) * -75000.0f; - if (flying) - { - vec.Z = (vel.Z - this._velocity.Z) * -75000.0f; - } - d.BodyAddForce(this.BoundingCapsule, vec.X, vec.Y, vec.Z); - } - - public void UpdatePosition() - { - d.Vector3 vec = d.BodyGetPosition(BoundingCapsule); - this._position.X = vec.X; - this._position.Y = vec.Y; - this._position.Z = vec.Z; - } - } - - public class OdePrim : PhysicsActor - { - private PhysicsVector _position; - private PhysicsVector _velocity; - private PhysicsVector _acceleration; - - public OdePrim() - { - _velocity = new PhysicsVector(); - _position = new PhysicsVector(); - _acceleration = new PhysicsVector(); - } - public override bool Flying - { - get - { - return false; //no flying prims for you - } - set - { - - } - } - public override PhysicsVector Position - { - get - { - PhysicsVector pos = new PhysicsVector(); - // PhysicsVector vec = this._prim.Position; - //pos.X = vec.X; - //pos.Y = vec.Y; - //pos.Z = vec.Z; - return pos; - - } - set - { - /*PhysicsVector vec = value; - PhysicsVector pos = new PhysicsVector(); - pos.X = vec.X; - pos.Y = vec.Y; - pos.Z = vec.Z; - this._prim.Position = pos;*/ - } - } - - public override PhysicsVector Velocity - { - get - { - return _velocity; - } - set - { - _velocity = value; - } - } - - public override bool Kinematic - { - get - { - return false; - //return this._prim.Kinematic; - } - set - { - //this._prim.Kinematic = value; - } - } - - public override Axiom.MathLib.Quaternion Orientation - { - get - { - Axiom.MathLib.Quaternion res = new Axiom.MathLib.Quaternion(); - return res; - } - set - { - - } - } - - public override PhysicsVector Acceleration - { - get - { - return _acceleration; - } - - } - public void SetAcceleration(PhysicsVector accel) - { - this._acceleration = accel; - } - - public override void AddForce(PhysicsVector force) - { - - } - - public override void SetMomentum(PhysicsVector momentum) - { - - } - - - } - -} diff --git a/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj b/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj deleted file mode 100644 index 08f54aa..0000000 --- a/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {63A05FE9-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Physics.OdePlugin - JScript - Grid - IE50 - false - Library - - OpenSim.Physics.OdePlugin - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\Physics\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\Physics\ - False - False - False - 4 - - - - - ..\..\..\bin\Axiom.MathLib.dll - False - - - ..\..\..\bin\Ode.NET.dll - False - - - System.dll - False - - - - - OpenSim.Physics.Manager - {8BE16150-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build b/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build deleted file mode 100644 index c93c0c2..0000000 --- a/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs b/OpenSim/OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs deleted file mode 100644 index b49c8da..0000000 --- a/OpenSim/OpenSim.Physics/PhysXPlugin/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("RealPhysXplugin")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("RealPhysXplugin")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("1.0.*")] diff --git a/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj b/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj deleted file mode 100644 index aa89cc1..0000000 --- a/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {988F0AC4-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Physics.PhysXPlugin - JScript - Grid - IE50 - false - Library - - OpenSim.Physics.PhysXPlugin - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\Physics\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\Physics\ - False - False - False - 4 - - - - - ..\..\..\bin\Axiom.MathLib.dll - False - - - ..\..\..\bin\PhysX_Wrapper_Dotnet.dll - False - - - System.dll - False - - - - - OpenSim.Physics.Manager - {8BE16150-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build b/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build deleted file mode 100644 index be7a847..0000000 --- a/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs deleted file mode 100644 index 802f983..0000000 --- a/OpenSim/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs +++ /dev/null @@ -1,424 +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 OpenSim.Physics.Manager; -using PhysXWrapper; - -namespace OpenSim.Physics.PhysXPlugin -{ - /// - /// Will be the PhysX plugin but for now will be a very basic physics engine - /// - public class PhysXPlugin : IPhysicsPlugin - { - private PhysXScene _mScene; - - public PhysXPlugin() - { - - } - - public bool Init() - { - return true; - } - - public PhysicsScene GetScene() - { - if(_mScene == null) - { - _mScene = new PhysXScene(); - } - return(_mScene); - } - - public string GetName() - { - return("RealPhysX"); - } - - public void Dispose() - { - - } - } - - public class PhysXScene :PhysicsScene - { - private List _characters = new List(); - private List _prims = new List(); - private float[] _heightMap = null; - private NxPhysicsSDK mySdk; - private NxScene scene; - - public PhysXScene() - { - mySdk = NxPhysicsSDK.CreateSDK(); - Console.WriteLine("Sdk created - now creating scene"); - scene = mySdk.CreateScene(); - - } - - public override PhysicsActor AddAvatar(PhysicsVector position) - { - Vec3 pos = new Vec3(); - pos.X = position.X; - pos.Y = position.Y; - pos.Z = position.Z; - PhysXCharacter act = new PhysXCharacter( scene.AddCharacter(pos)); - act.Position = position; - _characters.Add(act); - return act; - } - - public override void RemoveAvatar(PhysicsActor actor) - { - - } - - public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) - { - Vec3 pos = new Vec3(); - pos.X = position.X; - pos.Y = position.Y; - pos.Z = position.Z; - Vec3 siz = new Vec3(); - siz.X = size.X; - siz.Y = size.Y; - siz.Z = size.Z; - PhysXPrim act = new PhysXPrim( scene.AddNewBox(pos, siz)); - _prims.Add(act); - return act; - } - public override void Simulate(float timeStep) - { - try - { - foreach (PhysXCharacter actor in _characters) - { - actor.Move(timeStep); - } - scene.Simulate(timeStep); - scene.FetchResults(); - scene.UpdateControllers(); - - foreach (PhysXCharacter actor in _characters) - { - actor.UpdatePosition(); - } - } - catch (Exception e) - { - Console.WriteLine(e.Message); - } - - } - - public override void GetResults() - { - - } - - public override bool IsThreaded - { - get - { - return(false); // for now we won't be multithreaded - } - } - - public override void SetTerrain(float[] heightMap) - { - if (this._heightMap != null) - { - Console.WriteLine("PhysX - deleting old terrain"); - this.scene.DeleteTerrain(); - } - this._heightMap = heightMap; - this.scene.AddTerrain(heightMap); - } - - public override void DeleteTerrain() - { - this.scene.DeleteTerrain(); - } - } - - public class PhysXCharacter : PhysicsActor - { - private PhysicsVector _position; - private PhysicsVector _velocity; - private PhysicsVector _acceleration; - private NxCharacter _character; - private bool flying; - private float gravityAccel; - - public PhysXCharacter(NxCharacter character) - { - _velocity = new PhysicsVector(); - _position = new PhysicsVector(); - _acceleration = new PhysicsVector(); - _character = character; - } - - public override bool Flying - { - get - { - return flying; - } - set - { - flying = value; - } - } - - public override PhysicsVector Position - { - get - { - return _position; - } - set - { - _position = value; - Vec3 ps = new Vec3(); - ps.X = value.X; - ps.Y = value.Y; - ps.Z = value.Z; - this._character.Position = ps; - } - } - - public override PhysicsVector Velocity - { - get - { - return _velocity; - } - set - { - _velocity = value; - } - } - - public override bool Kinematic - { - get - { - return false; - } - set - { - - } - } - - public override Axiom.MathLib.Quaternion Orientation - { - get - { - return Axiom.MathLib.Quaternion.Identity; - } - set - { - - } - } - - public override PhysicsVector Acceleration - { - get - { - return _acceleration; - } - - } - public void SetAcceleration (PhysicsVector accel) - { - this._acceleration = accel; - } - - public override void AddForce(PhysicsVector force) - { - - } - - public override void SetMomentum(PhysicsVector momentum) - { - - } - - public void Move(float timeStep) - { - Vec3 vec = new Vec3(); - vec.X = this._velocity.X * timeStep; - vec.Y = this._velocity.Y * timeStep; - if(flying) - { - vec.Z = ( this._velocity.Z) * timeStep; - } - else - { - gravityAccel+= -9.8f; - vec.Z = (gravityAccel + this._velocity.Z) * timeStep; - } - int res = this._character.Move(vec); - if(res == 1) - { - gravityAccel = 0; - } - } - - public void UpdatePosition() - { - Vec3 vec = this._character.Position; - this._position.X = vec.X; - this._position.Y = vec.Y; - this._position.Z = vec.Z; - } - } - - public class PhysXPrim : PhysicsActor - { - private PhysicsVector _position; - private PhysicsVector _velocity; - private PhysicsVector _acceleration; - private NxActor _prim; - - public PhysXPrim(NxActor prim) - { - _velocity = new PhysicsVector(); - _position = new PhysicsVector(); - _acceleration = new PhysicsVector(); - _prim = prim; - } - public override bool Flying - { - get - { - return false; //no flying prims for you - } - set - { - - } - } - public override PhysicsVector Position - { - get - { - PhysicsVector pos = new PhysicsVector(); - Vec3 vec = this._prim.Position; - pos.X = vec.X; - pos.Y = vec.Y; - pos.Z = vec.Z; - return pos; - - } - set - { - PhysicsVector vec = value; - Vec3 pos = new Vec3(); - pos.X = vec.X; - pos.Y = vec.Y; - pos.Z = vec.Z; - this._prim.Position = pos; - } - } - - public override PhysicsVector Velocity - { - get - { - return _velocity; - } - set - { - _velocity = value; - } - } - - public override bool Kinematic - { - get - { - return this._prim.Kinematic; - } - set - { - this._prim.Kinematic = value; - } - } - - public override Axiom.MathLib.Quaternion Orientation - { - get - { - Axiom.MathLib.Quaternion res = new Axiom.MathLib.Quaternion(); - PhysXWrapper.Quaternion quat = this._prim.GetOrientation(); - res.w = quat.W; - res.x = quat.X; - res.y = quat.Y; - res.z = quat.Z; - return res; - } - set - { - - } - } - - public override PhysicsVector Acceleration - { - get - { - return _acceleration; - } - - } - public void SetAcceleration (PhysicsVector accel) - { - this._acceleration = accel; - } - - public override void AddForce(PhysicsVector force) - { - - } - - public override void SetMomentum(PhysicsVector momentum) - { - - } - - - } - -} diff --git a/OpenSim/OpenSim.RegionServer/AgentAssetUpload.cs b/OpenSim/OpenSim.RegionServer/AgentAssetUpload.cs deleted file mode 100644 index 6781781..0000000 --- a/OpenSim/OpenSim.RegionServer/AgentAssetUpload.cs +++ /dev/null @@ -1,259 +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 OpenSim.RegionServer.Assets; -using OpenSim.RegionServer.Client; -using OpenSim.Framework.Types; -using OpenSim.Framework.Utilities; -using libsecondlife; -using libsecondlife.Packets; - -namespace OpenSim.RegionServer -{ - public class AgentAssetUpload - { - private Dictionary transactions = new Dictionary(); - private ClientView ourClient; - private AssetCache m_assetCache; - private InventoryCache m_inventoryCache; - - public AgentAssetUpload(ClientView client, AssetCache assetCache, InventoryCache inventoryCache) - { - this.ourClient = client; - m_assetCache = assetCache; - m_inventoryCache = inventoryCache; - } - - public void AddUpload(LLUUID transactionID, AssetBase asset) - { - AssetTransaction upload = new AssetTransaction(); - lock (this.transactions) - { - upload.Asset = asset; - upload.TransactionID = transactionID; - this.transactions.Add(transactionID, upload); - } - if (upload.Asset.Data.Length > 2) - { - //is complete - upload.UploadComplete = true; - AssetUploadCompletePacket response = new AssetUploadCompletePacket(); - response.AssetBlock.Type = asset.Type; - response.AssetBlock.Success = true; - response.AssetBlock.UUID = transactionID.Combine(this.ourClient.SecureSessionID); - this.ourClient.OutPacket(response); - m_assetCache.AddAsset(asset); - } - else - { - upload.UploadComplete = false; - upload.XferID = Util.GetNextXferID(); - RequestXferPacket xfer = new RequestXferPacket(); - xfer.XferID.ID = upload.XferID; - xfer.XferID.VFileType = upload.Asset.Type; - xfer.XferID.VFileID = transactionID.Combine(this.ourClient.SecureSessionID); - xfer.XferID.FilePath = 0; - xfer.XferID.Filename = new byte[0]; - this.ourClient.OutPacket(xfer); - } - - } - - public AssetBase GetUpload(LLUUID transactionID) - { - if (this.transactions.ContainsKey(transactionID)) - { - return this.transactions[transactionID].Asset; - } - - return null; - } - - public void HandleUploadPacket(AssetUploadRequestPacket pack, LLUUID assetID) - { - // Console.Write("asset upload request , type = " + pack.AssetBlock.Type.ToString()); - AssetBase asset = null; - if (pack.AssetBlock.Type == 0) - { - - //first packet for transaction - asset = new AssetBase(); - asset.FullID = assetID; - asset.Type = pack.AssetBlock.Type; - asset.InvType = asset.Type; - asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000"); - asset.Data = pack.AssetBlock.AssetData; - - - } - else if (pack.AssetBlock.Type == 13 | pack.AssetBlock.Type == 5 | pack.AssetBlock.Type == 7) - { - - asset = new AssetBase(); - asset.FullID = assetID; - asset.Type = pack.AssetBlock.Type; - asset.InvType = asset.Type; - asset.Name = "NewClothing" + Util.RandomClass.Next(1, 1000).ToString("000"); - asset.Data = pack.AssetBlock.AssetData; - - - } - - if (asset != null) - { - this.AddUpload(pack.AssetBlock.TransactionID, asset); - } - else - { - - //currently we don't support this asset type - //so lets just tell the client that the upload is complete - AssetUploadCompletePacket response = new AssetUploadCompletePacket(); - response.AssetBlock.Type = pack.AssetBlock.Type; - response.AssetBlock.Success = true; - response.AssetBlock.UUID = pack.AssetBlock.TransactionID.Combine(this.ourClient.SecureSessionID); - this.ourClient.OutPacket(response); - } - - } - - #region Xfer packet system for larger uploads - - public void HandleXferPacket(SendXferPacketPacket xferPacket) - { - lock (this.transactions) - { - foreach (AssetTransaction trans in this.transactions.Values) - { - if (trans.XferID == xferPacket.XferID.ID) - { - if (trans.Asset.Data.Length > 1) - { - byte[] newArray = new byte[trans.Asset.Data.Length + xferPacket.DataPacket.Data.Length]; - Array.Copy(trans.Asset.Data, 0, newArray, 0, trans.Asset.Data.Length); - Array.Copy(xferPacket.DataPacket.Data, 0, newArray, trans.Asset.Data.Length, xferPacket.DataPacket.Data.Length); - trans.Asset.Data = newArray; - } - else - { - byte[] newArray = new byte[xferPacket.DataPacket.Data.Length - 4]; - Array.Copy(xferPacket.DataPacket.Data, 4, newArray, 0, xferPacket.DataPacket.Data.Length - 4); - trans.Asset.Data = newArray; - } - - if ((xferPacket.XferID.Packet & 2147483648) != 0) - { - //end of transfer - trans.UploadComplete = true; - AssetUploadCompletePacket response = new AssetUploadCompletePacket(); - response.AssetBlock.Type = trans.Asset.Type; - response.AssetBlock.Success = true; - response.AssetBlock.UUID = trans.TransactionID.Combine(this.ourClient.SecureSessionID); - this.ourClient.OutPacket(response); - - m_assetCache.AddAsset(trans.Asset); - //check if we should add it to inventory - if (trans.AddToInventory) - { - // m_assetCache.AddAsset(trans.Asset); - m_inventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset); - } - - - } - break; - } - - } - } - - ConfirmXferPacketPacket confirmXfer = new ConfirmXferPacketPacket(); - confirmXfer.XferID.ID = xferPacket.XferID.ID; - confirmXfer.XferID.Packet = xferPacket.XferID.Packet; - this.ourClient.OutPacket(confirmXfer); - } - - #endregion - - public AssetBase AddUploadToAssetCache(LLUUID transactionID) - { - AssetBase asset = null; - if (this.transactions.ContainsKey(transactionID)) - { - AssetTransaction trans = this.transactions[transactionID]; - if (trans.UploadComplete) - { - m_assetCache.AddAsset(trans.Asset); - asset = trans.Asset; - } - } - - return asset; - } - - public void CreateInventoryItem(CreateInventoryItemPacket packet) - { - if (this.transactions.ContainsKey(packet.InventoryBlock.TransactionID)) - { - AssetTransaction trans = this.transactions[packet.InventoryBlock.TransactionID]; - trans.Asset.Description = Util.FieldToString(packet.InventoryBlock.Description); - trans.Asset.Name = Util.FieldToString(packet.InventoryBlock.Name); - trans.Asset.Type = packet.InventoryBlock.Type; - trans.Asset.InvType = packet.InventoryBlock.InvType; - if (trans.UploadComplete) - { - //already complete so we can add it to the inventory - //m_assetCache.AddAsset(trans.Asset); - m_inventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset); - } - else - { - trans.AddToInventory = true; - trans.InventFolder = packet.InventoryBlock.FolderID; - } - } - } - - private class AssetTransaction - { - public uint XferID; - public AssetBase Asset; - public bool AddToInventory; - public LLUUID InventFolder = LLUUID.Zero; - public bool UploadComplete = false; - public LLUUID TransactionID = LLUUID.Zero; - - public AssetTransaction() - { - - } - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Assets/AssetCache.cs b/OpenSim/OpenSim.RegionServer/Assets/AssetCache.cs deleted file mode 100644 index 466f9f9..0000000 --- a/OpenSim/OpenSim.RegionServer/Assets/AssetCache.cs +++ /dev/null @@ -1,572 +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.Threading; -using libsecondlife; -using libsecondlife.Packets; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Console; -using OpenSim.RegionServer.Client; - -namespace OpenSim.RegionServer.Assets -{ - /// - /// Manages local cache of assets and their sending to viewers. - /// - public class AssetCache : IAssetReceiver - { - public Dictionary Assets; - public Dictionary Textures; - - public List AssetRequests = new List(); //assets ready to be sent to viewers - public List TextureRequests = new List(); //textures ready to be sent - - public Dictionary RequestedAssets = new Dictionary(); //Assets requested from the asset server - public Dictionary RequestedTextures = new Dictionary(); //Textures requested from the asset server - - private IAssetServer _assetServer; - private Thread _assetCacheThread; - private LLUUID[] textureList = new LLUUID[5]; - - /// - /// - /// - public AssetCache(IAssetServer assetServer) - { - MainConsole.Instance.Verbose("Creating Asset cache"); - _assetServer = assetServer; - _assetServer.SetReceiver(this); - Assets = new Dictionary(); - Textures = new Dictionary(); - this._assetCacheThread = new Thread(new ThreadStart(RunAssetManager)); - this._assetCacheThread.IsBackground = true; - this._assetCacheThread.Start(); - - } - - /// - /// - /// - public void RunAssetManager() - { - while (true) - { - try - { - this.ProcessAssetQueue(); - this.ProcessTextureQueue(); - Thread.Sleep(500); - } - catch (Exception e) - { - MainConsole.Instance.Error(e.Message); - } - } - } - - public void LoadDefaultTextureSet() - { - //hack: so we can give each user a set of textures - textureList[0] = new LLUUID("00000000-0000-0000-9999-000000000001"); - textureList[1] = new LLUUID("00000000-0000-0000-9999-000000000002"); - textureList[2] = new LLUUID("00000000-0000-0000-9999-000000000003"); - textureList[3] = new LLUUID("00000000-0000-0000-9999-000000000004"); - textureList[4] = new LLUUID("00000000-0000-0000-9999-000000000005"); - - for (int i = 0; i < textureList.Length; i++) - { - this._assetServer.RequestAsset(textureList[i], true); - } - - } - - public AssetBase[] CreateNewInventorySet(LLUUID agentID) - { - AssetBase[] inventorySet = new AssetBase[this.textureList.Length]; - for (int i = 0; i < textureList.Length; i++) - { - if (this.Textures.ContainsKey(textureList[i])) - { - inventorySet[i] = this.CloneImage(agentID, this.Textures[textureList[i]]); - TextureImage image = new TextureImage(inventorySet[i]); - this.Textures.Add(image.FullID, image); - this._assetServer.UploadNewAsset(image); //save the asset to the asset server - } - } - return inventorySet; - } - - public AssetBase GetAsset(LLUUID assetID) - { - AssetBase asset = null; - if(this.Textures.ContainsKey(assetID)) - { - asset = this.Textures[assetID]; - } - else if (this.Assets.ContainsKey(assetID)) - { - asset = this.Assets[assetID]; - } - return asset; - } - - public void AddAsset(AssetBase asset) - { - if (asset.Type == 0) - { - if (!this.Textures.ContainsKey(asset.FullID)) - { //texture - TextureImage textur = new TextureImage(asset); - this.Textures.Add(textur.FullID, textur); - this._assetServer.UploadNewAsset(asset); - } - } - else - { - if (!this.Assets.ContainsKey(asset.FullID)) - { - AssetInfo assetInf = new AssetInfo(asset); - this.Assets.Add(assetInf.FullID, assetInf); - this._assetServer.UploadNewAsset(asset); - } - } - } - - /// - /// - /// - private void ProcessTextureQueue() - { - if (this.TextureRequests.Count == 0) - { - //no requests waiting - return; - } - int num; - - if (this.TextureRequests.Count < 5) - { - //lower than 5 so do all of them - num = this.TextureRequests.Count; - } - else - { - num = 5; - } - AssetRequest req; - for (int i = 0; i < num; i++) - { - req = (AssetRequest)this.TextureRequests[i]; - if (req.PacketCounter != req.NumPackets) - { - // if (req.ImageInfo.FullID == new LLUUID("00000000-0000-0000-5005-000000000005")) - if (req.PacketCounter == 0) - { - //first time for this request so send imagedata packet - if (req.NumPackets == 1) - { - //only one packet so send whole file - ImageDataPacket im = new ImageDataPacket(); - im.ImageID.Packets = 1; - im.ImageID.ID = req.ImageInfo.FullID; - im.ImageID.Size = (uint)req.ImageInfo.Data.Length; - im.ImageData.Data = req.ImageInfo.Data; - im.ImageID.Codec = 2; - req.RequestUser.OutPacket(im); - req.PacketCounter++; - //req.ImageInfo.l= time; - } - else - { - //more than one packet so split file up - ImageDataPacket im = new ImageDataPacket(); - im.ImageID.Packets = (ushort)req.NumPackets; - im.ImageID.ID = req.ImageInfo.FullID; - im.ImageID.Size = (uint)req.ImageInfo.Data.Length; - im.ImageData.Data = new byte[600]; - Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600); - im.ImageID.Codec = 2; - req.RequestUser.OutPacket(im); - req.PacketCounter++; - //req.ImageInfo.last_used = time; - } - } - else - { - //send imagepacket - //more than one packet so split file up - ImagePacketPacket im = new ImagePacketPacket(); - im.ImageID.Packet = (ushort)req.PacketCounter; - im.ImageID.ID = req.ImageInfo.FullID; - int size = req.ImageInfo.Data.Length - 600 - 1000 * (req.PacketCounter - 1); - if (size > 1000) size = 1000; - im.ImageData.Data = new byte[size]; - Array.Copy(req.ImageInfo.Data, 600 + 1000 * (req.PacketCounter - 1), im.ImageData.Data, 0, size); - req.RequestUser.OutPacket(im); - req.PacketCounter++; - //req.ImageInfo.last_used = time; - } - } - } - - //remove requests that have been completed - int count = 0; - for (int i = 0; i < num; i++) - { - if (this.TextureRequests.Count > count) - { - req = (AssetRequest)this.TextureRequests[count]; - if (req.PacketCounter == req.NumPackets) - { - this.TextureRequests.Remove(req); - } - else - { - count++; - } - } - } - - } - public void AssetReceived(AssetBase asset, bool IsTexture) - { - if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server - { - //check if it is a texture or not - //then add to the correct cache list - //then check for waiting requests for this asset/texture (in the Requested lists) - //and move those requests into the Requests list. - if (IsTexture) - { - TextureImage image = new TextureImage(asset); - this.Textures.Add(image.FullID, image); - if (this.RequestedTextures.ContainsKey(image.FullID)) - { - AssetRequest req = this.RequestedTextures[image.FullID]; - req.ImageInfo = image; - if (image.Data.LongLength > 600) - { - //over 600 bytes so split up file - req.NumPackets = 1 + (int)(image.Data.Length - 600 + 999) / 1000; - } - else - { - req.NumPackets = 1; - } - this.RequestedTextures.Remove(image.FullID); - this.TextureRequests.Add(req); - } - } - else - { - AssetInfo assetInf = new AssetInfo(asset); - this.Assets.Add(assetInf.FullID, assetInf); - if (this.RequestedAssets.ContainsKey(assetInf.FullID)) - { - AssetRequest req = this.RequestedAssets[assetInf.FullID]; - req.AssetInf = assetInf; - if (assetInf.Data.LongLength > 600) - { - //over 600 bytes so split up file - req.NumPackets = 1 + (int)(assetInf.Data.Length - 600 + 999) / 1000; - } - else - { - req.NumPackets = 1; - } - this.RequestedAssets.Remove(assetInf.FullID); - this.AssetRequests.Add(req); - } - } - } - } - - public void AssetNotFound(AssetBase asset) - { - //the asset server had no knowledge of requested asset - - } - - #region Assets - /// - /// - /// - /// - /// - public void AddAssetRequest(ClientView userInfo, TransferRequestPacket transferRequest) - { - LLUUID requestID = new LLUUID(transferRequest.TransferInfo.Params, 0); - //check to see if asset is in local cache, if not we need to request it from asset server. - if (!this.Assets.ContainsKey(requestID)) - { - //not found asset - // so request from asset server - if (!this.RequestedAssets.ContainsKey(requestID)) - { - AssetRequest request = new AssetRequest(); - request.RequestUser = userInfo; - request.RequestAssetID = requestID; - request.TransferRequestID = transferRequest.TransferInfo.TransferID; - this.RequestedAssets.Add(requestID, request); - this._assetServer.RequestAsset(requestID, false); - } - return; - } - //it is in our cache - AssetInfo asset = this.Assets[requestID]; - - //work out how many packets it should be sent in - // and add to the AssetRequests list - AssetRequest req = new AssetRequest(); - req.RequestUser = userInfo; - req.RequestAssetID = requestID; - req.TransferRequestID = transferRequest.TransferInfo.TransferID; - req.AssetInf = asset; - - if (asset.Data.LongLength > 600) - { - //over 600 bytes so split up file - req.NumPackets = 1 + (int)(asset.Data.Length - 600 + 999) / 1000; - } - else - { - req.NumPackets = 1; - } - - this.AssetRequests.Add(req); - } - - /// - /// - /// - private void ProcessAssetQueue() - { - if (this.AssetRequests.Count == 0) - { - //no requests waiting - return; - } - int num; - - if (this.AssetRequests.Count < 5) - { - //lower than 5 so do all of them - num = this.AssetRequests.Count; - } - else - { - num = 5; - } - AssetRequest req; - for (int i = 0; i < num; i++) - { - req = (AssetRequest)this.AssetRequests[i]; - - TransferInfoPacket Transfer = new TransferInfoPacket(); - Transfer.TransferInfo.ChannelType = 2; - Transfer.TransferInfo.Status = 0; - Transfer.TransferInfo.TargetType = 0; - Transfer.TransferInfo.Params = req.RequestAssetID.GetBytes(); - Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length; - Transfer.TransferInfo.TransferID = req.TransferRequestID; - req.RequestUser.OutPacket(Transfer); - - if (req.NumPackets == 1) - { - TransferPacketPacket TransferPacket = new TransferPacketPacket(); - TransferPacket.TransferData.Packet = 0; - TransferPacket.TransferData.ChannelType = 2; - TransferPacket.TransferData.TransferID = req.TransferRequestID; - TransferPacket.TransferData.Data = req.AssetInf.Data; - TransferPacket.TransferData.Status = 1; - req.RequestUser.OutPacket(TransferPacket); - } - else - { - //more than one packet so split file up , for now it can't be bigger than 2000 bytes - TransferPacketPacket TransferPacket = new TransferPacketPacket(); - TransferPacket.TransferData.Packet = 0; - TransferPacket.TransferData.ChannelType = 2; - TransferPacket.TransferData.TransferID = req.TransferRequestID; - byte[] chunk = new byte[1000]; - Array.Copy(req.AssetInf.Data, chunk, 1000); - TransferPacket.TransferData.Data = chunk; - TransferPacket.TransferData.Status = 0; - req.RequestUser.OutPacket(TransferPacket); - - TransferPacket = new TransferPacketPacket(); - TransferPacket.TransferData.Packet = 1; - TransferPacket.TransferData.ChannelType = 2; - TransferPacket.TransferData.TransferID = req.TransferRequestID; - byte[] chunk1 = new byte[(req.AssetInf.Data.Length - 1000)]; - Array.Copy(req.AssetInf.Data, 1000, chunk1, 0, chunk1.Length); - TransferPacket.TransferData.Data = chunk1; - TransferPacket.TransferData.Status = 1; - req.RequestUser.OutPacket(TransferPacket); - } - - } - - //remove requests that have been completed - for (int i = 0; i < num; i++) - { - this.AssetRequests.RemoveAt(0); - } - - } - - public AssetInfo CloneAsset(LLUUID newOwner, AssetInfo sourceAsset) - { - AssetInfo newAsset = new AssetInfo(); - newAsset.Data = new byte[sourceAsset.Data.Length]; - Array.Copy(sourceAsset.Data, newAsset.Data, sourceAsset.Data.Length); - newAsset.FullID = LLUUID.Random(); - newAsset.Type = sourceAsset.Type; - newAsset.InvType = sourceAsset.InvType; - return (newAsset); - } - #endregion - - #region Textures - /// - /// - /// - /// - /// - public void AddTextureRequest(ClientView userInfo, LLUUID imageID) - { - //check to see if texture is in local cache, if not request from asset server - if (!this.Textures.ContainsKey(imageID)) - { - if (!this.RequestedTextures.ContainsKey(imageID)) - { - //not is cache so request from asset server - AssetRequest request = new AssetRequest(); - request.RequestUser = userInfo; - request.RequestAssetID = imageID; - request.IsTextureRequest = true; - this.RequestedTextures.Add(imageID, request); - this._assetServer.RequestAsset(imageID, true); - } - return; - } - - TextureImage imag = this.Textures[imageID]; - AssetRequest req = new AssetRequest(); - req.RequestUser = userInfo; - req.RequestAssetID = imageID; - req.IsTextureRequest = true; - req.ImageInfo = imag; - - if (imag.Data.LongLength > 600) - { - //over 600 bytes so split up file - req.NumPackets = 1 + (int)(imag.Data.Length - 600 + 999) / 1000; - } - else - { - req.NumPackets = 1; - } - this.TextureRequests.Add(req); - } - - public TextureImage CloneImage(LLUUID newOwner, TextureImage source) - { - TextureImage newImage = new TextureImage(); - newImage.Data = new byte[source.Data.Length]; - Array.Copy(source.Data, newImage.Data, source.Data.Length); - //newImage.filename = source.filename; - newImage.FullID = LLUUID.Random(); - newImage.Name = source.Name; - return (newImage); - } - #endregion - - } - - public class AssetRequest - { - public ClientView RequestUser; - public LLUUID RequestAssetID; - public AssetInfo AssetInf; - public TextureImage ImageInfo; - public LLUUID TransferRequestID; - public long DataPointer = 0; - public int NumPackets = 0; - public int PacketCounter = 0; - public bool IsTextureRequest; - //public bool AssetInCache; - //public int TimeRequested; - - public AssetRequest() - { - - } - } - - public class AssetInfo : AssetBase - { - public AssetInfo() - { - - } - - public AssetInfo(AssetBase aBase) - { - Data = aBase.Data; - FullID = aBase.FullID; - Type = aBase.Type; - InvType = aBase.InvType; - Name = aBase.Name; - Description = aBase.Description; - } - } - - public class TextureImage : AssetBase - { - public TextureImage() - { - - } - - public TextureImage(AssetBase aBase) - { - Data = aBase.Data; - FullID = aBase.FullID; - Type = aBase.Type; - InvType = aBase.InvType; - Name = aBase.Name; - Description = aBase.Description; - } - } - -} diff --git a/OpenSim/OpenSim.RegionServer/Assets/InventoryCache.cs b/OpenSim/OpenSim.RegionServer/Assets/InventoryCache.cs deleted file mode 100644 index 9ed5dcb..0000000 --- a/OpenSim/OpenSim.RegionServer/Assets/InventoryCache.cs +++ /dev/null @@ -1,338 +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 libsecondlife; -using OpenSim; -using libsecondlife.Packets; - -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Types; -using OpenSim.Framework.Interfaces; -using OpenSim.RegionServer.Client; - -namespace OpenSim.RegionServer.Assets -{ - /// - /// Description of InventoryManager. - /// - public class InventoryCache - { - private Dictionary _agentsInventory; - private List _serverRequests; //list of requests made to user server. - private System.Text.Encoding _enc = System.Text.Encoding.ASCII; - private const uint FULL_MASK_PERMISSIONS = 2147483647; - - public InventoryCache() - { - _agentsInventory = new Dictionary(); - _serverRequests = new List(); - } - - public void AddNewAgentsInventory(AgentInventory agentInventory) - { - if (!this._agentsInventory.ContainsKey(agentInventory.AgentID)) - { - this._agentsInventory.Add(agentInventory.AgentID, agentInventory); - } - } - - public AgentInventory FetchAgentsInventory(LLUUID agentID, IUserServer userserver) - { - AgentInventory res = null; - if (!this._agentsInventory.ContainsKey(agentID)) - { - res = userserver.RequestAgentsInventory(agentID); - this._agentsInventory.Add(agentID,res); - } - return res; - } - - public AgentInventory GetAgentsInventory(LLUUID agentID) - { - if (this._agentsInventory.ContainsKey(agentID)) - { - return this._agentsInventory[agentID]; - } - - return null; - } - - public void ClientLeaving(LLUUID clientID, IUserServer userserver) - { - if (this._agentsInventory.ContainsKey(clientID)) - { - if (userserver != null) - { - userserver.UpdateAgentsInventory(clientID, this._agentsInventory[clientID]); - } - this._agentsInventory.Remove(clientID); - } - } - - public bool CreateNewInventoryFolder(ClientView remoteClient, LLUUID folderID) - { - return this.CreateNewInventoryFolder(remoteClient, folderID, 0); - } - - public bool CreateNewInventoryFolder(ClientView remoteClient, LLUUID folderID, ushort type) - { - bool res = false; - if (folderID != LLUUID.Zero) //don't create a folder with a zero id - { - if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) - { - res = this._agentsInventory[remoteClient.AgentID].CreateNewFolder(folderID, type); - } - } - return res; - } - - public bool CreateNewInventoryFolder(ClientView remoteClient, LLUUID folderID, ushort type, string folderName, LLUUID parent) - { - bool res = false; - if (folderID != LLUUID.Zero) //don't create a folder with a zero id - { - if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) - { - res = this._agentsInventory[remoteClient.AgentID].CreateNewFolder(folderID, type, folderName, parent); - } - } - return res; - } - - public LLUUID AddNewInventoryItem(ClientView remoteClient, LLUUID folderID, OpenSim.Framework.Types.AssetBase asset) - { - LLUUID newItem = null; - if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) - { - newItem = this._agentsInventory[remoteClient.AgentID].AddToInventory(folderID, asset); - if (newItem != null) - { - InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[newItem]; - this.SendItemUpdateCreate(remoteClient, Item); - } - } - - return newItem; - } - public bool DeleteInventoryItem(ClientView remoteClient, LLUUID itemID) - { - bool res = false; - if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) - { - res = this._agentsInventory[remoteClient.AgentID].DeleteFromInventory(itemID); - if (res) - { - RemoveInventoryItemPacket remove = new RemoveInventoryItemPacket(); - remove.AgentData.AgentID = remoteClient.AgentID; - remove.AgentData.SessionID = remoteClient.SessionID; - remove.InventoryData = new RemoveInventoryItemPacket.InventoryDataBlock[1]; - remove.InventoryData[0] = new RemoveInventoryItemPacket.InventoryDataBlock(); - remove.InventoryData[0].ItemID = itemID; - remoteClient.OutPacket(remove); - } - } - - return res; - } - - public bool UpdateInventoryItemAsset(ClientView remoteClient, LLUUID itemID, OpenSim.Framework.Types.AssetBase asset) - { - if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) - { - bool res = _agentsInventory[remoteClient.AgentID].UpdateItemAsset(itemID, asset); - if (res) - { - InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID]; - this.SendItemUpdateCreate(remoteClient, Item); - } - return res; - } - - return false; - } - - public bool UpdateInventoryItemDetails(ClientView remoteClient, LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet) - { - if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) - { - bool res = _agentsInventory[remoteClient.AgentID].UpdateItemDetails(itemID, packet); - if (res) - { - InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID]; - this.SendItemUpdateCreate(remoteClient, Item); - } - return res; - } - - return false; - } - - public void FetchInventoryDescendents(ClientView userInfo, FetchInventoryDescendentsPacket FetchDescend) - { - if (this._agentsInventory.ContainsKey(userInfo.AgentID)) - { - AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID]; - if (FetchDescend.InventoryData.FetchItems) - { - if (agentInventory.InventoryFolders.ContainsKey(FetchDescend.InventoryData.FolderID)) - { - InventoryFolder Folder = agentInventory.InventoryFolders[FetchDescend.InventoryData.FolderID]; - InventoryDescendentsPacket Descend = new InventoryDescendentsPacket(); - Descend.AgentData.AgentID = userInfo.AgentID; - Descend.AgentData.OwnerID = Folder.OwnerID; - Descend.AgentData.FolderID = FetchDescend.InventoryData.FolderID; - Descend.AgentData.Descendents = Folder.Items.Count; - Descend.AgentData.Version = Folder.Items.Count; - - - Descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[Folder.Items.Count]; - for (int i = 0; i < Folder.Items.Count; i++) - { - - InventoryItem Item = Folder.Items[i]; - Descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock(); - Descend.ItemData[i].ItemID = Item.ItemID; - Descend.ItemData[i].AssetID = Item.AssetID; - Descend.ItemData[i].CreatorID = Item.CreatorID; - Descend.ItemData[i].BaseMask = FULL_MASK_PERMISSIONS; - Descend.ItemData[i].CreationDate = 1000; - Descend.ItemData[i].Description = _enc.GetBytes(Item.Description + "\0"); - Descend.ItemData[i].EveryoneMask = FULL_MASK_PERMISSIONS; - Descend.ItemData[i].Flags = 1; - Descend.ItemData[i].FolderID = Item.FolderID; - Descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); - Descend.ItemData[i].GroupMask = FULL_MASK_PERMISSIONS; - Descend.ItemData[i].InvType = Item.InvType; - Descend.ItemData[i].Name = _enc.GetBytes(Item.Name + "\0"); - Descend.ItemData[i].NextOwnerMask = FULL_MASK_PERMISSIONS; - Descend.ItemData[i].OwnerID = Item.OwnerID; - Descend.ItemData[i].OwnerMask = FULL_MASK_PERMISSIONS; - Descend.ItemData[i].SalePrice = 100; - Descend.ItemData[i].SaleType = 0; - Descend.ItemData[i].Type = Item.Type; - Descend.ItemData[i].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, Descend.ItemData[i].InvType, Descend.ItemData[i].Type, Descend.ItemData[i].AssetID, Descend.ItemData[i].GroupID, 100, Descend.ItemData[i].OwnerID, Descend.ItemData[i].CreatorID, Descend.ItemData[i].ItemID, Descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); - } - - userInfo.OutPacket(Descend); - - } - } - else - { - Console.WriteLine("fetch subfolders"); - } - } - } - - public void FetchInventory(ClientView userInfo, FetchInventoryPacket FetchItems) - { - if (this._agentsInventory.ContainsKey(userInfo.AgentID)) - { - AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID]; - - for (int i = 0; i < FetchItems.InventoryData.Length; i++) - { - if (agentInventory.InventoryItems.ContainsKey(FetchItems.InventoryData[i].ItemID)) - { - InventoryItem Item = agentInventory.InventoryItems[FetchItems.InventoryData[i].ItemID]; - FetchInventoryReplyPacket InventoryReply = new FetchInventoryReplyPacket(); - InventoryReply.AgentData.AgentID = userInfo.AgentID; - InventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1]; - InventoryReply.InventoryData[0] = new FetchInventoryReplyPacket.InventoryDataBlock(); - InventoryReply.InventoryData[0].ItemID = Item.ItemID; - InventoryReply.InventoryData[0].AssetID = Item.AssetID; - InventoryReply.InventoryData[0].CreatorID = Item.CreatorID; - InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS; - InventoryReply.InventoryData[0].CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; - InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0"); - InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS; - InventoryReply.InventoryData[0].Flags = 0; - InventoryReply.InventoryData[0].FolderID = Item.FolderID; - InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); - InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS; - InventoryReply.InventoryData[0].InvType = Item.InvType; - InventoryReply.InventoryData[0].Name = _enc.GetBytes(Item.Name + "\0"); - InventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS; - InventoryReply.InventoryData[0].OwnerID = Item.OwnerID; - InventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS; - InventoryReply.InventoryData[0].SalePrice = 100; - InventoryReply.InventoryData[0].SaleType = 0; - InventoryReply.InventoryData[0].Type = Item.Type; - InventoryReply.InventoryData[0].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); - userInfo.OutPacket(InventoryReply); - } - } - } - } - - private void SendItemUpdateCreate(ClientView remoteClient, InventoryItem Item) - { - - UpdateCreateInventoryItemPacket InventoryReply = new UpdateCreateInventoryItemPacket(); - InventoryReply.AgentData.AgentID = remoteClient.AgentID; - InventoryReply.AgentData.SimApproved = true; - InventoryReply.InventoryData = new UpdateCreateInventoryItemPacket.InventoryDataBlock[1]; - InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock(); - InventoryReply.InventoryData[0].ItemID = Item.ItemID; - InventoryReply.InventoryData[0].AssetID = Item.AssetID; - InventoryReply.InventoryData[0].CreatorID = Item.CreatorID; - InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS; - InventoryReply.InventoryData[0].CreationDate = 1000; - InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0"); - InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS; - InventoryReply.InventoryData[0].Flags = 0; - InventoryReply.InventoryData[0].FolderID = Item.FolderID; - InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); - InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS; - InventoryReply.InventoryData[0].InvType = Item.InvType; - InventoryReply.InventoryData[0].Name = _enc.GetBytes(Item.Name + "\0"); - InventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS; - InventoryReply.InventoryData[0].OwnerID = Item.OwnerID; - InventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS; - InventoryReply.InventoryData[0].SalePrice = 100; - InventoryReply.InventoryData[0].SaleType = 0; - InventoryReply.InventoryData[0].Type = Item.Type; - InventoryReply.InventoryData[0].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); - - remoteClient.OutPacket(InventoryReply); - } - } - - - - public class UserServerRequest - { - public UserServerRequest() - { - - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs deleted file mode 100644 index 6f80210..0000000 --- a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs +++ /dev/null @@ -1,131 +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.Interfaces; -using OpenSim.Framework.Types; - -namespace OpenSim.RegionServer -{ - public class AuthenticateSessionsBase - { - public Dictionary AgentCircuits = new Dictionary(); - - public AuthenticateSessionsBase() - { - - } - - public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode) - { - AgentCircuitData validcircuit = null; - if (this.AgentCircuits.ContainsKey(circuitcode)) - { - validcircuit = this.AgentCircuits[circuitcode]; - } - AuthenticateResponse user = new AuthenticateResponse(); - if (validcircuit == null) - { - //don't have this circuit code in our list - user.Authorised = false; - return (user); - } - - if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) - { - user.Authorised = true; - user.LoginInfo = new Login(); - user.LoginInfo.Agent = agentID; - user.LoginInfo.Session = sessionID; - user.LoginInfo.SecureSession = validcircuit.SecureSessionID; - user.LoginInfo.First = validcircuit.firstname; - user.LoginInfo.Last = validcircuit.lastname; - user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; - user.LoginInfo.BaseFolder = validcircuit.BaseFolder; - } - else - { - // Invalid - user.Authorised = false; - } - - return (user); - } - - public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) - { - if (this.AgentCircuits.ContainsKey(circuitCode)) - { - this.AgentCircuits[circuitCode] = agentData; - } - else - { - this.AgentCircuits.Add(circuitCode, agentData); - } - } - - public LLVector3 GetPosition(uint circuitCode) - { - LLVector3 vec = new LLVector3(); - if (this.AgentCircuits.ContainsKey(circuitCode)) - { - vec = this.AgentCircuits[circuitCode].startpos; - } - return vec; - } - - public void UpdateAgentData(AgentCircuitData agentData) - { - if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode)) - { - this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname; - this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname; - this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos; - } - } - - public void UpdateAgentChildStatus(uint circuitcode, bool childstatus) - { - if (this.AgentCircuits.ContainsKey(circuitcode)) - { - this.AgentCircuits[circuitcode].child = childstatus; - } - } - - public bool GetAgentChildStatus(uint circuitcode) - { - if (this.AgentCircuits.ContainsKey(circuitcode)) - { - return this.AgentCircuits[circuitcode].child; - } - return false; - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs deleted file mode 100644 index e0ffd71..0000000 --- a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.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; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Types; - -namespace OpenSim.RegionServer -{ - public class AuthenticateSessionsLocal : AuthenticateSessionsBase - { - public AuthenticateSessionsLocal() - { - - } - - public void AddNewSession(Login loginData) - { - AgentCircuitData agent = new AgentCircuitData(); - agent.AgentID = loginData.Agent; - agent.firstname = loginData.First; - agent.lastname = loginData.Last; - agent.SessionID = loginData.Session; - agent.SecureSessionID = loginData.SecureSession; - agent.circuitcode = loginData.CircuitCode; - agent.BaseFolder = loginData.BaseFolder; - agent.InventoryFolder = loginData.InventoryFolder; - agent.startpos = new LLVector3(128,128,70); - this.AddNewCircuit(agent.circuitcode, agent); - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs deleted file mode 100644 index 5747f8a..0000000 --- a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs +++ /dev/null @@ -1,72 +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 System.Xml; -using libsecondlife; -using OpenSim.Framework.Types; -using Nwc.XmlRpc; - -namespace OpenSim.RegionServer -{ - public class AuthenticateSessionsRemote : AuthenticateSessionsBase - { - public AuthenticateSessionsRemote() - { - - } - - public XmlRpcResponse ExpectUser(XmlRpcRequest request) - { - Hashtable requestData = (Hashtable)request.Params[0]; - AgentCircuitData agentData = new AgentCircuitData(); - agentData.SessionID = new LLUUID((string)requestData["session_id"]); - agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]); - agentData.firstname = (string)requestData["firstname"]; - agentData.lastname = (string)requestData["lastname"]; - agentData.AgentID = new LLUUID((string)requestData["agent_id"]); - agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); - if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) - { - agentData.child = true; - } - else - { - agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"])); - agentData.child = false; - - } - - this.AddNewCircuit(agentData.circuitcode, agentData); - - return new XmlRpcResponse(); - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs b/OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs deleted file mode 100644 index ead902d..0000000 --- a/OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs +++ /dev/null @@ -1,281 +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.IO; -using OpenSim.RegionServer.Simulator; -using OpenSim.UserServer; -using OpenSim.Servers; -using OpenSim.RegionServer.Assets; -using OpenSim.Framework.Inventory; -using libsecondlife; -using OpenSim.RegionServer.Scripting; -using Avatar=libsecondlife.Avatar; - -namespace OpenSim.RegionServer.CAPS -{ - public class AdminWebFront - { - private string AdminPage; - private string NewAccountForm; - private string LoginForm; - private string passWord = "Admin"; - private World m_world; - private LoginServer _userServer; - private InventoryCache _inventoryCache; - - public AdminWebFront(string password, World world, InventoryCache inventoryCache, LoginServer userserver) - { - _inventoryCache = inventoryCache; - _userServer = userserver; - m_world = world; - passWord = password; - LoadAdminPage(); - } - - public void LoadMethods( BaseHttpServer server ) - { - server.AddRestHandler("GET", "/Admin", GetAdminPage); - server.AddRestHandler("GET", "/Admin/Welcome", GetWelcomePage); - server.AddRestHandler("GET", "/Admin/Accounts", GetAccountsPage ); - server.AddRestHandler("GET", "/Admin/Clients", GetConnectedClientsPage); - server.AddRestHandler("GET", "/Admin/Entities", GetEntitiesPage); - server.AddRestHandler("GET", "/Admin/Scripts", GetScriptsPage); - server.AddRestHandler("GET", "/Admin/AddTestScript", AddTestScript ); - server.AddRestHandler("GET", "/ClientInventory", GetClientsInventory); - - server.AddRestHandler("POST", "/Admin/NewAccount", PostNewAccount ); - server.AddRestHandler("POST", "/Admin/Login", PostLogin ); - } - - private string GetWelcomePage(string request, string path, string param) - { - string responseString; - responseString = "Welcome to the OpenSim Admin Page"; - responseString += "


" + LoginForm; - return responseString; - } - - private string PostLogin(string requestBody, string path, string param) - { - string responseString; - if (requestBody == passWord) - { - responseString = "

Login Successful

"; - } - else - { - responseString = "

Password Error

"; - responseString += "

Please Login with the correct password

"; - responseString += "

" + LoginForm; - } - return responseString; - } - - private string PostNewAccount(string requestBody, string path, string param) - { - string responseString; - string firstName = ""; - string secondName = ""; - string userPasswd = ""; - string[] comp; - string[] passw; - string[] line; - string delimStr = "&"; - char[] delimiter = delimStr.ToCharArray(); - string delimStr2 = "="; - char[] delimiter2 = delimStr2.ToCharArray(); - - comp = requestBody.Split(delimiter); - passw = comp[3].Split(delimiter2); - if (passw[1] == passWord) // check admin password is correct - { - - line = comp[0].Split(delimiter2); //split firstname - if (line.Length > 1) - { - firstName = line[1]; - } - line = comp[1].Split(delimiter2); //split secondname - if (line.Length > 1) - { - secondName = line[1]; - } - line = comp[2].Split(delimiter2); //split user password - if (line.Length > 1) - { - userPasswd = line[1]; - } - if (this._userServer != null) - { - this._userServer.CreateUserAccount(firstName, secondName, userPasswd); - } - responseString = "

New Account created

"; - } - else - { - responseString = "

Admin password is incorrect, please login with the correct password

"; - responseString += "

" + LoginForm; - } - return responseString; - } - - private string GetConnectedClientsPage(string request, string path, string param) - { - string responseString; - responseString = "

Listing connected Clients

"; - OpenSim.RegionServer.Simulator.Avatar TempAv; - foreach (libsecondlife.LLUUID UUID in m_world.Entities.Keys) - { - if (m_world.Entities[UUID].ToString() == "OpenSim.RegionServer.Simulator.Avatar") - { - TempAv = (OpenSim.RegionServer.Simulator.Avatar)m_world.Entities[UUID]; - responseString += "

Client: "; - responseString += TempAv.firstname + " , " + TempAv.lastname + " , " + UUID + " , " + TempAv.ControllingClient.SessionID + " , " + TempAv.ControllingClient.CircuitCode + " , " + TempAv.ControllingClient.userEP.ToString(); - responseString += "

"; - } - } - return responseString; - } - - private string AddTestScript(string request, string path, string param) - { - int index = path.LastIndexOf('/'); - - string lluidStr = path.Substring(index+1); - - LLUUID id; - - if( LLUUID.TryParse( lluidStr, out id ) ) - { - // This is just here for concept purposes... Remove! - m_world.AddScript( m_world.Entities[id], new FollowRandomAvatar()); - return String.Format("Added new script to object [{0}]", id); - } - else - { - return String.Format("Couldn't parse [{0}]", lluidStr ); - } - } - - private string GetScriptsPage(string request, string path, string param) - { - return String.Empty; - } - - private string GetEntitiesPage(string request, string path, string param) - { - string responseString; - responseString = "

Listing current entities

    "; - - foreach (Entity entity in m_world.Entities.Values) - { - string testScriptLink = "javascript:loadXMLDoc('Admin/AddTestScript/" + entity.uuid.ToString() + "');"; - responseString += String.Format( "
  • [{0}] \"{1}\" @ {2} add test script
  • ", entity.uuid, entity.Name, entity.Pos, testScriptLink ); - } - responseString += "
"; - return responseString; - } - - private string GetClientsInventory(string request, string path, string param) - { - string[] line; - string delimStr = "/"; - char[] delimiter = delimStr.ToCharArray(); - string responseString; - responseString = "

Listing Inventory

"; - - line = path.Split(delimiter); - if (line.Length > 2) - { - if (line[1] == "ClientInventory") - { - AgentInventory inven = this._inventoryCache.GetAgentsInventory(new libsecondlife.LLUUID(line[2])); - responseString += "

Client: " + inven.AgentID.ToStringHyphenated() +"

"; - if (inven != null) - { - foreach (InventoryItem item in inven.InventoryItems.Values) - { - responseString += "

InventoryItem: "; - responseString += item.Name +" , "+ item.ItemID +" , "+ item.Type +" , "+ item.FolderID +" , "+ item.AssetID +" , "+ item.Description ; - responseString += "

"; - } - } - } - } - return responseString; - } - - private string GetCachedAssets(string request, string path, string param) - { - return ""; - } - - private string GetAccountsPage(string request, string path, string param) - { - string responseString; - responseString = "

Account management

"; - responseString += "
"; - responseString += "

Create New Account

"; - responseString += NewAccountForm; - return responseString; - } - - private string GetAdminPage(string request, string path, string param) - { - return AdminPage; - } - - private void LoadAdminPage() - { - try - { - StreamReader SR; - - SR = File.OpenText("testadmin.htm"); - AdminPage = SR.ReadToEnd(); - SR.Close(); - - SR = File.OpenText("newaccountform.htm"); - NewAccountForm = SR.ReadToEnd(); - SR.Close(); - - SR = File.OpenText("login.htm"); - LoginForm = SR.ReadToEnd(); - SR.Close(); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - - } - - } -} diff --git a/OpenSim/OpenSim.RegionServer/Client/ClientView.Grid.cs b/OpenSim/OpenSim.RegionServer/Client/ClientView.Grid.cs deleted file mode 100644 index 0bccbc2..0000000 --- a/OpenSim/OpenSim.RegionServer/Client/ClientView.Grid.cs +++ /dev/null @@ -1,192 +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 libsecondlife; -using libsecondlife.Packets; -using Nwc.XmlRpc; -using System.Net; -using System.Net.Sockets; -using System.IO; -using System.Threading; -using System.Timers; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; -using OpenSim.RegionServer.Simulator; -using OpenSim.RegionServer.Assets; -using OpenSim.Framework.Console; - -namespace OpenSim.RegionServer.Client -{ - public partial class ClientView - { - - public void EnableNeighbours() - { - if ((this.m_gridServer.GetName() == "Remote") && (!this.m_child)) - { - Hashtable SimParams; - ArrayList SendParams; - XmlRpcRequest GridReq; - XmlRpcResponse GridResp; - List enablePackets = new List(); - - RemoteGridBase gridServer = (RemoteGridBase)this.m_gridServer; - - foreach (Hashtable neighbour in gridServer.neighbours) - { - try - { - string neighbourIPStr = (string)neighbour["sim_ip"]; - System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr); - ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]); - string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString(); - - MainConsole.Instance.Verbose("Requesting " + reqUrl); - - SimParams = new Hashtable(); - SimParams["session_id"] = this.SessionID.ToString(); - SimParams["secure_session_id"] = this.SecureSessionID.ToString(); - SimParams["firstname"] = this.ClientAvatar.firstname; - SimParams["lastname"] = this.ClientAvatar.lastname; - SimParams["agent_id"] = this.AgentID.ToString(); - SimParams["circuit_code"] = (Int32)this.CircuitCode; - SimParams["child_agent"] = "1"; - SendParams = new ArrayList(); - SendParams.Add(SimParams); - - GridReq = new XmlRpcRequest("expect_user", SendParams); - GridResp = GridReq.Send(reqUrl, 3000); - EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); - enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); - enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256)); - - - byte[] byteIP = neighbourIP.GetAddressBytes(); - enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24; - enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16; - enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8; - enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0]; - enablesimpacket.SimulatorInfo.Port = neighbourPort; - enablePackets.Add(enablesimpacket); - } - catch - { - MainConsole.Instance.Notice("Could not connect to neighbour " + neighbour["sim_ip"] + ":" + neighbour["sim_port"] + ", continuing."); - } - } - Thread.Sleep(3000); - foreach (Packet enable in enablePackets) - { - this.OutPacket(enable); - } - enablePackets.Clear(); - - } - } - - public void CrossSimBorder(LLVector3 avatarpos) - { // VERY VERY BASIC - - LLVector3 newpos = avatarpos; - uint neighbourx = this.m_regionData.RegionLocX; - uint neighboury = this.m_regionData.RegionLocY; - - if (avatarpos.X < 0) - { - neighbourx -= 1; - newpos.X = 254; - } - if (avatarpos.X > 255) - { - neighbourx += 1; - newpos.X = 1; - } - if (avatarpos.Y < 0) - { - neighboury -= 1; - newpos.Y = 254; - } - if (avatarpos.Y > 255) - { - neighboury += 1; - newpos.Y = 1; - } - MainConsole.Instance.Notice("SimClient.cs:CrossSimBorder() - Crossing border to neighbouring sim at [" + neighbourx.ToString() + "," + neighboury.ToString() + "]"); - - Hashtable SimParams; - ArrayList SendParams; - XmlRpcRequest GridReq; - XmlRpcResponse GridResp; - foreach (Hashtable borderingSim in ((RemoteGridBase)m_gridServer).neighbours) - { - if (((string)borderingSim["region_locx"]).Equals(neighbourx.ToString()) && ((string)borderingSim["region_locy"]).Equals(neighboury.ToString())) - { - SimParams = new Hashtable(); - SimParams["firstname"] = this.ClientAvatar.firstname; - SimParams["lastname"] = this.ClientAvatar.lastname; - SimParams["circuit_code"] = this.CircuitCode.ToString(); - SimParams["pos_x"] = newpos.X.ToString(); - SimParams["pos_y"] = newpos.Y.ToString(); - SimParams["pos_z"] = newpos.Z.ToString(); - SendParams = new ArrayList(); - SendParams.Add(SimParams); - - GridReq = new XmlRpcRequest("agent_crossing", SendParams); - GridResp = GridReq.Send("http://" + borderingSim["sim_ip"] + ":" + borderingSim["sim_port"], 3000); - - CrossedRegionPacket NewSimPack = new CrossedRegionPacket(); - NewSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock(); - NewSimPack.AgentData.AgentID = this.AgentID; - NewSimPack.AgentData.SessionID = this.SessionID; - NewSimPack.Info = new CrossedRegionPacket.InfoBlock(); - NewSimPack.Info.Position = newpos; - NewSimPack.Info.LookAt = new LLVector3(0.99f, 0.042f, 0); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!! - NewSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock(); - NewSimPack.RegionData.RegionHandle = Helpers.UIntsToLong((uint)(Convert.ToInt32(borderingSim["region_locx"]) * 256), (uint)(Convert.ToInt32(borderingSim["region_locy"]) * 256)); - System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse((string)borderingSim["sim_ip"]); - byte[] byteIP = neighbourIP.GetAddressBytes(); - NewSimPack.RegionData.SimIP = (uint)byteIP[3] << 24; - NewSimPack.RegionData.SimIP += (uint)byteIP[2] << 16; - NewSimPack.RegionData.SimIP += (uint)byteIP[1] << 8; - NewSimPack.RegionData.SimIP += (uint)byteIP[0]; - NewSimPack.RegionData.SimPort = (ushort)Convert.ToInt32(borderingSim["sim_port"]); - NewSimPack.RegionData.SeedCapability = new byte[0]; - lock (PacketQueue) - { - ProcessOutPacket(NewSimPack); - DowngradeClient(); - } - } - } - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Client/ClientView.PacketHandlers.cs b/OpenSim/OpenSim.RegionServer/Client/ClientView.PacketHandlers.cs deleted file mode 100644 index 4af0485..0000000 --- a/OpenSim/OpenSim.RegionServer/Client/ClientView.PacketHandlers.cs +++ /dev/null @@ -1,196 +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 libsecondlife; -using libsecondlife.Packets; -using Nwc.XmlRpc; -using System.Net; -using System.Net.Sockets; -using System.IO; -using System.Threading; -using System.Timers; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; -using OpenSim.RegionServer.Simulator; -using OpenSim.RegionServer.Assets; -using OpenSim.Framework.Console; - -namespace OpenSim.RegionServer.Client -{ - public partial class ClientView - { - protected virtual void RegisterLocalPacketHandlers() - { - this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout); - this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached); - this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate); - } - - protected virtual bool Logout(ClientView simClient, Packet packet) - { - MainConsole.Instance.Notice("OpenSimClient.cs:ProcessInPacket() - Got a logout request"); - //send reply to let the client logout - LogoutReplyPacket logReply = new LogoutReplyPacket(); - logReply.AgentData.AgentID = this.AgentID; - logReply.AgentData.SessionID = this.SessionID; - logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1]; - logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock(); - logReply.InventoryData[0].ItemID = LLUUID.Zero; - OutPacket(logReply); - //tell all clients to kill our object - KillObjectPacket kill = new KillObjectPacket(); - kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; - kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); - kill.ObjectData[0].ID = this.ClientAvatar.localid; - foreach (ClientView client in m_clientThreads.Values) - { - client.OutPacket(kill); - } - if (this.m_userServer != null) - { - this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer); - } - else - { - this.m_inventoryCache.ClientLeaving(this.AgentID, null); - } - - m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode); - /*lock (m_world.Entities) - { - m_world.Entities.Remove(this.AgentID); - }*/ - m_world.RemoveViewerAgent(this); - //need to do other cleaning up here too - m_clientThreads.Remove(this.CircuitCode); - m_networkServer.RemoveClientCircuit(this.CircuitCode); - this.ClientThread.Abort(); - return true; - } - - protected bool AgentTextureCached(ClientView simclient, Packet packet) - { - AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet; - AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket(); - cachedresp.AgentData.AgentID = this.AgentID; - cachedresp.AgentData.SessionID = this.SessionID; - cachedresp.AgentData.SerialNum = this.cachedtextureserial; - this.cachedtextureserial++; - cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[chechedtex.WearableData.Length]; - for (int i = 0; i < chechedtex.WearableData.Length; i++) - { - cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); - cachedresp.WearableData[i].TextureIndex = chechedtex.WearableData[i].TextureIndex; - cachedresp.WearableData[i].TextureID = LLUUID.Zero; - cachedresp.WearableData[i].HostName = new byte[0]; - } - this.OutPacket(cachedresp); - return true; - } - - protected bool MultipleObjUpdate(ClientView simClient, Packet packet) - { - MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; - for (int i = 0; i < multipleupdate.ObjectData.Length; i++) - { - if (multipleupdate.ObjectData[i].Type == 9) //change position - { - libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); - OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); - //should update stored position of the prim - } - else if (multipleupdate.ObjectData[i].Type == 10)//rotation - { - libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); - OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); - } - else if (multipleupdate.ObjectData[i].Type == 13)//scale - { - libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); - OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); - } - } - return true; - } - - public void RequestMapLayer() //should be getting the map layer from the grid server - { - //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area) - MapLayerReplyPacket mapReply = new MapLayerReplyPacket(); - mapReply.AgentData.AgentID = this.AgentID; - mapReply.AgentData.Flags = 0; - mapReply.LayerData = new MapLayerReplyPacket.LayerDataBlock[1]; - mapReply.LayerData[0] = new MapLayerReplyPacket.LayerDataBlock(); - mapReply.LayerData[0].Bottom = this.m_regionData.RegionLocY - 50; - mapReply.LayerData[0].Left = this.m_regionData.RegionLocX - 50; - mapReply.LayerData[0].Top = this.m_regionData.RegionLocY + 50; - mapReply.LayerData[0].Right = this.m_regionData.RegionLocX + 50; - mapReply.LayerData[0].ImageID = new LLUUID("00000000-0000-0000-9999-000000000005"); - this.OutPacket(mapReply); - } - - public void RequestMapBlocks(int minX, int minY, int maxX, int maxY) - { - IList simMapProfiles = m_gridServer.RequestMapBlocks(minX, minY, maxX, maxY); - int len; - if (simMapProfiles == null) - len = 0; - else - len = simMapProfiles.Count; - - int i; - int mtu = 24; // Number of regions to send per packet. Will be more precise in future. ( TODO ) - for (i = 0; i < len; i += mtu) - { - MapBlockReplyPacket mbReply = new MapBlockReplyPacket(); - mbReply.AgentData.AgentID = this.AgentID; - - mbReply.Data = new MapBlockReplyPacket.DataBlock[Math.Min(mtu, len - i)]; - int j; - for (j = 0; (j < mtu) && ((i + j) < len); j++) - { - Hashtable mp = (Hashtable)simMapProfiles[j]; - mbReply.Data[j] = new MapBlockReplyPacket.DataBlock(); - mbReply.Data[j].Name = libsecondlife.Helpers.StringToField((string)mp["name"]); - mbReply.Data[j].Access = System.Convert.ToByte(mp["access"]); - mbReply.Data[j].Agents = System.Convert.ToByte(mp["agents"]); - mbReply.Data[j].MapImageID = new LLUUID((string)mp["map-image-id"]); - mbReply.Data[j].RegionFlags = System.Convert.ToUInt32(mp["region-flags"]); - mbReply.Data[j].WaterHeight = System.Convert.ToByte(mp["water-height"]); - mbReply.Data[j].X = System.Convert.ToUInt16(mp["x"]); - mbReply.Data[j].Y = System.Convert.ToUInt16(mp["y"]); - } - this.OutPacket(mbReply); - } - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Client/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/Client/ClientView.ProcessPackets.cs deleted file mode 100644 index 306bf63..0000000 --- a/OpenSim/OpenSim.RegionServer/Client/ClientView.ProcessPackets.cs +++ /dev/null @@ -1,523 +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 libsecondlife; -using libsecondlife.Packets; -using Nwc.XmlRpc; -using System.Net; -using System.Net.Sockets; -using System.IO; -using System.Threading; -using System.Timers; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; -using OpenSim.RegionServer.Simulator; -using OpenSim.RegionServer.Assets; -using OpenSim.Framework.Console; - -namespace OpenSim.RegionServer.Client -{ - public partial class ClientView - { - public delegate void GenericCall(ClientView remoteClient); - public delegate void GenericCall2(); - public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary. - public delegate void GenericCall4(Packet packet, ClientView remoteClient); - public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); - public delegate void ObjectSelect(uint localID, ClientView remoteClient); - public delegate void UpdatePrimFlags(uint localID, Packet packet, ClientView remoteClient); - public delegate void UpdatePrimTexture(uint localID, byte[] texture, ClientView remoteClient); - public delegate void UpdatePrimVector(uint localID, LLVector3 pos, ClientView remoteClient); - public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, ClientView remoteClient); - public delegate void StatusChange(bool status); - - - public event ChatFromViewer OnChatFromViewer; - public event RezObject OnRezObject; - public event GenericCall4 OnDeRezObject; - public event ModifyTerrain OnModifyTerrain; - public event GenericCall OnRegionHandShakeReply; - public event GenericCall OnRequestWearables; - public event SetAppearance OnSetAppearance; - public event GenericCall2 OnCompleteMovementToRegion; - public event GenericCall3 OnAgentUpdate; - public event StartAnim OnStartAnim; - public event GenericCall OnRequestAvatarsData; - public event LinkObjects OnLinkObjects; - public event GenericCall4 OnAddPrim; - public event UpdateShape OnUpdatePrimShape; - public event ObjectSelect OnObjectSelect; - public event UpdatePrimFlags OnUpdatePrimFlags; - public event UpdatePrimTexture OnUpdatePrimTexture; - public event UpdatePrimVector OnUpdatePrimPosition; - public event UpdatePrimRotation OnUpdatePrimRotation; - public event UpdatePrimVector OnUpdatePrimScale; - public event StatusChange OnChildAgentStatus; - - public event ParcelPropertiesRequest OnParcelPropertiesRequest; - public event ParcelDivideRequest OnParcelDivideRequest; - public event ParcelJoinRequest OnParcelJoinRequest; - public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; - - protected override void ProcessInPacket(Packet Pack) - { - ack_pack(Pack); - if (debug) - { - if (Pack.Type != PacketType.AgentUpdate) - { - Console.WriteLine("IN: " + Pack.Type.ToString()); - } - } - - - if (this.ProcessPacketMethod(Pack)) - { - //there is a handler registered that handled this packet type - return; - } - else - { - System.Text.Encoding _enc = System.Text.Encoding.ASCII; - - switch (Pack.Type) - { - case PacketType.ViewerEffect: - ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; - foreach (ClientView client in m_clientThreads.Values) - { - if (client.AgentID != this.AgentID) - { - viewer.AgentData.AgentID = client.AgentID; - viewer.AgentData.SessionID = client.SessionID; - client.OutPacket(viewer); - } - } - break; - - #region New Event System - World/Avatar - case PacketType.ChatFromViewer: - ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; - if (Util.FieldToString(inchatpack.ChatData.Message) == "") - { - //empty message so don't bother with it - break; - } - string fromName = ClientAvatar.firstname + " " + ClientAvatar.lastname; - byte[] message = inchatpack.ChatData.Message; - byte type = inchatpack.ChatData.Type; - LLVector3 fromPos = ClientAvatar.Pos; - LLUUID fromAgentID = AgentID; - this.OnChatFromViewer(message, type, fromPos, fromName, fromAgentID); - break; - case PacketType.RezObject: - RezObjectPacket rezPacket = (RezObjectPacket)Pack; - AgentInventory inven = this.m_inventoryCache.GetAgentsInventory(this.AgentID); - if (inven != null) - { - if (inven.InventoryItems.ContainsKey(rezPacket.InventoryData.ItemID)) - { - AssetBase asset = this.m_assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID); - if (asset != null) - { - this.OnRezObject(asset, rezPacket.RezData.RayEnd); - this.m_inventoryCache.DeleteInventoryItem(this, rezPacket.InventoryData.ItemID); - } - } - } - break; - case PacketType.DeRezObject: - OnDeRezObject(Pack, this); - break; - case PacketType.ModifyLand: - ModifyLandPacket modify = (ModifyLandPacket)Pack; - if (modify.ParcelData.Length > 0) - { - OnModifyTerrain(modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West); - } - break; - case PacketType.RegionHandshakeReply: - OnRegionHandShakeReply(this); - break; - case PacketType.AgentWearablesRequest: - OnRequestWearables(this); - OnRequestAvatarsData(this); - break; - case PacketType.AgentSetAppearance: - AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack; - OnSetAppearance(appear.ObjectData.TextureEntry, appear.VisualParam); - break; - case PacketType.CompleteAgentMovement: - if (this.m_child) this.UpgradeClient(); - OnCompleteMovementToRegion(); - this.EnableNeighbours(); - break; - case PacketType.AgentUpdate: - OnAgentUpdate(Pack); - break; - case PacketType.AgentAnimation: - if (!m_child) - { - AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; - for (int i = 0; i < AgentAni.AnimationList.Length; i++) - { - if (AgentAni.AnimationList[i].StartAnim) - { - OnStartAnim(AgentAni.AnimationList[i].AnimID, 1); - } - } - } - break; - - #endregion - - #region New Event System - Objects/Prims - case PacketType.ObjectLink: - ObjectLinkPacket link = (ObjectLinkPacket)Pack; - uint parentprimid = 0; - List childrenprims = new List(); - if (link.ObjectData.Length > 1) - { - parentprimid = link.ObjectData[0].ObjectLocalID; - - for (int i = 1; i < link.ObjectData.Length; i++) - { - childrenprims.Add(link.ObjectData[i].ObjectLocalID); - } - } - OnLinkObjects(parentprimid, childrenprims); - break; - case PacketType.ObjectAdd: - m_world.AddNewPrim((ObjectAddPacket)Pack, this); - OnAddPrim(Pack, this); - break; - case PacketType.ObjectShape: - ObjectShapePacket shape = (ObjectShapePacket)Pack; - for (int i = 0; i < shape.ObjectData.Length; i++) - { - OnUpdatePrimShape(shape.ObjectData[i].ObjectLocalID, shape.ObjectData[i]); - } - break; - case PacketType.ObjectSelect: - ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; - for (int i = 0; i < incomingselect.ObjectData.Length; i++) - { - OnObjectSelect(incomingselect.ObjectData[i].ObjectLocalID, this); - } - break; - case PacketType.ObjectFlagUpdate: - ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack; - OnUpdatePrimFlags(flags.AgentData.ObjectLocalID, Pack, this); - break; - case PacketType.ObjectImage: - ObjectImagePacket imagePack = (ObjectImagePacket)Pack; - for (int i = 0; i < imagePack.ObjectData.Length; i++) - { - OnUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID, imagePack.ObjectData[i].TextureEntry, this); - - } - break; - #endregion - - #region Inventory/Asset/Other related packets - case PacketType.RequestImage: - RequestImagePacket imageRequest = (RequestImagePacket)Pack; - for (int i = 0; i < imageRequest.RequestImage.Length; i++) - { - m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image); - } - break; - case PacketType.TransferRequest: - TransferRequestPacket transfer = (TransferRequestPacket)Pack; - m_assetCache.AddAssetRequest(this, transfer); - break; - case PacketType.AssetUploadRequest: - AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; - this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID)); - break; - case PacketType.RequestXfer: - break; - case PacketType.SendXferPacket: - this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack); - break; - case PacketType.CreateInventoryFolder: - CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; - m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Util.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID); - break; - case PacketType.CreateInventoryItem: - CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; - if (createItem.InventoryBlock.TransactionID != LLUUID.Zero) - { - this.UploadAssets.CreateInventoryItem(createItem); - } - else - { - this.CreateInventoryItem(createItem); - } - break; - case PacketType.FetchInventory: - FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack; - m_inventoryCache.FetchInventory(this, FetchInventory); - break; - case PacketType.FetchInventoryDescendents: - FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; - m_inventoryCache.FetchInventoryDescendents(this, Fetch); - break; - case PacketType.UpdateInventoryItem: - UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack; - for (int i = 0; i < update.InventoryData.Length; i++) - { - if (update.InventoryData[i].TransactionID != LLUUID.Zero) - { - AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID)); - if (asset != null) - { - m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); - } - else - { - asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); - if (asset != null) - { - m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); - } - else - { - - } - } - } - else - { - m_inventoryCache.UpdateInventoryItemDetails(this, update.InventoryData[i].ItemID, update.InventoryData[i]); ; - } - } - break; - case PacketType.RequestTaskInventory: - RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; - ReplyTaskInventoryPacket replytask = new ReplyTaskInventoryPacket(); - bool foundent = false; - foreach (Entity ent in m_world.Entities.Values) - { - if (ent.localid == requesttask.InventoryData.LocalID) - { - replytask.InventoryData.TaskID = ent.uuid; - replytask.InventoryData.Serial = 0; - replytask.InventoryData.Filename = new byte[0]; - foundent = true; - } - } - if (foundent) - { - this.OutPacket(replytask); - } - break; - case PacketType.UpdateTaskInventory: - UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack; - AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID); - if (myinventory != null) - { - if (updatetask.UpdateData.Key == 0) - { - if (myinventory.InventoryItems[updatetask.InventoryData.ItemID] != null) - { - if (myinventory.InventoryItems[updatetask.InventoryData.ItemID].Type == 7) - { - LLUUID noteaid = myinventory.InventoryItems[updatetask.InventoryData.ItemID].AssetID; - AssetBase assBase = this.m_assetCache.GetAsset(noteaid); - if (assBase != null) - { - foreach (Entity ent in m_world.Entities.Values) - { - if (ent.localid == updatetask.UpdateData.LocalID) - { - if (ent is OpenSim.RegionServer.Simulator.Primitive) - { - this.m_world.AddScript(ent, Util.FieldToString(assBase.Data)); - } - } - } - } - } - } - } - } - break; - case PacketType.MapLayerRequest: - // This be busted. - MapLayerRequestPacket MapRequest = (MapLayerRequestPacket)Pack; - this.RequestMapLayer(); - this.RequestMapBlocks((int)this.m_regionData.RegionLocX - 5, (int)this.m_regionData.RegionLocY - 5, (int)this.m_regionData.RegionLocX + 5, (int)this.m_regionData.RegionLocY + 5); - break; - - case PacketType.MapBlockRequest: - MapBlockRequestPacket MapBRequest = (MapBlockRequestPacket)Pack; - this.RequestMapBlocks(MapBRequest.PositionData.MinX, MapBRequest.PositionData.MinY, MapBRequest.PositionData.MaxX, MapBRequest.PositionData.MaxY); - break; - - case PacketType.MapNameRequest: - // TODO. - break; - - case PacketType.TeleportLandmarkRequest: - TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack; - - TeleportStartPacket tpStart = new TeleportStartPacket(); - tpStart.Info.TeleportFlags = 8; // tp via lm - this.OutPacket(tpStart); - - TeleportProgressPacket tpProgress = new TeleportProgressPacket(); - tpProgress.Info.Message = (new System.Text.ASCIIEncoding()).GetBytes("sending_landmark"); - tpProgress.Info.TeleportFlags = 8; - tpProgress.AgentData.AgentID = tpReq.Info.AgentID; - this.OutPacket(tpProgress); - - // Fetch landmark - LLUUID lmid = tpReq.Info.LandmarkID; - AssetBase lma = this.m_assetCache.GetAsset(lmid); - if (lma != null) - { - AssetLandmark lm = new AssetLandmark(lma); - - if (lm.RegionID == m_regionData.SimUUID) - { - TeleportLocalPacket tpLocal = new TeleportLocalPacket(); - - tpLocal.Info.AgentID = tpReq.Info.AgentID; - tpLocal.Info.TeleportFlags = 8; // Teleport via landmark - tpLocal.Info.LocationID = 2; - tpLocal.Info.Position = lm.Position; - OutPacket(tpLocal); - } - else - { - TeleportCancelPacket tpCancel = new TeleportCancelPacket(); - tpCancel.Info.AgentID = tpReq.Info.AgentID; - tpCancel.Info.SessionID = tpReq.Info.SessionID; - OutPacket(tpCancel); - } - } - else - { - Console.WriteLine("Cancelling Teleport - fetch asset not yet implemented"); - - TeleportCancelPacket tpCancel = new TeleportCancelPacket(); - tpCancel.Info.AgentID = tpReq.Info.AgentID; - tpCancel.Info.SessionID = tpReq.Info.SessionID; - OutPacket(tpCancel); - } - break; - case PacketType.TeleportLocationRequest: - TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; - Console.WriteLine(tpLocReq.ToString()); - - tpStart = new TeleportStartPacket(); - tpStart.Info.TeleportFlags = 16; // Teleport via location - Console.WriteLine(tpStart.ToString()); - OutPacket(tpStart); - - if (m_regionData.RegionHandle != tpLocReq.Info.RegionHandle) - { - /* m_gridServer.getRegion(tpLocReq.Info.RegionHandle); */ - Console.WriteLine("Inter-sim teleport not yet implemented"); - TeleportCancelPacket tpCancel = new TeleportCancelPacket(); - tpCancel.Info.SessionID = tpLocReq.AgentData.SessionID; - tpCancel.Info.AgentID = tpLocReq.AgentData.AgentID; - - OutPacket(tpCancel); - } - else - { - Console.WriteLine("Local teleport"); - TeleportLocalPacket tpLocal = new TeleportLocalPacket(); - tpLocal.Info.AgentID = tpLocReq.AgentData.AgentID; - tpLocal.Info.TeleportFlags = tpStart.Info.TeleportFlags; - tpLocal.Info.LocationID = 2; - tpLocal.Info.LookAt = tpLocReq.Info.LookAt; - tpLocal.Info.Position = tpLocReq.Info.Position; - OutPacket(tpLocal); - - } - break; - #endregion - - #region Parcel Packets - case PacketType.ParcelPropertiesRequest: - ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack; - OnParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), (int)Math.Round(propertiesRequest.ParcelData.South), (int)Math.Round(propertiesRequest.ParcelData.East), (int)Math.Round(propertiesRequest.ParcelData.North),propertiesRequest.ParcelData.SequenceID,propertiesRequest.ParcelData.SnapSelection, this); - break; - case PacketType.ParcelDivide: - ParcelDividePacket parcelDivide = (ParcelDividePacket)Pack; - OnParcelDivideRequest((int)Math.Round(parcelDivide.ParcelData.West), (int)Math.Round(parcelDivide.ParcelData.South), (int)Math.Round(parcelDivide.ParcelData.East), (int)Math.Round(parcelDivide.ParcelData.North), this); - break; - case PacketType.ParcelJoin: - ParcelJoinPacket parcelJoin = (ParcelJoinPacket)Pack; - OnParcelJoinRequest((int)Math.Round(parcelJoin.ParcelData.West), (int)Math.Round(parcelJoin.ParcelData.South), (int)Math.Round(parcelJoin.ParcelData.East), (int)Math.Round(parcelJoin.ParcelData.North), this); - break; - case PacketType.ParcelPropertiesUpdate: - ParcelPropertiesUpdatePacket updatePacket = (ParcelPropertiesUpdatePacket)Pack; - OnParcelPropertiesUpdateRequest(updatePacket, this); - break; - #endregion - - #region Estate Packets - case PacketType.EstateOwnerMessage: - this.m_world.estateManager.handleEstateOwnerMessage((EstateOwnerMessagePacket)Pack, this); - break; - #endregion - #region unimplemented handlers - case PacketType.AgentIsNowWearing: - // AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack; - break; - case PacketType.ObjectScale: - break; - case PacketType.MoneyBalanceRequest: - //This need to be actually done and not thrown back with fake infos - break; - - case PacketType.EstateCovenantRequest: - //This should be actually done and not thrown back with fake info - EstateCovenantRequestPacket estateCovenantRequest = (EstateCovenantRequestPacket)Pack; - EstateCovenantReplyPacket estateCovenantReply = new EstateCovenantReplyPacket(); - estateCovenantReply.Data.EstateName = libsecondlife.Helpers.StringToField("Leet Estate"); - estateCovenantReply.Data.EstateOwnerID = LLUUID.Zero; - estateCovenantReply.Data.CovenantID = LLUUID.Zero; - estateCovenantReply.Data.CovenantTimestamp = (uint)0; - this.OutPacket((Packet)estateCovenantReply); - MainConsole.Instance.Notice("Sent Temporary Estate packet (they are in leet estate)"); - break; - #endregion - } - } - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Client/ClientView.cs b/OpenSim/OpenSim.RegionServer/Client/ClientView.cs deleted file mode 100644 index 29efcc9..0000000 --- a/OpenSim/OpenSim.RegionServer/Client/ClientView.cs +++ /dev/null @@ -1,461 +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 libsecondlife; -using libsecondlife.Packets; -using Nwc.XmlRpc; -using System.Net; -using System.Net.Sockets; -using System.IO; -using System.Threading; -using System.Timers; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; -using OpenSim.RegionServer.Simulator; -using OpenSim.RegionServer.Assets; -using OpenSim.Framework.Console; - -namespace OpenSim.RegionServer.Client -{ - public delegate bool PacketMethod(ClientView simClient, Packet packet); - - /// - /// Handles new client connections - /// Constructor takes a single Packet and authenticates everything - /// - public partial class ClientView : ClientViewBase, IClientAPI - { - protected static Dictionary PacketHandlers = new Dictionary(); //Global/static handlers for all clients - protected Dictionary m_packetHandlers = new Dictionary(); //local handlers for this instance - - public LLUUID AgentID; - public LLUUID SessionID; - public LLUUID SecureSessionID = LLUUID.Zero; - public bool m_child; - public Simulator.Avatar ClientAvatar; - private UseCircuitCodePacket cirpack; - public Thread ClientThread; - public LLVector3 startpos; - - private AgentAssetUpload UploadAssets; - private LLUUID newAssetFolder = LLUUID.Zero; - private bool debug = false; - private World m_world; - private Dictionary m_clientThreads; - private AssetCache m_assetCache; - private IGridServer m_gridServer; - private IUserServer m_userServer = null; - private InventoryCache m_inventoryCache; - public bool m_sandboxMode; - private int cachedtextureserial = 0; - private RegionInfo m_regionData; - protected AuthenticateSessionsBase m_authenticateSessionsHandler; - - public IUserServer UserServer - { - set - { - this.m_userServer = value; - } - } - - public LLVector3 StartPos - { - get - { - return startpos; - } - set - { - startpos = value; - } - } - - public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, World world, Dictionary clientThreads, AssetCache assetCache, IGridServer gridServer, OpenSimNetworkHandler application, InventoryCache inventoryCache, bool sandboxMode, bool child, RegionInfo regionDat, AuthenticateSessionsBase authenSessions) - { - m_world = world; - m_clientThreads = clientThreads; - m_assetCache = assetCache; - m_gridServer = gridServer; - m_networkServer = application; - m_inventoryCache = inventoryCache; - m_sandboxMode = sandboxMode; - m_child = child; - m_regionData = regionDat; - m_authenticateSessionsHandler = authenSessions; - MainConsole.Instance.Notice("OpenSimClient.cs - Started up new client thread to handle incoming request"); - cirpack = initialcirpack; - userEP = remoteEP; - - if (m_gridServer.GetName() == "Remote") - { - this.m_child = m_authenticateSessionsHandler.GetAgentChildStatus(initialcirpack.CircuitCode.Code); - this.startpos = m_authenticateSessionsHandler.GetPosition(initialcirpack.CircuitCode.Code); - - // Dont rez new users underground - float aboveGround = 3.0f; // rez at least 3 meters above ground - if (this.startpos.Z < (m_world.Terrain[(int)this.startpos.X, (int)this.startpos.Y] + aboveGround)) - this.startpos.Z = m_world.Terrain[(int)this.startpos.X, (int)this.startpos.Y] + aboveGround; - - } - else - { - this.startpos = new LLVector3(128, 128, m_world.Terrain[(int)128, (int)128] + 15.0f); // new LLVector3(128.0f, 128.0f, 60f); - } - - PacketQueue = new BlockingQueue(); - - this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache); - AckTimer = new System.Timers.Timer(500); - AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); - AckTimer.Start(); - - this.RegisterLocalPacketHandlers(); - - - - ClientThread = new Thread(new ThreadStart(AuthUser)); - ClientThread.IsBackground = true; - ClientThread.Start(); - } - - # region Client Methods - public void UpgradeClient() - { - MainConsole.Instance.Notice("SimClient.cs:UpgradeClient() - upgrading child to full agent"); - this.m_child = false; - //this.m_world.RemoveViewerAgent(this); - if (!this.m_sandboxMode) - { - this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode); - m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false); - } - OnChildAgentStatus(this.m_child); - //this.InitNewClient(); - } - - public void DowngradeClient() - { - MainConsole.Instance.Notice("SimClient.cs:UpgradeClient() - changing full agent to child"); - this.m_child = true; - OnChildAgentStatus(this.m_child); - //this.m_world.RemoveViewerAgent(this); - //this.m_world.AddViewerAgent(this); - } - - public void KillClient() - { - KillObjectPacket kill = new KillObjectPacket(); - kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; - kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); - kill.ObjectData[0].ID = this.ClientAvatar.localid; - foreach (ClientView client in m_clientThreads.Values) - { - client.OutPacket(kill); - } - if (this.m_userServer != null) - { - this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer); - } - else - { - this.m_inventoryCache.ClientLeaving(this.AgentID, null); - } - - m_world.RemoveViewerAgent(this); - - m_clientThreads.Remove(this.CircuitCode); - m_networkServer.RemoveClientCircuit(this.CircuitCode); - this.ClientThread.Abort(); - } - #endregion - - # region Packet Handling - public static bool AddPacketHandler(PacketType packetType, PacketMethod handler) - { - bool result = false; - lock (PacketHandlers) - { - if (!PacketHandlers.ContainsKey(packetType)) - { - PacketHandlers.Add(packetType, handler); - result = true; - } - } - return result; - } - - public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler) - { - bool result = false; - lock (m_packetHandlers) - { - if (!m_packetHandlers.ContainsKey(packetType)) - { - m_packetHandlers.Add(packetType, handler); - result = true; - } - } - return result; - } - - protected virtual bool ProcessPacketMethod(Packet packet) - { - bool result = false; - bool found = false; - PacketMethod method; - if (m_packetHandlers.TryGetValue(packet.Type, out method)) - { - //there is a local handler for this packet type - result = method(this, packet); - } - else - { - //there is not a local handler so see if there is a Global handler - lock (PacketHandlers) - { - found = PacketHandlers.TryGetValue(packet.Type, out method); - } - if (found) - { - result = method(this, packet); - } - } - return result; - } - - protected virtual void ClientLoop() - { - MainConsole.Instance.Notice("OpenSimClient.cs:ClientLoop() - Entered loop"); - while (true) - { - QueItem nextPacket = PacketQueue.Dequeue(); - if (nextPacket.Incoming) - { - //is a incoming packet - ProcessInPacket(nextPacket.Packet); - } - else - { - //is a out going packet - ProcessOutPacket(nextPacket.Packet); - } - } - } - # endregion - - # region Setup - - protected virtual void InitNewClient() - { - MainConsole.Instance.Notice("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); - this.ClientAvatar = m_world.AddViewerAgent(this); - } - - protected virtual void AuthUser() - { - // AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code); - AuthenticateResponse sessionInfo = this.m_networkServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code); - if (!sessionInfo.Authorised) - { - //session/circuit not authorised - OpenSim.Framework.Console.MainConsole.Instance.Notice("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString()); - ClientThread.Abort(); - } - else - { - OpenSim.Framework.Console.MainConsole.Instance.Notice("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString()); - //session is authorised - this.AgentID = cirpack.CircuitCode.ID; - this.SessionID = cirpack.CircuitCode.SessionID; - this.CircuitCode = cirpack.CircuitCode.Code; - InitNewClient(); - this.ClientAvatar.firstname = sessionInfo.LoginInfo.First; - this.ClientAvatar.lastname = sessionInfo.LoginInfo.Last; - if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero) - { - this.SecureSessionID = sessionInfo.LoginInfo.SecureSession; - } - - // Create Inventory, currently only works for sandbox mode - if (m_sandboxMode) - { - this.SetupInventory(sessionInfo); - } - - //m_world.parcelManager.sendParcelOverlay(this); - m_world.estateManager.sendRegionInfoPacket(this); - - ClientLoop(); - } - } - # endregion - - - protected override void KillThread() - { - this.ClientThread.Abort(); - } - - #region World/Avatar To Viewer Methods - - public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) - { - System.Text.Encoding enc = System.Text.Encoding.ASCII; - libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket(); - reply.ChatData.Audible = 1; - reply.ChatData.Message = message; - reply.ChatData.ChatType = type; - reply.ChatData.SourceType = 1; - reply.ChatData.Position = fromPos; - reply.ChatData.FromName = enc.GetBytes(fromName + "\0"); - reply.ChatData.OwnerID = fromAgentID; - reply.ChatData.SourceID = fromAgentID; - - this.OutPacket(reply); - } - - public void SendAppearance(AvatarWearable[] wearables) - { - AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket(); - aw.AgentData.AgentID = this.AgentID; - aw.AgentData.SerialNum = 0; - aw.AgentData.SessionID = this.SessionID; - - aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13]; - AgentWearablesUpdatePacket.WearableDataBlock awb; - for (int i = 0; i < wearables.Length; i++) - { - awb = new AgentWearablesUpdatePacket.WearableDataBlock(); - awb.WearableType = (byte)i; - awb.AssetID = wearables[i].AssetID; - awb.ItemID = wearables[i].ItemID; - aw.WearableData[i] = awb; - } - - this.OutPacket(aw); - } - #endregion - - #region Inventory Creation - private void SetupInventory(AuthenticateResponse sessionInfo) - { - AgentInventory inventory = null; - if (sessionInfo.LoginInfo.InventoryFolder != null) - { - inventory = this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder); - if (sessionInfo.LoginInfo.BaseFolder != null) - { - if (!inventory.HasFolder(sessionInfo.LoginInfo.BaseFolder)) - { - m_inventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder); - } - this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder; - AssetBase[] inventorySet = m_assetCache.CreateNewInventorySet(this.AgentID); - if (inventorySet != null) - { - for (int i = 0; i < inventorySet.Length; i++) - { - if (inventorySet[i] != null) - { - m_inventoryCache.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]); - } - } - } - } - } - } - private AgentInventory CreateInventory(LLUUID baseFolder) - { - AgentInventory inventory = null; - if (this.m_userServer != null) - { - // a user server is set so request the inventory from it - MainConsole.Instance.Verbose("getting inventory from user server"); - inventory = m_inventoryCache.FetchAgentsInventory(this.AgentID, m_userServer); - } - else - { - inventory = new AgentInventory(); - inventory.AgentID = this.AgentID; - inventory.CreateRootFolder(this.AgentID, false); - m_inventoryCache.AddNewAgentsInventory(inventory); - m_inventoryCache.CreateNewInventoryFolder(this, baseFolder); - } - return inventory; - } - - private void CreateInventoryItem(CreateInventoryItemPacket packet) - { - if (!(packet.InventoryBlock.Type == 3 || packet.InventoryBlock.Type == 7)) - { - MainConsole.Instance.Warn("Attempted to create " + Util.FieldToString(packet.InventoryBlock.Name) + " in inventory. Unsupported type"); - return; - } - - //lets try this out with creating a notecard - AssetBase asset = new AssetBase(); - - asset.Name = Util.FieldToString(packet.InventoryBlock.Name); - asset.Description = Util.FieldToString(packet.InventoryBlock.Description); - asset.InvType = packet.InventoryBlock.InvType; - asset.Type = packet.InventoryBlock.Type; - asset.FullID = LLUUID.Random(); - - switch (packet.InventoryBlock.Type) - { - case 7: // Notecard - asset.Data = new byte[0]; - break; - - case 3: // Landmark - String content; - content = "Landmark version 2\n"; - content += "region_id " + m_regionData.SimUUID + "\n"; - String strPos = String.Format("%.2f %.2f %.2f>", - this.ClientAvatar.Pos.X, - this.ClientAvatar.Pos.Y, - this.ClientAvatar.Pos.Z); - content += "local_pos " + strPos + "\n"; - asset.Data = (new System.Text.ASCIIEncoding()).GetBytes(content); - break; - default: - break; - } - m_assetCache.AddAsset(asset); - m_inventoryCache.AddNewInventoryItem(this, packet.InventoryBlock.FolderID, asset); - } - #endregion - - } -} diff --git a/OpenSim/OpenSim.RegionServer/Client/ClientViewBase.cs b/OpenSim/OpenSim.RegionServer/Client/ClientViewBase.cs deleted file mode 100644 index 2ff245f..0000000 --- a/OpenSim/OpenSim.RegionServer/Client/ClientViewBase.cs +++ /dev/null @@ -1,326 +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 libsecondlife; -using libsecondlife.Packets; -using System.Net; -using System.Net.Sockets; -using System.IO; -using System.Threading; -using System.Timers; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Console; - -namespace OpenSim.RegionServer.Client -{ - public class ClientViewBase - { - protected BlockingQueue PacketQueue; - protected Dictionary PendingAcks = new Dictionary(); - protected Dictionary NeedAck = new Dictionary(); - - protected System.Timers.Timer AckTimer; - protected uint Sequence = 0; - protected object SequenceLock = new object(); - protected const int MAX_APPENDED_ACKS = 10; - protected const int RESEND_TIMEOUT = 4000; - protected const int MAX_SEQUENCE = 0xFFFFFF; - - public uint CircuitCode; - public EndPoint userEP; - - protected OpenSimNetworkHandler m_networkServer; - - public ClientViewBase() - { - - } - - protected virtual void ProcessInPacket(Packet Pack) - { - - } - - protected virtual void ProcessOutPacket(Packet Pack) - { - // Keep track of when this packet was sent out - Pack.TickCount = Environment.TickCount; - - - if (!Pack.Header.Resent) - { - // Set the sequence number - lock (SequenceLock) - { - if (Sequence >= MAX_SEQUENCE) - Sequence = 1; - else - Sequence++; - Pack.Header.Sequence = Sequence; - } - - if (Pack.Header.Reliable) //DIRTY HACK - { - lock (NeedAck) - { - if (!NeedAck.ContainsKey(Pack.Header.Sequence)) - { - try - { - NeedAck.Add(Pack.Header.Sequence, Pack); - } - catch (Exception e) // HACKY - { - e.ToString(); - // Ignore - // Seems to throw a exception here occasionally - // of 'duplicate key' despite being locked. - // !?!?!? - } - } - else - { - // Client.Log("Attempted to add a duplicate sequence number (" + - // packet.Header.Sequence + ") to the NeedAck dictionary for packet type " + - // packet.Type.ToString(), Helpers.LogLevel.Warning); - } - } - - // Don't append ACKs to resent packets, in case that's what was causing the - // delivery to fail - if (!Pack.Header.Resent) - { - // Append any ACKs that need to be sent out to this packet - lock (PendingAcks) - { - if (PendingAcks.Count > 0 && PendingAcks.Count < MAX_APPENDED_ACKS && - Pack.Type != PacketType.PacketAck && - Pack.Type != PacketType.LogoutRequest) - { - Pack.Header.AckList = new uint[PendingAcks.Count]; - int i = 0; - - foreach (uint ack in PendingAcks.Values) - { - Pack.Header.AckList[i] = ack; - i++; - } - - PendingAcks.Clear(); - Pack.Header.AppendedAcks = true; - } - } - } - } - } - - byte[] ZeroOutBuffer = new byte[4096]; - byte[] sendbuffer; - sendbuffer = Pack.ToBytes(); - - try - { - if (Pack.Header.Zerocoded) - { - int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); - m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, CircuitCode);//userEP); - } - else - { - m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, CircuitCode); //userEP); - } - } - catch (Exception) - { - MainConsole.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread"); - this.KillThread(); - } - - } - - public virtual void InPacket(Packet NewPack) - { - // Handle appended ACKs - if (NewPack.Header.AppendedAcks) - { - lock (NeedAck) - { - foreach (uint ack in NewPack.Header.AckList) - { - NeedAck.Remove(ack); - } - } - } - - // Handle PacketAck packets - if (NewPack.Type == PacketType.PacketAck) - { - PacketAckPacket ackPacket = (PacketAckPacket)NewPack; - - lock (NeedAck) - { - foreach (PacketAckPacket.PacketsBlock block in ackPacket.Packets) - { - NeedAck.Remove(block.ID); - } - } - } - else if ((NewPack.Type == PacketType.StartPingCheck)) - { - //reply to pingcheck - libsecondlife.Packets.StartPingCheckPacket startPing = (libsecondlife.Packets.StartPingCheckPacket)NewPack; - libsecondlife.Packets.CompletePingCheckPacket endPing = new CompletePingCheckPacket(); - endPing.PingID.PingID = startPing.PingID.PingID; - OutPacket(endPing); - } - else - { - QueItem item = new QueItem(); - item.Packet = NewPack; - item.Incoming = true; - this.PacketQueue.Enqueue(item); - } - - } - - public virtual void OutPacket(Packet NewPack) - { - QueItem item = new QueItem(); - item.Packet = NewPack; - item.Incoming = false; - this.PacketQueue.Enqueue(item); - } - - # region Low Level Packet Methods - - protected void ack_pack(Packet Pack) - { - if (Pack.Header.Reliable) - { - libsecondlife.Packets.PacketAckPacket ack_it = new PacketAckPacket(); - ack_it.Packets = new PacketAckPacket.PacketsBlock[1]; - ack_it.Packets[0] = new PacketAckPacket.PacketsBlock(); - ack_it.Packets[0].ID = Pack.Header.Sequence; - ack_it.Header.Reliable = false; - - OutPacket(ack_it); - - } - /* - if (Pack.Header.Reliable) - { - lock (PendingAcks) - { - uint sequence = (uint)Pack.Header.Sequence; - if (!PendingAcks.ContainsKey(sequence)) { PendingAcks[sequence] = sequence; } - } - }*/ - } - - protected void ResendUnacked() - { - int now = Environment.TickCount; - - lock (NeedAck) - { - foreach (Packet packet in NeedAck.Values) - { - if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent)) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Resending " + packet.Type.ToString() + " packet, " + - (now - packet.TickCount) + "ms have passed"); - - packet.Header.Resent = true; - OutPacket(packet); - } - } - } - } - - protected void SendAcks() - { - lock (PendingAcks) - { - if (PendingAcks.Count > 0) - { - if (PendingAcks.Count > 250) - { - // FIXME: Handle the odd case where we have too many pending ACKs queued up - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Too many ACKs queued up!"); - return; - } - - - int i = 0; - PacketAckPacket acks = new PacketAckPacket(); - acks.Packets = new PacketAckPacket.PacketsBlock[PendingAcks.Count]; - - foreach (uint ack in PendingAcks.Values) - { - acks.Packets[i] = new PacketAckPacket.PacketsBlock(); - acks.Packets[i].ID = ack; - i++; - } - - acks.Header.Reliable = false; - OutPacket(acks); - - PendingAcks.Clear(); - } - } - } - - protected void AckTimer_Elapsed(object sender, ElapsedEventArgs ea) - { - SendAcks(); - ResendUnacked(); - } - #endregion - - protected virtual void KillThread() - { - - } - - #region Nested Classes - - public class QueItem - { - public QueItem() - { - } - - public Packet Packet; - public bool Incoming; - } - #endregion - } -} diff --git a/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs b/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs deleted file mode 100644 index 0bf0615..0000000 --- a/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs +++ /dev/null @@ -1,293 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -using OpenSim.Framework.Types; -using OpenSim.RegionServer.Simulator; -using OpenSim.RegionServer.Client; - -using libsecondlife; -using libsecondlife.Packets; - -namespace OpenSim.RegionServer.Estate -{ - - /// - /// Processes requests regarding estates. Refer to EstateSettings.cs in OpenSim.Framework. Types for all of the core settings - /// - public class EstateManager - { - private World m_world; - - public EstateManager(World world) - { - m_world = world; //Estate settings found at world.m_regInfo.estateSettings - } - - private bool convertParamStringToBool(byte[] field) - { - string s = Helpers.FieldToUTF8String(field); - if (s == "1" || s.ToLower() == "y" || s.ToLower() == "yes" || s.ToLower() == "t" || s.ToLower() == "true") - { - return true; - } - return false; - } - - public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, ClientView remote_client) - { - if (remote_client.AgentID == m_world.m_regInfo.MasterAvatarAssignedUUID) - { - switch (Helpers.FieldToUTF8String(packet.MethodData.Method)) - { - case "getinfo": - Console.WriteLine("GETINFO Requested"); - this.sendRegionInfoPacketToAll(); - - break; - case "setregioninfo": - if (packet.ParamList.Length != 9) - { - OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: SetRegionInfo method has a ParamList of invalid length"); - } - else - { - m_world.m_regInfo.estateSettings.regionFlags = libsecondlife.Simulator.RegionFlags.None; - - if (convertParamStringToBool(packet.ParamList[0].Parameter)) - { - m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.BlockTerraform; - } - - if (convertParamStringToBool(packet.ParamList[1].Parameter)) - { - m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.NoFly; - } - - if (convertParamStringToBool(packet.ParamList[2].Parameter)) - { - m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.AllowDamage; - } - - if (convertParamStringToBool(packet.ParamList[3].Parameter) == false) - { - m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.BlockLandResell; - } - - - int tempMaxAgents = Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter))); - m_world.m_regInfo.estateSettings.maxAgents = (byte)tempMaxAgents; - - float tempObjectBonusFactor = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter)); - m_world.m_regInfo.estateSettings.objectBonusFactor = tempObjectBonusFactor; - - int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter)); - m_world.m_regInfo.estateSettings.simAccess = (libsecondlife.Simulator.SimAccess)tempMatureLevel; - - - if (convertParamStringToBool(packet.ParamList[7].Parameter)) - { - m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.RestrictPushObject; - } - - if (convertParamStringToBool(packet.ParamList[8].Parameter)) - { - m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.AllowParcelChanges; - } - - sendRegionInfoPacketToAll(); - - } - break; - case "texturebase": - foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList) - { - string s = Helpers.FieldToUTF8String(block.Parameter); - string[] splitField = s.Split(' '); - if (splitField.Length == 2) - { - LLUUID tempUUID = new LLUUID(splitField[1]); - switch (Convert.ToInt16(splitField[0])) - { - case 0: - m_world.m_regInfo.estateSettings.terrainBase0 = tempUUID; - break; - case 1: - m_world.m_regInfo.estateSettings.terrainBase1 = tempUUID; - break; - case 2: - m_world.m_regInfo.estateSettings.terrainBase2 = tempUUID; - break; - case 3: - m_world.m_regInfo.estateSettings.terrainBase3 = tempUUID; - break; - } - } - } - break; - case "texturedetail": - foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList) - { - - string s = Helpers.FieldToUTF8String(block.Parameter); - string[] splitField = s.Split(' '); - if (splitField.Length == 2) - { - LLUUID tempUUID = new LLUUID(splitField[1]); - switch (Convert.ToInt16(splitField[0])) - { - case 0: - m_world.m_regInfo.estateSettings.terrainDetail0 = tempUUID; - break; - case 1: - m_world.m_regInfo.estateSettings.terrainDetail1 = tempUUID; - break; - case 2: - m_world.m_regInfo.estateSettings.terrainDetail2 = tempUUID; - break; - case 3: - m_world.m_regInfo.estateSettings.terrainDetail3 = tempUUID; - break; - } - } - } - break; - case "textureheights": - foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList) - { - - string s = Helpers.FieldToUTF8String(block.Parameter); - string[] splitField = s.Split(' '); - if (splitField.Length == 3) - { - - float tempHeightLow = (float)Convert.ToDecimal(splitField[1]); - float tempHeightHigh = (float)Convert.ToDecimal(splitField[2]); - - switch (Convert.ToInt16(splitField[0])) - { - case 0: - m_world.m_regInfo.estateSettings.terrainStartHeight0 = tempHeightLow; - m_world.m_regInfo.estateSettings.terrainHeightRange0 = tempHeightHigh; - break; - case 1: - m_world.m_regInfo.estateSettings.terrainStartHeight1 = tempHeightLow; - m_world.m_regInfo.estateSettings.terrainHeightRange1 = tempHeightHigh; - break; - case 2: - m_world.m_regInfo.estateSettings.terrainStartHeight2 = tempHeightLow; - m_world.m_regInfo.estateSettings.terrainHeightRange2 = tempHeightHigh; - break; - case 3: - m_world.m_regInfo.estateSettings.terrainStartHeight3 = tempHeightLow; - m_world.m_regInfo.estateSettings.terrainHeightRange3 = tempHeightHigh; - break; - } - } - } - break; - case "texturecommit": - sendRegionHandshakeToAll(); - break; - case "setregionterrain": - if (packet.ParamList.Length != 9) - { - OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: SetRegionTerrain method has a ParamList of invalid length"); - } - else - { - m_world.m_regInfo.estateSettings.waterHeight = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter)); - m_world.m_regInfo.estateSettings.terrainRaiseLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter)); - m_world.m_regInfo.estateSettings.terrainLowerLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter)); - m_world.m_regInfo.estateSettings.useFixedSun = this.convertParamStringToBool(packet.ParamList[4].Parameter); - m_world.m_regInfo.estateSettings.sunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter)); - - sendRegionInfoPacketToAll(); - } - break; - default: - OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); - break; - } - } - } - - public void sendRegionInfoPacketToAll() - { - foreach (OpenSim.RegionServer.Simulator.Avatar av in m_world.Avatars.Values) - { - this.sendRegionInfoPacket(av.ControllingClient); - } - } - - public void sendRegionHandshakeToAll() - { - foreach (OpenSim.RegionServer.Simulator.Avatar av in m_world.Avatars.Values) - { - this.sendRegionHandshake(av.ControllingClient); - } - } - - public void sendRegionInfoPacket(ClientView remote_client) - { - - RegionInfoPacket regionInfoPacket = new RegionInfoPacket(); - regionInfoPacket.AgentData.AgentID = remote_client.AgentID; - regionInfoPacket.AgentData.SessionID = remote_client.SessionID; - regionInfoPacket.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor; - regionInfoPacket.RegionInfo.EstateID = m_world.m_regInfo.estateSettings.estateID; - regionInfoPacket.RegionInfo.MaxAgents = m_world.m_regInfo.estateSettings.maxAgents; - regionInfoPacket.RegionInfo.ObjectBonusFactor = m_world.m_regInfo.estateSettings.objectBonusFactor; - regionInfoPacket.RegionInfo.ParentEstateID = m_world.m_regInfo.estateSettings.parentEstateID; - regionInfoPacket.RegionInfo.PricePerMeter = m_world.m_regInfo.estateSettings.pricePerMeter; - regionInfoPacket.RegionInfo.RedirectGridX = m_world.m_regInfo.estateSettings.redirectGridX; - regionInfoPacket.RegionInfo.RedirectGridY = m_world.m_regInfo.estateSettings.redirectGridY; - regionInfoPacket.RegionInfo.RegionFlags = (uint)m_world.m_regInfo.estateSettings.regionFlags; - regionInfoPacket.RegionInfo.SimAccess = (byte)m_world.m_regInfo.estateSettings.simAccess; - regionInfoPacket.RegionInfo.SimName = Helpers.StringToField(m_world.m_regInfo.RegionName); - regionInfoPacket.RegionInfo.SunHour = m_world.m_regInfo.estateSettings.sunHour; - regionInfoPacket.RegionInfo.TerrainLowerLimit = m_world.m_regInfo.estateSettings.terrainLowerLimit; - regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_world.m_regInfo.estateSettings.terrainRaiseLimit; - regionInfoPacket.RegionInfo.UseEstateSun = !m_world.m_regInfo.estateSettings.useFixedSun; - regionInfoPacket.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight; - - remote_client.OutPacket(regionInfoPacket); - } - - public void sendRegionHandshake(ClientView remote_client) - { - System.Text.Encoding _enc = System.Text.Encoding.ASCII; - RegionHandshakePacket handshake = new RegionHandshakePacket(); - - handshake.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor; - handshake.RegionInfo.IsEstateManager = false; - handshake.RegionInfo.TerrainHeightRange00 = m_world.m_regInfo.estateSettings.terrainHeightRange0; - handshake.RegionInfo.TerrainHeightRange01 = m_world.m_regInfo.estateSettings.terrainHeightRange1; - handshake.RegionInfo.TerrainHeightRange10 = m_world.m_regInfo.estateSettings.terrainHeightRange2; - handshake.RegionInfo.TerrainHeightRange11 = m_world.m_regInfo.estateSettings.terrainHeightRange3; - handshake.RegionInfo.TerrainStartHeight00 = m_world.m_regInfo.estateSettings.terrainStartHeight0; - handshake.RegionInfo.TerrainStartHeight01 = m_world.m_regInfo.estateSettings.terrainStartHeight1; - handshake.RegionInfo.TerrainStartHeight10 = m_world.m_regInfo.estateSettings.terrainStartHeight2; - handshake.RegionInfo.TerrainStartHeight11 = m_world.m_regInfo.estateSettings.terrainStartHeight3; - handshake.RegionInfo.SimAccess = (byte)m_world.m_regInfo.estateSettings.simAccess; - handshake.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight; - - - handshake.RegionInfo.RegionFlags = (uint)m_world.m_regInfo.estateSettings.regionFlags; - - handshake.RegionInfo.SimName = _enc.GetBytes(m_world.m_regInfo.RegionName + "\0"); - handshake.RegionInfo.SimOwner = m_world.m_regInfo.MasterAvatarAssignedUUID; - handshake.RegionInfo.TerrainBase0 = m_world.m_regInfo.estateSettings.terrainBase0; - handshake.RegionInfo.TerrainBase1 = m_world.m_regInfo.estateSettings.terrainBase1; - handshake.RegionInfo.TerrainBase2 = m_world.m_regInfo.estateSettings.terrainBase2; - handshake.RegionInfo.TerrainBase3 = m_world.m_regInfo.estateSettings.terrainBase3; - handshake.RegionInfo.TerrainDetail0 = m_world.m_regInfo.estateSettings.terrainDetail0; - handshake.RegionInfo.TerrainDetail1 = m_world.m_regInfo.estateSettings.terrainDetail1; - handshake.RegionInfo.TerrainDetail2 = m_world.m_regInfo.estateSettings.terrainDetail2; - handshake.RegionInfo.TerrainDetail3 = m_world.m_regInfo.estateSettings.terrainDetail3; - handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting? - - remote_client.OutPacket(handshake); - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Grid.cs b/OpenSim/OpenSim.RegionServer/Grid.cs deleted file mode 100644 index 844bb71..0000000 --- a/OpenSim/OpenSim.RegionServer/Grid.cs +++ /dev/null @@ -1,117 +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.Reflection; -using OpenSim.Framework.Interfaces; -using OpenSim.UserServer; - -namespace OpenSim.RegionServer -{ - public class Grid - { - public IAssetServer AssetServer; - public IGridServer GridServer; - public IUserServer UserServer; - public string AssetDll = ""; - public string GridDll = ""; - - public Grid() - { - } - - public virtual void Initialise() - { - //load the dlls - this.AssetServer = this.LoadAssetDll(this.AssetDll); - this.GridServer = this.LoadGridDll(this.GridDll); - } - public virtual void Close() - { - this.AssetServer.Close(); - this.GridServer.Close(); - } - - private IAssetServer LoadAssetDll(string dllName) - { - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - IAssetServer server = null; - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IAssetPlugin", true); - - if (typeInterface != null) - { - IAssetPlugin plug = (IAssetPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - server = plug.GetAssetServer(); - break; - } - - typeInterface = null; - } - } - } - pluginAssembly = null; - return server; - } - - private IGridServer LoadGridDll(string dllName) - { - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - IGridServer server = null; - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IGridPlugin", true); - - if (typeInterface != null) - { - IGridPlugin plug = (IGridPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - server = plug.GetGridServer(); - break; - } - - typeInterface = null; - } - } - } - pluginAssembly = null; - return server; - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj deleted file mode 100644 index 889135b..0000000 --- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj +++ /dev/null @@ -1,264 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {632E1BFD-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.RegionServer - JScript - Grid - IE50 - false - Library - - OpenSim.RegionServer - - - - - - 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\Axiom.MathLib.dll - False - - - ..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\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 - - - OpenSim.GenericConfig.Xml - {E88EF749-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Physics.Manager - {8BE16150-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Servers - {8BB20F0A-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Terrain.BasicTerrain - {2270B8FE-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 - - - 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/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build deleted file mode 100644 index 13341b3..0000000 --- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim/OpenSim.RegionServer/OpenSimMain.cs deleted file mode 100644 index 5aba625..0000000 --- a/OpenSim/OpenSim.RegionServer/OpenSimMain.cs +++ /dev/null @@ -1,531 +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.RegionServer.Simulator; -using OpenSim.Terrain; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.UserServer; -using OpenSim.RegionServer.Assets; -using OpenSim.RegionServer.CAPS; -using OpenSim.Framework.Console; -using OpenSim.Physics.Manager; -using Nwc.XmlRpc; -using OpenSim.Servers; -using OpenSim.GenericConfig; - -namespace OpenSim -{ - //moved to the opensim main application project (do we want it there or here?) -/* - public class OpenSimMain : OpenSimApplicationBase , conscmd_callback - { - - public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile) - { - this.configFileSetup = useConfigFile; - m_sandbox = sandBoxMode; - m_loginserver = startLoginServer; - m_physicsEngine = physicsEngine; - m_config = configFile; - - m_console = new ConsoleBase("region-console-" + Guid.NewGuid().ToString() + ".log", "Region", this, silent); - OpenSim.Framework.Console.MainConsole.Instance = m_console; - } - - /// - /// Performs initialisation of the world, such as loading configuration from disk. - /// - public override void StartUp() - { - this.regionData = new RegionInfo(); - try - { - this.localConfig = new XmlConfig(m_config); - this.localConfig.LoadData(); - } - catch (Exception e) - { - Console.WriteLine(e.Message); - } - if (this.configFileSetup) - { - this.SetupFromConfigFile(this.localConfig); - } - m_console.Notice("Main.cs:Startup() - Loading configuration"); - this.regionData.InitConfig(this.m_sandbox, this.localConfig); - this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change - - GridServers = new Grid(); - if (m_sandbox) - { - this.SetupLocalGridServers(); - //Authenticate Session Handler - AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal(); - this.AuthenticateSessionsHandler = authen; - } - else - { - this.SetupRemoteGridServers(); - //Authenticate Session Handler - AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote(); - this.AuthenticateSessionsHandler = authen; - } - - startuptime = DateTime.Now; - - try - { - AssetCache = new AssetCache(GridServers.AssetServer); - InventoryCache = new InventoryCache(); - } - catch (Exception e) - { - m_console.Error(e.Message + "\nSorry, could not setup local cache"); - Environment.Exit(1); - } - - m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console, this.AuthenticateSessionsHandler); - - //should be passing a IGenericConfig object to these so they can read the config data they want from it - GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); - IGridServer gridServer = GridServers.GridServer; - gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey); - - if (!m_sandbox) - { - this.ConnectToRemoteGridServer(); - } - - this.SetupLocalWorld(); - - if (m_sandbox) - { - AssetCache.LoadDefaultTextureSet(); - } - - m_console.Notice("Main.cs:Startup() - Initialising HTTP server"); - - this.SetupHttpListener(); - - LoginServer loginServer = null; - LoginServer adminLoginServer = null; - - bool sandBoxWithLoginServer = m_loginserver && m_sandbox; - if (sandBoxWithLoginServer) - { - loginServer = new LoginServer( regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts); - loginServer.Startup(); - loginServer.SetSessionHandler(((AuthenticateSessionsLocal) this.AuthenticateSessionsHandler).AddNewSession); - - if (user_accounts) - { - //sandbox mode with loginserver using accounts - this.GridServers.UserServer = loginServer; - adminLoginServer = loginServer; - - httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.LocalUserManager.XmlRpcLoginMethod); - } - else - { - //sandbox mode with loginserver not using accounts - httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod); - } - } - - AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer); - adminWebFront.LoadMethods(httpServer); - - m_console.Notice("Main.cs:Startup() - Starting HTTP server"); - httpServer.Start(); - - //MainServerListener(); - this.m_udpServer.ServerListener(); - - m_heartbeatTimer.Enabled = true; - m_heartbeatTimer.Interval = 100; - m_heartbeatTimer.Elapsed += new ElapsedEventHandler(this.Heartbeat); - } - - # region Setup methods - protected virtual void SetupLocalGridServers() - { - GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll"; - GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll"; - - m_console.Notice("Starting in Sandbox mode"); - - try - { - GridServers.Initialise(); - } - catch (Exception e) - { - m_console.Error(e.Message + "\nSorry, could not setup the grid interface"); - Environment.Exit(1); - } - } - - protected virtual void SetupRemoteGridServers() - { - if (this.gridLocalAsset) - { - GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll"; - } - else - { - GridServers.AssetDll = "OpenSim.GridInterfaces.Remote.dll"; - } - GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll"; - - m_console.Notice("Starting in Grid mode"); - - try - { - GridServers.Initialise(); - } - catch (Exception e) - { - m_console.Error(e.Message + "\nSorry, could not setup the grid interface"); - Environment.Exit(1); - } - } - - protected virtual void SetupLocalWorld() - { - m_console.Notice("Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString()); - m_console.Notice("Initialising world"); - m_console.componentname = "Region " + regionData.RegionName; - - m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName); - LocalWorld.InventoryCache = InventoryCache; - LocalWorld.AssetCache = AssetCache; - - this.m_udpServer.LocalWorld = LocalWorld; - this.m_udpServer.PacketServer.RegisterClientPacketHandlers(); - - this.physManager = new OpenSim.Physics.Manager.PhysicsManager(); - this.physManager.LoadPlugins(); - - LocalWorld.m_datastore = this.regionData.DataStore; - - LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded. - LocalWorld.LoadWorldMap(); - - m_console.Notice("Main.cs:Startup() - Starting up messaging system"); - LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); - LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D()); - LocalWorld.LoadPrimsFromStorage(); - } - - protected virtual void SetupHttpListener() - { - httpServer = new BaseHttpServer(regionData.IPListenPort); - - if (this.GridServers.GridServer.GetName() == "Remote") - { - - // we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server - httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler).ExpectUser ); - - httpServer.AddXmlRPCHandler("agent_crossing", - delegate(XmlRpcRequest request) - { - Hashtable requestData = (Hashtable)request.Params[0]; - AgentCircuitData agent_data = new AgentCircuitData(); - agent_data.firstname = (string)requestData["firstname"]; - agent_data.lastname = (string)requestData["lastname"]; - agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); - agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]), Single.Parse((string)requestData["pos_y"]), Single.Parse((string)requestData["pos_z"])); - - if (((RemoteGridBase)this.GridServers.GridServer).agentcircuits.ContainsKey((uint)agent_data.circuitcode)) - { - ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].firstname = agent_data.firstname; - ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].lastname = agent_data.lastname; - ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].startpos = agent_data.startpos; - } - - return new XmlRpcResponse(); - }); - - httpServer.AddRestHandler("GET", "/simstatus/", - delegate(string request, string path, string param) - { - return "OK"; - }); - } - } - - protected virtual void ConnectToRemoteGridServer() - { - if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort)) - { - m_console.Notice("Main.cs:Startup() - Success: Got a grid connection OK!"); - } - else - { - m_console.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "Main.cs:Startup() - FAILED: Unable to get connection to grid. Shutting down."); - Shutdown(); - } - - GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]); - - // If we are being told to load a file, load it. - string dataUri = (string)((RemoteGridBase)GridServers.GridServer).GridData["data_uri"]; - - if (!String.IsNullOrEmpty(dataUri)) - { - this.LocalWorld.m_datastore = dataUri; - } - - if (((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString() != "") - { - // The grid server has told us who we are - // We must obey the grid server. - try - { - regionData.RegionLocX = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locx"].ToString()); - regionData.RegionLocY = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locy"].ToString()); - regionData.RegionName = ((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString(); - } - catch (Exception e) - { - m_console.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, e.Message + "\nBAD ERROR! THIS SHOULD NOT HAPPEN! Bad GridData from the grid interface!!!! ZOMG!!!"); - Environment.Exit(1); - } - } - } - - #endregion - - private void SetupFromConfigFile(IGenericConfig configData) - { - try - { - // SandBoxMode - string attri = ""; - attri = configData.GetAttribute("SandBox"); - if ((attri == "") || ((attri != "false") && (attri != "true"))) - { - this.m_sandbox = false; - configData.SetAttribute("SandBox", "false"); - } - else - { - this.m_sandbox = Convert.ToBoolean(attri); - } - - // LoginServer - attri = ""; - attri = configData.GetAttribute("LoginServer"); - if ((attri == "") || ((attri != "false") && (attri != "true"))) - { - this.m_loginserver = false; - configData.SetAttribute("LoginServer", "false"); - } - else - { - this.m_loginserver = Convert.ToBoolean(attri); - } - - // Sandbox User accounts - attri = ""; - attri = configData.GetAttribute("UserAccount"); - if ((attri == "") || ((attri != "false") && (attri != "true"))) - { - this.user_accounts = false; - configData.SetAttribute("UserAccounts", "false"); - } - else if (attri == "true") - { - this.user_accounts = Convert.ToBoolean(attri); - } - - // Grid mode hack to use local asset server - attri = ""; - attri = configData.GetAttribute("LocalAssets"); - if ((attri == "") || ((attri != "false") && (attri != "true"))) - { - this.gridLocalAsset = false; - configData.SetAttribute("LocalAssets", "false"); - } - else if (attri == "true") - { - this.gridLocalAsset = Convert.ToBoolean(attri); - } - - - attri = ""; - attri = configData.GetAttribute("PhysicsEngine"); - switch (attri) - { - default: - m_console.Warn("Main.cs: SetupFromConfig() - Invalid value for PhysicsEngine attribute, terminating"); - Environment.Exit(1); - break; - - case "": - this.m_physicsEngine = "basicphysics"; - configData.SetAttribute("PhysicsEngine", "basicphysics"); - OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = false; - break; - - case "basicphysics": - this.m_physicsEngine = "basicphysics"; - configData.SetAttribute("PhysicsEngine", "basicphysics"); - OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = false; - break; - - case "RealPhysX": - this.m_physicsEngine = "RealPhysX"; - OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = true; - break; - - case "OpenDynamicsEngine": - this.m_physicsEngine = "OpenDynamicsEngine"; - OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = true; - break; - } - - configData.Commit(); - } - catch (Exception e) - { - Console.WriteLine(e.Message); - Console.WriteLine("\nSorry, a fatal error occurred while trying to initialise the configuration data"); - Console.WriteLine("Can not continue starting up"); - Environment.Exit(1); - } - } - - /// - /// Performs any last-minute sanity checking and shuts down the region server - /// - public virtual void Shutdown() - { - m_console.Notice("Main.cs:Shutdown() - Closing all threads"); - m_console.Notice("Main.cs:Shutdown() - Killing listener thread"); - m_console.Notice("Main.cs:Shutdown() - Killing clients"); - // IMPLEMENT THIS - m_console.Notice("Main.cs:Shutdown() - Closing console and terminating"); - LocalWorld.Close(); - GridServers.Close(); - m_console.Close(); - Environment.Exit(0); - } - - /// - /// Performs per-frame updates regularly - /// - /// - /// - void Heartbeat(object sender, System.EventArgs e) - { - LocalWorld.Update(); - } - - #region Console Commands - /// - /// Runs commands issued by the server console from the operator - /// - /// The first argument of the parameter (the command) - /// Additional arguments passed to the command - public void RunCmd(string command, string[] cmdparams) - { - switch (command) - { - case "help": - m_console.Error("show users - show info about connected users"); - m_console.Error("shutdown - disconnect all clients and shutdown"); - break; - - case "show": - Show(cmdparams[0]); - break; - - case "terrain": - string result = ""; - if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams, ref result)) - { - m_console.Error(result); - } - break; - - case "shutdown": - Shutdown(); - break; - - default: - m_console.Error("Unknown command"); - break; - } - } - - /// - /// Outputs to the console information about the region - /// - /// What information to display (valid arguments are "uptime", "users") - public void Show(string ShowWhat) - { - switch (ShowWhat) - { - case "uptime": - m_console.Error("OpenSim has been running since " + startuptime.ToString()); - m_console.Error("That is " + (DateTime.Now - startuptime).ToString()); - break; - case "users": - OpenSim.RegionServer.Simulator.Avatar TempAv; - m_console.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP")); - foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys) - { - if (LocalWorld.Entities[UUID].ToString() == "OpenSim.RegionServer.Simulator.Avatar") - { - TempAv = (OpenSim.RegionServer.Simulator.Avatar)LocalWorld.Entities[UUID]; - m_console.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString())); - } - } - break; - } - } - #endregion - } - - */ -} diff --git a/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs b/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs deleted file mode 100644 index bc85cdb..0000000 --- a/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs +++ /dev/null @@ -1,45 +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.Net; -using System.Net.Sockets; -using libsecondlife; -using OpenSim.Framework.Interfaces; - -namespace OpenSim.RegionServer -{ - public interface OpenSimNetworkHandler - { - void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender); - void RemoveClientCircuit(uint circuitcode); - void RegisterPacketServer(PacketServer server); - AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode); - } -} diff --git a/OpenSim/OpenSim.RegionServer/PacketServer.cs b/OpenSim/OpenSim.RegionServer/PacketServer.cs deleted file mode 100644 index 7267ae8..0000000 --- a/OpenSim/OpenSim.RegionServer/PacketServer.cs +++ /dev/null @@ -1,116 +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 OpenSim.RegionServer.Simulator; -using OpenSim.RegionServer.Client; -using libsecondlife.Packets; - -namespace OpenSim.RegionServer -{ - public class PacketServer - { - private OpenSimNetworkHandler _networkHandler; - private World _localWorld; - public Dictionary ClientThreads = new Dictionary(); - - public PacketServer(OpenSimNetworkHandler networkHandler) - { - _networkHandler = networkHandler; - _networkHandler.RegisterPacketServer(this); - } - - public World LocalWorld - { - set - { - this._localWorld = value; - } - } - - public virtual void ClientInPacket(uint circuitCode, Packet packet) - { - if (this.ClientThreads.ContainsKey(circuitCode)) - { - ClientThreads[circuitCode].InPacket(packet); - } - } - - public virtual bool AddNewCircuitCodeClient(uint circuitCode) - { - return false; - } - - public virtual void SendPacketToAllClients(Packet packet) - { - - } - - public virtual void SendPacketToAllExcept(Packet packet, ClientView simClient) - { - - } - - public virtual void AddClientPacketHandler(PacketType packetType, PacketMethod handler) - { - - } - - public virtual void RegisterClientPacketHandlers() - { - if (this._localWorld != null) - { - ClientView.AddPacketHandler(PacketType.UUIDNameRequest, this.RequestUUIDName); - } - } - - #region Client Packet Handlers - - public bool RequestUUIDName(ClientView simClient, Packet packet) - { - System.Text.Encoding enc = System.Text.Encoding.ASCII; - Console.WriteLine(packet.ToString()); - UUIDNameRequestPacket nameRequest = (UUIDNameRequestPacket)packet; - UUIDNameReplyPacket nameReply = new UUIDNameReplyPacket(); - nameReply.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[nameRequest.UUIDNameBlock.Length]; - - for (int i = 0; i < nameRequest.UUIDNameBlock.Length; i++) - { - nameReply.UUIDNameBlock[i] = new UUIDNameReplyPacket.UUIDNameBlockBlock(); - nameReply.UUIDNameBlock[i].ID = nameRequest.UUIDNameBlock[i].ID; - nameReply.UUIDNameBlock[i].FirstName = enc.GetBytes("Who\0"); //for now send any name - nameReply.UUIDNameBlock[i].LastName = enc.GetBytes("Knows\0"); //in future need to look it up - } - simClient.OutPacket(nameReply); - return true; - } - - #endregion - } -} diff --git a/OpenSim/OpenSim.RegionServer/RegionInfo.cs b/OpenSim/OpenSim.RegionServer/RegionInfo.cs deleted file mode 100644 index de1750c..0000000 --- a/OpenSim/OpenSim.RegionServer/RegionInfo.cs +++ /dev/null @@ -1,380 +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.Globalization; -using System.Net; -using System.Web; -using System.IO; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; -using libsecondlife; - -namespace OpenSim.RegionServer -{ - public class RegionInfo : RegionInfoBase - { - //following should be removed and the GenericConfig object passed around, - //so each class (AssetServer, GridServer etc) can access what config data they want - public string AssetURL = "http://127.0.0.1:8003/"; - public string AssetSendKey = ""; - - public string GridURL = ""; - public string GridSendKey = ""; - public string GridRecvKey = ""; - public string UserURL = ""; - public string UserSendKey = ""; - public string UserRecvKey = ""; - private bool isSandbox; - - public string MasterAvatarFirstName = ""; - public string MasterAvatarLastName = ""; - public string MasterAvatarSandboxPassword = ""; - public LLUUID MasterAvatarAssignedUUID = LLUUID.Zero; - - public string DataStore; - - public RegionInfo() - { - - } - - public void SaveToGrid() - { - //we really want to keep any server connection code out of here and out of the code code - // and put it in the server connection classes (those inheriting from IGridServer etc) - string reqtext; - reqtext = ""; - reqtext += "" + this.GridSendKey + ""; - reqtext += ""; - reqtext += "" + this.SimUUID.ToString() + ""; - reqtext += "" + this.RegionName + ""; - reqtext += "" + this.IPListenAddr + ""; - reqtext += "" + this.IPListenPort.ToString() + ""; - reqtext += "" + this.RegionLocX.ToString() + ""; - reqtext += "" + this.RegionLocY.ToString() + ""; - reqtext += "1"; - reqtext += ""; - reqtext += ""; - - byte[] reqdata = (new System.Text.ASCIIEncoding()).GetBytes(reqtext); - string newpath = ""; - if (this.GridURL.EndsWith("/")) - { - newpath = this.GridURL + "sims/"; - } - else - { - newpath = this.GridURL + "/sims/"; - } - - WebRequest GridSaveReq = WebRequest.Create(newpath + this.SimUUID.ToString()); - GridSaveReq.Method = "POST"; - GridSaveReq.ContentType = "application/x-www-form-urlencoded"; - GridSaveReq.ContentLength = reqdata.Length; - - Stream stOut = GridSaveReq.GetRequestStream(); - stOut.Write(reqdata, 0, reqdata.Length); - stOut.Close(); - - WebResponse gridresp = GridSaveReq.GetResponse(); - StreamReader stIn = new StreamReader(gridresp.GetResponseStream(), Encoding.ASCII); - string GridResponse = stIn.ReadToEnd(); - stIn.Close(); - gridresp.Close(); - - OpenSim.Framework.Console.MainConsole.Instance.Verbose("RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse); - } - - public void InitConfig(bool sandboxMode, IGenericConfig configData) - { - this.isSandbox = sandboxMode; - try - { - // Sim UUID - string attri = ""; - attri = configData.GetAttribute("SimUUID"); - if (attri == "") - { - this.SimUUID = LLUUID.Random(); - configData.SetAttribute("SimUUID", this.SimUUID.ToString()); - } - else - { - this.SimUUID = new LLUUID(attri); - } - - // Sim name - attri = ""; - attri = configData.GetAttribute("SimName"); - if (attri == "") - { - this.RegionName = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Simulator Name", "OpenSim Island"); - configData.SetAttribute("SimName", this.RegionName); - } - else - { - this.RegionName = attri; - } - // Sim/Grid location X - attri = ""; - attri = configData.GetAttribute("SimLocationX"); - if (attri == "") - { - string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Grid Location X", "997"); - configData.SetAttribute("SimLocationX", location); - this.RegionLocX = (uint)Convert.ToUInt32(location); - } - else - { - this.RegionLocX = (uint)Convert.ToUInt32(attri); - } - // Sim/Grid location Y - attri = ""; - attri = configData.GetAttribute("SimLocationY"); - if (attri == "") - { - string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Grid Location Y", "996"); - configData.SetAttribute("SimLocationY", location); - this.RegionLocY = (uint)Convert.ToUInt32(location); - } - else - { - this.RegionLocY = (uint)Convert.ToUInt32(attri); - } - - // Local storage datastore - attri = ""; - attri = configData.GetAttribute("Datastore"); - if (attri == "") - { - string datastore = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Filename for local world storage", "localworld.yap"); - configData.SetAttribute("Datastore", datastore); - this.DataStore = datastore; - } - else - { - this.DataStore = attri; - } - - //Sim Listen Port - attri = ""; - attri = configData.GetAttribute("SimListenPort"); - if (attri == "") - { - string port = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: UDP port for client connections", "9000"); - configData.SetAttribute("SimListenPort", port); - this.IPListenPort = Convert.ToInt32(port); - } - else - { - this.IPListenPort = Convert.ToInt32(attri); - } - //Sim Listen Address - attri = ""; - attri = configData.GetAttribute("SimListenAddress"); - if (attri == "") - { - this.IPListenAddr = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: IP Address to listen on for client connections", "127.0.0.1"); - configData.SetAttribute("SimListenAddress", this.IPListenAddr); - } - else - { - // Probably belongs elsewhere, but oh well. - if (attri.Trim().StartsWith("SYSTEMIP")) - { - string localhostname = System.Net.Dns.GetHostName(); - System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); - try - { - this.IPListenAddr = ips[0].ToString(); - } - catch (Exception e) - { - e.ToString(); - this.IPListenAddr = "127.0.0.1"; // Use the default if we fail - } - } - else - { - this.IPListenAddr = attri; - } - } - - // Terrain Default File - attri = ""; - attri = configData.GetAttribute("TerrainFile"); - if (attri == "") - { - this.estateSettings.terrainFile = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Default Terrain File", "default.r32"); - configData.SetAttribute("TerrainFile", this.estateSettings.terrainFile); - } - else - { - this.estateSettings.terrainFile = attri; - } - - attri = ""; - attri = configData.GetAttribute("TerrainMultiplier"); - if (attri == "") - { - string re = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0"); - this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture); - configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString()); - } - else - { - this.estateSettings.terrainMultiplier = Convert.ToDouble(attri); - } - - attri = ""; - attri = configData.GetAttribute("MasterAvatarFirstName"); - if (attri == "") - { - this.MasterAvatarFirstName = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: First name of Master Avatar", "Test"); - - configData.SetAttribute("MasterAvatarFirstName", this.MasterAvatarFirstName); - } - else - { - this.MasterAvatarFirstName = attri; - } - - attri = ""; - attri = configData.GetAttribute("MasterAvatarLastName"); - if (attri == "") - { - this.MasterAvatarLastName = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Last name of Master Avatar", "User"); - - configData.SetAttribute("MasterAvatarLastName", this.MasterAvatarLastName); - } - else - { - this.MasterAvatarLastName = attri; - } - - if (isSandbox) //Sandbox Mode Settings - { - attri = ""; - attri = configData.GetAttribute("MasterAvatarSandboxPassword"); - if (attri == "") - { - this.MasterAvatarSandboxPassword = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("SANDBOX MODE SETTING: Password of Master Avatar", "test"); - - configData.SetAttribute("MasterAvatarSandboxPassword", this.MasterAvatarSandboxPassword); - } - else - { - this.MasterAvatarSandboxPassword = attri; - } - } - else //Grid Mode Settings - { - //shouldn't be reading this data in here, it should be up to the classes implementing the server interfaces to read what they need from the config object - - //Grid Server URL - attri = ""; - attri = configData.GetAttribute("GridServerURL"); - if (attri == "") - { - this.GridURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GRID MODE SETTING: Grid server URL", "http://127.0.0.1:8001/"); - configData.SetAttribute("GridServerURL", this.GridURL); - } - else - { - this.GridURL = attri; - } - - //Grid Send Key - attri = ""; - attri = configData.GetAttribute("GridSendKey"); - if (attri == "") - { - this.GridSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GRID MODE SETTING: Key to send to grid server", "null"); - configData.SetAttribute("GridSendKey", this.GridSendKey); - } - else - { - this.GridSendKey = attri; - } - - //Grid Receive Key - attri = ""; - attri = configData.GetAttribute("GridRecvKey"); - if (attri == "") - { - this.GridRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GRID MODE SETTING: Key to expect from grid server", "null"); - configData.SetAttribute("GridRecvKey", this.GridRecvKey); - } - else - { - this.GridRecvKey = attri; - } - - attri = ""; - attri = configData.GetAttribute("AssetServerURL"); - if (attri == "") - { - this.AssetURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GRID MODE SETTING: Asset server URL", "http://127.0.0.1:8003/"); - configData.SetAttribute("AssetServerURL", this.AssetURL); - } - else - { - this.AssetURL = attri; - } - - } - - this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); - if (!this.isSandbox) - { - this.SaveToGrid(); - } - configData.Commit(); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Warn("Config.cs:InitConfig() - Exception occured"); - OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); - } - - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Simulator Settings Loaded"); - /* MainConsole.Instance.Notice("UUID: " + this.SimUUID.ToStringHyphenated()); - MainConsole.Instance.Notice("Name: " + this.RegionName); - MainConsole.Instance.Notice("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); - MainConsole.Instance.Notice("Region Handle: " + this.RegionHandle.ToString()); - MainConsole.Instance.Notice("Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort); - MainConsole.Instance.Notice("Sandbox Mode? " + isSandbox.ToString()); - MainConsole.Instance.Notice("Asset URL: " + this.AssetURL); - MainConsole.Instance.Notice("Asset key: " + this.AssetSendKey); - MainConsole.Instance.Notice("Grid URL: " + this.GridURL); - MainConsole.Instance.Notice("Grid key: " + this.GridSendKey); */ - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/RegionInfoBase.cs b/OpenSim/OpenSim.RegionServer/RegionInfoBase.cs deleted file mode 100644 index 481b865..0000000 --- a/OpenSim/OpenSim.RegionServer/RegionInfoBase.cs +++ /dev/null @@ -1,62 +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.Net; -using System.Web; -using System.IO; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Types; -using libsecondlife; - -namespace OpenSim.RegionServer -{ - public class RegionInfoBase - { - public LLUUID SimUUID = new LLUUID(); - public string RegionName = ""; - public uint RegionLocX = 0; - public uint RegionLocY = 0; - public ulong RegionHandle = 0; - - - public int IPListenPort = 0; - public string IPListenAddr = ""; - - - public EstateSettings estateSettings; - - public RegionInfoBase() - { - estateSettings = new EstateSettings(); - } - } - -} diff --git a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs b/OpenSim/OpenSim.RegionServer/RegionServerBase.cs deleted file mode 100644 index 2d99bb3..0000000 --- a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs +++ /dev/null @@ -1,130 +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.RegionServer.Simulator; -using OpenSim.Terrain; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.UserServer; -using OpenSim.RegionServer.Assets; -using OpenSim.RegionServer.CAPS; -using OpenSim.Framework.Console; -using OpenSim.Physics.Manager; -using Nwc.XmlRpc; -using OpenSim.Servers; -using OpenSim.GenericConfig; - -namespace OpenSim.RegionServer -{ - public class RegionServerBase - { - protected IGenericConfig localConfig; - protected PhysicsManager physManager; - protected Grid GridServers; - protected AssetCache AssetCache; - protected InventoryCache InventoryCache; - protected Dictionary clientCircuits = new Dictionary(); - protected DateTime startuptime; - protected RegionInfo regionData; - - protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer(); - public string m_physicsEngine; - public bool m_sandbox = false; - public bool m_loginserver; - public bool user_accounts = false; - public bool gridLocalAsset = false; - protected bool configFileSetup = false; - public string m_config; - - protected UDPServer m_udpServer; - protected BaseHttpServer httpServer; - protected AuthenticateSessionsBase AuthenticateSessionsHandler; - - protected ConsoleBase m_console; - - public RegionServerBase() - { - - } - - public RegionServerBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile) - { - this.configFileSetup = useConfigFile; - m_sandbox = sandBoxMode; - m_loginserver = startLoginServer; - m_physicsEngine = physicsEngine; - m_config = configFile; - } - - protected World m_localWorld; - public World LocalWorld - { - get { return m_localWorld; } - } - - /// - /// Performs initialisation of the world, such as loading configuration from disk. - /// - public virtual void StartUp() - { - } - - protected virtual void SetupLocalGridServers() - { - } - - protected virtual void SetupRemoteGridServers() - { - - } - - protected virtual void SetupLocalWorld() - { - } - - protected virtual void SetupHttpListener() - { - } - - protected virtual void ConnectToRemoteGridServer() - { - - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Scripting/IScriptContext.cs b/OpenSim/OpenSim.RegionServer/Scripting/IScriptContext.cs deleted file mode 100644 index 2ac0a2e..0000000 --- a/OpenSim/OpenSim.RegionServer/Scripting/IScriptContext.cs +++ /dev/null @@ -1,40 +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.RegionServer.Scripting -{ - public interface IScriptContext - { - IScriptEntity Entity { get; } - bool TryGetRandomAvatar(out IScriptReadonlyEntity avatar); - } -} diff --git a/OpenSim/OpenSim.RegionServer/Scripting/IScriptEntity.cs b/OpenSim/OpenSim.RegionServer/Scripting/IScriptEntity.cs deleted file mode 100644 index 05a1237..0000000 --- a/OpenSim/OpenSim.RegionServer/Scripting/IScriptEntity.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; -using libsecondlife; - -namespace OpenSim.RegionServer.Scripting -{ - public interface IScriptReadonlyEntity - { - LLVector3 Pos { get; } - string Name { get; } - } - - public interface IScriptEntity - { - LLVector3 Pos { get; set; } - string Name { get; } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Scripting/IScriptHandler.cs b/OpenSim/OpenSim.RegionServer/Scripting/IScriptHandler.cs deleted file mode 100644 index 7431799..0000000 --- a/OpenSim/OpenSim.RegionServer/Scripting/IScriptHandler.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* -* Copyright (c) Contributors, http://www.openmetaverse.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Physics.Manager; -using OpenSim.RegionServer.Simulator; -using Avatar=OpenSim.RegionServer.Simulator.Avatar; -using Primitive = OpenSim.RegionServer.Simulator.Primitive; - -namespace OpenSim.RegionServer.Scripting -{ - public delegate void ScriptEventHandler(IScriptContext context); - - public class ScriptHandler : IScriptContext, IScriptEntity, IScriptReadonlyEntity - { - private World m_world; - private Script m_script; - private Entity m_entity; - - public LLUUID ScriptId - { - get - { - return m_script.ScriptId; - } - } - - public void OnFrame() - { - m_script.OnFrame(this); - } - - public ScriptHandler(Script script, Entity entity, World world) - { - m_script = script; - m_entity = entity; - m_world = world; - } - - #region IScriptContext Members - - IScriptEntity IScriptContext.Entity - { - get - { - return this; - } - } - - bool IScriptContext.TryGetRandomAvatar(out IScriptReadonlyEntity avatar) - { - foreach (Entity entity in m_world.Entities.Values ) - { - if( entity is Avatar ) - { - avatar = entity; - return true; - } - } - - avatar = null; - return false; - } - - #endregion - - #region IScriptEntity and IScriptReadonlyEntity Members - - public string Name - { - get - { - return m_entity.Name; - } - } - - public LLVector3 Pos - { - get - { - return m_entity.Pos; - } - - set - { - if (m_entity is Primitive) - { - Primitive prim = m_entity as Primitive; - // Of course, we really should have asked the physEngine if this is possible, and if not, returned false. - prim.UpdatePosition( value ); - } - } - } - - #endregion - } - -} diff --git a/OpenSim/OpenSim.RegionServer/Scripting/Script.cs b/OpenSim/OpenSim.RegionServer/Scripting/Script.cs deleted file mode 100644 index e6732a6..0000000 --- a/OpenSim/OpenSim.RegionServer/Scripting/Script.cs +++ /dev/null @@ -1,53 +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.RegionServer.Scripting -{ - public class Script - { - private LLUUID m_scriptId; - public virtual LLUUID ScriptId - { - get - { - return m_scriptId; - } - } - - public Script( LLUUID scriptId ) - { - m_scriptId = scriptId; - } - - public ScriptEventHandler OnFrame; - } -} diff --git a/OpenSim/OpenSim.RegionServer/Scripting/ScriptFactory.cs b/OpenSim/OpenSim.RegionServer/Scripting/ScriptFactory.cs deleted file mode 100644 index 525f63d..0000000 --- a/OpenSim/OpenSim.RegionServer/Scripting/ScriptFactory.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.RegionServer.Scripting -{ - public delegate Script ScriptFactory(); -} diff --git a/OpenSim/OpenSim.RegionServer/Scripting/Scripts/FollowRandomAvatar.cs b/OpenSim/OpenSim.RegionServer/Scripting/Scripts/FollowRandomAvatar.cs deleted file mode 100644 index 55ea795..0000000 --- a/OpenSim/OpenSim.RegionServer/Scripting/Scripts/FollowRandomAvatar.cs +++ /dev/null @@ -1,64 +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.RegionServer.Scripting -{ - public class FollowRandomAvatar : Script - { - public FollowRandomAvatar() - : base(LLUUID.Random()) - { - OnFrame += MyOnFrame; - } - - private void MyOnFrame(IScriptContext context) - { - LLVector3 pos = context.Entity.Pos; - - IScriptReadonlyEntity avatar; - - if (context.TryGetRandomAvatar(out avatar)) - { - LLVector3 avatarPos = avatar.Pos; - - float x = pos.X + ((float)avatarPos.X.CompareTo(pos.X)) / 2; - float y = pos.Y + ((float)avatarPos.Y.CompareTo(pos.Y)) / 2; - - LLVector3 newPos = new LLVector3(x, y, pos.Z); - - context.Entity.Pos = newPos; - } - } - } - - -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Client.cs b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Client.cs deleted file mode 100644 index c6ce258..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Client.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.Collections.Generic; -using System.Text; -using libsecondlife.Packets; - -namespace OpenSim.RegionServer.Simulator -{ - partial class Avatar - { - private List updateList = new List(); - private List interestList = new List(); - - public void SendPacketToViewer(Packet packet) - { - this.ControllingClient.OutPacket(packet); - } - - public void AddTerseUpdateToViewersList(ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock) - { - - } - - public void SendUpdateListToViewer() - { - - } - - private void UpdateInterestList() - { - - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs deleted file mode 100644 index 03da861..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs +++ /dev/null @@ -1,371 +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.RegionServer.Client; - -namespace OpenSim.RegionServer.Simulator -{ - partial class Avatar - { - public override void update() - { - if (!this.childAvatar) - { - if (this._physActor == null) - { - //HACKHACK: Note to work out why this entity does not have a physics actor - // and prehaps create one. - return; - } - libsecondlife.LLVector3 pos2 = new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z); - if (this.updateflag) - { - //need to send movement info - //so create the improvedterseobjectupdate packet - //use CreateTerseBlock() - ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); - ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); - terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle; - terse.RegionData.TimeDilation = 64096; - terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; - terse.ObjectData[0] = terseBlock; - List avList = this.m_world.RequestAvatarList(); - foreach (Avatar client in avList) - { - client.SendPacketToViewer(terse); - } - - updateflag = false; - //this._updateCount = 0; - } - else - { - - if ((pos2 != this.positionLastFrame) || (this.movementflag == 16)) - { - _updateCount++; - if (((!PhysicsEngineFlying) && (_updateCount > 3)) || (PhysicsEngineFlying) && (_updateCount > 0)) - { - //It has been a while since last update was sent so lets send one. - ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); - ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); - terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle; - terse.RegionData.TimeDilation = 64096; - terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; - terse.ObjectData[0] = terseBlock; - List avList = this.m_world.RequestAvatarList(); - foreach (Avatar client in avList) - { - client.SendPacketToViewer(terse); - } - _updateCount = 0; - } - - if (this.movementflag == 16) - { - movementflag = 0; - } - } - - } - - if (positionFrameBeforeLast != pos2) - { - this.positionFrameBeforeLast = this.positionLastFrame; - this.positionLastFrame = pos2; - int tempRoundedX = (int)Math.Round(positionLastFrame.X); - int tempRoundedY = (int)Math.Round(positionLastFrame.Y); - if (this.positionRoundedX != tempRoundedX || this.positionRoundedY != tempRoundedY) - { - - this.positionRoundedX = tempRoundedX; - this.positionRoundedY = tempRoundedY; - int currentParcelLocalID = m_world.parcelManager.getParcel(tempRoundedX, tempRoundedY).parcelData.localID; - if(currentParcelLocalID != this.positionParcelHoverLocalID) - { - - Console.WriteLine("NEW PARCEL: " + m_world.parcelManager.getParcel(tempRoundedX, tempRoundedY).parcelData.parcelName); - m_world.parcelManager.getParcel(tempRoundedX, tempRoundedY).sendParcelProperties(this.parcelUpdateSequenceIncrement, false, 0,this.ControllingClient); - this.positionParcelHoverLocalID = currentParcelLocalID; - this.parcelUpdateSequenceIncrement++; - } - } - } - - if (!this.ControllingClient.m_sandboxMode) - { - if (pos2.X < 0) - { - ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z)); - } - - if (pos2.Y < 0) - { - ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z)); - } - - if (pos2.X > 255) - { - ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z)); - } - - if (pos2.Y > 255) - { - ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z)); - } - } - } - - } - - public void SendUpdateToOtherClient(Avatar remoteAvatar) - { - ObjectUpdatePacket objupdate = CreateUpdatePacket(); - remoteAvatar.SendPacketToViewer(objupdate); - } - - public ObjectUpdatePacket CreateUpdatePacket() - { - System.Text.Encoding _enc = System.Text.Encoding.ASCII; - //send a objectupdate packet with information about the clients avatar - ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); - objupdate.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle; - objupdate.RegionData.TimeDilation = 64096; - objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; - - objupdate.ObjectData[0] = AvatarTemplate; - //give this avatar object a local id and assign the user a name - objupdate.ObjectData[0].ID = this.localid; - objupdate.ObjectData[0].FullID = ControllingClient.AgentID; - objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0"); - - libsecondlife.LLVector3 pos2 = new LLVector3((float)this._physActor.Position.X, (float)this._physActor.Position.Y, (float)this._physActor.Position.Z); - - byte[] pb = pos2.GetBytes(); - - Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); - return objupdate; - } - - public void SendInitialPosition() - { - System.Text.Encoding _enc = System.Text.Encoding.ASCII; - //send a objectupdate packet with information about the clients avatar - - ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); - objupdate.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle; - objupdate.RegionData.TimeDilation = 64096; - objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; - objupdate.ObjectData[0] = AvatarTemplate; - //give this avatar object a local id and assign the user a name - - objupdate.ObjectData[0].ID = this.localid; - this.uuid = objupdate.ObjectData[0].FullID = ControllingClient.AgentID; - objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0"); - libsecondlife.LLVector3 pos2 = new LLVector3((float)this.Pos.X, (float)this.Pos.Y, (float)this.Pos.Z); - byte[] pb = pos2.GetBytes(); - Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); - m_world._localNumber++; - - List avList = this.m_world.RequestAvatarList(); - foreach (Avatar client in avList) - { - client.SendPacketToViewer(objupdate); - if (client.ControllingClient.AgentID != this.ControllingClient.AgentID) - { - SendAppearanceToOtherAgent(client); - } - } - } - - public void SendOurAppearance() - { - ControllingClient.SendAppearance(this.Wearables); - } - - public void SendOurAppearance(ClientView OurClient) - { - //event handler for wearables request - this.SendOurAppearance(); - } - - public void SendAppearanceToOtherAgent(Avatar avatarInfo) - { - AvatarAppearancePacket avp = new AvatarAppearancePacket(); - avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; - avp.ObjectData.TextureEntry = this.avatarAppearanceTexture.ToBytes(); - - AvatarAppearancePacket.VisualParamBlock avblock = null; - for (int i = 0; i < 218; i++) - { - avblock = new AvatarAppearancePacket.VisualParamBlock(); - avblock.ParamValue = visualParams[i]; - avp.VisualParam[i] = avblock; - } - - avp.Sender.IsTrial = false; - avp.Sender.ID = ControllingClient.AgentID; - avatarInfo.SendPacketToViewer(avp); - } - - public void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam) - { - LLObject.TextureEntry tex = new LLObject.TextureEntry(texture, 0, texture.Length); - this.avatarAppearanceTexture = tex; - - for (int i = 0; i < visualParam.Length; i++) - { - this.visualParams[i] = visualParam[i].ParamValue; - } - - List avList = this.m_world.RequestAvatarList(); - foreach (Avatar client in avList) - { - if (client.ControllingClient.AgentID != this.ControllingClient.AgentID) - { - SendAppearanceToOtherAgent(client); - } - } - } - - public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock() - { - byte[] bytes = new byte[60]; - int i = 0; - ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); - - dat.TextureEntry = new byte[0];// AvatarTemplate.TextureEntry; - libsecondlife.LLVector3 pos2 = new LLVector3(0, 0, 0); - lock (m_world.LockPhysicsEngine) - { - pos2 = new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z); - } - - uint ID = this.localid; - - bytes[i++] = (byte)(ID % 256); - bytes[i++] = (byte)((ID >> 8) % 256); - bytes[i++] = (byte)((ID >> 16) % 256); - bytes[i++] = (byte)((ID >> 24) % 256); - bytes[i++] = 0; - bytes[i++] = 1; - i += 14; - bytes[i++] = 128; - bytes[i++] = 63; - - byte[] pb = pos2.GetBytes(); - Array.Copy(pb, 0, bytes, i, pb.Length); - i += 12; - ushort InternVelocityX; - ushort InternVelocityY; - ushort InternVelocityZ; - Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0); - lock (m_world.LockPhysicsEngine) - { - internDirec = new Axiom.MathLib.Vector3(this._physActor.Velocity.X, this._physActor.Velocity.Y, this._physActor.Velocity.Z); - } - internDirec = internDirec / 128.0f; - internDirec.x += 1; - internDirec.y += 1; - internDirec.z += 1; - - InternVelocityX = (ushort)(32768 * internDirec.x); - InternVelocityY = (ushort)(32768 * internDirec.y); - InternVelocityZ = (ushort)(32768 * internDirec.z); - - ushort ac = 32767; - bytes[i++] = (byte)(InternVelocityX % 256); - bytes[i++] = (byte)((InternVelocityX >> 8) % 256); - bytes[i++] = (byte)(InternVelocityY % 256); - bytes[i++] = (byte)((InternVelocityY >> 8) % 256); - bytes[i++] = (byte)(InternVelocityZ % 256); - bytes[i++] = (byte)((InternVelocityZ >> 8) % 256); - - //accel - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - //rot - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - //rotation vel - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - dat.Data = bytes; - return (dat); - } - - // Sends animation update - public void SendAnimPack(LLUUID animID, int seq) - { - AvatarAnimationPacket ani = new AvatarAnimationPacket(); - ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; - ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock(); - ani.AnimationSourceList[0].ObjectID = ControllingClient.AgentID; - ani.Sender = new AvatarAnimationPacket.SenderBlock(); - ani.Sender.ID = ControllingClient.AgentID; - ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[1]; - ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock(); - ani.AnimationList[0].AnimID = this.current_anim = animID; - ani.AnimationList[0].AnimSequenceID = this.anim_seq = seq; - - List avList = this.m_world.RequestAvatarList(); - foreach (Avatar client in avList) - { - client.SendPacketToViewer(ani); - } - - } - - public void SendAnimPack() - { - this.SendAnimPack(this.current_anim, this.anim_seq); - } - - } -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs deleted file mode 100644 index a64ee9e..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs +++ /dev/null @@ -1,435 +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.IO; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; -using OpenSim.Physics.Manager; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Interfaces; -using OpenSim.RegionServer.Client; - -using Axiom.MathLib; - -namespace OpenSim.RegionServer.Simulator -{ - public partial class Avatar : Entity - { - public static bool PhysicsEngineFlying = false; - public static AvatarAnimations Animations; - public string firstname; - public string lastname; - public ClientView ControllingClient; - public LLUUID current_anim; - public int anim_seq; - private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate; - private bool updateflag = false; - private byte movementflag = 0; - private List forcesList = new List(); - private short _updateCount = 0; - private Axiom.MathLib.Quaternion bodyRot; - private LLObject.TextureEntry avatarAppearanceTexture = null; - private byte[] visualParams; - private AvatarWearable[] Wearables; - private LLVector3 positionLastFrame = new LLVector3(0, 0, 0); - private LLVector3 positionFrameBeforeLast = new LLVector3(0, 0, 0); - - private int positionRoundedX = 0; - private int positionRoundedY = 0; - - private int positionParcelHoverLocalID = -1; //Local ID of the last parcel they were over - private int parcelUpdateSequenceIncrement = 1; - - private bool childAvatar = false; - - public Avatar(ClientView TheClient, World world) - { - m_world = world; - ControllingClient = TheClient; - - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs - Loading details from grid (DUMMY)"); - localid = 8880000 + (this.m_world._localNumber++); - Pos = ControllingClient.startpos; - visualParams = new byte[218]; - for (int i = 0; i < 218; i++) - { - visualParams[i] = 100; - } - Wearables = new AvatarWearable[13]; //should be 13 of these - for (int i = 0; i < 13; i++) - { - Wearables[i] = new AvatarWearable(); - } - this.Wearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); - this.Wearables[0].ItemID = LLUUID.Random(); - - this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); - - //register for events - ControllingClient.OnRequestWearables += new ClientView.GenericCall(this.SendOurAppearance); - ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance); - ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.CompleteMovement); - ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.SendInitialPosition); - ControllingClient.OnAgentUpdate += new ClientView.GenericCall3(this.HandleAgentUpdate); - ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); - ControllingClient.OnChildAgentStatus += new ClientView.StatusChange(this.ChildStatusChange); - - } - - public PhysicsActor PhysActor - { - set - { - this._physActor = value; - } - get - { - return _physActor; - } - } - - public void ChildStatusChange(bool status) - { - this.childAvatar = status; - - if (this.childAvatar == true) - { - this._physActor.Velocity = new PhysicsVector(0, 0, 0); - ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); - ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); - terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle; - terse.RegionData.TimeDilation = 64096; - terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; - terse.ObjectData[0] = terseBlock; - List avList = this.m_world.RequestAvatarList(); - foreach (Avatar client in avList) - { - client.SendPacketToViewer(terse); - } - } - else - { - LLVector3 startp = ControllingClient.StartPos; - lock (m_world.LockPhysicsEngine) - { - this._physActor.Position = new PhysicsVector(startp.X, startp.Y, startp.Z); - } - } - } - - public override void addForces() - { - lock (this.forcesList) - { - if (this.forcesList.Count > 0) - { - for (int i = 0; i < this.forcesList.Count; i++) - { - NewForce force = this.forcesList[i]; - PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z); - lock (m_world.LockPhysicsEngine) - { - this._physActor.Velocity = phyVector; - } - this.updateflag = true; - this.velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this - // but as we are setting the velocity (rather than using real forces) at the moment it is okay. - } - for (int i = 0; i < this.forcesList.Count; i++) - { - this.forcesList.RemoveAt(0); - } - } - } - } - - public static void SetupTemplate(string name) - { - FileInfo fInfo = new FileInfo(name); - long numBytes = fInfo.Length; - FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read); - BinaryReader br = new BinaryReader(fStream); - byte[] data1 = br.ReadBytes((int)numBytes); - br.Close(); - fStream.Close(); - - libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); - - SetDefaultPacketValues(objdata); - objdata.TextureEntry = data1; - objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); - objdata.PathCurve = 16; - objdata.ProfileCurve = 1; - objdata.PathScaleX = 100; - objdata.PathScaleY = 100; - objdata.ParentID = 0; - objdata.OwnerID = LLUUID.Zero; - objdata.Scale = new LLVector3(1, 1, 1); - objdata.PCode = 47; - System.Text.Encoding enc = System.Text.Encoding.ASCII; - libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16); - pos.X = 100f; - objdata.ID = 8880000; - objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0"); - libsecondlife.LLVector3 pos2 = new LLVector3(100f, 100f, 23f); - //objdata.FullID=user.AgentID; - byte[] pb = pos.GetBytes(); - Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length); - - Avatar.AvatarTemplate = objdata; - } - - protected static void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata) - { - objdata.PSBlock = new byte[0]; - objdata.ExtraParams = new byte[1]; - objdata.MediaURL = new byte[0]; - objdata.NameValue = new byte[0]; - objdata.Text = new byte[0]; - objdata.TextColor = new byte[4]; - objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0); - objdata.JointPivot = new LLVector3(0, 0, 0); - objdata.Material = 4; - objdata.TextureAnim = new byte[0]; - objdata.Sound = LLUUID.Zero; - LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); - objdata.TextureEntry = ntex.ToBytes(); - objdata.State = 0; - objdata.Data = new byte[0]; - - objdata.ObjectData = new byte[76]; - objdata.ObjectData[15] = 128; - objdata.ObjectData[16] = 63; - objdata.ObjectData[56] = 128; - objdata.ObjectData[61] = 102; - objdata.ObjectData[62] = 40; - objdata.ObjectData[63] = 61; - objdata.ObjectData[64] = 189; - - - } - - public void CompleteMovement() - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:CompleteMovement() - Constructing AgentMovementComplete packet"); - AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); - mov.AgentData.SessionID = this.ControllingClient.SessionID; - mov.AgentData.AgentID = this.ControllingClient.AgentID; - mov.Data.RegionHandle = this.m_world.m_regInfo.RegionHandle; - // TODO - dynamicalise this stuff - mov.Data.Timestamp = 1172750370; - mov.Data.Position = this.ControllingClient.startpos; - mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0); - - ControllingClient.OutPacket(mov); - } - - public void HandleAgentUpdate(Packet pack) - { - this.HandleUpdate((AgentUpdatePacket)pack); - } - - public void HandleUpdate(AgentUpdatePacket pack) - { - if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0) - { - if (this._physActor.Flying == false) - { - this.current_anim = Animations.AnimsLLUUID["FLY"]; - this.anim_seq = 1; - this.SendAnimPack(); - } - this._physActor.Flying = true; - - } - else - { - if (this._physActor.Flying == true) - { - this.current_anim = Animations.AnimsLLUUID["STAND"]; - this.anim_seq = 1; - this.SendAnimPack(); - } - this._physActor.Flying = false; - } - if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS) != 0) - { - Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); - if (((movementflag & 1) == 0) || (q != this.bodyRot)) - { - - if (((movementflag & 1) == 0) && (!this._physActor.Flying)) - { - this.current_anim = Animations.AnimsLLUUID["WALK"]; - this.anim_seq = 1; - this.SendAnimPack(); - } - - - //we should add a new force to the list - // but for now we will deal with velocities - NewForce newVelocity = new NewForce(); - Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0); - Axiom.MathLib.Vector3 direc = q * v3; - direc.Normalize(); - - //work out velocity for sim physics system - direc = direc * ((0.03f) * 128f); - if (this._physActor.Flying) - direc *= 4; - - newVelocity.X = direc.x; - newVelocity.Y = direc.y; - newVelocity.Z = direc.z; - this.forcesList.Add(newVelocity); - movementflag = 1; - this.bodyRot = q; - } - } - else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS) != 0) && (PhysicsEngineFlying)) - { - if (((movementflag & 2) == 0) && this._physActor.Flying) - { - //we should add a new force to the list - // but for now we will deal with velocities - NewForce newVelocity = new NewForce(); - Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(0, 0, 1); - Axiom.MathLib.Vector3 direc = v3; - direc.Normalize(); - - //work out velocity for sim physics system - direc = direc * ((0.03f) * 128f * 2); - newVelocity.X = direc.x; - newVelocity.Y = direc.y; - newVelocity.Z = direc.z; - this.forcesList.Add(newVelocity); - movementflag = 2; - } - } - else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && (PhysicsEngineFlying)) - { - if (((movementflag & 4) == 0) && this._physActor.Flying) - { - //we should add a new force to the list - // but for now we will deal with velocities - NewForce newVelocity = new NewForce(); - Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(0, 0, -1); - //Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); - Axiom.MathLib.Vector3 direc = v3; - direc.Normalize(); - - //work out velocity for sim physics system - direc = direc * ((0.03f) * 128f * 2); - newVelocity.X = direc.x; - newVelocity.Y = direc.y; - newVelocity.Z = direc.z; - this.forcesList.Add(newVelocity); - movementflag = 4; - } - } - else if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG) != 0) - { - Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); - if (((movementflag & 8) == 0) || (q != this.bodyRot)) - { - //we should add a new force to the list - // but for now we will deal with velocities - NewForce newVelocity = new NewForce(); - Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(-1, 0, 0); - Axiom.MathLib.Vector3 direc = q * v3; - direc.Normalize(); - - //work out velocity for sim physics system - direc = direc * ((0.03f) * 128f); - if (this._physActor.Flying) - direc *= 2; - - newVelocity.X = direc.x; - newVelocity.Y = direc.y; - newVelocity.Z = direc.z; - this.forcesList.Add(newVelocity); - movementflag = 8; - this.bodyRot = q; - } - } - else - { - if (movementflag == 16) - { - movementflag = 0; - } - if ((movementflag) != 0) - { - NewForce newVelocity = new NewForce(); - newVelocity.X = 0; - newVelocity.Y = 0; - newVelocity.Z = 0; - this.forcesList.Add(newVelocity); - movementflag = 0; - // We're standing still, so make it show! - if (this._physActor.Flying == false) - { - this.current_anim = Animations.AnimsLLUUID["STAND"]; - this.anim_seq = 1; - this.SendAnimPack(); - } - this.movementflag = 16; - - } - } - } - - - - public static void LoadAnims() - { - Avatar.Animations = new AvatarAnimations(); - Avatar.Animations.LoadAnims(); - } - - public override void LandRenegerated() - { - Pos = new LLVector3(100.0f, 100.0f, m_world.Terrain[(int)Pos.X, (int)Pos.Y] + 50.0f); - } - } - - public class NewForce - { - public float X; - public float Y; - public float Z; - - public NewForce() - { - - } - } - -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/AvatarAnimations.cs b/OpenSim/OpenSim.RegionServer/Simulator/AvatarAnimations.cs deleted file mode 100644 index c7557dc..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/AvatarAnimations.cs +++ /dev/null @@ -1,73 +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 System.Xml; - -namespace OpenSim.RegionServer.Simulator -{ - public class AvatarAnimations - { - - public Dictionary AnimsLLUUID = new Dictionary(); - public Dictionary AnimsNames = new Dictionary(); - - public AvatarAnimations() - { - } - - public void LoadAnims() - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:LoadAnims() - Loading avatar animations"); - XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"); - - XmlDocument doc = new XmlDocument(); - doc.Load(reader); - foreach (XmlNode nod in doc.DocumentElement.ChildNodes) - { - - if ( nod.Attributes["name"] != null) - { - AnimsLLUUID.Add(nod.Attributes["name"].Value, nod.InnerText); - } - - } - - reader.Close(); - - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)"); - - foreach (KeyValuePair kp in OpenSim.RegionServer.Simulator.Avatar.Animations.AnimsLLUUID) - { - AnimsNames.Add(kp.Value, kp.Key); - } - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Entity.cs b/OpenSim/OpenSim.RegionServer/Simulator/Entity.cs deleted file mode 100644 index 6d25c81..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/Entity.cs +++ /dev/null @@ -1,151 +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 Axiom.MathLib; -using OpenSim.Physics.Manager; -using OpenSim.RegionServer.Types; -using libsecondlife; -using OpenSim.RegionServer.Scripting; - -namespace OpenSim.RegionServer.Simulator -{ - public abstract class Entity : IScriptReadonlyEntity - { - public libsecondlife.LLUUID uuid; - public uint localid; - public LLVector3 velocity; - public Quaternion rotation; - protected List children; - - protected string m_name; - public virtual string Name - { - get { return m_name; } - } - - protected LLVector3 m_pos; - protected PhysicsActor _physActor; - protected World m_world; - - public virtual LLVector3 Pos - { - get - { - if (this._physActor != null) - { - m_pos.X = _physActor.Position.X; - m_pos.Y = _physActor.Position.Y; - m_pos.Z = _physActor.Position.Z; - } - - return m_pos; - } - set - { - if (this._physActor != null) - { - try - { - lock (this.m_world.LockPhysicsEngine) - { - - this._physActor.Position = new PhysicsVector(value.X, value.Y, value.Z); - } - } - catch (Exception e) - { - Console.WriteLine(e.Message); - } - } - - m_pos = value; - } - } - - /// - /// Creates a new Entity (should not occur on it's own) - /// - public Entity() - { - uuid = new libsecondlife.LLUUID(); - localid = 0; - m_pos = new LLVector3(); - velocity = new LLVector3(); - rotation = new Quaternion(); - m_name = "(basic entity)"; - children = new List(); - } - - public virtual void addForces() - { - foreach (Entity child in children) - { - child.addForces(); - } - } - - /// - /// Performs any updates that need to be done at each frame. This function is overridable from it's children. - /// - public virtual void update() { - // Do any per-frame updates needed that are applicable to every type of entity - foreach (Entity child in children) - { - child.update(); - } - } - - /// - /// Returns a mesh for this object and any dependents - /// - /// The mesh of this entity tree - public virtual Mesh getMesh() - { - Mesh mesh = new Mesh(); - - foreach (Entity child in children) - { - mesh += child.getMesh(); - } - - return mesh; - } - - public virtual void BackUp() - { - - } - - public virtual void LandRenegerated() - { - - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs b/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs deleted file mode 100644 index 21b783f..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs +++ /dev/null @@ -1,837 +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.RegionServer.Simulator; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.RegionServer.Client; - -namespace OpenSim.RegionServer.Simulator -{ - public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, ClientView remote_client); - public delegate void ParcelDivideRequest(int west, int south, int east, int north, ClientView remote_client); - public delegate void ParcelJoinRequest(int west, int south, int east, int north, ClientView remote_client); - public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, ClientView remote_client); - - #region ParcelManager Class - /// - /// Handles Parcel objects and operations requiring information from other Parcel objects (divide, join, etc) - /// - public class ParcelManager : OpenSim.Framework.Interfaces.ILocalStorageParcelReceiver - { - - #region Constants - //Parcel types set with flags in ParcelOverlay. - //Only one of these can be used. - public const byte PARCEL_TYPE_PUBLIC = (byte)0; //Equals 00000000 - public const byte PARCEL_TYPE_OWNED_BY_OTHER = (byte)1; //Equals 00000001 - public const byte PARCEL_TYPE_OWNED_BY_GROUP = (byte)2; //Equals 00000010 - public const byte PARCEL_TYPE_OWNED_BY_REQUESTER = (byte)3; //Equals 00000011 - public const byte PARCEL_TYPE_IS_FOR_SALE = (byte)4; //Equals 00000100 - public const byte PARCEL_TYPE_IS_BEING_AUCTIONED = (byte)5; //Equals 00000101 - - - //Flags that when set, a border on the given side will be placed - //NOTE: North and East is assumable by the west and south sides (if parcel to east has a west border, then I have an east border; etc) - //This took forever to figure out -- jeesh. /blame LL for even having to send these - public const byte PARCEL_FLAG_PROPERTY_BORDER_WEST = (byte)64; //Equals 01000000 - public const byte PARCEL_FLAG_PROPERTY_BORDER_SOUTH = (byte)128; //Equals 10000000 - - //RequestResults (I think these are right, they seem to work): - public const int PARCEL_RESULT_ONE_PARCEL = 0; // The request they made contained only one parcel - public const int PARCEL_RESULT_MULTIPLE_PARCELS = 1; // The request they made contained more than one parcel - - //These are other constants. Yay! - public const int START_PARCEL_LOCAL_ID = 1; - #endregion - - #region Member Variables - public Dictionary parcelList = new Dictionary(); - private int lastParcelLocalID = START_PARCEL_LOCAL_ID - 1; - private int[,] parcelIDList = new int[64, 64]; - - private static World m_world; - #endregion - - #region Constructors - public ParcelManager(World world) - { - - m_world = world; - parcelIDList.Initialize(); - - } - #endregion - - #region Member Functions - - #region Parcel From Storage Functions - public void ParcelFromStorage(ParcelData data) - { - Parcel new_parcel = new Parcel(data.ownerID, data.isGroupOwned, m_world); - new_parcel.parcelData = data.Copy(); - new_parcel.setParcelBitmapFromByteArray(); - addParcel(new_parcel); - - } - - public void NoParcelDataFromStorage() - { - resetSimParcels(); - } - #endregion - - #region Parcel Add/Remove/Get/Create - /// - /// Creates a basic Parcel object without an owner (a zeroed key) - /// - /// - public Parcel createBaseParcel() - { - return new Parcel(new LLUUID(), false, m_world); - } - - /// - /// Adds a parcel to the stored list and adds them to the parcelIDList to what they own - /// - /// The parcel being added - public void addParcel(Parcel new_parcel) - { - lastParcelLocalID++; - new_parcel.parcelData.localID = lastParcelLocalID; - parcelList.Add(lastParcelLocalID, new_parcel.Copy()); - - - bool[,] parcelBitmap = new_parcel.getParcelBitmap(); - int x, y; - for (x = 0; x < 64; x++) - { - for (y = 0; y < 64; y++) - { - if (parcelBitmap[x, y]) - { - parcelIDList[x, y] = lastParcelLocalID; - } - } - } - parcelList[lastParcelLocalID].forceUpdateParcelInfo(); - - - } - /// - /// Removes a parcel from the list. Will not remove if local_id is still owning an area in parcelIDList - /// - /// Parcel.localID of the parcel to remove. - public void removeParcel(int local_id) - { - int x, y; - for (x = 0; x < 64; x++) - { - for (y = 0; y < 64; y++) - { - if (parcelIDList[x, y] == local_id) - { - throw new Exception("Could not remove parcel. Still being used at " + x + ", " + y); - } - } - } - m_world.localStorage.RemoveParcel(parcelList[local_id].parcelData); - parcelList.Remove(local_id); - } - - public void performFinalParcelJoin(Parcel master, Parcel slave) - { - int x, y; - bool[,] parcelBitmapSlave = slave.getParcelBitmap(); - for (x = 0; x < 64; x++) - { - for (y = 0; y < 64; y++) - { - if (parcelBitmapSlave[x, y]) - { - parcelIDList[x, y] = master.parcelData.localID; - } - } - } - removeParcel(slave.parcelData.localID); - } - /// - /// Get the parcel at the specified point - /// - /// Value between 0 - 256 on the x axis of the point - /// Value between 0 - 256 on the y axis of the point - /// Parcel at the point supplied - public Parcel getParcel(int x, int y) - { - if (x > 256 || y > 256 || x < 0 || y < 0) - { - throw new Exception("Error: Parcel not found at point " + x + ", " + y); - } - else - { - return parcelList[parcelIDList[x / 4, y / 4]]; - } - - } - #endregion - - #region Parcel Modification - /// - /// Subdivides a parcel - /// - /// West Point - /// South Point - /// East Point - /// North Point - /// LLUUID of user who is trying to subdivide - /// Returns true if successful - public bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) - { - //First, lets loop through the points and make sure they are all in the same parcel - //Get the parcel at start - Parcel startParcel = getParcel(start_x, start_y); - if (startParcel == null) return false; //No such parcel at the beginning - - //Loop through the points - try - { - int totalX = end_x - start_x; - int totalY = end_y - start_y; - int x, y; - for (y = 0; y < totalY; y++) - { - for (x = 0; x < totalX; x++) - { - Parcel tempParcel = getParcel(start_x + x, start_y + y); - if (tempParcel == null) return false; //No such parcel at that point - if (tempParcel != startParcel) return false; //Subdividing over 2 parcels; no-no - } - } - } - catch - { - return false; //Exception. For now, lets skip subdivision - } - - //If we are still here, then they are subdividing within one parcel - //Check owner - if (startParcel.parcelData.ownerID != attempting_user_id) - { - return false; //They cant do this! - } - - //Lets create a new parcel with bitmap activated at that point (keeping the old parcels info) - Parcel newParcel = startParcel.Copy(); - newParcel.parcelData.parcelName = "Subdivision of " + newParcel.parcelData.parcelName; - newParcel.parcelData.globalID = LLUUID.Random(); - - newParcel.setParcelBitmap(Parcel.getSquareParcelBitmap(start_x, start_y, end_x, end_y)); - - //Now, lets set the subdivision area of the original to false - int startParcelIndex = startParcel.parcelData.localID; - parcelList[startParcelIndex].setParcelBitmap(Parcel.modifyParcelBitmapSquare(startParcel.getParcelBitmap(), start_x, start_y, end_x, end_y, false)); - parcelList[startParcelIndex].forceUpdateParcelInfo(); - - - //Now add the new parcel - addParcel(newParcel); - - - - - - return true; - } - /// - /// Join 2 parcels together - /// - /// x value in first parcel - /// y value in first parcel - /// x value in second parcel - /// y value in second parcel - /// LLUUID of the avatar trying to join the parcels - /// Returns true if successful - public bool join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) - { - end_x -= 4; - end_y -= 4; - - //NOTE: The following only connects the parcels in each corner and not all the parcels that are within the selection box! - //This should be fixed later -- somewhat "incomplete code" --Ming - Parcel startParcel, endParcel; - - try - { - startParcel = getParcel(start_x, start_y); - endParcel = getParcel(end_x, end_y); - } - catch - { - return false; //Error occured when trying to get the start and end parcels - } - if (startParcel == endParcel) - { - return false; //Subdivision of the same parcel is not allowed - } - - //Check the parcel owners: - if (startParcel.parcelData.ownerID != endParcel.parcelData.ownerID) - { - return false; - } - if (startParcel.parcelData.ownerID != attempting_user_id) - { - //TODO: Group editing stuff. Avatar owner support for now - return false; - } - - //Same owners! Lets join them - //Merge them to startParcel - parcelList[startParcel.parcelData.localID].setParcelBitmap(Parcel.mergeParcelBitmaps(startParcel.getParcelBitmap(), endParcel.getParcelBitmap())); - performFinalParcelJoin(startParcel, endParcel); - - return true; - - - - } - #endregion - - #region Parcel Updating - /// - /// Where we send the ParcelOverlay packet to the client - /// - /// The object representing the client - public void sendParcelOverlay(ClientView remote_client) - { - const int PARCEL_BLOCKS_PER_PACKET = 1024; - int x, y = 0; - byte[] byteArray = new byte[PARCEL_BLOCKS_PER_PACKET]; - int byteArrayCount = 0; - int sequenceID = 0; - ParcelOverlayPacket packet; - - for (y = 0; y < 64; y++) - { - for (x = 0; x < 64; x++) - { - byte tempByte = (byte)0; //This represents the byte for the current 4x4 - Parcel currentParcelBlock = getParcel(x * 4, y * 4); - - if (currentParcelBlock.parcelData.ownerID == remote_client.AgentID) - { - //Owner Flag - tempByte = Convert.ToByte(tempByte | PARCEL_TYPE_OWNED_BY_REQUESTER); - } - else if (currentParcelBlock.parcelData.salePrice > 0 && (currentParcelBlock.parcelData.authBuyerID == LLUUID.Zero || currentParcelBlock.parcelData.authBuyerID == remote_client.AgentID)) - { - //Sale Flag - tempByte = Convert.ToByte(tempByte | PARCEL_TYPE_IS_FOR_SALE); - } - else if (currentParcelBlock.parcelData.ownerID == LLUUID.Zero) - { - //Public Flag - tempByte = Convert.ToByte(tempByte | PARCEL_TYPE_PUBLIC); - } - else - { - //Other Flag - tempByte = Convert.ToByte(tempByte | PARCEL_TYPE_OWNED_BY_OTHER); - } - - - //Now for border control - if (x == 0) - { - tempByte = Convert.ToByte(tempByte | PARCEL_FLAG_PROPERTY_BORDER_WEST); - } - else if (getParcel((x - 1) * 4, y * 4) != currentParcelBlock) - { - tempByte = Convert.ToByte(tempByte | PARCEL_FLAG_PROPERTY_BORDER_WEST); - } - - if (y == 0) - { - tempByte = Convert.ToByte(tempByte | PARCEL_FLAG_PROPERTY_BORDER_SOUTH); - } - else if (getParcel(x * 4, (y - 1) * 4) != currentParcelBlock) - { - tempByte = Convert.ToByte(tempByte | PARCEL_FLAG_PROPERTY_BORDER_SOUTH); - } - - byteArray[byteArrayCount] = tempByte; - byteArrayCount++; - if (byteArrayCount >= PARCEL_BLOCKS_PER_PACKET) - { - byteArrayCount = 0; - packet = new ParcelOverlayPacket(); - packet.ParcelData.Data = byteArray; - packet.ParcelData.SequenceID = sequenceID; - //remote_client.OutPacket((Packet)packet); - sequenceID++; - byteArray = new byte[PARCEL_BLOCKS_PER_PACKET]; - } - } - } - - packet = new ParcelOverlayPacket(); - packet.ParcelData.Data = byteArray; - packet.ParcelData.SequenceID = sequenceID; //Eh? - //remote_client.OutPacket((Packet)packet); - } - #endregion - - /// - /// Resets the sim to the default parcel (full sim parcel owned by the default user) - /// - public void resetSimParcels() - { - //Remove all the parcels in the sim and add a blank, full sim parcel set to public - parcelList.Clear(); - lastParcelLocalID = START_PARCEL_LOCAL_ID - 1; - parcelIDList.Initialize(); - - Parcel fullSimParcel = new Parcel(LLUUID.Zero, false, m_world); - - fullSimParcel.setParcelBitmap(Parcel.getSquareParcelBitmap(0, 0, 256, 256)); - fullSimParcel.parcelData.parcelName = "Your Sim Parcel"; - fullSimParcel.parcelData.parcelDesc = ""; - - fullSimParcel.parcelData.ownerID = m_world.m_regInfo.MasterAvatarAssignedUUID; - fullSimParcel.parcelData.salePrice = 1; - fullSimParcel.parcelData.parcelFlags = libsecondlife.Parcel.ParcelFlags.ForSale; - fullSimParcel.parcelData.parcelStatus = libsecondlife.Parcel.ParcelStatus.Leased; - - addParcel(fullSimParcel); - - } - #endregion - } - #endregion - - - #region Parcel Class - /// - /// Keeps track of a specific parcel's information - /// - public class Parcel - { - #region Member Variables - public ParcelData parcelData = new ParcelData(); - public World m_world; - - private bool[,] parcelBitmap = new bool[64, 64]; - - #endregion - - - #region Constructors - public Parcel(LLUUID owner_id, bool is_group_owned, World world) - { - m_world = world; - parcelData.ownerID = owner_id; - parcelData.isGroupOwned = is_group_owned; - - } - #endregion - - - #region Member Functions - - #region General Functions - /// - /// Checks to see if this parcel contains a point - /// - /// - /// - /// Returns true if the parcel contains the specified point - public bool containsPoint(int x, int y) - { - if (x >= 0 && y >= 0 && x <= 256 && x <= 256) - { - return (parcelBitmap[x / 4, y / 4] == true); - } - else - { - return false; - } - } - - public Parcel Copy() - { - Parcel newParcel = new Parcel(this.parcelData.ownerID, this.parcelData.isGroupOwned, m_world); - - //Place all new variables here! - newParcel.parcelBitmap = (bool[,])(this.parcelBitmap.Clone()); - newParcel.parcelData = parcelData.Copy(); - - return newParcel; - } - - #endregion - - - #region Packet Request Handling - /// - /// Sends parcel properties as requested - /// - /// ID sent by client for them to keep track of - /// Bool sent by client for them to use - /// Object representing the client - public void sendParcelProperties(int sequence_id, bool snap_selection, int request_result, ClientView remote_client) - { - - /*ParcelPropertiesPacket updatePacket = new ParcelPropertiesPacket(); - updatePacket.ParcelData.AABBMax = parcelData.AABBMax; - updatePacket.ParcelData.AABBMin = parcelData.AABBMin; - updatePacket.ParcelData.Area = parcelData.area; - updatePacket.ParcelData.AuctionID = parcelData.auctionID; - updatePacket.ParcelData.AuthBuyerID =parcelData.authBuyerID; //unemplemented - - updatePacket.ParcelData.Bitmap = parcelData.parcelBitmapByteArray; - - updatePacket.ParcelData.Desc = libsecondlife.Helpers.StringToField(parcelData.parcelDesc); - updatePacket.ParcelData.Category = (byte)parcelData.category; - updatePacket.ParcelData.ClaimDate = parcelData.claimDate; - updatePacket.ParcelData.ClaimPrice = parcelData.claimPrice; - updatePacket.ParcelData.GroupID = parcelData.groupID; - updatePacket.ParcelData.GroupPrims = parcelData.groupPrims; - updatePacket.ParcelData.IsGroupOwned = parcelData.isGroupOwned; - updatePacket.ParcelData.LandingType = (byte)parcelData.landingType; - updatePacket.ParcelData.LocalID = parcelData.localID; - updatePacket.ParcelData.MaxPrims = 1000; //unemplemented - updatePacket.ParcelData.MediaAutoScale = parcelData.mediaAutoScale; - updatePacket.ParcelData.MediaID = parcelData.mediaID; - updatePacket.ParcelData.MediaURL = Helpers.StringToField(parcelData.mediaURL); - updatePacket.ParcelData.MusicURL = Helpers.StringToField(parcelData.musicURL); - updatePacket.ParcelData.Name = Helpers.StringToField(parcelData.parcelName); - updatePacket.ParcelData.OtherCleanTime = 0; //unemplemented - updatePacket.ParcelData.OtherCount = 0; //unemplemented - updatePacket.ParcelData.OtherPrims = 0; //unemplented - updatePacket.ParcelData.OwnerID = parcelData.ownerID; - updatePacket.ParcelData.OwnerPrims = 0; //unemplemented - updatePacket.ParcelData.ParcelFlags = (uint)parcelData.parcelFlags; //unemplemented - updatePacket.ParcelData.ParcelPrimBonus = (float)1.0; //unemplemented - updatePacket.ParcelData.PassHours = parcelData.passHours; - updatePacket.ParcelData.PassPrice = parcelData.passPrice; - updatePacket.ParcelData.PublicCount = 0; //unemplemented - updatePacket.ParcelData.RegionDenyAnonymous = false; //unemplemented - updatePacket.ParcelData.RegionDenyIdentified = false; //unemplemented - updatePacket.ParcelData.RegionDenyTransacted = false; //unemplemented - updatePacket.ParcelData.RegionPushOverride = true; //unemplemented - updatePacket.ParcelData.RentPrice = 0; //?? - updatePacket.ParcelData.RequestResult = request_result; - updatePacket.ParcelData.SalePrice = parcelData.salePrice; //unemplemented - updatePacket.ParcelData.SelectedPrims = 0; //unemeplemented - updatePacket.ParcelData.SelfCount = 0;//unemplemented - updatePacket.ParcelData.SequenceID = sequence_id; - updatePacket.ParcelData.SimWideMaxPrims = 15000; //unemplemented - updatePacket.ParcelData.SimWideTotalPrims = 0; //unemplemented - updatePacket.ParcelData.SnapSelection = snap_selection; - updatePacket.ParcelData.SnapshotID = parcelData.snapshotID; - updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus; - updatePacket.ParcelData.TotalPrims = 0; //unemplemented - updatePacket.ParcelData.UserLocation = parcelData.userLocation; - updatePacket.ParcelData.UserLookAt = parcelData.userLookAt; - remote_client.OutPacket((Packet)updatePacket); */ - } - - public void updateParcelProperties(ParcelPropertiesUpdatePacket packet, ClientView remote_client) - { - if (remote_client.AgentID == parcelData.ownerID) - { - //Needs later group support - parcelData.authBuyerID = packet.ParcelData.AuthBuyerID; - parcelData.category = (libsecondlife.Parcel.ParcelCategory)packet.ParcelData.Category; - parcelData.parcelDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc); - parcelData.groupID = packet.ParcelData.GroupID; - parcelData.landingType = packet.ParcelData.LandingType; - parcelData.mediaAutoScale = packet.ParcelData.MediaAutoScale; - parcelData.mediaID = packet.ParcelData.MediaID; - parcelData.mediaURL = Helpers.FieldToUTF8String(packet.ParcelData.MediaURL); - parcelData.musicURL = Helpers.FieldToUTF8String(packet.ParcelData.MusicURL); - parcelData.parcelName = libsecondlife.Helpers.FieldToUTF8String(packet.ParcelData.Name); - parcelData.parcelFlags = (libsecondlife.Parcel.ParcelFlags)packet.ParcelData.ParcelFlags; - parcelData.passHours = packet.ParcelData.PassHours; - parcelData.passPrice = packet.ParcelData.PassPrice; - parcelData.salePrice = packet.ParcelData.SalePrice; - parcelData.snapshotID = packet.ParcelData.SnapshotID; - parcelData.userLocation = packet.ParcelData.UserLocation; - parcelData.userLookAt = packet.ParcelData.UserLookAt; - - foreach (Avatar av in m_world.Avatars.Values) - { - Parcel over = m_world.parcelManager.getParcel((int)Math.Round(av.Pos.X), (int)Math.Round(av.Pos.Y)); - if (over == this) - { - sendParcelProperties(0, false, 0, av.ControllingClient); - } - } - } - } - #endregion - - - #region Update Functions - /// - /// Updates the AABBMin and AABBMax values after area/shape modification of parcel - /// - private void updateAABBAndAreaValues() - { - int min_x = 64; - int min_y = 64; - int max_x = 0; - int max_y = 0; - int tempArea = 0; - int x, y; - for (x = 0; x < 64; x++) - { - for (y = 0; y < 64; y++) - { - if (parcelBitmap[x, y] == true) - { - if (min_x > x) min_x = x; - if (min_y > y) min_y = y; - if (max_x < x) max_x = x; - if (max_y < y) max_y = y; - tempArea += 16; //16sqm parcel - } - } - } - parcelData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), m_world.Terrain[(min_x * 4), (min_y * 4)]); - parcelData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), m_world.Terrain[(max_x * 4), (max_y * 4)]); - parcelData.area = tempArea; - } - - public void updateParcelBitmapByteArray() - { - parcelData.parcelBitmapByteArray = convertParcelBitmapToBytes(); - } - - /// - /// Update all settings in parcel such as area, bitmap byte array, etc - /// - public void forceUpdateParcelInfo() - { - this.updateAABBAndAreaValues(); - this.updateParcelBitmapByteArray(); - } - - public void setParcelBitmapFromByteArray() - { - parcelBitmap = convertBytesToParcelBitmap(); - } - #endregion - - - #region Parcel Bitmap Functions - /// - /// Sets the parcel's bitmap manually - /// - /// 64x64 block representing where this parcel is on a map - public void setParcelBitmap(bool[,] bitmap) - { - if (bitmap.GetLength(0) != 64 || bitmap.GetLength(1) != 64 || bitmap.Rank != 2) - { - //Throw an exception - The bitmap is not 64x64 - throw new Exception("Error: Invalid Parcel Bitmap"); - } - else - { - //Valid: Lets set it - parcelBitmap = bitmap; - forceUpdateParcelInfo(); - - } - } - /// - /// Gets the parcels bitmap manually - /// - /// - public bool[,] getParcelBitmap() - { - return parcelBitmap; - } - /// - /// Converts the parcel bitmap to a packet friendly byte array - /// - /// - private byte[] convertParcelBitmapToBytes() - { - byte[] tempConvertArr = new byte[512]; - byte tempByte = 0; - int x, y, i, byteNum = 0; - i = 0; - for (y = 0; y < 64; y++) - { - for (x = 0; x < 64; x++) - { - tempByte = Convert.ToByte(tempByte | Convert.ToByte(parcelBitmap[x, y]) << (i++ % 8)); - if (i % 8 == 0) - { - tempConvertArr[byteNum] = tempByte; - tempByte = (byte)0; - i = 0; - byteNum++; - } - } - } - return tempConvertArr; - } - - private bool[,] convertBytesToParcelBitmap() - { - bool[,] tempConvertMap = new bool[64, 64]; - tempConvertMap.Initialize(); - byte tempByte = 0; - int x = 0, y = 0, i = 0, bitNum = 0; - for(i = 0; i < 512; i++) - { - tempByte = parcelData.parcelBitmapByteArray[i]; - for(bitNum = 0; bitNum < 8; bitNum++) - { - bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte)1); - tempConvertMap[x, y] = bit; - x++; - if(x > 63) - { - x = 0; - y++; - } - - } - - } - return tempConvertMap; - } - /// - /// Full sim parcel creation - /// - /// - public static bool[,] basicFullRegionParcelBitmap() - { - return getSquareParcelBitmap(0, 0, 256, 256); - } - - /// - /// Used to modify the bitmap between the x and y points. Points use 64 scale - /// - /// - /// - /// - /// - /// - public static bool[,] getSquareParcelBitmap(int start_x, int start_y, int end_x, int end_y) - { - - bool[,] tempBitmap = new bool[64, 64]; - tempBitmap.Initialize(); - - tempBitmap = modifyParcelBitmapSquare(tempBitmap, start_x, start_y, end_x, end_y, true); - return tempBitmap; - } - - /// - /// Change a parcel's bitmap at within a square and set those points to a specific value - /// - /// - /// - /// - /// - /// - /// - /// - public static bool[,] modifyParcelBitmapSquare(bool[,] parcel_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value) - { - if (parcel_bitmap.GetLength(0) != 64 || parcel_bitmap.GetLength(1) != 64 || parcel_bitmap.Rank != 2) - { - //Throw an exception - The bitmap is not 64x64 - throw new Exception("Error: Invalid Parcel Bitmap in modifyParcelBitmapSquare()"); - } - - int x, y; - for (y = 0; y < 64; y++) - { - for (x = 0; x < 64; x++) - { - if (x >= start_x / 4 && x < end_x / 4 - && y >= start_y / 4 && y < end_y / 4) - { - parcel_bitmap[x, y] = set_value; - } - } - } - return parcel_bitmap; - } - /// - /// Join the true values of 2 bitmaps together - /// - /// - /// - /// - public static bool[,] mergeParcelBitmaps(bool[,] bitmap_base, bool[,] bitmap_add) - { - if (bitmap_base.GetLength(0) != 64 || bitmap_base.GetLength(1) != 64 || bitmap_base.Rank != 2) - { - //Throw an exception - The bitmap is not 64x64 - throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_base in mergeParcelBitmaps"); - } - if (bitmap_add.GetLength(0) != 64 || bitmap_add.GetLength(1) != 64 || bitmap_add.Rank != 2) - { - //Throw an exception - The bitmap is not 64x64 - throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_add in mergeParcelBitmaps"); - - } - - int x, y; - for (y = 0; y < 64; y++) - { - for (x = 0; x < 64; x++) - { - if (bitmap_add[x, y]) - { - bitmap_base[x, y] = true; - } - } - } - return bitmap_base; - } - #endregion - - #endregion - - - } - #endregion - - -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Primitive.cs b/OpenSim/OpenSim.RegionServer/Simulator/Primitive.cs deleted file mode 100644 index f1417d0..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/Primitive.cs +++ /dev/null @@ -1,598 +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 OpenSim.RegionServer.Types; -using libsecondlife; -using libsecondlife.Packets; -using OpenSim.Framework.Interfaces; -using OpenSim.Physics.Manager; -using OpenSim.Framework.Types; -using OpenSim.RegionServer.Client; - -namespace OpenSim.RegionServer.Simulator -{ - public class Primitive : Entity - { - protected float mesh_cutbegin; - protected float mesh_cutend; - protected PrimData primData; - protected bool newPrimFlag = false; - protected bool updateFlag = false; - protected bool dirtyFlag = false; - private ObjectUpdatePacket OurPacket; - private bool physicsEnabled = false; - private bool physicstest = false; - private LLVector3 positionLastFrame = new LLVector3(0, 0, 0); - private Dictionary m_clientThreads; - private ulong m_regionHandle; - private const uint FULL_MASK_PERMISSIONS = 2147483647; - - public bool PhysicsEnabled - { - get - { - return physicsEnabled; - } - set - { - physicsEnabled = value; - } - } - public bool UpdateFlag - { - get - { - return updateFlag; - } - set - { - updateFlag = value; - } - } - public LLVector3 Scale - { - set - { - LLVector3 offset = (value - primData.Scale); - offset.X /= 2; - offset.Y /= 2; - offset.Z /= 2; - - this.primData.Position += offset; - this.primData.Scale = value; - - this.dirtyFlag = true; - } - get - { - return this.primData.Scale; - } - } - public PhysicsActor PhysActor - { - set - { - this._physActor = value; - } - } - - public Primitive(Dictionary clientThreads, ulong regionHandle, World world) - { - mesh_cutbegin = 0.0f; - mesh_cutend = 1.0f; - - m_clientThreads = clientThreads; - m_regionHandle = regionHandle; - m_world = world; - } - - public override Mesh getMesh() - { - Mesh mesh = new Mesh(); - Triangle tri = new Triangle( - new Axiom.MathLib.Vector3(0.0f, 1.0f, 1.0f), - new Axiom.MathLib.Vector3(1.0f, 0.0f, 1.0f), - new Axiom.MathLib.Vector3(1.0f, 1.0f, 0.0f)); - - mesh.AddTri(tri); - mesh += base.getMesh(); - - return mesh; - } - - public byte[] GetByteArray() - { - return this.primData.ToBytes(); - } - - public void GetProperites(ClientView client) - { - ObjectPropertiesPacket proper = new ObjectPropertiesPacket(); - proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; - proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); - proper.ObjectData[0].ItemID = LLUUID.Zero; // this.uuid; - proper.ObjectData[0].CreationDate = (ulong) this.primData.CreationDate; - proper.ObjectData[0].CreatorID = this.primData.OwnerID; - proper.ObjectData[0].FolderID = LLUUID.Zero; - proper.ObjectData[0].FromTaskID = LLUUID.Zero; - proper.ObjectData[0].GroupID = LLUUID.Zero; - proper.ObjectData[0].InventorySerial = 0; - proper.ObjectData[0].LastOwnerID = LLUUID.Zero; - proper.ObjectData[0].ObjectID = this.uuid; - proper.ObjectData[0].OwnerID = primData.OwnerID; - proper.ObjectData[0].TouchName = new byte[0]; - proper.ObjectData[0].TextureID = new byte[0]; - proper.ObjectData[0].SitName = new byte[0]; - proper.ObjectData[0].Name = new byte[0]; - proper.ObjectData[0].Description = new byte[0]; - proper.ObjectData[0].OwnerMask = this.primData.OwnerMask; - proper.ObjectData[0].NextOwnerMask = this.primData.NextOwnerMask; - proper.ObjectData[0].GroupMask = this.primData.GroupMask; - proper.ObjectData[0].EveryoneMask = this.primData.EveryoneMask; - proper.ObjectData[0].BaseMask = this.primData.BaseMask; - - client.OutPacket(proper); - } - - public void UpdatePosition(LLVector3 pos) - { - this.Pos = pos; - if (this._physActor != null) // && this.physicsEnabled) - { - try - { - lock (m_world.LockPhysicsEngine) - { - this._physActor.Position = new PhysicsVector(pos.X, pos.Y, pos.Z); - } - } - catch (Exception e) - { - Console.WriteLine(e.Message); - } - } - this.updateFlag = true; - } - - public override void update() - { - LLVector3 pos2 = new LLVector3(0, 0, 0); - if (this._physActor != null && this.physicsEnabled) - { - - PhysicsVector pPos = this._physActor.Position; - pos2 = new LLVector3(pPos.X, pPos.Y, pPos.Z); - } - if (this.newPrimFlag) - { - foreach (ClientView client in m_clientThreads.Values) - { - client.OutPacket(OurPacket); - } - this.newPrimFlag = false; - } - else if (this.updateFlag) - { - ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); - terse.RegionData.RegionHandle = m_regionHandle; // FIXME - terse.RegionData.TimeDilation = 64096; - terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; - terse.ObjectData[0] = this.CreateImprovedBlock(); - foreach (ClientView client in m_clientThreads.Values) - { - client.OutPacket(terse); - } - this.updateFlag = false; - } - else if (this.dirtyFlag) - { - foreach (ClientView client in m_clientThreads.Values) - { - UpdateClient(client); - } - this.dirtyFlag = false; - } - else - { - if (this._physActor != null && this.physicsEnabled) - { - if (pos2 != this.positionLastFrame) - { - ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); - terse.RegionData.RegionHandle = m_regionHandle; // FIXME - terse.RegionData.TimeDilation = 64096; - terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; - terse.ObjectData[0] = this.CreateImprovedBlock(); - foreach (ClientView client in m_clientThreads.Values) - { - client.OutPacket(terse); - } - } - this.positionLastFrame = pos2; - } - } - - if (this.physicstest) - { - LLVector3 pos = this.Pos; - pos.Z += 0.0001f; - this.UpdatePosition(pos); - this.physicstest = false; - } - } - - public void UpdateClient(ClientView RemoteClient) - { - - LLVector3 lPos; - if (this._physActor != null && this.physicsEnabled) - { - PhysicsVector pPos = this._physActor.Position; - lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z); - } - else - { - lPos = this.Pos; - } - byte[] pb = lPos.GetBytes(); - Array.Copy(pb, 0, OurPacket.ObjectData[0].ObjectData, 0, pb.Length); - - // OurPacket should be update with the follwing in updateShape() rather than having to do it here - OurPacket.ObjectData[0].OwnerID = this.primData.OwnerID; - OurPacket.ObjectData[0].PCode = this.primData.PCode; - OurPacket.ObjectData[0].PathBegin = this.primData.PathBegin; - OurPacket.ObjectData[0].PathEnd = this.primData.PathEnd; - OurPacket.ObjectData[0].PathScaleX = this.primData.PathScaleX; - OurPacket.ObjectData[0].PathScaleY = this.primData.PathScaleY; - OurPacket.ObjectData[0].PathShearX = this.primData.PathShearX; - OurPacket.ObjectData[0].PathShearY = this.primData.PathShearY; - OurPacket.ObjectData[0].PathSkew = this.primData.PathSkew; - OurPacket.ObjectData[0].ProfileBegin = this.primData.ProfileBegin; - OurPacket.ObjectData[0].ProfileEnd = this.primData.ProfileEnd; - OurPacket.ObjectData[0].Scale = this.primData.Scale; - OurPacket.ObjectData[0].PathCurve = this.primData.PathCurve; - OurPacket.ObjectData[0].ProfileCurve = this.primData.ProfileCurve; - OurPacket.ObjectData[0].ParentID = this.primData.ParentID ; - OurPacket.ObjectData[0].ProfileHollow = this.primData.ProfileHollow; - //finish off copying rest of shape data - OurPacket.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset; - OurPacket.ObjectData[0].PathRevolutions = this.primData.PathRevolutions; - OurPacket.ObjectData[0].PathTaperX = this.primData.PathTaperX; - OurPacket.ObjectData[0].PathTaperY = this.primData.PathTaperY; - OurPacket.ObjectData[0].PathTwist = this.primData.PathTwist; - OurPacket.ObjectData[0].PathTwistBegin = this.primData.PathTwistBegin; - - RemoteClient.OutPacket(OurPacket); - } - - public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket) - { - this.primData.PathBegin = addPacket.PathBegin; - this.primData.PathEnd = addPacket.PathEnd; - this.primData.PathScaleX = addPacket.PathScaleX; - this.primData.PathScaleY = addPacket.PathScaleY; - this.primData.PathShearX = addPacket.PathShearX; - this.primData.PathShearY = addPacket.PathShearY; - this.primData.PathSkew = addPacket.PathSkew; - this.primData.ProfileBegin = addPacket.ProfileBegin; - this.primData.ProfileEnd = addPacket.ProfileEnd; - this.primData.PathCurve = addPacket.PathCurve; - this.primData.ProfileCurve = addPacket.ProfileCurve; - this.primData.ProfileHollow = addPacket.ProfileHollow; - this.primData.PathRadiusOffset = addPacket.PathRadiusOffset; - this.primData.PathRevolutions = addPacket.PathRevolutions; - this.primData.PathTaperX = addPacket.PathTaperX; - this.primData.PathTaperY = addPacket.PathTaperY; - this.primData.PathTwist = addPacket.PathTwist; - this.primData.PathTwistBegin = addPacket.PathTwistBegin; - this.dirtyFlag = true; - } - - public void UpdateTexture(byte[] tex) - { - this.OurPacket.ObjectData[0].TextureEntry = tex; - this.primData.Texture = tex; - this.dirtyFlag = true; - } - - public void UpdateObjectFlags(ObjectFlagUpdatePacket pack) - { - if (this._physActor != null) - { - if (this._physActor.Kinematic == pack.AgentData.UsePhysics) - { - this._physActor.Kinematic = !pack.AgentData.UsePhysics; //if Usephysics = true, then Kinematic should = false - } - this.physicsEnabled = pack.AgentData.UsePhysics; - if (this._physActor.Kinematic == false) - { - LLVector3 pos = this.Pos; - this.UpdatePosition(pos); - pos.Z += 0.000001f; - this.UpdatePosition(pos); - this.physicstest = true; - } - else - { - PhysicsVector vec = this._physActor.Position; - LLVector3 pos = new LLVector3(vec.X, vec.Y, vec.Z); - this.Pos = pos; - this.updateFlag = true; - } - } - } - - public void MakeParent(Primitive prim) - { - this.primData.ParentID = prim.localid; - this.Pos -= prim.Pos; - this.dirtyFlag = true; - } - - public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID ownerID, uint localID) - { - ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); - objupdate.RegionData.RegionHandle = m_regionHandle; - objupdate.RegionData.TimeDilation = 64096; - - objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; - PrimData PData = new PrimData(); - this.primData = PData; - this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; - - objupdate.ObjectData[0] = new ObjectUpdatePacket.ObjectDataBlock(); - objupdate.ObjectData[0].PSBlock = new byte[0]; - objupdate.ObjectData[0].ExtraParams = new byte[1]; - objupdate.ObjectData[0].MediaURL = new byte[0]; - objupdate.ObjectData[0].NameValue = new byte[0]; - objupdate.ObjectData[0].Text = new byte[0]; - objupdate.ObjectData[0].TextColor = new byte[4]; - objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0, 0, 0); - objupdate.ObjectData[0].JointPivot = new LLVector3(0, 0, 0); - objupdate.ObjectData[0].Material = 3; - objupdate.ObjectData[0].UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; - objupdate.ObjectData[0].TextureAnim = new byte[0]; - objupdate.ObjectData[0].Sound = LLUUID.Zero; - LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); - this.primData.Texture = objupdate.ObjectData[0].TextureEntry = ntex.ToBytes(); - objupdate.ObjectData[0].State = 0; - objupdate.ObjectData[0].Data = new byte[0]; - PData.OwnerID = objupdate.ObjectData[0].OwnerID = ownerID; - PData.PCode = objupdate.ObjectData[0].PCode = addPacket.ObjectData.PCode; - PData.PathBegin = objupdate.ObjectData[0].PathBegin = addPacket.ObjectData.PathBegin; - PData.PathEnd = objupdate.ObjectData[0].PathEnd = addPacket.ObjectData.PathEnd; - PData.PathScaleX = objupdate.ObjectData[0].PathScaleX = addPacket.ObjectData.PathScaleX; - PData.PathScaleY = objupdate.ObjectData[0].PathScaleY = addPacket.ObjectData.PathScaleY; - PData.PathShearX = objupdate.ObjectData[0].PathShearX = addPacket.ObjectData.PathShearX; - PData.PathShearY = objupdate.ObjectData[0].PathShearY = addPacket.ObjectData.PathShearY; - PData.PathSkew = objupdate.ObjectData[0].PathSkew = addPacket.ObjectData.PathSkew; - PData.ProfileBegin = objupdate.ObjectData[0].ProfileBegin = addPacket.ObjectData.ProfileBegin; - PData.ProfileEnd = objupdate.ObjectData[0].ProfileEnd = addPacket.ObjectData.ProfileEnd; - PData.Scale = objupdate.ObjectData[0].Scale = addPacket.ObjectData.Scale; - PData.PathCurve = objupdate.ObjectData[0].PathCurve = addPacket.ObjectData.PathCurve; - PData.ProfileCurve = objupdate.ObjectData[0].ProfileCurve = addPacket.ObjectData.ProfileCurve; - PData.ParentID = objupdate.ObjectData[0].ParentID = 0; - PData.ProfileHollow = objupdate.ObjectData[0].ProfileHollow = addPacket.ObjectData.ProfileHollow; - PData.PathRadiusOffset = objupdate.ObjectData[0].PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset; - PData.PathRevolutions = objupdate.ObjectData[0].PathRevolutions = addPacket.ObjectData.PathRevolutions; - PData.PathTaperX = objupdate.ObjectData[0].PathTaperX = addPacket.ObjectData.PathTaperX; - PData.PathTaperY = objupdate.ObjectData[0].PathTaperY = addPacket.ObjectData.PathTaperY; - PData.PathTwist = objupdate.ObjectData[0].PathTwist = addPacket.ObjectData.PathTwist; - PData.PathTwistBegin = objupdate.ObjectData[0].PathTwistBegin = addPacket.ObjectData.PathTwistBegin; - - objupdate.ObjectData[0].ID = (uint)(localID); - objupdate.ObjectData[0].FullID = new LLUUID("edba7151-5857-acc5-b30b-f01efef" + (localID - 702000).ToString("00000")); - objupdate.ObjectData[0].ObjectData = new byte[60]; - objupdate.ObjectData[0].ObjectData[46] = 128; - objupdate.ObjectData[0].ObjectData[47] = 63; - LLVector3 pos1 = addPacket.ObjectData.RayEnd; - //update position - byte[] pb = pos1.GetBytes(); - Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 0, pb.Length); - this.newPrimFlag = true; - this.primData.FullID = this.uuid = objupdate.ObjectData[0].FullID; - this.localid = objupdate.ObjectData[0].ID; - this.primData.Position = this.Pos = pos1; - this.OurPacket = objupdate; - } - - public void CreateFromStorage(PrimData store) - { - this.CreateFromStorage(store, store.Position, store.LocalID, false); - } - - public void CreateFromStorage(PrimData store, LLVector3 posi, uint localID, bool newprim) - { - //need to clean this up as it shares a lot of code with CreateFromPacket() - ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); - objupdate.RegionData.RegionHandle = m_regionHandle; - objupdate.RegionData.TimeDilation = 64096; - objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; - - this.primData = store; - objupdate.ObjectData[0] = new ObjectUpdatePacket.ObjectDataBlock(); - objupdate.ObjectData[0].PSBlock = new byte[0]; - objupdate.ObjectData[0].ExtraParams = new byte[1]; - objupdate.ObjectData[0].MediaURL = new byte[0]; - objupdate.ObjectData[0].NameValue = new byte[0]; - objupdate.ObjectData[0].Text = new byte[0]; - objupdate.ObjectData[0].TextColor = new byte[4]; - objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0, 0, 0); - objupdate.ObjectData[0].JointPivot = new LLVector3(0, 0, 0); - objupdate.ObjectData[0].Material = 3; - objupdate.ObjectData[0].UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; - objupdate.ObjectData[0].TextureAnim = new byte[0]; - objupdate.ObjectData[0].Sound = LLUUID.Zero; - - if (store.Texture == null) - { - LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); - objupdate.ObjectData[0].TextureEntry = ntex.ToBytes(); - } - else - { - objupdate.ObjectData[0].TextureEntry = store.Texture; - } - - objupdate.ObjectData[0].State = 0; - objupdate.ObjectData[0].Data = new byte[0]; - objupdate.ObjectData[0].OwnerID = this.primData.OwnerID; - objupdate.ObjectData[0].PCode = this.primData.PCode; - objupdate.ObjectData[0].PathBegin = this.primData.PathBegin; - objupdate.ObjectData[0].PathEnd = this.primData.PathEnd; - objupdate.ObjectData[0].PathScaleX = this.primData.PathScaleX; - objupdate.ObjectData[0].PathScaleY = this.primData.PathScaleY; - objupdate.ObjectData[0].PathShearX = this.primData.PathShearX; - objupdate.ObjectData[0].PathShearY = this.primData.PathShearY; - objupdate.ObjectData[0].PathSkew = this.primData.PathSkew; - objupdate.ObjectData[0].ProfileBegin = this.primData.ProfileBegin; - objupdate.ObjectData[0].ProfileEnd = this.primData.ProfileEnd; - objupdate.ObjectData[0].Scale = this.primData.Scale; - objupdate.ObjectData[0].PathCurve = this.primData.PathCurve; - objupdate.ObjectData[0].ProfileCurve = this.primData.ProfileCurve; - objupdate.ObjectData[0].ParentID = 0; - objupdate.ObjectData[0].ProfileHollow = this.primData.ProfileHollow; - //finish off copying rest of shape data - objupdate.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset; - objupdate.ObjectData[0].PathRevolutions = this.primData.PathRevolutions; - objupdate.ObjectData[0].PathTaperX = this.primData.PathTaperX; - objupdate.ObjectData[0].PathTaperY = this.primData.PathTaperY; - objupdate.ObjectData[0].PathTwist = this.primData.PathTwist; - objupdate.ObjectData[0].PathTwistBegin = this.primData.PathTwistBegin; - - objupdate.ObjectData[0].ID = localID; // (uint)store.LocalID; - objupdate.ObjectData[0].FullID = store.FullID; - - objupdate.ObjectData[0].ObjectData = new byte[60]; - objupdate.ObjectData[0].ObjectData[46] = 128; - objupdate.ObjectData[0].ObjectData[47] = 63; - LLVector3 pos1 = posi; // store.Position; - //update position - byte[] pb = pos1.GetBytes(); - Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 0, pb.Length); - - this.uuid = objupdate.ObjectData[0].FullID; - this.localid = objupdate.ObjectData[0].ID; - this.Pos = pos1; - this.OurPacket = objupdate; - if (newprim) - { - this.newPrimFlag = true; - } - } - - public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateImprovedBlock() - { - uint ID = this.localid; - byte[] bytes = new byte[60]; - - int i = 0; - ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); - //dat.TextureEntry = this.OurPacket.ObjectData[0].TextureEntry; - dat.TextureEntry = new byte[0]; - bytes[i++] = (byte)(ID % 256); - bytes[i++] = (byte)((ID >> 8) % 256); - bytes[i++] = (byte)((ID >> 16) % 256); - bytes[i++] = (byte)((ID >> 24) % 256); - bytes[i++] = 0; - bytes[i++] = 0; - - LLVector3 lPos; - Axiom.MathLib.Quaternion lRot; - if (this._physActor != null && this.physicsEnabled) - { - PhysicsVector pPos = this._physActor.Position; - lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z); - lRot = this._physActor.Orientation; - } - else - { - lPos = this.Pos; - lRot = this.rotation; - } - byte[] pb = lPos.GetBytes(); - Array.Copy(pb, 0, bytes, i, pb.Length); - i += 12; - ushort ac = 32767; - - //vel - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - //accel - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - ushort rw, rx, ry, rz; - rw = (ushort)(32768 * (lRot.w + 1)); - rx = (ushort)(32768 * (lRot.x + 1)); - ry = (ushort)(32768 * (lRot.y + 1)); - rz = (ushort)(32768 * (lRot.z + 1)); - - //rot - bytes[i++] = (byte)(rx % 256); - bytes[i++] = (byte)((rx >> 8) % 256); - bytes[i++] = (byte)(ry % 256); - bytes[i++] = (byte)((ry >> 8) % 256); - bytes[i++] = (byte)(rz % 256); - bytes[i++] = (byte)((rz >> 8) % 256); - bytes[i++] = (byte)(rw % 256); - bytes[i++] = (byte)((rw >> 8) % 256); - - //rotation vel - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - dat.Data = bytes; - return dat; - } - - public override void BackUp() - { - this.primData.FullID = this.uuid; - this.primData.LocalID = this.localid; - this.primData.Position = this.Pos; - this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w); - this.m_world.localStorage.StorePrim(this.primData); - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Primitive2.cs b/OpenSim/OpenSim.RegionServer/Simulator/Primitive2.cs deleted file mode 100644 index 0286e54..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/Primitive2.cs +++ /dev/null @@ -1,519 +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 OpenSim.RegionServer.Types; -using libsecondlife; -using libsecondlife.Packets; -using OpenSim.Framework.Interfaces; -using OpenSim.Physics.Manager; -using OpenSim.Framework.Types; -using OpenSim.Framework.Inventory; -using OpenSim.RegionServer.Client; - -namespace OpenSim.RegionServer.Simulator -{ - public class Primitive2 : Entity - { - protected PrimData primData; - //private ObjectUpdatePacket OurPacket; - private LLVector3 positionLastFrame = new LLVector3(0, 0, 0); - private Dictionary m_clientThreads; - private ulong m_regionHandle; - private const uint FULL_MASK_PERMISSIONS = 2147483647; - private bool physicsEnabled = false; - - private Dictionary inventoryItems; - - #region Properties - - public LLVector3 Scale - { - set - { - this.primData.Scale = value; - //this.dirtyFlag = true; - } - get - { - return this.primData.Scale; - } - } - - public PhysicsActor PhysActor - { - set - { - this._physActor = value; - } - } - public override LLVector3 Pos - { - get - { - return base.Pos; - } - set - { - base.Pos = value; - } - } - #endregion - - public Primitive2(Dictionary clientThreads, ulong regionHandle, World world) - { - m_clientThreads = clientThreads; - m_regionHandle = regionHandle; - m_world = world; - inventoryItems = new Dictionary(); - } - - public Primitive2(Dictionary clientThreads, ulong regionHandle, World world, LLUUID owner) - { - m_clientThreads = clientThreads; - m_regionHandle = regionHandle; - m_world = world; - inventoryItems = new Dictionary(); - this.primData = new PrimData(); - this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; - this.primData.OwnerID = owner; - } - - public byte[] GetByteArray() - { - byte[] result = null; - List dataArrays = new List(); - dataArrays.Add(primData.ToBytes()); - foreach (Entity child in children) - { - if (child is OpenSim.RegionServer.Simulator.Primitive2) - { - dataArrays.Add(((OpenSim.RegionServer.Simulator.Primitive2)child).GetByteArray()); - } - } - byte[] primstart = Helpers.StringToField(""); - byte[] primend = Helpers.StringToField(""); - int totalLength = primstart.Length + primend.Length; - for (int i = 0; i < dataArrays.Count; i++) - { - totalLength += dataArrays[i].Length; - } - - result = new byte[totalLength]; - int arraypos = 0; - Array.Copy(primstart, 0, result, 0, primstart.Length); - arraypos += primstart.Length; - for (int i = 0; i < dataArrays.Count; i++) - { - Array.Copy(dataArrays[i], 0, result, arraypos, dataArrays[i].Length); - arraypos += dataArrays[i].Length; - } - Array.Copy(primend, 0, result, arraypos, primend.Length); - - return result; - } - - #region Overridden Methods - - public override void update() - { - LLVector3 pos2 = new LLVector3(0, 0, 0); - } - - public override void BackUp() - { - - } - - #endregion - - #region Packet handlers - - public void UpdatePosition(LLVector3 pos) - { - - } - - public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket) - { - this.primData.PathBegin = addPacket.PathBegin; - this.primData.PathEnd = addPacket.PathEnd; - this.primData.PathScaleX = addPacket.PathScaleX; - this.primData.PathScaleY = addPacket.PathScaleY; - this.primData.PathShearX = addPacket.PathShearX; - this.primData.PathShearY = addPacket.PathShearY; - this.primData.PathSkew = addPacket.PathSkew; - this.primData.ProfileBegin = addPacket.ProfileBegin; - this.primData.ProfileEnd = addPacket.ProfileEnd; - this.primData.PathCurve = addPacket.PathCurve; - this.primData.ProfileCurve = addPacket.ProfileCurve; - this.primData.ProfileHollow = addPacket.ProfileHollow; - this.primData.PathRadiusOffset = addPacket.PathRadiusOffset; - this.primData.PathRevolutions = addPacket.PathRevolutions; - this.primData.PathTaperX = addPacket.PathTaperX; - this.primData.PathTaperY = addPacket.PathTaperY; - this.primData.PathTwist = addPacket.PathTwist; - this.primData.PathTwistBegin = addPacket.PathTwistBegin; - } - - public void UpdateTexture(byte[] tex) - { - this.primData.Texture = tex; - //this.dirtyFlag = true; - } - - public void UpdateObjectFlags(ObjectFlagUpdatePacket pack) - { - - } - - public void AssignToParent(Primitive prim) - { - - } - - public void GetProperites(ClientView client) - { - ObjectPropertiesPacket proper = new ObjectPropertiesPacket(); - proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; - proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); - proper.ObjectData[0].ItemID = LLUUID.Zero; - proper.ObjectData[0].CreationDate = (ulong)this.primData.CreationDate; - proper.ObjectData[0].CreatorID = this.primData.OwnerID; - proper.ObjectData[0].FolderID = LLUUID.Zero; - proper.ObjectData[0].FromTaskID = LLUUID.Zero; - proper.ObjectData[0].GroupID = LLUUID.Zero; - proper.ObjectData[0].InventorySerial = 0; - proper.ObjectData[0].LastOwnerID = LLUUID.Zero; - proper.ObjectData[0].ObjectID = this.uuid; - proper.ObjectData[0].OwnerID = primData.OwnerID; - proper.ObjectData[0].TouchName = new byte[0]; - proper.ObjectData[0].TextureID = new byte[0]; - proper.ObjectData[0].SitName = new byte[0]; - proper.ObjectData[0].Name = new byte[0]; - proper.ObjectData[0].Description = new byte[0]; - proper.ObjectData[0].OwnerMask = this.primData.OwnerMask; - proper.ObjectData[0].NextOwnerMask = this.primData.NextOwnerMask; - proper.ObjectData[0].GroupMask = this.primData.GroupMask; - proper.ObjectData[0].EveryoneMask = this.primData.EveryoneMask; - proper.ObjectData[0].BaseMask = this.primData.BaseMask; - - client.OutPacket(proper); - } - - #endregion - - # region Inventory Methods - - public bool AddToInventory(InventoryItem item) - { - return false; - } - - public InventoryItem RemoveFromInventory(LLUUID itemID) - { - return null; - } - - public void RequestInventoryInfo(ClientView simClient, RequestTaskInventoryPacket packet) - { - - } - - public void RequestXferInventory(ClientView simClient, ulong xferID) - { - //will only currently work if the total size of the inventory data array is under about 1000 bytes - SendXferPacketPacket send = new SendXferPacketPacket(); - - send.XferID.ID = xferID; - send.XferID.Packet = 1 + 2147483648; - send.DataPacket.Data = this.ConvertInventoryToBytes(); - - simClient.OutPacket(send); - } - - public byte[] ConvertInventoryToBytes() - { - System.Text.Encoding enc = System.Text.Encoding.ASCII; - byte[] result = new byte[0]; - List inventoryData = new List(); - int totallength = 0; - foreach (InventoryItem invItem in inventoryItems.Values) - { - byte[] data = enc.GetBytes(invItem.ExportString()); - inventoryData.Add(data); - totallength += data.Length; - } - //TODO: copy arrays into the single result array - - return result; - } - - public void CreateInventoryFromBytes(byte[] data) - { - - } - - #endregion - - #region Update viewers Methods - - //should change these mehtods, so that outgoing packets are sent through the avatar class - public void SendFullUpdateToClient(ClientView remoteClient) - { - LLVector3 lPos; - if (this._physActor != null && this.physicsEnabled) - { - PhysicsVector pPos = this._physActor.Position; - lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z); - } - else - { - lPos = this.Pos; - } - - ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); - outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; - outPacket.ObjectData[0] = this.CreateUpdateBlock(); - byte[] pb = lPos.GetBytes(); - Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); - - remoteClient.OutPacket(outPacket); - } - - public void SendFullUpdateToAllClients() - { - - } - - public void SendTerseUpdateToClient(ClientView RemoteClient) - { - - } - - public void SendTerseUpdateToALLClients() - { - - } - - #endregion - - #region Create Methods - - public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID ownerID, uint localID) - { - PrimData PData = new PrimData(); - this.primData = PData; - this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; - - PData.OwnerID = ownerID; - PData.PCode = addPacket.ObjectData.PCode; - PData.PathBegin = addPacket.ObjectData.PathBegin; - PData.PathEnd = addPacket.ObjectData.PathEnd; - PData.PathScaleX = addPacket.ObjectData.PathScaleX; - PData.PathScaleY = addPacket.ObjectData.PathScaleY; - PData.PathShearX = addPacket.ObjectData.PathShearX; - PData.PathShearY = addPacket.ObjectData.PathShearY; - PData.PathSkew = addPacket.ObjectData.PathSkew; - PData.ProfileBegin = addPacket.ObjectData.ProfileBegin; - PData.ProfileEnd = addPacket.ObjectData.ProfileEnd; - PData.Scale = addPacket.ObjectData.Scale; - PData.PathCurve = addPacket.ObjectData.PathCurve; - PData.ProfileCurve = addPacket.ObjectData.ProfileCurve; - PData.ParentID = 0; - PData.ProfileHollow = addPacket.ObjectData.ProfileHollow; - PData.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset; - PData.PathRevolutions = addPacket.ObjectData.PathRevolutions; - PData.PathTaperX = addPacket.ObjectData.PathTaperX; - PData.PathTaperY = addPacket.ObjectData.PathTaperY; - PData.PathTwist = addPacket.ObjectData.PathTwist; - PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin; - LLVector3 pos1 = addPacket.ObjectData.RayEnd; - this.primData.FullID = this.uuid = LLUUID.Random(); - this.localid = (uint)(localID); - this.primData.Position = this.Pos = pos1; - } - - public void CreateFromBytes(byte[] data) - { - - } - - public void CreateFromPrimData(PrimData primData) - { - this.CreateFromPrimData(primData, primData.Position, primData.LocalID, false); - } - - public void CreateFromPrimData(PrimData primData, LLVector3 posi, uint localID, bool newprim) - { - - } - - #endregion - - #region Packet Update Methods - protected void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata) - { - objdata.PSBlock = new byte[0]; - objdata.ExtraParams = new byte[1]; - objdata.MediaURL = new byte[0]; - objdata.NameValue = new byte[0]; - objdata.Text = new byte[0]; - objdata.TextColor = new byte[4]; - objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0); - objdata.JointPivot = new LLVector3(0, 0, 0); - objdata.Material = 3; - objdata.TextureAnim = new byte[0]; - objdata.Sound = LLUUID.Zero; - LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); - this.primData.Texture = objdata.TextureEntry = ntex.ToBytes(); - objdata.State = 0; - objdata.Data = new byte[0]; - - objdata.ObjectData = new byte[60]; - objdata.ObjectData[46] = 128; - objdata.ObjectData[47] = 63; - } - - protected void SetPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData) - { - objectData.OwnerID = this.primData.OwnerID; - objectData.PCode = this.primData.PCode; - objectData.PathBegin = this.primData.PathBegin; - objectData.PathEnd = this.primData.PathEnd; - objectData.PathScaleX = this.primData.PathScaleX; - objectData.PathScaleY = this.primData.PathScaleY; - objectData.PathShearX = this.primData.PathShearX; - objectData.PathShearY = this.primData.PathShearY; - objectData.PathSkew = this.primData.PathSkew; - objectData.ProfileBegin = this.primData.ProfileBegin; - objectData.ProfileEnd = this.primData.ProfileEnd; - objectData.Scale = this.primData.Scale; - objectData.PathCurve = this.primData.PathCurve; - objectData.ProfileCurve = this.primData.ProfileCurve; - objectData.ParentID = this.primData.ParentID; - objectData.ProfileHollow = this.primData.ProfileHollow; - objectData.PathRadiusOffset = this.primData.PathRadiusOffset; - objectData.PathRevolutions = this.primData.PathRevolutions; - objectData.PathTaperX = this.primData.PathTaperX; - objectData.PathTaperY = this.primData.PathTaperY; - objectData.PathTwist = this.primData.PathTwist; - objectData.PathTwistBegin = this.primData.PathTwistBegin; - } - - #endregion - protected ObjectUpdatePacket.ObjectDataBlock CreateUpdateBlock() - { - ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock(); - this.SetDefaultPacketValues(objupdate); - objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; - this.SetPacketShapeData(objupdate); - byte[] pb = this.Pos.GetBytes(); - Array.Copy(pb, 0, objupdate.ObjectData, 0, pb.Length); - return objupdate; - } - - protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateImprovedBlock() - { - uint ID = this.localid; - byte[] bytes = new byte[60]; - - int i = 0; - ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); - dat.TextureEntry = new byte[0]; - bytes[i++] = (byte)(ID % 256); - bytes[i++] = (byte)((ID >> 8) % 256); - bytes[i++] = (byte)((ID >> 16) % 256); - bytes[i++] = (byte)((ID >> 24) % 256); - bytes[i++] = 0; - bytes[i++] = 0; - - LLVector3 lPos; - Axiom.MathLib.Quaternion lRot; - if (this._physActor != null && this.physicsEnabled) - { - PhysicsVector pPos = this._physActor.Position; - lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z); - lRot = this._physActor.Orientation; - } - else - { - lPos = this.Pos; - lRot = this.rotation; - } - byte[] pb = lPos.GetBytes(); - Array.Copy(pb, 0, bytes, i, pb.Length); - i += 12; - ushort ac = 32767; - - //vel - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - //accel - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - ushort rw, rx, ry, rz; - rw = (ushort)(32768 * (lRot.w + 1)); - rx = (ushort)(32768 * (lRot.x + 1)); - ry = (ushort)(32768 * (lRot.y + 1)); - rz = (ushort)(32768 * (lRot.z + 1)); - - //rot - bytes[i++] = (byte)(rx % 256); - bytes[i++] = (byte)((rx >> 8) % 256); - bytes[i++] = (byte)(ry % 256); - bytes[i++] = (byte)((ry >> 8) % 256); - bytes[i++] = (byte)(rz % 256); - bytes[i++] = (byte)((rz >> 8) % 256); - bytes[i++] = (byte)(rw % 256); - bytes[i++] = (byte)((rw >> 8) % 256); - - //rotation vel - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - dat.Data = bytes; - return dat; - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/SceneObject.cs b/OpenSim/OpenSim.RegionServer/Simulator/SceneObject.cs deleted file mode 100644 index ce2b50d..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/SceneObject.cs +++ /dev/null @@ -1,102 +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 OpenSim.RegionServer.Types; -using libsecondlife; -using libsecondlife.Packets; -using OpenSim.Framework.Interfaces; -using OpenSim.Physics.Manager; -using OpenSim.Framework.Types; -using OpenSim.Framework.Inventory; -using OpenSim.RegionServer.Client; - -namespace OpenSim.RegionServer.Simulator -{ - public class SceneObject : Entity - { - private Dictionary ChildPrimitives = new Dictionary(); - - public SceneObject() - { - - } - - public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) - { - } - - public void CreateFromBytes(byte[] data) - { - - } - - public override void update() - { - - } - - public override void BackUp() - { - - } - - public void GetProperites(ClientView client) - { - /* - ObjectPropertiesPacket proper = new ObjectPropertiesPacket(); - proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; - proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); - proper.ObjectData[0].ItemID = LLUUID.Zero; - proper.ObjectData[0].CreationDate = (ulong)this.primData.CreationDate; - proper.ObjectData[0].CreatorID = this.primData.OwnerID; - proper.ObjectData[0].FolderID = LLUUID.Zero; - proper.ObjectData[0].FromTaskID = LLUUID.Zero; - proper.ObjectData[0].GroupID = LLUUID.Zero; - proper.ObjectData[0].InventorySerial = 0; - proper.ObjectData[0].LastOwnerID = LLUUID.Zero; - proper.ObjectData[0].ObjectID = this.uuid; - proper.ObjectData[0].OwnerID = primData.OwnerID; - proper.ObjectData[0].TouchName = new byte[0]; - proper.ObjectData[0].TextureID = new byte[0]; - proper.ObjectData[0].SitName = new byte[0]; - proper.ObjectData[0].Name = new byte[0]; - proper.ObjectData[0].Description = new byte[0]; - proper.ObjectData[0].OwnerMask = this.primData.OwnerMask; - proper.ObjectData[0].NextOwnerMask = this.primData.NextOwnerMask; - proper.ObjectData[0].GroupMask = this.primData.GroupMask; - proper.ObjectData[0].EveryoneMask = this.primData.EveryoneMask; - proper.ObjectData[0].BaseMask = this.primData.BaseMask; - - client.OutPacket(proper); - * */ - } - - } -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/World.PacketHandlers.cs b/OpenSim/OpenSim.RegionServer/Simulator/World.PacketHandlers.cs deleted file mode 100644 index 2c5a05f..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/World.PacketHandlers.cs +++ /dev/null @@ -1,449 +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.Physics.Manager; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Terrain; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; -using OpenSim.RegionServer.Assets; -using OpenSim.RegionServer.Client; - -namespace OpenSim.RegionServer.Simulator -{ - public partial class World - { - public void ModifyTerrain(byte action, float north, float west) - { - switch (action) - { - case 1: - // raise terrain - Terrain.raise(north, west, 10.0, 0.001); - RegenerateTerrain(true, (int)north, (int)west); - break; - case 2: - //lower terrain - Terrain.lower(north, west, 10.0, 0.001); - RegenerateTerrain(true, (int)north, (int)west); - break; - } - return; - } - - public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) - { - foreach (ClientView client in m_clientThreads.Values) - { - // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); - int dis = (int)client.ClientAvatar.Pos.GetDistanceTo(fromPos); - - switch (type) - { - case 0: // Whisper - if ((dis < 10) && (dis > -10)) - { - //should change so the message is sent through the avatar rather than direct to the ClientView - client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); - } - break; - case 1: // Say - if ((dis < 30) && (dis > -30)) - { - client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); - } - break; - case 2: // Shout - if ((dis < 100) && (dis > -100)) - { - client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); - } - break; - - case 0xff: // Broadcast - client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); - break; - } - - } - } - - public void RezObject(AssetBase primAsset, LLVector3 pos) - { - PrimData primd = new PrimData(primAsset.Data); - Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this); - nPrim.CreateFromStorage(primd, pos, this._primCount, true); - this.Entities.Add(nPrim.uuid, nPrim); - this._primCount++; - } - - public void DeRezObject(Packet packet, ClientView simClient) - { - DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)packet; - - //Needs to delete object from physics at a later date - if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero) - { - //currently following code not used (or don't know of any case of destination being zero - libsecondlife.LLUUID[] DeRezEnts; - DeRezEnts = new libsecondlife.LLUUID[DeRezPacket.ObjectData.Length]; - int i = 0; - foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) - { - - //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); - foreach (Entity ent in this.Entities.Values) - { - if (ent.localid == Data.ObjectLocalID) - { - DeRezEnts[i++] = ent.uuid; - this.localStorage.RemovePrim(ent.uuid); - KillObjectPacket kill = new KillObjectPacket(); - kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; - kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); - kill.ObjectData[0].ID = ent.localid; - foreach (ClientView client in m_clientThreads.Values) - { - client.OutPacket(kill); - } - //Uncommenting this means an old UUID will be re-used, thus crashing the asset server - //Uncomment when prim/object UUIDs are random or such - //2007-03-22 - Randomskk - //this._primCount--; - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Deleted UUID " + ent.uuid); - } - } - } - foreach (libsecondlife.LLUUID uuid in DeRezEnts) - { - lock (Entities) - { - Entities.Remove(uuid); - } - } - } - else - { - foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) - { - Entity selectedEnt = null; - //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); - foreach (Entity ent in this.Entities.Values) - { - if (ent.localid == Data.ObjectLocalID) - { - AssetBase primAsset = new AssetBase(); - primAsset.FullID = LLUUID.Random();//DeRezPacket.AgentBlock.TransactionID.Combine(LLUUID.Zero); //should be combining with securesessionid - primAsset.InvType = 6; - primAsset.Type = 6; - primAsset.Name = "Prim"; - primAsset.Description = ""; - primAsset.Data = ((Primitive)ent).GetByteArray(); - this._assetCache.AddAsset(primAsset); - this._inventoryCache.AddNewInventoryItem(simClient, DeRezPacket.AgentBlock.DestinationID, primAsset); - selectedEnt = ent; - break; - } - } - if (selectedEnt != null) - { - this.localStorage.RemovePrim(selectedEnt.uuid); - KillObjectPacket kill = new KillObjectPacket(); - kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; - kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); - kill.ObjectData[0].ID = selectedEnt.localid; - foreach (ClientView client in m_clientThreads.Values) - { - client.OutPacket(kill); - } - lock (Entities) - { - Entities.Remove(selectedEnt.uuid); - } - } - } - } - - } - - public void SendAvatarsToClient(ClientView remoteClient) - { - foreach (ClientView client in m_clientThreads.Values) - { - if (client.AgentID != remoteClient.AgentID) - { - // ObjectUpdatePacket objupdate = client.ClientAvatar.CreateUpdatePacket(); - // RemoteClient.OutPacket(objupdate); - client.ClientAvatar.SendUpdateToOtherClient(remoteClient.ClientAvatar); - client.ClientAvatar.SendAppearanceToOtherAgent(remoteClient.ClientAvatar); - } - } - } - - public void LinkObjects(uint parentPrim, List childPrims) - { - Primitive parentprim = null; - foreach (Entity ent in Entities.Values) - { - if (ent.localid == parentPrim) - { - parentprim = (OpenSim.RegionServer.Simulator.Primitive)ent; - - } - } - - for (int i = 0; i < childPrims.Count; i++) - { - uint childId = childPrims[i]; - foreach (Entity ent in Entities.Values) - { - if (ent.localid == childId) - { - ((OpenSim.RegionServer.Simulator.Primitive)ent).MakeParent(parentprim); - } - } - } - - } - - public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock) - { - foreach (Entity ent in Entities.Values) - { - if (ent.localid == primLocalID) - { - ((OpenSim.RegionServer.Simulator.Primitive)ent).UpdateShape(shapeBlock); - break; - } - } - } - - public void SelectPrim(uint primLocalID, ClientView remoteClient) - { - foreach (Entity ent in Entities.Values) - { - if (ent.localid == primLocalID) - { - ((OpenSim.RegionServer.Simulator.Primitive)ent).GetProperites(remoteClient); - break; - } - } - } - - public void UpdatePrimFlags(uint localID, Packet packet, ClientView remoteClient) - { - foreach (Entity ent in Entities.Values) - { - if (ent.localid == localID) - { - ((OpenSim.RegionServer.Simulator.Primitive)ent).UpdateObjectFlags((ObjectFlagUpdatePacket) packet); - break; - } - } - } - - public void UpdatePrimTexture(uint localID, byte[] texture, ClientView remoteClient) - { - foreach (Entity ent in Entities.Values) - { - if (ent.localid == localID) - { - ((OpenSim.RegionServer.Simulator.Primitive)ent).UpdateTexture(texture); - break; - } - } - } - - public void UpdatePrimPosition(uint localID, LLVector3 pos, ClientView remoteClient) - { - foreach (Entity ent in Entities.Values) - { - if (ent.localid == localID) - { - ((OpenSim.RegionServer.Simulator.Primitive)ent).UpdatePosition(pos); - break; - } - } - } - - public void UpdatePrimRotation(uint localID, LLQuaternion rot, ClientView remoteClient) - { - foreach (Entity ent in Entities.Values) - { - if (ent.localid == localID) - { - ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z); - ((OpenSim.RegionServer.Simulator.Primitive)ent).UpdateFlag = true; - break; - } - } - } - - public void UpdatePrimScale(uint localID, LLVector3 scale, ClientView remoteClient) - { - foreach (Entity ent in Entities.Values) - { - if (ent.localid == localID) - { - ((OpenSim.RegionServer.Simulator.Primitive)ent).Scale = scale; - break; - } - } - } - #region Parcel Packet Handlers - void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, ClientView remote_client) - { - //Get the parcels within the bounds - List temp = new List(); - int x, y, i; - int inc_x = end_x - start_x; - int inc_y = end_y - start_y; - for(x = 0; x < inc_x; x++) - { - for(y = 0; y < inc_y; y++) - { - OpenSim.RegionServer.Simulator.Parcel currentParcel = parcelManager.getParcel(start_x + x, start_y + y); - if(!temp.Contains(currentParcel)) - { - currentParcel. - forceUpdateParcelInfo(); - temp.Add(currentParcel); - } - } - } - - int requestResult = OpenSim.RegionServer.Simulator.ParcelManager.PARCEL_RESULT_ONE_PARCEL; - if (temp.Count > 1) - { - requestResult = OpenSim.RegionServer.Simulator.ParcelManager.PARCEL_RESULT_MULTIPLE_PARCELS; - } - - for (i = 0; i < temp.Count; i++) - { - temp[i].sendParcelProperties(sequence_id, snap_selection, requestResult, remote_client); - } - - - parcelManager.sendParcelOverlay(remote_client); - } - - void ParcelDivideRequest(int west, int south, int east, int north, ClientView remote_client) - { - parcelManager.subdivide(west, south, east, north, remote_client.AgentID); - } - void ParcelJoinRequest(int west, int south, int east, int north, ClientView remote_client) - { - parcelManager.join(west, south, east, north, remote_client.AgentID); - } - void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, ClientView remote_client) - { - if (parcelManager.parcelList.ContainsKey(packet.ParcelData.LocalID)) - { - parcelManager.parcelList[packet.ParcelData.LocalID].updateParcelProperties(packet, remote_client); - } - } - #endregion - - /* - public void RequestMapBlock(ClientView simClient, int minX, int minY, int maxX, int maxY) - { - System.Text.Encoding _enc = System.Text.Encoding.ASCII; - if (((m_regInfo.RegionLocX > minX) && (m_regInfo.RegionLocX < maxX)) && ((m_regInfo.RegionLocY > minY) && (m_regInfo.RegionLocY < maxY))) - { - MapBlockReplyPacket mapReply = new MapBlockReplyPacket(); - mapReply.AgentData.AgentID = simClient.AgentID; - mapReply.AgentData.Flags = 0; - mapReply.Data = new MapBlockReplyPacket.DataBlock[1]; - mapReply.Data[0] = new MapBlockReplyPacket.DataBlock(); - mapReply.Data[0].MapImageID = new LLUUID("00000000-0000-0000-9999-000000000007"); - mapReply.Data[0].X = (ushort)m_regInfo.RegionLocX; - mapReply.Data[0].Y = (ushort)m_regInfo.RegionLocY; - mapReply.Data[0].WaterHeight = (byte)m_regInfo.RegionWaterHeight; - mapReply.Data[0].Name = _enc.GetBytes(this.m_regionName); - mapReply.Data[0].RegionFlags = 72458694; - mapReply.Data[0].Access = 13; - mapReply.Data[0].Agents = 1; //should send number of clients connected - simClient.OutPacket(mapReply); - } - } - public bool RezObjectHandler(ClientView simClient, Packet packet) - { - RezObjectPacket rezPacket = (RezObjectPacket)packet; - AgentInventory inven = this._inventoryCache.GetAgentsInventory(simClient.AgentID); - if (inven != null) - { - if (inven.InventoryItems.ContainsKey(rezPacket.InventoryData.ItemID)) - { - AssetBase asset = this._assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID); - if (asset != null) - { - PrimData primd = new PrimData(asset.Data); - Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this); - nPrim.CreateFromStorage(primd, rezPacket.RezData.RayEnd, this._primCount, true); - this.Entities.Add(nPrim.uuid, nPrim); - this._primCount++; - this._inventoryCache.DeleteInventoryItem(simClient, rezPacket.InventoryData.ItemID); - } - } - } - return true; - } - public bool ModifyTerrain(ClientView simClient, Packet packet) - { - ModifyLandPacket modify = (ModifyLandPacket)packet; - - switch (modify.ModifyBlock.Action) - { - case 1: - // raise terrain - if (modify.ParcelData.Length > 0) - { - Terrain.raise(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1); - RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West); - } - break; - case 2: - //lower terrain - if (modify.ParcelData.Length > 0) - { - Terrain.lower(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1); - RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West); - } - break; - } - return true; - } - */ - - } -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/World.Scripting.cs b/OpenSim/OpenSim.RegionServer/Simulator/World.Scripting.cs deleted file mode 100644 index 747730c..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/World.Scripting.cs +++ /dev/null @@ -1,151 +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.IO; -using System.Reflection; -using OpenSim.Framework; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using libsecondlife; - -namespace OpenSim.RegionServer.Simulator -{ - public partial class World - { - private Dictionary scriptEngines = new Dictionary(); - - private void LoadScriptEngines() - { - this.LoadScriptPlugins(); - } - - public void LoadScriptPlugins() - { - string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "ScriptEngines"); - string[] pluginFiles = Directory.GetFiles(path, "*.dll"); - - - for (int i = 0; i < pluginFiles.Length; i++) - { - this.AddPlugin(pluginFiles[i]); - } - } - - private void AddPlugin(string FileName) - { - Assembly pluginAssembly = Assembly.LoadFrom(FileName); - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IScriptEngine", true); - - if (typeInterface != null) - { - IScriptEngine plug = (IScriptEngine)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Init(this); - this.scriptEngines.Add(plug.GetName(), plug); - - } - - typeInterface = null; - } - } - } - - pluginAssembly = null; - } - - public void LoadScript(string scriptType, string scriptName, string script, Entity ent) - { - if(this.scriptEngines.ContainsKey(scriptType)) - { - this.scriptEngines[scriptType].LoadScript(script, scriptName, ent.localid); - } - } - - #region IScriptAPI Methods - - public OSVector3 GetEntityPosition(uint localID) - { - OSVector3 res = new OSVector3(); - // Console.WriteLine("script- getting entity " + localID + " position"); - foreach (Entity entity in this.Entities.Values) - { - if (entity.localid == localID) - { - res.X = entity.Pos.X; - res.Y = entity.Pos.Y; - res.Z = entity.Pos.Z; - } - } - return res; - } - - public void SetEntityPosition(uint localID, float x , float y, float z) - { - foreach (Entity entity in this.Entities.Values) - { - if (entity.localid == localID && entity is Primitive) - { - LLVector3 pos = entity.Pos; - pos.X = x; - pos.Y = y; - Primitive prim = entity as Primitive; - // Of course, we really should have asked the physEngine if this is possible, and if not, returned false. - prim.UpdatePosition(pos); - // Console.WriteLine("script- setting entity " + localID + " positon"); - } - } - - } - - public uint GetRandomAvatarID() - { - //Console.WriteLine("script- getting random avatar id"); - uint res = 0; - foreach (Entity entity in this.Entities.Values) - { - if (entity is Avatar) - { - res = entity.localid; - } - } - return res; - } - - #endregion - - - } -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/World.cs b/OpenSim/OpenSim.RegionServer/Simulator/World.cs deleted file mode 100644 index ac64c79..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/World.cs +++ /dev/null @@ -1,737 +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 libsecondlife; -using libsecondlife.Packets; -using System.Collections.Generic; -using System.Text; -using System.Reflection; -using System.IO; -using System.Threading; -using OpenSim.Physics.Manager; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Terrain; -using OpenSim.Framework.Inventory; -using OpenSim.RegionServer.Assets; - -using OpenSim.RegionServer.Scripting; -using OpenSim.Terrain; -using OpenSim.Framework.Console; -using OpenSim.RegionServer.Client; - - -namespace OpenSim.RegionServer.Simulator -{ - public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI - { - public object LockPhysicsEngine = new object(); - public Dictionary Avatars; - public Dictionary Prims; - //public ScriptEngine Scripts; - public uint _localNumber = 0; - private PhysicsScene phyScene; - private float timeStep = 0.1f; - public ILocalStorage localStorage; - private Random Rand = new Random(); - private uint _primCount = 702000; - private int storageCount; - private Dictionary m_scriptHandlers; - private Dictionary m_scripts; - private Mutex updateLock; - public string m_datastore; - public OpenSim.RegionServer.Simulator.ParcelManager parcelManager; - public OpenSim.RegionServer.Estate.EstateManager estateManager; - - #region Properties - public PhysicsScene PhysScene - { - set - { - this.phyScene = value; - } - get - { - return (this.phyScene); - } - } - #endregion - - #region Constructors - /// - /// Creates a new World class, and a region to go with it. - /// - /// Dictionary to contain client threads - /// Region Handle for this region - /// Region Name for this region - public World(Dictionary clientThreads, RegionInfo regInfo, ulong regionHandle, string regionName) - { - try - { - updateLock = new Mutex(false); - m_clientThreads = clientThreads; - m_regionHandle = regionHandle; - m_regionName = regionName; - m_regInfo = regInfo; - - m_scriptHandlers = new Dictionary(); - m_scripts = new Dictionary(); - - MainConsole.Instance.Notice("World.cs - creating new entitities instance"); - Entities = new Dictionary(); - Avatars = new Dictionary(); - Prims = new Dictionary(); - - MainConsole.Instance.Notice("World.cs - creating LandMap"); - TerrainManager = new TerrainManager(new SecondLife()); - Terrain = new TerrainEngine(); - Avatar.SetupTemplate("avatar-texture.dat"); - // MainConsole.Instance.WriteLine("World.cs - Creating script engine instance"); - // Initialise this only after the world has loaded - // Scripts = new ScriptEngine(this); - Avatar.LoadAnims(); - this.SetDefaultScripts(); - this.LoadScriptEngines(); - - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Error("World.cs: Constructor failed with exception " + e.ToString()); - } - } - #endregion - - #region Script Methods - /// - /// Loads a new script into the specified entity - /// - /// Entity to be scripted - /// The script to load - public void AddScript(Entity entity, Script script) - { - try - { - ScriptHandler scriptHandler = new ScriptHandler(script, entity, this); - m_scriptHandlers.Add(scriptHandler.ScriptId, scriptHandler); - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: AddScript() - Failed with exception " + e.ToString()); - } - } - - /// - /// Loads a new script into the specified entity, using a script loaded from a string. - /// - /// The entity to be scripted - /// The string containing the script - public void AddScript(Entity entity, string scriptData) - { - try - { - int scriptstart = 0; - int scriptend = 0; - string substring; - scriptstart = scriptData.LastIndexOf(""); - substring = scriptData.Substring(scriptstart + 8, scriptend - scriptstart - 8); - substring = substring.Trim(); - //Console.WriteLine("searching for script to add: " + substring); - - ScriptFactory scriptFactory; - //Console.WriteLine("script string is " + substring); - if (substring.StartsWith("'); - string sName = substring1.Substring(0, end); - //Console.WriteLine(" script info : " + sEngine + " , " + sName); - int startscript = substring.IndexOf('>'); - script = substring.Remove(0, startscript + 1); - // Console.WriteLine("script data is " + script); - if (this.scriptEngines.ContainsKey(sEngine)) - { - this.scriptEngines[sEngine].LoadScript(script, sName, entity.localid); - } - } - else if (this.m_scripts.TryGetValue(substring, out scriptFactory)) - { - //Console.WriteLine("added script"); - this.AddScript(entity, scriptFactory()); - } - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: AddScript() - Failed with exception " + e.ToString()); - } - } - - #endregion - - #region Update Methods - /// - /// Performs per-frame updates on the world, this should be the central world loop - /// - public override void Update() - { - updateLock.WaitOne(); - try - { - if (this.phyScene.IsThreaded) - { - this.phyScene.GetResults(); - - } - - foreach (libsecondlife.LLUUID UUID in Entities.Keys) - { - Entities[UUID].addForces(); - } - - lock (this.LockPhysicsEngine) - { - this.phyScene.Simulate(timeStep); - } - - foreach (libsecondlife.LLUUID UUID in Entities.Keys) - { - Entities[UUID].update(); - } - - foreach (ScriptHandler scriptHandler in m_scriptHandlers.Values) - { - scriptHandler.OnFrame(); - } - foreach (IScriptEngine scripteng in this.scriptEngines.Values) - { - scripteng.OnFrame(); - } - //backup world data - this.storageCount++; - if (storageCount > 1200) //set to how often you want to backup - { - this.Backup(); - storageCount = 0; - } - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: Update() - Failed with exception " + e.ToString()); - } - updateLock.ReleaseMutex(); - } - - public bool Backup() - { - try - { - // Terrain backup routines - if (Terrain.tainted > 0) - { - Terrain.tainted = 0; - MainConsole.Instance.Notice("World.cs: Backup() - Terrain tainted, saving."); - localStorage.SaveMap(Terrain.getHeights1D()); - MainConsole.Instance.Notice("World.cs: Backup() - Rebuilding world map image."); - Terrain.exportImage("map_" + m_regInfo.RegionName.ToLower() + ".png", "defaultstripe.png"); - MainConsole.Instance.Notice("World.cs: Backup() - Terrain saved, informing Physics."); - phyScene.SetTerrain(Terrain.getHeights1D()); - - // Needs optimising to just send patches which have changed. - MainConsole.Instance.Notice("World.cs: Backup() - Terrain changed, informing Clients."); - foreach (ClientView client in m_clientThreads.Values) - { - this.SendLayerData(client); - } - } - - // Primitive backup routines -- should only do if there's been a change. - MainConsole.Instance.Notice("World.cs: Backup() - Backing up Primitives"); - foreach (libsecondlife.LLUUID UUID in Entities.Keys) - { - Entities[UUID].BackUp(); - } - - - //Parcel backup routines. Yay! - ParcelData[] parcels = new ParcelData[parcelManager.parcelList.Count]; - int i = 0; - foreach(OpenSim.RegionServer.Simulator.Parcel parcel in parcelManager.parcelList.Values) - { - parcels[i] = parcel.parcelData; - i++; - } - localStorage.SaveParcels(parcels); - - - // Backup successful - return true; - } - catch (Exception e) - { - // Backup failed - OpenSim.Framework.Console.MainConsole.Instance.Error("World.cs: Backup() - Backup Failed with exception " + e.ToString()); - return false; - } - } - #endregion - - #region Setup Methods - /// - /// Loads a new storage subsystem from a named library - /// - /// Storage Library - /// Successful or not - public bool LoadStorageDLL(string dllName) - { - try - { - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - ILocalStorage store = null; - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("ILocalStorage", true); - - if (typeInterface != null) - { - ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - store = plug; - - store.Initialise(this.m_datastore); - break; - } - - typeInterface = null; - } - } - } - pluginAssembly = null; - this.localStorage = store; - return (store == null); - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: LoadStorageDLL() - Failed with exception " + e.ToString()); - return false; - } - } - - public void SetDefaultScripts() - { - this.m_scripts.Add("FollowRandomAvatar", delegate() - { - return new OpenSim.RegionServer.Scripting.FollowRandomAvatar(); - }); - } - - #endregion - - #region Regenerate Terrain - - /// - /// Rebuilds the terrain using a procedural algorithm - /// - public void RegenerateTerrain() - { - try - { - Terrain.hills(); - - lock (this.LockPhysicsEngine) - { - this.phyScene.SetTerrain(Terrain.getHeights1D()); - } - this.localStorage.SaveMap(this.Terrain.getHeights1D()); - - foreach (ClientView client in m_clientThreads.Values) - { - this.SendLayerData(client); - } - - foreach (libsecondlife.LLUUID UUID in Entities.Keys) - { - Entities[UUID].LandRenegerated(); - } - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); - } - } - - /// - /// Rebuilds the terrain using a 2D float array - /// - /// 256,256 float array containing heights - public void RegenerateTerrain(float[,] newMap) - { - try - { - this.Terrain.setHeights2D(newMap); - lock (this.LockPhysicsEngine) - { - this.phyScene.SetTerrain(this.Terrain.getHeights1D()); - } - this.localStorage.SaveMap(this.Terrain.getHeights1D()); - - foreach (ClientView client in m_clientThreads.Values) - { - this.SendLayerData(client); - } - - foreach (libsecondlife.LLUUID UUID in Entities.Keys) - { - Entities[UUID].LandRenegerated(); - } - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); - } - } - - /// - /// Rebuilds the terrain assuming changes occured at a specified point[?] - /// - /// ??? - /// ??? - /// ??? - public void RegenerateTerrain(bool changes, int pointx, int pointy) - { - try - { - if (changes) - { - /* Dont save here, rely on tainting system instead */ - - foreach (ClientView client in m_clientThreads.Values) - { - this.SendLayerData(pointx, pointy, client); - } - } - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); - } - } - - #endregion - - #region Load Terrain - /// - /// Loads the World heightmap - /// - public override void LoadWorldMap() - { - try - { - float[] map = this.localStorage.LoadWorld(); - if (map == null) - { - if (string.IsNullOrEmpty(this.m_regInfo.estateSettings.terrainFile)) - { - Console.WriteLine("No default terrain, procedurally generating..."); - this.Terrain.hills(); - - this.localStorage.SaveMap(this.Terrain.getHeights1D()); - } - else - { - try - { - this.Terrain.loadFromFileF32(this.m_regInfo.estateSettings.terrainFile); - this.Terrain *= this.m_regInfo.estateSettings.terrainMultiplier; - } - catch - { - Console.WriteLine("Unable to load default terrain, procedurally generating instead..."); - Terrain.hills(); - } - this.localStorage.SaveMap(this.Terrain.getHeights1D()); - } - } - else - { - this.Terrain.setHeights1D(map); - } - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: LoadWorldMap() - Failed with exception " + e.ToString()); - } - } - #endregion - - #region Primitives Methods - - /// - /// Sends prims to a client - /// - /// Client to send to - public void GetInitialPrims(ClientView RemoteClient) - { - try - { - foreach (libsecondlife.LLUUID UUID in Entities.Keys) - { - if (Entities[UUID] is Primitive) - { - Primitive primitive = Entities[UUID] as Primitive; - primitive.UpdateClient(RemoteClient); - } - } - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: GetInitialPrims() - Failed with exception " + e.ToString()); - } - } - - /// - /// Loads the World's objects - /// - public void LoadPrimsFromStorage() - { - try - { - MainConsole.Instance.Notice("World.cs: LoadPrimsFromStorage() - Loading primitives"); - this.localStorage.LoadPrimitives(this); - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: LoadPrimsFromStorage() - Failed with exception " + e.ToString()); - } - } - - /// - /// Loads a specific object from storage - /// - /// The object to load - public void PrimFromStorage(PrimData prim) - { - try - { - if (prim.LocalID >= this._primCount) - { - _primCount = prim.LocalID + 1; - } - MainConsole.Instance.Notice("World.cs: PrimFromStorage() - Reloading prim (localId " + prim.LocalID + " ) from storage"); - Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this); - nPrim.CreateFromStorage(prim); - this.Entities.Add(nPrim.uuid, nPrim); - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: PrimFromStorage() - Failed with exception " + e.ToString()); - } - } - - public void AddNewPrim(Packet addPacket, ClientView agentClient) - { - AddNewPrim((ObjectAddPacket)addPacket, agentClient.AgentID); - } - - public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID) - { - try - { - MainConsole.Instance.Notice("World.cs: AddNewPrim() - Creating new prim"); - Primitive prim = new Primitive(m_clientThreads, m_regionHandle, this); - prim.CreateFromPacket(addPacket, ownerID, this._primCount); - PhysicsVector pVec = new PhysicsVector(prim.Pos.X, prim.Pos.Y, prim.Pos.Z); - PhysicsVector pSize = new PhysicsVector(0.255f, 0.255f, 0.255f); - if (OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying) - { - lock (this.LockPhysicsEngine) - { - prim.PhysActor = this.phyScene.AddPrim(pVec, pSize); - } - } - - this.Entities.Add(prim.uuid, prim); - this._primCount++; - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: AddNewPrim() - Failed with exception " + e.ToString()); - } - } - - #endregion - - #region Add/Remove Avatar Methods - - public override Avatar AddViewerAgent(ClientView agentClient) - { - //register for events - agentClient.OnChatFromViewer += new ChatFromViewer(this.SimChat); - agentClient.OnRezObject += new RezObject(this.RezObject); - agentClient.OnModifyTerrain += new ModifyTerrain(this.ModifyTerrain); - agentClient.OnRegionHandShakeReply += new ClientView.GenericCall(this.SendLayerData); - agentClient.OnRequestWearables += new ClientView.GenericCall(this.GetInitialPrims); - agentClient.OnRequestAvatarsData += new ClientView.GenericCall(this.SendAvatarsToClient); - agentClient.OnLinkObjects += new LinkObjects(this.LinkObjects); - agentClient.OnAddPrim += new ClientView.GenericCall4(this.AddNewPrim); - agentClient.OnUpdatePrimShape += new ClientView.UpdateShape(this.UpdatePrimShape); - - agentClient.OnObjectSelect += new ClientView.ObjectSelect(this.SelectPrim); - agentClient.OnUpdatePrimFlags += new ClientView.UpdatePrimFlags(this.UpdatePrimFlags); - agentClient.OnUpdatePrimTexture += new ClientView.UpdatePrimTexture(this.UpdatePrimTexture); - agentClient.OnUpdatePrimPosition += new ClientView.UpdatePrimVector(this.UpdatePrimPosition); - agentClient.OnUpdatePrimRotation += new ClientView.UpdatePrimRotation(this.UpdatePrimRotation); - agentClient.OnUpdatePrimScale += new ClientView.UpdatePrimVector(this.UpdatePrimScale); - agentClient.OnDeRezObject += new ClientView.GenericCall4(this.DeRezObject); - - agentClient.OnParcelPropertiesRequest += new OpenSim.RegionServer.Simulator.ParcelPropertiesRequest(ParcelPropertiesRequest); - agentClient.OnParcelDivideRequest += new OpenSim.RegionServer.Simulator.ParcelDivideRequest(ParcelDivideRequest); - agentClient.OnParcelJoinRequest+=new OpenSim.RegionServer.Simulator.ParcelJoinRequest(ParcelJoinRequest); - agentClient.OnParcelPropertiesUpdateRequest += new OpenSim.RegionServer.Simulator.ParcelPropertiesUpdateRequest(ParcelPropertiesUpdateRequest); - - Avatar newAvatar = null; - try - { - MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); - newAvatar = new Avatar(agentClient, this); - MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Adding new avatar to world"); - MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Starting RegionHandshake "); - estateManager.sendRegionHandshake(newAvatar.ControllingClient); - - PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); - lock (this.LockPhysicsEngine) - { - newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); - } - - - lock (Entities) - { - if (!Entities.ContainsKey(agentClient.AgentID)) - { - this.Entities.Add(agentClient.AgentID, newAvatar); - } - else - { - Entities[agentClient.AgentID] = newAvatar; - } - } - lock (Avatars) - { - if (Avatars.ContainsKey(agentClient.AgentID)) - { - Avatars[agentClient.AgentID] = newAvatar; - } - else - { - this.Avatars.Add(agentClient.AgentID, newAvatar); - } - } - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: AddViewerAgent() - Failed with exception " + e.ToString()); - } - return newAvatar; - } - - - - - - - - public override void RemoveViewerAgent(ClientView agentClient) - { - try - { - lock (Entities) - { - Entities.Remove(agentClient.AgentID); - } - lock (Avatars) - { - Avatars.Remove(agentClient.AgentID); - } - if (agentClient.ClientAvatar.PhysActor != null) - { - this.phyScene.RemoveAvatar(agentClient.ClientAvatar.PhysActor); - } - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: RemoveViewerAgent() - Failed with exception " + e.ToString()); - } - } - #endregion - - #region Request Avatars List Methods - //The idea is to have a group of method that return a list of avatars meeting some requirement - // ie it could be all Avatars within a certain range of the calling prim/avatar. - - public List RequestAvatarList() - { - List result = new List(); - - foreach (Avatar avatar in Avatars.Values) - { - result.Add(avatar); - } - - return result; - } - #endregion - - #region ShutDown - /// - /// Tidy before shutdown - /// - public override void Close() - { - try - { - this.localStorage.ShutDown(); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Error("World.cs: Close() - Failed with exception " + e.ToString()); - } - } - #endregion - - } -} diff --git a/OpenSim/OpenSim.RegionServer/Simulator/WorldBase.cs b/OpenSim/OpenSim.RegionServer/Simulator/WorldBase.cs deleted file mode 100644 index c09ddd0..0000000 --- a/OpenSim/OpenSim.RegionServer/Simulator/WorldBase.cs +++ /dev/null @@ -1,205 +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 libsecondlife; -using libsecondlife.Packets; -using System.Collections.Generic; -using System.Text; -using System.Reflection; -using System.IO; -using System.Threading; -using OpenSim.Physics.Manager; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Terrain; -using OpenSim.Framework.Inventory; -using OpenSim.RegionServer.Assets; -using OpenSim.RegionServer.Scripting; -using OpenSim.RegionServer.Client; -using OpenSim.Terrain; -using OpenSim.Framework.Console; - -namespace OpenSim.RegionServer.Simulator -{ - public class WorldBase - { - public Dictionary Entities; - protected Dictionary m_clientThreads; - protected ulong m_regionHandle; - protected string m_regionName; - protected InventoryCache _inventoryCache; - protected AssetCache _assetCache; - public RegionInfo m_regInfo; - - public TerrainEngine Terrain; //TODO: Replace TerrainManager with this. - protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine - - #region Properties - public InventoryCache InventoryCache - { - set - { - this._inventoryCache = value; - } - } - - public AssetCache AssetCache - { - set - { - this._assetCache = value; - } - } - #endregion - - #region Constructors - public WorldBase() - { - - } - #endregion - - #region Setup Methods - /// - /// Register Packet handler Methods with the packet server (which will register them with the SimClient) - /// - /// - public virtual void RegisterPacketHandlers(PacketServer packetServer) - { - - } - #endregion - - #region Update Methods - /// - /// Normally called once every frame/tick to let the world preform anything required (like running the physics simulation) - /// - public virtual void Update() - { - - } - #endregion - - #region Terrain Methods - - /// - /// Loads the World heightmap - /// - public virtual void LoadWorldMap() - { - - } - - /// - /// Send the region heightmap to the client - /// - /// Client to send to - public virtual void SendLayerData(ClientView RemoteClient) - { - try - { - int[] patches = new int[4]; - - for (int y = 0; y < 16; y++) - { - for (int x = 0; x < 16; x = x + 4) - { - patches[0] = x + 0 + y * 16; - patches[1] = x + 1 + y * 16; - patches[2] = x + 2 + y * 16; - patches[3] = x + 3 + y * 16; - - Packet layerpack = TerrainManager.CreateLandPacket(Terrain.getHeights1D(), patches); - RemoteClient.OutPacket(layerpack); - } - } - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: SendLayerData() - Failed with exception " + e.ToString()); - } - } - - /// - /// Sends a specified patch to a client - /// - /// Patch coordinate (x) 0..16 - /// Patch coordinate (y) 0..16 - /// The client to send to - public void SendLayerData(int px, int py, ClientView RemoteClient) - { - try - { - int[] patches = new int[1]; - int patchx, patchy; - patchx = px / 16; - patchy = py / 16; - - patches[0] = patchx + 0 + patchy * 16; - - Packet layerpack = TerrainManager.CreateLandPacket(Terrain.getHeights1D(), patches); - RemoteClient.OutPacket(layerpack); - } - catch (Exception e) - { - MainConsole.Instance.Warn("World.cs: SendLayerData() - Failed with exception " + e.ToString()); - } - } - #endregion - - #region Add/Remove Agent/Avatar - /// - /// Add a new Agent's avatar - /// - /// - public virtual Avatar AddViewerAgent(ClientView agentClient) - { - return null; - } - - /// - /// Remove a Agent's avatar - /// - /// - public virtual void RemoveViewerAgent(ClientView agentClient) - { - - } - #endregion - - #region Shutdown - /// - /// Tidy before shutdown - /// - public virtual void Close() - { - - } - #endregion - } -} diff --git a/OpenSim/OpenSim.RegionServer/Types/Mesh.cs b/OpenSim/OpenSim.RegionServer/Types/Mesh.cs deleted file mode 100644 index 4c8acab..0000000 --- a/OpenSim/OpenSim.RegionServer/Types/Mesh.cs +++ /dev/null @@ -1,55 +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.RegionServer.Types -{ - // TODO: This will need some performance tuning no doubt. - public class Mesh - { - public List mesh; - - public Mesh() - { - mesh = new List(); - } - - public void AddTri(Triangle tri) - { - mesh.Add(tri); - } - - public static Mesh operator +(Mesh a, Mesh b) - { - a.mesh.AddRange(b.mesh); - return a; - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/Types/Triangle.cs b/OpenSim/OpenSim.RegionServer/Types/Triangle.cs deleted file mode 100644 index ffb62e5..0000000 --- a/OpenSim/OpenSim.RegionServer/Types/Triangle.cs +++ /dev/null @@ -1,55 +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 Axiom.MathLib; - -namespace OpenSim.RegionServer.Types -{ - public class Triangle - { - Vector3 a; - Vector3 b; - Vector3 c; - - public Triangle() - { - a = new Vector3(); - b = new Vector3(); - c = new Vector3(); - } - - public Triangle(Vector3 A, Vector3 B, Vector3 C) - { - a = A; - b = B; - c = C; - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/UDPServer.cs b/OpenSim/OpenSim.RegionServer/UDPServer.cs deleted file mode 100644 index ae62607..0000000 --- a/OpenSim/OpenSim.RegionServer/UDPServer.cs +++ /dev/null @@ -1,265 +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.Terrain; - -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Console; - -using OpenSim.UserServer; - -using OpenSim.RegionServer.Simulator; -using OpenSim.RegionServer.Assets; -using OpenSim.RegionServer.CAPS; -using OpenSim.RegionServer.Client; - -using Nwc.XmlRpc; -using OpenSim.Servers; -using OpenSim.GenericConfig; - -namespace OpenSim.RegionServer -{ - public delegate AuthenticateResponse AuthenticateSessionHandler(LLUUID sessionID, LLUUID agentID, uint circuitCode); - - public class UDPServer : OpenSimNetworkHandler - { - protected Dictionary clientCircuits = new Dictionary(); - private 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 PacketServer _packetServer; - - protected int listenPort; - protected Grid m_gridServers; - protected World m_localWorld; - protected AssetCache m_assetCache; - protected InventoryCache m_inventoryCache; - protected RegionInfo m_regionData; - protected bool m_sandbox = false; - protected bool user_accounts = false; - protected ConsoleBase m_console; - protected AuthenticateSessionsBase m_authenticateSessionsClass; - - public AuthenticateSessionHandler AuthenticateHandler; - - public PacketServer PacketServer - { - get - { - return _packetServer; - } - set - { - _packetServer = value; - } - } - - public World LocalWorld - { - set - { - this.m_localWorld = value; - this._packetServer.LocalWorld = this.m_localWorld; - } - } - - public UDPServer() - { - } - - public UDPServer(int port, Grid gridServers, AssetCache assetCache, InventoryCache inventoryCache, RegionInfo _regionData, bool sandbox, bool accounts, ConsoleBase console, AuthenticateSessionsBase authenticateClass) - { - listenPort = port; - this.m_gridServers = gridServers; - this.m_assetCache = assetCache; - this.m_inventoryCache = inventoryCache; - this.m_regionData = _regionData; - this.m_sandbox = sandbox; - this.user_accounts = accounts; - this.m_console = console; - this.m_authenticateSessionsClass = authenticateClass; - this.CreatePacketServer(); - - //set up delegate for authenticate sessions - this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_authenticateSessionsClass.AuthenticateSession); - } - - protected virtual void CreatePacketServer() - { - PacketServer packetServer = new PacketServer(this); - } - - protected virtual void OnReceivedData(IAsyncResult result) - { - ipeSender = new IPEndPoint(IPAddress.Any, 0); - epSender = (EndPoint)ipeSender; - Packet packet = null; - - int numBytes; - - try - { - numBytes = Server.EndReceiveFrom(result, ref epSender); - } - catch (SocketException e) - { - switch( e.SocketErrorCode ) - { - case SocketError.NotConnected: - case SocketError.ConnectionReset: - // At this point, we should clear the client connection altogether. - // The app should hook a disconnect event into the UDPServer. - // But for now, just ignore it. - return; - default: - throw; - } - } - - int packetEnd = numBytes - 1; - - packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); - - // do we already have a circuit for this endpoint - if (this.clientCircuits.ContainsKey(epSender)) - { - //if so then send packet to the packetserver - this._packetServer.ClientInPacket(this.clientCircuits[epSender], packet); - } - else if (packet.Type == PacketType.UseCircuitCode) - { - // new client - this.AddNewClient(packet); - } - else - { // invalid client - Console.Error.WriteLine("UDPServer.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString()); - } - - Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); - } - - protected virtual void AddNewClient(Packet packet) - { - UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet; - this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); - bool isChildAgent = false; - - ClientView newuser = new ClientView(epSender, useCircuit, m_localWorld, _packetServer.ClientThreads, m_assetCache, m_gridServers.GridServer, this, m_inventoryCache, m_sandbox, isChildAgent, this.m_regionData, m_authenticateSessionsClass); - if ((this.m_gridServers.UserServer != null) && (user_accounts)) - { - newuser.UserServer = this.m_gridServers.UserServer; - } - //OpenSimRoot.Instance.ClientThreads.Add(epSender, newuser); - this._packetServer.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser); - } - - public void ServerListener() - { - m_console.Notice("UDPServer.cs:ServerListener() - Opening UDP socket on " + listenPort); - - 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); - - m_console.Notice("UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen"); - - 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); - - m_console.Notice("UDPServer.cs:ServerListener() - Listening..."); - - } - - public virtual void RegisterPacketServer(PacketServer server) - { - this._packetServer = server; - } - - public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)//EndPoint packetSender) - { - // find the endpoint for this circuit - EndPoint sendto = null; - foreach (KeyValuePair p in this.clientCircuits) - { - if (p.Value == circuitcode) - { - sendto = p.Key; - break; - } - } - if (sendto != null) - { - //we found the endpoint so send the packet to it - this.Server.SendTo(buffer, size, flags, sendto); - } - } - - public virtual void RemoveClientCircuit(uint circuitcode) - { - foreach (KeyValuePair p in this.clientCircuits) - { - if (p.Value == circuitcode) - { - this.clientCircuits.Remove(p.Key); - break; - } - } - } - - public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode) - { - return this.AuthenticateHandler(sessionID, agentID, circuitCode); - } - } -} diff --git a/OpenSim/OpenSim.RegionServer/VersionInfo.cs b/OpenSim/OpenSim.RegionServer/VersionInfo.cs deleted file mode 100644 index 5e0eed6..0000000 --- a/OpenSim/OpenSim.RegionServer/VersionInfo.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; - -namespace OpenSim.RegionServer -{ - /// - /// - public class VersionInfo - { - public static string Version = "0.2, SVN build - please use releng if you desire any form of support"; - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassInstance.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassInstance.cs deleted file mode 100644 index 1d93197..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassInstance.cs +++ /dev/null @@ -1,45 +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 OpenSim.Scripting.EmbeddedJVM.Types; - -namespace OpenSim.Scripting.EmbeddedJVM -{ - public class ClassInstance : Object - { - public int size; - public Dictionary Fields = new Dictionary(); - - public ClassInstance() - { - - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassRecord.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassRecord.cs deleted file mode 100644 index f4ab1a2..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassRecord.cs +++ /dev/null @@ -1,503 +0,0 @@ -/* -* Copyright (c) Contributors, http://www.openmetaverse.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ -using System; -using System.IO; -using System.Collections.Generic; -using System.Text; -using OpenSim.Scripting.EmbeddedJVM.Types; - -namespace OpenSim.Scripting.EmbeddedJVM -{ - public class ClassRecord - { - private ushort _majorVersion; - private ushort _minorVersion; - private ushort _constantPoolCount; - private ushort _accessFlags; - private ushort _thisClass; - private ushort _supperClass; - private ushort _interfaceCount; - private ushort _fieldCount; - private ushort _methodCount; - //private ushort _attributeCount; - //private string _name; - public Dictionary StaticFields = new Dictionary(); - public PoolClass mClass; - - public List _constantsPool = new List(); - private List _methodsList = new List(); - private List _fieldList = new List(); - - public ClassRecord() - { - - } - - public ClassInstance CreateNewInstance() - { - return new ClassInstance(); - } - - public void LoadClassFromFile(string fileName) - { - Console.WriteLine("loading script " + fileName); - FileStream fs = File.OpenRead(fileName); - this.LoadClassFromBytes(ReadFully(fs)); - fs.Close(); - } - - public void LoadClassFromBytes(byte[] data) - { - int i = 0; - i += 4; - _minorVersion = (ushort)((data[i++] << 8) + data[i++] ); - _majorVersion = (ushort)((data[i++] << 8) + data[i++] ); - _constantPoolCount = (ushort)((data[i++] << 8) + data[i++] ); - // Console.WriteLine("there should be " + _constantPoolCount + " items in the pool"); - for (int count = 0; count < _constantPoolCount -1 ; count++) - { - //read in the constant pool - byte pooltype = data[i++]; - //Console.WriteLine("#" +count +": new constant type = " +pooltype); - //Console.WriteLine("start position is: " + i); - switch (pooltype) - { - case 1: //Utf8 - ushort uLength = (ushort)((data[i++] << 8) + data[i++] ); - - // Console.WriteLine("new utf8 type, length is " + uLength); - PoolUtf8 utf8 = new PoolUtf8(); - utf8.readValue(data, ref i, uLength); - this._constantsPool.Add(utf8); - break; - case 3: //Int - break; - case 7: //Class - PoolClass pClass = new PoolClass(this); - pClass.readValue(data, ref i); - this._constantsPool.Add(pClass); - break; - case 10: //Method - PoolMethodRef pMeth = new PoolMethodRef(this); - pMeth.readValue(data, ref i); - this._constantsPool.Add(pMeth); - break; - case 12: //NamedType - PoolNamedType pNamed = new PoolNamedType(this); - pNamed.readValue(data, ref i); - this._constantsPool.Add(pNamed); - break; - } - } - - _accessFlags = (ushort)((data[i++] << 8) + data[i++] ); - _thisClass = (ushort)((data[i++] << 8) + data[i++] ); - _supperClass = (ushort)((data[i++] << 8) + data[i++] ); - - if (this._constantsPool[this._thisClass - 1] is PoolClass) - { - this.mClass = ((PoolClass)this._constantsPool[this._thisClass - 1]); - } - - _interfaceCount = (ushort)((data[i++] << 8) + data[i++]); - //should now read in the info for each interface - _fieldCount = (ushort)((data[i++] << 8) + data[i++]); - //should now read in the info for each field - _methodCount = (ushort)((data[i++] << 8) + data[i++]); - for (int count = 0; count < _methodCount; count++) - { - MethodInfo methInf = new MethodInfo(this); - methInf.ReadData(data, ref i); - this._methodsList.Add(methInf); - } - } - - public void AddMethodsToMemory(MethodMemory memory) - { - for (int count = 0; count < _methodCount; count++) - { - this._methodsList[count].AddMethodCode(memory); - } - } - - public bool StartMethod(Thread thread, string methodName) - { - for (int count = 0; count < _methodCount; count++) - { - if (this._constantsPool[this._methodsList[count].NameIndex-1] is PoolUtf8) - { - if (((PoolUtf8)this._constantsPool[this._methodsList[count].NameIndex-1]).Value == methodName) - { - //Console.WriteLine("found method: " + ((PoolUtf8)this._constantsPool[this._methodsList[count].NameIndex - 1]).Value); - thread.SetPC(this._methodsList[count].CodePointer); - return true; - } - } - } - return false; - } - - public void PrintToConsole() - { - Console.WriteLine("Class File:"); - Console.WriteLine("Major version: " + _majorVersion); - Console.WriteLine("Minor version: " + _minorVersion); - Console.WriteLine("Pool size: " + _constantPoolCount); - - for (int i = 0; i < _constantsPool.Count; i++) - { - this._constantsPool[i].Print(); - } - - Console.WriteLine("Access flags: " + _accessFlags); - Console.WriteLine("This class: " + _thisClass ); - Console.WriteLine("Super class: " + _supperClass); - - for (int count = 0; count < _methodCount; count++) - { - Console.WriteLine(); - this._methodsList[count].Print(); - } - - Console.WriteLine("class name is " + this.mClass.Name.Value); - } - - public static byte[] ReadFully(Stream stream) - { - byte[] buffer = new byte[1024]; - using (MemoryStream ms = new MemoryStream()) - { - while (true) - { - int read = stream.Read(buffer, 0, buffer.Length); - if (read <= 0) - return ms.ToArray(); - ms.Write(buffer, 0, read); - } - } - } - - #region nested classes - public class PoolItem - { - public virtual void Print() - { - - } - } - - public class PoolUtf8 : PoolItem - { - public string Value = ""; - - public void readValue(byte[] data,ref int pointer , int length) - { - for (int i = 0; i < length; i++) - { - int a =(int) data[pointer++]; - if ((a & 0x80) == 0) - { - Value = Value + (char)a; - } - else if ((a & 0x20) == 0) - { - int b = (int) data[pointer++]; - Value = Value + (char)(((a & 0x1f) << 6) + (b & 0x3f)); - } - else - { - int b = (int)data[pointer++]; - int c = (int)data[pointer++]; - Value = Value + (char)(((a & 0xf) << 12) + ((b & 0x3f) << 6) + (c & 0x3f)); - } - } - } - - public override void Print() - { - Console.WriteLine("Utf8 type: " + Value); - } - } - - private class PoolInt : PoolItem - { - - } - - public class PoolClass : PoolItem - { - //public string name = ""; - public ushort namePointer = 0; - private ClassRecord parent; - public PoolUtf8 Name; - - public PoolClass(ClassRecord paren) - { - parent = paren; - } - - public void readValue(byte[] data, ref int pointer) - { - namePointer = (ushort)((data[pointer++] << 8) + data[pointer++] ); - } - - public override void Print() - { - this.Name = ((PoolUtf8)this.parent._constantsPool[namePointer - 1]); - Console.Write("Class type: " + namePointer); - Console.WriteLine(" // " + ((PoolUtf8)this.parent._constantsPool[namePointer - 1]).Value); - - } - } - - public class PoolMethodRef : PoolItem - { - public ushort classPointer = 0; - public ushort nameTypePointer = 0; - public PoolNamedType mNameType; - public PoolClass mClass; - private ClassRecord parent; - - public PoolMethodRef(ClassRecord paren) - { - parent = paren; - } - - public void readValue(byte[] data, ref int pointer) - { - classPointer = (ushort)((data[pointer++] << 8) + data[pointer++]); - nameTypePointer = (ushort)((data[pointer++] << 8) + data[pointer++]); - } - - public override void Print() - { - this.mNameType = ((PoolNamedType)this.parent._constantsPool[nameTypePointer - 1]); - this.mClass = ((PoolClass)this.parent._constantsPool[classPointer - 1]); - Console.WriteLine("MethodRef type: " + classPointer + " , " + nameTypePointer); - } - } - - public class PoolNamedType : PoolItem - { - public ushort namePointer = 0; - public ushort typePointer = 0; - private ClassRecord parent; - public PoolUtf8 Name; - public PoolUtf8 Type; - - public PoolNamedType(ClassRecord paren) - { - parent = paren; - } - - public void readValue(byte[] data, ref int pointer) - { - namePointer = (ushort)((data[pointer++] << 8) + data[pointer++] ); - typePointer = (ushort)((data[pointer++] << 8) + data[pointer++] ); - } - - public override void Print() - { - Name = ((PoolUtf8)this.parent._constantsPool[namePointer-1]); - Type = ((PoolUtf8)this.parent._constantsPool[typePointer-1]); - Console.Write("Named type: " + namePointer + " , " + typePointer ); - Console.WriteLine(" // "+ ((PoolUtf8)this.parent._constantsPool[namePointer-1]).Value); - } - } - - //*********************** - public class MethodInfo - { - public ushort AccessFlags = 0; - public ushort NameIndex = 0; - public string Name = ""; - public ushort DescriptorIndex = 0; - public ushort AttributeCount = 0; - public List Attributes = new List(); - private ClassRecord parent; - public int CodePointer = 0; - - public MethodInfo(ClassRecord paren) - { - parent = paren; - } - - public void AddMethodCode(MethodMemory memory) - { - Array.Copy(this.Attributes[0].Code, 0, memory.MethodBuffer, memory.NextMethodPC, this.Attributes[0].Code.Length); - memory.Methodcount++; - this.CodePointer = memory.NextMethodPC; - memory.NextMethodPC += this.Attributes[0].Code.Length; - } - - public void ReadData(byte[] data, ref int pointer) - { - AccessFlags = (ushort)((data[pointer++] << 8) + data[pointer++]); - NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]); - DescriptorIndex = (ushort)((data[pointer++] << 8) + data[pointer++]); - AttributeCount = (ushort)((data[pointer++] << 8) + data[pointer++]); - for(int i =0; i< AttributeCount; i++) - { - MethodAttribute attri = new MethodAttribute(this.parent); - attri.ReadData(data, ref pointer); - this.Attributes.Add(attri); - } - } - - public void Print() - { - Console.WriteLine("Method Info Struct: "); - Console.WriteLine("AccessFlags: " + AccessFlags); - Console.WriteLine("NameIndex: " + NameIndex +" // "+ ((PoolUtf8)this.parent._constantsPool[NameIndex-1]).Value); - Console.WriteLine("DescriptorIndex: " + DescriptorIndex + " // "+ ((PoolUtf8)this.parent._constantsPool[DescriptorIndex-1]).Value); - Console.WriteLine("Attribute Count:" + AttributeCount); - for (int i = 0; i < AttributeCount; i++) - { - this.Attributes[i].Print(); - } - } - - public class MethodAttribute - { - public ushort NameIndex = 0; - public string Name = ""; - public Int32 Length = 0; - //for now only support code attribute - public ushort MaxStack = 0; - public ushort MaxLocals = 0; - public Int32 CodeLength = 0; - public byte[] Code; - public ushort ExceptionTableLength = 0; - public ushort SubAttributeCount = 0; - public List SubAttributes = new List(); - private ClassRecord parent; - - public MethodAttribute(ClassRecord paren) - { - parent = paren; - } - - public void ReadData(byte[] data, ref int pointer) - { - NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]); - Length = (Int32)((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]); - MaxStack = (ushort)((data[pointer++] << 8) + data[pointer++]); - MaxLocals = (ushort)((data[pointer++] << 8) + data[pointer++]); - CodeLength = (Int32)((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]); - Code = new byte[CodeLength]; - for (int i = 0; i < CodeLength; i++) - { - Code[i] = data[pointer++]; - } - ExceptionTableLength = (ushort)((data[pointer++] << 8) + data[pointer++]); - SubAttributeCount = (ushort)((data[pointer++] << 8) + data[pointer++]); - for (int i = 0; i < SubAttributeCount; i++) - { - SubAttribute subAttri = new SubAttribute(this.parent); - subAttri.ReadData(data, ref pointer); - this.SubAttributes.Add(subAttri); - } - } - - public void Print() - { - Console.WriteLine("Method Attribute: "); - Console.WriteLine("Name Index: " + NameIndex + " // "+ ((PoolUtf8)this.parent._constantsPool[NameIndex-1]).Value); - Console.WriteLine("Length: " + Length); - Console.WriteLine("MaxStack: " + MaxStack); - Console.WriteLine("MaxLocals: " + MaxLocals); - Console.WriteLine("CodeLength: " + CodeLength); - for (int i = 0; i < Code.Length; i++) - { - Console.WriteLine("OpCode #" + i + " is: " + Code[i]); - } - Console.WriteLine("SubAttributes: " + SubAttributeCount); - for (int i = 0; i < SubAttributeCount; i++) - { - this.SubAttributes[i].Print(); - } - } - - public class SubAttribute - { - public ushort NameIndex = 0; - public string Name = ""; - public Int32 Length = 0; - public byte[] Data; - private ClassRecord parent; - - public SubAttribute(ClassRecord paren) - { - parent = paren; - } - - public void ReadData(byte[] data, ref int pointer) - { - NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]); - Length = (Int32)((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]); - Data = new byte[Length]; - for (int i = 0; i < Length; i++) - { - Data[i] = data[pointer++]; - } - } - - public void Print() - { - Console.WriteLine("SubAttribute: NameIndex: " + NameIndex + " // " + ((PoolUtf8)this.parent._constantsPool[NameIndex - 1]).Value); - } - - } - } - - } - private class InterfaceInfo - { - public void ReadData(byte[] data, ref int i) - { - - } - } - private class FieldInfo - { - public void ReadData(byte[] data, ref int i) - { - - } - } - private class AttributeInfo - { - public void ReadData(byte[] data, ref int i) - { - - } - } - #endregion - - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Heap.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Heap.cs deleted file mode 100644 index f213c36..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Heap.cs +++ /dev/null @@ -1,43 +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.Scripting.EmbeddedJVM -{ - public class Heap - { - public List ClassObjects = new List(); - - public Heap() - { - - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Interpreter.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Interpreter.cs deleted file mode 100644 index c5995b2..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Interpreter.cs +++ /dev/null @@ -1,135 +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 OpenSim.Scripting.EmbeddedJVM.Types; -using OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes; - -namespace OpenSim.Scripting.EmbeddedJVM -{ - partial class Thread - { - private partial class Interpreter - { - private Thread _mThread; - - public Interpreter(Thread parentThread) - { - _mThread = parentThread; - } - - public bool Excute() - { - bool run = true; - byte currentOpCode = GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC++]; - // Console.WriteLine("opCode is: " + currentOpCode); - bool handled = false; - - handled = this.IsLogicOpCode(currentOpCode); - if (!handled) - { - handled = this.IsMethodOpCode(currentOpCode); - } - if (!handled) - { - if (currentOpCode == 172) - { - if (this._mThread.stack.StackFrames.Count > 1) - { - Console.WriteLine("returning int from function"); - int retPC1 = this._mThread.currentFrame.ReturnPC; - BaseType bas1 = this._mThread.currentFrame.OpStack.Pop(); - this._mThread.stack.StackFrames.Pop(); - this._mThread.currentFrame = this._mThread.stack.StackFrames.Peek(); - this._mThread.PC = retPC1; - if (bas1 is Int) - { - this._mThread.currentFrame.OpStack.Push((Int)bas1); - } - } - else - { - // Console.WriteLine("No parent function so ending program"); - this._mThread.stack.StackFrames.Pop(); - run = false; - } - handled = true; - } - if (currentOpCode == 174) - { - if (this._mThread.stack.StackFrames.Count > 1) - { - Console.WriteLine("returning float from function"); - int retPC1 = this._mThread.currentFrame.ReturnPC; - BaseType bas1 = this._mThread.currentFrame.OpStack.Pop(); - this._mThread.stack.StackFrames.Pop(); - this._mThread.currentFrame = this._mThread.stack.StackFrames.Peek(); - this._mThread.PC = retPC1; - if (bas1 is Float) - { - this._mThread.currentFrame.OpStack.Push((Float)bas1); - } - } - else - { - // Console.WriteLine("No parent function so ending program"); - this._mThread.stack.StackFrames.Pop(); - run = false; - } - handled = true; - } - if (currentOpCode == 177) - { - if (this._mThread.stack.StackFrames.Count > 1) - { - Console.WriteLine("returning from function"); - int retPC = this._mThread.currentFrame.ReturnPC; - this._mThread.stack.StackFrames.Pop(); - this._mThread.currentFrame = this._mThread.stack.StackFrames.Peek(); - this._mThread.PC = retPC; - } - else - { - // Console.WriteLine("No parent function so ending program"); - this._mThread.stack.StackFrames.Pop(); - run = false; - } - handled = true; - } - } - if (!handled) - { - Console.WriteLine("opcode " + currentOpCode + " not been handled "); - } - return run; - - } - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterLogic.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterLogic.cs deleted file mode 100644 index 2a11afd..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterLogic.cs +++ /dev/null @@ -1,427 +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 OpenSim.Scripting.EmbeddedJVM.Types; -using OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes; - -namespace OpenSim.Scripting.EmbeddedJVM -{ - partial class Thread - { - private partial class Interpreter - { - private bool IsLogicOpCode(byte opcode) - { - bool result = false; - switch (opcode) - { - case 2: - Int m_int= new Int(); - m_int.mValue = -1; - this._mThread.currentFrame.OpStack.Push(m_int); - result = true; - break; - case 3: - m_int= new Int(); - m_int.mValue = 0; - this._mThread.currentFrame.OpStack.Push(m_int); - result = true; - break; - case 4: - m_int = new Int(); - m_int.mValue = 1; - this._mThread.currentFrame.OpStack.Push(m_int); - result = true; - break; - case 5: - m_int = new Int(); - m_int.mValue = 2; - this._mThread.currentFrame.OpStack.Push(m_int); - result = true; - break; - case 6: - m_int = new Int(); - m_int.mValue = 3; - this._mThread.currentFrame.OpStack.Push(m_int); - break; - case 7: - m_int = new Int(); - m_int.mValue = 4; - this._mThread.currentFrame.OpStack.Push(m_int); - result = true; - break; - case 8: - m_int = new Int(); - m_int.mValue = 5; - this._mThread.currentFrame.OpStack.Push(m_int); - result = true; - break; - case 11: - Float m_float = new Float(); - m_float.mValue = 0.0f; - this._mThread.currentFrame.OpStack.Push(m_float); - result = true; - break; - case 12: - m_float = new Float(); - m_float.mValue = 1.0f; - this._mThread.currentFrame.OpStack.Push(m_float); - result = true; - break; - case 13: - m_float = new Float(); - m_float.mValue = 2.0f; - this._mThread.currentFrame.OpStack.Push(m_float); - result = true; - break; - case 16: - int pushvalue = (int)GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC]; - Int pushInt = new Int(); - pushInt.mValue = pushvalue; - this._mThread.currentFrame.OpStack.Push(pushInt); - this._mThread.PC++; - result = true; - break; - case 17: - short pushvalue2 = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC + 1]); - Int pushInt2 = new Int(); - pushInt2.mValue = pushvalue2; - this._mThread.currentFrame.OpStack.Push(pushInt2); - this._mThread.PC += 2; - result = true; - break; - case 23: - short findex1 = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC])); - Float fload = new Float(); - if (this._mThread.currentFrame.LocalVariables[findex1] != null) - { - if (this._mThread.currentFrame.LocalVariables[findex1] is Float) - { - fload.mValue = ((Float)this._mThread.currentFrame.LocalVariables[findex1]).mValue; - this._mThread.currentFrame.OpStack.Push(fload); - } - } - this._mThread.PC++; - result = true; - break; - case 26: - if (this._mThread.currentFrame.LocalVariables[0] != null) - { - if (this._mThread.currentFrame.LocalVariables[0] is Int) - { - Int newInt = new Int(); - newInt.mValue = ((Int)this._mThread.currentFrame.LocalVariables[0]).mValue; - this._mThread.currentFrame.OpStack.Push(newInt); - } - } - result = true; - break; - case 27: - if (this._mThread.currentFrame.LocalVariables[1] != null) - { - if (this._mThread.currentFrame.LocalVariables[1] is Int) - { - Int newInt = new Int(); - newInt.mValue = ((Int)this._mThread.currentFrame.LocalVariables[1]).mValue; - this._mThread.currentFrame.OpStack.Push(newInt); - } - } - result = true; - break; - case 34: - if (this._mThread.currentFrame.LocalVariables[0] != null) - { - if (this._mThread.currentFrame.LocalVariables[0] is Float) - { - Float newfloat = new Float(); - newfloat.mValue = ((Float)this._mThread.currentFrame.LocalVariables[0]).mValue; - this._mThread.currentFrame.OpStack.Push(newfloat); - } - } - result = true; - break; - case 35: - if (this._mThread.currentFrame.LocalVariables[1] != null) - { - if (this._mThread.currentFrame.LocalVariables[1] is Float) - { - Float newfloat = new Float(); - newfloat.mValue = ((Float)this._mThread.currentFrame.LocalVariables[1]).mValue; - this._mThread.currentFrame.OpStack.Push(newfloat); - } - } - result = true; - break; - case 36: - if (this._mThread.currentFrame.LocalVariables[2] != null) - { - if (this._mThread.currentFrame.LocalVariables[2] is Float) - { - Float newfloat = new Float(); - newfloat.mValue = ((Float)this._mThread.currentFrame.LocalVariables[2]).mValue; - this._mThread.currentFrame.OpStack.Push(newfloat); - } - } - result = true; - break; - case 37: - if (this._mThread.currentFrame.LocalVariables[3] != null) - { - if (this._mThread.currentFrame.LocalVariables[3] is Float) - { - Float newfloat = new Float(); - newfloat.mValue = ((Float)this._mThread.currentFrame.LocalVariables[3]).mValue; - this._mThread.currentFrame.OpStack.Push(newfloat); - } - } - result = true; - break; - case 56: - short findex = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] )); - BaseType fstor = this._mThread.currentFrame.OpStack.Pop(); - if (fstor is Float) - { - this._mThread.currentFrame.LocalVariables[findex] = (Float)fstor; - } - this._mThread.PC++; - result = true; - break; - case 59: - BaseType baset = this._mThread.currentFrame.OpStack.Pop(); - if (baset is Int) - { - this._mThread.currentFrame.LocalVariables[0] = (Int)baset; - } - result = true; - break; - case 60: - baset = this._mThread.currentFrame.OpStack.Pop(); - if (baset is Int) - { - this._mThread.currentFrame.LocalVariables[1] = (Int)baset; - } - result = true; - break; - case 67: - baset = this._mThread.currentFrame.OpStack.Pop(); - if (baset is Float) - { - this._mThread.currentFrame.LocalVariables[0] = (Float)baset; - } - result = true; - break; - case 68: - baset = this._mThread.currentFrame.OpStack.Pop(); - if (baset is Float) - { - this._mThread.currentFrame.LocalVariables[1] = (Float)baset; - } - result = true; - break; - case 69: - baset = this._mThread.currentFrame.OpStack.Pop(); - if (baset is Float) - { - this._mThread.currentFrame.LocalVariables[2] = (Float)baset; - } - result = true; - break; - case 70: - baset = this._mThread.currentFrame.OpStack.Pop(); - if (baset is Float) - { - this._mThread.currentFrame.LocalVariables[3] = (Float)baset; - } - result = true; - break; - case 87: - this._mThread.currentFrame.OpStack.Pop(); - result = true; - break; - case 98: - BaseType bf2 = this._mThread.currentFrame.OpStack.Pop(); - BaseType bf1 = this._mThread.currentFrame.OpStack.Pop(); - if (bf1 is Float && bf2 is Float) - { - Float nflt = new Float(); - nflt.mValue = ((Float)bf1).mValue + ((Float)bf2).mValue; - this._mThread.currentFrame.OpStack.Push(nflt); - } - result = true; - break; - case 102: - BaseType bsf2 = this._mThread.currentFrame.OpStack.Pop(); - BaseType bsf1 = this._mThread.currentFrame.OpStack.Pop(); - if (bsf1 is Float && bsf2 is Float) - { - Float resf = new Float(); - resf.mValue = ((Float)bsf1).mValue - ((Float)bsf2).mValue; - this._mThread.currentFrame.OpStack.Push(resf); - } - result = true; - break; - case 104: //check the order of the two values off the stack is correct - BaseType bs2 = this._mThread.currentFrame.OpStack.Pop(); - BaseType bs1 = this._mThread.currentFrame.OpStack.Pop(); - if (bs1 is Int && bs2 is Int) - { - Int nInt = new Int(); - nInt.mValue = ((Int)bs1).mValue * ((Int)bs2).mValue; - this._mThread.currentFrame.OpStack.Push(nInt); - } - result = true; - break; - case 132: - if (this._mThread.currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC]] != null) - { - if (this._mThread.currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC]] is Int) - { - ((Int)this._mThread.currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC]]).mValue += (sbyte) GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC + 1]; - } - } - this._mThread.PC += 2; - result = true; - break; - case 139: - BaseType conv1 = this._mThread.currentFrame.OpStack.Pop(); - if (conv1 is Float) - { - Int newconv = new Int(); - newconv.mValue = (int)((Float)conv1).mValue; - this._mThread.currentFrame.OpStack.Push(newconv); - } - result = true; - break; - case 149: - BaseType flcom2 = this._mThread.currentFrame.OpStack.Pop(); - BaseType flcom1 = this._mThread.currentFrame.OpStack.Pop(); - if (flcom1 is Float && flcom2 is Float) - { - Int compres = new Int(); - if (((Float)flcom1).mValue < ((Float)flcom2).mValue) - { - compres.mValue = -1; - } - else if (((Float)flcom1).mValue > ((Float)flcom2).mValue) - { - compres.mValue = 1; - } - else - { - compres.mValue = 0; - } - this._mThread.currentFrame.OpStack.Push(compres); - } - result = true; - break; - case 158: - short compareoffset1 = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC + 1]); - BaseType comp1 = this._mThread.currentFrame.OpStack.Pop(); - if (comp1 is Int) - { - if (((Int)comp1).mValue <= 0) - { - this._mThread.PC += -1 + compareoffset1; - } - else - { - this._mThread.PC += 2; - } - } - else - { - this._mThread.PC += 2; - } - result = true; - break; - case 162: - short compareoffset = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC + 1]); - BaseType bc2 = this._mThread.currentFrame.OpStack.Pop(); - BaseType bc1 = this._mThread.currentFrame.OpStack.Pop(); - if (bc1 is Int && bc2 is Int) - { - //Console.WriteLine("comparing " + ((Int)bc1).mValue + " and " + ((Int)bc2).mValue); - if (((Int)bc1).mValue >= ((Int)bc2).mValue) - { - // Console.WriteLine("branch compare true , offset is " +compareoffset); - // Console.WriteLine("current PC is " + this._mThread.PC); - this._mThread.PC += -1 + compareoffset; - //Console.WriteLine("new PC is " + this._mThread.PC); - } - else - { - //Console.WriteLine("branch compare false"); - this._mThread.PC += 2; - } - } - else - { - this._mThread.PC += 2; - } - result = true; - break; - case 164: - short compareloffset = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC + 1]); - BaseType bcl2 = this._mThread.currentFrame.OpStack.Pop(); - BaseType bcl1 = this._mThread.currentFrame.OpStack.Pop(); - if (bcl1 is Int && bcl2 is Int) - { - //Console.WriteLine("comparing " + ((Int)bcl1).mValue + " and " + ((Int)bcl2).mValue); - if (((Int)bcl1).mValue <= ((Int)bcl2).mValue) - { - // Console.WriteLine("branch compare true , offset is " + compareloffset); - // Console.WriteLine("current PC is " + this._mThread.PC); - this._mThread.PC += -1 + compareloffset; - // Console.WriteLine("new PC is " + this._mThread.PC); - } - else - { - //Console.WriteLine("branch compare false"); - this._mThread.PC += 2; - } - } - else - { - this._mThread.PC += 2; - } - result = true; - break; - case 167: - short offset = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC+1]); - this._mThread.PC += -1 + offset; - result = true; - break; - } - - return result; - } - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterMethods.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterMethods.cs deleted file mode 100644 index 8e34de7..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterMethods.cs +++ /dev/null @@ -1,161 +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 OpenSim.Scripting.EmbeddedJVM.Types; -using OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework; -using OpenSim.Framework.Types; - -namespace OpenSim.Scripting.EmbeddedJVM -{ - partial class Thread - { - private partial class Interpreter - { - private bool IsMethodOpCode(byte opcode) - { - bool result = false; - switch (opcode) - { - case 184: - short refIndex = (short) ((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC+1]); - if (this._mThread.currentClass._constantsPool[refIndex - 1] is ClassRecord.PoolMethodRef) - { - string typ = ((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mNameType.Type.Value; - string typeparam = ""; - string typereturn = ""; - int firstbrak = 0; - int secondbrak = 0; - firstbrak = typ.LastIndexOf('('); - secondbrak = typ.LastIndexOf(')'); - typeparam = typ.Substring(firstbrak + 1, secondbrak - firstbrak - 1); - typereturn = typ.Substring(secondbrak + 1, typ.Length - secondbrak - 1); - if (((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mClass.Name.Value == this._mThread.currentClass.mClass.Name.Value) - { - //calling a method in this class - if (typeparam.Length == 0) - { - this._mThread.JumpToStaticVoidMethod(((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mNameType.Name.Value, (this._mThread.PC + 2)); - } - else - { - this._mThread.JumpToStaticParamMethod(((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mNameType.Name.Value, typeparam, (this._mThread.PC + 2)); - } - } - else - { - //calling a method of a different class - - //for now we will have a built in OpenSimAPI class, but this should be a java class that then calls native methods - if (((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mClass.Name.Value == "OpenSimAPI") - { - switch (((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mNameType.Name.Value) - { - case "GetEntityID": - Int entityID = new Int(); - entityID.mValue =(int) this._mThread.EntityId; - this._mThread.currentFrame.OpStack.Push(entityID); - this._mThread.PC += 2; - break; - case "GetRandomAvatarID": - entityID = new Int(); - entityID.mValue = (int)Thread.OpenSimScriptAPI.GetRandomAvatarID(); - this._mThread.currentFrame.OpStack.Push(entityID); - this._mThread.PC += 2; - break; - case "GetEntityPositionX": - BaseType bs1 = this._mThread.currentFrame.OpStack.Pop(); - if (bs1 is Int) - { - //should get the position of the entity from the IScriptAPI - OSVector3 vec3 = Thread.OpenSimScriptAPI.GetEntityPosition((uint)((Int)bs1).mValue); - Float pos = new Float(); - pos.mValue = vec3.X; - this._mThread.currentFrame.OpStack.Push(pos); - } - this._mThread.PC += 2; - break; - case "GetEntityPositionY": - bs1 = this._mThread.currentFrame.OpStack.Pop(); - if (bs1 is Int) - { - //should get the position of the entity from the IScriptAPI - OSVector3 vec3 = Thread.OpenSimScriptAPI.GetEntityPosition((uint)((Int)bs1).mValue); - Float pos = new Float(); - pos.mValue = vec3.Y; - this._mThread.currentFrame.OpStack.Push(pos); - } - this._mThread.PC += 2; - break; - case "GetEntityPositionZ": - bs1 = this._mThread.currentFrame.OpStack.Pop(); - if (bs1 is Int) - { - //should get the position of the entity from the IScriptAPI - OSVector3 vec3 = Thread.OpenSimScriptAPI.GetEntityPosition((uint)((Int)bs1).mValue); - Float pos = new Float(); - pos.mValue = vec3.Z; - this._mThread.currentFrame.OpStack.Push(pos); - } - this._mThread.PC += 2; - break; - case "SetEntityPosition": - //pop the three float values and the entity id - BaseType ft3 = this._mThread.currentFrame.OpStack.Pop(); - BaseType ft2 = this._mThread.currentFrame.OpStack.Pop(); - BaseType ft1 = this._mThread.currentFrame.OpStack.Pop(); - BaseType in1 = this._mThread.currentFrame.OpStack.Pop(); - if (ft1 is Float && ft2 is Float && ft3 is Float) - { - if(in1 is Int) - { - Thread.OpenSimScriptAPI.SetEntityPosition((uint)((Int) in1).mValue, ((Float)ft1).mValue, ((Float)ft2).mValue, ((Float)ft3).mValue); - } - } - this._mThread.PC += 2; - break; - } - } - } - } - else - { - this._mThread.PC += 2; - } - result = true; - break; - } - - return result; - } - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterReturn.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterReturn.cs deleted file mode 100644 index cbedb71..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterReturn.cs +++ /dev/null @@ -1,40 +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.Scripting.EmbeddedJVM -{ - partial class Thread - { - private partial class Interpreter - { - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/MainMemory.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/MainMemory.cs deleted file mode 100644 index 97d9fb6..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/MainMemory.cs +++ /dev/null @@ -1,45 +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.Scripting.EmbeddedJVM -{ - public class MainMemory - { - public Heap HeapArea; - public MethodMemory MethodArea; - - public MainMemory() - { - MethodArea = new MethodMemory(); - HeapArea = new Heap(); - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/MethodMemory.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/MethodMemory.cs deleted file mode 100644 index 7e938b4..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/MethodMemory.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.Scripting.EmbeddedJVM -{ - public class MethodMemory - { - public byte[] MethodBuffer; - public List Classes = new List(); - public int NextMethodPC = 0; - public int Methodcount = 0; - - public MethodMemory() - { - MethodBuffer = new byte[20000]; - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Object.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Object.cs deleted file mode 100644 index 2c3bedd..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Object.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.Scripting.EmbeddedJVM -{ - public class Object - { - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj deleted file mode 100644 index bd1a332..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj +++ /dev/null @@ -1,153 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {97A82740-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Scripting.EmbeddedJVM - JScript - Grid - IE50 - false - Library - - OpenSim.Scripting.EmbeddedJVM - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\ScriptEngines\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\ScriptEngines\ - 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 - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build deleted file mode 100644 index cce2fef..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSimJVM.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSimJVM.cs deleted file mode 100644 index 2de8152..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSimJVM.cs +++ /dev/null @@ -1,161 +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.IO; -using System.Threading; -using OpenSim.Framework; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; - -namespace OpenSim.Scripting.EmbeddedJVM -{ - public class OpenSimJVM : IScriptEngine - { - private List _threads = new List(); - private BlockingQueue CompileScripts = new BlockingQueue(); - private MainMemory _mainMemory; - private System.Threading.Thread compileThread; - - public OpenSimJVM() - { - - } - - public bool Init(IScriptAPI api) - { - Console.WriteLine("Creating OpenSim JVM scripting engine"); - _mainMemory = new MainMemory(); - Thread.GlobalMemory = this._mainMemory; - Thread.OpenSimScriptAPI = api; - compileThread = new System.Threading.Thread(new ThreadStart(CompileScript)); - compileThread.IsBackground = true; - compileThread.Start(); - return true; - } - - public string GetName() - { - return "OpenSimJVM"; - } - - public void LoadScript(string script, string scriptName, uint entityID) - { - Console.WriteLine("OpenSimJVM - loading new script: " + scriptName); - CompileInfo comp = new CompileInfo(); - comp.entityId = entityID; - comp.script = script; - comp.scriptName = scriptName; - this.CompileScripts.Enqueue(comp); - } - - public void CompileScript() - { - while (true) - { - CompileInfo comp = this.CompileScripts.Dequeue(); - string script = comp.script; - string scriptName = comp.scriptName; - uint entityID = comp.entityId; - try - { - //need to compile the script into a java class file - - //first save it to a java source file - TextWriter tw = new StreamWriter(scriptName + ".java"); - tw.WriteLine(script); - tw.Close(); - - //now compile - System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("javac.exe", "*.java"); - // psi.RedirectStandardOutput = true; - psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; - psi.UseShellExecute = false; - - System.Diagnostics.Process javacomp; - javacomp = System.Diagnostics.Process.Start(psi); - javacomp.WaitForExit(); - - - //now load in class file - ClassRecord class1 = new ClassRecord(); - class1.LoadClassFromFile(scriptName + ".class"); - class1.PrintToConsole(); - //Console.WriteLine(); - this._mainMemory.MethodArea.Classes.Add(class1); - class1.AddMethodsToMemory(this._mainMemory.MethodArea); - - Thread newThread = new Thread(); - this._threads.Add(newThread); - newThread.EntityId = entityID; - newThread.currentClass = class1; - - //now delete the created files - System.IO.File.Delete(scriptName + ".java"); - System.IO.File.Delete(scriptName + ".class"); - //this.OnFrame(); - } - catch (Exception e) - { - Console.WriteLine("exception"); - Console.WriteLine(e.StackTrace); - Console.WriteLine(e.Message); - } - } - } - - public void OnFrame() - { - for (int i = 0; i < this._threads.Count; i++) - { - if (!this._threads[i].running) - { - this._threads[i].StartMethod("OnFrame"); - bool run = true; - while (run) - { - run = this._threads[i].Excute(); - } - } - } - } - - private class CompileInfo - { - public string script; - public string scriptName; - public uint entityId; - - public CompileInfo() - { - - } - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Properties/AssemblyInfo.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Properties/AssemblyInfo.cs deleted file mode 100644 index 53a0f08..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/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.Scripting.EmbeddedJVM")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenSim.Scripting.EmbeddedJVM")] -[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("087c0917-5a6a-4b47-a4dd-0928dd85bd4b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Stack.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Stack.cs deleted file mode 100644 index 69a274c..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Stack.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.Generic; -using System.Text; - -namespace OpenSim.Scripting.EmbeddedJVM -{ - public class Stack - { - public Stack StackFrames = new Stack(); - - public Stack() - { - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/StackFrame.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/StackFrame.cs deleted file mode 100644 index 3a2b58a..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/StackFrame.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 OpenSim.Scripting.EmbeddedJVM.Types; - -namespace OpenSim.Scripting.EmbeddedJVM -{ - public class StackFrame - { - public BaseType[] LocalVariables; - public Stack OpStack = new Stack(); - - public int ReturnPC = 0; - public ClassRecord CallingClass = null; - - public StackFrame() - { - LocalVariables = new BaseType[20]; - } - - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Thread.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Thread.cs deleted file mode 100644 index 6813a20..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Thread.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 OpenSim.Scripting.EmbeddedJVM.Types; -using OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes; -using OpenSim.Framework; -using OpenSim.Framework.Interfaces; - -namespace OpenSim.Scripting.EmbeddedJVM -{ - public partial class Thread - { - public static MainMemory GlobalMemory; - public static IScriptAPI OpenSimScriptAPI; - private int PC = 0; - private Stack stack; - private Interpreter mInterpreter; - public ClassRecord currentClass; - public ClassInstance currentInstance; - private StackFrame currentFrame; - public int excutionCounter = 0; - public bool running = false; - public uint EntityId = 0; - - public Thread() - { - this.mInterpreter = new Interpreter(this); - this.stack = new Stack(); - } - - public void SetPC(int methodpointer) - { - //Console.WriteLine("Thread PC has been set to " + methodpointer); - PC = methodpointer; - } - - public void StartMethod(ClassRecord rec, string methName) - { - currentFrame = new StackFrame(); - this.stack.StackFrames.Push(currentFrame); - this.currentClass = rec; - currentClass.StartMethod(this, methName); - } - - public void StartMethod( string methName) - { - currentFrame = new StackFrame(); - this.stack.StackFrames.Push(currentFrame); - currentClass.StartMethod(this, methName); - } - - public void JumpToStaticVoidMethod(string methName, int returnPC) - { - currentFrame = new StackFrame(); - currentFrame.ReturnPC = returnPC; - this.stack.StackFrames.Push(currentFrame); - currentClass.StartMethod(this, methName); - } - - public void JumpToStaticParamMethod(string methName, string param, int returnPC) - { - if (param == "I") - { - BaseType bs1 = currentFrame.OpStack.Pop(); - currentFrame = new StackFrame(); - currentFrame.ReturnPC = returnPC; - this.stack.StackFrames.Push(currentFrame); - currentFrame.LocalVariables[0] = ((Int)bs1); - currentClass.StartMethod(this, methName); - } - if (param == "F") - { - - } - } - - public void JumpToClassStaticVoidMethod(string className, string methName, int returnPC) - { - - } - - public bool Excute() - { - excutionCounter++; - return this.mInterpreter.Excute(); - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ArrayReference.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ArrayReference.cs deleted file mode 100644 index 2854eab..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ArrayReference.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Scripting.EmbeddedJVM.Types -{ - public class ArrayReference :BaseType - { - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/BaseType.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/BaseType.cs deleted file mode 100644 index 270aa7b..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/BaseType.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Scripting.EmbeddedJVM.Types -{ - public class BaseType : Object - { - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ObjectReference.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ObjectReference.cs deleted file mode 100644 index da28eaa..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ObjectReference.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Scripting.EmbeddedJVM.Types -{ - public class ObjectReference : BaseType - { - public ushort Reference; - - public ObjectReference() - { - - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Byte.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Byte.cs deleted file mode 100644 index 1a3ecff..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Byte.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes -{ - public class Byte : BaseType - { - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Char.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Char.cs deleted file mode 100644 index 19002d4..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Char.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes -{ - public class Char : BaseType - { - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Float.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Float.cs deleted file mode 100644 index 91f1679..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Float.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes -{ - public class Float : BaseType - { - public float mValue = 0; - - public Float() - { - - } - } -} diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Int.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Int.cs deleted file mode 100644 index 4ecd325..0000000 --- a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Int.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes -{ - public class Int : BaseType - { - public int mValue = 0; - - public Int() - { - - } - } -} diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs deleted file mode 100644 index 1818e3a..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs +++ /dev/null @@ -1,118 +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. -* -*/ - -// BDB Support -// Apparently broken on Mono - -using System; -using System.Collections.Generic; -using System.Data; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Terrain; -using BerkeleyDb; -using Kds.Serialization; -using Kds.Serialization.Buffer; - -namespace OpenSim.Storage.LocalStorageBDB -{ - public class BDBLocalStorage : ILocalStorage - { - const string simDbName = "localsim.db"; - - DbHash sim; - Db DB; - //BEFormatter formatter; - - public BDBLocalStorage() - { - DB = new Db(DbCreateFlags.None); - sim = (DbHash)DB.Open(null, simDbName, null, BerkeleyDb.DbType.Hash, Db.OpenFlags.Create, 0); - //vendorDb = (DbBTree)db.Open(null, VendorDbName, null, DbType.BTree, Db.OpenFlags.Create, 0); - } - - public void Initialise(string file) - { - // Blank - } - - public void StorePrim(PrimData prim) - { - DbEntry key = new DbEntry(); - DbEntry data = new DbEntry(); - lock (sim) - { - sim.PutUnique(null, ref key, ref data, DbFile.WriteFlags.AutoCommit); - } - } - public void RemovePrim(LLUUID primID) - { - - } - public void LoadPrimitives(ILocalStorageReceiver receiver) - { - - } - public float[] LoadWorld() - { - return new float[65536]; - } - public void SaveMap(float[] heightmap) - { - - } - - public void SaveParcels(ParcelData[] parcel_data) - { - } - - public void SaveParcel(ParcelData parcel) - { - } - - public void RemoveParcel(ParcelData parcel) - { - } - - public void RemoveAllParcels() - { - } - - public void LoadParcels(ILocalStorageParcelReceiver recv) - { - recv.NoParcelDataFromStorage(); - } - - public void ShutDown() - { - sim.GetDb().Close(); - DB.Close(); - } - } -} \ No newline at end of file diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj deleted file mode 100644 index 417643f..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {EE9E5D96-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Storage.LocalStorageBerkeleyDB - JScript - Grid - IE50 - false - Library - - OpenSim.Storage.LocalStorageBerkeleyDB - - - - - - 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\Kds.Serialization.dll - False - - - ..\..\..\bin\libdb_dotNET43.dll - False - - - ..\..\..\bin\libsecondlife.dll - False - - - System.dll - False - - - System.Data.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 - - - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build deleted file mode 100644 index bc2d8ec..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/AssemblyInfo.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/AssemblyInfo.cs deleted file mode 100644 index ea2b62e..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/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("Db4LocalStorage")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Db4LocalStorage")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("1.0.*")] diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs deleted file mode 100644 index 46fecd0..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs +++ /dev/null @@ -1,271 +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 Db4objects.Db4o; -using Db4objects.Db4o.Query; - -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Terrain; -using OpenSim.Framework.Console; - - -namespace OpenSim.Storage.LocalStorageDb4o -{ - /// - /// - /// - public class Db4LocalStorage : ILocalStorage - { - private IObjectContainer db; - private string datastore; - - public Db4LocalStorage() - { - - } - - public void Initialise(string dfile) - { - OpenSim.Framework.Console.MainConsole.Instance.Warn("Db4LocalStorage Opening " + dfile); - datastore = dfile; - try - { - db = Db4oFactory.OpenFile(datastore); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Db4LocalStorage creation"); - } - catch (Exception e) - { - db.Close(); - OpenSim.Framework.Console.MainConsole.Instance.Warn("Db4LocalStorage :Constructor - Exception occured"); - OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); - } - } - - public void StorePrim(PrimData prim) - { - IObjectSet result = db.Query(new UUIDPrimQuery(prim.FullID)); - if(result.Count>0) - { - //prim already in storage - //so update it - PrimData found = (PrimData) result.Next(); - found.PathBegin = prim.PathBegin; - found.PathCurve= prim.PathCurve; - found.PathEnd = prim.PathEnd; - found.PathRadiusOffset = prim.PathRadiusOffset; - found.PathRevolutions = prim.PathRevolutions; - found.PathScaleX= prim.PathScaleX; - found.PathScaleY = prim.PathScaleY; - found.PathShearX = prim.PathShearX; - found.PathShearY = prim.PathShearY; - found.PathSkew = prim.PathSkew; - found.PathTaperX = prim.PathTaperX; - found.PathTaperY = prim.PathTaperY; - found.PathTwist = prim.PathTwist; - found.PathTwistBegin = prim.PathTwistBegin; - found.PCode = prim.PCode; - found.ProfileBegin = prim.ProfileBegin; - found.ProfileCurve = prim.ProfileCurve; - found.ProfileEnd = prim.ProfileEnd; - found.ProfileHollow = prim.ProfileHollow; - found.Position = prim.Position; - found.Rotation = prim.Rotation; - found.Texture = prim.Texture; - db.Set(found); - db.Commit(); - } - else - { - //not in storage - db.Set(prim); - db.Commit(); - } - } - - public void RemovePrim(LLUUID primID) - { - IObjectSet result = db.Query(new UUIDPrimQuery(primID)); - if(result.Count>0) - { - PrimData found = (PrimData) result.Next(); - db.Delete(found); - } - } - - - public void LoadPrimitives(ILocalStorageReceiver receiver) - { - IObjectSet result = db.Get(typeof(PrimData)); - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count); - foreach (PrimData prim in result) { - receiver.PrimFromStorage(prim); - } - } - - public float[] LoadWorld() - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Loading world...."); - float[] heightmap = null; - OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Looking for a heightmap in local DB"); - IObjectSet world_result = db.Get(typeof(MapStorage)); - if (world_result.Count > 0) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Found a heightmap in local database, loading"); - MapStorage map = (MapStorage)world_result.Next(); - //blank.LandMap = map.Map; - heightmap = map.Map; - } - return heightmap; - } - - public void SaveMap(float[] heightmap) - { - IObjectSet world_result = db.Get(typeof(MapStorage)); - if (world_result.Count > 0) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("SaveWorld() - updating saved copy of heightmap in local database"); - MapStorage map = (MapStorage)world_result.Next(); - db.Delete(map); - } - MapStorage map1 = new MapStorage(); - map1.Map = heightmap; //OpenSim_Main.local_world.LandMap; - db.Set(map1); - db.Commit(); - } - - public void SaveParcel(ParcelData parcel) - { - IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID)); - if (result.Count > 0) - { - //Old Parcel - ParcelData updateParcel = (ParcelData)result.Next(); - updateParcel.AABBMax = parcel.AABBMax; - updateParcel.AABBMin = parcel.AABBMin; - updateParcel.area = parcel.area; - updateParcel.auctionID = parcel.auctionID; - updateParcel.authBuyerID = parcel.authBuyerID; - updateParcel.category = parcel.category; - updateParcel.claimDate = parcel.claimDate; - updateParcel.claimPrice = parcel.claimPrice; - updateParcel.groupID = parcel.groupID; - updateParcel.groupPrims = parcel.groupPrims; - updateParcel.isGroupOwned = parcel.isGroupOwned; - updateParcel.landingType = parcel.landingType; - updateParcel.mediaAutoScale = parcel.mediaAutoScale; - updateParcel.mediaID = parcel.mediaID; - updateParcel.mediaURL = parcel.mediaURL; - updateParcel.musicURL = parcel.musicURL; - updateParcel.localID = parcel.localID; - updateParcel.ownerID = parcel.ownerID; - updateParcel.passHours = parcel.passHours; - updateParcel.passPrice = parcel.passPrice; - updateParcel.parcelBitmapByteArray = (byte[])parcel.parcelBitmapByteArray.Clone(); - updateParcel.parcelDesc = parcel.parcelDesc; - updateParcel.parcelFlags = parcel.parcelFlags; - updateParcel.parcelName = parcel.parcelName; - updateParcel.parcelStatus = parcel.parcelStatus; - updateParcel.salePrice = parcel.salePrice; - updateParcel.snapshotID = parcel.snapshotID; - updateParcel.userLocation = parcel.userLocation; - updateParcel.userLookAt = parcel.userLookAt; - - db.Set(updateParcel); - } - else - { - db.Set(parcel); - } - db.Commit(); - } - - public void SaveParcels(ParcelData[] parcel_data) - { - MainConsole.Instance.Notice("Parcel Backup: Saving Parcels..."); - int i; - for (i = 0; i < parcel_data.GetLength(0); i++) - { - - SaveParcel(parcel_data[i]); - - } - MainConsole.Instance.Notice("Parcel Backup: Parcel Save Complete"); - } - - public void RemoveParcel(ParcelData parcel) - { - IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID)); - if (result.Count > 0) - { - db.Delete(result[0]); - } - db.Commit(); - } - public void RemoveAllParcels() - { - MainConsole.Instance.Notice("Parcel Backup: Removing all parcels..."); - IObjectSet result = db.Get(typeof(ParcelData)); - if (result.Count > 0) - { - foreach (ParcelData parcelData in result) - { - RemoveParcel(parcelData); - } - } - } - - public void LoadParcels(ILocalStorageParcelReceiver recv) - { - MainConsole.Instance.Notice("Parcel Backup: Loading Parcels..."); - IObjectSet result = db.Get(typeof(ParcelData)); - if (result.Count > 0) - { - MainConsole.Instance.Notice("Parcel Backup: Parcels exist in database."); - foreach (ParcelData parcelData in result) - { - - recv.ParcelFromStorage(parcelData); - } - } - else - { - MainConsole.Instance.Notice("Parcel Backup: No parcels exist. Creating basic parcel."); - recv.NoParcelDataFromStorage(); - } - MainConsole.Instance.Notice("Parcel Backup: Parcels Restored"); - } - public void ShutDown() - { - db.Commit(); - db.Close(); - } - } -} \ No newline at end of file diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs deleted file mode 100644 index 56387ac..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs +++ /dev/null @@ -1,43 +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.Storage.LocalStorageDb4o -{ - public class MapStorage - { - public float[] Map; - - public MapStorage() - { - - } - } -} \ No newline at end of file diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj deleted file mode 100644 index 5b8f1c1..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj +++ /dev/null @@ -1,116 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {E1B79ECF-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Storage.LocalStorageDb4o - JScript - Grid - IE50 - false - Library - - OpenSim.Storage.LocalStorageDb4o - - - - - - 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 - - - - - 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 - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build deleted file mode 100644 index 739b98c..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.cs deleted file mode 100644 index d24fb5f..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.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 Db4objects.Db4o; -using Db4objects.Db4o.Query; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; - -namespace OpenSim.Storage.LocalStorageDb4o -{ - public class UUIDParcelQuery : Predicate - { - private LLUUID globalIDSearch; - - public UUIDParcelQuery(LLUUID find) - { - globalIDSearch = find; - } - public bool Match(ParcelData parcel) - { - return (parcel.globalID == globalIDSearch); - } - } -} diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.cs deleted file mode 100644 index b2e8a91..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.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 Db4objects.Db4o; -using Db4objects.Db4o.Query; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; - -namespace OpenSim.Storage.LocalStorageDb4o -{ - public class UUIDPrimQuery : Predicate - { - private LLUUID _findID; - - public UUIDPrimQuery(LLUUID find) - { - _findID = find; - } - public bool Match(PrimData prim) - { - return (prim.FullID == _findID); - } - } -} diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj deleted file mode 100644 index ff93a8f..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {6B20B603-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Storage.LocalStorageSQLite - JScript - Grid - IE50 - false - Library - - OpenSim.Storage.LocalStorageSQLite - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - True - 4096 - False - ..\..\..\bin\ - False - False - False - 4 - - - - False - 285212672 - False - - - TRACE - - False - 4096 - True - ..\..\..\bin\ - False - False - False - 4 - - - - - ..\..\..\bin\libsecondlife.dll - False - - - System.dll - False - - - System.Data.dll - False - - - ..\..\..\bin\System.Data.SQLite.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 - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build deleted file mode 100644 index bd4c731..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs b/OpenSim/OpenSim.Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs deleted file mode 100644 index fe81f8a..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/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.Storage.LocalStorageSQLite")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenSim.Storage.LocalStorageSQLite")] -[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("ecd6e0c1-7909-413e-9e3f-659678ac3bc3")] - -// 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.*")] -[assembly: AssemblyFileVersion("1.0.0.*")] diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs deleted file mode 100644 index 8106727..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs +++ /dev/null @@ -1,199 +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. -* -*/ - -// SQLite Support -// A bad idea, but the IRC people told me to! - -using System; -using System.Collections.Generic; -using System.Data; -using System.Data.SQLite; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.Framework.Terrain; - -namespace OpenSim.Storage.LocalStorageSQLite -{ - public class SQLiteLocalStorage : ILocalStorage - { - IDbConnection db; - - public SQLiteLocalStorage() - { - try - { - string connectionstring = "URI=file:localsim.sdb"; - db = (IDbConnection)new SQLiteConnection(connectionstring); - db.Open(); - } - catch (Exception e) - { - db.Close(); - OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :Constructor - Exception occured"); - OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); - } - } - - public void Initialise(string file) - { - // Blank - } - - public void StorePrim(PrimData prim) - { - IDbCommand cmd = db.CreateCommand(); - - //SECURITY WARNING: - // These parameters wont produce SQL injections since they are all integer based, however. - // if inserting strings such as name or description, you will need to use appropriate - // measures to prevent SQL injection (although the value of SQL injection in this is limited). - - string sql = "REPLACE INTO prim (OwnerID,PCode,PathBegin,PathEnd,PathScaleX,PathScaleY,PathShearX,PathShearY,PathSkew,ProfileBegin,ProfileEnd,Scale,PathCurve,ProfileCurve,ParentID,ProfileHollow,PathRadiusOffset,PathRevolutions,PathTaperX,PathTaperY,PathTwist,PathTwistBegin,Texture,CreationDate,OwnerMask,NextOwnerMask,GroupMask,EveryoneMask,BaseMask,Position,Rotation,LocalID,FullID) "; - sql += "VALUES ("; - sql += "\"" + prim.OwnerID.ToStringHyphenated() + "\","; // KILL ME NOW! - sql += "\"" + prim.PCode.ToString() + "\","; - sql += "\"" + prim.PathBegin.ToString() + "\","; - sql += "\"" + prim.PathEnd.ToString() + "\","; - sql += "\"" + prim.PathScaleX.ToString() + "\","; - sql += "\"" + prim.PathScaleY.ToString() + "\","; - sql += "\"" + prim.PathShearX.ToString() + "\","; - sql += "\"" + prim.PathShearY.ToString() + "\","; - sql += "\"" + prim.PathSkew.ToString() + "\","; - sql += "\"" + prim.ProfileBegin.ToString() + "\","; - sql += "\"" + prim.ProfileEnd.ToString() + "\","; - sql += "\"" + prim.Scale.ToString() + "\","; - sql += "\"" + prim.PathCurve.ToString() + "\","; - sql += "\"" + prim.ProfileCurve.ToString() + "\","; - sql += "\"" + prim.ParentID.ToString() + "\","; - sql += "\"" + prim.ProfileHollow.ToString() + "\","; - sql += "\"" + prim.PathRadiusOffset.ToString() + "\","; - sql += "\"" + prim.PathRevolutions.ToString() + "\","; - sql += "\"" + prim.PathTaperX.ToString() + "\","; - sql += "\"" + prim.PathTaperY.ToString() + "\","; - sql += "\"" + prim.PathTwist.ToString() + "\","; - sql += "\"" + prim.PathTwistBegin.ToString() + "\","; - sql += "\"" + prim.Texture.ToString() + "\","; - sql += "\"" + prim.CreationDate.ToString() + "\","; - sql += "\"" + prim.OwnerMask.ToString() + "\","; - sql += "\"" + prim.NextOwnerMask.ToString() + "\","; - sql += "\"" + prim.GroupMask.ToString() + "\","; - sql += "\"" + prim.EveryoneMask.ToString() + "\","; - sql += "\"" + prim.BaseMask.ToString() + "\","; - sql += "\"" + prim.Position.ToString() + "\","; - sql += "\"" + prim.Rotation.ToString() + "\","; - sql += "\"" + prim.LocalID.ToString() + "\","; - sql += "\"" + prim.FullID.ToString() + "\")"; - - cmd.CommandText = sql; - - try - { - cmd.ExecuteNonQuery(); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :StorePrim - Exception occured"); - OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); - } - - cmd.Dispose(); - cmd = null; - } - - public void RemovePrim(LLUUID primID) - { - IDbCommand cmd = db.CreateCommand(); - - //SECURITY WARNING: - // These parameters wont produce SQL injections since they are all integer based, however. - // if inserting strings such as name or description, you will need to use appropriate - // measures to prevent SQL injection (although the value of SQL injection in this is limited). - - string sql = "DELETE FROM prim WHERE FullID = \"" + primID.ToStringHyphenated() + "\""; - - cmd.CommandText = sql; - - try - { - cmd.ExecuteNonQuery(); - } - catch (Exception e) - { - OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :RemovePrim - Exception occured"); - OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); - } - - cmd.Dispose(); - cmd = null; - } - - public void LoadPrimitives(ILocalStorageReceiver receiver) - { - - } - - public float[] LoadWorld() - { - return new float[65536]; - } - - public void SaveMap(float[] heightmap) - { - - } - - public void SaveParcels(ParcelData[] parcel_manager) - { - - } - - public void SaveParcel(ParcelData parcel) - { - } - - public void RemoveParcel(ParcelData parcel) - { - } - - public void RemoveAllParcels() - { - } - - public void LoadParcels(ILocalStorageParcelReceiver recv) - { - recv.NoParcelDataFromStorage(); - } - - public void ShutDown() - { - db.Close(); - db = null; - } - } -} \ No newline at end of file diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.csproj b/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.csproj deleted file mode 100644 index aae0ab8..0000000 --- a/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {2270B8FE-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim.Terrain.BasicTerrain - JScript - Grid - IE50 - false - Library - - OpenSim.Terrain.BasicTerrain - - - - - - 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\libTerrain-BSD.dll - False - - - System.dll - False - - - System.Data.dll - False - - - System.Drawing.dll - False - - - System.Xml.dll - False - - - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build b/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build deleted file mode 100644 index 6526648..0000000 --- a/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/Properties/AssemblyInfo.cs b/OpenSim/OpenSim.Terrain.BasicTerrain/Properties/AssemblyInfo.cs deleted file mode 100644 index bd74993..0000000 --- a/OpenSim/OpenSim.Terrain.BasicTerrain/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.Terrain.BasicTerrain")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenSim.Terrain.BasicTerrain")] -[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("3263f5b5-0a41-4ed5-91a2-9baaaeecc849")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs deleted file mode 100644 index 373d6ad..0000000 --- a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs +++ /dev/null @@ -1,533 +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.Drawing; -using libTerrain; - -namespace OpenSim.Terrain -{ - public class TerrainEngine - { - /// - /// A [normally] 256x256 heightmap - /// - public Channel heightmap; - - /// - /// Whether or not the terrain has been modified since it was last saved and sent to the Physics engine. - /// Counts the number of modifications since the last save. (0 = Untainted) - /// - public int tainted; - - int w, h; - - /// - /// Generate a new TerrainEngine instance and creates a new heightmap - /// - public TerrainEngine() - { - w = 256; - h = 256; - heightmap = new Channel(w, h); - - tainted++; - } - - /// - /// Converts the heightmap to a 65536 value 1D floating point array - /// - /// A float[65536] array containing the heightmap - public float[] getHeights1D() - { - float[] heights = new float[w * h]; - int i; - - for (i = 0; i < w * h; i++) - { - heights[i] = (float)heightmap.map[i / w, i % w]; - } - - return heights; - } - - /// - /// Converts the heightmap to a 256x256 value 2D floating point array. - /// - /// An array of 256,256 values containing the heightmap - public float[,] getHeights2D() - { - float[,] heights = new float[w, h]; - int x, y; - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - heights[x, y] = (float)heightmap.map[x, y]; - } - } - return heights; - } - - /// - /// Imports a 1D floating point array into the 2D heightmap array - /// - /// The array to import (must have 65536 members) - public void setHeights1D(float[] heights) - { - int i; - for (i = 0; i < w * h; i++) - { - heightmap.map[i / w, i % w] = heights[i]; - } - - tainted++; - } - - /// - /// Loads a 2D array of values into the heightmap - /// - /// An array of 256,256 float values - public void setHeights2D(float[,] heights) - { - int x, y; - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - heightmap.set(x, y, (double)heights[x, y]); - } - } - tainted++; - } - - /// - /// Processes a terrain-specific command - /// - /// Commandline arguments (space seperated) - /// Reference that returns error or help text if returning false - /// If the operation was successful (if not, the error is placed into resultText) - public bool RunTerrainCmd(string[] args, ref string resultText) - { - string command = args[0]; - - try - { - - switch (command) - { - case "help": - resultText += "terrain regenerate - rebuilds the sims terrain using a default algorithm\n"; - resultText += "terrain seed - sets the random seed value to \n"; - resultText += "terrain load - loads a terrain from disk, type can be 'F32', 'F64', 'RAW' or 'IMG'\n"; - resultText += "terrain save - saves a terrain to disk, type can be 'F32' or 'F64'\n"; - resultText += "terrain save grdmap - creates a PNG snapshot of the region using a named gradient map\n"; - resultText += "terrain rescale - rescales a terrain to be between and meters high\n"; - resultText += "terrain erode aerobic \n"; - resultText += "terrain erode thermal \n"; - resultText += "terrain multiply - multiplies a terrain by \n"; - return false; - - case "seed": - setSeed(Convert.ToInt32(args[1])); - break; - - case "erode": - switch (args[1].ToLower()) - { - case "aerobic": - // WindSpeed, PickupMinimum,DropMinimum,Carry,Rounds,Lowest - heightmap.AerobicErosion(Convert.ToDouble(args[2]), Convert.ToDouble(args[3]), Convert.ToDouble(args[4]), Convert.ToDouble(args[5]), Convert.ToInt32(args[6]), Convert.ToBoolean(args[7])); - break; - case "thermal": - heightmap.thermalWeathering(Convert.ToDouble(args[2]), Convert.ToInt32(args[3]), Convert.ToDouble(args[4])); - break; - default: - resultText = "Unknown erosion type"; - return false; - } - break; - - case "regenerate": - hills(); - break; - - case "rescale": - setRange(Convert.ToSingle(args[1]), Convert.ToSingle(args[2])); - break; - - case "multiply": - heightmap *= Convert.ToDouble(args[1]); - break; - - case "load": - switch (args[1].ToLower()) - { - case "f32": - loadFromFileF32(args[2]); - break; - - case "f64": - loadFromFileF64(args[2]); - break; - - case "raw": - loadFromFileSLRAW(args[2]); - break; - - case "img": - loadFromFileIMG(args[2]); - return false; - - default: - resultText = "Unknown image or data format"; - return false; - } - break; - - case "save": - switch (args[1].ToLower()) - { - case "f32": - writeToFileF32(args[2]); - break; - - case "f64": - writeToFileF64(args[2]); - break; - - case "grdmap": - exportImage(args[2], args[3]); - break; - - default: - resultText = "Unknown image or data format"; - return false; - } - break; - - default: - resultText = "Unknown terrain command"; - return false; - } - return true; - } - catch (Exception e) - { - resultText = "Error running terrain command: " + e.ToString(); - return false; - } - } - - /// - /// Renormalises the array between min and max - /// - /// Minimum value of the new array - /// Maximum value of the new array - public void setRange(float min, float max) - { - heightmap.normalise((double)min, (double)max); - tainted++; - } - - /// - /// Loads a file from an image compatible with System.Drawing - /// - /// File to load - public void loadFromFileIMG(string filename) - { - System.Drawing.Bitmap bmp = new Bitmap(filename); - - if (bmp.Width != heightmap.w && bmp.Height != heightmap.h) - throw new Exception("Wrong image size! Images for this region must be " + heightmap.w.ToString() + " by " + heightmap.h.ToString() + " pixels in dimension"); - - int x, y; - - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - Color c = bmp.GetPixel(x, y); - } - } - } - - /// - /// Loads a file consisting of 256x256 doubles and imports it as an array into the map. - /// - /// TODO: Move this to libTerrain itself - /// The filename of the double array to import - public void loadFromFileF64(string filename) - { - System.IO.FileInfo file = new System.IO.FileInfo(filename); - System.IO.FileStream s = file.Open(System.IO.FileMode.Open, System.IO.FileAccess.Read); - System.IO.BinaryReader bs = new System.IO.BinaryReader(s); - int x, y; - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - heightmap.map[x, y] = bs.ReadDouble(); - } - } - - bs.Close(); - s.Close(); - - tainted++; - } - - /// - /// Loads a file consisting of 256x256 floats and imports it as an array into the map. - /// - /// TODO: Move this to libTerrain itself - /// The filename of the float array to import - public void loadFromFileF32(string filename) - { - System.IO.FileInfo file = new System.IO.FileInfo(filename); - System.IO.FileStream s = file.Open(System.IO.FileMode.Open, System.IO.FileAccess.Read); - System.IO.BinaryReader bs = new System.IO.BinaryReader(s); - int x, y; - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - heightmap.map[x, y] = (double)bs.ReadSingle(); - } - } - - bs.Close(); - s.Close(); - - tainted++; - } - - /// - /// Loads a file formatted in the SL .RAW Format used on the main grid - /// - /// This file format stinks and is best avoided. - /// A path to the .RAW format - public void loadFromFileSLRAW(string filename) - { - System.IO.FileInfo file = new System.IO.FileInfo(filename); - System.IO.FileStream s = file.Open(System.IO.FileMode.Open, System.IO.FileAccess.Read); - System.IO.BinaryReader bs = new System.IO.BinaryReader(s); - int x, y; - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - heightmap.map[x, y] = (double)bs.ReadByte() * ((double)bs.ReadByte() / 127.0); - bs.ReadBytes(11); // Advance the stream to next bytes. - } - } - - bs.Close(); - s.Close(); - - tainted++; - } - - /// - /// Writes the current terrain heightmap to disk, in the format of a 65536 entry double[] array. - /// - /// The desired output filename - public void writeToFileF64(string filename) - { - System.IO.FileInfo file = new System.IO.FileInfo(filename); - System.IO.FileStream s = file.Open(System.IO.FileMode.CreateNew, System.IO.FileAccess.Write); - System.IO.BinaryWriter bs = new System.IO.BinaryWriter(s); - - int x, y; - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - bs.Write(heightmap.get(x, y)); - } - } - - bs.Close(); - s.Close(); - } - - /// - /// Writes the current terrain heightmap to disk, in the format of a 65536 entry float[] array - /// - /// The desired output filename - public void writeToFileF32(string filename) - { - System.IO.FileInfo file = new System.IO.FileInfo(filename); - System.IO.FileStream s = file.Open(System.IO.FileMode.CreateNew, System.IO.FileAccess.Write); - System.IO.BinaryWriter bs = new System.IO.BinaryWriter(s); - - int x, y; - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - bs.Write((float)heightmap.get(x, y)); - } - } - - bs.Close(); - s.Close(); - } - - /// - /// Sets the random seed to be used by procedural functions which involve random numbers. - /// - /// The desired seed - public void setSeed(int val) - { - heightmap.seed = val; - } - - /// - /// Raises land in a sphere around the specified coordinates - /// - /// Center of the sphere on the X axis - /// Center of the sphere on the Y axis - /// The radius of the sphere - /// Scale the height of the sphere by this amount (recommended 0..2) - public void raise(double rx, double ry, double size, double amount) - { - lock (heightmap) - { - heightmap.raise(rx, ry, size, amount); - } - - tainted++; - } - - /// - /// Lowers the land in a sphere around the specified coordinates - /// - /// The center of the sphere at the X axis - /// The center of the sphere at the Y axis - /// The radius of the sphere in meters - /// Scale the height of the sphere by this amount (recommended 0..2) - public void lower(double rx, double ry, double size, double amount) - { - lock (heightmap) - { - heightmap.lower(rx, ry, size, amount); - } - - tainted++; - } - - /// - /// Generates a simple set of hills in the shape of an island - /// - public void hills() - { - lock (heightmap) - { - heightmap.hillsSpheres(200, 20, 40, true, true, false); - heightmap.normalise(); - heightmap *= 60.0; // Raise to 60m - } - - tainted++; - } - - /// - /// Multiplies the heightfield by val - /// - /// The heightfield - /// The multiplier - /// - public static TerrainEngine operator *(TerrainEngine meep, Double val) - { - meep.heightmap *= val; - meep.tainted++; - return meep; - } - - /// - /// Returns the height at the coordinates x,y - /// - /// X Coordinate - /// Y Coordinate - /// - public float this[int x, int y] - { - get - { - return (float)heightmap.get(x, y); - } - set - { - tainted++; - heightmap.set(x, y, (double)value); - } - } - - /// - /// Exports the current heightmap to a PNG file - /// - /// The destination filename for the image - /// A 1x*height* image which contains the colour gradient to export with. Must be at least 1x2 pixels, 1x256 or more is ideal. - public void exportImage(string filename, string gradientmap) - { - try - { - Bitmap gradientmapLd = new Bitmap(gradientmap); - - int pallete = gradientmapLd.Height; - - Bitmap bmp = new Bitmap(heightmap.w, heightmap.h); - Color[] colours = new Color[pallete]; - - for (int i = 0; i < pallete; i++) - { - colours[i] = gradientmapLd.GetPixel(0, i); - } - - Channel copy = heightmap.copy(); - for (int x = 0; x < copy.w; x++) - { - for (int y = 0; y < copy.h; y++) - { - // 512 is the largest possible height before colours clamp - int colorindex = (int)(Math.Max(Math.Min(1.0, copy.get(x, y) / 512.0), 0.0) * pallete); - bmp.SetPixel(y, 255 - x, colours[colorindex]); - } - } - - bmp.Save(filename, System.Drawing.Imaging.ImageFormat.Png); - } - catch (Exception e) - { - Console.WriteLine("Failed generating terrain map: " + e.ToString()); - } - } - } -} \ No newline at end of file diff --git a/OpenSim/OpenSim/Application.cs b/OpenSim/OpenSim/Application.cs deleted file mode 100644 index dec0029..0000000 --- a/OpenSim/OpenSim/Application.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 OpenSim.UserServer; -using OpenSim.Framework.Console; -using OpenSim.RegionServer; - -namespace OpenSim -{ - public class Application - { - //could move our main function into OpenSimMain and kill this class - [STAThread] - public static void Main(string[] args) - { - try - { - Console.WriteLine("OpenSim " + VersionInfo.Version + "\n"); - Console.WriteLine("Starting...\n"); - - bool sandBoxMode = false; - bool startLoginServer = false; - string physicsEngine = "basicphysics"; - bool allowFlying = false; - bool userAccounts = false; - bool gridLocalAsset = false; - bool useConfigFile = false; - bool silent = false; - string configFile = "simconfig.xml"; - - for (int i = 0; i < args.Length; i++) - { - if (args[i] == "-sandbox") - { - sandBoxMode = true; - userAccounts = true; - startLoginServer = true; - } - /* - if (args[i] == "-loginserver") - { - startLoginServer = true; - }*/ - if (args[i] == "-accounts") - { - userAccounts = true; - } - if (args[i] == "-realphysx") - { - physicsEngine = "RealPhysX"; - allowFlying = true; - } - if (args[i] == "-ode") - { - physicsEngine = "OpenDynamicsEngine"; - allowFlying = true; - } - if (args[i] == "-localasset") - { - gridLocalAsset = true; - } - if (args[i] == "-configfile") - { - useConfigFile = true; - } - if (args[i] == "-noverbose") - { - silent = true; - } - if (args[i] == "-config") - { - try - { - i++; - configFile = args[i]; - } - catch (Exception e) - { - Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")"); - } - } - } - - OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile); - // OpenSimRoot.Instance.Application = sim; - sim.m_sandbox = sandBoxMode; - sim.user_accounts = userAccounts; - sim.gridLocalAsset = gridLocalAsset; - OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = allowFlying; - - sim.StartUp(); - - while (true) - { - OpenSim.Framework.Console.MainConsole.Instance.MainConsolePrompt(); - } - } - finally - { - /// Ensure that all sockets have been closed before the process closes. This helps ensure that no - /// open ports are left open on process that ''. This is in the finally block, as it - /// should be done regardless of whether a exception closes the application, or if the application - /// is closed normally. - - OpenSim.Servers.SocketRegistry.UnregisterAllAndClose(); - } - } - } -} diff --git a/OpenSim/OpenSim/OpenSim.csproj b/OpenSim/OpenSim/OpenSim.csproj deleted file mode 100644 index f55735f..0000000 --- a/OpenSim/OpenSim/OpenSim.csproj +++ /dev/null @@ -1,147 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {438A9556-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - OpenSim - JScript - Grid - IE50 - false - Exe - - OpenSim - - - - - - 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\Axiom.MathLib.dll - False - - - ..\..\bin\Db4objects.Db4o.dll - False - - - ..\..\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 - - - OpenSim.GenericConfig.Xml - {E88EF749-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Physics.Manager - {8BE16150-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.RegionServer - {632E1BFD-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Servers - {8BB20F0A-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Terrain.BasicTerrain - {2270B8FE-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - XMLRPC - {8E81D43C-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - - - - - - - - diff --git a/OpenSim/OpenSim/OpenSim.exe.build b/OpenSim/OpenSim/OpenSim.exe.build deleted file mode 100644 index 784c9ca..0000000 --- a/OpenSim/OpenSim/OpenSim.exe.build +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs deleted file mode 100644 index 0a316bd..0000000 --- a/OpenSim/OpenSim/OpenSimMain.cs +++ /dev/null @@ -1,552 +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.RegionServer; - -using OpenSim.RegionServer.Simulator; -using OpenSim.Terrain; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.UserServer; -using OpenSim.RegionServer.Assets; -using OpenSim.RegionServer.CAPS; -using OpenSim.Framework.Console; -using OpenSim.Physics.Manager; -using Nwc.XmlRpc; -using OpenSim.Servers; -using OpenSim.GenericConfig; - -namespace OpenSim -{ - - public class OpenSimMain : OpenSim.RegionServer.RegionServerBase, conscmd_callback - { - private CheckSumServer checkServer; - - public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile) - { - this.configFileSetup = useConfigFile; - m_sandbox = sandBoxMode; - m_loginserver = startLoginServer; - m_physicsEngine = physicsEngine; - m_config = configFile; - - m_console = new ConsoleBase("region-console-" + Guid.NewGuid().ToString() + ".log", "Region", this, silent); - OpenSim.Framework.Console.MainConsole.Instance = m_console; - } - - /// - /// Performs initialisation of the world, such as loading configuration from disk. - /// - public override void StartUp() - { - this.regionData = new RegionInfo(); - - this.localConfig = new XmlConfig(m_config); - this.localConfig.LoadData(); - - if (this.configFileSetup) - { - this.SetupFromConfigFile(this.localConfig); - } - m_console.Notice("Main.cs:Startup() - Loading configuration"); - this.regionData.InitConfig(this.m_sandbox, this.localConfig); - this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change - - GridServers = new Grid(); - if (m_sandbox) - { - this.SetupLocalGridServers(); - //Authenticate Session Handler - AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal(); - this.AuthenticateSessionsHandler = authen; - this.checkServer = new CheckSumServer(12036); - this.checkServer.ServerListener(); - } - else - { - this.SetupRemoteGridServers(); - //Authenticate Session Handler - AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote(); - this.AuthenticateSessionsHandler = authen; - } - - startuptime = DateTime.Now; - - - AssetCache = new AssetCache(GridServers.AssetServer); - InventoryCache = new InventoryCache(); - - - m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console, this.AuthenticateSessionsHandler); - - //should be passing a IGenericConfig object to these so they can read the config data they want from it - GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); - IGridServer gridServer = GridServers.GridServer; - gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey); - - if (!m_sandbox) - { - this.ConnectToRemoteGridServer(); - } - - this.SetupLocalWorld(); - - if (m_sandbox) - { - AssetCache.LoadDefaultTextureSet(); - } - - m_console.Notice("Main.cs:Startup() - Initialising HTTP server"); - - this.SetupHttpListener(); - - //Login server setup - LoginServer loginServer = null; - LoginServer adminLoginServer = null; - - bool sandBoxWithLoginServer = m_loginserver && m_sandbox; - if (sandBoxWithLoginServer) - { - loginServer = new LoginServer(regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts); - loginServer.Startup(); - loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler).AddNewSession); - - if (user_accounts) - { - //sandbox mode with loginserver using accounts - this.GridServers.UserServer = loginServer; - adminLoginServer = loginServer; - - httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.LocalUserManager.XmlRpcLoginMethod); - } - else - { - //sandbox mode with loginserver not using accounts - httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod); - } - } - - //Web front end setup - AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer); - adminWebFront.LoadMethods(httpServer); - - //Start http server - m_console.Notice("Main.cs:Startup() - Starting HTTP server"); - httpServer.Start(); - - // Start UDP server - this.m_udpServer.ServerListener(); - - //Setup Master Avatar - m_console.Notice("Main.cs:Startup() - Setting up Master Avatar"); - if (this.m_sandbox) - { - OpenSim.Framework.User.UserProfile masterUser = adminLoginServer.LocalUserManager.GetProfileByName(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName); - if (masterUser == null) - { - m_console.Notice("Main.cs:Startup() - Sandbox Mode; Master Avatar is a new user; creating account."); - adminLoginServer.CreateUserAccount(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName, this.regionData.MasterAvatarSandboxPassword); - masterUser = adminLoginServer.LocalUserManager.GetProfileByName(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName); - if (masterUser == null) //Still NULL?!!?! OMG FAIL! - { - throw new Exception("Failure to create master user account"); - } - } - m_console.Notice("Main.cs:Startup() - Master User UUID: " + masterUser.UUID.ToStringHyphenated()); - regionData.MasterAvatarAssignedUUID = masterUser.UUID; - - } - else - { - m_console.Warn("Main.cs:Startup() - Grid Mode; Do not know how to get the user's master key yet!"); - } - - m_console.Notice("Creating Estate Manager"); - LocalWorld.estateManager = new OpenSim.RegionServer.Estate.EstateManager(this.LocalWorld); - - m_console.Notice("Creating Parcel Manager"); - LocalWorld.parcelManager = new OpenSim.RegionServer.Simulator.ParcelManager(this.LocalWorld); - - m_console.Notice("Loading Parcels from DB..."); - LocalWorld.localStorage.LoadParcels((ILocalStorageParcelReceiver)LocalWorld.parcelManager); - - m_heartbeatTimer.Enabled = true; - m_heartbeatTimer.Interval = 100; - m_heartbeatTimer.Elapsed += new ElapsedEventHandler(this.Heartbeat); - } - - # region Setup methods - protected override void SetupLocalGridServers() - { - GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll"; - GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll"; - - m_console.Notice("Starting in Sandbox mode"); - - GridServers.Initialise(); - } - - protected override void SetupRemoteGridServers() - { - if (this.gridLocalAsset) - { - GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll"; - } - else - { - GridServers.AssetDll = "OpenSim.GridInterfaces.Remote.dll"; - } - GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll"; - - m_console.Notice("Starting in Grid mode"); - - - GridServers.Initialise(); - - } - - protected override void SetupLocalWorld() - { - m_console.Status("Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString()); - m_console.Notice("Initialising world"); - m_console.componentname = "Region " + regionData.RegionName; - - m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName); - LocalWorld.InventoryCache = InventoryCache; - LocalWorld.AssetCache = AssetCache; - - this.m_udpServer.LocalWorld = LocalWorld; - this.m_udpServer.PacketServer.RegisterClientPacketHandlers(); - - this.physManager = new OpenSim.Physics.Manager.PhysicsManager(); - this.physManager.LoadPlugins(); - - LocalWorld.m_datastore = this.regionData.DataStore; - - LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded. - LocalWorld.LoadWorldMap(); - - m_console.Notice("Main.cs:Startup() - Starting up messaging system"); - LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); - LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D()); - LocalWorld.LoadPrimsFromStorage(); - } - - protected override void SetupHttpListener() - { - httpServer = new BaseHttpServer(regionData.IPListenPort); - - if (this.GridServers.GridServer.GetName() == "Remote") - { - - // we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server - httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler).ExpectUser); - - httpServer.AddXmlRPCHandler("agent_crossing", - delegate(XmlRpcRequest request) - { - Hashtable requestData = (Hashtable)request.Params[0]; - uint circuitcode = Convert.ToUInt32(requestData["circuit_code"]); - - AgentCircuitData agent_data = new AgentCircuitData(); - agent_data.firstname = (string)requestData["firstname"]; - agent_data.lastname = (string)requestData["lastname"]; - agent_data.circuitcode = circuitcode; - agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]), Single.Parse((string)requestData["pos_y"]), Single.Parse((string)requestData["pos_z"])); - - AuthenticateSessionsHandler.UpdateAgentData(agent_data); - - return new XmlRpcResponse(); - }); - - httpServer.AddRestHandler("GET", "/simstatus/", - delegate(string request, string path, string param) - { - return "OK"; - }); - } - } - - protected override void ConnectToRemoteGridServer() - { - if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort)) - { - m_console.Notice("Main.cs:Startup() - Success: Got a grid connection OK!"); - } - else - { - m_console.Error("Main.cs:Startup() - FAILED: Unable to get connection to grid. Shutting down."); - Shutdown(); - } - - GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]); - - // If we are being told to load a file, load it. - string dataUri = (string)((RemoteGridBase)GridServers.GridServer).GridData["data_uri"]; - - if (!String.IsNullOrEmpty(dataUri)) - { - this.LocalWorld.m_datastore = dataUri; - } - - if (((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString() != "") - { - // The grid server has told us who we are - // We must obey the grid server. - - regionData.RegionLocX = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locx"].ToString()); - regionData.RegionLocY = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locy"].ToString()); - regionData.RegionName = ((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString(); - - - } - } - - #endregion - - private void SetupFromConfigFile(IGenericConfig configData) - { - - // SandBoxMode - string attri = ""; - attri = configData.GetAttribute("SandBox"); - if ((attri == "") || ((attri != "false") && (attri != "true"))) - { - this.m_sandbox = false; - configData.SetAttribute("SandBox", "false"); - } - else - { - this.m_sandbox = Convert.ToBoolean(attri); - } - - // LoginServer - attri = ""; - attri = configData.GetAttribute("LoginServer"); - if ((attri == "") || ((attri != "false") && (attri != "true"))) - { - this.m_loginserver = false; - configData.SetAttribute("LoginServer", "false"); - } - else - { - this.m_loginserver = Convert.ToBoolean(attri); - } - - // Sandbox User accounts - attri = ""; - attri = configData.GetAttribute("UserAccount"); - if ((attri == "") || ((attri != "false") && (attri != "true"))) - { - this.user_accounts = false; - configData.SetAttribute("UserAccounts", "false"); - } - else if (attri == "true") - { - this.user_accounts = Convert.ToBoolean(attri); - } - - // Grid mode hack to use local asset server - attri = ""; - attri = configData.GetAttribute("LocalAssets"); - if ((attri == "") || ((attri != "false") && (attri != "true"))) - { - this.gridLocalAsset = false; - configData.SetAttribute("LocalAssets", "false"); - } - else if (attri == "true") - { - this.gridLocalAsset = Convert.ToBoolean(attri); - } - - - attri = ""; - attri = configData.GetAttribute("PhysicsEngine"); - switch (attri) - { - default: - m_console.Warn("Main.cs: SetupFromConfig() - Invalid value for PhysicsEngine attribute, terminating"); - Environment.Exit(1); - break; - - case "": - this.m_physicsEngine = "basicphysics"; - configData.SetAttribute("PhysicsEngine", "basicphysics"); - OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = false; - break; - - case "basicphysics": - this.m_physicsEngine = "basicphysics"; - configData.SetAttribute("PhysicsEngine", "basicphysics"); - OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = false; - break; - - case "RealPhysX": - this.m_physicsEngine = "RealPhysX"; - OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = true; - break; - - case "OpenDynamicsEngine": - this.m_physicsEngine = "OpenDynamicsEngine"; - OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = true; - break; - } - - configData.Commit(); - } - - /// - /// Performs any last-minute sanity checking and shuts down the region server - /// - public virtual void Shutdown() - { - m_console.Notice("Main.cs:Shutdown() - Closing all threads"); - m_console.Notice("Main.cs:Shutdown() - Killing listener thread"); - m_console.Notice("Main.cs:Shutdown() - Killing clients"); - // IMPLEMENT THIS - m_console.Notice("Main.cs:Shutdown() - Closing console and terminating"); - LocalWorld.Close(); - GridServers.Close(); - m_console.Close(); - Environment.Exit(0); - } - - /// - /// Performs per-frame updates regularly - /// - /// - /// - void Heartbeat(object sender, System.EventArgs e) - { - LocalWorld.Update(); - } - - #region Console Commands - /// - /// Runs commands issued by the server console from the operator - /// - /// The first argument of the parameter (the command) - /// Additional arguments passed to the command - public void RunCmd(string command, string[] cmdparams) - { - switch (command) - { - case "help": - m_console.Error("show users - show info about connected users"); - m_console.Error("shutdown - disconnect all clients and shutdown"); - m_console.Error("backup - start a backup manually"); - break; - - case "show": - Show(cmdparams[0]); - break; - - case "terrain": - string result = ""; - if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams, ref result)) - { - m_console.Error(result); - } - break; - - case "shutdown": - Shutdown(); - break; - - case "backup": - LocalWorld.Backup(); - break; - - case "reset": - if (cmdparams[0] == "parcels") - { - LocalWorld.localStorage.RemoveAllParcels(); - LocalWorld.localStorage.LoadParcels((ILocalStorageParcelReceiver)LocalWorld.parcelManager); - } - break; - - default: - m_console.Error("Unknown command"); - break; - } - } - - /// - /// Outputs to the console information about the region - /// - /// What information to display (valid arguments are "uptime", "users") - public void Show(string ShowWhat) - { - switch (ShowWhat) - { - case "uptime": - m_console.Error("OpenSim has been running since " + startuptime.ToString()); - m_console.Error("That is " + (DateTime.Now - startuptime).ToString()); - break; - case "users": - OpenSim.RegionServer.Simulator.Avatar TempAv; - m_console.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP")); - foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys) - { - if (LocalWorld.Entities[UUID].ToString() == "OpenSim.RegionServer.Simulator.Avatar") - { - TempAv = (OpenSim.RegionServer.Simulator.Avatar)LocalWorld.Entities[UUID]; - m_console.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString())); - } - } - break; - case "parcels": - foreach (OpenSim.RegionServer.Simulator.Parcel parcel in LocalWorld.parcelManager.parcelList.Values) - { - m_console.Error("Parcel ID#" + parcel.parcelData.localID + "(Global UUID: " + parcel.parcelData.globalID + "):"); - m_console.Error("\tParcel Name: " + parcel.parcelData.parcelName); - m_console.Error("\tParcel Owner UUID: " + parcel.parcelData.ownerID); - m_console.Error("\tParcel Area: " + parcel.parcelData.area + "sqm"); - m_console.Error(" "); - } - break; - } - } - #endregion - } - - -} \ No newline at end of file diff --git a/Prebuild/Prebuild.build b/Prebuild/Prebuild.build deleted file mode 100644 index 395fb31..0000000 --- a/Prebuild/Prebuild.build +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Prebuild/Prebuild.sln b/Prebuild/Prebuild.sln deleted file mode 100644 index 449896b..0000000 --- a/Prebuild/Prebuild.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prebuild", "src\Prebuild.csproj", "{92E80C1C-0000-0000-0000-000000000000}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Prebuild/README b/Prebuild/README deleted file mode 100644 index eca6be1..0000000 --- a/Prebuild/README +++ /dev/null @@ -1,230 +0,0 @@ -Prebuild Instructions - -Prebuild is an XML-driven pre-build tool allowing developers to easily generate project or make files for major IDE's and .NET development tools including: Visual Studio 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, SharpDevelop2, MonoDevelop, and NAnt. - -_________________________________________________________________________________ -Overview - -Prebuild can be either be run from the command line to generate the project and make files or you can execute the included batch (*.bat) and Unix Shell script (*.sh) files. -The Prebuild file - -_________________________________________________________________________________ -The currently supported developement tools and their associated batch and shell script files. - -Visual Studio .NET 2005 (VS2005.bat) -Visual Studio .NET 2003 (VS2003.bat) -Visual Studio .NET 2002 (VS2002.bat) -SharpDevelop (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/ -SharpDevelop2 (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/ -MonoDevelop (MonoDevelop.sh) - http://www.monodevelop.com/ -NAnt (nant.sh and nant.bat) - http://nant.sourceforge.net/ -Autotools (autotools.bat and autotools.sh) http://www.gnu.org. Only partial support - -Notes: -A Unix Shell script is provided for MonoDevelop, as this is more appropriate than a windows batch file. -Visual Studio .NET 2005 and the Visual Express IDE's can import solutions from older versions of Visual Studio .NET. -Makefiles are not currently supported. - -_________________________________________________________________________________ -Command Line Syntax: - -Example: ->Prebuild /target vs2003 - -This will generate the project files for Visual Studio.NET 2003 and place the redirect the log to a file named PrebuildLog.txt in the parent directory - - -The syntax structure is as below, where commandParameter is optional depending on the command and you can provide several option-value pairs. -Note: The '>' signified the command line, do not actually enter this manually - ->Prebuild /