aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--Common/OpenSim.Framework.Console/AssemblyInfo.cs31
-rw-r--r--Common/OpenSim.Framework.Console/ConsoleBase.cs166
-rw-r--r--Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs12
-rw-r--r--Common/OpenSim.Framework.Console/MainConsole.cs48
-rw-r--r--Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj89
-rw-r--r--Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj.user12
-rw-r--r--Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build42
-rw-r--r--Common/OpenSim.Framework/AgentInventory.cs251
-rw-r--r--Common/OpenSim.Framework/BlockingQueue.cs33
-rw-r--r--Common/OpenSim.Framework/HeightMapGenHills.cs149
-rw-r--r--Common/OpenSim.Framework/Interfaces/IAssetServer.cs68
-rw-r--r--Common/OpenSim.Framework/Interfaces/IClientAPI.cs35
-rw-r--r--Common/OpenSim.Framework/Interfaces/IConfig.cs76
-rw-r--r--Common/OpenSim.Framework/Interfaces/IGenericConfig.cs15
-rw-r--r--Common/OpenSim.Framework/Interfaces/IGridConfig.cs64
-rw-r--r--Common/OpenSim.Framework/Interfaces/IGridServer.cs81
-rw-r--r--Common/OpenSim.Framework/Interfaces/ILocalStorage.cs54
-rw-r--r--Common/OpenSim.Framework/Interfaces/IScriptAPI.cs14
-rw-r--r--Common/OpenSim.Framework/Interfaces/IScriptEngine.cs14
-rw-r--r--Common/OpenSim.Framework/Interfaces/IUserConfig.cs58
-rw-r--r--Common/OpenSim.Framework/Interfaces/IUserServer.cs15
-rw-r--r--Common/OpenSim.Framework/Interfaces/LocalGridBase.cs24
-rw-r--r--Common/OpenSim.Framework/Interfaces/RemoteGridBase.cs37
-rw-r--r--Common/OpenSim.Framework/LoginService.cs14
-rw-r--r--Common/OpenSim.Framework/OpenSim.Framework.csproj194
-rw-r--r--Common/OpenSim.Framework/OpenSim.Framework.csproj.user12
-rw-r--r--Common/OpenSim.Framework/OpenSim.Framework.dll.build75
-rw-r--r--Common/OpenSim.Framework/Properties/AssemblyInfo.cs33
-rw-r--r--Common/OpenSim.Framework/Remoting.cs109
-rw-r--r--Common/OpenSim.Framework/SimProfile.cs83
-rw-r--r--Common/OpenSim.Framework/SimProfileBase.cs27
-rw-r--r--Common/OpenSim.Framework/Types/AgentCiruitData.cs22
-rw-r--r--Common/OpenSim.Framework/Types/AssetBase.cs22
-rw-r--r--Common/OpenSim.Framework/Types/AssetLandmark.cs34
-rw-r--r--Common/OpenSim.Framework/Types/AssetStorage.cs23
-rw-r--r--Common/OpenSim.Framework/Types/Login.cs24
-rw-r--r--Common/OpenSim.Framework/Types/NeighbourInfo.cs19
-rw-r--r--Common/OpenSim.Framework/Types/OSVector3.cs18
-rw-r--r--Common/OpenSim.Framework/Types/PrimData.cs173
-rw-r--r--Common/OpenSim.Framework/UserProfile.cs62
-rw-r--r--Common/OpenSim.Framework/UserProfileManager.cs272
-rw-r--r--Common/OpenSim.Framework/UserProfileManagerBase.cs124
-rw-r--r--Common/OpenSim.Framework/Util.cs151
-rw-r--r--Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj93
-rw-r--r--Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj.user12
-rw-r--r--Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build42
-rw-r--r--Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs35
-rw-r--r--Common/OpenSim.GenericConfig/Xml/XmlConfig.cs109
-rw-r--r--Common/OpenSim.Servers/BaseHttpServer.cs256
-rw-r--r--Common/OpenSim.Servers/BaseServer.cs10
-rw-r--r--Common/OpenSim.Servers/CheckSumServer.cs113
-rw-r--r--Common/OpenSim.Servers/IRestHandler.cs8
-rw-r--r--Common/OpenSim.Servers/LocalUserProfileManager.cs123
-rw-r--r--Common/OpenSim.Servers/LoginResponse.cs670
-rw-r--r--Common/OpenSim.Servers/LoginServer.cs284
-rw-r--r--Common/OpenSim.Servers/OpenSim.Servers.csproj130
-rw-r--r--Common/OpenSim.Servers/OpenSim.Servers.csproj.user12
-rw-r--r--Common/OpenSim.Servers/OpenSim.Servers.dll.build52
-rw-r--r--Common/OpenSim.Servers/UDPServerBase.cs68
-rw-r--r--Common/OpenSim.Servers/XmlRpcMethod.cs7
-rw-r--r--Common/XmlRpcCS/Logger.cs46
-rw-r--r--Common/XmlRpcCS/SimpleHttpRequest.cs204
-rw-r--r--Common/XmlRpcCS/XMLRPC.csproj138
-rw-r--r--Common/XmlRpcCS/XMLRPC.csproj.user12
-rw-r--r--Common/XmlRpcCS/XMLRPC.dll.build58
-rw-r--r--Common/XmlRpcCS/XmlRpcBoxcarRequest.cs51
-rw-r--r--Common/XmlRpcCS/XmlRpcClientProxy.cs61
-rw-r--r--Common/XmlRpcCS/XmlRpcDeserializer.cs195
-rw-r--r--Common/XmlRpcCS/XmlRpcErrorCodes.cs51
-rw-r--r--Common/XmlRpcCS/XmlRpcException.cs39
-rw-r--r--Common/XmlRpcCS/XmlRpcExposedAttribute.cs60
-rw-r--r--Common/XmlRpcCS/XmlRpcRequest.cs150
-rw-r--r--Common/XmlRpcCS/XmlRpcRequestDeserializer.cs64
-rw-r--r--Common/XmlRpcCS/XmlRpcRequestSerializer.cs51
-rw-r--r--Common/XmlRpcCS/XmlRpcResponder.cs98
-rw-r--r--Common/XmlRpcCS/XmlRpcResponse.cs85
-rw-r--r--Common/XmlRpcCS/XmlRpcResponseDeserializer.cs65
-rw-r--r--Common/XmlRpcCS/XmlRpcResponseSerializer.cs57
-rw-r--r--Common/XmlRpcCS/XmlRpcSerializer.cs109
-rw-r--r--Common/XmlRpcCS/XmlRpcServer.cs239
-rw-r--r--Common/XmlRpcCS/XmlRpcSystemObject.cs252
-rw-r--r--Common/XmlRpcCS/XmlRpcXmlTokens.cs76
-rw-r--r--OpenGridServices.build100
-rw-r--r--OpenGridServices.sln85
-rw-r--r--OpenGridServices.suobin0 -> 137216 bytes
-rw-r--r--OpenGridServices/OpenGrid.Config/GridConfigDb4o/AssemblyInfo.cs31
-rw-r--r--OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs112
-rw-r--r--OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj107
-rw-r--r--OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj.user12
-rw-r--r--OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build46
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs83
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oManager.cs111
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs100
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj111
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.user12
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build47
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs35
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLGridData.cs136
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs171
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj104
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj.user12
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build45
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MSSQL/Properties/AssemblyInfo.cs35
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs201
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs270
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs153
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj111
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj.user12
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build47
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MySQL/Properties/AssemblyInfo.cs35
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.csproj108
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.csproj.user12
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build46
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.SQLite/Properties/AssemblyInfo.cs35
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteGridData.cs136
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteManager.cs172
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data/GridData.cs83
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs73
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj107
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.user12
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build47
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs35
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs84
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data/UserData.cs101
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs54
-rw-r--r--OpenGridServices/OpenGrid.Framework.Manager/GridManagementAgent.cs76
-rw-r--r--OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs50
-rw-r--r--OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj99
-rw-r--r--OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj.user12
-rw-r--r--OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build44
-rw-r--r--OpenGridServices/OpenGridServices.AssetServer/AssetHttpServer.cs92
-rw-r--r--OpenGridServices/OpenGridServices.AssetServer/Main.cs337
-rw-r--r--OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj125
-rw-r--r--OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj.user12
-rw-r--r--OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build50
-rw-r--r--OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj126
-rw-r--r--OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build49
-rw-r--r--OpenGridServices/OpenGridServices.AssetServer/Properties/AssemblyInfo.cs33
-rw-r--r--OpenGridServices/OpenGridServices.GridServer/GridManager.cs474
-rw-r--r--OpenGridServices/OpenGridServices.GridServer/Main.cs272
-rw-r--r--OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj134
-rw-r--r--OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj.user12
-rw-r--r--OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build52
-rw-r--r--OpenGridServices/OpenGridServices.GridServer/Properties/AssemblyInfo.cs33
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.mds16
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.userprefs39
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.usertasks2
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/AssemblyInfo.cs32
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/BlockingQueue.cs33
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Connect to grid server.cs16
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs29
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs106
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs96
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs76
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp43
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.pidbbin0 -> 12308 bytes
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/RegionBlock.cs37
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs133
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs226
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs256
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/generated.cs35
-rw-r--r--OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic502
-rw-r--r--OpenGridServices/OpenGridServices.UserServer/Main.cs217
-rw-r--r--OpenGridServices/OpenGridServices.UserServer/OGS-UserServer.csproj63
-rw-r--r--OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj128
-rw-r--r--OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj.user12
-rw-r--r--OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build51
-rw-r--r--OpenGridServices/OpenGridServices.UserServer/Properties/AssemblyInfo.cs33
-rw-r--r--OpenGridServices/OpenGridServices.UserServer/UserManager.cs597
-rw-r--r--OpenGridServices/OpenUser.Config/UserConfigDb4o/AssemblyInfo.cs31
-rw-r--r--OpenGridServices/OpenUser.Config/UserConfigDb4o/DbUserConfig.cs95
-rw-r--r--OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj107
-rw-r--r--OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj.user12
-rw-r--r--OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build46
-rw-r--r--OpenGridServices/SQL/mysql-agents.sql24
-rw-r--r--OpenGridServices/SQL/mysql-regions.sql29
-rw-r--r--OpenGridServices/SQL/mysql-users.sql34
-rw-r--r--OpenGridServices/ServiceManager/ServiceManager.cs160
-rw-r--r--OpenGridServices/ServiceManager/ServiceManager.csproj95
-rw-r--r--OpenGridServices/ServiceManager/ServiceManager.csproj.user12
-rw-r--r--OpenGridServices/ServiceManager/ServiceManager.exe.build41
-rw-r--r--OpenSim.FxCop7241
-rw-r--r--OpenSim.build118
-rw-r--r--OpenSim.sln121
-rw-r--r--OpenSim.suobin0 -> 331264 bytes
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Local/AssemblyInfo.cs31
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Local/LocalAssetServer.cs271
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Local/LocalGridServer.cs157
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj110
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj.user12
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build46
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Remote/AssemblyInfo.cs31
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj112
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj.user12
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build46
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs108
-rw-r--r--OpenSim/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs210
-rw-r--r--OpenSim/OpenSim.Physics/BasicPhysicsPlugin/AssemblyInfo.cs31
-rw-r--r--OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs297
-rw-r--r--OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj93
-rw-r--r--OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj.user12
-rw-r--r--OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build42
-rw-r--r--OpenSim/OpenSim.Physics/Manager/AssemblyInfo.cs31
-rw-r--r--OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj112
-rw-r--r--OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj.user12
-rw-r--r--OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build47
-rw-r--r--OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs161
-rw-r--r--OpenSim/OpenSim.Physics/Manager/PhysicsManager.cs116
-rw-r--r--OpenSim/OpenSim.Physics/Manager/PhysicsScene.cs113
-rw-r--r--OpenSim/OpenSim.Physics/Manager/PhysicsVector.cs54
-rw-r--r--OpenSim/OpenSim.Physics/OdePlugin/AssemblyInfo.cs31
-rw-r--r--OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs452
-rw-r--r--OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj97
-rw-r--r--OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj.user12
-rw-r--r--OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build43
-rw-r--r--OpenSim/OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs31
-rw-r--r--OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj97
-rw-r--r--OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj.user12
-rw-r--r--OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build43
-rw-r--r--OpenSim/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs449
-rw-r--r--OpenSim/OpenSim.RegionServer/AgentAssetUpload.cs232
-rw-r--r--OpenSim/OpenSim.RegionServer/Assets/AssetCache.cs574
-rw-r--r--OpenSim/OpenSim.RegionServer/Assets/InventoryCache.cs336
-rw-r--r--OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs105
-rw-r--r--OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs31
-rw-r--r--OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs46
-rw-r--r--OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs256
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.Grid.cs167
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs163
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs456
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.cs449
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientViewBase.cs299
-rw-r--r--OpenSim/OpenSim.RegionServer/Grid.cs90
-rw-r--r--OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj258
-rw-r--r--OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj.user12
-rw-r--r--OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build90
-rw-r--r--OpenSim/OpenSim.RegionServer/OpenSimMain.cs531
-rw-r--r--OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs18
-rw-r--r--OpenSim/OpenSim.RegionServer/PacketServer.cs88
-rw-r--r--OpenSim/OpenSim.RegionServer/RegionInfo.cs261
-rw-r--r--OpenSim/OpenSim.RegionServer/RegionInfoBase.cs32
-rw-r--r--OpenSim/OpenSim.RegionServer/RegionServerBase.cs103
-rw-r--r--OpenSim/OpenSim.RegionServer/UDPServer.cs205
-rw-r--r--OpenSim/OpenSim.RegionServer/VersionInfo.cs37
-rw-r--r--OpenSim/OpenSim.RegionServer/types/Mesh.cs28
-rw-r--r--OpenSim/OpenSim.RegionServer/types/Triangle.cs28
-rw-r--r--OpenSim/OpenSim.RegionServer/world/Avatar.Client.cs33
-rw-r--r--OpenSim/OpenSim.RegionServer/world/Avatar.Update.cs338
-rw-r--r--OpenSim/OpenSim.RegionServer/world/Avatar.cs438
-rw-r--r--OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs163
-rw-r--r--OpenSim/OpenSim.RegionServer/world/Entity.cs124
-rw-r--r--OpenSim/OpenSim.RegionServer/world/Primitive.cs570
-rw-r--r--OpenSim/OpenSim.RegionServer/world/Primitive2.cs491
-rw-r--r--OpenSim/OpenSim.RegionServer/world/SceneObject.cs77
-rw-r--r--OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs368
-rw-r--r--OpenSim/OpenSim.RegionServer/world/World.Scripting.cs124
-rw-r--r--OpenSim/OpenSim.RegionServer/world/World.cs657
-rw-r--r--OpenSim/OpenSim.RegionServer/world/WorldBase.cs176
-rw-r--r--OpenSim/OpenSim.RegionServer/world/scripting/IScriptContext.cs13
-rw-r--r--OpenSim/OpenSim.RegionServer/world/scripting/IScriptEntity.cs19
-rw-r--r--OpenSim/OpenSim.RegionServer/world/scripting/IScriptHandler.cs98
-rw-r--r--OpenSim/OpenSim.RegionServer/world/scripting/Script.cs26
-rw-r--r--OpenSim/OpenSim.RegionServer/world/scripting/ScriptFactory.cs8
-rw-r--r--OpenSim/OpenSim.RegionServer/world/scripting/Scripts/FollowRandomAvatar.cs37
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassInstance.cs18
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassRecord.cs476
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Heap.cs16
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Interpreter.cs108
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterLogic.cs400
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterMethods.cs141
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterReturn.cs13
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/MainMemory.cs18
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/MethodMemory.cs19
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Object.cs10
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj153
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj.user12
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build62
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSimJVM.cs134
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Stack.cs15
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/StackFrame.cs22
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Thread.cs88
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ArrayReference.cs10
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/BaseType.cs10
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ObjectReference.cs16
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Byte.cs10
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Char.cs10
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Float.cs16
-rw-r--r--OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Int.cs16
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs95
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj112
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.user12
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build46
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/AssemblyInfo.cs31
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs182
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs16
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj113
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj.user12
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build47
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDQuery.cs25
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj111
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj.user12
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build46
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs35
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs176
-rw-r--r--OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.csproj99
-rw-r--r--OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.csproj.user12
-rw-r--r--OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build44
-rw-r--r--OpenSim/OpenSim.Terrain.BasicTerrain/Properties/AssemblyInfo.cs35
-rw-r--r--OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs484
-rw-r--r--OpenSim/OpenSim/Application.cs95
-rw-r--r--OpenSim/OpenSim/OpenSim.csproj147
-rw-r--r--OpenSim/OpenSim/OpenSim.csproj.user13
-rw-r--r--OpenSim/OpenSim/OpenSim.exe.build52
-rw-r--r--OpenSim/OpenSim/OpenSimMain.cs533
-rw-r--r--Prebuild/Prebuild.build67
-rw-r--r--Prebuild/Prebuild.sln19
-rw-r--r--Prebuild/README230
-rw-r--r--Prebuild/TODO21
-rw-r--r--Prebuild/doc/prebuild-example1.xml300
-rw-r--r--Prebuild/doc/prebuild-example2.xml72
-rw-r--r--Prebuild/doc/prebuild-example3.xml113
-rw-r--r--Prebuild/doc/prebuild-example4.xml715
-rw-r--r--Prebuild/doc/prebuild-example5.xml187
-rw-r--r--Prebuild/prebuild2
-rw-r--r--Prebuild/scripts/Clean.bat2
-rw-r--r--Prebuild/scripts/Help.bat2
-rw-r--r--Prebuild/scripts/MonoDevelop.sh2
-rw-r--r--Prebuild/scripts/Prebuild.nsi231
-rw-r--r--Prebuild/scripts/SharpDevelop.bat4
-rw-r--r--Prebuild/scripts/SharpDevelop2.bat4
-rw-r--r--Prebuild/scripts/VS2002.bat4
-rw-r--r--Prebuild/scripts/VS2003.bat4
-rw-r--r--Prebuild/scripts/VS2005.bat4
-rw-r--r--Prebuild/scripts/autotools.bat4
-rw-r--r--Prebuild/scripts/autotools.sh2
-rw-r--r--Prebuild/scripts/nant.bat4
-rw-r--r--Prebuild/scripts/nant.sh2
-rw-r--r--Prebuild/src/App.icobin0 -> 4286 bytes
-rw-r--r--Prebuild/src/Core/Attributes/DataNodeAttribute.cs81
-rw-r--r--Prebuild/src/Core/Attributes/OptionNodeAttribute.cs80
-rw-r--r--Prebuild/src/Core/Attributes/TargetAttribute.cs80
-rw-r--r--Prebuild/src/Core/FatalException.cs94
-rw-r--r--Prebuild/src/Core/Interfaces/IDataNode.cs56
-rw-r--r--Prebuild/src/Core/Interfaces/ITarget.cs60
-rw-r--r--Prebuild/src/Core/Kernel.cs758
-rw-r--r--Prebuild/src/Core/Nodes/ConfigurationNode.cs177
-rw-r--r--Prebuild/src/Core/Nodes/DataNode.cs82
-rw-r--r--Prebuild/src/Core/Nodes/ExcludeNode.cs85
-rw-r--r--Prebuild/src/Core/Nodes/FileNode.cs238
-rw-r--r--Prebuild/src/Core/Nodes/FilesNode.cs222
-rw-r--r--Prebuild/src/Core/Nodes/MatchNode.cs299
-rw-r--r--Prebuild/src/Core/Nodes/OptionsNode.cs655
-rw-r--r--Prebuild/src/Core/Nodes/ProcessNode.cs119
-rw-r--r--Prebuild/src/Core/Nodes/ProjectNode.cs494
-rw-r--r--Prebuild/src/Core/Nodes/ReferenceNode.cs143
-rw-r--r--Prebuild/src/Core/Nodes/ReferencePathNode.cs98
-rw-r--r--Prebuild/src/Core/Nodes/SolutionNode.cs284
-rw-r--r--Prebuild/src/Core/Parse/IfContext.cs163
-rw-r--r--Prebuild/src/Core/Parse/Preprocessor.cs519
-rw-r--r--Prebuild/src/Core/Targets/AutotoolsTarget.cs926
-rw-r--r--Prebuild/src/Core/Targets/DebugTarget.cs102
-rw-r--r--Prebuild/src/Core/Targets/MonoDevelopTarget.cs458
-rw-r--r--Prebuild/src/Core/Targets/NAntTarget.cs621
-rw-r--r--Prebuild/src/Core/Targets/SharpDevelop2Target.cs90
-rw-r--r--Prebuild/src/Core/Targets/SharpDevelopTarget.cs437
-rw-r--r--Prebuild/src/Core/Targets/VS2002Target.cs96
-rw-r--r--Prebuild/src/Core/Targets/VS2003Target.cs633
-rw-r--r--Prebuild/src/Core/Targets/VS2005Target.cs883
-rw-r--r--Prebuild/src/Core/UnknownLanguageException.cs63
-rw-r--r--Prebuild/src/Core/Utilities/CommandLineCollection.cs162
-rw-r--r--Prebuild/src/Core/Utilities/CurrentDirectory.cs89
-rw-r--r--Prebuild/src/Core/Utilities/Helper.cs661
-rw-r--r--Prebuild/src/Core/Utilities/Log.cs279
-rw-r--r--Prebuild/src/Core/WarningException.cs93
-rw-r--r--Prebuild/src/Prebuild.cs165
-rw-r--r--Prebuild/src/Prebuild.csproj205
-rw-r--r--Prebuild/src/Prebuild.csproj.user12
-rw-r--r--Prebuild/src/Prebuild.exe.build80
-rw-r--r--Prebuild/src/Prebuild.snkbin0 -> 596 bytes
-rw-r--r--Prebuild/src/Properties/AssemblyInfo.cs101
-rw-r--r--Prebuild/src/data/dnpb-1.0.xsd183
-rw-r--r--Prebuild/src/data/dnpb-1.1.xsd184
-rw-r--r--Prebuild/src/data/dnpb-1.2.xsd198
-rw-r--r--Prebuild/src/data/dnpb-1.3.xsd206
-rw-r--r--Prebuild/src/data/dnpb-1.4.xsd212
-rw-r--r--Prebuild/src/data/dnpb-1.5.xsd215
-rw-r--r--Prebuild/src/data/prebuild-1.6.xsd231
-rw-r--r--Prebuild/src/data/prebuild-1.7.xsd261
-rw-r--r--libraries/libLSL/Properties/AssemblyInfo.cs35
-rw-r--r--libraries/libLSL/libLSL.csproj49
-rw-r--r--libraries/libLSL/lsl.cs329
-rw-r--r--libraries/libLSL/lslByteCode.cs133
-rw-r--r--libraries/libLSL/lslscript.cs10
-rw-r--r--prebuild.xml882
-rw-r--r--releng/CAUTION4
-rw-r--r--releng/README3
-rw-r--r--releng/createreldir.sh9
-rw-r--r--releng/dist/INSTALL33
-rw-r--r--releng/dist/README70
-rw-r--r--releng/dist/bin/OpenSim3
-rw-r--r--releng/dobuild.sh20
-rw-r--r--releng/makerel.sh30
-rw-r--r--releng/parsetmpl.sh5
-rw-r--r--releng/templates/VersionInfo.cs.tmpl37
-rw-r--r--runprebuild.bat2
406 files changed, 56401 insertions, 0 deletions
diff --git a/Common/OpenSim.Framework.Console/AssemblyInfo.cs b/Common/OpenSim.Framework.Console/AssemblyInfo.cs
new file mode 100644
index 0000000..00a9b7d
--- /dev/null
+++ b/Common/OpenSim.Framework.Console/AssemblyInfo.cs
@@ -0,0 +1,31 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// Information about this assembly is defined by the following
6// attributes.
7//
8// change them to the information which is associated with the assembly
9// you compile.
10
11[assembly: AssemblyTitle("ServerConsole")]
12[assembly: AssemblyDescription("")]
13[assembly: AssemblyConfiguration("")]
14[assembly: AssemblyCompany("")]
15[assembly: AssemblyProduct("ServerConsole")]
16[assembly: AssemblyCopyright("")]
17[assembly: AssemblyTrademark("")]
18[assembly: AssemblyCulture("")]
19
20// This sets the default COM visibility of types in the assembly to invisible.
21// If you need to expose a type to COM, use [ComVisible(true)] on that type.
22[assembly: ComVisible(false)]
23
24// The assembly version has following format :
25//
26// Major.Minor.Build.Revision
27//
28// You can specify all values by your own or you can build default build and revision
29// numbers with the '*' character (the default):
30
31[assembly: AssemblyVersion("1.0.*")]
diff --git a/Common/OpenSim.Framework.Console/ConsoleBase.cs b/Common/OpenSim.Framework.Console/ConsoleBase.cs
new file mode 100644
index 0000000..6a1c53c
--- /dev/null
+++ b/Common/OpenSim.Framework.Console/ConsoleBase.cs
@@ -0,0 +1,166 @@
1using System;
2using System.IO;
3
4namespace OpenSim.Framework.Console
5{
6 public enum LogPriority : int
7 {
8 CRITICAL,
9 HIGH,
10 MEDIUM,
11 NORMAL,
12 LOW,
13 VERBOSE,
14 EXTRAVERBOSE
15 }
16
17 public class ConsoleBase
18 {
19 StreamWriter Log;
20 public conscmd_callback cmdparser;
21 public string componentname;
22 private bool m_silent;
23
24 public ConsoleBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent )
25 {
26 this.componentname = componentname;
27 this.cmdparser = cmdparser;
28 this.m_silent = silent;
29 System.Console.WriteLine("ServerConsole.cs - creating new local console");
30 System.Console.WriteLine("Logs will be saved to current directory in " + LogFile);
31 Log = File.AppendText(LogFile);
32 Log.WriteLine("========================================================================");
33 Log.WriteLine(componentname + " Started at " + DateTime.Now.ToString());
34 }
35
36 public void Close()
37 {
38 Log.WriteLine("Shutdown at " + DateTime.Now.ToString());
39 Log.Close();
40 }
41
42 public void Write(string format, params object[] args)
43 {
44 WriteLine(LogPriority.NORMAL,format,args);
45 return;
46 }
47
48 [Obsolete("WriteLine(msg,args) has been depreciated, use WriteLine(priority,msg,args) instead.")]
49 public void WriteLine(string format, params object[] args)
50 {
51 Log.WriteLine(format, args);
52 Log.Flush();
53 if(!m_silent)
54 {
55 System.Console.WriteLine(format, args);
56 }
57 return;
58 }
59
60 public void WriteLine(LogPriority importance, string format, params object[] args)
61 {
62 Log.WriteLine(format, args);
63 Log.Flush();
64 if (!m_silent)
65 {
66 System.Console.WriteLine(format, args);
67 }
68 return;
69 }
70
71 public string ReadLine()
72 {
73 string TempStr = System.Console.ReadLine();
74 Log.WriteLine(TempStr);
75 return TempStr;
76 }
77
78 public int Read()
79 {
80 int TempInt = System.Console.Read();
81 Log.Write((char)TempInt);
82 return TempInt;
83 }
84
85 // Displays a prompt and waits for the user to enter a string, then returns that string
86 // Done with no echo and suitable for passwords
87 public string PasswdPrompt(string prompt)
88 {
89 // FIXME: Needs to be better abstracted
90 Log.WriteLine(prompt);
91 this.Write(prompt);
92 ConsoleColor oldfg = System.Console.ForegroundColor;
93 System.Console.ForegroundColor = System.Console.BackgroundColor;
94 string temp = System.Console.ReadLine();
95 System.Console.ForegroundColor = oldfg;
96 return temp;
97 }
98
99 // Displays a command prompt and waits for the user to enter a string, then returns that string
100 public string CmdPrompt(string prompt)
101 {
102 this.Write(String.Format("{0}: ", prompt));
103 return this.ReadLine();
104 }
105
106 // Displays a command prompt and returns a default value if the user simply presses enter
107 public string CmdPrompt(string prompt, string defaultresponse)
108 {
109 string temp = CmdPrompt(String.Format( "{0} [{1}]", prompt, defaultresponse ));
110 if (temp == "")
111 {
112 return defaultresponse;
113 }
114 else
115 {
116 return temp;
117 }
118 }
119
120 // Displays a command prompt and returns a default value, user may only enter 1 of 2 options
121 public string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB)
122 {
123 bool itisdone = false;
124 string temp = CmdPrompt(prompt, defaultresponse);
125 while (itisdone == false)
126 {
127 if ((temp == OptionA) || (temp == OptionB))
128 {
129 itisdone = true;
130 }
131 else
132 {
133 this.WriteLine(LogPriority.MEDIUM,"Valid options are " + OptionA + " or " + OptionB);
134 temp = CmdPrompt(prompt, defaultresponse);
135 }
136 }
137 return temp;
138 }
139
140 // Runs a command with a number of parameters
141 public Object RunCmd(string Cmd, string[] cmdparams)
142 {
143 cmdparser.RunCmd(Cmd, cmdparams);
144 return null;
145 }
146
147 // Shows data about something
148 public void ShowCommands(string ShowWhat)
149 {
150 cmdparser.Show(ShowWhat);
151 }
152
153 public void MainConsolePrompt()
154 {
155 string[] tempstrarray;
156 string tempstr = this.CmdPrompt(this.componentname + "# ");
157 tempstrarray = tempstr.Split(' ');
158 string cmd = tempstrarray[0];
159 Array.Reverse(tempstrarray);
160 Array.Resize<string>(ref tempstrarray, tempstrarray.Length - 1);
161 Array.Reverse(tempstrarray);
162 string[] cmdparams = (string[])tempstrarray;
163 RunCmd(cmd, cmdparams);
164 }
165 }
166}
diff --git a/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs b/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs
new file mode 100644
index 0000000..bb589d2
--- /dev/null
+++ b/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs
@@ -0,0 +1,12 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework.Console
6{
7 public interface conscmd_callback
8 {
9 void RunCmd(string cmd, string[] cmdparams);
10 void Show(string ShowWhat);
11 }
12}
diff --git a/Common/OpenSim.Framework.Console/MainConsole.cs b/Common/OpenSim.Framework.Console/MainConsole.cs
new file mode 100644
index 0000000..02c4ae8
--- /dev/null
+++ b/Common/OpenSim.Framework.Console/MainConsole.cs
@@ -0,0 +1,48 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28
29namespace OpenSim.Framework.Console
30{
31 public class MainConsole {
32
33 private static ConsoleBase instance;
34
35 public static ConsoleBase Instance
36 {
37 get
38 {
39 return instance;
40 }
41 set
42 {
43 instance = value;
44 }
45 }
46 }
47
48}
diff --git a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj
new file mode 100644
index 0000000..7af0eca
--- /dev/null
+++ b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj
@@ -0,0 +1,89 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{A7CD0630-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Framework.Console</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Framework.Console</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 </ItemGroup>
66 <ItemGroup>
67 </ItemGroup>
68 <ItemGroup>
69 <Compile Include="AssemblyInfo.cs">
70 <SubType>Code</SubType>
71 </Compile>
72 <Compile Include="ConsoleBase.cs">
73 <SubType>Code</SubType>
74 </Compile>
75 <Compile Include="ConsoleCallbacksBase.cs">
76 <SubType>Code</SubType>
77 </Compile>
78 <Compile Include="MainConsole.cs">
79 <SubType>Code</SubType>
80 </Compile>
81 </ItemGroup>
82 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
83 <PropertyGroup>
84 <PreBuildEvent>
85 </PreBuildEvent>
86 <PostBuildEvent>
87 </PostBuildEvent>
88 </PropertyGroup>
89</Project>
diff --git a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj.user b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build
new file mode 100644
index 0000000..9a03b54
--- /dev/null
+++ b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build
@@ -0,0 +1,42 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Framework.Console" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Framework.Console" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="ConsoleBase.cs" />
16 <include name="ConsoleCallbacksBase.cs" />
17 <include name="MainConsole.cs" />
18 </sources>
19 <references basedir="${project::get-base-directory()}">
20 <lib>
21 <include name="${project::get-base-directory()}" />
22 <include name="${project::get-base-directory()}/${build.dir}" />
23 </lib>
24 <include name="System.dll" />
25 </references>
26 </csc>
27 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
28 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
29 <copy todir="${project::get-base-directory()}/../../bin/">
30 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
31 <include name="*.dll"/>
32 <include name="*.exe"/>
33 </fileset>
34 </copy>
35 </target>
36 <target name="clean">
37 <delete dir="${bin.dir}" failonerror="false" />
38 <delete dir="${obj.dir}" failonerror="false" />
39 </target>
40 <target name="doc" description="Creates documentation.">
41 </target>
42</project>
diff --git a/Common/OpenSim.Framework/AgentInventory.cs b/Common/OpenSim.Framework/AgentInventory.cs
new file mode 100644
index 0000000..b28645e
--- /dev/null
+++ b/Common/OpenSim.Framework/AgentInventory.cs
@@ -0,0 +1,251 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using libsecondlife.Packets;
6using OpenSim.Framework.Types;
7using OpenSim.Framework.Utilities;
8
9namespace OpenSim.Framework.Inventory
10{
11 public class AgentInventory
12 {
13 //Holds the local copy of Inventory info for a agent
14 public Dictionary<LLUUID, InventoryFolder> InventoryFolders;
15 public Dictionary<LLUUID, InventoryItem> InventoryItems;
16 public InventoryFolder InventoryRoot;
17 public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server
18 public LLUUID AgentID;
19 public AvatarWearable[] Wearables;
20
21 public AgentInventory()
22 {
23 InventoryFolders = new Dictionary<LLUUID, InventoryFolder>();
24 InventoryItems = new Dictionary<LLUUID, InventoryItem>();
25 this.Initialise();
26 }
27
28 public virtual void Initialise()
29 {
30 Wearables = new AvatarWearable[13]; //should be 12 of these
31 for (int i = 0; i < 13; i++)
32 {
33 Wearables[i] = new AvatarWearable();
34 }
35
36 }
37
38 public bool CreateNewFolder(LLUUID folderID, ushort type)
39 {
40 InventoryFolder Folder = new InventoryFolder();
41 Folder.FolderID = folderID;
42 Folder.OwnerID = this.AgentID;
43 Folder.DefaultType = type;
44 this.InventoryFolders.Add(Folder.FolderID, Folder);
45 return (true);
46 }
47
48 public void CreateRootFolder(LLUUID newAgentID, bool createTextures)
49 {
50 this.AgentID = newAgentID;
51 InventoryRoot = new InventoryFolder();
52 InventoryRoot.FolderID = LLUUID.Random();
53 InventoryRoot.ParentID = new LLUUID();
54 InventoryRoot.Version = 1;
55 InventoryRoot.DefaultType = 8;
56 InventoryRoot.OwnerID = this.AgentID;
57 InventoryRoot.FolderName = "My Inventory";
58 InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot);
59 InventoryRoot.OwnerID = this.AgentID;
60 if (createTextures)
61 {
62 this.CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID);
63 }
64 }
65
66 public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName)
67 {
68 InventoryFolder Folder = new InventoryFolder();
69 Folder.FolderID = folderID;
70 Folder.OwnerID = this.AgentID;
71 Folder.DefaultType = type;
72 Folder.FolderName = folderName;
73 this.InventoryFolders.Add(Folder.FolderID, Folder);
74
75 return (true);
76 }
77
78 public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent)
79 {
80 if (!this.InventoryFolders.ContainsKey(folderID))
81 {
82 Console.WriteLine("creating new folder called " + folderName + " in agents inventory");
83 InventoryFolder Folder = new InventoryFolder();
84 Folder.FolderID = folderID;
85 Folder.OwnerID = this.AgentID;
86 Folder.DefaultType = type;
87 Folder.FolderName = folderName;
88 Folder.ParentID = parent;
89 this.InventoryFolders.Add(Folder.FolderID, Folder);
90 }
91
92 return (true);
93 }
94
95 public bool HasFolder(LLUUID folderID)
96 {
97 if (this.InventoryFolders.ContainsKey(folderID))
98 {
99 return true;
100 }
101 return false;
102 }
103
104 public LLUUID GetFolderID(string folderName)
105 {
106 foreach (InventoryFolder inv in this.InventoryFolders.Values)
107 {
108 if (inv.FolderName == folderName)
109 {
110 return inv.FolderID;
111 }
112 }
113
114 return LLUUID.Zero;
115 }
116
117 public bool UpdateItemAsset(LLUUID itemID, AssetBase asset)
118 {
119 if(this.InventoryItems.ContainsKey(itemID))
120 {
121 InventoryItem Item = this.InventoryItems[itemID];
122 Item.AssetID = asset.FullID;
123 Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated());
124 //TODO need to update the rest of the info
125 }
126 return true;
127 }
128
129 public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet)
130 {
131 Console.WriteLine("updating inventory item details");
132 if (this.InventoryItems.ContainsKey(itemID))
133 {
134 Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name));
135 InventoryItem Item = this.InventoryItems[itemID];
136 Item.Name = Util.FieldToString(packet.Name);
137 Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated());
138 //TODO need to update the rest of the info
139 }
140 return true;
141 }
142
143 public LLUUID AddToInventory(LLUUID folderID, AssetBase asset)
144 {
145 if (this.InventoryFolders.ContainsKey(folderID))
146 {
147 LLUUID NewItemID = LLUUID.Random();
148
149 InventoryItem Item = new InventoryItem();
150 Item.FolderID = folderID;
151 Item.OwnerID = AgentID;
152 Item.AssetID = asset.FullID;
153 Item.ItemID = NewItemID;
154 Item.Type = asset.Type;
155 Item.Name = asset.Name;
156 Item.Description = asset.Description;
157 Item.InvType = asset.InvType;
158 this.InventoryItems.Add(Item.ItemID, Item);
159 InventoryFolder Folder = InventoryFolders[Item.FolderID];
160 Folder.Items.Add(Item);
161 return (Item.ItemID);
162 }
163 else
164 {
165 return (null);
166 }
167 }
168
169 public bool DeleteFromInventory(LLUUID itemID)
170 {
171 bool res = false;
172 if (this.InventoryItems.ContainsKey(itemID))
173 {
174 InventoryItem item = this.InventoryItems[itemID];
175 this.InventoryItems.Remove(itemID);
176 foreach (InventoryFolder fold in InventoryFolders.Values)
177 {
178 if (fold.Items.Contains(item))
179 {
180 fold.Items.Remove(item);
181 break;
182 }
183 }
184 res = true;
185
186 }
187 return res;
188 }
189 }
190
191 public class InventoryFolder
192 {
193 public List<InventoryItem> Items;
194 //public List<InventoryFolder> Subfolders;
195 public LLUUID FolderID;
196 public LLUUID OwnerID;
197 public LLUUID ParentID = LLUUID.Zero;
198 public string FolderName;
199 public ushort DefaultType;
200 public ushort Version;
201
202 public InventoryFolder()
203 {
204 Items = new List<InventoryItem>();
205 //Subfolders = new List<InventoryFolder>();
206 }
207
208 }
209
210 public class InventoryItem
211 {
212 public LLUUID FolderID;
213 public LLUUID OwnerID;
214 public LLUUID ItemID;
215 public LLUUID AssetID;
216 public LLUUID CreatorID;
217 public sbyte InvType;
218 public sbyte Type;
219 public string Name ="";
220 public string Description;
221
222 public InventoryItem()
223 {
224 this.CreatorID = LLUUID.Zero;
225 }
226
227 public string ExportString()
228 {
229 string typ = "notecard";
230 string result = "";
231 result += "\tinv_object\t0\n\t{\n";
232 result += "\t\tobj_id\t%s\n";
233 result += "\t\tparent_id\t"+ ItemID.ToString() +"\n";
234 result += "\t\ttype\t"+ typ +"\n";
235 result += "\t\tname\t" + Name+"|\n";
236 result += "\t}\n";
237 return result;
238 }
239 }
240
241 public class AvatarWearable
242 {
243 public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000");
244 public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000");
245
246 public AvatarWearable()
247 {
248
249 }
250 }
251}
diff --git a/Common/OpenSim.Framework/BlockingQueue.cs b/Common/OpenSim.Framework/BlockingQueue.cs
new file mode 100644
index 0000000..f840354
--- /dev/null
+++ b/Common/OpenSim.Framework/BlockingQueue.cs
@@ -0,0 +1,33 @@
1using System;
2using System.Threading;
3using System.Collections.Generic;
4using System.Text;
5
6namespace OpenSim.Framework.Utilities
7{
8 public class BlockingQueue<T>
9 {
10 private Queue<T> _queue = new Queue<T>();
11 private object _queueSync = new object();
12
13 public void Enqueue(T value)
14 {
15 lock (_queueSync)
16 {
17 _queue.Enqueue(value);
18 Monitor.Pulse(_queueSync);
19 }
20 }
21
22 public T Dequeue()
23 {
24 lock (_queueSync)
25 {
26 if (_queue.Count < 1)
27 Monitor.Wait(_queueSync);
28
29 return _queue.Dequeue();
30 }
31 }
32 }
33}
diff --git a/Common/OpenSim.Framework/HeightMapGenHills.cs b/Common/OpenSim.Framework/HeightMapGenHills.cs
new file mode 100644
index 0000000..6a729da
--- /dev/null
+++ b/Common/OpenSim.Framework/HeightMapGenHills.cs
@@ -0,0 +1,149 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using System;
29
30namespace OpenSim.Framework.Terrain
31{
32 public class HeightmapGenHills
33 {
34 private Random Rand = new Random();
35 private int NumHills;
36 private float HillMin;
37 private float HillMax;
38 private bool Island;
39 private float[] heightmap;
40
41 public float[] GenerateHeightmap(int numHills, float hillMin, float hillMax, bool island)
42 {
43 NumHills = numHills;
44 HillMin = hillMin;
45 HillMax = hillMax;
46 Island = island;
47
48 heightmap = new float[256 * 256];
49
50 for (int i = 0; i < numHills; i++)
51 {
52 AddHill();
53 }
54
55 Normalize();
56
57 return heightmap;
58 }
59
60 private void AddHill()
61 {
62 float x, y;
63 float radius = RandomRange(HillMin, HillMax);
64
65 if (Island)
66 {
67 // Which direction from the center of the map the hill is placed
68 float theta = RandomRange(0, 6.28f);
69
70 // How far from the center of the map to place the hill. The radius
71 // is subtracted from the range to prevent any part of the hill from
72 // reaching the edge of the map
73 float distance = RandomRange(radius / 2.0f, 128.0f - radius);
74
75 x = 128.0f + (float)Math.Cos(theta) * distance;
76 y = 128.0f + (float)Math.Sin(theta) * distance;
77 }
78 else
79 {
80 x = RandomRange(-radius, 256.0f + radius);
81 y = RandomRange(-radius, 256.0f + radius);
82 }
83
84 float radiusSq = radius * radius;
85 float distSq;
86 float height;
87
88 int xMin = (int)(x - radius) - 1;
89 int xMax = (int)(x + radius) + 1;
90 if (xMin < 0) xMin = 0;
91 if (xMax > 255) xMax = 255;
92
93 int yMin = (int)(y - radius) - 1;
94 int yMax = (int)(y + radius) + 1;
95 if (yMin < 0) yMin = 0;
96 if (yMax > 255) yMax = 255;
97
98 // Loop through each affected cell and determine the height at that point
99 for (int v = yMin; v <= yMax; ++v)
100 {
101 float fv = (float)v;
102
103 for (int h = xMin; h <= xMax; ++h)
104 {
105 float fh = (float)h;
106
107 // Determine how far from the center of this hill this point is
108 distSq = (x - fh) * (x - fh) + (y - fv) * (y - fv);
109 height = radiusSq - distSq;
110
111 // Don't add negative hill values
112 if (height > 0.0f) heightmap[h + v * 256] += height;
113 }
114 }
115 }
116
117 private void Normalize()
118 {
119 float min = heightmap[0];
120 float max = heightmap[0];
121
122 for (int x = 0; x < 256; x++)
123 {
124 for (int y = 0; y < 256; y++)
125 {
126 if (heightmap[x + y * 256] < min) min = heightmap[x + y * 256];
127 if (heightmap[x + y * 256] > max) max = heightmap[x + y * 256];
128 }
129 }
130
131 // Avoid a rare divide by zero
132 if (min != max)
133 {
134 for (int x = 0; x < 256; x++)
135 {
136 for (int y = 0; y < 256; y++)
137 {
138 heightmap[x + y * 256] = ((heightmap[x + y * 256] - min) / (max - min)) * (HillMax - HillMin);
139 }
140 }
141 }
142 }
143
144 private float RandomRange(float min, float max)
145 {
146 return (float)Rand.NextDouble() * (max - min) + min;
147 }
148 }
149}
diff --git a/Common/OpenSim.Framework/Interfaces/IAssetServer.cs b/Common/OpenSim.Framework/Interfaces/IAssetServer.cs
new file mode 100644
index 0000000..3f86acc
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/IAssetServer.cs
@@ -0,0 +1,68 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Net;
29using System.Net.Sockets;
30using System.IO;
31using System.Threading;
32using libsecondlife;
33using OpenSim.Framework.Types;
34
35namespace OpenSim.Framework.Interfaces
36{
37 /// <summary>
38 /// Description of IAssetServer.
39 /// </summary>
40
41 public interface IAssetServer
42 {
43 void SetReceiver(IAssetReceiver receiver);
44 void RequestAsset(LLUUID assetID, bool isTexture);
45 void UpdateAsset(AssetBase asset);
46 void UploadNewAsset(AssetBase asset);
47 void SetServerInfo(string ServerUrl, string ServerKey);
48 void Close();
49 }
50
51 // could change to delegate?
52 public interface IAssetReceiver
53 {
54 void AssetReceived(AssetBase asset, bool IsTexture);
55 void AssetNotFound(AssetBase asset);
56 }
57
58 public interface IAssetPlugin
59 {
60 IAssetServer GetAssetServer();
61 }
62
63 public struct ARequest
64 {
65 public LLUUID AssetID;
66 public bool IsTexture;
67 }
68}
diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
new file mode 100644
index 0000000..9f7b619
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
@@ -0,0 +1,35 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Inventory;
5using libsecondlife;
6using libsecondlife.Packets;
7using OpenSim.Framework.Types;
8
9namespace OpenSim.Framework.Interfaces
10{
11 public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
12 public delegate void RezObject(AssetBase primAsset, LLVector3 pos);
13 public delegate void ModifyTerrain(byte action, float north, float west);
14 public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam);
15 public delegate void StartAnim(LLUUID animID, int seq);
16 public delegate void LinkObjects(uint parent, List<uint> children);
17
18 public interface IClientAPI
19 {
20 event ChatFromViewer OnChatFromViewer;
21 event RezObject OnRezObject;
22 event ModifyTerrain OnModifyTerrain;
23 event SetAppearance OnSetAppearance;
24 event StartAnim OnStartAnim;
25 event LinkObjects OnLinkObjects;
26
27 LLVector3 StartPos
28 {
29 get;
30 set;
31 }
32 void SendAppearance(AvatarWearable[] wearables);
33 void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
34 }
35}
diff --git a/Common/OpenSim.Framework/Interfaces/IConfig.cs b/Common/OpenSim.Framework/Interfaces/IConfig.cs
new file mode 100644
index 0000000..7b4c040
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/IConfig.cs
@@ -0,0 +1,76 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3
4* Copyright (c) <year>, <copyright holder>
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.Collections.Generic;
32using System.IO;
33using libsecondlife;
34//using OpenSim.world;
35
36namespace OpenSim.Framework.Interfaces
37{
38 /// <summary>
39 /// This class handles connection to the underlying database used for configuration of the region.
40 /// Region content is also stored by this class. The main entry point is InitConfig() which attempts to locate
41 /// opensim.yap in the current working directory. If opensim.yap can not be found, default settings are loaded from
42 /// what is hardcoded here and then saved into opensim.yap for future startups.
43 /// </summary>
44
45
46 public abstract class SimConfig
47 {
48 public string RegionName;
49
50 public uint RegionLocX;
51 public uint RegionLocY;
52 public ulong RegionHandle;
53
54 public int IPListenPort;
55 public string IPListenAddr;
56
57 public string AssetURL;
58 public string AssetSendKey;
59
60 public string GridURL;
61 public string GridSendKey;
62 public string GridRecvKey;
63 public string UserURL;
64 public string UserSendKey;
65 public string UserRecvKey;
66
67 public abstract void InitConfig(bool sandboxMode);
68 public abstract void LoadFromGrid();
69
70 }
71
72 public interface ISimConfig
73 {
74 SimConfig GetConfigObject();
75 }
76}
diff --git a/Common/OpenSim.Framework/Interfaces/IGenericConfig.cs b/Common/OpenSim.Framework/Interfaces/IGenericConfig.cs
new file mode 100644
index 0000000..a853fe4
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/IGenericConfig.cs
@@ -0,0 +1,15 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework.Interfaces
6{
7 public interface IGenericConfig
8 {
9 void LoadData();
10 string GetAttribute(string attributeName);
11 bool SetAttribute(string attributeName, string attributeValue);
12 void Commit();
13 void Close();
14 }
15}
diff --git a/Common/OpenSim.Framework/Interfaces/IGridConfig.cs b/Common/OpenSim.Framework/Interfaces/IGridConfig.cs
new file mode 100644
index 0000000..b2f26da
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/IGridConfig.cs
@@ -0,0 +1,64 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3
4* Copyright (c) <year>, <copyright holder>
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.Collections.Generic;
32using System.IO;
33using libsecondlife;
34//using OpenSim.world;
35
36namespace OpenSim.Framework.Interfaces
37{
38 /// <summary>
39 /// </summary>
40
41
42 public abstract class GridConfig
43 {
44 public string GridOwner;
45 public string DefaultStartupMsg;
46 public string DefaultAssetServer;
47 public string AssetSendKey;
48 public string AssetRecvKey;
49 public string DefaultUserServer;
50 public string UserSendKey;
51 public string UserRecvKey;
52 public string SimSendKey;
53 public string SimRecvKey;
54
55
56 public abstract void InitConfig();
57
58 }
59
60 public interface IGridConfig
61 {
62 GridConfig GetConfigObject();
63 }
64}
diff --git a/Common/OpenSim.Framework/Interfaces/IGridServer.cs b/Common/OpenSim.Framework/Interfaces/IGridServer.cs
new file mode 100644
index 0000000..e67ea98
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/IGridServer.cs
@@ -0,0 +1,81 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28
29using System;
30using System.Collections;
31using System.Collections.Generic;
32using System.Net;
33using System.Net.Sockets;
34using System.IO;
35using libsecondlife;
36using OpenSim;
37using OpenSim.Framework.Types;
38
39namespace OpenSim.Framework.Interfaces
40{
41 /// <summary>
42 /// Handles connection to Grid Servers.
43 /// also Sim to Sim connections?
44 /// </summary>
45
46 public interface IGridServer
47 {
48 UUIDBlock RequestUUIDBlock();
49 NeighbourInfo[] RequestNeighbours(); //should return a array of neighbouring regions
50 AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
51 bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
52 string GetName();
53 bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port);
54 void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
55 IList RequestMapBlocks(int minX, int minY, int maxX, int maxY);
56 void Close();
57 }
58
59 public struct UUIDBlock
60 {
61 public LLUUID BlockStart;
62 public LLUUID BlockEnd;
63 }
64
65 public class AuthenticateResponse
66 {
67 public bool Authorised;
68 public Login LoginInfo;
69
70 public AuthenticateResponse()
71 {
72
73 }
74
75 }
76
77 public interface IGridPlugin
78 {
79 IGridServer GetGridServer();
80 }
81}
diff --git a/Common/OpenSim.Framework/Interfaces/ILocalStorage.cs b/Common/OpenSim.Framework/Interfaces/ILocalStorage.cs
new file mode 100644
index 0000000..4dd8868
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/ILocalStorage.cs
@@ -0,0 +1,54 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using System;
29using libsecondlife;
30using OpenSim.Framework.Types;
31
32namespace OpenSim.Framework.Interfaces
33{
34 /// <summary>
35 /// ILocalStorage. Really hacked together right now needs cleaning up
36 /// </summary>
37 public interface ILocalStorage
38 {
39 void Initialise(string datastore);
40 void StorePrim(PrimData prim);
41 void RemovePrim(LLUUID primID);
42 void LoadPrimitives(ILocalStorageReceiver receiver);
43 float[] LoadWorld();
44 void SaveMap(float[] heightmap);
45 void ShutDown();
46 }
47
48 public interface ILocalStorageReceiver
49 {
50 void PrimFromStorage(PrimData prim);
51 }
52
53}
54
diff --git a/Common/OpenSim.Framework/Interfaces/IScriptAPI.cs b/Common/OpenSim.Framework/Interfaces/IScriptAPI.cs
new file mode 100644
index 0000000..3ad0f06
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/IScriptAPI.cs
@@ -0,0 +1,14 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Types;
5
6namespace OpenSim.Framework.Interfaces
7{
8 public interface IScriptAPI
9 {
10 OSVector3 GetEntityPosition(uint localID);
11 void SetEntityPosition(uint localID, float x, float y, float z);
12 uint GetRandomAvatarID();
13 }
14}
diff --git a/Common/OpenSim.Framework/Interfaces/IScriptEngine.cs b/Common/OpenSim.Framework/Interfaces/IScriptEngine.cs
new file mode 100644
index 0000000..ed8974c
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/IScriptEngine.cs
@@ -0,0 +1,14 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework.Interfaces
6{
7 public interface IScriptEngine
8 {
9 bool Init(IScriptAPI api);
10 string GetName();
11 void LoadScript(string script, string scriptName, uint entityID);
12 void OnFrame();
13 }
14}
diff --git a/Common/OpenSim.Framework/Interfaces/IUserConfig.cs b/Common/OpenSim.Framework/Interfaces/IUserConfig.cs
new file mode 100644
index 0000000..e15867d
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/IUserConfig.cs
@@ -0,0 +1,58 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3
4* Copyright (c) <year>, <copyright holder>
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.Collections.Generic;
32using System.IO;
33using libsecondlife;
34//using OpenSim.world;
35
36namespace OpenSim.Framework.Interfaces
37{
38 /// <summary>
39 /// </summary>
40
41
42 public abstract class UserConfig
43 {
44 public string DefaultStartupMsg;
45 public string GridServerURL;
46 public string GridSendKey;
47 public string GridRecvKey;
48
49
50 public abstract void InitConfig();
51
52 }
53
54 public interface IUserConfig
55 {
56 UserConfig GetConfigObject();
57 }
58}
diff --git a/Common/OpenSim.Framework/Interfaces/IUserServer.cs b/Common/OpenSim.Framework/Interfaces/IUserServer.cs
new file mode 100644
index 0000000..21f2721
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/IUserServer.cs
@@ -0,0 +1,15 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Inventory;
5using libsecondlife;
6
7namespace OpenSim.Framework.Interfaces
8{
9 public interface IUserServer
10 {
11 AgentInventory RequestAgentsInventory(LLUUID agentID);
12 void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
13 bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory);
14 }
15}
diff --git a/Common/OpenSim.Framework/Interfaces/LocalGridBase.cs b/Common/OpenSim.Framework/Interfaces/LocalGridBase.cs
new file mode 100644
index 0000000..ff46502
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/LocalGridBase.cs
@@ -0,0 +1,24 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using OpenSim.Framework.Types;
6using System.Collections;
7
8namespace OpenSim.Framework.Interfaces
9{
10 public abstract class LocalGridBase : IGridServer
11 {
12 public abstract UUIDBlock RequestUUIDBlock();
13 public abstract NeighbourInfo[] RequestNeighbours();
14 public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
15 public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
16 public abstract string GetName();
17 public abstract bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port);
18 public abstract void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
19 public abstract void AddNewSession(Login session);
20 public abstract IList RequestMapBlocks(int minX, int minY, int maxX, int maxY);
21 public abstract void Close();
22 }
23
24}
diff --git a/Common/OpenSim.Framework/Interfaces/RemoteGridBase.cs b/Common/OpenSim.Framework/Interfaces/RemoteGridBase.cs
new file mode 100644
index 0000000..ed13ed5
--- /dev/null
+++ b/Common/OpenSim.Framework/Interfaces/RemoteGridBase.cs
@@ -0,0 +1,37 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Text;
5using libsecondlife;
6using OpenSim.Framework.Types;
7
8namespace OpenSim.Framework.Interfaces
9{
10 public abstract class RemoteGridBase : IGridServer
11 {
12 public abstract Dictionary<uint, AgentCircuitData> agentcircuits
13 {
14 get;
15 set;
16 }
17
18 public abstract UUIDBlock RequestUUIDBlock();
19 public abstract NeighbourInfo[] RequestNeighbours();
20 public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
21 public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
22 public abstract string GetName();
23 public abstract bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port);
24 public abstract void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
25 public abstract IList RequestMapBlocks(int minX, int minY, int maxX, int maxY);
26 public abstract void Close();
27 public abstract Hashtable GridData {
28 get;
29 set;
30 }
31
32 public abstract ArrayList neighbours {
33 get;
34 set;
35 }
36 }
37}
diff --git a/Common/OpenSim.Framework/LoginService.cs b/Common/OpenSim.Framework/LoginService.cs
new file mode 100644
index 0000000..eba0281
--- /dev/null
+++ b/Common/OpenSim.Framework/LoginService.cs
@@ -0,0 +1,14 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Text;
5using Nwc.XmlRpc;
6using libsecondlife;
7
8namespace OpenSim.Framework.Grid
9{
10 public abstract class LoginService
11 {
12
13 }
14} \ No newline at end of file
diff --git a/Common/OpenSim.Framework/OpenSim.Framework.csproj b/Common/OpenSim.Framework/OpenSim.Framework.csproj
new file mode 100644
index 0000000..f58a2d7
--- /dev/null
+++ b/Common/OpenSim.Framework/OpenSim.Framework.csproj
@@ -0,0 +1,194 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{8ACA2445-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Framework</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Framework</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="libsecondlife.dll" >
70 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="Db4objects.Db4o.dll" >
74 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 </ItemGroup>
78 <ItemGroup>
79 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
80 <Name>XMLRPC</Name>
81 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
82 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
83 <Private>False</Private>
84 </ProjectReference>
85 </ItemGroup>
86 <ItemGroup>
87 <Compile Include="AgentInventory.cs">
88 <SubType>Code</SubType>
89 </Compile>
90 <Compile Include="BlockingQueue.cs">
91 <SubType>Code</SubType>
92 </Compile>
93 <Compile Include="HeightMapGenHills.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 <Compile Include="LoginService.cs">
97 <SubType>Code</SubType>
98 </Compile>
99 <Compile Include="Remoting.cs">
100 <SubType>Code</SubType>
101 </Compile>
102 <Compile Include="SimProfile.cs">
103 <SubType>Code</SubType>
104 </Compile>
105 <Compile Include="SimProfileBase.cs">
106 <SubType>Code</SubType>
107 </Compile>
108 <Compile Include="UserProfile.cs">
109 <SubType>Code</SubType>
110 </Compile>
111 <Compile Include="UserProfileManager.cs">
112 <SubType>Code</SubType>
113 </Compile>
114 <Compile Include="UserProfileManagerBase.cs">
115 <SubType>Code</SubType>
116 </Compile>
117 <Compile Include="Util.cs">
118 <SubType>Code</SubType>
119 </Compile>
120 <Compile Include="Interfaces\IAssetServer.cs">
121 <SubType>Code</SubType>
122 </Compile>
123 <Compile Include="Interfaces\IClientAPI.cs">
124 <SubType>Code</SubType>
125 </Compile>
126 <Compile Include="Interfaces\IConfig.cs">
127 <SubType>Code</SubType>
128 </Compile>
129 <Compile Include="Interfaces\IGenericConfig.cs">
130 <SubType>Code</SubType>
131 </Compile>
132 <Compile Include="Interfaces\IGridConfig.cs">
133 <SubType>Code</SubType>
134 </Compile>
135 <Compile Include="Interfaces\IGridServer.cs">
136 <SubType>Code</SubType>
137 </Compile>
138 <Compile Include="Interfaces\ILocalStorage.cs">
139 <SubType>Code</SubType>
140 </Compile>
141 <Compile Include="Interfaces\IScriptAPI.cs">
142 <SubType>Code</SubType>
143 </Compile>
144 <Compile Include="Interfaces\IScriptEngine.cs">
145 <SubType>Code</SubType>
146 </Compile>
147 <Compile Include="Interfaces\IUserConfig.cs">
148 <SubType>Code</SubType>
149 </Compile>
150 <Compile Include="Interfaces\IUserServer.cs">
151 <SubType>Code</SubType>
152 </Compile>
153 <Compile Include="Interfaces\LocalGridBase.cs">
154 <SubType>Code</SubType>
155 </Compile>
156 <Compile Include="Interfaces\RemoteGridBase.cs">
157 <SubType>Code</SubType>
158 </Compile>
159 <Compile Include="Properties\AssemblyInfo.cs">
160 <SubType>Code</SubType>
161 </Compile>
162 <Compile Include="Types\AgentCiruitData.cs">
163 <SubType>Code</SubType>
164 </Compile>
165 <Compile Include="Types\AssetBase.cs">
166 <SubType>Code</SubType>
167 </Compile>
168 <Compile Include="Types\AssetLandmark.cs">
169 <SubType>Code</SubType>
170 </Compile>
171 <Compile Include="Types\AssetStorage.cs">
172 <SubType>Code</SubType>
173 </Compile>
174 <Compile Include="Types\Login.cs">
175 <SubType>Code</SubType>
176 </Compile>
177 <Compile Include="Types\NeighbourInfo.cs">
178 <SubType>Code</SubType>
179 </Compile>
180 <Compile Include="Types\OSVector3.cs">
181 <SubType>Code</SubType>
182 </Compile>
183 <Compile Include="Types\PrimData.cs">
184 <SubType>Code</SubType>
185 </Compile>
186 </ItemGroup>
187 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
188 <PropertyGroup>
189 <PreBuildEvent>
190 </PreBuildEvent>
191 <PostBuildEvent>
192 </PostBuildEvent>
193 </PropertyGroup>
194</Project>
diff --git a/Common/OpenSim.Framework/OpenSim.Framework.csproj.user b/Common/OpenSim.Framework/OpenSim.Framework.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/Common/OpenSim.Framework/OpenSim.Framework.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/Common/OpenSim.Framework/OpenSim.Framework.dll.build b/Common/OpenSim.Framework/OpenSim.Framework.dll.build
new file mode 100644
index 0000000..34be1c8
--- /dev/null
+++ b/Common/OpenSim.Framework/OpenSim.Framework.dll.build
@@ -0,0 +1,75 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Framework" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Framework" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AgentInventory.cs" />
15 <include name="BlockingQueue.cs" />
16 <include name="HeightMapGenHills.cs" />
17 <include name="LoginService.cs" />
18 <include name="Remoting.cs" />
19 <include name="SimProfile.cs" />
20 <include name="SimProfileBase.cs" />
21 <include name="UserProfile.cs" />
22 <include name="UserProfileManager.cs" />
23 <include name="UserProfileManagerBase.cs" />
24 <include name="Util.cs" />
25 <include name="Interfaces/IAssetServer.cs" />
26 <include name="Interfaces/IClientAPI.cs" />
27 <include name="Interfaces/IConfig.cs" />
28 <include name="Interfaces/IGenericConfig.cs" />
29 <include name="Interfaces/IGridConfig.cs" />
30 <include name="Interfaces/IGridServer.cs" />
31 <include name="Interfaces/ILocalStorage.cs" />
32 <include name="Interfaces/IScriptAPI.cs" />
33 <include name="Interfaces/IScriptEngine.cs" />
34 <include name="Interfaces/IUserConfig.cs" />
35 <include name="Interfaces/IUserServer.cs" />
36 <include name="Interfaces/LocalGridBase.cs" />
37 <include name="Interfaces/RemoteGridBase.cs" />
38 <include name="Properties/AssemblyInfo.cs" />
39 <include name="Types/AgentCiruitData.cs" />
40 <include name="Types/AssetBase.cs" />
41 <include name="Types/AssetLandmark.cs" />
42 <include name="Types/AssetStorage.cs" />
43 <include name="Types/Login.cs" />
44 <include name="Types/NeighbourInfo.cs" />
45 <include name="Types/OSVector3.cs" />
46 <include name="Types/PrimData.cs" />
47 </sources>
48 <references basedir="${project::get-base-directory()}">
49 <lib>
50 <include name="${project::get-base-directory()}" />
51 <include name="${project::get-base-directory()}/${build.dir}" />
52 </lib>
53 <include name="System.dll" />
54 <include name="System.Xml.dll" />
55 <include name="../../bin/libsecondlife.dll" />
56 <include name="../../bin/Db4objects.Db4o.dll" />
57 <include name="../../bin/XMLRPC.dll" />
58 </references>
59 </csc>
60 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
61 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
62 <copy todir="${project::get-base-directory()}/../../bin/">
63 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
64 <include name="*.dll"/>
65 <include name="*.exe"/>
66 </fileset>
67 </copy>
68 </target>
69 <target name="clean">
70 <delete dir="${bin.dir}" failonerror="false" />
71 <delete dir="${obj.dir}" failonerror="false" />
72 </target>
73 <target name="doc" description="Creates documentation.">
74 </target>
75</project>
diff --git a/Common/OpenSim.Framework/Properties/AssemblyInfo.cs b/Common/OpenSim.Framework/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..86f5cdb
--- /dev/null
+++ b/Common/OpenSim.Framework/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.FrameWork")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.FrameWork")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("a08e20c7-f191-4137-b1f0-9291408fa521")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("1.0.0.0")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/OpenSim.Framework/Remoting.cs b/Common/OpenSim.Framework/Remoting.cs
new file mode 100644
index 0000000..1212ee5
--- /dev/null
+++ b/Common/OpenSim.Framework/Remoting.cs
@@ -0,0 +1,109 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Security.Cryptography;
5
6namespace OpenSim.Framework
7{
8 /// <summary>
9 /// NEEDS AUDIT.
10 /// </summary>
11 /// <remarks>
12 /// Suggested implementation
13 /// <para>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.</para>
14 /// <para>When sending data to the foreign host - run 'Sign' on the data and affix the returned byte[] to the message.</para>
15 /// <para>When recieving data from the foreign host - run 'Authenticate' against the data and the attached byte[].</para>
16 /// <para>Both hosts should be performing these operations for this to be effective.</para>
17 /// </remarks>
18 class RemoteDigest
19 {
20 private byte[] currentHash;
21 private byte[] secret;
22
23 private SHA512Managed SHA512;
24
25 /// <summary>
26 /// Initialises a new RemoteDigest authentication mechanism
27 /// </summary>
28 /// <remarks>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</remarks>
29 /// <param name="sharedSecret">The shared secret between systems (for inter-sim, this is provided in encrypted form during connection, for grid this is input manually in setup)</param>
30 /// <param name="salt">Binary salt - some common value - to be decided what</param>
31 /// <param name="challenge">The challenge key provided by the third party</param>
32 public RemoteDigest(string sharedSecret, byte[] salt, string challenge)
33 {
34 SHA512 = new SHA512Managed();
35 Rfc2898DeriveBytes RFC2898 = new Rfc2898DeriveBytes(sharedSecret,salt);
36 secret = RFC2898.GetBytes(512);
37 ASCIIEncoding ASCII = new ASCIIEncoding();
38
39 currentHash = SHA512.ComputeHash(AppendArrays(secret, ASCII.GetBytes(challenge)));
40 }
41
42 /// <summary>
43 /// Authenticates a piece of incoming data against the local digest. Upon successful authentication, digest string is incremented.
44 /// </summary>
45 /// <param name="data">The incoming data</param>
46 /// <param name="digest">The remote digest</param>
47 /// <returns></returns>
48 public bool Authenticate(byte[] data, byte[] digest)
49 {
50 byte[] newHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data));
51 if (digest == newHash)
52 {
53 currentHash = newHash;
54 return true;
55 }
56 else
57 {
58 throw new Exception("Hash comparison failed. Key resync required.");
59 }
60 }
61
62 /// <summary>
63 /// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message.
64 /// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the
65 /// hashes will get out of sync and throw an exception when validation is attempted.
66 /// </summary>
67 /// <param name="data">The outgoing data</param>
68 /// <returns>The local digest</returns>
69 public byte[] Sign(byte[] data)
70 {
71 currentHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data));
72 return currentHash;
73 }
74
75 /// <summary>
76 /// 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.
77 /// </summary>
78 /// <returns>A 128-character hexadecimal string containing the challenge.</returns>
79 public static string GenerateChallenge()
80 {
81 RNGCryptoServiceProvider RNG = new RNGCryptoServiceProvider();
82 byte[] bytes = new byte[64];
83 RNG.GetBytes(bytes);
84
85 StringBuilder sb = new StringBuilder(bytes.Length * 2);
86 foreach (byte b in bytes)
87 {
88 sb.AppendFormat("{0:x2}", b);
89 }
90 return sb.ToString();
91 }
92
93 /// <summary>
94 /// Helper function, merges two byte arrays
95 /// </summary>
96 /// <remarks>Sourced from MSDN Forum</remarks>
97 /// <param name="a">A</param>
98 /// <param name="b">B</param>
99 /// <returns>C</returns>
100 private byte[] AppendArrays(byte[] a, byte[] b)
101 {
102 byte[] c = new byte[a.Length + b.Length];
103 Buffer.BlockCopy(a, 0, c, 0, a.Length);
104 Buffer.BlockCopy(b, 0, c, a.Length, b.Length);
105 return c;
106 }
107
108 }
109}
diff --git a/Common/OpenSim.Framework/SimProfile.cs b/Common/OpenSim.Framework/SimProfile.cs
new file mode 100644
index 0000000..8acb20b
--- /dev/null
+++ b/Common/OpenSim.Framework/SimProfile.cs
@@ -0,0 +1,83 @@
1using System;
2using System.Collections.Generic;
3using System.Collections;
4using System.Xml;
5using System.Text;
6using libsecondlife;
7using Nwc.XmlRpc;
8
9namespace OpenSim.Framework.Sims
10{
11 public class SimProfile : SimProfileBase
12 {
13 public SimProfile LoadFromGrid(ulong region_handle, string GridURL, string SendKey, string RecvKey)
14 {
15 try
16 {
17 Hashtable GridReqParams = new Hashtable();
18 GridReqParams["region_handle"] = region_handle.ToString();
19 GridReqParams["authkey"] = SendKey;
20 ArrayList SendParams = new ArrayList();
21 SendParams.Add(GridReqParams);
22 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
23
24 XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
25
26 Hashtable RespData = (Hashtable)GridResp.Value;
27 this.UUID = new LLUUID((string)RespData["UUID"]);
28 this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256));
29 this.regionname = (string)RespData["regionname"];
30 this.sim_ip = (string)RespData["sim_ip"];
31 this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
32 this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
33 this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
34 this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
35 this.sendkey = SendKey;
36 this.recvkey = RecvKey;
37 }
38 catch (Exception e)
39 {
40 Console.WriteLine(e.ToString());
41 }
42 return this;
43 }
44
45 public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey)
46 {
47 try
48 {
49 Hashtable GridReqParams = new Hashtable();
50 GridReqParams["UUID"] = UUID.ToString();
51 GridReqParams["authkey"] = SendKey;
52 ArrayList SendParams = new ArrayList();
53 SendParams.Add(GridReqParams);
54 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
55
56 XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
57
58 Hashtable RespData = (Hashtable)GridResp.Value;
59 this.UUID = new LLUUID((string)RespData["UUID"]);
60 this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256));
61 this.regionname = (string)RespData["regionname"];
62 this.sim_ip = (string)RespData["sim_ip"];
63 this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
64 this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
65 this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
66 this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
67 this.sendkey = SendKey;
68 this.recvkey = RecvKey;
69 }
70 catch (Exception e)
71 {
72 Console.WriteLine(e.ToString());
73 }
74 return this;
75 }
76
77
78 public SimProfile()
79 {
80 }
81 }
82
83}
diff --git a/Common/OpenSim.Framework/SimProfileBase.cs b/Common/OpenSim.Framework/SimProfileBase.cs
new file mode 100644
index 0000000..30e2e0f
--- /dev/null
+++ b/Common/OpenSim.Framework/SimProfileBase.cs
@@ -0,0 +1,27 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Sims
7{
8 [System.Obsolete("Depreciated, use SimProfileData instead")]
9 public class SimProfileBase
10 {
11 public LLUUID UUID;
12 public ulong regionhandle;
13 public string regionname;
14 public string sim_ip;
15 public uint sim_port;
16 public string caps_url;
17 public uint RegionLocX;
18 public uint RegionLocY;
19 public string sendkey;
20 public string recvkey;
21 public bool online;
22
23 public SimProfileBase()
24 {
25 }
26 }
27}
diff --git a/Common/OpenSim.Framework/Types/AgentCiruitData.cs b/Common/OpenSim.Framework/Types/AgentCiruitData.cs
new file mode 100644
index 0000000..7314586
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/AgentCiruitData.cs
@@ -0,0 +1,22 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class AgentCircuitData
9 {
10 public AgentCircuitData() { }
11 public LLUUID AgentID;
12 public LLUUID SessionID;
13 public LLUUID SecureSessionID;
14 public LLVector3 startpos;
15 public string firstname;
16 public string lastname;
17 public uint circuitcode;
18 public bool child;
19 public LLUUID InventoryFolder;
20 public LLUUID BaseFolder;
21 }
22}
diff --git a/Common/OpenSim.Framework/Types/AssetBase.cs b/Common/OpenSim.Framework/Types/AssetBase.cs
new file mode 100644
index 0000000..f6104f8
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/AssetBase.cs
@@ -0,0 +1,22 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class AssetBase
9 {
10 public byte[] Data;
11 public LLUUID FullID;
12 public sbyte Type;
13 public sbyte InvType;
14 public string Name;
15 public string Description;
16
17 public AssetBase()
18 {
19
20 }
21 }
22}
diff --git a/Common/OpenSim.Framework/Types/AssetLandmark.cs b/Common/OpenSim.Framework/Types/AssetLandmark.cs
new file mode 100644
index 0000000..9d1a326
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/AssetLandmark.cs
@@ -0,0 +1,34 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class AssetLandmark : AssetBase
9 {
10 public int Version;
11 public LLVector3 Position;
12 public LLUUID RegionID;
13
14 public AssetLandmark(AssetBase a)
15 {
16 this.Data = a.Data;
17 this.FullID = a.FullID;
18 this.Type = a.Type;
19 this.InvType = a.InvType;
20 this.Name = a.Name;
21 this.Description = a.Description;
22 InternData();
23 }
24
25 private void InternData()
26 {
27 string temp = System.Text.Encoding.UTF8.GetString(Data).Trim();
28 string[] parts = temp.Split('\n');
29 int.TryParse(parts[0].Substring(17, 1), out Version);
30 LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID);
31 LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position);
32 }
33 }
34}
diff --git a/Common/OpenSim.Framework/Types/AssetStorage.cs b/Common/OpenSim.Framework/Types/AssetStorage.cs
new file mode 100644
index 0000000..5b5b3b2
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/AssetStorage.cs
@@ -0,0 +1,23 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class AssetStorage
9 {
10
11 public AssetStorage() {
12 }
13
14 public AssetStorage(LLUUID assetUUID) {
15 UUID=assetUUID;
16 }
17
18 public byte[] Data;
19 public sbyte Type;
20 public string Name;
21 public LLUUID UUID;
22 }
23}
diff --git a/Common/OpenSim.Framework/Types/Login.cs b/Common/OpenSim.Framework/Types/Login.cs
new file mode 100644
index 0000000..71f9de3
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/Login.cs
@@ -0,0 +1,24 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class Login
9 {
10 public string First = "Test";
11 public string Last = "User";
12 public LLUUID Agent;
13 public LLUUID Session;
14 public LLUUID SecureSession = LLUUID.Zero;
15 public LLUUID InventoryFolder;
16 public LLUUID BaseFolder;
17 public uint CircuitCode;
18
19 public Login()
20 {
21
22 }
23 }
24}
diff --git a/Common/OpenSim.Framework/Types/NeighbourInfo.cs b/Common/OpenSim.Framework/Types/NeighbourInfo.cs
new file mode 100644
index 0000000..58b6cb1
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/NeighbourInfo.cs
@@ -0,0 +1,19 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework.Types
6{
7 public class NeighbourInfo
8 {
9 public NeighbourInfo()
10 {
11 }
12
13 public ulong regionhandle;
14 public uint RegionLocX;
15 public uint RegionLocY;
16 public string sim_ip;
17 public uint sim_port;
18 }
19}
diff --git a/Common/OpenSim.Framework/Types/OSVector3.cs b/Common/OpenSim.Framework/Types/OSVector3.cs
new file mode 100644
index 0000000..8fb840b
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/OSVector3.cs
@@ -0,0 +1,18 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework.Types
6{
7 public class OSVector3
8 {
9 public float X;
10 public float Y;
11 public float Z;
12
13 public OSVector3()
14 {
15
16 }
17 }
18}
diff --git a/Common/OpenSim.Framework/Types/PrimData.cs b/Common/OpenSim.Framework/Types/PrimData.cs
new file mode 100644
index 0000000..68e2a22
--- /dev/null
+++ b/Common/OpenSim.Framework/Types/PrimData.cs
@@ -0,0 +1,173 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Types
7{
8 public class PrimData
9 {
10 private const uint FULL_MASK_PERMISSIONS = 2147483647;
11
12 public LLUUID OwnerID;
13 public byte PCode;
14 public ushort PathBegin;
15 public ushort PathEnd;
16 public byte PathScaleX;
17 public byte PathScaleY;
18 public byte PathShearX;
19 public byte PathShearY;
20 public sbyte PathSkew;
21 public ushort ProfileBegin;
22 public ushort ProfileEnd;
23 public LLVector3 Scale;
24 public byte PathCurve;
25 public byte ProfileCurve;
26 public uint ParentID = 0;
27 public ushort ProfileHollow;
28 public sbyte PathRadiusOffset;
29 public byte PathRevolutions;
30 public sbyte PathTaperX;
31 public sbyte PathTaperY;
32 public sbyte PathTwist;
33 public sbyte PathTwistBegin;
34 public byte[] Texture;
35
36
37 public Int32 CreationDate;
38 public uint OwnerMask = FULL_MASK_PERMISSIONS;
39 public uint NextOwnerMask = FULL_MASK_PERMISSIONS;
40 public uint GroupMask = FULL_MASK_PERMISSIONS;
41 public uint EveryoneMask = FULL_MASK_PERMISSIONS;
42 public uint BaseMask = FULL_MASK_PERMISSIONS;
43
44 //following only used during prim storage
45 public LLVector3 Position;
46 public LLQuaternion Rotation = new LLQuaternion(0,1,0,0);
47 public uint LocalID;
48 public LLUUID FullID;
49
50 public PrimData()
51 {
52
53 }
54
55 public PrimData(byte[] data)
56 {
57 int i =0;
58
59 this.OwnerID = new LLUUID(data, i); i += 16;
60 this.PCode = data[i++];
61 this.PathBegin = (ushort)(data[i++] + (data[i++] << 8));
62 this.PathEnd = (ushort)(data[i++] + (data[i++] << 8));
63 this.PathScaleX = data[i++];
64 this.PathScaleY = data[i++];
65 this.PathShearX = data[i++];
66 this.PathShearY = data[i++];
67 this.PathSkew = (sbyte)data[i++];
68 this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8));
69 this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8));
70 this.Scale = new LLVector3(data, i); i += 12;
71 this.PathCurve = data[i++];
72 this.ProfileCurve = data[i++];
73 this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
74 this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8));
75 this.PathRadiusOffset = (sbyte)data[i++];
76 this.PathRevolutions = data[i++];
77 this.PathTaperX = (sbyte)data[i++];
78 this.PathTaperY =(sbyte) data[i++];
79 this.PathTwist = (sbyte) data[i++];
80 this.PathTwistBegin = (sbyte) data[i++];
81 ushort length = (ushort)(data[i++] + (data[i++] << 8));
82 this.Texture = new byte[length];
83 Array.Copy(data, i, Texture, 0, length); i += length;
84 this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
85 this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
86 this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
87 this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
88 this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
89 this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
90 this.Position = new LLVector3(data, i); i += 12;
91 this.Rotation = new LLQuaternion(data,i, true); i += 12;
92 this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
93 this.FullID = new LLUUID(data, i); i += 16;
94
95 }
96
97 public byte[] ToBytes()
98 {
99 int i = 0;
100 byte[] bytes = new byte[126 + Texture.Length];
101 Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
102 bytes[i++] = this.PCode;
103 bytes[i++] = (byte)(this.PathBegin % 256);
104 bytes[i++] = (byte)((this.PathBegin >> 8) % 256);
105 bytes[i++] = (byte)(this.PathEnd % 256);
106 bytes[i++] = (byte)((this.PathEnd >> 8) % 256);
107 bytes[i++] = this.PathScaleX;
108 bytes[i++] = this.PathScaleY;
109 bytes[i++] = this.PathShearX;
110 bytes[i++] = this.PathShearY;
111 bytes[i++] = (byte)this.PathSkew;
112 bytes[i++] = (byte)(this.ProfileBegin % 256);
113 bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256);
114 bytes[i++] = (byte)(this.ProfileEnd % 256);
115 bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256);
116 Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12;
117 bytes[i++] = this.PathCurve;
118 bytes[i++] = this.ProfileCurve;
119 bytes[i++] = (byte)(ParentID % 256);
120 bytes[i++] = (byte)((ParentID >> 8) % 256);
121 bytes[i++] = (byte)((ParentID >> 16) % 256);
122 bytes[i++] = (byte)((ParentID >> 24) % 256);
123 bytes[i++] = (byte)(this.ProfileHollow %256);
124 bytes[i++] = (byte)((this.ProfileHollow >> 8)% 256);
125 bytes[i++] = ((byte)this.PathRadiusOffset);
126 bytes[i++] = this.PathRevolutions;
127 bytes[i++] = ((byte) this.PathTaperX);
128 bytes[i++] = ((byte) this.PathTaperY);
129 bytes[i++] = ((byte) this.PathTwist);
130 bytes[i++] = ((byte) this.PathTwistBegin);
131 bytes[i++] = (byte)(Texture.Length % 256);
132 bytes[i++] = (byte)((Texture.Length >> 8) % 256);
133 Array.Copy(Texture, 0, bytes, i, Texture.Length); i += Texture.Length;
134 bytes[i++] = (byte)(this.CreationDate % 256);
135 bytes[i++] = (byte)((this.CreationDate >> 8) % 256);
136 bytes[i++] = (byte)((this.CreationDate >> 16) % 256);
137 bytes[i++] = (byte)((this.CreationDate >> 24) % 256);
138 bytes[i++] = (byte)(this.OwnerMask % 256);
139 bytes[i++] = (byte)((this.OwnerMask >> 8) % 256);
140 bytes[i++] = (byte)((this.OwnerMask >> 16) % 256);
141 bytes[i++] = (byte)((this.OwnerMask >> 24) % 256);
142 bytes[i++] = (byte)(this.NextOwnerMask % 256);
143 bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256);
144 bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256);
145 bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256);
146 bytes[i++] = (byte)(this.GroupMask % 256);
147 bytes[i++] = (byte)((this.GroupMask >> 8) % 256);
148 bytes[i++] = (byte)((this.GroupMask >> 16) % 256);
149 bytes[i++] = (byte)((this.GroupMask >> 24) % 256);
150 bytes[i++] = (byte)(this.EveryoneMask % 256);
151 bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256);
152 bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256);
153 bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256);
154 bytes[i++] = (byte)(this.BaseMask % 256);
155 bytes[i++] = (byte)((this.BaseMask >> 8) % 256);
156 bytes[i++] = (byte)((this.BaseMask >> 16) % 256);
157 bytes[i++] = (byte)((this.BaseMask >> 24) % 256);
158 Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12;
159 if (this.Rotation == new LLQuaternion(0,0,0,0))
160 {
161 this.Rotation = new LLQuaternion(0, 1, 0, 0);
162 }
163 Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12;
164 bytes[i++] = (byte)(this.LocalID % 256);
165 bytes[i++] = (byte)((this.LocalID >> 8) % 256);
166 bytes[i++] = (byte)((this.LocalID >> 16) % 256);
167 bytes[i++] = (byte)((this.LocalID >> 24) % 256);
168 Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16;
169
170 return bytes;
171 }
172 }
173}
diff --git a/Common/OpenSim.Framework/UserProfile.cs b/Common/OpenSim.Framework/UserProfile.cs
new file mode 100644
index 0000000..f95a8fa
--- /dev/null
+++ b/Common/OpenSim.Framework/UserProfile.cs
@@ -0,0 +1,62 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using OpenSim.Framework.Inventory;
6using System.Security.Cryptography;
7
8namespace OpenSim.Framework.User
9{
10 public class UserProfile
11 {
12
13 public string firstname;
14 public string lastname;
15 public ulong homeregionhandle;
16 public LLVector3 homepos;
17 public LLVector3 homelookat;
18
19 public bool IsGridGod = false;
20 public bool IsLocal = true; // will be used in future for visitors from foreign grids
21 public string AssetURL;
22 public string MD5passwd;
23
24 public LLUUID CurrentSessionID;
25 public LLUUID CurrentSecureSessionID;
26 public LLUUID UUID;
27 public Dictionary<LLUUID, uint> Circuits = new Dictionary<LLUUID, uint>(); // tracks circuit codes
28
29 public AgentInventory Inventory;
30
31 public UserProfile()
32 {
33 Circuits = new Dictionary<LLUUID, uint>();
34 Inventory = new AgentInventory();
35 homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
36 homepos = new LLVector3();
37 homelookat = new LLVector3();
38 }
39
40 public void InitSessionData()
41 {
42 RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
43
44 byte[] randDataS = new byte[16];
45 byte[] randDataSS = new byte[16];
46
47 rand.GetBytes(randDataS);
48 rand.GetBytes(randDataSS);
49
50 CurrentSecureSessionID = new LLUUID(randDataSS,0);
51 CurrentSessionID = new LLUUID(randDataS,0);
52
53 }
54
55 public void AddSimCircuit(uint circuitCode, LLUUID regionUUID)
56 {
57 if (this.Circuits.ContainsKey(regionUUID) == false)
58 this.Circuits.Add(regionUUID, circuitCode);
59 }
60
61 }
62}
diff --git a/Common/OpenSim.Framework/UserProfileManager.cs b/Common/OpenSim.Framework/UserProfileManager.cs
new file mode 100644
index 0000000..18b3513
--- /dev/null
+++ b/Common/OpenSim.Framework/UserProfileManager.cs
@@ -0,0 +1,272 @@
1using System;
2using System.Collections.Generic;
3using System.Collections;
4using System.Text;
5using System.Text.RegularExpressions;
6using System.Xml;
7using libsecondlife;
8using Nwc.XmlRpc;
9using OpenSim.Framework.Sims;
10using OpenSim.Framework.Inventory;
11using OpenSim.Framework.Utilities;
12
13namespace OpenSim.Framework.User
14{
15 public class UserProfileManager : UserProfileManagerBase
16 {
17 public string GridURL;
18 public string GridSendKey;
19 public string GridRecvKey;
20 public string DefaultStartupMsg;
21
22 public UserProfileManager()
23 {
24
25 }
26
27 public void SetKeys(string sendKey, string recvKey, string url, string message)
28 {
29 GridRecvKey = recvKey;
30 GridSendKey = sendKey;
31 GridURL = url;
32 DefaultStartupMsg = message;
33 }
34
35 public virtual string ParseXMLRPC(string requestBody)
36 {
37
38 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
39
40 switch (request.MethodName)
41 {
42 case "login_to_simulator":
43 XmlRpcResponse response = XmlRpcLoginMethod(request);
44
45 return (Regex.Replace(XmlRpcResponseSerializer.Singleton.Serialize(response), "utf-16", "utf-8"));
46 }
47
48 return "";
49 }
50
51 public string RestDeleteUserSessionMethod( string request, string path, string param )
52 {
53 LLUUID sessionid = new LLUUID(param); // get usersessions/sessionid
54 foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys)
55 {
56 if ( UserProfiles[UUID].CurrentSessionID == sessionid)
57 {
58 UserProfiles[UUID].CurrentSessionID = null;
59 UserProfiles[UUID].CurrentSecureSessionID = null;
60 UserProfiles[UUID].Circuits.Clear();
61 }
62 }
63
64 return "OK";
65 }
66
67 public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
68 {
69 XmlRpcResponse response = new XmlRpcResponse();
70 Hashtable requestData = (Hashtable)request.Params[0];
71
72 bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
73 bool GoodLogin = false;
74 string firstname = "";
75 string lastname = "";
76 string passwd = "";
77
78 if (GoodXML)
79 {
80 firstname = (string)requestData["first"];
81 lastname = (string)requestData["last"];
82 passwd = (string)requestData["passwd"];
83 GoodLogin = AuthenticateUser(firstname, lastname, passwd);
84 }
85
86
87 if (!(GoodXML && GoodLogin))
88 {
89 response = CreateErrorConnectingToGridResponse();
90 }
91 else
92 {
93 UserProfile TheUser = GetProfileByName(firstname, lastname);
94 //we need to sort out how sessions are logged out , currently the sim tells the gridserver
95 //but if as this suggests the userserver handles it then please have the sim telling the userserver instead
96 //as it really makes things messy for sandbox mode
97 //if (!((TheUser.CurrentSessionID == null) && (TheUser.CurrentSecureSessionID == null)))
98 // {
99 // response = CreateAlreadyLoggedInResponse();
100 // }
101 //else
102 //{
103 try
104 {
105 Hashtable responseData = new Hashtable();
106
107 LLUUID AgentID = TheUser.UUID;
108 TheUser.InitSessionData();
109
110 //for loading data from a grid server, make any changes in CustomiseResponse() (or create a sub class of this and override that method)
111 //SimProfile SimInfo = new SimProfile();
112 //SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey);
113
114
115 Hashtable GlobalT = new Hashtable();
116 GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271";
117 GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
118 GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
119 ArrayList GlobalTextures = new ArrayList();
120 GlobalTextures.Add(GlobalT);
121
122 Hashtable LoginFlagsHash = new Hashtable();
123 LoginFlagsHash["daylight_savings"] = "N";
124 LoginFlagsHash["stipend_since_login"] = "N";
125 LoginFlagsHash["gendered"] = "Y";
126 LoginFlagsHash["ever_logged_in"] = "Y";
127 ArrayList LoginFlags = new ArrayList();
128 LoginFlags.Add(LoginFlagsHash);
129
130 Hashtable uiconfig = new Hashtable();
131 uiconfig["allow_first_life"] = "Y";
132 ArrayList ui_config = new ArrayList();
133 ui_config.Add(uiconfig);
134
135 Hashtable ClassifiedCategoriesHash = new Hashtable();
136 ClassifiedCategoriesHash["category_name"] = "bla bla";
137 ClassifiedCategoriesHash["category_id"] = (Int32)1;
138 ArrayList ClassifiedCategories = new ArrayList();
139 ClassifiedCategories.Add(ClassifiedCategoriesHash);
140
141 ArrayList AgentInventory = new ArrayList();
142 Console.WriteLine("adding inventory to response");
143 Hashtable TempHash;
144 foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values)
145 {
146 TempHash = new Hashtable();
147 Console.WriteLine("adding folder " + InvFolder.FolderName + ", ID: " + InvFolder.FolderID.ToStringHyphenated() + " with parent: " + InvFolder.ParentID.ToStringHyphenated());
148 TempHash["name"] = InvFolder.FolderName;
149 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
150 TempHash["version"] = (Int32)InvFolder.Version;
151 TempHash["type_default"] = (Int32)InvFolder.DefaultType;
152 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
153 AgentInventory.Add(TempHash);
154 }
155
156 Hashtable InventoryRootHash = new Hashtable();
157 InventoryRootHash["folder_id"] = TheUser.Inventory.InventoryRoot.FolderID.ToStringHyphenated();
158 ArrayList InventoryRoot = new ArrayList();
159 InventoryRoot.Add(InventoryRootHash);
160
161 Hashtable InitialOutfitHash = new Hashtable();
162 InitialOutfitHash["folder_name"] = "Nightclub Female";
163 InitialOutfitHash["gender"] = "female";
164 ArrayList InitialOutfit = new ArrayList();
165 InitialOutfit.Add(InitialOutfitHash);
166
167 uint circode = (uint)(Util.RandomClass.Next());
168 //TheUser.AddSimCircuit(circode, SimInfo.UUID);
169
170 responseData["last_name"] = TheUser.lastname;
171 responseData["ui-config"] = ui_config;
172 responseData["sim_ip"] = "127.0.0.1"; //SimInfo.sim_ip.ToString();
173 responseData["login-flags"] = LoginFlags;
174 responseData["global-textures"] = GlobalTextures;
175 responseData["classified_categories"] = ClassifiedCategories;
176 responseData["event_categories"] = new ArrayList();
177 responseData["inventory-skeleton"] = AgentInventory;
178 responseData["inventory-skel-lib"] = new ArrayList();
179 responseData["inventory-root"] = InventoryRoot;
180 responseData["event_notifications"] = new ArrayList();
181 responseData["gestures"] = new ArrayList();
182 responseData["inventory-lib-owner"] = new ArrayList();
183 responseData["initial-outfit"] = InitialOutfit;
184 responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
185 responseData["start_location"] = "last";
186 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() + "]}";
187 responseData["message"] = DefaultStartupMsg;
188 responseData["first_name"] = TheUser.firstname;
189 responseData["circuit_code"] = (Int32)circode;
190 responseData["sim_port"] = 0; //(Int32)SimInfo.sim_port;
191 responseData["secure_session_id"] = TheUser.CurrentSecureSessionID.ToStringHyphenated();
192 responseData["look_at"] = "\n[r" + TheUser.homelookat.X.ToString() + ",r" + TheUser.homelookat.Y.ToString() + ",r" + TheUser.homelookat.Z.ToString() + "]\n";
193 responseData["agent_id"] = AgentID.ToStringHyphenated();
194 responseData["region_y"] = (Int32)0 * 256; // (Int32)SimInfo.RegionLocY * 256;
195 responseData["region_x"] = (Int32)0 * 256; //SimInfo.RegionLocX * 256;
196 responseData["seed_capability"] = "";
197 responseData["agent_access"] = "M";
198 responseData["session_id"] = TheUser.CurrentSessionID.ToStringHyphenated();
199 responseData["login"] = "true";
200
201 this.CustomiseResponse(ref responseData, TheUser);
202 response.Value = responseData;
203 // TheUser.SendDataToSim(SimInfo);
204 return response;
205
206 }
207 catch (Exception E)
208 {
209 Console.WriteLine(E.ToString());
210 }
211 //}
212 }
213 return response;
214
215 }
216
217 private static XmlRpcResponse CreateErrorConnectingToGridResponse()
218 {
219 XmlRpcResponse response = new XmlRpcResponse();
220 Hashtable ErrorRespData = new Hashtable();
221 ErrorRespData["reason"] = "key";
222 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";
223 ErrorRespData["login"] = "false";
224 response.Value = ErrorRespData;
225 return response;
226 }
227
228 private static XmlRpcResponse CreateAlreadyLoggedInResponse()
229 {
230 XmlRpcResponse response = new XmlRpcResponse();
231 Hashtable PresenceErrorRespData = new Hashtable();
232 PresenceErrorRespData["reason"] = "presence";
233 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";
234 PresenceErrorRespData["login"] = "false";
235 response.Value = PresenceErrorRespData;
236 return response;
237 }
238
239 public virtual void CustomiseResponse(ref Hashtable response, UserProfile theUser)
240 {
241 //default method set up to act as ogs user server
242 SimProfile SimInfo= new SimProfile();
243 //get siminfo from grid server
244 SimInfo = SimInfo.LoadFromGrid(theUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey);
245 Int32 circode = (Int32)Convert.ToUInt32(response["circuit_code"]);
246 theUser.AddSimCircuit((uint)circode, SimInfo.UUID);
247 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() + "]}";
248 response["sim_ip"] = SimInfo.sim_ip;
249 response["sim_port"] = (Int32)SimInfo.sim_port;
250 response["region_y"] = (Int32)SimInfo.RegionLocY * 256;
251 response["region_x"] = (Int32)SimInfo.RegionLocX * 256;
252
253 //default is ogs user server, so let the sim know about the user via a XmlRpcRequest
254 Console.WriteLine(SimInfo.caps_url);
255 Hashtable SimParams = new Hashtable();
256 SimParams["session_id"] = theUser.CurrentSessionID.ToString();
257 SimParams["secure_session_id"] = theUser.CurrentSecureSessionID.ToString();
258 SimParams["firstname"] = theUser.firstname;
259 SimParams["lastname"] = theUser.lastname;
260 SimParams["agent_id"] = theUser.UUID.ToString();
261 SimParams["circuit_code"] = (Int32)circode;
262 SimParams["startpos_x"] = theUser.homepos.X.ToString();
263 SimParams["startpos_y"] = theUser.homepos.Y.ToString();
264 SimParams["startpos_z"] = theUser.homepos.Z.ToString();
265 ArrayList SendParams = new ArrayList();
266 SendParams.Add(SimParams);
267
268 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
269 XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000);
270 }
271 }
272}
diff --git a/Common/OpenSim.Framework/UserProfileManagerBase.cs b/Common/OpenSim.Framework/UserProfileManagerBase.cs
new file mode 100644
index 0000000..d1307a5
--- /dev/null
+++ b/Common/OpenSim.Framework/UserProfileManagerBase.cs
@@ -0,0 +1,124 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using OpenSim.Framework.Utilities;
6using OpenSim.Framework.Inventory;
7using Db4objects.Db4o;
8
9namespace OpenSim.Framework.User
10{
11 public class UserProfileManagerBase
12 {
13
14 public Dictionary<LLUUID, UserProfile> UserProfiles = new Dictionary<LLUUID, UserProfile>();
15
16 public UserProfileManagerBase()
17 {
18 }
19
20 public virtual void InitUserProfiles()
21 {
22 IObjectContainer db;
23 db = Db4oFactory.OpenFile("userprofiles.yap");
24 IObjectSet result = db.Get(typeof(UserProfile));
25 foreach (UserProfile userprof in result)
26 {
27 UserProfiles.Add(userprof.UUID, userprof);
28 }
29 Console.WriteLine("UserProfiles.Cs:InitUserProfiles() - Successfully loaded " + result.Count.ToString() + " from database");
30 db.Close();
31 }
32
33 public virtual void SaveUserProfiles() // ZOMG! INEFFICIENT!
34 {
35 IObjectContainer db;
36 db = Db4oFactory.OpenFile("userprofiles.yap");
37 IObjectSet result = db.Get(typeof(UserProfile));
38 foreach (UserProfile userprof in result)
39 {
40 db.Delete(userprof);
41 db.Commit();
42 }
43 foreach (UserProfile userprof in UserProfiles.Values)
44 {
45 db.Set(userprof);
46 db.Commit();
47 }
48 db.Close();
49 }
50
51 public UserProfile GetProfileByName(string firstname, string lastname)
52 {
53 foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys)
54 {
55 if (UserProfiles[UUID].firstname.Equals(firstname)) if (UserProfiles[UUID].lastname.Equals(lastname))
56 {
57 return UserProfiles[UUID];
58 }
59 }
60 return null;
61 }
62
63 public UserProfile GetProfileByLLUUID(LLUUID ProfileLLUUID)
64 {
65 return UserProfiles[ProfileLLUUID];
66 }
67
68 public virtual bool AuthenticateUser(string firstname, string lastname, string passwd)
69 {
70 UserProfile TheUser = GetProfileByName(firstname, lastname);
71 passwd = passwd.Remove(0, 3); //remove $1$
72 if (TheUser != null)
73 {
74 if (TheUser.MD5passwd == passwd)
75 {
76 Console.WriteLine("UserProfile - authorised " + firstname + " " + lastname);
77 return true;
78 }
79 else
80 {
81 Console.WriteLine("UserProfile - not authorised, password not match " + TheUser.MD5passwd + " and " + passwd);
82 return false;
83 }
84 }
85 else
86 {
87 Console.WriteLine("UserProfile - not authorised , unkown: " + firstname + " , " + lastname);
88 return false;
89 }
90
91 }
92
93 public void SetGod(LLUUID GodID)
94 {
95 this.UserProfiles[GodID].IsGridGod = true;
96 }
97
98 public virtual UserProfile CreateNewProfile(string firstname, string lastname, string MD5passwd)
99 {
100 Console.WriteLine("creating new profile for : " + firstname + " , " + lastname);
101 UserProfile newprofile = new UserProfile();
102 newprofile.homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
103 newprofile.firstname = firstname;
104 newprofile.lastname = lastname;
105 newprofile.MD5passwd = MD5passwd;
106 newprofile.UUID = LLUUID.Random();
107 newprofile.Inventory.CreateRootFolder(newprofile.UUID, true);
108 this.UserProfiles.Add(newprofile.UUID, newprofile);
109 return newprofile;
110 }
111
112 public virtual AgentInventory GetUsersInventory(LLUUID agentID)
113 {
114 UserProfile user = this.GetProfileByLLUUID(agentID);
115 if (user != null)
116 {
117 return user.Inventory;
118 }
119
120 return null;
121 }
122
123 }
124}
diff --git a/Common/OpenSim.Framework/Util.cs b/Common/OpenSim.Framework/Util.cs
new file mode 100644
index 0000000..400f415
--- /dev/null
+++ b/Common/OpenSim.Framework/Util.cs
@@ -0,0 +1,151 @@
1using System;
2using System.Security.Cryptography;
3using System.Collections.Generic;
4using System.Text;
5using libsecondlife;
6using libsecondlife.Packets;
7
8namespace OpenSim.Framework.Utilities
9{
10 public class Util
11 {
12 private static Random randomClass = new Random();
13 private static uint nextXferID = 5000;
14 private static object XferLock = new object();
15
16 public static ulong UIntsToLong(uint X, uint Y)
17 {
18 return Helpers.UIntsToLong(X, Y);
19 }
20
21 public static Random RandomClass
22 {
23 get
24 {
25 return randomClass;
26 }
27 }
28
29 public static uint GetNextXferID()
30 {
31 uint id = 0;
32 lock(XferLock)
33 {
34 id = nextXferID;
35 nextXferID++;
36 }
37 return id;
38 }
39
40 public static int UnixTimeSinceEpoch()
41 {
42 TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1));
43 int timestamp = (int)t.TotalSeconds;
44 return timestamp;
45 }
46
47 public static string Md5Hash(string pass)
48 {
49 MD5 md5 = MD5CryptoServiceProvider.Create();
50 byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass));
51 StringBuilder sb = new StringBuilder();
52 for (int i = 0; i < dataMd5.Length; i++)
53 sb.AppendFormat("{0:x2}", dataMd5[i]);
54 return sb.ToString();
55 }
56
57 //public static int fast_distance2d(int x, int y)
58 //{
59 // x = System.Math.Abs(x);
60 // y = System.Math.Abs(y);
61
62 // int min = System.Math.Min(x, y);
63
64 // return (x + y - (min >> 1) - (min >> 2) + (min >> 4));
65 //}
66
67 public static string FieldToString(byte[] bytes)
68 {
69 return FieldToString(bytes, String.Empty);
70 }
71
72 /// <summary>
73 /// Convert a variable length field (byte array) to a string, with a
74 /// field name prepended to each line of the output
75 /// </summary>
76 /// <remarks>If the byte array has unprintable characters in it, a
77 /// hex dump will be put in the string instead</remarks>
78 /// <param name="bytes">The byte array to convert to a string</param>
79 /// <param name="fieldName">A field name to prepend to each line of output</param>
80 /// <returns>An ASCII string or a string containing a hex dump, minus
81 /// the null terminator</returns>
82 public static string FieldToString(byte[] bytes, string fieldName)
83 {
84 // Check for a common case
85 if (bytes.Length == 0) return String.Empty;
86
87 StringBuilder output = new StringBuilder();
88 bool printable = true;
89
90 for (int i = 0; i < bytes.Length; ++i)
91 {
92 // Check if there are any unprintable characters in the array
93 if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09
94 && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00)
95 {
96 printable = false;
97 break;
98 }
99 }
100
101 if (printable)
102 {
103 if (fieldName.Length > 0)
104 {
105 output.Append(fieldName);
106 output.Append(": ");
107 }
108
109 if (bytes[bytes.Length - 1] == 0x00)
110 output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1));
111 else
112 output.Append(UTF8Encoding.UTF8.GetString(bytes));
113 }
114 else
115 {
116 for (int i = 0; i < bytes.Length; i += 16)
117 {
118 if (i != 0)
119 output.Append(Environment.NewLine);
120 if (fieldName.Length > 0)
121 {
122 output.Append(fieldName);
123 output.Append(": ");
124 }
125
126 for (int j = 0; j < 16; j++)
127 {
128 if ((i + j) < bytes.Length)
129 output.Append(String.Format("{0:X2} ", bytes[i + j]));
130 else
131 output.Append(" ");
132 }
133
134 for (int j = 0; j < 16 && (i + j) < bytes.Length; j++)
135 {
136 if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E)
137 output.Append((char)bytes[i + j]);
138 else
139 output.Append(".");
140 }
141 }
142 }
143
144 return output.ToString();
145 }
146 public Util()
147 {
148
149 }
150 }
151}
diff --git a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj
new file mode 100644
index 0000000..df68722
--- /dev/null
+++ b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj
@@ -0,0 +1,93 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{E88EF749-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.GenericConfig.Xml</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.GenericConfig.Xml</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 </ItemGroup>
70 <ItemGroup>
71 <ProjectReference Include="..\..\OpenSim.Framework\OpenSim.Framework.csproj">
72 <Name>OpenSim.Framework</Name>
73 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
74 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
75 <Private>False</Private>
76 </ProjectReference>
77 </ItemGroup>
78 <ItemGroup>
79 <Compile Include="XmlConfig.cs">
80 <SubType>Code</SubType>
81 </Compile>
82 <Compile Include="Properties\AssemblyInfo.cs">
83 <SubType>Code</SubType>
84 </Compile>
85 </ItemGroup>
86 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
87 <PropertyGroup>
88 <PreBuildEvent>
89 </PreBuildEvent>
90 <PostBuildEvent>
91 </PostBuildEvent>
92 </PropertyGroup>
93</Project>
diff --git a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj.user b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build
new file mode 100644
index 0000000..926e72c
--- /dev/null
+++ b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build
@@ -0,0 +1,42 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.GenericConfig.Xml" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.GenericConfig.Xml" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="XmlConfig.cs" />
15 <include name="Properties/AssemblyInfo.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="System.Xml.dll" />
24 <include name="../../../bin/OpenSim.Framework.dll" />
25 </references>
26 </csc>
27 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
28 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
29 <copy todir="${project::get-base-directory()}/../../../bin/">
30 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
31 <include name="*.dll"/>
32 <include name="*.exe"/>
33 </fileset>
34 </copy>
35 </target>
36 <target name="clean">
37 <delete dir="${bin.dir}" failonerror="false" />
38 <delete dir="${obj.dir}" failonerror="false" />
39 </target>
40 <target name="doc" description="Creates documentation.">
41 </target>
42</project>
diff --git a/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs b/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..de5f48d
--- /dev/null
+++ b/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.GenericConfig")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.GenericConfig")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("285a3047-f165-46c8-8767-b51428738a09")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs b/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs
new file mode 100644
index 0000000..62e3cbf
--- /dev/null
+++ b/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs
@@ -0,0 +1,109 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Xml;
5using OpenSim.Framework.Interfaces;
6
7namespace OpenSim.GenericConfig
8{
9 public class XmlConfig : IGenericConfig
10 {
11 private XmlDocument doc;
12 private XmlNode rootNode;
13 private XmlNode configNode;
14 private string fileName;
15 private bool createdFile = false;
16
17 public XmlConfig(string filename)
18 {
19 fileName = filename;
20 }
21
22 public void LoadData()
23 {
24 doc = new XmlDocument();
25 try
26 {
27 if (System.IO.File.Exists(fileName))
28 {
29 XmlTextReader reader = new XmlTextReader(fileName);
30 reader.WhitespaceHandling = WhitespaceHandling.None;
31 doc.Load(reader);
32 reader.Close();
33 }
34 else
35 {
36 createdFile = true;
37 rootNode = doc.CreateNode(XmlNodeType.Element, "Root", "");
38 doc.AppendChild(rootNode);
39 configNode = doc.CreateNode(XmlNodeType.Element, "Config", "");
40 rootNode.AppendChild(configNode);
41 }
42
43 }
44 catch (Exception e)
45 {
46 Console.WriteLine(e.Message);
47 return;
48 }
49 try
50 {
51 rootNode = doc.FirstChild;
52 if (rootNode.Name != "Root")
53 throw new Exception("Error: Invalid .xml File. Missing <Root>");
54
55 configNode = rootNode.FirstChild;
56 if (configNode.Name != "Config")
57 throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>");
58
59 }
60 catch (Exception e)
61 {
62 Console.WriteLine(e.Message);
63 }
64 if (createdFile)
65 {
66 this.Commit();
67 }
68 }
69
70 public string GetAttribute(string attributeName)
71 {
72 string result = "";
73 if (configNode.Attributes[attributeName] != null)
74 {
75 result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value;
76 }
77 return result;
78 }
79
80 public bool SetAttribute(string attributeName, string attributeValue)
81 {
82 if (configNode.Attributes[attributeName] != null)
83 {
84 ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue;
85 }
86 else
87 {
88 XmlAttribute attri;
89 attri = doc.CreateAttribute(attributeName);
90 attri.Value = attributeValue;
91 configNode.Attributes.Append(attri);
92 }
93 return true;
94 }
95
96 public void Commit()
97 {
98 doc.Save(fileName);
99 }
100
101 public void Close()
102 {
103 configNode = null;
104 rootNode = null;
105 doc = null;
106 }
107
108 }
109}
diff --git a/Common/OpenSim.Servers/BaseHttpServer.cs b/Common/OpenSim.Servers/BaseHttpServer.cs
new file mode 100644
index 0000000..38f4370
--- /dev/null
+++ b/Common/OpenSim.Servers/BaseHttpServer.cs
@@ -0,0 +1,256 @@
1using System;
2using System.Collections.Generic;
3using System.Net;
4using System.Text;
5using System.Text.RegularExpressions;
6using System.Threading;
7//using OpenSim.CAPS;
8using Nwc.XmlRpc;
9using System.Collections;
10using OpenSim.Framework.Console;
11
12namespace OpenSim.Servers
13{
14 public class BaseHttpServer
15 {
16 protected class RestMethodEntry
17 {
18 private string m_path;
19 public string Path
20 {
21 get { return m_path; }
22 }
23
24 private RestMethod m_restMethod;
25 public RestMethod RestMethod
26 {
27 get { return m_restMethod; }
28 }
29
30 public RestMethodEntry(string path, RestMethod restMethod)
31 {
32 m_path = path;
33 m_restMethod = restMethod;
34 }
35 }
36
37 protected Thread m_workerThread;
38 protected HttpListener m_httpListener;
39 protected Dictionary<string, RestMethodEntry> m_restHandlers = new Dictionary<string, RestMethodEntry>();
40 protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>();
41 protected int m_port;
42
43 public BaseHttpServer(int port)
44 {
45 m_port = port;
46 }
47
48 public bool AddRestHandler(string method, string path, RestMethod handler)
49 {
50 string methodKey = String.Format("{0}: {1}", method, path);
51
52 if (!this.m_restHandlers.ContainsKey(methodKey))
53 {
54 this.m_restHandlers.Add(methodKey, new RestMethodEntry(path, handler));
55 return true;
56 }
57
58 //must already have a handler for that path so return false
59 return false;
60 }
61
62 public bool AddXmlRPCHandler(string method, XmlRpcMethod handler)
63 {
64 if (!this.m_rpcHandlers.ContainsKey(method))
65 {
66 this.m_rpcHandlers.Add(method, handler);
67 return true;
68 }
69
70 //must already have a handler for that path so return false
71 return false;
72 }
73
74 protected virtual string ProcessXMLRPCMethod(string methodName, XmlRpcRequest request)
75 {
76 XmlRpcResponse response;
77
78 XmlRpcMethod method;
79 if (this.m_rpcHandlers.TryGetValue(methodName, out method))
80 {
81 response = method(request);
82 }
83 else
84 {
85 response = new XmlRpcResponse();
86 Hashtable unknownMethodError = new Hashtable();
87 unknownMethodError["reason"] = "XmlRequest"; ;
88 unknownMethodError["message"] = "Unknown Rpc request";
89 unknownMethodError["login"] = "false";
90 response.Value = unknownMethodError;
91 }
92
93 return XmlRpcResponseSerializer.Singleton.Serialize(response);
94 }
95
96 protected virtual string ParseREST(string request, string path, string method)
97 {
98 string response;
99
100 string requestKey = String.Format("{0}: {1}", method, path);
101
102 string bestMatch = String.Empty;
103 foreach (string currentKey in m_restHandlers.Keys)
104 {
105 if (requestKey.StartsWith(currentKey))
106 {
107 if (currentKey.Length > bestMatch.Length)
108 {
109 bestMatch = currentKey;
110 }
111 }
112 }
113
114 RestMethodEntry restMethodEntry;
115 if (m_restHandlers.TryGetValue(bestMatch, out restMethodEntry))
116 {
117 RestMethod restMethod = restMethodEntry.RestMethod;
118
119 string param = path.Substring(restMethodEntry.Path.Length);
120 response = restMethod(request, path, param);
121
122 }
123 else
124 {
125 response = String.Empty;
126 }
127
128 return response;
129 }
130
131 protected virtual string ParseLLSDXML(string requestBody)
132 {
133 // dummy function for now - IMPLEMENT ME!
134 return "";
135 }
136
137 protected virtual string ParseXMLRPC(string requestBody)
138 {
139 string responseString = String.Empty;
140
141 try
142 {
143 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
144
145 string methodName = request.MethodName;
146
147 responseString = ProcessXMLRPCMethod(methodName, request);
148 }
149 catch (Exception e)
150 {
151 Console.WriteLine(e.ToString());
152 }
153 return responseString;
154 }
155
156 public virtual void HandleRequest(Object stateinfo)
157 {
158 try
159 {
160 HttpListenerContext context = (HttpListenerContext)stateinfo;
161
162 HttpListenerRequest request = context.Request;
163 HttpListenerResponse response = context.Response;
164
165 response.KeepAlive = false;
166 response.SendChunked = false;
167
168 System.IO.Stream body = request.InputStream;
169 System.Text.Encoding encoding = System.Text.Encoding.UTF8;
170 System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding);
171
172 string requestBody = reader.ReadToEnd();
173 body.Close();
174 reader.Close();
175
176 //Console.WriteLine(request.HttpMethod + " " + request.RawUrl + " Http/" + request.ProtocolVersion.ToString() + " content type: " + request.ContentType);
177 //Console.WriteLine(requestBody);
178
179 string responseString = "";
180 switch (request.ContentType)
181 {
182 case "text/xml":
183 // must be XML-RPC, so pass to the XML-RPC parser
184
185 responseString = ParseXMLRPC(requestBody);
186 responseString = Regex.Replace(responseString, "utf-16", "utf-8");
187
188 response.AddHeader("Content-type", "text/xml");
189 break;
190
191 case "application/xml":
192 // probably LLSD we hope, otherwise it should be ignored by the parser
193 responseString = ParseLLSDXML(requestBody);
194 response.AddHeader("Content-type", "application/xml");
195 break;
196
197 case "application/x-www-form-urlencoded":
198 // a form data POST so send to the REST parser
199 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
200 response.AddHeader("Content-type", "text/html");
201 break;
202
203 case null:
204 // must be REST or invalid crap, so pass to the REST parser
205 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
206 response.AddHeader("Content-type", "text/html");
207 break;
208
209 }
210
211 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
212 System.IO.Stream output = response.OutputStream;
213 response.SendChunked = false;
214 response.ContentLength64 = buffer.Length;
215 output.Write(buffer, 0, buffer.Length);
216 output.Close();
217 }
218 catch (Exception e)
219 {
220 Console.WriteLine(e.ToString());
221 }
222 }
223
224 public void Start()
225 {
226 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server");
227
228 m_workerThread = new Thread(new ThreadStart(StartHTTP));
229 m_workerThread.IsBackground = true;
230 m_workerThread.Start();
231 }
232
233 private void StartHTTP()
234 {
235 try
236 {
237 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK");
238 m_httpListener = new HttpListener();
239
240 m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
241 m_httpListener.Start();
242
243 HttpListenerContext context;
244 while (true)
245 {
246 context = m_httpListener.GetContext();
247 ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context);
248 }
249 }
250 catch (Exception e)
251 {
252 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM, e.Message);
253 }
254 }
255 }
256}
diff --git a/Common/OpenSim.Servers/BaseServer.cs b/Common/OpenSim.Servers/BaseServer.cs
new file mode 100644
index 0000000..0a4c498
--- /dev/null
+++ b/Common/OpenSim.Servers/BaseServer.cs
@@ -0,0 +1,10 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Servers
6{
7 public class BaseServer
8 {
9 }
10}
diff --git a/Common/OpenSim.Servers/CheckSumServer.cs b/Common/OpenSim.Servers/CheckSumServer.cs
new file mode 100644
index 0000000..1125baf
--- /dev/null
+++ b/Common/OpenSim.Servers/CheckSumServer.cs
@@ -0,0 +1,113 @@
1using System;
2using System.Text;
3using System.IO;
4using System.Threading;
5using System.Net;
6using System.Net.Sockets;
7using System.Timers;
8using System.Reflection;
9using System.Collections;
10using System.Collections.Generic;
11using libsecondlife;
12using libsecondlife.Packets;
13using OpenSim.Framework.Console;
14
15
16namespace OpenSim.Servers
17{
18 public class CheckSumServer : UDPServerBase
19 {
20 //protected ConsoleBase m_console;
21
22 public CheckSumServer(int port)
23 : base(port)
24 {
25 }
26
27 protected override void OnReceivedData(IAsyncResult result)
28 {
29 ipeSender = new IPEndPoint(IPAddress.Any, 0);
30 epSender = (EndPoint)ipeSender;
31 Packet packet = null;
32 int numBytes = Server.EndReceiveFrom(result, ref epSender);
33 int packetEnd = numBytes - 1;
34
35 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
36
37 if (packet.Type == PacketType.SecuredTemplateChecksumRequest)
38 {
39 SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet;
40 TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket();
41 checkreply.DataBlock.Checksum = 3220703154;//180572585;
42 checkreply.DataBlock.Flags = 0;
43 checkreply.DataBlock.MajorVersion = 1;
44 checkreply.DataBlock.MinorVersion = 15;
45 checkreply.DataBlock.PatchVersion = 0;
46 checkreply.DataBlock.ServerVersion = 0;
47 checkreply.TokenBlock.Token = checksum.TokenBlock.Token;
48 this.SendPacket(checkreply, epSender);
49
50 /*
51 //if we wanted to echo the the checksum/ version from the client (so that any client worked)
52 SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket();
53 checkrequest.TokenBlock.Token = checksum.TokenBlock.Token;
54 this.SendPacket(checkrequest, epSender);
55 */
56 }
57 else if (packet.Type == PacketType.TemplateChecksumReply)
58 {
59 //echo back the client checksum reply (Hegemon's method)
60 TemplateChecksumReplyPacket checksum2 = (TemplateChecksumReplyPacket)packet;
61 TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket();
62 checkreply2.DataBlock.Checksum = checksum2.DataBlock.Checksum;
63 checkreply2.DataBlock.Flags = checksum2.DataBlock.Flags;
64 checkreply2.DataBlock.MajorVersion = checksum2.DataBlock.MajorVersion;
65 checkreply2.DataBlock.MinorVersion = checksum2.DataBlock.MinorVersion;
66 checkreply2.DataBlock.PatchVersion = checksum2.DataBlock.PatchVersion;
67 checkreply2.DataBlock.ServerVersion = checksum2.DataBlock.ServerVersion;
68 checkreply2.TokenBlock.Token = checksum2.TokenBlock.Token;
69 this.SendPacket(checkreply2, epSender);
70 }
71 else
72 {
73 }
74
75 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
76 }
77
78 private void SendPacket(Packet Pack, EndPoint endp)
79 {
80 if (!Pack.Header.Resent)
81 {
82 Pack.Header.Sequence = 1;
83 }
84
85 byte[] ZeroOutBuffer = new byte[4096];
86 byte[] sendbuffer;
87 sendbuffer = Pack.ToBytes();
88
89 try
90 {
91 if (Pack.Header.Zerocoded)
92 {
93 int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
94 this.SendPackTo(ZeroOutBuffer, packetsize, SocketFlags.None, endp);
95 }
96 else
97 {
98 this.SendPackTo(sendbuffer, sendbuffer.Length, SocketFlags.None, endp);
99 }
100 }
101 catch (Exception)
102 {
103 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection ");
104
105 }
106 }
107
108 private void SendPackTo(byte[] buffer, int size, SocketFlags flags, EndPoint endp)
109 {
110 this.Server.SendTo(buffer, size, flags, endp);
111 }
112 }
113} \ No newline at end of file
diff --git a/Common/OpenSim.Servers/IRestHandler.cs b/Common/OpenSim.Servers/IRestHandler.cs
new file mode 100644
index 0000000..c322505
--- /dev/null
+++ b/Common/OpenSim.Servers/IRestHandler.cs
@@ -0,0 +1,8 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Servers
6{
7 public delegate string RestMethod( string request, string path, string param );
8}
diff --git a/Common/OpenSim.Servers/LocalUserProfileManager.cs b/Common/OpenSim.Servers/LocalUserProfileManager.cs
new file mode 100644
index 0000000..a8b5f1f
--- /dev/null
+++ b/Common/OpenSim.Servers/LocalUserProfileManager.cs
@@ -0,0 +1,123 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using System;
29using System.Collections.Generic;
30using System.Collections;
31using System.Text;
32using OpenSim.Framework.User;
33using OpenSim.Framework.Grid;
34using OpenSim.Framework.Inventory;
35using OpenSim.Framework.Interfaces;
36using OpenSim.Framework.Types;
37using libsecondlife;
38
39namespace OpenSim.UserServer
40{
41 public class LocalUserProfileManager : UserProfileManager
42 {
43 private IGridServer m_gridServer;
44 private int m_port;
45 private string m_ipAddr;
46 private uint regionX;
47 private uint regionY;
48 private AddNewSessionHandler AddSession;
49
50 public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY)
51 {
52 m_gridServer = gridServer;
53 m_port = simPort;
54 m_ipAddr = ipAddr;
55 regionX = regX;
56 regionY = regY;
57 }
58
59 public void SetSessionHandler(AddNewSessionHandler sessionHandler)
60 {
61 this.AddSession = sessionHandler;
62 }
63
64 public override void InitUserProfiles()
65 {
66 // TODO: need to load from database
67 }
68
69 public override void CustomiseResponse(ref System.Collections.Hashtable response, UserProfile theUser)
70 {
71 Int32 circode = (Int32)response["circuit_code"];
72 theUser.AddSimCircuit((uint)circode, LLUUID.Random());
73 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() + "]}";
74 response["sim_port"] = m_port;
75 response["sim_ip"] = m_ipAddr;
76 response["region_y"] = (Int32)regionY* 256;
77 response["region_x"] = (Int32)regionX* 256;
78
79 string first;
80 string last;
81 if (response.Contains("first_name"))
82 {
83 first = (string)response["first_name"];
84 }
85 else
86 {
87 first = "test";
88 }
89
90 if (response.Contains("last_name"))
91 {
92 last = (string)response["last_name"];
93 }
94 else
95 {
96 last = "User";
97 }
98
99 ArrayList InventoryList = (ArrayList)response["inventory-skeleton"];
100 Hashtable Inventory1 = (Hashtable)InventoryList[0];
101
102 Login _login = new Login();
103 //copy data to login object
104 _login.First = first;
105 _login.Last = last;
106 _login.Agent = new LLUUID((string)response["agent_id"]) ;
107 _login.Session = new LLUUID((string)response["session_id"]);
108 _login.SecureSession = new LLUUID((string)response["secure_session_id"]);
109 _login.CircuitCode =(uint) circode;
110 _login.BaseFolder = null;
111 _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]);
112
113 //working on local computer if so lets add to the gridserver's list of sessions?
114 /*if (m_gridServer.GetName() == "Local")
115 {
116 Console.WriteLine("adding login data to gridserver");
117 ((LocalGridBase)this.m_gridServer).AddNewSession(_login);
118 }*/
119
120 this.AddSession(_login);
121 }
122 }
123}
diff --git a/Common/OpenSim.Servers/LoginResponse.cs b/Common/OpenSim.Servers/LoginResponse.cs
new file mode 100644
index 0000000..7333d1f
--- /dev/null
+++ b/Common/OpenSim.Servers/LoginResponse.cs
@@ -0,0 +1,670 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using Nwc.XmlRpc;
29using System;
30using System.IO;
31using System.Net;
32using System.Net.Sockets;
33using System.Text;
34using System.Text.RegularExpressions;
35using System.Threading;
36using System.Collections;
37using System.Security.Cryptography;
38using System.Xml;
39using libsecondlife;
40using OpenSim;
41using OpenSim.Framework.User;
42using OpenSim.Framework.Inventory;
43using OpenSim.Framework.Utilities;
44using OpenSim.Framework.Interfaces;
45
46// ?
47using OpenSim.Framework.Grid;
48
49namespace OpenSim.UserServer
50{
51 /// <summary>
52 /// A temp class to handle login response.
53 /// Should make use of UserProfileManager where possible.
54 /// </summary>
55
56 public class LoginResponse
57 {
58 private Hashtable loginFlagsHash;
59 private Hashtable globalTexturesHash;
60 private Hashtable loginError;
61 private Hashtable eventCategoriesHash;
62 private Hashtable uiConfigHash;
63 private Hashtable classifiedCategoriesHash;
64
65 private ArrayList loginFlags;
66 private ArrayList globalTextures;
67 private ArrayList eventCategories;
68 private ArrayList uiConfig;
69 private ArrayList classifiedCategories;
70 private ArrayList inventoryRoot;
71 private ArrayList initialOutfit;
72 private ArrayList agentInventory;
73
74 private UserProfile userProfile;
75
76 private LLUUID agentID;
77 private LLUUID sessionID;
78 private LLUUID secureSessionID;
79 private LLUUID baseFolderID;
80 private LLUUID inventoryFolderID;
81
82 // Login Flags
83 private string dst;
84 private string stipendSinceLogin;
85 private string gendered;
86 private string everLoggedIn;
87 private string login;
88 private string simPort;
89 private string simAddress;
90 private string agentAccess;
91 private Int32 circuitCode;
92 private uint regionX;
93 private uint regionY;
94
95 // Login
96 private string firstname;
97 private string lastname;
98
99 // Global Textures
100 private string sunTexture;
101 private string cloudTexture;
102 private string moonTexture;
103
104 // Error Flags
105 private string errorReason;
106 private string errorMessage;
107
108 // Response
109 private XmlRpcResponse xmlRpcResponse;
110 private XmlRpcResponse defaultXmlRpcResponse;
111
112 private string welcomeMessage;
113 private string startLocation;
114 private string allowFirstLife;
115 private string home;
116 private string seedCapability;
117 private string lookAt;
118
119 public LoginResponse()
120 {
121 this.loginFlags = new ArrayList();
122 this.globalTextures = new ArrayList();
123 this.eventCategories = new ArrayList();
124 this.uiConfig = new ArrayList();
125 this.classifiedCategories = new ArrayList();
126
127 this.loginError = new Hashtable();
128 this.eventCategoriesHash = new Hashtable();
129 this.classifiedCategoriesHash = new Hashtable();
130 this.uiConfigHash = new Hashtable();
131
132 this.defaultXmlRpcResponse = new XmlRpcResponse();
133 this.userProfile = new UserProfile();
134 this.inventoryRoot = new ArrayList();
135 this.initialOutfit = new ArrayList();
136 this.agentInventory = new ArrayList();
137
138 this.xmlRpcResponse = new XmlRpcResponse();
139 this.defaultXmlRpcResponse = new XmlRpcResponse();
140
141 this.SetDefaultValues();
142 } // LoginServer
143
144 public void SetDefaultValues()
145 {
146 try
147 {
148 this.DST = "N";
149 this.StipendSinceLogin = "N";
150 this.Gendered = "Y";
151 this.EverLoggedIn = "Y";
152 this.login = "false";
153 this.firstname = "Test";
154 this.lastname = "User";
155 this.agentAccess = "M";
156 this.startLocation = "last";
157 this.allowFirstLife = "Y";
158
159 this.SunTexture = "cce0f112-878f-4586-a2e2-a8f104bba271";
160 this.CloudTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
161 this.MoonTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
162
163 this.ErrorMessage = "You have entered an invalid name/password combination. Check Caps/lock.";
164 this.ErrorReason = "key";
165 this.welcomeMessage = "Welcome to OpenSim!";
166 this.seedCapability = "";
167 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() + "]}";
168 this.lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]";
169 this.RegionX = (uint)255232;
170 this.RegionY = (uint)254976;
171
172 // Classifieds;
173 this.AddClassifiedCategory((Int32)1, "Shopping");
174 this.AddClassifiedCategory((Int32)2, "Land Rental");
175 this.AddClassifiedCategory((Int32)3, "Property Rental");
176 this.AddClassifiedCategory((Int32)4, "Special Attraction");
177 this.AddClassifiedCategory((Int32)5, "New Products");
178 this.AddClassifiedCategory((Int32)6, "Employment");
179 this.AddClassifiedCategory((Int32)7, "Wanted");
180 this.AddClassifiedCategory((Int32)8, "Service");
181 this.AddClassifiedCategory((Int32)9, "Personal");
182
183 int SessionRand = Util.RandomClass.Next(1, 999);
184 this.SessionID = new LLUUID("aaaabbbb-0200-" + SessionRand.ToString("0000") + "-8664-58f53e442797");
185 this.SecureSessionID = LLUUID.Random();
186
187 this.userProfile.Inventory.CreateRootFolder(this.userProfile.UUID, true);
188 this.baseFolderID = this.userProfile.Inventory.GetFolderID("Textures");
189 this.inventoryFolderID = this.userProfile.Inventory.GetFolderID("My Inventory-");
190 Hashtable InventoryRootHash = new Hashtable();
191 InventoryRootHash["folder_id"] = this.userProfile.Inventory.InventoryRoot.FolderID.ToStringHyphenated();
192 this.inventoryRoot.Add(InventoryRootHash);
193
194 Hashtable TempHash;
195 foreach (InventoryFolder InvFolder in this.userProfile.Inventory.InventoryFolders.Values)
196 {
197 TempHash = new Hashtable();
198 TempHash["name"] = InvFolder.FolderName;
199 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
200 TempHash["version"] = (Int32)InvFolder.Version;
201 TempHash["type_default"] = (Int32)InvFolder.DefaultType;
202 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
203 this.agentInventory.Add(TempHash);
204 }
205
206 Hashtable InitialOutfitHash = new Hashtable();
207 InitialOutfitHash["folder_name"] = "Nightclub Female";
208 InitialOutfitHash["gender"] = "female";
209 this.initialOutfit.Add(InitialOutfitHash);
210 }
211 catch (Exception e)
212 {
213 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(
214 OpenSim.Framework.Console.LogPriority.LOW,
215 "LoginResponse: Unable to set default values: " + e.Message
216 );
217 }
218
219 } // SetDefaultValues
220
221 protected virtual LLUUID GetAgentId()
222 {
223 // todo
224 LLUUID Agent;
225 int AgentRand = Util.RandomClass.Next(1, 9999);
226 Agent = new LLUUID("99998888-0100-" + AgentRand.ToString("0000") + "-8ec1-0b1d5cd6aead");
227 return Agent;
228 } // GetAgentId
229
230 private XmlRpcResponse GenerateFailureResponse(string reason, string message, string login)
231 {
232 // Overwrite any default values;
233 this.xmlRpcResponse = new XmlRpcResponse();
234
235 // Ensure Login Failed message/reason;
236 this.ErrorMessage = message;
237 this.ErrorReason = reason;
238
239 this.loginError["reason"] = this.ErrorReason;
240 this.loginError["message"] = this.ErrorMessage;
241 this.loginError["login"] = login;
242 this.xmlRpcResponse.Value = this.loginError;
243 return (this.xmlRpcResponse);
244 } // GenerateResponse
245
246 public XmlRpcResponse LoginFailedResponse()
247 {
248 return (this.GenerateFailureResponse("key", "You have entered an invalid name/password combination. Check Caps/lock.", "false"));
249 } // LoginFailedResponse
250
251 public XmlRpcResponse ConnectionFailedResponse()
252 {
253 return (this.LoginFailedResponse());
254 } // CreateErrorConnectingToGridResponse()
255
256 public XmlRpcResponse CreateAlreadyLoggedInResponse()
257 {
258 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"));
259 } // CreateAlreadyLoggedInResponse()
260
261 public XmlRpcResponse ToXmlRpcResponse()
262 {
263 try
264 {
265
266 Hashtable responseData = new Hashtable();
267
268 this.loginFlagsHash = new Hashtable();
269 this.loginFlagsHash["daylight_savings"] = this.DST;
270 this.loginFlagsHash["stipend_since_login"] = this.StipendSinceLogin;
271 this.loginFlagsHash["gendered"] = this.Gendered;
272 this.loginFlagsHash["ever_logged_in"] = this.EverLoggedIn;
273 this.loginFlags.Add(this.loginFlagsHash);
274
275 responseData["first_name"] = this.Firstname;
276 responseData["last_name"] = this.Lastname;
277 responseData["agent_access"] = this.agentAccess;
278
279 this.globalTexturesHash = new Hashtable();
280 this.globalTexturesHash["sun_texture_id"] = this.SunTexture;
281 this.globalTexturesHash["cloud_texture_id"] = this.CloudTexture;
282 this.globalTexturesHash["moon_texture_id"] = this.MoonTexture;
283 this.globalTextures.Add(this.globalTexturesHash);
284 this.eventCategories.Add(this.eventCategoriesHash);
285
286 this.AddToUIConfig("allow_first_life", this.allowFirstLife);
287 this.uiConfig.Add(this.uiConfigHash);
288
289 // Create a agent and session LLUUID
290 this.agentID = this.GetAgentId();
291
292 responseData["sim_port"] = this.SimPort;
293 responseData["sim_ip"] = this.SimAddress;
294 responseData["agent_id"] = this.AgentID.ToStringHyphenated();
295 responseData["session_id"] = this.SessionID.ToStringHyphenated();
296 responseData["secure_session_id"] = this.SecureSessionID.ToStringHyphenated();
297 responseData["circuit_code"] = this.CircuitCode;
298 responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
299 responseData["login-flags"] = this.loginFlags;
300 responseData["global-textures"] = this.globalTextures;
301 responseData["seed_capability"] = this.seedCapability;
302
303 responseData["event_categories"] = this.eventCategories;
304 responseData["event_notifications"] = new ArrayList(); // todo
305 responseData["classified_categories"] = this.classifiedCategories;
306 responseData["ui-config"] = this.uiConfig;
307
308 responseData["inventory-skeleton"] = this.agentInventory;
309 responseData["inventory-skel-lib"] = new ArrayList(); // todo
310 responseData["inventory-root"] = this.inventoryRoot;
311 responseData["gestures"] = new ArrayList(); // todo
312 responseData["inventory-lib-owner"] = new ArrayList(); // todo
313 responseData["initial-outfit"] = this.initialOutfit;
314 responseData["start_location"] = this.startLocation;
315 responseData["seed_capability"] = this.seedCapability;
316 responseData["home"] = this.home;
317 responseData["look_at"] = this.lookAt;
318 responseData["message"] = this.welcomeMessage;
319 responseData["region_x"] = (Int32)this.RegionX * 256;
320 responseData["region_y"] = (Int32)this.RegionY * 256;
321
322 responseData["login"] = "true";
323 this.xmlRpcResponse.Value = responseData;
324
325 return (this.xmlRpcResponse);
326 }
327 catch (Exception e)
328 {
329 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(
330 OpenSim.Framework.Console.LogPriority.LOW,
331 "LoginResponse: Error creating XML-RPC Response: " + e.Message
332 );
333 return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false"));
334
335 }
336
337 } // ToXmlRpcResponse
338
339 public void SetEventCategories(string category, string value)
340 {
341 this.eventCategoriesHash[category] = value;
342 } // SetEventCategories
343
344 public void AddToUIConfig(string itemName, string item)
345 {
346 this.uiConfigHash[itemName] = item;
347 } // SetUIConfig
348
349 public void AddClassifiedCategory(Int32 ID, string categoryName)
350 {
351 this.classifiedCategoriesHash["category_name"] = categoryName;
352 this.classifiedCategoriesHash["category_id"] = ID;
353 this.classifiedCategories.Add(this.classifiedCategoriesHash);
354 // this.classifiedCategoriesHash.Clear();
355 } // SetClassifiedCategory
356
357 public string Login
358 {
359 get
360 {
361 return this.login;
362 }
363 set
364 {
365 this.login = value;
366 }
367 } // Login
368
369 public string DST
370 {
371 get
372 {
373 return this.dst;
374 }
375 set
376 {
377 this.dst = value;
378 }
379 } // DST
380
381 public string StipendSinceLogin
382 {
383 get
384 {
385 return this.stipendSinceLogin;
386 }
387 set
388 {
389 this.stipendSinceLogin = value;
390 }
391 } // StipendSinceLogin
392
393 public string Gendered
394 {
395 get
396 {
397 return this.gendered;
398 }
399 set
400 {
401 this.gendered = value;
402 }
403 } // Gendered
404
405 public string EverLoggedIn
406 {
407 get
408 {
409 return this.everLoggedIn;
410 }
411 set
412 {
413 this.everLoggedIn = value;
414 }
415 } // EverLoggedIn
416
417 public string SimPort
418 {
419 get
420 {
421 return this.simPort;
422 }
423 set
424 {
425 this.simPort = value;
426 }
427 } // SimPort
428
429 public string SimAddress
430 {
431 get
432 {
433 return this.simAddress;
434 }
435 set
436 {
437 this.simAddress = value;
438 }
439 } // SimAddress
440
441 public LLUUID AgentID
442 {
443 get
444 {
445 return this.agentID;
446 }
447 set
448 {
449 this.agentID = value;
450 }
451 } // AgentID
452
453 public LLUUID SessionID
454 {
455 get
456 {
457 return this.sessionID;
458 }
459 set
460 {
461 this.sessionID = value;
462 }
463 } // SessionID
464
465 public LLUUID SecureSessionID
466 {
467 get
468 {
469 return this.secureSessionID;
470 }
471 set
472 {
473 this.secureSessionID = value;
474 }
475 } // SecureSessionID
476
477 public LLUUID BaseFolderID
478 {
479 get
480 {
481 return this.baseFolderID;
482 }
483 set
484 {
485 this.baseFolderID = value;
486 }
487 } // BaseFolderID
488
489 public LLUUID InventoryFolderID
490 {
491 get
492 {
493 return this.inventoryFolderID;
494 }
495 set
496 {
497 this.inventoryFolderID = value;
498 }
499 } // InventoryFolderID
500
501 public Int32 CircuitCode
502 {
503 get
504 {
505 return this.circuitCode;
506 }
507 set
508 {
509 this.circuitCode = value;
510 }
511 } // CircuitCode
512
513 public uint RegionX
514 {
515 get
516 {
517 return this.regionX;
518 }
519 set
520 {
521 this.regionX = value;
522 }
523 } // RegionX
524
525 public uint RegionY
526 {
527 get
528 {
529 return this.regionY;
530 }
531 set
532 {
533 this.regionY = value;
534 }
535 } // RegionY
536
537 public string SunTexture
538 {
539 get
540 {
541 return this.sunTexture;
542 }
543 set
544 {
545 this.sunTexture = value;
546 }
547 } // SunTexture
548
549 public string CloudTexture
550 {
551 get
552 {
553 return this.cloudTexture;
554 }
555 set
556 {
557 this.cloudTexture = value;
558 }
559 } // CloudTexture
560
561 public string MoonTexture
562 {
563 get
564 {
565 return this.moonTexture;
566 }
567 set
568 {
569 this.moonTexture = value;
570 }
571 } // MoonTexture
572
573 public string Firstname
574 {
575 get
576 {
577 return this.firstname;
578 }
579 set
580 {
581 this.firstname = value;
582 }
583 } // Firstname
584
585 public string Lastname
586 {
587 get
588 {
589 return this.lastname;
590 }
591 set
592 {
593 this.lastname = value;
594 }
595 } // Lastname
596
597 public string AgentAccess
598 {
599 get
600 {
601 return this.agentAccess;
602 }
603 set
604 {
605 this.agentAccess = value;
606 }
607 }
608
609 public string StartLocation
610 {
611 get
612 {
613 return this.startLocation;
614 }
615 set
616 {
617 this.startLocation = value;
618 }
619 } // StartLocation
620
621 public string LookAt
622 {
623 get
624 {
625 return this.lookAt;
626 }
627 set
628 {
629 this.lookAt = value;
630 }
631 }
632
633 public string SeedCapability
634 {
635 get
636 {
637 return this.seedCapability;
638 }
639 set
640 {
641 this.seedCapability = value;
642 }
643 } // SeedCapability
644
645 public string ErrorReason
646 {
647 get
648 {
649 return this.errorReason;
650 }
651 set
652 {
653 this.errorReason = value;
654 }
655 } // ErrorReason
656
657 public string ErrorMessage
658 {
659 get
660 {
661 return this.errorMessage;
662 }
663 set
664 {
665 this.errorMessage = value;
666 }
667 } // ErrorMessage
668
669 } // LoginResponse
670} // namespace OpenSim.UserServer \ No newline at end of file
diff --git a/Common/OpenSim.Servers/LoginServer.cs b/Common/OpenSim.Servers/LoginServer.cs
new file mode 100644
index 0000000..6fd174b
--- /dev/null
+++ b/Common/OpenSim.Servers/LoginServer.cs
@@ -0,0 +1,284 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using Nwc.XmlRpc;
29using System;
30using System.IO;
31using System.Net;
32using System.Net.Sockets;
33using System.Text;
34using System.Text.RegularExpressions;
35using System.Threading;
36using System.Collections;
37using System.Security.Cryptography;
38using System.Xml;
39using libsecondlife;
40using OpenSim;
41using OpenSim.Framework.Interfaces;
42using OpenSim.Framework.Grid;
43using OpenSim.Framework.Inventory;
44using OpenSim.Framework.User;
45using OpenSim.Framework.Utilities;
46using OpenSim.Framework.Types;
47
48namespace OpenSim.UserServer
49{
50 public delegate void AddNewSessionHandler(Login loginData);
51 /// <summary>
52 /// When running in local (default) mode , handles client logins.
53 /// </summary>
54 public class LoginServer : LoginService, IUserServer
55 {
56 private IGridServer m_gridServer;
57 public IPAddress clientAddress = IPAddress.Loopback;
58 public IPAddress remoteAddress = IPAddress.Any;
59 private int NumClients;
60 private bool userAccounts = false;
61 private string _mpasswd;
62 private bool _needPasswd = false;
63 private LocalUserProfileManager userManager;
64 private int m_simPort;
65 private string m_simAddr;
66 private uint regionX;
67 private uint regionY;
68 private AddNewSessionHandler AddSession;
69
70 public LocalUserProfileManager LocalUserManager
71 {
72 get
73 {
74 return userManager;
75 }
76 }
77
78 public LoginServer( string simAddr, int simPort, uint regX, uint regY, bool useAccounts)
79 {
80 m_simPort = simPort;
81 m_simAddr = simAddr;
82 regionX = regX;
83 regionY = regY;
84 this.userAccounts = useAccounts;
85 }
86
87 public void SetSessionHandler(AddNewSessionHandler sessionHandler)
88 {
89 this.AddSession = sessionHandler;
90 this.userManager.SetSessionHandler(sessionHandler);
91 }
92
93 public void Startup()
94 {
95 this._needPasswd = false;
96
97 this._mpasswd = EncodePassword("testpass");
98
99 userManager = new LocalUserProfileManager(this.m_gridServer, m_simPort, m_simAddr, regionX, regionY);
100 //userManager.InitUserProfiles();
101 userManager.SetKeys("", "", "", "Welcome to OpenSim");
102 }
103
104 public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
105 {
106 Console.WriteLine("login attempt");
107 Hashtable requestData = (Hashtable)request.Params[0];
108 string first;
109 string last;
110 string passwd;
111
112 LoginResponse loginResponse = new LoginResponse();
113 loginResponse.RegionX = regionX;
114 loginResponse.RegionY = regionY;
115
116 //get login name
117 if (requestData.Contains("first"))
118 {
119 first = (string)requestData["first"];
120 }
121 else
122 {
123 first = "test";
124 }
125
126 if (requestData.Contains("last"))
127 {
128 last = (string)requestData["last"];
129 }
130 else
131 {
132 last = "User" + NumClients.ToString();
133 }
134
135 if (requestData.Contains("passwd"))
136 {
137 passwd = (string)requestData["passwd"];
138 }
139 else
140 {
141 passwd = "notfound";
142 }
143
144 if (!Authenticate(first, last, passwd))
145 {
146 return loginResponse.LoginFailedResponse();
147 }
148
149 NumClients++;
150
151 // Create a agent and session LLUUID
152 // Agent = GetAgentId(first, last);
153 // int SessionRand = Util.RandomClass.Next(1, 999);
154 // Session = new LLUUID("aaaabbbb-0200-" + SessionRand.ToString("0000") + "-8664-58f53e442797");
155 // LLUUID secureSess = LLUUID.Random();
156
157 loginResponse.SimPort = m_simPort.ToString();
158 loginResponse.SimAddress = m_simAddr.ToString();
159 // loginResponse.AgentID = Agent.ToStringHyphenated();
160 // loginResponse.SessionID = Session.ToStringHyphenated();
161 // loginResponse.SecureSessionID = secureSess.ToStringHyphenated();
162 loginResponse.CircuitCode = (Int32)(Util.RandomClass.Next());
163 XmlRpcResponse response = loginResponse.ToXmlRpcResponse();
164 Hashtable responseData = (Hashtable)response.Value;
165
166 //inventory
167 /* ArrayList InventoryList = (ArrayList)responseData["inventory-skeleton"];
168 Hashtable Inventory1 = (Hashtable)InventoryList[0];
169 Hashtable Inventory2 = (Hashtable)InventoryList[1];
170 LLUUID BaseFolderID = LLUUID.Random();
171 LLUUID InventoryFolderID = LLUUID.Random();
172 Inventory2["name"] = "Textures";
173 Inventory2["folder_id"] = BaseFolderID.ToStringHyphenated();
174 Inventory2["type_default"] = 0;
175 Inventory1["folder_id"] = InventoryFolderID.ToStringHyphenated();
176
177 ArrayList InventoryRoot = (ArrayList)responseData["inventory-root"];
178 Hashtable Inventoryroot = (Hashtable)InventoryRoot[0];
179 Inventoryroot["folder_id"] = InventoryFolderID.ToStringHyphenated();
180 */
181 CustomiseLoginResponse(responseData, first, last);
182
183 Login _login = new Login();
184 //copy data to login object
185 _login.First = first;
186 _login.Last = last;
187 _login.Agent = loginResponse.AgentID;
188 _login.Session = loginResponse.SessionID;
189 _login.SecureSession = loginResponse.SecureSessionID;
190 _login.CircuitCode = (uint) loginResponse.CircuitCode;
191 _login.BaseFolder = loginResponse.BaseFolderID;
192 _login.InventoryFolder = loginResponse.InventoryFolderID;
193
194 //working on local computer if so lets add to the gridserver's list of sessions?
195 /* if (m_gridServer.GetName() == "Local")
196 {
197 ((LocalGridBase)m_gridServer).AddNewSession(_login);
198 }*/
199 AddSession(_login);
200
201 return response;
202 }
203
204 protected virtual void CustomiseLoginResponse(Hashtable responseData, string first, string last)
205 {
206 }
207
208 protected virtual LLUUID GetAgentId(string firstName, string lastName)
209 {
210 LLUUID Agent;
211 int AgentRand = Util.RandomClass.Next(1, 9999);
212 Agent = new LLUUID("99998888-0100-" + AgentRand.ToString("0000") + "-8ec1-0b1d5cd6aead");
213 return Agent;
214 }
215
216 protected virtual bool Authenticate(string first, string last, string passwd)
217 {
218 if (this._needPasswd)
219 {
220 //every user needs the password to login
221 string encodedPass = passwd.Remove(0, 3); //remove $1$
222 if (encodedPass == this._mpasswd)
223 {
224 return true;
225 }
226 else
227 {
228 return false;
229 }
230 }
231 else
232 {
233 //do not need password to login
234 return true;
235 }
236 }
237
238 private static string EncodePassword(string passwd)
239 {
240 Byte[] originalBytes;
241 Byte[] encodedBytes;
242 MD5 md5;
243
244 md5 = new MD5CryptoServiceProvider();
245 originalBytes = ASCIIEncoding.Default.GetBytes(passwd);
246 encodedBytes = md5.ComputeHash(originalBytes);
247
248 return Regex.Replace(BitConverter.ToString(encodedBytes), "-", "").ToLower();
249 }
250
251 public bool CreateUserAccount(string firstName, string lastName, string password)
252 {
253 Console.WriteLine("creating new user account");
254 string mdPassword = EncodePassword(password);
255 Console.WriteLine("with password: " + mdPassword);
256 this.userManager.CreateNewProfile(firstName, lastName, mdPassword);
257 return true;
258 }
259
260 //IUserServer implementation
261 public AgentInventory RequestAgentsInventory(LLUUID agentID)
262 {
263 AgentInventory aInventory = null;
264 if (this.userAccounts)
265 {
266 aInventory = this.userManager.GetUsersInventory(agentID);
267 }
268
269 return aInventory;
270 }
271
272 public bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory)
273 {
274 return true;
275 }
276
277 public void SetServerInfo(string ServerUrl, string SendKey, string RecvKey)
278 {
279
280 }
281 }
282
283
284}
diff --git a/Common/OpenSim.Servers/OpenSim.Servers.csproj b/Common/OpenSim.Servers/OpenSim.Servers.csproj
new file mode 100644
index 0000000..e89a62c
--- /dev/null
+++ b/Common/OpenSim.Servers/OpenSim.Servers.csproj
@@ -0,0 +1,130 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{8BB20F0A-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Servers</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Servers</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="libsecondlife.dll" >
70 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 </ItemGroup>
74 <ItemGroup>
75 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
76 <Name>OpenSim.Framework</Name>
77 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
78 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
79 <Private>False</Private>
80 </ProjectReference>
81 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
82 <Name>OpenSim.Framework.Console</Name>
83 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
84 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
85 <Private>False</Private>
86 </ProjectReference>
87 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
88 <Name>XMLRPC</Name>
89 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
90 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
91 <Private>False</Private>
92 </ProjectReference>
93 </ItemGroup>
94 <ItemGroup>
95 <Compile Include="BaseHttpServer.cs">
96 <SubType>Code</SubType>
97 </Compile>
98 <Compile Include="BaseServer.cs">
99 <SubType>Code</SubType>
100 </Compile>
101 <Compile Include="CheckSumServer.cs">
102 <SubType>Code</SubType>
103 </Compile>
104 <Compile Include="IRestHandler.cs">
105 <SubType>Code</SubType>
106 </Compile>
107 <Compile Include="LocalUserProfileManager.cs">
108 <SubType>Code</SubType>
109 </Compile>
110 <Compile Include="LoginResponse.cs">
111 <SubType>Code</SubType>
112 </Compile>
113 <Compile Include="LoginServer.cs">
114 <SubType>Code</SubType>
115 </Compile>
116 <Compile Include="UDPServerBase.cs">
117 <SubType>Code</SubType>
118 </Compile>
119 <Compile Include="XmlRpcMethod.cs">
120 <SubType>Code</SubType>
121 </Compile>
122 </ItemGroup>
123 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
124 <PropertyGroup>
125 <PreBuildEvent>
126 </PreBuildEvent>
127 <PostBuildEvent>
128 </PostBuildEvent>
129 </PropertyGroup>
130</Project>
diff --git a/Common/OpenSim.Servers/OpenSim.Servers.csproj.user b/Common/OpenSim.Servers/OpenSim.Servers.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/Common/OpenSim.Servers/OpenSim.Servers.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/Common/OpenSim.Servers/OpenSim.Servers.dll.build b/Common/OpenSim.Servers/OpenSim.Servers.dll.build
new file mode 100644
index 0000000..41c1350
--- /dev/null
+++ b/Common/OpenSim.Servers/OpenSim.Servers.dll.build
@@ -0,0 +1,52 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Servers" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Servers" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="BaseHttpServer.cs" />
15 <include name="BaseServer.cs" />
16 <include name="CheckSumServer.cs" />
17 <include name="IRestHandler.cs" />
18 <include name="LocalUserProfileManager.cs" />
19 <include name="LoginResponse.cs" />
20 <include name="LoginServer.cs" />
21 <include name="UDPServerBase.cs" />
22 <include name="XmlRpcMethod.cs" />
23 </sources>
24 <references basedir="${project::get-base-directory()}">
25 <lib>
26 <include name="${project::get-base-directory()}" />
27 <include name="${project::get-base-directory()}/${build.dir}" />
28 </lib>
29 <include name="System.dll" />
30 <include name="System.Xml.dll" />
31 <include name="../../bin/OpenSim.Framework.dll" />
32 <include name="../../bin/OpenSim.Framework.Console.dll" />
33 <include name="../../bin/libsecondlife.dll" />
34 <include name="../../bin/XMLRPC.dll" />
35 </references>
36 </csc>
37 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
38 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
39 <copy todir="${project::get-base-directory()}/../../bin/">
40 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
41 <include name="*.dll"/>
42 <include name="*.exe"/>
43 </fileset>
44 </copy>
45 </target>
46 <target name="clean">
47 <delete dir="${bin.dir}" failonerror="false" />
48 <delete dir="${obj.dir}" failonerror="false" />
49 </target>
50 <target name="doc" description="Creates documentation.">
51 </target>
52</project>
diff --git a/Common/OpenSim.Servers/UDPServerBase.cs b/Common/OpenSim.Servers/UDPServerBase.cs
new file mode 100644
index 0000000..a308052
--- /dev/null
+++ b/Common/OpenSim.Servers/UDPServerBase.cs
@@ -0,0 +1,68 @@
1using System;
2using System.Text;
3using System.IO;
4using System.Threading;
5using System.Net;
6using System.Net.Sockets;
7using System.Timers;
8using System.Reflection;
9using System.Collections;
10using System.Collections.Generic;
11using libsecondlife;
12using libsecondlife.Packets;
13
14namespace OpenSim.Servers
15{
16 public class UDPServerBase
17 {
18 public Socket Server;
19 protected IPEndPoint ServerIncoming;
20 protected byte[] RecvBuffer = new byte[4096];
21 protected byte[] ZeroBuffer = new byte[8192];
22 protected IPEndPoint ipeSender;
23 protected EndPoint epSender;
24 protected AsyncCallback ReceivedData;
25 protected int listenPort;
26
27 public UDPServerBase(int port)
28 {
29 listenPort = port;
30 }
31
32 protected virtual void OnReceivedData(IAsyncResult result)
33 {
34 ipeSender = new IPEndPoint(IPAddress.Any, 0);
35 epSender = (EndPoint)ipeSender;
36 Packet packet = null;
37 int numBytes = Server.EndReceiveFrom(result, ref epSender);
38 int packetEnd = numBytes - 1;
39
40 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
41
42 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
43 }
44
45 protected virtual void AddNewClient(Packet packet)
46 {
47 }
48
49 public virtual void ServerListener()
50 {
51
52 ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
53 Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
54 Server.Bind(ServerIncoming);
55
56 ipeSender = new IPEndPoint(IPAddress.Any, 0);
57 epSender = (EndPoint)ipeSender;
58 ReceivedData = new AsyncCallback(this.OnReceivedData);
59 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
60 }
61
62 public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
63 {
64
65 }
66 }
67}
68
diff --git a/Common/OpenSim.Servers/XmlRpcMethod.cs b/Common/OpenSim.Servers/XmlRpcMethod.cs
new file mode 100644
index 0000000..2295405
--- /dev/null
+++ b/Common/OpenSim.Servers/XmlRpcMethod.cs
@@ -0,0 +1,7 @@
1using System;
2using Nwc.XmlRpc;
3
4namespace OpenSim.Servers
5{
6 public delegate XmlRpcResponse XmlRpcMethod( XmlRpcRequest request );
7}
diff --git a/Common/XmlRpcCS/Logger.cs b/Common/XmlRpcCS/Logger.cs
new file mode 100644
index 0000000..ebf804b
--- /dev/null
+++ b/Common/XmlRpcCS/Logger.cs
@@ -0,0 +1,46 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4
5 /// <summary>Define levels of logging.</summary><remarks> This duplicates
6 /// similar enumerations in System.Diagnostics.EventLogEntryType. The
7 /// duplication was merited because .NET Compact Framework lacked the EventLogEntryType enum.</remarks>
8 public enum LogLevel
9 {
10 /// <summary>Information level, log entry for informational reasons only.</summary>
11 Information,
12 /// <summary>Warning level, indicates a possible problem.</summary>
13 Warning,
14 /// <summary>Error level, implies a significant problem.</summary>
15 Error
16 }
17
18 ///<summary>
19 ///Logging singleton with swappable output delegate.
20 ///</summary>
21 ///<remarks>
22 ///This singleton provides a centralized log. The actual WriteEntry calls are passed
23 ///off to a delegate however. Having a delegate do the actual logginh allows you to
24 ///implement different logging mechanism and have them take effect throughout the system.
25 ///</remarks>
26 public class Logger
27 {
28 ///<summary>Delegate definition for logging.</summary>
29 ///<param name="message">The message <c>String</c> to log.</param>
30 ///<param name="level">The <c>LogLevel</c> of your message.</param>
31 public delegate void LoggerDelegate(String message, LogLevel level);
32 ///<summary>The LoggerDelegate that will recieve WriteEntry requests.</summary>
33 static public LoggerDelegate Delegate = null;
34
35 ///<summary>
36 ///Method logging events are sent to.
37 ///</summary>
38 ///<param name="message">The message <c>String</c> to log.</param>
39 ///<param name="level">The <c>LogLevel</c> of your message.</param>
40 static public void WriteEntry(String message, LogLevel level)
41 {
42 if (Delegate != null)
43 Delegate(message, level);
44 }
45 }
46}
diff --git a/Common/XmlRpcCS/SimpleHttpRequest.cs b/Common/XmlRpcCS/SimpleHttpRequest.cs
new file mode 100644
index 0000000..e5326c3
--- /dev/null
+++ b/Common/XmlRpcCS/SimpleHttpRequest.cs
@@ -0,0 +1,204 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.IO;
5 using System.Net.Sockets;
6 using System.Collections;
7
8 ///<summary>Very basic HTTP request handler.</summary>
9 ///<remarks>This class is designed to accept a TcpClient and treat it as an HTTP request.
10 /// It will do some basic header parsing and manage the input and output streams associated
11 /// with the request.</remarks>
12 public class SimpleHttpRequest
13 {
14 private String _httpMethod = null;
15 private String _protocol;
16 private String _filePathFile = null;
17 private String _filePathDir = null;
18 private String __filePath;
19 private TcpClient _client;
20 private StreamReader _input;
21 private StreamWriter _output;
22 private Hashtable _headers;
23
24 /// <summary>A constructor which accepts the TcpClient.</summary>
25 /// <remarks>It creates the associated input and output streams, determines the request type,
26 /// and parses the remaining HTTP header.</remarks>
27 /// <param name="client">The <c>TcpClient</c> associated with the HTTP connection.</param>
28 public SimpleHttpRequest(TcpClient client)
29 {
30 _client = client;
31 _output = new StreamWriter(client.GetStream());
32 _input = new StreamReader(client.GetStream());
33 GetRequestMethod();
34 GetRequestHeaders();
35 }
36
37 /// <summary>The output <c>StreamWriter</c> associated with the request.</summary>
38 public StreamWriter Output
39 {
40 get { return _output; }
41 }
42
43 /// <summary>The input <c>StreamReader</c> associated with the request.</summary>
44 public StreamReader Input
45 {
46 get { return _input; }
47 }
48
49 /// <summary>The <c>TcpClient</c> with the request.</summary>
50 public TcpClient Client
51 {
52 get { return _client; }
53 }
54
55 private String _filePath
56 {
57 get { return __filePath; }
58 set
59 {
60 __filePath = value;
61 _filePathDir = null;
62 _filePathFile = null;
63 }
64 }
65
66 /// <summary>The type of HTTP request (i.e. PUT, GET, etc.).</summary>
67 public String HttpMethod
68 {
69 get { return _httpMethod; }
70 }
71
72 /// <summary>The level of the HTTP protocol.</summary>
73 public String Protocol
74 {
75 get { return _protocol; }
76 }
77
78 /// <summary>The "path" which is part of any HTTP request.</summary>
79 public String FilePath
80 {
81 get { return _filePath; }
82 }
83
84 /// <summary>The file portion of the "path" which is part of any HTTP request.</summary>
85 public String FilePathFile
86 {
87 get
88 {
89 if (_filePathFile != null)
90 return _filePathFile;
91
92 int i = FilePath.LastIndexOf("/");
93
94 if (i == -1)
95 return "";
96
97 i++;
98 _filePathFile = FilePath.Substring(i, FilePath.Length - i);
99 return _filePathFile;
100 }
101 }
102
103 /// <summary>The directory portion of the "path" which is part of any HTTP request.</summary>
104 public String FilePathDir
105 {
106 get
107 {
108 if (_filePathDir != null)
109 return _filePathDir;
110
111 int i = FilePath.LastIndexOf("/");
112
113 if (i == -1)
114 return "";
115
116 i++;
117 _filePathDir = FilePath.Substring(0, i);
118 return _filePathDir;
119 }
120 }
121
122 private void GetRequestMethod()
123 {
124 string req = _input.ReadLine();
125 if (req == null)
126 throw new ApplicationException("Void request.");
127
128 if (0 == String.Compare("GET ", req.Substring(0, 4), true))
129 _httpMethod = "GET";
130 else if (0 == String.Compare("POST ", req.Substring(0, 5), true))
131 _httpMethod = "POST";
132 else
133 throw new InvalidOperationException("Unrecognized method in query: " + req);
134
135 req = req.TrimEnd();
136 int idx = req.IndexOf(' ') + 1;
137 if (idx >= req.Length)
138 throw new ApplicationException("What do you want?");
139
140 string page_protocol = req.Substring(idx);
141 int idx2 = page_protocol.IndexOf(' ');
142 if (idx2 == -1)
143 idx2 = page_protocol.Length;
144
145 _filePath = page_protocol.Substring(0, idx2).Trim();
146 _protocol = page_protocol.Substring(idx2).Trim();
147 }
148
149 private void GetRequestHeaders()
150 {
151 String line;
152 int idx;
153
154 _headers = new Hashtable();
155
156 while ((line = _input.ReadLine()) != "")
157 {
158 if (line == null)
159 {
160 break;
161 }
162
163 idx = line.IndexOf(':');
164 if (idx == -1 || idx == line.Length - 1)
165 {
166 Logger.WriteEntry("Malformed header line: " + line, LogLevel.Information);
167 continue;
168 }
169
170 String key = line.Substring(0, idx);
171 String value = line.Substring(idx + 1);
172
173 try
174 {
175 _headers.Add(key, value);
176 }
177 catch (Exception)
178 {
179 Logger.WriteEntry("Duplicate header key in line: " + line, LogLevel.Information);
180 }
181 }
182 }
183
184 /// <summary>
185 /// Format the object contents into a useful string representation.
186 /// </summary>
187 ///<returns><c>String</c> representation of the <c>SimpleHttpRequest</c> as the <i>HttpMethod FilePath Protocol</i>.</returns>
188 override public String ToString()
189 {
190 return HttpMethod + " " + FilePath + " " + Protocol;
191 }
192
193 /// <summary>
194 /// Close the <c>SimpleHttpRequest</c>. This flushes and closes all associated io streams.
195 /// </summary>
196 public void Close()
197 {
198 _output.Flush();
199 _output.Close();
200 _input.Close();
201 _client.Close();
202 }
203 }
204}
diff --git a/Common/XmlRpcCS/XMLRPC.csproj b/Common/XmlRpcCS/XMLRPC.csproj
new file mode 100644
index 0000000..61f8be0
--- /dev/null
+++ b/Common/XmlRpcCS/XMLRPC.csproj
@@ -0,0 +1,138 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{8E81D43C-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>XMLRPC</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>XMLRPC</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 </ItemGroup>
70 <ItemGroup>
71 </ItemGroup>
72 <ItemGroup>
73 <Compile Include="Logger.cs">
74 <SubType>Code</SubType>
75 </Compile>
76 <Compile Include="SimpleHttpRequest.cs">
77 <SubType>Code</SubType>
78 </Compile>
79 <Compile Include="XmlRpcBoxcarRequest.cs">
80 <SubType>Code</SubType>
81 </Compile>
82 <Compile Include="XmlRpcClientProxy.cs">
83 <SubType>Code</SubType>
84 </Compile>
85 <Compile Include="XmlRpcDeserializer.cs">
86 <SubType>Code</SubType>
87 </Compile>
88 <Compile Include="XmlRpcErrorCodes.cs">
89 <SubType>Code</SubType>
90 </Compile>
91 <Compile Include="XmlRpcException.cs">
92 <SubType>Code</SubType>
93 </Compile>
94 <Compile Include="XmlRpcExposedAttribute.cs">
95 <SubType>Code</SubType>
96 </Compile>
97 <Compile Include="XmlRpcRequest.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="XmlRpcRequestDeserializer.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 <Compile Include="XmlRpcRequestSerializer.cs">
104 <SubType>Code</SubType>
105 </Compile>
106 <Compile Include="XmlRpcResponder.cs">
107 <SubType>Code</SubType>
108 </Compile>
109 <Compile Include="XmlRpcResponse.cs">
110 <SubType>Code</SubType>
111 </Compile>
112 <Compile Include="XmlRpcResponseDeserializer.cs">
113 <SubType>Code</SubType>
114 </Compile>
115 <Compile Include="XmlRpcResponseSerializer.cs">
116 <SubType>Code</SubType>
117 </Compile>
118 <Compile Include="XmlRpcSerializer.cs">
119 <SubType>Code</SubType>
120 </Compile>
121 <Compile Include="XmlRpcServer.cs">
122 <SubType>Code</SubType>
123 </Compile>
124 <Compile Include="XmlRpcSystemObject.cs">
125 <SubType>Code</SubType>
126 </Compile>
127 <Compile Include="XmlRpcXmlTokens.cs">
128 <SubType>Code</SubType>
129 </Compile>
130 </ItemGroup>
131 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
132 <PropertyGroup>
133 <PreBuildEvent>
134 </PreBuildEvent>
135 <PostBuildEvent>
136 </PostBuildEvent>
137 </PropertyGroup>
138</Project>
diff --git a/Common/XmlRpcCS/XMLRPC.csproj.user b/Common/XmlRpcCS/XMLRPC.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/Common/XmlRpcCS/XMLRPC.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/Common/XmlRpcCS/XMLRPC.dll.build b/Common/XmlRpcCS/XMLRPC.dll.build
new file mode 100644
index 0000000..2eabfcd
--- /dev/null
+++ b/Common/XmlRpcCS/XMLRPC.dll.build
@@ -0,0 +1,58 @@
1<?xml version="1.0" ?>
2<project name="XMLRPC" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="XMLRPC" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="Logger.cs" />
15 <include name="SimpleHttpRequest.cs" />
16 <include name="XmlRpcBoxcarRequest.cs" />
17 <include name="XmlRpcClientProxy.cs" />
18 <include name="XmlRpcDeserializer.cs" />
19 <include name="XmlRpcErrorCodes.cs" />
20 <include name="XmlRpcException.cs" />
21 <include name="XmlRpcExposedAttribute.cs" />
22 <include name="XmlRpcRequest.cs" />
23 <include name="XmlRpcRequestDeserializer.cs" />
24 <include name="XmlRpcRequestSerializer.cs" />
25 <include name="XmlRpcResponder.cs" />
26 <include name="XmlRpcResponse.cs" />
27 <include name="XmlRpcResponseDeserializer.cs" />
28 <include name="XmlRpcResponseSerializer.cs" />
29 <include name="XmlRpcSerializer.cs" />
30 <include name="XmlRpcServer.cs" />
31 <include name="XmlRpcSystemObject.cs" />
32 <include name="XmlRpcXmlTokens.cs" />
33 </sources>
34 <references basedir="${project::get-base-directory()}">
35 <lib>
36 <include name="${project::get-base-directory()}" />
37 <include name="${project::get-base-directory()}/${build.dir}" />
38 </lib>
39 <include name="System.dll" />
40 <include name="System.Xml.dll" />
41 </references>
42 </csc>
43 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
44 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
45 <copy todir="${project::get-base-directory()}/../../bin/">
46 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
47 <include name="*.dll"/>
48 <include name="*.exe"/>
49 </fileset>
50 </copy>
51 </target>
52 <target name="clean">
53 <delete dir="${bin.dir}" failonerror="false" />
54 <delete dir="${obj.dir}" failonerror="false" />
55 </target>
56 <target name="doc" description="Creates documentation.">
57 </target>
58</project>
diff --git a/Common/XmlRpcCS/XmlRpcBoxcarRequest.cs b/Common/XmlRpcCS/XmlRpcBoxcarRequest.cs
new file mode 100644
index 0000000..f87f7a5
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcBoxcarRequest.cs
@@ -0,0 +1,51 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7 using System.Net;
8 using System.Text;
9 using System.Reflection;
10
11 /// <summary>Class that collects individual <c>XmlRpcRequest</c> objects and submits them as a <i>boxcarred</i> request.</summary>
12 /// <remarks>A boxcared request is when a number of request are collected before being sent via XML-RPC, and then are sent via
13 /// a single HTTP connection. This results in a speed up from reduced connection time. The results are then retuned collectively
14 /// as well.
15 ///</remarks>
16 /// <seealso cref="XmlRpcRequest"/>
17 public class XmlRpcBoxcarRequest : XmlRpcRequest
18 {
19 /// <summary>ArrayList to collect the requests to boxcar.</summary>
20 public IList Requests = new ArrayList();
21
22 /// <summary>Basic constructor.</summary>
23 public XmlRpcBoxcarRequest()
24 {
25 }
26
27 /// <summary>Returns the <c>String</c> "system.multiCall" which is the server method that handles boxcars.</summary>
28 public override String MethodName
29 {
30 get { return "system.multiCall"; }
31 }
32
33 /// <summary>The <c>ArrayList</c> of boxcarred <paramref>Requests</paramref> as properly formed parameters.</summary>
34 public override IList Params
35 {
36 get {
37 _params.Clear();
38 ArrayList reqArray = new ArrayList();
39 foreach (XmlRpcRequest request in Requests)
40 {
41 Hashtable requestEntry = new Hashtable();
42 requestEntry.Add(XmlRpcXmlTokens.METHOD_NAME, request.MethodName);
43 requestEntry.Add(XmlRpcXmlTokens.PARAMS, request.Params);
44 reqArray.Add(requestEntry);
45 }
46 _params.Add(reqArray);
47 return _params;
48 }
49 }
50 }
51}
diff --git a/Common/XmlRpcCS/XmlRpcClientProxy.cs b/Common/XmlRpcCS/XmlRpcClientProxy.cs
new file mode 100644
index 0000000..f52273a
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcClientProxy.cs
@@ -0,0 +1,61 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Runtime.Remoting.Proxies;
5 using System.Runtime.Remoting.Messaging;
6
7 /// <summary>This class provides support for creating local proxies of XML-RPC remote objects</summary>
8 /// <remarks>
9 /// To create a local proxy you need to create a local C# interface and then, via <i>createProxy</i>
10 /// associate that interface with a remote object at a given URL.
11 /// </remarks>
12public class XmlRpcClientProxy : RealProxy
13{
14 private String _remoteObjectName;
15 private String _url;
16 private XmlRpcRequest _client = new XmlRpcRequest();
17
18 /// <summary>Factory method to create proxies.</summary>
19 /// <remarks>
20 /// To create a local proxy you need to create a local C# interface with methods that mirror those of the server object.
21 /// Next, pass that interface into <c>createProxy</c> along with the object name and URL of the remote object and
22 /// cast the resulting object to the specifice interface.
23 /// </remarks>
24 /// <param name="remoteObjectName"><c>String</c> The name of the remote object.</param>
25 /// <param name="url"><c>String</c> The URL of the remote object.</param>
26 /// <param name="anInterface"><c>Type</c> The typeof() of a C# interface.</param>
27 /// <returns><c>Object</c> A proxy for your specified interface. Cast to appropriate type.</returns>
28 public static Object createProxy(String remoteObjectName, String url, Type anInterface)
29 {
30 return new XmlRpcClientProxy(remoteObjectName, url, anInterface).GetTransparentProxy();
31 }
32
33 private XmlRpcClientProxy(String remoteObjectName, String url, Type t) : base(t)
34 {
35 _remoteObjectName = remoteObjectName;
36 _url = url;
37 }
38
39 /// <summary>The local method dispatcher - do not invoke.</summary>
40 override public IMessage Invoke(IMessage msg)
41 {
42 IMethodCallMessage methodMessage = (IMethodCallMessage)msg;
43
44 _client.MethodName = _remoteObjectName + "." + methodMessage.MethodName;
45 _client.Params.Clear();
46 foreach (Object o in methodMessage.Args)
47 _client.Params.Add(o);
48
49 try
50 {
51 Object ret = _client.Invoke(_url);
52 return new ReturnMessage(ret,null,0,
53 methodMessage.LogicalCallContext, methodMessage);
54 }
55 catch (Exception e)
56 {
57 return new ReturnMessage(e, methodMessage);
58 }
59 }
60}
61}
diff --git a/Common/XmlRpcCS/XmlRpcDeserializer.cs b/Common/XmlRpcCS/XmlRpcDeserializer.cs
new file mode 100644
index 0000000..bd736c0
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcDeserializer.cs
@@ -0,0 +1,195 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7 using System.Globalization;
8
9 /// <summary>Parser context, we maintain contexts in a stack to avoiding recursion. </summary>
10 struct Context
11 {
12 public String Name;
13 public Object Container;
14 }
15
16 /// <summary>Basic XML-RPC data deserializer.</summary>
17 /// <remarks>Uses <c>XmlTextReader</c> to parse the XML data. This level of the class
18 /// only handles the tokens common to both Requests and Responses. This class is not useful in and of itself
19 /// but is designed to be subclassed.</remarks>
20 public class XmlRpcDeserializer : XmlRpcXmlTokens
21 {
22 private static DateTimeFormatInfo _dateFormat = new DateTimeFormatInfo();
23
24 private Object _container;
25 private Stack _containerStack;
26
27 /// <summary>Protected reference to last text.</summary>
28 protected String _text;
29 /// <summary>Protected reference to last deserialized value.</summary>
30 protected Object _value;
31 /// <summary>Protected reference to last name field.</summary>
32 protected String _name;
33
34
35 /// <summary>Basic constructor.</summary>
36 public XmlRpcDeserializer()
37 {
38 Reset();
39 _dateFormat.FullDateTimePattern = ISO_DATETIME;
40 }
41
42 /// <summary>Static method that parses XML data into a response using the Singleton.</summary>
43 /// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC response.</param>
44 /// <returns><c>Object</c> object resulting from the deserialization.</returns>
45 virtual public Object Deserialize(TextReader xmlData)
46 {
47 return null;
48 }
49
50 /// <summary>Protected method to parse a node in an XML-RPC XML stream.</summary>
51 /// <remarks>Method deals with elements common to all XML-RPC data, subclasses of
52 /// this object deal with request/response spefic elements.</remarks>
53 /// <param name="reader"><c>XmlTextReader</c> of the in progress parsing data stream.</param>
54 protected void DeserializeNode(XmlTextReader reader)
55 {
56 switch (reader.NodeType)
57 {
58 case XmlNodeType.Element:
59 if (Logger.Delegate != null)
60 Logger.WriteEntry("START " + reader.Name, LogLevel.Information);
61 switch (reader.Name)
62 {
63 case VALUE:
64 _value = null;
65 _text = null;
66 break;
67 case STRUCT:
68 PushContext();
69 _container = new Hashtable();
70 break;
71 case ARRAY:
72 PushContext();
73 _container = new ArrayList();
74 break;
75 }
76 break;
77 case XmlNodeType.EndElement:
78 if (Logger.Delegate != null)
79 Logger.WriteEntry("END " + reader.Name, LogLevel.Information);
80 switch (reader.Name)
81 {
82 case BASE64:
83 _value = Convert.FromBase64String(_text);
84 break;
85 case BOOLEAN:
86 int val = Int16.Parse(_text);
87 if (val == 0)
88 _value = false;
89 else if (val == 1)
90 _value = true;
91 break;
92 case STRING:
93 _value = _text;
94 break;
95 case DOUBLE:
96 _value = Double.Parse(_text);
97 break;
98 case INT:
99 case ALT_INT:
100 _value = Int32.Parse(_text);
101 break;
102 case DATETIME:
103#if __MONO__
104 _value = DateParse(_text);
105#else
106 _value = DateTime.ParseExact(_text, "F", _dateFormat);
107#endif
108 break;
109 case NAME:
110 _name = _text;
111 break;
112 case VALUE:
113 if (_value == null)
114 _value = _text; // some kits don't use <string> tag, they just do <value>
115
116 if ((_container != null) && (_container is IList)) // in an array? If so add value to it.
117 ((IList)_container).Add(_value);
118 break;
119 case MEMBER:
120 if ((_container != null) && (_container is IDictionary)) // in an struct? If so add value to it.
121 ((IDictionary)_container).Add(_name, _value);
122 break;
123 case ARRAY:
124 case STRUCT:
125 _value = _container;
126 PopContext();
127 break;
128 }
129 break;
130 case XmlNodeType.Text:
131 if (Logger.Delegate != null)
132 Logger.WriteEntry("Text " + reader.Value, LogLevel.Information);
133 _text = reader.Value;
134 break;
135 default:
136 break;
137 }
138 }
139
140 /// <summary>Static method that parses XML in a <c>String</c> into a
141 /// request using the Singleton.</summary>
142 /// <param name="xmlData"><c>String</c> containing an XML-RPC request.</param>
143 /// <returns><c>XmlRpcRequest</c> object resulting from the parse.</returns>
144 public Object Deserialize(String xmlData)
145 {
146 StringReader sr = new StringReader(xmlData);
147 return Deserialize(sr);
148 }
149
150 /// <summary>Pop a Context of the stack, an Array or Struct has closed.</summary>
151 private void PopContext()
152 {
153 Context c = (Context)_containerStack.Pop();
154 _container = c.Container;
155 _name = c.Name;
156 }
157
158 /// <summary>Push a Context on the stack, an Array or Struct has opened.</summary>
159 private void PushContext()
160 {
161 Context context;
162
163 context.Container = _container;
164 context.Name = _name;
165
166 _containerStack.Push(context);
167 }
168
169 /// <summary>Reset the internal state of the deserializer.</summary>
170 protected void Reset()
171 {
172 _text = null;
173 _value = null;
174 _name = null;
175 _container = null;
176 _containerStack = new Stack();
177 }
178
179#if __MONO__
180 private DateTime DateParse(String str)
181 {
182 int year = Int32.Parse(str.Substring(0,4));
183 int month = Int32.Parse(str.Substring(4,2));
184 int day = Int32.Parse(str.Substring(6,2));
185 int hour = Int32.Parse(str.Substring(9,2));
186 int min = Int32.Parse(str.Substring(12,2));
187 int sec = Int32.Parse(str.Substring(15,2));
188 return new DateTime(year,month,day,hour,min,sec);
189 }
190#endif
191
192 }
193}
194
195
diff --git a/Common/XmlRpcCS/XmlRpcErrorCodes.cs b/Common/XmlRpcCS/XmlRpcErrorCodes.cs
new file mode 100644
index 0000000..6dec57d
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcErrorCodes.cs
@@ -0,0 +1,51 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4
5 /// <summary>Standard XML-RPC error codes.</summary>
6 public class XmlRpcErrorCodes
7 {
8 /// <summary></summary>
9 public const int PARSE_ERROR_MALFORMED = -32700;
10 /// <summary></summary>
11 public const String PARSE_ERROR_MALFORMED_MSG = "Parse Error, not well formed";
12
13 /// <summary></summary>
14 public const int PARSE_ERROR_ENCODING = -32701;
15 /// <summary></summary>
16 public const String PARSE_ERROR_ENCODING_MSG = "Parse Error, unsupported encoding";
17
18 //
19 // -32702 ---> parse error. invalid character for encoding
20 // -32600 ---> server error. invalid xml-rpc. not conforming to spec.
21 //
22
23 /// <summary></summary>
24 public const int SERVER_ERROR_METHOD = -32601;
25 /// <summary></summary>
26 public const String SERVER_ERROR_METHOD_MSG = "Server Error, requested method not found";
27
28 /// <summary></summary>
29 public const int SERVER_ERROR_PARAMS = -32602;
30 /// <summary></summary>
31 public const String SERVER_ERROR_PARAMS_MSG = "Server Error, invalid method parameters";
32
33 //
34 // -32603 ---> server error. internal xml-rpc error
35 //
36
37 /// <summary></summary>
38 public const int APPLICATION_ERROR = -32500;
39 /// <summary></summary>
40 public const String APPLICATION_ERROR_MSG = "Application Error";
41
42 //
43 // -32400 ---> system error
44 //
45
46 /// <summary></summary>
47 public const int TRANSPORT_ERROR = -32300;
48 /// <summary></summary>
49 public const String TRANSPORT_ERROR_MSG = "Transport Layer Error";
50 }
51}
diff --git a/Common/XmlRpcCS/XmlRpcException.cs b/Common/XmlRpcCS/XmlRpcException.cs
new file mode 100644
index 0000000..fd1f4ae
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcException.cs
@@ -0,0 +1,39 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4
5 /// <summary>An XML-RPC Exception.</summary>
6 /// <remarks>Maps a C# exception to an XML-RPC fault. Normal exceptions
7 /// include a message so this adds the code needed by XML-RPC.</remarks>
8 public class XmlRpcException : Exception
9 {
10 private int _code;
11
12 /// <summary>Instantiate an <c>XmlRpcException</c> with a code and message.</summary>
13 /// <param name="code"><c>Int</c> faultCode associated with this exception.</param>
14 /// <param name="message"><c>String</c> faultMessage associated with this exception.</param>
15 public XmlRpcException(int code, String message)
16 : base(message)
17 {
18 _code = code;
19 }
20
21 /// <summary>The value of the faults message, i.e. the faultString.</summary>
22 public String FaultString
23 {
24 get { return Message; }
25 }
26
27 /// <summary>The value of the faults code, i.e. the faultCode.</summary>
28 public int FaultCode
29 {
30 get { return _code; }
31 }
32
33 /// <summary>Format the message to include the code.</summary>
34 override public String ToString()
35 {
36 return "Code: " + FaultCode + " Message: " + base.ToString();
37 }
38 }
39}
diff --git a/Common/XmlRpcCS/XmlRpcExposedAttribute.cs b/Common/XmlRpcCS/XmlRpcExposedAttribute.cs
new file mode 100644
index 0000000..67b27ae
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcExposedAttribute.cs
@@ -0,0 +1,60 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Reflection;
5
6 /// <summary>
7 /// Simple tagging attribute to indicate participation is XML-RPC exposure.
8 /// </summary>
9 /// <remarks>
10 /// If present at the class level it indicates that this class does explicitly
11 /// expose methods. If present at the method level it denotes that the method
12 /// is exposed.
13 /// </remarks>
14 [AttributeUsage(
15 AttributeTargets.Class | AttributeTargets.Method,
16 AllowMultiple = false,
17 Inherited = true
18 )]
19 public class XmlRpcExposedAttribute : Attribute
20 {
21 /// <summary>Check if <paramref>obj</paramref> is an object utilizing the XML-RPC exposed Attribute.</summary>
22 /// <param name="obj"><c>Object</c> of a class or method to check for attribute.</param>
23 /// <returns><c>Boolean</c> true if attribute present.</returns>
24 public static Boolean ExposedObject(Object obj)
25 {
26 return IsExposed(obj.GetType());
27 }
28
29 /// <summary>Check if <paramref>obj</paramref>.<paramref>methodName</paramref> is an XML-RPC exposed method.</summary>
30 /// <remarks>A method is considered to be exposed if it exists and, either, the object does not use the XmlRpcExposed attribute,
31 /// or the object does use the XmlRpcExposed attribute and the method has the XmlRpcExposed attribute as well.</remarks>
32 /// <returns><c>Boolean</c> true if the method is exposed.</returns>
33 public static Boolean ExposedMethod(Object obj, String methodName)
34 {
35 Type type = obj.GetType();
36 MethodInfo method = type.GetMethod(methodName);
37
38 if (method == null)
39 throw new MissingMethodException("Method " + methodName + " not found.");
40
41 if (!IsExposed(type))
42 return true;
43
44 return IsExposed(method);
45 }
46
47 /// <summary>Check if <paramref>mi</paramref> is XML-RPC exposed.</summary>
48 /// <param name="mi"><c>MemberInfo</c> of a class or method to check for attribute.</param>
49 /// <returns><c>Boolean</c> true if attribute present.</returns>
50 public static Boolean IsExposed(MemberInfo mi)
51 {
52 foreach (Attribute attr in mi.GetCustomAttributes(true))
53 {
54 if (attr is XmlRpcExposedAttribute)
55 return true;
56 }
57 return false;
58 }
59 }
60}
diff --git a/Common/XmlRpcCS/XmlRpcRequest.cs b/Common/XmlRpcCS/XmlRpcRequest.cs
new file mode 100644
index 0000000..18d2182
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcRequest.cs
@@ -0,0 +1,150 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7 using System.Net;
8 using System.Text;
9 using System.Reflection;
10 using System.Net.Security;
11 using System.Security.Cryptography.X509Certificates;
12
13 internal class AcceptAllCertificatePolicy : ICertificatePolicy
14 {
15 public AcceptAllCertificatePolicy()
16 {
17 }
18
19 public bool CheckValidationResult(ServicePoint sPoint,
20 System.Security.Cryptography.X509Certificates.X509Certificate cert,
21 WebRequest wRequest, int certProb)
22 {
23 // Always accept
24 return true;
25 }
26 }
27
28 /// <summary>Class supporting the request side of an XML-RPC transaction.</summary>
29 public class XmlRpcRequest
30 {
31 private String _methodName = null;
32 private Encoding _encoding = new ASCIIEncoding();
33 private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer();
34 private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer();
35
36 /// <summary><c>ArrayList</c> containing the parameters.</summary>
37 protected IList _params = null;
38
39 /// <summary>Instantiate an <c>XmlRpcRequest</c></summary>
40 public XmlRpcRequest()
41 {
42 _params = new ArrayList();
43 }
44
45 /// <summary>Instantiate an <c>XmlRpcRequest</c> for a specified method and parameters.</summary>
46 /// <param name="methodName"><c>String</c> designating the <i>object.method</i> on the server the request
47 /// should be directed to.</param>
48 /// <param name="parameters"><c>ArrayList</c> of XML-RPC type parameters to invoke the request with.</param>
49 public XmlRpcRequest(String methodName, IList parameters)
50 {
51 MethodName = methodName;
52 _params = parameters;
53 }
54
55 /// <summary><c>ArrayList</c> conntaining the parameters for the request.</summary>
56 public virtual IList Params
57 {
58 get { return _params; }
59 }
60
61 /// <summary><c>String</c> conntaining the method name, both object and method, that the request will be sent to.</summary>
62 public virtual String MethodName
63 {
64 get { return _methodName; }
65 set { _methodName = value; }
66 }
67
68 /// <summary><c>String</c> object name portion of the method name.</summary>
69 public String MethodNameObject
70 {
71 get
72 {
73 int index = MethodName.IndexOf(".");
74
75 if (index == -1)
76 return MethodName;
77
78 return MethodName.Substring(0, index);
79 }
80 }
81
82 /// <summary><c>String</c> method name portion of the object.method name.</summary>
83 public String MethodNameMethod
84 {
85 get
86 {
87 int index = MethodName.IndexOf(".");
88
89 if (index == -1)
90 return MethodName;
91
92 return MethodName.Substring(index + 1, MethodName.Length - index - 1);
93 }
94 }
95
96 /// <summary>Invoke this request on the server.</summary>
97 /// <param name="url"><c>String</c> The url of the XML-RPC server.</param>
98 /// <returns><c>Object</c> The value returned from the method invocation on the server.</returns>
99 /// <exception cref="XmlRpcException">If an exception generated on the server side.</exception>
100 public Object Invoke(String url)
101 {
102 XmlRpcResponse res = Send(url, 10000);
103
104 if (res.IsFault)
105 throw new XmlRpcException(res.FaultCode, res.FaultString);
106
107 return res.Value;
108 }
109
110 /// <summary>Send the request to the server.</summary>
111 /// <param name="url"><c>String</c> The url of the XML-RPC server.</param>
112 /// <param name="timeout">Milliseconds before the connection times out.</param>
113 /// <returns><c>XmlRpcResponse</c> The response generated.</returns>
114 public XmlRpcResponse Send(String url, int timeout)
115 {
116 // Override SSL authentication mechanisms
117 ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
118
119 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
120 if (request == null)
121 throw new XmlRpcException(XmlRpcErrorCodes.TRANSPORT_ERROR,
122 XmlRpcErrorCodes.TRANSPORT_ERROR_MSG + ": Could not create request with " + url);
123 request.Method = "POST";
124 request.ContentType = "text/xml";
125 request.AllowWriteStreamBuffering = true;
126 request.Timeout = timeout;
127
128 Stream stream = request.GetRequestStream();
129 XmlTextWriter xml = new XmlTextWriter(stream, _encoding);
130 _serializer.Serialize(xml, this);
131 xml.Flush();
132 xml.Close();
133
134 HttpWebResponse response = (HttpWebResponse)request.GetResponse();
135 StreamReader input = new StreamReader(response.GetResponseStream());
136
137 XmlRpcResponse resp = (XmlRpcResponse)_deserializer.Deserialize(input);
138 input.Close();
139 response.Close();
140 return resp;
141 }
142
143 /// <summary>Produce <c>String</c> representation of the object.</summary>
144 /// <returns><c>String</c> representation of the object.</returns>
145 override public String ToString()
146 {
147 return _serializer.Serialize(this);
148 }
149 }
150}
diff --git a/Common/XmlRpcCS/XmlRpcRequestDeserializer.cs b/Common/XmlRpcCS/XmlRpcRequestDeserializer.cs
new file mode 100644
index 0000000..0770b7e
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcRequestDeserializer.cs
@@ -0,0 +1,64 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.Diagnostics;
6 using System.IO;
7 using System.Xml;
8
9 /// <summary>Class to deserialize XML data representing a request.</summary>
10 public class XmlRpcRequestDeserializer : XmlRpcDeserializer
11 {
12 static private XmlRpcRequestDeserializer _singleton;
13 /// <summary>A static singleton instance of this deserializer.</summary>
14 [Obsolete("This object is now thread safe, just use an instance.", false)]
15 static public XmlRpcRequestDeserializer Singleton
16 {
17 get
18 {
19 if (_singleton == null)
20 _singleton = new XmlRpcRequestDeserializer();
21
22 return _singleton;
23 }
24 }
25
26 /// <summary>Static method that parses XML data into a request using the Singleton.</summary>
27 /// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC request.</param>
28 /// <returns><c>XmlRpcRequest</c> object resulting from the parse.</returns>
29 override public Object Deserialize(TextReader xmlData)
30 {
31 XmlTextReader reader = new XmlTextReader(xmlData);
32 XmlRpcRequest request = new XmlRpcRequest();
33 bool done = false;
34
35 lock (this)
36 {
37 Reset();
38 while (!done && reader.Read())
39 {
40 DeserializeNode(reader); // Parent parse...
41 switch (reader.NodeType)
42 {
43 case XmlNodeType.EndElement:
44 switch (reader.Name)
45 {
46 case METHOD_NAME:
47 request.MethodName = _text;
48 break;
49 case METHOD_CALL:
50 done = true;
51 break;
52 case PARAM:
53 request.Params.Add(_value);
54 _text = null;
55 break;
56 }
57 break;
58 }
59 }
60 }
61 return request;
62 }
63 }
64}
diff --git a/Common/XmlRpcCS/XmlRpcRequestSerializer.cs b/Common/XmlRpcCS/XmlRpcRequestSerializer.cs
new file mode 100644
index 0000000..8099bdb
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcRequestSerializer.cs
@@ -0,0 +1,51 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.Xml;
6 using System.IO;
7
8 /// <summary>Class responsible for serializing an XML-RPC request.</summary>
9 /// <remarks>This class handles the request envelope, depending on <c>XmlRpcSerializer</c>
10 /// to serialize the payload.</remarks>
11 /// <seealso cref="XmlRpcSerializer"/>
12 public class XmlRpcRequestSerializer : XmlRpcSerializer
13 {
14 static private XmlRpcRequestSerializer _singleton;
15 /// <summary>A static singleton instance of this deserializer.</summary>
16 static public XmlRpcRequestSerializer Singleton
17 {
18 get
19 {
20 if (_singleton == null)
21 _singleton = new XmlRpcRequestSerializer();
22
23 return _singleton;
24 }
25 }
26
27 /// <summary>Serialize the <c>XmlRpcRequest</c> to the output stream.</summary>
28 /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
29 /// <param name="obj">An <c>XmlRpcRequest</c> to serialize.</param>
30 /// <seealso cref="XmlRpcRequest"/>
31 override public void Serialize(XmlTextWriter output, Object obj)
32 {
33 XmlRpcRequest request = (XmlRpcRequest)obj;
34 output.WriteStartDocument();
35 output.WriteStartElement(METHOD_CALL);
36 output.WriteElementString(METHOD_NAME, request.MethodName);
37 output.WriteStartElement(PARAMS);
38 foreach (Object param in request.Params)
39 {
40 output.WriteStartElement(PARAM);
41 output.WriteStartElement(VALUE);
42 SerializeObject(output, param);
43 output.WriteEndElement();
44 output.WriteEndElement();
45 }
46
47 output.WriteEndElement();
48 output.WriteEndElement();
49 }
50 }
51}
diff --git a/Common/XmlRpcCS/XmlRpcResponder.cs b/Common/XmlRpcCS/XmlRpcResponder.cs
new file mode 100644
index 0000000..0412568
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcResponder.cs
@@ -0,0 +1,98 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Xml;
5 using System.Net.Sockets;
6
7 /// <summary>The class is a container of the context of an XML-RPC dialog on the server side.</summary>
8 /// <remarks>Instances of this class maintain the context for an individual XML-RPC server
9 /// side dialog. Namely they manage an inbound deserializer and an outbound serializer. </remarks>
10 public class XmlRpcResponder
11 {
12 private XmlRpcRequestDeserializer _deserializer = new XmlRpcRequestDeserializer();
13 private XmlRpcResponseSerializer _serializer = new XmlRpcResponseSerializer();
14 private XmlRpcServer _server;
15 private TcpClient _client;
16 private SimpleHttpRequest _httpReq;
17
18 /// <summary>The SimpleHttpRequest based on the TcpClient.</summary>
19 public SimpleHttpRequest HttpReq
20 {
21 get { return _httpReq; }
22 }
23
24 /// <summary>Basic constructor.</summary>
25 /// <param name="server">XmlRpcServer that this XmlRpcResponder services.</param>
26 /// <param name="client">TcpClient with the connection.</param>
27 public XmlRpcResponder(XmlRpcServer server, TcpClient client)
28 {
29 _server = server;
30 _client = client;
31 _httpReq = new SimpleHttpRequest(_client);
32 }
33
34 /// <summary>Call close to insure proper shutdown.</summary>
35 ~XmlRpcResponder()
36 {
37 Close();
38 }
39
40 ///<summary>Respond using this responders HttpReq.</summary>
41 public void Respond()
42 {
43 Respond(HttpReq);
44 }
45
46 /// <summary>Handle an HTTP request containing an XML-RPC request.</summary>
47 /// <remarks>This method deserializes the XML-RPC request, invokes the
48 /// described method, serializes the response (or fault) and sends the XML-RPC response
49 /// back as a valid HTTP page.
50 /// </remarks>
51 /// <param name="httpReq"><c>SimpleHttpRequest</c> containing the request.</param>
52 public void Respond(SimpleHttpRequest httpReq)
53 {
54 XmlRpcRequest xmlRpcReq = (XmlRpcRequest)_deserializer.Deserialize(httpReq.Input);
55 XmlRpcResponse xmlRpcResp = new XmlRpcResponse();
56
57 try
58 {
59 xmlRpcResp.Value = _server.Invoke(xmlRpcReq);
60 }
61 catch (XmlRpcException e)
62 {
63 xmlRpcResp.SetFault(e.FaultCode, e.FaultString);
64 }
65 catch (Exception e2)
66 {
67 xmlRpcResp.SetFault(XmlRpcErrorCodes.APPLICATION_ERROR,
68 XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": " + e2.Message);
69 }
70
71 if (Logger.Delegate != null)
72 Logger.WriteEntry(xmlRpcResp.ToString(), LogLevel.Information);
73
74 XmlRpcServer.HttpHeader(httpReq.Protocol, "text/xml", 0, " 200 OK", httpReq.Output);
75 httpReq.Output.Flush();
76 XmlTextWriter xml = new XmlTextWriter(httpReq.Output);
77 _serializer.Serialize(xml, xmlRpcResp);
78 xml.Flush();
79 httpReq.Output.Flush();
80 }
81
82 ///<summary>Close all contained resources, both the HttpReq and client.</summary>
83 public void Close()
84 {
85 if (_httpReq != null)
86 {
87 _httpReq.Close();
88 _httpReq = null;
89 }
90
91 if (_client != null)
92 {
93 _client.Close();
94 _client = null;
95 }
96 }
97 }
98}
diff --git a/Common/XmlRpcCS/XmlRpcResponse.cs b/Common/XmlRpcCS/XmlRpcResponse.cs
new file mode 100644
index 0000000..8ff8354
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcResponse.cs
@@ -0,0 +1,85 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7
8 /// <summary>Class designed to represent an XML-RPC response.</summary>
9 public class XmlRpcResponse
10 {
11 private Object _value;
12 /// <summary><c>bool</c> indicating if this response represents a fault.</summary>
13 public bool IsFault;
14
15 /// <summary>Basic constructor</summary>
16 public XmlRpcResponse()
17 {
18 Value = null;
19 IsFault = false;
20 }
21
22 /// <summary>Constructor for a fault.</summary>
23 /// <param name="code"><c>int</c> the numeric faultCode value.</param>
24 /// <param name="message"><c>String</c> the faultString value.</param>
25 public XmlRpcResponse(int code, String message)
26 : this()
27 {
28 SetFault(code, message);
29 }
30
31 /// <summary>The data value of the response, may be fault data.</summary>
32 public Object Value
33 {
34 get { return _value; }
35 set
36 {
37 IsFault = false;
38 _value = value;
39 }
40 }
41
42 /// <summary>The faultCode if this is a fault.</summary>
43 public int FaultCode
44 {
45 get
46 {
47 if (!IsFault)
48 return 0;
49 else
50 return (int)((Hashtable)_value)[XmlRpcXmlTokens.FAULT_CODE];
51 }
52 }
53
54 /// <summary>The faultString if this is a fault.</summary>
55 public String FaultString
56 {
57 get
58 {
59 if (!IsFault)
60 return "";
61 else
62 return (String)((Hashtable)_value)[XmlRpcXmlTokens.FAULT_STRING];
63 }
64 }
65
66 /// <summary>Set this response to be a fault.</summary>
67 /// <param name="code"><c>int</c> the numeric faultCode value.</param>
68 /// <param name="message"><c>String</c> the faultString value.</param>
69 public void SetFault(int code, String message)
70 {
71 Hashtable fault = new Hashtable();
72 fault.Add("faultCode", code);
73 fault.Add("faultString", message);
74 Value = fault;
75 IsFault = true;
76 }
77
78 /// <summary>Form a useful string representation of the object, in this case the XML response.</summary>
79 /// <returns><c>String</c> The XML serialized XML-RPC response.</returns>
80 override public String ToString()
81 {
82 return XmlRpcResponseSerializer.Singleton.Serialize(this);
83 }
84 }
85}
diff --git a/Common/XmlRpcCS/XmlRpcResponseDeserializer.cs b/Common/XmlRpcCS/XmlRpcResponseDeserializer.cs
new file mode 100644
index 0000000..032d8a3
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcResponseDeserializer.cs
@@ -0,0 +1,65 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7
8 /// <summary>Class to deserialize XML data representing a response.</summary>
9 public class XmlRpcResponseDeserializer : XmlRpcDeserializer
10 {
11 static private XmlRpcResponseDeserializer _singleton;
12 /// <summary>A static singleton instance of this deserializer.</summary>
13 [Obsolete("This object is now thread safe, just use an instance.", false)]
14 static public XmlRpcResponseDeserializer Singleton
15 {
16 get
17 {
18 if (_singleton == null)
19 _singleton = new XmlRpcResponseDeserializer();
20
21 return _singleton;
22 }
23 }
24
25 /// <summary>Static method that parses XML data into a response using the Singleton.</summary>
26 /// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC response.</param>
27 /// <returns><c>XmlRpcResponse</c> object resulting from the parse.</returns>
28 override public Object Deserialize(TextReader xmlData)
29 {
30 XmlTextReader reader = new XmlTextReader(xmlData);
31 XmlRpcResponse response = new XmlRpcResponse();
32 bool done = false;
33
34 lock (this)
35 {
36 Reset();
37
38 while (!done && reader.Read())
39 {
40 DeserializeNode(reader); // Parent parse...
41 switch (reader.NodeType)
42 {
43 case XmlNodeType.EndElement:
44 switch (reader.Name)
45 {
46 case FAULT:
47 response.Value = _value;
48 response.IsFault = true;
49 break;
50 case PARAM:
51 response.Value = _value;
52 _value = null;
53 _text = null;
54 break;
55 }
56 break;
57 default:
58 break;
59 }
60 }
61 }
62 return response;
63 }
64 }
65}
diff --git a/Common/XmlRpcCS/XmlRpcResponseSerializer.cs b/Common/XmlRpcCS/XmlRpcResponseSerializer.cs
new file mode 100644
index 0000000..72ca568
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcResponseSerializer.cs
@@ -0,0 +1,57 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.Xml;
6
7 /// <summary>Class responsible for serializing an XML-RPC response.</summary>
8 /// <remarks>This class handles the response envelope, depending on XmlRpcSerializer
9 /// to serialize the payload.</remarks>
10 /// <seealso cref="XmlRpcSerializer"/>
11 public class XmlRpcResponseSerializer : XmlRpcSerializer
12 {
13 static private XmlRpcResponseSerializer _singleton;
14 /// <summary>A static singleton instance of this deserializer.</summary>
15 static public XmlRpcResponseSerializer Singleton
16 {
17 get
18 {
19 if (_singleton == null)
20 _singleton = new XmlRpcResponseSerializer();
21
22 return _singleton;
23 }
24 }
25
26 /// <summary>Serialize the <c>XmlRpcResponse</c> to the output stream.</summary>
27 /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
28 /// <param name="obj">An <c>Object</c> to serialize.</param>
29 /// <seealso cref="XmlRpcResponse"/>
30 override public void Serialize(XmlTextWriter output, Object obj)
31 {
32 XmlRpcResponse response = (XmlRpcResponse)obj;
33
34 output.WriteStartDocument();
35 output.WriteStartElement(METHOD_RESPONSE);
36
37 if (response.IsFault)
38 output.WriteStartElement(FAULT);
39 else
40 {
41 output.WriteStartElement(PARAMS);
42 output.WriteStartElement(PARAM);
43 }
44
45 output.WriteStartElement(VALUE);
46
47 SerializeObject(output, response.Value);
48
49 output.WriteEndElement();
50
51 output.WriteEndElement();
52 if (!response.IsFault)
53 output.WriteEndElement();
54 output.WriteEndElement();
55 }
56 }
57}
diff --git a/Common/XmlRpcCS/XmlRpcSerializer.cs b/Common/XmlRpcCS/XmlRpcSerializer.cs
new file mode 100644
index 0000000..0643d38
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcSerializer.cs
@@ -0,0 +1,109 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Xml;
7
8 /// <summary>Base class of classes serializing data to XML-RPC's XML format.</summary>
9 /// <remarks>This class handles the basic type conversions like Integer to &lt;i4&gt;. </remarks>
10 /// <seealso cref="XmlRpcXmlTokens"/>
11 public class XmlRpcSerializer : XmlRpcXmlTokens
12 {
13
14 /// <summary>Serialize the <c>XmlRpcRequest</c> to the output stream.</summary>
15 /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
16 /// <param name="obj">An <c>Object</c> to serialize.</param>
17 /// <seealso cref="XmlRpcRequest"/>
18 virtual public void Serialize(XmlTextWriter output, Object obj)
19 {
20 }
21
22 /// <summary>Serialize the <c>XmlRpcRequest</c> to a String.</summary>
23 /// <remarks>Note this may represent a real memory hog for a large request.</remarks>
24 /// <param name="obj">An <c>Object</c> to serialize.</param>
25 /// <returns><c>String</c> containing XML-RPC representation of the request.</returns>
26 /// <seealso cref="XmlRpcRequest"/>
27 public String Serialize(Object obj)
28 {
29 StringWriter strBuf = new StringWriter();
30 XmlTextWriter xml = new XmlTextWriter(strBuf);
31 xml.Formatting = Formatting.Indented;
32 xml.Indentation = 4;
33 Serialize(xml, obj);
34 xml.Flush();
35 String returns = strBuf.ToString();
36 xml.Close();
37 return returns;
38 }
39
40 /// <remarks>Serialize the object to the output stream.</remarks>
41 /// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
42 /// <param name="obj">An <c>Object</c> to serialize.</param>
43 public void SerializeObject(XmlTextWriter output, Object obj)
44 {
45 if (obj == null)
46 return;
47
48 if (obj is byte[])
49 {
50 byte[] ba = (byte[])obj;
51 output.WriteStartElement(BASE64);
52 output.WriteBase64(ba, 0, ba.Length);
53 output.WriteEndElement();
54 }
55 else if (obj is String)
56 {
57 output.WriteElementString(STRING, obj.ToString());
58 }
59 else if (obj is Int32)
60 {
61 output.WriteElementString(INT, obj.ToString());
62 }
63 else if (obj is DateTime)
64 {
65 output.WriteElementString(DATETIME, ((DateTime)obj).ToString(ISO_DATETIME));
66 }
67 else if (obj is Double)
68 {
69 output.WriteElementString(DOUBLE, obj.ToString());
70 }
71 else if (obj is Boolean)
72 {
73 output.WriteElementString(BOOLEAN, ((((Boolean)obj) == true) ? "1" : "0"));
74 }
75 else if (obj is IList)
76 {
77 output.WriteStartElement(ARRAY);
78 output.WriteStartElement(DATA);
79 if (((ArrayList)obj).Count > 0)
80 {
81 foreach (Object member in ((IList)obj))
82 {
83 output.WriteStartElement(VALUE);
84 SerializeObject(output, member);
85 output.WriteEndElement();
86 }
87 }
88 output.WriteEndElement();
89 output.WriteEndElement();
90 }
91 else if (obj is IDictionary)
92 {
93 IDictionary h = (IDictionary)obj;
94 output.WriteStartElement(STRUCT);
95 foreach (String key in h.Keys)
96 {
97 output.WriteStartElement(MEMBER);
98 output.WriteElementString(NAME, key);
99 output.WriteStartElement(VALUE);
100 SerializeObject(output, h[key]);
101 output.WriteEndElement();
102 output.WriteEndElement();
103 }
104 output.WriteEndElement();
105 }
106
107 }
108 }
109}
diff --git a/Common/XmlRpcCS/XmlRpcServer.cs b/Common/XmlRpcCS/XmlRpcServer.cs
new file mode 100644
index 0000000..1c226c1
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcServer.cs
@@ -0,0 +1,239 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.IO;
6 using System.Net;
7 using System.Net.Sockets;
8 using System.Text;
9 using System.Threading;
10 using System.Xml;
11
12 /// <summary>A restricted HTTP server for use with XML-RPC.</summary>
13 /// <remarks>It only handles POST requests, and only POSTs representing XML-RPC calls.
14 /// In addition to dispatching requests it also provides a registry for request handlers.
15 /// </remarks>
16 public class XmlRpcServer : IEnumerable
17 {
18#pragma warning disable 0414 // disable "private field assigned but not used"
19 const int RESPONDER_COUNT = 10;
20 private TcpListener _myListener;
21 private int _port;
22 private IPAddress _address;
23 private IDictionary _handlers;
24 private XmlRpcSystemObject _system;
25 private WaitCallback _wc;
26#pragma warning restore 0414
27
28 ///<summary>Constructor with port and address.</summary>
29 ///<remarks>This constructor sets up a TcpListener listening on the
30 ///given port and address. It also calls a Thread on the method StartListen().</remarks>
31 ///<param name="address"><c>IPAddress</c> value of the address to listen on.</param>
32 ///<param name="port"><c>Int</c> value of the port to listen on.</param>
33 public XmlRpcServer(IPAddress address, int port)
34 {
35 _port = port;
36 _address = address;
37 _handlers = new Hashtable();
38 _system = new XmlRpcSystemObject(this);
39 _wc = new WaitCallback(WaitCallback);
40 }
41
42 ///<summary>Basic constructor.</summary>
43 ///<remarks>This constructor sets up a TcpListener listening on the
44 ///given port. It also calls a Thread on the method StartListen(). IPAddress.Any
45 ///is assumed as the address here.</remarks>
46 ///<param name="port"><c>Int</c> value of the port to listen on.</param>
47 public XmlRpcServer(int port) : this(IPAddress.Any, port) { }
48
49 /// <summary>Start the server.</summary>
50 public void Start()
51 {
52 try
53 {
54 Stop();
55 //start listing on the given port
56 // IPAddress addr = IPAddress.Parse("127.0.0.1");
57 lock (this)
58 {
59 _myListener = new TcpListener(IPAddress.Any, _port);
60 _myListener.Start();
61 //start the thread which calls the method 'StartListen'
62 Thread th = new Thread(new ThreadStart(StartListen));
63 th.Start();
64 }
65 }
66 catch (Exception e)
67 {
68 Logger.WriteEntry("An Exception Occurred while Listening :" + e.ToString(), LogLevel.Error);
69 }
70 }
71
72 /// <summary>Stop the server.</summary>
73 public void Stop()
74 {
75 try
76 {
77 if (_myListener != null)
78 {
79 lock (this)
80 {
81 _myListener.Stop();
82 _myListener = null;
83 }
84 }
85 }
86 catch (Exception e)
87 {
88 Logger.WriteEntry("An Exception Occurred while stopping :" +
89 e.ToString(), LogLevel.Error);
90 }
91 }
92
93 /// <summary>Get an enumeration of my XML-RPC handlers.</summary>
94 /// <returns><c>IEnumerable</c> the handler enumeration.</returns>
95 public IEnumerator GetEnumerator()
96 {
97 return _handlers.GetEnumerator();
98 }
99
100 /// <summary>Retrieve a handler by name.</summary>
101 /// <param name="name"><c>String</c> naming a handler</param>
102 /// <returns><c>Object</c> that is the handler.</returns>
103 public Object this[String name]
104 {
105 get { return _handlers[name]; }
106 }
107
108 ///<summary>
109 ///This method Accepts new connections and dispatches them when appropriate.
110 ///</summary>
111 public void StartListen()
112 {
113 while (true && _myListener != null)
114 {
115 //Accept a new connection
116 XmlRpcResponder responder = new XmlRpcResponder(this, _myListener.AcceptTcpClient());
117 ThreadPool.QueueUserWorkItem(_wc, responder);
118 }
119 }
120
121
122 ///<summary>
123 ///Add an XML-RPC handler object by name.
124 ///</summary>
125 ///<param name="name"><c>String</c> XML-RPC dispatch name of this object.</param>
126 ///<param name="obj"><c>Object</c> The object that is the XML-RPC handler.</param>
127 public void Add(String name, Object obj)
128 {
129 _handlers.Add(name, obj);
130 }
131
132 ///<summary>Return a C# object.method name for and XML-RPC object.method name pair.</summary>
133 ///<param name="methodName">The XML-RPC object.method.</param>
134 ///<returns><c>String</c> of form object.method for the underlying C# method.</returns>
135 public String MethodName(String methodName)
136 {
137 int dotAt = methodName.LastIndexOf('.');
138
139 if (dotAt == -1)
140 {
141 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
142 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Bad method name " + methodName);
143 }
144
145 String objectName = methodName.Substring(0, dotAt);
146 Object target = _handlers[objectName];
147
148 if (target == null)
149 {
150 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
151 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found");
152 }
153
154 return target.GetType().FullName + "." + methodName.Substring(dotAt + 1);
155 }
156
157 ///<summary>Invoke a method described in a request.</summary>
158 ///<param name="req"><c>XmlRpcRequest</c> containing a method descriptions.</param>
159 /// <seealso cref="XmlRpcSystemObject.Invoke"/>
160 /// <seealso cref="XmlRpcServer.Invoke(String,String,IList)"/>
161 public Object Invoke(XmlRpcRequest req)
162 {
163 return Invoke(req.MethodNameObject, req.MethodNameMethod, req.Params);
164 }
165
166 ///<summary>Invoke a method on a named handler.</summary>
167 ///<param name="objectName"><c>String</c> The name of the handler.</param>
168 ///<param name="methodName"><c>String</c> The name of the method to invoke on the handler.</param>
169 ///<param name="parameters"><c>IList</c> The parameters to invoke the method with.</param>
170 /// <seealso cref="XmlRpcSystemObject.Invoke"/>
171 public Object Invoke(String objectName, String methodName, IList parameters)
172 {
173 Object target = _handlers[objectName];
174
175 if (target == null)
176 {
177 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
178 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found");
179 }
180
181 return XmlRpcSystemObject.Invoke(target, methodName, parameters);
182 }
183
184 /// <summary>The method the thread pool invokes when a thread is available to handle an HTTP request.</summary>
185 /// <param name="responder">TcpClient from the socket accept.</param>
186 public void WaitCallback(object responder)
187 {
188 XmlRpcResponder resp = (XmlRpcResponder)responder;
189
190 if (resp.HttpReq.HttpMethod == "POST")
191 {
192 try
193 {
194 resp.Respond();
195 }
196 catch (Exception e)
197 {
198 Logger.WriteEntry("Failed on post: " + e, LogLevel.Error);
199 }
200 }
201 else
202 {
203 Logger.WriteEntry("Only POST methods are supported: " + resp.HttpReq.HttpMethod +
204 " ignored", LogLevel.Error);
205 }
206
207 resp.Close();
208 }
209
210 /// <summary>
211 /// This function send the Header Information to the client (Browser)
212 /// </summary>
213 /// <param name="sHttpVersion">HTTP Version</param>
214 /// <param name="sMIMEHeader">Mime Type</param>
215 /// <param name="iTotBytes">Total Bytes to be sent in the body</param>
216 /// <param name="sStatusCode"></param>
217 /// <param name="output">Socket reference</param>
218 static public void HttpHeader(string sHttpVersion, string sMIMEHeader, long iTotBytes, string sStatusCode, TextWriter output)
219 {
220 String sBuffer = "";
221
222 // if Mime type is not provided set default to text/html
223 if (sMIMEHeader.Length == 0)
224 {
225 sMIMEHeader = "text/html"; // Default Mime Type is text/html
226 }
227
228 sBuffer += sHttpVersion + sStatusCode + "\r\n";
229 sBuffer += "Connection: close\r\n";
230 if (iTotBytes > 0)
231 sBuffer += "Content-Length: " + iTotBytes + "\r\n";
232 sBuffer += "Server: XmlRpcServer \r\n";
233 sBuffer += "Content-Type: " + sMIMEHeader + "\r\n";
234 sBuffer += "\r\n";
235
236 output.Write(sBuffer);
237 }
238 }
239}
diff --git a/Common/XmlRpcCS/XmlRpcSystemObject.cs b/Common/XmlRpcCS/XmlRpcSystemObject.cs
new file mode 100644
index 0000000..5f79951
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcSystemObject.cs
@@ -0,0 +1,252 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4 using System.Collections;
5 using System.Reflection;
6
7 /// <summary> XML-RPC System object implementation of extended specifications.</summary>
8 [XmlRpcExposed]
9 public class XmlRpcSystemObject
10 {
11 private XmlRpcServer _server;
12 static private IDictionary _methodHelp = new Hashtable();
13
14 /// <summary>Static <c>IDictionary</c> to hold mappings of method name to associated documentation String</summary>
15 static public IDictionary MethodHelp
16 {
17 get { return _methodHelp; }
18 }
19
20 /// <summary>Constructor.</summary>
21 /// <param name="server"><c>XmlRpcServer</c> server to be the system object for.</param>
22 public XmlRpcSystemObject(XmlRpcServer server)
23 {
24 _server = server;
25 server.Add("system", this);
26 _methodHelp.Add(this.GetType().FullName + ".methodHelp", "Return a string description.");
27 }
28
29 /// <summary>Invoke a method on a given object.</summary>
30 /// <remarks>Using reflection, and respecting the <c>XmlRpcExposed</c> attribute,
31 /// invoke the <paramref>methodName</paramref> method on the <paramref>target</paramref>
32 /// instance with the <paramref>parameters</paramref> provided. All this packages other <c>Invoke</c> methods
33 /// end up calling this.</remarks>
34 /// <returns><c>Object</c> the value the invoked method returns.</returns>
35 /// <exception cref="XmlRpcException">If method does not exist, is not exposed, parameters invalid, or invocation
36 /// results in an exception. Note, the <c>XmlRpcException.Code</c> will indicate cause.</exception>
37 static public Object Invoke(Object target, String methodName, IList parameters)
38 {
39 if (target == null)
40 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
41 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Invalid target object.");
42
43 Type type = target.GetType();
44 MethodInfo method = type.GetMethod(methodName);
45
46 try
47 {
48 if (!XmlRpcExposedAttribute.ExposedMethod(target, methodName))
49 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
50 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Method " + methodName + " is not exposed.");
51 }
52 catch (MissingMethodException me)
53 {
54 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
55 XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": " + me.Message);
56 }
57
58 Object[] args = new Object[parameters.Count];
59
60 int index = 0;
61 foreach (Object arg in parameters)
62 {
63 args[index] = arg;
64 index++;
65 }
66
67 try
68 {
69 Object retValue = method.Invoke(target, args);
70 if (retValue == null)
71 throw new XmlRpcException(XmlRpcErrorCodes.APPLICATION_ERROR,
72 XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": Method returned NULL.");
73 return retValue;
74 }
75 catch (XmlRpcException e)
76 {
77 throw e;
78 }
79 catch (ArgumentException ae)
80 {
81 Logger.WriteEntry(XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": " + ae.Message,
82 LogLevel.Information);
83 String call = methodName + "( ";
84 foreach (Object o in args)
85 {
86 call += o.GetType().Name;
87 call += " ";
88 }
89 call += ")";
90 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_PARAMS,
91 XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": Arguement type mismatch invoking " + call);
92 }
93 catch (TargetParameterCountException tpce)
94 {
95 Logger.WriteEntry(XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": " + tpce.Message,
96 LogLevel.Information);
97 throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_PARAMS,
98 XmlRpcErrorCodes.SERVER_ERROR_PARAMS_MSG + ": Arguement count mismatch invoking " + methodName);
99 }
100 catch (TargetInvocationException tie)
101 {
102 throw new XmlRpcException(XmlRpcErrorCodes.APPLICATION_ERROR,
103 XmlRpcErrorCodes.APPLICATION_ERROR_MSG + " Invoked method " + methodName + ": " + tie.Message);
104 }
105 }
106
107 /// <summary>List methods available on all handlers of this server.</summary>
108 /// <returns><c>IList</c> An array of <c>Strings</c>, each <c>String</c> will have form "object.method".</returns>
109 [XmlRpcExposed]
110 public IList listMethods()
111 {
112 IList methods = new ArrayList();
113 Boolean considerExposure;
114
115 foreach (DictionaryEntry handlerEntry in _server)
116 {
117 considerExposure = XmlRpcExposedAttribute.IsExposed(handlerEntry.Value.GetType());
118
119 foreach (MemberInfo mi in handlerEntry.Value.GetType().GetMembers())
120 {
121 if (mi.MemberType != MemberTypes.Method)
122 continue;
123
124 if (!((MethodInfo)mi).IsPublic)
125 continue;
126
127 if (considerExposure && !XmlRpcExposedAttribute.IsExposed(mi))
128 continue;
129
130 methods.Add(handlerEntry.Key + "." + mi.Name);
131 }
132 }
133
134 return methods;
135 }
136
137 /// <summary>Given a method name return the possible signatures for it.</summary>
138 /// <param name="name"><c>String</c> The object.method name to look up.</param>
139 /// <returns><c>IList</c> Of arrays of signatures.</returns>
140 [XmlRpcExposed]
141 public IList methodSignature(String name)
142 {
143 IList signatures = new ArrayList();
144 int index = name.IndexOf('.');
145
146 if (index < 0)
147 return signatures;
148
149 String oName = name.Substring(0, index);
150 Object obj = _server[oName];
151
152 if (obj == null)
153 return signatures;
154
155 MemberInfo[] mi = obj.GetType().GetMember(name.Substring(index + 1));
156
157 if (mi == null || mi.Length != 1) // for now we want a single signature
158 return signatures;
159
160 MethodInfo method;
161
162 try
163 {
164 method = (MethodInfo)mi[0];
165 }
166 catch (Exception e)
167 {
168 Logger.WriteEntry("Attempted methodSignature call on " + mi[0] + " caused: " + e,
169 LogLevel.Information);
170 return signatures;
171 }
172
173 if (!method.IsPublic)
174 return signatures;
175
176 IList signature = new ArrayList();
177 signature.Add(method.ReturnType.Name);
178
179 foreach (ParameterInfo param in method.GetParameters())
180 {
181 signature.Add(param.ParameterType.Name);
182 }
183
184
185 signatures.Add(signature);
186
187 return signatures;
188 }
189
190 /// <summary>Help for given method signature. Not implemented yet.</summary>
191 /// <param name="name"><c>String</c> The object.method name to look up.</param>
192 /// <returns><c>String</c> help text. Rich HTML text.</returns>
193 [XmlRpcExposed]
194 public String methodHelp(String name)
195 {
196 String help = null;
197
198 try
199 {
200 help = (String)_methodHelp[_server.MethodName(name)];
201 }
202 catch (XmlRpcException e)
203 {
204 throw e;
205 }
206 catch (Exception) { /* ignored */ };
207
208 if (help == null)
209 help = "No help available for: " + name;
210
211 return help;
212 }
213
214 /// <summary>Boxcarring support method.</summary>
215 /// <param name="calls"><c>IList</c> of calls</param>
216 /// <returns><c>ArrayList</c> of results/faults.</returns>
217 [XmlRpcExposed]
218 public IList multiCall(IList calls)
219 {
220 IList responses = new ArrayList();
221 XmlRpcResponse fault = new XmlRpcResponse();
222
223 foreach (IDictionary call in calls)
224 {
225 try
226 {
227 XmlRpcRequest req = new XmlRpcRequest((String)call[XmlRpcXmlTokens.METHOD_NAME],
228 (ArrayList)call[XmlRpcXmlTokens.PARAMS]);
229 Object results = _server.Invoke(req);
230 IList response = new ArrayList();
231 response.Add(results);
232 responses.Add(response);
233 }
234 catch (XmlRpcException e)
235 {
236 fault.SetFault(e.FaultCode, e.FaultString);
237 responses.Add(fault.Value);
238 }
239 catch (Exception e2)
240 {
241 fault.SetFault(XmlRpcErrorCodes.APPLICATION_ERROR,
242 XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": " + e2.Message);
243 responses.Add(fault.Value);
244 }
245 }
246
247 return responses;
248 }
249
250 }
251}
252
diff --git a/Common/XmlRpcCS/XmlRpcXmlTokens.cs b/Common/XmlRpcCS/XmlRpcXmlTokens.cs
new file mode 100644
index 0000000..50788bd
--- /dev/null
+++ b/Common/XmlRpcCS/XmlRpcXmlTokens.cs
@@ -0,0 +1,76 @@
1namespace Nwc.XmlRpc
2{
3 using System;
4
5 /// <summary>Class collecting <c>String</c> tokens that are part of XML-RPC files.</summary>
6 public class XmlRpcXmlTokens
7 {
8 /// <summary>C# formatting string to describe an ISO 8601 date.</summary>
9 public const String ISO_DATETIME = "yyyyMMdd\\THH\\:mm\\:ss";
10 /// <summary>Base64 field indicator.</summary>
11 /// <remarks>Corresponds to the &lt;base64&gt; tag.</remarks>
12 public const String BASE64 = "base64";
13 /// <summary>String field indicator.</summary>
14 /// <remarks>Corresponds to the &lt;string&gt; tag.</remarks>
15 public const String STRING = "string";
16 /// <summary>Integer field integer.</summary>
17 /// <remarks>Corresponds to the &lt;i4&gt; tag.</remarks>
18 public const String INT = "i4";
19 /// <summary>Alternate integer field indicator.</summary>
20 /// <remarks>Corresponds to the &lt;int&gt; tag.</remarks>
21 public const String ALT_INT = "int";
22 /// <summary>Date field indicator.</summary>
23 /// <remarks>Corresponds to the &lt;dateTime.iso8601&gt; tag.</remarks>
24 public const String DATETIME = "dateTime.iso8601";
25 /// <summary>Boolean field indicator.</summary>
26 /// <remarks>Corresponds to the &lt;boolean&gt; tag.</remarks>
27 public const String BOOLEAN = "boolean";
28 /// <summary>Value token.</summary>
29 /// <remarks>Corresponds to the &lt;value&gt; tag.</remarks>
30 public const String VALUE = "value";
31 /// <summary>Name token.</summary>
32 /// <remarks>Corresponds to the &lt;name&gt; tag.</remarks>
33 public const String NAME = "name";
34 /// <summary>Array field indicator..</summary>
35 /// <remarks>Corresponds to the &lt;array&gt; tag.</remarks>
36 public const String ARRAY = "array";
37 /// <summary>Data token.</summary>
38 /// <remarks>Corresponds to the &lt;data&gt; tag.</remarks>
39 public const String DATA = "data";
40 /// <summary>Member token.</summary>
41 /// <remarks>Corresponds to the &lt;member&gt; tag.</remarks>
42 public const String MEMBER = "member";
43 /// <summary>Stuct field indicator.</summary>
44 /// <remarks>Corresponds to the &lt;struct&gt; tag.</remarks>
45 public const String STRUCT = "struct";
46 /// <summary>Double field indicator.</summary>
47 /// <remarks>Corresponds to the &lt;double&gt; tag.</remarks>
48 public const String DOUBLE = "double";
49 /// <summary>Param token.</summary>
50 /// <remarks>Corresponds to the &lt;param&gt; tag.</remarks>
51 public const String PARAM = "param";
52 /// <summary>Params token.</summary>
53 /// <remarks>Corresponds to the &lt;params&gt; tag.</remarks>
54 public const String PARAMS = "params";
55 /// <summary>MethodCall token.</summary>
56 /// <remarks>Corresponds to the &lt;methodCall&gt; tag.</remarks>
57 public const String METHOD_CALL = "methodCall";
58 /// <summary>MethodName token.</summary>
59 /// <remarks>Corresponds to the &lt;methodName&gt; tag.</remarks>
60 public const String METHOD_NAME = "methodName";
61 /// <summary>MethodResponse token</summary>
62 /// <remarks>Corresponds to the &lt;methodResponse&gt; tag.</remarks>
63 public const String METHOD_RESPONSE = "methodResponse";
64 /// <summary>Fault response token.</summary>
65 /// <remarks>Corresponds to the &lt;fault&gt; tag.</remarks>
66 public const String FAULT = "fault";
67 /// <summary>FaultCode token.</summary>
68 /// <remarks>Corresponds to the &lt;faultCode&gt; tag.</remarks>
69 public const String FAULT_CODE = "faultCode";
70 /// <summary>FaultString token.</summary>
71 /// <remarks>Corresponds to the &lt;faultString&gt; tag.</remarks>
72 public const String FAULT_STRING = "faultString";
73 }
74}
75
76
diff --git a/OpenGridServices.build b/OpenGridServices.build
new file mode 100644
index 0000000..d240dc0
--- /dev/null
+++ b/OpenGridServices.build
@@ -0,0 +1,100 @@
1<?xml version="1.0" ?>
2<project name="OpenGridServices" default="build">
3 <echo message="Using '${nant.settings.currentframework}' Framework"/>
4
5 <property name="bin.dir" value="bin" />
6 <property name="obj.dir" value="obj" />
7 <property name="doc.dir" value="doc" />
8 <property name="project.main.dir" value="${project::get-base-directory()}" />
9
10 <target name="Debug" description="">
11 <property name="project.config" value="Debug" />
12 <property name="build.debug" value="true" />
13 </target>
14
15 <property name="project.config" value="Release" />
16
17 <target name="Release" description="">
18 <property name="project.config" value="Release" />
19 <property name="build.debug" value="false" />
20 </target>
21
22 <target name="net-1.1" description="Sets framework to .NET 1.1">
23 <property name="nant.settings.currentframework" value="net-1.1" />
24 </target>
25
26 <target name="net-2.0" description="Sets framework to .NET 2.0">
27 <property name="nant.settings.currentframework" value="net-2.0" />
28 </target>
29
30 <target name="mono-2.0" description="Sets framework to mono 2.0">
31 <property name="nant.settings.currentframework" value="mono-2.0" />
32 </target>
33
34 <target name="mono-1.0" description="Sets framework to mono 1.0">
35 <property name="nant.settings.currentframework" value="mono-1.0" />
36 </target>
37
38 <target name="init" description="">
39 <call target="${project.config}" />
40 <sysinfo />
41 <echo message="Platform ${sys.os.platform}" />
42 <property name="build.dir" value="${bin.dir}/${project.config}" />
43 </target>
44
45 <target name="clean" description="">
46 <echo message="Deleting all builds from all configurations" />
47 <delete dir="${bin.dir}" failonerror="false" />
48 <delete dir="${obj.dir}" failonerror="false" />
49 <nant buildfile="OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build" target="clean" />
50 <nant buildfile="OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build" target="clean" />
51 <nant buildfile="OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build" target="clean" />
52 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build" target="clean" />
53 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build" target="clean" />
54 <nant buildfile="OpenGridServices/ServiceManager/ServiceManager.exe.build" target="clean" />
55 <nant buildfile="OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build" target="clean" />
56 <nant buildfile="OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="clean" />
57 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build" target="clean" />
58 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build" target="clean" />
59 <nant buildfile="OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="clean" />
60 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build" target="clean" />
61 </target>
62
63 <target name="build" depends="init" description="">
64 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build" target="build" />
65 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build" target="build" />
66 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build" target="build" />
67 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build" target="build" />
68 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build" target="build" />
69 <nant buildfile="OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build" target="build" />
70 <nant buildfile="OpenGridServices/ServiceManager/ServiceManager.exe.build" target="build" />
71 <nant buildfile="OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="build" />
72 <nant buildfile="OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build" target="build" />
73 <nant buildfile="OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="build" />
74 <nant buildfile="OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build" target="build" />
75 <nant buildfile="OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build" target="build" />
76 </target>
77
78 <target name="build-release" depends="Release, init, build" description="Builds in Release mode" />
79
80 <target name="build-debug" depends="Debug, init, build" description="Builds in Debug mode" />
81
82 <target name="package" depends="clean, doc" description="Builds all" />
83
84 <target name="doc" depends="build-release">
85 <echo message="Generating all documentation from all builds" />
86 <nant buildfile="OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build" target="doc" />
87 <nant buildfile="OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build" target="doc" />
88 <nant buildfile="OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build" target="doc" />
89 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build" target="doc" />
90 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build" target="doc" />
91 <nant buildfile="OpenGridServices/ServiceManager/ServiceManager.exe.build" target="doc" />
92 <nant buildfile="OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build" target="doc" />
93 <nant buildfile="OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="doc" />
94 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build" target="doc" />
95 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build" target="doc" />
96 <nant buildfile="OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="doc" />
97 <nant buildfile="OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build" target="doc" />
98 </target>
99
100</project>
diff --git a/OpenGridServices.sln b/OpenGridServices.sln
new file mode 100644
index 0000000..bc21256
--- /dev/null
+++ b/OpenGridServices.sln
@@ -0,0 +1,85 @@
1Microsoft Visual Studio Solution File, Format Version 9.00
2# Visual C# Express 2005
3Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenUser.Config.UserConfigDb4o", "OpenGridServices\OpenUser.Config\UserConfigDb4o\OpenUser.Config.UserConfigDb4o.csproj", "{7E494328-0000-0000-0000-000000000000}"
4EndProject
5Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGridServices.AssetServer", "OpenGridServices\OpenGridServices.AssetServer\OpenGridServices.AssetServer.csproj", "{0021261B-0000-0000-0000-000000000000}"
6EndProject
7Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Config.GridConfigDb4o", "OpenGridServices\OpenGrid.Config\GridConfigDb4o\OpenGrid.Config.GridConfigDb4o.csproj", "{B0027747-0000-0000-0000-000000000000}"
8EndProject
9Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Data.SQLite", "OpenGridServices\OpenGrid.Framework.Data.SQLite\OpenGrid.Framework.Data.SQLite.csproj", "{1E3F341A-0000-0000-0000-000000000000}"
10EndProject
11Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Data.DB4o", "OpenGridServices\OpenGrid.Framework.Data.DB4o\OpenGrid.Framework.Data.DB4o.csproj", "{39BD9497-0000-0000-0000-000000000000}"
12EndProject
13Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceManager", "OpenGridServices\ServiceManager\ServiceManager.csproj", "{E141F4EE-0000-0000-0000-000000000000}"
14EndProject
15Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Manager", "OpenGridServices\OpenGrid.Framework.Manager\OpenGrid.Framework.Manager.csproj", "{7924FD35-0000-0000-0000-000000000000}"
16EndProject
17Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGridServices.GridServer", "OpenGridServices\OpenGridServices.GridServer\OpenGridServices.GridServer.csproj", "{21BFC8E2-0000-0000-0000-000000000000}"
18EndProject
19Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Data.MSSQL", "OpenGridServices\OpenGrid.Framework.Data.MSSQL\OpenGrid.Framework.Data.MSSQL.csproj", "{0A563AC1-0000-0000-0000-000000000000}"
20EndProject
21Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Data", "OpenGridServices\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj", "{62CDF671-0000-0000-0000-000000000000}"
22EndProject
23Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGridServices.UserServer", "OpenGridServices\OpenGridServices.UserServer\OpenGridServices.UserServer.csproj", "{66591469-0000-0000-0000-000000000000}"
24EndProject
25Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Data.MySQL", "OpenGridServices\OpenGrid.Framework.Data.MySQL\OpenGrid.Framework.Data.MySQL.csproj", "{0F3C3AC1-0000-0000-0000-000000000000}"
26EndProject
27Global
28 GlobalSection(SolutionConfigurationPlatforms) = preSolution
29 Debug|Any CPU = Debug|Any CPU
30 Release|Any CPU = Release|Any CPU
31 EndGlobalSection
32 GlobalSection(ProjectConfigurationPlatforms) = postSolution
33 {7E494328-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34 {7E494328-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
35 {7E494328-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
36 {7E494328-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
37 {0021261B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38 {0021261B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
39 {0021261B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
40 {0021261B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
41 {B0027747-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42 {B0027747-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
43 {B0027747-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
44 {B0027747-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
45 {1E3F341A-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46 {1E3F341A-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
47 {1E3F341A-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
48 {1E3F341A-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
49 {39BD9497-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50 {39BD9497-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
51 {39BD9497-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
52 {39BD9497-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
53 {E141F4EE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54 {E141F4EE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
55 {E141F4EE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
56 {E141F4EE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
57 {7924FD35-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58 {7924FD35-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
59 {7924FD35-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
60 {7924FD35-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
61 {21BFC8E2-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62 {21BFC8E2-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
63 {21BFC8E2-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
64 {21BFC8E2-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
65 {0A563AC1-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
66 {0A563AC1-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
67 {0A563AC1-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
68 {0A563AC1-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
69 {62CDF671-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
70 {62CDF671-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
71 {62CDF671-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
72 {62CDF671-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
73 {66591469-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
74 {66591469-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
75 {66591469-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
76 {66591469-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
77 {0F3C3AC1-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
78 {0F3C3AC1-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
79 {0F3C3AC1-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
80 {0F3C3AC1-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
81 EndGlobalSection
82 GlobalSection(SolutionProperties) = preSolution
83 HideSolutionNode = FALSE
84 EndGlobalSection
85EndGlobal
diff --git a/OpenGridServices.suo b/OpenGridServices.suo
new file mode 100644
index 0000000..9a93215
--- /dev/null
+++ b/OpenGridServices.suo
Binary files differ
diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/AssemblyInfo.cs
new file mode 100644
index 0000000..b5065bc
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/AssemblyInfo.cs
@@ -0,0 +1,31 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// Information about this assembly is defined by the following
6// attributes.
7//
8// change them to the information which is associated with the assembly
9// you compile.
10
11[assembly: AssemblyTitle("GridConfig")]
12[assembly: AssemblyDescription("")]
13[assembly: AssemblyConfiguration("")]
14[assembly: AssemblyCompany("")]
15[assembly: AssemblyProduct("GridConfig")]
16[assembly: AssemblyCopyright("")]
17[assembly: AssemblyTrademark("")]
18[assembly: AssemblyCulture("")]
19
20// This sets the default COM visibility of types in the assembly to invisible.
21// If you need to expose a type to COM, use [ComVisible(true)] on that type.
22[assembly: ComVisible(false)]
23
24// The assembly version has following format :
25//
26// Major.Minor.Build.Revision
27//
28// You can specify all values by your own or you can build default build and revision
29// numbers with the '*' character (the default):
30
31[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs
new file mode 100644
index 0000000..2d00ca6
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs
@@ -0,0 +1,112 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections.Generic;
29using OpenSim.Framework.Console;
30using OpenSim.Framework.Interfaces;
31using Db4objects.Db4o;
32
33namespace OpenGrid.Config.GridConfigDb4o
34{
35 public class Db40ConfigPlugin: IGridConfig
36 {
37 public GridConfig GetConfigObject()
38 {
39 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Loading Db40Config dll");
40 return ( new DbGridConfig());
41 }
42 }
43
44 public class DbGridConfig : GridConfig
45 {
46 private IObjectContainer db;
47
48 public void LoadDefaults() {
49 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings");
50
51 this.GridOwner = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid owner", "OGS development team");
52
53 this.DefaultAssetServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default asset server","http://127.0.0.1:8003/");
54 this.AssetSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to asset server","null");
55 this.AssetRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from asset server","null");
56
57 this.DefaultUserServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default user server","http://127.0.0.1:8002/");
58 this.UserSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to user server","null");
59 this.UserRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from user server","null");
60
61 this.SimSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to sims","null");
62 this.SimRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from sims","null");
63 }
64
65 public override void InitConfig() {
66 try {
67 db = Db4oFactory.OpenFile("opengrid.yap");
68 IObjectSet result = db.Get(typeof(DbGridConfig));
69 if(result.Count==1) {
70 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Config.cs:InitConfig() - Found a GridConfig object in the local database, loading");
71 foreach (DbGridConfig cfg in result) {
72 this.GridOwner=cfg.GridOwner;
73 this.DefaultAssetServer=cfg.DefaultAssetServer;
74 this.AssetSendKey=cfg.AssetSendKey;
75 this.AssetRecvKey=cfg.AssetRecvKey;
76 this.DefaultUserServer=cfg.DefaultUserServer;
77 this.UserSendKey=cfg.UserSendKey;
78 this.UserRecvKey=cfg.UserRecvKey;
79 this.SimSendKey=cfg.SimSendKey;
80 this.SimRecvKey=cfg.SimRecvKey;
81 }
82 } else {
83 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults");
84 LoadDefaults();
85 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Writing out default settings to local database");
86 db.Set(this);
87 db.Close();
88 }
89 } catch(Exception e) {
90 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Config.cs:InitConfig() - Exception occured");
91 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString());
92 }
93
94 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Grid settings loaded:");
95 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Grid owner: " + this.GridOwner);
96 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Default asset server: " + this.DefaultAssetServer);
97 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to asset server: " + this.AssetSendKey);
98 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from asset server: " + this.AssetRecvKey);
99 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Default user server: " + this.DefaultUserServer);
100 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to user server: " + this.UserSendKey);
101 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from user server: " + this.UserRecvKey);
102 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to sims: " + this.SimSendKey);
103 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from sims: " + this.SimRecvKey);
104 }
105
106
107 public void Shutdown() {
108 db.Close();
109 }
110 }
111
112}
diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj
new file mode 100644
index 0000000..744e1e8
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj
@@ -0,0 +1,107 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{B0027747-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Config.GridConfigDb4o</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Config.GridConfigDb4o</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Data.dll" >
66 <HintPath>..\..\..\bin\System.Data.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Xml" >
70 <HintPath>System.Xml.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" >
78 <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 <Reference Include="OpenSim.Framework" >
82 <HintPath>OpenSim.Framework.dll</HintPath>
83 <Private>False</Private>
84 </Reference>
85 <Reference Include="OpenSim.Framework.Console" >
86 <HintPath>OpenSim.Framework.Console.dll</HintPath>
87 <Private>False</Private>
88 </Reference>
89 </ItemGroup>
90 <ItemGroup>
91 </ItemGroup>
92 <ItemGroup>
93 <Compile Include="AssemblyInfo.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 <Compile Include="DbGridConfig.cs">
97 <SubType>Code</SubType>
98 </Compile>
99 </ItemGroup>
100 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
101 <PropertyGroup>
102 <PreBuildEvent>
103 </PreBuildEvent>
104 <PostBuildEvent>
105 </PostBuildEvent>
106 </PropertyGroup>
107</Project>
diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj.user b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build
new file mode 100644
index 0000000..cbc8479
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build
@@ -0,0 +1,46 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Config.GridConfigDb4o" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Config.GridConfigDb4o" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="DbGridConfig.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="System.Data.dll.dll" />
24 <include name="System.Xml.dll" />
25 <include name="../../../bin/libsecondlife.dll" />
26 <include name="../../../bin/Db4objects.Db4o.dll" />
27 <include name="../../../bin/OpenSim.Framework.dll" />
28 <include name="../../../bin/OpenSim.Framework.Console.dll" />
29 </references>
30 </csc>
31 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
32 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
33 <copy todir="${project::get-base-directory()}/../../../bin/">
34 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
35 <include name="*.dll"/>
36 <include name="*.exe"/>
37 </fileset>
38 </copy>
39 </target>
40 <target name="clean">
41 <delete dir="${bin.dir}" failonerror="false" />
42 <delete dir="${obj.dir}" failonerror="false" />
43 </target>
44 <target name="doc" description="Creates documentation.">
45 </target>
46</project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs
new file mode 100644
index 0000000..546713e
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs
@@ -0,0 +1,83 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenGrid.Framework.Data;
5using libsecondlife;
6
7
8namespace OpenGrid.Framework.Data.DB4o
9{
10 class DB4oGridData : IGridData
11 {
12 DB4oGridManager manager;
13
14 public void Initialise() {
15 manager = new DB4oGridManager("gridserver.yap");
16 }
17
18 public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
19 {
20 return null;
21 }
22
23 public SimProfileData GetProfileByHandle(ulong handle) {
24 lock (manager.simProfiles)
25 {
26 foreach (LLUUID UUID in manager.simProfiles.Keys)
27 {
28 if (manager.simProfiles[UUID].regionHandle == handle)
29 {
30 return manager.simProfiles[UUID];
31 }
32 }
33 }
34 throw new Exception("Unable to find profile with handle (" + handle.ToString() + ")");
35 }
36
37 public SimProfileData GetProfileByLLUUID(LLUUID uuid)
38 {
39 lock (manager.simProfiles)
40 {
41 if (manager.simProfiles.ContainsKey(uuid))
42 return manager.simProfiles[uuid];
43 }
44 throw new Exception("Unable to find profile with UUID (" + uuid.ToStringHyphenated() + ")");
45 }
46
47 public DataResponse AddProfile(SimProfileData profile)
48 {
49 lock (manager.simProfiles)
50 {
51 if (manager.AddRow(profile))
52 {
53 return DataResponse.RESPONSE_OK;
54 }
55 else
56 {
57 return DataResponse.RESPONSE_ERROR;
58 }
59 }
60 }
61
62 public bool AuthenticateSim(LLUUID uuid, ulong handle, string key) {
63 if (manager.simProfiles[uuid].regionRecvKey == key)
64 return true;
65 return false;
66 }
67
68 public void Close()
69 {
70 manager = null;
71 }
72
73 public string getName()
74 {
75 return "DB4o Grid Provider";
76 }
77
78 public string getVersion()
79 {
80 return "0.1";
81 }
82 }
83}
diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oManager.cs b/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oManager.cs
new file mode 100644
index 0000000..1606765
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oManager.cs
@@ -0,0 +1,111 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Db4objects.Db4o;
5using OpenGrid.Framework.Data;
6using libsecondlife;
7
8namespace OpenGrid.Framework.Data.DB4o
9{
10 class DB4oGridManager
11 {
12 public Dictionary<LLUUID, SimProfileData> simProfiles = new Dictionary<LLUUID, SimProfileData>();
13 string dbfl;
14
15 public DB4oGridManager(string db4odb)
16 {
17 dbfl = db4odb;
18 IObjectContainer database;
19 database = Db4oFactory.OpenFile(dbfl);
20 IObjectSet result = database.Get(typeof(SimProfileData));
21 foreach(SimProfileData row in result) {
22 simProfiles.Add(row.UUID, row);
23 }
24 database.Close();
25 }
26
27 /// <summary>
28 /// Adds a new profile to the database (Warning: Probably slow.)
29 /// </summary>
30 /// <param name="row">The profile to add</param>
31 /// <returns>Successful?</returns>
32 public bool AddRow(SimProfileData row)
33 {
34 if (simProfiles.ContainsKey(row.UUID))
35 {
36 simProfiles[row.UUID] = row;
37 }
38 else
39 {
40 simProfiles.Add(row.UUID, row);
41 }
42
43 try
44 {
45 IObjectContainer database;
46 database = Db4oFactory.OpenFile(dbfl);
47 database.Set(row);
48 database.Close();
49 return true;
50 }
51 catch (Exception e)
52 {
53 return false;
54 }
55 }
56
57
58 }
59
60 class DB4oUserManager
61 {
62 public Dictionary<LLUUID, UserProfileData> userProfiles = new Dictionary<LLUUID, UserProfileData>();
63 string dbfl;
64
65 public DB4oUserManager(string db4odb)
66 {
67 dbfl = db4odb;
68 IObjectContainer database;
69 database = Db4oFactory.OpenFile(dbfl);
70 IObjectSet result = database.Get(typeof(UserProfileData));
71 foreach (UserProfileData row in result)
72 {
73 userProfiles.Add(row.UUID, row);
74 }
75 database.Close();
76 }
77
78 /// <summary>
79 /// Adds a new profile to the database (Warning: Probably slow.)
80 /// </summary>
81 /// <param name="row">The profile to add</param>
82 /// <returns>Successful?</returns>
83 public bool AddRow(UserProfileData row)
84 {
85 Console.WriteLine("adding profile to database" + row.username);
86 if (userProfiles.ContainsKey(row.UUID))
87 {
88 userProfiles[row.UUID] = row;
89 }
90 else
91 {
92 userProfiles.Add(row.UUID, row);
93 }
94
95 try
96 {
97 IObjectContainer database;
98 database = Db4oFactory.OpenFile(dbfl);
99 database.Set(row);
100 database.Close();
101 return true;
102 }
103 catch (Exception e)
104 {
105 return false;
106 }
107 }
108
109
110 }
111}
diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs b/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs
new file mode 100644
index 0000000..b95219c
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs
@@ -0,0 +1,100 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenGrid.Framework.Data;
5using libsecondlife;
6
7namespace OpenGrid.Framework.Data.DB4o
8{
9 public class DB4oUserData : IUserData
10 {
11 DB4oUserManager manager;
12
13 public void Initialise()
14 {
15 manager = new DB4oUserManager("userprofiles.yap");
16 }
17
18 public UserProfileData getUserByUUID(LLUUID uuid)
19 {
20 if(manager.userProfiles.ContainsKey(uuid))
21 return manager.userProfiles[uuid];
22 return null;
23 }
24
25 public UserProfileData getUserByName(string name)
26 {
27 return getUserByName(name.Split(' ')[0], name.Split(' ')[1]);
28 }
29
30 public UserProfileData getUserByName(string fname, string lname)
31 {
32 foreach (UserProfileData profile in manager.userProfiles.Values)
33 {
34 if (profile.username == fname && profile.surname == lname)
35 return profile;
36 }
37 return null;
38 }
39
40 public UserAgentData getAgentByUUID(LLUUID uuid)
41 {
42 try
43 {
44 return getUserByUUID(uuid).currentAgent;
45 }
46 catch (Exception e)
47 {
48 return null;
49 }
50 }
51
52 public UserAgentData getAgentByName(string name)
53 {
54 return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
55 }
56
57 public UserAgentData getAgentByName(string fname, string lname)
58 {
59 try
60 {
61 return getUserByName(fname,lname).currentAgent;
62 }
63 catch (Exception e)
64 {
65 return null;
66 }
67 }
68
69 public void addNewUserProfile(UserProfileData user)
70 {
71 manager.AddRow(user);
72 }
73
74 public void addNewUserAgent(UserAgentData agent)
75 {
76 // Do nothing. yet.
77 }
78
79 public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
80 {
81 return true;
82 }
83
84 public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
85 {
86 return true;
87 }
88
89
90 public string getName()
91 {
92 return "DB4o Userdata";
93 }
94
95 public string getVersion()
96 {
97 return "0.1";
98 }
99 }
100}
diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj b/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj
new file mode 100644
index 0000000..82d4f5f
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj
@@ -0,0 +1,111 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{39BD9497-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data.DB4o</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data.DB4o</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" >
78 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
84 <Name>OpenGrid.Framework.Data</Name>
85 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 </ItemGroup>
90 <ItemGroup>
91 <Compile Include="DB4oGridData.cs">
92 <SubType>Code</SubType>
93 </Compile>
94 <Compile Include="DB4oManager.cs">
95 <SubType>Code</SubType>
96 </Compile>
97 <Compile Include="DB4oUserData.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="Properties\AssemblyInfo.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 </ItemGroup>
104 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
105 <PropertyGroup>
106 <PreBuildEvent>
107 </PreBuildEvent>
108 <PostBuildEvent>
109 </PostBuildEvent>
110 </PropertyGroup>
111</Project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.user b/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
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
new file mode 100644
index 0000000..8e0f53a
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build
@@ -0,0 +1,47 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.Data.DB4o" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.Data.DB4o" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="DB4oGridData.cs" />
15 <include name="DB4oManager.cs" />
16 <include name="DB4oUserData.cs" />
17 <include name="Properties/AssemblyInfo.cs" />
18 </sources>
19 <references basedir="${project::get-base-directory()}">
20 <lib>
21 <include name="${project::get-base-directory()}" />
22 <include name="${project::get-base-directory()}/${build.dir}" />
23 </lib>
24 <include name="System.dll" />
25 <include name="System.Xml.dll" />
26 <include name="System.Data.dll" />
27 <include name="../../bin/OpenGrid.Framework.Data.dll" />
28 <include name="../../bin/libsecondlife.dll" />
29 <include name="../../bin/Db4objects.Db4o.dll" />
30 </references>
31 </csc>
32 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
33 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
34 <copy todir="${project::get-base-directory()}/../../bin/">
35 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
36 <include name="*.dll"/>
37 <include name="*.exe"/>
38 </fileset>
39 </copy>
40 </target>
41 <target name="clean">
42 <delete dir="${bin.dir}" failonerror="false" />
43 <delete dir="${obj.dir}" failonerror="false" />
44 </target>
45 <target name="doc" description="Creates documentation.">
46 </target>
47</project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..dc4a9a1
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.DB4o/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenGrid.Framework.Data.DB4o")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenGrid.Framework.Data.DB4o")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("57991e15-79da-41b7-aa06-2e6b49165a63")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLGridData.cs
new file mode 100644
index 0000000..0925df1
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLGridData.cs
@@ -0,0 +1,136 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenGrid.Framework.Data;
5
6namespace OpenGrid.Framework.Data.MSSQL
7{
8 public class SqlGridData : IGridData
9 {
10 private MSSqlManager database;
11
12 /// <summary>
13 /// Initialises the Grid Interface
14 /// </summary>
15 public void Initialise()
16 {
17 database = new MSSqlManager("localhost", "db", "user", "password", "false");
18 }
19
20 /// <summary>
21 /// Shuts down the grid interface
22 /// </summary>
23 public void Close()
24 {
25 database.Close();
26 }
27
28 public string getName()
29 {
30 return "Sql OpenGridData";
31 }
32
33 public string getVersion()
34 {
35 return "0.1";
36 }
37
38 public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
39 {
40 return null;
41 }
42
43 /// <summary>
44 /// Returns a sim profile from it's location
45 /// </summary>
46 /// <param name="handle">Region location handle</param>
47 /// <returns>Sim profile</returns>
48 public SimProfileData GetProfileByHandle(ulong handle)
49 {
50 Dictionary<string, string> param = new Dictionary<string, string>();
51 param["handle"] = handle.ToString();
52
53 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
54 System.Data.IDataReader reader = result.ExecuteReader();
55
56 SimProfileData row = database.getRow(reader);
57 reader.Close();
58 result.Dispose();
59
60 return row;
61 }
62
63 /// <summary>
64 /// Returns a sim profile from it's UUID
65 /// </summary>
66 /// <param name="uuid">The region UUID</param>
67 /// <returns>The sim profile</returns>
68 public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid)
69 {
70 Dictionary<string, string> param = new Dictionary<string, string>();
71 param["uuid"] = uuid.ToStringHyphenated();
72
73 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
74 System.Data.IDataReader reader = result.ExecuteReader();
75
76 SimProfileData row = database.getRow(reader);
77 reader.Close();
78 result.Dispose();
79
80 return row;
81 }
82
83 public DataResponse AddProfile(SimProfileData profile)
84 {
85 if (database.insertRow(profile))
86 {
87 return DataResponse.RESPONSE_OK;
88 }
89 else
90 {
91 return DataResponse.RESPONSE_ERROR;
92 }
93 }
94
95 /// <summary>
96 /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
97 /// </summary>
98 /// <param name="uuid">The UUID of the challenger</param>
99 /// <param name="handle">The attempted regionHandle of the challenger</param>
100 /// <param name="authkey">The secret</param>
101 /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
102 public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey)
103 {
104 bool throwHissyFit = false; // Should be true by 1.0
105
106 if (throwHissyFit)
107 throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
108
109 SimProfileData data = GetProfileByLLUUID(uuid);
110
111 return (handle == data.regionHandle && authkey == data.regionSecret);
112 }
113
114 /// <summary>
115 /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region
116 /// </summary>
117 /// <remarks>This requires a security audit.</remarks>
118 /// <param name="uuid"></param>
119 /// <param name="handle"></param>
120 /// <param name="authhash"></param>
121 /// <param name="challenge"></param>
122 /// <returns></returns>
123 public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge)
124 {
125 System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed();
126 System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding();
127
128 byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
129 byte[] hash = HashProvider.ComputeHash(stream);
130
131 return false;
132 }
133 }
134
135
136}
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs
new file mode 100644
index 0000000..12c166c
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs
@@ -0,0 +1,171 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Data;
5
6using System.Data.SqlClient;
7
8using OpenGrid.Framework.Data;
9
10namespace OpenGrid.Framework.Data.MSSQL
11{
12 class MSSqlManager
13 {
14 IDbConnection dbcon;
15
16 /// <summary>
17 /// Initialises and creates a new Sql connection and maintains it.
18 /// </summary>
19 /// <param name="hostname">The Sql server being connected to</param>
20 /// <param name="database">The name of the Sql database being used</param>
21 /// <param name="username">The username logging into the database</param>
22 /// <param name="password">The password for the user logging in</param>
23 /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param>
24 public MSSqlManager(string hostname, string database, string username, string password, string cpooling)
25 {
26 try
27 {
28 string connectionString = "Server=" + hostname + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";";
29 dbcon = new SqlConnection(connectionString);
30
31 dbcon.Open();
32 }
33 catch (Exception e)
34 {
35 throw new Exception("Error initialising Sql Database: " + e.ToString());
36 }
37 }
38
39 /// <summary>
40 /// Shuts down the database connection
41 /// </summary>
42 public void Close()
43 {
44 dbcon.Close();
45 dbcon = null;
46 }
47
48 /// <summary>
49 /// Runs a query with protection against SQL Injection by using parameterised input.
50 /// </summary>
51 /// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param>
52 /// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param>
53 /// <returns>A Sql DB Command</returns>
54 public IDbCommand Query(string sql, Dictionary<string, string> parameters)
55 {
56 SqlCommand dbcommand = (SqlCommand)dbcon.CreateCommand();
57 dbcommand.CommandText = sql;
58 foreach (KeyValuePair<string, string> param in parameters)
59 {
60 dbcommand.Parameters.AddWithValue(param.Key, param.Value);
61 }
62
63 return (IDbCommand)dbcommand;
64 }
65
66 public SimProfileData getRow(IDataReader reader)
67 {
68 SimProfileData retval = new SimProfileData();
69
70 if (reader.Read())
71 {
72 // Region Main
73 retval.regionHandle = (ulong)reader["regionHandle"];
74 retval.regionName = (string)reader["regionName"];
75 retval.UUID = new libsecondlife.LLUUID((string)reader["uuid"]);
76
77 // Secrets
78 retval.regionRecvKey = (string)reader["regionRecvKey"];
79 retval.regionSecret = (string)reader["regionSecret"];
80 retval.regionSendKey = (string)reader["regionSendKey"];
81
82 // Region Server
83 retval.regionDataURI = (string)reader["regionDataURI"];
84 retval.regionOnline = false; // Needs to be pinged before this can be set.
85 retval.serverIP = (string)reader["serverIP"];
86 retval.serverPort = (uint)reader["serverPort"];
87 retval.serverURI = (string)reader["serverURI"];
88
89 // Location
90 retval.regionLocX = (uint)((int)reader["locX"]);
91 retval.regionLocY = (uint)((int)reader["locY"]);
92 retval.regionLocZ = (uint)((int)reader["locZ"]);
93
94 // Neighbours - 0 = No Override
95 retval.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"];
96 retval.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"];
97 retval.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"];
98 retval.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"];
99
100 // Assets
101 retval.regionAssetURI = (string)reader["regionAssetURI"];
102 retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"];
103 retval.regionAssetSendKey = (string)reader["regionAssetSendKey"];
104
105 // Userserver
106 retval.regionUserURI = (string)reader["regionUserURI"];
107 retval.regionUserRecvKey = (string)reader["regionUserRecvKey"];
108 retval.regionUserSendKey = (string)reader["regionUserSendKey"];
109 }
110 else
111 {
112 throw new Exception("No rows to return");
113 }
114 return retval;
115 }
116
117 public bool insertRow(SimProfileData profile)
118 {
119 string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
120 sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
121 sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES ";
122
123 sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, ";
124 sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, ";
125 sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);";
126
127 Dictionary<string, string> parameters = new Dictionary<string, string>();
128
129 parameters["regionHandle"] = profile.regionHandle.ToString();
130 parameters["regionName"] = profile.regionName;
131 parameters["uuid"] = profile.UUID.ToString();
132 parameters["regionRecvKey"] = profile.regionRecvKey;
133 parameters["regionSendKey"] = profile.regionSendKey;
134 parameters["regionDataURI"] = profile.regionDataURI;
135 parameters["serverIP"] = profile.serverIP;
136 parameters["serverPort"] = profile.serverPort.ToString();
137 parameters["serverURI"] = profile.serverURI;
138 parameters["locX"] = profile.regionLocX.ToString();
139 parameters["locY"] = profile.regionLocY.ToString();
140 parameters["locZ"] = profile.regionLocZ.ToString();
141 parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString();
142 parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString();
143 parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString();
144 parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString();
145 parameters["regionAssetURI"] = profile.regionAssetURI;
146 parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey;
147 parameters["regionAssetSendKey"] = profile.regionAssetSendKey;
148 parameters["regionUserURI"] = profile.regionUserURI;
149 parameters["regionUserRecvKey"] = profile.regionUserRecvKey;
150 parameters["regionUserSendKey"] = profile.regionUserSendKey;
151
152 bool returnval = false;
153
154 try
155 {
156 IDbCommand result = Query(sql, parameters);
157
158 if (result.ExecuteNonQuery() == 1)
159 returnval = true;
160
161 result.Dispose();
162 }
163 catch (Exception e)
164 {
165 return false;
166 }
167
168 return returnval;
169 }
170 }
171}
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj
new file mode 100644
index 0000000..8d53692
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj
@@ -0,0 +1,104 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{0A563AC1-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data.MSSQL</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data.MSSQL</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 </ItemGroup>
78 <ItemGroup>
79 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
80 <Name>OpenGrid.Framework.Data</Name>
81 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
82 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
83 <Private>False</Private>
84 </ProjectReference>
85 </ItemGroup>
86 <ItemGroup>
87 <Compile Include="MSSQLGridData.cs">
88 <SubType>Code</SubType>
89 </Compile>
90 <Compile Include="MSSQLManager.cs">
91 <SubType>Code</SubType>
92 </Compile>
93 <Compile Include="Properties\AssemblyInfo.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 </ItemGroup>
97 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
98 <PropertyGroup>
99 <PreBuildEvent>
100 </PreBuildEvent>
101 <PostBuildEvent>
102 </PostBuildEvent>
103 </PropertyGroup>
104</Project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj.user b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
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
new file mode 100644
index 0000000..5b6b75b
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build
@@ -0,0 +1,45 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.Data.MSSQL" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.Data.MSSQL" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="MSSQLGridData.cs" />
15 <include name="MSSQLManager.cs" />
16 <include name="Properties/AssemblyInfo.cs" />
17 </sources>
18 <references basedir="${project::get-base-directory()}">
19 <lib>
20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib>
23 <include name="System.dll" />
24 <include name="System.Xml.dll" />
25 <include name="System.Data.dll" />
26 <include name="../../bin/OpenGrid.Framework.Data.dll" />
27 <include name="../../bin/libsecondlife.dll" />
28 </references>
29 </csc>
30 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
31 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
32 <copy todir="${project::get-base-directory()}/../../bin/">
33 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
34 <include name="*.dll"/>
35 <include name="*.exe"/>
36 </fileset>
37 </copy>
38 </target>
39 <target name="clean">
40 <delete dir="${bin.dir}" failonerror="false" />
41 <delete dir="${obj.dir}" failonerror="false" />
42 </target>
43 <target name="doc" description="Creates documentation.">
44 </target>
45</project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MSSQL/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..bbe3cdf
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MSSQL/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenGrid.Framework.Data.MSSQL")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenGrid.Framework.Data.MSSQL")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("0e1c1ca4-2cf2-4315-b0e7-432c02feea8a")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs
new file mode 100644
index 0000000..6ac8cc3
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs
@@ -0,0 +1,201 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenGrid.Framework.Data;
5
6namespace OpenGrid.Framework.Data.MySQL
7{
8 public class MySQLGridData : IGridData
9 {
10 private MySQLManager database;
11
12 /// <summary>
13 /// Initialises the Grid Interface
14 /// </summary>
15 public void Initialise()
16 {
17 IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
18 string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
19 string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
20 string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
21 string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
22 string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
23 string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
24
25 database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort);
26 }
27
28 /// <summary>
29 /// Shuts down the grid interface
30 /// </summary>
31 public void Close()
32 {
33 database.Close();
34 }
35
36 public string getName()
37 {
38 return "MySql OpenGridData";
39 }
40
41 public string getVersion()
42 {
43 return "0.1";
44 }
45
46 public SimProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax)
47 {
48 try
49 {
50 lock (database)
51 {
52 Dictionary<string, string> param = new Dictionary<string, string>();
53 param["?xmin"] = xmin.ToString();
54 param["?ymin"] = ymin.ToString();
55 param["?xmax"] = xmax.ToString();
56 param["?ymax"] = ymax.ToString();
57
58 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", param);
59 System.Data.IDataReader reader = result.ExecuteReader();
60
61 SimProfileData row;
62
63 List<SimProfileData> rows = new List<SimProfileData>();
64
65 while ((row = database.getSimRow(reader)) != null)
66 {
67 rows.Add(row);
68 }
69 reader.Close();
70 result.Dispose();
71
72 return rows.ToArray();
73
74 }
75 }
76 catch (Exception e)
77 {
78 Console.WriteLine(e.ToString());
79 return null;
80 }
81 }
82
83 /// <summary>
84 /// Returns a sim profile from it's location
85 /// </summary>
86 /// <param name="handle">Region location handle</param>
87 /// <returns>Sim profile</returns>
88 public SimProfileData GetProfileByHandle(ulong handle)
89 {
90 try
91 {
92 lock (database)
93 {
94 Dictionary<string, string> param = new Dictionary<string, string>();
95 param["?handle"] = handle.ToString();
96
97 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param);
98 System.Data.IDataReader reader = result.ExecuteReader();
99
100 SimProfileData row = database.getSimRow(reader);
101 reader.Close();
102 result.Dispose();
103
104 return row;
105 }
106 }
107 catch (Exception e)
108 {
109 Console.WriteLine(e.ToString());
110 return null;
111 }
112 }
113
114 /// <summary>
115 /// Returns a sim profile from it's UUID
116 /// </summary>
117 /// <param name="uuid">The region UUID</param>
118 /// <returns>The sim profile</returns>
119 public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid)
120 {
121 try
122 {
123 lock (database)
124 {
125 Dictionary<string, string> param = new Dictionary<string, string>();
126 param["?uuid"] = uuid.ToStringHyphenated();
127
128 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param);
129 System.Data.IDataReader reader = result.ExecuteReader();
130
131 SimProfileData row = database.getSimRow(reader);
132 reader.Close();
133 result.Dispose();
134
135 return row;
136 }
137 }
138 catch (Exception e)
139 {
140 Console.WriteLine(e.ToString());
141 return null;
142 }
143 }
144
145 public DataResponse AddProfile(SimProfileData profile)
146 {
147 lock (database)
148 {
149 if (database.insertRow(profile))
150 {
151 return DataResponse.RESPONSE_OK;
152 }
153 else
154 {
155 return DataResponse.RESPONSE_ERROR;
156 }
157 }
158 }
159
160 /// <summary>
161 /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
162 /// </summary>
163 /// <param name="uuid">The UUID of the challenger</param>
164 /// <param name="handle">The attempted regionHandle of the challenger</param>
165 /// <param name="authkey">The secret</param>
166 /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
167 public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey)
168 {
169 bool throwHissyFit = false; // Should be true by 1.0
170
171 if (throwHissyFit)
172 throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
173
174 SimProfileData data = GetProfileByLLUUID(uuid);
175
176 return (handle == data.regionHandle && authkey == data.regionSecret);
177 }
178
179 /// <summary>
180 /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region
181 /// </summary>
182 /// <remarks>This requires a security audit.</remarks>
183 /// <param name="uuid"></param>
184 /// <param name="handle"></param>
185 /// <param name="authhash"></param>
186 /// <param name="challenge"></param>
187 /// <returns></returns>
188 public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge)
189 {
190 System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed();
191 System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding();
192
193 byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
194 byte[] hash = HashProvider.ComputeHash(stream);
195
196 return false;
197 }
198 }
199
200
201}
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
new file mode 100644
index 0000000..ea7e2ac
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs
@@ -0,0 +1,270 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Data;
5
6// MySQL Native
7using MySql;
8using MySql.Data;
9using MySql.Data.Types;
10using MySql.Data.MySqlClient;
11
12using OpenGrid.Framework.Data;
13
14namespace OpenGrid.Framework.Data.MySQL
15{
16 class MySQLManager
17 {
18 IDbConnection dbcon;
19
20 /// <summary>
21 /// Initialises and creates a new MySQL connection and maintains it.
22 /// </summary>
23 /// <param name="hostname">The MySQL server being connected to</param>
24 /// <param name="database">The name of the MySQL database being used</param>
25 /// <param name="username">The username logging into the database</param>
26 /// <param name="password">The password for the user logging in</param>
27 /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param>
28 public MySQLManager(string hostname, string database, string username, string password, string cpooling, string port)
29 {
30 try
31 {
32 string connectionString = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";";
33 dbcon = new MySqlConnection(connectionString);
34
35 dbcon.Open();
36 }
37 catch (Exception e)
38 {
39 throw new Exception("Error initialising MySql Database: " + e.ToString());
40 }
41 }
42
43 /// <summary>
44 /// Shuts down the database connection
45 /// </summary>
46 public void Close()
47 {
48 dbcon.Close();
49 dbcon = null;
50 }
51
52 /// <summary>
53 /// Runs a query with protection against SQL Injection by using parameterised input.
54 /// </summary>
55 /// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param>
56 /// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param>
57 /// <returns>A MySQL DB Command</returns>
58 public IDbCommand Query(string sql, Dictionary<string, string> parameters)
59 {
60 try
61 {
62 MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand();
63 dbcommand.CommandText = sql;
64 foreach (KeyValuePair<string, string> param in parameters)
65 {
66 dbcommand.Parameters.Add(param.Key, param.Value);
67 }
68
69 return (IDbCommand)dbcommand;
70 }
71 catch (Exception e)
72 {
73 Console.WriteLine("Failed during Query generation: " + e.ToString());
74 return null;
75 }
76 }
77
78 public SimProfileData getSimRow(IDataReader reader)
79 {
80 SimProfileData retval = new SimProfileData();
81
82 if (reader.Read())
83 {
84 // Region Main
85 retval.regionHandle = Convert.ToUInt64(reader["regionHandle"].ToString());
86 retval.regionName = (string)reader["regionName"];
87 retval.UUID = new libsecondlife.LLUUID((string)reader["uuid"]);
88
89 // Secrets
90 retval.regionRecvKey = (string)reader["regionRecvKey"];
91 retval.regionSecret = (string)reader["regionSecret"];
92 retval.regionSendKey = (string)reader["regionSendKey"];
93
94 // Region Server
95 retval.regionDataURI = (string)reader["regionDataURI"];
96 retval.regionOnline = false; // Needs to be pinged before this can be set.
97 retval.serverIP = (string)reader["serverIP"];
98 retval.serverPort = (uint)reader["serverPort"];
99 retval.serverURI = (string)reader["serverURI"];
100
101 // Location
102 retval.regionLocX = Convert.ToUInt32(reader["locX"].ToString());
103 retval.regionLocY = Convert.ToUInt32(reader["locY"].ToString());
104 retval.regionLocZ = Convert.ToUInt32(reader["locZ"].ToString());
105
106 // Neighbours - 0 = No Override
107 retval.regionEastOverrideHandle = Convert.ToUInt64(reader["eastOverrideHandle"].ToString());
108 retval.regionWestOverrideHandle = Convert.ToUInt64(reader["westOverrideHandle"].ToString());
109 retval.regionSouthOverrideHandle = Convert.ToUInt64(reader["southOverrideHandle"].ToString());
110 retval.regionNorthOverrideHandle = Convert.ToUInt64(reader["northOverrideHandle"].ToString());
111
112 // Assets
113 retval.regionAssetURI = (string)reader["regionAssetURI"];
114 retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"];
115 retval.regionAssetSendKey = (string)reader["regionAssetSendKey"];
116
117 // Userserver
118 retval.regionUserURI = (string)reader["regionUserURI"];
119 retval.regionUserRecvKey = (string)reader["regionUserRecvKey"];
120 retval.regionUserSendKey = (string)reader["regionUserSendKey"];
121
122 // World Map Addition
123 retval.regionMapTextureID = new libsecondlife.LLUUID((string)reader["regionMapTexture"]);
124 }
125 else
126 {
127 return null;
128 }
129 return retval;
130 }
131
132 public UserAgentData getAgentRow(IDataReader reader)
133 {
134 UserAgentData retval = new UserAgentData();
135
136 if (reader.Read())
137 {
138 // Agent IDs
139 retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]);
140 retval.sessionID = new libsecondlife.LLUUID((string)reader["sessionID"]);
141 retval.secureSessionID = new libsecondlife.LLUUID((string)reader["secureSessionID"]);
142
143 // Agent Who?
144 retval.agentIP = (string)reader["agentIP"];
145 retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString());
146 retval.agentOnline = Convert.ToBoolean(reader["agentOnline"].ToString());
147
148 // Login/Logout times (UNIX Epoch)
149 retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString());
150 retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString());
151
152 // Current position
153 retval.currentRegion = (string)reader["currentRegion"];
154 retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString());
155 libsecondlife.LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos);
156 }
157 else
158 {
159 return null;
160 }
161 return retval;
162 }
163
164 public UserProfileData getUserRow(IDataReader reader)
165 {
166 UserProfileData retval = new UserProfileData();
167
168 if (reader.Read())
169 {
170 retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]);
171 retval.username = (string)reader["username"];
172 retval.surname = (string)reader["lastname"];
173
174 retval.passwordHash = (string)reader["passwordHash"];
175 retval.passwordSalt = (string)reader["passwordSalt"];
176
177 retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
178 retval.homeLocation = new libsecondlife.LLVector3(
179 Convert.ToSingle(reader["homeLocationX"].ToString()),
180 Convert.ToSingle(reader["homeLocationY"].ToString()),
181 Convert.ToSingle(reader["homeLocationZ"].ToString()));
182 retval.homeLookAt = new libsecondlife.LLVector3(
183 Convert.ToSingle(reader["homeLookAtX"].ToString()),
184 Convert.ToSingle(reader["homeLookAtY"].ToString()),
185 Convert.ToSingle(reader["homeLookAtZ"].ToString()));
186
187 retval.created = Convert.ToInt32(reader["created"].ToString());
188 retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
189
190 retval.userInventoryURI = (string)reader["userInventoryURI"];
191 retval.userAssetURI = (string)reader["userAssetURI"];
192
193 retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString());
194 retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString());
195
196 retval.profileAboutText = (string)reader["profileAboutText"];
197 retval.profileFirstText = (string)reader["profileFirstText"];
198
199 retval.profileImage = new libsecondlife.LLUUID((string)reader["profileImage"]);
200 retval.profileFirstImage = new libsecondlife.LLUUID((string)reader["profileFirstImage"]);
201
202 }
203 else
204 {
205 return null;
206 }
207 return retval;
208 }
209
210 public bool insertRow(SimProfileData profile)
211 {
212 string sql = "REPLACE INTO regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
213 sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
214 sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture) VALUES ";
215
216 sql += "(?regionHandle, ?regionName, ?uuid, ?regionRecvKey, ?regionSecret, ?regionSendKey, ?regionDataURI, ";
217 sql += "?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, ";
218 sql += "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture);";
219
220 Dictionary<string, string> parameters = new Dictionary<string, string>();
221
222 parameters["?regionHandle"] = profile.regionHandle.ToString();
223 parameters["?regionName"] = profile.regionName.ToString();
224 parameters["?uuid"] = profile.UUID.ToStringHyphenated();
225 parameters["?regionRecvKey"] = profile.regionRecvKey.ToString();
226 parameters["?regionSecret"] = profile.regionSecret.ToString();
227 parameters["?regionSendKey"] = profile.regionSendKey.ToString();
228 parameters["?regionDataURI"] = profile.regionDataURI.ToString();
229 parameters["?serverIP"] = profile.serverIP.ToString();
230 parameters["?serverPort"] = profile.serverPort.ToString();
231 parameters["?serverURI"] = profile.serverURI.ToString();
232 parameters["?locX"] = profile.regionLocX.ToString();
233 parameters["?locY"] = profile.regionLocY.ToString();
234 parameters["?locZ"] = profile.regionLocZ.ToString();
235 parameters["?eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString();
236 parameters["?westOverrideHandle"] = profile.regionWestOverrideHandle.ToString();
237 parameters["?northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString();
238 parameters["?southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString();
239 parameters["?regionAssetURI"] = profile.regionAssetURI.ToString();
240 parameters["?regionAssetRecvKey"] = profile.regionAssetRecvKey.ToString();
241 parameters["?regionAssetSendKey"] = profile.regionAssetSendKey.ToString();
242 parameters["?regionUserURI"] = profile.regionUserURI.ToString();
243 parameters["?regionUserRecvKey"] = profile.regionUserRecvKey.ToString();
244 parameters["?regionUserSendKey"] = profile.regionUserSendKey.ToString();
245 parameters["?regionMapTexture"] = profile.regionMapTextureID.ToStringHyphenated();
246
247 bool returnval = false;
248
249 try
250 {
251
252 IDbCommand result = Query(sql, parameters);
253
254 //Console.WriteLine(result.CommandText);
255
256 if (result.ExecuteNonQuery() == 1)
257 returnval = true;
258
259 result.Dispose();
260 }
261 catch (Exception e)
262 {
263 Console.WriteLine(e.ToString());
264 return false;
265 }
266
267 return returnval;
268 }
269 }
270}
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs
new file mode 100644
index 0000000..57dbfc6
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs
@@ -0,0 +1,153 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenGrid.Framework.Data;
5using libsecondlife;
6
7namespace OpenGrid.Framework.Data.MySQL
8{
9 class MySQLUserData : IUserData
10 {
11 public MySQLManager database;
12
13 public void Initialise()
14 {
15 IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
16 string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
17 string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
18 string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
19 string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
20 string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
21 string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
22
23 database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort);
24 }
25
26 public UserProfileData getUserByName(string name)
27 {
28 return getUserByName(name.Split(' ')[0], name.Split(' ')[1]);
29 }
30
31 public UserProfileData getUserByName(string user, string last)
32 {
33 try
34 {
35 lock (database)
36 {
37 Dictionary<string, string> param = new Dictionary<string, string>();
38 param["?first"] = user;
39 param["?second"] = last;
40
41 System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE username = ?first AND lastname = ?second", param);
42 System.Data.IDataReader reader = result.ExecuteReader();
43
44 UserProfileData row = database.getUserRow(reader);
45
46 reader.Close();
47 result.Dispose();
48
49 return row;
50 }
51 }
52 catch (Exception e)
53 {
54 Console.WriteLine(e.ToString());
55 return null;
56 }
57 }
58
59 public UserProfileData getUserByUUID(LLUUID uuid)
60 {
61 try
62 {
63 lock (database)
64 {
65 Dictionary<string, string> param = new Dictionary<string, string>();
66 param["?uuid"] = uuid.ToStringHyphenated();
67
68 System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE UUID = ?uuid", param);
69 System.Data.IDataReader reader = result.ExecuteReader();
70
71 UserProfileData row = database.getUserRow(reader);
72
73 reader.Close();
74 result.Dispose();
75
76 return row;
77 }
78 }
79 catch (Exception e)
80 {
81 Console.WriteLine(e.ToString());
82 return null;
83 }
84 }
85
86 public UserAgentData getAgentByName(string name)
87 {
88 return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
89 }
90
91 public UserAgentData getAgentByName(string user, string last)
92 {
93 UserProfileData profile = getUserByName(user, last);
94 return getAgentByUUID(profile.UUID);
95 }
96
97 public UserAgentData getAgentByUUID(LLUUID uuid)
98 {
99 try
100 {
101 lock (database)
102 {
103 Dictionary<string, string> param = new Dictionary<string, string>();
104 param["?uuid"] = uuid.ToStringHyphenated();
105
106 System.Data.IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param);
107 System.Data.IDataReader reader = result.ExecuteReader();
108
109 UserAgentData row = database.getAgentRow(reader);
110
111 reader.Close();
112 result.Dispose();
113
114 return row;
115 }
116 }
117 catch (Exception e)
118 {
119 Console.WriteLine(e.ToString());
120 return null;
121 }
122 }
123
124 public void addNewUserProfile(UserProfileData user)
125 {
126 }
127
128 public void addNewUserAgent(UserAgentData agent)
129 {
130 // Do nothing.
131 }
132
133 public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
134 {
135 return false;
136 }
137
138 public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
139 {
140 return false;
141 }
142
143 public string getName()
144 {
145 return "MySQL Userdata Interface";
146 }
147
148 public string getVersion()
149 {
150 return "0.1";
151 }
152 }
153}
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj b/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj
new file mode 100644
index 0000000..9a1703a
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj
@@ -0,0 +1,111 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{0F3C3AC1-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data.MySQL</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data.MySQL</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="MySql.Data.dll" >
78 <HintPath>..\..\bin\MySql.Data.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
84 <Name>OpenGrid.Framework.Data</Name>
85 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 </ItemGroup>
90 <ItemGroup>
91 <Compile Include="MySQLGridData.cs">
92 <SubType>Code</SubType>
93 </Compile>
94 <Compile Include="MySQLManager.cs">
95 <SubType>Code</SubType>
96 </Compile>
97 <Compile Include="MySQLUserData.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="Properties\AssemblyInfo.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 </ItemGroup>
104 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
105 <PropertyGroup>
106 <PreBuildEvent>
107 </PreBuildEvent>
108 <PostBuildEvent>
109 </PostBuildEvent>
110 </PropertyGroup>
111</Project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj.user b/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
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
new file mode 100644
index 0000000..2d425b4
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build
@@ -0,0 +1,47 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.Data.MySQL" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.Data.MySQL" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="MySQLGridData.cs" />
15 <include name="MySQLManager.cs" />
16 <include name="MySQLUserData.cs" />
17 <include name="Properties/AssemblyInfo.cs" />
18 </sources>
19 <references basedir="${project::get-base-directory()}">
20 <lib>
21 <include name="${project::get-base-directory()}" />
22 <include name="${project::get-base-directory()}/${build.dir}" />
23 </lib>
24 <include name="System.dll" />
25 <include name="System.Xml.dll" />
26 <include name="System.Data.dll" />
27 <include name="../../bin/OpenGrid.Framework.Data.dll" />
28 <include name="../../bin/libsecondlife.dll" />
29 <include name="../../bin/MySql.Data.dll" />
30 </references>
31 </csc>
32 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
33 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
34 <copy todir="${project::get-base-directory()}/../../bin/">
35 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
36 <include name="*.dll"/>
37 <include name="*.exe"/>
38 </fileset>
39 </copy>
40 </target>
41 <target name="clean">
42 <delete dir="${bin.dir}" failonerror="false" />
43 <delete dir="${obj.dir}" failonerror="false" />
44 </target>
45 <target name="doc" description="Creates documentation.">
46 </target>
47</project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..0bfd1d6
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenGrid.Framework.Data.MySQL")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenGrid.Framework.Data.MySQL")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("e49826b2-dcef-41be-a5bd-596733fa3304")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[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
new file mode 100644
index 0000000..463cf86
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.csproj
@@ -0,0 +1,108 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{1E3F341A-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data.SQLite</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data.SQLite</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="System.Data.SQLite.dll" >
74 <HintPath>..\..\bin\System.Data.SQLite.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="libsecondlife.dll" >
78 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
84 <Name>OpenGrid.Framework.Data</Name>
85 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 </ItemGroup>
90 <ItemGroup>
91 <Compile Include="SQLiteGridData.cs">
92 <SubType>Code</SubType>
93 </Compile>
94 <Compile Include="SQLiteManager.cs">
95 <SubType>Code</SubType>
96 </Compile>
97 <Compile Include="Properties\AssemblyInfo.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 </ItemGroup>
101 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
102 <PropertyGroup>
103 <PreBuildEvent>
104 </PreBuildEvent>
105 <PostBuildEvent>
106 </PostBuildEvent>
107 </PropertyGroup>
108</Project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.csproj.user b/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
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
new file mode 100644
index 0000000..1be9b43
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build
@@ -0,0 +1,46 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.Data.SQLite" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.Data.SQLite" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="SQLiteGridData.cs" />
15 <include name="SQLiteManager.cs" />
16 <include name="Properties/AssemblyInfo.cs" />
17 </sources>
18 <references basedir="${project::get-base-directory()}">
19 <lib>
20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib>
23 <include name="System.dll" />
24 <include name="System.Xml.dll" />
25 <include name="System.Data.dll" />
26 <include name="../../bin/System.Data.SQLite.dll" />
27 <include name="../../bin/OpenGrid.Framework.Data.dll" />
28 <include name="../../bin/libsecondlife.dll" />
29 </references>
30 </csc>
31 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
32 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
33 <copy todir="${project::get-base-directory()}/../../bin/">
34 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
35 <include name="*.dll"/>
36 <include name="*.exe"/>
37 </fileset>
38 </copy>
39 </target>
40 <target name="clean">
41 <delete dir="${bin.dir}" failonerror="false" />
42 <delete dir="${obj.dir}" failonerror="false" />
43 </target>
44 <target name="doc" description="Creates documentation.">
45 </target>
46</project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data.SQLite/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Framework.Data.SQLite/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..57c4bae
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.SQLite/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenGrid.Framework.Data.SQLite")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenGrid.Framework.Data.SQLite")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("6113d5ce-4547-49f4-9236-0dcc503457b1")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteGridData.cs
new file mode 100644
index 0000000..4850f12
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteGridData.cs
@@ -0,0 +1,136 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenGrid.Framework.Data;
5
6namespace OpenGrid.Framework.Data.SQLite
7{
8 public class SQLiteGridData : IGridData
9 {
10 private SQLiteManager database;
11
12 /// <summary>
13 /// Initialises the Grid Interface
14 /// </summary>
15 public void Initialise()
16 {
17 database = new SQLiteManager("localhost", "db", "user", "password", "false");
18 }
19
20 /// <summary>
21 /// Shuts down the grid interface
22 /// </summary>
23 public void Close()
24 {
25 database.Close();
26 }
27
28 public string getName()
29 {
30 return "SQLite OpenGridData";
31 }
32
33 public string getVersion()
34 {
35 return "0.1";
36 }
37
38 public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
39 {
40 return null;
41 }
42
43 /// <summary>
44 /// Returns a sim profile from it's location
45 /// </summary>
46 /// <param name="handle">Region location handle</param>
47 /// <returns>Sim profile</returns>
48 public SimProfileData GetProfileByHandle(ulong handle)
49 {
50 Dictionary<string, string> param = new Dictionary<string, string>();
51 param["handle"] = handle.ToString();
52
53 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
54 System.Data.IDataReader reader = result.ExecuteReader();
55
56 SimProfileData row = database.getRow(reader);
57 reader.Close();
58 result.Dispose();
59
60 return row;
61 }
62
63 /// <summary>
64 /// Returns a sim profile from it's UUID
65 /// </summary>
66 /// <param name="uuid">The region UUID</param>
67 /// <returns>The sim profile</returns>
68 public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid)
69 {
70 Dictionary<string, string> param = new Dictionary<string, string>();
71 param["uuid"] = uuid.ToStringHyphenated();
72
73 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
74 System.Data.IDataReader reader = result.ExecuteReader();
75
76 SimProfileData row = database.getRow(reader);
77 reader.Close();
78 result.Dispose();
79
80 return row;
81 }
82
83 public DataResponse AddProfile(SimProfileData profile)
84 {
85 if (database.insertRow(profile))
86 {
87 return DataResponse.RESPONSE_OK;
88 }
89 else
90 {
91 return DataResponse.RESPONSE_ERROR;
92 }
93 }
94
95 /// <summary>
96 /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
97 /// </summary>
98 /// <param name="uuid">The UUID of the challenger</param>
99 /// <param name="handle">The attempted regionHandle of the challenger</param>
100 /// <param name="authkey">The secret</param>
101 /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
102 public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey)
103 {
104 bool throwHissyFit = false; // Should be true by 1.0
105
106 if (throwHissyFit)
107 throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
108
109 SimProfileData data = GetProfileByLLUUID(uuid);
110
111 return (handle == data.regionHandle && authkey == data.regionSecret);
112 }
113
114 /// <summary>
115 /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region
116 /// </summary>
117 /// <remarks>This requires a security audit.</remarks>
118 /// <param name="uuid"></param>
119 /// <param name="handle"></param>
120 /// <param name="authhash"></param>
121 /// <param name="challenge"></param>
122 /// <returns></returns>
123 public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge)
124 {
125 System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed();
126 System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding();
127
128 byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
129 byte[] hash = HashProvider.ComputeHash(stream);
130
131 return false;
132 }
133 }
134
135
136}
diff --git a/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteManager.cs b/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteManager.cs
new file mode 100644
index 0000000..408a582
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data.SQLite/SQLiteManager.cs
@@ -0,0 +1,172 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Data;
5
6using System.Data.SQLite;
7
8using OpenGrid.Framework.Data;
9
10namespace OpenGrid.Framework.Data.SQLite
11{
12 class SQLiteManager
13 {
14 IDbConnection dbcon;
15
16 /// <summary>
17 /// Initialises and creates a new SQLite connection and maintains it.
18 /// </summary>
19 /// <param name="hostname">The SQLite server being connected to</param>
20 /// <param name="database">The name of the SQLite database being used</param>
21 /// <param name="username">The username logging into the database</param>
22 /// <param name="password">The password for the user logging in</param>
23 /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param>
24 public SQLiteManager(string hostname, string database, string username, string password, string cpooling)
25 {
26 try
27 {
28 string connectionString = "URI=file:GridServerSqlite.db;";
29 dbcon = new SQLiteConnection(connectionString);
30
31 dbcon.Open();
32 }
33 catch (Exception e)
34 {
35 throw new Exception("Error initialising SQLite Database: " + e.ToString());
36 }
37 }
38
39 /// <summary>
40 /// Shuts down the database connection
41 /// </summary>
42 public void Close()
43 {
44 dbcon.Close();
45 dbcon = null;
46 }
47
48 /// <summary>
49 /// Runs a query with protection against SQL Injection by using parameterised input.
50 /// </summary>
51 /// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param>
52 /// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param>
53 /// <returns>A SQLite DB Command</returns>
54 public IDbCommand Query(string sql, Dictionary<string, string> parameters)
55 {
56 SQLiteCommand dbcommand = (SQLiteCommand)dbcon.CreateCommand();
57 dbcommand.CommandText = sql;
58 foreach (KeyValuePair<string, string> param in parameters)
59 {
60 SQLiteParameter paramx = new SQLiteParameter(param.Key,param.Value);
61 dbcommand.Parameters.Add(paramx);
62 }
63
64 return (IDbCommand)dbcommand;
65 }
66
67 public SimProfileData getRow(IDataReader reader)
68 {
69 SimProfileData retval = new SimProfileData();
70
71 if (reader.Read())
72 {
73 // Region Main
74 retval.regionHandle = (ulong)reader["regionHandle"];
75 retval.regionName = (string)reader["regionName"];
76 retval.UUID = new libsecondlife.LLUUID((string)reader["uuid"]);
77
78 // Secrets
79 retval.regionRecvKey = (string)reader["regionRecvKey"];
80 retval.regionSecret = (string)reader["regionSecret"];
81 retval.regionSendKey = (string)reader["regionSendKey"];
82
83 // Region Server
84 retval.regionDataURI = (string)reader["regionDataURI"];
85 retval.regionOnline = false; // Needs to be pinged before this can be set.
86 retval.serverIP = (string)reader["serverIP"];
87 retval.serverPort = (uint)reader["serverPort"];
88 retval.serverURI = (string)reader["serverURI"];
89
90 // Location
91 retval.regionLocX = (uint)((int)reader["locX"]);
92 retval.regionLocY = (uint)((int)reader["locY"]);
93 retval.regionLocZ = (uint)((int)reader["locZ"]);
94
95 // Neighbours - 0 = No Override
96 retval.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"];
97 retval.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"];
98 retval.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"];
99 retval.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"];
100
101 // Assets
102 retval.regionAssetURI = (string)reader["regionAssetURI"];
103 retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"];
104 retval.regionAssetSendKey = (string)reader["regionAssetSendKey"];
105
106 // Userserver
107 retval.regionUserURI = (string)reader["regionUserURI"];
108 retval.regionUserRecvKey = (string)reader["regionUserRecvKey"];
109 retval.regionUserSendKey = (string)reader["regionUserSendKey"];
110 }
111 else
112 {
113 throw new Exception("No rows to return");
114 }
115 return retval;
116 }
117
118 public bool insertRow(SimProfileData profile)
119 {
120 string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
121 sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
122 sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES ";
123
124 sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, ";
125 sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, ";
126 sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);";
127
128 Dictionary<string, string> parameters = new Dictionary<string, string>();
129
130 parameters["regionHandle"] = profile.regionHandle.ToString();
131 parameters["regionName"] = profile.regionName;
132 parameters["uuid"] = profile.UUID.ToString();
133 parameters["regionRecvKey"] = profile.regionRecvKey;
134 parameters["regionSendKey"] = profile.regionSendKey;
135 parameters["regionDataURI"] = profile.regionDataURI;
136 parameters["serverIP"] = profile.serverIP;
137 parameters["serverPort"] = profile.serverPort.ToString();
138 parameters["serverURI"] = profile.serverURI;
139 parameters["locX"] = profile.regionLocX.ToString();
140 parameters["locY"] = profile.regionLocY.ToString();
141 parameters["locZ"] = profile.regionLocZ.ToString();
142 parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString();
143 parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString();
144 parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString();
145 parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString();
146 parameters["regionAssetURI"] = profile.regionAssetURI;
147 parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey;
148 parameters["regionAssetSendKey"] = profile.regionAssetSendKey;
149 parameters["regionUserURI"] = profile.regionUserURI;
150 parameters["regionUserRecvKey"] = profile.regionUserRecvKey;
151 parameters["regionUserSendKey"] = profile.regionUserSendKey;
152
153 bool returnval = false;
154
155 try
156 {
157 IDbCommand result = Query(sql, parameters);
158
159 if (result.ExecuteNonQuery() == 1)
160 returnval = true;
161
162 result.Dispose();
163 }
164 catch (Exception e)
165 {
166 return false;
167 }
168
169 return returnval;
170 }
171 }
172}
diff --git a/OpenGridServices/OpenGrid.Framework.Data/GridData.cs b/OpenGridServices/OpenGrid.Framework.Data/GridData.cs
new file mode 100644
index 0000000..6dad37e
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data/GridData.cs
@@ -0,0 +1,83 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenGrid.Framework.Data
6{
7 public enum DataResponse
8 {
9 RESPONSE_OK,
10 RESPONSE_AUTHREQUIRED,
11 RESPONSE_INVALIDCREDENTIALS,
12 RESPONSE_ERROR
13 }
14
15 /// <summary>
16 /// A standard grid interface
17 /// </summary>
18 public interface IGridData
19 {
20 /// <summary>
21 /// Returns a sim profile from a regionHandle
22 /// </summary>
23 /// <param name="regionHandle">A 64bit Region Handle</param>
24 /// <returns>A simprofile</returns>
25 SimProfileData GetProfileByHandle(ulong regionHandle);
26
27 /// <summary>
28 /// Returns a sim profile from a UUID
29 /// </summary>
30 /// <param name="UUID">A 128bit UUID</param>
31 /// <returns>A sim profile</returns>
32 SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID UUID);
33
34 /// <summary>
35 /// Returns all profiles within the specified range
36 /// </summary>
37 /// <param name="Xmin">Minimum sim coordinate (X)</param>
38 /// <param name="Ymin">Minimum sim coordinate (Y)</param>
39 /// <param name="Xmax">Maximum sim coordinate (X)</param>
40 /// <param name="Ymin">Maximum sim coordinate (Y)</param>
41 /// <returns>An array containing all the sim profiles in the specified range</returns>
42 SimProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax);
43
44 /// <summary>
45 /// Authenticates a sim by use of it's recv key.
46 /// WARNING: Insecure
47 /// </summary>
48 /// <param name="UUID">The UUID sent by the sim</param>
49 /// <param name="regionHandle">The regionhandle sent by the sim</param>
50 /// <param name="simrecvkey">The recieving key sent by the sim</param>
51 /// <returns>Whether the sim has been authenticated</returns>
52 bool AuthenticateSim(libsecondlife.LLUUID UUID, ulong regionHandle, string simrecvkey);
53
54 /// <summary>
55 /// Initialises the interface
56 /// </summary>
57 void Initialise();
58
59 /// <summary>
60 /// Closes the interface
61 /// </summary>
62 void Close();
63
64 /// <summary>
65 /// The plugin being loaded
66 /// </summary>
67 /// <returns>A string containing the plugin name</returns>
68 string getName();
69
70 /// <summary>
71 /// The plugins version
72 /// </summary>
73 /// <returns>A string containing the plugin version</returns>
74 string getVersion();
75
76 /// <summary>
77 /// Adds a new profile to the database
78 /// </summary>
79 /// <param name="profile">The profile to add</param>
80 /// <returns>RESPONSE_OK if successful, error if not.</returns>
81 DataResponse AddProfile(SimProfileData profile);
82 }
83}
diff --git a/OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs b/OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs
new file mode 100644
index 0000000..58597d2
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data/IniConfig.cs
@@ -0,0 +1,73 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.IO;
5using System.Text.RegularExpressions;
6
7/*
8 Taken from public code listing at by Alex Pinsker
9 http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html
10 */
11
12namespace OpenGrid.Framework.Data
13{
14 /// <summary>
15 /// Parse settings from ini-like files
16 /// </summary>
17 public class IniFile
18 {
19 static IniFile()
20 {
21 _iniKeyValuePatternRegex = new Regex(
22 @"((\s)*(?<Key>([^\=^\s^\n]+))[\s^\n]*
23 # key part (surrounding whitespace stripped)
24 \=
25 (\s)*(?<Value>([^\n^\s]+(\n){0,1})))
26 # value part (surrounding whitespace stripped)
27 ",
28 RegexOptions.IgnorePatternWhitespace |
29 RegexOptions.Compiled |
30 RegexOptions.CultureInvariant);
31 }
32 static private Regex _iniKeyValuePatternRegex;
33
34 public IniFile(string iniFileName)
35 {
36 _iniFileName = iniFileName;
37 }
38
39 public string ParseFileReadValue(string key)
40 {
41 using (StreamReader reader =
42 new StreamReader(_iniFileName))
43 {
44 do
45 {
46 string line = reader.ReadLine();
47 Match match =
48 _iniKeyValuePatternRegex.Match(line);
49 if (match.Success)
50 {
51 string currentKey =
52 match.Groups["Key"].Value as string;
53 if (currentKey != null &&
54 currentKey.Trim().CompareTo(key) == 0)
55 {
56 string value =
57 match.Groups["Value"].Value as string;
58 return value;
59 }
60 }
61
62 }
63 while (reader.Peek() != -1);
64 }
65 return null;
66 }
67
68 public string IniFileName
69 {
70 get { return _iniFileName; }
71 } private string _iniFileName;
72 }
73}
diff --git a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj
new file mode 100644
index 0000000..b033c6c
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj
@@ -0,0 +1,107 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{62CDF671-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Data</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Data</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 </ItemGroup>
78 <ItemGroup>
79 </ItemGroup>
80 <ItemGroup>
81 <Compile Include="GridData.cs">
82 <SubType>Code</SubType>
83 </Compile>
84 <Compile Include="IniConfig.cs">
85 <SubType>Code</SubType>
86 </Compile>
87 <Compile Include="SimProfileData.cs">
88 <SubType>Code</SubType>
89 </Compile>
90 <Compile Include="UserData.cs">
91 <SubType>Code</SubType>
92 </Compile>
93 <Compile Include="UserProfileData.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 <Compile Include="Properties\AssemblyInfo.cs">
97 <SubType>Code</SubType>
98 </Compile>
99 </ItemGroup>
100 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
101 <PropertyGroup>
102 <PreBuildEvent>
103 </PreBuildEvent>
104 <PostBuildEvent>
105 </PostBuildEvent>
106 </PropertyGroup>
107</Project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.user b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build
new file mode 100644
index 0000000..281295f
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build
@@ -0,0 +1,47 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.Data" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.Data" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="GridData.cs" />
15 <include name="IniConfig.cs" />
16 <include name="SimProfileData.cs" />
17 <include name="UserData.cs" />
18 <include name="UserProfileData.cs" />
19 <include name="Properties/AssemblyInfo.cs" />
20 </sources>
21 <references basedir="${project::get-base-directory()}">
22 <lib>
23 <include name="${project::get-base-directory()}" />
24 <include name="${project::get-base-directory()}/${build.dir}" />
25 </lib>
26 <include name="System.dll" />
27 <include name="System.Xml.dll" />
28 <include name="System.Data.dll" />
29 <include name="../../bin/libsecondlife.dll" />
30 </references>
31 </csc>
32 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
33 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
34 <copy todir="${project::get-base-directory()}/../../bin/">
35 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
36 <include name="*.dll"/>
37 <include name="*.exe"/>
38 </fileset>
39 </copy>
40 </target>
41 <target name="clean">
42 <delete dir="${bin.dir}" failonerror="false" />
43 <delete dir="${obj.dir}" failonerror="false" />
44 </target>
45 <target name="doc" description="Creates documentation.">
46 </target>
47</project>
diff --git a/OpenGridServices/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..1446673
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenGrid.Framework.Data")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenGrid.Framework.Data")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("3a711c34-b0c0-4264-b0fe-f366eabf9d7b")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs b/OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs
new file mode 100644
index 0000000..c66610e
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data/SimProfileData.cs
@@ -0,0 +1,84 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenGrid.Framework.Data
6{
7 public class SimProfileData
8 {
9 /// <summary>
10 /// The name of the region
11 /// </summary>
12 public string regionName = "";
13
14 /// <summary>
15 /// A 64-bit number combining map position into a (mostly) unique ID
16 /// </summary>
17 public ulong regionHandle;
18
19 /// <summary>
20 /// OGS/OpenSim Specific ID for a region
21 /// </summary>
22 public libsecondlife.LLUUID UUID;
23
24 /// <summary>
25 /// Coordinates of the region
26 /// </summary>
27 public uint regionLocX;
28 public uint regionLocY;
29 public uint regionLocZ; // Reserved (round-robin, layers, etc)
30
31 /// <summary>
32 /// Authentication secrets
33 /// </summary>
34 /// <remarks>Not very secure, needs improvement.</remarks>
35 public string regionSendKey = "";
36 public string regionRecvKey = "";
37 public string regionSecret = "";
38
39 /// <summary>
40 /// Whether the region is online
41 /// </summary>
42 public bool regionOnline;
43
44 /// <summary>
45 /// Information about the server that the region is currently hosted on
46 /// </summary>
47 public string serverIP = "";
48 public uint serverPort;
49 public string serverURI = "";
50
51 /// <summary>
52 /// Set of optional overrides. Can be used to create non-eulicidean spaces.
53 /// </summary>
54 public ulong regionNorthOverrideHandle;
55 public ulong regionSouthOverrideHandle;
56 public ulong regionEastOverrideHandle;
57 public ulong regionWestOverrideHandle;
58
59 /// <summary>
60 /// Optional: URI Location of the region database
61 /// </summary>
62 /// <remarks>Used for floating sim pools where the region data is not nessecarily coupled to a specific server</remarks>
63 public string regionDataURI = "";
64
65 /// <summary>
66 /// Region Asset Details
67 /// </summary>
68 public string regionAssetURI = "";
69 public string regionAssetSendKey = "";
70 public string regionAssetRecvKey = "";
71
72 /// <summary>
73 /// Region Userserver Details
74 /// </summary>
75 public string regionUserURI = "";
76 public string regionUserSendKey = "";
77 public string regionUserRecvKey = "";
78
79 /// <summary>
80 /// Region Map Texture Asset
81 /// </summary>
82 public libsecondlife.LLUUID regionMapTextureID = new libsecondlife.LLUUID("00000000-0000-0000-9999-000000000006");
83 }
84}
diff --git a/OpenGridServices/OpenGrid.Framework.Data/UserData.cs b/OpenGridServices/OpenGrid.Framework.Data/UserData.cs
new file mode 100644
index 0000000..4802c5f
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data/UserData.cs
@@ -0,0 +1,101 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenGrid.Framework.Data
7{
8 public interface IUserData
9 {
10 /// <summary>
11 /// Returns a user profile from a database via their UUID
12 /// </summary>
13 /// <param name="user">The accounts UUID</param>
14 /// <returns>The user data profile</returns>
15 UserProfileData getUserByUUID(LLUUID user);
16
17 /// <summary>
18 /// Returns a users profile by searching their username
19 /// </summary>
20 /// <param name="name">The users username</param>
21 /// <returns>The user data profile</returns>
22 UserProfileData getUserByName(string name);
23
24 /// <summary>
25 /// Returns a users profile by searching their username parts
26 /// </summary>
27 /// <param name="fname">Account firstname</param>
28 /// <param name="lname">Account lastname</param>
29 /// <returns>The user data profile</returns>
30 UserProfileData getUserByName(string fname, string lname);
31
32 /// <summary>
33 /// Returns the current agent for a user searching by it's UUID
34 /// </summary>
35 /// <param name="user">The users UUID</param>
36 /// <returns>The current agent session</returns>
37 UserAgentData getAgentByUUID(LLUUID user);
38
39 /// <summary>
40 /// Returns the current session agent for a user searching by username
41 /// </summary>
42 /// <param name="name">The users account name</param>
43 /// <returns>The current agent session</returns>
44 UserAgentData getAgentByName(string name);
45
46 /// <summary>
47 /// Returns the current session agent for a user searching by username parts
48 /// </summary>
49 /// <param name="fname">The users first account name</param>
50 /// <param name="lname">The users account surname</param>
51 /// <returns>The current agent session</returns>
52 UserAgentData getAgentByName(string fname, string lname);
53
54 /// <summary>
55 /// Adds a new User profile to the database
56 /// </summary>
57 /// <param name="user">UserProfile to add</param>
58 void addNewUserProfile(UserProfileData user);
59
60 /// <summary>
61 /// Adds a new agent to the database
62 /// </summary>
63 /// <param name="agent">The agent to add</param>
64 void addNewUserAgent(UserAgentData agent);
65
66 /// <summary>
67 /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES)
68 /// </summary>
69 /// <param name="from">The account to transfer from</param>
70 /// <param name="to">The account to transfer to</param>
71 /// <param name="amount">The amount to transfer</param>
72 /// <returns>Successful?</returns>
73 bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount);
74
75 /// <summary>
76 /// Attempts to move inventory between accounts, if inventory is copyable it will be copied into the target account.
77 /// </summary>
78 /// <param name="from">User to transfer from</param>
79 /// <param name="to">User to transfer to</param>
80 /// <param name="inventory">Specified inventory item</param>
81 /// <returns>Successful?</returns>
82 bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory);
83
84 /// <summary>
85 /// Returns the plugin version
86 /// </summary>
87 /// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns>
88 string getVersion();
89
90 /// <summary>
91 /// Returns the plugin name
92 /// </summary>
93 /// <returns>Plugin name, eg MySQL User Provider</returns>
94 string getName();
95
96 /// <summary>
97 /// Initialises the plugin (artificial constructor)
98 /// </summary>
99 void Initialise();
100 }
101}
diff --git a/OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs b/OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs
new file mode 100644
index 0000000..3f42762
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Data/UserProfileData.cs
@@ -0,0 +1,54 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenGrid.Framework.Data
7{
8 public class UserProfileData
9 {
10 public LLUUID UUID;
11 public string username; // The configurable part of the users username
12 public string surname; // The users surname (can be used to indicate user class - eg 'Test User' or 'Test Admin')
13
14 public string passwordHash; // Hash of the users password
15 public string passwordSalt; // Salt for the users password
16
17 public ulong homeRegion; // RegionHandle of home
18 public LLVector3 homeLocation; // Home Location inside the sim
19 public LLVector3 homeLookAt; // Coordinates where the user is looking
20
21
22 public int created; // UNIX Epoch Timestamp (User Creation)
23 public int lastLogin; // UNIX Epoch Timestamp (Last Login Time)
24
25 public string userInventoryURI; // URI to inventory server for this user
26 public string userAssetURI; // URI to asset server for this user
27
28 public uint profileCanDoMask; // Profile window "I can do" mask
29 public uint profileWantDoMask; // Profile window "I want to" mask
30
31 public string profileAboutText; // My about window text
32 public string profileFirstText; // First Life Text
33
34 public LLUUID profileImage; // My avatars profile image
35 public LLUUID profileFirstImage; // First-life image
36 public UserAgentData currentAgent; // The users last agent
37 }
38
39 public class UserAgentData
40 {
41 public LLUUID UUID; // Account ID
42 public string agentIP; // The IP of the agent
43 public uint agentPort; // The port of the agent
44 public bool agentOnline; // The online status of the agent
45 public LLUUID sessionID; // The session ID for the agent (used by client)
46 public LLUUID secureSessionID; // The secure session ID for the agent (used by client)
47 public LLUUID regionID; // The region ID the agent occupies
48 public int loginTime; // EPOCH based Timestamp
49 public int logoutTime; // Timestamp or 0 if N/A
50 public LLUUID currentRegion; // UUID of the users current region
51 public ulong currentHandle; // RegionHandle of the users current region
52 public LLVector3 currentPos; // Current position in the region
53 }
54}
diff --git a/OpenGridServices/OpenGrid.Framework.Manager/GridManagementAgent.cs b/OpenGridServices/OpenGrid.Framework.Manager/GridManagementAgent.cs
new file mode 100644
index 0000000..f4483fb
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Manager/GridManagementAgent.cs
@@ -0,0 +1,76 @@
1using Nwc.XmlRpc;
2using OpenSim.Framework;
3using OpenSim.Servers;
4using System.Collections;
5using System.Collections.Generic;
6using libsecondlife;
7
8namespace OpenGrid.Framework.Manager
9{
10
11 public delegate void GridManagerCallback(string param);
12
13 public class GridManagementAgent
14 {
15
16 private GridManagerCallback thecallback;
17 private string sendkey;
18 private string recvkey;
19 private string component_type;
20
21 private static ArrayList Sessions;
22
23 public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback)
24 {
25 this.sendkey = sendkey;
26 this.recvkey = recvkey;
27 this.component_type = component_type;
28 this.thecallback = thecallback;
29 Sessions = new ArrayList();
30
31 app_httpd.AddXmlRPCHandler("manager_login", XmlRpcLoginMethod);
32
33 switch (component_type)
34 {
35 case "gridserver":
36 GridServerManager.sendkey = this.sendkey;
37 GridServerManager.recvkey = this.recvkey;
38 GridServerManager.thecallback = thecallback;
39 app_httpd.AddXmlRPCHandler("shutdown", GridServerManager.XmlRpcShutdownMethod);
40 break;
41 }
42 }
43
44 public static bool SessionExists(LLUUID sessionID)
45 {
46 return Sessions.Contains(sessionID);
47 }
48
49 public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
50 {
51 XmlRpcResponse response = new XmlRpcResponse();
52 Hashtable requestData = (Hashtable)request.Params[0];
53 Hashtable responseData = new Hashtable();
54
55 // TODO: Switch this over to using OpenGrid.Framework.Data
56 if (requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret"))
57 {
58 response.IsFault = false;
59 LLUUID new_session = LLUUID.Random();
60 Sessions.Add(new_session);
61 responseData["session_id"] = new_session.ToString();
62 responseData["msg"] = "Login OK";
63 }
64 else
65 {
66 response.IsFault = true;
67 responseData["error"] = "Invalid username or password";
68 }
69
70 response.Value = responseData;
71 return response;
72
73 }
74
75 }
76}
diff --git a/OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs b/OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs
new file mode 100644
index 0000000..7ebf66a
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs
@@ -0,0 +1,50 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using Nwc.XmlRpc;
5using System.Threading;
6using libsecondlife;
7
8namespace OpenGrid.Framework.Manager {
9
10 public class GridServerManager
11 {
12 public static GridManagerCallback thecallback;
13
14 public static string sendkey;
15 public static string recvkey;
16
17 public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
18 {
19 XmlRpcResponse response = new XmlRpcResponse();
20 Hashtable requestData = (Hashtable)request.Params[0];
21 Hashtable responseData = new Hashtable();
22
23 if(requestData.ContainsKey("session_id")) {
24 if(GridManagementAgent.SessionExists(new LLUUID((string)requestData["session_id"]))) {
25 responseData["msg"]="Shutdown command accepted";
26 (new Thread(new ThreadStart(ZOMGServerIsNowTerminallyIll))).Start();
27 } else {
28 response.IsFault=true;
29 responseData["error"]="bad session ID";
30 }
31 } else {
32 response.IsFault=true;
33 responseData["error"]="no session ID";
34 }
35
36 response.Value = responseData;
37 return response;
38 }
39
40 // Brought to by late-night coding
41 public static void ZOMGServerIsNowTerminallyIll()
42 {
43 Console.WriteLine("ZOMG! THIS SERVER IS TERMINALLY ILL - WE GOT A SHUTDOWN REQUEST FROM A GRID MANAGER!!!!");
44 Console.WriteLine("We have 3 seconds to live...");
45 Thread.Sleep(3000);
46 thecallback("shutdown");
47 }
48 }
49}
50
diff --git a/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj b/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj
new file mode 100644
index 0000000..ea7548a
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj
@@ -0,0 +1,99 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{7924FD35-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Manager</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Manager</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="OpenSim.Framework" >
66 <HintPath>OpenSim.Framework.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="OpenSim.Servers" >
70 <HintPath>OpenSim.Servers.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="XMLRPC" >
78 <HintPath>XMLRPC.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 </ItemGroup>
84 <ItemGroup>
85 <Compile Include="GridManagementAgent.cs">
86 <SubType>Code</SubType>
87 </Compile>
88 <Compile Include="GridServerManager.cs">
89 <SubType>Code</SubType>
90 </Compile>
91 </ItemGroup>
92 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
93 <PropertyGroup>
94 <PreBuildEvent>
95 </PreBuildEvent>
96 <PostBuildEvent>
97 </PostBuildEvent>
98 </PropertyGroup>
99</Project>
diff --git a/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj.user b/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build b/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build
new file mode 100644
index 0000000..f8cc80e
--- /dev/null
+++ b/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build
@@ -0,0 +1,44 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Framework.Manager" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Framework.Manager" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="GridManagementAgent.cs" />
15 <include name="GridServerManager.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="../../bin/OpenSim.Framework.dll" />
24 <include name="../../bin/OpenSim.Servers.dll" />
25 <include name="../../bin/libsecondlife.dll" />
26 <include name="../../bin/XMLRPC.dll" />
27 </references>
28 </csc>
29 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
30 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
31 <copy todir="${project::get-base-directory()}/../../bin/">
32 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
33 <include name="*.dll"/>
34 <include name="*.exe"/>
35 </fileset>
36 </copy>
37 </target>
38 <target name="clean">
39 <delete dir="${bin.dir}" failonerror="false" />
40 <delete dir="${obj.dir}" failonerror="false" />
41 </target>
42 <target name="doc" description="Creates documentation.">
43 </target>
44</project>
diff --git a/OpenGridServices/OpenGridServices.AssetServer/AssetHttpServer.cs b/OpenGridServices/OpenGridServices.AssetServer/AssetHttpServer.cs
new file mode 100644
index 0000000..8439e92
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.AssetServer/AssetHttpServer.cs
@@ -0,0 +1,92 @@
1using System;
2using System.Collections.Generic;
3using System.Net;
4using System.Text;
5using System.Text.RegularExpressions;
6using System.Threading;
7//using OpenSim.CAPS;
8using Nwc.XmlRpc;
9using System.Collections;
10using OpenSim.Framework.Console;
11using OpenSim.Servers;
12
13namespace OpenGridServices.AssetServer
14{
15 public class AssetHttpServer :BaseHttpServer
16 {
17 public AssetHttpServer(int port)
18 : base(port)
19 {
20 }
21
22 public override void HandleRequest(Object stateinfo)
23 {
24 try
25 {
26 HttpListenerContext context = (HttpListenerContext)stateinfo;
27
28 HttpListenerRequest request = context.Request;
29 HttpListenerResponse response = context.Response;
30
31 response.KeepAlive = false;
32 response.SendChunked = false;
33
34 System.IO.Stream body = request.InputStream;
35 System.Text.Encoding encoding = System.Text.Encoding.UTF8;
36 System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding);
37
38 string requestBody = reader.ReadToEnd();
39 body.Close();
40 reader.Close();
41
42 //Console.WriteLine(request.HttpMethod + " " + request.RawUrl + " Http/" + request.ProtocolVersion.ToString() + " content type: " + request.ContentType);
43 //Console.WriteLine(requestBody);
44
45 string responseString = "";
46 switch (request.ContentType)
47 {
48 case "text/xml":
49 // must be XML-RPC, so pass to the XML-RPC parser
50
51 responseString = ParseXMLRPC(requestBody);
52 responseString = Regex.Replace(responseString, "utf-16", "utf-8");
53
54 response.AddHeader("Content-type", "text/xml");
55 break;
56
57 case "application/xml":
58 // probably LLSD we hope, otherwise it should be ignored by the parser
59 responseString = ParseLLSDXML(requestBody);
60 response.AddHeader("Content-type", "application/xml");
61 break;
62
63 case "application/x-www-form-urlencoded":
64 // a form data POST so send to the REST parser
65 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
66 response.AddHeader("Content-type", "text/plain");
67 break;
68
69 case null:
70 // must be REST or invalid crap, so pass to the REST parser
71 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
72 response.AddHeader("Content-type", "text/plain");
73 break;
74
75 }
76
77 Encoding Windows1252Encoding = Encoding.GetEncoding(1252);
78 byte[] buffer = Windows1252Encoding.GetBytes(responseString);
79 System.IO.Stream output = response.OutputStream;
80 response.SendChunked = false;
81 response.ContentLength64 = buffer.Length;
82 output.Write(buffer, 0, buffer.Length);
83 output.Close();
84 }
85 catch (Exception e)
86 {
87 Console.WriteLine(e.ToString());
88 }
89 }
90
91 }
92}
diff --git a/OpenGridServices/OpenGridServices.AssetServer/Main.cs b/OpenGridServices/OpenGridServices.AssetServer/Main.cs
new file mode 100644
index 0000000..adbf18b
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.AssetServer/Main.cs
@@ -0,0 +1,337 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3
4
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.IO;
32using System.Text;
33using System.Timers;
34using System.Net;
35using System.Reflection;
36using System.Threading;
37using libsecondlife;
38using OpenSim.Framework;
39using OpenSim.Framework.Sims;
40using OpenSim.Framework.Console;
41using OpenSim.Framework.Types;
42using OpenSim.Framework.Interfaces;
43using OpenSim.Framework.Utilities;
44using OpenSim.Servers;
45using Db4objects.Db4o;
46using Db4objects.Db4o.Query;
47
48namespace OpenGridServices.AssetServer
49{
50 /// <summary>
51 /// </summary>
52 public class OpenAsset_Main : BaseServer, conscmd_callback
53 {
54 private IObjectContainer db;
55
56 public static OpenAsset_Main assetserver;
57
58 private ConsoleBase m_console;
59
60 [STAThread]
61 public static void Main(string[] args)
62 {
63 Console.WriteLine("Starting...\n");
64
65 assetserver = new OpenAsset_Main();
66 assetserver.Startup();
67
68 assetserver.Work();
69 }
70
71 private void Work()
72 {
73 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "\nEnter help for a list of commands\n");
74
75 while (true)
76 {
77 m_console.MainConsolePrompt();
78 }
79 }
80
81 private OpenAsset_Main()
82 {
83 m_console = new ConsoleBase("opengrid-AssetServer-console.log", "OpenGrid", this, false);
84 MainConsole.Instance = m_console;
85 }
86
87 public void Startup()
88 {
89 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Setting up asset DB");
90 setupDB();
91
92 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP process");
93 AssetHttpServer httpServer = new AssetHttpServer(8003);
94
95
96 httpServer.AddRestHandler("GET", "/assets/", this.assetGetMethod);
97 httpServer.AddRestHandler("POST", "/assets/", this.assetPostMethod);
98
99 httpServer.Start();
100
101 }
102
103 public string assetPostMethod(string requestBody, string path, string param)
104 {
105 AssetBase asset = new AssetBase();
106 asset.Name = "";
107 asset.FullID = new LLUUID(param);
108 Encoding Windows1252Encoding = Encoding.GetEncoding(1252);
109 byte[] buffer = Windows1252Encoding.GetBytes(requestBody);
110 asset.Data = buffer;
111 AssetStorage store = new AssetStorage();
112 store.Data = asset.Data;
113 store.Name = asset.Name;
114 store.UUID = asset.FullID;
115 db.Set(store);
116 db.Commit();
117 return "";
118 }
119
120 public string assetGetMethod(string request, string path, string param)
121 {
122 Console.WriteLine("got a request " +param);
123 byte[] assetdata = getAssetData(new LLUUID(param), false);
124 if (assetdata != null)
125 {
126 Encoding Windows1252Encoding = Encoding.GetEncoding(1252);
127 string ret = Windows1252Encoding.GetString(assetdata);
128 //string ret = System.Text.Encoding.Unicode.GetString(assetdata);
129
130 return ret;
131
132 }
133 else
134 {
135 return "";
136 }
137
138 }
139
140 public byte[] getAssetData(LLUUID assetID, bool isTexture)
141 {
142 bool found = false;
143 AssetStorage foundAsset = null;
144
145 IObjectSet result = db.Get(new AssetStorage(assetID));
146 if (result.Count > 0)
147 {
148 foundAsset = (AssetStorage)result.Next();
149 found = true;
150 }
151
152 if (found)
153 {
154 return foundAsset.Data;
155 }
156 else
157 {
158 return null;
159 }
160 }
161
162 public void setupDB()
163 {
164 bool yapfile = System.IO.File.Exists("assets.yap");
165 try
166 {
167 db = Db4oFactory.OpenFile("assets.yap");
168 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:setupDB() - creation");
169 }
170 catch (Exception e)
171 {
172 db.Close();
173 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Main.cs:setupDB() - Exception occured");
174 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, e.ToString());
175 }
176 if (!yapfile)
177 {
178 this.LoadDB();
179 }
180 }
181
182 public void LoadDB()
183 {
184 try
185 {
186
187 Console.WriteLine("setting up Asset database");
188
189 AssetBase Image = new AssetBase();
190 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001");
191 Image.Name = "Bricks";
192 this.LoadAsset(Image, true, "bricks.jp2");
193 AssetStorage store = new AssetStorage();
194 store.Data = Image.Data;
195 store.Name = Image.Name;
196 store.UUID = Image.FullID;
197 db.Set(store);
198 db.Commit();
199
200 Image = new AssetBase();
201 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000002");
202 Image.Name = "Plywood";
203 this.LoadAsset(Image, true, "plywood.jp2");
204 store = new AssetStorage();
205 store.Data = Image.Data;
206 store.Name = Image.Name;
207 store.UUID = Image.FullID;
208 db.Set(store);
209 db.Commit();
210
211 Image = new AssetBase();
212 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000003");
213 Image.Name = "Rocks";
214 this.LoadAsset(Image, true, "rocks.jp2");
215 store = new AssetStorage();
216 store.Data = Image.Data;
217 store.Name = Image.Name;
218 store.UUID = Image.FullID;
219 db.Set(store);
220 db.Commit();
221
222 Image = new AssetBase();
223 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000004");
224 Image.Name = "Granite";
225 this.LoadAsset(Image, true, "granite.jp2");
226 store = new AssetStorage();
227 store.Data = Image.Data;
228 store.Name = Image.Name;
229 store.UUID = Image.FullID;
230 db.Set(store);
231 db.Commit();
232
233 Image = new AssetBase();
234 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000005");
235 Image.Name = "Hardwood";
236 this.LoadAsset(Image, true, "hardwood.jp2");
237 store = new AssetStorage();
238 store.Data = Image.Data;
239 store.Name = Image.Name;
240 store.UUID = Image.FullID;
241 db.Set(store);
242 db.Commit();
243
244 Image = new AssetBase();
245 Image.FullID = new LLUUID("00000000-0000-0000-5005-000000000005");
246 Image.Name = "Prim Base Texture";
247 this.LoadAsset(Image, true, "plywood.jp2");
248 store = new AssetStorage();
249 store.Data = Image.Data;
250 store.Name = Image.Name;
251 store.UUID = Image.FullID;
252 db.Set(store);
253 db.Commit();
254
255 Image = new AssetBase();
256 Image.FullID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
257 Image.Name = "Shape";
258 this.LoadAsset(Image, false, "base_shape.dat");
259 store = new AssetStorage();
260 store.Data = Image.Data;
261 store.Name = Image.Name;
262 store.UUID = Image.FullID;
263 db.Set(store);
264 db.Commit();
265 }
266 catch (Exception e)
267 {
268 Console.WriteLine(e.Message);
269 }
270 }
271
272 private void LoadAsset(AssetBase info, bool image, string filename)
273 {
274
275
276 string dataPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder;
277 string fileName = Path.Combine(dataPath, filename);
278 FileInfo fInfo = new FileInfo(fileName);
279 long numBytes = fInfo.Length;
280 FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
281 byte[] idata = new byte[numBytes];
282 BinaryReader br = new BinaryReader(fStream);
283 idata = br.ReadBytes((int)numBytes);
284 br.Close();
285 fStream.Close();
286 info.Data = idata;
287 //info.loaded=true;
288 }
289
290 /*private GridConfig LoadConfigDll(string dllName)
291 {
292 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
293 GridConfig config = null;
294
295 foreach (Type pluginType in pluginAssembly.GetTypes())
296 {
297 if (pluginType.IsPublic)
298 {
299 if (!pluginType.IsAbstract)
300 {
301 Type typeInterface = pluginType.GetInterface("IGridConfig", true);
302
303 if (typeInterface != null)
304 {
305 IGridConfig plug = (IGridConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
306 config = plug.GetConfigObject();
307 break;
308 }
309
310 typeInterface = null;
311 }
312 }
313 }
314 pluginAssembly = null;
315 return config;
316 }*/
317
318 public void RunCmd(string cmd, string[] cmdparams)
319 {
320 switch (cmd)
321 {
322 case "help":
323 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "shutdown - shutdown this asset server (USE CAUTION!)");
324 break;
325
326 case "shutdown":
327 m_console.Close();
328 Environment.Exit(0);
329 break;
330 }
331 }
332
333 public void Show(string ShowWhat)
334 {
335 }
336 }
337}
diff --git a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj
new file mode 100644
index 0000000..cee7b77
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj
@@ -0,0 +1,125 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{0021261B-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon>
10 </ApplicationIcon>
11 <AssemblyKeyContainerName>
12 </AssemblyKeyContainerName>
13 <AssemblyName>OpenGridServices.AssetServer</AssemblyName>
14 <DefaultClientScript>JScript</DefaultClientScript>
15 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
17 <DelaySign>false</DelaySign>
18 <OutputType>Exe</OutputType>
19 <AppDesignerFolder>
20 </AppDesignerFolder>
21 <RootNamespace>OpenGridServices.AssetServer</RootNamespace>
22 <StartupObject>
23 </StartupObject>
24 <FileUpgradeFlags>
25 </FileUpgradeFlags>
26 </PropertyGroup>
27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
28 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
29 <BaseAddress>285212672</BaseAddress>
30 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
31 <ConfigurationOverrideFile>
32 </ConfigurationOverrideFile>
33 <DefineConstants>TRACE;DEBUG</DefineConstants>
34 <DocumentationFile>
35 </DocumentationFile>
36 <DebugSymbols>True</DebugSymbols>
37 <FileAlignment>4096</FileAlignment>
38 <Optimize>False</Optimize>
39 <OutputPath>..\..\bin\</OutputPath>
40 <RegisterForComInterop>False</RegisterForComInterop>
41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
43 <WarningLevel>4</WarningLevel>
44 <NoWarn>
45 </NoWarn>
46 </PropertyGroup>
47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
49 <BaseAddress>285212672</BaseAddress>
50 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
51 <ConfigurationOverrideFile>
52 </ConfigurationOverrideFile>
53 <DefineConstants>TRACE</DefineConstants>
54 <DocumentationFile>
55 </DocumentationFile>
56 <DebugSymbols>False</DebugSymbols>
57 <FileAlignment>4096</FileAlignment>
58 <Optimize>True</Optimize>
59 <OutputPath>..\..\bin\</OutputPath>
60 <RegisterForComInterop>False</RegisterForComInterop>
61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
63 <WarningLevel>4</WarningLevel>
64 <NoWarn>
65 </NoWarn>
66 </PropertyGroup>
67 <ItemGroup>
68 <Reference Include="System">
69 <HintPath>System.dll</HintPath>
70 <Private>False</Private>
71 </Reference>
72 <Reference Include="System.Data">
73 <HintPath>System.Data.dll</HintPath>
74 <Private>False</Private>
75 </Reference>
76 <Reference Include="System.Xml">
77 <HintPath>System.Xml.dll</HintPath>
78 <Private>False</Private>
79 </Reference>
80 <Reference Include="OpenSim.Framework">
81 <HintPath>OpenSim.Framework.dll</HintPath>
82 <Private>False</Private>
83 </Reference>
84 <Reference Include="OpenSim.Framework.Console">
85 <HintPath>OpenSim.Framework.Console.dll</HintPath>
86 <Private>False</Private>
87 </Reference>
88 <Reference Include="OpenSim.Servers">
89 <HintPath>OpenSim.Servers.dll</HintPath>
90 <Private>False</Private>
91 </Reference>
92 <Reference Include="libsecondlife.dll">
93 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
94 <Private>False</Private>
95 </Reference>
96 <Reference Include="Db4objects.Db4o.dll">
97 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
98 <Private>False</Private>
99 </Reference>
100 <Reference Include="XMLRPC">
101 <HintPath>XMLRPC.dll</HintPath>
102 <Private>False</Private>
103 </Reference>
104 </ItemGroup>
105 <ItemGroup>
106 </ItemGroup>
107 <ItemGroup>
108 <Compile Include="AssetHttpServer.cs">
109 <SubType>Code</SubType>
110 </Compile>
111 <Compile Include="Main.cs">
112 <SubType>Code</SubType>
113 </Compile>
114 <Compile Include="Properties\AssemblyInfo.cs">
115 <SubType>Code</SubType>
116 </Compile>
117 </ItemGroup>
118 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
119 <PropertyGroup>
120 <PreBuildEvent>
121 </PreBuildEvent>
122 <PostBuildEvent>
123 </PostBuildEvent>
124 </PropertyGroup>
125</Project> \ No newline at end of file
diff --git a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj.user b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build
new file mode 100644
index 0000000..e889a4d
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build
@@ -0,0 +1,50 @@
1<?xml version="1.0" ?>
2<project name="OpenGridServices.AssetServer" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
11 <resources prefix="OpenGridServices.AssetServer" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssetHttpServer.cs" />
15 <include name="Main.cs" />
16 <include name="Properties/AssemblyInfo.cs" />
17 </sources>
18 <references basedir="${project::get-base-directory()}">
19 <lib>
20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib>
23 <include name="System.dll" />
24 <include name="System.Data.dll" />
25 <include name="System.Xml.dll" />
26 <include name="../../bin/OpenSim.Framework.dll" />
27 <include name="../../bin/OpenSim.Framework.Console.dll" />
28 <include name="../../bin/OpenSim.GridInterfaces.Local.dll" />
29 <include name="../../bin/OpenSim.Servers.dll" />
30 <include name="../../bin/libsecondlife.dll" />
31 <include name="../../bin/Db4objects.Db4o.dll" />
32 <include name="../../bin/XMLRPC.dll" />
33 </references>
34 </csc>
35 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
36 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
37 <copy todir="${project::get-base-directory()}/../../bin/">
38 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
39 <include name="*.dll"/>
40 <include name="*.exe"/>
41 </fileset>
42 </copy>
43 </target>
44 <target name="clean">
45 <delete dir="${bin.dir}" failonerror="false" />
46 <delete dir="${obj.dir}" failonerror="false" />
47 </target>
48 <target name="doc" description="Creates documentation.">
49 </target>
50</project>
diff --git a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj
new file mode 100644
index 0000000..9b8cc87
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.csproj
@@ -0,0 +1,126 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{21BFC8E2-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGridServices.GridServer</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Exe</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGridServices.GridServer</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Data" >
66 <HintPath>System.Data.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Xml" >
70 <HintPath>System.Xml.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" >
78 <HintPath>..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
84 <Name>OpenSim.Framework</Name>
85 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
90 <Name>OpenSim.Framework.Console</Name>
91 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private>
94 </ProjectReference>
95 <ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj">
96 <Name>OpenSim.Servers</Name>
97 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
98 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
99 <Private>False</Private>
100 </ProjectReference>
101 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
102 <Name>XMLRPC</Name>
103 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
104 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
105 <Private>False</Private>
106 </ProjectReference>
107 </ItemGroup>
108 <ItemGroup>
109 <Compile Include="Main.cs">
110 <SubType>Code</SubType>
111 </Compile>
112 <Compile Include="SimProfiles.cs">
113 <SubType>Code</SubType>
114 </Compile>
115 <Compile Include="Properties\AssemblyInfo.cs">
116 <SubType>Code</SubType>
117 </Compile>
118 </ItemGroup>
119 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
120 <PropertyGroup>
121 <PreBuildEvent>
122 </PreBuildEvent>
123 <PostBuildEvent>
124 </PostBuildEvent>
125 </PropertyGroup>
126</Project>
diff --git a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build
new file mode 100644
index 0000000..6bef534
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.GridServer.exe.build
@@ -0,0 +1,49 @@
1<?xml version="1.0" ?>
2<project name="OpenGridServices.GridServer" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
11 <resources prefix="OpenGridServices.GridServer" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="Main.cs" />
15 <include name="SimProfiles.cs" />
16 <include name="Properties/AssemblyInfo.cs" />
17 </sources>
18 <references basedir="${project::get-base-directory()}">
19 <lib>
20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib>
23 <include name="System.dll" />
24 <include name="System.Data.dll" />
25 <include name="System.Xml.dll" />
26 <include name="../bin/OpenSim.Framework.dll" />
27 <include name="../bin/OpenSim.Framework.Console.dll" />
28 <include name="../bin/OpenSim.Servers.dll" />
29 <include name="../bin/libsecondlife.dll" />
30 <include name="../bin/Db4objects.Db4o.dll" />
31 <include name="../bin/XMLRPC.dll" />
32 </references>
33 </csc>
34 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />
35 <mkdir dir="${project::get-base-directory()}/../bin/"/>
36 <copy todir="${project::get-base-directory()}/../bin/">
37 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
38 <include name="*.dll"/>
39 <include name="*.exe"/>
40 </fileset>
41 </copy>
42 </target>
43 <target name="clean">
44 <delete dir="${bin.dir}" failonerror="false" />
45 <delete dir="${obj.dir}" failonerror="false" />
46 </target>
47 <target name="doc" description="Creates documentation.">
48 </target>
49</project>
diff --git a/OpenGridServices/OpenGridServices.AssetServer/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGridServices.AssetServer/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..7014284
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.AssetServer/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OGS-AssetServer")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OGS-AssetServer")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("b541b244-3d1d-4625-9003-bc2a3a6a39a4")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("1.0.0.0")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenGridServices/OpenGridServices.GridServer/GridManager.cs b/OpenGridServices/OpenGridServices.GridServer/GridManager.cs
new file mode 100644
index 0000000..54e4bb7
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.GridServer/GridManager.cs
@@ -0,0 +1,474 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Text;
5using System.Reflection;
6using OpenGrid.Framework.Data;
7using OpenSim.Framework.Utilities;
8using OpenSim.Framework.Console;
9using OpenSim.Framework.Sims;
10using libsecondlife;
11using Nwc.XmlRpc;
12using System.Xml;
13
14namespace OpenGridServices.GridServer
15{
16 class GridManager
17 {
18 Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>();
19 public OpenSim.Framework.Interfaces.GridConfig config;
20
21 /// <summary>
22 /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded.
23 /// </summary>
24 /// <param name="FileName">The filename to the grid server plugin DLL</param>
25 public void AddPlugin(string FileName)
26 {
27 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Storage: Attempting to load " + FileName);
28 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
29
30 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
31 foreach (Type pluginType in pluginAssembly.GetTypes())
32 {
33 if (!pluginType.IsAbstract)
34 {
35 Type typeInterface = pluginType.GetInterface("IGridData", true);
36
37 if (typeInterface != null)
38 {
39 IGridData plug = (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
40 plug.Initialise();
41 this._plugins.Add(plug.getName(), plug);
42 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Storage: Added IGridData Interface");
43 }
44
45 typeInterface = null;
46 }
47 }
48
49 pluginAssembly = null;
50 }
51
52 /// <summary>
53 /// Returns a region by argument
54 /// </summary>
55 /// <param name="uuid">A UUID key of the region to return</param>
56 /// <returns>A SimProfileData for the region</returns>
57 public SimProfileData getRegion(libsecondlife.LLUUID uuid)
58 {
59 foreach(KeyValuePair<string,IGridData> kvp in _plugins) {
60 try
61 {
62 return kvp.Value.GetProfileByLLUUID(uuid);
63 }
64 catch (Exception e)
65 {
66 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL,"Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key);
67 }
68 }
69 return null;
70 }
71
72 /// <summary>
73 /// Returns a region by argument
74 /// </summary>
75 /// <param name="uuid">A regionHandle of the region to return</param>
76 /// <returns>A SimProfileData for the region</returns>
77 public SimProfileData getRegion(ulong handle)
78 {
79 foreach (KeyValuePair<string, IGridData> kvp in _plugins)
80 {
81 try
82 {
83 return kvp.Value.GetProfileByHandle(handle);
84 }
85 catch (Exception e)
86 {
87 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL,"Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key);
88 }
89 }
90 return null;
91 }
92
93 public Dictionary<ulong, SimProfileData> getRegions(uint xmin, uint ymin, uint xmax, uint ymax)
94 {
95 Dictionary<ulong, SimProfileData> regions = new Dictionary<ulong, SimProfileData>();
96
97 SimProfileData[] neighbours;
98
99 foreach (KeyValuePair<string, IGridData> kvp in _plugins)
100 {
101 try
102 {
103 neighbours = kvp.Value.GetProfilesInRange(xmin, ymin, xmax, ymax);
104 foreach (SimProfileData neighbour in neighbours)
105 {
106 regions[neighbour.regionHandle] = neighbour;
107 }
108 }
109 catch (Exception e)
110 {
111 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "Storage: Unable to query regionblock via " + kvp.Key);
112 }
113 }
114
115 return regions;
116 }
117
118 /// <summary>
119 /// Returns a XML String containing a list of the neighbouring regions
120 /// </summary>
121 /// <param name="reqhandle">The regionhandle for the center sim</param>
122 /// <returns>An XML string containing neighbour entities</returns>
123 public string GetXMLNeighbours(ulong reqhandle)
124 {
125 string response = "";
126 SimProfileData central_region = getRegion(reqhandle);
127 SimProfileData neighbour;
128 for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++)
129 {
130 if (getRegion(Util.UIntsToLong((uint)((central_region.regionLocX + x) * 256), (uint)(central_region.regionLocY + y) * 256)) != null)
131 {
132 neighbour = getRegion(Util.UIntsToLong((uint)((central_region.regionLocX + x) * 256), (uint)(central_region.regionLocY + y) * 256));
133 response += "<neighbour>";
134 response += "<sim_ip>" + neighbour.serverIP + "</sim_ip>";
135 response += "<sim_port>" + neighbour.serverPort.ToString() + "</sim_port>";
136 response += "<locx>" + neighbour.regionLocX.ToString() + "</locx>";
137 response += "<locy>" + neighbour.regionLocY.ToString() + "</locy>";
138 response += "<regionhandle>" + neighbour.regionHandle.ToString() + "</regionhandle>";
139 response += "</neighbour>";
140
141 }
142 }
143 return response;
144 }
145
146 /// <summary>
147 /// Performed when a region connects to the grid server initially.
148 /// </summary>
149 /// <param name="request">The XMLRPC Request</param>
150 /// <returns>Startup parameters</returns>
151 public XmlRpcResponse XmlRpcLoginToSimulatorMethod(XmlRpcRequest request)
152 {
153 XmlRpcResponse response = new XmlRpcResponse();
154 Hashtable responseData = new Hashtable();
155 response.Value = responseData;
156
157 SimProfileData TheSim = null;
158 Hashtable requestData = (Hashtable)request.Params[0];
159
160 if (requestData.ContainsKey("UUID"))
161 {
162 TheSim = getRegion(new LLUUID((string)requestData["UUID"]));
163 }
164 else if (requestData.ContainsKey("region_handle"))
165 {
166 TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"]));
167 }
168
169 if (TheSim == null)
170 {
171 responseData["error"] = "sim not found";
172 }
173 else
174 {
175
176 ArrayList SimNeighboursData = new ArrayList();
177
178 SimProfileData neighbour;
179 Hashtable NeighbourBlock;
180
181 bool fastMode = false; // Only compatible with MySQL right now
182
183 if (fastMode)
184 {
185 Dictionary<ulong, SimProfileData> neighbours = getRegions(TheSim.regionLocX - 1, TheSim.regionLocY - 1, TheSim.regionLocX + 1, TheSim.regionLocY + 1);
186
187 foreach (KeyValuePair<ulong, SimProfileData> aSim in neighbours)
188 {
189 NeighbourBlock = new Hashtable();
190 NeighbourBlock["sim_ip"] = aSim.Value.serverIP.ToString();
191 NeighbourBlock["sim_port"] = aSim.Value.serverPort.ToString();
192 NeighbourBlock["region_locx"] = aSim.Value.regionLocX.ToString();
193 NeighbourBlock["region_locy"] = aSim.Value.regionLocY.ToString();
194 NeighbourBlock["UUID"] = aSim.Value.UUID.ToString();
195
196 if (aSim.Value.UUID != TheSim.UUID)
197 SimNeighboursData.Add(NeighbourBlock);
198 }
199 }
200 else
201 {
202 for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++)
203 {
204 if (getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)) != null)
205 {
206 neighbour = getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256));
207
208 NeighbourBlock = new Hashtable();
209 NeighbourBlock["sim_ip"] = neighbour.serverIP;
210 NeighbourBlock["sim_port"] = neighbour.serverPort.ToString();
211 NeighbourBlock["region_locx"] = neighbour.regionLocX.ToString();
212 NeighbourBlock["region_locy"] = neighbour.regionLocY.ToString();
213 NeighbourBlock["UUID"] = neighbour.UUID.ToString();
214
215 if (neighbour.UUID != TheSim.UUID) SimNeighboursData.Add(NeighbourBlock);
216 }
217 }
218 }
219
220 responseData["UUID"] = TheSim.UUID.ToString();
221 responseData["region_locx"] = TheSim.regionLocX.ToString();
222 responseData["region_locy"] = TheSim.regionLocY.ToString();
223 responseData["regionname"] = TheSim.regionName;
224 responseData["estate_id"] = "1";
225 responseData["neighbours"] = SimNeighboursData;
226
227 responseData["sim_ip"] = TheSim.serverIP;
228 responseData["sim_port"] = TheSim.serverPort.ToString();
229 responseData["asset_url"] = TheSim.regionAssetURI;
230 responseData["asset_sendkey"] = TheSim.regionAssetSendKey;
231 responseData["asset_recvkey"] = TheSim.regionAssetRecvKey;
232 responseData["user_url"] = TheSim.regionUserURI;
233 responseData["user_sendkey"] = TheSim.regionUserSendKey;
234 responseData["user_recvkey"] = TheSim.regionUserRecvKey;
235 responseData["authkey"] = TheSim.regionSecret;
236
237 // New! If set, use as URL to local sim storage (ie http://remotehost/region.yap)
238 responseData["data_uri"] = TheSim.regionDataURI;
239 }
240
241 return response;
242 }
243
244 public XmlRpcResponse XmlRpcMapBlockMethod(XmlRpcRequest request)
245 {
246 int xmin=980, ymin=980, xmax=1020, ymax=1020;
247
248 Hashtable requestData = (Hashtable)request.Params[0];
249 if (requestData.ContainsKey("xmin"))
250 {
251 xmin = (Int32)requestData["xmin"];
252 }
253 if (requestData.ContainsKey("ymin"))
254 {
255 ymin = (Int32)requestData["ymin"];
256 }
257 if (requestData.ContainsKey("xmax"))
258 {
259 xmax = (Int32)requestData["xmax"];
260 }
261 if (requestData.ContainsKey("ymax"))
262 {
263 ymax = (Int32)requestData["ymax"];
264 }
265
266 XmlRpcResponse response = new XmlRpcResponse();
267 Hashtable responseData = new Hashtable();
268 response.Value = responseData;
269 IList simProfileList = new ArrayList();
270
271 SimProfileData simProfile;
272 for (int x = xmin; x < xmax; x++)
273 {
274 for (int y = ymin; y < ymax; y++)
275 {
276 simProfile = getRegion(Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256)));
277 if (simProfile != null)
278 {
279 Hashtable simProfileBlock = new Hashtable();
280 simProfileBlock["x"] = x;
281 simProfileBlock["y"] = y;
282 simProfileBlock["name"] = simProfile.regionName;
283 simProfileBlock["access"] = 0;
284 simProfileBlock["region-flags"] = 0;
285 simProfileBlock["water-height"] = 20;
286 simProfileBlock["agents"] = 1;
287 simProfileBlock["map-image-id"] = simProfile.regionMapTextureID.ToString();
288
289 simProfileList.Add(simProfileBlock);
290 }
291 }
292 }
293
294 responseData["sim-profiles"] = simProfileList;
295
296 return response;
297 }
298
299
300
301 /// <summary>
302 /// Performs a REST Get Operation
303 /// </summary>
304 /// <param name="request"></param>
305 /// <param name="path"></param>
306 /// <param name="param"></param>
307 /// <returns></returns>
308 public string RestGetRegionMethod(string request, string path, string param)
309 {
310 return RestGetSimMethod("", "/sims/", param);
311 }
312
313 /// <summary>
314 /// Performs a REST Set Operation
315 /// </summary>
316 /// <param name="request"></param>
317 /// <param name="path"></param>
318 /// <param name="param"></param>
319 /// <returns></returns>
320 public string RestSetRegionMethod(string request, string path, string param)
321 {
322 return RestSetSimMethod("", "/sims/", param);
323 }
324
325 /// <summary>
326 /// Returns information about a sim via a REST Request
327 /// </summary>
328 /// <param name="request"></param>
329 /// <param name="path"></param>
330 /// <param name="param"></param>
331 /// <returns>Information about the sim in XML</returns>
332 public string RestGetSimMethod(string request, string path, string param)
333 {
334 string respstring = String.Empty;
335
336 SimProfileData TheSim;
337 LLUUID UUID = new LLUUID(param);
338 TheSim = getRegion(UUID);
339
340 if (!(TheSim == null))
341 {
342 respstring = "<Root>";
343 respstring += "<authkey>" + TheSim.regionSendKey + "</authkey>";
344 respstring += "<sim>";
345 respstring += "<uuid>" + TheSim.UUID.ToString() + "</uuid>";
346 respstring += "<regionname>" + TheSim.regionName + "</regionname>";
347 respstring += "<sim_ip>" + TheSim.serverIP + "</sim_ip>";
348 respstring += "<sim_port>" + TheSim.serverPort.ToString() + "</sim_port>";
349 respstring += "<region_locx>" + TheSim.regionLocX.ToString() + "</region_locx>";
350 respstring += "<region_locy>" + TheSim.regionLocY.ToString() + "</region_locy>";
351 respstring += "<estate_id>1</estate_id>";
352 respstring += "</sim>";
353 respstring += "</Root>";
354 }
355
356 return respstring;
357 }
358
359 /// <summary>
360 /// Creates or updates a sim via a REST Method Request
361 /// BROKEN with SQL Update
362 /// </summary>
363 /// <param name="request"></param>
364 /// <param name="path"></param>
365 /// <param name="param"></param>
366 /// <returns>"OK" or an error</returns>
367 public string RestSetSimMethod(string request, string path, string param)
368 {
369 Console.WriteLine("SimProfiles.cs:RestSetSimMethod() - processing request......");
370 SimProfileData TheSim;
371 TheSim = getRegion(new LLUUID(param));
372 if ((TheSim) == null)
373 {
374 TheSim = new SimProfileData();
375 LLUUID UUID = new LLUUID(param);
376 TheSim.UUID = UUID;
377 TheSim.regionRecvKey = config.SimRecvKey;
378 }
379
380 XmlDocument doc = new XmlDocument();
381 doc.LoadXml(request);
382 XmlNode rootnode = doc.FirstChild;
383 XmlNode authkeynode = rootnode.ChildNodes[0];
384 if (authkeynode.Name != "authkey")
385 {
386 return "ERROR! bad XML - expected authkey tag";
387 }
388
389 XmlNode simnode = rootnode.ChildNodes[1];
390 if (simnode.Name != "sim")
391 {
392 return "ERROR! bad XML - expected sim tag";
393 }
394
395 if (authkeynode.InnerText != TheSim.regionRecvKey)
396 {
397 return "ERROR! invalid key";
398 }
399
400 //TheSim.regionSendKey = Cfg;
401 TheSim.regionRecvKey = config.SimRecvKey;
402 TheSim.regionSendKey = config.SimSendKey;
403 TheSim.regionSecret = config.SimRecvKey;
404 TheSim.regionDataURI = "";
405 TheSim.regionAssetURI = config.DefaultAssetServer;
406 TheSim.regionAssetRecvKey = config.AssetRecvKey;
407 TheSim.regionAssetSendKey = config.AssetSendKey;
408 TheSim.regionUserURI = config.DefaultUserServer;
409 TheSim.regionUserSendKey = config.UserSendKey;
410 TheSim.regionUserRecvKey = config.UserRecvKey;
411
412
413 for (int i = 0; i < simnode.ChildNodes.Count; i++)
414 {
415 switch (simnode.ChildNodes[i].Name)
416 {
417 case "regionname":
418 TheSim.regionName = simnode.ChildNodes[i].InnerText;
419 break;
420
421 case "sim_ip":
422 TheSim.serverIP = simnode.ChildNodes[i].InnerText;
423 break;
424
425 case "sim_port":
426 TheSim.serverPort = Convert.ToUInt32(simnode.ChildNodes[i].InnerText);
427 break;
428
429 case "region_locx":
430 TheSim.regionLocX = Convert.ToUInt32((string)simnode.ChildNodes[i].InnerText);
431 TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256));
432 break;
433
434 case "region_locy":
435 TheSim.regionLocY = Convert.ToUInt32((string)simnode.ChildNodes[i].InnerText);
436 TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256));
437 break;
438 }
439 }
440
441 TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/";
442
443 bool requirePublic = false;
444
445 if (requirePublic && (TheSim.serverIP.StartsWith("172.16") || TheSim.serverIP.StartsWith("192.168") || TheSim.serverIP.StartsWith("10.") || TheSim.serverIP.StartsWith("0.") || TheSim.serverIP.StartsWith("255.")))
446 {
447 return "ERROR! Servers must register with public addresses.";
448 }
449
450 try
451 {
452 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Attempting to add a new region to the grid - " + _plugins.Count + " storage provider(s) registered.");
453 foreach (KeyValuePair<string, IGridData> kvp in _plugins)
454 {
455 try
456 {
457 kvp.Value.AddProfile(TheSim);
458 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"New sim added to grid (" + TheSim.regionName + ")");
459 }
460 catch (Exception e)
461 {
462 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + e.ToString());
463 }
464 }
465 return "OK";
466 }
467 catch (Exception e)
468 {
469 return "ERROR! Could not save to database! (" + e.ToString() + ")";
470 }
471 }
472
473 }
474}
diff --git a/OpenGridServices/OpenGridServices.GridServer/Main.cs b/OpenGridServices/OpenGridServices.GridServer/Main.cs
new file mode 100644
index 0000000..8baf293
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.GridServer/Main.cs
@@ -0,0 +1,272 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3
4
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.IO;
32using System.Text;
33using System.Timers;
34using System.Net;
35using System.Threading;
36using System.Reflection;
37using libsecondlife;
38using OpenGrid.Framework.Manager;
39using OpenSim.Framework;
40using OpenSim.Framework.Sims;
41using OpenSim.Framework.Console;
42using OpenSim.Framework.Interfaces;
43using OpenSim.Servers;
44using OpenSim.GenericConfig;
45
46namespace OpenGridServices.GridServer
47{
48 /// <summary>
49 /// </summary>
50 public class OpenGrid_Main : BaseServer, conscmd_callback
51 {
52 private string ConfigDll = "OpenGrid.Config.GridConfigDb4o.dll";
53 private string GridDll = "OpenGrid.Framework.Data.DB4o.dll";
54 public GridConfig Cfg;
55
56 public static OpenGrid_Main thegrid;
57 protected IGenericConfig localXMLConfig;
58
59 public static bool setuponly;
60
61 //public LLUUID highestUUID;
62
63 // private SimProfileManager m_simProfileManager;
64
65 private GridManager m_gridManager;
66
67 private ConsoleBase m_console;
68
69 [STAThread]
70 public static void Main(string[] args)
71 {
72 if (args.Length > 0)
73 {
74 if (args[0] == "-setuponly") setuponly = true;
75 }
76 Console.WriteLine("Starting...\n");
77
78 thegrid = new OpenGrid_Main();
79 thegrid.Startup();
80
81 thegrid.Work();
82 }
83
84 private void Work()
85 {
86 while (true)
87 {
88 Thread.Sleep(5000);
89 // should flush the DB etc here
90 }
91 }
92
93 private OpenGrid_Main()
94 {
95 m_console = new ConsoleBase("opengrid-gridserver-console.log", "OpenGrid", this, false);
96 MainConsole.Instance = m_console;
97
98
99 }
100
101 public void managercallback(string cmd)
102 {
103 switch (cmd)
104 {
105 case "shutdown":
106 RunCmd("shutdown", new string[0]);
107 break;
108 }
109 }
110
111
112 public void Startup()
113 {
114 this.localXMLConfig = new XmlConfig("GridServerConfig.xml");
115 this.localXMLConfig.LoadData();
116 this.ConfigDB(this.localXMLConfig);
117 this.localXMLConfig.Close();
118
119 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Loading configuration");
120 Cfg = this.LoadConfigDll(this.ConfigDll);
121 Cfg.InitConfig();
122 if (setuponly) Environment.Exit(0);
123
124 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Connecting to Storage Server");
125 m_gridManager = new GridManager();
126 m_gridManager.AddPlugin(GridDll); // Made of win
127 m_gridManager.config = Cfg;
128
129 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP process");
130 BaseHttpServer httpServer = new BaseHttpServer(8001);
131 GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback);
132
133 httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcLoginToSimulatorMethod);
134 httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod);
135
136 httpServer.AddRestHandler("GET", "/sims/", m_gridManager.RestGetSimMethod);
137 httpServer.AddRestHandler("POST", "/sims/", m_gridManager.RestSetSimMethod);
138 httpServer.AddRestHandler("GET", "/regions/", m_gridManager.RestGetRegionMethod);
139 httpServer.AddRestHandler("POST", "/regions/", m_gridManager.RestSetRegionMethod);
140
141
142 // lbsa71 : This code snippet taken from old http server.
143 // I have no idea what this was supposed to do - looks like an infinite recursion to me.
144 // case "regions":
145 //// DIRTY HACK ALERT
146 //Console.WriteLine("/regions/ accessed");
147 //TheSim = OpenGrid_Main.thegrid._regionmanager.GetProfileByHandle((ulong)Convert.ToUInt64(rest_params[1]));
148 //respstring = ParseREST("/regions/" + rest_params[1], requestBody, HTTPmethod);
149 //break;
150
151 // lbsa71 : I guess these were never used?
152 //Listener.Prefixes.Add("http://+:8001/gods/");
153 //Listener.Prefixes.Add("http://+:8001/highestuuid/");
154 //Listener.Prefixes.Add("http://+:8001/uuidblocks/");
155
156 httpServer.Start();
157
158 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting sim status checker");
159
160 System.Timers.Timer simCheckTimer = new System.Timers.Timer(300000); // 5 minutes
161 simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims);
162 simCheckTimer.Enabled = true;
163 }
164
165 private GridConfig LoadConfigDll(string dllName)
166 {
167 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
168 GridConfig config = null;
169
170 foreach (Type pluginType in pluginAssembly.GetTypes())
171 {
172 if (pluginType.IsPublic)
173 {
174 if (!pluginType.IsAbstract)
175 {
176 Type typeInterface = pluginType.GetInterface("IGridConfig", true);
177
178 if (typeInterface != null)
179 {
180 IGridConfig plug = (IGridConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
181 config = plug.GetConfigObject();
182 break;
183 }
184
185 typeInterface = null;
186 }
187 }
188 }
189 pluginAssembly = null;
190 return config;
191 }
192
193 public void CheckSims(object sender, ElapsedEventArgs e)
194 {
195 /*
196 foreach (SimProfileBase sim in m_simProfileManager.SimProfiles.Values)
197 {
198 string SimResponse = "";
199 try
200 {
201 WebRequest CheckSim = WebRequest.Create("http://" + sim.sim_ip + ":" + sim.sim_port.ToString() + "/checkstatus/");
202 CheckSim.Method = "GET";
203 CheckSim.ContentType = "text/plaintext";
204 CheckSim.ContentLength = 0;
205
206 StreamWriter stOut = new StreamWriter(CheckSim.GetRequestStream(), System.Text.Encoding.ASCII);
207 stOut.Write("");
208 stOut.Close();
209
210 StreamReader stIn = new StreamReader(CheckSim.GetResponse().GetResponseStream());
211 SimResponse = stIn.ReadToEnd();
212 stIn.Close();
213 }
214 catch
215 {
216 }
217
218 if (SimResponse == "OK")
219 {
220 m_simProfileManager.SimProfiles[sim.UUID].online = true;
221 }
222 else
223 {
224 m_simProfileManager.SimProfiles[sim.UUID].online = false;
225 }
226 }
227 */
228 }
229
230 public void RunCmd(string cmd, string[] cmdparams)
231 {
232 switch (cmd)
233 {
234 case "help":
235 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "shutdown - shutdown the grid (USE CAUTION!)");
236 break;
237
238 case "shutdown":
239 m_console.Close();
240 Environment.Exit(0);
241 break;
242 }
243 }
244
245 public void Show(string ShowWhat)
246 {
247 }
248
249 private void ConfigDB(IGenericConfig configData)
250 {
251 try
252 {
253 string attri = "";
254 attri = configData.GetAttribute("DataBaseProvider");
255 if (attri == "")
256 {
257 GridDll = "OpenGrid.Framework.Data.DB4o.dll";
258 configData.SetAttribute("DataBaseProvider", "OpenGrid.Framework.Data.DB4o.dll");
259 }
260 else
261 {
262 GridDll = attri;
263 }
264 configData.Commit();
265 }
266 catch (Exception e)
267 {
268
269 }
270 }
271 }
272}
diff --git a/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj b/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj
new file mode 100644
index 0000000..f4a6ca1
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj
@@ -0,0 +1,134 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{21BFC8E2-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGridServices.GridServer</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Exe</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGridServices.GridServer</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Data" >
66 <HintPath>System.Data.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Xml" >
70 <HintPath>System.Xml.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="OpenSim.Framework" >
74 <HintPath>OpenSim.Framework.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="OpenSim.Framework.Console" >
78 <HintPath>OpenSim.Framework.Console.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 <Reference Include="OpenSim.Servers" >
82 <HintPath>OpenSim.Servers.dll</HintPath>
83 <Private>False</Private>
84 </Reference>
85 <Reference Include="OpenSim.GenericConfig.Xml" >
86 <HintPath>OpenSim.GenericConfig.Xml.dll</HintPath>
87 <Private>False</Private>
88 </Reference>
89 <Reference Include="libsecondlife.dll" >
90 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
91 <Private>False</Private>
92 </Reference>
93 <Reference Include="Db4objects.Db4o.dll" >
94 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
95 <Private>False</Private>
96 </Reference>
97 <Reference Include="XMLRPC" >
98 <HintPath>XMLRPC.dll</HintPath>
99 <Private>False</Private>
100 </Reference>
101 </ItemGroup>
102 <ItemGroup>
103 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
104 <Name>OpenGrid.Framework.Data</Name>
105 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
106 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
107 <Private>False</Private>
108 </ProjectReference>
109 <ProjectReference Include="..\OpenGrid.Framework.Manager\OpenGrid.Framework.Manager.csproj">
110 <Name>OpenGrid.Framework.Manager</Name>
111 <Project>{7924FD35-0000-0000-0000-000000000000}</Project>
112 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
113 <Private>False</Private>
114 </ProjectReference>
115 </ItemGroup>
116 <ItemGroup>
117 <Compile Include="GridManager.cs">
118 <SubType>Code</SubType>
119 </Compile>
120 <Compile Include="Main.cs">
121 <SubType>Code</SubType>
122 </Compile>
123 <Compile Include="Properties\AssemblyInfo.cs">
124 <SubType>Code</SubType>
125 </Compile>
126 </ItemGroup>
127 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
128 <PropertyGroup>
129 <PreBuildEvent>
130 </PreBuildEvent>
131 <PostBuildEvent>
132 </PostBuildEvent>
133 </PropertyGroup>
134</Project>
diff --git a/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj.user b/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build b/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build
new file mode 100644
index 0000000..9d21edd
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build
@@ -0,0 +1,52 @@
1<?xml version="1.0" ?>
2<project name="OpenGridServices.GridServer" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
11 <resources prefix="OpenGridServices.GridServer" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="GridManager.cs" />
15 <include name="Main.cs" />
16 <include name="Properties/AssemblyInfo.cs" />
17 </sources>
18 <references basedir="${project::get-base-directory()}">
19 <lib>
20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib>
23 <include name="System.dll" />
24 <include name="System.Data.dll" />
25 <include name="System.Xml.dll" />
26 <include name="../../bin/OpenSim.Framework.dll" />
27 <include name="../../bin/OpenSim.Framework.Console.dll" />
28 <include name="../../bin/OpenSim.Servers.dll" />
29 <include name="../../bin/OpenGrid.Framework.Data.dll" />
30 <include name="../../bin/OpenGrid.Framework.Manager.dll" />
31 <include name="../../bin/OpenSim.GenericConfig.Xml.dll" />
32 <include name="../../bin/libsecondlife.dll" />
33 <include name="../../bin/Db4objects.Db4o.dll" />
34 <include name="../../bin/XMLRPC.dll" />
35 </references>
36 </csc>
37 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
38 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
39 <copy todir="${project::get-base-directory()}/../../bin/">
40 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
41 <include name="*.dll"/>
42 <include name="*.exe"/>
43 </fileset>
44 </copy>
45 </target>
46 <target name="clean">
47 <delete dir="${bin.dir}" failonerror="false" />
48 <delete dir="${obj.dir}" failonerror="false" />
49 </target>
50 <target name="doc" description="Creates documentation.">
51 </target>
52</project>
diff --git a/OpenGridServices/OpenGridServices.GridServer/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGridServices.GridServer/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8471e6b
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.GridServer/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OGS-GridServer")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OGS-GridServer")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("b541b244-3d1d-4625-9003-bc2a3a6a39a4")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("1.0.0.0")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.mds b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.mds
new file mode 100644
index 0000000..ed7bc24
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.mds
@@ -0,0 +1,16 @@
1<Combine name="OpenGridServices.Manager" fileversion="2.0" outputpath="../../mono-1.2.3.1/lib/monodevelop/bin" MakePkgConfig="False" MakeLibPC="True">
2 <Configurations active="Debug">
3 <Configuration name="Debug" ctype="CombineConfiguration">
4 <Entry build="True" name="OpenGridServices.Manager" configuration="Debug" />
5 </Configuration>
6 <Configuration name="Release" ctype="CombineConfiguration">
7 <Entry build="True" name="OpenGridServices.Manager" configuration="Release" />
8 </Configuration>
9 </Configurations>
10 <StartMode startupentry="OpenGridServices.Manager" single="True">
11 <Execute type="None" entry="OpenGridServices.Manager" />
12 </StartMode>
13 <Entries>
14 <Entry filename="./OpenGridServices.Manager/OpenGridServices.Manager.mdp" />
15 </Entries>
16</Combine> \ No newline at end of file
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.userprefs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.userprefs
new file mode 100644
index 0000000..f221509
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.userprefs
@@ -0,0 +1,39 @@
1<?xml version="1.0"?>
2<UserCombinePreferences filename="/home/gareth/OpenGridServices.Manager/OpenGridServices.Manager.mds">
3 <Files>
4 <File filename="Welcome" />
5 <File filename="./OpenGridServices.Manager/MainWindow.cs" />
6 <File filename="./OpenGridServices.Manager/ConnectToGridServerDialog.cs" />
7 <File filename="./OpenGridServices.Manager/Main.cs" />
8 </Files>
9 <Views>
10 <ViewMemento Id="MonoDevelop.Ide.Gui.Pads.ProjectPad">
11 <TreeView>
12 <Node expanded="True">
13 <Node name="OpenGridServices.Manager" expanded="True">
14 <Node name="References" expanded="True" />
15 <Node name="Resources" expanded="True" />
16 <Node name="UserInterface" expanded="True" />
17 <Node name="ConnectToGridServerDialog.cs" expanded="False" selected="True" />
18 </Node>
19 </Node>
20 </TreeView>
21 </ViewMemento>
22 <ViewMemento Id="MonoDevelop.Ide.Gui.Pads.ClassPad">
23 <TreeView>
24 <Node expanded="True" />
25 </TreeView>
26 </ViewMemento>
27 <ViewMemento Id="MonoDevelop.NUnit.TestPad">
28 <TreeView>
29 <Node expanded="False" />
30 </TreeView>
31 </ViewMemento>
32 </Views>
33 <Properties>
34 <Properties>
35 <Property key="ActiveConfiguration" value="Debug" />
36 <Property key="ActiveWindow" value="/home/gareth/OpenGridServices.Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs" />
37 </Properties>
38 </Properties>
39</UserCombinePreferences> \ No newline at end of file
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.usertasks b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.usertasks
new file mode 100644
index 0000000..d887d0e
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager.usertasks
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="utf-8"?>
2<ArrayOfUserTask xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> \ No newline at end of file
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/AssemblyInfo.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/AssemblyInfo.cs
new file mode 100644
index 0000000..af4e275
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/AssemblyInfo.cs
@@ -0,0 +1,32 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3
4// Information about this assembly is defined by the following
5// attributes.
6//
7// change them to the information which is associated with the assembly
8// you compile.
9
10[assembly: AssemblyTitle("")]
11[assembly: AssemblyDescription("")]
12[assembly: AssemblyConfiguration("")]
13[assembly: AssemblyCompany("")]
14[assembly: AssemblyProduct("")]
15[assembly: AssemblyCopyright("")]
16[assembly: AssemblyTrademark("")]
17[assembly: AssemblyCulture("")]
18
19// The assembly version has following format :
20//
21// Major.Minor.Build.Revision
22//
23// You can specify all values by your own or you can build default build and revision
24// numbers with the '*' character (the default):
25
26[assembly: AssemblyVersion("1.0.*")]
27
28// The following attributes specify the key for the sign of your assembly. See the
29// .NET Framework documentation for more information about signing.
30// This is not required, if you don't want signing let these attributes like they're.
31[assembly: AssemblyDelaySign(false)]
32[assembly: AssemblyKeyFile("")]
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/BlockingQueue.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/BlockingQueue.cs
new file mode 100644
index 0000000..83685fc
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/BlockingQueue.cs
@@ -0,0 +1,33 @@
1using System;
2using System.Threading;
3using System.Collections.Generic;
4using System.Text;
5
6namespace OpenGridServices.Manager
7{
8 public class BlockingQueue<T>
9 {
10 private Queue<T> _queue = new Queue<T>();
11 private object _queueSync = new object();
12
13 public void Enqueue(T value)
14 {
15 lock (_queueSync)
16 {
17 _queue.Enqueue(value);
18 Monitor.Pulse(_queueSync);
19 }
20 }
21
22 public T Dequeue()
23 {
24 lock (_queueSync)
25 {
26 if (_queue.Count < 1)
27 Monitor.Wait(_queueSync);
28
29 return _queue.Dequeue();
30 }
31 }
32 }
33}
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Connect to grid server.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Connect to grid server.cs
new file mode 100644
index 0000000..0d509ef
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Connect to grid server.cs
@@ -0,0 +1,16 @@
1
2using System;
3
4namespace OpenGridServices.Manager
5{
6
7
8 public partial class Connect to grid server : Gtk.Dialog
9 {
10
11 public Connect to grid server()
12 {
13 this.Build();
14 }
15 }
16}
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs
new file mode 100644
index 0000000..8a80b1d
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs
@@ -0,0 +1,29 @@
1using Gtk;
2using System;
3
4namespace OpenGridServices.Manager {
5 public partial class ConnectToGridServerDialog : Gtk.Dialog
6 {
7
8 public ConnectToGridServerDialog()
9 {
10 this.Build();
11 }
12
13 protected virtual void OnResponse(object o, Gtk.ResponseArgs args)
14 {
15 switch(args.ResponseId) {
16 case Gtk.ResponseType.Ok:
17 MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text);
18 break;
19
20 case Gtk.ResponseType.Cancel:
21 break;
22 }
23 this.Hide();
24
25 }
26
27 }
28
29} \ No newline at end of file
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
new file mode 100644
index 0000000..6b632d6
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
@@ -0,0 +1,106 @@
1using Nwc.XmlRpc;
2using System;
3using System.Net;
4using System.IO;
5using System.Xml;
6using System.Collections;
7using System.Collections.Generic;
8using libsecondlife;
9
10namespace OpenGridServices.Manager
11{
12 public class GridServerConnectionManager
13 {
14 private string ServerURL;
15 public LLUUID SessionID;
16 public bool connected=false;
17
18 public RegionBlock[][] WorldMap;
19
20 public bool Connect(string GridServerURL, string username, string password)
21 {
22 try {
23 this.ServerURL=GridServerURL;
24 Hashtable LoginParamsHT = new Hashtable();
25 LoginParamsHT["username"]=username;
26 LoginParamsHT["password"]=password;
27 ArrayList LoginParams = new ArrayList();
28 LoginParams.Add(LoginParamsHT);
29 XmlRpcRequest GridLoginReq = new XmlRpcRequest("manager_login",LoginParams);
30 XmlRpcResponse GridResp = GridLoginReq.Send(ServerURL,3000);
31 if(GridResp.IsFault) {
32 connected=false;
33 return false;
34 } else {
35 Hashtable gridrespData = (Hashtable)GridResp.Value;
36 this.SessionID = new LLUUID((string)gridrespData["session_id"]);
37 connected=true;
38 return true;
39 }
40 } catch(Exception e) {
41 Console.WriteLine(e.ToString());
42 connected=false;
43 return false;
44 }
45 }
46
47 public void DownloadMap()
48 {
49 System.Net.WebClient mapdownloader = new WebClient();
50 Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist");
51
52 RegionBlock TempRegionData;
53
54 XmlDocument doc = new XmlDocument();
55 doc.Load(regionliststream);
56 regionliststream.Close();
57 XmlNode rootnode = doc.FirstChild;
58 if (rootnode.Name != "regions")
59 {
60 // TODO - ERROR!
61 }
62
63 for(int i=0; i<=rootnode.ChildNodes.Count; i++)
64 {
65 if(rootnode.ChildNodes.Item(i).Name != "region") {
66 // TODO - ERROR!
67 } else {
68 TempRegionData = new RegionBlock();
69
70
71 }
72 }
73 }
74
75 public bool RestartServer()
76 {
77 return true;
78 }
79
80 public bool ShutdownServer()
81 {
82 try {
83 Hashtable ShutdownParamsHT = new Hashtable();
84 ArrayList ShutdownParams = new ArrayList();
85 ShutdownParamsHT["session_id"]=this.SessionID.ToString();
86 ShutdownParams.Add(ShutdownParamsHT);
87 XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams);
88 XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL,3000);
89 if(GridResp.IsFault) {
90 return false;
91 } else {
92 connected=false;
93 return true;
94 }
95 } catch(Exception e) {
96 Console.WriteLine(e.ToString());
97 return false;
98 }
99 }
100
101 public void DisconnectServer()
102 {
103 this.connected=false;
104 }
105 }
106}
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
new file mode 100644
index 0000000..42e09e0
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
@@ -0,0 +1,96 @@
1// project created on 5/14/2007 at 2:04 PM
2using System;
3using System.Threading;
4using Gtk;
5
6namespace OpenGridServices.Manager
7{
8 class MainClass
9 {
10
11 public static bool QuitReq=false;
12 public static BlockingQueue<string> PendingOperations = new BlockingQueue<string>();
13
14 private static Thread OperationsRunner;
15
16 private static GridServerConnectionManager gridserverConn;
17
18 private static MainWindow win;
19
20 public static void DoMainLoop()
21 {
22 while(!QuitReq)
23 {
24 Application.RunIteration();
25 }
26 }
27
28 public static void RunOperations()
29 {
30 string operation;
31 string cmd;
32 char[] sep = new char[1];
33 sep[0]=' ';
34 while(!QuitReq)
35 {
36 operation=PendingOperations.Dequeue();
37 Console.WriteLine(operation);
38 cmd = operation.Split(sep)[0];
39 switch(cmd) {
40 case "connect_to_gridserver":
41 win.SetStatus("Connecting to grid server...");
42 if(gridserverConn.Connect(operation.Split(sep)[1],operation.Split(sep)[2],operation.Split(sep)[3])) {
43 win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID);
44 win.SetGridServerConnected(true);
45 Thread.Sleep(3000);
46 win.SetStatus("Downloading region maps...");
47 gridserverConn.DownloadMap();
48 } else {
49 win.SetStatus("Could not connect");
50 }
51 break;
52
53 case "restart_gridserver":
54 win.SetStatus("Restarting grid server...");
55 if(gridserverConn.RestartServer()) {
56 win.SetStatus("Restarted server OK");
57 Thread.Sleep(3000);
58 win.SetStatus("");
59 } else {
60 win.SetStatus("Error restarting grid server!!!");
61 }
62 break;
63
64 case "shutdown_gridserver":
65 win.SetStatus("Shutting down grid server...");
66 if(gridserverConn.ShutdownServer()) {
67 win.SetStatus("Grid server shutdown");
68 win.SetGridServerConnected(false);
69 Thread.Sleep(3000);
70 win.SetStatus("");
71 } else {
72 win.SetStatus("Could not shutdown grid server!!!");
73 }
74 break;
75
76 case "disconnect_gridserver":
77 gridserverConn.DisconnectServer();
78 win.SetGridServerConnected(false);
79 break;
80 }
81 }
82 }
83
84 public static void Main (string[] args)
85 {
86 gridserverConn = new GridServerConnectionManager();
87 Application.Init ();
88 win = new MainWindow ();
89 win.Show ();
90 OperationsRunner = new Thread(new ThreadStart(RunOperations));
91 OperationsRunner.IsBackground=true;
92 OperationsRunner.Start();
93 DoMainLoop();
94 }
95 }
96} \ No newline at end of file
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs
new file mode 100644
index 0000000..1db38f0
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs
@@ -0,0 +1,76 @@
1using System;
2using Gtk;
3
4namespace OpenGridServices.Manager {
5 public partial class MainWindow: Gtk.Window
6 {
7 public MainWindow (): base (Gtk.WindowType.Toplevel)
8 {
9 Build ();
10 }
11
12 public void SetStatus(string statustext)
13 {
14 this.statusbar1.Pop(0);
15 this.statusbar1.Push(0,statustext);
16 }
17
18 public void DrawGrid(RegionBlock[][] regions)
19 {
20 for(int x=0; x<=regions.GetUpperBound(0); x++) {
21 for(int y=0; y<=regions.GetUpperBound(1); y++) {
22 Gdk.Image themap = new Gdk.Image(Gdk.ImageType.Fastest,Gdk.Visual.System,256,256);
23 this.drawingarea1.GdkWindow.DrawImage(new Gdk.GC(this.drawingarea1.GdkWindow),themap,0,0,x*256,y*256,256,256);
24 }
25 }
26 }
27
28 public void SetGridServerConnected(bool connected)
29 {
30 if(connected) {
31 this.ConnectToGridserver.Visible=false;
32 this.DisconnectFromGridServer.Visible=true;
33 } else {
34 this.ConnectToGridserver.Visible=true;
35 this.DisconnectFromGridServer.Visible=false;
36 }
37 }
38
39 protected void OnDeleteEvent (object sender, DeleteEventArgs a)
40 {
41 Application.Quit ();
42 MainClass.QuitReq=true;
43 a.RetVal = true;
44 }
45
46 protected virtual void QuitMenu(object sender, System.EventArgs e)
47 {
48 MainClass.QuitReq=true;
49 Application.Quit();
50 }
51
52 protected virtual void ConnectToGridServerMenu(object sender, System.EventArgs e)
53 {
54 ConnectToGridServerDialog griddialog = new ConnectToGridServerDialog ();
55 griddialog.Show();
56 }
57
58 protected virtual void RestartGridserverMenu(object sender, System.EventArgs e)
59 {
60 MainClass.PendingOperations.Enqueue("restart_gridserver");
61 }
62
63 protected virtual void ShutdownGridserverMenu(object sender, System.EventArgs e)
64 {
65 MainClass.PendingOperations.Enqueue("shutdown_gridserver");
66 }
67
68 protected virtual void DisconnectGridServerMenu(object sender, System.EventArgs e)
69 {
70 MainClass.PendingOperations.Enqueue("disconnect_gridserver");
71 }
72
73 }
74}
75
76 \ 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
new file mode 100644
index 0000000..cfdc085
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp
@@ -0,0 +1,43 @@
1<Project name="OpenGridServices.Manager" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject">
2 <Configurations active="Debug">
3 <Configuration name="Debug" ctype="DotNetProjectConfiguration">
4 <Output directory="./bin/Debug" assembly="OpenGridServices.Manager" />
5 <Build debugmode="True" target="Exe" />
6 <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
7 <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
8 </Configuration>
9 <Configuration name="Release" ctype="DotNetProjectConfiguration">
10 <Output directory="./bin/Release" assembly="OpenGridServices.Manager" />
11 <Build debugmode="False" target="Exe" />
12 <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
13 <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
14 </Configuration>
15 </Configurations>
16 <Contents>
17 <File name="./gtk-gui/gui.stetic" subtype="Code" buildaction="EmbedAsResource" />
18 <File name="./gtk-gui/generated.cs" subtype="Code" buildaction="Compile" />
19 <File name="./MainWindow.cs" subtype="Code" buildaction="Compile" />
20 <File name="./Main.cs" subtype="Code" buildaction="Compile" />
21 <File name="./AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
22 <File name="./ConnectToGridServerDialog.cs" subtype="Code" buildaction="Compile" />
23 <File name="./Util.cs" subtype="Code" buildaction="Compile" />
24 <File name="./gtk-gui/OpenGridServices.Manager.MainWindow.cs" subtype="Code" buildaction="Compile" />
25 <File name="./BlockingQueue.cs" subtype="Code" buildaction="Compile" />
26 <File name="./gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs" subtype="Code" buildaction="Compile" />
27 <File name="./GridServerConnectionManager.cs" subtype="Code" buildaction="Compile" />
28 <File name="./RegionBlock.cs" subtype="Code" buildaction="Compile" />
29 </Contents>
30 <References>
31 <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
32 <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
33 <ProjectReference type="Gac" localcopy="True" refto="glib-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
34 <ProjectReference type="Gac" localcopy="True" refto="glade-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
35 <ProjectReference type="Gac" localcopy="True" refto="pango-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
36 <ProjectReference type="Assembly" localcopy="True" refto="../../bin/libsecondlife.dll" />
37 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
38 <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
39 <ProjectReference type="Assembly" localcopy="True" refto="../../bin/XMLRPC.dll" />
40 <ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
41 </References>
42 <GtkDesignInfo partialTypes="True" />
43</Project> \ 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
new file mode 100644
index 0000000..44e7a61
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.pidb
Binary files differ
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/RegionBlock.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/RegionBlock.cs
new file mode 100644
index 0000000..00f7c65
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/RegionBlock.cs
@@ -0,0 +1,37 @@
1using System;
2using System.Xml;
3using libsecondlife;
4using OpenSim.Framework.Utilities;
5
6namespace OpenGridServices.Manager
7{
8
9
10 public class RegionBlock
11 {
12 public uint regloc_x;
13 public uint regloc_y;
14
15 public string httpd_url;
16
17 public string region_name;
18
19 public ulong regionhandle {
20 get { return Util.UIntsToLong(regloc_x*256,regloc_y*256); }
21 }
22
23 public Gdk.Pixbuf MiniMap;
24
25 public RegionBlock()
26 {
27 }
28
29 public void LoadFromXmlNode(XmlNode sourcenode)
30 {
31 this.regloc_x=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_x").Value);
32 this.regloc_y=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_y").Value);
33 this.region_name=sourcenode.Attributes.GetNamedItem("region_name").Value;
34 this.httpd_url=sourcenode.Attributes.GetNamedItem("httpd_url").Value;
35 }
36 }
37}
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs
new file mode 100644
index 0000000..5bf7ff9
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs
@@ -0,0 +1,133 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using libsecondlife.Packets;
6
7namespace OpenSim.Framework.Utilities
8{
9 public class Util
10 {
11 private static Random randomClass = new Random();
12 private static uint nextXferID = 5000;
13 private static object XferLock = new object();
14
15 public static ulong UIntsToLong(uint X, uint Y)
16 {
17 return Helpers.UIntsToLong(X, Y);
18 }
19
20 public static Random RandomClass
21 {
22 get
23 {
24 return randomClass;
25 }
26 }
27
28 public static uint GetNextXferID()
29 {
30 uint id = 0;
31 lock(XferLock)
32 {
33 id = nextXferID;
34 nextXferID++;
35 }
36 return id;
37 }
38
39 //public static int fast_distance2d(int x, int y)
40 //{
41 // x = System.Math.Abs(x);
42 // y = System.Math.Abs(y);
43
44 // int min = System.Math.Min(x, y);
45
46 // return (x + y - (min >> 1) - (min >> 2) + (min >> 4));
47 //}
48
49 public static string FieldToString(byte[] bytes)
50 {
51 return FieldToString(bytes, String.Empty);
52 }
53
54 /// <summary>
55 /// Convert a variable length field (byte array) to a string, with a
56 /// field name prepended to each line of the output
57 /// </summary>
58 /// <remarks>If the byte array has unprintable characters in it, a
59 /// hex dump will be put in the string instead</remarks>
60 /// <param name="bytes">The byte array to convert to a string</param>
61 /// <param name="fieldName">A field name to prepend to each line of output</param>
62 /// <returns>An ASCII string or a string containing a hex dump, minus
63 /// the null terminator</returns>
64 public static string FieldToString(byte[] bytes, string fieldName)
65 {
66 // Check for a common case
67 if (bytes.Length == 0) return String.Empty;
68
69 StringBuilder output = new StringBuilder();
70 bool printable = true;
71
72 for (int i = 0; i < bytes.Length; ++i)
73 {
74 // Check if there are any unprintable characters in the array
75 if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09
76 && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00)
77 {
78 printable = false;
79 break;
80 }
81 }
82
83 if (printable)
84 {
85 if (fieldName.Length > 0)
86 {
87 output.Append(fieldName);
88 output.Append(": ");
89 }
90
91 if (bytes[bytes.Length - 1] == 0x00)
92 output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1));
93 else
94 output.Append(UTF8Encoding.UTF8.GetString(bytes));
95 }
96 else
97 {
98 for (int i = 0; i < bytes.Length; i += 16)
99 {
100 if (i != 0)
101 output.Append(Environment.NewLine);
102 if (fieldName.Length > 0)
103 {
104 output.Append(fieldName);
105 output.Append(": ");
106 }
107
108 for (int j = 0; j < 16; j++)
109 {
110 if ((i + j) < bytes.Length)
111 output.Append(String.Format("{0:X2} ", bytes[i + j]));
112 else
113 output.Append(" ");
114 }
115
116 for (int j = 0; j < 16 && (i + j) < bytes.Length; j++)
117 {
118 if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E)
119 output.Append((char)bytes[i + j]);
120 else
121 output.Append(".");
122 }
123 }
124 }
125
126 return output.ToString();
127 }
128 public Util()
129 {
130
131 }
132 }
133}
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
new file mode 100644
index 0000000..da6739e
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs
@@ -0,0 +1,226 @@
1// ------------------------------------------------------------------------------
2// <autogenerated>
3// This code was generated by a tool.
4// Mono Runtime Version: 2.0.50727.42
5//
6// Changes to this file may cause incorrect behavior and will be lost if
7// the code is regenerated.
8// </autogenerated>
9// ------------------------------------------------------------------------------
10
11namespace OpenGridServices.Manager {
12
13
14 public partial class ConnectToGridServerDialog {
15
16 private Gtk.VBox vbox2;
17
18 private Gtk.VBox vbox3;
19
20 private Gtk.HBox hbox1;
21
22 private Gtk.Label label1;
23
24 private Gtk.Entry entry1;
25
26 private Gtk.HBox hbox2;
27
28 private Gtk.Label label2;
29
30 private Gtk.Entry entry2;
31
32 private Gtk.HBox hbox3;
33
34 private Gtk.Label label3;
35
36 private Gtk.Entry entry3;
37
38 private Gtk.Button button2;
39
40 private Gtk.Button button8;
41
42 protected virtual void Build() {
43 Stetic.Gui.Initialize();
44 // Widget OpenGridServices.Manager.ConnectToGridServerDialog
45 this.Events = ((Gdk.EventMask)(256));
46 this.Name = "OpenGridServices.Manager.ConnectToGridServerDialog";
47 this.Title = Mono.Unix.Catalog.GetString("Connect to Grid server");
48 this.WindowPosition = ((Gtk.WindowPosition)(4));
49 this.HasSeparator = false;
50 // Internal child OpenGridServices.Manager.ConnectToGridServerDialog.VBox
51 Gtk.VBox w1 = this.VBox;
52 w1.Events = ((Gdk.EventMask)(256));
53 w1.Name = "dialog_VBox";
54 w1.BorderWidth = ((uint)(2));
55 // Container child dialog_VBox.Gtk.Box+BoxChild
56 this.vbox2 = new Gtk.VBox();
57 this.vbox2.Name = "vbox2";
58 // Container child vbox2.Gtk.Box+BoxChild
59 this.vbox3 = new Gtk.VBox();
60 this.vbox3.Name = "vbox3";
61 // Container child vbox3.Gtk.Box+BoxChild
62 this.hbox1 = new Gtk.HBox();
63 this.hbox1.Name = "hbox1";
64 // Container child hbox1.Gtk.Box+BoxChild
65 this.label1 = new Gtk.Label();
66 this.label1.Name = "label1";
67 this.label1.Xalign = 1F;
68 this.label1.LabelProp = Mono.Unix.Catalog.GetString("Grid server URL: ");
69 this.label1.Justify = ((Gtk.Justification)(1));
70 this.hbox1.Add(this.label1);
71 Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.label1]));
72 w2.Position = 0;
73 // Container child hbox1.Gtk.Box+BoxChild
74 this.entry1 = new Gtk.Entry();
75 this.entry1.CanFocus = true;
76 this.entry1.Name = "entry1";
77 this.entry1.Text = Mono.Unix.Catalog.GetString("http://gridserver:8001");
78 this.entry1.IsEditable = true;
79 this.entry1.MaxLength = 255;
80 this.entry1.InvisibleChar = '•';
81 this.hbox1.Add(this.entry1);
82 Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.hbox1[this.entry1]));
83 w3.Position = 1;
84 this.vbox3.Add(this.hbox1);
85 Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox1]));
86 w4.Position = 0;
87 w4.Expand = false;
88 w4.Fill = false;
89 // Container child vbox3.Gtk.Box+BoxChild
90 this.hbox2 = new Gtk.HBox();
91 this.hbox2.Name = "hbox2";
92 // Container child hbox2.Gtk.Box+BoxChild
93 this.label2 = new Gtk.Label();
94 this.label2.Name = "label2";
95 this.label2.Xalign = 1F;
96 this.label2.LabelProp = Mono.Unix.Catalog.GetString("Username:");
97 this.label2.Justify = ((Gtk.Justification)(1));
98 this.hbox2.Add(this.label2);
99 Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(this.hbox2[this.label2]));
100 w5.Position = 0;
101 // Container child hbox2.Gtk.Box+BoxChild
102 this.entry2 = new Gtk.Entry();
103 this.entry2.CanFocus = true;
104 this.entry2.Name = "entry2";
105 this.entry2.IsEditable = true;
106 this.entry2.InvisibleChar = '•';
107 this.hbox2.Add(this.entry2);
108 Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.hbox2[this.entry2]));
109 w6.Position = 1;
110 this.vbox3.Add(this.hbox2);
111 Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox2]));
112 w7.Position = 1;
113 w7.Expand = false;
114 w7.Fill = false;
115 // Container child vbox3.Gtk.Box+BoxChild
116 this.hbox3 = new Gtk.HBox();
117 this.hbox3.Name = "hbox3";
118 // Container child hbox3.Gtk.Box+BoxChild
119 this.label3 = new Gtk.Label();
120 this.label3.Name = "label3";
121 this.label3.Xalign = 1F;
122 this.label3.LabelProp = Mono.Unix.Catalog.GetString("Password:");
123 this.label3.Justify = ((Gtk.Justification)(1));
124 this.hbox3.Add(this.label3);
125 Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.hbox3[this.label3]));
126 w8.Position = 0;
127 // Container child hbox3.Gtk.Box+BoxChild
128 this.entry3 = new Gtk.Entry();
129 this.entry3.CanFocus = true;
130 this.entry3.Name = "entry3";
131 this.entry3.IsEditable = true;
132 this.entry3.InvisibleChar = '•';
133 this.hbox3.Add(this.entry3);
134 Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.hbox3[this.entry3]));
135 w9.Position = 1;
136 this.vbox3.Add(this.hbox3);
137 Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox3]));
138 w10.Position = 2;
139 w10.Expand = false;
140 w10.Fill = false;
141 this.vbox2.Add(this.vbox3);
142 Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(this.vbox2[this.vbox3]));
143 w11.Position = 2;
144 w11.Expand = false;
145 w11.Fill = false;
146 w1.Add(this.vbox2);
147 Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(w1[this.vbox2]));
148 w12.Position = 0;
149 // Internal child OpenGridServices.Manager.ConnectToGridServerDialog.ActionArea
150 Gtk.HButtonBox w13 = this.ActionArea;
151 w13.Events = ((Gdk.EventMask)(256));
152 w13.Name = "OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea";
153 w13.Spacing = 6;
154 w13.BorderWidth = ((uint)(5));
155 w13.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
156 // Container child OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild
157 this.button2 = new Gtk.Button();
158 this.button2.CanDefault = true;
159 this.button2.CanFocus = true;
160 this.button2.Name = "button2";
161 this.button2.UseUnderline = true;
162 // Container child button2.Gtk.Container+ContainerChild
163 Gtk.Alignment w14 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
164 w14.Name = "GtkAlignment";
165 // Container child GtkAlignment.Gtk.Container+ContainerChild
166 Gtk.HBox w15 = new Gtk.HBox();
167 w15.Name = "GtkHBox";
168 w15.Spacing = 2;
169 // Container child GtkHBox.Gtk.Container+ContainerChild
170 Gtk.Image w16 = new Gtk.Image();
171 w16.Name = "image1";
172 w16.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-apply", 16, 0);
173 w15.Add(w16);
174 // Container child GtkHBox.Gtk.Container+ContainerChild
175 Gtk.Label w18 = new Gtk.Label();
176 w18.Name = "GtkLabel";
177 w18.LabelProp = Mono.Unix.Catalog.GetString("Connect");
178 w18.UseUnderline = true;
179 w15.Add(w18);
180 w14.Add(w15);
181 this.button2.Add(w14);
182 this.AddActionWidget(this.button2, -5);
183 Gtk.ButtonBox.ButtonBoxChild w22 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.button2]));
184 w22.Expand = false;
185 w22.Fill = false;
186 // Container child OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild
187 this.button8 = new Gtk.Button();
188 this.button8.CanDefault = true;
189 this.button8.CanFocus = true;
190 this.button8.Name = "button8";
191 this.button8.UseUnderline = true;
192 // Container child button8.Gtk.Container+ContainerChild
193 Gtk.Alignment w23 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
194 w23.Name = "GtkAlignment1";
195 // Container child GtkAlignment1.Gtk.Container+ContainerChild
196 Gtk.HBox w24 = new Gtk.HBox();
197 w24.Name = "GtkHBox1";
198 w24.Spacing = 2;
199 // Container child GtkHBox1.Gtk.Container+ContainerChild
200 Gtk.Image w25 = new Gtk.Image();
201 w25.Name = "image2";
202 w25.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-cancel", 16, 0);
203 w24.Add(w25);
204 // Container child GtkHBox1.Gtk.Container+ContainerChild
205 Gtk.Label w27 = new Gtk.Label();
206 w27.Name = "GtkLabel1";
207 w27.LabelProp = Mono.Unix.Catalog.GetString("Cancel");
208 w27.UseUnderline = true;
209 w24.Add(w27);
210 w23.Add(w24);
211 this.button8.Add(w23);
212 this.AddActionWidget(this.button8, -6);
213 Gtk.ButtonBox.ButtonBoxChild w31 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.button8]));
214 w31.Position = 1;
215 w31.Expand = false;
216 w31.Fill = false;
217 if ((this.Child != null)) {
218 this.Child.ShowAll();
219 }
220 this.DefaultWidth = 476;
221 this.DefaultHeight = 137;
222 this.Show();
223 this.Response += new Gtk.ResponseHandler(this.OnResponse);
224 }
225 }
226}
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
new file mode 100644
index 0000000..8798dac
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs
@@ -0,0 +1,256 @@
1// ------------------------------------------------------------------------------
2// <autogenerated>
3// This code was generated by a tool.
4// Mono Runtime Version: 2.0.50727.42
5//
6// Changes to this file may cause incorrect behavior and will be lost if
7// the code is regenerated.
8// </autogenerated>
9// ------------------------------------------------------------------------------
10
11namespace OpenGridServices.Manager {
12
13
14 public partial class MainWindow {
15
16 private Gtk.Action Grid;
17
18 private Gtk.Action User;
19
20 private Gtk.Action Asset;
21
22 private Gtk.Action Region;
23
24 private Gtk.Action Services;
25
26 private Gtk.Action ConnectToGridserver;
27
28 private Gtk.Action RestartWholeGrid;
29
30 private Gtk.Action ShutdownWholeGrid;
31
32 private Gtk.Action ExitGridManager;
33
34 private Gtk.Action ConnectToUserserver;
35
36 private Gtk.Action AccountManagment;
37
38 private Gtk.Action GlobalNotice;
39
40 private Gtk.Action DisableAllLogins;
41
42 private Gtk.Action DisableNonGodUsersOnly;
43
44 private Gtk.Action ShutdownUserServer;
45
46 private Gtk.Action ShutdownGridserverOnly;
47
48 private Gtk.Action RestartGridserverOnly;
49
50 private Gtk.Action DefaultLocalGridUserserver;
51
52 private Gtk.Action CustomUserserver;
53
54 private Gtk.Action RemoteGridDefaultUserserver;
55
56 private Gtk.Action DisconnectFromGridServer;
57
58 private Gtk.Action UploadAsset;
59
60 private Gtk.Action AssetManagement;
61
62 private Gtk.Action ConnectToAssetServer;
63
64 private Gtk.Action ConnectToDefaultAssetServerForGrid;
65
66 private Gtk.Action DefaultForLocalGrid;
67
68 private Gtk.Action DefaultForRemoteGrid;
69
70 private Gtk.Action CustomAssetServer;
71
72 private Gtk.VBox vbox1;
73
74 private Gtk.MenuBar menubar2;
75
76 private Gtk.HBox hbox1;
77
78 private Gtk.ScrolledWindow scrolledwindow1;
79
80 private Gtk.DrawingArea drawingarea1;
81
82 private Gtk.TreeView treeview1;
83
84 private Gtk.Statusbar statusbar1;
85
86 protected virtual void Build() {
87 Stetic.Gui.Initialize();
88 // Widget OpenGridServices.Manager.MainWindow
89 Gtk.UIManager w1 = new Gtk.UIManager();
90 Gtk.ActionGroup w2 = new Gtk.ActionGroup("Default");
91 this.Grid = new Gtk.Action("Grid", Mono.Unix.Catalog.GetString("Grid"), null, null);
92 this.Grid.HideIfEmpty = false;
93 this.Grid.ShortLabel = Mono.Unix.Catalog.GetString("Grid");
94 w2.Add(this.Grid, "<Alt><Mod2>g");
95 this.User = new Gtk.Action("User", Mono.Unix.Catalog.GetString("User"), null, null);
96 this.User.HideIfEmpty = false;
97 this.User.ShortLabel = Mono.Unix.Catalog.GetString("User");
98 w2.Add(this.User, null);
99 this.Asset = new Gtk.Action("Asset", Mono.Unix.Catalog.GetString("Asset"), null, null);
100 this.Asset.HideIfEmpty = false;
101 this.Asset.ShortLabel = Mono.Unix.Catalog.GetString("Asset");
102 w2.Add(this.Asset, null);
103 this.Region = new Gtk.Action("Region", Mono.Unix.Catalog.GetString("Region"), null, null);
104 this.Region.ShortLabel = Mono.Unix.Catalog.GetString("Region");
105 w2.Add(this.Region, null);
106 this.Services = new Gtk.Action("Services", Mono.Unix.Catalog.GetString("Services"), null, null);
107 this.Services.ShortLabel = Mono.Unix.Catalog.GetString("Services");
108 w2.Add(this.Services, null);
109 this.ConnectToGridserver = new Gtk.Action("ConnectToGridserver", Mono.Unix.Catalog.GetString("Connect to gridserver..."), null, "gtk-connect");
110 this.ConnectToGridserver.HideIfEmpty = false;
111 this.ConnectToGridserver.ShortLabel = Mono.Unix.Catalog.GetString("Connect to gridserver");
112 w2.Add(this.ConnectToGridserver, null);
113 this.RestartWholeGrid = new Gtk.Action("RestartWholeGrid", Mono.Unix.Catalog.GetString("Restart whole grid"), null, "gtk-refresh");
114 this.RestartWholeGrid.ShortLabel = Mono.Unix.Catalog.GetString("Restart whole grid");
115 w2.Add(this.RestartWholeGrid, null);
116 this.ShutdownWholeGrid = new Gtk.Action("ShutdownWholeGrid", Mono.Unix.Catalog.GetString("Shutdown whole grid"), null, "gtk-stop");
117 this.ShutdownWholeGrid.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown whole grid");
118 w2.Add(this.ShutdownWholeGrid, null);
119 this.ExitGridManager = new Gtk.Action("ExitGridManager", Mono.Unix.Catalog.GetString("Exit grid manager"), null, "gtk-close");
120 this.ExitGridManager.ShortLabel = Mono.Unix.Catalog.GetString("Exit grid manager");
121 w2.Add(this.ExitGridManager, null);
122 this.ConnectToUserserver = new Gtk.Action("ConnectToUserserver", Mono.Unix.Catalog.GetString("Connect to userserver"), null, "gtk-connect");
123 this.ConnectToUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Connect to userserver");
124 w2.Add(this.ConnectToUserserver, null);
125 this.AccountManagment = new Gtk.Action("AccountManagment", Mono.Unix.Catalog.GetString("Account managment"), null, "gtk-properties");
126 this.AccountManagment.ShortLabel = Mono.Unix.Catalog.GetString("Account managment");
127 w2.Add(this.AccountManagment, null);
128 this.GlobalNotice = new Gtk.Action("GlobalNotice", Mono.Unix.Catalog.GetString("Global notice"), null, "gtk-network");
129 this.GlobalNotice.ShortLabel = Mono.Unix.Catalog.GetString("Global notice");
130 w2.Add(this.GlobalNotice, null);
131 this.DisableAllLogins = new Gtk.Action("DisableAllLogins", Mono.Unix.Catalog.GetString("Disable all logins"), null, "gtk-no");
132 this.DisableAllLogins.ShortLabel = Mono.Unix.Catalog.GetString("Disable all logins");
133 w2.Add(this.DisableAllLogins, null);
134 this.DisableNonGodUsersOnly = new Gtk.Action("DisableNonGodUsersOnly", Mono.Unix.Catalog.GetString("Disable non-god users only"), null, "gtk-no");
135 this.DisableNonGodUsersOnly.ShortLabel = Mono.Unix.Catalog.GetString("Disable non-god users only");
136 w2.Add(this.DisableNonGodUsersOnly, null);
137 this.ShutdownUserServer = new Gtk.Action("ShutdownUserServer", Mono.Unix.Catalog.GetString("Shutdown user server"), null, "gtk-stop");
138 this.ShutdownUserServer.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown user server");
139 w2.Add(this.ShutdownUserServer, null);
140 this.ShutdownGridserverOnly = new Gtk.Action("ShutdownGridserverOnly", Mono.Unix.Catalog.GetString("Shutdown gridserver only"), null, "gtk-stop");
141 this.ShutdownGridserverOnly.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown gridserver only");
142 w2.Add(this.ShutdownGridserverOnly, null);
143 this.RestartGridserverOnly = new Gtk.Action("RestartGridserverOnly", Mono.Unix.Catalog.GetString("Restart gridserver only"), null, "gtk-refresh");
144 this.RestartGridserverOnly.ShortLabel = Mono.Unix.Catalog.GetString("Restart gridserver only");
145 w2.Add(this.RestartGridserverOnly, null);
146 this.DefaultLocalGridUserserver = new Gtk.Action("DefaultLocalGridUserserver", Mono.Unix.Catalog.GetString("Default local grid userserver"), null, null);
147 this.DefaultLocalGridUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Default local grid userserver");
148 w2.Add(this.DefaultLocalGridUserserver, null);
149 this.CustomUserserver = new Gtk.Action("CustomUserserver", Mono.Unix.Catalog.GetString("Custom userserver..."), null, null);
150 this.CustomUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Custom userserver");
151 w2.Add(this.CustomUserserver, null);
152 this.RemoteGridDefaultUserserver = new Gtk.Action("RemoteGridDefaultUserserver", Mono.Unix.Catalog.GetString("Remote grid default userserver..."), null, null);
153 this.RemoteGridDefaultUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Remote grid default userserver");
154 w2.Add(this.RemoteGridDefaultUserserver, null);
155 this.DisconnectFromGridServer = new Gtk.Action("DisconnectFromGridServer", Mono.Unix.Catalog.GetString("Disconnect from grid server"), null, "gtk-disconnect");
156 this.DisconnectFromGridServer.ShortLabel = Mono.Unix.Catalog.GetString("Disconnect from grid server");
157 this.DisconnectFromGridServer.Visible = false;
158 w2.Add(this.DisconnectFromGridServer, null);
159 this.UploadAsset = new Gtk.Action("UploadAsset", Mono.Unix.Catalog.GetString("Upload asset"), null, null);
160 this.UploadAsset.ShortLabel = Mono.Unix.Catalog.GetString("Upload asset");
161 w2.Add(this.UploadAsset, null);
162 this.AssetManagement = new Gtk.Action("AssetManagement", Mono.Unix.Catalog.GetString("Asset management"), null, null);
163 this.AssetManagement.ShortLabel = Mono.Unix.Catalog.GetString("Asset management");
164 w2.Add(this.AssetManagement, null);
165 this.ConnectToAssetServer = new Gtk.Action("ConnectToAssetServer", Mono.Unix.Catalog.GetString("Connect to asset server"), null, null);
166 this.ConnectToAssetServer.ShortLabel = Mono.Unix.Catalog.GetString("Connect to asset server");
167 w2.Add(this.ConnectToAssetServer, null);
168 this.ConnectToDefaultAssetServerForGrid = new Gtk.Action("ConnectToDefaultAssetServerForGrid", Mono.Unix.Catalog.GetString("Connect to default asset server for grid"), null, null);
169 this.ConnectToDefaultAssetServerForGrid.ShortLabel = Mono.Unix.Catalog.GetString("Connect to default asset server for grid");
170 w2.Add(this.ConnectToDefaultAssetServerForGrid, null);
171 this.DefaultForLocalGrid = new Gtk.Action("DefaultForLocalGrid", Mono.Unix.Catalog.GetString("Default for local grid"), null, null);
172 this.DefaultForLocalGrid.ShortLabel = Mono.Unix.Catalog.GetString("Default for local grid");
173 w2.Add(this.DefaultForLocalGrid, null);
174 this.DefaultForRemoteGrid = new Gtk.Action("DefaultForRemoteGrid", Mono.Unix.Catalog.GetString("Default for remote grid..."), null, null);
175 this.DefaultForRemoteGrid.ShortLabel = Mono.Unix.Catalog.GetString("Default for remote grid...");
176 w2.Add(this.DefaultForRemoteGrid, null);
177 this.CustomAssetServer = new Gtk.Action("CustomAssetServer", Mono.Unix.Catalog.GetString("Custom asset server..."), null, null);
178 this.CustomAssetServer.ShortLabel = Mono.Unix.Catalog.GetString("Custom asset server...");
179 w2.Add(this.CustomAssetServer, null);
180 w1.InsertActionGroup(w2, 0);
181 this.AddAccelGroup(w1.AccelGroup);
182 this.WidthRequest = 800;
183 this.HeightRequest = 600;
184 this.Name = "OpenGridServices.Manager.MainWindow";
185 this.Title = Mono.Unix.Catalog.GetString("Open Grid Services Manager");
186 this.Icon = Gtk.IconTheme.Default.LoadIcon("gtk-network", 48, 0);
187 // Container child OpenGridServices.Manager.MainWindow.Gtk.Container+ContainerChild
188 this.vbox1 = new Gtk.VBox();
189 this.vbox1.Name = "vbox1";
190 // Container child vbox1.Gtk.Box+BoxChild
191 w1.AddUiFromString("<ui><menubar name='menubar2'><menu action='Grid'><menuitem action='ConnectToGridserver'/><menuitem action='DisconnectFromGridServer'/><separator/><menuitem action='RestartWholeGrid'/><menuitem action='RestartGridserverOnly'/><separator/><menuitem action='ShutdownWholeGrid'/><menuitem action='ShutdownGridserverOnly'/><separator/><menuitem action='ExitGridManager'/></menu><menu action='User'><menu action='ConnectToUserserver'><menuitem action='DefaultLocalGridUserserver'/><menuitem action='CustomUserserver'/><menuitem action='RemoteGridDefaultUserserver'/></menu><separator/><menuitem action='AccountManagment'/><menuitem action='GlobalNotice'/><separator/><menuitem action='DisableAllLogins'/><menuitem action='DisableNonGodUsersOnly'/><separator/><menuitem action='ShutdownUserServer'/></menu><menu action='Asset'><menuitem action='UploadAsset'/><menuitem action='AssetManagement'/><menu action='ConnectToAssetServer'><menuitem action='DefaultForLocalGrid'/><menuitem action='DefaultForRemoteGrid'/><menuitem action='CustomAssetServer'/></menu></menu><menu action='Region'/><menu action='Services'/></menubar></ui>");
192 this.menubar2 = ((Gtk.MenuBar)(w1.GetWidget("/menubar2")));
193 this.menubar2.HeightRequest = 25;
194 this.menubar2.Name = "menubar2";
195 this.vbox1.Add(this.menubar2);
196 Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.vbox1[this.menubar2]));
197 w3.Position = 0;
198 w3.Expand = false;
199 w3.Fill = false;
200 // Container child vbox1.Gtk.Box+BoxChild
201 this.hbox1 = new Gtk.HBox();
202 this.hbox1.Name = "hbox1";
203 // Container child hbox1.Gtk.Box+BoxChild
204 this.scrolledwindow1 = new Gtk.ScrolledWindow();
205 this.scrolledwindow1.CanFocus = true;
206 this.scrolledwindow1.Name = "scrolledwindow1";
207 this.scrolledwindow1.VscrollbarPolicy = ((Gtk.PolicyType)(1));
208 this.scrolledwindow1.HscrollbarPolicy = ((Gtk.PolicyType)(1));
209 // Container child scrolledwindow1.Gtk.Container+ContainerChild
210 Gtk.Viewport w4 = new Gtk.Viewport();
211 w4.Name = "GtkViewport";
212 w4.ShadowType = ((Gtk.ShadowType)(0));
213 // Container child GtkViewport.Gtk.Container+ContainerChild
214 this.drawingarea1 = new Gtk.DrawingArea();
215 this.drawingarea1.Name = "drawingarea1";
216 w4.Add(this.drawingarea1);
217 this.scrolledwindow1.Add(w4);
218 this.hbox1.Add(this.scrolledwindow1);
219 Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.hbox1[this.scrolledwindow1]));
220 w7.Position = 1;
221 // Container child hbox1.Gtk.Box+BoxChild
222 this.treeview1 = new Gtk.TreeView();
223 this.treeview1.CanFocus = true;
224 this.treeview1.Name = "treeview1";
225 this.hbox1.Add(this.treeview1);
226 Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.hbox1[this.treeview1]));
227 w8.Position = 2;
228 this.vbox1.Add(this.hbox1);
229 Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbox1]));
230 w9.Position = 1;
231 // Container child vbox1.Gtk.Box+BoxChild
232 this.statusbar1 = new Gtk.Statusbar();
233 this.statusbar1.Name = "statusbar1";
234 this.statusbar1.Spacing = 5;
235 this.vbox1.Add(this.statusbar1);
236 Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
237 w10.PackType = ((Gtk.PackType)(1));
238 w10.Position = 2;
239 w10.Expand = false;
240 w10.Fill = false;
241 this.Add(this.vbox1);
242 if ((this.Child != null)) {
243 this.Child.ShowAll();
244 }
245 this.DefaultWidth = 800;
246 this.DefaultHeight = 800;
247 this.Show();
248 this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent);
249 this.ConnectToGridserver.Activated += new System.EventHandler(this.ConnectToGridServerMenu);
250 this.ExitGridManager.Activated += new System.EventHandler(this.QuitMenu);
251 this.ShutdownGridserverOnly.Activated += new System.EventHandler(this.ShutdownGridserverMenu);
252 this.RestartGridserverOnly.Activated += new System.EventHandler(this.RestartGridserverMenu);
253 this.DisconnectFromGridServer.Activated += new System.EventHandler(this.DisconnectGridServerMenu);
254 }
255 }
256}
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/generated.cs b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/generated.cs
new file mode 100644
index 0000000..dd4abdd
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/generated.cs
@@ -0,0 +1,35 @@
1// ------------------------------------------------------------------------------
2// <autogenerated>
3// This code was generated by a tool.
4// Mono Runtime Version: 2.0.50727.42
5//
6// Changes to this file may cause incorrect behavior and will be lost if
7// the code is regenerated.
8// </autogenerated>
9// ------------------------------------------------------------------------------
10
11namespace Stetic {
12
13
14 internal class Gui {
15
16 private static bool initialized;
17
18 internal static void Initialize() {
19 if ((Stetic.Gui.initialized == false)) {
20 Stetic.Gui.initialized = true;
21 }
22 }
23 }
24
25 internal class ActionGroups {
26
27 public static Gtk.ActionGroup GetActionGroup(System.Type type) {
28 return Stetic.ActionGroups.GetActionGroup(type.FullName);
29 }
30
31 public static Gtk.ActionGroup GetActionGroup(string name) {
32 return null;
33 }
34 }
35}
diff --git a/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic
new file mode 100644
index 0000000..c883f08
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic
@@ -0,0 +1,502 @@
1<?xml version="1.0" encoding="utf-8"?>
2<stetic-interface>
3 <widget class="Gtk.Window" id="OpenGridServices.Manager.MainWindow" design-size="800 800">
4 <action-group name="Default">
5 <action id="Grid">
6 <property name="Type">Action</property>
7 <property name="Accelerator">&lt;Alt&gt;&lt;Mod2&gt;g</property>
8 <property name="HideIfEmpty">False</property>
9 <property name="Label" translatable="yes">Grid</property>
10 <property name="ShortLabel" translatable="yes">Grid</property>
11 </action>
12 <action id="User">
13 <property name="Type">Action</property>
14 <property name="HideIfEmpty">False</property>
15 <property name="Label" translatable="yes">User</property>
16 <property name="ShortLabel" translatable="yes">User</property>
17 </action>
18 <action id="Asset">
19 <property name="Type">Action</property>
20 <property name="HideIfEmpty">False</property>
21 <property name="Label" translatable="yes">Asset</property>
22 <property name="ShortLabel" translatable="yes">Asset</property>
23 </action>
24 <action id="Region">
25 <property name="Type">Action</property>
26 <property name="Label" translatable="yes">Region</property>
27 <property name="ShortLabel" translatable="yes">Region</property>
28 </action>
29 <action id="Services">
30 <property name="Type">Action</property>
31 <property name="Label" translatable="yes">Services</property>
32 <property name="ShortLabel" translatable="yes">Services</property>
33 </action>
34 <action id="ConnectToGridserver">
35 <property name="Type">Action</property>
36 <property name="HideIfEmpty">False</property>
37 <property name="Label" translatable="yes">Connect to gridserver...</property>
38 <property name="ShortLabel" translatable="yes">Connect to gridserver</property>
39 <property name="StockId">gtk-connect</property>
40 <signal name="Activated" handler="ConnectToGridServerMenu" />
41 </action>
42 <action id="RestartWholeGrid">
43 <property name="Type">Action</property>
44 <property name="Label" translatable="yes">Restart whole grid</property>
45 <property name="ShortLabel" translatable="yes">Restart whole grid</property>
46 <property name="StockId">gtk-refresh</property>
47 </action>
48 <action id="ShutdownWholeGrid">
49 <property name="Type">Action</property>
50 <property name="Label" translatable="yes">Shutdown whole grid</property>
51 <property name="ShortLabel" translatable="yes">Shutdown whole grid</property>
52 <property name="StockId">gtk-stop</property>
53 </action>
54 <action id="ExitGridManager">
55 <property name="Type">Action</property>
56 <property name="Label" translatable="yes">Exit grid manager</property>
57 <property name="ShortLabel" translatable="yes">Exit grid manager</property>
58 <property name="StockId">gtk-close</property>
59 <signal name="Activated" handler="QuitMenu" after="yes" />
60 </action>
61 <action id="ConnectToUserserver">
62 <property name="Type">Action</property>
63 <property name="Label" translatable="yes">Connect to userserver</property>
64 <property name="ShortLabel" translatable="yes">Connect to userserver</property>
65 <property name="StockId">gtk-connect</property>
66 </action>
67 <action id="AccountManagment">
68 <property name="Type">Action</property>
69 <property name="Label" translatable="yes">Account managment</property>
70 <property name="ShortLabel" translatable="yes">Account managment</property>
71 <property name="StockId">gtk-properties</property>
72 </action>
73 <action id="GlobalNotice">
74 <property name="Type">Action</property>
75 <property name="Label" translatable="yes">Global notice</property>
76 <property name="ShortLabel" translatable="yes">Global notice</property>
77 <property name="StockId">gtk-network</property>
78 </action>
79 <action id="DisableAllLogins">
80 <property name="Type">Action</property>
81 <property name="Label" translatable="yes">Disable all logins</property>
82 <property name="ShortLabel" translatable="yes">Disable all logins</property>
83 <property name="StockId">gtk-no</property>
84 </action>
85 <action id="DisableNonGodUsersOnly">
86 <property name="Type">Action</property>
87 <property name="Label" translatable="yes">Disable non-god users only</property>
88 <property name="ShortLabel" translatable="yes">Disable non-god users only</property>
89 <property name="StockId">gtk-no</property>
90 </action>
91 <action id="ShutdownUserServer">
92 <property name="Type">Action</property>
93 <property name="Label" translatable="yes">Shutdown user server</property>
94 <property name="ShortLabel" translatable="yes">Shutdown user server</property>
95 <property name="StockId">gtk-stop</property>
96 </action>
97 <action id="ShutdownGridserverOnly">
98 <property name="Type">Action</property>
99 <property name="Label" translatable="yes">Shutdown gridserver only</property>
100 <property name="ShortLabel" translatable="yes">Shutdown gridserver only</property>
101 <property name="StockId">gtk-stop</property>
102 <signal name="Activated" handler="ShutdownGridserverMenu" after="yes" />
103 </action>
104 <action id="RestartGridserverOnly">
105 <property name="Type">Action</property>
106 <property name="Label" translatable="yes">Restart gridserver only</property>
107 <property name="ShortLabel" translatable="yes">Restart gridserver only</property>
108 <property name="StockId">gtk-refresh</property>
109 <signal name="Activated" handler="RestartGridserverMenu" after="yes" />
110 </action>
111 <action id="DefaultLocalGridUserserver">
112 <property name="Type">Action</property>
113 <property name="Label" translatable="yes">Default local grid userserver</property>
114 <property name="ShortLabel" translatable="yes">Default local grid userserver</property>
115 </action>
116 <action id="CustomUserserver">
117 <property name="Type">Action</property>
118 <property name="Label" translatable="yes">Custom userserver...</property>
119 <property name="ShortLabel" translatable="yes">Custom userserver</property>
120 </action>
121 <action id="RemoteGridDefaultUserserver">
122 <property name="Type">Action</property>
123 <property name="Label" translatable="yes">Remote grid default userserver...</property>
124 <property name="ShortLabel" translatable="yes">Remote grid default userserver</property>
125 </action>
126 <action id="DisconnectFromGridServer">
127 <property name="Type">Action</property>
128 <property name="Label" translatable="yes">Disconnect from grid server</property>
129 <property name="ShortLabel" translatable="yes">Disconnect from grid server</property>
130 <property name="StockId">gtk-disconnect</property>
131 <property name="Visible">False</property>
132 <signal name="Activated" handler="DisconnectGridServerMenu" after="yes" />
133 </action>
134 <action id="UploadAsset">
135 <property name="Type">Action</property>
136 <property name="Label" translatable="yes">Upload asset</property>
137 <property name="ShortLabel" translatable="yes">Upload asset</property>
138 </action>
139 <action id="AssetManagement">
140 <property name="Type">Action</property>
141 <property name="Label" translatable="yes">Asset management</property>
142 <property name="ShortLabel" translatable="yes">Asset management</property>
143 </action>
144 <action id="ConnectToAssetServer">
145 <property name="Type">Action</property>
146 <property name="Label" translatable="yes">Connect to asset server</property>
147 <property name="ShortLabel" translatable="yes">Connect to asset server</property>
148 </action>
149 <action id="ConnectToDefaultAssetServerForGrid">
150 <property name="Type">Action</property>
151 <property name="Label" translatable="yes">Connect to default asset server for grid</property>
152 <property name="ShortLabel" translatable="yes">Connect to default asset server for grid</property>
153 </action>
154 <action id="DefaultForLocalGrid">
155 <property name="Type">Action</property>
156 <property name="Label" translatable="yes">Default for local grid</property>
157 <property name="ShortLabel" translatable="yes">Default for local grid</property>
158 </action>
159 <action id="DefaultForRemoteGrid">
160 <property name="Type">Action</property>
161 <property name="Label" translatable="yes">Default for remote grid...</property>
162 <property name="ShortLabel" translatable="yes">Default for remote grid...</property>
163 </action>
164 <action id="CustomAssetServer">
165 <property name="Type">Action</property>
166 <property name="Label" translatable="yes">Custom asset server...</property>
167 <property name="ShortLabel" translatable="yes">Custom asset server...</property>
168 </action>
169 </action-group>
170 <property name="MemberName" />
171 <property name="WidthRequest">800</property>
172 <property name="HeightRequest">600</property>
173 <property name="Title" translatable="yes">Open Grid Services Manager</property>
174 <property name="Icon">stock:gtk-network Dialog</property>
175 <signal name="DeleteEvent" handler="OnDeleteEvent" />
176 <child>
177 <widget class="Gtk.VBox" id="vbox1">
178 <property name="MemberName" />
179 <child>
180 <widget class="Gtk.MenuBar" id="menubar2">
181 <property name="MemberName" />
182 <property name="HeightRequest">25</property>
183 <node name="menubar2" type="Menubar">
184 <node type="Menu" action="Grid">
185 <node type="Menuitem" action="ConnectToGridserver" />
186 <node type="Menuitem" action="DisconnectFromGridServer" />
187 <node type="Separator" />
188 <node type="Menuitem" action="RestartWholeGrid" />
189 <node type="Menuitem" action="RestartGridserverOnly" />
190 <node type="Separator" />
191 <node type="Menuitem" action="ShutdownWholeGrid" />
192 <node type="Menuitem" action="ShutdownGridserverOnly" />
193 <node type="Separator" />
194 <node type="Menuitem" action="ExitGridManager" />
195 </node>
196 <node type="Menu" action="User">
197 <node type="Menu" action="ConnectToUserserver">
198 <node type="Menuitem" action="DefaultLocalGridUserserver" />
199 <node type="Menuitem" action="CustomUserserver" />
200 <node type="Menuitem" action="RemoteGridDefaultUserserver" />
201 </node>
202 <node type="Separator" />
203 <node type="Menuitem" action="AccountManagment" />
204 <node type="Menuitem" action="GlobalNotice" />
205 <node type="Separator" />
206 <node type="Menuitem" action="DisableAllLogins" />
207 <node type="Menuitem" action="DisableNonGodUsersOnly" />
208 <node type="Separator" />
209 <node type="Menuitem" action="ShutdownUserServer" />
210 </node>
211 <node type="Menu" action="Asset">
212 <node type="Menuitem" action="UploadAsset" />
213 <node type="Menuitem" action="AssetManagement" />
214 <node type="Menu" action="ConnectToAssetServer">
215 <node type="Menuitem" action="DefaultForLocalGrid" />
216 <node type="Menuitem" action="DefaultForRemoteGrid" />
217 <node type="Menuitem" action="CustomAssetServer" />
218 </node>
219 </node>
220 <node type="Menu" action="Region" />
221 <node type="Menu" action="Services" />
222 </node>
223 </widget>
224 <packing>
225 <property name="Position">0</property>
226 <property name="AutoSize">False</property>
227 <property name="Expand">False</property>
228 <property name="Fill">False</property>
229 </packing>
230 </child>
231 <child>
232 <widget class="Gtk.HBox" id="hbox1">
233 <property name="MemberName" />
234 <child>
235 <placeholder />
236 </child>
237 <child>
238 <widget class="Gtk.ScrolledWindow" id="scrolledwindow1">
239 <property name="MemberName" />
240 <property name="CanFocus">True</property>
241 <property name="VscrollbarPolicy">Automatic</property>
242 <property name="HscrollbarPolicy">Automatic</property>
243 <child>
244 <widget class="Gtk.Viewport" id="GtkViewport">
245 <property name="MemberName" />
246 <property name="ShadowType">None</property>
247 <child>
248 <widget class="Gtk.DrawingArea" id="drawingarea1">
249 <property name="MemberName" />
250 </widget>
251 </child>
252 </widget>
253 </child>
254 </widget>
255 <packing>
256 <property name="Position">1</property>
257 <property name="AutoSize">True</property>
258 </packing>
259 </child>
260 <child>
261 <widget class="Gtk.TreeView" id="treeview1">
262 <property name="MemberName" />
263 <property name="CanFocus">True</property>
264 </widget>
265 <packing>
266 <property name="Position">2</property>
267 <property name="AutoSize">True</property>
268 </packing>
269 </child>
270 </widget>
271 <packing>
272 <property name="Position">1</property>
273 <property name="AutoSize">True</property>
274 </packing>
275 </child>
276 <child>
277 <widget class="Gtk.Statusbar" id="statusbar1">
278 <property name="MemberName">statusBar1</property>
279 <property name="Spacing">5</property>
280 <child>
281 <placeholder />
282 </child>
283 <child>
284 <placeholder />
285 </child>
286 </widget>
287 <packing>
288 <property name="PackType">End</property>
289 <property name="Position">2</property>
290 <property name="AutoSize">False</property>
291 <property name="Expand">False</property>
292 <property name="Fill">False</property>
293 </packing>
294 </child>
295 </widget>
296 </child>
297 </widget>
298 <widget class="Gtk.Dialog" id="OpenGridServices.Manager.ConnectToGridServerDialog" design-size="476 137">
299 <property name="MemberName" />
300 <property name="Events">ButtonPressMask</property>
301 <property name="Title" translatable="yes">Connect to Grid server</property>
302 <property name="WindowPosition">CenterOnParent</property>
303 <property name="Buttons">2</property>
304 <property name="HelpButton">False</property>
305 <property name="HasSeparator">False</property>
306 <signal name="Response" handler="OnResponse" />
307 <child internal-child="VBox">
308 <widget class="Gtk.VBox" id="dialog_VBox">
309 <property name="MemberName" />
310 <property name="Events">ButtonPressMask</property>
311 <property name="BorderWidth">2</property>
312 <child>
313 <widget class="Gtk.VBox" id="vbox2">
314 <property name="MemberName" />
315 <child>
316 <placeholder />
317 </child>
318 <child>
319 <placeholder />
320 </child>
321 <child>
322 <widget class="Gtk.VBox" id="vbox3">
323 <property name="MemberName" />
324 <child>
325 <widget class="Gtk.HBox" id="hbox1">
326 <property name="MemberName" />
327 <child>
328 <widget class="Gtk.Label" id="label1">
329 <property name="MemberName" />
330 <property name="Xalign">1</property>
331 <property name="LabelProp" translatable="yes">Grid server URL: </property>
332 <property name="Justify">Right</property>
333 </widget>
334 <packing>
335 <property name="Position">0</property>
336 <property name="AutoSize">False</property>
337 </packing>
338 </child>
339 <child>
340 <widget class="Gtk.Entry" id="entry1">
341 <property name="MemberName" />
342 <property name="CanFocus">True</property>
343 <property name="Text" translatable="yes">http://gridserver:8001</property>
344 <property name="IsEditable">True</property>
345 <property name="MaxLength">255</property>
346 <property name="InvisibleChar">•</property>
347 </widget>
348 <packing>
349 <property name="Position">1</property>
350 <property name="AutoSize">False</property>
351 </packing>
352 </child>
353 <child>
354 <placeholder />
355 </child>
356 </widget>
357 <packing>
358 <property name="Position">0</property>
359 <property name="AutoSize">True</property>
360 <property name="Expand">False</property>
361 <property name="Fill">False</property>
362 </packing>
363 </child>
364 <child>
365 <widget class="Gtk.HBox" id="hbox2">
366 <property name="MemberName" />
367 <child>
368 <widget class="Gtk.Label" id="label2">
369 <property name="MemberName" />
370 <property name="Xalign">1</property>
371 <property name="LabelProp" translatable="yes">Username:</property>
372 <property name="Justify">Right</property>
373 </widget>
374 <packing>
375 <property name="Position">0</property>
376 <property name="AutoSize">False</property>
377 </packing>
378 </child>
379 <child>
380 <widget class="Gtk.Entry" id="entry2">
381 <property name="MemberName" />
382 <property name="CanFocus">True</property>
383 <property name="IsEditable">True</property>
384 <property name="InvisibleChar">•</property>
385 </widget>
386 <packing>
387 <property name="Position">1</property>
388 <property name="AutoSize">True</property>
389 </packing>
390 </child>
391 <child>
392 <placeholder />
393 </child>
394 </widget>
395 <packing>
396 <property name="Position">1</property>
397 <property name="AutoSize">False</property>
398 <property name="Expand">False</property>
399 <property name="Fill">False</property>
400 </packing>
401 </child>
402 <child>
403 <widget class="Gtk.HBox" id="hbox3">
404 <property name="MemberName" />
405 <child>
406 <widget class="Gtk.Label" id="label3">
407 <property name="MemberName" />
408 <property name="Xalign">1</property>
409 <property name="LabelProp" translatable="yes">Password:</property>
410 <property name="Justify">Right</property>
411 </widget>
412 <packing>
413 <property name="Position">0</property>
414 <property name="AutoSize">False</property>
415 </packing>
416 </child>
417 <child>
418 <widget class="Gtk.Entry" id="entry3">
419 <property name="MemberName" />
420 <property name="CanFocus">True</property>
421 <property name="IsEditable">True</property>
422 <property name="InvisibleChar">•</property>
423 </widget>
424 <packing>
425 <property name="Position">1</property>
426 <property name="AutoSize">True</property>
427 </packing>
428 </child>
429 <child>
430 <placeholder />
431 </child>
432 </widget>
433 <packing>
434 <property name="Position">2</property>
435 <property name="AutoSize">True</property>
436 <property name="Expand">False</property>
437 <property name="Fill">False</property>
438 </packing>
439 </child>
440 </widget>
441 <packing>
442 <property name="Position">2</property>
443 <property name="AutoSize">True</property>
444 <property name="Expand">False</property>
445 <property name="Fill">False</property>
446 </packing>
447 </child>
448 </widget>
449 <packing>
450 <property name="Position">0</property>
451 <property name="AutoSize">True</property>
452 </packing>
453 </child>
454 </widget>
455 </child>
456 <child internal-child="ActionArea">
457 <widget class="Gtk.HButtonBox" id="OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea">
458 <property name="MemberName" />
459 <property name="Events">ButtonPressMask</property>
460 <property name="Spacing">6</property>
461 <property name="BorderWidth">5</property>
462 <property name="Size">2</property>
463 <property name="LayoutStyle">End</property>
464 <child>
465 <widget class="Gtk.Button" id="button2">
466 <property name="MemberName" />
467 <property name="CanDefault">True</property>
468 <property name="CanFocus">True</property>
469 <property name="Type">TextAndIcon</property>
470 <property name="Icon">stock:gtk-apply Menu</property>
471 <property name="Label" translatable="yes">Connect</property>
472 <property name="UseUnderline">True</property>
473 <property name="IsDialogButton">True</property>
474 <property name="ResponseId">-5</property>
475 </widget>
476 <packing>
477 <property name="Expand">False</property>
478 <property name="Fill">False</property>
479 </packing>
480 </child>
481 <child>
482 <widget class="Gtk.Button" id="button8">
483 <property name="MemberName" />
484 <property name="CanDefault">True</property>
485 <property name="CanFocus">True</property>
486 <property name="Type">TextAndIcon</property>
487 <property name="Icon">stock:gtk-cancel Menu</property>
488 <property name="Label" translatable="yes">Cancel</property>
489 <property name="UseUnderline">True</property>
490 <property name="IsDialogButton">True</property>
491 <property name="ResponseId">-6</property>
492 </widget>
493 <packing>
494 <property name="Position">1</property>
495 <property name="Expand">False</property>
496 <property name="Fill">False</property>
497 </packing>
498 </child>
499 </widget>
500 </child>
501 </widget>
502</stetic-interface> \ No newline at end of file
diff --git a/OpenGridServices/OpenGridServices.UserServer/Main.cs b/OpenGridServices/OpenGridServices.UserServer/Main.cs
new file mode 100644
index 0000000..aec80dc
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.UserServer/Main.cs
@@ -0,0 +1,217 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3
4
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.Collections;
32using System.Collections.Generic;
33using System.Reflection;
34using System.IO;
35using System.Text;
36using libsecondlife;
37using OpenSim.Framework.User;
38using OpenSim.Framework.Sims;
39using OpenSim.Framework.Inventory;
40using OpenSim.Framework.Interfaces;
41using OpenSim.Framework.Console;
42using OpenSim.Servers;
43using OpenSim.Framework.Utilities;
44using OpenSim.GenericConfig;
45
46namespace OpenGridServices.UserServer
47{
48 /// <summary>
49 /// </summary>
50 public class OpenUser_Main : BaseServer, conscmd_callback
51 {
52 private string ConfigDll = "OpenUser.Config.UserConfigDb4o.dll";
53 private string StorageDll = "OpenGrid.Framework.Data.DB4o.dll";
54 private UserConfig Cfg;
55 protected IGenericConfig localXMLConfig;
56
57 public UserManager m_userManager; // Replaces below.
58
59 //private UserProfileManager m_userProfileManager; // Depreciated
60
61 public Dictionary<LLUUID, UserProfile> UserSessions = new Dictionary<LLUUID, UserProfile>();
62
63 ConsoleBase m_console;
64
65 [STAThread]
66 public static void Main(string[] args)
67 {
68 Console.WriteLine("Starting...\n");
69
70 OpenUser_Main userserver = new OpenUser_Main();
71
72 userserver.Startup();
73 userserver.Work();
74 }
75
76 private OpenUser_Main()
77 {
78 m_console = new ConsoleBase("opengrid-userserver-console.log", "OpenUser", this , false);
79 MainConsole.Instance = m_console;
80 }
81
82 private void Work()
83 {
84 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"\nEnter help for a list of commands\n");
85
86 while (true)
87 {
88 m_console.MainConsolePrompt();
89 }
90 }
91
92 public void Startup()
93 {
94 this.localXMLConfig = new XmlConfig("UserServerConfig.xml");
95 this.localXMLConfig.LoadData();
96 this.ConfigDB(this.localXMLConfig);
97 this.localXMLConfig.Close();
98
99 MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Loading configuration");
100 Cfg = this.LoadConfigDll(this.ConfigDll);
101 Cfg.InitConfig();
102
103 MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Establishing data connection");
104 m_userManager = new UserManager();
105 m_userManager._config = Cfg;
106 m_userManager.AddPlugin(StorageDll);
107
108 MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Starting HTTP process");
109 BaseHttpServer httpServer = new BaseHttpServer(8002);
110
111 httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod);
112 httpServer.AddRestHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod);
113
114 httpServer.Start();
115 }
116
117
118 public void do_create(string what)
119 {
120 switch (what)
121 {
122 case "user":
123 string tempfirstname;
124 string templastname;
125 string tempMD5Passwd;
126 uint regX = 997;
127 uint regY = 996;
128
129 tempfirstname = m_console.CmdPrompt("First name");
130 templastname = m_console.CmdPrompt("Last name");
131 tempMD5Passwd = m_console.PasswdPrompt("Password");
132 regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X"));
133 regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y"));
134
135 tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + "");
136
137 m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
138 break;
139 }
140 }
141
142 public void RunCmd(string cmd, string[] cmdparams)
143 {
144 switch (cmd)
145 {
146 case "help":
147 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"create user - create a new user");
148 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"shutdown - shutdown the grid (USE CAUTION!)");
149 break;
150
151 case "create":
152 do_create(cmdparams[0]);
153 break;
154
155 case "shutdown":
156 m_console.Close();
157 Environment.Exit(0);
158 break;
159 }
160 }
161
162 private void ConfigDB(IGenericConfig configData)
163 {
164 try
165 {
166 string attri = "";
167 attri = configData.GetAttribute("DataBaseProvider");
168 if (attri == "")
169 {
170 StorageDll = "OpenGrid.Framework.Data.DB4o.dll";
171 configData.SetAttribute("DataBaseProvider", "OpenGrid.Framework.Data.DB4o.dll");
172 }
173 else
174 {
175 StorageDll = attri;
176 }
177 configData.Commit();
178 }
179 catch (Exception e)
180 {
181
182 }
183 }
184
185 private UserConfig LoadConfigDll(string dllName)
186 {
187 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
188 UserConfig config = null;
189
190 foreach (Type pluginType in pluginAssembly.GetTypes())
191 {
192 if (pluginType.IsPublic)
193 {
194 if (!pluginType.IsAbstract)
195 {
196 Type typeInterface = pluginType.GetInterface("IUserConfig", true);
197
198 if (typeInterface != null)
199 {
200 IUserConfig plug = (IUserConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
201 config = plug.GetConfigObject();
202 break;
203 }
204
205 typeInterface = null;
206 }
207 }
208 }
209 pluginAssembly = null;
210 return config;
211 }
212
213 public void Show(string ShowWhat)
214 {
215 }
216 }
217}
diff --git a/OpenGridServices/OpenGridServices.UserServer/OGS-UserServer.csproj b/OpenGridServices/OpenGridServices.UserServer/OGS-UserServer.csproj
new file mode 100644
index 0000000..f4fa8b6
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.UserServer/OGS-UserServer.csproj
@@ -0,0 +1,63 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ProductVersion>8.0.50727</ProductVersion>
6 <SchemaVersion>2.0</SchemaVersion>
7 <ProjectGuid>{D45B6E48-5668-478D-B9CB-6D46E665FACF}</ProjectGuid>
8 <OutputType>Exe</OutputType>
9 <AppDesignerFolder>Properties</AppDesignerFolder>
10 <RootNamespace>OGS_UserServer</RootNamespace>
11 <AssemblyName>OGS-UserServer</AssemblyName>
12 <StartupObject>OpenGridServices.OpenUser_Main</StartupObject>
13 </PropertyGroup>
14 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
15 <DebugSymbols>true</DebugSymbols>
16 <DebugType>full</DebugType>
17 <Optimize>false</Optimize>
18 <OutputPath>bin\Debug\</OutputPath>
19 <DefineConstants>DEBUG;TRACE</DefineConstants>
20 <ErrorReport>prompt</ErrorReport>
21 <WarningLevel>4</WarningLevel>
22 </PropertyGroup>
23 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
24 <DebugType>pdbonly</DebugType>
25 <Optimize>true</Optimize>
26 <OutputPath>bin\Release\</OutputPath>
27 <DefineConstants>TRACE</DefineConstants>
28 <ErrorReport>prompt</ErrorReport>
29 <WarningLevel>4</WarningLevel>
30 </PropertyGroup>
31 <ItemGroup>
32 <Reference Include="libsecondlife, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
33 <SpecificVersion>False</SpecificVersion>
34 <HintPath>..\..\common\bin\libsecondlife.dll</HintPath>
35 </Reference>
36 <Reference Include="System" />
37 <Reference Include="System.Data" />
38 <Reference Include="System.Xml" />
39 </ItemGroup>
40 <ItemGroup>
41 <Compile Include="..\..\common\src\OGS-Console.cs">
42 <Link>OGS-Console.cs</Link>
43 </Compile>
44 <Compile Include="..\..\common\VersionInfo\VersionInfo.cs">
45 <Link>VersionInfo.cs</Link>
46 </Compile>
47 <Compile Include="ConsoleCmds.cs" />
48 <Compile Include="Main.cs" />
49 <Compile Include="Properties\AssemblyInfo.cs" />
50 <Compile Include="UserHttp.cs" />
51 </ItemGroup>
52 <ItemGroup>
53 <ProjectReference Include="..\..\..\OpenSim.FrameWork\OpenSim.Framework.csproj">
54 <Project>{2E46A825-3168-492F-93BC-637126B5B72B}</Project>
55 <Name>OpenSim.Framework</Name>
56 </ProjectReference>
57 <ProjectReference Include="..\..\ServerConsole\ServerConsole.csproj">
58 <Project>{7667E6E2-F227-41A2-B1B2-315613E1BAFC}</Project>
59 <Name>ServerConsole</Name>
60 </ProjectReference>
61 </ItemGroup>
62 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
63</Project> \ No newline at end of file
diff --git a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj
new file mode 100644
index 0000000..1bd07fb
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj
@@ -0,0 +1,128 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{66591469-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGridServices.UserServer</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Exe</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGridServices.UserServer</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Data" >
66 <HintPath>System.Data.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Xml" >
70 <HintPath>System.Xml.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="OpenSim.Framework" >
74 <HintPath>OpenSim.Framework.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="OpenSim.Framework.Console" >
78 <HintPath>OpenSim.Framework.Console.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 <Reference Include="OpenSim.GenericConfig.Xml" >
82 <HintPath>OpenSim.GenericConfig.Xml.dll</HintPath>
83 <Private>False</Private>
84 </Reference>
85 <Reference Include="OpenSim.Servers" >
86 <HintPath>OpenSim.Servers.dll</HintPath>
87 <Private>False</Private>
88 </Reference>
89 <Reference Include="libsecondlife.dll" >
90 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
91 <Private>False</Private>
92 </Reference>
93 <Reference Include="Db4objects.Db4o.dll" >
94 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
95 <Private>False</Private>
96 </Reference>
97 <Reference Include="XMLRPC" >
98 <HintPath>XMLRPC.dll</HintPath>
99 <Private>False</Private>
100 </Reference>
101 </ItemGroup>
102 <ItemGroup>
103 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
104 <Name>OpenGrid.Framework.Data</Name>
105 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
106 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
107 <Private>False</Private>
108 </ProjectReference>
109 </ItemGroup>
110 <ItemGroup>
111 <Compile Include="Main.cs">
112 <SubType>Code</SubType>
113 </Compile>
114 <Compile Include="UserManager.cs">
115 <SubType>Code</SubType>
116 </Compile>
117 <Compile Include="Properties\AssemblyInfo.cs">
118 <SubType>Code</SubType>
119 </Compile>
120 </ItemGroup>
121 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
122 <PropertyGroup>
123 <PreBuildEvent>
124 </PreBuildEvent>
125 <PostBuildEvent>
126 </PostBuildEvent>
127 </PropertyGroup>
128</Project>
diff --git a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj.user b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build
new file mode 100644
index 0000000..5275ef4
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build
@@ -0,0 +1,51 @@
1<?xml version="1.0" ?>
2<project name="OpenGridServices.UserServer" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
11 <resources prefix="OpenGridServices.UserServer" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="Main.cs" />
15 <include name="UserManager.cs" />
16 <include name="Properties/AssemblyInfo.cs" />
17 </sources>
18 <references basedir="${project::get-base-directory()}">
19 <lib>
20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib>
23 <include name="System.dll" />
24 <include name="System.Data.dll" />
25 <include name="System.Xml.dll" />
26 <include name="../../bin/OpenSim.Framework.dll" />
27 <include name="../../bin/OpenSim.Framework.Console.dll" />
28 <include name="../../bin/OpenGrid.Framework.Data.dll" />
29 <include name="../../bin/OpenSim.GenericConfig.Xml.dll" />
30 <include name="../../bin/OpenSim.Servers.dll" />
31 <include name="../../bin/libsecondlife.dll" />
32 <include name="../../bin/Db4objects.Db4o.dll" />
33 <include name="../../bin/XMLRPC.dll" />
34 </references>
35 </csc>
36 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
37 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
38 <copy todir="${project::get-base-directory()}/../../bin/">
39 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
40 <include name="*.dll"/>
41 <include name="*.exe"/>
42 </fileset>
43 </copy>
44 </target>
45 <target name="clean">
46 <delete dir="${bin.dir}" failonerror="false" />
47 <delete dir="${obj.dir}" failonerror="false" />
48 </target>
49 <target name="doc" description="Creates documentation.">
50 </target>
51</project>
diff --git a/OpenGridServices/OpenGridServices.UserServer/Properties/AssemblyInfo.cs b/OpenGridServices/OpenGridServices.UserServer/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..5d5ce8d
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.UserServer/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OGS-UserServer")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OGS-UserServer")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("e266513a-090b-4d38-80f6-8599eef68c8c")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("1.0.0.0")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs
new file mode 100644
index 0000000..fdda63b
--- /dev/null
+++ b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs
@@ -0,0 +1,597 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Text;
5using OpenGrid.Framework.Data;
6using libsecondlife;
7using System.Reflection;
8
9using System.Xml;
10using Nwc.XmlRpc;
11using OpenSim.Framework.Sims;
12using OpenSim.Framework.Inventory;
13using OpenSim.Framework.Utilities;
14
15using System.Security.Cryptography;
16
17namespace OpenGridServices.UserServer
18{
19 public class UserManager
20 {
21 public OpenSim.Framework.Interfaces.UserConfig _config;
22 Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>();
23
24 /// <summary>
25 /// Adds a new user server plugin - user servers will be requested in the order they were loaded.
26 /// </summary>
27 /// <param name="FileName">The filename to the user server plugin DLL</param>
28 public void AddPlugin(string FileName)
29 {
30 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Userstorage: Attempting to load " + FileName);
31 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
32
33 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Userstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
34 foreach (Type pluginType in pluginAssembly.GetTypes())
35 {
36 if (!pluginType.IsAbstract)
37 {
38 Type typeInterface = pluginType.GetInterface("IUserData", true);
39
40 if (typeInterface != null)
41 {
42 IUserData plug = (IUserData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
43 plug.Initialise();
44 this._plugins.Add(plug.getName(), plug);
45 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Userstorage: Added IUserData Interface");
46 }
47
48 typeInterface = null;
49 }
50 }
51
52 pluginAssembly = null;
53 }
54
55 /// <summary>
56 ///
57 /// </summary>
58 /// <param name="user"></param>
59 public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
60 {
61 UserProfileData user = new UserProfileData();
62 user.homeLocation = new LLVector3(128, 128, 100);
63 user.UUID = LLUUID.Random();
64 user.username = firstName;
65 user.surname = lastName;
66 user.passwordHash = pass;
67 user.passwordSalt = "";
68 user.created = Util.UnixTimeSinceEpoch();
69 user.homeLookAt = new LLVector3(100, 100, 100);
70 user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256));
71
72 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
73 {
74 try
75 {
76 plugin.Value.addNewUserProfile(user);
77
78 }
79 catch (Exception e)
80 {
81 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
82 }
83 }
84 }
85
86 /// <summary>
87 /// Loads a user profile from a database by UUID
88 /// </summary>
89 /// <param name="uuid">The target UUID</param>
90 /// <returns>A user profile</returns>
91 public UserProfileData getUserProfile(LLUUID uuid)
92 {
93 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
94 {
95 try
96 {
97 UserProfileData profile = plugin.Value.getUserByUUID(uuid);
98 profile.currentAgent = getUserAgent(profile.UUID);
99 return profile;
100 }
101 catch (Exception e)
102 {
103 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
104 }
105 }
106
107 return null;
108 }
109
110
111 /// <summary>
112 /// Loads a user profile by name
113 /// </summary>
114 /// <param name="name">The target name</param>
115 /// <returns>A user profile</returns>
116 public UserProfileData getUserProfile(string name)
117 {
118 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
119 {
120 try
121 {
122 UserProfileData profile = plugin.Value.getUserByName(name);
123 profile.currentAgent = getUserAgent(profile.UUID);
124 return profile;
125 }
126 catch (Exception e)
127 {
128 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
129 }
130 }
131
132 return null;
133 }
134
135 /// <summary>
136 /// Loads a user profile by name
137 /// </summary>
138 /// <param name="fname">First name</param>
139 /// <param name="lname">Last name</param>
140 /// <returns>A user profile</returns>
141 public UserProfileData getUserProfile(string fname, string lname)
142 {
143 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
144 {
145 try
146 {
147 UserProfileData profile = plugin.Value.getUserByName(fname,lname);
148 try
149 {
150 profile.currentAgent = getUserAgent(profile.UUID);
151 }
152 catch (Exception e)
153 {
154 // Ignore
155 }
156 return profile;
157 }
158 catch (Exception e)
159 {
160 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
161 }
162 }
163
164 return null;
165 }
166
167 /// <summary>
168 /// Loads a user agent by uuid (not called directly)
169 /// </summary>
170 /// <param name="uuid">The agents UUID</param>
171 /// <returns>Agent profiles</returns>
172 public UserAgentData getUserAgent(LLUUID uuid)
173 {
174 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
175 {
176 try
177 {
178 return plugin.Value.getAgentByUUID(uuid);
179 }
180 catch (Exception e)
181 {
182 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
183 }
184 }
185
186 return null;
187 }
188
189 /// <summary>
190 /// Loads a user agent by name (not called directly)
191 /// </summary>
192 /// <param name="name">The agents name</param>
193 /// <returns>A user agent</returns>
194 public UserAgentData getUserAgent(string name)
195 {
196 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
197 {
198 try
199 {
200 return plugin.Value.getAgentByName(name);
201 }
202 catch (Exception e)
203 {
204 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
205 }
206 }
207
208 return null;
209 }
210
211 /// <summary>
212 /// Loads a user agent by name (not called directly)
213 /// </summary>
214 /// <param name="fname">The agents firstname</param>
215 /// <param name="lname">The agents lastname</param>
216 /// <returns>A user agent</returns>
217 public UserAgentData getUserAgent(string fname, string lname)
218 {
219 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
220 {
221 try
222 {
223 return plugin.Value.getAgentByName(fname,lname);
224 }
225 catch (Exception e)
226 {
227 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
228 }
229 }
230
231 return null;
232 }
233
234 /// <summary>
235 /// Creates a error response caused by invalid XML
236 /// </summary>
237 /// <returns>An XMLRPC response</returns>
238 private static XmlRpcResponse CreateErrorConnectingToGridResponse()
239 {
240 XmlRpcResponse response = new XmlRpcResponse();
241 Hashtable ErrorRespData = new Hashtable();
242 ErrorRespData["reason"] = "key";
243 ErrorRespData["message"] = "Error connecting to grid. Could not percieve credentials from login XML.";
244 ErrorRespData["login"] = "false";
245 response.Value = ErrorRespData;
246 return response;
247 }
248
249 /// <summary>
250 /// Creates an error response caused by bad login credentials
251 /// </summary>
252 /// <returns>An XMLRPC response</returns>
253 private static XmlRpcResponse CreateLoginErrorResponse()
254 {
255 XmlRpcResponse response = new XmlRpcResponse();
256 Hashtable ErrorRespData = new Hashtable();
257 ErrorRespData["reason"] = "key";
258 ErrorRespData["message"] = "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.";
259 ErrorRespData["login"] = "false";
260 response.Value = ErrorRespData;
261 return response;
262 }
263
264 /// <summary>
265 /// Creates an error response caused by being logged in already
266 /// </summary>
267 /// <returns>An XMLRPC Response</returns>
268 private static XmlRpcResponse CreateAlreadyLoggedInResponse()
269 {
270 XmlRpcResponse response = new XmlRpcResponse();
271 Hashtable PresenceErrorRespData = new Hashtable();
272 PresenceErrorRespData["reason"] = "presence";
273 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";
274 PresenceErrorRespData["login"] = "false";
275 response.Value = PresenceErrorRespData;
276 return response;
277 }
278
279 /// <summary>
280 /// Customises the login response and fills in missing values.
281 /// </summary>
282 /// <param name="response">The existing response</param>
283 /// <param name="theUser">The user profile</param>
284 public virtual void CustomiseResponse(ref Hashtable response, ref UserProfileData theUser)
285 {
286 // Load information from the gridserver
287 SimProfile SimInfo = new SimProfile();
288 SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey);
289
290 // Customise the response
291 // Home Location
292 response["home"] = "{'region_handle':[r" + (SimInfo.RegionLocX * 256).ToString() + ",r" + (SimInfo.RegionLocY * 256).ToString() + "], " +
293 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
294 "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
295
296 // Destination
297 response["sim_ip"] = SimInfo.sim_ip;
298 response["sim_port"] = (Int32)SimInfo.sim_port;
299 response["region_y"] = (Int32)SimInfo.RegionLocY * 256;
300 response["region_x"] = (Int32)SimInfo.RegionLocX * 256;
301
302 // Notify the target of an incoming user
303 Console.WriteLine("Notifying " + SimInfo.regionname + " (" + SimInfo.caps_url + ")");
304
305 // Prepare notification
306 Hashtable SimParams = new Hashtable();
307 SimParams["session_id"] = theUser.currentAgent.sessionID.ToString();
308 SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString();
309 SimParams["firstname"] = theUser.username;
310 SimParams["lastname"] = theUser.surname;
311 SimParams["agent_id"] = theUser.UUID.ToString();
312 SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response["circuit_code"]);
313 SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString();
314 SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString();
315 SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString();
316 ArrayList SendParams = new ArrayList();
317 SendParams.Add(SimParams);
318
319 // Update agent with target sim
320 theUser.currentAgent.currentRegion = SimInfo.UUID;
321 theUser.currentAgent.currentHandle = SimInfo.regionhandle;
322
323 // Send
324 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
325 XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000);
326 }
327
328 /// <summary>
329 /// Checks a user against it's password hash
330 /// </summary>
331 /// <param name="profile">The users profile</param>
332 /// <param name="password">The supplied password</param>
333 /// <returns>Authenticated?</returns>
334 public bool AuthenticateUser(ref UserProfileData profile, string password)
335 {
336 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(
337 OpenSim.Framework.Console.LogPriority.LOW,
338 "Authenticating " + profile.username + " " + profile.surname);
339
340 password = password.Remove(0, 3); //remove $1$
341
342 string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
343
344 return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
345 }
346
347 /// <summary>
348 /// Creates and initialises a new user agent - make sure to use CommitAgent when done to submit to the DB
349 /// </summary>
350 /// <param name="profile">The users profile</param>
351 /// <param name="request">The users loginrequest</param>
352 public void CreateAgent(ref UserProfileData profile, XmlRpcRequest request)
353 {
354 Hashtable requestData = (Hashtable)request.Params[0];
355
356 UserAgentData agent = new UserAgentData();
357
358 // User connection
359 agent.agentIP = "";
360 agent.agentOnline = true;
361 agent.agentPort = 0;
362
363 // Generate sessions
364 RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
365 byte[] randDataS = new byte[16];
366 byte[] randDataSS = new byte[16];
367 rand.GetBytes(randDataS);
368 rand.GetBytes(randDataSS);
369
370 agent.secureSessionID = new LLUUID(randDataSS, 0);
371 agent.sessionID = new LLUUID(randDataS, 0);
372
373 // Profile UUID
374 agent.UUID = profile.UUID;
375
376 // Current position (from Home)
377 agent.currentHandle = profile.homeRegion;
378 agent.currentPos = profile.homeLocation;
379
380 // If user specified additional start, use that
381 if (requestData.ContainsKey("start"))
382 {
383 string startLoc = (string)requestData["start"];
384 if (!(startLoc == "last" || startLoc == "home"))
385 {
386 // Ignore it! Heh.
387 }
388 }
389
390 // What time did the user login?
391 agent.loginTime = Util.UnixTimeSinceEpoch();
392 agent.logoutTime = 0;
393
394 // Current location
395 agent.regionID = new LLUUID(); // Fill in later
396 agent.currentRegion = new LLUUID(); // Fill in later
397
398 profile.currentAgent = agent;
399 }
400
401 /// <summary>
402 /// Saves a target agent to the database
403 /// </summary>
404 /// <param name="profile">The users profile</param>
405 /// <returns>Successful?</returns>
406 public bool CommitAgent(ref UserProfileData profile)
407 {
408 // Saves the agent to database
409 return true;
410 }
411
412 /// <summary>
413 /// Main user login function
414 /// </summary>
415 /// <param name="request">The XMLRPC request</param>
416 /// <returns>The response to send</returns>
417 public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
418 {
419 XmlRpcResponse response = new XmlRpcResponse();
420 Hashtable requestData = (Hashtable)request.Params[0];
421
422 bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
423 bool GoodLogin = false;
424 string firstname = "";
425 string lastname = "";
426 string passwd = "";
427
428 UserProfileData TheUser;
429
430 if (GoodXML)
431 {
432 firstname = (string)requestData["first"];
433 lastname = (string)requestData["last"];
434 passwd = (string)requestData["passwd"];
435
436 TheUser = getUserProfile(firstname, lastname);
437 if (TheUser == null)
438 return CreateLoginErrorResponse();
439
440 GoodLogin = AuthenticateUser(ref TheUser, passwd);
441 }
442 else
443 {
444 return CreateErrorConnectingToGridResponse();
445 }
446
447 if (!GoodLogin)
448 {
449 return CreateLoginErrorResponse();
450 }
451 else
452 {
453 // If we already have a session...
454 if (TheUser.currentAgent != null && TheUser.currentAgent.agentOnline)
455 {
456 // Reject the login
457 return CreateAlreadyLoggedInResponse();
458 }
459 // Otherwise...
460 // Create a new agent session
461 CreateAgent(ref TheUser, request);
462
463 try
464 {
465 Hashtable responseData = new Hashtable();
466
467 LLUUID AgentID = TheUser.UUID;
468
469 // Global Texture Section
470 Hashtable GlobalT = new Hashtable();
471 GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271";
472 GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
473 GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
474 ArrayList GlobalTextures = new ArrayList();
475 GlobalTextures.Add(GlobalT);
476
477 // Login Flags Section
478 Hashtable LoginFlagsHash = new Hashtable();
479 LoginFlagsHash["daylight_savings"] = "N";
480 LoginFlagsHash["stipend_since_login"] = "N";
481 LoginFlagsHash["gendered"] = "Y";
482 LoginFlagsHash["ever_logged_in"] = "N"; // Should allow male/female av selection
483 ArrayList LoginFlags = new ArrayList();
484 LoginFlags.Add(LoginFlagsHash);
485
486 // UI Customisation Section
487 Hashtable uiconfig = new Hashtable();
488 uiconfig["allow_first_life"] = "Y";
489 ArrayList ui_config = new ArrayList();
490 ui_config.Add(uiconfig);
491
492 // Classified Categories Section
493 Hashtable ClassifiedCategoriesHash = new Hashtable();
494 ClassifiedCategoriesHash["category_name"] = "Generic";
495 ClassifiedCategoriesHash["category_id"] = (Int32)1;
496 ArrayList ClassifiedCategories = new ArrayList();
497 ClassifiedCategories.Add(ClassifiedCategoriesHash);
498
499 // Inventory Library Section
500 ArrayList AgentInventoryArray = new ArrayList();
501 Hashtable TempHash;
502
503 AgentInventory Library = new AgentInventory();
504 Library.CreateRootFolder(AgentID, true);
505
506 foreach (InventoryFolder InvFolder in Library.InventoryFolders.Values)
507 {
508 TempHash = new Hashtable();
509 TempHash["name"] = InvFolder.FolderName;
510 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
511 TempHash["version"] = (Int32)InvFolder.Version;
512 TempHash["type_default"] = (Int32)InvFolder.DefaultType;
513 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
514 AgentInventoryArray.Add(TempHash);
515 }
516
517 Hashtable InventoryRootHash = new Hashtable();
518 InventoryRootHash["folder_id"] = Library.InventoryRoot.FolderID.ToStringHyphenated();
519 ArrayList InventoryRoot = new ArrayList();
520 InventoryRoot.Add(InventoryRootHash);
521
522 Hashtable InitialOutfitHash = new Hashtable();
523 InitialOutfitHash["folder_name"] = "Nightclub Female";
524 InitialOutfitHash["gender"] = "female";
525 ArrayList InitialOutfit = new ArrayList();
526 InitialOutfit.Add(InitialOutfitHash);
527
528 // Circuit Code
529 uint circode = (uint)(Util.RandomClass.Next());
530
531 // Generics
532 responseData["last_name"] = TheUser.surname;
533 responseData["ui-config"] = ui_config;
534 responseData["sim_ip"] = "127.0.0.1"; //SimInfo.sim_ip.ToString();
535 responseData["login-flags"] = LoginFlags;
536 responseData["global-textures"] = GlobalTextures;
537 responseData["classified_categories"] = ClassifiedCategories;
538 responseData["event_categories"] = new ArrayList();
539 responseData["inventory-skeleton"] = AgentInventoryArray;
540 responseData["inventory-skel-lib"] = new ArrayList();
541 responseData["inventory-root"] = InventoryRoot;
542 responseData["event_notifications"] = new ArrayList();
543 responseData["gestures"] = new ArrayList();
544 responseData["inventory-lib-owner"] = new ArrayList();
545 responseData["initial-outfit"] = InitialOutfit;
546 responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
547 responseData["start_location"] = "last";
548 responseData["home"] = "!!null temporary value {home}!!"; // Overwritten
549 responseData["message"] = _config.DefaultStartupMsg;
550 responseData["first_name"] = TheUser.username;
551 responseData["circuit_code"] = (Int32)circode;
552 responseData["sim_port"] = 0; //(Int32)SimInfo.sim_port;
553 responseData["secure_session_id"] = TheUser.currentAgent.secureSessionID.ToStringHyphenated();
554 responseData["look_at"] = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n";
555 responseData["agent_id"] = AgentID.ToStringHyphenated();
556 responseData["region_y"] = (Int32)0; // Overwritten
557 responseData["region_x"] = (Int32)0; // Overwritten
558 responseData["seed_capability"] = "";
559 responseData["agent_access"] = "M";
560 responseData["session_id"] = TheUser.currentAgent.sessionID.ToStringHyphenated();
561 responseData["login"] = "true";
562
563 this.CustomiseResponse(ref responseData, ref TheUser);
564
565 CommitAgent(ref TheUser);
566
567 response.Value = responseData;
568 // TheUser.SendDataToSim(SimInfo);
569 return response;
570
571 }
572 catch (Exception E)
573 {
574 Console.WriteLine(E.ToString());
575 }
576 //}
577 }
578 return response;
579
580 }
581
582 /// <summary>
583 /// Deletes an active agent session
584 /// </summary>
585 /// <param name="request">The request</param>
586 /// <param name="path">The path (eg /bork/narf/test)</param>
587 /// <param name="param">Parameters sent</param>
588 /// <returns>Success "OK" else error</returns>
589 public string RestDeleteUserSessionMethod(string request, string path, string param)
590 {
591 // TODO! Important!
592
593 return "OK";
594 }
595
596 }
597}
diff --git a/OpenGridServices/OpenUser.Config/UserConfigDb4o/AssemblyInfo.cs b/OpenGridServices/OpenUser.Config/UserConfigDb4o/AssemblyInfo.cs
new file mode 100644
index 0000000..56a5535
--- /dev/null
+++ b/OpenGridServices/OpenUser.Config/UserConfigDb4o/AssemblyInfo.cs
@@ -0,0 +1,31 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// Information about this assembly is defined by the following
6// attributes.
7//
8// change them to the information which is associated with the assembly
9// you compile.
10
11[assembly: AssemblyTitle("UserConfig")]
12[assembly: AssemblyDescription("")]
13[assembly: AssemblyConfiguration("")]
14[assembly: AssemblyCompany("")]
15[assembly: AssemblyProduct("UserConfig")]
16[assembly: AssemblyCopyright("")]
17[assembly: AssemblyTrademark("")]
18[assembly: AssemblyCulture("")]
19
20// This sets the default COM visibility of types in the assembly to invisible.
21// If you need to expose a type to COM, use [ComVisible(true)] on that type.
22[assembly: ComVisible(false)]
23
24// The assembly version has following format :
25//
26// Major.Minor.Build.Revision
27//
28// You can specify all values by your own or you can build default build and revision
29// numbers with the '*' character (the default):
30
31[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenGridServices/OpenUser.Config/UserConfigDb4o/DbUserConfig.cs b/OpenGridServices/OpenUser.Config/UserConfigDb4o/DbUserConfig.cs
new file mode 100644
index 0000000..a281889
--- /dev/null
+++ b/OpenGridServices/OpenUser.Config/UserConfigDb4o/DbUserConfig.cs
@@ -0,0 +1,95 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections.Generic;
29using OpenSim.Framework.Console;
30using OpenSim.Framework.Interfaces;
31using Db4objects.Db4o;
32
33namespace OpenUser.Config.UserConfigDb4o
34{
35 public class Db4oConfigPlugin: IUserConfig
36 {
37 public UserConfig GetConfigObject()
38 {
39 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Loading Db40Config dll");
40 return ( new DbUserConfig());
41 }
42 }
43
44 public class DbUserConfig : UserConfig
45 {
46 private IObjectContainer db;
47
48 public void LoadDefaults() {
49 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings");
50
51 this.DefaultStartupMsg = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default startup message", "Welcome to OGS");
52
53 this.GridServerURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/");
54 this.GridSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to grid server","null");
55 this.GridRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from grid server","null");
56 }
57
58 public override void InitConfig() {
59 try {
60 db = Db4oFactory.OpenFile("openuser.yap");
61 IObjectSet result = db.Get(typeof(DbUserConfig));
62 if(result.Count==1) {
63 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Config.cs:InitConfig() - Found a UserConfig object in the local database, loading");
64 foreach (DbUserConfig cfg in result) {
65 this.GridServerURL=cfg.GridServerURL;
66 this.GridSendKey=cfg.GridSendKey;
67 this.GridRecvKey=cfg.GridRecvKey;
68 this.DefaultStartupMsg=cfg.DefaultStartupMsg;
69 }
70 } else {
71 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults");
72 LoadDefaults();
73 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Writing out default settings to local database");
74 db.Set(this);
75 db.Close();
76 }
77 } catch(Exception e) {
78 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Config.cs:InitConfig() - Exception occured");
79 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString());
80 }
81
82 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"User settings loaded:");
83 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Default startup message: " + this.DefaultStartupMsg);
84 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Grid server URL: " + this.GridServerURL);
85 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to grid: " + this.GridSendKey);
86 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from grid: " + this.GridRecvKey);
87 }
88
89
90 public void Shutdown() {
91 db.Close();
92 }
93 }
94
95}
diff --git a/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj b/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj
new file mode 100644
index 0000000..722b8d4
--- /dev/null
+++ b/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj
@@ -0,0 +1,107 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{7E494328-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenUser.Config.UserConfigDb4o</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenUser.Config.UserConfigDb4o</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Data.dll" >
66 <HintPath>..\..\..\bin\System.Data.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Xml" >
70 <HintPath>System.Xml.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" >
78 <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 <Reference Include="OpenSim.Framework" >
82 <HintPath>OpenSim.Framework.dll</HintPath>
83 <Private>False</Private>
84 </Reference>
85 <Reference Include="OpenSim.Framework.Console" >
86 <HintPath>OpenSim.Framework.Console.dll</HintPath>
87 <Private>False</Private>
88 </Reference>
89 </ItemGroup>
90 <ItemGroup>
91 </ItemGroup>
92 <ItemGroup>
93 <Compile Include="AssemblyInfo.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 <Compile Include="DbUserConfig.cs">
97 <SubType>Code</SubType>
98 </Compile>
99 </ItemGroup>
100 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
101 <PropertyGroup>
102 <PreBuildEvent>
103 </PreBuildEvent>
104 <PostBuildEvent>
105 </PostBuildEvent>
106 </PropertyGroup>
107</Project>
diff --git a/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj.user b/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build b/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build
new file mode 100644
index 0000000..2833bce
--- /dev/null
+++ b/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build
@@ -0,0 +1,46 @@
1<?xml version="1.0" ?>
2<project name="OpenUser.Config.UserConfigDb4o" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenUser.Config.UserConfigDb4o" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="DbUserConfig.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="System.Data.dll.dll" />
24 <include name="System.Xml.dll" />
25 <include name="../../../bin/libsecondlife.dll" />
26 <include name="../../../bin/Db4objects.Db4o.dll" />
27 <include name="../../../bin/OpenSim.Framework.dll" />
28 <include name="../../../bin/OpenSim.Framework.Console.dll" />
29 </references>
30 </csc>
31 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
32 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
33 <copy todir="${project::get-base-directory()}/../../../bin/">
34 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
35 <include name="*.dll"/>
36 <include name="*.exe"/>
37 </fileset>
38 </copy>
39 </target>
40 <target name="clean">
41 <delete dir="${bin.dir}" failonerror="false" />
42 <delete dir="${obj.dir}" failonerror="false" />
43 </target>
44 <target name="doc" description="Creates documentation.">
45 </target>
46</project>
diff --git a/OpenGridServices/SQL/mysql-agents.sql b/OpenGridServices/SQL/mysql-agents.sql
new file mode 100644
index 0000000..8194ca9
--- /dev/null
+++ b/OpenGridServices/SQL/mysql-agents.sql
@@ -0,0 +1,24 @@
1SET FOREIGN_KEY_CHECKS=0;
2-- ----------------------------
3-- Table structure for agents
4-- ----------------------------
5CREATE TABLE `agents` (
6 `UUID` varchar(36) NOT NULL,
7 `sessionID` varchar(36) NOT NULL,
8 `secureSessionID` varchar(36) NOT NULL,
9 `agentIP` varchar(16) NOT NULL,
10 `agentPort` int(11) NOT NULL,
11 `agentOnline` tinyint(4) NOT NULL,
12 `loginTime` int(11) NOT NULL,
13 `logoutTime` int(11) NOT NULL,
14 `currentRegion` varchar(36) NOT NULL,
15 `currentHandle` bigint(20) unsigned NOT NULL,
16 `currentPos` varchar(64) NOT NULL,
17 PRIMARY KEY (`UUID`),
18 UNIQUE KEY `session` (`sessionID`),
19 UNIQUE KEY `ssession` (`secureSessionID`)
20) ENGINE=MyISAM DEFAULT CHARSET=utf8;
21
22-- ----------------------------
23-- Records
24-- ----------------------------
diff --git a/OpenGridServices/SQL/mysql-regions.sql b/OpenGridServices/SQL/mysql-regions.sql
new file mode 100644
index 0000000..4f98826
--- /dev/null
+++ b/OpenGridServices/SQL/mysql-regions.sql
@@ -0,0 +1,29 @@
1CREATE TABLE `regions` (
2 `uuid` varchar(36) NOT NULL,
3 `regionHandle` bigint(20) unsigned NOT NULL,
4 `regionName` varchar(32) default NULL,
5 `regionRecvKey` varchar(128) default NULL,
6 `regionSendKey` varchar(128) default NULL,
7 `regionSecret` varchar(128) default NULL,
8 `regionDataURI` varchar(255) default NULL,
9 `serverIP` varchar(16) default NULL,
10 `serverPort` int(10) unsigned default NULL,
11 `serverURI` varchar(255) default NULL,
12 `locX` int(10) unsigned default NULL,
13 `locY` int(10) unsigned default NULL,
14 `locZ` int(10) unsigned default NULL,
15 `eastOverrideHandle` bigint(20) unsigned default NULL,
16 `westOverrideHandle` bigint(20) unsigned default NULL,
17 `southOverrideHandle` bigint(20) unsigned default NULL,
18 `northOverrideHandle` bigint(20) unsigned default NULL,
19 `regionAssetURI` varchar(255) default NULL,
20 `regionAssetRecvKey` varchar(128) default NULL,
21 `regionAssetSendKey` varchar(128) default NULL,
22 `regionUserURI` varchar(255) default NULL,
23 `regionUserRecvKey` varchar(128) default NULL,
24 `regionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL,
25 PRIMARY KEY (`uuid`),
26 KEY `regionName` (`regionName`),
27 KEY `regionHandle` (`regionHandle`),
28 KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`)
29) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED \ No newline at end of file
diff --git a/OpenGridServices/SQL/mysql-users.sql b/OpenGridServices/SQL/mysql-users.sql
new file mode 100644
index 0000000..5ce4d1c
--- /dev/null
+++ b/OpenGridServices/SQL/mysql-users.sql
@@ -0,0 +1,34 @@
1SET FOREIGN_KEY_CHECKS=0;
2-- ----------------------------
3-- Table structure for users
4-- ----------------------------
5CREATE TABLE `users` (
6 `UUID` varchar(36) NOT NULL default '',
7 `username` varchar(32) NOT NULL,
8 `lastname` varchar(32) NOT NULL,
9 `passwordHash` varchar(32) NOT NULL,
10 `passwordSalt` varchar(32) NOT NULL,
11 `homeRegion` bigint(20) unsigned default NULL,
12 `homeLocationX` float default NULL,
13 `homeLocationY` float default NULL,
14 `homeLocationZ` float default NULL,
15 `homeLookAtX` float default NULL,
16 `homeLookAtY` float default NULL,
17 `homeLookAtZ` float default NULL,
18 `created` int(11) NOT NULL,
19 `lastLogin` int(11) NOT NULL,
20 `userInventoryURI` varchar(255) default NULL,
21 `userAssetURI` varchar(255) default NULL,
22 `profileCanDoMask` int(10) unsigned default NULL,
23 `profileWantDoMask` int(10) unsigned default NULL,
24 `profileAboutText` text,
25 `profileFirstText` text,
26 `profileImage` varchar(36) default NULL,
27 `profileFirstImage` varchar(36) default NULL,
28 PRIMARY KEY (`UUID`),
29 UNIQUE KEY `usernames` (`username`,`lastname`)
30) ENGINE=MyISAM DEFAULT CHARSET=utf8;
31
32-- ----------------------------
33-- Records
34-- ----------------------------
diff --git a/OpenGridServices/ServiceManager/ServiceManager.cs b/OpenGridServices/ServiceManager/ServiceManager.cs
new file mode 100644
index 0000000..b21a5b1
--- /dev/null
+++ b/OpenGridServices/ServiceManager/ServiceManager.cs
@@ -0,0 +1,160 @@
1using System;
2using System.Diagnostics;
3using System.Threading;
4using System.ServiceProcess;
5using System.Xml;
6using System.IO;
7
8public class OpenGridMasterService : System.ServiceProcess.ServiceBase {
9
10 private Thread ServiceWorkerThread;
11
12 public OpenGridMasterService()
13 {
14 CanPauseAndContinue = false;
15 ServiceName = "OpenGridServices-master";
16 }
17
18 private void InitializeComponent()
19 {
20 this.CanPauseAndContinue = false;
21 this.CanShutdown = true;
22 this.ServiceName = "OpenGridServices-master";
23 }
24
25 protected override void OnStart(string[] args)
26 {
27 ServiceWorkerThread = new Thread(new ThreadStart(MainServiceThread));
28 ServiceWorkerThread.Start();
29 }
30
31 protected override void OnStop()
32 {
33 ServiceWorkerThread.Abort();
34 }
35
36 private void MainServiceThread()
37 {
38 try {
39 StreamReader reader=new StreamReader("opengrid-master-cfg.xml");
40
41 string configxml = reader.ReadToEnd();
42 XmlDocument doc = new XmlDocument();
43 doc.LoadXml(configxml);
44 XmlNode rootnode = doc.FirstChild;
45 if (rootnode.Name != "regions")
46 {
47 EventLog.WriteEntry("ERROR! bad XML in opengrid-master-cfg.xml - expected regions tag");
48 Console.WriteLine("Sorry, could not startup the service - please check your opengrid-master-cfg.xml file: missing regions tag");
49 (new ServiceController("OpenGridServices-master")).Stop();
50 }
51
52 for(int i=0; i<=rootnode.ChildNodes.Count; i++)
53 {
54 if(rootnode.ChildNodes.Item(i).Name != "region") {
55 EventLog.WriteEntry("nonfatal error - unexpected tag inside regions block of opengrid-master-cfg.xml");
56 (new ServiceController("OpenGridServices-master")).Stop();
57 }
58 }
59 } catch(Exception e) {
60 Console.WriteLine(e.ToString());
61 (new ServiceController("OpenGridServices-master")).Stop();
62 }
63
64 }
65
66 private static string SetupGrid()
67 {
68 Console.WriteLine("Running external program (OpenGridServices.GridServer.exe) to configure the grid server");
69 Process p = new Process();
70
71 p.StartInfo.Arguments = "-setuponly";
72 p.StartInfo.FileName = "OpenGridServices.GridServer.exe";
73 p.Start();
74
75 return "<gridserver />"; // we let the gridserver handle it's own setup
76 }
77
78 private static string SetupUser()
79 {
80 return "<user></user>";
81 }
82
83 private static string SetupAsset()
84 {
85 return "<asset></asset>";
86 }
87
88 private static string SetupRegion()
89 {
90 return "<regions></regions>";
91 }
92
93 public static void InitSetup()
94 {
95 string choice="";
96
97 string GridInfo;
98 string UserInfo;
99 string AssetInfo;
100 string RegionInfo;
101
102 bool grid=false;
103 bool user=false;
104 bool asset=false;
105 bool region=false;
106 while(choice!="OK")
107 {
108 Console.Clear();
109 Console.WriteLine("Please select the components you would like to run on this server:\n");
110
111 Console.WriteLine("1 - [" + (grid ? "X" : " ") + "] Grid server - this service handles co-ordinates of regions/sims on the grid");
112 Console.WriteLine("2 - [" + (user ? "X" : " ") + "] User server - this service handles user login, profiles, inventory and IM");
113 Console.WriteLine("3 - [" + (asset ? "X" : " ") + "] Asset server - this service handles storage of assets such as textures, objects, sounds, scripts");
114 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");
115
116
117 Console.Write("Type a number to toggle a choice or type OK to accept your current choices: ");
118 choice = Console.ReadLine();
119 switch(choice)
120 {
121 case "1":
122 grid = (!grid);
123 break;
124
125 case "2":
126 user = (!user);
127 break;
128
129 case "3":
130 asset = (!asset);
131 break;
132
133 case "4":
134 region = (!region);
135 break;
136 }
137 }
138
139 if(grid) GridInfo = SetupGrid();
140 if(user) UserInfo = SetupUser();
141 if(asset) AssetInfo = SetupAsset();
142 if(region) RegionInfo = SetupRegion();
143 }
144
145 public static void Main()
146 {
147 if(!File.Exists("opengrid-master-cfg.xml"))
148 {
149 Console.WriteLine("Could not find a config file, running initial setup");
150 InitSetup();
151 }
152 Console.WriteLine("Starting up OGS master service");
153 try {
154 ServiceBase.Run(new OpenGridMasterService());
155 } catch(Exception e) {
156 Console.WriteLine("THIS SHOULD NEVER HAPPEN!!!!!!!!!!!!!!!!!!!!!");
157 Console.WriteLine(e.ToString());
158 }
159 }
160}
diff --git a/OpenGridServices/ServiceManager/ServiceManager.csproj b/OpenGridServices/ServiceManager/ServiceManager.csproj
new file mode 100644
index 0000000..392f560
--- /dev/null
+++ b/OpenGridServices/ServiceManager/ServiceManager.csproj
@@ -0,0 +1,95 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{E141F4EE-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon>
10 </ApplicationIcon>
11 <AssemblyKeyContainerName>
12 </AssemblyKeyContainerName>
13 <AssemblyName>ServiceManager</AssemblyName>
14 <DefaultClientScript>JScript</DefaultClientScript>
15 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
17 <DelaySign>false</DelaySign>
18 <OutputType>Exe</OutputType>
19 <AppDesignerFolder>
20 </AppDesignerFolder>
21 <RootNamespace>ServiceManager</RootNamespace>
22 <StartupObject>
23 </StartupObject>
24 <FileUpgradeFlags>
25 </FileUpgradeFlags>
26 </PropertyGroup>
27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
28 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
29 <BaseAddress>285212672</BaseAddress>
30 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
31 <ConfigurationOverrideFile>
32 </ConfigurationOverrideFile>
33 <DefineConstants>TRACE;DEBUG</DefineConstants>
34 <DocumentationFile>
35 </DocumentationFile>
36 <DebugSymbols>True</DebugSymbols>
37 <FileAlignment>4096</FileAlignment>
38 <Optimize>False</Optimize>
39 <OutputPath>..\..\bin\</OutputPath>
40 <RegisterForComInterop>False</RegisterForComInterop>
41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
43 <WarningLevel>4</WarningLevel>
44 <NoWarn>
45 </NoWarn>
46 </PropertyGroup>
47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
49 <BaseAddress>285212672</BaseAddress>
50 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
51 <ConfigurationOverrideFile>
52 </ConfigurationOverrideFile>
53 <DefineConstants>TRACE</DefineConstants>
54 <DocumentationFile>
55 </DocumentationFile>
56 <DebugSymbols>False</DebugSymbols>
57 <FileAlignment>4096</FileAlignment>
58 <Optimize>True</Optimize>
59 <OutputPath>..\..\bin\</OutputPath>
60 <RegisterForComInterop>False</RegisterForComInterop>
61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
63 <WarningLevel>4</WarningLevel>
64 <NoWarn>
65 </NoWarn>
66 </PropertyGroup>
67 <ItemGroup>
68 <Reference Include="System">
69 <HintPath>System.dll</HintPath>
70 <Private>False</Private>
71 </Reference>
72 <Reference Include="System.ServiceProcess">
73 <HintPath>System.ServiceProcess.dll</HintPath>
74 <Private>False</Private>
75 </Reference>
76 <Reference Include="System.Xml">
77 <HintPath>System.Xml.dll</HintPath>
78 <Private>False</Private>
79 </Reference>
80 </ItemGroup>
81 <ItemGroup>
82 </ItemGroup>
83 <ItemGroup>
84 <Compile Include="ServiceManager.cs">
85 <SubType>Component</SubType>
86 </Compile>
87 </ItemGroup>
88 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
89 <PropertyGroup>
90 <PreBuildEvent>
91 </PreBuildEvent>
92 <PostBuildEvent>
93 </PostBuildEvent>
94 </PropertyGroup>
95</Project> \ No newline at end of file
diff --git a/OpenGridServices/ServiceManager/ServiceManager.csproj.user b/OpenGridServices/ServiceManager/ServiceManager.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenGridServices/ServiceManager/ServiceManager.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenGridServices/ServiceManager/ServiceManager.exe.build b/OpenGridServices/ServiceManager/ServiceManager.exe.build
new file mode 100644
index 0000000..163e086
--- /dev/null
+++ b/OpenGridServices/ServiceManager/ServiceManager.exe.build
@@ -0,0 +1,41 @@
1<?xml version="1.0" ?>
2<project name="ServiceManager" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
11 <resources prefix="ServiceManager" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="ServiceManager.cs" />
15 </sources>
16 <references basedir="${project::get-base-directory()}">
17 <lib>
18 <include name="${project::get-base-directory()}" />
19 <include name="${project::get-base-directory()}/${build.dir}" />
20 </lib>
21 <include name="System.dll" />
22 <include name="System.ServiceProcess.dll" />
23 <include name="System.Xml.dll" />
24 </references>
25 </csc>
26 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
27 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
28 <copy todir="${project::get-base-directory()}/../../bin/">
29 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
30 <include name="*.dll"/>
31 <include name="*.exe"/>
32 </fileset>
33 </copy>
34 </target>
35 <target name="clean">
36 <delete dir="${bin.dir}" failonerror="false" />
37 <delete dir="${obj.dir}" failonerror="false" />
38 </target>
39 <target name="doc" description="Creates documentation.">
40 </target>
41</project>
diff --git a/OpenSim.FxCop b/OpenSim.FxCop
new file mode 100644
index 0000000..1e2ea2d
--- /dev/null
+++ b/OpenSim.FxCop
@@ -0,0 +1,7241 @@
1<?xml version="1.0" encoding="utf-8"?>
2<FxCopProject Version="1.35" Name="OpenSim">
3 <ProjectOptions>
4 <SharedProject>True</SharedProject>
5 <Stylesheet Apply="False">http://www.gotdotnet.com/team/fxcop//xsl/1.35/FxCopReport.xsl</Stylesheet>
6 <SaveMessages>
7 <Project Status="Active, Excluded" NewOnly="False" />
8 <Report Status="Active" NewOnly="False" />
9 </SaveMessages>
10 <ProjectFile Compress="True" DefaultTargetCheck="True" DefaultRuleCheck="True" SaveByRuleGroup="" Deterministic="True" />
11 <EnableMultithreadedLoad>True</EnableMultithreadedLoad>
12 <EnableMultithreadedAnalysis>True</EnableMultithreadedAnalysis>
13 <SourceLookup>True</SourceLookup>
14 <AnalysisExceptionsThreshold>10</AnalysisExceptionsThreshold>
15 <RuleExceptionsThreshold>1</RuleExceptionsThreshold>
16 <Spelling Locale="en-us" />
17 <VersionAware>False</VersionAware>
18 <OverrideRuleVisibilities>False</OverrideRuleVisibilities>
19 <CustomDictionaries SearchFxCopDir="True" SearchUserProfile="True" SearchProjectDir="True" />
20 <SearchGlobalAssemblyCache>False</SearchGlobalAssemblyCache>
21 <DeadlockDetectionTimeout>120</DeadlockDetectionTimeout>
22 </ProjectOptions>
23 <Targets>
24 <AssemblyReferenceDirectories>
25 <Directory>$(ProjectDir)/lib/</Directory>
26 </AssemblyReferenceDirectories>
27 <Target Name="$(ProjectDir)/bin/OpenGridServices.ServerConsole.dll" Analyze="True" AnalyzeAllChildren="True" />
28 <Target Name="$(ProjectDir)/bin/OpenSim.Config.SimConfigDb4o.dll" Analyze="True" AnalyzeAllChildren="True" />
29 <Target Name="$(ProjectDir)/bin/OpenSim.exe" Analyze="True" AnalyzeAllChildren="True" />
30 <Target Name="$(ProjectDir)/bin/OpenSim.Framework.Console.dll" Analyze="True" AnalyzeAllChildren="True" />
31 <Target Name="$(ProjectDir)/bin/OpenSim.Framework.dll" Analyze="True" AnalyzeAllChildren="True" />
32 <Target Name="$(ProjectDir)/bin/OpenSim.GridInterfaces.Local.dll" Analyze="True" AnalyzeAllChildren="True" />
33 <Target Name="$(ProjectDir)/bin/OpenSim.GridInterfaces.Remote.dll" Analyze="True" AnalyzeAllChildren="True" />
34 <Target Name="$(ProjectDir)/bin/OpenSim.Physics.Manager.dll" Analyze="True" AnalyzeAllChildren="True" />
35 <Target Name="$(ProjectDir)/bin/OpenSim.RegionServer.dll" Analyze="True" AnalyzeAllChildren="True" />
36 <Target Name="$(ProjectDir)/bin/OpenSim.Storage.LocalStorageDb4o.dll" Analyze="True" AnalyzeAllChildren="True" />
37 <Target Name="$(ProjectDir)/bin/Physics/OpenSim.Physics.BasicPhysicsPlugin.dll" Analyze="True" AnalyzeAllChildren="True" />
38 <Target Name="$(ProjectDir)/bin/Physics/OpenSim.Physics.OdePlugin.dll" Analyze="True" AnalyzeAllChildren="True" />
39 <Target Name="$(ProjectDir)/bin/Physics/OpenSim.Physics.PhysXPlugin.dll" Analyze="True" AnalyzeAllChildren="True" />
40 </Targets>
41 <Rules>
42 <RuleFiles>
43 <RuleFile Name="$(FxCopDir)\Rules\DesignRules.dll" Enabled="True" AllRulesEnabled="True" />
44 <RuleFile Name="$(FxCopDir)\Rules\GlobalizationRules.dll" Enabled="True" AllRulesEnabled="True" />
45 <RuleFile Name="$(FxCopDir)\Rules\InteroperabilityRules.dll" Enabled="True" AllRulesEnabled="True" />
46 <RuleFile Name="$(FxCopDir)\Rules\MobilityRules.dll" Enabled="True" AllRulesEnabled="True" />
47 <RuleFile Name="$(FxCopDir)\Rules\NamingRules.dll" Enabled="True" AllRulesEnabled="True" />
48 <RuleFile Name="$(FxCopDir)\Rules\PerformanceRules.dll" Enabled="True" AllRulesEnabled="True" />
49 <RuleFile Name="$(FxCopDir)\Rules\PortabilityRules.dll" Enabled="True" AllRulesEnabled="True" />
50 <RuleFile Name="$(FxCopDir)\Rules\SecurityRules.dll" Enabled="True" AllRulesEnabled="True" />
51 <RuleFile Name="$(FxCopDir)\Rules\UsageRules.dll" Enabled="True" AllRulesEnabled="True" />
52 </RuleFiles>
53 <Groups />
54 <Settings />
55 </Rules>
56 <FxCopReport Version="1.35">
57 <Namespaces>
58 <Namespace Name="OpenSim">
59 <Messages>
60 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
61 <Issue Name="Namespace">
62 <Item>Sim</Item>
63 <Item>OpenSim</Item>
64 </Issue>
65 </Message>
66 </Messages>
67 </Namespace>
68 <Namespace Name="OpenSim.Assets">
69 <Messages>
70 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
71 <Issue Name="Namespace">
72 <Item>Sim</Item>
73 <Item>OpenSim.Assets</Item>
74 </Issue>
75 </Message>
76 </Messages>
77 </Namespace>
78 <Namespace Name="OpenSim.CAPS">
79 <Messages>
80 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
81 <Issue>
82 <Item>OpenSim.CAPS</Item>
83 </Issue>
84 </Message>
85 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
86 <Issue Name="Namespace">
87 <Item>Sim</Item>
88 <Item>OpenSim.CAPS</Item>
89 </Issue>
90 </Message>
91 <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
92 <Issue Name="Namespace">
93 <Item>OpenSim.CAPS</Item>
94 </Issue>
95 </Message>
96 </Messages>
97 </Namespace>
98 <Namespace Name="OpenSim.Config.SimConfigDb4o">
99 <Messages>
100 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
101 <Issue Name="Namespace">
102 <Item>Sim</Item>
103 <Item>OpenSim.Config.SimConfigDb4o</Item>
104 </Issue>
105 <Issue Name="Namespace">
106 <Item>Sim</Item>
107 <Item>OpenSim.Config.SimConfigDb4o</Item>
108 </Issue>
109 </Message>
110 </Messages>
111 </Namespace>
112 <Namespace Name="OpenSim.Framework.Assets">
113 <Messages>
114 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
115 <Issue>
116 <Item>OpenSim.Framework.Assets</Item>
117 </Issue>
118 </Message>
119 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
120 <Issue Name="Namespace">
121 <Item>Sim</Item>
122 <Item>OpenSim.Framework.Assets</Item>
123 </Issue>
124 </Message>
125 </Messages>
126 </Namespace>
127 <Namespace Name="OpenSim.Framework.Console">
128 <Messages>
129 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
130 <Issue Name="Namespace">
131 <Item>Sim</Item>
132 <Item>OpenSim.Framework.Console</Item>
133 </Issue>
134 </Message>
135 </Messages>
136 </Namespace>
137 <Namespace Name="OpenSim.Framework.Grid">
138 <Messages>
139 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
140 <Issue>
141 <Item>OpenSim.Framework.Grid</Item>
142 </Issue>
143 </Message>
144 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
145 <Issue Name="Namespace">
146 <Item>Sim</Item>
147 <Item>OpenSim.Framework.Grid</Item>
148 </Issue>
149 </Message>
150 </Messages>
151 </Namespace>
152 <Namespace Name="OpenSim.Framework.Interfaces">
153 <Messages>
154 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
155 <Issue Name="Namespace">
156 <Item>Sim</Item>
157 <Item>OpenSim.Framework.Interfaces</Item>
158 </Issue>
159 </Message>
160 </Messages>
161 </Namespace>
162 <Namespace Name="OpenSim.Framework.Inventory">
163 <Messages>
164 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
165 <Issue>
166 <Item>OpenSim.Framework.Inventory</Item>
167 </Issue>
168 </Message>
169 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
170 <Issue Name="Namespace">
171 <Item>Sim</Item>
172 <Item>OpenSim.Framework.Inventory</Item>
173 </Issue>
174 </Message>
175 </Messages>
176 </Namespace>
177 <Namespace Name="OpenSim.Framework.Sims">
178 <Messages>
179 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
180 <Issue>
181 <Item>OpenSim.Framework.Sims</Item>
182 </Issue>
183 </Message>
184 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
185 <Issue Name="Namespace">
186 <Item>Sim</Item>
187 <Item>OpenSim.Framework.Sims</Item>
188 </Issue>
189 </Message>
190 </Messages>
191 </Namespace>
192 <Namespace Name="OpenSim.Framework.Terrain">
193 <Messages>
194 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
195 <Issue>
196 <Item>OpenSim.Framework.Terrain</Item>
197 </Issue>
198 </Message>
199 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
200 <Issue Name="Namespace">
201 <Item>Sim</Item>
202 <Item>OpenSim.Framework.Terrain</Item>
203 </Issue>
204 </Message>
205 </Messages>
206 </Namespace>
207 <Namespace Name="OpenSim.Framework.User">
208 <Messages>
209 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
210 <Issue>
211 <Item>OpenSim.Framework.User</Item>
212 </Issue>
213 </Message>
214 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
215 <Issue Name="Namespace">
216 <Item>Sim</Item>
217 <Item>OpenSim.Framework.User</Item>
218 </Issue>
219 </Message>
220 </Messages>
221 </Namespace>
222 <Namespace Name="OpenSim.Framework.Utilities">
223 <Messages>
224 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
225 <Issue>
226 <Item>OpenSim.Framework.Utilities</Item>
227 </Issue>
228 </Message>
229 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
230 <Issue Name="Namespace">
231 <Item>Sim</Item>
232 <Item>OpenSim.Framework.Utilities</Item>
233 </Issue>
234 </Message>
235 </Messages>
236 </Namespace>
237 <Namespace Name="OpenSim.GridInterfaces.Local">
238 <Messages>
239 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
240 <Issue Name="Namespace">
241 <Item>Sim</Item>
242 <Item>OpenSim.GridInterfaces.Local</Item>
243 </Issue>
244 </Message>
245 </Messages>
246 </Namespace>
247 <Namespace Name="OpenSim.GridInterfaces.Remote">
248 <Messages>
249 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
250 <Issue>
251 <Item>OpenSim.GridInterfaces.Remote</Item>
252 </Issue>
253 </Message>
254 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
255 <Issue Name="Namespace">
256 <Item>Sim</Item>
257 <Item>OpenSim.GridInterfaces.Remote</Item>
258 </Issue>
259 </Message>
260 </Messages>
261 </Namespace>
262 <Namespace Name="OpenSim.Physics.BasicPhysicsPlugin">
263 <Messages>
264 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
265 <Issue Name="Namespace">
266 <Item>Plugin</Item>
267 <Item>OpenSim.Physics.BasicPhysicsPlugin</Item>
268 </Issue>
269 </Message>
270 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
271 <Issue Name="Namespace">
272 <Item>Sim</Item>
273 <Item>OpenSim.Physics.BasicPhysicsPlugin</Item>
274 </Issue>
275 </Message>
276 </Messages>
277 </Namespace>
278 <Namespace Name="OpenSim.Physics.Manager">
279 <Messages>
280 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
281 <Issue Name="Namespace">
282 <Item>Sim</Item>
283 <Item>OpenSim.Physics.Manager</Item>
284 </Issue>
285 </Message>
286 </Messages>
287 </Namespace>
288 <Namespace Name="OpenSim.Physics.OdePlugin">
289 <Messages>
290 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
291 <Issue>
292 <Item>OpenSim.Physics.OdePlugin</Item>
293 </Issue>
294 </Message>
295 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
296 <Issue Name="Namespace">
297 <Item>Plugin</Item>
298 <Item>OpenSim.Physics.OdePlugin</Item>
299 </Issue>
300 </Message>
301 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
302 <Issue Name="Namespace">
303 <Item>Sim</Item>
304 <Item>OpenSim.Physics.OdePlugin</Item>
305 </Issue>
306 </Message>
307 </Messages>
308 </Namespace>
309 <Namespace Name="OpenSim.Physics.PhysXPlugin">
310 <Messages>
311 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
312 <Issue>
313 <Item>OpenSim.Physics.PhysXPlugin</Item>
314 </Issue>
315 </Message>
316 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
317 <Issue Name="Namespace">
318 <Item>Plugin</Item>
319 <Item>OpenSim.Physics.PhysXPlugin</Item>
320 </Issue>
321 </Message>
322 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
323 <Issue Name="Namespace">
324 <Item>Sim</Item>
325 <Item>OpenSim.Physics.PhysXPlugin</Item>
326 </Issue>
327 </Message>
328 </Messages>
329 </Namespace>
330 <Namespace Name="OpenSim.Storage.LocalStorageDb4o">
331 <Messages>
332 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
333 <Issue Name="Namespace">
334 <Item>Sim</Item>
335 <Item>OpenSim.Storage.LocalStorageDb4o</Item>
336 </Issue>
337 </Message>
338 </Messages>
339 </Namespace>
340 <Namespace Name="OpenSim.types">
341 <Messages>
342 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
343 <Issue>
344 <Item>OpenSim.types</Item>
345 </Issue>
346 </Message>
347 <Message TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
348 <Issue Name="Namespace">
349 <Item>OpenSim.types</Item>
350 </Issue>
351 </Message>
352 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
353 <Issue Name="Namespace">
354 <Item>Sim</Item>
355 <Item>OpenSim.types</Item>
356 </Issue>
357 </Message>
358 </Messages>
359 </Namespace>
360 <Namespace Name="OpenSim.UserServer">
361 <Messages>
362 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
363 <Issue>
364 <Item>OpenSim.UserServer</Item>
365 </Issue>
366 </Message>
367 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
368 <Issue Name="Namespace">
369 <Item>Sim</Item>
370 <Item>OpenSim.UserServer</Item>
371 </Issue>
372 </Message>
373 </Messages>
374 </Namespace>
375 <Namespace Name="OpenSim.world">
376 <Messages>
377 <Message TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
378 <Issue Name="Namespace">
379 <Item>OpenSim.world</Item>
380 </Issue>
381 </Message>
382 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
383 <Issue Name="Namespace">
384 <Item>Sim</Item>
385 <Item>OpenSim.world</Item>
386 </Issue>
387 </Message>
388 </Messages>
389 </Namespace>
390 <Namespace Name="OpenSim.world.scripting">
391 <Messages>
392 <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2007-03-27 04:29:04Z">
393 <Issue>
394 <Item>OpenSim.world.scripting</Item>
395 </Issue>
396 </Message>
397 <Message TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
398 <Issue Name="Namespace">
399 <Item>OpenSim.world.scripting</Item>
400 </Issue>
401 <Issue Name="Namespace">
402 <Item>OpenSim.world.scripting</Item>
403 </Issue>
404 </Message>
405 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
406 <Issue Name="Namespace">
407 <Item>Sim</Item>
408 <Item>OpenSim.world.scripting</Item>
409 </Issue>
410 </Message>
411 </Messages>
412 </Namespace>
413 </Namespaces>
414 <Targets>
415 <Target Name="$(ProjectDir)/bin/OpenGridServices.ServerConsole.dll">
416 <Modules>
417 <Module Name="opengridservices.serverconsole.dll">
418 <Messages>
419 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
420 <Issue>
421 <Item>OpenGridServices.ServerConsole</Item>
422 </Issue>
423 </Message>
424 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
425 <Issue Name="NoStrongName">
426 <Item>OpenGridServices.ServerConsole</Item>
427 </Issue>
428 </Message>
429 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
430 <Issue Name="NoAttr">
431 <Item>OpenGridServices.ServerConsole</Item>
432 </Issue>
433 </Message>
434 </Messages>
435 <Namespaces>
436 <Namespace Name="ServerConsole">
437 <Types>
438 <Type Name="conscmd_callback">
439 <Messages>
440 <Message TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
441 <Issue Name="Type">
442 <Item>conscmd_callback</Item>
443 </Issue>
444 </Message>
445 <Message Id="conscmd" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
446 <Issue Name="Type">
447 <Item>conscmd</Item>
448 <Item>ServerConsole.conscmd_callback</Item>
449 </Issue>
450 </Message>
451 <Message TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
452 <Issue Name="Type">
453 <Item>conscmd_callback</Item>
454 </Issue>
455 </Message>
456 </Messages>
457 <Members>
458 <Member Name="RunCmd(System.String,System.String[]):System.Void">
459 <Messages>
460 <Message Id="1#cmdparams" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
461 <Issue Name="Parameter">
462 <Item>conscmd_callback.RunCmd(String, String[]):Void</Item>
463 <Item>cmdparams</Item>
464 <Item>cmdparams</Item>
465 </Issue>
466 </Message>
467 </Messages>
468 </Member>
469 <Member Name="Show(System.String):System.Void">
470 <Messages>
471 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
472 <Issue Name="Parameter">
473 <Item>ShowWhat</Item>
474 </Issue>
475 </Message>
476 </Messages>
477 </Member>
478 </Members>
479 </Type>
480 <Type Name="ConsoleBase">
481 <Members>
482 <Member Name="CmdPrompt(System.String,System.String):System.String">
483 <Messages>
484 <Message Id="1#defaultresponse" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
485 <Issue Name="Parameter">
486 <Item>ConsoleBase.CmdPrompt(String, String):String</Item>
487 <Item>defaultresponse</Item>
488 <Item>defaultresponse</Item>
489 </Issue>
490 </Message>
491 </Messages>
492 </Member>
493 <Member Name="CmdPrompt(System.String,System.String,System.String,System.String):System.String">
494 <Messages>
495 <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
496 <Issue Name="Parameter">
497 <Item>OptionA</Item>
498 </Issue>
499 </Message>
500 <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
501 <Issue Name="Parameter">
502 <Item>OptionB</Item>
503 </Issue>
504 </Message>
505 <Message Id="1#defaultresponse" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
506 <Issue Name="Parameter">
507 <Item>ConsoleBase.CmdPrompt(String, String, String, String):String</Item>
508 <Item>defaultresponse</Item>
509 <Item>defaultresponse</Item>
510 </Issue>
511 </Message>
512 </Messages>
513 </Member>
514 <Member Name="PasswdPrompt(System.String):System.String">
515 <Messages>
516 <Message Id="Passwd" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
517 <Issue Name="Member">
518 <Item>Passwd</Item>
519 <Item>ConsoleBase.PasswdPrompt(String):String</Item>
520 </Issue>
521 </Message>
522 </Messages>
523 </Member>
524 <Member Name="RunCmd(System.String,System.String[]):System.Object">
525 <Messages>
526 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
527 <Issue Name="Parameter">
528 <Item>Cmd</Item>
529 </Issue>
530 </Message>
531 <Message Id="1#cmdparams" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
532 <Issue Name="Parameter">
533 <Item>ConsoleBase.RunCmd(String, String[]):Object</Item>
534 <Item>cmdparams</Item>
535 <Item>cmdparams</Item>
536 </Issue>
537 </Message>
538 </Messages>
539 </Member>
540 <Member Name="ShowCommands(System.String):System.Void">
541 <Messages>
542 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
543 <Issue Name="Parameter">
544 <Item>ShowWhat</Item>
545 </Issue>
546 </Message>
547 </Messages>
548 </Member>
549 <Member Name="Write(System.String):System.Void">
550 <Messages>
551 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
552 <Issue Name="Parameter">
553 <Item>Line</Item>
554 </Issue>
555 </Message>
556 </Messages>
557 </Member>
558 <Member Name="WriteLine(System.String):System.Void">
559 <Messages>
560 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
561 <Issue Name="Parameter">
562 <Item>Line</Item>
563 </Issue>
564 </Message>
565 </Messages>
566 </Member>
567 </Members>
568 </Type>
569 <Type Name="ConsoleBase+ConsoleType">
570 <Members>
571 <Member Name="SimChat">
572 <Messages>
573 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
574 <Issue Name="Member">
575 <Item>Sim</Item>
576 <Item>ConsoleType.SimChat</Item>
577 </Issue>
578 </Message>
579 </Messages>
580 </Member>
581 <Member Name="TCP">
582 <Messages>
583 <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
584 <Issue Name="Member">
585 <Item>ConsoleType.TCP</Item>
586 </Issue>
587 </Message>
588 </Messages>
589 </Member>
590 </Members>
591 </Type>
592 <Type Name="MainConsole">
593 <Messages>
594 <Message TypeName="StaticHolderTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1053" Created="2007-03-27 04:29:04Z">
595 <Issue>
596 <Item>MainConsole</Item>
597 </Issue>
598 </Message>
599 </Messages>
600 </Type>
601 </Types>
602 </Namespace>
603 </Namespaces>
604 </Module>
605 </Modules>
606 </Target>
607 <Target Name="$(ProjectDir)/bin/OpenSim.Config.SimConfigDb4o.dll">
608 <Modules>
609 <Module Name="opensim.config.simconfigdb4o.dll">
610 <Messages>
611 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
612 <Issue>
613 <Item>OpenSim.Config.SimConfigDb4o</Item>
614 </Issue>
615 </Message>
616 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
617 <Issue Name="NoStrongName">
618 <Item>OpenSim.Config.SimConfigDb4o</Item>
619 </Issue>
620 </Message>
621 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
622 <Issue Name="NoAttr">
623 <Item>OpenSim.Config.SimConfigDb4o</Item>
624 </Issue>
625 </Message>
626 </Messages>
627 <Namespaces>
628 <Namespace Name="OpenSim.Config.SimConfigDb4o">
629 <Types>
630 <Type Name="Db40ConfigPlugin">
631 <Messages>
632 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
633 <Issue Name="Type">
634 <Item>Plugin</Item>
635 <Item>OpenSim.Config.SimConfigDb4o.Db40ConfigPlugin</Item>
636 </Issue>
637 </Message>
638 </Messages>
639 </Type>
640 <Type Name="DbSimConfig">
641 <Messages>
642 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
643 <Issue Name="Type">
644 <Item>Sim</Item>
645 <Item>OpenSim.Config.SimConfigDb4o.DbSimConfig</Item>
646 </Issue>
647 </Message>
648 <Message TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
649 <Issue Name="Type">
650 <Item>Db</Item>
651 <Item>OpenSim.Config.SimConfigDb4o.DbSimConfig</Item>
652 </Issue>
653 </Message>
654 </Messages>
655 <Members>
656 <Member Name="InitConfig(System.Boolean):System.Void">
657 <Messages>
658 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
659 <Issue>
660 <Item>DbSimConfig.InitConfig(Boolean):Void</Item>
661 <Item>System.Exception</Item>
662 </Issue>
663 </Message>
664 <Message Id="System.UInt32.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
665 <Issue>
666 <Item>DbSimConfig.InitConfig(Boolean):Void</Item>
667 <Item>System.UInt32.ToString</Item>
668 <Item>System.UInt32.ToString(System.IFormatProvider)</Item>
669 </Issue>
670 </Message>
671 <Message Id="System.UInt64.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
672 <Issue>
673 <Item>DbSimConfig.InitConfig(Boolean):Void</Item>
674 <Item>System.UInt64.ToString</Item>
675 <Item>System.UInt64.ToString(System.IFormatProvider)</Item>
676 </Issue>
677 </Message>
678 </Messages>
679 </Member>
680 <Member Name="LoadDefaults():System.Void">
681 <Messages>
682 <Message Id="System.Convert.ToInt32(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
683 <Issue>
684 <Item>DbSimConfig.LoadDefaults():Void</Item>
685 <Item>System.Convert.ToInt32(System.String)</Item>
686 <Item>System.Convert.ToInt32(System.String,System.IFormatProvider)</Item>
687 </Issue>
688 <Issue>
689 <Item>DbSimConfig.LoadDefaults():Void</Item>
690 <Item>System.Convert.ToInt32(System.String)</Item>
691 <Item>System.Convert.ToInt32(System.String,System.IFormatProvider)</Item>
692 </Issue>
693 <Issue>
694 <Item>DbSimConfig.LoadDefaults():Void</Item>
695 <Item>System.Convert.ToInt32(System.String)</Item>
696 <Item>System.Convert.ToInt32(System.String,System.IFormatProvider)</Item>
697 </Issue>
698 </Message>
699 </Messages>
700 </Member>
701 </Members>
702 </Type>
703 <Type Name="MapStorage">
704 <Members>
705 <Member Name="Map">
706 <Messages>
707 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
708 <Issue>
709 <Item>Map</Item>
710 </Issue>
711 </Message>
712 </Messages>
713 </Member>
714 </Members>
715 </Type>
716 </Types>
717 </Namespace>
718 </Namespaces>
719 </Module>
720 </Modules>
721 </Target>
722 <Target Name="$(ProjectDir)/bin/OpenSim.exe">
723 <Modules>
724 <Module Name="opensim.exe">
725 <Messages>
726 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
727 <Issue>
728 <Item>OpenSim</Item>
729 </Issue>
730 </Message>
731 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
732 <Issue Name="NoStrongName">
733 <Item>OpenSim</Item>
734 </Issue>
735 </Message>
736 <Message TypeName="MarkAssembliesWithAssemblyVersion" Category="Microsoft.Design" CheckId="CA1016" Created="2007-03-27 04:29:04Z">
737 <Issue>
738 <Item>OpenSim</Item>
739 </Issue>
740 </Message>
741 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
742 <Issue Name="NoAttr">
743 <Item>OpenSim</Item>
744 </Issue>
745 </Message>
746 <Message TypeName="MarkAssembliesWithComVisible" Category="Microsoft.Design" CheckId="CA1017" Created="2007-03-27 04:29:04Z">
747 <Issue Name="NoAttribute" Level="CriticalError">
748 <Item>OpenSim</Item>
749 </Issue>
750 </Message>
751 </Messages>
752 <Namespaces>
753 <Namespace Name="OpenSim">
754 <Types>
755 <Type Name="RegionServer">
756 <Members>
757 <Member Name="Main(System.String[]):System.Void">
758 <Messages>
759 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
760 <Issue>
761 <Item>'args'</Item>
762 <Item>RegionServer.Main(String[]):Void</Item>
763 </Issue>
764 <Issue>
765 <Item>'args'</Item>
766 <Item>RegionServer.Main(String[]):Void</Item>
767 </Issue>
768 </Message>
769 </Messages>
770 </Member>
771 </Members>
772 </Type>
773 </Types>
774 </Namespace>
775 </Namespaces>
776 </Module>
777 </Modules>
778 </Target>
779 <Target Name="$(ProjectDir)/bin/OpenSim.Framework.Console.dll">
780 <Modules>
781 <Module Name="opensim.framework.console.dll">
782 <Messages>
783 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
784 <Issue>
785 <Item>OpenSim.Framework.Console</Item>
786 </Issue>
787 </Message>
788 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
789 <Issue Name="NoStrongName">
790 <Item>OpenSim.Framework.Console</Item>
791 </Issue>
792 </Message>
793 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
794 <Issue Name="NoAttr">
795 <Item>OpenSim.Framework.Console</Item>
796 </Issue>
797 </Message>
798 </Messages>
799 <Namespaces>
800 <Namespace Name="OpenSim.Framework.Console">
801 <Types>
802 <Type Name="ConsoleBase">
803 <Members>
804 <Member Name="CmdPrompt(System.String,System.String):System.String">
805 <Messages>
806 <Message Id="1#defaultresponse" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
807 <Issue Name="Parameter">
808 <Item>ConsoleBase.CmdPrompt(String, String):String</Item>
809 <Item>defaultresponse</Item>
810 <Item>defaultresponse</Item>
811 </Issue>
812 </Message>
813 </Messages>
814 </Member>
815 <Member Name="CmdPrompt(System.String,System.String,System.String,System.String):System.String">
816 <Messages>
817 <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
818 <Issue Name="Parameter">
819 <Item>OptionA</Item>
820 </Issue>
821 </Message>
822 <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
823 <Issue Name="Parameter">
824 <Item>OptionB</Item>
825 </Issue>
826 </Message>
827 <Message Id="1#defaultresponse" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
828 <Issue Name="Parameter">
829 <Item>ConsoleBase.CmdPrompt(String, String, String, String):String</Item>
830 <Item>defaultresponse</Item>
831 <Item>defaultresponse</Item>
832 </Issue>
833 </Message>
834 </Messages>
835 </Member>
836 <Member Name="RunCmd(System.String,System.String[]):System.Object">
837 <Messages>
838 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
839 <Issue Name="Parameter">
840 <Item>Cmd</Item>
841 </Issue>
842 </Message>
843 <Message Id="1#cmdparams" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
844 <Issue Name="Parameter">
845 <Item>ConsoleBase.RunCmd(String, String[]):Object</Item>
846 <Item>cmdparams</Item>
847 <Item>cmdparams</Item>
848 </Issue>
849 </Message>
850 </Messages>
851 </Member>
852 <Member Name="ShowCommands(System.String):System.Void">
853 <Messages>
854 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
855 <Issue Name="Parameter">
856 <Item>ShowWhat</Item>
857 </Issue>
858 </Message>
859 </Messages>
860 </Member>
861 </Members>
862 </Type>
863 <Type Name="ConsoleBase+ConsoleType">
864 <Members>
865 <Member Name="SimChat">
866 <Messages>
867 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
868 <Issue Name="Member">
869 <Item>Sim</Item>
870 <Item>ConsoleType.SimChat</Item>
871 </Issue>
872 </Message>
873 </Messages>
874 </Member>
875 <Member Name="TCP">
876 <Messages>
877 <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
878 <Issue Name="Member">
879 <Item>ConsoleType.TCP</Item>
880 </Issue>
881 </Message>
882 </Messages>
883 </Member>
884 </Members>
885 </Type>
886 <Type Name="MainConsole">
887 <Messages>
888 <Message TypeName="StaticHolderTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1053" Created="2007-03-27 04:29:04Z">
889 <Issue>
890 <Item>MainConsole</Item>
891 </Issue>
892 </Message>
893 </Messages>
894 </Type>
895 </Types>
896 </Namespace>
897 </Namespaces>
898 </Module>
899 </Modules>
900 </Target>
901 <Target Name="$(ProjectDir)/bin/OpenSim.Framework.dll">
902 <Modules>
903 <Module Name="opensim.framework.dll">
904 <Messages>
905 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
906 <Issue>
907 <Item>OpenSim.Framework</Item>
908 </Issue>
909 </Message>
910 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
911 <Issue Name="NoStrongName">
912 <Item>OpenSim.Framework</Item>
913 </Issue>
914 </Message>
915 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
916 <Issue Name="NoAttr">
917 <Item>OpenSim.Framework</Item>
918 </Issue>
919 </Message>
920 </Messages>
921 <Namespaces>
922 <Namespace Name="OpenSim.Framework.Assets">
923 <Types>
924 <Type Name="AssetBase">
925 <Members>
926 <Member Name="Data">
927 <Messages>
928 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
929 <Issue>
930 <Item>Data</Item>
931 </Issue>
932 </Message>
933 </Messages>
934 </Member>
935 <Member Name="Description">
936 <Messages>
937 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
938 <Issue>
939 <Item>Description</Item>
940 </Issue>
941 </Message>
942 </Messages>
943 </Member>
944 <Member Name="FullID">
945 <Messages>
946 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
947 <Issue>
948 <Item>FullID</Item>
949 </Issue>
950 </Message>
951 </Messages>
952 </Member>
953 <Member Name="InvType">
954 <Messages>
955 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
956 <Issue>
957 <Item>InvType</Item>
958 </Issue>
959 </Message>
960 </Messages>
961 </Member>
962 <Member Name="Name">
963 <Messages>
964 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
965 <Issue>
966 <Item>Name</Item>
967 </Issue>
968 </Message>
969 </Messages>
970 </Member>
971 <Member Name="Type">
972 <Messages>
973 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
974 <Issue>
975 <Item>Type</Item>
976 </Issue>
977 </Message>
978 </Messages>
979 </Member>
980 </Members>
981 </Type>
982 <Type Name="PrimData">
983 <Members>
984 <Member Name=".ctor()">
985 <Messages>
986 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
987 <Issue>
988 <Item>PrimData.PrimData()</Item>
989 <Item>ParentID</Item>
990 <Item>System.UInt32</Item>
991 <Item>0</Item>
992 </Issue>
993 </Message>
994 </Messages>
995 </Member>
996 <Member Name="FullID">
997 <Messages>
998 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
999 <Issue>
1000 <Item>FullID</Item>
1001 </Issue>
1002 </Message>
1003 </Messages>
1004 </Member>
1005 <Member Name="LocalID">
1006 <Messages>
1007 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1008 <Issue>
1009 <Item>LocalID</Item>
1010 </Issue>
1011 </Message>
1012 </Messages>
1013 </Member>
1014 <Member Name="OwnerID">
1015 <Messages>
1016 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1017 <Issue>
1018 <Item>OwnerID</Item>
1019 </Issue>
1020 </Message>
1021 </Messages>
1022 </Member>
1023 <Member Name="ParentID">
1024 <Messages>
1025 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1026 <Issue>
1027 <Item>ParentID</Item>
1028 </Issue>
1029 </Message>
1030 </Messages>
1031 </Member>
1032 <Member Name="PathBegin">
1033 <Messages>
1034 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1035 <Issue>
1036 <Item>PathBegin</Item>
1037 </Issue>
1038 </Message>
1039 </Messages>
1040 </Member>
1041 <Member Name="PathCurve">
1042 <Messages>
1043 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1044 <Issue>
1045 <Item>PathCurve</Item>
1046 </Issue>
1047 </Message>
1048 </Messages>
1049 </Member>
1050 <Member Name="PathEnd">
1051 <Messages>
1052 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1053 <Issue>
1054 <Item>PathEnd</Item>
1055 </Issue>
1056 </Message>
1057 </Messages>
1058 </Member>
1059 <Member Name="PathRadiusOffset">
1060 <Messages>
1061 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1062 <Issue>
1063 <Item>PathRadiusOffset</Item>
1064 </Issue>
1065 </Message>
1066 </Messages>
1067 </Member>
1068 <Member Name="PathRevolutions">
1069 <Messages>
1070 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1071 <Issue>
1072 <Item>PathRevolutions</Item>
1073 </Issue>
1074 </Message>
1075 </Messages>
1076 </Member>
1077 <Member Name="PathScaleX">
1078 <Messages>
1079 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1080 <Issue>
1081 <Item>PathScaleX</Item>
1082 </Issue>
1083 </Message>
1084 </Messages>
1085 </Member>
1086 <Member Name="PathScaleY">
1087 <Messages>
1088 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1089 <Issue>
1090 <Item>PathScaleY</Item>
1091 </Issue>
1092 </Message>
1093 </Messages>
1094 </Member>
1095 <Member Name="PathShearX">
1096 <Messages>
1097 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1098 <Issue>
1099 <Item>PathShearX</Item>
1100 </Issue>
1101 </Message>
1102 </Messages>
1103 </Member>
1104 <Member Name="PathShearY">
1105 <Messages>
1106 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1107 <Issue>
1108 <Item>PathShearY</Item>
1109 </Issue>
1110 </Message>
1111 </Messages>
1112 </Member>
1113 <Member Name="PathSkew">
1114 <Messages>
1115 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1116 <Issue>
1117 <Item>PathSkew</Item>
1118 </Issue>
1119 </Message>
1120 </Messages>
1121 </Member>
1122 <Member Name="PathTaperX">
1123 <Messages>
1124 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1125 <Issue>
1126 <Item>PathTaperX</Item>
1127 </Issue>
1128 </Message>
1129 </Messages>
1130 </Member>
1131 <Member Name="PathTaperY">
1132 <Messages>
1133 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1134 <Issue>
1135 <Item>PathTaperY</Item>
1136 </Issue>
1137 </Message>
1138 </Messages>
1139 </Member>
1140 <Member Name="PathTwist">
1141 <Messages>
1142 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1143 <Issue>
1144 <Item>PathTwist</Item>
1145 </Issue>
1146 </Message>
1147 </Messages>
1148 </Member>
1149 <Member Name="PathTwistBegin">
1150 <Messages>
1151 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1152 <Issue>
1153 <Item>PathTwistBegin</Item>
1154 </Issue>
1155 </Message>
1156 </Messages>
1157 </Member>
1158 <Member Name="PCode">
1159 <Messages>
1160 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1161 <Issue>
1162 <Item>PCode</Item>
1163 </Issue>
1164 </Message>
1165 </Messages>
1166 </Member>
1167 <Member Name="Position">
1168 <Messages>
1169 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1170 <Issue>
1171 <Item>Position</Item>
1172 </Issue>
1173 </Message>
1174 </Messages>
1175 </Member>
1176 <Member Name="ProfileBegin">
1177 <Messages>
1178 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1179 <Issue>
1180 <Item>ProfileBegin</Item>
1181 </Issue>
1182 </Message>
1183 </Messages>
1184 </Member>
1185 <Member Name="ProfileCurve">
1186 <Messages>
1187 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1188 <Issue>
1189 <Item>ProfileCurve</Item>
1190 </Issue>
1191 </Message>
1192 </Messages>
1193 </Member>
1194 <Member Name="ProfileEnd">
1195 <Messages>
1196 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1197 <Issue>
1198 <Item>ProfileEnd</Item>
1199 </Issue>
1200 </Message>
1201 </Messages>
1202 </Member>
1203 <Member Name="ProfileHollow">
1204 <Messages>
1205 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1206 <Issue>
1207 <Item>ProfileHollow</Item>
1208 </Issue>
1209 </Message>
1210 </Messages>
1211 </Member>
1212 <Member Name="Rotation">
1213 <Messages>
1214 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1215 <Issue>
1216 <Item>Rotation</Item>
1217 </Issue>
1218 </Message>
1219 </Messages>
1220 </Member>
1221 <Member Name="Scale">
1222 <Messages>
1223 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1224 <Issue>
1225 <Item>Scale</Item>
1226 </Issue>
1227 </Message>
1228 </Messages>
1229 </Member>
1230 <Member Name="Texture">
1231 <Messages>
1232 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1233 <Issue>
1234 <Item>Texture</Item>
1235 </Issue>
1236 </Message>
1237 </Messages>
1238 </Member>
1239 </Members>
1240 </Type>
1241 </Types>
1242 </Namespace>
1243 <Namespace Name="OpenSim.Framework.Grid">
1244 <Types>
1245 <Type Name="LoginService">
1246 <Messages>
1247 <Message Id="Login" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2007-03-27 04:29:04Z">
1248 <Issue Name="Type">
1249 <Item>Login</Item>
1250 <Item>LoginService</Item>
1251 <Item>LogOn</Item>
1252 </Issue>
1253 </Message>
1254 </Messages>
1255 </Type>
1256 </Types>
1257 </Namespace>
1258 <Namespace Name="OpenSim.Framework.Interfaces">
1259 <Types>
1260 <Type Name="AgentCircuitData">
1261 <Members>
1262 <Member Name="AgentID">
1263 <Messages>
1264 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1265 <Issue>
1266 <Item>AgentID</Item>
1267 </Issue>
1268 </Message>
1269 </Messages>
1270 </Member>
1271 <Member Name="circuitcode">
1272 <Messages>
1273 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1274 <Issue>
1275 <Item>circuitcode</Item>
1276 </Issue>
1277 </Message>
1278 <Message Id="circuitcode" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1279 <Issue Name="Member">
1280 <Item>circuitcode</Item>
1281 <Item>AgentCircuitData.circuitcode</Item>
1282 </Issue>
1283 </Message>
1284 </Messages>
1285 </Member>
1286 <Member Name="firstname">
1287 <Messages>
1288 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1289 <Issue>
1290 <Item>firstname</Item>
1291 </Issue>
1292 </Message>
1293 <Message Id="firstname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1294 <Issue Name="Member">
1295 <Item>firstname</Item>
1296 <Item>AgentCircuitData.firstname</Item>
1297 </Issue>
1298 </Message>
1299 </Messages>
1300 </Member>
1301 <Member Name="lastname">
1302 <Messages>
1303 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1304 <Issue>
1305 <Item>lastname</Item>
1306 </Issue>
1307 </Message>
1308 <Message Id="lastname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1309 <Issue Name="Member">
1310 <Item>lastname</Item>
1311 <Item>AgentCircuitData.lastname</Item>
1312 </Issue>
1313 </Message>
1314 </Messages>
1315 </Member>
1316 <Member Name="SecureSessionID">
1317 <Messages>
1318 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1319 <Issue>
1320 <Item>SecureSessionID</Item>
1321 </Issue>
1322 </Message>
1323 </Messages>
1324 </Member>
1325 <Member Name="SessionID">
1326 <Messages>
1327 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1328 <Issue>
1329 <Item>SessionID</Item>
1330 </Issue>
1331 </Message>
1332 </Messages>
1333 </Member>
1334 </Members>
1335 </Type>
1336 <Type Name="ARequest">
1337 <Messages>
1338 <Message TypeName="OverrideEqualsAndOperatorEqualsOnValueTypes" Category="Microsoft.Performance" CheckId="CA1815" Created="2007-03-27 04:29:04Z">
1339 <Issue Name="Equals">
1340 <Item>OpenSim.Framework.Interfaces.ARequest</Item>
1341 </Issue>
1342 <Issue Name="op_Equality">
1343 <Item>OpenSim.Framework.Interfaces.ARequest</Item>
1344 </Issue>
1345 </Message>
1346 </Messages>
1347 <Members>
1348 <Member Name="AssetID">
1349 <Messages>
1350 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1351 <Issue>
1352 <Item>AssetID</Item>
1353 </Issue>
1354 </Message>
1355 </Messages>
1356 </Member>
1357 <Member Name="IsTexture">
1358 <Messages>
1359 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1360 <Issue>
1361 <Item>IsTexture</Item>
1362 </Issue>
1363 </Message>
1364 </Messages>
1365 </Member>
1366 </Members>
1367 </Type>
1368 <Type Name="AuthenticateResponse">
1369 <Members>
1370 <Member Name="Authorised">
1371 <Messages>
1372 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1373 <Issue>
1374 <Item>Authorised</Item>
1375 </Issue>
1376 </Message>
1377 <Message Id="Authorised" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1378 <Issue Name="Member">
1379 <Item>Authorised</Item>
1380 <Item>AuthenticateResponse.Authorised</Item>
1381 </Issue>
1382 </Message>
1383 </Messages>
1384 </Member>
1385 <Member Name="LoginInfo">
1386 <Messages>
1387 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1388 <Issue>
1389 <Item>LoginInfo</Item>
1390 </Issue>
1391 </Message>
1392 <Message Id="Login" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2007-03-27 04:29:04Z">
1393 <Issue Name="Member">
1394 <Item>Login</Item>
1395 <Item>LoginInfo</Item>
1396 <Item>LogOn</Item>
1397 </Issue>
1398 </Message>
1399 </Messages>
1400 </Member>
1401 </Members>
1402 </Type>
1403 <Type Name="IAssetPlugin">
1404 <Messages>
1405 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1406 <Issue Name="Type">
1407 <Item>Plugin</Item>
1408 <Item>OpenSim.Framework.Interfaces.IAssetPlugin</Item>
1409 </Issue>
1410 </Message>
1411 </Messages>
1412 <Members>
1413 <Member Name="GetAssetServer():OpenSim.Framework.Interfaces.IAssetServer">
1414 <Messages>
1415 <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2007-03-27 04:29:04Z">
1416 <Issue Certainty="50">
1417 <Item>GetAssetServer</Item>
1418 </Issue>
1419 </Message>
1420 </Messages>
1421 </Member>
1422 </Members>
1423 </Type>
1424 <Type Name="IAssetReceiver">
1425 <Members>
1426 <Member Name="AssetReceived(OpenSim.Framework.Assets.AssetBase,System.Boolean):System.Void">
1427 <Messages>
1428 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
1429 <Issue Name="Parameter">
1430 <Item>IsTexture</Item>
1431 </Issue>
1432 </Message>
1433 </Messages>
1434 </Member>
1435 </Members>
1436 </Type>
1437 <Type Name="IAssetServer">
1438 <Members>
1439 <Member Name="RequestAsset(libsecondlife.LLUUID,System.Boolean):System.Void">
1440 <Messages>
1441 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
1442 <Issue Name="ParameterId">
1443 <Item>ID</Item>
1444 <Item>assetID</Item>
1445 <Item>Id</Item>
1446 </Issue>
1447 </Message>
1448 </Messages>
1449 </Member>
1450 <Member Name="SetServerInfo(System.String,System.String):System.Void">
1451 <Messages>
1452 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
1453 <Issue Name="Parameter">
1454 <Item>ServerUrl</Item>
1455 </Issue>
1456 </Message>
1457 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
1458 <Issue Name="Parameter">
1459 <Item>ServerKey</Item>
1460 </Issue>
1461 </Message>
1462 <Message Id="0#" TypeName="UriParametersShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1054" Created="2007-03-27 04:29:04Z">
1463 <Issue>
1464 <Item>ServerUrl</Item>
1465 <Item>IAssetServer.SetServerInfo(String, String):Void</Item>
1466 </Issue>
1467 </Message>
1468 </Messages>
1469 </Member>
1470 </Members>
1471 </Type>
1472 <Type Name="IGridPlugin">
1473 <Messages>
1474 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1475 <Issue Name="Type">
1476 <Item>Plugin</Item>
1477 <Item>OpenSim.Framework.Interfaces.IGridPlugin</Item>
1478 </Issue>
1479 </Message>
1480 </Messages>
1481 <Members>
1482 <Member Name="GetGridServer():OpenSim.Framework.Interfaces.IGridServer">
1483 <Messages>
1484 <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2007-03-27 04:29:04Z">
1485 <Issue Certainty="50">
1486 <Item>GetGridServer</Item>
1487 </Issue>
1488 </Message>
1489 </Messages>
1490 </Member>
1491 </Members>
1492 </Type>
1493 <Type Name="IGridServer">
1494 <Members>
1495 <Member Name="AuthenticateSession(libsecondlife.LLUUID,libsecondlife.LLUUID,System.UInt32):OpenSim.Framework.Interfaces.AuthenticateResponse">
1496 <Messages>
1497 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
1498 <Issue Name="ParameterId">
1499 <Item>ID</Item>
1500 <Item>sessionID</Item>
1501 <Item>Id</Item>
1502 </Issue>
1503 </Message>
1504 <Message Id="1#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
1505 <Issue Name="ParameterId">
1506 <Item>ID</Item>
1507 <Item>agentID</Item>
1508 <Item>Id</Item>
1509 </Issue>
1510 </Message>
1511 </Messages>
1512 </Member>
1513 <Member Name="GetName():System.String">
1514 <Messages>
1515 <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2007-03-27 04:29:04Z">
1516 <Issue Certainty="50">
1517 <Item>GetName</Item>
1518 </Issue>
1519 </Message>
1520 </Messages>
1521 </Member>
1522 <Member Name="LogoutSession(libsecondlife.LLUUID,libsecondlife.LLUUID,System.UInt32):System.Boolean">
1523 <Messages>
1524 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
1525 <Issue Name="ParameterId">
1526 <Item>ID</Item>
1527 <Item>sessionID</Item>
1528 <Item>Id</Item>
1529 </Issue>
1530 </Message>
1531 <Message Id="1#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
1532 <Issue Name="ParameterId">
1533 <Item>ID</Item>
1534 <Item>agentID</Item>
1535 <Item>Id</Item>
1536 </Issue>
1537 </Message>
1538 <Message Id="Logout" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2007-03-27 04:29:04Z">
1539 <Issue Name="Member">
1540 <Item>Logout</Item>
1541 <Item>LogoutSession</Item>
1542 <Item>LogOff</Item>
1543 </Issue>
1544 </Message>
1545 </Messages>
1546 </Member>
1547 <Member Name="RequestNeighbours():OpenSim.Framework.Interfaces.NeighbourInfo[]">
1548 <Messages>
1549 <Message Id="Neighbours" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1550 <Issue Name="Member">
1551 <Item>Neighbours</Item>
1552 <Item>IGridServer.RequestNeighbours():NeighbourInfo[]</Item>
1553 </Issue>
1554 </Message>
1555 </Messages>
1556 </Member>
1557 <Member Name="RequestUUIDBlock():OpenSim.Framework.Interfaces.UUIDBlock">
1558 <Messages>
1559 <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
1560 <Issue Name="Member">
1561 <Item>IGridServer.RequestUUIDBlock():UUIDBlock</Item>
1562 </Issue>
1563 </Message>
1564 </Messages>
1565 </Member>
1566 <Member Name="SetServerInfo(System.String,System.String,System.String):System.Void">
1567 <Messages>
1568 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
1569 <Issue Name="Parameter">
1570 <Item>ServerUrl</Item>
1571 </Issue>
1572 </Message>
1573 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
1574 <Issue Name="Parameter">
1575 <Item>SendKey</Item>
1576 </Issue>
1577 </Message>
1578 <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
1579 <Issue Name="Parameter">
1580 <Item>RecvKey</Item>
1581 </Issue>
1582 </Message>
1583 <Message Id="2#Recv" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1584 <Issue Name="Parameter">
1585 <Item>IGridServer.SetServerInfo(String, String, String):Void</Item>
1586 <Item>Recv</Item>
1587 <Item>RecvKey</Item>
1588 </Issue>
1589 </Message>
1590 <Message Id="0#" TypeName="UriParametersShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1054" Created="2007-03-27 04:29:04Z">
1591 <Issue>
1592 <Item>ServerUrl</Item>
1593 <Item>IGridServer.SetServerInfo(String, String, String):Void</Item>
1594 </Issue>
1595 </Message>
1596 </Messages>
1597 </Member>
1598 </Members>
1599 </Type>
1600 <Type Name="ILocalStorage">
1601 <Members>
1602 <Member Name="RemovePrim(libsecondlife.LLUUID):System.Void">
1603 <Messages>
1604 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
1605 <Issue Name="ParameterId">
1606 <Item>ID</Item>
1607 <Item>primID</Item>
1608 <Item>Id</Item>
1609 </Issue>
1610 </Message>
1611 </Messages>
1612 </Member>
1613 <Member Name="ShutDown():System.Void">
1614 <Messages>
1615 <Message Id="ShutDown" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2007-03-27 04:29:04Z">
1616 <Issue Name="ShouldBeDiscreteTerm">
1617 <Item>ShutDown</Item>
1618 <Item>method</Item>
1619 <Item>ShutDown</Item>
1620 <Item>Shutdown</Item>
1621 </Issue>
1622 </Message>
1623 </Messages>
1624 </Member>
1625 </Members>
1626 </Type>
1627 <Type Name="ISimConfig">
1628 <Messages>
1629 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1630 <Issue Name="Type">
1631 <Item>Sim</Item>
1632 <Item>OpenSim.Framework.Interfaces.ISimConfig</Item>
1633 </Issue>
1634 </Message>
1635 </Messages>
1636 <Members>
1637 <Member Name="GetConfigObject():OpenSim.Framework.Interfaces.SimConfig">
1638 <Messages>
1639 <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2007-03-27 04:29:04Z">
1640 <Issue Certainty="50">
1641 <Item>GetConfigObject</Item>
1642 </Issue>
1643 </Message>
1644 </Messages>
1645 </Member>
1646 </Members>
1647 </Type>
1648 <Type Name="IUserServer">
1649 <Members>
1650 <Member Name="RequestAgentsInventory(libsecondlife.LLUUID):OpenSim.Framework.Inventory.AgentInventory">
1651 <Messages>
1652 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
1653 <Issue Name="ParameterId">
1654 <Item>ID</Item>
1655 <Item>agentID</Item>
1656 <Item>Id</Item>
1657 </Issue>
1658 </Message>
1659 </Messages>
1660 </Member>
1661 <Member Name="SetServerInfo(System.String,System.String,System.String):System.Void">
1662 <Messages>
1663 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
1664 <Issue Name="Parameter">
1665 <Item>ServerUrl</Item>
1666 </Issue>
1667 </Message>
1668 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
1669 <Issue Name="Parameter">
1670 <Item>SendKey</Item>
1671 </Issue>
1672 </Message>
1673 <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
1674 <Issue Name="Parameter">
1675 <Item>RecvKey</Item>
1676 </Issue>
1677 </Message>
1678 <Message Id="2#Recv" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1679 <Issue Name="Parameter">
1680 <Item>IUserServer.SetServerInfo(String, String, String):Void</Item>
1681 <Item>Recv</Item>
1682 <Item>RecvKey</Item>
1683 </Issue>
1684 </Message>
1685 <Message Id="0#" TypeName="UriParametersShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1054" Created="2007-03-27 04:29:04Z">
1686 <Issue>
1687 <Item>ServerUrl</Item>
1688 <Item>IUserServer.SetServerInfo(String, String, String):Void</Item>
1689 </Issue>
1690 </Message>
1691 </Messages>
1692 </Member>
1693 </Members>
1694 </Type>
1695 <Type Name="LocalGridBase">
1696 <Members>
1697 <Member Name="LogoutSession(libsecondlife.LLUUID,libsecondlife.LLUUID,System.UInt32):System.Boolean">
1698 <Messages>
1699 <Message Id="Logout" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2007-03-27 04:29:04Z">
1700 <Issue Name="Member">
1701 <Item>Logout</Item>
1702 <Item>LogoutSession</Item>
1703 <Item>LogOff</Item>
1704 </Issue>
1705 </Message>
1706 </Messages>
1707 </Member>
1708 </Members>
1709 </Type>
1710 <Type Name="Login">
1711 <Messages>
1712 <Message Id="Login" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2007-03-27 04:29:04Z">
1713 <Issue Name="Type">
1714 <Item>Login</Item>
1715 <Item>Login</Item>
1716 <Item>LogOn</Item>
1717 </Issue>
1718 </Message>
1719 </Messages>
1720 <Members>
1721 <Member Name="Agent">
1722 <Messages>
1723 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1724 <Issue>
1725 <Item>Agent</Item>
1726 </Issue>
1727 </Message>
1728 </Messages>
1729 </Member>
1730 <Member Name="BaseFolder">
1731 <Messages>
1732 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1733 <Issue>
1734 <Item>BaseFolder</Item>
1735 </Issue>
1736 </Message>
1737 </Messages>
1738 </Member>
1739 <Member Name="First">
1740 <Messages>
1741 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1742 <Issue>
1743 <Item>First</Item>
1744 </Issue>
1745 </Message>
1746 </Messages>
1747 </Member>
1748 <Member Name="InventoryFolder">
1749 <Messages>
1750 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1751 <Issue>
1752 <Item>InventoryFolder</Item>
1753 </Issue>
1754 </Message>
1755 </Messages>
1756 </Member>
1757 <Member Name="Last">
1758 <Messages>
1759 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1760 <Issue>
1761 <Item>Last</Item>
1762 </Issue>
1763 </Message>
1764 </Messages>
1765 </Member>
1766 <Member Name="SecureSession">
1767 <Messages>
1768 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1769 <Issue>
1770 <Item>SecureSession</Item>
1771 </Issue>
1772 </Message>
1773 </Messages>
1774 </Member>
1775 <Member Name="Session">
1776 <Messages>
1777 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1778 <Issue>
1779 <Item>Session</Item>
1780 </Issue>
1781 </Message>
1782 </Messages>
1783 </Member>
1784 </Members>
1785 </Type>
1786 <Type Name="NeighbourInfo">
1787 <Messages>
1788 <Message Id="Neighbour" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1789 <Issue Name="Type">
1790 <Item>Neighbour</Item>
1791 <Item>OpenSim.Framework.Interfaces.NeighbourInfo</Item>
1792 </Issue>
1793 </Message>
1794 </Messages>
1795 <Members>
1796 <Member Name="regionhandle">
1797 <Messages>
1798 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1799 <Issue>
1800 <Item>regionhandle</Item>
1801 </Issue>
1802 </Message>
1803 <Message Id="regionhandle" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1804 <Issue Name="Member">
1805 <Item>regionhandle</Item>
1806 <Item>NeighbourInfo.regionhandle</Item>
1807 </Issue>
1808 </Message>
1809 </Messages>
1810 </Member>
1811 <Member Name="RegionLocX">
1812 <Messages>
1813 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1814 <Issue>
1815 <Item>RegionLocX</Item>
1816 </Issue>
1817 </Message>
1818 </Messages>
1819 </Member>
1820 <Member Name="RegionLocY">
1821 <Messages>
1822 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1823 <Issue>
1824 <Item>RegionLocY</Item>
1825 </Issue>
1826 </Message>
1827 </Messages>
1828 </Member>
1829 <Member Name="sim_ip">
1830 <Messages>
1831 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1832 <Issue>
1833 <Item>sim_ip</Item>
1834 </Issue>
1835 </Message>
1836 <Message Id="sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1837 <Issue Name="Member">
1838 <Item>sim</Item>
1839 <Item>NeighbourInfo.sim_ip</Item>
1840 </Issue>
1841 </Message>
1842 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
1843 <Issue Name="Member">
1844 <Item>sim_ip</Item>
1845 </Issue>
1846 </Message>
1847 </Messages>
1848 </Member>
1849 <Member Name="sim_port">
1850 <Messages>
1851 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1852 <Issue>
1853 <Item>sim_port</Item>
1854 </Issue>
1855 </Message>
1856 <Message Id="sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1857 <Issue Name="Member">
1858 <Item>sim</Item>
1859 <Item>NeighbourInfo.sim_port</Item>
1860 </Issue>
1861 </Message>
1862 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
1863 <Issue Name="Member">
1864 <Item>sim_port</Item>
1865 </Issue>
1866 </Message>
1867 </Messages>
1868 </Member>
1869 </Members>
1870 </Type>
1871 <Type Name="RemoteGridBase">
1872 <Members>
1873 <Member Name="agentcircuits">
1874 <Messages>
1875 <Message TypeName="CollectionPropertiesShouldBeReadOnly" Category="Microsoft.Usage" CheckId="CA2227" Created="2007-03-27 04:29:04Z">
1876 <Issue>
1877 <Item>agentcircuits</Item>
1878 </Issue>
1879 </Message>
1880 <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
1881 <Issue Name="Member">
1882 <Item>agentcircuits</Item>
1883 </Issue>
1884 </Message>
1885 <Message Id="agentcircuits" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1886 <Issue Name="Member">
1887 <Item>agentcircuits</Item>
1888 <Item>RemoteGridBase.agentcircuits:Dictionary`2&lt;System.UInt32,OpenSim.Framework.Interfaces.AgentCircuitData&gt;</Item>
1889 </Issue>
1890 </Message>
1891 </Messages>
1892 </Member>
1893 <Member Name="LogoutSession(libsecondlife.LLUUID,libsecondlife.LLUUID,System.UInt32):System.Boolean">
1894 <Messages>
1895 <Message Id="Logout" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2007-03-27 04:29:04Z">
1896 <Issue Name="Member">
1897 <Item>Logout</Item>
1898 <Item>LogoutSession</Item>
1899 <Item>LogOff</Item>
1900 </Issue>
1901 </Message>
1902 </Messages>
1903 </Member>
1904 </Members>
1905 </Type>
1906 <Type Name="SimConfig">
1907 <Messages>
1908 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1909 <Issue Name="Type">
1910 <Item>Sim</Item>
1911 <Item>OpenSim.Framework.Interfaces.SimConfig</Item>
1912 </Issue>
1913 </Message>
1914 </Messages>
1915 <Members>
1916 <Member Name="AssetSendKey">
1917 <Messages>
1918 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1919 <Issue>
1920 <Item>AssetSendKey</Item>
1921 </Issue>
1922 </Message>
1923 </Messages>
1924 </Member>
1925 <Member Name="AssetURL">
1926 <Messages>
1927 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1928 <Issue>
1929 <Item>AssetURL</Item>
1930 </Issue>
1931 </Message>
1932 </Messages>
1933 </Member>
1934 <Member Name="GridRecvKey">
1935 <Messages>
1936 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1937 <Issue>
1938 <Item>GridRecvKey</Item>
1939 </Issue>
1940 </Message>
1941 <Message Id="Recv" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1942 <Issue Name="Member">
1943 <Item>Recv</Item>
1944 <Item>SimConfig.GridRecvKey</Item>
1945 </Issue>
1946 </Message>
1947 </Messages>
1948 </Member>
1949 <Member Name="GridSendKey">
1950 <Messages>
1951 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1952 <Issue>
1953 <Item>GridSendKey</Item>
1954 </Issue>
1955 </Message>
1956 </Messages>
1957 </Member>
1958 <Member Name="GridURL">
1959 <Messages>
1960 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1961 <Issue>
1962 <Item>GridURL</Item>
1963 </Issue>
1964 </Message>
1965 </Messages>
1966 </Member>
1967 <Member Name="IPListenAddr">
1968 <Messages>
1969 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1970 <Issue>
1971 <Item>IPListenAddr</Item>
1972 </Issue>
1973 </Message>
1974 <Message Id="Addr" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
1975 <Issue Name="Member">
1976 <Item>Addr</Item>
1977 <Item>SimConfig.IPListenAddr</Item>
1978 </Issue>
1979 </Message>
1980 </Messages>
1981 </Member>
1982 <Member Name="IPListenPort">
1983 <Messages>
1984 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1985 <Issue>
1986 <Item>IPListenPort</Item>
1987 </Issue>
1988 </Message>
1989 </Messages>
1990 </Member>
1991 <Member Name="RegionHandle">
1992 <Messages>
1993 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
1994 <Issue>
1995 <Item>RegionHandle</Item>
1996 </Issue>
1997 </Message>
1998 </Messages>
1999 </Member>
2000 <Member Name="RegionLocX">
2001 <Messages>
2002 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2003 <Issue>
2004 <Item>RegionLocX</Item>
2005 </Issue>
2006 </Message>
2007 </Messages>
2008 </Member>
2009 <Member Name="RegionLocY">
2010 <Messages>
2011 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2012 <Issue>
2013 <Item>RegionLocY</Item>
2014 </Issue>
2015 </Message>
2016 </Messages>
2017 </Member>
2018 <Member Name="RegionName">
2019 <Messages>
2020 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2021 <Issue>
2022 <Item>RegionName</Item>
2023 </Issue>
2024 </Message>
2025 </Messages>
2026 </Member>
2027 <Member Name="SaveMap(System.Single[]):System.Void">
2028 <Messages>
2029 <Message Id="0#heightmap" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2030 <Issue Name="Parameter">
2031 <Item>SimConfig.SaveMap(Single[]):Void</Item>
2032 <Item>heightmap</Item>
2033 <Item>heightmap</Item>
2034 </Issue>
2035 </Message>
2036 </Messages>
2037 </Member>
2038 <Member Name="UserRecvKey">
2039 <Messages>
2040 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2041 <Issue>
2042 <Item>UserRecvKey</Item>
2043 </Issue>
2044 </Message>
2045 <Message Id="Recv" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2046 <Issue Name="Member">
2047 <Item>Recv</Item>
2048 <Item>SimConfig.UserRecvKey</Item>
2049 </Issue>
2050 </Message>
2051 </Messages>
2052 </Member>
2053 <Member Name="UserSendKey">
2054 <Messages>
2055 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2056 <Issue>
2057 <Item>UserSendKey</Item>
2058 </Issue>
2059 </Message>
2060 </Messages>
2061 </Member>
2062 <Member Name="UserURL">
2063 <Messages>
2064 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2065 <Issue>
2066 <Item>UserURL</Item>
2067 </Issue>
2068 </Message>
2069 </Messages>
2070 </Member>
2071 </Members>
2072 </Type>
2073 <Type Name="UUIDBlock">
2074 <Messages>
2075 <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
2076 <Issue Name="Type">
2077 <Item>UUIDBlock</Item>
2078 </Issue>
2079 </Message>
2080 <Message TypeName="OverrideEqualsAndOperatorEqualsOnValueTypes" Category="Microsoft.Performance" CheckId="CA1815" Created="2007-03-27 04:29:04Z">
2081 <Issue Name="Equals">
2082 <Item>OpenSim.Framework.Interfaces.UUIDBlock</Item>
2083 </Issue>
2084 <Issue Name="op_Equality">
2085 <Item>OpenSim.Framework.Interfaces.UUIDBlock</Item>
2086 </Issue>
2087 </Message>
2088 </Messages>
2089 <Members>
2090 <Member Name="BlockEnd">
2091 <Messages>
2092 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2093 <Issue>
2094 <Item>BlockEnd</Item>
2095 </Issue>
2096 </Message>
2097 </Messages>
2098 </Member>
2099 <Member Name="BlockStart">
2100 <Messages>
2101 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2102 <Issue>
2103 <Item>BlockStart</Item>
2104 </Issue>
2105 </Message>
2106 </Messages>
2107 </Member>
2108 </Members>
2109 </Type>
2110 </Types>
2111 </Namespace>
2112 <Namespace Name="OpenSim.Framework.Inventory">
2113 <Types>
2114 <Type Name="AgentInventory">
2115 <Members>
2116 <Member Name=".ctor()">
2117 <Messages>
2118 <Message TypeName="DoNotCallOverridableMethodsInConstructors" Category="Microsoft.Usage" CheckId="CA2214" Created="2007-03-27 04:29:04Z">
2119 <Issue>
2120 <Item>AgentInventory.AgentInventory()</Item>
2121 <Item>&#xD;&#xA;&#xD;&#xA;AgentInventory.AgentInventory()&#xD;&#xA;AgentInventory.Initialise():Void</Item>
2122 </Issue>
2123 </Message>
2124 </Messages>
2125 </Member>
2126 <Member Name="AddToInventory(libsecondlife.LLUUID,OpenSim.Framework.Assets.AssetBase):libsecondlife.LLUUID">
2127 <Messages>
2128 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
2129 <Issue Name="ParameterId">
2130 <Item>ID</Item>
2131 <Item>folderID</Item>
2132 <Item>Id</Item>
2133 </Issue>
2134 </Message>
2135 </Messages>
2136 </Member>
2137 <Member Name="AgentID">
2138 <Messages>
2139 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2140 <Issue>
2141 <Item>AgentID</Item>
2142 </Issue>
2143 </Message>
2144 </Messages>
2145 </Member>
2146 <Member Name="CreateNewFolder(libsecondlife.LLUUID,System.UInt16):System.Boolean">
2147 <Messages>
2148 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
2149 <Issue Name="ParameterId">
2150 <Item>ID</Item>
2151 <Item>folderID</Item>
2152 <Item>Id</Item>
2153 </Issue>
2154 </Message>
2155 </Messages>
2156 </Member>
2157 <Member Name="Initialise():System.Void">
2158 <Messages>
2159 <Message Id="Initialise" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2160 <Issue Name="Member">
2161 <Item>Initialise</Item>
2162 <Item>AgentInventory.Initialise():Void</Item>
2163 </Issue>
2164 </Message>
2165 </Messages>
2166 </Member>
2167 <Member Name="InventoryFolders">
2168 <Messages>
2169 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2170 <Issue>
2171 <Item>InventoryFolders</Item>
2172 </Issue>
2173 </Message>
2174 </Messages>
2175 </Member>
2176 <Member Name="InventoryItems">
2177 <Messages>
2178 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2179 <Issue>
2180 <Item>InventoryItems</Item>
2181 </Issue>
2182 </Message>
2183 </Messages>
2184 </Member>
2185 <Member Name="InventoryRoot">
2186 <Messages>
2187 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2188 <Issue>
2189 <Item>InventoryRoot</Item>
2190 </Issue>
2191 </Message>
2192 </Messages>
2193 </Member>
2194 <Member Name="LastCached">
2195 <Messages>
2196 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2197 <Issue>
2198 <Item>LastCached</Item>
2199 </Issue>
2200 </Message>
2201 </Messages>
2202 </Member>
2203 <Member Name="UpdateItem(libsecondlife.LLUUID,OpenSim.Framework.Assets.AssetBase):System.Boolean">
2204 <Messages>
2205 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
2206 <Issue Name="ParameterId">
2207 <Item>ID</Item>
2208 <Item>itemID</Item>
2209 <Item>Id</Item>
2210 </Issue>
2211 </Message>
2212 </Messages>
2213 </Member>
2214 <Member Name="Wearables">
2215 <Messages>
2216 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2217 <Issue>
2218 <Item>Wearables</Item>
2219 </Issue>
2220 </Message>
2221 <Message Id="Wearables" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2222 <Issue Name="Member">
2223 <Item>Wearables</Item>
2224 <Item>AgentInventory.Wearables</Item>
2225 </Issue>
2226 </Message>
2227 </Messages>
2228 </Member>
2229 </Members>
2230 </Type>
2231 <Type Name="AvatarWearable">
2232 <Members>
2233 <Member Name="AssetID">
2234 <Messages>
2235 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2236 <Issue>
2237 <Item>AssetID</Item>
2238 </Issue>
2239 </Message>
2240 </Messages>
2241 </Member>
2242 <Member Name="ItemID">
2243 <Messages>
2244 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2245 <Issue>
2246 <Item>ItemID</Item>
2247 </Issue>
2248 </Message>
2249 </Messages>
2250 </Member>
2251 </Members>
2252 </Type>
2253 <Type Name="InventoryFolder">
2254 <Members>
2255 <Member Name="DefaultType">
2256 <Messages>
2257 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2258 <Issue>
2259 <Item>DefaultType</Item>
2260 </Issue>
2261 </Message>
2262 </Messages>
2263 </Member>
2264 <Member Name="FolderID">
2265 <Messages>
2266 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2267 <Issue>
2268 <Item>FolderID</Item>
2269 </Issue>
2270 </Message>
2271 </Messages>
2272 </Member>
2273 <Member Name="FolderName">
2274 <Messages>
2275 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2276 <Issue>
2277 <Item>FolderName</Item>
2278 </Issue>
2279 </Message>
2280 </Messages>
2281 </Member>
2282 <Member Name="Items">
2283 <Messages>
2284 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2285 <Issue>
2286 <Item>Items</Item>
2287 </Issue>
2288 </Message>
2289 <Message TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002" Created="2007-03-27 04:29:04Z">
2290 <Issue>
2291 <Item>System.Collections.Generic.List`1&lt;OpenSim.Framework.Inventory.InventoryItem&gt;</Item>
2292 <Item>InventoryFolder.Items</Item>
2293 </Issue>
2294 </Message>
2295 </Messages>
2296 </Member>
2297 <Member Name="OwnerID">
2298 <Messages>
2299 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2300 <Issue>
2301 <Item>OwnerID</Item>
2302 </Issue>
2303 </Message>
2304 </Messages>
2305 </Member>
2306 <Member Name="ParentID">
2307 <Messages>
2308 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2309 <Issue>
2310 <Item>ParentID</Item>
2311 </Issue>
2312 </Message>
2313 </Messages>
2314 </Member>
2315 <Member Name="Version">
2316 <Messages>
2317 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2318 <Issue>
2319 <Item>Version</Item>
2320 </Issue>
2321 </Message>
2322 </Messages>
2323 </Member>
2324 </Members>
2325 </Type>
2326 <Type Name="InventoryItem">
2327 <Members>
2328 <Member Name="AssetID">
2329 <Messages>
2330 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2331 <Issue>
2332 <Item>AssetID</Item>
2333 </Issue>
2334 </Message>
2335 </Messages>
2336 </Member>
2337 <Member Name="CreatorID">
2338 <Messages>
2339 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2340 <Issue>
2341 <Item>CreatorID</Item>
2342 </Issue>
2343 </Message>
2344 </Messages>
2345 </Member>
2346 <Member Name="Description">
2347 <Messages>
2348 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2349 <Issue>
2350 <Item>Description</Item>
2351 </Issue>
2352 </Message>
2353 </Messages>
2354 </Member>
2355 <Member Name="FolderID">
2356 <Messages>
2357 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2358 <Issue>
2359 <Item>FolderID</Item>
2360 </Issue>
2361 </Message>
2362 </Messages>
2363 </Member>
2364 <Member Name="InvType">
2365 <Messages>
2366 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2367 <Issue>
2368 <Item>InvType</Item>
2369 </Issue>
2370 </Message>
2371 </Messages>
2372 </Member>
2373 <Member Name="ItemID">
2374 <Messages>
2375 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2376 <Issue>
2377 <Item>ItemID</Item>
2378 </Issue>
2379 </Message>
2380 </Messages>
2381 </Member>
2382 <Member Name="Name">
2383 <Messages>
2384 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2385 <Issue>
2386 <Item>Name</Item>
2387 </Issue>
2388 </Message>
2389 </Messages>
2390 </Member>
2391 <Member Name="OwnerID">
2392 <Messages>
2393 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2394 <Issue>
2395 <Item>OwnerID</Item>
2396 </Issue>
2397 </Message>
2398 </Messages>
2399 </Member>
2400 <Member Name="Type">
2401 <Messages>
2402 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2403 <Issue>
2404 <Item>Type</Item>
2405 </Issue>
2406 </Message>
2407 </Messages>
2408 </Member>
2409 </Members>
2410 </Type>
2411 </Types>
2412 </Namespace>
2413 <Namespace Name="OpenSim.Framework.Sims">
2414 <Types>
2415 <Type Name="SimProfile">
2416 <Messages>
2417 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2418 <Issue Name="Type">
2419 <Item>Sim</Item>
2420 <Item>OpenSim.Framework.Sims.SimProfile</Item>
2421 </Issue>
2422 </Message>
2423 </Messages>
2424 <Members>
2425 <Member Name="LoadFromGrid(System.UInt64,System.String,System.String,System.String):OpenSim.Framework.Sims.SimProfile">
2426 <Messages>
2427 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
2428 <Issue>
2429 <Item>SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile</Item>
2430 <Item>System.Exception</Item>
2431 </Issue>
2432 </Message>
2433 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
2434 <Issue Name="Parameter">
2435 <Item>GridURL</Item>
2436 </Issue>
2437 </Message>
2438 <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
2439 <Issue Name="Parameter">
2440 <Item>SendKey</Item>
2441 </Issue>
2442 </Message>
2443 <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
2444 <Issue Name="Parameter">
2445 <Item>RecvKey</Item>
2446 </Issue>
2447 </Message>
2448 <Message Id="3#Recv" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2449 <Issue Name="Parameter">
2450 <Item>SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile</Item>
2451 <Item>Recv</Item>
2452 <Item>RecvKey</Item>
2453 </Issue>
2454 </Message>
2455 <Message Id="0#" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
2456 <Issue Name="Parameter">
2457 <Item>region_handle</Item>
2458 </Issue>
2459 </Message>
2460 <Message Id="1#" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
2461 <Issue Name="Parameter">
2462 <Item>GridURL</Item>
2463 </Issue>
2464 </Message>
2465 <Message Id="RecvKey" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
2466 <Issue>
2467 <Item>RecvKey</Item>
2468 <Item>SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile</Item>
2469 </Issue>
2470 </Message>
2471 <Message Id="System.Convert.ToUInt16(System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
2472 <Issue>
2473 <Item>SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile</Item>
2474 <Item>System.Convert.ToUInt16(System.Object)</Item>
2475 <Item>System.Convert.ToUInt16(System.Object,System.IFormatProvider)</Item>
2476 </Issue>
2477 </Message>
2478 <Message Id="System.Convert.ToUInt32(System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
2479 <Issue>
2480 <Item>SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile</Item>
2481 <Item>System.Convert.ToUInt32(System.Object)</Item>
2482 <Item>System.Convert.ToUInt32(System.Object,System.IFormatProvider)</Item>
2483 </Issue>
2484 <Issue>
2485 <Item>SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile</Item>
2486 <Item>System.Convert.ToUInt32(System.Object)</Item>
2487 <Item>System.Convert.ToUInt32(System.Object,System.IFormatProvider)</Item>
2488 </Issue>
2489 </Message>
2490 <Message Id="System.Convert.ToUInt64(System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
2491 <Issue>
2492 <Item>SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile</Item>
2493 <Item>System.Convert.ToUInt64(System.Object)</Item>
2494 <Item>System.Convert.ToUInt64(System.Object,System.IFormatProvider)</Item>
2495 </Issue>
2496 </Message>
2497 <Message Id="System.UInt64.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
2498 <Issue>
2499 <Item>SimProfile.LoadFromGrid(UInt64, String, String, String):SimProfile</Item>
2500 <Item>System.UInt64.ToString</Item>
2501 <Item>System.UInt64.ToString(System.IFormatProvider)</Item>
2502 </Issue>
2503 </Message>
2504 </Messages>
2505 </Member>
2506 </Members>
2507 </Type>
2508 <Type Name="SimProfileBase">
2509 <Messages>
2510 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2511 <Issue Name="Type">
2512 <Item>Sim</Item>
2513 <Item>OpenSim.Framework.Sims.SimProfileBase</Item>
2514 </Issue>
2515 </Message>
2516 </Messages>
2517 <Members>
2518 <Member Name="caps_url">
2519 <Messages>
2520 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2521 <Issue>
2522 <Item>caps_url</Item>
2523 </Issue>
2524 </Message>
2525 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
2526 <Issue Name="Member">
2527 <Item>caps_url</Item>
2528 </Issue>
2529 </Message>
2530 </Messages>
2531 </Member>
2532 <Member Name="recvkey">
2533 <Messages>
2534 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2535 <Issue>
2536 <Item>recvkey</Item>
2537 </Issue>
2538 </Message>
2539 <Message Id="recvkey" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2540 <Issue Name="Member">
2541 <Item>recvkey</Item>
2542 <Item>SimProfileBase.recvkey</Item>
2543 </Issue>
2544 </Message>
2545 </Messages>
2546 </Member>
2547 <Member Name="regionhandle">
2548 <Messages>
2549 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2550 <Issue>
2551 <Item>regionhandle</Item>
2552 </Issue>
2553 </Message>
2554 <Message Id="regionhandle" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2555 <Issue Name="Member">
2556 <Item>regionhandle</Item>
2557 <Item>SimProfileBase.regionhandle</Item>
2558 </Issue>
2559 </Message>
2560 </Messages>
2561 </Member>
2562 <Member Name="RegionLocX">
2563 <Messages>
2564 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2565 <Issue>
2566 <Item>RegionLocX</Item>
2567 </Issue>
2568 </Message>
2569 </Messages>
2570 </Member>
2571 <Member Name="RegionLocY">
2572 <Messages>
2573 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2574 <Issue>
2575 <Item>RegionLocY</Item>
2576 </Issue>
2577 </Message>
2578 </Messages>
2579 </Member>
2580 <Member Name="regionname">
2581 <Messages>
2582 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2583 <Issue>
2584 <Item>regionname</Item>
2585 </Issue>
2586 </Message>
2587 <Message Id="regionname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2588 <Issue Name="Member">
2589 <Item>regionname</Item>
2590 <Item>SimProfileBase.regionname</Item>
2591 </Issue>
2592 </Message>
2593 </Messages>
2594 </Member>
2595 <Member Name="sendkey">
2596 <Messages>
2597 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2598 <Issue>
2599 <Item>sendkey</Item>
2600 </Issue>
2601 </Message>
2602 <Message Id="sendkey" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2603 <Issue Name="Member">
2604 <Item>sendkey</Item>
2605 <Item>SimProfileBase.sendkey</Item>
2606 </Issue>
2607 </Message>
2608 </Messages>
2609 </Member>
2610 <Member Name="sim_ip">
2611 <Messages>
2612 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2613 <Issue>
2614 <Item>sim_ip</Item>
2615 </Issue>
2616 </Message>
2617 <Message Id="sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2618 <Issue Name="Member">
2619 <Item>sim</Item>
2620 <Item>SimProfileBase.sim_ip</Item>
2621 </Issue>
2622 </Message>
2623 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
2624 <Issue Name="Member">
2625 <Item>sim_ip</Item>
2626 </Issue>
2627 </Message>
2628 </Messages>
2629 </Member>
2630 <Member Name="sim_port">
2631 <Messages>
2632 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2633 <Issue>
2634 <Item>sim_port</Item>
2635 </Issue>
2636 </Message>
2637 <Message Id="sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2638 <Issue Name="Member">
2639 <Item>sim</Item>
2640 <Item>SimProfileBase.sim_port</Item>
2641 </Issue>
2642 </Message>
2643 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
2644 <Issue Name="Member">
2645 <Item>sim_port</Item>
2646 </Issue>
2647 </Message>
2648 </Messages>
2649 </Member>
2650 <Member Name="UUID">
2651 <Messages>
2652 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2653 <Issue>
2654 <Item>UUID</Item>
2655 </Issue>
2656 </Message>
2657 </Messages>
2658 </Member>
2659 </Members>
2660 </Type>
2661 </Types>
2662 </Namespace>
2663 <Namespace Name="OpenSim.Framework.Terrain">
2664 <Types>
2665 <Type Name="HeightmapGenHills">
2666 <Messages>
2667 <Message Id="Heightmap" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2668 <Issue Name="Type">
2669 <Item>Heightmap</Item>
2670 <Item>OpenSim.Framework.Terrain.HeightmapGenHills</Item>
2671 </Issue>
2672 </Message>
2673 </Messages>
2674 <Members>
2675 <Member Name="GenerateHeightmap(System.Int32,System.Single,System.Single,System.Boolean):System.Single[]">
2676 <Messages>
2677 <Message Id="0#num" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2678 <Issue Name="Parameter">
2679 <Item>HeightmapGenHills.GenerateHeightmap(Int32, Single, Single, Boolean):Single[]</Item>
2680 <Item>num</Item>
2681 <Item>numHills</Item>
2682 </Issue>
2683 </Message>
2684 <Message Id="Heightmap" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2685 <Issue Name="Member">
2686 <Item>Heightmap</Item>
2687 <Item>HeightmapGenHills.GenerateHeightmap(Int32, Single, Single, Boolean):Single[]</Item>
2688 </Issue>
2689 </Message>
2690 </Messages>
2691 </Member>
2692 <Member Name="NumHills">
2693 <Messages>
2694 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
2695 <Issue>
2696 <Item>HeightmapGenHills.NumHills</Item>
2697 </Issue>
2698 </Message>
2699 </Messages>
2700 </Member>
2701 </Members>
2702 </Type>
2703 </Types>
2704 </Namespace>
2705 <Namespace Name="OpenSim.Framework.User">
2706 <Types>
2707 <Type Name="UserProfile">
2708 <Members>
2709 <Member Name=".ctor()">
2710 <Messages>
2711 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
2712 <Issue>
2713 <Item>UserProfile.UserProfile()</Item>
2714 <Item>IsGridGod</Item>
2715 <Item>System.Boolean</Item>
2716 <Item>false</Item>
2717 </Issue>
2718 </Message>
2719 </Messages>
2720 </Member>
2721 <Member Name="AddSimCircuit(System.UInt32,libsecondlife.LLUUID):System.Void">
2722 <Messages>
2723 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2724 <Issue Name="Member">
2725 <Item>Sim</Item>
2726 <Item>UserProfile.AddSimCircuit(UInt32, LLUUID):Void</Item>
2727 </Issue>
2728 </Message>
2729 <Message Id="1#" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
2730 <Issue Name="Parameter">
2731 <Item>regionUUID</Item>
2732 </Issue>
2733 </Message>
2734 </Messages>
2735 </Member>
2736 <Member Name="AssetURL">
2737 <Messages>
2738 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2739 <Issue>
2740 <Item>AssetURL</Item>
2741 </Issue>
2742 </Message>
2743 </Messages>
2744 </Member>
2745 <Member Name="Circuits">
2746 <Messages>
2747 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2748 <Issue>
2749 <Item>Circuits</Item>
2750 </Issue>
2751 </Message>
2752 </Messages>
2753 </Member>
2754 <Member Name="CurrentSecureSessionID">
2755 <Messages>
2756 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2757 <Issue>
2758 <Item>CurrentSecureSessionID</Item>
2759 </Issue>
2760 </Message>
2761 </Messages>
2762 </Member>
2763 <Member Name="CurrentSessionID">
2764 <Messages>
2765 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2766 <Issue>
2767 <Item>CurrentSessionID</Item>
2768 </Issue>
2769 </Message>
2770 </Messages>
2771 </Member>
2772 <Member Name="firstname">
2773 <Messages>
2774 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2775 <Issue>
2776 <Item>firstname</Item>
2777 </Issue>
2778 </Message>
2779 <Message Id="firstname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2780 <Issue Name="Member">
2781 <Item>firstname</Item>
2782 <Item>UserProfile.firstname</Item>
2783 </Issue>
2784 </Message>
2785 </Messages>
2786 </Member>
2787 <Member Name="homelookat">
2788 <Messages>
2789 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2790 <Issue>
2791 <Item>homelookat</Item>
2792 </Issue>
2793 </Message>
2794 <Message Id="homelookat" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2795 <Issue Name="Member">
2796 <Item>homelookat</Item>
2797 <Item>UserProfile.homelookat</Item>
2798 </Issue>
2799 </Message>
2800 </Messages>
2801 </Member>
2802 <Member Name="homepos">
2803 <Messages>
2804 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2805 <Issue>
2806 <Item>homepos</Item>
2807 </Issue>
2808 </Message>
2809 <Message Id="homepos" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2810 <Issue Name="Member">
2811 <Item>homepos</Item>
2812 <Item>UserProfile.homepos</Item>
2813 </Issue>
2814 </Message>
2815 </Messages>
2816 </Member>
2817 <Member Name="homeregionhandle">
2818 <Messages>
2819 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2820 <Issue>
2821 <Item>homeregionhandle</Item>
2822 </Issue>
2823 </Message>
2824 <Message Id="homeregionhandle" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2825 <Issue Name="Member">
2826 <Item>homeregionhandle</Item>
2827 <Item>UserProfile.homeregionhandle</Item>
2828 </Issue>
2829 </Message>
2830 </Messages>
2831 </Member>
2832 <Member Name="Inventory">
2833 <Messages>
2834 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2835 <Issue>
2836 <Item>Inventory</Item>
2837 </Issue>
2838 </Message>
2839 </Messages>
2840 </Member>
2841 <Member Name="IsGridGod">
2842 <Messages>
2843 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2844 <Issue>
2845 <Item>IsGridGod</Item>
2846 </Issue>
2847 </Message>
2848 </Messages>
2849 </Member>
2850 <Member Name="IsLocal">
2851 <Messages>
2852 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2853 <Issue>
2854 <Item>IsLocal</Item>
2855 </Issue>
2856 </Message>
2857 </Messages>
2858 </Member>
2859 <Member Name="lastname">
2860 <Messages>
2861 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2862 <Issue>
2863 <Item>lastname</Item>
2864 </Issue>
2865 </Message>
2866 <Message Id="lastname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2867 <Issue Name="Member">
2868 <Item>lastname</Item>
2869 <Item>UserProfile.lastname</Item>
2870 </Issue>
2871 </Message>
2872 </Messages>
2873 </Member>
2874 <Member Name="MD5passwd">
2875 <Messages>
2876 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2877 <Issue>
2878 <Item>MD5passwd</Item>
2879 </Issue>
2880 </Message>
2881 </Messages>
2882 </Member>
2883 <Member Name="UUID">
2884 <Messages>
2885 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2886 <Issue>
2887 <Item>UUID</Item>
2888 </Issue>
2889 </Message>
2890 </Messages>
2891 </Member>
2892 </Members>
2893 </Type>
2894 <Type Name="UserProfileManager">
2895 <Members>
2896 <Member Name="CustomiseResponse(System.Collections.Hashtable&amp;,OpenSim.Framework.User.UserProfile):System.Void">
2897 <Messages>
2898 <Message Id="0#" TypeName="DoNotPassTypesByReference" Category="Microsoft.Design" CheckId="CA1045" Created="2007-03-27 04:29:04Z">
2899 <Issue Level="CriticalWarning">
2900 <Item>response</Item>
2901 </Issue>
2902 </Message>
2903 <Message Id="Customise" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2904 <Issue Name="Member">
2905 <Item>Customise</Item>
2906 <Item>UserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
2907 </Issue>
2908 </Message>
2909 <Message Id="GridResp" TypeName="RemoveUnusedLocals" Category="Microsoft.Performance" CheckId="CA1804" Created="2007-03-27 04:29:04Z">
2910 <Issue>
2911 <Item>UserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
2912 <Item>GridResp</Item>
2913 <Item>Nwc.XmlRpc.XmlRpcResponse</Item>
2914 </Issue>
2915 </Message>
2916 <Message Id="System.Single.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
2917 <Issue>
2918 <Item>UserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
2919 <Item>System.Single.ToString</Item>
2920 <Item>System.Single.ToString(System.IFormatProvider)</Item>
2921 </Issue>
2922 <Issue>
2923 <Item>UserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
2924 <Item>System.Single.ToString</Item>
2925 <Item>System.Single.ToString(System.IFormatProvider)</Item>
2926 </Issue>
2927 <Issue>
2928 <Item>UserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
2929 <Item>System.Single.ToString</Item>
2930 <Item>System.Single.ToString(System.IFormatProvider)</Item>
2931 </Issue>
2932 <Issue>
2933 <Item>UserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
2934 <Item>System.Single.ToString</Item>
2935 <Item>System.Single.ToString(System.IFormatProvider)</Item>
2936 </Issue>
2937 <Issue>
2938 <Item>UserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
2939 <Item>System.Single.ToString</Item>
2940 <Item>System.Single.ToString(System.IFormatProvider)</Item>
2941 </Issue>
2942 <Issue>
2943 <Item>UserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
2944 <Item>System.Single.ToString</Item>
2945 <Item>System.Single.ToString(System.IFormatProvider)</Item>
2946 </Issue>
2947 </Message>
2948 <Message Id="System.UInt32.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
2949 <Issue>
2950 <Item>UserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
2951 <Item>System.UInt32.ToString</Item>
2952 <Item>System.UInt32.ToString(System.IFormatProvider)</Item>
2953 </Issue>
2954 <Issue>
2955 <Item>UserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
2956 <Item>System.UInt32.ToString</Item>
2957 <Item>System.UInt32.ToString(System.IFormatProvider)</Item>
2958 </Issue>
2959 </Message>
2960 </Messages>
2961 </Member>
2962 <Member Name="DefaultStartupMsg">
2963 <Messages>
2964 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2965 <Issue>
2966 <Item>DefaultStartupMsg</Item>
2967 </Issue>
2968 </Message>
2969 </Messages>
2970 </Member>
2971 <Member Name="GridRecvKey">
2972 <Messages>
2973 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2974 <Issue>
2975 <Item>GridRecvKey</Item>
2976 </Issue>
2977 </Message>
2978 <Message Id="Recv" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
2979 <Issue Name="Member">
2980 <Item>Recv</Item>
2981 <Item>UserProfileManager.GridRecvKey</Item>
2982 </Issue>
2983 </Message>
2984 </Messages>
2985 </Member>
2986 <Member Name="GridSendKey">
2987 <Messages>
2988 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2989 <Issue>
2990 <Item>GridSendKey</Item>
2991 </Issue>
2992 </Message>
2993 </Messages>
2994 </Member>
2995 <Member Name="GridURL">
2996 <Messages>
2997 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
2998 <Issue>
2999 <Item>GridURL</Item>
3000 </Issue>
3001 </Message>
3002 </Messages>
3003 </Member>
3004 <Member Name="ParseXMLRPC(System.String):System.String">
3005 <Messages>
3006 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
3007 <Issue>
3008 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3009 <Item>System.Exception</Item>
3010 </Issue>
3011 </Message>
3012 <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
3013 <Issue Name="Member">
3014 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3015 </Issue>
3016 </Message>
3017 <Message Id="System.Int32.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
3018 <Issue>
3019 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3020 <Item>System.Int32.ToString</Item>
3021 <Item>System.Int32.ToString(System.IFormatProvider)</Item>
3022 </Issue>
3023 <Issue>
3024 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3025 <Item>System.Int32.ToString</Item>
3026 <Item>System.Int32.ToString(System.IFormatProvider)</Item>
3027 </Issue>
3028 </Message>
3029 <Message Id="System.Single.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
3030 <Issue>
3031 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3032 <Item>System.Single.ToString</Item>
3033 <Item>System.Single.ToString(System.IFormatProvider)</Item>
3034 </Issue>
3035 <Issue>
3036 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3037 <Item>System.Single.ToString</Item>
3038 <Item>System.Single.ToString(System.IFormatProvider)</Item>
3039 </Issue>
3040 <Issue>
3041 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3042 <Item>System.Single.ToString</Item>
3043 <Item>System.Single.ToString(System.IFormatProvider)</Item>
3044 </Issue>
3045 <Issue>
3046 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3047 <Item>System.Single.ToString</Item>
3048 <Item>System.Single.ToString(System.IFormatProvider)</Item>
3049 </Issue>
3050 <Issue>
3051 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3052 <Item>System.Single.ToString</Item>
3053 <Item>System.Single.ToString(System.IFormatProvider)</Item>
3054 </Issue>
3055 <Issue>
3056 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3057 <Item>System.Single.ToString</Item>
3058 <Item>System.Single.ToString(System.IFormatProvider)</Item>
3059 </Issue>
3060 <Issue>
3061 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3062 <Item>System.Single.ToString</Item>
3063 <Item>System.Single.ToString(System.IFormatProvider)</Item>
3064 </Issue>
3065 <Issue>
3066 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3067 <Item>System.Single.ToString</Item>
3068 <Item>System.Single.ToString(System.IFormatProvider)</Item>
3069 </Issue>
3070 <Issue>
3071 <Item>UserProfileManager.ParseXMLRPC(String):String</Item>
3072 <Item>System.Single.ToString</Item>
3073 <Item>System.Single.ToString(System.IFormatProvider)</Item>
3074 </Issue>
3075 </Message>
3076 </Messages>
3077 </Member>
3078 <Member Name="SetKeys(System.String,System.String,System.String,System.String):System.Void">
3079 <Messages>
3080 <Message Id="1#recv" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3081 <Issue Name="Parameter">
3082 <Item>UserProfileManager.SetKeys(String, String, String, String):Void</Item>
3083 <Item>recv</Item>
3084 <Item>recvKey</Item>
3085 </Issue>
3086 </Message>
3087 <Message Id="2#" TypeName="UriParametersShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1054" Created="2007-03-27 04:29:04Z">
3088 <Issue>
3089 <Item>url</Item>
3090 <Item>UserProfileManager.SetKeys(String, String, String, String):Void</Item>
3091 </Issue>
3092 </Message>
3093 </Messages>
3094 </Member>
3095 </Members>
3096 </Type>
3097 <Type Name="UserProfileManagerBase">
3098 <Members>
3099 <Member Name="AuthenticateUser(System.String,System.String,System.String):System.Boolean">
3100 <Messages>
3101 <Message Id="0#firstname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3102 <Issue Name="Parameter">
3103 <Item>UserProfileManagerBase.AuthenticateUser(String, String, String):Boolean</Item>
3104 <Item>firstname</Item>
3105 <Item>firstname</Item>
3106 </Issue>
3107 </Message>
3108 <Message Id="1#lastname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3109 <Issue Name="Parameter">
3110 <Item>UserProfileManagerBase.AuthenticateUser(String, String, String):Boolean</Item>
3111 <Item>lastname</Item>
3112 <Item>lastname</Item>
3113 </Issue>
3114 </Message>
3115 <Message Id="2#passwd" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3116 <Issue Name="Parameter">
3117 <Item>UserProfileManagerBase.AuthenticateUser(String, String, String):Boolean</Item>
3118 <Item>passwd</Item>
3119 <Item>passwd</Item>
3120 </Issue>
3121 </Message>
3122 </Messages>
3123 </Member>
3124 <Member Name="CreateNewProfile(System.String,System.String,System.String):OpenSim.Framework.User.UserProfile">
3125 <Messages>
3126 <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
3127 <Issue Name="Parameter">
3128 <Item>MD5passwd</Item>
3129 </Issue>
3130 </Message>
3131 <Message Id="0#firstname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3132 <Issue Name="Parameter">
3133 <Item>UserProfileManagerBase.CreateNewProfile(String, String, String):UserProfile</Item>
3134 <Item>firstname</Item>
3135 <Item>firstname</Item>
3136 </Issue>
3137 </Message>
3138 <Message Id="1#lastname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3139 <Issue Name="Parameter">
3140 <Item>UserProfileManagerBase.CreateNewProfile(String, String, String):UserProfile</Item>
3141 <Item>lastname</Item>
3142 <Item>lastname</Item>
3143 </Issue>
3144 </Message>
3145 <Message Id="2#M" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3146 <Issue Name="Parameter">
3147 <Item>UserProfileManagerBase.CreateNewProfile(String, String, String):UserProfile</Item>
3148 <Item>M</Item>
3149 <Item>MD5passwd</Item>
3150 </Issue>
3151 </Message>
3152 </Messages>
3153 </Member>
3154 <Member Name="GetProfileByLLUUID(libsecondlife.LLUUID):OpenSim.Framework.User.UserProfile">
3155 <Messages>
3156 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
3157 <Issue Name="Parameter">
3158 <Item>ProfileLLUUID</Item>
3159 </Issue>
3160 </Message>
3161 <Message Id="0#" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
3162 <Issue Name="Parameter">
3163 <Item>ProfileLLUUID</Item>
3164 </Issue>
3165 </Message>
3166 <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
3167 <Issue Name="Member">
3168 <Item>UserProfileManagerBase.GetProfileByLLUUID(LLUUID):UserProfile</Item>
3169 </Issue>
3170 </Message>
3171 </Messages>
3172 </Member>
3173 <Member Name="GetProfileByName(System.String,System.String):OpenSim.Framework.User.UserProfile">
3174 <Messages>
3175 <Message Id="0#firstname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3176 <Issue Name="Parameter">
3177 <Item>UserProfileManagerBase.GetProfileByName(String, String):UserProfile</Item>
3178 <Item>firstname</Item>
3179 <Item>firstname</Item>
3180 </Issue>
3181 </Message>
3182 <Message Id="1#lastname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3183 <Issue Name="Parameter">
3184 <Item>UserProfileManagerBase.GetProfileByName(String, String):UserProfile</Item>
3185 <Item>lastname</Item>
3186 <Item>lastname</Item>
3187 </Issue>
3188 </Message>
3189 </Messages>
3190 </Member>
3191 <Member Name="GetUsersInventory(libsecondlife.LLUUID):OpenSim.Framework.Inventory.AgentInventory">
3192 <Messages>
3193 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
3194 <Issue Name="ParameterId">
3195 <Item>ID</Item>
3196 <Item>agentID</Item>
3197 <Item>Id</Item>
3198 </Issue>
3199 </Message>
3200 </Messages>
3201 </Member>
3202 <Member Name="SetGod(libsecondlife.LLUUID):System.Void">
3203 <Messages>
3204 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
3205 <Issue Name="Parameter">
3206 <Item>GodID</Item>
3207 </Issue>
3208 </Message>
3209 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
3210 <Issue Name="ParameterId">
3211 <Item>ID</Item>
3212 <Item>GodID</Item>
3213 <Item>Id</Item>
3214 </Issue>
3215 </Message>
3216 </Messages>
3217 </Member>
3218 <Member Name="UserProfiles">
3219 <Messages>
3220 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3221 <Issue>
3222 <Item>UserProfiles</Item>
3223 </Issue>
3224 </Message>
3225 </Messages>
3226 </Member>
3227 </Members>
3228 </Type>
3229 </Types>
3230 </Namespace>
3231 <Namespace Name="OpenSim.Framework.Utilities">
3232 <Types>
3233 <Type Name="BlockingQueue`1">
3234 <Messages>
3235 <Message TypeName="IdentifiersShouldNotHaveIncorrectSuffix" Category="Microsoft.Naming" CheckId="CA1711" Created="2007-03-27 04:29:04Z">
3236 <Issue>
3237 <Item>OpenSim.Framework.Utilities.BlockingQueue`1</Item>
3238 <Item>Queue</Item>
3239 </Issue>
3240 </Message>
3241 </Messages>
3242 </Type>
3243 <Type Name="Util">
3244 <Messages>
3245 <Message Id="Util" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3246 <Issue Name="Type">
3247 <Item>Util</Item>
3248 <Item>OpenSim.Framework.Utilities.Util</Item>
3249 </Issue>
3250 </Message>
3251 <Message TypeName="StaticHolderTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1053" Created="2007-03-27 04:29:04Z">
3252 <Issue>
3253 <Item>Util</Item>
3254 </Issue>
3255 </Message>
3256 <Message TypeName="TypeNamesShouldNotMatchNamespaces" Category="Microsoft.Naming" CheckId="CA1724" Created="2007-03-27 04:29:04Z">
3257 <Issue>
3258 <Item>Util</Item>
3259 <Item>System.Web.Util</Item>
3260 </Issue>
3261 </Message>
3262 </Messages>
3263 <Members>
3264 <Member Name="GetNextXferID():System.UInt32">
3265 <Messages>
3266 <Message Id="Xfer" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3267 <Issue Name="Member">
3268 <Item>Xfer</Item>
3269 <Item>Util.GetNextXferID():UInt32</Item>
3270 </Issue>
3271 </Message>
3272 <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
3273 <Issue Name="MemberId">
3274 <Item>Util.GetNextXferID():UInt32</Item>
3275 </Issue>
3276 </Message>
3277 <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2007-03-27 04:29:04Z">
3278 <Issue>
3279 <Item>GetNextXferID</Item>
3280 </Issue>
3281 </Message>
3282 </Messages>
3283 </Member>
3284 <Member Name="UIntsToLong(System.UInt32,System.UInt32):System.UInt64">
3285 <Messages>
3286 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
3287 <Issue Name="Parameter">
3288 <Item>X</Item>
3289 </Issue>
3290 </Message>
3291 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
3292 <Issue Name="Parameter">
3293 <Item>Y</Item>
3294 </Issue>
3295 </Message>
3296 <Message Id="0#X" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3297 <Issue Name="ParameterOneLetter">
3298 <Item>Util.UIntsToLong(UInt32, UInt32):UInt64</Item>
3299 <Item>X</Item>
3300 </Issue>
3301 </Message>
3302 <Message Id="1#Y" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3303 <Issue Name="ParameterOneLetter">
3304 <Item>Util.UIntsToLong(UInt32, UInt32):UInt64</Item>
3305 <Item>Y</Item>
3306 </Issue>
3307 </Message>
3308 <Message Id="Ints" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3309 <Issue Name="Member">
3310 <Item>Ints</Item>
3311 <Item>Util.UIntsToLong(UInt32, UInt32):UInt64</Item>
3312 </Issue>
3313 </Message>
3314 </Messages>
3315 </Member>
3316 </Members>
3317 </Type>
3318 </Types>
3319 </Namespace>
3320 </Namespaces>
3321 </Module>
3322 </Modules>
3323 </Target>
3324 <Target Name="$(ProjectDir)/bin/OpenSim.GridInterfaces.Local.dll">
3325 <Modules>
3326 <Module Name="opensim.gridinterfaces.local.dll">
3327 <Messages>
3328 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
3329 <Issue>
3330 <Item>OpenSim.GridInterfaces.Local</Item>
3331 </Issue>
3332 </Message>
3333 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
3334 <Issue Name="NoStrongName">
3335 <Item>OpenSim.GridInterfaces.Local</Item>
3336 </Issue>
3337 </Message>
3338 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
3339 <Issue Name="NoAttr">
3340 <Item>OpenSim.GridInterfaces.Local</Item>
3341 </Issue>
3342 </Message>
3343 </Messages>
3344 <Namespaces>
3345 <Namespace Name="OpenSim.GridInterfaces.Local">
3346 <Types>
3347 <Type Name="AssetStorage">
3348 <Members>
3349 <Member Name="Data">
3350 <Messages>
3351 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3352 <Issue>
3353 <Item>Data</Item>
3354 </Issue>
3355 </Message>
3356 </Messages>
3357 </Member>
3358 <Member Name="Name">
3359 <Messages>
3360 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3361 <Issue>
3362 <Item>Name</Item>
3363 </Issue>
3364 </Message>
3365 </Messages>
3366 </Member>
3367 <Member Name="Type">
3368 <Messages>
3369 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3370 <Issue>
3371 <Item>Type</Item>
3372 </Issue>
3373 </Message>
3374 </Messages>
3375 </Member>
3376 <Member Name="UUID">
3377 <Messages>
3378 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3379 <Issue>
3380 <Item>UUID</Item>
3381 </Issue>
3382 </Message>
3383 </Messages>
3384 </Member>
3385 </Members>
3386 </Type>
3387 <Type Name="AssetUUIDQuery">
3388 <Messages>
3389 <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
3390 <Issue Name="Type">
3391 <Item>AssetUUIDQuery</Item>
3392 </Issue>
3393 </Message>
3394 </Messages>
3395 <Members>
3396 <Member Name="Match(OpenSim.GridInterfaces.Local.AssetStorage):System.Boolean">
3397 <Messages>
3398 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
3399 <Issue>
3400 <Item>'asset'</Item>
3401 <Item>AssetUUIDQuery.Match(AssetStorage):Boolean</Item>
3402 </Issue>
3403 </Message>
3404 </Messages>
3405 </Member>
3406 </Members>
3407 </Type>
3408 <Type Name="LocalAssetPlugin">
3409 <Messages>
3410 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3411 <Issue Name="Type">
3412 <Item>Plugin</Item>
3413 <Item>OpenSim.GridInterfaces.Local.LocalAssetPlugin</Item>
3414 </Issue>
3415 </Message>
3416 </Messages>
3417 </Type>
3418 <Type Name="LocalAssetServer">
3419 <Members>
3420 <Member Name=".ctor()">
3421 <Messages>
3422 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
3423 <Issue>
3424 <Item>LocalAssetServer.LocalAssetServer()</Item>
3425 <Item>System.Exception</Item>
3426 </Issue>
3427 </Message>
3428 </Messages>
3429 </Member>
3430 <Member Name="LoadAsset(OpenSim.Framework.Assets.AssetBase,System.Boolean,System.String):System.Void">
3431 <Messages>
3432 <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2007-03-27 04:29:04Z" FixCategory="NonBreaking">
3433 <Issue>
3434 <Item>LocalAssetServer.LoadAsset(AssetBase, Boolean, String):Void</Item>
3435 </Issue>
3436 </Message>
3437 <Message Id="image" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="NonBreaking">
3438 <Issue>
3439 <Item>image</Item>
3440 <Item>LocalAssetServer.LoadAsset(AssetBase, Boolean, String):Void</Item>
3441 </Issue>
3442 </Message>
3443 </Messages>
3444 </Member>
3445 <Member Name="UploadNewAsset(OpenSim.Framework.Assets.AssetBase):System.Void">
3446 <Messages>
3447 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
3448 <Issue>
3449 <Item>'asset'</Item>
3450 <Item>LocalAssetServer.UploadNewAsset(AssetBase):Void</Item>
3451 </Issue>
3452 </Message>
3453 </Messages>
3454 </Member>
3455 </Members>
3456 </Type>
3457 <Type Name="LocalGridPlugin">
3458 <Messages>
3459 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3460 <Issue Name="Type">
3461 <Item>Plugin</Item>
3462 <Item>OpenSim.GridInterfaces.Local.LocalGridPlugin</Item>
3463 </Issue>
3464 </Message>
3465 </Messages>
3466 </Type>
3467 <Type Name="LocalGridServer">
3468 <Members>
3469 <Member Name="LogoutSession(libsecondlife.LLUUID,libsecondlife.LLUUID,System.UInt32):System.Boolean">
3470 <Messages>
3471 <Message Id="Logout" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2007-03-27 04:29:04Z">
3472 <Issue Name="Member">
3473 <Item>Logout</Item>
3474 <Item>LogoutSession</Item>
3475 <Item>LogOff</Item>
3476 </Issue>
3477 </Message>
3478 </Messages>
3479 </Member>
3480 <Member Name="Sessions">
3481 <Messages>
3482 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3483 <Issue>
3484 <Item>Sessions</Item>
3485 </Issue>
3486 </Message>
3487 <Message TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002" Created="2007-03-27 04:29:04Z">
3488 <Issue>
3489 <Item>System.Collections.Generic.List`1&lt;OpenSim.Framework.Interfaces.Login&gt;</Item>
3490 <Item>LocalGridServer.Sessions</Item>
3491 </Issue>
3492 </Message>
3493 </Messages>
3494 </Member>
3495 </Members>
3496 </Type>
3497 </Types>
3498 </Namespace>
3499 </Namespaces>
3500 </Module>
3501 </Modules>
3502 </Target>
3503 <Target Name="$(ProjectDir)/bin/OpenSim.GridInterfaces.Remote.dll">
3504 <Modules>
3505 <Module Name="opensim.gridinterfaces.remote.dll">
3506 <Messages>
3507 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
3508 <Issue>
3509 <Item>OpenSim.GridInterfaces.Remote</Item>
3510 </Issue>
3511 </Message>
3512 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
3513 <Issue Name="NoStrongName">
3514 <Item>OpenSim.GridInterfaces.Remote</Item>
3515 </Issue>
3516 </Message>
3517 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
3518 <Issue Name="NoAttr">
3519 <Item>OpenSim.GridInterfaces.Remote</Item>
3520 </Issue>
3521 </Message>
3522 </Messages>
3523 <Namespaces>
3524 <Namespace Name="OpenSim.GridInterfaces.Remote">
3525 <Types>
3526 <Type Name="RemoteAssetPlugin">
3527 <Messages>
3528 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3529 <Issue Name="Type">
3530 <Item>Plugin</Item>
3531 <Item>OpenSim.GridInterfaces.Remote.RemoteAssetPlugin</Item>
3532 </Issue>
3533 </Message>
3534 </Messages>
3535 </Type>
3536 <Type Name="RemoteGridPlugin">
3537 <Messages>
3538 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3539 <Issue Name="Type">
3540 <Item>Plugin</Item>
3541 <Item>OpenSim.GridInterfaces.Remote.RemoteGridPlugin</Item>
3542 </Issue>
3543 </Message>
3544 </Messages>
3545 </Type>
3546 <Type Name="RemoteGridServer">
3547 <Members>
3548 <Member Name="agentcircuits">
3549 <Messages>
3550 <Message TypeName="CollectionPropertiesShouldBeReadOnly" Category="Microsoft.Usage" CheckId="CA2227" Created="2007-03-27 04:29:04Z">
3551 <Issue>
3552 <Item>agentcircuits</Item>
3553 </Issue>
3554 </Message>
3555 </Messages>
3556 </Member>
3557 <Member Name="AuthenticateSession(libsecondlife.LLUUID,libsecondlife.LLUUID,System.UInt32):OpenSim.Framework.Interfaces.AuthenticateResponse">
3558 <Messages>
3559 <Message Id="2#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2007-03-27 04:29:04Z">
3560 <Issue>
3561 <Item>circuitcode</Item>
3562 <Item>RemoteGridServer.AuthenticateSession(LLUUID, LLUUID, UInt32):AuthenticateResponse</Item>
3563 <Item>circuitCode</Item>
3564 <Item>IGridServer.AuthenticateSession(LLUUID, LLUUID, UInt32):AuthenticateResponse</Item>
3565 </Issue>
3566 </Message>
3567 </Messages>
3568 </Member>
3569 <Member Name="GridRecvKey">
3570 <Messages>
3571 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
3572 <Issue>
3573 <Item>RemoteGridServer.GridRecvKey</Item>
3574 </Issue>
3575 </Message>
3576 </Messages>
3577 </Member>
3578 <Member Name="GridSendKey">
3579 <Messages>
3580 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
3581 <Issue>
3582 <Item>RemoteGridServer.GridSendKey</Item>
3583 </Issue>
3584 </Message>
3585 </Messages>
3586 </Member>
3587 <Member Name="LogoutSession(libsecondlife.LLUUID,libsecondlife.LLUUID,System.UInt32):System.Boolean">
3588 <Messages>
3589 <Message TypeName="PassSystemUriObjectsInsteadOfStrings" Category="Microsoft.Usage" CheckId="CA2234" Created="2007-03-27 04:29:04Z">
3590 <Issue>
3591 <Item>RemoteGridServer.LogoutSession(LLUUID, LLUUID, UInt32):Boolean</Item>
3592 <Item>WebRequest.Create(Uri):WebRequest</Item>
3593 <Item>WebRequest.Create(String):WebRequest</Item>
3594 </Issue>
3595 </Message>
3596 <Message Id="GridResponse" TypeName="RemoveUnusedLocals" Category="Microsoft.Performance" CheckId="CA1804" Created="2007-03-27 04:29:04Z">
3597 <Issue>
3598 <Item>RemoteGridServer.LogoutSession(LLUUID, LLUUID, UInt32):Boolean</Item>
3599 <Item>GridResponse</Item>
3600 <Item>System.String</Item>
3601 </Issue>
3602 </Message>
3603 <Message Id="Logout" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2007-03-27 04:29:04Z">
3604 <Issue Name="Member">
3605 <Item>Logout</Item>
3606 <Item>LogoutSession</Item>
3607 <Item>LogOff</Item>
3608 </Issue>
3609 </Message>
3610 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
3611 <Issue>
3612 <Item>'sessionID'</Item>
3613 <Item>RemoteGridServer.LogoutSession(LLUUID, LLUUID, UInt32):Boolean</Item>
3614 </Issue>
3615 </Message>
3616 </Messages>
3617 </Member>
3618 </Members>
3619 </Type>
3620 </Types>
3621 </Namespace>
3622 </Namespaces>
3623 </Module>
3624 </Modules>
3625 </Target>
3626 <Target Name="$(ProjectDir)/bin/OpenSim.Physics.Manager.dll">
3627 <Modules>
3628 <Module Name="opensim.physics.manager.dll">
3629 <Messages>
3630 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
3631 <Issue>
3632 <Item>OpenSim.Physics.Manager</Item>
3633 </Issue>
3634 </Message>
3635 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
3636 <Issue Name="NoStrongName">
3637 <Item>OpenSim.Physics.Manager</Item>
3638 </Issue>
3639 </Message>
3640 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
3641 <Issue Name="NoAttr">
3642 <Item>OpenSim.Physics.Manager</Item>
3643 </Issue>
3644 </Message>
3645 </Messages>
3646 <Namespaces>
3647 <Namespace Name="OpenSim.Physics.Manager">
3648 <Types>
3649 <Type Name="IPhysicsPlugin">
3650 <Messages>
3651 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3652 <Issue Name="Type">
3653 <Item>Plugin</Item>
3654 <Item>OpenSim.Physics.Manager.IPhysicsPlugin</Item>
3655 </Issue>
3656 </Message>
3657 </Messages>
3658 <Members>
3659 <Member Name="GetName():System.String">
3660 <Messages>
3661 <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2007-03-27 04:29:04Z">
3662 <Issue Certainty="50">
3663 <Item>GetName</Item>
3664 </Issue>
3665 </Message>
3666 </Messages>
3667 </Member>
3668 <Member Name="GetScene():OpenSim.Physics.Manager.PhysicsScene">
3669 <Messages>
3670 <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2007-03-27 04:29:04Z">
3671 <Issue Certainty="50">
3672 <Item>GetScene</Item>
3673 </Issue>
3674 </Message>
3675 </Messages>
3676 </Member>
3677 </Members>
3678 </Type>
3679 <Type Name="NullPhysicsScene">
3680 <Members>
3681 <Member Name="SetTerrain(System.Single[]):System.Void">
3682 <Messages>
3683 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
3684 <Issue>
3685 <Item>'heightMap'</Item>
3686 <Item>NullPhysicsScene.SetTerrain(Single[]):Void</Item>
3687 </Issue>
3688 </Message>
3689 </Messages>
3690 </Member>
3691 <Member Name="Simulate(System.Single):System.Void">
3692 <Messages>
3693 <Message Id="System.Int32.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
3694 <Issue>
3695 <Item>NullPhysicsScene.Simulate(Single):Void</Item>
3696 <Item>System.Int32.ToString</Item>
3697 <Item>System.Int32.ToString(System.IFormatProvider)</Item>
3698 </Issue>
3699 </Message>
3700 </Messages>
3701 </Member>
3702 </Members>
3703 </Type>
3704 <Type Name="PhysicsActor">
3705 <Members>
3706 <Member Name="Kinematic">
3707 <Messages>
3708 <Message Id="Kinematic" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3709 <Issue Name="Member">
3710 <Item>Kinematic</Item>
3711 <Item>PhysicsActor.Kinematic:Boolean</Item>
3712 </Issue>
3713 </Message>
3714 </Messages>
3715 </Member>
3716 </Members>
3717 </Type>
3718 <Type Name="PhysicsManager">
3719 <Members>
3720 <Member Name="GetPhysicsScene(System.String):OpenSim.Physics.Manager.PhysicsScene">
3721 <Messages>
3722 <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
3723 <Issue>
3724 <Item>PhysicsManager.GetPhysicsScene(String):PhysicsScene</Item>
3725 <Item>System.String.Format(System.String,System.Object)</Item>
3726 <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
3727 </Issue>
3728 </Message>
3729 </Messages>
3730 </Member>
3731 <Member Name="LoadPlugins():System.Void">
3732 <Messages>
3733 <Message Id="Plugins" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3734 <Issue Name="Member">
3735 <Item>Plugins</Item>
3736 <Item>PhysicsManager.LoadPlugins():Void</Item>
3737 </Issue>
3738 </Message>
3739 </Messages>
3740 </Member>
3741 </Members>
3742 </Type>
3743 <Type Name="PhysicsVector">
3744 <Members>
3745 <Member Name=".ctor(System.Single,System.Single,System.Single)">
3746 <Messages>
3747 <Message Id="0#x" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3748 <Issue Name="ParameterOneLetter">
3749 <Item>PhysicsVector.PhysicsVector(Single, Single, Single)</Item>
3750 <Item>x</Item>
3751 </Issue>
3752 </Message>
3753 <Message Id="1#y" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3754 <Issue Name="ParameterOneLetter">
3755 <Item>PhysicsVector.PhysicsVector(Single, Single, Single)</Item>
3756 <Item>y</Item>
3757 </Issue>
3758 </Message>
3759 <Message Id="2#z" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3760 <Issue Name="ParameterOneLetter">
3761 <Item>PhysicsVector.PhysicsVector(Single, Single, Single)</Item>
3762 <Item>z</Item>
3763 </Issue>
3764 </Message>
3765 </Messages>
3766 </Member>
3767 <Member Name="X">
3768 <Messages>
3769 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3770 <Issue>
3771 <Item>X</Item>
3772 </Issue>
3773 </Message>
3774 <Message Id="X" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3775 <Issue Name="MemberOneLetter">
3776 <Item>X</Item>
3777 <Item>PhysicsVector.X</Item>
3778 </Issue>
3779 </Message>
3780 </Messages>
3781 </Member>
3782 <Member Name="Y">
3783 <Messages>
3784 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3785 <Issue>
3786 <Item>Y</Item>
3787 </Issue>
3788 </Message>
3789 <Message Id="Y" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3790 <Issue Name="MemberOneLetter">
3791 <Item>Y</Item>
3792 <Item>PhysicsVector.Y</Item>
3793 </Issue>
3794 </Message>
3795 </Messages>
3796 </Member>
3797 <Member Name="Z">
3798 <Messages>
3799 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3800 <Issue>
3801 <Item>Z</Item>
3802 </Issue>
3803 </Message>
3804 <Message Id="Z" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3805 <Issue Name="MemberOneLetter">
3806 <Item>Z</Item>
3807 <Item>PhysicsVector.Z</Item>
3808 </Issue>
3809 </Message>
3810 </Messages>
3811 </Member>
3812 <Member Name="Zero">
3813 <Messages>
3814 <Message TypeName="DoNotDeclareReadOnlyMutableReferenceTypes" Category="Microsoft.Security" CheckId="CA2104" Created="2007-03-27 04:29:04Z">
3815 <Issue>
3816 <Item>PhysicsVector.Zero</Item>
3817 <Item>OpenSim.Physics.Manager.PhysicsVector</Item>
3818 </Issue>
3819 </Message>
3820 </Messages>
3821 </Member>
3822 </Members>
3823 </Type>
3824 </Types>
3825 </Namespace>
3826 </Namespaces>
3827 </Module>
3828 </Modules>
3829 </Target>
3830 <Target Name="$(ProjectDir)/bin/OpenSim.RegionServer.dll">
3831 <Modules>
3832 <Module Name="opensim.regionserver.dll">
3833 <Messages>
3834 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
3835 <Issue>
3836 <Item>OpenSim.RegionServer</Item>
3837 </Issue>
3838 </Message>
3839 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
3840 <Issue Name="NoStrongName">
3841 <Item>OpenSim.RegionServer</Item>
3842 </Issue>
3843 </Message>
3844 <Message TypeName="MarkAssembliesWithAssemblyVersion" Category="Microsoft.Design" CheckId="CA1016" Created="2007-03-27 04:29:04Z">
3845 <Issue>
3846 <Item>OpenSim.RegionServer</Item>
3847 </Issue>
3848 </Message>
3849 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
3850 <Issue Name="NoAttr">
3851 <Item>OpenSim.RegionServer</Item>
3852 </Issue>
3853 </Message>
3854 <Message TypeName="MarkAssembliesWithComVisible" Category="Microsoft.Design" CheckId="CA1017" Created="2007-03-27 04:29:04Z">
3855 <Issue Name="NoAttribute" Level="CriticalError">
3856 <Item>OpenSim.RegionServer</Item>
3857 </Issue>
3858 </Message>
3859 </Messages>
3860 <Namespaces>
3861 <Namespace Name="OpenSim">
3862 <Types>
3863 <Type Name="AgentAssetUpload">
3864 <Members>
3865 <Member Name="AddUpload(libsecondlife.LLUUID,OpenSim.Framework.Assets.AssetBase):System.Void">
3866 <Messages>
3867 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
3868 <Issue Name="ParameterId">
3869 <Item>ID</Item>
3870 <Item>transactionID</Item>
3871 <Item>Id</Item>
3872 </Issue>
3873 </Message>
3874 </Messages>
3875 </Member>
3876 <Member Name="AddUploadToAssetCache(libsecondlife.LLUUID):OpenSim.Framework.Assets.AssetBase">
3877 <Messages>
3878 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
3879 <Issue Name="ParameterId">
3880 <Item>ID</Item>
3881 <Item>transactionID</Item>
3882 <Item>Id</Item>
3883 </Issue>
3884 </Message>
3885 </Messages>
3886 </Member>
3887 <Member Name="GetUpload(libsecondlife.LLUUID):OpenSim.Framework.Assets.AssetBase">
3888 <Messages>
3889 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
3890 <Issue Name="ParameterId">
3891 <Item>ID</Item>
3892 <Item>transactionID</Item>
3893 <Item>Id</Item>
3894 </Issue>
3895 </Message>
3896 </Messages>
3897 </Member>
3898 <Member Name="HandleUploadPacket(libsecondlife.Packets.AssetUploadRequestPacket,libsecondlife.LLUUID):System.Void">
3899 <Messages>
3900 <Message Id="1#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
3901 <Issue Name="ParameterId">
3902 <Item>ID</Item>
3903 <Item>assetID</Item>
3904 <Item>Id</Item>
3905 </Issue>
3906 </Message>
3907 <Message Id="System.Int32.ToString(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
3908 <Issue>
3909 <Item>AgentAssetUpload.HandleUploadPacket(AssetUploadRequestPacket, LLUUID):Void</Item>
3910 <Item>System.Int32.ToString(System.String)</Item>
3911 <Item>System.Int32.ToString(System.String,System.IFormatProvider)</Item>
3912 </Issue>
3913 <Issue>
3914 <Item>AgentAssetUpload.HandleUploadPacket(AssetUploadRequestPacket, LLUUID):Void</Item>
3915 <Item>System.Int32.ToString(System.String)</Item>
3916 <Item>System.Int32.ToString(System.String,System.IFormatProvider)</Item>
3917 </Issue>
3918 </Message>
3919 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
3920 <Issue>
3921 <Item>'assetID'</Item>
3922 <Item>AgentAssetUpload.HandleUploadPacket(AssetUploadRequestPacket, LLUUID):Void</Item>
3923 </Issue>
3924 <Issue>
3925 <Item>'pack'</Item>
3926 <Item>AgentAssetUpload.HandleUploadPacket(AssetUploadRequestPacket, LLUUID):Void</Item>
3927 </Issue>
3928 </Message>
3929 </Messages>
3930 </Member>
3931 <Member Name="HandleXferPacket(libsecondlife.Packets.SendXferPacketPacket):System.Void">
3932 <Messages>
3933 <Message Id="0#xfer" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3934 <Issue Name="Parameter">
3935 <Item>AgentAssetUpload.HandleXferPacket(SendXferPacketPacket):Void</Item>
3936 <Item>xfer</Item>
3937 <Item>xferPacket</Item>
3938 </Issue>
3939 </Message>
3940 <Message Id="Xfer" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
3941 <Issue Name="Member">
3942 <Item>Xfer</Item>
3943 <Item>AgentAssetUpload.HandleXferPacket(SendXferPacketPacket):Void</Item>
3944 </Issue>
3945 </Message>
3946 </Messages>
3947 </Member>
3948 </Members>
3949 </Type>
3950 <Type Name="AssetTransaction">
3951 <Members>
3952 <Member Name=".ctor()">
3953 <Messages>
3954 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
3955 <Issue>
3956 <Item>AssetTransaction.AssetTransaction()</Item>
3957 <Item>UploadComplete</Item>
3958 <Item>System.Boolean</Item>
3959 <Item>false</Item>
3960 </Issue>
3961 </Message>
3962 </Messages>
3963 </Member>
3964 <Member Name="AddToInventory">
3965 <Messages>
3966 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3967 <Issue>
3968 <Item>AddToInventory</Item>
3969 </Issue>
3970 </Message>
3971 </Messages>
3972 </Member>
3973 <Member Name="Asset">
3974 <Messages>
3975 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3976 <Issue>
3977 <Item>Asset</Item>
3978 </Issue>
3979 </Message>
3980 </Messages>
3981 </Member>
3982 <Member Name="InventFolder">
3983 <Messages>
3984 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3985 <Issue>
3986 <Item>InventFolder</Item>
3987 </Issue>
3988 </Message>
3989 </Messages>
3990 </Member>
3991 <Member Name="TransactionID">
3992 <Messages>
3993 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
3994 <Issue>
3995 <Item>TransactionID</Item>
3996 </Issue>
3997 </Message>
3998 </Messages>
3999 </Member>
4000 <Member Name="UploadComplete">
4001 <Messages>
4002 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4003 <Issue>
4004 <Item>UploadComplete</Item>
4005 </Issue>
4006 </Message>
4007 </Messages>
4008 </Member>
4009 <Member Name="XferID">
4010 <Messages>
4011 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4012 <Issue>
4013 <Item>XferID</Item>
4014 </Issue>
4015 </Message>
4016 <Message Id="Xfer" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4017 <Issue Name="Member">
4018 <Item>Xfer</Item>
4019 <Item>AssetTransaction.XferID</Item>
4020 </Issue>
4021 </Message>
4022 </Messages>
4023 </Member>
4024 </Members>
4025 </Type>
4026 <Type Name="Grid">
4027 <Messages>
4028 <Message TypeName="TypeNamesShouldNotMatchNamespaces" Category="Microsoft.Naming" CheckId="CA1724" Created="2007-03-27 04:29:04Z">
4029 <Issue>
4030 <Item>Grid</Item>
4031 <Item>OpenSim.Framework.Grid</Item>
4032 </Issue>
4033 </Message>
4034 </Messages>
4035 <Members>
4036 <Member Name="AssetDll">
4037 <Messages>
4038 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4039 <Issue>
4040 <Item>AssetDll</Item>
4041 </Issue>
4042 </Message>
4043 </Messages>
4044 </Member>
4045 <Member Name="AssetServer">
4046 <Messages>
4047 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4048 <Issue>
4049 <Item>AssetServer</Item>
4050 </Issue>
4051 </Message>
4052 </Messages>
4053 </Member>
4054 <Member Name="GridDll">
4055 <Messages>
4056 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4057 <Issue>
4058 <Item>GridDll</Item>
4059 </Issue>
4060 </Message>
4061 </Messages>
4062 </Member>
4063 <Member Name="GridServer">
4064 <Messages>
4065 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4066 <Issue>
4067 <Item>GridServer</Item>
4068 </Issue>
4069 </Message>
4070 </Messages>
4071 </Member>
4072 <Member Name="Initialise():System.Void">
4073 <Messages>
4074 <Message Id="Initialise" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4075 <Issue Name="Member">
4076 <Item>Initialise</Item>
4077 <Item>Grid.Initialise():Void</Item>
4078 </Issue>
4079 </Message>
4080 </Messages>
4081 </Member>
4082 <Member Name="LoadAssetDll(System.String):OpenSim.Framework.Interfaces.IAssetServer">
4083 <Messages>
4084 <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2007-03-27 04:29:04Z" FixCategory="NonBreaking">
4085 <Issue>
4086 <Item>Grid.LoadAssetDll(String):IAssetServer</Item>
4087 </Issue>
4088 </Message>
4089 </Messages>
4090 </Member>
4091 <Member Name="LoadGridDll(System.String):OpenSim.Framework.Interfaces.IGridServer">
4092 <Messages>
4093 <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2007-03-27 04:29:04Z" FixCategory="NonBreaking">
4094 <Issue>
4095 <Item>Grid.LoadGridDll(String):IGridServer</Item>
4096 </Issue>
4097 </Message>
4098 </Messages>
4099 </Member>
4100 </Members>
4101 </Type>
4102 <Type Name="OpenSimApplication">
4103 <Messages>
4104 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4105 <Issue Name="Type">
4106 <Item>Sim</Item>
4107 <Item>OpenSim.OpenSimApplication</Item>
4108 </Issue>
4109 </Message>
4110 </Messages>
4111 <Members>
4112 <Member Name="RemoveClientCircuit(System.UInt32):System.Void">
4113 <Messages>
4114 <Message Id="0#circuitcode" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4115 <Issue Name="Parameter">
4116 <Item>OpenSimApplication.RemoveClientCircuit(UInt32):Void</Item>
4117 <Item>circuitcode</Item>
4118 <Item>circuitcode</Item>
4119 </Issue>
4120 </Message>
4121 </Messages>
4122 </Member>
4123 <Member Name="SendPacketTo(System.Byte[],System.Int32,System.Net.Sockets.SocketFlags,System.UInt32):System.Void">
4124 <Messages>
4125 <Message Id="3#circuitcode" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4126 <Issue Name="Parameter">
4127 <Item>OpenSimApplication.SendPacketTo(Byte[], Int32, SocketFlags, UInt32):Void</Item>
4128 <Item>circuitcode</Item>
4129 <Item>circuitcode</Item>
4130 </Issue>
4131 </Message>
4132 </Messages>
4133 </Member>
4134 <Member Name="StartUp():System.Void">
4135 <Messages>
4136 <Message Id="StartUp" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2007-03-27 04:29:04Z">
4137 <Issue Name="ShouldBeDiscreteTerm">
4138 <Item>StartUp</Item>
4139 <Item>method</Item>
4140 <Item>StartUp</Item>
4141 <Item>Startup</Item>
4142 </Issue>
4143 </Message>
4144 </Messages>
4145 </Member>
4146 </Members>
4147 </Type>
4148 <Type Name="OpenSimMain">
4149 <Messages>
4150 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4151 <Issue Name="Type">
4152 <Item>Sim</Item>
4153 <Item>OpenSim.OpenSimMain</Item>
4154 </Issue>
4155 </Message>
4156 <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
4157 <Issue>
4158 <Item>OpenSim.OpenSimMain</Item>
4159 <Item>System.Timers.Timer, System.Net.Sockets.Socket</Item>
4160 </Issue>
4161 </Message>
4162 </Messages>
4163 <Members>
4164 <Member Name=".ctor()">
4165 <Messages>
4166 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
4167 <Issue>
4168 <Item>OpenSimMain.OpenSimMain()</Item>
4169 <Item>loginserver</Item>
4170 <Item>System.Boolean</Item>
4171 <Item>false</Item>
4172 </Issue>
4173 <Issue>
4174 <Item>OpenSimMain.OpenSimMain()</Item>
4175 <Item>sandbox</Item>
4176 <Item>System.Boolean</Item>
4177 <Item>false</Item>
4178 </Issue>
4179 </Message>
4180 </Messages>
4181 </Member>
4182 <Member Name="_physicsEngine">
4183 <Messages>
4184 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4185 <Issue>
4186 <Item>_physicsEngine</Item>
4187 </Issue>
4188 </Message>
4189 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
4190 <Issue Name="Member">
4191 <Item>_physicsEngine</Item>
4192 </Issue>
4193 </Message>
4194 </Messages>
4195 </Member>
4196 <Member Name="LoadConfigDll(System.String):OpenSim.Framework.Interfaces.SimConfig">
4197 <Messages>
4198 <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2007-03-27 04:29:04Z" FixCategory="NonBreaking">
4199 <Issue>
4200 <Item>OpenSimMain.LoadConfigDll(String):SimConfig</Item>
4201 </Issue>
4202 </Message>
4203 </Messages>
4204 </Member>
4205 <Member Name="loginserver">
4206 <Messages>
4207 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4208 <Issue>
4209 <Item>loginserver</Item>
4210 </Issue>
4211 </Message>
4212 <Message Id="loginserver" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4213 <Issue Name="Member">
4214 <Item>loginserver</Item>
4215 <Item>OpenSimMain.loginserver</Item>
4216 </Issue>
4217 </Message>
4218 </Messages>
4219 </Member>
4220 <Member Name="sandbox">
4221 <Messages>
4222 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4223 <Issue>
4224 <Item>sandbox</Item>
4225 </Issue>
4226 </Message>
4227 </Messages>
4228 </Member>
4229 <Member Name="Server">
4230 <Messages>
4231 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4232 <Issue>
4233 <Item>Server</Item>
4234 </Issue>
4235 </Message>
4236 </Messages>
4237 </Member>
4238 <Member Name="StartUp():System.Void">
4239 <Messages>
4240 <Message TypeName="DoNotUseTimersThatPreventPowerStateChanges" Category="Microsoft.Mobility" CheckId="CA1601" Created="2007-03-27 04:29:04Z">
4241 <Issue>
4242 <Item>Timer.set_Interval(Double):Void</Item>
4243 <Item>OpenSimMain.StartUp():Void</Item>
4244 </Issue>
4245 </Message>
4246 <Message Id="System.UInt32.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
4247 <Issue>
4248 <Item>OpenSimMain.StartUp():Void</Item>
4249 <Item>System.UInt32.ToString</Item>
4250 <Item>System.UInt32.ToString(System.IFormatProvider)</Item>
4251 </Issue>
4252 <Issue>
4253 <Item>OpenSimMain.StartUp():Void</Item>
4254 <Item>System.UInt32.ToString</Item>
4255 <Item>System.UInt32.ToString(System.IFormatProvider)</Item>
4256 </Issue>
4257 </Message>
4258 </Messages>
4259 </Member>
4260 </Members>
4261 </Type>
4262 <Type Name="OpenSimRoot">
4263 <Messages>
4264 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4265 <Issue Name="Type">
4266 <Item>Sim</Item>
4267 <Item>OpenSim.OpenSimRoot</Item>
4268 </Issue>
4269 </Message>
4270 </Messages>
4271 <Members>
4272 <Member Name=".ctor()">
4273 <Messages>
4274 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
4275 <Issue>
4276 <Item>OpenSimRoot.OpenSimRoot()</Item>
4277 <Item>Sandbox</Item>
4278 <Item>System.Boolean</Item>
4279 <Item>false</Item>
4280 </Issue>
4281 </Message>
4282 </Messages>
4283 </Member>
4284 <Member Name="Application">
4285 <Messages>
4286 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4287 <Issue>
4288 <Item>Application</Item>
4289 </Issue>
4290 </Message>
4291 </Messages>
4292 </Member>
4293 <Member Name="AssetCache">
4294 <Messages>
4295 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4296 <Issue>
4297 <Item>AssetCache</Item>
4298 </Issue>
4299 </Message>
4300 </Messages>
4301 </Member>
4302 <Member Name="Cfg">
4303 <Messages>
4304 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4305 <Issue>
4306 <Item>Cfg</Item>
4307 </Issue>
4308 </Message>
4309 <Message Id="Cfg" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4310 <Issue Name="Member">
4311 <Item>Cfg</Item>
4312 <Item>OpenSimRoot.Cfg</Item>
4313 </Issue>
4314 </Message>
4315 </Messages>
4316 </Member>
4317 <Member Name="ClientThreads">
4318 <Messages>
4319 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4320 <Issue>
4321 <Item>ClientThreads</Item>
4322 </Issue>
4323 </Message>
4324 </Messages>
4325 </Member>
4326 <Member Name="GridServers">
4327 <Messages>
4328 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4329 <Issue>
4330 <Item>GridServers</Item>
4331 </Issue>
4332 </Message>
4333 </Messages>
4334 </Member>
4335 <Member Name="HttpServer">
4336 <Messages>
4337 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4338 <Issue>
4339 <Item>HttpServer</Item>
4340 </Issue>
4341 </Message>
4342 </Messages>
4343 </Member>
4344 <Member Name="InventoryCache">
4345 <Messages>
4346 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4347 <Issue>
4348 <Item>InventoryCache</Item>
4349 </Issue>
4350 </Message>
4351 </Messages>
4352 </Member>
4353 <Member Name="LocalWorld">
4354 <Messages>
4355 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4356 <Issue>
4357 <Item>LocalWorld</Item>
4358 </Issue>
4359 </Message>
4360 </Messages>
4361 </Member>
4362 <Member Name="Sandbox">
4363 <Messages>
4364 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4365 <Issue>
4366 <Item>Sandbox</Item>
4367 </Issue>
4368 </Message>
4369 </Messages>
4370 </Member>
4371 <Member Name="StartUp():System.Void">
4372 <Messages>
4373 <Message Id="StartUp" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2007-03-27 04:29:04Z">
4374 <Issue Name="ShouldBeDiscreteTerm">
4375 <Item>StartUp</Item>
4376 <Item>method</Item>
4377 <Item>StartUp</Item>
4378 <Item>Startup</Item>
4379 </Issue>
4380 </Message>
4381 </Messages>
4382 </Member>
4383 <Member Name="startuptime">
4384 <Messages>
4385 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4386 <Issue>
4387 <Item>startuptime</Item>
4388 </Issue>
4389 </Message>
4390 <Message Id="startuptime" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4391 <Issue Name="Member">
4392 <Item>startuptime</Item>
4393 <Item>OpenSimRoot.startuptime</Item>
4394 </Issue>
4395 </Message>
4396 </Messages>
4397 </Member>
4398 </Members>
4399 </Type>
4400 <Type Name="QueItem">
4401 <Messages>
4402 <Message Id="Que" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4403 <Issue Name="Type">
4404 <Item>Que</Item>
4405 <Item>OpenSim.QueItem</Item>
4406 </Issue>
4407 </Message>
4408 </Messages>
4409 <Members>
4410 <Member Name="Incoming">
4411 <Messages>
4412 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4413 <Issue>
4414 <Item>Incoming</Item>
4415 </Issue>
4416 </Message>
4417 </Messages>
4418 </Member>
4419 <Member Name="Packet">
4420 <Messages>
4421 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4422 <Issue>
4423 <Item>Packet</Item>
4424 </Issue>
4425 </Message>
4426 </Messages>
4427 </Member>
4428 </Members>
4429 </Type>
4430 <Type Name="SimClient">
4431 <Messages>
4432 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4433 <Issue Name="Type">
4434 <Item>Sim</Item>
4435 <Item>OpenSim.SimClient</Item>
4436 </Issue>
4437 </Message>
4438 <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
4439 <Issue>
4440 <Item>OpenSim.SimClient</Item>
4441 <Item>System.Timers.Timer</Item>
4442 </Issue>
4443 </Message>
4444 </Messages>
4445 <Members>
4446 <Member Name=".ctor(System.Net.EndPoint,libsecondlife.Packets.UseCircuitCodePacket)">
4447 <Messages>
4448 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
4449 <Issue>
4450 <Item>SimClient.SimClient(EndPoint, UseCircuitCodePacket)</Item>
4451 <Item>Sequence</Item>
4452 <Item>System.UInt32</Item>
4453 <Item>0</Item>
4454 </Issue>
4455 <Issue>
4456 <Item>SimClient.SimClient(EndPoint, UseCircuitCodePacket)</Item>
4457 <Item>debug</Item>
4458 <Item>System.Boolean</Item>
4459 <Item>false</Item>
4460 </Issue>
4461 </Message>
4462 <Message TypeName="DoNotUseTimersThatPreventPowerStateChanges" Category="Microsoft.Mobility" CheckId="CA1601" Created="2007-03-27 04:29:04Z">
4463 <Issue>
4464 <Item>Timer.Timer(Double)</Item>
4465 <Item>SimClient.SimClient(EndPoint, UseCircuitCodePacket)</Item>
4466 </Issue>
4467 </Message>
4468 <Message Id="1#initialcirpack" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4469 <Issue Name="Parameter">
4470 <Item>SimClient.SimClient(EndPoint, UseCircuitCodePacket)</Item>
4471 <Item>initialcirpack</Item>
4472 <Item>initialcirpack</Item>
4473 </Issue>
4474 </Message>
4475 </Messages>
4476 </Member>
4477 <Member Name="AgentID">
4478 <Messages>
4479 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4480 <Issue>
4481 <Item>AgentID</Item>
4482 </Issue>
4483 </Message>
4484 </Messages>
4485 </Member>
4486 <Member Name="CircuitCode">
4487 <Messages>
4488 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4489 <Issue>
4490 <Item>CircuitCode</Item>
4491 </Issue>
4492 </Message>
4493 </Messages>
4494 </Member>
4495 <Member Name="ClientAvatar">
4496 <Messages>
4497 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4498 <Issue>
4499 <Item>ClientAvatar</Item>
4500 </Issue>
4501 </Message>
4502 </Messages>
4503 </Member>
4504 <Member Name="InPacket(libsecondlife.Packets.Packet):System.Void">
4505 <Messages>
4506 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
4507 <Issue Name="Parameter">
4508 <Item>NewPack</Item>
4509 </Issue>
4510 </Message>
4511 </Messages>
4512 </Member>
4513 <Member Name="newAssetFolder">
4514 <Messages>
4515 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
4516 <Issue>
4517 <Item>SimClient.newAssetFolder</Item>
4518 </Issue>
4519 </Message>
4520 </Messages>
4521 </Member>
4522 <Member Name="OutPacket(libsecondlife.Packets.Packet):System.Void">
4523 <Messages>
4524 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
4525 <Issue Name="Parameter">
4526 <Item>NewPack</Item>
4527 </Issue>
4528 </Message>
4529 </Messages>
4530 </Member>
4531 <Member Name="ProcessInPacket(libsecondlife.Packets.Packet):System.Void">
4532 <Messages>
4533 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
4534 <Issue Name="Parameter">
4535 <Item>Pack</Item>
4536 </Issue>
4537 </Message>
4538 <Message Id="wear" TypeName="RemoveUnusedLocals" Category="Microsoft.Performance" CheckId="CA1804" Created="2007-03-27 04:29:04Z">
4539 <Issue>
4540 <Item>SimClient.ProcessInPacket(Packet):Void</Item>
4541 <Item>wear</Item>
4542 <Item>libsecondlife.Packets.AgentIsNowWearingPacket</Item>
4543 </Issue>
4544 </Message>
4545 <Message TypeName="TestForEmptyStringsUsingStringLength" Category="Microsoft.Performance" CheckId="CA1820" Created="2007-03-27 04:29:04Z">
4546 <Issue Name="IsNullOrEmpty">
4547 <Item>op_Equality</Item>
4548 <Item>""</Item>
4549 <Item>SimClient.ProcessInPacket(Packet):Void</Item>
4550 </Issue>
4551 </Message>
4552 </Messages>
4553 </Member>
4554 <Member Name="ProcessOutPacket(libsecondlife.Packets.Packet):System.Void">
4555 <Messages>
4556 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
4557 <Issue>
4558 <Item>SimClient.ProcessOutPacket(Packet):Void</Item>
4559 <Item>System.Exception</Item>
4560 </Issue>
4561 </Message>
4562 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
4563 <Issue Name="Parameter">
4564 <Item>Pack</Item>
4565 </Issue>
4566 </Message>
4567 </Messages>
4568 </Member>
4569 <Member Name="SecureSessionID">
4570 <Messages>
4571 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4572 <Issue>
4573 <Item>SecureSessionID</Item>
4574 </Issue>
4575 </Message>
4576 </Messages>
4577 </Member>
4578 <Member Name="SessionID">
4579 <Messages>
4580 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4581 <Issue>
4582 <Item>SessionID</Item>
4583 </Issue>
4584 </Message>
4585 </Messages>
4586 </Member>
4587 <Member Name="userEP">
4588 <Messages>
4589 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4590 <Issue>
4591 <Item>userEP</Item>
4592 </Issue>
4593 </Message>
4594 </Messages>
4595 </Member>
4596 </Members>
4597 </Type>
4598 <Type Name="SimConsole">
4599 <Messages>
4600 <Message TypeName="ComVisibleTypeBaseTypesShouldBeComVisible" Category="Microsoft.Interoperability" CheckId="CA1405" Created="2007-03-27 04:29:04Z">
4601 <Issue>
4602 <Item>OpenSim.SimConsole</Item>
4603 <Item> OpenSim.Framework.Console.ConsoleBase</Item>
4604 </Issue>
4605 </Message>
4606 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4607 <Issue Name="Type">
4608 <Item>Sim</Item>
4609 <Item>OpenSim.SimConsole</Item>
4610 </Issue>
4611 </Message>
4612 </Messages>
4613 <Members>
4614 <Member Name=".ctor(OpenSim.Framework.Console.ConsoleBase+ConsoleType,System.String,System.Int32)">
4615 <Messages>
4616 <Message Id="0#constype" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4617 <Issue Name="Parameter">
4618 <Item>SimConsole.SimConsole(ConsoleType, String, Int32)</Item>
4619 <Item>constype</Item>
4620 <Item>constype</Item>
4621 </Issue>
4622 </Message>
4623 <Message Id="1#sparam" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4624 <Issue Name="Parameter">
4625 <Item>SimConsole.SimConsole(ConsoleType, String, Int32)</Item>
4626 <Item>sparam</Item>
4627 <Item>sparam</Item>
4628 </Issue>
4629 </Message>
4630 <Message Id="2#iparam" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4631 <Issue Name="Parameter">
4632 <Item>SimConsole.SimConsole(ConsoleType, String, Int32)</Item>
4633 <Item>iparam</Item>
4634 <Item>iparam</Item>
4635 </Issue>
4636 </Message>
4637 <Message Id="iparam" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
4638 <Issue>
4639 <Item>iparam</Item>
4640 <Item>SimConsole.SimConsole(ConsoleType, String, Int32)</Item>
4641 </Issue>
4642 </Message>
4643 <Message Id="sparam" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
4644 <Issue>
4645 <Item>sparam</Item>
4646 <Item>SimConsole.SimConsole(ConsoleType, String, Int32)</Item>
4647 </Issue>
4648 </Message>
4649 </Messages>
4650 </Member>
4651 <Member Name="CmdPrompt(System.String,System.String):System.String">
4652 <Messages>
4653 <Message TypeName="TestForEmptyStringsUsingStringLength" Category="Microsoft.Performance" CheckId="CA1820" Created="2007-03-27 04:29:04Z">
4654 <Issue Name="IsNullOrEmpty">
4655 <Item>op_Equality</Item>
4656 <Item>""</Item>
4657 <Item>SimConsole.CmdPrompt(String, String):String</Item>
4658 </Issue>
4659 </Message>
4660 </Messages>
4661 </Member>
4662 <Member Name="ConsType">
4663 <Messages>
4664 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
4665 <Issue>
4666 <Item>SimConsole.ConsType</Item>
4667 </Issue>
4668 </Message>
4669 </Messages>
4670 </Member>
4671 <Member Name="MainConsolePrompt():System.Void">
4672 <Messages>
4673 <Message Id="System.UInt64.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
4674 <Issue>
4675 <Item>SimConsole.MainConsolePrompt():Void</Item>
4676 <Item>System.UInt64.ToString</Item>
4677 <Item>System.UInt64.ToString(System.IFormatProvider)</Item>
4678 </Issue>
4679 </Message>
4680 </Messages>
4681 </Member>
4682 <Member Name="RunCmd(System.String,System.String[]):System.Object">
4683 <Messages>
4684 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
4685 <Issue>
4686 <Item>'cmdparams'</Item>
4687 <Item>SimConsole.RunCmd(String, String[]):Object</Item>
4688 </Issue>
4689 </Message>
4690 </Messages>
4691 </Member>
4692 <Member Name="ShowCommands(System.String):System.Void">
4693 <Messages>
4694 <Message Id="System.String.Format(System.String,System.Object[])" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
4695 <Issue>
4696 <Item>SimConsole.ShowCommands(String):Void</Item>
4697 <Item>System.String.Format(System.String,System.Object[])</Item>
4698 <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
4699 </Issue>
4700 <Issue>
4701 <Item>SimConsole.ShowCommands(String):Void</Item>
4702 <Item>System.String.Format(System.String,System.Object[])</Item>
4703 <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
4704 </Issue>
4705 </Message>
4706 </Messages>
4707 </Member>
4708 </Members>
4709 </Type>
4710 <Type Name="VersionInfo">
4711 <Members>
4712 <Member Name="Version">
4713 <Messages>
4714 <Message TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211" Created="2007-03-27 04:29:04Z">
4715 <Issue>
4716 <Item>Version</Item>
4717 </Issue>
4718 </Message>
4719 </Messages>
4720 </Member>
4721 </Members>
4722 </Type>
4723 </Types>
4724 </Namespace>
4725 <Namespace Name="OpenSim.Assets">
4726 <Types>
4727 <Type Name="AssetCache">
4728 <Members>
4729 <Member Name="AddTextureRequest(OpenSim.SimClient,libsecondlife.LLUUID):System.Void">
4730 <Messages>
4731 <Message Id="1#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
4732 <Issue Name="ParameterId">
4733 <Item>ID</Item>
4734 <Item>imageID</Item>
4735 <Item>Id</Item>
4736 </Issue>
4737 </Message>
4738 </Messages>
4739 </Member>
4740 <Member Name="AssetRequests">
4741 <Messages>
4742 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4743 <Issue>
4744 <Item>AssetRequests</Item>
4745 </Issue>
4746 </Message>
4747 <Message TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002" Created="2007-03-27 04:29:04Z">
4748 <Issue>
4749 <Item>System.Collections.Generic.List`1&lt;OpenSim.Assets.AssetRequest&gt;</Item>
4750 <Item>AssetCache.AssetRequests</Item>
4751 </Issue>
4752 </Message>
4753 </Messages>
4754 </Member>
4755 <Member Name="Assets">
4756 <Messages>
4757 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4758 <Issue>
4759 <Item>Assets</Item>
4760 </Issue>
4761 </Message>
4762 </Messages>
4763 </Member>
4764 <Member Name="CloneAsset(libsecondlife.LLUUID,OpenSim.Assets.AssetInfo):OpenSim.Assets.AssetInfo">
4765 <Messages>
4766 <Message TypeName="ConsiderPassingBaseTypesAsParameters" Category="Microsoft.Design" CheckId="CA1011" Created="2007-03-27 04:29:04Z">
4767 <Issue>
4768 <Item>sourceAsset</Item>
4769 <Item>AssetCache.CloneAsset(LLUUID, AssetInfo):AssetInfo</Item>
4770 <Item>OpenSim.Assets.AssetInfo</Item>
4771 <Item>OpenSim.Framework.Assets.AssetBase</Item>
4772 </Issue>
4773 </Message>
4774 <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
4775 <Issue>
4776 <Item>AssetCache.CloneAsset(LLUUID, AssetInfo):AssetInfo</Item>
4777 </Issue>
4778 </Message>
4779 <Message Id="newOwner" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
4780 <Issue>
4781 <Item>newOwner</Item>
4782 <Item>AssetCache.CloneAsset(LLUUID, AssetInfo):AssetInfo</Item>
4783 </Issue>
4784 </Message>
4785 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
4786 <Issue>
4787 <Item>'sourceAsset'</Item>
4788 <Item>AssetCache.CloneAsset(LLUUID, AssetInfo):AssetInfo</Item>
4789 </Issue>
4790 </Message>
4791 </Messages>
4792 </Member>
4793 <Member Name="CloneImage(libsecondlife.LLUUID,OpenSim.Assets.TextureImage):OpenSim.Assets.TextureImage">
4794 <Messages>
4795 <Message TypeName="ConsiderPassingBaseTypesAsParameters" Category="Microsoft.Design" CheckId="CA1011" Created="2007-03-27 04:29:04Z">
4796 <Issue>
4797 <Item>source</Item>
4798 <Item>AssetCache.CloneImage(LLUUID, TextureImage):TextureImage</Item>
4799 <Item>OpenSim.Assets.TextureImage</Item>
4800 <Item>OpenSim.Framework.Assets.AssetBase</Item>
4801 </Issue>
4802 </Message>
4803 <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
4804 <Issue>
4805 <Item>AssetCache.CloneImage(LLUUID, TextureImage):TextureImage</Item>
4806 </Issue>
4807 </Message>
4808 <Message Id="newOwner" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
4809 <Issue>
4810 <Item>newOwner</Item>
4811 <Item>AssetCache.CloneImage(LLUUID, TextureImage):TextureImage</Item>
4812 </Issue>
4813 </Message>
4814 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
4815 <Issue>
4816 <Item>'source'</Item>
4817 <Item>AssetCache.CloneImage(LLUUID, TextureImage):TextureImage</Item>
4818 </Issue>
4819 </Message>
4820 </Messages>
4821 </Member>
4822 <Member Name="CreateNewInventorySet(libsecondlife.LLUUID):OpenSim.Framework.Assets.AssetBase[]">
4823 <Messages>
4824 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
4825 <Issue Name="ParameterId">
4826 <Item>ID</Item>
4827 <Item>agentID</Item>
4828 <Item>Id</Item>
4829 </Issue>
4830 </Message>
4831 </Messages>
4832 </Member>
4833 <Member Name="GetAsset(libsecondlife.LLUUID):OpenSim.Framework.Assets.AssetBase">
4834 <Messages>
4835 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
4836 <Issue Name="ParameterId">
4837 <Item>ID</Item>
4838 <Item>assetID</Item>
4839 <Item>Id</Item>
4840 </Issue>
4841 </Message>
4842 </Messages>
4843 </Member>
4844 <Member Name="RequestedAssets">
4845 <Messages>
4846 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4847 <Issue>
4848 <Item>RequestedAssets</Item>
4849 </Issue>
4850 </Message>
4851 </Messages>
4852 </Member>
4853 <Member Name="RequestedTextures">
4854 <Messages>
4855 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4856 <Issue>
4857 <Item>RequestedTextures</Item>
4858 </Issue>
4859 </Message>
4860 </Messages>
4861 </Member>
4862 <Member Name="RunAssetManager():System.Void">
4863 <Messages>
4864 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
4865 <Issue>
4866 <Item>AssetCache.RunAssetManager():Void</Item>
4867 <Item>System.Exception</Item>
4868 </Issue>
4869 </Message>
4870 </Messages>
4871 </Member>
4872 <Member Name="TextureRequests">
4873 <Messages>
4874 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4875 <Issue>
4876 <Item>TextureRequests</Item>
4877 </Issue>
4878 </Message>
4879 <Message TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002" Created="2007-03-27 04:29:04Z">
4880 <Issue>
4881 <Item>System.Collections.Generic.List`1&lt;OpenSim.Assets.AssetRequest&gt;</Item>
4882 <Item>AssetCache.TextureRequests</Item>
4883 </Issue>
4884 </Message>
4885 </Messages>
4886 </Member>
4887 <Member Name="Textures">
4888 <Messages>
4889 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4890 <Issue>
4891 <Item>Textures</Item>
4892 </Issue>
4893 </Message>
4894 </Messages>
4895 </Member>
4896 </Members>
4897 </Type>
4898 <Type Name="AssetInfo">
4899 <Messages>
4900 <Message TypeName="ComVisibleTypeBaseTypesShouldBeComVisible" Category="Microsoft.Interoperability" CheckId="CA1405" Created="2007-03-27 04:29:04Z">
4901 <Issue>
4902 <Item>OpenSim.Assets.AssetInfo</Item>
4903 <Item> OpenSim.Framework.Assets.AssetBase</Item>
4904 </Issue>
4905 </Message>
4906 </Messages>
4907 <Members>
4908 <Member Name=".ctor(OpenSim.Framework.Assets.AssetBase)">
4909 <Messages>
4910 <Message Id="0#a" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4911 <Issue Name="Parameter">
4912 <Item>AssetInfo.AssetInfo(AssetBase)</Item>
4913 <Item>a</Item>
4914 <Item>aBase</Item>
4915 </Issue>
4916 </Message>
4917 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
4918 <Issue>
4919 <Item>'aBase'</Item>
4920 <Item>AssetInfo.AssetInfo(AssetBase)</Item>
4921 </Issue>
4922 </Message>
4923 </Messages>
4924 </Member>
4925 </Members>
4926 </Type>
4927 <Type Name="AssetRequest">
4928 <Members>
4929 <Member Name=".ctor()">
4930 <Messages>
4931 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
4932 <Issue>
4933 <Item>AssetRequest.AssetRequest()</Item>
4934 <Item>DataPointer</Item>
4935 <Item>System.Int64</Item>
4936 <Item>0</Item>
4937 </Issue>
4938 <Issue>
4939 <Item>AssetRequest.AssetRequest()</Item>
4940 <Item>NumPackets</Item>
4941 <Item>System.Int32</Item>
4942 <Item>0</Item>
4943 </Issue>
4944 <Issue>
4945 <Item>AssetRequest.AssetRequest()</Item>
4946 <Item>PacketCounter</Item>
4947 <Item>System.Int32</Item>
4948 <Item>0</Item>
4949 </Issue>
4950 </Message>
4951 </Messages>
4952 </Member>
4953 <Member Name="AssetInf">
4954 <Messages>
4955 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4956 <Issue>
4957 <Item>AssetInf</Item>
4958 </Issue>
4959 </Message>
4960 </Messages>
4961 </Member>
4962 <Member Name="DataPointer">
4963 <Messages>
4964 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4965 <Issue>
4966 <Item>DataPointer</Item>
4967 </Issue>
4968 </Message>
4969 </Messages>
4970 </Member>
4971 <Member Name="ImageInfo">
4972 <Messages>
4973 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4974 <Issue>
4975 <Item>ImageInfo</Item>
4976 </Issue>
4977 </Message>
4978 </Messages>
4979 </Member>
4980 <Member Name="IsTextureRequest">
4981 <Messages>
4982 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4983 <Issue>
4984 <Item>IsTextureRequest</Item>
4985 </Issue>
4986 </Message>
4987 </Messages>
4988 </Member>
4989 <Member Name="NumPackets">
4990 <Messages>
4991 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
4992 <Issue>
4993 <Item>NumPackets</Item>
4994 </Issue>
4995 </Message>
4996 <Message Id="Num" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
4997 <Issue Name="Member">
4998 <Item>Num</Item>
4999 <Item>AssetRequest.NumPackets</Item>
5000 </Issue>
5001 </Message>
5002 </Messages>
5003 </Member>
5004 <Member Name="PacketCounter">
5005 <Messages>
5006 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5007 <Issue>
5008 <Item>PacketCounter</Item>
5009 </Issue>
5010 </Message>
5011 </Messages>
5012 </Member>
5013 <Member Name="RequestAssetID">
5014 <Messages>
5015 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5016 <Issue>
5017 <Item>RequestAssetID</Item>
5018 </Issue>
5019 </Message>
5020 </Messages>
5021 </Member>
5022 <Member Name="RequestUser">
5023 <Messages>
5024 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5025 <Issue>
5026 <Item>RequestUser</Item>
5027 </Issue>
5028 </Message>
5029 </Messages>
5030 </Member>
5031 <Member Name="TransferRequestID">
5032 <Messages>
5033 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5034 <Issue>
5035 <Item>TransferRequestID</Item>
5036 </Issue>
5037 </Message>
5038 </Messages>
5039 </Member>
5040 </Members>
5041 </Type>
5042 <Type Name="InventoryCache">
5043 <Members>
5044 <Member Name="AddNewInventoryItem(OpenSim.SimClient,libsecondlife.LLUUID,OpenSim.Framework.Assets.AssetBase):libsecondlife.LLUUID">
5045 <Messages>
5046 <Message Id="1#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
5047 <Issue Name="ParameterId">
5048 <Item>ID</Item>
5049 <Item>folderID</Item>
5050 <Item>Id</Item>
5051 </Issue>
5052 </Message>
5053 </Messages>
5054 </Member>
5055 <Member Name="ClientLeaving(libsecondlife.LLUUID):System.Void">
5056 <Messages>
5057 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
5058 <Issue Name="ParameterId">
5059 <Item>ID</Item>
5060 <Item>clientID</Item>
5061 <Item>Id</Item>
5062 </Issue>
5063 </Message>
5064 </Messages>
5065 </Member>
5066 <Member Name="CreateNewInventoryFolder(OpenSim.SimClient,libsecondlife.LLUUID):System.Boolean">
5067 <Messages>
5068 <Message Id="1#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
5069 <Issue Name="ParameterId">
5070 <Item>ID</Item>
5071 <Item>folderID</Item>
5072 <Item>Id</Item>
5073 </Issue>
5074 </Message>
5075 </Messages>
5076 </Member>
5077 <Member Name="CreateNewInventoryFolder(OpenSim.SimClient,libsecondlife.LLUUID,System.UInt16):System.Boolean">
5078 <Messages>
5079 <Message Id="1#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
5080 <Issue Name="ParameterId">
5081 <Item>ID</Item>
5082 <Item>folderID</Item>
5083 <Item>Id</Item>
5084 </Issue>
5085 </Message>
5086 </Messages>
5087 </Member>
5088 <Member Name="FetchInventory(OpenSim.SimClient,libsecondlife.Packets.FetchInventoryPacket):System.Void">
5089 <Messages>
5090 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5091 <Issue Name="Parameter">
5092 <Item>FetchItems</Item>
5093 </Issue>
5094 </Message>
5095 </Messages>
5096 </Member>
5097 <Member Name="FetchInventoryDescendents(OpenSim.SimClient,libsecondlife.Packets.FetchInventoryDescendentsPacket):System.Void">
5098 <Messages>
5099 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5100 <Issue Name="Parameter">
5101 <Item>FetchDescend</Item>
5102 </Issue>
5103 </Message>
5104 </Messages>
5105 </Member>
5106 <Member Name="GetAgentsInventory(libsecondlife.LLUUID):OpenSim.Framework.Inventory.AgentInventory">
5107 <Messages>
5108 <Message Id="0#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
5109 <Issue Name="ParameterId">
5110 <Item>ID</Item>
5111 <Item>agentID</Item>
5112 <Item>Id</Item>
5113 </Issue>
5114 </Message>
5115 </Messages>
5116 </Member>
5117 <Member Name="UpdateInventoryItem(OpenSim.SimClient,libsecondlife.LLUUID,OpenSim.Framework.Assets.AssetBase):System.Boolean">
5118 <Messages>
5119 <Message Id="1#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
5120 <Issue Name="ParameterId">
5121 <Item>ID</Item>
5122 <Item>itemID</Item>
5123 <Item>Id</Item>
5124 </Issue>
5125 </Message>
5126 </Messages>
5127 </Member>
5128 </Members>
5129 </Type>
5130 <Type Name="TextureImage">
5131 <Messages>
5132 <Message TypeName="ComVisibleTypeBaseTypesShouldBeComVisible" Category="Microsoft.Interoperability" CheckId="CA1405" Created="2007-03-27 04:29:04Z">
5133 <Issue>
5134 <Item>OpenSim.Assets.TextureImage</Item>
5135 <Item> OpenSim.Framework.Assets.AssetBase</Item>
5136 </Issue>
5137 </Message>
5138 </Messages>
5139 <Members>
5140 <Member Name=".ctor(OpenSim.Framework.Assets.AssetBase)">
5141 <Messages>
5142 <Message Id="0#a" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5143 <Issue Name="Parameter">
5144 <Item>TextureImage.TextureImage(AssetBase)</Item>
5145 <Item>a</Item>
5146 <Item>aBase</Item>
5147 </Issue>
5148 </Message>
5149 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
5150 <Issue>
5151 <Item>'aBase'</Item>
5152 <Item>TextureImage.TextureImage(AssetBase)</Item>
5153 </Issue>
5154 </Message>
5155 </Messages>
5156 </Member>
5157 </Members>
5158 </Type>
5159 </Types>
5160 </Namespace>
5161 <Namespace Name="OpenSim.CAPS">
5162 <Types>
5163 <Type Name="SimCAPSHTTPServer">
5164 <Messages>
5165 <Message Id="Sim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5166 <Issue Name="Type">
5167 <Item>Sim</Item>
5168 <Item>OpenSim.CAPS.SimCAPSHTTPServer</Item>
5169 </Issue>
5170 </Message>
5171 <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
5172 <Issue Name="Type">
5173 <Item>SimCAPSHTTPServer</Item>
5174 </Issue>
5175 </Message>
5176 <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
5177 <Issue>
5178 <Item>OpenSim.CAPS.SimCAPSHTTPServer</Item>
5179 <Item>System.Net.HttpListener</Item>
5180 </Issue>
5181 </Message>
5182 </Messages>
5183 <Members>
5184 <Member Name="HandleRequest(System.Object):System.Void">
5185 <Messages>
5186 <Message Id="0#stateinfo" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5187 <Issue Name="Parameter">
5188 <Item>SimCAPSHTTPServer.HandleRequest(Object):Void</Item>
5189 <Item>stateinfo</Item>
5190 <Item>stateinfo</Item>
5191 </Issue>
5192 </Message>
5193 </Messages>
5194 </Member>
5195 <Member Name="HTTPD">
5196 <Messages>
5197 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5198 <Issue>
5199 <Item>HTTPD</Item>
5200 </Issue>
5201 </Message>
5202 </Messages>
5203 </Member>
5204 <Member Name="Listener">
5205 <Messages>
5206 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5207 <Issue>
5208 <Item>Listener</Item>
5209 </Issue>
5210 </Message>
5211 </Messages>
5212 </Member>
5213 <Member Name="LoadAdminPage():System.Void">
5214 <Messages>
5215 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
5216 <Issue>
5217 <Item>SimCAPSHTTPServer.LoadAdminPage():Void</Item>
5218 <Item>System.Exception</Item>
5219 </Issue>
5220 </Message>
5221 </Messages>
5222 </Member>
5223 <Member Name="ParseLLSDXML(System.String):System.String">
5224 <Messages>
5225 <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2007-03-27 04:29:04Z" FixCategory="NonBreaking">
5226 <Issue>
5227 <Item>SimCAPSHTTPServer.ParseLLSDXML(String):String</Item>
5228 </Issue>
5229 </Message>
5230 <Message Id="requestBody" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="NonBreaking">
5231 <Issue>
5232 <Item>requestBody</Item>
5233 <Item>SimCAPSHTTPServer.ParseLLSDXML(String):String</Item>
5234 </Issue>
5235 </Message>
5236 </Messages>
5237 </Member>
5238 <Member Name="ParseREST(System.String,System.String,System.String):System.String">
5239 <Messages>
5240 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
5241 <Issue>
5242 <Item>SimCAPSHTTPServer.ParseREST(String, String, String):String</Item>
5243 <Item>System.Exception</Item>
5244 </Issue>
5245 </Message>
5246 <Message Id="System.String.Format(System.String,System.Object[])" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
5247 <Issue>
5248 <Item>SimCAPSHTTPServer.ParseREST(String, String, String):String</Item>
5249 <Item>System.String.Format(System.String,System.Object[])</Item>
5250 <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
5251 </Issue>
5252 </Message>
5253 </Messages>
5254 </Member>
5255 <Member Name="ParseXMLRPC(System.String):System.String">
5256 <Messages>
5257 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
5258 <Issue>
5259 <Item>SimCAPSHTTPServer.ParseXMLRPC(String):String</Item>
5260 <Item>System.Exception</Item>
5261 </Issue>
5262 </Message>
5263 <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2007-03-27 04:29:04Z" FixCategory="NonBreaking">
5264 <Issue>
5265 <Item>SimCAPSHTTPServer.ParseXMLRPC(String):String</Item>
5266 </Issue>
5267 </Message>
5268 <Message Id="System.Convert.ToUInt32(System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
5269 <Issue>
5270 <Item>SimCAPSHTTPServer.ParseXMLRPC(String):String</Item>
5271 <Item>System.Convert.ToUInt32(System.Object)</Item>
5272 <Item>System.Convert.ToUInt32(System.Object,System.IFormatProvider)</Item>
5273 </Issue>
5274 </Message>
5275 </Messages>
5276 </Member>
5277 <Member Name="StartHTTP():System.Void">
5278 <Messages>
5279 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
5280 <Issue>
5281 <Item>SimCAPSHTTPServer.StartHTTP():Void</Item>
5282 <Item>System.Exception</Item>
5283 </Issue>
5284 </Message>
5285 <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
5286 <Issue Name="Member">
5287 <Item>SimCAPSHTTPServer.StartHTTP():Void</Item>
5288 </Issue>
5289 </Message>
5290 </Messages>
5291 </Member>
5292 </Members>
5293 </Type>
5294 </Types>
5295 </Namespace>
5296 <Namespace Name="OpenSim.types">
5297 <Types>
5298 <Type Name="Mesh">
5299 <Members>
5300 <Member Name="mesh">
5301 <Messages>
5302 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5303 <Issue>
5304 <Item>mesh</Item>
5305 </Issue>
5306 </Message>
5307 <Message TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002" Created="2007-03-27 04:29:04Z">
5308 <Issue>
5309 <Item>System.Collections.Generic.List`1&lt;OpenSim.types.Triangle&gt;</Item>
5310 <Item>Mesh.mesh</Item>
5311 </Issue>
5312 </Message>
5313 </Messages>
5314 </Member>
5315 <Member Name="op_Addition(OpenSim.types.Mesh,OpenSim.types.Mesh):OpenSim.types.Mesh">
5316 <Messages>
5317 <Message Id="0#a" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5318 <Issue Name="ParameterOneLetter">
5319 <Item>Mesh.op_Addition(Mesh, Mesh):Mesh</Item>
5320 <Item>a</Item>
5321 </Issue>
5322 </Message>
5323 <Message Id="1#b" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5324 <Issue Name="ParameterOneLetter">
5325 <Item>Mesh.op_Addition(Mesh, Mesh):Mesh</Item>
5326 <Item>b</Item>
5327 </Issue>
5328 </Message>
5329 <Message TypeName="OperatorOverloadsHaveNamedAlternates" Category="Microsoft.Usage" CheckId="CA2225" Created="2007-03-27 04:29:04Z">
5330 <Issue>
5331 <Item>Add</Item>
5332 <Item>Mesh.op_Addition(Mesh, Mesh):Mesh</Item>
5333 </Issue>
5334 </Message>
5335 <Message TypeName="OverloadOperatorEqualsOnOverloadingAddAndSubtract" Category="Microsoft.Design" CheckId="CA1013" Created="2007-03-27 04:29:04Z">
5336 <Issue>
5337 <Item>Mesh</Item>
5338 <Item>Mesh.op_Addition(Mesh, Mesh):Mesh</Item>
5339 </Issue>
5340 </Message>
5341 </Messages>
5342 </Member>
5343 </Members>
5344 </Type>
5345 <Type Name="Triangle">
5346 <Members>
5347 <Member Name=".ctor(Axiom.MathLib.Vector3,Axiom.MathLib.Vector3,Axiom.MathLib.Vector3)">
5348 <Messages>
5349 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5350 <Issue Name="Parameter">
5351 <Item>A</Item>
5352 </Issue>
5353 </Message>
5354 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5355 <Issue Name="Parameter">
5356 <Item>B</Item>
5357 </Issue>
5358 </Message>
5359 <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5360 <Issue Name="Parameter">
5361 <Item>C</Item>
5362 </Issue>
5363 </Message>
5364 <Message Id="0#A" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5365 <Issue Name="ParameterOneLetter">
5366 <Item>Triangle.Triangle(Vector3, Vector3, Vector3)</Item>
5367 <Item>A</Item>
5368 </Issue>
5369 </Message>
5370 <Message Id="1#B" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5371 <Issue Name="ParameterOneLetter">
5372 <Item>Triangle.Triangle(Vector3, Vector3, Vector3)</Item>
5373 <Item>B</Item>
5374 </Issue>
5375 </Message>
5376 <Message Id="2#C" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5377 <Issue Name="ParameterOneLetter">
5378 <Item>Triangle.Triangle(Vector3, Vector3, Vector3)</Item>
5379 <Item>C</Item>
5380 </Issue>
5381 </Message>
5382 </Messages>
5383 </Member>
5384 </Members>
5385 </Type>
5386 </Types>
5387 </Namespace>
5388 <Namespace Name="OpenSim.UserServer">
5389 <Types>
5390 <Type Name="LocalUserProfileManager">
5391 <Members>
5392 <Member Name="CustomiseResponse(System.Collections.Hashtable&amp;,OpenSim.Framework.User.UserProfile):System.Void">
5393 <Messages>
5394 <Message Id="System.Int32.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
5395 <Issue>
5396 <Item>LocalUserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
5397 <Item>System.Int32.ToString</Item>
5398 <Item>System.Int32.ToString(System.IFormatProvider)</Item>
5399 </Issue>
5400 <Issue>
5401 <Item>LocalUserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
5402 <Item>System.Int32.ToString</Item>
5403 <Item>System.Int32.ToString(System.IFormatProvider)</Item>
5404 </Issue>
5405 </Message>
5406 <Message Id="System.Single.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
5407 <Issue>
5408 <Item>LocalUserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
5409 <Item>System.Single.ToString</Item>
5410 <Item>System.Single.ToString(System.IFormatProvider)</Item>
5411 </Issue>
5412 <Issue>
5413 <Item>LocalUserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
5414 <Item>System.Single.ToString</Item>
5415 <Item>System.Single.ToString(System.IFormatProvider)</Item>
5416 </Issue>
5417 <Issue>
5418 <Item>LocalUserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
5419 <Item>System.Single.ToString</Item>
5420 <Item>System.Single.ToString(System.IFormatProvider)</Item>
5421 </Issue>
5422 <Issue>
5423 <Item>LocalUserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
5424 <Item>System.Single.ToString</Item>
5425 <Item>System.Single.ToString(System.IFormatProvider)</Item>
5426 </Issue>
5427 <Issue>
5428 <Item>LocalUserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
5429 <Item>System.Single.ToString</Item>
5430 <Item>System.Single.ToString(System.IFormatProvider)</Item>
5431 </Issue>
5432 <Issue>
5433 <Item>LocalUserProfileManager.CustomiseResponse(Hashtable&amp;, UserProfile):Void</Item>
5434 <Item>System.Single.ToString</Item>
5435 <Item>System.Single.ToString(System.IFormatProvider)</Item>
5436 </Issue>
5437 </Message>
5438 </Messages>
5439 </Member>
5440 </Members>
5441 </Type>
5442 <Type Name="LoginServer">
5443 <Messages>
5444 <Message TypeName="ComVisibleTypeBaseTypesShouldBeComVisible" Category="Microsoft.Interoperability" CheckId="CA1405" Created="2007-03-27 04:29:04Z">
5445 <Issue>
5446 <Item>OpenSim.UserServer.LoginServer</Item>
5447 <Item> OpenSim.Framework.Grid.LoginService</Item>
5448 </Issue>
5449 </Message>
5450 <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
5451 <Issue>
5452 <Item>OpenSim.UserServer.LoginServer</Item>
5453 <Item>System.Net.Sockets.Socket</Item>
5454 </Issue>
5455 </Message>
5456 <Message Id="Login" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2007-03-27 04:29:04Z">
5457 <Issue Name="Type">
5458 <Item>Login</Item>
5459 <Item>LoginServer</Item>
5460 <Item>LogOn</Item>
5461 </Issue>
5462 </Message>
5463 </Messages>
5464 <Members>
5465 <Member Name=".ctor(OpenSim.Framework.Interfaces.IGridServer)">
5466 <Messages>
5467 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
5468 <Issue>
5469 <Item>LoginServer.LoginServer(IGridServer)</Item>
5470 <Item>_needPasswd</Item>
5471 <Item>System.Boolean</Item>
5472 <Item>false</Item>
5473 </Issue>
5474 <Issue>
5475 <Item>LoginServer.LoginServer(IGridServer)</Item>
5476 <Item>userAccounts</Item>
5477 <Item>System.Boolean</Item>
5478 <Item>false</Item>
5479 </Issue>
5480 </Message>
5481 </Messages>
5482 </Member>
5483 <Member Name="Authenticate(System.String,System.String,System.String):System.Boolean">
5484 <Messages>
5485 <Message Id="2#passwd" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5486 <Issue Name="Parameter">
5487 <Item>LoginServer.Authenticate(String, String, String):Boolean</Item>
5488 <Item>passwd</Item>
5489 <Item>passwd</Item>
5490 </Issue>
5491 </Message>
5492 </Messages>
5493 </Member>
5494 <Member Name="clientAddress">
5495 <Messages>
5496 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5497 <Issue>
5498 <Item>clientAddress</Item>
5499 </Issue>
5500 </Message>
5501 </Messages>
5502 </Member>
5503 <Member Name="CustomiseLoginResponse(System.Collections.Hashtable,System.String,System.String):System.Void">
5504 <Messages>
5505 <Message Id="Customise" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5506 <Issue Name="Member">
5507 <Item>Customise</Item>
5508 <Item>LoginServer.CustomiseLoginResponse(Hashtable, String, String):Void</Item>
5509 </Issue>
5510 </Message>
5511 <Message Id="Login" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2007-03-27 04:29:04Z">
5512 <Issue Name="Member">
5513 <Item>Login</Item>
5514 <Item>CustomiseLoginResponse</Item>
5515 <Item>LogOn</Item>
5516 </Issue>
5517 </Message>
5518 </Messages>
5519 </Member>
5520 <Member Name="EncodePassword(System.String):System.String">
5521 <Messages>
5522 <Message Id="System.String.ToLower" TypeName="SpecifyCultureInfo" Category="Microsoft.Globalization" CheckId="CA1304" Created="2007-03-27 04:29:04Z">
5523 <Issue>
5524 <Item>LoginServer.EncodePassword(String):String</Item>
5525 <Item>System.String.ToLower</Item>
5526 <Item>System.String.ToLower(System.Globalization.CultureInfo)</Item>
5527 </Issue>
5528 </Message>
5529 </Messages>
5530 </Member>
5531 <Member Name="GetAgentId(System.String,System.String):libsecondlife.LLUUID">
5532 <Messages>
5533 <Message Id="System.Int32.ToString(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
5534 <Issue>
5535 <Item>LoginServer.GetAgentId(String, String):LLUUID</Item>
5536 <Item>System.Int32.ToString(System.String)</Item>
5537 <Item>System.Int32.ToString(System.String,System.IFormatProvider)</Item>
5538 </Issue>
5539 </Message>
5540 </Messages>
5541 </Member>
5542 <Member Name="InitializeLogin():System.Void">
5543 <Messages>
5544 <Message Id="OpenSim.Framework.User.UserProfileManager.SetKeys(System.String,System.String,System.String,System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2007-03-27 04:29:04Z">
5545 <Issue>
5546 <Item>LoginServer.InitializeLogin():Void</Item>
5547 <Item>4</Item>
5548 <Item>UserProfileManager.SetKeys(String, String, String, String):Void</Item>
5549 <Item>Welcome to OpenSim</Item>
5550 </Issue>
5551 </Message>
5552 <Message Id="Sim" TypeName="LiteralsShouldBeSpelledCorrectly" Category="Microsoft.Usage" CheckId="CA2204" Created="2007-03-27 04:29:04Z">
5553 <Issue>
5554 <Item>Sim</Item>
5555 <Item>OpenSim</Item>
5556 </Issue>
5557 </Message>
5558 </Messages>
5559 </Member>
5560 <Member Name="LoginRequest(System.IO.StreamReader,System.IO.StreamWriter):System.Void">
5561 <Messages>
5562 <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2007-03-27 04:29:04Z">
5563 <Issue Name="TooGeneric">
5564 <Item>LoginServer.LoginRequest(StreamReader, StreamWriter):Void</Item>
5565 <Item>System.Exception</Item>
5566 </Issue>
5567 </Message>
5568 <Message Id="System.Convert.ToInt32(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
5569 <Issue>
5570 <Item>LoginServer.LoginRequest(StreamReader, StreamWriter):Void</Item>
5571 <Item>System.Convert.ToInt32(System.String)</Item>
5572 <Item>System.Convert.ToInt32(System.String,System.IFormatProvider)</Item>
5573 </Issue>
5574 </Message>
5575 <Message TypeName="TestForEmptyStringsUsingStringLength" Category="Microsoft.Performance" CheckId="CA1820" Created="2007-03-27 04:29:04Z">
5576 <Issue Name="IsNullOrEmpty">
5577 <Item>op_Inequality</Item>
5578 <Item>""</Item>
5579 <Item>LoginServer.LoginRequest(StreamReader, StreamWriter):Void</Item>
5580 </Issue>
5581 </Message>
5582 </Messages>
5583 </Member>
5584 <Member Name="ProcessXmlRequest(Nwc.XmlRpc.XmlRpcRequest,System.IO.StreamWriter):System.Boolean">
5585 <Messages>
5586 <Message TypeName="ConsiderPassingBaseTypesAsParameters" Category="Microsoft.Design" CheckId="CA1011" Created="2007-03-27 04:29:04Z">
5587 <Issue>
5588 <Item>writer</Item>
5589 <Item>LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean</Item>
5590 <Item>System.IO.StreamWriter</Item>
5591 <Item>System.IO.TextWriter</Item>
5592 </Issue>
5593 </Message>
5594 <Message Id="System.Int32.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
5595 <Issue>
5596 <Item>LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean</Item>
5597 <Item>System.Int32.ToString</Item>
5598 <Item>System.Int32.ToString(System.IFormatProvider)</Item>
5599 </Issue>
5600 </Message>
5601 <Message Id="System.Int32.ToString(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
5602 <Issue>
5603 <Item>LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean</Item>
5604 <Item>System.Int32.ToString(System.String)</Item>
5605 <Item>System.Int32.ToString(System.String,System.IFormatProvider)</Item>
5606 </Issue>
5607 </Message>
5608 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
5609 <Issue>
5610 <Item>'request'</Item>
5611 <Item>LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean</Item>
5612 </Issue>
5613 <Issue>
5614 <Item>'writer'</Item>
5615 <Item>LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean</Item>
5616 </Issue>
5617 <Issue>
5618 <Item>'writer'</Item>
5619 <Item>LoginServer.ProcessXmlRequest(XmlRpcRequest, StreamWriter):Boolean</Item>
5620 </Issue>
5621 </Message>
5622 </Messages>
5623 </Member>
5624 <Member Name="remoteAddress">
5625 <Messages>
5626 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5627 <Issue>
5628 <Item>remoteAddress</Item>
5629 </Issue>
5630 </Message>
5631 </Messages>
5632 </Member>
5633 <Member Name="RunLogin():System.Void">
5634 <Messages>
5635 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
5636 <Issue>
5637 <Item>LoginServer.RunLogin():Void</Item>
5638 <Item>System.Exception</Item>
5639 </Issue>
5640 <Issue>
5641 <Item>LoginServer.RunLogin():Void</Item>
5642 <Item>System.Exception</Item>
5643 </Issue>
5644 </Message>
5645 <Message Id="clientEndPoint" TypeName="RemoveUnusedLocals" Category="Microsoft.Performance" CheckId="CA1804" Created="2007-03-27 04:29:04Z">
5646 <Issue>
5647 <Item>LoginServer.RunLogin():Void</Item>
5648 <Item>clientEndPoint</Item>
5649 <Item>System.Net.IPEndPoint</Item>
5650 </Issue>
5651 </Message>
5652 </Messages>
5653 </Member>
5654 </Members>
5655 </Type>
5656 </Types>
5657 </Namespace>
5658 <Namespace Name="OpenSim.world">
5659 <Types>
5660 <Type Name="Avatar">
5661 <Members>
5662 <Member Name=".cctor()">
5663 <Messages>
5664 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
5665 <Issue>
5666 <Item>Avatar.Avatar()</Item>
5667 <Item>PhysicsEngineFlying</Item>
5668 <Item>System.Boolean</Item>
5669 <Item>false</Item>
5670 </Issue>
5671 </Message>
5672 </Messages>
5673 </Member>
5674 <Member Name=".ctor(OpenSim.SimClient)">
5675 <Messages>
5676 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
5677 <Issue>
5678 <Item>Avatar.Avatar(SimClient)</Item>
5679 <Item>_updateCount</Item>
5680 <Item>System.Int16</Item>
5681 <Item>0</Item>
5682 </Issue>
5683 <Issue>
5684 <Item>Avatar.Avatar(SimClient)</Item>
5685 <Item>avatarAppearanceTexture</Item>
5686 <Item>libsecondlife.LLObject+TextureEntry</Item>
5687 <Item>null</Item>
5688 </Issue>
5689 <Issue>
5690 <Item>Avatar.Avatar(SimClient)</Item>
5691 <Item>movementflag</Item>
5692 <Item>System.Byte</Item>
5693 <Item>0</Item>
5694 </Issue>
5695 <Issue>
5696 <Item>Avatar.Avatar(SimClient)</Item>
5697 <Item>updateflag</Item>
5698 <Item>System.Boolean</Item>
5699 <Item>false</Item>
5700 </Issue>
5701 </Message>
5702 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5703 <Issue Name="Parameter">
5704 <Item>TheClient</Item>
5705 </Issue>
5706 </Message>
5707 </Messages>
5708 </Member>
5709 <Member Name="anim_seq">
5710 <Messages>
5711 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5712 <Issue>
5713 <Item>anim_seq</Item>
5714 </Issue>
5715 </Message>
5716 <Message Id="anim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5717 <Issue Name="Member">
5718 <Item>anim</Item>
5719 <Item>Avatar.anim_seq</Item>
5720 </Issue>
5721 </Message>
5722 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
5723 <Issue Name="Member">
5724 <Item>anim_seq</Item>
5725 </Issue>
5726 </Message>
5727 </Messages>
5728 </Member>
5729 <Member Name="Animations">
5730 <Messages>
5731 <Message TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211" Created="2007-03-27 04:29:04Z">
5732 <Issue>
5733 <Item>Animations</Item>
5734 </Issue>
5735 </Message>
5736 </Messages>
5737 </Member>
5738 <Member Name="CompleteMovement(OpenSim.world.World):System.Void">
5739 <Messages>
5740 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5741 <Issue Name="Parameter">
5742 <Item>RegionInfo</Item>
5743 </Issue>
5744 </Message>
5745 <Message Id="RegionInfo" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
5746 <Issue>
5747 <Item>RegionInfo</Item>
5748 <Item>Avatar.CompleteMovement(World):Void</Item>
5749 </Issue>
5750 </Message>
5751 </Messages>
5752 </Member>
5753 <Member Name="ControllingClient">
5754 <Messages>
5755 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5756 <Issue>
5757 <Item>ControllingClient</Item>
5758 </Issue>
5759 </Message>
5760 </Messages>
5761 </Member>
5762 <Member Name="current_anim">
5763 <Messages>
5764 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5765 <Issue>
5766 <Item>current_anim</Item>
5767 </Issue>
5768 </Message>
5769 <Message Id="anim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5770 <Issue Name="Member">
5771 <Item>anim</Item>
5772 <Item>Avatar.current_anim</Item>
5773 </Issue>
5774 </Message>
5775 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
5776 <Issue Name="Member">
5777 <Item>current_anim</Item>
5778 </Issue>
5779 </Message>
5780 </Messages>
5781 </Member>
5782 <Member Name="firstname">
5783 <Messages>
5784 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5785 <Issue>
5786 <Item>firstname</Item>
5787 </Issue>
5788 </Message>
5789 <Message Id="firstname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5790 <Issue Name="Member">
5791 <Item>firstname</Item>
5792 <Item>Avatar.firstname</Item>
5793 </Issue>
5794 </Message>
5795 </Messages>
5796 </Member>
5797 <Member Name="lastname">
5798 <Messages>
5799 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5800 <Issue>
5801 <Item>lastname</Item>
5802 </Issue>
5803 </Message>
5804 <Message Id="lastname" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5805 <Issue Name="Member">
5806 <Item>lastname</Item>
5807 <Item>Avatar.lastname</Item>
5808 </Issue>
5809 </Message>
5810 </Messages>
5811 </Member>
5812 <Member Name="LoadAnims():System.Void">
5813 <Messages>
5814 <Message Id="Anims" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5815 <Issue Name="Member">
5816 <Item>Anims</Item>
5817 <Item>Avatar.LoadAnims():Void</Item>
5818 </Issue>
5819 </Message>
5820 </Messages>
5821 </Member>
5822 <Member Name="PhysActor">
5823 <Messages>
5824 <Message TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044" Created="2007-03-27 04:29:04Z">
5825 <Issue>
5826 <Item>PhysActor</Item>
5827 </Issue>
5828 </Message>
5829 </Messages>
5830 </Member>
5831 <Member Name="PhysicsEngineFlying">
5832 <Messages>
5833 <Message TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211" Created="2007-03-27 04:29:04Z">
5834 <Issue>
5835 <Item>PhysicsEngineFlying</Item>
5836 </Issue>
5837 </Message>
5838 </Messages>
5839 </Member>
5840 <Member Name="SendAnimPack():System.Void">
5841 <Messages>
5842 <Message Id="Anim" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5843 <Issue Name="Member">
5844 <Item>Anim</Item>
5845 <Item>Avatar.SendAnimPack():Void</Item>
5846 </Issue>
5847 </Message>
5848 </Messages>
5849 </Member>
5850 <Member Name="SendAppearanceToOtherAgent(OpenSim.SimClient):System.Void">
5851 <Messages>
5852 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
5853 <Issue>
5854 <Item>'userInfo'</Item>
5855 <Item>Avatar.SendAppearanceToOtherAgent(SimClient):Void</Item>
5856 </Issue>
5857 </Message>
5858 </Messages>
5859 </Member>
5860 <Member Name="SendRegionHandshake(OpenSim.world.World):System.Void">
5861 <Messages>
5862 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5863 <Issue Name="Parameter">
5864 <Item>RegionInfo</Item>
5865 </Issue>
5866 </Message>
5867 <Message Id="RegionInfo" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
5868 <Issue>
5869 <Item>RegionInfo</Item>
5870 <Item>Avatar.SendRegionHandshake(World):Void</Item>
5871 </Issue>
5872 </Message>
5873 </Messages>
5874 </Member>
5875 </Members>
5876 </Type>
5877 <Type Name="AvatarAnimations">
5878 <Members>
5879 <Member Name="AnimsLLUUID">
5880 <Messages>
5881 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5882 <Issue>
5883 <Item>AnimsLLUUID</Item>
5884 </Issue>
5885 </Message>
5886 <Message Id="Anims" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5887 <Issue Name="Member">
5888 <Item>Anims</Item>
5889 <Item>AvatarAnimations.AnimsLLUUID</Item>
5890 </Issue>
5891 </Message>
5892 </Messages>
5893 </Member>
5894 <Member Name="AnimsNames">
5895 <Messages>
5896 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5897 <Issue>
5898 <Item>AnimsNames</Item>
5899 </Issue>
5900 </Message>
5901 <Message Id="Anims" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5902 <Issue Name="Member">
5903 <Item>Anims</Item>
5904 <Item>AvatarAnimations.AnimsNames</Item>
5905 </Issue>
5906 </Message>
5907 </Messages>
5908 </Member>
5909 <Member Name="LoadAnims():System.Void">
5910 <Messages>
5911 <Message Id="Anims" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5912 <Issue Name="Member">
5913 <Item>Anims</Item>
5914 <Item>AvatarAnimations.LoadAnims():Void</Item>
5915 </Issue>
5916 </Message>
5917 </Messages>
5918 </Member>
5919 </Members>
5920 </Type>
5921 <Type Name="Entity">
5922 <Members>
5923 <Member Name=".ctor()">
5924 <Messages>
5925 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
5926 <Issue>
5927 <Item>Entity.Entity()</Item>
5928 <Item>localid</Item>
5929 <Item>System.UInt32</Item>
5930 <Item>0</Item>
5931 </Issue>
5932 </Message>
5933 </Messages>
5934 </Member>
5935 <Member Name="addForces():System.Void">
5936 <Messages>
5937 <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5938 <Issue Name="Member">
5939 <Item>addForces</Item>
5940 </Issue>
5941 </Message>
5942 </Messages>
5943 </Member>
5944 <Member Name="BackUp():System.Void">
5945 <Messages>
5946 <Message Id="BackUp" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2007-03-27 04:29:04Z">
5947 <Issue Name="ShouldBeDiscreteTerm">
5948 <Item>BackUp</Item>
5949 <Item>method</Item>
5950 <Item>BackUp</Item>
5951 <Item>Backup</Item>
5952 </Issue>
5953 </Message>
5954 </Messages>
5955 </Member>
5956 <Member Name="children">
5957 <Messages>
5958 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5959 <Issue>
5960 <Item>children</Item>
5961 </Issue>
5962 </Message>
5963 <Message TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002" Created="2007-03-27 04:29:04Z">
5964 <Issue>
5965 <Item>System.Collections.Generic.List`1&lt;OpenSim.world.Entity&gt;</Item>
5966 <Item>Entity.children</Item>
5967 </Issue>
5968 </Message>
5969 </Messages>
5970 </Member>
5971 <Member Name="getMesh():OpenSim.types.Mesh">
5972 <Messages>
5973 <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5974 <Issue Name="Member">
5975 <Item>getMesh</Item>
5976 </Issue>
5977 </Message>
5978 </Messages>
5979 </Member>
5980 <Member Name="getName():System.String">
5981 <Messages>
5982 <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
5983 <Issue Name="Member">
5984 <Item>getName</Item>
5985 </Issue>
5986 </Message>
5987 </Messages>
5988 </Member>
5989 <Member Name="localid">
5990 <Messages>
5991 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
5992 <Issue>
5993 <Item>localid</Item>
5994 </Issue>
5995 </Message>
5996 <Message Id="localid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
5997 <Issue Name="Member">
5998 <Item>localid</Item>
5999 <Item>Entity.localid</Item>
6000 </Issue>
6001 </Message>
6002 </Messages>
6003 </Member>
6004 <Member Name="name">
6005 <Messages>
6006 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6007 <Issue>
6008 <Item>name</Item>
6009 </Issue>
6010 </Message>
6011 </Messages>
6012 </Member>
6013 <Member Name="position">
6014 <Messages>
6015 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6016 <Issue>
6017 <Item>position</Item>
6018 </Issue>
6019 </Message>
6020 </Messages>
6021 </Member>
6022 <Member Name="rotation">
6023 <Messages>
6024 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6025 <Issue>
6026 <Item>rotation</Item>
6027 </Issue>
6028 </Message>
6029 </Messages>
6030 </Member>
6031 <Member Name="update():System.Void">
6032 <Messages>
6033 <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
6034 <Issue Name="Member">
6035 <Item>update</Item>
6036 </Issue>
6037 </Message>
6038 </Messages>
6039 </Member>
6040 <Member Name="uuid">
6041 <Messages>
6042 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6043 <Issue>
6044 <Item>uuid</Item>
6045 </Issue>
6046 </Message>
6047 <Message Id="uuid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6048 <Issue Name="Member">
6049 <Item>uuid</Item>
6050 <Item>Entity.uuid</Item>
6051 </Issue>
6052 </Message>
6053 </Messages>
6054 </Member>
6055 <Member Name="velocity">
6056 <Messages>
6057 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6058 <Issue>
6059 <Item>velocity</Item>
6060 </Issue>
6061 </Message>
6062 </Messages>
6063 </Member>
6064 </Members>
6065 </Type>
6066 <Type Name="NewForce">
6067 <Members>
6068 <Member Name="X">
6069 <Messages>
6070 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6071 <Issue>
6072 <Item>X</Item>
6073 </Issue>
6074 </Message>
6075 <Message Id="X" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6076 <Issue Name="MemberOneLetter">
6077 <Item>X</Item>
6078 <Item>NewForce.X</Item>
6079 </Issue>
6080 </Message>
6081 </Messages>
6082 </Member>
6083 <Member Name="Y">
6084 <Messages>
6085 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6086 <Issue>
6087 <Item>Y</Item>
6088 </Issue>
6089 </Message>
6090 <Message Id="Y" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6091 <Issue Name="MemberOneLetter">
6092 <Item>Y</Item>
6093 <Item>NewForce.Y</Item>
6094 </Issue>
6095 </Message>
6096 </Messages>
6097 </Member>
6098 <Member Name="Z">
6099 <Messages>
6100 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6101 <Issue>
6102 <Item>Z</Item>
6103 </Issue>
6104 </Message>
6105 <Message Id="Z" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6106 <Issue Name="MemberOneLetter">
6107 <Item>Z</Item>
6108 <Item>NewForce.Z</Item>
6109 </Issue>
6110 </Message>
6111 </Messages>
6112 </Member>
6113 </Members>
6114 </Type>
6115 <Type Name="Primitive">
6116 <Messages>
6117 <Message TypeName="IdentifiersShouldDifferByMoreThanCase" Category="Microsoft.Naming" CheckId="CA1708" Created="2007-03-27 04:29:04Z">
6118 <Issue Name="Member">
6119 <Item>'UpdateFlag'</Item>
6120 <Item>updateFlag</Item>
6121 </Issue>
6122 </Message>
6123 </Messages>
6124 <Members>
6125 <Member Name=".ctor()">
6126 <Messages>
6127 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
6128 <Issue>
6129 <Item>Primitive.Primitive()</Item>
6130 <Item>dirtyFlag</Item>
6131 <Item>System.Boolean</Item>
6132 <Item>false</Item>
6133 </Issue>
6134 <Issue>
6135 <Item>Primitive.Primitive()</Item>
6136 <Item>mesh_cutbegin</Item>
6137 <Item>System.Single</Item>
6138 <Item>0.0</Item>
6139 </Issue>
6140 <Issue>
6141 <Item>Primitive.Primitive()</Item>
6142 <Item>newPrimFlag</Item>
6143 <Item>System.Boolean</Item>
6144 <Item>false</Item>
6145 </Issue>
6146 <Issue>
6147 <Item>Primitive.Primitive()</Item>
6148 <Item>physicsEnabled</Item>
6149 <Item>System.Boolean</Item>
6150 <Item>false</Item>
6151 </Issue>
6152 <Issue>
6153 <Item>Primitive.Primitive()</Item>
6154 <Item>physicstest</Item>
6155 <Item>System.Boolean</Item>
6156 <Item>false</Item>
6157 </Issue>
6158 <Issue>
6159 <Item>Primitive.Primitive()</Item>
6160 <Item>updateFlag</Item>
6161 <Item>System.Boolean</Item>
6162 <Item>false</Item>
6163 </Issue>
6164 </Message>
6165 </Messages>
6166 </Member>
6167 <Member Name="CreateFromPacket(libsecondlife.Packets.ObjectAddPacket,libsecondlife.LLUUID,System.UInt32):System.Void">
6168 <Messages>
6169 <Message Id="localID-702000" TypeName="OperationsShouldNotOverflow" Category="Microsoft.Usage" CheckId="CA2233" Created="2007-03-27 04:29:04Z">
6170 <Issue>
6171 <Item>localID-702000</Item>
6172 <Item>Primitive.CreateFromPacket(ObjectAddPacket, LLUUID, UInt32):Void</Item>
6173 </Issue>
6174 </Message>
6175 <Message Id="1#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
6176 <Issue Name="ParameterId">
6177 <Item>ID</Item>
6178 <Item>agentID</Item>
6179 <Item>Id</Item>
6180 </Issue>
6181 </Message>
6182 <Message Id="2#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
6183 <Issue Name="ParameterId">
6184 <Item>ID</Item>
6185 <Item>localID</Item>
6186 <Item>Id</Item>
6187 </Issue>
6188 </Message>
6189 <Message Id="System.UInt32.ToString(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2007-03-27 04:29:04Z">
6190 <Issue>
6191 <Item>Primitive.CreateFromPacket(ObjectAddPacket, LLUUID, UInt32):Void</Item>
6192 <Item>System.UInt32.ToString(System.String)</Item>
6193 <Item>System.UInt32.ToString(System.String,System.IFormatProvider)</Item>
6194 </Issue>
6195 </Message>
6196 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6197 <Issue>
6198 <Item>'addPacket'</Item>
6199 <Item>Primitive.CreateFromPacket(ObjectAddPacket, LLUUID, UInt32):Void</Item>
6200 </Issue>
6201 </Message>
6202 </Messages>
6203 </Member>
6204 <Member Name="CreateFromStorage(OpenSim.Framework.Assets.PrimData):System.Void">
6205 <Messages>
6206 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6207 <Issue>
6208 <Item>'store'</Item>
6209 <Item>Primitive.CreateFromStorage(PrimData):Void</Item>
6210 </Issue>
6211 </Message>
6212 </Messages>
6213 </Member>
6214 <Member Name="dirtyFlag">
6215 <Messages>
6216 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6217 <Issue>
6218 <Item>dirtyFlag</Item>
6219 </Issue>
6220 </Message>
6221 </Messages>
6222 </Member>
6223 <Member Name="mesh_cutbegin">
6224 <Messages>
6225 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6226 <Issue>
6227 <Item>mesh_cutbegin</Item>
6228 </Issue>
6229 </Message>
6230 <Message Id="cutbegin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6231 <Issue Name="Member">
6232 <Item>cutbegin</Item>
6233 <Item>Primitive.mesh_cutbegin</Item>
6234 </Issue>
6235 </Message>
6236 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
6237 <Issue Name="Member">
6238 <Item>mesh_cutbegin</Item>
6239 </Issue>
6240 </Message>
6241 </Messages>
6242 </Member>
6243 <Member Name="mesh_cutend">
6244 <Messages>
6245 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6246 <Issue>
6247 <Item>mesh_cutend</Item>
6248 </Issue>
6249 </Message>
6250 <Message Id="cutend" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6251 <Issue Name="Member">
6252 <Item>cutend</Item>
6253 <Item>Primitive.mesh_cutend</Item>
6254 </Issue>
6255 </Message>
6256 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
6257 <Issue Name="Member">
6258 <Item>mesh_cutend</Item>
6259 </Issue>
6260 </Message>
6261 </Messages>
6262 </Member>
6263 <Member Name="newPrimFlag">
6264 <Messages>
6265 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6266 <Issue>
6267 <Item>newPrimFlag</Item>
6268 </Issue>
6269 </Message>
6270 </Messages>
6271 </Member>
6272 <Member Name="PhysActor">
6273 <Messages>
6274 <Message TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044" Created="2007-03-27 04:29:04Z">
6275 <Issue>
6276 <Item>PhysActor</Item>
6277 </Issue>
6278 </Message>
6279 </Messages>
6280 </Member>
6281 <Member Name="primData">
6282 <Messages>
6283 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6284 <Issue>
6285 <Item>primData</Item>
6286 </Issue>
6287 </Message>
6288 </Messages>
6289 </Member>
6290 <Member Name="UpdateClient(OpenSim.SimClient):System.Void">
6291 <Messages>
6292 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
6293 <Issue Name="Parameter">
6294 <Item>RemoteClient</Item>
6295 </Issue>
6296 </Message>
6297 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6298 <Issue>
6299 <Item>'RemoteClient'</Item>
6300 <Item>Primitive.UpdateClient(SimClient):Void</Item>
6301 </Issue>
6302 </Message>
6303 </Messages>
6304 </Member>
6305 <Member Name="updateFlag">
6306 <Messages>
6307 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6308 <Issue>
6309 <Item>updateFlag</Item>
6310 </Issue>
6311 </Message>
6312 </Messages>
6313 </Member>
6314 <Member Name="UpdateObjectFlags(libsecondlife.Packets.ObjectFlagUpdatePacket):System.Void">
6315 <Messages>
6316 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6317 <Issue>
6318 <Item>'pack'</Item>
6319 <Item>Primitive.UpdateObjectFlags(ObjectFlagUpdatePacket):Void</Item>
6320 </Issue>
6321 </Message>
6322 </Messages>
6323 </Member>
6324 <Member Name="UpdateShape(libsecondlife.Packets.ObjectShapePacket+ObjectDataBlock):System.Void">
6325 <Messages>
6326 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6327 <Issue>
6328 <Item>'addPacket'</Item>
6329 <Item>Primitive.UpdateShape(ObjectDataBlock):Void</Item>
6330 </Issue>
6331 </Message>
6332 </Messages>
6333 </Member>
6334 </Members>
6335 </Type>
6336 <Type Name="ScriptEngine">
6337 <Members>
6338 <Member Name=".ctor(OpenSim.world.World)">
6339 <Messages>
6340 <Message Id="0#env" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6341 <Issue Name="Parameter">
6342 <Item>ScriptEngine.ScriptEngine(World)</Item>
6343 <Item>env</Item>
6344 <Item>env</Item>
6345 </Issue>
6346 </Message>
6347 <Message Id="env" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
6348 <Issue>
6349 <Item>env</Item>
6350 <Item>ScriptEngine.ScriptEngine(World)</Item>
6351 </Issue>
6352 </Message>
6353 </Messages>
6354 </Member>
6355 <Member Name="LoadScript():System.Void">
6356 <Messages>
6357 <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
6358 <Issue>
6359 <Item>ScriptEngine.LoadScript():Void</Item>
6360 </Issue>
6361 </Message>
6362 </Messages>
6363 </Member>
6364 </Members>
6365 </Type>
6366 <Type Name="SurfacePatch">
6367 <Members>
6368 <Member Name="HeightMap">
6369 <Messages>
6370 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6371 <Issue>
6372 <Item>HeightMap</Item>
6373 </Issue>
6374 </Message>
6375 </Messages>
6376 </Member>
6377 </Members>
6378 </Type>
6379 <Type Name="World">
6380 <Messages>
6381 <Message TypeName="TypeNamesShouldNotMatchNamespaces" Category="Microsoft.Naming" CheckId="CA1724" Created="2007-03-27 04:29:04Z">
6382 <Issue>
6383 <Item>World</Item>
6384 <Item>OpenSim.world</Item>
6385 </Issue>
6386 </Message>
6387 </Messages>
6388 <Members>
6389 <Member Name=".ctor()">
6390 <Messages>
6391 <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2007-03-27 04:29:04Z">
6392 <Issue>
6393 <Item>World.World()</Item>
6394 <Item>_localNumber</Item>
6395 <Item>System.UInt32</Item>
6396 <Item>0</Item>
6397 </Issue>
6398 </Message>
6399 </Messages>
6400 </Member>
6401 <Member Name="_localNumber">
6402 <Messages>
6403 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6404 <Issue>
6405 <Item>_localNumber</Item>
6406 </Issue>
6407 </Message>
6408 <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2007-03-27 04:29:04Z">
6409 <Issue Name="Member">
6410 <Item>_localNumber</Item>
6411 </Issue>
6412 </Message>
6413 </Messages>
6414 </Member>
6415 <Member Name="AddNewPrim(libsecondlife.Packets.ObjectAddPacket,OpenSim.SimClient):System.Void">
6416 <Messages>
6417 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
6418 <Issue Name="Parameter">
6419 <Item>AgentClient</Item>
6420 </Issue>
6421 </Message>
6422 </Messages>
6423 </Member>
6424 <Member Name="AddViewerAgent(OpenSim.SimClient):System.Void">
6425 <Messages>
6426 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
6427 <Issue Name="Parameter">
6428 <Item>AgentClient</Item>
6429 </Issue>
6430 </Message>
6431 </Messages>
6432 </Member>
6433 <Member Name="DeRezObject(libsecondlife.Packets.DeRezObjectPacket,OpenSim.SimClient):System.Void">
6434 <Messages>
6435 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
6436 <Issue Name="Parameter">
6437 <Item>DeRezPacket</Item>
6438 </Issue>
6439 </Message>
6440 <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
6441 <Issue Name="Parameter">
6442 <Item>AgentClient</Item>
6443 </Issue>
6444 </Message>
6445 <Message Id="0#Rez" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6446 <Issue Name="Parameter">
6447 <Item>World.DeRezObject(DeRezObjectPacket, SimClient):Void</Item>
6448 <Item>Rez</Item>
6449 <Item>DeRezPacket</Item>
6450 </Issue>
6451 </Message>
6452 <Message Id="Rez" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6453 <Issue Name="Member">
6454 <Item>Rez</Item>
6455 <Item>World.DeRezObject(DeRezObjectPacket, SimClient):Void</Item>
6456 </Issue>
6457 </Message>
6458 <Message Id="AgentClient" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
6459 <Issue>
6460 <Item>AgentClient</Item>
6461 <Item>World.DeRezObject(DeRezObjectPacket, SimClient):Void</Item>
6462 </Issue>
6463 </Message>
6464 <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2007-03-27 04:29:04Z">
6465 <Issue Name="Member">
6466 <Item>De</Item>
6467 <Item>World.DeRezObject(DeRezObjectPacket, SimClient):Void</Item>
6468 </Issue>
6469 </Message>
6470 </Messages>
6471 </Member>
6472 <Member Name="Entities">
6473 <Messages>
6474 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6475 <Issue>
6476 <Item>Entities</Item>
6477 </Issue>
6478 </Message>
6479 </Messages>
6480 </Member>
6481 <Member Name="GetInitialPrims(OpenSim.SimClient):System.Void">
6482 <Messages>
6483 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
6484 <Issue Name="Parameter">
6485 <Item>RemoteClient</Item>
6486 </Issue>
6487 </Message>
6488 <Message Id="Prims" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6489 <Issue Name="Member">
6490 <Item>Prims</Item>
6491 <Item>World.GetInitialPrims(SimClient):Void</Item>
6492 </Issue>
6493 </Message>
6494 </Messages>
6495 </Member>
6496 <Member Name="LandMap">
6497 <Messages>
6498 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6499 <Issue>
6500 <Item>LandMap</Item>
6501 </Issue>
6502 </Message>
6503 </Messages>
6504 </Member>
6505 <Member Name="LoadPrimsFromStorage():System.Void">
6506 <Messages>
6507 <Message Id="Prims" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6508 <Issue Name="Member">
6509 <Item>Prims</Item>
6510 <Item>World.LoadPrimsFromStorage():Void</Item>
6511 </Issue>
6512 </Message>
6513 </Messages>
6514 </Member>
6515 <Member Name="LoadStorageDLL(System.String):System.Boolean">
6516 <Messages>
6517 <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
6518 <Issue Name="Member">
6519 <Item>World.LoadStorageDLL(String):Boolean</Item>
6520 </Issue>
6521 </Message>
6522 </Messages>
6523 </Member>
6524 <Member Name="localStorage">
6525 <Messages>
6526 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6527 <Issue>
6528 <Item>localStorage</Item>
6529 </Issue>
6530 </Message>
6531 </Messages>
6532 </Member>
6533 <Member Name="Rand">
6534 <Messages>
6535 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
6536 <Issue>
6537 <Item>World.Rand</Item>
6538 </Issue>
6539 </Message>
6540 </Messages>
6541 </Member>
6542 <Member Name="Scripts">
6543 <Messages>
6544 <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2007-03-27 04:29:04Z">
6545 <Issue>
6546 <Item>Scripts</Item>
6547 </Issue>
6548 </Message>
6549 </Messages>
6550 </Member>
6551 <Member Name="SendLayerData(OpenSim.SimClient):System.Void">
6552 <Messages>
6553 <Message Id="0#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2007-03-27 04:29:04Z">
6554 <Issue Name="Parameter">
6555 <Item>RemoteClient</Item>
6556 </Issue>
6557 </Message>
6558 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6559 <Issue>
6560 <Item>'RemoteClient'</Item>
6561 <Item>World.SendLayerData(SimClient):Void</Item>
6562 </Issue>
6563 <Issue>
6564 <Item>'RemoteClient'</Item>
6565 <Item>World.SendLayerData(SimClient):Void</Item>
6566 </Issue>
6567 <Issue>
6568 <Item>'RemoteClient'</Item>
6569 <Item>World.SendLayerData(SimClient):Void</Item>
6570 </Issue>
6571 </Message>
6572 </Messages>
6573 </Member>
6574 </Members>
6575 </Type>
6576 </Types>
6577 </Namespace>
6578 <Namespace Name="OpenSim.world.scripting">
6579 <Types>
6580 <Type Name="IScriptHost">
6581 <Members>
6582 <Member Name="Register(OpenSim.world.scripting.IScript):System.Boolean">
6583 <Messages>
6584 <Message Id="0#iscript" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6585 <Issue Name="Parameter">
6586 <Item>IScriptHost.Register(IScript):Boolean</Item>
6587 <Item>iscript</Item>
6588 <Item>iscript</Item>
6589 </Issue>
6590 </Message>
6591 </Messages>
6592 </Member>
6593 </Members>
6594 </Type>
6595 </Types>
6596 </Namespace>
6597 </Namespaces>
6598 </Module>
6599 </Modules>
6600 </Target>
6601 <Target Name="$(ProjectDir)/bin/OpenSim.Storage.LocalStorageDb4o.dll">
6602 <Modules>
6603 <Module Name="opensim.storage.localstoragedb4o.dll">
6604 <Messages>
6605 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
6606 <Issue>
6607 <Item>OpenSim.Storage.LocalStorageDb4o</Item>
6608 </Issue>
6609 </Message>
6610 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
6611 <Issue Name="NoStrongName">
6612 <Item>OpenSim.Storage.LocalStorageDb4o</Item>
6613 </Issue>
6614 </Message>
6615 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
6616 <Issue Name="NoAttr">
6617 <Item>OpenSim.Storage.LocalStorageDb4o</Item>
6618 </Issue>
6619 </Message>
6620 </Messages>
6621 <Namespaces>
6622 <Namespace Name="OpenSim.Storage.LocalStorageDb4o">
6623 <Types>
6624 <Type Name="Db4LocalStorage">
6625 <Members>
6626 <Member Name=".ctor()">
6627 <Messages>
6628 <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2007-03-27 04:29:04Z">
6629 <Issue>
6630 <Item>Db4LocalStorage.Db4LocalStorage()</Item>
6631 <Item>System.Exception</Item>
6632 </Issue>
6633 </Message>
6634 </Messages>
6635 </Member>
6636 <Member Name="LoadPrimitives(OpenSim.Framework.Interfaces.ILocalStorageReceiver):System.Void">
6637 <Messages>
6638 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6639 <Issue>
6640 <Item>'receiver'</Item>
6641 <Item>Db4LocalStorage.LoadPrimitives(ILocalStorageReceiver):Void</Item>
6642 </Issue>
6643 </Message>
6644 </Messages>
6645 </Member>
6646 <Member Name="StorePrim(OpenSim.Framework.Assets.PrimData):System.Void">
6647 <Messages>
6648 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6649 <Issue>
6650 <Item>'prim'</Item>
6651 <Item>Db4LocalStorage.StorePrim(PrimData):Void</Item>
6652 </Issue>
6653 </Message>
6654 </Messages>
6655 </Member>
6656 </Members>
6657 </Type>
6658 <Type Name="UUIDQuery">
6659 <Messages>
6660 <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2007-03-27 04:29:04Z">
6661 <Issue Name="Type">
6662 <Item>UUIDQuery</Item>
6663 </Issue>
6664 </Message>
6665 </Messages>
6666 <Members>
6667 <Member Name="Match(OpenSim.Framework.Assets.PrimData):System.Boolean">
6668 <Messages>
6669 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6670 <Issue>
6671 <Item>'prim'</Item>
6672 <Item>UUIDQuery.Match(PrimData):Boolean</Item>
6673 </Issue>
6674 </Message>
6675 </Messages>
6676 </Member>
6677 </Members>
6678 </Type>
6679 </Types>
6680 </Namespace>
6681 </Namespaces>
6682 </Module>
6683 </Modules>
6684 </Target>
6685 <Target Name="$(ProjectDir)/bin/Physics/OpenSim.Physics.BasicPhysicsPlugin.dll">
6686 <Modules>
6687 <Module Name="opensim.physics.basicphysicsplugin.dll">
6688 <Messages>
6689 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Status="Excluded" Created="2007-03-27 04:29:04Z">
6690 <Issue>
6691 <Item>OpenSim.Physics.BasicPhysicsPlugin</Item>
6692 </Issue>
6693 <Notes>
6694 <User Name="Stefan">
6695 <Note Id="2" />
6696 </User>
6697 </Notes>
6698 </Message>
6699 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Status="Excluded" Created="2007-03-27 04:29:04Z">
6700 <Issue Name="NoStrongName">
6701 <Item>OpenSim.Physics.BasicPhysicsPlugin</Item>
6702 </Issue>
6703 <Notes>
6704 <User Name="Stefan">
6705 <Note Id="0" />
6706 </User>
6707 </Notes>
6708 </Message>
6709 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Status="Excluded" Created="2007-03-27 04:29:04Z">
6710 <Issue Name="NoAttr">
6711 <Item>OpenSim.Physics.BasicPhysicsPlugin</Item>
6712 </Issue>
6713 <Notes>
6714 <User Name="Stefan">
6715 <Note Id="1" />
6716 </User>
6717 </Notes>
6718 </Message>
6719 </Messages>
6720 <Namespaces>
6721 <Namespace Name="OpenSim.Physics.BasicPhysicsPlugin">
6722 <Types>
6723 <Type Name="BasicActor">
6724 <Members>
6725 <Member Name="flying">
6726 <Messages>
6727 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
6728 <Issue>
6729 <Item>BasicActor.flying</Item>
6730 </Issue>
6731 </Message>
6732 </Messages>
6733 </Member>
6734 <Member Name="SetAcceleration(OpenSim.Physics.Manager.PhysicsVector):System.Void">
6735 <Messages>
6736 <Message Id="0#accel" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6737 <Issue Name="Parameter">
6738 <Item>BasicActor.SetAcceleration(PhysicsVector):Void</Item>
6739 <Item>accel</Item>
6740 <Item>accel</Item>
6741 </Issue>
6742 </Message>
6743 </Messages>
6744 </Member>
6745 </Members>
6746 </Type>
6747 <Type Name="BasicPhysicsPlugin">
6748 <Messages>
6749 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6750 <Issue Name="Type">
6751 <Item>Plugin</Item>
6752 <Item>OpenSim.Physics.BasicPhysicsPlugin.BasicPhysicsPlugin</Item>
6753 </Issue>
6754 </Message>
6755 <Message TypeName="TypeNamesShouldNotMatchNamespaces" Category="Microsoft.Naming" CheckId="CA1724" Created="2007-03-27 04:29:04Z">
6756 <Issue>
6757 <Item>BasicPhysicsPlugin</Item>
6758 <Item>OpenSim.Physics.BasicPhysicsPlugin</Item>
6759 </Issue>
6760 </Message>
6761 </Messages>
6762 </Type>
6763 </Types>
6764 </Namespace>
6765 </Namespaces>
6766 </Module>
6767 </Modules>
6768 </Target>
6769 <Target Name="$(ProjectDir)/bin/Physics/OpenSim.Physics.OdePlugin.dll">
6770 <Modules>
6771 <Module Name="opensim.physics.odeplugin.dll">
6772 <Messages>
6773 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
6774 <Issue>
6775 <Item>OpenSim.Physics.OdePlugin</Item>
6776 </Issue>
6777 </Message>
6778 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
6779 <Issue Name="NoStrongName">
6780 <Item>OpenSim.Physics.OdePlugin</Item>
6781 </Issue>
6782 </Message>
6783 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
6784 <Issue Name="NoAttr">
6785 <Item>OpenSim.Physics.OdePlugin</Item>
6786 </Issue>
6787 </Message>
6788 </Messages>
6789 <Namespaces>
6790 <Namespace Name="OpenSim.Physics.OdePlugin">
6791 <Types>
6792 <Type Name="OdeCharacter">
6793 <Messages>
6794 <Message TypeName="TypesThatOwnNativeResourcesShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1049" Created="2007-03-27 04:29:04Z">
6795 <Issue>
6796 <Item>OdeCharacter</Item>
6797 </Issue>
6798 </Message>
6799 </Messages>
6800 <Members>
6801 <Member Name=".ctor(OpenSim.Physics.OdePlugin.OdeScene,OpenSim.Physics.Manager.PhysicsVector)">
6802 <Messages>
6803 <Message Id="parent_scene" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2007-03-27 04:29:04Z" FixCategory="Breaking">
6804 <Issue>
6805 <Item>parent_scene</Item>
6806 <Item>OdeCharacter.OdeCharacter(OdeScene, PhysicsVector)</Item>
6807 </Issue>
6808 </Message>
6809 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6810 <Issue>
6811 <Item>'pos'</Item>
6812 <Item>OdeCharacter.OdeCharacter(OdeScene, PhysicsVector)</Item>
6813 </Issue>
6814 </Message>
6815 </Messages>
6816 </Member>
6817 <Member Name="capsule_geom">
6818 <Messages>
6819 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
6820 <Issue>
6821 <Item>OdeCharacter.capsule_geom</Item>
6822 </Issue>
6823 </Message>
6824 </Messages>
6825 </Member>
6826 <Member Name="gravityAccel">
6827 <Messages>
6828 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
6829 <Issue>
6830 <Item>OdeCharacter.gravityAccel</Item>
6831 </Issue>
6832 </Message>
6833 </Messages>
6834 </Member>
6835 <Member Name="SetAcceleration(OpenSim.Physics.Manager.PhysicsVector):System.Void">
6836 <Messages>
6837 <Message Id="0#accel" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6838 <Issue Name="Parameter">
6839 <Item>OdeCharacter.SetAcceleration(PhysicsVector):Void</Item>
6840 <Item>accel</Item>
6841 <Item>accel</Item>
6842 </Issue>
6843 </Message>
6844 </Messages>
6845 </Member>
6846 </Members>
6847 </Type>
6848 <Type Name="OdePlugin">
6849 <Messages>
6850 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6851 <Issue Name="Type">
6852 <Item>Plugin</Item>
6853 <Item>OpenSim.Physics.OdePlugin.OdePlugin</Item>
6854 </Issue>
6855 </Message>
6856 <Message TypeName="TypeNamesShouldNotMatchNamespaces" Category="Microsoft.Naming" CheckId="CA1724" Created="2007-03-27 04:29:04Z">
6857 <Issue>
6858 <Item>OdePlugin</Item>
6859 <Item>OpenSim.Physics.OdePlugin</Item>
6860 </Issue>
6861 </Message>
6862 </Messages>
6863 </Type>
6864 <Type Name="OdePrim">
6865 <Members>
6866 <Member Name="_position">
6867 <Messages>
6868 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
6869 <Issue>
6870 <Item>OdePrim._position</Item>
6871 </Issue>
6872 </Message>
6873 </Messages>
6874 </Member>
6875 <Member Name="SetAcceleration(OpenSim.Physics.Manager.PhysicsVector):System.Void">
6876 <Messages>
6877 <Message Id="0#accel" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
6878 <Issue Name="Parameter">
6879 <Item>OdePrim.SetAcceleration(PhysicsVector):Void</Item>
6880 <Item>accel</Item>
6881 <Item>accel</Item>
6882 </Issue>
6883 </Message>
6884 </Messages>
6885 </Member>
6886 </Members>
6887 </Type>
6888 <Type Name="OdeScene">
6889 <Members>
6890 <Member Name="AddPrim(OpenSim.Physics.Manager.PhysicsVector,OpenSim.Physics.Manager.PhysicsVector):OpenSim.Physics.Manager.PhysicsActor">
6891 <Messages>
6892 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6893 <Issue>
6894 <Item>'position'</Item>
6895 <Item>OdeScene.AddPrim(PhysicsVector, PhysicsVector):PhysicsActor</Item>
6896 </Issue>
6897 <Issue>
6898 <Item>'size'</Item>
6899 <Item>OdeScene.AddPrim(PhysicsVector, PhysicsVector):PhysicsActor</Item>
6900 </Issue>
6901 </Message>
6902 </Messages>
6903 </Member>
6904 <Member Name="Land">
6905 <Messages>
6906 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
6907 <Issue>
6908 <Item>OdeScene.Land</Item>
6909 </Issue>
6910 </Message>
6911 </Messages>
6912 </Member>
6913 <Member Name="LandGeom">
6914 <Messages>
6915 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
6916 <Issue>
6917 <Item>OdeScene.LandGeom</Item>
6918 </Issue>
6919 </Message>
6920 </Messages>
6921 </Member>
6922 <Member Name="SetTerrain(System.Single[]):System.Void">
6923 <Messages>
6924 <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2007-03-27 04:29:04Z">
6925 <Issue>
6926 <Item>'heightMap'</Item>
6927 <Item>OdeScene.SetTerrain(Single[]):Void</Item>
6928 </Issue>
6929 <Issue>
6930 <Item>'heightMap'</Item>
6931 <Item>OdeScene.SetTerrain(Single[]):Void</Item>
6932 </Issue>
6933 </Message>
6934 </Messages>
6935 </Member>
6936 <Member Name="space">
6937 <Messages>
6938 <Message TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211" Created="2007-03-27 04:29:04Z">
6939 <Issue>
6940 <Item>space</Item>
6941 </Issue>
6942 </Message>
6943 <Message TypeName="PointersShouldNotBeVisible" Category="Microsoft.Security" CheckId="CA2111" Created="2007-03-27 04:29:04Z">
6944 <Issue>
6945 <Item>space</Item>
6946 </Issue>
6947 </Message>
6948 </Messages>
6949 </Member>
6950 <Member Name="world">
6951 <Messages>
6952 <Message TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211" Created="2007-03-27 04:29:04Z">
6953 <Issue>
6954 <Item>world</Item>
6955 </Issue>
6956 </Message>
6957 <Message TypeName="PointersShouldNotBeVisible" Category="Microsoft.Security" CheckId="CA2111" Created="2007-03-27 04:29:04Z">
6958 <Issue>
6959 <Item>world</Item>
6960 </Issue>
6961 </Message>
6962 </Messages>
6963 </Member>
6964 </Members>
6965 </Type>
6966 </Types>
6967 </Namespace>
6968 </Namespaces>
6969 </Module>
6970 </Modules>
6971 </Target>
6972 <Target Name="$(ProjectDir)/bin/Physics/OpenSim.Physics.PhysXPlugin.dll">
6973 <Modules>
6974 <Module Name="opensim.physics.physxplugin.dll">
6975 <Messages>
6976 <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2007-03-27 04:29:04Z">
6977 <Issue>
6978 <Item>OpenSim.Physics.PhysXPlugin</Item>
6979 </Issue>
6980 </Message>
6981 <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2007-03-27 04:29:04Z">
6982 <Issue Name="NoStrongName">
6983 <Item>OpenSim.Physics.PhysXPlugin</Item>
6984 </Issue>
6985 </Message>
6986 <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2007-03-27 04:29:04Z">
6987 <Issue Name="NoAttr">
6988 <Item>OpenSim.Physics.PhysXPlugin</Item>
6989 </Issue>
6990 </Message>
6991 </Messages>
6992 <Namespaces>
6993 <Namespace Name="OpenSim.Physics.PhysXPlugin">
6994 <Types>
6995 <Type Name="PhysXCharacter">
6996 <Members>
6997 <Member Name="SetAcceleration(OpenSim.Physics.Manager.PhysicsVector):System.Void">
6998 <Messages>
6999 <Message Id="0#accel" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
7000 <Issue Name="Parameter">
7001 <Item>PhysXCharacter.SetAcceleration(PhysicsVector):Void</Item>
7002 <Item>accel</Item>
7003 <Item>accel</Item>
7004 </Issue>
7005 </Message>
7006 </Messages>
7007 </Member>
7008 </Members>
7009 </Type>
7010 <Type Name="PhysXPlugin">
7011 <Messages>
7012 <Message Id="Plugin" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
7013 <Issue Name="Type">
7014 <Item>Plugin</Item>
7015 <Item>OpenSim.Physics.PhysXPlugin.PhysXPlugin</Item>
7016 </Issue>
7017 </Message>
7018 <Message TypeName="TypeNamesShouldNotMatchNamespaces" Category="Microsoft.Naming" CheckId="CA1724" Created="2007-03-27 04:29:04Z">
7019 <Issue>
7020 <Item>PhysXPlugin</Item>
7021 <Item>OpenSim.Physics.PhysXPlugin</Item>
7022 </Issue>
7023 </Message>
7024 </Messages>
7025 </Type>
7026 <Type Name="PhysXPrim">
7027 <Members>
7028 <Member Name="_position">
7029 <Messages>
7030 <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2007-03-27 04:29:04Z">
7031 <Issue>
7032 <Item>PhysXPrim._position</Item>
7033 </Issue>
7034 </Message>
7035 </Messages>
7036 </Member>
7037 <Member Name="SetAcceleration(OpenSim.Physics.Manager.PhysicsVector):System.Void">
7038 <Messages>
7039 <Message Id="0#accel" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2007-03-27 04:29:04Z">
7040 <Issue Name="Parameter">
7041 <Item>PhysXPrim.SetAcceleration(PhysicsVector):Void</Item>
7042 <Item>accel</Item>
7043 <Item>accel</Item>
7044 </Issue>
7045 </Message>
7046 </Messages>
7047 </Member>
7048 </Members>
7049 </Type>
7050 </Types>
7051 </Namespace>
7052 </Namespaces>
7053 </Module>
7054 </Modules>
7055 </Target>
7056 </Targets>
7057 <Notes>
7058 <User Name="Stefan">
7059 <Note Id="0" Modified="2007-03-27 04:30:24Z">Save it for a rainy day.</Note>
7060 <Note Id="1" Modified="2007-03-27 04:30:31Z">Save it for a rainy day.</Note>
7061 <Note Id="2" Modified="2007-03-27 04:30:38Z">Save it for a rainy day.</Note>
7062 </User>
7063 </Notes>
7064 <Rules>
7065 <Rule TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209">
7066 <Resolution Name="Default">No valid permission requests were found for assembly '{0}'. You should always specify the minimum security permissions using SecurityAction.RequestMinimum.</Resolution>
7067 </Rule>
7068 <Rule TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210">
7069 <Resolution Name="NoStrongName">Sign '{0}' with a strong name key.</Resolution>
7070 </Rule>
7071 <Rule TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020">
7072 <Resolution Name="Default">Consider merging the types defined in '{0}' with another namespace.</Resolution>
7073 </Rule>
7074 <Rule TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823">
7075 <Resolution Name="Default">It appears that field '{0}' is never used or is only ever assigned to. Use this field or remove it.</Resolution>
7076 </Rule>
7077 <Rule TypeName="CollectionPropertiesShouldBeReadOnly" Category="Microsoft.Usage" CheckId="CA2227">
7078 <Resolution Name="Default">Change '{0}' to be read-only by removing the property setter.</Resolution>
7079 </Rule>
7080 <Rule TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702">
7081 <Resolution Name="ShouldBeDiscreteTerm">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}'.</Resolution>
7082 </Rule>
7083 <Rule TypeName="ComVisibleTypeBaseTypesShouldBeComVisible" Category="Microsoft.Interoperability" CheckId="CA1405">
7084 <Resolution Name="Default">'{0}' is marked ComVisible(true) but has the following ComVisible(false) types in its object hierarchy: {1}</Resolution>
7085 </Rule>
7086 <Rule TypeName="ConsiderPassingBaseTypesAsParameters" Category="Microsoft.Design" CheckId="CA1011">
7087 <Resolution Name="Default">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.</Resolution>
7088 </Rule>
7089 <Rule TypeName="DoNotCallOverridableMethodsInConstructors" Category="Microsoft.Usage" CheckId="CA2214">
7090 <Resolution Name="Default">'{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}</Resolution>
7091 </Rule>
7092 <Rule TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031">
7093 <Resolution Name="Default">Modify '{0}' to catch a more specific exception than '{1}' or rethrow the exception.</Resolution>
7094 </Rule>
7095 <Rule TypeName="DoNotDeclareReadOnlyMutableReferenceTypes" Category="Microsoft.Security" CheckId="CA2104">
7096 <Resolution Name="Default">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.</Resolution>
7097 </Rule>
7098 <Rule TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051">
7099 <Resolution Name="Default">Make '{0}' private or internal (Friend in VB, public private in C++) and provide a public or protected property to access it.</Resolution>
7100 </Rule>
7101 <Rule TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002">
7102 <Resolution Name="Default">Change '{0}' in {1} to use Collection&lt;T&gt;, ReadOnlyCollection&lt;T&gt; or KeyedCollection&lt;K,V&gt;</Resolution>
7103 </Rule>
7104 <Rule TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805">
7105 <Resolution Name="Default">{0} initializes field {1} of type {2} to {3}. Remove this initialization as it will be done automatically by the runtime.</Resolution>
7106 </Rule>
7107 <Rule TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303">
7108 <Resolution Name="Default">{0} passes a literal as parameter {1} of a call to {2}. Retrieve the following string argument from a resource table instead: '{3}'</Resolution>
7109 </Rule>
7110 <Rule TypeName="DoNotPassTypesByReference" Category="Microsoft.Design" CheckId="CA1045">
7111 <Resolution Name="Default">Consider a design that does not require that '{0}' be a reference parameter.</Resolution>
7112 </Rule>
7113 <Rule TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201">
7114 <Resolution Name="TooGeneric">{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.</Resolution>
7115 </Rule>
7116 <Rule TypeName="DoNotUseTimersThatPreventPowerStateChanges" Category="Microsoft.Mobility" CheckId="CA1601">
7117 <Resolution Name="Default">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.</Resolution>
7118 </Rule>
7119 <Rule TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709">
7120 <Resolution Name="Member">Correct the casing of member name '{0}'.</Resolution>
7121 <Resolution Name="Namespace">Correct the casing of namespace name '{0}'.</Resolution>
7122 <Resolution Name="Parameter">Correct the casing of parameter name '{0}'.</Resolution>
7123 <Resolution Name="Type">Correct the casing of type name '{0}'.</Resolution>
7124 </Rule>
7125 <Rule TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704">
7126 <Resolution Name="Member">Correct the spelling of the unrecognized token '{0}' in member name '{1}'.</Resolution>
7127 <Resolution Name="MemberOneLetter">Consider providing a more meaningful name than the one-letter token '{0}' in member name '{1}'.</Resolution>
7128 <Resolution Name="Namespace">Correct the spelling of the unrecognized token '{0}' in namespace '{1}'.</Resolution>
7129 <Resolution Name="Parameter">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.</Resolution>
7130 <Resolution Name="ParameterOneLetter">In method {0}, consider providing a more meaningful name than the one-letter parameter name '{1}'.</Resolution>
7131 <Resolution Name="Type">Correct the spelling of the unrecognized token '{0}' in type name '{1}'.</Resolution>
7132 </Rule>
7133 <Rule TypeName="IdentifiersShouldDifferByMoreThanCase" Category="Microsoft.Naming" CheckId="CA1708">
7134 <Resolution Name="Member">Change member names {0} and '{1}' so that they differ by more than case.</Resolution>
7135 </Rule>
7136 <Rule TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707">
7137 <Resolution Name="Member">Remove all underscores from member '{0}'.</Resolution>
7138 <Resolution Name="Parameter">Remove all underscores from parameter '{0}'.</Resolution>
7139 <Resolution Name="Type">Remove all underscores from type '{0}'.</Resolution>
7140 </Rule>
7141 <Rule TypeName="IdentifiersShouldNotHaveIncorrectSuffix" Category="Microsoft.Naming" CheckId="CA1711">
7142 <Resolution Name="Default">Rename '{0}' so that it does not end in '{1}'.</Resolution>
7143 </Rule>
7144 <Rule TypeName="LiteralsShouldBeSpelledCorrectly" Category="Microsoft.Usage" CheckId="CA2204">
7145 <Resolution Name="Default">Correct the spelling of the unrecognized token '{0}' in the literal '{1}'.</Resolution>
7146 </Rule>
7147 <Rule TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705">
7148 <Resolution Name="Member">Correct the capitalization of member name '{0}'.</Resolution>
7149 <Resolution Name="Namespace">Correct the capitalization of namespace name '{0}'.</Resolution>
7150 <Resolution Name="Parameter">Correct the capitalization of parameter name '{0}'.</Resolution>
7151 <Resolution Name="Type">Correct the capitalization of type name '{0}'.</Resolution>
7152 </Rule>
7153 <Rule TypeName="MarkAssembliesWithAssemblyVersion" Category="Microsoft.Design" CheckId="CA1016">
7154 <Resolution Name="Default">Add an AssemblyVersion attribute to '{0}'.</Resolution>
7155 </Rule>
7156 <Rule TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014">
7157 <Resolution Name="NoAttr">'{0}' should be marked with CLSCompliantAttribute and its value should be true.</Resolution>
7158 </Rule>
7159 <Rule TypeName="MarkAssembliesWithComVisible" Category="Microsoft.Design" CheckId="CA1017">
7160 <Resolution Name="NoAttribute">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).</Resolution>
7161 </Rule>
7162 <Rule TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822">
7163 <Resolution Name="Default">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.</Resolution>
7164 </Rule>
7165 <Rule TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211">
7166 <Resolution Name="Default">Consider making '{0}' non-public or a constant.</Resolution>
7167 </Rule>
7168 <Rule TypeName="OperationsShouldNotOverflow" Category="Microsoft.Usage" CheckId="CA2233">
7169 <Resolution Name="Default">Correct the potential overflow in the operation '{0}' in '{1}'.</Resolution>
7170 </Rule>
7171 <Rule TypeName="OperatorOverloadsHaveNamedAlternates" Category="Microsoft.Usage" CheckId="CA2225">
7172 <Resolution Name="Default">Provide a method named '{0}' as a friendly alternate for operator {1}.</Resolution>
7173 </Rule>
7174 <Rule TypeName="OverloadOperatorEqualsOnOverloadingAddAndSubtract" Category="Microsoft.Design" CheckId="CA1013">
7175 <Resolution Name="Default">Consider adding an overload of the equality operator for '{0}' that takes the same parameters as {1}.</Resolution>
7176 </Rule>
7177 <Rule TypeName="OverrideEqualsAndOperatorEqualsOnValueTypes" Category="Microsoft.Performance" CheckId="CA1815">
7178 <Resolution Name="Equals">'{0}' should override Equals.</Resolution>
7179 <Resolution Name="op_Equality">'{0}' should override the equality (==) and inequality (!=) operators.</Resolution>
7180 </Rule>
7181 <Rule TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725">
7182 <Resolution Name="Default">Change parameter name '{0}' of method {1} to '{2}' in order to match the identifier as it has been declared in {3}.</Resolution>
7183 </Rule>
7184 <Rule TypeName="PassSystemUriObjectsInsteadOfStrings" Category="Microsoft.Usage" CheckId="CA2234">
7185 <Resolution Name="Default">Modify {0} to call {1} instead of {2}.</Resolution>
7186 </Rule>
7187 <Rule TypeName="PointersShouldNotBeVisible" Category="Microsoft.Security" CheckId="CA2111">
7188 <Resolution Name="Default">Make '{0}' private.</Resolution>
7189 </Rule>
7190 <Rule TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044">
7191 <Resolution Name="Default">Add a property getter to '{0}'.</Resolution>
7192 </Rule>
7193 <Rule TypeName="RemoveUnusedLocals" Category="Microsoft.Performance" CheckId="CA1804">
7194 <Resolution Name="Default">{0} declares a local, '{1}', of type {2}, which is never used or is only assigned to. Use this local or remove it.</Resolution>
7195 </Rule>
7196 <Rule TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801">
7197 <Resolution Name="Default">Parameter '{0}' of {1} is never used. Remove the parameter or use it in the method body.</Resolution>
7198 </Rule>
7199 <Rule TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706">
7200 <Resolution Name="Member">Correct the capitalization of '{0}' in member name '{1}'.</Resolution>
7201 <Resolution Name="MemberId">'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'.</Resolution>
7202 <Resolution Name="ParameterId">'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}'.</Resolution>
7203 <Resolution Name="Type">Correct the capitalization of '{0}' in type name '{1}'.</Resolution>
7204 </Rule>
7205 <Rule TypeName="SpecifyCultureInfo" Category="Microsoft.Globalization" CheckId="CA1304">
7206 <Resolution Name="Default">{0} makes a call to {1} that does not explicitly provide a CultureInfo. This should be replaced with a call to {2}.</Resolution>
7207 </Rule>
7208 <Rule TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305">
7209 <Resolution Name="Default">{0} makes a call to {1} that does not explicitly provide an IFormatProvider. This should be replaced with a call to {2}.</Resolution>
7210 </Rule>
7211 <Rule TypeName="StaticHolderTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1053">
7212 <Resolution Name="Default">Remove the public constructors from '{0}'.</Resolution>
7213 </Rule>
7214 <Rule TypeName="TestForEmptyStringsUsingStringLength" Category="Microsoft.Performance" CheckId="CA1820">
7215 <Resolution Name="IsNullOrEmpty">Replace the call to String.{0}({1}) in '{2}' with a call to String.IsNullOrEmpty.</Resolution>
7216 </Rule>
7217 <Rule TypeName="TypeNamesShouldNotMatchNamespaces" Category="Microsoft.Naming" CheckId="CA1724">
7218 <Resolution Name="Default">The type name '{0}' conflicts in whole or in part with the namespace name '{1}'. Change either name to eliminate the conflict.</Resolution>
7219 </Rule>
7220 <Rule TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001">
7221 <Resolution Name="Default">Implement IDisposable on '{0}' as it instantiates members of the following IDisposable types: {1}</Resolution>
7222 </Rule>
7223 <Rule TypeName="TypesThatOwnNativeResourcesShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1049">
7224 <Resolution Name="Default">Implement IDisposable on '{0}'.</Resolution>
7225 </Rule>
7226 <Rule TypeName="UriParametersShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1054">
7227 <Resolution Name="Default">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.</Resolution>
7228 </Rule>
7229 <Rule TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726">
7230 <Resolution Name="Member">Replace the term '{0}' in member name '{1}' with the preferred alternate '{2}'.</Resolution>
7231 <Resolution Name="Type">Replace the term '{0}' in type name '{1}' with the preferred alternate '{2}'.</Resolution>
7232 </Rule>
7233 <Rule TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024">
7234 <Resolution Name="Default">Change '{0}' to a property if appropriate.</Resolution>
7235 </Rule>
7236 <Rule TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062">
7237 <Resolution Name="Default">Validate parameter {0} passed to externally visible method {1}.</Resolution>
7238 </Rule>
7239 </Rules>
7240 </FxCopReport>
7241</FxCopProject>
diff --git a/OpenSim.build b/OpenSim.build
new file mode 100644
index 0000000..51168a1
--- /dev/null
+++ b/OpenSim.build
@@ -0,0 +1,118 @@
1<?xml version="1.0" ?>
2<project name="OpenSim" default="build">
3 <echo message="Using '${nant.settings.currentframework}' Framework"/>
4
5 <property name="bin.dir" value="bin" />
6 <property name="obj.dir" value="obj" />
7 <property name="doc.dir" value="doc" />
8 <property name="project.main.dir" value="${project::get-base-directory()}" />
9
10 <target name="Debug" description="">
11 <property name="project.config" value="Debug" />
12 <property name="build.debug" value="true" />
13 </target>
14
15 <property name="project.config" value="Release" />
16
17 <target name="Release" description="">
18 <property name="project.config" value="Release" />
19 <property name="build.debug" value="false" />
20 </target>
21
22 <target name="net-1.1" description="Sets framework to .NET 1.1">
23 <property name="nant.settings.currentframework" value="net-1.1" />
24 </target>
25
26 <target name="net-2.0" description="Sets framework to .NET 2.0">
27 <property name="nant.settings.currentframework" value="net-2.0" />
28 </target>
29
30 <target name="mono-2.0" description="Sets framework to mono 2.0">
31 <property name="nant.settings.currentframework" value="mono-2.0" />
32 </target>
33
34 <target name="mono-1.0" description="Sets framework to mono 1.0">
35 <property name="nant.settings.currentframework" value="mono-1.0" />
36 </target>
37
38 <target name="init" description="">
39 <call target="${project.config}" />
40 <sysinfo />
41 <echo message="Platform ${sys.os.platform}" />
42 <property name="build.dir" value="${bin.dir}/${project.config}" />
43 </target>
44
45 <target name="clean" description="">
46 <echo message="Deleting all builds from all configurations" />
47 <delete dir="${bin.dir}" failonerror="false" />
48 <delete dir="${obj.dir}" failonerror="false" />
49 <nant buildfile="OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build" target="clean" />
50 <nant buildfile="OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build" target="clean" />
51 <nant buildfile="OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build" target="clean" />
52 <nant buildfile="Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build" target="clean" />
53 <nant buildfile="OpenSim/OpenSim/OpenSim.exe.build" target="clean" />
54 <nant buildfile="OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build" target="clean" />
55 <nant buildfile="Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build" target="clean" />
56 <nant buildfile="OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build" target="clean" />
57 <nant buildfile="OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build" target="clean" />
58 <nant buildfile="OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="clean" />
59 <nant buildfile="OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="clean" />
60 <nant buildfile="Common/OpenSim.Framework/OpenSim.Framework.dll.build" target="clean" />
61 <nant buildfile="Common/OpenSim.Servers/OpenSim.Servers.dll.build" target="clean" />
62 <nant buildfile="OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="clean" />
63 <nant buildfile="OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build" target="clean" />
64 <nant buildfile="OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build" target="clean" />
65 <nant buildfile="OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="clean" />
66 <nant buildfile="Common/XmlRpcCS/XMLRPC.dll.build" target="clean" />
67 </target>
68
69 <target name="build" depends="init" description="">
70 <nant buildfile="Common/XmlRpcCS/XMLRPC.dll.build" target="build" />
71 <nant buildfile="Common/OpenSim.Framework/OpenSim.Framework.dll.build" target="build" />
72 <nant buildfile="Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build" target="build" />
73 <nant buildfile="Common/OpenSim.Servers/OpenSim.Servers.dll.build" target="build" />
74 <nant buildfile="OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="build" />
75 <nant buildfile="OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build" target="build" />
76 <nant buildfile="OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build" target="build" />
77 <nant buildfile="OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="build" />
78 <nant buildfile="OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="build" />
79 <nant buildfile="OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build" target="build" />
80 <nant buildfile="OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build" target="build" />
81 <nant buildfile="OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="build" />
82 <nant buildfile="OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build" target="build" />
83 <nant buildfile="Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build" target="build" />
84 <nant buildfile="OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build" target="build" />
85 <nant buildfile="OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build" target="build" />
86 <nant buildfile="OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build" target="build" />
87 <nant buildfile="OpenSim/OpenSim/OpenSim.exe.build" target="build" />
88 </target>
89
90 <target name="build-release" depends="Release, init, build" description="Builds in Release mode" />
91
92 <target name="build-debug" depends="Debug, init, build" description="Builds in Debug mode" />
93
94 <target name="package" depends="clean, doc" description="Builds all" />
95
96 <target name="doc" depends="build-release">
97 <echo message="Generating all documentation from all builds" />
98 <nant buildfile="OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build" target="doc" />
99 <nant buildfile="OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build" target="doc" />
100 <nant buildfile="OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build" target="doc" />
101 <nant buildfile="Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build" target="doc" />
102 <nant buildfile="OpenSim/OpenSim/OpenSim.exe.build" target="doc" />
103 <nant buildfile="OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build" target="doc" />
104 <nant buildfile="Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build" target="doc" />
105 <nant buildfile="OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build" target="doc" />
106 <nant buildfile="OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build" target="doc" />
107 <nant buildfile="OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="doc" />
108 <nant buildfile="OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="doc" />
109 <nant buildfile="Common/OpenSim.Framework/OpenSim.Framework.dll.build" target="doc" />
110 <nant buildfile="Common/OpenSim.Servers/OpenSim.Servers.dll.build" target="doc" />
111 <nant buildfile="OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="doc" />
112 <nant buildfile="OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build" target="doc" />
113 <nant buildfile="OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build" target="doc" />
114 <nant buildfile="OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="doc" />
115 <nant buildfile="Common/XmlRpcCS/XMLRPC.dll.build" target="doc" />
116 </target>
117
118</project>
diff --git a/OpenSim.sln b/OpenSim.sln
new file mode 100644
index 0000000..4ad8e63
--- /dev/null
+++ b/OpenSim.sln
@@ -0,0 +1,121 @@
1Microsoft Visual Studio Solution File, Format Version 9.00
2# Visual C# Express 2005
3Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Terrain.BasicTerrain", "OpenSim\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj", "{2270B8FE-0000-0000-0000-000000000000}"
4EndProject
5Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageBerkeleyDB", "OpenSim\OpenSim.Storage\LocalStorageBerkeleyDB\OpenSim.Storage.LocalStorageBerkeleyDB.csproj", "{EE9E5D96-0000-0000-0000-000000000000}"
6EndProject
7Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.OdePlugin", "OpenSim\OpenSim.Physics\OdePlugin\OpenSim.Physics.OdePlugin.csproj", "{63A05FE9-0000-0000-0000-000000000000}"
8EndProject
9Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Console", "Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj", "{A7CD0630-0000-0000-0000-000000000000}"
10EndProject
11Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim\OpenSim\OpenSim.csproj", "{438A9556-0000-0000-0000-000000000000}"
12EndProject
13Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.RegionServer", "OpenSim\OpenSim.RegionServer\OpenSim.RegionServer.csproj", "{632E1BFD-0000-0000-0000-000000000000}"
14EndProject
15Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.GenericConfig.Xml", "Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj", "{E88EF749-0000-0000-0000-000000000000}"
16EndProject
17Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.Manager", "OpenSim\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj", "{8BE16150-0000-0000-0000-000000000000}"
18EndProject
19Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.BasicPhysicsPlugin", "OpenSim\OpenSim.Physics\BasicPhysicsPlugin\OpenSim.Physics.BasicPhysicsPlugin.csproj", "{4F874463-0000-0000-0000-000000000000}"
20EndProject
21Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.PhysXPlugin", "OpenSim\OpenSim.Physics\PhysXPlugin\OpenSim.Physics.PhysXPlugin.csproj", "{988F0AC4-0000-0000-0000-000000000000}"
22EndProject
23Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.GridInterfaces.Remote", "OpenSim\OpenSim.GridInterfaces\Remote\OpenSim.GridInterfaces.Remote.csproj", "{B55C0B5D-0000-0000-0000-000000000000}"
24EndProject
25Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework", "Common\OpenSim.Framework\OpenSim.Framework.csproj", "{8ACA2445-0000-0000-0000-000000000000}"
26EndProject
27Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Servers", "Common\OpenSim.Servers\OpenSim.Servers.csproj", "{8BB20F0A-0000-0000-0000-000000000000}"
28EndProject
29Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageDb4o", "OpenSim\OpenSim.Storage\LocalStorageDb4o\OpenSim.Storage.LocalStorageDb4o.csproj", "{E1B79ECF-0000-0000-0000-000000000000}"
30EndProject
31Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageSQLite", "OpenSim\OpenSim.Storage\LocalStorageSQLite\OpenSim.Storage.LocalStorageSQLite.csproj", "{6B20B603-0000-0000-0000-000000000000}"
32EndProject
33Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Scripting.EmbeddedJVM", "OpenSim\OpenSim.Scripting\EmbeddedJVM\OpenSim.Scripting.EmbeddedJVM.csproj", "{97A82740-0000-0000-0000-000000000000}"
34EndProject
35Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.GridInterfaces.Local", "OpenSim\OpenSim.GridInterfaces\Local\OpenSim.GridInterfaces.Local.csproj", "{546099CD-0000-0000-0000-000000000000}"
36EndProject
37Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLRPC", "Common\XmlRpcCS\XMLRPC.csproj", "{8E81D43C-0000-0000-0000-000000000000}"
38EndProject
39Global
40 GlobalSection(SolutionConfigurationPlatforms) = preSolution
41 Debug|Any CPU = Debug|Any CPU
42 Release|Any CPU = Release|Any CPU
43 EndGlobalSection
44 GlobalSection(ProjectConfigurationPlatforms) = postSolution
45 {2270B8FE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46 {2270B8FE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
47 {2270B8FE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
48 {2270B8FE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
49 {EE9E5D96-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50 {EE9E5D96-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
51 {EE9E5D96-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
52 {EE9E5D96-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
53 {63A05FE9-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54 {63A05FE9-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
55 {63A05FE9-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
56 {63A05FE9-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
57 {A7CD0630-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58 {A7CD0630-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
59 {A7CD0630-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
60 {A7CD0630-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
61 {438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62 {438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
63 {438A9556-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
64 {438A9556-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
65 {632E1BFD-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
66 {632E1BFD-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
67 {632E1BFD-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
68 {632E1BFD-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
69 {E88EF749-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
70 {E88EF749-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
71 {E88EF749-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
72 {E88EF749-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
73 {8BE16150-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
74 {8BE16150-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
75 {8BE16150-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
76 {8BE16150-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
77 {4F874463-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
78 {4F874463-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
79 {4F874463-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
80 {4F874463-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
81 {988F0AC4-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
82 {988F0AC4-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
83 {988F0AC4-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
84 {988F0AC4-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
85 {B55C0B5D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
86 {B55C0B5D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
87 {B55C0B5D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
88 {B55C0B5D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
89 {8ACA2445-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
90 {8ACA2445-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
91 {8ACA2445-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
92 {8ACA2445-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
93 {8BB20F0A-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
94 {8BB20F0A-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
95 {8BB20F0A-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
96 {8BB20F0A-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
97 {E1B79ECF-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
98 {E1B79ECF-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
99 {E1B79ECF-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
100 {E1B79ECF-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
101 {6B20B603-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
102 {6B20B603-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
103 {6B20B603-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
104 {6B20B603-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
105 {97A82740-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
106 {97A82740-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
107 {97A82740-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
108 {97A82740-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
109 {546099CD-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
110 {546099CD-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
111 {546099CD-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
112 {546099CD-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
113 {8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
114 {8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
115 {8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
116 {8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
117 EndGlobalSection
118 GlobalSection(SolutionProperties) = preSolution
119 HideSolutionNode = FALSE
120 EndGlobalSection
121EndGlobal
diff --git a/OpenSim.suo b/OpenSim.suo
new file mode 100644
index 0000000..dfcacfe
--- /dev/null
+++ b/OpenSim.suo
Binary files differ
diff --git a/OpenSim/OpenSim.GridInterfaces/Local/AssemblyInfo.cs b/OpenSim/OpenSim.GridInterfaces/Local/AssemblyInfo.cs
new file mode 100644
index 0000000..103b49a
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Local/AssemblyInfo.cs
@@ -0,0 +1,31 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// Information about this assembly is defined by the following
6// attributes.
7//
8// change them to the information which is associated with the assembly
9// you compile.
10
11[assembly: AssemblyTitle("LocalGridServers")]
12[assembly: AssemblyDescription("")]
13[assembly: AssemblyConfiguration("")]
14[assembly: AssemblyCompany("")]
15[assembly: AssemblyProduct("LocalGridServers")]
16[assembly: AssemblyCopyright("")]
17[assembly: AssemblyTrademark("")]
18[assembly: AssemblyCulture("")]
19
20// This sets the default COM visibility of types in the assembly to invisible.
21// If you need to expose a type to COM, use [ComVisible(true)] on that type.
22[assembly: ComVisible(false)]
23
24// The assembly version has following format :
25//
26// Major.Minor.Build.Revision
27//
28// You can specify all values by your own or you can build default build and revision
29// numbers with the '*' character (the default):
30
31[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenSim/OpenSim.GridInterfaces/Local/LocalAssetServer.cs b/OpenSim/OpenSim.GridInterfaces/Local/LocalAssetServer.cs
new file mode 100644
index 0000000..5f75821
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Local/LocalAssetServer.cs
@@ -0,0 +1,271 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Threading;
5using System.IO;
6using OpenSim.Framework.Interfaces;
7using OpenSim.Framework.Types;
8using OpenSim.Framework.Utilities;
9using OpenSim.Framework.Console;
10using libsecondlife;
11using Db4objects.Db4o;
12using Db4objects.Db4o.Query;
13
14namespace OpenSim.GridInterfaces.Local
15{
16 public class LocalAssetPlugin : IAssetPlugin
17 {
18 public LocalAssetPlugin()
19 {
20
21 }
22
23 public IAssetServer GetAssetServer()
24 {
25 return (new LocalAssetServer());
26 }
27 }
28
29 public class LocalAssetServer : IAssetServer
30 {
31 private IAssetReceiver _receiver;
32 private BlockingQueue<ARequest> _assetRequests;
33 private IObjectContainer db;
34 private Thread _localAssetServerThread;
35
36 public LocalAssetServer()
37 {
38 bool yapfile;
39 this._assetRequests = new BlockingQueue<ARequest>();
40 yapfile = System.IO.File.Exists("assets.yap");
41
42 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"Local Asset Server class created");
43 try
44 {
45 db = Db4oFactory.OpenFile("assets.yap");
46 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"Db4 Asset database creation");
47 }
48 catch (Exception e)
49 {
50 db.Close();
51 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM,"Db4 Asset server :Constructor - Exception occured");
52 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, e.ToString());
53 }
54 if (!yapfile)
55 {
56 this.SetUpAssetDatabase();
57 }
58 this._localAssetServerThread = new Thread(new ThreadStart(RunRequests));
59 this._localAssetServerThread.IsBackground = true;
60 this._localAssetServerThread.Start();
61
62 }
63
64 public void SetReceiver(IAssetReceiver receiver)
65 {
66 this._receiver = receiver;
67 }
68
69 public void RequestAsset(LLUUID assetID, bool isTexture)
70 {
71 ARequest req = new ARequest();
72 req.AssetID = assetID;
73 req.IsTexture = isTexture;
74 this._assetRequests.Enqueue(req);
75 }
76
77 public void UpdateAsset(AssetBase asset)
78 {
79
80 }
81
82 public void UploadNewAsset(AssetBase asset)
83 {
84 AssetStorage store = new AssetStorage();
85 store.Data = asset.Data;
86 store.Name = asset.Name;
87 store.UUID = asset.FullID;
88 db.Set(store);
89 db.Commit();
90 }
91
92 public void SetServerInfo(string ServerUrl, string ServerKey)
93 {
94
95 }
96 public void Close()
97 {
98 if (db != null)
99 {
100 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "Closing local asset server database");
101 db.Close();
102 }
103 }
104
105 private void RunRequests()
106 {
107 while (true)
108 {
109 byte[] idata = null;
110 bool found = false;
111 AssetStorage foundAsset = null;
112 ARequest req = this._assetRequests.Dequeue();
113 IObjectSet result = db.Query(new AssetUUIDQuery(req.AssetID));
114 if (result.Count > 0)
115 {
116 foundAsset = (AssetStorage)result.Next();
117 found = true;
118 }
119
120 AssetBase asset = new AssetBase();
121 if (found)
122 {
123 asset.FullID = foundAsset.UUID;
124 asset.Type = foundAsset.Type;
125 asset.InvType = foundAsset.Type;
126 asset.Name = foundAsset.Name;
127 idata = foundAsset.Data;
128 }
129 else
130 {
131 asset.FullID = LLUUID.Zero;
132 }
133 asset.Data = idata;
134 _receiver.AssetReceived(asset, req.IsTexture);
135 }
136
137 }
138
139 private void SetUpAssetDatabase()
140 {
141 try
142 {
143
144 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "Setting up asset database");
145
146 AssetBase Image = new AssetBase();
147 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001");
148 Image.Name = "Bricks";
149 this.LoadAsset(Image, true, "bricks.jp2");
150 AssetStorage store = new AssetStorage();
151 store.Data = Image.Data;
152 store.Name = Image.Name;
153 store.UUID = Image.FullID;
154 db.Set(store);
155 db.Commit();
156
157 Image = new AssetBase();
158 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000002");
159 Image.Name = "Plywood";
160 this.LoadAsset(Image, true, "plywood.jp2");
161 store = new AssetStorage();
162 store.Data = Image.Data;
163 store.Name = Image.Name;
164 store.UUID = Image.FullID;
165 db.Set(store);
166 db.Commit();
167
168 Image = new AssetBase();
169 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000003");
170 Image.Name = "Rocks";
171 this.LoadAsset(Image, true, "rocks.jp2");
172 store = new AssetStorage();
173 store.Data = Image.Data;
174 store.Name = Image.Name;
175 store.UUID = Image.FullID;
176 db.Set(store);
177 db.Commit();
178
179 Image = new AssetBase();
180 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000004");
181 Image.Name = "Granite";
182 this.LoadAsset(Image, true, "granite.jp2");
183 store = new AssetStorage();
184 store.Data = Image.Data;
185 store.Name = Image.Name;
186 store.UUID = Image.FullID;
187 db.Set(store);
188 db.Commit();
189
190 Image = new AssetBase();
191 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000005");
192 Image.Name = "Hardwood";
193 this.LoadAsset(Image, true, "hardwood.jp2");
194 store = new AssetStorage();
195 store.Data = Image.Data;
196 store.Name = Image.Name;
197 store.UUID = Image.FullID;
198 db.Set(store);
199 db.Commit();
200
201 Image = new AssetBase();
202 Image.FullID = new LLUUID("00000000-0000-0000-5005-000000000005");
203 Image.Name = "Prim Base Texture";
204 this.LoadAsset(Image, true, "plywood.jp2");
205 store = new AssetStorage();
206 store.Data = Image.Data;
207 store.Name = Image.Name;
208 store.UUID = Image.FullID;
209 db.Set(store);
210 db.Commit();
211
212 Image = new AssetBase();
213 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000006");
214 Image.Name = "Map Base Texture";
215 this.LoadAsset(Image, true, "map_base.jp2");
216 store = new AssetStorage();
217 store.Data = Image.Data;
218 store.Name = Image.Name;
219 store.UUID = Image.FullID;
220 db.Set(store);
221 db.Commit();
222
223 Image = new AssetBase();
224 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000007");
225 Image.Name = "Map Texture";
226 this.LoadAsset(Image, true, "map1.jp2");
227 store = new AssetStorage();
228 store.Data = Image.Data;
229 store.Name = Image.Name;
230 store.UUID = Image.FullID;
231 db.Set(store);
232 db.Commit();
233
234 Image = new AssetBase();
235 Image.FullID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
236 Image.Name = "Shape";
237 this.LoadAsset(Image, false, "base_shape.dat");
238 store = new AssetStorage();
239 store.Data = Image.Data;
240 store.Name = Image.Name;
241 store.UUID = Image.FullID;
242 db.Set(store);
243 db.Commit();
244 }
245 catch (Exception e)
246 {
247 Console.WriteLine(e.Message);
248 }
249
250 }
251
252 private void LoadAsset(AssetBase info, bool image, string filename)
253 {
254 //should request Asset from storage manager
255 //but for now read from file
256
257 string dataPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder;
258 string fileName = Path.Combine(dataPath, filename);
259 FileInfo fInfo = new FileInfo(fileName);
260 long numBytes = fInfo.Length;
261 FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
262 byte[] idata = new byte[numBytes];
263 BinaryReader br = new BinaryReader(fStream);
264 idata = br.ReadBytes((int)numBytes);
265 br.Close();
266 fStream.Close();
267 info.Data = idata;
268 //info.loaded=true;
269 }
270 }
271}
diff --git a/OpenSim/OpenSim.GridInterfaces/Local/LocalGridServer.cs b/OpenSim/OpenSim.GridInterfaces/Local/LocalGridServer.cs
new file mode 100644
index 0000000..fdd6ba4
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Local/LocalGridServer.cs
@@ -0,0 +1,157 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections.Generic;
29using System.Threading;
30using System.IO;
31using OpenSim.Framework.Interfaces;
32using OpenSim.Framework.Types;
33using OpenSim.Framework.Console;
34using libsecondlife;
35using Db4objects.Db4o;
36using Db4objects.Db4o.Query;
37using System.Collections;
38
39namespace OpenSim.GridInterfaces.Local
40{
41 /// <summary>
42 ///
43 /// </summary>
44 ///
45 public class LocalGridPlugin : IGridPlugin
46 {
47 public LocalGridPlugin()
48 {
49
50 }
51
52 public IGridServer GetGridServer()
53 {
54 return(new LocalGridServer());
55 }
56 }
57
58 public class LocalGridServer : LocalGridBase
59 {
60 public List<Login> Sessions = new List<Login>();
61
62 public LocalGridServer()
63 {
64 Sessions = new List<Login>();
65 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"Local Grid Server class created");
66 }
67
68 public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port)
69 {
70 return true;
71 }
72
73 public override string GetName()
74 {
75 return "Local";
76 }
77
78 public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
79 {
80 //we are running local
81 AuthenticateResponse user = new AuthenticateResponse();
82
83 lock(this.Sessions)
84 {
85
86 for(int i = 0; i < Sessions.Count; i++)
87 {
88 if((Sessions[i].Agent == agentID) && (Sessions[i].Session == sessionID))
89 {
90 user.Authorised = true;
91 user.LoginInfo = Sessions[i];
92 }
93 }
94 }
95 return(user);
96 }
97
98 public override bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
99 {
100 return(true);
101 }
102
103 public override UUIDBlock RequestUUIDBlock()
104 {
105 UUIDBlock uuidBlock = new UUIDBlock();
106 return(uuidBlock);
107 }
108
109 public override NeighbourInfo[] RequestNeighbours()
110 {
111 return null;
112 }
113
114 public override void SetServerInfo(string ServerUrl, string SendKey, string RecvKey)
115 {
116
117 }
118
119 public override IList RequestMapBlocks(int minX, int minY, int maxX, int maxY)
120 {
121 return new ArrayList();
122 }
123
124
125 public override void Close()
126 {
127
128 }
129
130 /// <summary>
131 /// used by the local login server to inform us of new sessions
132 /// </summary>
133 /// <param name="session"></param>
134 public override void AddNewSession(Login session)
135 {
136 lock(this.Sessions)
137 {
138 this.Sessions.Add(session);
139 }
140 }
141 }
142
143 public class AssetUUIDQuery : Predicate
144 {
145 private LLUUID _findID;
146
147 public AssetUUIDQuery(LLUUID find)
148 {
149 _findID = find;
150 }
151 public bool Match(AssetStorage asset)
152 {
153 return (asset.UUID == _findID);
154 }
155 }
156
157}
diff --git a/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj b/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj
new file mode 100644
index 0000000..c6ec476
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj
@@ -0,0 +1,110 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{546099CD-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.GridInterfaces.Local</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.GridInterfaces.Local</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="Db4objects.Db4o.dll" >
70 <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 </ItemGroup>
78 <ItemGroup>
79 <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
80 <Name>OpenSim.Framework</Name>
81 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
82 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
83 <Private>False</Private>
84 </ProjectReference>
85 <ProjectReference Include="..\..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
86 <Name>OpenSim.Framework.Console</Name>
87 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
88 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
89 <Private>False</Private>
90 </ProjectReference>
91 </ItemGroup>
92 <ItemGroup>
93 <Compile Include="AssemblyInfo.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 <Compile Include="LocalAssetServer.cs">
97 <SubType>Code</SubType>
98 </Compile>
99 <Compile Include="LocalGridServer.cs">
100 <SubType>Code</SubType>
101 </Compile>
102 </ItemGroup>
103 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
104 <PropertyGroup>
105 <PreBuildEvent>
106 </PreBuildEvent>
107 <PostBuildEvent>
108 </PostBuildEvent>
109 </PropertyGroup>
110</Project>
diff --git a/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj.user b/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build b/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build
new file mode 100644
index 0000000..fc2d94b
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build
@@ -0,0 +1,46 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.GridInterfaces.Local" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.GridInterfaces.Local" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="LocalAssetServer.cs" />
16 <include name="LocalGridServer.cs" />
17 </sources>
18 <references basedir="${project::get-base-directory()}">
19 <lib>
20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib>
23 <include name="System.dll" />
24 <include name="System.Xml.dll" />
25 <include name="../../../bin/Db4objects.Db4o.dll" />
26 <include name="../../../bin/libsecondlife.dll" />
27 <include name="../../../bin/OpenSim.Framework.dll" />
28 <include name="../../../bin/OpenSim.Framework.Console.dll" />
29 </references>
30 </csc>
31 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
32 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
33 <copy todir="${project::get-base-directory()}/../../../bin/">
34 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
35 <include name="*.dll"/>
36 <include name="*.exe"/>
37 </fileset>
38 </copy>
39 </target>
40 <target name="clean">
41 <delete dir="${bin.dir}" failonerror="false" />
42 <delete dir="${obj.dir}" failonerror="false" />
43 </target>
44 <target name="doc" description="Creates documentation.">
45 </target>
46</project>
diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/AssemblyInfo.cs b/OpenSim/OpenSim.GridInterfaces/Remote/AssemblyInfo.cs
new file mode 100644
index 0000000..0fa7d6e
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Remote/AssemblyInfo.cs
@@ -0,0 +1,31 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// Information about this assembly is defined by the following
6// attributes.
7//
8// change them to the information which is associated with the assembly
9// you compile.
10
11[assembly: AssemblyTitle("RemoteGridServers")]
12[assembly: AssemblyDescription("")]
13[assembly: AssemblyConfiguration("")]
14[assembly: AssemblyCompany("")]
15[assembly: AssemblyProduct("RemoteGridServers")]
16[assembly: AssemblyCopyright("")]
17[assembly: AssemblyTrademark("")]
18[assembly: AssemblyCulture("")]
19
20// This sets the default COM visibility of types in the assembly to invisible.
21// If you need to expose a type to COM, use [ComVisible(true)] on that type.
22[assembly: ComVisible(false)]
23
24// The assembly version has following format :
25//
26// Major.Minor.Build.Revision
27//
28// You can specify all values by your own or you can build default build and revision
29// numbers with the '*' character (the default):
30
31[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj b/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj
new file mode 100644
index 0000000..28e0bb8
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj
@@ -0,0 +1,112 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{B55C0B5D-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.GridInterfaces.Remote</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.GridInterfaces.Remote</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="libsecondlife.dll" >
70 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 </ItemGroup>
74 <ItemGroup>
75 <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
76 <Name>OpenSim.Framework</Name>
77 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
78 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
79 <Private>False</Private>
80 </ProjectReference>
81 <ProjectReference Include="..\..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
82 <Name>OpenSim.Framework.Console</Name>
83 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
84 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
85 <Private>False</Private>
86 </ProjectReference>
87 <ProjectReference Include="..\..\..\Common\XmlRpcCS\XMLRPC.csproj">
88 <Name>XMLRPC</Name>
89 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
90 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
91 <Private>False</Private>
92 </ProjectReference>
93 </ItemGroup>
94 <ItemGroup>
95 <Compile Include="AssemblyInfo.cs">
96 <SubType>Code</SubType>
97 </Compile>
98 <Compile Include="RemoteAssetServer.cs">
99 <SubType>Code</SubType>
100 </Compile>
101 <Compile Include="RemoteGridServer.cs">
102 <SubType>Code</SubType>
103 </Compile>
104 </ItemGroup>
105 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
106 <PropertyGroup>
107 <PreBuildEvent>
108 </PreBuildEvent>
109 <PostBuildEvent>
110 </PostBuildEvent>
111 </PropertyGroup>
112</Project>
diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj.user b/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build b/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build
new file mode 100644
index 0000000..daf35c6
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build
@@ -0,0 +1,46 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.GridInterfaces.Remote" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.GridInterfaces.Remote" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="RemoteAssetServer.cs" />
16 <include name="RemoteGridServer.cs" />
17 </sources>
18 <references basedir="${project::get-base-directory()}">
19 <lib>
20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib>
23 <include name="System.dll" />
24 <include name="System.Xml.dll" />
25 <include name="../../../bin/libsecondlife.dll" />
26 <include name="../../../bin/OpenSim.Framework.dll" />
27 <include name="../../../bin/OpenSim.Framework.Console.dll" />
28 <include name="../../../bin/XMLRPC.dll" />
29 </references>
30 </csc>
31 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
32 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
33 <copy todir="${project::get-base-directory()}/../../../bin/">
34 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
35 <include name="*.dll"/>
36 <include name="*.exe"/>
37 </fileset>
38 </copy>
39 </target>
40 <target name="clean">
41 <delete dir="${bin.dir}" failonerror="false" />
42 <delete dir="${obj.dir}" failonerror="false" />
43 </target>
44 <target name="doc" description="Creates documentation.">
45 </target>
46</project>
diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs b/OpenSim/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs
new file mode 100644
index 0000000..7432dee
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs
@@ -0,0 +1,108 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Threading;
5using System.Net;
6using System.Net.Sockets;
7using System.IO;
8using libsecondlife;
9using OpenSim.Framework.Interfaces;
10using OpenSim.Framework.Types;
11using OpenSim.Framework.Utilities;
12
13namespace OpenSim.GridInterfaces.Remote
14{
15 public class RemoteAssetServer : IAssetServer
16 {
17 private IAssetReceiver _receiver;
18 private BlockingQueue<ARequest> _assetRequests;
19 private Thread _remoteAssetServerThread;
20 private string AssetServerUrl;
21 private string AssetSendKey;
22
23 public RemoteAssetServer()
24 {
25 this._assetRequests = new BlockingQueue<ARequest>();
26 this._remoteAssetServerThread = new Thread(new ThreadStart(RunRequests));
27 this._remoteAssetServerThread.IsBackground = true;
28 this._remoteAssetServerThread.Start();
29 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Remote Asset Server class created");
30 }
31
32 public void SetReceiver(IAssetReceiver receiver)
33 {
34 this._receiver = receiver;
35 }
36
37 public void RequestAsset(LLUUID assetID, bool isTexture)
38 {
39 ARequest req = new ARequest();
40 req.AssetID = assetID;
41 req.IsTexture = isTexture;
42 this._assetRequests.Enqueue(req);
43 }
44
45 public void UpdateAsset(AssetBase asset)
46 {
47
48 }
49
50 public void UploadNewAsset(AssetBase asset)
51 {
52 Encoding Windows1252Encoding = Encoding.GetEncoding(1252);
53 string ret = Windows1252Encoding.GetString(asset.Data);
54 byte[] buffer = Windows1252Encoding.GetBytes(ret);
55 WebClient client = new WebClient();
56 client.UploadData(this.AssetServerUrl + "assets/" + asset.FullID, buffer);
57
58 }
59
60 public void SetServerInfo(string ServerUrl, string ServerKey)
61 {
62 this.AssetServerUrl = ServerUrl;
63 this.AssetSendKey = ServerKey;
64 }
65
66 private void RunRequests()
67 {
68 while (true)
69 {
70 //we need to add support for the asset server not knowing about a requested asset
71 // 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
72 ARequest req = this._assetRequests.Dequeue();
73 LLUUID assetID = req.AssetID;
74 // OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW," RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "assets/" + assetID);
75 WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "assets/" + assetID);
76 WebResponse AssetResponse = AssetLoad.GetResponse();
77 byte[] idata = new byte[(int)AssetResponse.ContentLength];
78 BinaryReader br = new BinaryReader(AssetResponse.GetResponseStream());
79 idata = br.ReadBytes((int)AssetResponse.ContentLength);
80 br.Close();
81
82 AssetBase asset = new AssetBase();
83 asset.FullID = assetID;
84 asset.Data = idata;
85 _receiver.AssetReceived(asset, req.IsTexture);
86 }
87 }
88
89 public void Close()
90 {
91
92 }
93 }
94
95 public class RemoteAssetPlugin : IAssetPlugin
96 {
97 public RemoteAssetPlugin()
98 {
99
100 }
101
102 public IAssetServer GetAssetServer()
103 {
104 return (new RemoteAssetServer());
105 }
106 }
107
108}
diff --git a/OpenSim/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs b/OpenSim/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs
new file mode 100644
index 0000000..7f911d8
--- /dev/null
+++ b/OpenSim/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs
@@ -0,0 +1,210 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections;
29using System.Collections.Generic;
30using System.Threading;
31using System.Net;
32using System.Net.Sockets;
33using System.IO;
34using libsecondlife;
35using Nwc.XmlRpc;
36using OpenSim.Framework.Interfaces;
37using OpenSim.Framework.Types;
38
39namespace OpenSim.GridInterfaces.Remote
40{
41 public class RemoteGridServer : RemoteGridBase
42 {
43 private string GridServerUrl;
44 private string GridSendKey;
45 private string GridRecvKey;
46 private Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
47 private ArrayList simneighbours = new ArrayList();
48 private Hashtable griddatahash;
49
50 public override Dictionary<uint, AgentCircuitData> agentcircuits
51 {
52 get { return AgentCircuits; }
53 set { AgentCircuits = value; }
54 }
55
56 public override ArrayList neighbours
57 {
58 get { return simneighbours; }
59 set { simneighbours = value; }
60 }
61
62 public override Hashtable GridData
63 {
64 get { return griddatahash; }
65 set { griddatahash = value; }
66 }
67
68
69 public RemoteGridServer()
70 {
71 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Remote Grid Server class created");
72 }
73
74 public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port)
75 {
76 Hashtable GridParams = new Hashtable();
77 GridParams["authkey"] = GridSendKey;
78 GridParams["UUID"] = SimUUID.ToString();
79 GridParams["sim_ip"] = sim_ip;
80 GridParams["sim_port"] = sim_port.ToString();
81 ArrayList SendParams = new ArrayList();
82 SendParams.Add(GridParams);
83
84 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
85 XmlRpcResponse GridResp = GridReq.Send(this.GridServerUrl, 3000);
86 Hashtable GridRespData = (Hashtable)GridResp.Value;
87 this.griddatahash = GridRespData;
88
89 if (GridRespData.ContainsKey("error"))
90 {
91 string errorstring = (string)GridRespData["error"];
92 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Error connecting to grid:");
93 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, errorstring);
94 return false;
95 }
96 this.neighbours = (ArrayList)GridRespData["neighbours"];
97 Console.WriteLine(simneighbours.Count);
98 return true;
99 }
100
101 public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
102 {
103 AgentCircuitData validcircuit = null;
104 if (this.AgentCircuits.ContainsKey(circuitcode))
105 {
106 validcircuit = this.AgentCircuits[circuitcode];
107 }
108 AuthenticateResponse user = new AuthenticateResponse();
109 if (validcircuit == null)
110 {
111 //don't have this circuit code in our list
112 user.Authorised = false;
113 return (user);
114 }
115
116 if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
117 {
118 // YAY! Valid login
119 user.Authorised = true;
120 user.LoginInfo = new Login();
121 user.LoginInfo.Agent = agentID;
122 user.LoginInfo.Session = sessionID;
123 user.LoginInfo.SecureSession = validcircuit.SecureSessionID;
124 user.LoginInfo.First = validcircuit.firstname;
125 user.LoginInfo.Last = validcircuit.lastname;
126 }
127 else
128 {
129 // Invalid
130 user.Authorised = false;
131 }
132
133 return (user);
134 }
135
136 public override bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
137 {
138 WebRequest DeleteSession = WebRequest.Create(GridServerUrl + "/usersessions/" + sessionID.ToString());
139 DeleteSession.Method = "DELETE";
140 DeleteSession.ContentType = "text/plaintext";
141 DeleteSession.ContentLength = 0;
142
143 StreamWriter stOut = new StreamWriter(DeleteSession.GetRequestStream(), System.Text.Encoding.ASCII);
144 stOut.Write("");
145 stOut.Close();
146
147 StreamReader stIn = new StreamReader(DeleteSession.GetResponse().GetResponseStream());
148 string GridResponse = stIn.ReadToEnd();
149 stIn.Close();
150 return (true);
151 }
152
153 public override UUIDBlock RequestUUIDBlock()
154 {
155 UUIDBlock uuidBlock = new UUIDBlock();
156 return (uuidBlock);
157 }
158
159 public override NeighbourInfo[] RequestNeighbours()
160 {
161 return null;
162 }
163
164 public override IList RequestMapBlocks(int minX, int minY, int maxX, int maxY)
165 {
166 Hashtable param = new Hashtable();
167 param["xmin"] = minX;
168 param["ymin"] = minY;
169 param["xmax"] = maxX;
170 param["ymax"] = maxY;
171 IList parameters = new ArrayList();
172 parameters.Add(param);
173 XmlRpcRequest req = new XmlRpcRequest("map_block", parameters);
174 XmlRpcResponse resp = req.Send(GridServerUrl, 3000);
175 Hashtable respData = (Hashtable)resp.Value;
176 return (IList)respData["sim-profiles"];
177 }
178
179 public override void SetServerInfo(string ServerUrl, string SendKey, string RecvKey)
180 {
181 this.GridServerUrl = ServerUrl;
182 this.GridSendKey = SendKey;
183 this.GridRecvKey = RecvKey;
184 }
185
186 public override string GetName()
187 {
188 return "Remote";
189 }
190
191 public override void Close()
192 {
193
194 }
195 }
196
197 public class RemoteGridPlugin : IGridPlugin
198 {
199 public RemoteGridPlugin()
200 {
201
202 }
203
204 public IGridServer GetGridServer()
205 {
206 return (new RemoteGridServer());
207 }
208 }
209
210}
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/AssemblyInfo.cs b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/AssemblyInfo.cs
new file mode 100644
index 0000000..0c9c06c
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/AssemblyInfo.cs
@@ -0,0 +1,31 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// Information about this assembly is defined by the following
6// attributes.
7//
8// change them to the information which is associated with the assembly
9// you compile.
10
11[assembly: AssemblyTitle("PhysXplugin")]
12[assembly: AssemblyDescription("")]
13[assembly: AssemblyConfiguration("")]
14[assembly: AssemblyCompany("")]
15[assembly: AssemblyProduct("PhysXplugin")]
16[assembly: AssemblyCopyright("")]
17[assembly: AssemblyTrademark("")]
18[assembly: AssemblyCulture("")]
19
20// This sets the default COM visibility of types in the assembly to invisible.
21// If you need to expose a type to COM, use [ComVisible(true)] on that type.
22[assembly: ComVisible(false)]
23
24// The assembly version has following format :
25//
26// Major.Minor.Build.Revision
27//
28// You can specify all values by your own or you can build default build and revision
29// numbers with the '*' character (the default):
30
31[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
new file mode 100644
index 0000000..54be853
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
@@ -0,0 +1,297 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections.Generic;
29using OpenSim.Physics.Manager;
30
31namespace OpenSim.Physics.BasicPhysicsPlugin
32{
33 /// <summary>
34 /// Will be the PhysX plugin but for now will be a very basic physics engine
35 /// </summary>
36 public class BasicPhysicsPlugin : IPhysicsPlugin
37 {
38 private BasicScene _mScene;
39
40 public BasicPhysicsPlugin()
41 {
42
43 }
44
45 public bool Init()
46 {
47 return true;
48 }
49
50 public PhysicsScene GetScene()
51 {
52 if(_mScene == null)
53 {
54 _mScene = new BasicScene();
55 }
56 return(_mScene);
57 }
58
59 public string GetName()
60 {
61 return("basicphysics");
62 }
63
64 public void Dispose()
65 {
66
67 }
68 }
69
70 public class BasicScene :PhysicsScene
71 {
72 private List<BasicActor> _actors = new List<BasicActor>();
73 private float[] _heightMap;
74
75 public BasicScene()
76 {
77
78 }
79
80 public override PhysicsActor AddAvatar(PhysicsVector position)
81 {
82 BasicActor act = new BasicActor();
83 act.Position = position;
84 _actors.Add(act);
85 return act;
86 }
87
88 public override void RemoveAvatar(PhysicsActor actor)
89 {
90 BasicActor act = (BasicActor)actor;
91 if(_actors.Contains(act))
92 {
93 _actors.Remove(act);
94 }
95
96 }
97
98 public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
99 {
100 return null;
101 }
102
103 public override void Simulate(float timeStep)
104 {
105 foreach (BasicActor actor in _actors)
106 {
107 actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep);
108 actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep);
109 actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep);
110 /*if(actor.Flying)
111 {
112 actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep);
113 }
114 else
115 {
116 actor.Position.Z = actor.Position.Z + ((-9.8f + actor.Velocity.Z) * timeStep);
117 }
118 if(actor.Position.Z < (_heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X]+1))
119 {*/
120 if ((actor.Position.Y > 0 && actor.Position.Y < 256) && (actor.Position.X > 0 && actor.Position.X < 256))
121 {
122 actor.Position.Z = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1;
123 }
124 else
125 {
126 if (actor.Position.Y < -1)
127 {
128 actor.Position.Y = -1;
129 }
130 else if (actor.Position.Y > 257)
131 {
132 actor.Position.Y = 257;
133 }
134
135 if (actor.Position.X < -1)
136 {
137 actor.Position.X = -1;
138 }
139 if (actor.Position.X > 257)
140 {
141 actor.Position.X = 257;
142 }
143 }
144 //}
145
146
147
148 // This code needs sorting out - border crossings etc
149/* if(actor.Position.X<0)
150 {
151 ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z));
152 actor.Position.X = 0;
153 actor.Velocity.X = 0;
154 }
155 if(actor.Position.Y < 0)
156 {
157 ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z));
158 actor.Position.Y = 0;
159 actor.Velocity.Y = 0;
160 }
161 if(actor.Position.X > 255)
162 {
163 ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z));
164 actor.Position.X = 255;
165 actor.Velocity.X = 0;
166 }
167 if(actor.Position.Y > 255)
168 {
169 ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z));
170 actor.Position.Y = 255;
171 actor.Velocity.X = 0;
172 }*/
173 }
174 }
175
176 public override void GetResults()
177 {
178
179 }
180
181 public override bool IsThreaded
182 {
183 get
184 {
185 return(false); // for now we won't be multithreaded
186 }
187 }
188
189 public override void SetTerrain(float[] heightMap)
190 {
191 this._heightMap = heightMap;
192 }
193
194 public override void DeleteTerrain()
195 {
196
197 }
198 }
199
200 public class BasicActor : PhysicsActor
201 {
202 private PhysicsVector _position;
203 private PhysicsVector _velocity;
204 private PhysicsVector _acceleration;
205 private bool flying;
206 public BasicActor()
207 {
208 _velocity = new PhysicsVector();
209 _position = new PhysicsVector();
210 _acceleration = new PhysicsVector();
211 }
212
213 public override bool Flying
214 {
215 get
216 {
217 return false;
218 }
219 set
220 {
221 flying= value;
222 }
223 }
224
225 public override PhysicsVector Position
226 {
227 get
228 {
229 return _position;
230 }
231 set
232 {
233 _position = value;
234 }
235 }
236
237 public override PhysicsVector Velocity
238 {
239 get
240 {
241 return _velocity;
242 }
243 set
244 {
245 _velocity = value;
246 }
247 }
248
249 public override Axiom.MathLib.Quaternion Orientation
250 {
251 get
252 {
253 return Axiom.MathLib.Quaternion.Identity;
254 }
255 set
256 {
257
258 }
259 }
260
261 public override PhysicsVector Acceleration
262 {
263 get
264 {
265 return _acceleration;
266 }
267
268 }
269
270 public override bool Kinematic
271 {
272 get
273 {
274 return true;
275 }
276 set
277 {
278
279 }
280 }
281 public void SetAcceleration (PhysicsVector accel)
282 {
283 this._acceleration = accel;
284 }
285
286 public override void AddForce(PhysicsVector force)
287 {
288
289 }
290
291 public override void SetMomentum(PhysicsVector momentum)
292 {
293
294 }
295 }
296
297}
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj
new file mode 100644
index 0000000..15f3f72
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj
@@ -0,0 +1,93 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{4F874463-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Physics.BasicPhysicsPlugin</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Physics.BasicPhysicsPlugin</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\Physics\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\Physics\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="Axiom.MathLib.dll" >
66 <HintPath>..\..\..\bin\Axiom.MathLib.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 </ItemGroup>
70 <ItemGroup>
71 <ProjectReference Include="..\Manager\OpenSim.Physics.Manager.csproj">
72 <Name>OpenSim.Physics.Manager</Name>
73 <Project>{8BE16150-0000-0000-0000-000000000000}</Project>
74 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
75 <Private>False</Private>
76 </ProjectReference>
77 </ItemGroup>
78 <ItemGroup>
79 <Compile Include="AssemblyInfo.cs">
80 <SubType>Code</SubType>
81 </Compile>
82 <Compile Include="BasicPhysicsPlugin.cs">
83 <SubType>Code</SubType>
84 </Compile>
85 </ItemGroup>
86 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
87 <PropertyGroup>
88 <PreBuildEvent>
89 </PreBuildEvent>
90 <PostBuildEvent>
91 </PostBuildEvent>
92 </PropertyGroup>
93</Project>
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj.user b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build
new file mode 100644
index 0000000..5845387
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build
@@ -0,0 +1,42 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Physics.BasicPhysicsPlugin" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Physics.BasicPhysicsPlugin" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="BasicPhysicsPlugin.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="../../../bin/Axiom.MathLib.dll" />
24 <include name="../../../bin/OpenSim.Physics.Manager.dll" />
25 </references>
26 </csc>
27 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/Physics/" />
28 <mkdir dir="${project::get-base-directory()}/../../../bin/Physics/"/>
29 <copy todir="${project::get-base-directory()}/../../../bin/Physics/">
30 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
31 <include name="*.dll"/>
32 <include name="*.exe"/>
33 </fileset>
34 </copy>
35 </target>
36 <target name="clean">
37 <delete dir="${bin.dir}" failonerror="false" />
38 <delete dir="${obj.dir}" failonerror="false" />
39 </target>
40 <target name="doc" description="Creates documentation.">
41 </target>
42</project>
diff --git a/OpenSim/OpenSim.Physics/Manager/AssemblyInfo.cs b/OpenSim/OpenSim.Physics/Manager/AssemblyInfo.cs
new file mode 100644
index 0000000..57a8913
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/Manager/AssemblyInfo.cs
@@ -0,0 +1,31 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// Information about this assembly is defined by the following
6// attributes.
7//
8// change them to the information which is associated with the assembly
9// you compile.
10
11[assembly: AssemblyTitle("PhysicsManager")]
12[assembly: AssemblyDescription("")]
13[assembly: AssemblyConfiguration("")]
14[assembly: AssemblyCompany("")]
15[assembly: AssemblyProduct("PhysicsManager")]
16[assembly: AssemblyCopyright("")]
17[assembly: AssemblyTrademark("")]
18[assembly: AssemblyCulture("")]
19
20// This sets the default COM visibility of types in the assembly to invisible.
21// If you need to expose a type to COM, use [ComVisible(true)] on that type.
22[assembly: ComVisible(false)]
23
24// The assembly version has following format :
25//
26// Major.Minor.Build.Revision
27//
28// You can specify all values by your own or you can build default build and revision
29// numbers with the '*' character (the default):
30
31[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj b/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj
new file mode 100644
index 0000000..70ffa30
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj
@@ -0,0 +1,112 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{8BE16150-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Physics.Manager</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Physics.Manager</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="Axiom.MathLib.dll" >
70 <HintPath>..\..\..\bin\Axiom.MathLib.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 </ItemGroup>
74 <ItemGroup>
75 <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
76 <Name>OpenSim.Framework</Name>
77 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
78 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
79 <Private>False</Private>
80 </ProjectReference>
81 <ProjectReference Include="..\..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
82 <Name>OpenSim.Framework.Console</Name>
83 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
84 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
85 <Private>False</Private>
86 </ProjectReference>
87 </ItemGroup>
88 <ItemGroup>
89 <Compile Include="AssemblyInfo.cs">
90 <SubType>Code</SubType>
91 </Compile>
92 <Compile Include="PhysicsActor.cs">
93 <SubType>Code</SubType>
94 </Compile>
95 <Compile Include="PhysicsManager.cs">
96 <SubType>Code</SubType>
97 </Compile>
98 <Compile Include="PhysicsScene.cs">
99 <SubType>Code</SubType>
100 </Compile>
101 <Compile Include="PhysicsVector.cs">
102 <SubType>Code</SubType>
103 </Compile>
104 </ItemGroup>
105 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
106 <PropertyGroup>
107 <PreBuildEvent>
108 </PreBuildEvent>
109 <PostBuildEvent>
110 </PostBuildEvent>
111 </PropertyGroup>
112</Project>
diff --git a/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj.user b/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build b/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build
new file mode 100644
index 0000000..726444a
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build
@@ -0,0 +1,47 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Physics.Manager" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Physics.Manager" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="PhysicsActor.cs" />
16 <include name="PhysicsManager.cs" />
17 <include name="PhysicsScene.cs" />
18 <include name="PhysicsVector.cs" />
19 </sources>
20 <references basedir="${project::get-base-directory()}">
21 <lib>
22 <include name="${project::get-base-directory()}" />
23 <include name="${project::get-base-directory()}/${build.dir}" />
24 </lib>
25 <include name="System.dll" />
26 <include name="System.Xml.dll" />
27 <include name="../../../bin/Axiom.MathLib.dll" />
28 <include name="../../../bin/OpenSim.Framework.dll" />
29 <include name="../../../bin/OpenSim.Framework.Console.dll" />
30 </references>
31 </csc>
32 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
33 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
34 <copy todir="${project::get-base-directory()}/../../../bin/">
35 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
36 <include name="*.dll"/>
37 <include name="*.exe"/>
38 </fileset>
39 </copy>
40 </target>
41 <target name="clean">
42 <delete dir="${bin.dir}" failonerror="false" />
43 <delete dir="${obj.dir}" failonerror="false" />
44 </target>
45 <target name="doc" description="Creates documentation.">
46 </target>
47</project>
diff --git a/OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs b/OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs
new file mode 100644
index 0000000..a0b6c21
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs
@@ -0,0 +1,161 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using System;
29using System.Collections.Generic;
30using System.Text;
31
32namespace OpenSim.Physics.Manager
33{
34 public abstract class PhysicsActor
35 {
36 public static PhysicsActor Null
37 {
38 get
39 {
40 return new NullPhysicsActor();
41 }
42 }
43
44 public abstract PhysicsVector Position
45 {
46 get;
47 set;
48 }
49
50 public abstract PhysicsVector Velocity
51 {
52 get;
53 set;
54 }
55
56 public abstract PhysicsVector Acceleration
57 {
58 get;
59 }
60
61 public abstract Axiom.MathLib.Quaternion Orientation
62 {
63 get;
64 set;
65 }
66
67 public abstract bool Flying
68 {
69 get;
70 set;
71 }
72
73 public abstract bool Kinematic
74 {
75 get;
76 set;
77 }
78
79 public abstract void AddForce(PhysicsVector force);
80
81 public abstract void SetMomentum(PhysicsVector momentum);
82 }
83
84 public class NullPhysicsActor : PhysicsActor
85 {
86 public override PhysicsVector Position
87 {
88 get
89 {
90 return PhysicsVector.Zero;
91 }
92 set
93 {
94 return;
95 }
96 }
97
98 public override PhysicsVector Velocity
99 {
100 get
101 {
102 return PhysicsVector.Zero;
103 }
104 set
105 {
106 return;
107 }
108 }
109
110 public override Axiom.MathLib.Quaternion Orientation
111 {
112 get
113 {
114 return Axiom.MathLib.Quaternion.Identity;
115 }
116 set
117 {
118
119 }
120 }
121
122 public override PhysicsVector Acceleration
123 {
124 get { return PhysicsVector.Zero; }
125 }
126
127 public override bool Flying
128 {
129 get
130 {
131 return false;
132 }
133 set
134 {
135 return;
136 }
137 }
138
139 public override bool Kinematic
140 {
141 get
142 {
143 return true;
144 }
145 set
146 {
147 return;
148 }
149 }
150
151 public override void AddForce(PhysicsVector force)
152 {
153 return;
154 }
155
156 public override void SetMomentum(PhysicsVector momentum)
157 {
158 return;
159 }
160 }
161}
diff --git a/OpenSim/OpenSim.Physics/Manager/PhysicsManager.cs b/OpenSim/OpenSim.Physics/Manager/PhysicsManager.cs
new file mode 100644
index 0000000..291fc7e
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/Manager/PhysicsManager.cs
@@ -0,0 +1,116 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections.Generic;
29using System.Collections;
30using System.IO;
31using System.Reflection;
32using Axiom.MathLib;
33using OpenSim.Framework.Console;
34
35namespace OpenSim.Physics.Manager
36{
37 /// <summary>
38 /// Description of MyClass.
39 /// </summary>
40 public class PhysicsManager
41 {
42 private Dictionary<string, IPhysicsPlugin> _plugins=new Dictionary<string, IPhysicsPlugin>();
43
44 public PhysicsManager()
45 {
46
47 }
48
49 public PhysicsScene GetPhysicsScene(string engineName)
50 {
51 if (String.IsNullOrEmpty(engineName))
52 {
53 return new NullPhysicsScene();
54 }
55
56 if(_plugins.ContainsKey(engineName))
57 {
58 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW,"creating "+engineName);
59 return _plugins[engineName].GetScene();
60 }
61 else
62 {
63 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM,"couldn't find physicsEngine: {0}",engineName);
64 throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}",engineName));
65 }
66 }
67
68 public void LoadPlugins()
69 {
70 string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory ,"Physics");
71 string[] pluginFiles = Directory.GetFiles(path, "*.dll");
72
73
74 for(int i= 0; i<pluginFiles.Length; i++)
75 {
76 this.AddPlugin(pluginFiles[i]);
77 }
78 }
79
80 private void AddPlugin(string FileName)
81 {
82 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
83
84 foreach (Type pluginType in pluginAssembly.GetTypes())
85 {
86 if (pluginType.IsPublic)
87 {
88 if (!pluginType.IsAbstract)
89 {
90 Type typeInterface = pluginType.GetInterface("IPhysicsPlugin", true);
91
92 if (typeInterface != null)
93 {
94 IPhysicsPlugin plug = (IPhysicsPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
95 plug.Init();
96 this._plugins.Add(plug.GetName(),plug);
97
98 }
99
100 typeInterface = null;
101 }
102 }
103 }
104
105 pluginAssembly = null;
106 }
107 }
108
109 public interface IPhysicsPlugin
110 {
111 bool Init();
112 PhysicsScene GetScene();
113 string GetName();
114 void Dispose();
115 }
116}
diff --git a/OpenSim/OpenSim.Physics/Manager/PhysicsScene.cs b/OpenSim/OpenSim.Physics/Manager/PhysicsScene.cs
new file mode 100644
index 0000000..7dab4e1
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/Manager/PhysicsScene.cs
@@ -0,0 +1,113 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using System;
29using System.Collections.Generic;
30using System.Text;
31using OpenSim.Framework.Console;
32
33namespace OpenSim.Physics.Manager
34{
35 public abstract class PhysicsScene
36 {
37 public static PhysicsScene Null
38 {
39 get
40 {
41 return new NullPhysicsScene();
42 }
43 }
44
45 public abstract PhysicsActor AddAvatar(PhysicsVector position);
46
47 public abstract void RemoveAvatar(PhysicsActor actor);
48
49 public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size);
50
51 public abstract void Simulate(float timeStep);
52
53 public abstract void GetResults();
54
55 public abstract void SetTerrain(float[] heightMap);
56
57 public abstract void DeleteTerrain();
58
59 public abstract bool IsThreaded
60 {
61 get;
62 }
63 }
64
65 public class NullPhysicsScene : PhysicsScene
66 {
67 private static int m_workIndicator;
68
69 public override PhysicsActor AddAvatar(PhysicsVector position)
70 {
71 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"NullPhysicsScene : AddAvatar({0})", position);
72 return PhysicsActor.Null;
73 }
74
75 public override void RemoveAvatar(PhysicsActor actor)
76 {
77
78 }
79
80 public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
81 {
82 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "NullPhysicsScene : AddPrim({0},{1})", position, size);
83 return PhysicsActor.Null;
84 }
85
86 public override void Simulate(float timeStep)
87 {
88 m_workIndicator = (m_workIndicator + 1) % 10;
89
90 //OpenSim.Framework.Console.MainConsole.Instance.SetStatus(m_workIndicator.ToString());
91 }
92
93 public override void GetResults()
94 {
95 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "NullPhysicsScene : GetResults()");
96 }
97
98 public override void SetTerrain(float[] heightMap)
99 {
100 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "NullPhysicsScene : SetTerrain({0} items)", heightMap.Length);
101 }
102
103 public override void DeleteTerrain()
104 {
105
106 }
107
108 public override bool IsThreaded
109 {
110 get { return false; }
111 }
112 }
113}
diff --git a/OpenSim/OpenSim.Physics/Manager/PhysicsVector.cs b/OpenSim/OpenSim.Physics/Manager/PhysicsVector.cs
new file mode 100644
index 0000000..3c824d0
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/Manager/PhysicsVector.cs
@@ -0,0 +1,54 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using System;
29using System.Collections.Generic;
30using System.Text;
31
32namespace OpenSim.Physics.Manager
33{
34 public class PhysicsVector
35 {
36 public float X;
37 public float Y;
38 public float Z;
39
40 public PhysicsVector()
41 {
42
43 }
44
45 public PhysicsVector(float x, float y, float z)
46 {
47 X = x;
48 Y = y;
49 Z = z;
50 }
51
52 public static readonly PhysicsVector Zero = new PhysicsVector(0f, 0f, 0f);
53 }
54}
diff --git a/OpenSim/OpenSim.Physics/OdePlugin/AssemblyInfo.cs b/OpenSim/OpenSim.Physics/OdePlugin/AssemblyInfo.cs
new file mode 100644
index 0000000..913aae7
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/OdePlugin/AssemblyInfo.cs
@@ -0,0 +1,31 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// Information about this assembly is defined by the following
6// attributes.
7//
8// change them to the information which is associated with the assembly
9// you compile.
10
11[assembly: AssemblyTitle("RealPhysXplugin")]
12[assembly: AssemblyDescription("")]
13[assembly: AssemblyConfiguration("")]
14[assembly: AssemblyCompany("")]
15[assembly: AssemblyProduct("RealPhysXplugin")]
16[assembly: AssemblyCopyright("")]
17[assembly: AssemblyTrademark("")]
18[assembly: AssemblyCulture("")]
19
20// This sets the default COM visibility of types in the assembly to invisible.
21// If you need to expose a type to COM, use [ComVisible(true)] on that type.
22[assembly: ComVisible(false)]
23
24// The assembly version has following format :
25//
26// Major.Minor.Build.Revision
27//
28// You can specify all values by your own or you can build default build and revision
29// numbers with the '*' character (the default):
30
31[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs b/OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs
new file mode 100644
index 0000000..599dea8
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs
@@ -0,0 +1,452 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections.Generic;
29using OpenSim.Physics.Manager;
30using Ode.NET;
31
32namespace OpenSim.Physics.OdePlugin
33{
34 /// <summary>
35 /// ODE plugin
36 /// </summary>
37 public class OdePlugin : IPhysicsPlugin
38 {
39 private OdeScene _mScene;
40
41 public OdePlugin()
42 {
43
44 }
45
46 public bool Init()
47 {
48 return true;
49 }
50
51 public PhysicsScene GetScene()
52 {
53 if (_mScene == null)
54 {
55 _mScene = new OdeScene();
56 }
57 return (_mScene);
58 }
59
60 public string GetName()
61 {
62 return ("OpenDynamicsEngine");
63 }
64
65 public void Dispose()
66 {
67
68 }
69 }
70
71 public class OdeScene : PhysicsScene
72 {
73 static public IntPtr world;
74 static public IntPtr space;
75 static private IntPtr contactgroup;
76 static private IntPtr LandGeom;
77 //static private IntPtr Land;
78 private double[] _heightmap;
79 static private d.NearCallback nearCallback = near;
80 private List<OdeCharacter> _characters = new List<OdeCharacter>();
81 private static d.ContactGeom[] contacts = new d.ContactGeom[30];
82 private static d.Contact contact;
83
84 public OdeScene()
85 {
86 contact.surface.mode = d.ContactFlags.Bounce | d.ContactFlags.SoftCFM;
87 contact.surface.mu = d.Infinity;
88 contact.surface.mu2 = 0.0f;
89 contact.surface.bounce = 0.1f;
90 contact.surface.bounce_vel = 0.1f;
91 contact.surface.soft_cfm = 0.01f;
92
93 world = d.WorldCreate();
94 space = d.HashSpaceCreate(IntPtr.Zero);
95 contactgroup = d.JointGroupCreate(0);
96 d.WorldSetGravity(world, 0.0f, 0.0f, -0.5f);
97 //d.WorldSetCFM(world, 1e-5f);
98 d.WorldSetAutoDisableFlag(world, false);
99 d.WorldSetContactSurfaceLayer(world, 0.001f);
100 // d.CreatePlane(space, 0, 0, 1, 0);
101 this._heightmap = new double[65536];
102 }
103
104 // This function blatantly ripped off from BoxStack.cs
105 static private void near(IntPtr space, IntPtr g1, IntPtr g2)
106 {
107 //Console.WriteLine("collision callback");
108 IntPtr b1 = d.GeomGetBody(g1);
109 IntPtr b2 = d.GeomGetBody(g2);
110 if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact))
111 return;
112
113 int count = d.Collide(g1, g2, 500, contacts, d.ContactGeom.SizeOf);
114 for (int i = 0; i < count; ++i)
115 {
116 contact.geom = contacts[i];
117 IntPtr joint = d.JointCreateContact(world, contactgroup, ref contact);
118 d.JointAttach(joint, b1, b2);
119 }
120
121 }
122
123 public override PhysicsActor AddAvatar(PhysicsVector position)
124 {
125 PhysicsVector pos = new PhysicsVector();
126 pos.X = position.X;
127 pos.Y = position.Y;
128 pos.Z = position.Z + 20;
129 OdeCharacter newAv = new OdeCharacter(this, pos);
130 this._characters.Add(newAv);
131 return newAv;
132 }
133
134 public override void RemoveAvatar(PhysicsActor actor)
135 {
136
137 }
138
139 public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
140 {
141 PhysicsVector pos = new PhysicsVector();
142 pos.X = position.X;
143 pos.Y = position.Y;
144 pos.Z = position.Z;
145 PhysicsVector siz = new PhysicsVector();
146 siz.X = size.X;
147 siz.Y = size.Y;
148 siz.Z = size.Z;
149 return new OdePrim();
150 }
151
152 public override void Simulate(float timeStep)
153 {
154 foreach (OdeCharacter actor in _characters)
155 {
156 actor.Move(timeStep * 5f);
157 }
158 d.SpaceCollide(space, IntPtr.Zero, nearCallback);
159 d.WorldQuickStep(world, timeStep * 5f);
160 d.JointGroupEmpty(contactgroup);
161 foreach (OdeCharacter actor in _characters)
162 {
163 actor.UpdatePosition();
164 }
165
166 }
167
168 public override void GetResults()
169 {
170
171 }
172
173 public override bool IsThreaded
174 {
175 get
176 {
177 return (false); // for now we won't be multithreaded
178 }
179 }
180
181 public override void SetTerrain(float[] heightMap)
182 {
183 for (int i = 0; i < 65536; i++)
184 {
185 this._heightmap[i] = (double)heightMap[i];
186 }
187 IntPtr HeightmapData = d.GeomHeightfieldDataCreate();
188 d.GeomHeightfieldDataBuildDouble(HeightmapData, _heightmap, 0, 256, 256, 256, 256, 1.0f, 0.0f, 2.0f, 0);
189 d.GeomHeightfieldDataSetBounds(HeightmapData, 256, 256);
190 LandGeom = d.CreateHeightfield(space, HeightmapData, 1);
191 d.Matrix3 R = new d.Matrix3();
192
193 Axiom.MathLib.Quaternion q1 =Axiom.MathLib.Quaternion.FromAngleAxis(1.5707f, new Axiom.MathLib.Vector3(1,0,0));
194 Axiom.MathLib.Quaternion q2 =Axiom.MathLib.Quaternion.FromAngleAxis(1.5707f, new Axiom.MathLib.Vector3(0,1,0));
195 //Axiom.MathLib.Quaternion q3 = Axiom.MathLib.Quaternion.FromAngleAxis(3.14f, new Axiom.MathLib.Vector3(0, 0, 1));
196
197 q1 = q1 * q2;
198 //q1 = q1 * q3;
199 Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3();
200 float angle = 0;
201 q1.ToAngleAxis(ref angle, ref v3);
202
203 d.RFromAxisAndAngle(out R, v3.x, v3.y, v3.z, angle);
204 d.GeomSetRotation(LandGeom, ref R);
205 d.GeomSetPosition(LandGeom, 128, 128, 0);
206 }
207
208 public override void DeleteTerrain()
209 {
210
211 }
212 }
213
214 public class OdeCharacter : PhysicsActor
215 {
216 private PhysicsVector _position;
217 private PhysicsVector _velocity;
218 private PhysicsVector _acceleration;
219 private bool flying;
220 //private float gravityAccel;
221 private IntPtr BoundingCapsule;
222 IntPtr capsule_geom;
223 d.Mass capsule_mass;
224
225 public OdeCharacter(OdeScene parent_scene, PhysicsVector pos)
226 {
227 _velocity = new PhysicsVector();
228 _position = pos;
229 _acceleration = new PhysicsVector();
230 d.MassSetCapsule(out capsule_mass, 5.0f, 3, 0.5f, 2f);
231 capsule_geom = d.CreateCapsule(OdeScene.space, 0.5f, 2f);
232 this.BoundingCapsule = d.BodyCreate(OdeScene.world);
233 d.BodySetMass(BoundingCapsule, ref capsule_mass);
234 d.BodySetPosition(BoundingCapsule, pos.X, pos.Y, pos.Z);
235 d.GeomSetBody(capsule_geom, BoundingCapsule);
236 }
237
238 public override bool Flying
239 {
240 get
241 {
242 return flying;
243 }
244 set
245 {
246 flying = value;
247 }
248 }
249
250 public override PhysicsVector Position
251 {
252 get
253 {
254 return _position;
255 }
256 set
257 {
258 _position = value;
259 }
260 }
261
262 public override PhysicsVector Velocity
263 {
264 get
265 {
266 return _velocity;
267 }
268 set
269 {
270 _velocity = value;
271 }
272 }
273
274 public override bool Kinematic
275 {
276 get
277 {
278 return false;
279 }
280 set
281 {
282
283 }
284 }
285
286 public override Axiom.MathLib.Quaternion Orientation
287 {
288 get
289 {
290 return Axiom.MathLib.Quaternion.Identity;
291 }
292 set
293 {
294
295 }
296 }
297
298 public override PhysicsVector Acceleration
299 {
300 get
301 {
302 return _acceleration;
303 }
304
305 }
306 public void SetAcceleration(PhysicsVector accel)
307 {
308 this._acceleration = accel;
309 }
310
311 public override void AddForce(PhysicsVector force)
312 {
313
314 }
315
316 public override void SetMomentum(PhysicsVector momentum)
317 {
318
319 }
320
321 public void Move(float timeStep)
322 {
323 PhysicsVector vec = new PhysicsVector();
324 vec.X = this._velocity.X * timeStep;
325 vec.Y = this._velocity.Y * timeStep;
326 if (flying)
327 {
328 vec.Z = (this._velocity.Z + 0.5f) * timeStep;
329 }
330 d.BodySetLinearVel(this.BoundingCapsule, vec.X, vec.Y, vec.Z);
331 }
332
333 public void UpdatePosition()
334 {
335 d.Vector3 vec = d.BodyGetPosition(BoundingCapsule);
336 this._position.X = vec.X;
337 this._position.Y = vec.Y;
338 this._position.Z = vec.Z;
339 }
340 }
341
342 public class OdePrim : PhysicsActor
343 {
344 private PhysicsVector _position;
345 private PhysicsVector _velocity;
346 private PhysicsVector _acceleration;
347
348 public OdePrim()
349 {
350 _velocity = new PhysicsVector();
351 _position = new PhysicsVector();
352 _acceleration = new PhysicsVector();
353 }
354 public override bool Flying
355 {
356 get
357 {
358 return false; //no flying prims for you
359 }
360 set
361 {
362
363 }
364 }
365 public override PhysicsVector Position
366 {
367 get
368 {
369 PhysicsVector pos = new PhysicsVector();
370 // PhysicsVector vec = this._prim.Position;
371 //pos.X = vec.X;
372 //pos.Y = vec.Y;
373 //pos.Z = vec.Z;
374 return pos;
375
376 }
377 set
378 {
379 /*PhysicsVector vec = value;
380 PhysicsVector pos = new PhysicsVector();
381 pos.X = vec.X;
382 pos.Y = vec.Y;
383 pos.Z = vec.Z;
384 this._prim.Position = pos;*/
385 }
386 }
387
388 public override PhysicsVector Velocity
389 {
390 get
391 {
392 return _velocity;
393 }
394 set
395 {
396 _velocity = value;
397 }
398 }
399
400 public override bool Kinematic
401 {
402 get
403 {
404 return false;
405 //return this._prim.Kinematic;
406 }
407 set
408 {
409 //this._prim.Kinematic = value;
410 }
411 }
412
413 public override Axiom.MathLib.Quaternion Orientation
414 {
415 get
416 {
417 Axiom.MathLib.Quaternion res = new Axiom.MathLib.Quaternion();
418 return res;
419 }
420 set
421 {
422
423 }
424 }
425
426 public override PhysicsVector Acceleration
427 {
428 get
429 {
430 return _acceleration;
431 }
432
433 }
434 public void SetAcceleration(PhysicsVector accel)
435 {
436 this._acceleration = accel;
437 }
438
439 public override void AddForce(PhysicsVector force)
440 {
441
442 }
443
444 public override void SetMomentum(PhysicsVector momentum)
445 {
446
447 }
448
449
450 }
451
452}
diff --git a/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj b/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj
new file mode 100644
index 0000000..8d57bd5
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj
@@ -0,0 +1,97 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{63A05FE9-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Physics.OdePlugin</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Physics.OdePlugin</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\Physics\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\Physics\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="Axiom.MathLib.dll" >
66 <HintPath>..\..\..\bin\Axiom.MathLib.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="Ode.NET.dll" >
70 <HintPath>..\..\..\bin\Ode.NET.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 </ItemGroup>
74 <ItemGroup>
75 <ProjectReference Include="..\Manager\OpenSim.Physics.Manager.csproj">
76 <Name>OpenSim.Physics.Manager</Name>
77 <Project>{8BE16150-0000-0000-0000-000000000000}</Project>
78 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
79 <Private>False</Private>
80 </ProjectReference>
81 </ItemGroup>
82 <ItemGroup>
83 <Compile Include="AssemblyInfo.cs">
84 <SubType>Code</SubType>
85 </Compile>
86 <Compile Include="OdePlugin.cs">
87 <SubType>Code</SubType>
88 </Compile>
89 </ItemGroup>
90 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
91 <PropertyGroup>
92 <PreBuildEvent>
93 </PreBuildEvent>
94 <PostBuildEvent>
95 </PostBuildEvent>
96 </PropertyGroup>
97</Project>
diff --git a/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj.user b/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build b/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build
new file mode 100644
index 0000000..a49782f
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build
@@ -0,0 +1,43 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Physics.OdePlugin" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Physics.OdePlugin" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="OdePlugin.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="../../../bin/Axiom.MathLib.dll" />
24 <include name="../../../bin/OpenSim.Physics.Manager.dll" />
25 <include name="../../../bin/Ode.NET.dll" />
26 </references>
27 </csc>
28 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/Physics/" />
29 <mkdir dir="${project::get-base-directory()}/../../../bin/Physics/"/>
30 <copy todir="${project::get-base-directory()}/../../../bin/Physics/">
31 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
32 <include name="*.dll"/>
33 <include name="*.exe"/>
34 </fileset>
35 </copy>
36 </target>
37 <target name="clean">
38 <delete dir="${bin.dir}" failonerror="false" />
39 <delete dir="${obj.dir}" failonerror="false" />
40 </target>
41 <target name="doc" description="Creates documentation.">
42 </target>
43</project>
diff --git a/OpenSim/OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs b/OpenSim/OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs
new file mode 100644
index 0000000..913aae7
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/PhysXPlugin/AssemblyInfo.cs
@@ -0,0 +1,31 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// Information about this assembly is defined by the following
6// attributes.
7//
8// change them to the information which is associated with the assembly
9// you compile.
10
11[assembly: AssemblyTitle("RealPhysXplugin")]
12[assembly: AssemblyDescription("")]
13[assembly: AssemblyConfiguration("")]
14[assembly: AssemblyCompany("")]
15[assembly: AssemblyProduct("RealPhysXplugin")]
16[assembly: AssemblyCopyright("")]
17[assembly: AssemblyTrademark("")]
18[assembly: AssemblyCulture("")]
19
20// This sets the default COM visibility of types in the assembly to invisible.
21// If you need to expose a type to COM, use [ComVisible(true)] on that type.
22[assembly: ComVisible(false)]
23
24// The assembly version has following format :
25//
26// Major.Minor.Build.Revision
27//
28// You can specify all values by your own or you can build default build and revision
29// numbers with the '*' character (the default):
30
31[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj b/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj
new file mode 100644
index 0000000..b72bb0f
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj
@@ -0,0 +1,97 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{988F0AC4-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Physics.PhysXPlugin</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Physics.PhysXPlugin</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\Physics\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\Physics\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="Axiom.MathLib.dll" >
66 <HintPath>..\..\..\bin\Axiom.MathLib.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="PhysX_Wrapper_Dotnet.dll" >
70 <HintPath>..\..\..\bin\PhysX_Wrapper_Dotnet.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 </ItemGroup>
74 <ItemGroup>
75 <ProjectReference Include="..\Manager\OpenSim.Physics.Manager.csproj">
76 <Name>OpenSim.Physics.Manager</Name>
77 <Project>{8BE16150-0000-0000-0000-000000000000}</Project>
78 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
79 <Private>False</Private>
80 </ProjectReference>
81 </ItemGroup>
82 <ItemGroup>
83 <Compile Include="AssemblyInfo.cs">
84 <SubType>Code</SubType>
85 </Compile>
86 <Compile Include="PhysXPlugin.cs">
87 <SubType>Code</SubType>
88 </Compile>
89 </ItemGroup>
90 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
91 <PropertyGroup>
92 <PreBuildEvent>
93 </PreBuildEvent>
94 <PostBuildEvent>
95 </PostBuildEvent>
96 </PropertyGroup>
97</Project>
diff --git a/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj.user b/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build b/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build
new file mode 100644
index 0000000..2ea5534
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build
@@ -0,0 +1,43 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Physics.PhysXPlugin" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Physics.PhysXPlugin" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="PhysXPlugin.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="../../../bin/Axiom.MathLib.dll" />
24 <include name="../../../bin/PhysX_Wrapper_Dotnet.dll" />
25 <include name="../../../bin/OpenSim.Physics.Manager.dll" />
26 </references>
27 </csc>
28 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/Physics/" />
29 <mkdir dir="${project::get-base-directory()}/../../../bin/Physics/"/>
30 <copy todir="${project::get-base-directory()}/../../../bin/Physics/">
31 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
32 <include name="*.dll"/>
33 <include name="*.exe"/>
34 </fileset>
35 </copy>
36 </target>
37 <target name="clean">
38 <delete dir="${bin.dir}" failonerror="false" />
39 <delete dir="${obj.dir}" failonerror="false" />
40 </target>
41 <target name="doc" description="Creates documentation.">
42 </target>
43</project>
diff --git a/OpenSim/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs
new file mode 100644
index 0000000..dff1ee2
--- /dev/null
+++ b/OpenSim/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs
@@ -0,0 +1,449 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27/*
28* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
29*
30* Redistribution and use in source and binary forms, with or without
31* modification, are permitted provided that the following conditions are met:
32* * Redistributions of source code must retain the above copyright
33* notice, this list of conditions and the following disclaimer.
34* * Redistributions in binary form must reproduce the above copyright
35* notice, this list of conditions and the following disclaimer in the
36* documentation and/or other materials provided with the distribution.
37* * Neither the name of the <organization> nor the
38* names of its contributors may be used to endorse or promote products
39* derived from this software without specific prior written permission.
40*
41* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
42* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
43* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
44* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
45* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
46* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
50* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51*
52*/
53using System;
54using System.Collections.Generic;
55using OpenSim.Physics.Manager;
56using PhysXWrapper;
57
58namespace OpenSim.Physics.PhysXPlugin
59{
60 /// <summary>
61 /// Will be the PhysX plugin but for now will be a very basic physics engine
62 /// </summary>
63 public class PhysXPlugin : IPhysicsPlugin
64 {
65 private PhysXScene _mScene;
66
67 public PhysXPlugin()
68 {
69
70 }
71
72 public bool Init()
73 {
74 return true;
75 }
76
77 public PhysicsScene GetScene()
78 {
79 if(_mScene == null)
80 {
81 _mScene = new PhysXScene();
82 }
83 return(_mScene);
84 }
85
86 public string GetName()
87 {
88 return("RealPhysX");
89 }
90
91 public void Dispose()
92 {
93
94 }
95 }
96
97 public class PhysXScene :PhysicsScene
98 {
99 private List<PhysXCharacter> _characters = new List<PhysXCharacter>();
100 private List<PhysXPrim> _prims = new List<PhysXPrim>();
101 private float[] _heightMap = null;
102 private NxPhysicsSDK mySdk;
103 private NxScene scene;
104
105 public PhysXScene()
106 {
107 mySdk = NxPhysicsSDK.CreateSDK();
108 Console.WriteLine("Sdk created - now creating scene");
109 scene = mySdk.CreateScene();
110
111 }
112
113 public override PhysicsActor AddAvatar(PhysicsVector position)
114 {
115 Vec3 pos = new Vec3();
116 pos.X = position.X;
117 pos.Y = position.Y;
118 pos.Z = position.Z;
119 PhysXCharacter act = new PhysXCharacter( scene.AddCharacter(pos));
120 act.Position = position;
121 _characters.Add(act);
122 return act;
123 }
124
125 public override void RemoveAvatar(PhysicsActor actor)
126 {
127
128 }
129
130 public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
131 {
132 Vec3 pos = new Vec3();
133 pos.X = position.X;
134 pos.Y = position.Y;
135 pos.Z = position.Z;
136 Vec3 siz = new Vec3();
137 siz.X = size.X;
138 siz.Y = size.Y;
139 siz.Z = size.Z;
140 PhysXPrim act = new PhysXPrim( scene.AddNewBox(pos, siz));
141 _prims.Add(act);
142 return act;
143 }
144 public override void Simulate(float timeStep)
145 {
146 try
147 {
148 foreach (PhysXCharacter actor in _characters)
149 {
150 actor.Move(timeStep);
151 }
152 scene.Simulate(timeStep);
153 scene.FetchResults();
154 scene.UpdateControllers();
155
156 foreach (PhysXCharacter actor in _characters)
157 {
158 actor.UpdatePosition();
159 }
160 }
161 catch (Exception e)
162 {
163 Console.WriteLine(e.Message);
164 }
165
166 }
167
168 public override void GetResults()
169 {
170
171 }
172
173 public override bool IsThreaded
174 {
175 get
176 {
177 return(false); // for now we won't be multithreaded
178 }
179 }
180
181 public override void SetTerrain(float[] heightMap)
182 {
183 if (this._heightMap != null)
184 {
185 Console.WriteLine("PhysX - deleting old terrain");
186 this.scene.DeleteTerrain();
187 }
188 this._heightMap = heightMap;
189 this.scene.AddTerrain(heightMap);
190 }
191
192 public override void DeleteTerrain()
193 {
194 this.scene.DeleteTerrain();
195 }
196 }
197
198 public class PhysXCharacter : PhysicsActor
199 {
200 private PhysicsVector _position;
201 private PhysicsVector _velocity;
202 private PhysicsVector _acceleration;
203 private NxCharacter _character;
204 private bool flying;
205 private float gravityAccel;
206
207 public PhysXCharacter(NxCharacter character)
208 {
209 _velocity = new PhysicsVector();
210 _position = new PhysicsVector();
211 _acceleration = new PhysicsVector();
212 _character = character;
213 }
214
215 public override bool Flying
216 {
217 get
218 {
219 return flying;
220 }
221 set
222 {
223 flying = value;
224 }
225 }
226
227 public override PhysicsVector Position
228 {
229 get
230 {
231 return _position;
232 }
233 set
234 {
235 _position = value;
236 Vec3 ps = new Vec3();
237 ps.X = value.X;
238 ps.Y = value.Y;
239 ps.Z = value.Z;
240 this._character.Position = ps;
241 }
242 }
243
244 public override PhysicsVector Velocity
245 {
246 get
247 {
248 return _velocity;
249 }
250 set
251 {
252 _velocity = value;
253 }
254 }
255
256 public override bool Kinematic
257 {
258 get
259 {
260 return false;
261 }
262 set
263 {
264
265 }
266 }
267
268 public override Axiom.MathLib.Quaternion Orientation
269 {
270 get
271 {
272 return Axiom.MathLib.Quaternion.Identity;
273 }
274 set
275 {
276
277 }
278 }
279
280 public override PhysicsVector Acceleration
281 {
282 get
283 {
284 return _acceleration;
285 }
286
287 }
288 public void SetAcceleration (PhysicsVector accel)
289 {
290 this._acceleration = accel;
291 }
292
293 public override void AddForce(PhysicsVector force)
294 {
295
296 }
297
298 public override void SetMomentum(PhysicsVector momentum)
299 {
300
301 }
302
303 public void Move(float timeStep)
304 {
305 Vec3 vec = new Vec3();
306 vec.X = this._velocity.X * timeStep;
307 vec.Y = this._velocity.Y * timeStep;
308 if(flying)
309 {
310 vec.Z = ( this._velocity.Z) * timeStep;
311 }
312 else
313 {
314 gravityAccel+= -9.8f;
315 vec.Z = (gravityAccel + this._velocity.Z) * timeStep;
316 }
317 int res = this._character.Move(vec);
318 if(res == 1)
319 {
320 gravityAccel = 0;
321 }
322 }
323
324 public void UpdatePosition()
325 {
326 Vec3 vec = this._character.Position;
327 this._position.X = vec.X;
328 this._position.Y = vec.Y;
329 this._position.Z = vec.Z;
330 }
331 }
332
333 public class PhysXPrim : PhysicsActor
334 {
335 private PhysicsVector _position;
336 private PhysicsVector _velocity;
337 private PhysicsVector _acceleration;
338 private NxActor _prim;
339
340 public PhysXPrim(NxActor prim)
341 {
342 _velocity = new PhysicsVector();
343 _position = new PhysicsVector();
344 _acceleration = new PhysicsVector();
345 _prim = prim;
346 }
347 public override bool Flying
348 {
349 get
350 {
351 return false; //no flying prims for you
352 }
353 set
354 {
355
356 }
357 }
358 public override PhysicsVector Position
359 {
360 get
361 {
362 PhysicsVector pos = new PhysicsVector();
363 Vec3 vec = this._prim.Position;
364 pos.X = vec.X;
365 pos.Y = vec.Y;
366 pos.Z = vec.Z;
367 return pos;
368
369 }
370 set
371 {
372 PhysicsVector vec = value;
373 Vec3 pos = new Vec3();
374 pos.X = vec.X;
375 pos.Y = vec.Y;
376 pos.Z = vec.Z;
377 this._prim.Position = pos;
378 }
379 }
380
381 public override PhysicsVector Velocity
382 {
383 get
384 {
385 return _velocity;
386 }
387 set
388 {
389 _velocity = value;
390 }
391 }
392
393 public override bool Kinematic
394 {
395 get
396 {
397 return this._prim.Kinematic;
398 }
399 set
400 {
401 this._prim.Kinematic = value;
402 }
403 }
404
405 public override Axiom.MathLib.Quaternion Orientation
406 {
407 get
408 {
409 Axiom.MathLib.Quaternion res = new Axiom.MathLib.Quaternion();
410 PhysXWrapper.Quaternion quat = this._prim.GetOrientation();
411 res.w = quat.W;
412 res.x = quat.X;
413 res.y = quat.Y;
414 res.z = quat.Z;
415 return res;
416 }
417 set
418 {
419
420 }
421 }
422
423 public override PhysicsVector Acceleration
424 {
425 get
426 {
427 return _acceleration;
428 }
429
430 }
431 public void SetAcceleration (PhysicsVector accel)
432 {
433 this._acceleration = accel;
434 }
435
436 public override void AddForce(PhysicsVector force)
437 {
438
439 }
440
441 public override void SetMomentum(PhysicsVector momentum)
442 {
443
444 }
445
446
447 }
448
449}
diff --git a/OpenSim/OpenSim.RegionServer/AgentAssetUpload.cs b/OpenSim/OpenSim.RegionServer/AgentAssetUpload.cs
new file mode 100644
index 0000000..dd2b2a9
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/AgentAssetUpload.cs
@@ -0,0 +1,232 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Assets;
5using OpenSim.Framework.Types;
6using OpenSim.Framework.Utilities;
7using libsecondlife;
8using libsecondlife.Packets;
9
10namespace OpenSim
11{
12 public class AgentAssetUpload
13 {
14 private Dictionary<LLUUID, AssetTransaction> transactions = new Dictionary<LLUUID, AssetTransaction>();
15 private ClientView ourClient;
16 private AssetCache m_assetCache;
17 private InventoryCache m_inventoryCache;
18
19 public AgentAssetUpload(ClientView client, AssetCache assetCache, InventoryCache inventoryCache)
20 {
21 this.ourClient = client;
22 m_assetCache = assetCache;
23 m_inventoryCache = inventoryCache;
24 }
25
26 public void AddUpload(LLUUID transactionID, AssetBase asset)
27 {
28 AssetTransaction upload = new AssetTransaction();
29 lock (this.transactions)
30 {
31 upload.Asset = asset;
32 upload.TransactionID = transactionID;
33 this.transactions.Add(transactionID, upload);
34 }
35 if (upload.Asset.Data.Length > 2)
36 {
37 //is complete
38 upload.UploadComplete = true;
39 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
40 response.AssetBlock.Type = asset.Type;
41 response.AssetBlock.Success = true;
42 response.AssetBlock.UUID = transactionID.Combine(this.ourClient.SecureSessionID);
43 this.ourClient.OutPacket(response);
44 m_assetCache.AddAsset(asset);
45 }
46 else
47 {
48 upload.UploadComplete = false;
49 upload.XferID = Util.GetNextXferID();
50 RequestXferPacket xfer = new RequestXferPacket();
51 xfer.XferID.ID = upload.XferID;
52 xfer.XferID.VFileType = upload.Asset.Type;
53 xfer.XferID.VFileID = transactionID.Combine(this.ourClient.SecureSessionID);
54 xfer.XferID.FilePath = 0;
55 xfer.XferID.Filename = new byte[0];
56 this.ourClient.OutPacket(xfer);
57 }
58
59 }
60
61 public AssetBase GetUpload(LLUUID transactionID)
62 {
63 if (this.transactions.ContainsKey(transactionID))
64 {
65 return this.transactions[transactionID].Asset;
66 }
67
68 return null;
69 }
70
71 public void HandleUploadPacket(AssetUploadRequestPacket pack, LLUUID assetID)
72 {
73 // Console.Write("asset upload request , type = " + pack.AssetBlock.Type.ToString());
74 AssetBase asset = null;
75 if (pack.AssetBlock.Type == 0)
76 {
77
78 //first packet for transaction
79 asset = new AssetBase();
80 asset.FullID = assetID;
81 asset.Type = pack.AssetBlock.Type;
82 asset.InvType = asset.Type;
83 asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000");
84 asset.Data = pack.AssetBlock.AssetData;
85
86
87 }
88 else if (pack.AssetBlock.Type == 13 | pack.AssetBlock.Type == 5 | pack.AssetBlock.Type == 7)
89 {
90
91 asset = new AssetBase();
92 asset.FullID = assetID;
93 // Console.WriteLine("skin asset id is " + assetID.ToStringHyphenated());
94 asset.Type = pack.AssetBlock.Type;
95 asset.InvType = asset.Type;
96 asset.Name = "NewClothing" + Util.RandomClass.Next(1, 1000).ToString("000");
97 asset.Data = pack.AssetBlock.AssetData;
98
99
100 }
101
102 if (asset != null)
103 {
104 this.AddUpload(pack.AssetBlock.TransactionID, asset);
105 }
106 else
107 {
108
109 //currently we don't support this asset type
110 //so lets just tell the client that the upload is complete
111 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
112 response.AssetBlock.Type = pack.AssetBlock.Type;
113 response.AssetBlock.Success = true;
114 response.AssetBlock.UUID = pack.AssetBlock.TransactionID.Combine(this.ourClient.SecureSessionID);
115 this.ourClient.OutPacket(response);
116 }
117
118 }
119
120 #region Xfer packet system for larger uploads
121
122 public void HandleXferPacket(SendXferPacketPacket xferPacket)
123 {
124 lock (this.transactions)
125 {
126 foreach (AssetTransaction trans in this.transactions.Values)
127 {
128 if (trans.XferID == xferPacket.XferID.ID)
129 {
130 if (trans.Asset.Data.Length > 1)
131 {
132 byte[] newArray = new byte[trans.Asset.Data.Length + xferPacket.DataPacket.Data.Length];
133 Array.Copy(trans.Asset.Data, 0, newArray, 0, trans.Asset.Data.Length);
134 Array.Copy(xferPacket.DataPacket.Data, 0, newArray, trans.Asset.Data.Length, xferPacket.DataPacket.Data.Length);
135 trans.Asset.Data = newArray;
136 }
137 else
138 {
139 byte[] newArray = new byte[xferPacket.DataPacket.Data.Length - 4];
140 Array.Copy(xferPacket.DataPacket.Data, 4, newArray, 0, xferPacket.DataPacket.Data.Length - 4);
141 trans.Asset.Data = newArray;
142 }
143
144 if ((xferPacket.XferID.Packet & 2147483648) != 0)
145 {
146 //end of transfer
147 trans.UploadComplete = true;
148 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
149 response.AssetBlock.Type = trans.Asset.Type;
150 response.AssetBlock.Success = true;
151 response.AssetBlock.UUID = trans.TransactionID.Combine(this.ourClient.SecureSessionID);
152 this.ourClient.OutPacket(response);
153
154 m_assetCache.AddAsset(trans.Asset);
155 //check if we should add it to inventory
156 if (trans.AddToInventory)
157 {
158 // m_assetCache.AddAsset(trans.Asset);
159 m_inventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset);
160 }
161
162
163 }
164 break;
165 }
166
167 }
168 }
169
170 ConfirmXferPacketPacket confirmXfer = new ConfirmXferPacketPacket();
171 confirmXfer.XferID.ID = xferPacket.XferID.ID;
172 confirmXfer.XferID.Packet = xferPacket.XferID.Packet;
173 this.ourClient.OutPacket(confirmXfer);
174 }
175
176 #endregion
177
178 public AssetBase AddUploadToAssetCache(LLUUID transactionID)
179 {
180 AssetBase asset = null;
181 if (this.transactions.ContainsKey(transactionID))
182 {
183 AssetTransaction trans = this.transactions[transactionID];
184 if (trans.UploadComplete)
185 {
186 m_assetCache.AddAsset(trans.Asset);
187 asset = trans.Asset;
188 }
189 }
190
191 return asset;
192 }
193
194 public void CreateInventoryItem(CreateInventoryItemPacket packet)
195 {
196 if (this.transactions.ContainsKey(packet.InventoryBlock.TransactionID))
197 {
198 AssetTransaction trans = this.transactions[packet.InventoryBlock.TransactionID];
199 trans.Asset.Description = Util.FieldToString(packet.InventoryBlock.Description);
200 trans.Asset.Name = Util.FieldToString(packet.InventoryBlock.Name);
201 trans.Asset.Type = packet.InventoryBlock.Type;
202 trans.Asset.InvType = packet.InventoryBlock.InvType;
203 if (trans.UploadComplete)
204 {
205 //already complete so we can add it to the inventory
206 //m_assetCache.AddAsset(trans.Asset);
207 m_inventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset);
208 }
209 else
210 {
211 trans.AddToInventory = true;
212 trans.InventFolder = packet.InventoryBlock.FolderID;
213 }
214 }
215 }
216
217 private class AssetTransaction
218 {
219 public uint XferID;
220 public AssetBase Asset;
221 public bool AddToInventory;
222 public LLUUID InventFolder = LLUUID.Zero;
223 public bool UploadComplete = false;
224 public LLUUID TransactionID = LLUUID.Zero;
225
226 public AssetTransaction()
227 {
228
229 }
230 }
231 }
232}
diff --git a/OpenSim/OpenSim.RegionServer/Assets/AssetCache.cs b/OpenSim/OpenSim.RegionServer/Assets/AssetCache.cs
new file mode 100644
index 0000000..ccebb24
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/Assets/AssetCache.cs
@@ -0,0 +1,574 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using System;
29using System.Collections.Generic;
30using System.Threading;
31using libsecondlife;
32using libsecondlife.Packets;
33using OpenSim;
34using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities;
37
38namespace OpenSim.Assets
39{
40 /// <summary>
41 /// Manages local cache of assets and their sending to viewers.
42 /// </summary>
43 public class AssetCache : IAssetReceiver
44 {
45 public Dictionary<libsecondlife.LLUUID, AssetInfo> Assets;
46 public Dictionary<libsecondlife.LLUUID, TextureImage> Textures;
47
48 public List<AssetRequest> AssetRequests = new List<AssetRequest>(); //assets ready to be sent to viewers
49 public List<AssetRequest> TextureRequests = new List<AssetRequest>(); //textures ready to be sent
50
51 public Dictionary<LLUUID, AssetRequest> RequestedAssets = new Dictionary<LLUUID, AssetRequest>(); //Assets requested from the asset server
52 public Dictionary<LLUUID, AssetRequest> RequestedTextures = new Dictionary<LLUUID, AssetRequest>(); //Textures requested from the asset server
53
54 private IAssetServer _assetServer;
55 private Thread _assetCacheThread;
56 private LLUUID[] textureList = new LLUUID[5];
57
58 /// <summary>
59 ///
60 /// </summary>
61 public AssetCache(IAssetServer assetServer)
62 {
63 Console.WriteLine("Creating Asset cache");
64 _assetServer = assetServer;
65 _assetServer.SetReceiver(this);
66 Assets = new Dictionary<libsecondlife.LLUUID, AssetInfo>();
67 Textures = new Dictionary<libsecondlife.LLUUID, TextureImage>();
68 this._assetCacheThread = new Thread(new ThreadStart(RunAssetManager));
69 this._assetCacheThread.IsBackground = true;
70 this._assetCacheThread.Start();
71
72 }
73
74 /// <summary>
75 ///
76 /// </summary>
77 public void RunAssetManager()
78 {
79 while (true)
80 {
81 try
82 {
83 //Console.WriteLine("Asset cache loop");
84 this.ProcessAssetQueue();
85 this.ProcessTextureQueue();
86 Thread.Sleep(500);
87 }
88 catch (Exception e)
89 {
90 Console.WriteLine(e.Message);
91 }
92 }
93 }
94
95 public void LoadDefaultTextureSet()
96 {
97 //hack: so we can give each user a set of textures
98 textureList[0] = new LLUUID("00000000-0000-0000-9999-000000000001");
99 textureList[1] = new LLUUID("00000000-0000-0000-9999-000000000002");
100 textureList[2] = new LLUUID("00000000-0000-0000-9999-000000000003");
101 textureList[3] = new LLUUID("00000000-0000-0000-9999-000000000004");
102 textureList[4] = new LLUUID("00000000-0000-0000-9999-000000000005");
103
104 for (int i = 0; i < textureList.Length; i++)
105 {
106 this._assetServer.RequestAsset(textureList[i], true);
107 }
108
109 }
110
111 public AssetBase[] CreateNewInventorySet(LLUUID agentID)
112 {
113 AssetBase[] inventorySet = new AssetBase[this.textureList.Length];
114 for (int i = 0; i < textureList.Length; i++)
115 {
116 if (this.Textures.ContainsKey(textureList[i]))
117 {
118 inventorySet[i] = this.CloneImage(agentID, this.Textures[textureList[i]]);
119 TextureImage image = new TextureImage(inventorySet[i]);
120 this.Textures.Add(image.FullID, image);
121 this._assetServer.UploadNewAsset(image); //save the asset to the asset server
122 }
123 }
124 return inventorySet;
125 }
126
127 public AssetBase GetAsset(LLUUID assetID)
128 {
129 AssetBase asset = null;
130 if(this.Textures.ContainsKey(assetID))
131 {
132 asset = this.Textures[assetID];
133 }
134 else if (this.Assets.ContainsKey(assetID))
135 {
136 asset = this.Assets[assetID];
137 }
138 return asset;
139 }
140
141 public void AddAsset(AssetBase asset)
142 {
143 if (asset.Type == 0)
144 {
145 if (!this.Textures.ContainsKey(asset.FullID))
146 { //texture
147 TextureImage textur = new TextureImage(asset);
148 this.Textures.Add(textur.FullID, textur);
149 this._assetServer.UploadNewAsset(asset);
150 }
151 }
152 else
153 {
154 if (!this.Assets.ContainsKey(asset.FullID))
155 {
156 AssetInfo assetInf = new AssetInfo(asset);
157 this.Assets.Add(assetInf.FullID, assetInf);
158 this._assetServer.UploadNewAsset(asset);
159 }
160 }
161 }
162
163 /// <summary>
164 ///
165 /// </summary>
166 private void ProcessTextureQueue()
167 {
168 if (this.TextureRequests.Count == 0)
169 {
170 //no requests waiting
171 return;
172 }
173 int num;
174
175 if (this.TextureRequests.Count < 5)
176 {
177 //lower than 5 so do all of them
178 num = this.TextureRequests.Count;
179 }
180 else
181 {
182 num = 5;
183 }
184 AssetRequest req;
185 for (int i = 0; i < num; i++)
186 {
187 req = (AssetRequest)this.TextureRequests[i];
188 if (req.PacketCounter != req.NumPackets)
189 {
190 // if (req.ImageInfo.FullID == new LLUUID("00000000-0000-0000-5005-000000000005"))
191 if (req.PacketCounter == 0)
192 {
193 //first time for this request so send imagedata packet
194 if (req.NumPackets == 1)
195 {
196 //only one packet so send whole file
197 ImageDataPacket im = new ImageDataPacket();
198 im.ImageID.Packets = 1;
199 im.ImageID.ID = req.ImageInfo.FullID;
200 im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
201 im.ImageData.Data = req.ImageInfo.Data;
202 im.ImageID.Codec = 2;
203 req.RequestUser.OutPacket(im);
204 req.PacketCounter++;
205 //req.ImageInfo.l= time;
206 //System.Console.WriteLine("sent texture: "+req.image_info.FullID);
207 }
208 else
209 {
210 //more than one packet so split file up
211 ImageDataPacket im = new ImageDataPacket();
212 im.ImageID.Packets = (ushort)req.NumPackets;
213 im.ImageID.ID = req.ImageInfo.FullID;
214 im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
215 im.ImageData.Data = new byte[600];
216 Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600);
217 im.ImageID.Codec = 2;
218 req.RequestUser.OutPacket(im);
219 req.PacketCounter++;
220 //req.ImageInfo.last_used = time;
221 //System.Console.WriteLine("sent first packet of texture:
222 }
223 }
224 else
225 {
226 //send imagepacket
227 //more than one packet so split file up
228 ImagePacketPacket im = new ImagePacketPacket();
229 im.ImageID.Packet = (ushort)req.PacketCounter;
230 im.ImageID.ID = req.ImageInfo.FullID;
231 int size = req.ImageInfo.Data.Length - 600 - 1000 * (req.PacketCounter - 1);
232 if (size > 1000) size = 1000;
233 im.ImageData.Data = new byte[size];
234 Array.Copy(req.ImageInfo.Data, 600 + 1000 * (req.PacketCounter - 1), im.ImageData.Data, 0, size);
235 req.RequestUser.OutPacket(im);
236 req.PacketCounter++;
237 //req.ImageInfo.last_used = time;
238 //System.Console.WriteLine("sent a packet of texture: "+req.image_info.FullID);
239 }
240 }
241 }
242
243 //remove requests that have been completed
244 int count = 0;
245 for (int i = 0; i < num; i++)
246 {
247 if (this.TextureRequests.Count > count)
248 {
249 req = (AssetRequest)this.TextureRequests[count];
250 if (req.PacketCounter == req.NumPackets)
251 {
252 this.TextureRequests.Remove(req);
253 }
254 else
255 {
256 count++;
257 }
258 }
259 }
260
261 }
262 public void AssetReceived(AssetBase asset, bool IsTexture)
263 {
264 if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server
265 {
266 //check if it is a texture or not
267 //then add to the correct cache list
268 //then check for waiting requests for this asset/texture (in the Requested lists)
269 //and move those requests into the Requests list.
270 if (IsTexture)
271 {
272 TextureImage image = new TextureImage(asset);
273 this.Textures.Add(image.FullID, image);
274 if (this.RequestedTextures.ContainsKey(image.FullID))
275 {
276 AssetRequest req = this.RequestedTextures[image.FullID];
277 req.ImageInfo = image;
278 if (image.Data.LongLength > 600)
279 {
280 //over 600 bytes so split up file
281 req.NumPackets = 1 + (int)(image.Data.Length - 600 + 999) / 1000;
282 }
283 else
284 {
285 req.NumPackets = 1;
286 }
287 this.RequestedTextures.Remove(image.FullID);
288 this.TextureRequests.Add(req);
289 }
290 }
291 else
292 {
293 AssetInfo assetInf = new AssetInfo(asset);
294 this.Assets.Add(assetInf.FullID, assetInf);
295 if (this.RequestedAssets.ContainsKey(assetInf.FullID))
296 {
297 AssetRequest req = this.RequestedAssets[assetInf.FullID];
298 req.AssetInf = assetInf;
299 if (assetInf.Data.LongLength > 600)
300 {
301 //over 600 bytes so split up file
302 req.NumPackets = 1 + (int)(assetInf.Data.Length - 600 + 999) / 1000;
303 }
304 else
305 {
306 req.NumPackets = 1;
307 }
308 this.RequestedAssets.Remove(assetInf.FullID);
309 this.AssetRequests.Add(req);
310 }
311 }
312 }
313 }
314
315 public void AssetNotFound(AssetBase asset)
316 {
317 //the asset server had no knowledge of requested asset
318
319 }
320
321 #region Assets
322 /// <summary>
323 ///
324 /// </summary>
325 /// <param name="userInfo"></param>
326 /// <param name="transferRequest"></param>
327 public void AddAssetRequest(ClientView userInfo, TransferRequestPacket transferRequest)
328 {
329 LLUUID requestID = new LLUUID(transferRequest.TransferInfo.Params, 0);
330 //check to see if asset is in local cache, if not we need to request it from asset server.
331 if (!this.Assets.ContainsKey(requestID))
332 {
333 //not found asset
334 // so request from asset server
335 if (!this.RequestedAssets.ContainsKey(requestID))
336 {
337 AssetRequest request = new AssetRequest();
338 request.RequestUser = userInfo;
339 request.RequestAssetID = requestID;
340 request.TransferRequestID = transferRequest.TransferInfo.TransferID;
341 this.RequestedAssets.Add(requestID, request);
342 this._assetServer.RequestAsset(requestID, false);
343 }
344 return;
345 }
346 //it is in our cache
347 AssetInfo asset = this.Assets[requestID];
348
349 //work out how many packets it should be sent in
350 // and add to the AssetRequests list
351 AssetRequest req = new AssetRequest();
352 req.RequestUser = userInfo;
353 req.RequestAssetID = requestID;
354 req.TransferRequestID = transferRequest.TransferInfo.TransferID;
355 req.AssetInf = asset;
356
357 if (asset.Data.LongLength > 600)
358 {
359 //over 600 bytes so split up file
360 req.NumPackets = 1 + (int)(asset.Data.Length - 600 + 999) / 1000;
361 }
362 else
363 {
364 req.NumPackets = 1;
365 }
366
367 this.AssetRequests.Add(req);
368 }
369
370 /// <summary>
371 ///
372 /// </summary>
373 private void ProcessAssetQueue()
374 {
375 if (this.AssetRequests.Count == 0)
376 {
377 //no requests waiting
378 return;
379 }
380 int num;
381
382 if (this.AssetRequests.Count < 5)
383 {
384 //lower than 5 so do all of them
385 num = this.AssetRequests.Count;
386 }
387 else
388 {
389 num = 5;
390 }
391 AssetRequest req;
392 for (int i = 0; i < num; i++)
393 {
394 req = (AssetRequest)this.AssetRequests[i];
395
396 TransferInfoPacket Transfer = new TransferInfoPacket();
397 Transfer.TransferInfo.ChannelType = 2;
398 Transfer.TransferInfo.Status = 0;
399 Transfer.TransferInfo.TargetType = 0;
400 Transfer.TransferInfo.Params = req.RequestAssetID.GetBytes();
401 Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length;
402 Transfer.TransferInfo.TransferID = req.TransferRequestID;
403 req.RequestUser.OutPacket(Transfer);
404
405 if (req.NumPackets == 1)
406 {
407 TransferPacketPacket TransferPacket = new TransferPacketPacket();
408 TransferPacket.TransferData.Packet = 0;
409 TransferPacket.TransferData.ChannelType = 2;
410 TransferPacket.TransferData.TransferID = req.TransferRequestID;
411 TransferPacket.TransferData.Data = req.AssetInf.Data;
412 TransferPacket.TransferData.Status = 1;
413 req.RequestUser.OutPacket(TransferPacket);
414 }
415 else
416 {
417 //more than one packet so split file up , for now it can't be bigger than 2000 bytes
418 TransferPacketPacket TransferPacket = new TransferPacketPacket();
419 TransferPacket.TransferData.Packet = 0;
420 TransferPacket.TransferData.ChannelType = 2;
421 TransferPacket.TransferData.TransferID = req.TransferRequestID;
422 byte[] chunk = new byte[1000];
423 Array.Copy(req.AssetInf.Data, chunk, 1000);
424 TransferPacket.TransferData.Data = chunk;
425 TransferPacket.TransferData.Status = 0;
426 req.RequestUser.OutPacket(TransferPacket);
427
428 TransferPacket = new TransferPacketPacket();
429 TransferPacket.TransferData.Packet = 1;
430 TransferPacket.TransferData.ChannelType = 2;
431 TransferPacket.TransferData.TransferID = req.TransferRequestID;
432 byte[] chunk1 = new byte[(req.AssetInf.Data.Length - 1000)];
433 Array.Copy(req.AssetInf.Data, 1000, chunk1, 0, chunk1.Length);
434 TransferPacket.TransferData.Data = chunk1;
435 TransferPacket.TransferData.Status = 1;
436 req.RequestUser.OutPacket(TransferPacket);
437 }
438
439 }
440
441 //remove requests that have been completed
442 for (int i = 0; i < num; i++)
443 {
444 this.AssetRequests.RemoveAt(0);
445 }
446
447 }
448
449 public AssetInfo CloneAsset(LLUUID newOwner, AssetInfo sourceAsset)
450 {
451 AssetInfo newAsset = new AssetInfo();
452 newAsset.Data = new byte[sourceAsset.Data.Length];
453 Array.Copy(sourceAsset.Data, newAsset.Data, sourceAsset.Data.Length);
454 newAsset.FullID = LLUUID.Random();
455 newAsset.Type = sourceAsset.Type;
456 newAsset.InvType = sourceAsset.InvType;
457 return (newAsset);
458 }
459 #endregion
460
461 #region Textures
462 /// <summary>
463 ///
464 /// </summary>
465 /// <param name="userInfo"></param>
466 /// <param name="imageID"></param>
467 public void AddTextureRequest(ClientView userInfo, LLUUID imageID)
468 {
469 //check to see if texture is in local cache, if not request from asset server
470 if (!this.Textures.ContainsKey(imageID))
471 {
472 if (!this.RequestedTextures.ContainsKey(imageID))
473 {
474 //not is cache so request from asset server
475 AssetRequest request = new AssetRequest();
476 request.RequestUser = userInfo;
477 request.RequestAssetID = imageID;
478 request.IsTextureRequest = true;
479 this.RequestedTextures.Add(imageID, request);
480 this._assetServer.RequestAsset(imageID, true);
481 }
482 return;
483 }
484
485 TextureImage imag = this.Textures[imageID];
486 AssetRequest req = new AssetRequest();
487 req.RequestUser = userInfo;
488 req.RequestAssetID = imageID;
489 req.IsTextureRequest = true;
490 req.ImageInfo = imag;
491
492 if (imag.Data.LongLength > 600)
493 {
494 //over 600 bytes so split up file
495 req.NumPackets = 1 + (int)(imag.Data.Length - 600 + 999) / 1000;
496 }
497 else
498 {
499 req.NumPackets = 1;
500 }
501 this.TextureRequests.Add(req);
502 }
503
504 public TextureImage CloneImage(LLUUID newOwner, TextureImage source)
505 {
506 TextureImage newImage = new TextureImage();
507 newImage.Data = new byte[source.Data.Length];
508 Array.Copy(source.Data, newImage.Data, source.Data.Length);
509 //newImage.filename = source.filename;
510 newImage.FullID = LLUUID.Random();
511 newImage.Name = source.Name;
512 return (newImage);
513 }
514 #endregion
515
516 }
517
518 public class AssetRequest
519 {
520 public ClientView RequestUser;
521 public LLUUID RequestAssetID;
522 public AssetInfo AssetInf;
523 public TextureImage ImageInfo;
524 public LLUUID TransferRequestID;
525 public long DataPointer = 0;
526 public int NumPackets = 0;
527 public int PacketCounter = 0;
528 public bool IsTextureRequest;
529 //public bool AssetInCache;
530 //public int TimeRequested;
531
532 public AssetRequest()
533 {
534
535 }
536 }
537
538 public class AssetInfo : AssetBase
539 {
540 public AssetInfo()
541 {
542
543 }
544
545 public AssetInfo(AssetBase aBase)
546 {
547 Data = aBase.Data;
548 FullID = aBase.FullID;
549 Type = aBase.Type;
550 InvType = aBase.InvType;
551 Name = aBase.Name;
552 Description = aBase.Description;
553 }
554 }
555
556 public class TextureImage : AssetBase
557 {
558 public TextureImage()
559 {
560
561 }
562
563 public TextureImage(AssetBase aBase)
564 {
565 Data = aBase.Data;
566 FullID = aBase.FullID;
567 Type = aBase.Type;
568 InvType = aBase.InvType;
569 Name = aBase.Name;
570 Description = aBase.Description;
571 }
572 }
573
574}
diff --git a/OpenSim/OpenSim.RegionServer/Assets/InventoryCache.cs b/OpenSim/OpenSim.RegionServer/Assets/InventoryCache.cs
new file mode 100644
index 0000000..64a7a32
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/Assets/InventoryCache.cs
@@ -0,0 +1,336 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28using System;
29using System.Collections.Generic;
30using libsecondlife;
31using OpenSim;
32using libsecondlife.Packets;
33//using OpenSim.GridServers;
34using OpenSim.Framework.Inventory;
35using OpenSim.Framework.Types;
36using OpenSim.Framework.Interfaces;
37
38namespace OpenSim.Assets
39{
40 /// <summary>
41 /// Description of InventoryManager.
42 /// </summary>
43 public class InventoryCache
44 {
45 private Dictionary<LLUUID, AgentInventory> _agentsInventory;
46 private List<UserServerRequest> _serverRequests; //list of requests made to user server.
47 private System.Text.Encoding _enc = System.Text.Encoding.ASCII;
48 private const uint FULL_MASK_PERMISSIONS = 2147483647;
49
50 public InventoryCache()
51 {
52 _agentsInventory = new Dictionary<LLUUID, AgentInventory>();
53 _serverRequests = new List<UserServerRequest>();
54 }
55
56 public void AddNewAgentsInventory(AgentInventory agentInventory)
57 {
58 if (!this._agentsInventory.ContainsKey(agentInventory.AgentID))
59 {
60 this._agentsInventory.Add(agentInventory.AgentID, agentInventory);
61 }
62 }
63
64 public AgentInventory FetchAgentsInventory(LLUUID agentID, IUserServer userserver)
65 {
66 AgentInventory res = null;
67 if (!this._agentsInventory.ContainsKey(agentID))
68 {
69 res = userserver.RequestAgentsInventory(agentID);
70 this._agentsInventory.Add(agentID,res);
71 }
72 return res;
73 }
74
75 public AgentInventory GetAgentsInventory(LLUUID agentID)
76 {
77 if (this._agentsInventory.ContainsKey(agentID))
78 {
79 return this._agentsInventory[agentID];
80 }
81
82 return null;
83 }
84
85 public void ClientLeaving(LLUUID clientID, IUserServer userserver)
86 {
87 if (this._agentsInventory.ContainsKey(clientID))
88 {
89 if (userserver != null)
90 {
91 userserver.UpdateAgentsInventory(clientID, this._agentsInventory[clientID]);
92 }
93 this._agentsInventory.Remove(clientID);
94 }
95 }
96
97 public bool CreateNewInventoryFolder(ClientView remoteClient, LLUUID folderID)
98 {
99 return this.CreateNewInventoryFolder(remoteClient, folderID, 0);
100 }
101
102 public bool CreateNewInventoryFolder(ClientView remoteClient, LLUUID folderID, ushort type)
103 {
104 bool res = false;
105 if (folderID != LLUUID.Zero) //don't create a folder with a zero id
106 {
107 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
108 {
109 res = this._agentsInventory[remoteClient.AgentID].CreateNewFolder(folderID, type);
110 }
111 }
112 return res;
113 }
114
115 public bool CreateNewInventoryFolder(ClientView remoteClient, LLUUID folderID, ushort type, string folderName, LLUUID parent)
116 {
117 bool res = false;
118 if (folderID != LLUUID.Zero) //don't create a folder with a zero id
119 {
120 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
121 {
122 res = this._agentsInventory[remoteClient.AgentID].CreateNewFolder(folderID, type, folderName, parent);
123 }
124 }
125 return res;
126 }
127
128 public LLUUID AddNewInventoryItem(ClientView remoteClient, LLUUID folderID, OpenSim.Framework.Types.AssetBase asset)
129 {
130 LLUUID newItem = null;
131 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
132 {
133 newItem = this._agentsInventory[remoteClient.AgentID].AddToInventory(folderID, asset);
134 if (newItem != null)
135 {
136 InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[newItem];
137 this.SendItemUpdateCreate(remoteClient, Item);
138 }
139 }
140
141 return newItem;
142 }
143 public bool DeleteInventoryItem(ClientView remoteClient, LLUUID itemID)
144 {
145 bool res = false;
146 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
147 {
148 res = this._agentsInventory[remoteClient.AgentID].DeleteFromInventory(itemID);
149 if (res)
150 {
151 RemoveInventoryItemPacket remove = new RemoveInventoryItemPacket();
152 remove.AgentData.AgentID = remoteClient.AgentID;
153 remove.AgentData.SessionID = remoteClient.SessionID;
154 remove.InventoryData = new RemoveInventoryItemPacket.InventoryDataBlock[1];
155 remove.InventoryData[0] = new RemoveInventoryItemPacket.InventoryDataBlock();
156 remove.InventoryData[0].ItemID = itemID;
157 remoteClient.OutPacket(remove);
158 }
159 }
160
161 return res;
162 }
163
164 public bool UpdateInventoryItemAsset(ClientView remoteClient, LLUUID itemID, OpenSim.Framework.Types.AssetBase asset)
165 {
166 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
167 {
168 bool res = _agentsInventory[remoteClient.AgentID].UpdateItemAsset(itemID, asset);
169 if (res)
170 {
171 InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID];
172 this.SendItemUpdateCreate(remoteClient, Item);
173 }
174 return res;
175 }
176
177 return false;
178 }
179
180 public bool UpdateInventoryItemDetails(ClientView remoteClient, LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet)
181 {
182 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
183 {
184 bool res = _agentsInventory[remoteClient.AgentID].UpdateItemDetails(itemID, packet);
185 if (res)
186 {
187 InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID];
188 this.SendItemUpdateCreate(remoteClient, Item);
189 }
190 return res;
191 }
192
193 return false;
194 }
195
196 public void FetchInventoryDescendents(ClientView userInfo, FetchInventoryDescendentsPacket FetchDescend)
197 {
198 if (this._agentsInventory.ContainsKey(userInfo.AgentID))
199 {
200 AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID];
201 if (FetchDescend.InventoryData.FetchItems)
202 {
203 if (agentInventory.InventoryFolders.ContainsKey(FetchDescend.InventoryData.FolderID))
204 {
205 InventoryFolder Folder = agentInventory.InventoryFolders[FetchDescend.InventoryData.FolderID];
206 InventoryDescendentsPacket Descend = new InventoryDescendentsPacket();
207 Descend.AgentData.AgentID = userInfo.AgentID;
208 Descend.AgentData.OwnerID = Folder.OwnerID;
209 Descend.AgentData.FolderID = FetchDescend.InventoryData.FolderID;
210 Descend.AgentData.Descendents = Folder.Items.Count;
211 Descend.AgentData.Version = Folder.Items.Count;
212
213
214 Descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[Folder.Items.Count];
215 for (int i = 0; i < Folder.Items.Count; i++)
216 {
217
218 InventoryItem Item = Folder.Items[i];
219 Descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock();
220 Descend.ItemData[i].ItemID = Item.ItemID;
221 Descend.ItemData[i].AssetID = Item.AssetID;
222 Descend.ItemData[i].CreatorID = Item.CreatorID;
223 Descend.ItemData[i].BaseMask = FULL_MASK_PERMISSIONS;
224 Descend.ItemData[i].CreationDate = 1000;
225 Descend.ItemData[i].Description = _enc.GetBytes(Item.Description + "\0");
226 Descend.ItemData[i].EveryoneMask = FULL_MASK_PERMISSIONS;
227 Descend.ItemData[i].Flags = 1;
228 Descend.ItemData[i].FolderID = Item.FolderID;
229 Descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
230 Descend.ItemData[i].GroupMask = FULL_MASK_PERMISSIONS;
231 Descend.ItemData[i].InvType = Item.InvType;
232 Descend.ItemData[i].Name = _enc.GetBytes(Item.Name + "\0");
233 Descend.ItemData[i].NextOwnerMask = FULL_MASK_PERMISSIONS;
234 Descend.ItemData[i].OwnerID = Item.OwnerID;
235 Descend.ItemData[i].OwnerMask = FULL_MASK_PERMISSIONS;
236 Descend.ItemData[i].SalePrice = 100;
237 Descend.ItemData[i].SaleType = 0;
238 Descend.ItemData[i].Type = Item.Type;
239 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);
240 }
241
242 userInfo.OutPacket(Descend);
243
244 }
245 }
246 else
247 {
248 Console.WriteLine("fetch subfolders");
249 }
250 }
251 }
252
253 public void FetchInventory(ClientView userInfo, FetchInventoryPacket FetchItems)
254 {
255 if (this._agentsInventory.ContainsKey(userInfo.AgentID))
256 {
257 AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID];
258
259 for (int i = 0; i < FetchItems.InventoryData.Length; i++)
260 {
261 if (agentInventory.InventoryItems.ContainsKey(FetchItems.InventoryData[i].ItemID))
262 {
263 InventoryItem Item = agentInventory.InventoryItems[FetchItems.InventoryData[i].ItemID];
264 FetchInventoryReplyPacket InventoryReply = new FetchInventoryReplyPacket();
265 InventoryReply.AgentData.AgentID = userInfo.AgentID;
266 InventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1];
267 InventoryReply.InventoryData[0] = new FetchInventoryReplyPacket.InventoryDataBlock();
268 InventoryReply.InventoryData[0].ItemID = Item.ItemID;
269 InventoryReply.InventoryData[0].AssetID = Item.AssetID;
270 InventoryReply.InventoryData[0].CreatorID = Item.CreatorID;
271 InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS;
272 InventoryReply.InventoryData[0].CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
273 InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0");
274 InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
275 InventoryReply.InventoryData[0].Flags = 0;
276 InventoryReply.InventoryData[0].FolderID = Item.FolderID;
277 InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
278 InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
279 InventoryReply.InventoryData[0].InvType = Item.InvType;
280 InventoryReply.InventoryData[0].Name = _enc.GetBytes(Item.Name + "\0");
281 InventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS;
282 InventoryReply.InventoryData[0].OwnerID = Item.OwnerID;
283 InventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS;
284 InventoryReply.InventoryData[0].SalePrice = 100;
285 InventoryReply.InventoryData[0].SaleType = 0;
286 InventoryReply.InventoryData[0].Type = Item.Type;
287 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);
288 userInfo.OutPacket(InventoryReply);
289 }
290 }
291 }
292 }
293
294 private void SendItemUpdateCreate(ClientView remoteClient, InventoryItem Item)
295 {
296
297 UpdateCreateInventoryItemPacket InventoryReply = new UpdateCreateInventoryItemPacket();
298 InventoryReply.AgentData.AgentID = remoteClient.AgentID;
299 InventoryReply.AgentData.SimApproved = true;
300 InventoryReply.InventoryData = new UpdateCreateInventoryItemPacket.InventoryDataBlock[1];
301 InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock();
302 InventoryReply.InventoryData[0].ItemID = Item.ItemID;
303 InventoryReply.InventoryData[0].AssetID = Item.AssetID;
304 InventoryReply.InventoryData[0].CreatorID = Item.CreatorID;
305 InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS;
306 InventoryReply.InventoryData[0].CreationDate = 1000;
307 InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0");
308 InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
309 InventoryReply.InventoryData[0].Flags = 0;
310 InventoryReply.InventoryData[0].FolderID = Item.FolderID;
311 InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
312 InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
313 InventoryReply.InventoryData[0].InvType = Item.InvType;
314 InventoryReply.InventoryData[0].Name = _enc.GetBytes(Item.Name + "\0");
315 InventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS;
316 InventoryReply.InventoryData[0].OwnerID = Item.OwnerID;
317 InventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS;
318 InventoryReply.InventoryData[0].SalePrice = 100;
319 InventoryReply.InventoryData[0].SaleType = 0;
320 InventoryReply.InventoryData[0].Type = Item.Type;
321 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);
322
323 remoteClient.OutPacket(InventoryReply);
324 }
325 }
326
327
328
329 public class UserServerRequest
330 {
331 public UserServerRequest()
332 {
333
334 }
335 }
336}
diff --git a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs
new file mode 100644
index 0000000..99b86d4
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsBase.cs
@@ -0,0 +1,105 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using OpenSim.Framework.Interfaces;
6using OpenSim.Framework.Types;
7
8namespace OpenSim
9{
10 public class AuthenticateSessionsBase
11 {
12 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
13
14 public AuthenticateSessionsBase()
15 {
16
17 }
18
19 public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
20 {
21 AgentCircuitData validcircuit = null;
22 if (this.AgentCircuits.ContainsKey(circuitcode))
23 {
24 validcircuit = this.AgentCircuits[circuitcode];
25 }
26 AuthenticateResponse user = new AuthenticateResponse();
27 if (validcircuit == null)
28 {
29 //don't have this circuit code in our list
30 user.Authorised = false;
31 return (user);
32 }
33
34 if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
35 {
36 user.Authorised = true;
37 user.LoginInfo = new Login();
38 user.LoginInfo.Agent = agentID;
39 user.LoginInfo.Session = sessionID;
40 user.LoginInfo.SecureSession = validcircuit.SecureSessionID;
41 user.LoginInfo.First = validcircuit.firstname;
42 user.LoginInfo.Last = validcircuit.lastname;
43 user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder;
44 user.LoginInfo.BaseFolder = validcircuit.BaseFolder;
45 }
46 else
47 {
48 // Invalid
49 user.Authorised = false;
50 }
51
52 return (user);
53 }
54
55 public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
56 {
57 if (this.AgentCircuits.ContainsKey(circuitCode))
58 {
59 this.AgentCircuits[circuitCode] = agentData;
60 }
61 else
62 {
63 this.AgentCircuits.Add(circuitCode, agentData);
64 }
65 }
66
67 public LLVector3 GetPosition(uint circuitCode)
68 {
69 LLVector3 vec = new LLVector3();
70 if (this.AgentCircuits.ContainsKey(circuitCode))
71 {
72 vec = this.AgentCircuits[circuitCode].startpos;
73 }
74 return vec;
75 }
76
77 public void UpdateAgentData(AgentCircuitData agentData)
78 {
79 if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode))
80 {
81 this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname;
82 this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname;
83 this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos;
84 // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z);
85 }
86 }
87
88 public void UpdateAgentChildStatus(uint circuitcode, bool childstatus)
89 {
90 if (this.AgentCircuits.ContainsKey(circuitcode))
91 {
92 this.AgentCircuits[circuitcode].child = childstatus;
93 }
94 }
95
96 public bool GetAgentChildStatus(uint circuitcode)
97 {
98 if (this.AgentCircuits.ContainsKey(circuitcode))
99 {
100 return this.AgentCircuits[circuitcode].child;
101 }
102 return false;
103 }
104 }
105}
diff --git a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs
new file mode 100644
index 0000000..6c1c7d2
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsLocal.cs
@@ -0,0 +1,31 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using OpenSim.Framework.Types;
6
7namespace OpenSim
8{
9 public class AuthenticateSessionsLocal : AuthenticateSessionsBase
10 {
11 public AuthenticateSessionsLocal()
12 {
13
14 }
15
16 public void AddNewSession(Login loginData)
17 {
18 AgentCircuitData agent = new AgentCircuitData();
19 agent.AgentID = loginData.Agent;
20 agent.firstname = loginData.First;
21 agent.lastname = loginData.Last;
22 agent.SessionID = loginData.Session;
23 agent.SecureSessionID = loginData.SecureSession;
24 agent.circuitcode = loginData.CircuitCode;
25 agent.BaseFolder = loginData.BaseFolder;
26 agent.InventoryFolder = loginData.InventoryFolder;
27 agent.startpos = new LLVector3(128,128,70);
28 this.AddNewCircuit(agent.circuitcode, agent);
29 }
30 }
31}
diff --git a/OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs
new file mode 100644
index 0000000..0802d75
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/AuthenticateSessionsRemote.cs
@@ -0,0 +1,46 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Text;
5using System.Xml;
6using libsecondlife;
7using OpenSim.Framework.Types;
8using Nwc.XmlRpc;
9
10namespace OpenSim
11{
12 public class AuthenticateSessionsRemote : AuthenticateSessionsBase
13 {
14 public AuthenticateSessionsRemote()
15 {
16
17 }
18
19 public XmlRpcResponse ExpectUser(XmlRpcRequest request)
20 {
21 Hashtable requestData = (Hashtable)request.Params[0];
22 AgentCircuitData agentData = new AgentCircuitData();
23 agentData.SessionID = new LLUUID((string)requestData["session_id"]);
24 agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
25 agentData.firstname = (string)requestData["firstname"];
26 agentData.lastname = (string)requestData["lastname"];
27 agentData.AgentID = new LLUUID((string)requestData["agent_id"]);
28 agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
29 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
30 {
31 agentData.child = true;
32 }
33 else
34 {
35 agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"]));
36 agentData.child = false;
37 // Console.WriteLine("expect user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z);
38
39 }
40
41 this.AddNewCircuit(agentData.circuitcode, agentData);
42
43 return new XmlRpcResponse();
44 }
45 }
46}
diff --git a/OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs b/OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs
new file mode 100644
index 0000000..2299fa4
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/CAPS/AdminWebFront.cs
@@ -0,0 +1,256 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.IO;
5using OpenSim.world;
6using OpenSim.UserServer;
7using OpenSim.Servers;
8using OpenSim.Assets;
9using OpenSim.Framework.Inventory;
10using libsecondlife;
11using OpenSim.RegionServer.world.scripting;
12using Avatar=libsecondlife.Avatar;
13
14namespace OpenSim.CAPS
15{
16 public class AdminWebFront
17 {
18 private string AdminPage;
19 private string NewAccountForm;
20 private string LoginForm;
21 private string passWord = "Admin";
22 private World m_world;
23 private LoginServer _userServer;
24 private InventoryCache _inventoryCache;
25
26 public AdminWebFront(string password, World world, InventoryCache inventoryCache, LoginServer userserver)
27 {
28 _inventoryCache = inventoryCache;
29 _userServer = userserver;
30 m_world = world;
31 passWord = password;
32 LoadAdminPage();
33 }
34
35 public void LoadMethods( BaseHttpServer server )
36 {
37 server.AddRestHandler("GET", "/Admin", GetAdminPage);
38 server.AddRestHandler("GET", "/Admin/Welcome", GetWelcomePage);
39 server.AddRestHandler("GET", "/Admin/Accounts", GetAccountsPage );
40 server.AddRestHandler("GET", "/Admin/Clients", GetConnectedClientsPage);
41 server.AddRestHandler("GET", "/Admin/Entities", GetEntitiesPage);
42 server.AddRestHandler("GET", "/Admin/Scripts", GetScriptsPage);
43 server.AddRestHandler("GET", "/Admin/AddTestScript", AddTestScript );
44 server.AddRestHandler("GET", "/ClientInventory", GetClientsInventory);
45
46 server.AddRestHandler("POST", "/Admin/NewAccount", PostNewAccount );
47 server.AddRestHandler("POST", "/Admin/Login", PostLogin );
48 }
49
50 private string GetWelcomePage(string request, string path, string param)
51 {
52 string responseString;
53 responseString = "Welcome to the OpenSim Admin Page";
54 responseString += "<br><br><br> " + LoginForm;
55 return responseString;
56 }
57
58 private string PostLogin(string requestBody, string path, string param)
59 {
60 string responseString;
61// Console.WriteLine(requestBody);
62 if (requestBody == passWord)
63 {
64 responseString = "<p> Login Successful </p>";
65 }
66 else
67 {
68 responseString = "<p> Password Error </p>";
69 responseString += "<p> Please Login with the correct password </p>";
70 responseString += "<br><br> " + LoginForm;
71 }
72 return responseString;
73 }
74
75 private string PostNewAccount(string requestBody, string path, string param)
76 {
77 string responseString;
78 string firstName = "";
79 string secondName = "";
80 string userPasswd = "";
81 string[] comp;
82 string[] passw;
83 string[] line;
84 string delimStr = "&";
85 char[] delimiter = delimStr.ToCharArray();
86 string delimStr2 = "=";
87 char[] delimiter2 = delimStr2.ToCharArray();
88
89 //Console.WriteLine(requestBody);
90 comp = requestBody.Split(delimiter);
91 passw = comp[3].Split(delimiter2);
92 if (passw[1] == passWord) // check admin password is correct
93 {
94
95 line = comp[0].Split(delimiter2); //split firstname
96 if (line.Length > 1)
97 {
98 firstName = line[1];
99 }
100 line = comp[1].Split(delimiter2); //split secondname
101 if (line.Length > 1)
102 {
103 secondName = line[1];
104 }
105 line = comp[2].Split(delimiter2); //split user password
106 if (line.Length > 1)
107 {
108 userPasswd = line[1];
109 }
110 if (this._userServer != null)
111 {
112 this._userServer.CreateUserAccount(firstName, secondName, userPasswd);
113 }
114 responseString = "<p> New Account created </p>";
115 }
116 else
117 {
118 responseString = "<p> Admin password is incorrect, please login with the correct password</p>";
119 responseString += "<br><br>" + LoginForm;
120 }
121 return responseString;
122 }
123
124 private string GetConnectedClientsPage(string request, string path, string param)
125 {
126 string responseString;
127 responseString = " <p> Listing connected Clients </p>";
128 OpenSim.world.Avatar TempAv;
129 foreach (libsecondlife.LLUUID UUID in m_world.Entities.Keys)
130 {
131 if (m_world.Entities[UUID].ToString() == "OpenSim.world.Avatar")
132 {
133 TempAv = (OpenSim.world.Avatar)m_world.Entities[UUID];
134 responseString += "<p> Client: ";
135 responseString += TempAv.firstname + " , " + TempAv.lastname + " , <A HREF=\"javascript:loadXMLDoc('ClientInventory/" + UUID.ToString() + "')\">" + UUID + "</A> , " + TempAv.ControllingClient.SessionID + " , " + TempAv.ControllingClient.CircuitCode + " , " + TempAv.ControllingClient.userEP.ToString();
136 responseString += "</p>";
137 }
138 }
139 return responseString;
140 }
141
142 private string AddTestScript(string request, string path, string param)
143 {
144 int index = path.LastIndexOf('/');
145
146 string lluidStr = path.Substring(index+1);
147
148 LLUUID id;
149
150 if( LLUUID.TryParse( lluidStr, out id ) )
151 {
152 // This is just here for concept purposes... Remove!
153 m_world.AddScript( m_world.Entities[id], new FollowRandomAvatar());
154 return String.Format("Added new script to object [{0}]", id);
155 }
156 else
157 {
158 return String.Format("Couldn't parse [{0}]", lluidStr );
159 }
160 }
161
162 private string GetScriptsPage(string request, string path, string param)
163 {
164 return String.Empty;
165 }
166
167 private string GetEntitiesPage(string request, string path, string param)
168 {
169 string responseString;
170 responseString = " <p> Listing current entities</p><ul>";
171
172 foreach (Entity entity in m_world.Entities.Values)
173 {
174 string testScriptLink = "javascript:loadXMLDoc('Admin/AddTestScript/" + entity.uuid.ToString() + "');";
175 responseString += String.Format( "<li>[{0}] \"{1}\" @ {2} <a href=\"{3}\">add test script</a></li>", entity.uuid, entity.Name, entity.Pos, testScriptLink );
176 }
177 responseString += "</ul>";
178 return responseString;
179 }
180
181 private string GetClientsInventory(string request, string path, string param)
182 {
183 string[] line;
184 string delimStr = "/";
185 char[] delimiter = delimStr.ToCharArray();
186 string responseString;
187 responseString = " <p> Listing Inventory </p>";
188
189 line = path.Split(delimiter);
190 if (line.Length > 2)
191 {
192 if (line[1] == "ClientInventory")
193 {
194 AgentInventory inven = this._inventoryCache.GetAgentsInventory(new libsecondlife.LLUUID(line[2]));
195 responseString += " <p> Client: " + inven.AgentID.ToStringHyphenated() +" </p>";
196 if (inven != null)
197 {
198 foreach (InventoryItem item in inven.InventoryItems.Values)
199 {
200 responseString += "<p> InventoryItem: ";
201 responseString += item.Name +" , "+ item.ItemID +" , "+ item.Type +" , "+ item.FolderID +" , "+ item.AssetID +" , "+ item.Description ;
202 responseString += "</p>";
203 }
204 }
205 }
206 }
207 return responseString;
208 }
209
210 private string GetCachedAssets(string request, string path, string param)
211 {
212 return "";
213 }
214
215 private string GetAccountsPage(string request, string path, string param)
216 {
217 string responseString;
218 responseString = "<p> Account management </p>";
219 responseString += "<br> ";
220 responseString += "<p> Create New Account </p>";
221 responseString += NewAccountForm;
222 return responseString;
223 }
224
225 private string GetAdminPage(string request, string path, string param)
226 {
227 return AdminPage;
228 }
229
230 private void LoadAdminPage()
231 {
232 try
233 {
234 StreamReader SR;
235
236 SR = File.OpenText("testadmin.htm");
237 AdminPage = SR.ReadToEnd();
238 SR.Close();
239
240 SR = File.OpenText("newaccountform.htm");
241 NewAccountForm = SR.ReadToEnd();
242 SR.Close();
243
244 SR = File.OpenText("login.htm");
245 LoginForm = SR.ReadToEnd();
246 SR.Close();
247 }
248 catch (Exception e)
249 {
250 Console.WriteLine(e.ToString());
251 }
252
253 }
254
255 }
256}
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs b/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs
new file mode 100644
index 0000000..1121839
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs
@@ -0,0 +1,167 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using libsecondlife;
5using libsecondlife.Packets;
6using Nwc.XmlRpc;
7using System.Net;
8using System.Net.Sockets;
9using System.IO;
10using System.Threading;
11using System.Timers;
12using OpenSim.Framework.Interfaces;
13using OpenSim.Framework.Types;
14using OpenSim.Framework.Inventory;
15using OpenSim.Framework.Utilities;
16using OpenSim.world;
17using OpenSim.Assets;
18
19namespace OpenSim
20{
21 public partial class ClientView
22 {
23
24 public void EnableNeighbours()
25 {
26 if ((this.m_gridServer.GetName() == "Remote") && (!this.m_child))
27 {
28 Hashtable SimParams;
29 ArrayList SendParams;
30 XmlRpcRequest GridReq;
31 XmlRpcResponse GridResp;
32 List<Packet> enablePackets = new List<Packet>();
33
34 RemoteGridBase gridServer = (RemoteGridBase)this.m_gridServer;
35
36 foreach (Hashtable neighbour in gridServer.neighbours)
37 {
38 try
39 {
40 string neighbourIPStr = (string)neighbour["sim_ip"];
41 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr);
42 ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]);
43 string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString();
44
45 Console.WriteLine(reqUrl);
46
47 SimParams = new Hashtable();
48 SimParams["session_id"] = this.SessionID.ToString();
49 SimParams["secure_session_id"] = this.SecureSessionID.ToString();
50 SimParams["firstname"] = this.ClientAvatar.firstname;
51 SimParams["lastname"] = this.ClientAvatar.lastname;
52 SimParams["agent_id"] = this.AgentID.ToString();
53 SimParams["circuit_code"] = (Int32)this.CircuitCode;
54 SimParams["child_agent"] = "1";
55 SendParams = new ArrayList();
56 SendParams.Add(SimParams);
57
58 GridReq = new XmlRpcRequest("expect_user", SendParams);
59 GridResp = GridReq.Send(reqUrl, 3000);
60 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
61 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
62 enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
63
64
65 byte[] byteIP = neighbourIP.GetAddressBytes();
66 enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
67 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
68 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
69 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
70 enablesimpacket.SimulatorInfo.Port = neighbourPort;
71 enablePackets.Add(enablesimpacket);
72 }
73 catch (Exception e)
74 {
75 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Could not connect to neighbour " + neighbour["sim_ip"] + ":" + neighbour["sim_port"] + ", continuing.");
76 }
77 }
78 Thread.Sleep(3000);
79 foreach (Packet enable in enablePackets)
80 {
81 this.OutPacket(enable);
82 }
83 enablePackets.Clear();
84
85 }
86 }
87
88 public void CrossSimBorder(LLVector3 avatarpos)
89 { // VERY VERY BASIC
90
91 LLVector3 newpos = avatarpos;
92 uint neighbourx = this.m_regionData.RegionLocX;
93 uint neighboury = this.m_regionData.RegionLocY;
94
95 if (avatarpos.X < 0)
96 {
97 neighbourx -= 1;
98 newpos.X = 254;
99 }
100 if (avatarpos.X > 255)
101 {
102 neighbourx += 1;
103 newpos.X = 1;
104 }
105 if (avatarpos.Y < 0)
106 {
107 neighboury -= 1;
108 newpos.Y = 254;
109 }
110 if (avatarpos.Y > 255)
111 {
112 neighboury += 1;
113 newpos.Y = 1;
114 }
115 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:CrossSimBorder() - Crossing border to neighbouring sim at [" + neighbourx.ToString() + "," + neighboury.ToString() + "]");
116
117 Hashtable SimParams;
118 ArrayList SendParams;
119 XmlRpcRequest GridReq;
120 XmlRpcResponse GridResp;
121 foreach (Hashtable borderingSim in ((RemoteGridBase)m_gridServer).neighbours)
122 {
123 if (((string)borderingSim["region_locx"]).Equals(neighbourx.ToString()) && ((string)borderingSim["region_locy"]).Equals(neighboury.ToString()))
124 {
125 Console.WriteLine("found the neighbouring sim");
126 SimParams = new Hashtable();
127 SimParams["firstname"] = this.ClientAvatar.firstname;
128 SimParams["lastname"] = this.ClientAvatar.lastname;
129 SimParams["circuit_code"] = this.CircuitCode.ToString();
130 SimParams["pos_x"] = newpos.X.ToString();
131 SimParams["pos_y"] = newpos.Y.ToString();
132 SimParams["pos_z"] = newpos.Z.ToString();
133 SendParams = new ArrayList();
134 SendParams.Add(SimParams);
135
136 GridReq = new XmlRpcRequest("agent_crossing", SendParams);
137 GridResp = GridReq.Send("http://" + borderingSim["sim_ip"] + ":" + borderingSim["sim_port"], 3000);
138
139 CrossedRegionPacket NewSimPack = new CrossedRegionPacket();
140 NewSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock();
141 NewSimPack.AgentData.AgentID = this.AgentID;
142 NewSimPack.AgentData.SessionID = this.SessionID;
143 NewSimPack.Info = new CrossedRegionPacket.InfoBlock();
144 NewSimPack.Info.Position = newpos;
145 NewSimPack.Info.LookAt = new LLVector3(0.99f, 0.042f, 0); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!!
146 NewSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock();
147 NewSimPack.RegionData.RegionHandle = Helpers.UIntsToLong((uint)(Convert.ToInt32(borderingSim["region_locx"]) * 256), (uint)(Convert.ToInt32(borderingSim["region_locy"]) * 256));
148 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse((string)borderingSim["sim_ip"]);
149 byte[] byteIP = neighbourIP.GetAddressBytes();
150 NewSimPack.RegionData.SimIP = (uint)byteIP[3] << 24;
151 NewSimPack.RegionData.SimIP += (uint)byteIP[2] << 16;
152 NewSimPack.RegionData.SimIP += (uint)byteIP[1] << 8;
153 NewSimPack.RegionData.SimIP += (uint)byteIP[0];
154 NewSimPack.RegionData.SimPort = (ushort)Convert.ToInt32(borderingSim["sim_port"]);
155 NewSimPack.RegionData.SeedCapability = new byte[0];
156 this.OutPacket(NewSimPack);
157 this.DowngradeClient();
158 /* lock (PacketQueue)
159 {
160 ProcessOutPacket(NewSimPack);
161 DowngradeClient();
162 }*/
163 }
164 }
165 }
166 }
167}
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs b/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs
new file mode 100644
index 0000000..75fcf18
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs
@@ -0,0 +1,163 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using libsecondlife;
5using libsecondlife.Packets;
6using Nwc.XmlRpc;
7using System.Net;
8using System.Net.Sockets;
9using System.IO;
10using System.Threading;
11using System.Timers;
12using OpenSim.Framework.Interfaces;
13using OpenSim.Framework.Types;
14using OpenSim.Framework.Inventory;
15using OpenSim.Framework.Utilities;
16using OpenSim.world;
17using OpenSim.Assets;
18
19namespace OpenSim
20{
21 public partial class ClientView
22 {
23 protected virtual void RegisterLocalPacketHandlers()
24 {
25 this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout);
26 this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached);
27 this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate);
28 }
29
30 protected virtual bool Logout(ClientView simClient, Packet packet)
31 {
32 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:ProcessInPacket() - Got a logout request");
33 //send reply to let the client logout
34 LogoutReplyPacket logReply = new LogoutReplyPacket();
35 logReply.AgentData.AgentID = this.AgentID;
36 logReply.AgentData.SessionID = this.SessionID;
37 logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
38 logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
39 logReply.InventoryData[0].ItemID = LLUUID.Zero;
40 OutPacket(logReply);
41 //tell all clients to kill our object
42 KillObjectPacket kill = new KillObjectPacket();
43 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
44 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
45 kill.ObjectData[0].ID = this.ClientAvatar.localid;
46 foreach (ClientView client in m_clientThreads.Values)
47 {
48 client.OutPacket(kill);
49 }
50 if (this.m_userServer != null)
51 {
52 this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
53 }
54 else
55 {
56 this.m_inventoryCache.ClientLeaving(this.AgentID, null);
57 }
58
59 m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
60 /*lock (m_world.Entities)
61 {
62 m_world.Entities.Remove(this.AgentID);
63 }*/
64 m_world.RemoveViewerAgent(this);
65 //need to do other cleaning up here too
66 m_clientThreads.Remove(this.CircuitCode);
67 m_networkServer.RemoveClientCircuit(this.CircuitCode);
68 this.ClientThread.Abort();
69 return true;
70 }
71
72 protected bool AgentTextureCached(ClientView simclient, Packet packet)
73 {
74 // Console.WriteLine(packet.ToString());
75 AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet;
76 AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket();
77 cachedresp.AgentData.AgentID = this.AgentID;
78 cachedresp.AgentData.SessionID = this.SessionID;
79 cachedresp.AgentData.SerialNum = this.cachedtextureserial;
80 this.cachedtextureserial++;
81 cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[chechedtex.WearableData.Length];
82 for (int i = 0; i < chechedtex.WearableData.Length; i++)
83 {
84 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
85 cachedresp.WearableData[i].TextureIndex = chechedtex.WearableData[i].TextureIndex;
86 cachedresp.WearableData[i].TextureID = LLUUID.Zero;
87 cachedresp.WearableData[i].HostName = new byte[0];
88 }
89 this.OutPacket(cachedresp);
90 return true;
91 }
92
93 protected bool MultipleObjUpdate(ClientView simClient, Packet packet)
94 {
95 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
96 for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
97 {
98 if (multipleupdate.ObjectData[i].Type == 9) //change position
99 {
100 libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
101 OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this);
102 //should update stored position of the prim
103 }
104 else if (multipleupdate.ObjectData[i].Type == 10)//rotation
105 {
106 libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
107 OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
108 }
109 else if (multipleupdate.ObjectData[i].Type == 13)//scale
110 {
111 libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
112 OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
113 }
114 }
115 return true;
116 }
117
118 public void RequestMapLayer() //should be getting the map layer from the grid server
119 {
120 //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area)
121 MapLayerReplyPacket mapReply = new MapLayerReplyPacket();
122 mapReply.AgentData.AgentID = this.AgentID;
123 mapReply.AgentData.Flags = 0;
124 mapReply.LayerData = new MapLayerReplyPacket.LayerDataBlock[1];
125 mapReply.LayerData[0] = new MapLayerReplyPacket.LayerDataBlock();
126 mapReply.LayerData[0].Bottom = 800;
127 mapReply.LayerData[0].Left = 800;
128 mapReply.LayerData[0].Top = 1200;
129 mapReply.LayerData[0].Right = 1200;
130 mapReply.LayerData[0].ImageID = new LLUUID("00000000-0000-0000-9999-000000000006");
131 this.OutPacket(mapReply);
132 }
133
134 public void RequestMapBlocks(int minX, int minY, int maxX, int maxY)
135 {
136 IList simMapProfiles = m_gridServer.RequestMapBlocks(minX, minY, maxX, maxY);
137 MapBlockReplyPacket mbReply = new MapBlockReplyPacket();
138 mbReply.AgentData.AgentID = this.AgentID;
139 int len;
140 if (simMapProfiles == null)
141 len = 0;
142 else
143 len = simMapProfiles.Count;
144
145 mbReply.Data = new MapBlockReplyPacket.DataBlock[len];
146 int iii;
147 for (iii = 0; iii < len; iii++)
148 {
149 Hashtable mp = (Hashtable)simMapProfiles[iii];
150 mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock();
151 mbReply.Data[iii].Name = System.Text.Encoding.UTF8.GetBytes((string)mp["name"]);
152 mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]);
153 mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]);
154 mbReply.Data[iii].MapImageID = new LLUUID((string)mp["map-image-id"]);
155 mbReply.Data[iii].RegionFlags = System.Convert.ToUInt32(mp["region-flags"]);
156 mbReply.Data[iii].WaterHeight = System.Convert.ToByte(mp["water-height"]);
157 mbReply.Data[iii].X = System.Convert.ToUInt16(mp["x"]);
158 mbReply.Data[iii].Y = System.Convert.ToUInt16(mp["y"]);
159 }
160 this.OutPacket(mbReply);
161 }
162 }
163}
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
new file mode 100644
index 0000000..977162f
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
@@ -0,0 +1,456 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using libsecondlife;
5using libsecondlife.Packets;
6using Nwc.XmlRpc;
7using System.Net;
8using System.Net.Sockets;
9using System.IO;
10using System.Threading;
11using System.Timers;
12using OpenSim.Framework.Interfaces;
13using OpenSim.Framework.Types;
14using OpenSim.Framework.Inventory;
15using OpenSim.Framework.Utilities;
16using OpenSim.world;
17using OpenSim.Assets;
18
19namespace OpenSim
20{
21 public partial class ClientView
22 {
23 public delegate void GenericCall(ClientView remoteClient);
24 public delegate void GenericCall2();
25 public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary.
26 public delegate void GenericCall4(Packet packet, ClientView remoteClient);
27 public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
28 public delegate void ObjectSelect(uint localID, ClientView remoteClient);
29 public delegate void UpdatePrimFlags(uint localID, Packet packet, ClientView remoteClient);
30 public delegate void UpdatePrimTexture(uint localID, byte[] texture, ClientView remoteClient);
31 public delegate void UpdatePrimVector(uint localID, LLVector3 pos, ClientView remoteClient);
32 public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, ClientView remoteClient);
33 public delegate void StatusChange(bool status);
34
35 public event ChatFromViewer OnChatFromViewer;
36 public event RezObject OnRezObject;
37 public event GenericCall4 OnDeRezObject;
38 public event ModifyTerrain OnModifyTerrain;
39 public event GenericCall OnRegionHandShakeReply;
40 public event GenericCall OnRequestWearables;
41 public event SetAppearance OnSetAppearance;
42 public event GenericCall2 OnCompleteMovementToRegion;
43 public event GenericCall3 OnAgentUpdate;
44 public event StartAnim OnStartAnim;
45 public event GenericCall OnRequestAvatarsData;
46 public event LinkObjects OnLinkObjects;
47 public event GenericCall4 OnAddPrim;
48 public event UpdateShape OnUpdatePrimShape;
49 public event ObjectSelect OnObjectSelect;
50 public event UpdatePrimFlags OnUpdatePrimFlags;
51 public event UpdatePrimTexture OnUpdatePrimTexture;
52 public event UpdatePrimVector OnUpdatePrimPosition;
53 public event UpdatePrimRotation OnUpdatePrimRotation;
54 public event UpdatePrimVector OnUpdatePrimScale;
55 public event StatusChange OnChildAgentStatus;
56 public event GenericCall2 OnStopMovement;
57
58 protected override void ProcessInPacket(Packet Pack)
59 {
60 ack_pack(Pack);
61 if (debug)
62 {
63 if (Pack.Type != PacketType.AgentUpdate)
64 {
65 Console.WriteLine(Pack.Type.ToString());
66 }
67 }
68
69 if (this.ProcessPacketMethod(Pack))
70 {
71 //there is a handler registered that handled this packet type
72 return;
73 }
74 else
75 {
76 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
77
78 switch (Pack.Type)
79 {
80 case PacketType.ViewerEffect:
81 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
82 foreach (ClientView client in m_clientThreads.Values)
83 {
84 if (client.AgentID != this.AgentID)
85 {
86 viewer.AgentData.AgentID = client.AgentID;
87 viewer.AgentData.SessionID = client.SessionID;
88 client.OutPacket(viewer);
89 }
90 }
91 break;
92
93 #region New Event System - World/Avatar
94 case PacketType.ChatFromViewer:
95 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
96 if (Util.FieldToString(inchatpack.ChatData.Message) == "")
97 {
98 //empty message so don't bother with it
99 break;
100 }
101 string fromName = ClientAvatar.firstname + " " + ClientAvatar.lastname;
102 byte[] message = inchatpack.ChatData.Message;
103 byte type = inchatpack.ChatData.Type;
104 LLVector3 fromPos = ClientAvatar.Pos;
105 LLUUID fromAgentID = AgentID;
106 this.OnChatFromViewer(message, type, fromPos, fromName, fromAgentID);
107 break;
108 case PacketType.RezObject:
109 RezObjectPacket rezPacket = (RezObjectPacket)Pack;
110 AgentInventory inven = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
111 if (inven != null)
112 {
113 if (inven.InventoryItems.ContainsKey(rezPacket.InventoryData.ItemID))
114 {
115 AssetBase asset = this.m_assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID);
116 if (asset != null)
117 {
118 this.OnRezObject(asset, rezPacket.RezData.RayEnd);
119 this.m_inventoryCache.DeleteInventoryItem(this, rezPacket.InventoryData.ItemID);
120 }
121 }
122 }
123 break;
124 case PacketType.DeRezObject:
125 OnDeRezObject(Pack, this);
126 break;
127 case PacketType.ModifyLand:
128 ModifyLandPacket modify = (ModifyLandPacket)Pack;
129 if (modify.ParcelData.Length > 0)
130 {
131 OnModifyTerrain(modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West);
132 }
133 break;
134 case PacketType.RegionHandshakeReply:
135 OnRegionHandShakeReply(this);
136 break;
137 case PacketType.AgentWearablesRequest:
138 OnRequestWearables(this);
139 OnRequestAvatarsData(this);
140 break;
141 case PacketType.AgentSetAppearance:
142 AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack;
143 OnSetAppearance(appear.ObjectData.TextureEntry, appear.VisualParam);
144 break;
145 case PacketType.CompleteAgentMovement:
146 if (this.m_child) this.UpgradeClient();
147 OnCompleteMovementToRegion();
148 this.EnableNeighbours();
149 break;
150 case PacketType.AgentUpdate:
151 OnAgentUpdate(Pack);
152 break;
153 case PacketType.AgentAnimation:
154 if (!m_child)
155 {
156 AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack;
157 for (int i = 0; i < AgentAni.AnimationList.Length; i++)
158 {
159 if (AgentAni.AnimationList[i].StartAnim)
160 {
161 OnStartAnim(AgentAni.AnimationList[i].AnimID, 1);
162 }
163 }
164 }
165 break;
166
167 #endregion
168
169 #region New Event System - Objects/Prims
170 case PacketType.ObjectLink:
171 // OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, Pack.ToString());
172 ObjectLinkPacket link = (ObjectLinkPacket)Pack;
173 uint parentprimid = 0;
174 List<uint> childrenprims = new List<uint>();
175 if (link.ObjectData.Length > 1)
176 {
177 parentprimid = link.ObjectData[0].ObjectLocalID;
178
179 for (int i = 1; i < link.ObjectData.Length; i++)
180 {
181 childrenprims.Add(link.ObjectData[i].ObjectLocalID);
182 }
183 }
184 OnLinkObjects(parentprimid, childrenprims);
185 break;
186 case PacketType.ObjectAdd:
187 m_world.AddNewPrim((ObjectAddPacket)Pack, this);
188 OnAddPrim(Pack, this);
189 break;
190 case PacketType.ObjectShape:
191 ObjectShapePacket shape = (ObjectShapePacket)Pack;
192 for (int i = 0; i < shape.ObjectData.Length; i++)
193 {
194 OnUpdatePrimShape(shape.ObjectData[i].ObjectLocalID, shape.ObjectData[i]);
195 }
196 break;
197 case PacketType.ObjectSelect:
198 ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack;
199 for (int i = 0; i < incomingselect.ObjectData.Length; i++)
200 {
201 OnObjectSelect(incomingselect.ObjectData[i].ObjectLocalID, this);
202 }
203 break;
204 case PacketType.ObjectFlagUpdate:
205 ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack;
206 OnUpdatePrimFlags(flags.AgentData.ObjectLocalID, Pack, this);
207 break;
208 case PacketType.ObjectImage:
209 ObjectImagePacket imagePack = (ObjectImagePacket)Pack;
210 for (int i = 0; i < imagePack.ObjectData.Length; i++)
211 {
212 OnUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID, imagePack.ObjectData[i].TextureEntry, this);
213
214 }
215 break;
216 #endregion
217
218 #region Inventory/Asset/Other related packets
219 case PacketType.RequestImage:
220 RequestImagePacket imageRequest = (RequestImagePacket)Pack;
221 for (int i = 0; i < imageRequest.RequestImage.Length; i++)
222 {
223 m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image);
224 }
225 break;
226 case PacketType.TransferRequest:
227 //Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request");
228 TransferRequestPacket transfer = (TransferRequestPacket)Pack;
229 m_assetCache.AddAssetRequest(this, transfer);
230 break;
231 case PacketType.AssetUploadRequest:
232 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
233 this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID));
234 break;
235 case PacketType.RequestXfer:
236 //Console.WriteLine(Pack.ToString());
237 break;
238 case PacketType.SendXferPacket:
239 this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack);
240 break;
241 case PacketType.CreateInventoryFolder:
242 CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack;
243 m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Util.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID);
244 //Console.WriteLine(Pack.ToString());
245 break;
246 case PacketType.CreateInventoryItem:
247 //Console.WriteLine(Pack.ToString());
248 CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack;
249 if (createItem.InventoryBlock.TransactionID != LLUUID.Zero)
250 {
251 this.UploadAssets.CreateInventoryItem(createItem);
252 }
253 else
254 {
255 // Console.Write(Pack.ToString());
256 this.CreateInventoryItem(createItem);
257 }
258 break;
259 case PacketType.FetchInventory:
260 //Console.WriteLine("fetch item packet");
261 FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack;
262 m_inventoryCache.FetchInventory(this, FetchInventory);
263 break;
264 case PacketType.FetchInventoryDescendents:
265 FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack;
266 m_inventoryCache.FetchInventoryDescendents(this, Fetch);
267 break;
268 case PacketType.UpdateInventoryItem:
269 UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack;
270 //Console.WriteLine(Pack.ToString());
271 for (int i = 0; i < update.InventoryData.Length; i++)
272 {
273 if (update.InventoryData[i].TransactionID != LLUUID.Zero)
274 {
275 AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID));
276 if (asset != null)
277 {
278 // Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache");
279 m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset);
280 }
281 else
282 {
283 asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID);
284 if (asset != null)
285 {
286 //Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToStringHyphenated() + " to cache");
287 m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset);
288 }
289 else
290 {
291 //Console.WriteLine("trying to update inventory item, but asset is null");
292 }
293 }
294 }
295 else
296 {
297 m_inventoryCache.UpdateInventoryItemDetails(this, update.InventoryData[i].ItemID, update.InventoryData[i]); ;
298 }
299 }
300 break;
301 case PacketType.RequestTaskInventory:
302 // Console.WriteLine(Pack.ToString());
303 RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack;
304 ReplyTaskInventoryPacket replytask = new ReplyTaskInventoryPacket();
305 bool foundent = false;
306 foreach (Entity ent in m_world.Entities.Values)
307 {
308 if (ent.localid == requesttask.InventoryData.LocalID)
309 {
310 replytask.InventoryData.TaskID = ent.uuid;
311 replytask.InventoryData.Serial = 0;
312 replytask.InventoryData.Filename = new byte[0];
313 foundent = true;
314 }
315 }
316 if (foundent)
317 {
318 this.OutPacket(replytask);
319 }
320 break;
321 case PacketType.UpdateTaskInventory:
322 // Console.WriteLine(Pack.ToString());
323 UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
324 AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
325 if (myinventory != null)
326 {
327 if (updatetask.UpdateData.Key == 0)
328 {
329 if (myinventory.InventoryItems[updatetask.InventoryData.ItemID] != null)
330 {
331 if (myinventory.InventoryItems[updatetask.InventoryData.ItemID].Type == 7)
332 {
333 LLUUID noteaid = myinventory.InventoryItems[updatetask.InventoryData.ItemID].AssetID;
334 AssetBase assBase = this.m_assetCache.GetAsset(noteaid);
335 if (assBase != null)
336 {
337 foreach (Entity ent in m_world.Entities.Values)
338 {
339 if (ent.localid == updatetask.UpdateData.LocalID)
340 {
341 if (ent is OpenSim.world.Primitive)
342 {
343 this.m_world.AddScript(ent, Util.FieldToString(assBase.Data));
344 }
345 }
346 }
347 }
348 }
349 }
350 }
351 }
352 break;
353 case PacketType.MapLayerRequest:
354 this.RequestMapLayer();
355 break;
356 case PacketType.MapBlockRequest:
357 MapBlockRequestPacket MapRequest = (MapBlockRequestPacket)Pack;
358
359 this.RequestMapBlocks(MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, MapRequest.PositionData.MaxX, MapRequest.PositionData.MaxY);
360 break;
361 case PacketType.TeleportLandmarkRequest:
362 TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack;
363
364 TeleportStartPacket tpStart = new TeleportStartPacket();
365 tpStart.Info.TeleportFlags = 8; // tp via lm
366 this.OutPacket(tpStart);
367
368 TeleportProgressPacket tpProgress = new TeleportProgressPacket();
369 tpProgress.Info.Message = (new System.Text.ASCIIEncoding()).GetBytes("sending_landmark");
370 tpProgress.Info.TeleportFlags = 8;
371 tpProgress.AgentData.AgentID = tpReq.Info.AgentID;
372 this.OutPacket(tpProgress);
373
374 // Fetch landmark
375 LLUUID lmid = tpReq.Info.LandmarkID;
376 AssetBase lma = this.m_assetCache.GetAsset(lmid);
377 if (lma != null)
378 {
379 AssetLandmark lm = new AssetLandmark(lma);
380
381 if (lm.RegionID == m_regionData.SimUUID)
382 {
383 TeleportLocalPacket tpLocal = new TeleportLocalPacket();
384
385 tpLocal.Info.AgentID = tpReq.Info.AgentID;
386 tpLocal.Info.TeleportFlags = 8; // Teleport via landmark
387 tpLocal.Info.LocationID = 2;
388 tpLocal.Info.Position = lm.Position;
389 OutPacket(tpLocal);
390 }
391 else
392 {
393 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
394 tpCancel.Info.AgentID = tpReq.Info.AgentID;
395 tpCancel.Info.SessionID = tpReq.Info.SessionID;
396 OutPacket(tpCancel);
397 }
398 }
399 else
400 {
401 Console.WriteLine("Cancelling Teleport - fetch asset not yet implemented");
402
403 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
404 tpCancel.Info.AgentID = tpReq.Info.AgentID;
405 tpCancel.Info.SessionID = tpReq.Info.SessionID;
406 OutPacket(tpCancel);
407 }
408 break;
409 case PacketType.TeleportLocationRequest:
410 TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack;
411 Console.WriteLine(tpLocReq.ToString());
412
413 tpStart = new TeleportStartPacket();
414 tpStart.Info.TeleportFlags = 16; // Teleport via location
415 Console.WriteLine(tpStart.ToString());
416 OutPacket(tpStart);
417
418 if (m_regionData.RegionHandle != tpLocReq.Info.RegionHandle)
419 {
420 /* m_gridServer.getRegion(tpLocReq.Info.RegionHandle); */
421 Console.WriteLine("Inter-sim teleport not yet implemented");
422 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
423 tpCancel.Info.SessionID = tpLocReq.AgentData.SessionID;
424 tpCancel.Info.AgentID = tpLocReq.AgentData.AgentID;
425
426 OutPacket(tpCancel);
427 }
428 else
429 {
430 Console.WriteLine("Local teleport");
431 TeleportLocalPacket tpLocal = new TeleportLocalPacket();
432 tpLocal.Info.AgentID = tpLocReq.AgentData.AgentID;
433 tpLocal.Info.TeleportFlags = tpStart.Info.TeleportFlags;
434 tpLocal.Info.LocationID = 2;
435 tpLocal.Info.LookAt = tpLocReq.Info.LookAt;
436 tpLocal.Info.Position = tpLocReq.Info.Position;
437 OutPacket(tpLocal);
438
439 }
440 break;
441 #endregion
442
443 #region unimplemented handlers
444 case PacketType.AgentIsNowWearing:
445 // AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack;
446 //Console.WriteLine(Pack.ToString());
447 break;
448 case PacketType.ObjectScale:
449 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, Pack.ToString());
450 break;
451 #endregion
452 }
453 }
454 }
455 }
456}
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.cs b/OpenSim/OpenSim.RegionServer/ClientView.cs
new file mode 100644
index 0000000..295cd7b
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/ClientView.cs
@@ -0,0 +1,449 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*/
26
27using System;
28using System.Collections;
29using System.Collections.Generic;
30using libsecondlife;
31using libsecondlife.Packets;
32using Nwc.XmlRpc;
33using System.Net;
34using System.Net.Sockets;
35using System.IO;
36using System.Threading;
37using System.Timers;
38using OpenSim.Framework.Interfaces;
39using OpenSim.Framework.Types;
40using OpenSim.Framework.Inventory;
41using OpenSim.Framework.Utilities;
42using OpenSim.world;
43using OpenSim.Assets;
44
45namespace OpenSim
46{
47 public delegate bool PacketMethod(ClientView simClient, Packet packet);
48
49 /// <summary>
50 /// Handles new client connections
51 /// Constructor takes a single Packet and authenticates everything
52 /// </summary>
53 public partial class ClientView : ClientViewBase, IClientAPI
54 {
55 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
56 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); //local handlers for this instance
57
58 public LLUUID AgentID;
59 public LLUUID SessionID;
60 public LLUUID SecureSessionID = LLUUID.Zero;
61 public bool m_child;
62 public world.Avatar ClientAvatar;
63 private UseCircuitCodePacket cirpack;
64 public Thread ClientThread;
65 public LLVector3 startpos;
66
67 private AgentAssetUpload UploadAssets;
68 private LLUUID newAssetFolder = LLUUID.Zero;
69 private bool debug = false;
70 private World m_world;
71 private Dictionary<uint, ClientView> m_clientThreads;
72 private AssetCache m_assetCache;
73 private IGridServer m_gridServer;
74 private IUserServer m_userServer = null;
75 private InventoryCache m_inventoryCache;
76 public bool m_sandboxMode;
77 private int cachedtextureserial = 0;
78 private RegionInfo m_regionData;
79 protected AuthenticateSessionsBase m_authenticateSessionsHandler;
80
81 public IUserServer UserServer
82 {
83 set
84 {
85 this.m_userServer = value;
86 }
87 }
88
89 public LLVector3 StartPos
90 {
91 get
92 {
93 return startpos;
94 }
95 set
96 {
97 startpos = value;
98 }
99 }
100
101 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, World world, Dictionary<uint, ClientView> clientThreads, AssetCache assetCache, IGridServer gridServer, OpenSimNetworkHandler application, InventoryCache inventoryCache, bool sandboxMode, bool child, RegionInfo regionDat, AuthenticateSessionsBase authenSessions)
102 {
103 m_world = world;
104 m_clientThreads = clientThreads;
105 m_assetCache = assetCache;
106 m_gridServer = gridServer;
107 m_networkServer = application;
108 m_inventoryCache = inventoryCache;
109 m_sandboxMode = sandboxMode;
110 m_child = child;
111 m_regionData = regionDat;
112 m_authenticateSessionsHandler = authenSessions;
113
114 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs - Started up new client thread to handle incoming request");
115 cirpack = initialcirpack;
116 userEP = remoteEP;
117
118 if (m_gridServer.GetName() == "Remote")
119 {
120 this.m_child = m_authenticateSessionsHandler.GetAgentChildStatus(initialcirpack.CircuitCode.Code);
121 this.startpos = m_authenticateSessionsHandler.GetPosition(initialcirpack.CircuitCode.Code);
122 //Console.WriteLine("start pos is " + this.startpos.X + " , " + this.startpos.Y + " , " + this.startpos.Z);
123 }
124 else
125 {
126 this.startpos = new LLVector3(128, 128, m_world.Terrain[(int)128, (int)128] + 15.0f); // new LLVector3(128.0f, 128.0f, 60f);
127 }
128
129 PacketQueue = new BlockingQueue<QueItem>();
130
131 this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache);
132 AckTimer = new System.Timers.Timer(500);
133 AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed);
134 AckTimer.Start();
135
136 this.RegisterLocalPacketHandlers();
137
138 ClientThread = new Thread(new ThreadStart(AuthUser));
139 ClientThread.IsBackground = true;
140 ClientThread.Start();
141 }
142
143 # region Client Methods
144 public void UpgradeClient()
145 {
146 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent");
147 this.m_child = false;
148 //this.m_world.RemoveViewerAgent(this);
149 if (!this.m_sandboxMode)
150 {
151 this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode);
152 m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false);
153 }
154 OnChildAgentStatus(this.m_child);
155 //this.InitNewClient();
156 }
157
158 public void DowngradeClient()
159 {
160 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - changing full agent to child");
161 this.m_child = true;
162 OnChildAgentStatus(this.m_child);
163 //this.m_world.RemoveViewerAgent(this);
164 //this.m_world.AddViewerAgent(this);
165 }
166
167 public void KillClient()
168 {
169 KillObjectPacket kill = new KillObjectPacket();
170 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
171 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
172 kill.ObjectData[0].ID = this.ClientAvatar.localid;
173 foreach (ClientView client in m_clientThreads.Values)
174 {
175 client.OutPacket(kill);
176 }
177 if (this.m_userServer != null)
178 {
179 this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
180 }
181 else
182 {
183 this.m_inventoryCache.ClientLeaving(this.AgentID, null);
184 }
185
186 m_world.RemoveViewerAgent(this);
187
188 m_clientThreads.Remove(this.CircuitCode);
189 m_networkServer.RemoveClientCircuit(this.CircuitCode);
190 this.ClientThread.Abort();
191 }
192 #endregion
193
194 # region Packet Handling
195 public static bool AddPacketHandler(PacketType packetType, PacketMethod handler)
196 {
197 bool result = false;
198 lock (PacketHandlers)
199 {
200 if (!PacketHandlers.ContainsKey(packetType))
201 {
202 PacketHandlers.Add(packetType, handler);
203 result = true;
204 }
205 }
206 return result;
207 }
208
209 public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler)
210 {
211 bool result = false;
212 lock (m_packetHandlers)
213 {
214 if (!m_packetHandlers.ContainsKey(packetType))
215 {
216 m_packetHandlers.Add(packetType, handler);
217 result = true;
218 }
219 }
220 return result;
221 }
222
223 protected virtual bool ProcessPacketMethod(Packet packet)
224 {
225 bool result = false;
226 bool found = false;
227 PacketMethod method;
228 if (m_packetHandlers.TryGetValue(packet.Type, out method))
229 {
230 //there is a local handler for this packet type
231 result = method(this, packet);
232 }
233 else
234 {
235 //there is not a local handler so see if there is a Global handler
236 lock (PacketHandlers)
237 {
238 found = PacketHandlers.TryGetValue(packet.Type, out method);
239 }
240 if (found)
241 {
242 result = method(this, packet);
243 }
244 }
245 return result;
246 }
247
248 protected virtual void ClientLoop()
249 {
250 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:ClientLoop() - Entered loop");
251 while (true)
252 {
253 QueItem nextPacket = PacketQueue.Dequeue();
254 if (nextPacket.Incoming)
255 {
256 //is a incoming packet
257 ProcessInPacket(nextPacket.Packet);
258 }
259 else
260 {
261 //is a out going packet
262 ProcessOutPacket(nextPacket.Packet);
263 }
264 }
265 }
266 # endregion
267
268 # region Setup
269
270 protected virtual void InitNewClient()
271 {
272 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
273 this.ClientAvatar = m_world.AddViewerAgent(this);
274 }
275
276 protected virtual void AuthUser()
277 {
278 // AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
279 AuthenticateResponse sessionInfo = this.m_networkServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
280 if (!sessionInfo.Authorised)
281 {
282 //session/circuit not authorised
283 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString());
284 ClientThread.Abort();
285 }
286 else
287 {
288 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString());
289 //session is authorised
290 this.AgentID = cirpack.CircuitCode.ID;
291 this.SessionID = cirpack.CircuitCode.SessionID;
292 this.CircuitCode = cirpack.CircuitCode.Code;
293 InitNewClient();
294 this.ClientAvatar.firstname = sessionInfo.LoginInfo.First;
295 this.ClientAvatar.lastname = sessionInfo.LoginInfo.Last;
296 if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero)
297 {
298 this.SecureSessionID = sessionInfo.LoginInfo.SecureSession;
299 }
300
301 // Create Inventory, currently only works for sandbox mode
302 if (m_sandboxMode)
303 {
304 this.SetupInventory(sessionInfo);
305 }
306
307 ClientLoop();
308 }
309 }
310 # endregion
311
312
313 protected override void KillThread()
314 {
315 this.ClientThread.Abort();
316 }
317
318 #region World/Avatar To Viewer Methods
319
320 public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
321 {
322 System.Text.Encoding enc = System.Text.Encoding.ASCII;
323 libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
324 reply.ChatData.Audible = 1;
325 reply.ChatData.Message = message;
326 reply.ChatData.ChatType = type;
327 reply.ChatData.SourceType = 1;
328 reply.ChatData.Position = fromPos;
329 reply.ChatData.FromName = enc.GetBytes(fromName + "\0");
330 reply.ChatData.OwnerID = fromAgentID;
331 reply.ChatData.SourceID = fromAgentID;
332
333 this.OutPacket(reply);
334 }
335
336 public void SendAppearance(AvatarWearable[] wearables)
337 {
338 AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket();
339 aw.AgentData.AgentID = this.AgentID;
340 aw.AgentData.SerialNum = 0;
341 aw.AgentData.SessionID = this.SessionID;
342
343 aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13];
344 AgentWearablesUpdatePacket.WearableDataBlock awb;
345 for (int i = 0; i < wearables.Length; i++)
346 {
347 awb = new AgentWearablesUpdatePacket.WearableDataBlock();
348 awb.WearableType = (byte)i;
349 awb.AssetID = wearables[i].AssetID;
350 awb.ItemID = wearables[i].ItemID;
351 aw.WearableData[i] = awb;
352 }
353
354 this.OutPacket(aw);
355 }
356 #endregion
357
358 #region Inventory Creation
359 private void SetupInventory(AuthenticateResponse sessionInfo)
360 {
361 AgentInventory inventory = null;
362 if (sessionInfo.LoginInfo.InventoryFolder != null)
363 {
364 inventory = this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder);
365 if (sessionInfo.LoginInfo.BaseFolder != null)
366 {
367 if (!inventory.HasFolder(sessionInfo.LoginInfo.BaseFolder))
368 {
369 m_inventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder);
370 }
371 this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder;
372 AssetBase[] inventorySet = m_assetCache.CreateNewInventorySet(this.AgentID);
373 if (inventorySet != null)
374 {
375 for (int i = 0; i < inventorySet.Length; i++)
376 {
377 if (inventorySet[i] != null)
378 {
379 m_inventoryCache.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]);
380 }
381 }
382 }
383 }
384 }
385 }
386 private AgentInventory CreateInventory(LLUUID baseFolder)
387 {
388 AgentInventory inventory = null;
389 if (this.m_userServer != null)
390 {
391 // a user server is set so request the inventory from it
392 Console.WriteLine("getting inventory from user server");
393 inventory = m_inventoryCache.FetchAgentsInventory(this.AgentID, m_userServer);
394 }
395 else
396 {
397 inventory = new AgentInventory();
398 inventory.AgentID = this.AgentID;
399 inventory.CreateRootFolder(this.AgentID, false);
400 m_inventoryCache.AddNewAgentsInventory(inventory);
401 m_inventoryCache.CreateNewInventoryFolder(this, baseFolder);
402 }
403 return inventory;
404 }
405
406 private void CreateInventoryItem(CreateInventoryItemPacket packet)
407 {
408 if (!(packet.InventoryBlock.Type == 3 || packet.InventoryBlock.Type == 7))
409 {
410 System.Console.WriteLine("Attempted to create " + Util.FieldToString(packet.InventoryBlock.Name) + " in inventory. Unsupported type");
411 return;
412 }
413
414 //lets try this out with creating a notecard
415 AssetBase asset = new AssetBase();
416
417 asset.Name = Util.FieldToString(packet.InventoryBlock.Name);
418 asset.Description = Util.FieldToString(packet.InventoryBlock.Description);
419 asset.InvType = packet.InventoryBlock.InvType;
420 asset.Type = packet.InventoryBlock.Type;
421 asset.FullID = LLUUID.Random();
422
423 switch (packet.InventoryBlock.Type)
424 {
425 case 7: // Notecard
426 asset.Data = new byte[0];
427 break;
428
429 case 3: // Landmark
430 String content;
431 content = "Landmark version 2\n";
432 content += "region_id " + m_regionData.SimUUID + "\n";
433 String strPos = String.Format("%.2f %.2f %.2f>",
434 this.ClientAvatar.Pos.X,
435 this.ClientAvatar.Pos.Y,
436 this.ClientAvatar.Pos.Z);
437 content += "local_pos " + strPos + "\n";
438 asset.Data = (new System.Text.ASCIIEncoding()).GetBytes(content);
439 break;
440 default:
441 break;
442 }
443 m_assetCache.AddAsset(asset);
444 m_inventoryCache.AddNewInventoryItem(this, packet.InventoryBlock.FolderID, asset);
445 }
446 #endregion
447
448 }
449}
diff --git a/OpenSim/OpenSim.RegionServer/ClientViewBase.cs b/OpenSim/OpenSim.RegionServer/ClientViewBase.cs
new file mode 100644
index 0000000..572dbce
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/ClientViewBase.cs
@@ -0,0 +1,299 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using libsecondlife;
5using libsecondlife.Packets;
6using System.Net;
7using System.Net.Sockets;
8using System.IO;
9using System.Threading;
10using System.Timers;
11using OpenSim.Framework.Utilities;
12using OpenSim.Framework.Interfaces;
13
14namespace OpenSim
15{
16 public class ClientViewBase
17 {
18 protected BlockingQueue<QueItem> PacketQueue;
19 protected Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>();
20 protected Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>();
21
22 protected System.Timers.Timer AckTimer;
23 protected uint Sequence = 0;
24 protected object SequenceLock = new object();
25 protected const int MAX_APPENDED_ACKS = 10;
26 protected const int RESEND_TIMEOUT = 4000;
27 protected const int MAX_SEQUENCE = 0xFFFFFF;
28
29 public uint CircuitCode;
30 public EndPoint userEP;
31
32 protected OpenSimNetworkHandler m_networkServer;
33
34 public ClientViewBase()
35 {
36
37 }
38
39 protected virtual void ProcessInPacket(Packet Pack)
40 {
41
42 }
43
44 protected virtual void ProcessOutPacket(Packet Pack)
45 {
46 // Keep track of when this packet was sent out
47 Pack.TickCount = Environment.TickCount;
48
49 if (!Pack.Header.Resent)
50 {
51 // Set the sequence number
52 lock (SequenceLock)
53 {
54 if (Sequence >= MAX_SEQUENCE)
55 Sequence = 1;
56 else
57 Sequence++;
58 Pack.Header.Sequence = Sequence;
59 }
60
61 if (Pack.Header.Reliable) //DIRTY HACK
62 {
63 lock (NeedAck)
64 {
65 if (!NeedAck.ContainsKey(Pack.Header.Sequence))
66 {
67 try
68 {
69 NeedAck.Add(Pack.Header.Sequence, Pack);
70 }
71 catch (Exception e) // HACKY
72 {
73 e.ToString();
74 // Ignore
75 // Seems to throw a exception here occasionally
76 // of 'duplicate key' despite being locked.
77 // !?!?!?
78 }
79 }
80 else
81 {
82 // Client.Log("Attempted to add a duplicate sequence number (" +
83 // packet.Header.Sequence + ") to the NeedAck dictionary for packet type " +
84 // packet.Type.ToString(), Helpers.LogLevel.Warning);
85 }
86 }
87
88 // Don't append ACKs to resent packets, in case that's what was causing the
89 // delivery to fail
90 if (!Pack.Header.Resent)
91 {
92 // Append any ACKs that need to be sent out to this packet
93 lock (PendingAcks)
94 {
95 if (PendingAcks.Count > 0 && PendingAcks.Count < MAX_APPENDED_ACKS &&
96 Pack.Type != PacketType.PacketAck &&
97 Pack.Type != PacketType.LogoutRequest)
98 {
99 Pack.Header.AckList = new uint[PendingAcks.Count];
100 int i = 0;
101
102 foreach (uint ack in PendingAcks.Values)
103 {
104 Pack.Header.AckList[i] = ack;
105 i++;
106 }
107
108 PendingAcks.Clear();
109 Pack.Header.AppendedAcks = true;
110 }
111 }
112 }
113 }
114 }
115
116 byte[] ZeroOutBuffer = new byte[4096];
117 byte[] sendbuffer;
118 sendbuffer = Pack.ToBytes();
119
120 try
121 {
122 if (Pack.Header.Zerocoded)
123 {
124 int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
125 m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, CircuitCode);//userEP);
126 }
127 else
128 {
129 m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, CircuitCode); //userEP);
130 }
131 }
132 catch (Exception)
133 {
134 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread");
135 this.KillThread();
136 }
137
138 }
139
140 public virtual void InPacket(Packet NewPack)
141 {
142 // Handle appended ACKs
143 if (NewPack.Header.AppendedAcks)
144 {
145 lock (NeedAck)
146 {
147 foreach (uint ack in NewPack.Header.AckList)
148 {
149 NeedAck.Remove(ack);
150 }
151 }
152 }
153
154 // Handle PacketAck packets
155 if (NewPack.Type == PacketType.PacketAck)
156 {
157 PacketAckPacket ackPacket = (PacketAckPacket)NewPack;
158
159 lock (NeedAck)
160 {
161 foreach (PacketAckPacket.PacketsBlock block in ackPacket.Packets)
162 {
163 NeedAck.Remove(block.ID);
164 }
165 }
166 }
167 else if ((NewPack.Type == PacketType.StartPingCheck))
168 {
169 //reply to pingcheck
170 libsecondlife.Packets.StartPingCheckPacket startPing = (libsecondlife.Packets.StartPingCheckPacket)NewPack;
171 libsecondlife.Packets.CompletePingCheckPacket endPing = new CompletePingCheckPacket();
172 endPing.PingID.PingID = startPing.PingID.PingID;
173 OutPacket(endPing);
174 }
175 else
176 {
177 QueItem item = new QueItem();
178 item.Packet = NewPack;
179 item.Incoming = true;
180 this.PacketQueue.Enqueue(item);
181 }
182
183 }
184
185 public virtual void OutPacket(Packet NewPack)
186 {
187 QueItem item = new QueItem();
188 item.Packet = NewPack;
189 item.Incoming = false;
190 this.PacketQueue.Enqueue(item);
191 }
192
193 # region Low Level Packet Methods
194
195 protected void ack_pack(Packet Pack)
196 {
197 if (Pack.Header.Reliable)
198 {
199 libsecondlife.Packets.PacketAckPacket ack_it = new PacketAckPacket();
200 ack_it.Packets = new PacketAckPacket.PacketsBlock[1];
201 ack_it.Packets[0] = new PacketAckPacket.PacketsBlock();
202 ack_it.Packets[0].ID = Pack.Header.Sequence;
203 ack_it.Header.Reliable = false;
204
205 OutPacket(ack_it);
206
207 }
208 /*
209 if (Pack.Header.Reliable)
210 {
211 lock (PendingAcks)
212 {
213 uint sequence = (uint)Pack.Header.Sequence;
214 if (!PendingAcks.ContainsKey(sequence)) { PendingAcks[sequence] = sequence; }
215 }
216 }*/
217 }
218
219 protected void ResendUnacked()
220 {
221 int now = Environment.TickCount;
222
223 lock (NeedAck)
224 {
225 foreach (Packet packet in NeedAck.Values)
226 {
227 if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent))
228 {
229 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Resending " + packet.Type.ToString() + " packet, " +
230 (now - packet.TickCount) + "ms have passed");
231
232 packet.Header.Resent = true;
233 OutPacket(packet);
234 }
235 }
236 }
237 }
238
239 protected void SendAcks()
240 {
241 lock (PendingAcks)
242 {
243 if (PendingAcks.Count > 0)
244 {
245 if (PendingAcks.Count > 250)
246 {
247 // FIXME: Handle the odd case where we have too many pending ACKs queued up
248 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Too many ACKs queued up!");
249 return;
250 }
251
252 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Sending PacketAck");
253
254
255 int i = 0;
256 PacketAckPacket acks = new PacketAckPacket();
257 acks.Packets = new PacketAckPacket.PacketsBlock[PendingAcks.Count];
258
259 foreach (uint ack in PendingAcks.Values)
260 {
261 acks.Packets[i] = new PacketAckPacket.PacketsBlock();
262 acks.Packets[i].ID = ack;
263 i++;
264 }
265
266 acks.Header.Reliable = false;
267 OutPacket(acks);
268
269 PendingAcks.Clear();
270 }
271 }
272 }
273
274 protected void AckTimer_Elapsed(object sender, ElapsedEventArgs ea)
275 {
276 SendAcks();
277 ResendUnacked();
278 }
279 #endregion
280
281 protected virtual void KillThread()
282 {
283
284 }
285
286 #region Nested Classes
287
288 public class QueItem
289 {
290 public QueItem()
291 {
292 }
293
294 public Packet Packet;
295 public bool Incoming;
296 }
297 #endregion
298 }
299}
diff --git a/OpenSim/OpenSim.RegionServer/Grid.cs b/OpenSim/OpenSim.RegionServer/Grid.cs
new file mode 100644
index 0000000..db5b8fe
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/Grid.cs
@@ -0,0 +1,90 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Reflection;
5using OpenSim.Framework.Interfaces;
6using OpenSim.UserServer;
7
8namespace OpenSim
9{
10 public class Grid
11 {
12 public IAssetServer AssetServer;
13 public IGridServer GridServer;
14 public IUserServer UserServer;
15 public string AssetDll = "";
16 public string GridDll = "";
17
18 public Grid()
19 {
20 }
21
22 public virtual void Initialise()
23 {
24 //load the dlls
25 this.AssetServer = this.LoadAssetDll(this.AssetDll);
26 this.GridServer = this.LoadGridDll(this.GridDll);
27 }
28 public virtual void Close()
29 {
30 this.AssetServer.Close();
31 this.GridServer.Close();
32 }
33
34 private IAssetServer LoadAssetDll(string dllName)
35 {
36 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
37 IAssetServer server = null;
38
39 foreach (Type pluginType in pluginAssembly.GetTypes())
40 {
41 if (pluginType.IsPublic)
42 {
43 if (!pluginType.IsAbstract)
44 {
45 Type typeInterface = pluginType.GetInterface("IAssetPlugin", true);
46
47 if (typeInterface != null)
48 {
49 IAssetPlugin plug = (IAssetPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
50 server = plug.GetAssetServer();
51 break;
52 }
53
54 typeInterface = null;
55 }
56 }
57 }
58 pluginAssembly = null;
59 return server;
60 }
61
62 private IGridServer LoadGridDll(string dllName)
63 {
64 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
65 IGridServer server = null;
66
67 foreach (Type pluginType in pluginAssembly.GetTypes())
68 {
69 if (pluginType.IsPublic)
70 {
71 if (!pluginType.IsAbstract)
72 {
73 Type typeInterface = pluginType.GetInterface("IGridPlugin", true);
74
75 if (typeInterface != null)
76 {
77 IGridPlugin plug = (IGridPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
78 server = plug.GetGridServer();
79 break;
80 }
81
82 typeInterface = null;
83 }
84 }
85 }
86 pluginAssembly = null;
87 return server;
88 }
89 }
90}
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
new file mode 100644
index 0000000..f06e16a
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -0,0 +1,258 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.RegionServer</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.RegionServer</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="libsecondlife.dll" >
70 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="Axiom.MathLib.dll" >
74 <HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" >
78 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj">
84 <Name>OpenSim.Terrain.BasicTerrain</Name>
85 <Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 <ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
90 <Name>OpenSim.Framework</Name>
91 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private>
94 </ProjectReference>
95 <ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
96 <Name>OpenSim.Framework.Console</Name>
97 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
98 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
99 <Private>False</Private>
100 </ProjectReference>
101 <ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
102 <Name>OpenSim.GenericConfig.Xml</Name>
103 <Project>{E88EF749-0000-0000-0000-000000000000}</Project>
104 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
105 <Private>False</Private>
106 </ProjectReference>
107 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
108 <Name>OpenSim.Physics.Manager</Name>
109 <Project>{8BE16150-0000-0000-0000-000000000000}</Project>
110 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
111 <Private>False</Private>
112 </ProjectReference>
113 <ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
114 <Name>OpenSim.Servers</Name>
115 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
116 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
117 <Private>False</Private>
118 </ProjectReference>
119 <ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj">
120 <Name>XMLRPC</Name>
121 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
122 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
123 <Private>False</Private>
124 </ProjectReference>
125 </ItemGroup>
126 <ItemGroup>
127 <Compile Include="AgentAssetUpload.cs">
128 <SubType>Code</SubType>
129 </Compile>
130 <Compile Include="AuthenticateSessionsBase.cs">
131 <SubType>Code</SubType>
132 </Compile>
133 <Compile Include="AuthenticateSessionsLocal.cs">
134 <SubType>Code</SubType>
135 </Compile>
136 <Compile Include="AuthenticateSessionsRemote.cs">
137 <SubType>Code</SubType>
138 </Compile>
139 <Compile Include="ClientView.cs">
140 <SubType>Code</SubType>
141 </Compile>
142 <Compile Include="ClientView.Grid.cs">
143 <SubType>Code</SubType>
144 </Compile>
145 <Compile Include="ClientView.PacketHandlers.cs">
146 <SubType>Code</SubType>
147 </Compile>
148 <Compile Include="ClientView.ProcessPackets.cs">
149 <SubType>Code</SubType>
150 </Compile>
151 <Compile Include="ClientViewBase.cs">
152 <SubType>Code</SubType>
153 </Compile>
154 <Compile Include="Grid.cs">
155 <SubType>Code</SubType>
156 </Compile>
157 <Compile Include="OpenSimMain.cs">
158 <SubType>Code</SubType>
159 </Compile>
160 <Compile Include="OpenSimNetworkHandler.cs">
161 <SubType>Code</SubType>
162 </Compile>
163 <Compile Include="PacketServer.cs">
164 <SubType>Code</SubType>
165 </Compile>
166 <Compile Include="RegionInfo.cs">
167 <SubType>Code</SubType>
168 </Compile>
169 <Compile Include="RegionInfoBase.cs">
170 <SubType>Code</SubType>
171 </Compile>
172 <Compile Include="RegionServerBase.cs">
173 <SubType>Code</SubType>
174 </Compile>
175 <Compile Include="UDPServer.cs">
176 <SubType>Code</SubType>
177 </Compile>
178 <Compile Include="VersionInfo.cs">
179 <SubType>Code</SubType>
180 </Compile>
181 <Compile Include="Assets\AssetCache.cs">
182 <SubType>Code</SubType>
183 </Compile>
184 <Compile Include="Assets\InventoryCache.cs">
185 <SubType>Code</SubType>
186 </Compile>
187 <Compile Include="CAPS\AdminWebFront.cs">
188 <SubType>Code</SubType>
189 </Compile>
190 <Compile Include="types\Mesh.cs">
191 <SubType>Code</SubType>
192 </Compile>
193 <Compile Include="types\Triangle.cs">
194 <SubType>Code</SubType>
195 </Compile>
196 <Compile Include="world\Avatar.Client.cs">
197 <SubType>Code</SubType>
198 </Compile>
199 <Compile Include="world\Avatar.cs">
200 <SubType>Code</SubType>
201 </Compile>
202 <Compile Include="world\Avatar.Update.cs">
203 <SubType>Code</SubType>
204 </Compile>
205 <Compile Include="world\AvatarAnimations.cs">
206 <SubType>Code</SubType>
207 </Compile>
208 <Compile Include="world\Entity.cs">
209 <SubType>Code</SubType>
210 </Compile>
211 <Compile Include="world\Primitive.cs">
212 <SubType>Code</SubType>
213 </Compile>
214 <Compile Include="world\Primitive2.cs">
215 <SubType>Code</SubType>
216 </Compile>
217 <Compile Include="world\SceneObject.cs">
218 <SubType>Code</SubType>
219 </Compile>
220 <Compile Include="world\World.cs">
221 <SubType>Code</SubType>
222 </Compile>
223 <Compile Include="world\World.PacketHandlers.cs">
224 <SubType>Code</SubType>
225 </Compile>
226 <Compile Include="world\World.Scripting.cs">
227 <SubType>Code</SubType>
228 </Compile>
229 <Compile Include="world\WorldBase.cs">
230 <SubType>Code</SubType>
231 </Compile>
232 <Compile Include="world\scripting\IScriptContext.cs">
233 <SubType>Code</SubType>
234 </Compile>
235 <Compile Include="world\scripting\IScriptEntity.cs">
236 <SubType>Code</SubType>
237 </Compile>
238 <Compile Include="world\scripting\IScriptHandler.cs">
239 <SubType>Code</SubType>
240 </Compile>
241 <Compile Include="world\scripting\Script.cs">
242 <SubType>Code</SubType>
243 </Compile>
244 <Compile Include="world\scripting\ScriptFactory.cs">
245 <SubType>Code</SubType>
246 </Compile>
247 <Compile Include="world\scripting\Scripts\FollowRandomAvatar.cs">
248 <SubType>Code</SubType>
249 </Compile>
250 </ItemGroup>
251 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
252 <PropertyGroup>
253 <PreBuildEvent>
254 </PreBuildEvent>
255 <PostBuildEvent>
256 </PostBuildEvent>
257 </PropertyGroup>
258</Project>
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj.user b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
new file mode 100644
index 0000000..c984f5a
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
@@ -0,0 +1,90 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.RegionServer" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.RegionServer" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AgentAssetUpload.cs" />
15 <include name="AuthenticateSessionsBase.cs" />
16 <include name="AuthenticateSessionsLocal.cs" />
17 <include name="AuthenticateSessionsRemote.cs" />
18 <include name="ClientView.cs" />
19 <include name="ClientView.Grid.cs" />
20 <include name="ClientView.PacketHandlers.cs" />
21 <include name="ClientView.ProcessPackets.cs" />
22 <include name="ClientViewBase.cs" />
23 <include name="Grid.cs" />
24 <include name="OpenSimMain.cs" />
25 <include name="OpenSimNetworkHandler.cs" />
26 <include name="PacketServer.cs" />
27 <include name="RegionInfo.cs" />
28 <include name="RegionInfoBase.cs" />
29 <include name="RegionServerBase.cs" />
30 <include name="UDPServer.cs" />
31 <include name="VersionInfo.cs" />
32 <include name="Assets/AssetCache.cs" />
33 <include name="Assets/InventoryCache.cs" />
34 <include name="CAPS/AdminWebFront.cs" />
35 <include name="types/Mesh.cs" />
36 <include name="types/Triangle.cs" />
37 <include name="world/Avatar.Client.cs" />
38 <include name="world/Avatar.cs" />
39 <include name="world/Avatar.Update.cs" />
40 <include name="world/AvatarAnimations.cs" />
41 <include name="world/Entity.cs" />
42 <include name="world/Primitive.cs" />
43 <include name="world/Primitive2.cs" />
44 <include name="world/SceneObject.cs" />
45 <include name="world/World.cs" />
46 <include name="world/World.PacketHandlers.cs" />
47 <include name="world/World.Scripting.cs" />
48 <include name="world/WorldBase.cs" />
49 <include name="world/scripting/IScriptContext.cs" />
50 <include name="world/scripting/IScriptEntity.cs" />
51 <include name="world/scripting/IScriptHandler.cs" />
52 <include name="world/scripting/Script.cs" />
53 <include name="world/scripting/ScriptFactory.cs" />
54 <include name="world/scripting/Scripts/FollowRandomAvatar.cs" />
55 </sources>
56 <references basedir="${project::get-base-directory()}">
57 <lib>
58 <include name="${project::get-base-directory()}" />
59 <include name="${project::get-base-directory()}/${build.dir}" />
60 </lib>
61 <include name="System.dll" />
62 <include name="System.Xml.dll" />
63 <include name="../../bin/libsecondlife.dll" />
64 <include name="../../bin/Axiom.MathLib.dll" />
65 <include name="../../bin/Db4objects.Db4o.dll" />
66 <include name="../../bin/OpenSim.Terrain.BasicTerrain.dll" />
67 <include name="../../bin/OpenSim.Framework.dll" />
68 <include name="../../bin/OpenSim.Framework.Console.dll" />
69 <include name="../../bin/OpenSim.GenericConfig.Xml.dll" />
70 <include name="../../bin/OpenSim.Physics.Manager.dll" />
71 <include name="../../bin/OpenSim.Servers.dll" />
72 <include name="../../bin/XMLRPC.dll" />
73 </references>
74 </csc>
75 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
76 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
77 <copy todir="${project::get-base-directory()}/../../bin/">
78 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
79 <include name="*.dll"/>
80 <include name="*.exe"/>
81 </fileset>
82 </copy>
83 </target>
84 <target name="clean">
85 <delete dir="${bin.dir}" failonerror="false" />
86 <delete dir="${obj.dir}" failonerror="false" />
87 </target>
88 <target name="doc" description="Creates documentation.">
89 </target>
90</project>
diff --git a/OpenSim/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim/OpenSim.RegionServer/OpenSimMain.cs
new file mode 100644
index 0000000..003412d
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/OpenSimMain.cs
@@ -0,0 +1,531 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3
4* All rights reserved.
5*
6* Redistribution and use in source and binary forms, with or without
7* modification, are permitted provided that the following conditions are met:
8* * Redistributions of source code must retain the above copyright
9* notice, this list of conditions and the following disclaimer.
10* * Redistributions in binary form must reproduce the above copyright
11* notice, this list of conditions and the following disclaimer in the
12* documentation and/or other materials provided with the distribution.
13* * Neither the name of the <organization> nor the
14* names of its contributors may be used to endorse or promote products
15* derived from this software without specific prior written permission.
16*
17* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
18* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
21* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*/
28
29using System;
30using System.Text;
31using System.IO;
32using System.Threading;
33using System.Net;
34using System.Net.Sockets;
35using System.Timers;
36using System.Reflection;
37using System.Collections;
38using System.Collections.Generic;
39using libsecondlife;
40using libsecondlife.Packets;
41using OpenSim.world;
42using OpenSim.Terrain;
43using OpenSim.Framework.Interfaces;
44using OpenSim.Framework.Types;
45using OpenSim.UserServer;
46using OpenSim.Assets;
47using OpenSim.CAPS;
48using OpenSim.Framework.Console;
49using OpenSim.Physics.Manager;
50using Nwc.XmlRpc;
51using OpenSim.Servers;
52using OpenSim.GenericConfig;
53
54namespace OpenSim
55{
56 //moved to the opensim main application project (do we want it there or here?)
57/*
58 public class OpenSimMain : OpenSimApplicationBase , conscmd_callback
59 {
60
61 public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
62 {
63 this.configFileSetup = useConfigFile;
64 m_sandbox = sandBoxMode;
65 m_loginserver = startLoginServer;
66 m_physicsEngine = physicsEngine;
67 m_config = configFile;
68
69 m_console = new ConsoleBase("region-console-" + Guid.NewGuid().ToString() + ".log", "Region", this, silent);
70 OpenSim.Framework.Console.MainConsole.Instance = m_console;
71 }
72
73 /// <summary>
74 /// Performs initialisation of the world, such as loading configuration from disk.
75 /// </summary>
76 public override void StartUp()
77 {
78 this.regionData = new RegionInfo();
79 try
80 {
81 this.localConfig = new XmlConfig(m_config);
82 this.localConfig.LoadData();
83 }
84 catch (Exception e)
85 {
86 Console.WriteLine(e.Message);
87 }
88 if (this.configFileSetup)
89 {
90 this.SetupFromConfigFile(this.localConfig);
91 }
92 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Loading configuration");
93 this.regionData.InitConfig(this.m_sandbox, this.localConfig);
94 this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
95
96 GridServers = new Grid();
97 if (m_sandbox)
98 {
99 this.SetupLocalGridServers();
100 //Authenticate Session Handler
101 AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
102 this.AuthenticateSessionsHandler = authen;
103 }
104 else
105 {
106 this.SetupRemoteGridServers();
107 //Authenticate Session Handler
108 AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote();
109 this.AuthenticateSessionsHandler = authen;
110 }
111
112 startuptime = DateTime.Now;
113
114 try
115 {
116 AssetCache = new AssetCache(GridServers.AssetServer);
117 InventoryCache = new InventoryCache();
118 }
119 catch (Exception e)
120 {
121 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup local cache");
122 Environment.Exit(1);
123 }
124
125 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);
126
127 //should be passing a IGenericConfig object to these so they can read the config data they want from it
128 GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey);
129 IGridServer gridServer = GridServers.GridServer;
130 gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey);
131
132 if (!m_sandbox)
133 {
134 this.ConnectToRemoteGridServer();
135 }
136
137 this.SetupLocalWorld();
138
139 if (m_sandbox)
140 {
141 AssetCache.LoadDefaultTextureSet();
142 }
143
144 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Initialising HTTP server");
145
146 this.SetupHttpListener();
147
148 LoginServer loginServer = null;
149 LoginServer adminLoginServer = null;
150
151 bool sandBoxWithLoginServer = m_loginserver && m_sandbox;
152 if (sandBoxWithLoginServer)
153 {
154 loginServer = new LoginServer( regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts);
155 loginServer.Startup();
156 loginServer.SetSessionHandler(((AuthenticateSessionsLocal) this.AuthenticateSessionsHandler).AddNewSession);
157
158 if (user_accounts)
159 {
160 //sandbox mode with loginserver using accounts
161 this.GridServers.UserServer = loginServer;
162 adminLoginServer = loginServer;
163
164 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.LocalUserManager.XmlRpcLoginMethod);
165 }
166 else
167 {
168 //sandbox mode with loginserver not using accounts
169 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
170 }
171 }
172
173 AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer);
174 adminWebFront.LoadMethods(httpServer);
175
176 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP server");
177 httpServer.Start();
178
179 //MainServerListener();
180 this.m_udpServer.ServerListener();
181
182 m_heartbeatTimer.Enabled = true;
183 m_heartbeatTimer.Interval = 100;
184 m_heartbeatTimer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
185 }
186
187 # region Setup methods
188 protected virtual void SetupLocalGridServers()
189 {
190 GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll";
191 GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll";
192
193 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Sandbox mode");
194
195 try
196 {
197 GridServers.Initialise();
198 }
199 catch (Exception e)
200 {
201 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface");
202 Environment.Exit(1);
203 }
204 }
205
206 protected virtual void SetupRemoteGridServers()
207 {
208 if (this.gridLocalAsset)
209 {
210 GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll";
211 }
212 else
213 {
214 GridServers.AssetDll = "OpenSim.GridInterfaces.Remote.dll";
215 }
216 GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll";
217
218 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Grid mode");
219
220 try
221 {
222 GridServers.Initialise();
223 }
224 catch (Exception e)
225 {
226 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface");
227 Environment.Exit(1);
228 }
229 }
230
231 protected virtual void SetupLocalWorld()
232 {
233 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString());
234 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Initialising world");
235 m_console.componentname = "Region " + regionData.RegionName;
236
237 m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName);
238 LocalWorld.InventoryCache = InventoryCache;
239 LocalWorld.AssetCache = AssetCache;
240
241 this.m_udpServer.LocalWorld = LocalWorld;
242 this.m_udpServer.PacketServer.RegisterClientPacketHandlers();
243
244 this.physManager = new OpenSim.Physics.Manager.PhysicsManager();
245 this.physManager.LoadPlugins();
246
247 LocalWorld.m_datastore = this.regionData.DataStore;
248
249 LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded.
250 LocalWorld.LoadWorldMap();
251
252 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting up messaging system");
253 LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
254 LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
255 LocalWorld.LoadPrimsFromStorage();
256 }
257
258 protected virtual void SetupHttpListener()
259 {
260 httpServer = new BaseHttpServer(regionData.IPListenPort);
261
262 if (this.GridServers.GridServer.GetName() == "Remote")
263 {
264
265 // we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
266 httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler).ExpectUser );
267
268 httpServer.AddXmlRPCHandler("agent_crossing",
269 delegate(XmlRpcRequest request)
270 {
271 Hashtable requestData = (Hashtable)request.Params[0];
272 AgentCircuitData agent_data = new AgentCircuitData();
273 agent_data.firstname = (string)requestData["firstname"];
274 agent_data.lastname = (string)requestData["lastname"];
275 agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
276 agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]), Single.Parse((string)requestData["pos_y"]), Single.Parse((string)requestData["pos_z"]));
277
278 if (((RemoteGridBase)this.GridServers.GridServer).agentcircuits.ContainsKey((uint)agent_data.circuitcode))
279 {
280 ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].firstname = agent_data.firstname;
281 ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].lastname = agent_data.lastname;
282 ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].startpos = agent_data.startpos;
283 }
284
285 return new XmlRpcResponse();
286 });
287
288 httpServer.AddRestHandler("GET", "/simstatus/",
289 delegate(string request, string path, string param)
290 {
291 return "OK";
292 });
293 }
294 }
295
296 protected virtual void ConnectToRemoteGridServer()
297 {
298 if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort))
299 {
300 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Success: Got a grid connection OK!");
301 }
302 else
303 {
304 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "Main.cs:Startup() - FAILED: Unable to get connection to grid. Shutting down.");
305 Shutdown();
306 }
307
308 GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]);
309
310 // If we are being told to load a file, load it.
311 string dataUri = (string)((RemoteGridBase)GridServers.GridServer).GridData["data_uri"];
312
313 if (!String.IsNullOrEmpty(dataUri))
314 {
315 this.LocalWorld.m_datastore = dataUri;
316 }
317
318 if (((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString() != "")
319 {
320 // The grid server has told us who we are
321 // We must obey the grid server.
322 try
323 {
324 regionData.RegionLocX = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locx"].ToString());
325 regionData.RegionLocY = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locy"].ToString());
326 regionData.RegionName = ((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString();
327 }
328 catch (Exception e)
329 {
330 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, e.Message + "\nBAD ERROR! THIS SHOULD NOT HAPPEN! Bad GridData from the grid interface!!!! ZOMG!!!");
331 Environment.Exit(1);
332 }
333 }
334 }
335
336 #endregion
337
338 private void SetupFromConfigFile(IGenericConfig configData)
339 {
340 try
341 {
342 // SandBoxMode
343 string attri = "";
344 attri = configData.GetAttribute("SandBox");
345 if ((attri == "") || ((attri != "false") && (attri != "true")))
346 {
347 this.m_sandbox = false;
348 configData.SetAttribute("SandBox", "false");
349 }
350 else
351 {
352 this.m_sandbox = Convert.ToBoolean(attri);
353 }
354
355 // LoginServer
356 attri = "";
357 attri = configData.GetAttribute("LoginServer");
358 if ((attri == "") || ((attri != "false") && (attri != "true")))
359 {
360 this.m_loginserver = false;
361 configData.SetAttribute("LoginServer", "false");
362 }
363 else
364 {
365 this.m_loginserver = Convert.ToBoolean(attri);
366 }
367
368 // Sandbox User accounts
369 attri = "";
370 attri = configData.GetAttribute("UserAccount");
371 if ((attri == "") || ((attri != "false") && (attri != "true")))
372 {
373 this.user_accounts = false;
374 configData.SetAttribute("UserAccounts", "false");
375 }
376 else if (attri == "true")
377 {
378 this.user_accounts = Convert.ToBoolean(attri);
379 }
380
381 // Grid mode hack to use local asset server
382 attri = "";
383 attri = configData.GetAttribute("LocalAssets");
384 if ((attri == "") || ((attri != "false") && (attri != "true")))
385 {
386 this.gridLocalAsset = false;
387 configData.SetAttribute("LocalAssets", "false");
388 }
389 else if (attri == "true")
390 {
391 this.gridLocalAsset = Convert.ToBoolean(attri);
392 }
393
394
395 attri = "";
396 attri = configData.GetAttribute("PhysicsEngine");
397 switch (attri)
398 {
399 default:
400 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Main.cs: SetupFromConfig() - Invalid value for PhysicsEngine attribute, terminating");
401 Environment.Exit(1);
402 break;
403
404 case "":
405 this.m_physicsEngine = "basicphysics";
406 configData.SetAttribute("PhysicsEngine", "basicphysics");
407 OpenSim.world.Avatar.PhysicsEngineFlying = false;
408 break;
409
410 case "basicphysics":
411 this.m_physicsEngine = "basicphysics";
412 configData.SetAttribute("PhysicsEngine", "basicphysics");
413 OpenSim.world.Avatar.PhysicsEngineFlying = false;
414 break;
415
416 case "RealPhysX":
417 this.m_physicsEngine = "RealPhysX";
418 OpenSim.world.Avatar.PhysicsEngineFlying = true;
419 break;
420
421 case "OpenDynamicsEngine":
422 this.m_physicsEngine = "OpenDynamicsEngine";
423 OpenSim.world.Avatar.PhysicsEngineFlying = true;
424 break;
425 }
426
427 configData.Commit();
428 }
429 catch (Exception e)
430 {
431 Console.WriteLine(e.Message);
432 Console.WriteLine("\nSorry, a fatal error occurred while trying to initialise the configuration data");
433 Console.WriteLine("Can not continue starting up");
434 Environment.Exit(1);
435 }
436 }
437
438 /// <summary>
439 /// Performs any last-minute sanity checking and shuts down the region server
440 /// </summary>
441 public virtual void Shutdown()
442 {
443 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing all threads");
444 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing listener thread");
445 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing clients");
446 // IMPLEMENT THIS
447 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing console and terminating");
448 LocalWorld.Close();
449 GridServers.Close();
450 m_console.Close();
451 Environment.Exit(0);
452 }
453
454 /// <summary>
455 /// Performs per-frame updates regularly
456 /// </summary>
457 /// <param name="sender"></param>
458 /// <param name="e"></param>
459 void Heartbeat(object sender, System.EventArgs e)
460 {
461 LocalWorld.Update();
462 }
463
464 #region Console Commands
465 /// <summary>
466 /// Runs commands issued by the server console from the operator
467 /// </summary>
468 /// <param name="command">The first argument of the parameter (the command)</param>
469 /// <param name="cmdparams">Additional arguments passed to the command</param>
470 public void RunCmd(string command, string[] cmdparams)
471 {
472 switch (command)
473 {
474 case "help":
475 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "show users - show info about connected users");
476 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "shutdown - disconnect all clients and shutdown");
477 break;
478
479 case "show":
480 Show(cmdparams[0]);
481 break;
482
483 case "terrain":
484 string result = "";
485 if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams, ref result))
486 {
487 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, result);
488 }
489 break;
490
491 case "shutdown":
492 Shutdown();
493 break;
494
495 default:
496 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "Unknown command");
497 break;
498 }
499 }
500
501 /// <summary>
502 /// Outputs to the console information about the region
503 /// </summary>
504 /// <param name="ShowWhat">What information to display (valid arguments are "uptime", "users")</param>
505 public void Show(string ShowWhat)
506 {
507 switch (ShowWhat)
508 {
509 case "uptime":
510 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "OpenSim has been running since " + startuptime.ToString());
511 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "That is " + (DateTime.Now - startuptime).ToString());
512 break;
513 case "users":
514 OpenSim.world.Avatar TempAv;
515 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP"));
516 foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys)
517 {
518 if (LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
519 {
520 TempAv = (OpenSim.world.Avatar)LocalWorld.Entities[UUID];
521 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, 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()));
522 }
523 }
524 break;
525 }
526 }
527 #endregion
528 }
529
530 */
531}
diff --git a/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs b/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs
new file mode 100644
index 0000000..15ee740
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs
@@ -0,0 +1,18 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Net;
5using System.Net.Sockets;
6using libsecondlife;
7using OpenSim.Framework.Interfaces;
8
9namespace OpenSim
10{
11 public interface OpenSimNetworkHandler
12 {
13 void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender);
14 void RemoveClientCircuit(uint circuitcode);
15 void RegisterPacketServer(PacketServer server);
16 AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
17 }
18}
diff --git a/OpenSim/OpenSim.RegionServer/PacketServer.cs b/OpenSim/OpenSim.RegionServer/PacketServer.cs
new file mode 100644
index 0000000..9c8f65c
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/PacketServer.cs
@@ -0,0 +1,88 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.world;
5using libsecondlife.Packets;
6
7namespace OpenSim
8{
9 public class PacketServer
10 {
11 private OpenSimNetworkHandler _networkHandler;
12 private World _localWorld;
13 public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
14
15 public PacketServer(OpenSimNetworkHandler networkHandler)
16 {
17 _networkHandler = networkHandler;
18 _networkHandler.RegisterPacketServer(this);
19 }
20
21 public World LocalWorld
22 {
23 set
24 {
25 this._localWorld = value;
26 }
27 }
28
29 public virtual void ClientInPacket(uint circuitCode, Packet packet)
30 {
31 if (this.ClientThreads.ContainsKey(circuitCode))
32 {
33 ClientThreads[circuitCode].InPacket(packet);
34 }
35 }
36
37 public virtual bool AddNewCircuitCodeClient(uint circuitCode)
38 {
39 return false;
40 }
41
42 public virtual void SendPacketToAllClients(Packet packet)
43 {
44
45 }
46
47 public virtual void SendPacketToAllExcept(Packet packet, ClientView simClient)
48 {
49
50 }
51
52 public virtual void AddClientPacketHandler(PacketType packetType, PacketMethod handler)
53 {
54
55 }
56
57 public virtual void RegisterClientPacketHandlers()
58 {
59 if (this._localWorld != null)
60 {
61 ClientView.AddPacketHandler(PacketType.UUIDNameRequest, this.RequestUUIDName);
62 }
63 }
64
65 #region Client Packet Handlers
66
67 public bool RequestUUIDName(ClientView simClient, Packet packet)
68 {
69 System.Text.Encoding enc = System.Text.Encoding.ASCII;
70 Console.WriteLine(packet.ToString());
71 UUIDNameRequestPacket nameRequest = (UUIDNameRequestPacket)packet;
72 UUIDNameReplyPacket nameReply = new UUIDNameReplyPacket();
73 nameReply.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[nameRequest.UUIDNameBlock.Length];
74
75 for (int i = 0; i < nameRequest.UUIDNameBlock.Length; i++)
76 {
77 nameReply.UUIDNameBlock[i] = new UUIDNameReplyPacket.UUIDNameBlockBlock();
78 nameReply.UUIDNameBlock[i].ID = nameRequest.UUIDNameBlock[i].ID;
79 nameReply.UUIDNameBlock[i].FirstName = enc.GetBytes("Who\0"); //for now send any name
80 nameReply.UUIDNameBlock[i].LastName = enc.GetBytes("Knows\0"); //in future need to look it up
81 }
82 simClient.OutPacket(nameReply);
83 return true;
84 }
85
86 #endregion
87 }
88}
diff --git a/OpenSim/OpenSim.RegionServer/RegionInfo.cs b/OpenSim/OpenSim.RegionServer/RegionInfo.cs
new file mode 100644
index 0000000..f82495a
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/RegionInfo.cs
@@ -0,0 +1,261 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Net;
5using System.Web;
6using System.IO;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Utilities;
9using libsecondlife;
10
11namespace OpenSim
12{
13 public class RegionInfo : RegionInfoBase
14 {
15 //following should be removed and the GenericConfig object passed around,
16 //so each class (AssetServer, GridServer etc) can access what config data they want
17 public string AssetURL = "http://127.0.0.1:8003/";
18 public string AssetSendKey = "";
19
20 public string GridURL = "";
21 public string GridSendKey = "";
22 public string GridRecvKey = "";
23 public string UserURL = "";
24 public string UserSendKey = "";
25 public string UserRecvKey = "";
26 private bool isSandbox;
27
28 public string DataStore;
29
30 public RegionInfo()
31 {
32
33 }
34
35 public void SaveToGrid()
36 {
37 //we really want to keep any server connection code out of here and out of the code code
38 // and put it in the server connection classes (those inheriting from IGridServer etc)
39 string reqtext;
40 reqtext = "<Root>";
41 reqtext += "<authkey>" + this.GridSendKey + "</authkey>";
42 reqtext += "<sim>";
43 reqtext += "<uuid>" + this.SimUUID.ToString() + "</uuid>";
44 reqtext += "<regionname>" + this.RegionName + "</regionname>";
45 reqtext += "<sim_ip>" + this.IPListenAddr + "</sim_ip>";
46 reqtext += "<sim_port>" + this.IPListenPort.ToString() + "</sim_port>";
47 reqtext += "<region_locx>" + this.RegionLocX.ToString() + "</region_locx>";
48 reqtext += "<region_locy>" + this.RegionLocY.ToString() + "</region_locy>";
49 reqtext += "<estate_id>1</estate_id>";
50 reqtext += "</sim>";
51 reqtext += "</Root>";
52
53 byte[] reqdata = (new System.Text.ASCIIEncoding()).GetBytes(reqtext);
54 string newpath = "";
55 if (this.GridURL.EndsWith("/"))
56 {
57 newpath = this.GridURL + "sims/";
58 }
59 else
60 {
61 newpath = this.GridURL + "/sims/";
62 }
63
64 WebRequest GridSaveReq = WebRequest.Create(newpath + this.SimUUID.ToString());
65 GridSaveReq.Method = "POST";
66 GridSaveReq.ContentType = "application/x-www-form-urlencoded";
67 GridSaveReq.ContentLength = reqdata.Length;
68
69 Stream stOut = GridSaveReq.GetRequestStream();
70 stOut.Write(reqdata, 0, reqdata.Length);
71 stOut.Close();
72
73 WebResponse gridresp = GridSaveReq.GetResponse();
74 StreamReader stIn = new StreamReader(gridresp.GetResponseStream(), Encoding.ASCII);
75 string GridResponse = stIn.ReadToEnd();
76 stIn.Close();
77 gridresp.Close();
78
79 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse);
80 }
81
82 public void InitConfig(bool sandboxMode, IGenericConfig configData)
83 {
84 this.isSandbox = sandboxMode;
85 try
86 {
87 // Sim UUID
88 string attri = "";
89 attri = configData.GetAttribute("SimUUID");
90 if (attri == "")
91 {
92 this.SimUUID = LLUUID.Random();
93 configData.SetAttribute("SimUUID", this.SimUUID.ToString());
94 }
95 else
96 {
97 this.SimUUID = new LLUUID(attri);
98 }
99
100 // Sim name
101 attri = "";
102 attri = configData.GetAttribute("SimName");
103 if (attri == "")
104 {
105 this.RegionName = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Name", "OpenSim test");
106 configData.SetAttribute("SimName", this.RegionName);
107 }
108 else
109 {
110 this.RegionName = attri;
111 }
112 // Sim/Grid location X
113 attri = "";
114 attri = configData.GetAttribute("SimLocationX");
115 if (attri == "")
116 {
117 string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location X", "997");
118 configData.SetAttribute("SimLocationX", location);
119 this.RegionLocX = (uint)Convert.ToUInt32(location);
120 }
121 else
122 {
123 this.RegionLocX = (uint)Convert.ToUInt32(attri);
124 }
125 // Sim/Grid location Y
126 attri = "";
127 attri = configData.GetAttribute("SimLocationY");
128 if (attri == "")
129 {
130 string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location Y", "996");
131 configData.SetAttribute("SimLocationY", location);
132 this.RegionLocY = (uint)Convert.ToUInt32(location);
133 }
134 else
135 {
136 this.RegionLocY = (uint)Convert.ToUInt32(attri);
137 }
138
139 // Local storage datastore
140 attri = "";
141 attri = configData.GetAttribute("Datastore");
142 if (attri == "")
143 {
144 string datastore = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Filename for local storage", "localworld.yap");
145 configData.SetAttribute("Datastore", datastore);
146 this.DataStore = datastore;
147 }
148 else
149 {
150 this.DataStore = attri;
151 }
152
153 //Sim Listen Port
154 attri = "";
155 attri = configData.GetAttribute("SimListenPort");
156 if (attri == "")
157 {
158 string port = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("UDP port for client connections", "9000");
159 configData.SetAttribute("SimListenPort", port);
160 this.IPListenPort = Convert.ToInt32(port);
161 }
162 else
163 {
164 this.IPListenPort = Convert.ToInt32(attri);
165 }
166 //Sim Listen Address
167 attri = "";
168 attri = configData.GetAttribute("SimListenAddress");
169 if (attri == "")
170 {
171 this.IPListenAddr = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("IP Address to listen on for client connections", "127.0.0.1");
172 configData.SetAttribute("SimListenAddress", this.IPListenAddr);
173 }
174 else
175 {
176 this.IPListenAddr = attri;
177 }
178
179 if (!isSandbox)
180 {
181 //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
182
183 //Grid Server URL
184 attri = "";
185 attri = configData.GetAttribute("GridServerURL");
186 if (attri == "")
187 {
188 this.GridURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/");
189 configData.SetAttribute("GridServerURL", this.GridURL);
190 }
191 else
192 {
193 this.GridURL = attri;
194 }
195
196 //Grid Send Key
197 attri = "";
198 attri = configData.GetAttribute("GridSendKey");
199 if (attri == "")
200 {
201 this.GridSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to grid server","null");
202 configData.SetAttribute("GridSendKey", this.GridSendKey);
203 }
204 else
205 {
206 this.GridSendKey = attri;
207 }
208
209 //Grid Receive Key
210 attri = "";
211 attri = configData.GetAttribute("GridRecvKey");
212 if (attri == "")
213 {
214 this.GridRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from grid server","null");
215 configData.SetAttribute("GridRecvKey", this.GridRecvKey);
216 }
217 else
218 {
219 this.GridRecvKey = attri;
220 }
221
222 attri = "";
223 attri = configData.GetAttribute("AssetServerURL");
224 if (attri == "")
225 {
226 this.AssetURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/");
227 configData.SetAttribute("AssetServerURL", this.GridURL);
228 }
229 else
230 {
231 this.AssetURL = attri;
232 }
233
234 }
235 this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
236 if (!this.isSandbox)
237 {
238 this.SaveToGrid();
239 }
240 configData.Commit();
241 }
242 catch (Exception e)
243 {
244 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Config.cs:InitConfig() - Exception occured");
245 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString());
246 }
247
248 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Sim settings loaded:");
249 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "UUID: " + this.SimUUID.ToStringHyphenated());
250 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Name: " + this.RegionName);
251 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]");
252 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Region Handle: " + this.RegionHandle.ToString());
253 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort);
254 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Sandbox Mode? " + isSandbox.ToString());
255 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Asset URL: " + this.AssetURL);
256 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Asset key: " + this.AssetSendKey);
257 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Grid URL: " + this.GridURL);
258 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Grid key: " + this.GridSendKey);
259 }
260 }
261}
diff --git a/OpenSim/OpenSim.RegionServer/RegionInfoBase.cs b/OpenSim/OpenSim.RegionServer/RegionInfoBase.cs
new file mode 100644
index 0000000..42d3030
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/RegionInfoBase.cs
@@ -0,0 +1,32 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Net;
5using System.Web;
6using System.IO;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Utilities;
9using libsecondlife;
10
11namespace OpenSim
12{
13 public class RegionInfoBase
14 {
15 public LLUUID SimUUID;
16 public string RegionName;
17 public uint RegionLocX;
18 public uint RegionLocY;
19 public ulong RegionHandle;
20 public ushort RegionWaterHeight = 20;
21 public bool RegionTerraform = true;
22
23 public int IPListenPort;
24 public string IPListenAddr;
25
26 public RegionInfoBase()
27 {
28
29 }
30 }
31
32}
diff --git a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs b/OpenSim/OpenSim.RegionServer/RegionServerBase.cs
new file mode 100644
index 0000000..69a8748
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/RegionServerBase.cs
@@ -0,0 +1,103 @@
1using System;
2using System.Text;
3using System.IO;
4using System.Threading;
5using System.Net;
6using System.Net.Sockets;
7using System.Timers;
8using System.Reflection;
9using System.Collections;
10using System.Collections.Generic;
11using libsecondlife;
12using libsecondlife.Packets;
13using OpenSim.world;
14using OpenSim.Terrain;
15using OpenSim.Framework.Interfaces;
16using OpenSim.Framework.Types;
17using OpenSim.UserServer;
18using OpenSim.Assets;
19using OpenSim.CAPS;
20using OpenSim.Framework.Console;
21using OpenSim.Physics.Manager;
22using Nwc.XmlRpc;
23using OpenSim.Servers;
24using OpenSim.GenericConfig;
25
26namespace OpenSim
27{
28 public class RegionServerBase
29 {
30 protected IGenericConfig localConfig;
31 protected PhysicsManager physManager;
32 protected Grid GridServers;
33 protected AssetCache AssetCache;
34 protected InventoryCache InventoryCache;
35 protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
36 protected DateTime startuptime;
37 protected RegionInfo regionData;
38
39 protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
40 public string m_physicsEngine;
41 public bool m_sandbox = false;
42 public bool m_loginserver;
43 public bool user_accounts = false;
44 public bool gridLocalAsset = false;
45 protected bool configFileSetup = false;
46 public string m_config;
47
48 protected UDPServer m_udpServer;
49 protected BaseHttpServer httpServer;
50 protected AuthenticateSessionsBase AuthenticateSessionsHandler;
51
52 protected ConsoleBase m_console;
53
54 public RegionServerBase()
55 {
56
57 }
58
59 public RegionServerBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
60 {
61 this.configFileSetup = useConfigFile;
62 m_sandbox = sandBoxMode;
63 m_loginserver = startLoginServer;
64 m_physicsEngine = physicsEngine;
65 m_config = configFile;
66 }
67
68 protected World m_localWorld;
69 public World LocalWorld
70 {
71 get { return m_localWorld; }
72 }
73
74 /// <summary>
75 /// Performs initialisation of the world, such as loading configuration from disk.
76 /// </summary>
77 public virtual void StartUp()
78 {
79 }
80
81 protected virtual void SetupLocalGridServers()
82 {
83 }
84
85 protected virtual void SetupRemoteGridServers()
86 {
87
88 }
89
90 protected virtual void SetupLocalWorld()
91 {
92 }
93
94 protected virtual void SetupHttpListener()
95 {
96 }
97
98 protected virtual void ConnectToRemoteGridServer()
99 {
100
101 }
102 }
103}
diff --git a/OpenSim/OpenSim.RegionServer/UDPServer.cs b/OpenSim/OpenSim.RegionServer/UDPServer.cs
new file mode 100644
index 0000000..3a93e66
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/UDPServer.cs
@@ -0,0 +1,205 @@
1using System;
2using System.Text;
3using System.IO;
4using System.Threading;
5using System.Net;
6using System.Net.Sockets;
7using System.Timers;
8using System.Reflection;
9using System.Collections;
10using System.Collections.Generic;
11using libsecondlife;
12using libsecondlife.Packets;
13using OpenSim.world;
14using OpenSim.Terrain;
15using OpenSim.Framework.Interfaces;
16using OpenSim.Framework.Types;
17using OpenSim.UserServer;
18using OpenSim.Assets;
19using OpenSim.CAPS;
20using OpenSim.Framework.Console;
21using Nwc.XmlRpc;
22using OpenSim.Servers;
23using OpenSim.GenericConfig;
24
25namespace OpenSim
26{
27 public delegate AuthenticateResponse AuthenticateSessionHandler(LLUUID sessionID, LLUUID agentID, uint circuitCode);
28
29 public class UDPServer : OpenSimNetworkHandler
30 {
31 protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
32 public Socket Server;
33 protected IPEndPoint ServerIncoming;
34 protected byte[] RecvBuffer = new byte[4096];
35 protected byte[] ZeroBuffer = new byte[8192];
36 protected IPEndPoint ipeSender;
37 protected EndPoint epSender;
38 protected AsyncCallback ReceivedData;
39 protected PacketServer _packetServer;
40
41 protected int listenPort;
42 protected Grid m_gridServers;
43 protected World m_localWorld;
44 protected AssetCache m_assetCache;
45 protected InventoryCache m_inventoryCache;
46 protected RegionInfo m_regionData;
47 protected bool m_sandbox = false;
48 protected bool user_accounts = false;
49 protected ConsoleBase m_console;
50 protected AuthenticateSessionsBase m_authenticateSessionsClass;
51
52 public AuthenticateSessionHandler AuthenticateHandler;
53
54 public PacketServer PacketServer
55 {
56 get
57 {
58 return _packetServer;
59 }
60 set
61 {
62 _packetServer = value;
63 }
64 }
65
66 public World LocalWorld
67 {
68 set
69 {
70 this.m_localWorld = value;
71 this._packetServer.LocalWorld = this.m_localWorld;
72 }
73 }
74
75 public UDPServer()
76 {
77 }
78
79 public UDPServer(int port, Grid gridServers, AssetCache assetCache, InventoryCache inventoryCache, RegionInfo _regionData, bool sandbox, bool accounts, ConsoleBase console, AuthenticateSessionsBase authenticateClass)
80 {
81 listenPort = port;
82 this.m_gridServers = gridServers;
83 this.m_assetCache = assetCache;
84 this.m_inventoryCache = inventoryCache;
85 this.m_regionData = _regionData;
86 this.m_sandbox = sandbox;
87 this.user_accounts = accounts;
88 this.m_console = console;
89 this.m_authenticateSessionsClass = authenticateClass;
90 this.CreatePacketServer();
91
92 //set up delegate for authenticate sessions
93 this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_authenticateSessionsClass.AuthenticateSession);
94 }
95
96 protected virtual void CreatePacketServer()
97 {
98 PacketServer packetServer = new PacketServer(this);
99 }
100
101 protected virtual void OnReceivedData(IAsyncResult result)
102 {
103 ipeSender = new IPEndPoint(IPAddress.Any, 0);
104 epSender = (EndPoint)ipeSender;
105 Packet packet = null;
106 int numBytes = Server.EndReceiveFrom(result, ref epSender);
107 int packetEnd = numBytes - 1;
108
109 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
110
111 // do we already have a circuit for this endpoint
112 if (this.clientCircuits.ContainsKey(epSender))
113 {
114 //if so then send packet to the packetserver
115 this._packetServer.ClientInPacket(this.clientCircuits[epSender], packet);
116 }
117 else if (packet.Type == PacketType.UseCircuitCode)
118 {
119 // new client
120 this.AddNewClient(packet);
121 }
122 else
123 { // invalid client
124 Console.Error.WriteLine("UDPServer.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString());
125 }
126
127 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
128 }
129
130 protected virtual void AddNewClient(Packet packet)
131 {
132 UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet;
133 this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
134 bool isChildAgent = false;
135
136 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);
137 if ((this.m_gridServers.UserServer != null) && (user_accounts))
138 {
139 newuser.UserServer = this.m_gridServers.UserServer;
140 }
141 //OpenSimRoot.Instance.ClientThreads.Add(epSender, newuser);
142 this._packetServer.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
143 }
144
145 public void ServerListener()
146 {
147 m_console.WriteLine("UDPServer.cs:ServerListener() - Opening UDP socket on " + listenPort);
148
149 ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
150 Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
151 Server.Bind(ServerIncoming);
152
153 m_console.WriteLine("UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen");
154
155 ipeSender = new IPEndPoint(IPAddress.Any, 0);
156 epSender = (EndPoint)ipeSender;
157 ReceivedData = new AsyncCallback(this.OnReceivedData);
158 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
159
160 m_console.WriteLine("UDPServer.cs:ServerListener() - Listening...");
161
162 }
163
164 public virtual void RegisterPacketServer(PacketServer server)
165 {
166 this._packetServer = server;
167 }
168
169 public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)//EndPoint packetSender)
170 {
171 // find the endpoint for this circuit
172 EndPoint sendto = null;
173 foreach (KeyValuePair<EndPoint, uint> p in this.clientCircuits)
174 {
175 if (p.Value == circuitcode)
176 {
177 sendto = p.Key;
178 break;
179 }
180 }
181 if (sendto != null)
182 {
183 //we found the endpoint so send the packet to it
184 this.Server.SendTo(buffer, size, flags, sendto);
185 }
186 }
187
188 public virtual void RemoveClientCircuit(uint circuitcode)
189 {
190 foreach (KeyValuePair<EndPoint, uint> p in this.clientCircuits)
191 {
192 if (p.Value == circuitcode)
193 {
194 this.clientCircuits.Remove(p.Key);
195 break;
196 }
197 }
198 }
199
200 public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
201 {
202 return this.AuthenticateHandler(sessionID, agentID, circuitCode);
203 }
204 }
205} \ No newline at end of file
diff --git a/OpenSim/OpenSim.RegionServer/VersionInfo.cs b/OpenSim/OpenSim.RegionServer/VersionInfo.cs
new file mode 100644
index 0000000..49cc6a5
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/VersionInfo.cs
@@ -0,0 +1,37 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*/
26
27using System;
28
29namespace OpenSim
30{
31 /// <summary>
32 /// </summary>
33 public class VersionInfo
34 {
35 public static string Version = "0.2, SVN build - please use releng if you desire any form of support";
36 }
37}
diff --git a/OpenSim/OpenSim.RegionServer/types/Mesh.cs b/OpenSim/OpenSim.RegionServer/types/Mesh.cs
new file mode 100644
index 0000000..3e00c91
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/types/Mesh.cs
@@ -0,0 +1,28 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.types
6{
7 // TODO: This will need some performance tuning no doubt.
8 public class Mesh
9 {
10 public List<Triangle> mesh;
11
12 public Mesh()
13 {
14 mesh = new List<Triangle>();
15 }
16
17 public void AddTri(Triangle tri)
18 {
19 mesh.Add(tri);
20 }
21
22 public static Mesh operator +(Mesh a, Mesh b)
23 {
24 a.mesh.AddRange(b.mesh);
25 return a;
26 }
27 }
28}
diff --git a/OpenSim/OpenSim.RegionServer/types/Triangle.cs b/OpenSim/OpenSim.RegionServer/types/Triangle.cs
new file mode 100644
index 0000000..8dfea6e
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/types/Triangle.cs
@@ -0,0 +1,28 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Axiom.MathLib;
5
6namespace OpenSim.types
7{
8 public class Triangle
9 {
10 Vector3 a;
11 Vector3 b;
12 Vector3 c;
13
14 public Triangle()
15 {
16 a = new Vector3();
17 b = new Vector3();
18 c = new Vector3();
19 }
20
21 public Triangle(Vector3 A, Vector3 B, Vector3 C)
22 {
23 a = A;
24 b = B;
25 c = C;
26 }
27 }
28}
diff --git a/OpenSim/OpenSim.RegionServer/world/Avatar.Client.cs b/OpenSim/OpenSim.RegionServer/world/Avatar.Client.cs
new file mode 100644
index 0000000..7656a89
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/Avatar.Client.cs
@@ -0,0 +1,33 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife.Packets;
5
6namespace OpenSim.world
7{
8 partial class Avatar
9 {
10 private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> updateList = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
11 private List<Entity> interestList = new List<Entity>();
12
13 public void SendPacketToViewer(Packet packet)
14 {
15 this.ControllingClient.OutPacket(packet);
16 }
17
18 public void AddTerseUpdateToViewersList(ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock)
19 {
20
21 }
22
23 public void SendUpdateListToViewer()
24 {
25
26 }
27
28 private void UpdateInterestList()
29 {
30
31 }
32 }
33}
diff --git a/OpenSim/OpenSim.RegionServer/world/Avatar.Update.cs b/OpenSim/OpenSim.RegionServer/world/Avatar.Update.cs
new file mode 100644
index 0000000..67eab24
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/Avatar.Update.cs
@@ -0,0 +1,338 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using libsecondlife.Packets;
6using OpenSim.Physics.Manager;
7
8namespace OpenSim.world
9{
10 partial class Avatar
11 {
12 public override void update()
13 {
14 if (!this.childAvatar)
15 {
16 if (this._physActor == null)
17 {
18 //HACKHACK: Note to work out why this entity does not have a physics actor
19 // and prehaps create one.
20 return;
21 }
22 libsecondlife.LLVector3 pos2 = new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z);
23 if (this.updateflag)
24 {
25 //need to send movement info
26 //so create the improvedterseobjectupdate packet
27 //use CreateTerseBlock()
28 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
29 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
30 terse.RegionData.RegionHandle = m_regionHandle; // FIXME
31 terse.RegionData.TimeDilation = 64096;
32 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
33 terse.ObjectData[0] = terseBlock;
34 List<Avatar> avList = this.m_world.RequestAvatarList();
35 foreach (Avatar client in avList)
36 {
37 client.SendPacketToViewer(terse);
38 }
39
40 updateflag = false;
41 //this._updateCount = 0;
42 }
43 else
44 {
45
46 if ((pos2 != this.positionLastFrame) || (this.movementflag == 16))
47 {
48 _updateCount++;
49 if (((!PhysicsEngineFlying) && (_updateCount > 3)) || (PhysicsEngineFlying) && (_updateCount > 0))
50 {
51 //It has been a while since last update was sent so lets send one.
52 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
53 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
54 terse.RegionData.RegionHandle = m_regionHandle; // FIXME
55 terse.RegionData.TimeDilation = 64096;
56 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
57 terse.ObjectData[0] = terseBlock;
58 List<Avatar> avList = this.m_world.RequestAvatarList();
59 foreach (Avatar client in avList)
60 {
61 client.SendPacketToViewer(terse);
62 }
63 _updateCount = 0;
64 }
65
66 if (this.movementflag == 16)
67 {
68 movementflag = 0;
69 }
70 }
71
72 }
73 this.positionLastFrame = pos2;
74
75 if (!this.ControllingClient.m_sandboxMode)
76 {
77 if (pos2.X < 0)
78 {
79 ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z));
80 }
81
82 if (pos2.Y < 0)
83 {
84 ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z));
85 }
86
87 if (pos2.X > 255)
88 {
89 ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z));
90 }
91
92 if (pos2.Y > 255)
93 {
94 ControllingClient.CrossSimBorder(new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z));
95 }
96 }
97 }
98
99 }
100
101 public void SendUpdateToOtherClient(Avatar remoteAvatar)
102 {
103 ObjectUpdatePacket objupdate = CreateUpdatePacket();
104 remoteAvatar.SendPacketToViewer(objupdate);
105 }
106
107 public ObjectUpdatePacket CreateUpdatePacket()
108 {
109 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
110 //send a objectupdate packet with information about the clients avatar
111 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
112 objupdate.RegionData.RegionHandle = m_regionHandle;
113 objupdate.RegionData.TimeDilation = 64096;
114 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
115
116 objupdate.ObjectData[0] = AvatarTemplate;
117 //give this avatar object a local id and assign the user a name
118 objupdate.ObjectData[0].ID = this.localid;
119 objupdate.ObjectData[0].FullID = ControllingClient.AgentID;
120 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0");
121
122 libsecondlife.LLVector3 pos2 = new LLVector3((float)this._physActor.Position.X, (float)this._physActor.Position.Y, (float)this._physActor.Position.Z);
123
124 byte[] pb = pos2.GetBytes();
125
126 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
127 return objupdate;
128 }
129
130 public void SendInitialPosition()
131 {
132 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
133 //send a objectupdate packet with information about the clients avatar
134
135 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
136 objupdate.RegionData.RegionHandle = m_regionHandle;
137 objupdate.RegionData.TimeDilation = 64096;
138 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
139 objupdate.ObjectData[0] = AvatarTemplate;
140 //give this avatar object a local id and assign the user a name
141
142 objupdate.ObjectData[0].ID = this.localid;
143 this.uuid = objupdate.ObjectData[0].FullID = ControllingClient.AgentID;
144 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0");
145 libsecondlife.LLVector3 pos2 = new LLVector3((float)this.Pos.X, (float)this.Pos.Y, (float)this.Pos.Z);
146 byte[] pb = pos2.GetBytes();
147 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
148 m_world._localNumber++;
149
150 List<Avatar> avList = this.m_world.RequestAvatarList();
151 foreach (Avatar client in avList)
152 {
153 client.SendPacketToViewer(objupdate);
154 if (client.ControllingClient.AgentID != this.ControllingClient.AgentID)
155 {
156 SendAppearanceToOtherAgent(client);
157 }
158 }
159 }
160
161 public void SendOurAppearance()
162 {
163 ControllingClient.SendAppearance(this.Wearables);
164 }
165
166 public void SendOurAppearance(ClientView OurClient)
167 {
168 //event handler for wearables request
169 this.SendOurAppearance();
170 }
171
172 public void SendAppearanceToOtherAgent(Avatar avatarInfo)
173 {
174 AvatarAppearancePacket avp = new AvatarAppearancePacket();
175 avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218];
176 avp.ObjectData.TextureEntry = this.avatarAppearanceTexture.ToBytes();
177
178 AvatarAppearancePacket.VisualParamBlock avblock = null;
179 for (int i = 0; i < 218; i++)
180 {
181 avblock = new AvatarAppearancePacket.VisualParamBlock();
182 avblock.ParamValue = visualParams[i];
183 avp.VisualParam[i] = avblock;
184 }
185
186 avp.Sender.IsTrial = false;
187 avp.Sender.ID = ControllingClient.AgentID;
188 avatarInfo.SendPacketToViewer(avp);
189 }
190
191 public void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam)
192 {
193 LLObject.TextureEntry tex = new LLObject.TextureEntry(texture, 0, texture.Length);
194 this.avatarAppearanceTexture = tex;
195
196 for (int i = 0; i < visualParam.Length; i++)
197 {
198 this.visualParams[i] = visualParam[i].ParamValue;
199 }
200
201 List<Avatar> avList = this.m_world.RequestAvatarList();
202 foreach (Avatar client in avList)
203 {
204 if (client.ControllingClient.AgentID != this.ControllingClient.AgentID)
205 {
206 SendAppearanceToOtherAgent(client);
207 }
208 }
209 }
210
211 public void StopMovement()
212 {
213 this._physActor.Velocity = new PhysicsVector(0, 0, 0);
214 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
215 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
216 terse.RegionData.RegionHandle = m_regionHandle; // FIXME
217 terse.RegionData.TimeDilation = 64096;
218 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
219 terse.ObjectData[0] = terseBlock;
220 List<Avatar> avList = this.m_world.RequestAvatarList();
221 foreach (Avatar client in avList)
222 {
223 client.SendPacketToViewer(terse);
224 }
225 }
226
227 public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock()
228 {
229 byte[] bytes = new byte[60];
230 int i = 0;
231 ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
232
233 dat.TextureEntry = new byte[0];// AvatarTemplate.TextureEntry;
234 libsecondlife.LLVector3 pos2 = new LLVector3(0, 0, 0);
235 lock (m_world.LockPhysicsEngine)
236 {
237 pos2 = new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z);
238 }
239
240 uint ID = this.localid;
241
242 bytes[i++] = (byte)(ID % 256);
243 bytes[i++] = (byte)((ID >> 8) % 256);
244 bytes[i++] = (byte)((ID >> 16) % 256);
245 bytes[i++] = (byte)((ID >> 24) % 256);
246 bytes[i++] = 0;
247 bytes[i++] = 1;
248 i += 14;
249 bytes[i++] = 128;
250 bytes[i++] = 63;
251
252 byte[] pb = pos2.GetBytes();
253 Array.Copy(pb, 0, bytes, i, pb.Length);
254 i += 12;
255 ushort InternVelocityX;
256 ushort InternVelocityY;
257 ushort InternVelocityZ;
258 Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0);
259 lock (m_world.LockPhysicsEngine)
260 {
261 internDirec = new Axiom.MathLib.Vector3(this._physActor.Velocity.X, this._physActor.Velocity.Y, this._physActor.Velocity.Z);
262 }
263 internDirec = internDirec / 128.0f;
264 internDirec.x += 1;
265 internDirec.y += 1;
266 internDirec.z += 1;
267
268 InternVelocityX = (ushort)(32768 * internDirec.x);
269 InternVelocityY = (ushort)(32768 * internDirec.y);
270 InternVelocityZ = (ushort)(32768 * internDirec.z);
271
272 ushort ac = 32767;
273 bytes[i++] = (byte)(InternVelocityX % 256);
274 bytes[i++] = (byte)((InternVelocityX >> 8) % 256);
275 bytes[i++] = (byte)(InternVelocityY % 256);
276 bytes[i++] = (byte)((InternVelocityY >> 8) % 256);
277 bytes[i++] = (byte)(InternVelocityZ % 256);
278 bytes[i++] = (byte)((InternVelocityZ >> 8) % 256);
279
280 //accel
281 bytes[i++] = (byte)(ac % 256);
282 bytes[i++] = (byte)((ac >> 8) % 256);
283 bytes[i++] = (byte)(ac % 256);
284 bytes[i++] = (byte)((ac >> 8) % 256);
285 bytes[i++] = (byte)(ac % 256);
286 bytes[i++] = (byte)((ac >> 8) % 256);
287
288 //rot
289 bytes[i++] = (byte)(ac % 256);
290 bytes[i++] = (byte)((ac >> 8) % 256);
291 bytes[i++] = (byte)(ac % 256);
292 bytes[i++] = (byte)((ac >> 8) % 256);
293 bytes[i++] = (byte)(ac % 256);
294 bytes[i++] = (byte)((ac >> 8) % 256);
295 bytes[i++] = (byte)(ac % 256);
296 bytes[i++] = (byte)((ac >> 8) % 256);
297
298 //rotation vel
299 bytes[i++] = (byte)(ac % 256);
300 bytes[i++] = (byte)((ac >> 8) % 256);
301 bytes[i++] = (byte)(ac % 256);
302 bytes[i++] = (byte)((ac >> 8) % 256);
303 bytes[i++] = (byte)(ac % 256);
304 bytes[i++] = (byte)((ac >> 8) % 256);
305
306 dat.Data = bytes;
307 return (dat);
308 }
309
310 // Sends animation update
311 public void SendAnimPack(LLUUID animID, int seq)
312 {
313 AvatarAnimationPacket ani = new AvatarAnimationPacket();
314 ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1];
315 ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock();
316 ani.AnimationSourceList[0].ObjectID = ControllingClient.AgentID;
317 ani.Sender = new AvatarAnimationPacket.SenderBlock();
318 ani.Sender.ID = ControllingClient.AgentID;
319 ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[1];
320 ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock();
321 ani.AnimationList[0].AnimID = this.current_anim = animID;
322 ani.AnimationList[0].AnimSequenceID = this.anim_seq = seq;
323
324 List<Avatar> avList = this.m_world.RequestAvatarList();
325 foreach (Avatar client in avList)
326 {
327 client.SendPacketToViewer(ani);
328 }
329
330 }
331
332 public void SendAnimPack()
333 {
334 this.SendAnimPack(this.current_anim, this.anim_seq);
335 }
336
337 }
338}
diff --git a/OpenSim/OpenSim.RegionServer/world/Avatar.cs b/OpenSim/OpenSim.RegionServer/world/Avatar.cs
new file mode 100644
index 0000000..9401036
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/Avatar.cs
@@ -0,0 +1,438 @@
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Text;
5using libsecondlife;
6using libsecondlife.Packets;
7using OpenSim.Physics.Manager;
8using OpenSim.Framework.Inventory;
9using OpenSim.Framework.Interfaces;
10using Axiom.MathLib;
11
12namespace OpenSim.world
13{
14 public partial class Avatar : Entity
15 {
16 public static bool PhysicsEngineFlying = false;
17 public static AvatarAnimations Animations;
18 public string firstname;
19 public string lastname;
20 public ClientView ControllingClient;
21 public LLUUID current_anim;
22 public int anim_seq;
23 private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate;
24 private bool updateflag = false;
25 private byte movementflag = 0;
26 private List<NewForce> forcesList = new List<NewForce>();
27 private short _updateCount = 0;
28 private Axiom.MathLib.Quaternion bodyRot;
29 private LLObject.TextureEntry avatarAppearanceTexture = null;
30 private byte[] visualParams;
31 private AvatarWearable[] Wearables;
32 private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
33 private ulong m_regionHandle;
34 //private Dictionary<uint, ClientView> m_clientThreads;
35 private string m_regionName;
36 private ushort m_regionWaterHeight;
37 private bool m_regionTerraform;
38 private bool childAvatar = false;
39
40 public Avatar(ClientView TheClient, World world, string regionName, Dictionary<uint, ClientView> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater)
41 {
42 m_world = world;
43 // m_clientThreads = clientThreads;
44 m_regionName = regionName;
45 m_regionHandle = regionHandle;
46 m_regionTerraform = regionTerraform;
47 m_regionWaterHeight = regionWater;
48
49 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs - Loading details from grid (DUMMY)");
50 ControllingClient = TheClient;
51 localid = 8880000 + (this.m_world._localNumber++);
52 Pos = ControllingClient.startpos;
53 visualParams = new byte[218];
54 for (int i = 0; i < 218; i++)
55 {
56 visualParams[i] = 100;
57 }
58 Wearables = new AvatarWearable[13]; //should be 13 of these
59 for (int i = 0; i < 13; i++)
60 {
61 Wearables[i] = new AvatarWearable();
62 }
63 this.Wearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
64 this.Wearables[0].ItemID = LLUUID.Random();
65
66 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
67
68 //register for events
69 ControllingClient.OnRequestWearables += new ClientView.GenericCall(this.SendOurAppearance);
70 ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
71 ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.CompleteMovement);
72 ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.SendInitialPosition);
73 ControllingClient.OnAgentUpdate += new ClientView.GenericCall3(this.HandleAgentUpdate);
74 ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
75 ControllingClient.OnChildAgentStatus += new ClientView.StatusChange(this.ChildStatusChange);
76 ControllingClient.OnStopMovement += new ClientView.GenericCall2(this.StopMovement);
77 }
78
79 public PhysicsActor PhysActor
80 {
81 set
82 {
83 this._physActor = value;
84 }
85 get
86 {
87 return _physActor;
88 }
89 }
90
91 public void ChildStatusChange(bool status)
92 {
93 Console.WriteLine("child agent status change");
94 this.childAvatar = status;
95
96 if (this.childAvatar == true)
97 {
98 this.StopMovement();
99 }
100 else
101 {
102 LLVector3 startp = ControllingClient.StartPos;
103 lock (m_world.LockPhysicsEngine)
104 {
105 this._physActor.Position = new PhysicsVector(startp.X, startp.Y, startp.Z);
106 }
107 }
108 }
109
110 public override void addForces()
111 {
112 lock (this.forcesList)
113 {
114 if (this.forcesList.Count > 0)
115 {
116 for (int i = 0; i < this.forcesList.Count; i++)
117 {
118 NewForce force = this.forcesList[i];
119 PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z);
120 lock (m_world.LockPhysicsEngine)
121 {
122 this._physActor.Velocity = phyVector;
123 }
124 this.updateflag = true;
125 this.velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this
126 // but as we are setting the velocity (rather than using real forces) at the moment it is okay.
127 }
128 for (int i = 0; i < this.forcesList.Count; i++)
129 {
130 this.forcesList.RemoveAt(0);
131 }
132 }
133 }
134 }
135
136 public static void SetupTemplate(string name)
137 {
138 FileInfo fInfo = new FileInfo(name);
139 long numBytes = fInfo.Length;
140 FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read);
141 BinaryReader br = new BinaryReader(fStream);
142 byte[] data1 = br.ReadBytes((int)numBytes);
143 br.Close();
144 fStream.Close();
145
146 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
147
148 SetDefaultPacketValues(objdata);
149 objdata.TextureEntry = data1;
150 objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24);
151 objdata.PathCurve = 16;
152 objdata.ProfileCurve = 1;
153 objdata.PathScaleX = 100;
154 objdata.PathScaleY = 100;
155 objdata.ParentID = 0;
156 objdata.OwnerID = LLUUID.Zero;
157 objdata.Scale = new LLVector3(1, 1, 1);
158 objdata.PCode = 47;
159 System.Text.Encoding enc = System.Text.Encoding.ASCII;
160 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
161 pos.X = 100f;
162 objdata.ID = 8880000;
163 objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0");
164 libsecondlife.LLVector3 pos2 = new LLVector3(100f, 100f, 23f);
165 //objdata.FullID=user.AgentID;
166 byte[] pb = pos.GetBytes();
167 Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length);
168
169 Avatar.AvatarTemplate = objdata;
170 }
171
172 protected static void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
173 {
174 objdata.PSBlock = new byte[0];
175 objdata.ExtraParams = new byte[1];
176 objdata.MediaURL = new byte[0];
177 objdata.NameValue = new byte[0];
178 objdata.Text = new byte[0];
179 objdata.TextColor = new byte[4];
180 objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0);
181 objdata.JointPivot = new LLVector3(0, 0, 0);
182 objdata.Material = 4;
183 objdata.TextureAnim = new byte[0];
184 objdata.Sound = LLUUID.Zero;
185 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
186 objdata.TextureEntry = ntex.ToBytes();
187 objdata.State = 0;
188 objdata.Data = new byte[0];
189
190 objdata.ObjectData = new byte[76];
191 objdata.ObjectData[15] = 128;
192 objdata.ObjectData[16] = 63;
193 objdata.ObjectData[56] = 128;
194 objdata.ObjectData[61] = 102;
195 objdata.ObjectData[62] = 40;
196 objdata.ObjectData[63] = 61;
197 objdata.ObjectData[64] = 189;
198
199
200 }
201
202 public void CompleteMovement()
203 {
204 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Avatar.cs:CompleteMovement() - Constructing AgentMovementComplete packet");
205 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
206 mov.AgentData.SessionID = this.ControllingClient.SessionID;
207 mov.AgentData.AgentID = this.ControllingClient.AgentID;
208 mov.Data.RegionHandle = this.m_regionHandle;
209 // TODO - dynamicalise this stuff
210 mov.Data.Timestamp = 1172750370;
211 mov.Data.Position = this.ControllingClient.startpos;
212 mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0);
213
214 ControllingClient.OutPacket(mov);
215 }
216
217 public void HandleAgentUpdate(Packet pack)
218 {
219 this.HandleUpdate((AgentUpdatePacket)pack);
220 }
221
222 public void HandleUpdate(AgentUpdatePacket pack)
223 {
224 if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0)
225 {
226 if (this._physActor.Flying == false)
227 {
228 this.current_anim = Animations.AnimsLLUUID["ANIM_AGENT_FLY"];
229 this.anim_seq = 1;
230 this.SendAnimPack();
231 }
232 this._physActor.Flying = true;
233
234 }
235 else
236 {
237 if (this._physActor.Flying == true)
238 {
239 this.current_anim = Animations.AnimsLLUUID["ANIM_AGENT_STAND"];
240 this.anim_seq = 1;
241 this.SendAnimPack();
242 }
243 this._physActor.Flying = false;
244 }
245 if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS) != 0)
246 {
247 Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z);
248 if (((movementflag & 1) == 0) || (q != this.bodyRot))
249 {
250
251 if (((movementflag & 1) == 0) && (!this._physActor.Flying))
252 {
253 this.current_anim = Animations.AnimsLLUUID["ANIM_AGENT_WALK"];
254 this.anim_seq = 1;
255 this.SendAnimPack();
256 }
257
258
259 //we should add a new force to the list
260 // but for now we will deal with velocities
261 NewForce newVelocity = new NewForce();
262 Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0);
263 Axiom.MathLib.Vector3 direc = q * v3;
264 direc.Normalize();
265
266 //work out velocity for sim physics system
267 direc = direc * ((0.03f) * 128f);
268 if (this._physActor.Flying)
269 direc *= 4;
270
271 newVelocity.X = direc.x;
272 newVelocity.Y = direc.y;
273 newVelocity.Z = direc.z;
274 this.forcesList.Add(newVelocity);
275 movementflag = 1;
276 this.bodyRot = q;
277 }
278 }
279 else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS) != 0) && (PhysicsEngineFlying))
280 {
281 if (((movementflag & 2) == 0) && this._physActor.Flying)
282 {
283 //we should add a new force to the list
284 // but for now we will deal with velocities
285 NewForce newVelocity = new NewForce();
286 Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(0, 0, 1);
287 Axiom.MathLib.Vector3 direc = v3;
288 direc.Normalize();
289
290 //work out velocity for sim physics system
291 direc = direc * ((0.03f) * 128f * 2);
292 newVelocity.X = direc.x;
293 newVelocity.Y = direc.y;
294 newVelocity.Z = direc.z;
295 this.forcesList.Add(newVelocity);
296 movementflag = 2;
297 }
298 }
299 else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && (PhysicsEngineFlying))
300 {
301 if (((movementflag & 4) == 0) && this._physActor.Flying)
302 {
303 //we should add a new force to the list
304 // but for now we will deal with velocities
305 NewForce newVelocity = new NewForce();
306 Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(0, 0, -1);
307 //Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z);
308 Axiom.MathLib.Vector3 direc = v3;
309 direc.Normalize();
310
311 //work out velocity for sim physics system
312 direc = direc * ((0.03f) * 128f * 2);
313 newVelocity.X = direc.x;
314 newVelocity.Y = direc.y;
315 newVelocity.Z = direc.z;
316 this.forcesList.Add(newVelocity);
317 movementflag = 4;
318 }
319 }
320 else if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG) != 0)
321 {
322 Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z);
323 if (((movementflag & 8) == 0) || (q != this.bodyRot))
324 {
325 //we should add a new force to the list
326 // but for now we will deal with velocities
327 NewForce newVelocity = new NewForce();
328 Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(-1, 0, 0);
329 Axiom.MathLib.Vector3 direc = q * v3;
330 direc.Normalize();
331
332 //work out velocity for sim physics system
333 direc = direc * ((0.03f) * 128f);
334 if (this._physActor.Flying)
335 direc *= 2;
336
337 newVelocity.X = direc.x;
338 newVelocity.Y = direc.y;
339 newVelocity.Z = direc.z;
340 this.forcesList.Add(newVelocity);
341 movementflag = 8;
342 this.bodyRot = q;
343 }
344 }
345 else
346 {
347 if (movementflag == 16)
348 {
349 movementflag = 0;
350 }
351 if ((movementflag) != 0)
352 {
353 NewForce newVelocity = new NewForce();
354 newVelocity.X = 0;
355 newVelocity.Y = 0;
356 newVelocity.Z = 0;
357 this.forcesList.Add(newVelocity);
358 movementflag = 0;
359 // We're standing still, so make it show!
360 if (this._physActor.Flying == false)
361 {
362 this.current_anim = Animations.AnimsLLUUID["ANIM_AGENT_STAND"];
363 this.anim_seq = 1;
364 this.SendAnimPack();
365 }
366 this.movementflag = 16;
367
368 }
369 }
370 }
371
372 //really really should be moved somewhere else (RegionInfo.cs ?)
373 public void SendRegionHandshake(World regionInfo)
374 {
375 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
376 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
377 RegionHandshakePacket handshake = new RegionHandshakePacket();
378
379 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details");
380 handshake.RegionInfo.BillableFactor = 0;
381 handshake.RegionInfo.IsEstateManager = false;
382 handshake.RegionInfo.TerrainHeightRange00 = 60;
383 handshake.RegionInfo.TerrainHeightRange01 = 60;
384 handshake.RegionInfo.TerrainHeightRange10 = 60;
385 handshake.RegionInfo.TerrainHeightRange11 = 60;
386 handshake.RegionInfo.TerrainStartHeight00 = 10;
387 handshake.RegionInfo.TerrainStartHeight01 = 10;
388 handshake.RegionInfo.TerrainStartHeight10 = 10;
389 handshake.RegionInfo.TerrainStartHeight11 = 10;
390 handshake.RegionInfo.SimAccess = 13;
391 handshake.RegionInfo.WaterHeight = m_regionWaterHeight;
392 uint regionFlags = 72458694;
393 if (this.m_regionTerraform)
394 {
395 regionFlags -= 64;
396 }
397 handshake.RegionInfo.RegionFlags = regionFlags;
398 handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0");
399 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
400 handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975");
401 handshake.RegionInfo.TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3");
402 handshake.RegionInfo.TerrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f");
403 handshake.RegionInfo.TerrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2");
404 handshake.RegionInfo.TerrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000");
405 handshake.RegionInfo.TerrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000");
406 handshake.RegionInfo.TerrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000");
407 handshake.RegionInfo.TerrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000");
408 handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37");
409
410 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Avatar.cs:SendRegionHandshake() - Sending RegionHandshake packet");
411 this.ControllingClient.OutPacket(handshake);
412 }
413
414 public static void LoadAnims()
415 {
416 Avatar.Animations = new AvatarAnimations();
417 Avatar.Animations.LoadAnims();
418 }
419
420 public override void LandRenegerated()
421 {
422 Pos = new LLVector3(100.0f, 100.0f, m_world.Terrain[(int)Pos.X, (int)Pos.Y] + 50.0f);
423 }
424 }
425
426 public class NewForce
427 {
428 public float X;
429 public float Y;
430 public float Z;
431
432 public NewForce()
433 {
434
435 }
436 }
437
438}
diff --git a/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs b/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs
new file mode 100644
index 0000000..b554af8
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs
@@ -0,0 +1,163 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.world
7{
8 public class AvatarAnimations
9 {
10
11 public Dictionary<string, LLUUID> AnimsLLUUID = new Dictionary<string, LLUUID>();
12 public Dictionary<LLUUID, string> AnimsNames = new Dictionary<LLUUID, string>();
13
14 public AvatarAnimations()
15 {
16 }
17
18 public void LoadAnims()
19 {
20 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs:LoadAnims() - Loading avatar animations");
21 AnimsLLUUID.Add("ANIM_AGENT_AFRAID", new LLUUID("6b61c8e8-4747-0d75-12d7-e49ff207a4ca"));
22 AnimsLLUUID.Add("ANIM_AGENT_AIM_BAZOOKA_R", new LLUUID("b5b4a67d-0aee-30d2-72cd-77b333e932ef"));
23 AnimsLLUUID.Add("ANIM_AGENT_AIM_BOW_L", new LLUUID("46bb4359-de38-4ed8-6a22-f1f52fe8f506"));
24 AnimsLLUUID.Add("ANIM_AGENT_AIM_HANDGUN_R", new LLUUID("3147d815-6338-b932-f011-16b56d9ac18b"));
25 AnimsLLUUID.Add("ANIM_AGENT_AIM_RIFLE_R", new LLUUID("ea633413-8006-180a-c3ba-96dd1d756720"));
26 AnimsLLUUID.Add("ANIM_AGENT_ANGRY", new LLUUID("5747a48e-073e-c331-f6f3-7c2149613d3e"));
27 AnimsLLUUID.Add("ANIM_AGENT_AWAY", new LLUUID("fd037134-85d4-f241-72c6-4f42164fedee"));
28 AnimsLLUUID.Add("ANIM_AGENT_BACKFLIP", new LLUUID("c4ca6188-9127-4f31-0158-23c4e2f93304"));
29 AnimsLLUUID.Add("ANIM_AGENT_BELLY_LAUGH", new LLUUID("18b3a4b5-b463-bd48-e4b6-71eaac76c515"));
30 AnimsLLUUID.Add("ANIM_AGENT_BLOW_KISS", new LLUUID("db84829b-462c-ee83-1e27-9bbee66bd624"));
31 AnimsLLUUID.Add("ANIM_AGENT_BORED", new LLUUID("b906c4ba-703b-1940-32a3-0c7f7d791510"));
32 AnimsLLUUID.Add("ANIM_AGENT_BOW", new LLUUID("82e99230-c906-1403-4d9c-3889dd98daba"));
33 AnimsLLUUID.Add("ANIM_AGENT_BRUSH", new LLUUID("349a3801-54f9-bf2c-3bd0-1ac89772af01"));
34 AnimsLLUUID.Add("ANIM_AGENT_BUSY", new LLUUID("efcf670c-2d18-8128-973a-034ebc806b67"));
35 AnimsLLUUID.Add("ANIM_AGENT_CLAP", new LLUUID("9b0c1c4e-8ac7-7969-1494-28c874c4f668"));
36 AnimsLLUUID.Add("ANIM_AGENT_COURTBOW", new LLUUID("9ba1c942-08be-e43a-fb29-16ad440efc50"));
37 AnimsLLUUID.Add("ANIM_AGENT_CROUCH", new LLUUID("201f3fdf-cb1f-dbec-201f-7333e328ae7c"));
38 AnimsLLUUID.Add("ANIM_AGENT_CROUCHWALK", new LLUUID("47f5f6fb-22e5-ae44-f871-73aaaf4a6022"));
39 AnimsLLUUID.Add("ANIM_AGENT_CRY", new LLUUID("92624d3e-1068-f1aa-a5ec-8244585193ed"));
40 AnimsLLUUID.Add("ANIM_AGENT_CUSTOMIZE", new LLUUID("038fcec9-5ebd-8a8e-0e2e-6e71a0a1ac53"));
41 AnimsLLUUID.Add("ANIM_AGENT_CUSTOMIZE_DONE", new LLUUID("6883a61a-b27b-5914-a61e-dda118a9ee2c"));
42 AnimsLLUUID.Add("ANIM_AGENT_DANCE1", new LLUUID("b68a3d7c-de9e-fc87-eec8-543d787e5b0d"));
43 AnimsLLUUID.Add("ANIM_AGENT_DANCE2", new LLUUID("928cae18-e31d-76fd-9cc9-2f55160ff818"));
44 AnimsLLUUID.Add("ANIM_AGENT_DANCE3", new LLUUID("30047778-10ea-1af7-6881-4db7a3a5a114"));
45 AnimsLLUUID.Add("ANIM_AGENT_DANCE4", new LLUUID("951469f4-c7b2-c818-9dee-ad7eea8c30b7"));
46 AnimsLLUUID.Add("ANIM_AGENT_DANCE5", new LLUUID("4bd69a1d-1114-a0b4-625f-84e0a5237155"));
47 AnimsLLUUID.Add("ANIM_AGENT_DANCE6", new LLUUID("cd28b69b-9c95-bb78-3f94-8d605ff1bb12"));
48 AnimsLLUUID.Add("ANIM_AGENT_DANCE7", new LLUUID("a54d8ee2-28bb-80a9-7f0c-7afbbe24a5d6"));
49 AnimsLLUUID.Add("ANIM_AGENT_DANCE8", new LLUUID("b0dc417c-1f11-af36-2e80-7e7489fa7cdc"));
50 AnimsLLUUID.Add("ANIM_AGENT_DEAD", new LLUUID("57abaae6-1d17-7b1b-5f98-6d11a6411276"));
51 AnimsLLUUID.Add("ANIM_AGENT_DRINK", new LLUUID("0f86e355-dd31-a61c-fdb0-3a96b9aad05f"));
52 AnimsLLUUID.Add("ANIM_AGENT_EMBARRASSED", new LLUUID("514af488-9051-044a-b3fc-d4dbf76377c6"));
53 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_AFRAID", new LLUUID("aa2df84d-cf8f-7218-527b-424a52de766e"));
54 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_ANGER", new LLUUID("1a03b575-9634-b62a-5767-3a679e81f4de"));
55 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_BORED", new LLUUID("214aa6c1-ba6a-4578-f27c-ce7688f61d0d"));
56 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_CRY", new LLUUID("d535471b-85bf-3b4d-a542-93bea4f59d33"));
57 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_DISDAIN", new LLUUID("d4416ff1-09d3-300f-4183-1b68a19b9fc1"));
58 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_EMBARRASSED", new LLUUID("0b8c8211-d78c-33e8-fa28-c51a9594e424"));
59 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_FROWN", new LLUUID("fee3df48-fa3d-1015-1e26-a205810e3001"));
60 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_KISS", new LLUUID("1e8d90cc-a84e-e135-884c-7c82c8b03a14"));
61 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_LAUGH", new LLUUID("62570842-0950-96f8-341c-809e65110823"));
62 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_OPEN_MOUTH", new LLUUID("d63bc1f9-fc81-9625-a0c6-007176d82eb7"));
63 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_REPULSED", new LLUUID("f76cda94-41d4-a229-2872-e0296e58afe1"));
64 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_SAD", new LLUUID("eb6ebfb2-a4b3-a19c-d388-4dd5c03823f7"));
65 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_SHRUG", new LLUUID("a351b1bc-cc94-aac2-7bea-a7e6ebad15ef"));
66 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_SMILE", new LLUUID("b7c7c833-e3d3-c4e3-9fc0-131237446312"));
67 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_SURPRISE", new LLUUID("728646d9-cc79-08b2-32d6-937f0a835c24"));
68 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_TONGUE_OUT", new LLUUID("835965c6-7f2f-bda2-5deb-2478737f91bf"));
69 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_TOOTHSMILE", new LLUUID("b92ec1a5-e7ce-a76b-2b05-bcdb9311417e"));
70 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_WINK", new LLUUID("da020525-4d94-59d6-23d7-81fdebf33148"));
71 AnimsLLUUID.Add("ANIM_AGENT_EXPRESS_WORRY", new LLUUID("9c05e5c7-6f07-6ca4-ed5a-b230390c3950"));
72 AnimsLLUUID.Add("ANIM_AGENT_FALLDOWN", new LLUUID("666307d9-a860-572d-6fd4-c3ab8865c094"));
73 AnimsLLUUID.Add("ANIM_AGENT_FEMALE_WALK", new LLUUID("f5fc7433-043d-e819-8298-f519a119b688"));
74 AnimsLLUUID.Add("ANIM_AGENT_FINGER_WAG", new LLUUID("c1bc7f36-3ba0-d844-f93c-93be945d644f"));
75 AnimsLLUUID.Add("ANIM_AGENT_FIST_PUMP", new LLUUID("7db00ccd-f380-f3ee-439d-61968ec69c8a"));
76 AnimsLLUUID.Add("ANIM_AGENT_FLY", new LLUUID("aec4610c-757f-bc4e-c092-c6e9caf18daf"));
77 AnimsLLUUID.Add("ANIM_AGENT_FLYSLOW", new LLUUID("2b5a38b2-5e00-3a97-a495-4c826bc443e6"));
78 AnimsLLUUID.Add("ANIM_AGENT_HELLO", new LLUUID("9b29cd61-c45b-5689-ded2-91756b8d76a9"));
79 AnimsLLUUID.Add("ANIM_AGENT_HOLD_BAZOOKA_R", new LLUUID("ef62d355-c815-4816-2474-b1acc21094a6"));
80 AnimsLLUUID.Add("ANIM_AGENT_HOLD_BOW_L", new LLUUID("8b102617-bcba-037b-86c1-b76219f90c88"));
81 AnimsLLUUID.Add("ANIM_AGENT_HOLD_HANDGUN_R", new LLUUID("efdc1727-8b8a-c800-4077-975fc27ee2f2"));
82 AnimsLLUUID.Add("ANIM_AGENT_HOLD_RIFLE_R", new LLUUID("3d94bad0-c55b-7dcc-8763-033c59405d33"));
83 AnimsLLUUID.Add("ANIM_AGENT_HOLD_THROW_R", new LLUUID("7570c7b5-1f22-56dd-56ef-a9168241bbb6"));
84 AnimsLLUUID.Add("ANIM_AGENT_HOVER", new LLUUID("4ae8016b-31b9-03bb-c401-b1ea941db41d"));
85 AnimsLLUUID.Add("ANIM_AGENT_HOVER_DOWN", new LLUUID("20f063ea-8306-2562-0b07-5c853b37b31e"));
86 AnimsLLUUID.Add("ANIM_AGENT_HOVER_UP", new LLUUID("62c5de58-cb33-5743-3d07-9e4cd4352864"));
87 AnimsLLUUID.Add("ANIM_AGENT_IMPATIENT", new LLUUID("5ea3991f-c293-392e-6860-91dfa01278a3"));
88 AnimsLLUUID.Add("ANIM_AGENT_JUMP", new LLUUID("2305bd75-1ca9-b03b-1faa-b176b8a8c49e"));
89 AnimsLLUUID.Add("ANIM_AGENT_JUMP_FOR_JOY", new LLUUID("709ea28e-1573-c023-8bf8-520c8bc637fa"));
90 AnimsLLUUID.Add("ANIM_AGENT_KISS_MY_BUTT", new LLUUID("19999406-3a3a-d58c-a2ac-d72e555dcf51"));
91 AnimsLLUUID.Add("ANIM_AGENT_LAND", new LLUUID("7a17b059-12b2-41b1-570a-186368b6aa6f"));
92 AnimsLLUUID.Add("ANIM_AGENT_LAUGH_SHORT", new LLUUID("ca5b3f14-3194-7a2b-c894-aa699b718d1f"));
93 AnimsLLUUID.Add("ANIM_AGENT_MEDIUM_LAND", new LLUUID("f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57"));
94 AnimsLLUUID.Add("ANIM_AGENT_MOTORCYCLE_SIT", new LLUUID("08464f78-3a8e-2944-cba5-0c94aff3af29"));
95 AnimsLLUUID.Add("ANIM_AGENT_MUSCLE_BEACH", new LLUUID("315c3a41-a5f3-0ba4-27da-f893f769e69b"));
96 AnimsLLUUID.Add("ANIM_AGENT_NO", new LLUUID("5a977ed9-7f72-44e9-4c4c-6e913df8ae74"));
97 AnimsLLUUID.Add("ANIM_AGENT_NO_UNHAPPY", new LLUUID("d83fa0e5-97ed-7eb2-e798-7bd006215cb4"));
98 AnimsLLUUID.Add("ANIM_AGENT_NYAH_NYAH", new LLUUID("f061723d-0a18-754f-66ee-29a44795a32f"));
99 AnimsLLUUID.Add("ANIM_AGENT_ONETWO_PUNCH", new LLUUID("eefc79be-daae-a239-8c04-890f5d23654a"));
100 AnimsLLUUID.Add("ANIM_AGENT_PEACE", new LLUUID("b312b10e-65ab-a0a4-8b3c-1326ea8e3ed9"));
101 AnimsLLUUID.Add("ANIM_AGENT_POINT_ME", new LLUUID("17c024cc-eef2-f6a0-3527-9869876d7752"));
102 AnimsLLUUID.Add("ANIM_AGENT_POINT_YOU", new LLUUID("ec952cca-61ef-aa3b-2789-4d1344f016de"));
103 AnimsLLUUID.Add("ANIM_AGENT_PRE_JUMP", new LLUUID("7a4e87fe-de39-6fcb-6223-024b00893244"));
104 AnimsLLUUID.Add("ANIM_AGENT_PUNCH_LEFT", new LLUUID("f3300ad9-3462-1d07-2044-0fef80062da0"));
105 AnimsLLUUID.Add("ANIM_AGENT_PUNCH_RIGHT", new LLUUID("c8e42d32-7310-6906-c903-cab5d4a34656"));
106 AnimsLLUUID.Add("ANIM_AGENT_REPULSED", new LLUUID("36f81a92-f076-5893-dc4b-7c3795e487cf"));
107 AnimsLLUUID.Add("ANIM_AGENT_ROUNDHOUSE_KICK", new LLUUID("49aea43b-5ac3-8a44-b595-96100af0beda"));
108 AnimsLLUUID.Add("ANIM_AGENT_RPS_COUNTDOWN", new LLUUID("35db4f7e-28c2-6679-cea9-3ee108f7fc7f"));
109 AnimsLLUUID.Add("ANIM_AGENT_RPS_PAPER", new LLUUID("0836b67f-7f7b-f37b-c00a-460dc1521f5a"));
110 AnimsLLUUID.Add("ANIM_AGENT_RPS_ROCK", new LLUUID("42dd95d5-0bc6-6392-f650-777304946c0f"));
111 AnimsLLUUID.Add("ANIM_AGENT_RPS_SCISSORS", new LLUUID("16803a9f-5140-e042-4d7b-d28ba247c325"));
112 AnimsLLUUID.Add("ANIM_AGENT_RUN", new LLUUID("05ddbff8-aaa9-92a1-2b74-8fe77a29b445"));
113 AnimsLLUUID.Add("ANIM_AGENT_SAD", new LLUUID("0eb702e2-cc5a-9a88-56a5-661a55c0676a"));
114 AnimsLLUUID.Add("ANIM_AGENT_SALUTE", new LLUUID("cd7668a6-7011-d7e2-ead8-fc69eff1a104"));
115 AnimsLLUUID.Add("ANIM_AGENT_SHOOT_BOW_L", new LLUUID("e04d450d-fdb5-0432-fd68-818aaf5935f8"));
116 AnimsLLUUID.Add("ANIM_AGENT_SHOUT", new LLUUID("6bd01860-4ebd-127a-bb3d-d1427e8e0c42"));
117 AnimsLLUUID.Add("ANIM_AGENT_SHRUG", new LLUUID("70ea714f-3a97-d742-1b01-590a8fcd1db5"));
118 AnimsLLUUID.Add("ANIM_AGENT_SIT", new LLUUID("1a5fe8ac-a804-8a5d-7cbd-56bd83184568"));
119 AnimsLLUUID.Add("ANIM_AGENT_SIT_FEMALE", new LLUUID("b1709c8d-ecd3-54a1-4f28-d55ac0840782"));
120 AnimsLLUUID.Add("ANIM_AGENT_SIT_GENERIC", new LLUUID("245f3c54-f1c0-bf2e-811f-46d8eeb386e7"));
121 AnimsLLUUID.Add("ANIM_AGENT_SIT_GROUND", new LLUUID("1c7600d6-661f-b87b-efe2-d7421eb93c86"));
122 AnimsLLUUID.Add("ANIM_AGENT_SIT_GROUND_CONSTRAINED", new LLUUID("1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e"));
123 AnimsLLUUID.Add("ANIM_AGENT_SIT_TO_STAND", new LLUUID("a8dee56f-2eae-9e7a-05a2-6fb92b97e21e"));
124 AnimsLLUUID.Add("ANIM_AGENT_SLEEP", new LLUUID("f2bed5f9-9d44-39af-b0cd-257b2a17fe40"));
125 AnimsLLUUID.Add("ANIM_AGENT_SMOKE_IDLE", new LLUUID("d2f2ee58-8ad1-06c9-d8d3-3827ba31567a"));
126 AnimsLLUUID.Add("ANIM_AGENT_SMOKE_INHALE", new LLUUID("6802d553-49da-0778-9f85-1599a2266526"));
127 AnimsLLUUID.Add("ANIM_AGENT_SMOKE_THROW_DOWN", new LLUUID("0a9fb970-8b44-9114-d3a9-bf69cfe804d6"));
128 AnimsLLUUID.Add("ANIM_AGENT_SNAPSHOT", new LLUUID("eae8905b-271a-99e2-4c0e-31106afd100c"));
129 AnimsLLUUID.Add("ANIM_AGENT_STAND", new LLUUID("2408fe9e-df1d-1d7d-f4ff-1384fa7b350f"));
130 AnimsLLUUID.Add("ANIM_AGENT_STANDUP", new LLUUID("3da1d753-028a-5446-24f3-9c9b856d9422"));
131 AnimsLLUUID.Add("ANIM_AGENT_STAND_1", new LLUUID("15468e00-3400-bb66-cecc-646d7c14458e"));
132 AnimsLLUUID.Add("ANIM_AGENT_STAND_2", new LLUUID("370f3a20-6ca6-9971-848c-9a01bc42ae3c"));
133 AnimsLLUUID.Add("ANIM_AGENT_STAND_3", new LLUUID("42b46214-4b44-79ae-deb8-0df61424ff4b"));
134 AnimsLLUUID.Add("ANIM_AGENT_STAND_4", new LLUUID("f22fed8b-a5ed-2c93-64d5-bdd8b93c889f"));
135 AnimsLLUUID.Add("ANIM_AGENT_STRETCH", new LLUUID("80700431-74ec-a008-14f8-77575e73693f"));
136 AnimsLLUUID.Add("ANIM_AGENT_STRIDE", new LLUUID("1cb562b0-ba21-2202-efb3-30f82cdf9595"));
137 AnimsLLUUID.Add("ANIM_AGENT_SURF", new LLUUID("41426836-7437-7e89-025d-0aa4d10f1d69"));
138 AnimsLLUUID.Add("ANIM_AGENT_SURPRISE", new LLUUID("313b9881-4302-73c0-c7d0-0e7a36b6c224"));
139 AnimsLLUUID.Add("ANIM_AGENT_SWORD_STRIKE", new LLUUID("85428680-6bf9-3e64-b489-6f81087c24bd"));
140 AnimsLLUUID.Add("ANIM_AGENT_TALK", new LLUUID("5c682a95-6da4-a463-0bf6-0f5b7be129d1"));
141 AnimsLLUUID.Add("ANIM_AGENT_TANTRUM", new LLUUID("11000694-3f41-adc2-606b-eee1d66f3724"));
142 AnimsLLUUID.Add("ANIM_AGENT_THROW_R", new LLUUID("aa134404-7dac-7aca-2cba-435f9db875ca"));
143 AnimsLLUUID.Add("ANIM_AGENT_TRYON_SHIRT", new LLUUID("83ff59fe-2346-f236-9009-4e3608af64c1"));
144 AnimsLLUUID.Add("ANIM_AGENT_TURNLEFT", new LLUUID("56e0ba0d-4a9f-7f27-6117-32f2ebbf6135"));
145 AnimsLLUUID.Add("ANIM_AGENT_TURNRIGHT", new LLUUID("2d6daa51-3192-6794-8e2e-a15f8338ec30"));
146 AnimsLLUUID.Add("ANIM_AGENT_TYPE", new LLUUID("c541c47f-e0c0-058b-ad1a-d6ae3a4584d9"));
147 AnimsLLUUID.Add("ANIM_AGENT_WALK", new LLUUID("6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"));
148 AnimsLLUUID.Add("ANIM_AGENT_WHISPER", new LLUUID("7693f268-06c7-ea71-fa21-2b30d6533f8f"));
149 AnimsLLUUID.Add("ANIM_AGENT_WHISTLE", new LLUUID("b1ed7982-c68e-a982-7561-52a88a5298c0"));
150 AnimsLLUUID.Add("ANIM_AGENT_WINK", new LLUUID("869ecdad-a44b-671e-3266-56aef2e3ac2e"));
151 AnimsLLUUID.Add("ANIM_AGENT_WINK_HOLLYWOOD", new LLUUID("c0c4030f-c02b-49de-24ba-2331f43fe41c"));
152 AnimsLLUUID.Add("ANIM_AGENT_WORRY", new LLUUID("9f496bd2-589a-709f-16cc-69bf7df1d36c"));
153 AnimsLLUUID.Add("ANIM_AGENT_YES", new LLUUID("15dd911d-be82-2856-26db-27659b142875"));
154 AnimsLLUUID.Add("ANIM_AGENT_YES_HAPPY", new LLUUID("b8c8b2a3-9008-1771-3bfc-90924955ab2d"));
155 AnimsLLUUID.Add("ANIM_AGENT_YOGA_FLOAT", new LLUUID("42ecd00b-9947-a97c-400a-bbc9174c7aeb"));
156
157 foreach (KeyValuePair<string, LLUUID> kp in OpenSim.world.Avatar.Animations.AnimsLLUUID)
158 {
159 AnimsNames.Add(kp.Value, kp.Key);
160 }
161 }
162 }
163}
diff --git a/OpenSim/OpenSim.RegionServer/world/Entity.cs b/OpenSim/OpenSim.RegionServer/world/Entity.cs
new file mode 100644
index 0000000..96e039a
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/Entity.cs
@@ -0,0 +1,124 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Axiom.MathLib;
5using OpenSim.Physics.Manager;
6using OpenSim.types;
7using libsecondlife;
8using OpenSim.RegionServer.world.scripting;
9
10namespace OpenSim.world
11{
12 public abstract class Entity : IScriptReadonlyEntity
13 {
14 public libsecondlife.LLUUID uuid;
15 public uint localid;
16 public LLVector3 velocity;
17 public Quaternion rotation;
18 protected List<Entity> children;
19
20 protected string m_name;
21 public virtual string Name
22 {
23 get { return m_name; }
24 }
25
26 protected LLVector3 m_pos;
27 protected PhysicsActor _physActor;
28 protected World m_world;
29
30 public virtual LLVector3 Pos
31 {
32 get
33 {
34 if (this._physActor != null)
35 {
36 m_pos.X = _physActor.Position.X;
37 m_pos.Y = _physActor.Position.Y;
38 m_pos.Z = _physActor.Position.Z;
39 }
40
41 return m_pos;
42 }
43 set
44 {
45 if (this._physActor != null)
46 {
47 try
48 {
49 lock (this.m_world.LockPhysicsEngine)
50 {
51
52 this._physActor.Position = new PhysicsVector(value.X, value.Y, value.Z);
53 }
54 }
55 catch (Exception e)
56 {
57 Console.WriteLine(e.Message);
58 }
59 }
60
61 m_pos = value;
62 }
63 }
64
65 /// <summary>
66 /// Creates a new Entity (should not occur on it's own)
67 /// </summary>
68 public Entity()
69 {
70 uuid = new libsecondlife.LLUUID();
71 localid = 0;
72 m_pos = new LLVector3();
73 velocity = new LLVector3();
74 rotation = new Quaternion();
75 m_name = "(basic entity)";
76 children = new List<Entity>();
77 }
78
79 public virtual void addForces()
80 {
81 foreach (Entity child in children)
82 {
83 child.addForces();
84 }
85 }
86
87 /// <summary>
88 /// Performs any updates that need to be done at each frame. This function is overridable from it's children.
89 /// </summary>
90 public virtual void update() {
91 // Do any per-frame updates needed that are applicable to every type of entity
92 foreach (Entity child in children)
93 {
94 child.update();
95 }
96 }
97
98 /// <summary>
99 /// Returns a mesh for this object and any dependents
100 /// </summary>
101 /// <returns>The mesh of this entity tree</returns>
102 public virtual Mesh getMesh()
103 {
104 Mesh mesh = new Mesh();
105
106 foreach (Entity child in children)
107 {
108 mesh += child.getMesh();
109 }
110
111 return mesh;
112 }
113
114 public virtual void BackUp()
115 {
116
117 }
118
119 public virtual void LandRenegerated()
120 {
121
122 }
123 }
124}
diff --git a/OpenSim/OpenSim.RegionServer/world/Primitive.cs b/OpenSim/OpenSim.RegionServer/world/Primitive.cs
new file mode 100644
index 0000000..e048a9e
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/Primitive.cs
@@ -0,0 +1,570 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.types;
5using libsecondlife;
6using libsecondlife.Packets;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Physics.Manager;
9using OpenSim.Framework.Types;
10
11namespace OpenSim.world
12{
13 public class Primitive : Entity
14 {
15 protected float mesh_cutbegin;
16 protected float mesh_cutend;
17 protected PrimData primData;
18 protected bool newPrimFlag = false;
19 protected bool updateFlag = false;
20 protected bool dirtyFlag = false;
21 private ObjectUpdatePacket OurPacket;
22 private bool physicsEnabled = false;
23 private bool physicstest = false;
24 private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
25 private Dictionary<uint, ClientView> m_clientThreads;
26 private ulong m_regionHandle;
27 private const uint FULL_MASK_PERMISSIONS = 2147483647;
28
29 public bool PhysicsEnabled
30 {
31 get
32 {
33 return physicsEnabled;
34 }
35 set
36 {
37 physicsEnabled = value;
38 }
39 }
40 public bool UpdateFlag
41 {
42 get
43 {
44 return updateFlag;
45 }
46 set
47 {
48 updateFlag = value;
49 }
50 }
51 public LLVector3 Scale
52 {
53 set
54 {
55 LLVector3 offset = (value - primData.Scale);
56 offset.X /= 2;
57 offset.Y /= 2;
58 offset.Z /= 2;
59
60 this.primData.Position += offset;
61 this.primData.Scale = value;
62
63 this.dirtyFlag = true;
64 }
65 get
66 {
67 return this.primData.Scale;
68 }
69 }
70 public PhysicsActor PhysActor
71 {
72 set
73 {
74 this._physActor = value;
75 }
76 }
77
78 public Primitive(Dictionary<uint, ClientView> clientThreads, ulong regionHandle, World world)
79 {
80 mesh_cutbegin = 0.0f;
81 mesh_cutend = 1.0f;
82
83 m_clientThreads = clientThreads;
84 m_regionHandle = regionHandle;
85 m_world = world;
86 }
87
88 public override Mesh getMesh()
89 {
90 Mesh mesh = new Mesh();
91 Triangle tri = new Triangle(
92 new Axiom.MathLib.Vector3(0.0f, 1.0f, 1.0f),
93 new Axiom.MathLib.Vector3(1.0f, 0.0f, 1.0f),
94 new Axiom.MathLib.Vector3(1.0f, 1.0f, 0.0f));
95
96 mesh.AddTri(tri);
97 mesh += base.getMesh();
98
99 return mesh;
100 }
101
102 public byte[] GetByteArray()
103 {
104 return this.primData.ToBytes();
105 }
106
107 public void GetProperites(ClientView client)
108 {
109 ObjectPropertiesPacket proper = new ObjectPropertiesPacket();
110 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
111 proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
112 proper.ObjectData[0].ItemID = LLUUID.Zero; // this.uuid;
113 proper.ObjectData[0].CreationDate = (ulong) this.primData.CreationDate;
114 proper.ObjectData[0].CreatorID = this.primData.OwnerID;
115 proper.ObjectData[0].FolderID = LLUUID.Zero;
116 proper.ObjectData[0].FromTaskID = LLUUID.Zero;
117 proper.ObjectData[0].GroupID = LLUUID.Zero;
118 proper.ObjectData[0].InventorySerial = 0;
119 proper.ObjectData[0].LastOwnerID = LLUUID.Zero;
120 proper.ObjectData[0].ObjectID = this.uuid;
121 proper.ObjectData[0].OwnerID = primData.OwnerID;
122 proper.ObjectData[0].TouchName = new byte[0];
123 proper.ObjectData[0].TextureID = new byte[0];
124 proper.ObjectData[0].SitName = new byte[0];
125 proper.ObjectData[0].Name = new byte[0];
126 proper.ObjectData[0].Description = new byte[0];
127 proper.ObjectData[0].OwnerMask = this.primData.OwnerMask;
128 proper.ObjectData[0].NextOwnerMask = this.primData.NextOwnerMask;
129 proper.ObjectData[0].GroupMask = this.primData.GroupMask;
130 proper.ObjectData[0].EveryoneMask = this.primData.EveryoneMask;
131 proper.ObjectData[0].BaseMask = this.primData.BaseMask;
132
133 client.OutPacket(proper);
134 }
135
136 public void UpdatePosition(LLVector3 pos)
137 {
138 this.Pos = pos;
139 if (this._physActor != null) // && this.physicsEnabled)
140 {
141 try
142 {
143 lock (m_world.LockPhysicsEngine)
144 {
145 this._physActor.Position = new PhysicsVector(pos.X, pos.Y, pos.Z);
146 }
147 }
148 catch (Exception e)
149 {
150 Console.WriteLine(e.Message);
151 }
152 }
153 this.updateFlag = true;
154 }
155
156 public override void update()
157 {
158 LLVector3 pos2 = new LLVector3(0, 0, 0);
159 if (this._physActor != null && this.physicsEnabled)
160 {
161
162 PhysicsVector pPos = this._physActor.Position;
163 pos2 = new LLVector3(pPos.X, pPos.Y, pPos.Z);
164 }
165 if (this.newPrimFlag)
166 {
167 foreach (ClientView client in m_clientThreads.Values)
168 {
169 client.OutPacket(OurPacket);
170 }
171 this.newPrimFlag = false;
172 }
173 else if (this.updateFlag)
174 {
175 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
176 terse.RegionData.RegionHandle = m_regionHandle; // FIXME
177 terse.RegionData.TimeDilation = 64096;
178 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
179 terse.ObjectData[0] = this.CreateImprovedBlock();
180 foreach (ClientView client in m_clientThreads.Values)
181 {
182 client.OutPacket(terse);
183 }
184 this.updateFlag = false;
185 }
186 else if (this.dirtyFlag)
187 {
188 foreach (ClientView client in m_clientThreads.Values)
189 {
190 UpdateClient(client);
191 }
192 this.dirtyFlag = false;
193 }
194 else
195 {
196 if (this._physActor != null && this.physicsEnabled)
197 {
198 if (pos2 != this.positionLastFrame)
199 {
200 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
201 terse.RegionData.RegionHandle = m_regionHandle; // FIXME
202 terse.RegionData.TimeDilation = 64096;
203 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
204 terse.ObjectData[0] = this.CreateImprovedBlock();
205 foreach (ClientView client in m_clientThreads.Values)
206 {
207 client.OutPacket(terse);
208 }
209 }
210 this.positionLastFrame = pos2;
211 }
212 }
213
214 if (this.physicstest)
215 {
216 LLVector3 pos = this.Pos;
217 pos.Z += 0.0001f;
218 this.UpdatePosition(pos);
219 this.physicstest = false;
220 }
221 }
222
223 public void UpdateClient(ClientView RemoteClient)
224 {
225
226 LLVector3 lPos;
227 if (this._physActor != null && this.physicsEnabled)
228 {
229 PhysicsVector pPos = this._physActor.Position;
230 lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z);
231 }
232 else
233 {
234 lPos = this.Pos;
235 }
236 byte[] pb = lPos.GetBytes();
237 Array.Copy(pb, 0, OurPacket.ObjectData[0].ObjectData, 0, pb.Length);
238
239 // OurPacket should be update with the follwing in updateShape() rather than having to do it here
240 OurPacket.ObjectData[0].OwnerID = this.primData.OwnerID;
241 OurPacket.ObjectData[0].PCode = this.primData.PCode;
242 OurPacket.ObjectData[0].PathBegin = this.primData.PathBegin;
243 OurPacket.ObjectData[0].PathEnd = this.primData.PathEnd;
244 OurPacket.ObjectData[0].PathScaleX = this.primData.PathScaleX;
245 OurPacket.ObjectData[0].PathScaleY = this.primData.PathScaleY;
246 OurPacket.ObjectData[0].PathShearX = this.primData.PathShearX;
247 OurPacket.ObjectData[0].PathShearY = this.primData.PathShearY;
248 OurPacket.ObjectData[0].PathSkew = this.primData.PathSkew;
249 OurPacket.ObjectData[0].ProfileBegin = this.primData.ProfileBegin;
250 OurPacket.ObjectData[0].ProfileEnd = this.primData.ProfileEnd;
251 OurPacket.ObjectData[0].Scale = this.primData.Scale;
252 OurPacket.ObjectData[0].PathCurve = this.primData.PathCurve;
253 OurPacket.ObjectData[0].ProfileCurve = this.primData.ProfileCurve;
254 OurPacket.ObjectData[0].ParentID = this.primData.ParentID ;
255 OurPacket.ObjectData[0].ProfileHollow = this.primData.ProfileHollow;
256 //finish off copying rest of shape data
257 OurPacket.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset;
258 OurPacket.ObjectData[0].PathRevolutions = this.primData.PathRevolutions;
259 OurPacket.ObjectData[0].PathTaperX = this.primData.PathTaperX;
260 OurPacket.ObjectData[0].PathTaperY = this.primData.PathTaperY;
261 OurPacket.ObjectData[0].PathTwist = this.primData.PathTwist;
262 OurPacket.ObjectData[0].PathTwistBegin = this.primData.PathTwistBegin;
263
264 RemoteClient.OutPacket(OurPacket);
265 }
266
267 public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket)
268 {
269 this.primData.PathBegin = addPacket.PathBegin;
270 this.primData.PathEnd = addPacket.PathEnd;
271 this.primData.PathScaleX = addPacket.PathScaleX;
272 this.primData.PathScaleY = addPacket.PathScaleY;
273 this.primData.PathShearX = addPacket.PathShearX;
274 this.primData.PathShearY = addPacket.PathShearY;
275 this.primData.PathSkew = addPacket.PathSkew;
276 this.primData.ProfileBegin = addPacket.ProfileBegin;
277 this.primData.ProfileEnd = addPacket.ProfileEnd;
278 this.primData.PathCurve = addPacket.PathCurve;
279 this.primData.ProfileCurve = addPacket.ProfileCurve;
280 this.primData.ProfileHollow = addPacket.ProfileHollow;
281 this.primData.PathRadiusOffset = addPacket.PathRadiusOffset;
282 this.primData.PathRevolutions = addPacket.PathRevolutions;
283 this.primData.PathTaperX = addPacket.PathTaperX;
284 this.primData.PathTaperY = addPacket.PathTaperY;
285 this.primData.PathTwist = addPacket.PathTwist;
286 this.primData.PathTwistBegin = addPacket.PathTwistBegin;
287 this.dirtyFlag = true;
288 }
289
290 public void UpdateTexture(byte[] tex)
291 {
292 this.OurPacket.ObjectData[0].TextureEntry = tex;
293 this.primData.Texture = tex;
294 this.dirtyFlag = true;
295 }
296
297 public void UpdateObjectFlags(ObjectFlagUpdatePacket pack)
298 {
299 if (this._physActor != null)
300 {
301 if (this._physActor.Kinematic == pack.AgentData.UsePhysics)
302 {
303 this._physActor.Kinematic = !pack.AgentData.UsePhysics; //if Usephysics = true, then Kinematic should = false
304 }
305 this.physicsEnabled = pack.AgentData.UsePhysics;
306 if (this._physActor.Kinematic == false)
307 {
308 LLVector3 pos = this.Pos;
309 this.UpdatePosition(pos);
310 pos.Z += 0.000001f;
311 this.UpdatePosition(pos);
312 this.physicstest = true;
313 }
314 else
315 {
316 PhysicsVector vec = this._physActor.Position;
317 LLVector3 pos = new LLVector3(vec.X, vec.Y, vec.Z);
318 this.Pos = pos;
319 this.updateFlag = true;
320 }
321 }
322 }
323
324 public void MakeParent(Primitive prim)
325 {
326 this.primData.ParentID = prim.localid;
327 this.Pos -= prim.Pos;
328 this.dirtyFlag = true;
329 }
330
331 public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID ownerID, uint localID)
332 {
333 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
334 objupdate.RegionData.RegionHandle = m_regionHandle;
335 objupdate.RegionData.TimeDilation = 64096;
336
337 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
338 PrimData PData = new PrimData();
339 this.primData = PData;
340 this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
341
342 objupdate.ObjectData[0] = new ObjectUpdatePacket.ObjectDataBlock();
343 objupdate.ObjectData[0].PSBlock = new byte[0];
344 objupdate.ObjectData[0].ExtraParams = new byte[1];
345 objupdate.ObjectData[0].MediaURL = new byte[0];
346 objupdate.ObjectData[0].NameValue = new byte[0];
347 objupdate.ObjectData[0].Text = new byte[0];
348 objupdate.ObjectData[0].TextColor = new byte[4];
349 objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0, 0, 0);
350 objupdate.ObjectData[0].JointPivot = new LLVector3(0, 0, 0);
351 objupdate.ObjectData[0].Material = 3;
352 objupdate.ObjectData[0].UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456;
353 objupdate.ObjectData[0].TextureAnim = new byte[0];
354 objupdate.ObjectData[0].Sound = LLUUID.Zero;
355 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
356 this.primData.Texture = objupdate.ObjectData[0].TextureEntry = ntex.ToBytes();
357 objupdate.ObjectData[0].State = 0;
358 objupdate.ObjectData[0].Data = new byte[0];
359 PData.OwnerID = objupdate.ObjectData[0].OwnerID = ownerID;
360 PData.PCode = objupdate.ObjectData[0].PCode = addPacket.ObjectData.PCode;
361 PData.PathBegin = objupdate.ObjectData[0].PathBegin = addPacket.ObjectData.PathBegin;
362 PData.PathEnd = objupdate.ObjectData[0].PathEnd = addPacket.ObjectData.PathEnd;
363 PData.PathScaleX = objupdate.ObjectData[0].PathScaleX = addPacket.ObjectData.PathScaleX;
364 PData.PathScaleY = objupdate.ObjectData[0].PathScaleY = addPacket.ObjectData.PathScaleY;
365 PData.PathShearX = objupdate.ObjectData[0].PathShearX = addPacket.ObjectData.PathShearX;
366 PData.PathShearY = objupdate.ObjectData[0].PathShearY = addPacket.ObjectData.PathShearY;
367 PData.PathSkew = objupdate.ObjectData[0].PathSkew = addPacket.ObjectData.PathSkew;
368 PData.ProfileBegin = objupdate.ObjectData[0].ProfileBegin = addPacket.ObjectData.ProfileBegin;
369 PData.ProfileEnd = objupdate.ObjectData[0].ProfileEnd = addPacket.ObjectData.ProfileEnd;
370 PData.Scale = objupdate.ObjectData[0].Scale = addPacket.ObjectData.Scale;
371 PData.PathCurve = objupdate.ObjectData[0].PathCurve = addPacket.ObjectData.PathCurve;
372 PData.ProfileCurve = objupdate.ObjectData[0].ProfileCurve = addPacket.ObjectData.ProfileCurve;
373 PData.ParentID = objupdate.ObjectData[0].ParentID = 0;
374 PData.ProfileHollow = objupdate.ObjectData[0].ProfileHollow = addPacket.ObjectData.ProfileHollow;
375 PData.PathRadiusOffset = objupdate.ObjectData[0].PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset;
376 PData.PathRevolutions = objupdate.ObjectData[0].PathRevolutions = addPacket.ObjectData.PathRevolutions;
377 PData.PathTaperX = objupdate.ObjectData[0].PathTaperX = addPacket.ObjectData.PathTaperX;
378 PData.PathTaperY = objupdate.ObjectData[0].PathTaperY = addPacket.ObjectData.PathTaperY;
379 PData.PathTwist = objupdate.ObjectData[0].PathTwist = addPacket.ObjectData.PathTwist;
380 PData.PathTwistBegin = objupdate.ObjectData[0].PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
381 objupdate.ObjectData[0].ID = (uint)(localID);
382 objupdate.ObjectData[0].FullID = new LLUUID("edba7151-5857-acc5-b30b-f01efef" + (localID - 702000).ToString("00000"));
383 objupdate.ObjectData[0].ObjectData = new byte[60];
384 objupdate.ObjectData[0].ObjectData[46] = 128;
385 objupdate.ObjectData[0].ObjectData[47] = 63;
386 LLVector3 pos1 = addPacket.ObjectData.RayEnd;
387 //update position
388 byte[] pb = pos1.GetBytes();
389 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 0, pb.Length);
390 this.newPrimFlag = true;
391 this.primData.FullID = this.uuid = objupdate.ObjectData[0].FullID;
392 this.localid = objupdate.ObjectData[0].ID;
393 this.primData.Position = this.Pos = pos1;
394 this.OurPacket = objupdate;
395 }
396
397 public void CreateFromStorage(PrimData store)
398 {
399 this.CreateFromStorage(store, store.Position, store.LocalID, false);
400 }
401
402 public void CreateFromStorage(PrimData store, LLVector3 posi, uint localID, bool newprim)
403 {
404 //need to clean this up as it shares a lot of code with CreateFromPacket()
405 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
406 objupdate.RegionData.RegionHandle = m_regionHandle;
407 objupdate.RegionData.TimeDilation = 64096;
408 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
409
410 this.primData = store;
411 objupdate.ObjectData[0] = new ObjectUpdatePacket.ObjectDataBlock();
412 objupdate.ObjectData[0].PSBlock = new byte[0];
413 objupdate.ObjectData[0].ExtraParams = new byte[1];
414 objupdate.ObjectData[0].MediaURL = new byte[0];
415 objupdate.ObjectData[0].NameValue = new byte[0];
416 objupdate.ObjectData[0].Text = new byte[0];
417 objupdate.ObjectData[0].TextColor = new byte[4];
418 objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0, 0, 0);
419 objupdate.ObjectData[0].JointPivot = new LLVector3(0, 0, 0);
420 objupdate.ObjectData[0].Material = 3;
421 objupdate.ObjectData[0].UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456;
422 objupdate.ObjectData[0].TextureAnim = new byte[0];
423 objupdate.ObjectData[0].Sound = LLUUID.Zero;
424
425 if (store.Texture == null)
426 {
427 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
428 objupdate.ObjectData[0].TextureEntry = ntex.ToBytes();
429 }
430 else
431 {
432 objupdate.ObjectData[0].TextureEntry = store.Texture;
433 }
434
435 objupdate.ObjectData[0].State = 0;
436 objupdate.ObjectData[0].Data = new byte[0];
437 objupdate.ObjectData[0].OwnerID = this.primData.OwnerID;
438 objupdate.ObjectData[0].PCode = this.primData.PCode;
439 objupdate.ObjectData[0].PathBegin = this.primData.PathBegin;
440 objupdate.ObjectData[0].PathEnd = this.primData.PathEnd;
441 objupdate.ObjectData[0].PathScaleX = this.primData.PathScaleX;
442 objupdate.ObjectData[0].PathScaleY = this.primData.PathScaleY;
443 objupdate.ObjectData[0].PathShearX = this.primData.PathShearX;
444 objupdate.ObjectData[0].PathShearY = this.primData.PathShearY;
445 objupdate.ObjectData[0].PathSkew = this.primData.PathSkew;
446 objupdate.ObjectData[0].ProfileBegin = this.primData.ProfileBegin;
447 objupdate.ObjectData[0].ProfileEnd = this.primData.ProfileEnd;
448 objupdate.ObjectData[0].Scale = this.primData.Scale;
449 objupdate.ObjectData[0].PathCurve = this.primData.PathCurve;
450 objupdate.ObjectData[0].ProfileCurve = this.primData.ProfileCurve;
451 objupdate.ObjectData[0].ParentID = 0;
452 objupdate.ObjectData[0].ProfileHollow = this.primData.ProfileHollow;
453 //finish off copying rest of shape data
454 objupdate.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset;
455 objupdate.ObjectData[0].PathRevolutions = this.primData.PathRevolutions;
456 objupdate.ObjectData[0].PathTaperX = this.primData.PathTaperX;
457 objupdate.ObjectData[0].PathTaperY = this.primData.PathTaperY;
458 objupdate.ObjectData[0].PathTwist = this.primData.PathTwist;
459 objupdate.ObjectData[0].PathTwistBegin = this.primData.PathTwistBegin;
460
461 objupdate.ObjectData[0].ID = localID; // (uint)store.LocalID;
462 objupdate.ObjectData[0].FullID = store.FullID;
463
464 objupdate.ObjectData[0].ObjectData = new byte[60];
465 objupdate.ObjectData[0].ObjectData[46] = 128;
466 objupdate.ObjectData[0].ObjectData[47] = 63;
467 LLVector3 pos1 = posi; // store.Position;
468 //update position
469 byte[] pb = pos1.GetBytes();
470 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 0, pb.Length);
471
472 this.uuid = objupdate.ObjectData[0].FullID;
473 this.localid = objupdate.ObjectData[0].ID;
474 this.Pos = pos1;
475 this.OurPacket = objupdate;
476 if (newprim)
477 {
478 this.newPrimFlag = true;
479 }
480 }
481
482 public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateImprovedBlock()
483 {
484 uint ID = this.localid;
485 byte[] bytes = new byte[60];
486
487 int i = 0;
488 ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
489 //dat.TextureEntry = this.OurPacket.ObjectData[0].TextureEntry;
490 dat.TextureEntry = new byte[0];
491 //Console.WriteLine("texture-entry length in improvedterse block is " + this.OurPacket.ObjectData[0].TextureEntry.Length);
492 bytes[i++] = (byte)(ID % 256);
493 bytes[i++] = (byte)((ID >> 8) % 256);
494 bytes[i++] = (byte)((ID >> 16) % 256);
495 bytes[i++] = (byte)((ID >> 24) % 256);
496 bytes[i++] = 0;
497 bytes[i++] = 0;
498
499 LLVector3 lPos;
500 Axiom.MathLib.Quaternion lRot;
501 if (this._physActor != null && this.physicsEnabled)
502 {
503 PhysicsVector pPos = this._physActor.Position;
504 lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z);
505 lRot = this._physActor.Orientation;
506 }
507 else
508 {
509 lPos = this.Pos;
510 lRot = this.rotation;
511 }
512 byte[] pb = lPos.GetBytes();
513 Array.Copy(pb, 0, bytes, i, pb.Length);
514 i += 12;
515 ushort ac = 32767;
516
517 //vel
518 bytes[i++] = (byte)(ac % 256);
519 bytes[i++] = (byte)((ac >> 8) % 256);
520 bytes[i++] = (byte)(ac % 256);
521 bytes[i++] = (byte)((ac >> 8) % 256);
522 bytes[i++] = (byte)(ac % 256);
523 bytes[i++] = (byte)((ac >> 8) % 256);
524
525 //accel
526 bytes[i++] = (byte)(ac % 256);
527 bytes[i++] = (byte)((ac >> 8) % 256);
528 bytes[i++] = (byte)(ac % 256);
529 bytes[i++] = (byte)((ac >> 8) % 256);
530 bytes[i++] = (byte)(ac % 256);
531 bytes[i++] = (byte)((ac >> 8) % 256);
532
533 ushort rw, rx, ry, rz;
534 rw = (ushort)(32768 * (lRot.w + 1));
535 rx = (ushort)(32768 * (lRot.x + 1));
536 ry = (ushort)(32768 * (lRot.y + 1));
537 rz = (ushort)(32768 * (lRot.z + 1));
538
539 //rot
540 bytes[i++] = (byte)(rx % 256);
541 bytes[i++] = (byte)((rx >> 8) % 256);
542 bytes[i++] = (byte)(ry % 256);
543 bytes[i++] = (byte)((ry >> 8) % 256);
544 bytes[i++] = (byte)(rz % 256);
545 bytes[i++] = (byte)((rz >> 8) % 256);
546 bytes[i++] = (byte)(rw % 256);
547 bytes[i++] = (byte)((rw >> 8) % 256);
548
549 //rotation vel
550 bytes[i++] = (byte)(ac % 256);
551 bytes[i++] = (byte)((ac >> 8) % 256);
552 bytes[i++] = (byte)(ac % 256);
553 bytes[i++] = (byte)((ac >> 8) % 256);
554 bytes[i++] = (byte)(ac % 256);
555 bytes[i++] = (byte)((ac >> 8) % 256);
556
557 dat.Data = bytes;
558 return dat;
559 }
560
561 public override void BackUp()
562 {
563 this.primData.FullID = this.uuid;
564 this.primData.LocalID = this.localid;
565 this.primData.Position = this.Pos;
566 this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w);
567 this.m_world.localStorage.StorePrim(this.primData);
568 }
569 }
570}
diff --git a/OpenSim/OpenSim.RegionServer/world/Primitive2.cs b/OpenSim/OpenSim.RegionServer/world/Primitive2.cs
new file mode 100644
index 0000000..6d071d4
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/Primitive2.cs
@@ -0,0 +1,491 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.types;
5using libsecondlife;
6using libsecondlife.Packets;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Physics.Manager;
9using OpenSim.Framework.Types;
10using OpenSim.Framework.Inventory;
11
12namespace OpenSim.world
13{
14 public class Primitive2 : Entity
15 {
16 protected PrimData primData;
17 //private ObjectUpdatePacket OurPacket;
18 private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
19 private Dictionary<uint, ClientView> m_clientThreads;
20 private ulong m_regionHandle;
21 private const uint FULL_MASK_PERMISSIONS = 2147483647;
22 private bool physicsEnabled = false;
23
24 private Dictionary<LLUUID, InventoryItem> inventoryItems;
25
26 #region Properties
27
28 public LLVector3 Scale
29 {
30 set
31 {
32 this.primData.Scale = value;
33 //this.dirtyFlag = true;
34 }
35 get
36 {
37 return this.primData.Scale;
38 }
39 }
40
41 public PhysicsActor PhysActor
42 {
43 set
44 {
45 this._physActor = value;
46 }
47 }
48 public override LLVector3 Pos
49 {
50 get
51 {
52 return base.Pos;
53 }
54 set
55 {
56 base.Pos = value;
57 }
58 }
59 #endregion
60
61 public Primitive2(Dictionary<uint, ClientView> clientThreads, ulong regionHandle, World world)
62 {
63 m_clientThreads = clientThreads;
64 m_regionHandle = regionHandle;
65 m_world = world;
66 inventoryItems = new Dictionary<LLUUID, InventoryItem>();
67 }
68
69 public Primitive2(Dictionary<uint, ClientView> clientThreads, ulong regionHandle, World world, LLUUID owner)
70 {
71 m_clientThreads = clientThreads;
72 m_regionHandle = regionHandle;
73 m_world = world;
74 inventoryItems = new Dictionary<LLUUID, InventoryItem>();
75 this.primData = new PrimData();
76 this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
77 this.primData.OwnerID = owner;
78 }
79
80 public byte[] GetByteArray()
81 {
82 byte[] result = null;
83 List<byte[]> dataArrays = new List<byte[]>();
84 dataArrays.Add(primData.ToBytes());
85 foreach (Entity child in children)
86 {
87 if (child is OpenSim.world.Primitive2)
88 {
89 dataArrays.Add(((OpenSim.world.Primitive2)child).GetByteArray());
90 }
91 }
92 byte[] primstart = Helpers.StringToField("<Prim>");
93 byte[] primend = Helpers.StringToField("</Prim>");
94 int totalLength = primstart.Length + primend.Length;
95 for (int i = 0; i < dataArrays.Count; i++)
96 {
97 totalLength += dataArrays[i].Length;
98 }
99
100 result = new byte[totalLength];
101 int arraypos = 0;
102 Array.Copy(primstart, 0, result, 0, primstart.Length);
103 arraypos += primstart.Length;
104 for (int i = 0; i < dataArrays.Count; i++)
105 {
106 Array.Copy(dataArrays[i], 0, result, arraypos, dataArrays[i].Length);
107 arraypos += dataArrays[i].Length;
108 }
109 Array.Copy(primend, 0, result, arraypos, primend.Length);
110
111 return result;
112 }
113
114 #region Overridden Methods
115
116 public override void update()
117 {
118 LLVector3 pos2 = new LLVector3(0, 0, 0);
119 }
120
121 public override void BackUp()
122 {
123
124 }
125
126 #endregion
127
128 #region Packet handlers
129
130 public void UpdatePosition(LLVector3 pos)
131 {
132
133 }
134
135 public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket)
136 {
137 this.primData.PathBegin = addPacket.PathBegin;
138 this.primData.PathEnd = addPacket.PathEnd;
139 this.primData.PathScaleX = addPacket.PathScaleX;
140 this.primData.PathScaleY = addPacket.PathScaleY;
141 this.primData.PathShearX = addPacket.PathShearX;
142 this.primData.PathShearY = addPacket.PathShearY;
143 this.primData.PathSkew = addPacket.PathSkew;
144 this.primData.ProfileBegin = addPacket.ProfileBegin;
145 this.primData.ProfileEnd = addPacket.ProfileEnd;
146 this.primData.PathCurve = addPacket.PathCurve;
147 this.primData.ProfileCurve = addPacket.ProfileCurve;
148 this.primData.ProfileHollow = addPacket.ProfileHollow;
149 this.primData.PathRadiusOffset = addPacket.PathRadiusOffset;
150 this.primData.PathRevolutions = addPacket.PathRevolutions;
151 this.primData.PathTaperX = addPacket.PathTaperX;
152 this.primData.PathTaperY = addPacket.PathTaperY;
153 this.primData.PathTwist = addPacket.PathTwist;
154 this.primData.PathTwistBegin = addPacket.PathTwistBegin;
155 }
156
157 public void UpdateTexture(byte[] tex)
158 {
159 this.primData.Texture = tex;
160 //this.dirtyFlag = true;
161 }
162
163 public void UpdateObjectFlags(ObjectFlagUpdatePacket pack)
164 {
165
166 }
167
168 public void AssignToParent(Primitive prim)
169 {
170
171 }
172
173 public void GetProperites(ClientView client)
174 {
175 ObjectPropertiesPacket proper = new ObjectPropertiesPacket();
176 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
177 proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
178 proper.ObjectData[0].ItemID = LLUUID.Zero;
179 proper.ObjectData[0].CreationDate = (ulong)this.primData.CreationDate;
180 proper.ObjectData[0].CreatorID = this.primData.OwnerID;
181 proper.ObjectData[0].FolderID = LLUUID.Zero;
182 proper.ObjectData[0].FromTaskID = LLUUID.Zero;
183 proper.ObjectData[0].GroupID = LLUUID.Zero;
184 proper.ObjectData[0].InventorySerial = 0;
185 proper.ObjectData[0].LastOwnerID = LLUUID.Zero;
186 proper.ObjectData[0].ObjectID = this.uuid;
187 proper.ObjectData[0].OwnerID = primData.OwnerID;
188 proper.ObjectData[0].TouchName = new byte[0];
189 proper.ObjectData[0].TextureID = new byte[0];
190 proper.ObjectData[0].SitName = new byte[0];
191 proper.ObjectData[0].Name = new byte[0];
192 proper.ObjectData[0].Description = new byte[0];
193 proper.ObjectData[0].OwnerMask = this.primData.OwnerMask;
194 proper.ObjectData[0].NextOwnerMask = this.primData.NextOwnerMask;
195 proper.ObjectData[0].GroupMask = this.primData.GroupMask;
196 proper.ObjectData[0].EveryoneMask = this.primData.EveryoneMask;
197 proper.ObjectData[0].BaseMask = this.primData.BaseMask;
198
199 client.OutPacket(proper);
200 }
201
202 #endregion
203
204 # region Inventory Methods
205
206 public bool AddToInventory(InventoryItem item)
207 {
208 return false;
209 }
210
211 public InventoryItem RemoveFromInventory(LLUUID itemID)
212 {
213 return null;
214 }
215
216 public void RequestInventoryInfo(ClientView simClient, RequestTaskInventoryPacket packet)
217 {
218
219 }
220
221 public void RequestXferInventory(ClientView simClient, ulong xferID)
222 {
223 //will only currently work if the total size of the inventory data array is under about 1000 bytes
224 SendXferPacketPacket send = new SendXferPacketPacket();
225
226 send.XferID.ID = xferID;
227 send.XferID.Packet = 1 + 2147483648;
228 send.DataPacket.Data = this.ConvertInventoryToBytes();
229
230 simClient.OutPacket(send);
231 }
232
233 public byte[] ConvertInventoryToBytes()
234 {
235 System.Text.Encoding enc = System.Text.Encoding.ASCII;
236 byte[] result = new byte[0];
237 List<byte[]> inventoryData = new List<byte[]>();
238 int totallength = 0;
239 foreach (InventoryItem invItem in inventoryItems.Values)
240 {
241 byte[] data = enc.GetBytes(invItem.ExportString());
242 inventoryData.Add(data);
243 totallength += data.Length;
244 }
245 //TODO: copy arrays into the single result array
246
247 return result;
248 }
249
250 public void CreateInventoryFromBytes(byte[] data)
251 {
252
253 }
254
255 #endregion
256
257 #region Update viewers Methods
258
259 //should change these mehtods, so that outgoing packets are sent through the avatar class
260 public void SendFullUpdateToClient(ClientView remoteClient)
261 {
262 LLVector3 lPos;
263 if (this._physActor != null && this.physicsEnabled)
264 {
265 PhysicsVector pPos = this._physActor.Position;
266 lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z);
267 }
268 else
269 {
270 lPos = this.Pos;
271 }
272
273 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
274 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
275 outPacket.ObjectData[0] = this.CreateUpdateBlock();
276 byte[] pb = lPos.GetBytes();
277 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
278
279 remoteClient.OutPacket(outPacket);
280 }
281
282 public void SendFullUpdateToAllClients()
283 {
284
285 }
286
287 public void SendTerseUpdateToClient(ClientView RemoteClient)
288 {
289
290 }
291
292 public void SendTerseUpdateToALLClients()
293 {
294
295 }
296
297 #endregion
298
299 #region Create Methods
300
301 public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID ownerID, uint localID)
302 {
303 PrimData PData = new PrimData();
304 this.primData = PData;
305 this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
306
307 PData.OwnerID = ownerID;
308 PData.PCode = addPacket.ObjectData.PCode;
309 PData.PathBegin = addPacket.ObjectData.PathBegin;
310 PData.PathEnd = addPacket.ObjectData.PathEnd;
311 PData.PathScaleX = addPacket.ObjectData.PathScaleX;
312 PData.PathScaleY = addPacket.ObjectData.PathScaleY;
313 PData.PathShearX = addPacket.ObjectData.PathShearX;
314 PData.PathShearY = addPacket.ObjectData.PathShearY;
315 PData.PathSkew = addPacket.ObjectData.PathSkew;
316 PData.ProfileBegin = addPacket.ObjectData.ProfileBegin;
317 PData.ProfileEnd = addPacket.ObjectData.ProfileEnd;
318 PData.Scale = addPacket.ObjectData.Scale;
319 PData.PathCurve = addPacket.ObjectData.PathCurve;
320 PData.ProfileCurve = addPacket.ObjectData.ProfileCurve;
321 PData.ParentID = 0;
322 PData.ProfileHollow = addPacket.ObjectData.ProfileHollow;
323 PData.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset;
324 PData.PathRevolutions = addPacket.ObjectData.PathRevolutions;
325 PData.PathTaperX = addPacket.ObjectData.PathTaperX;
326 PData.PathTaperY = addPacket.ObjectData.PathTaperY;
327 PData.PathTwist = addPacket.ObjectData.PathTwist;
328 PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
329 LLVector3 pos1 = addPacket.ObjectData.RayEnd;
330 this.primData.FullID = this.uuid = LLUUID.Random();
331 this.localid = (uint)(localID);
332 this.primData.Position = this.Pos = pos1;
333 }
334
335 public void CreateFromBytes(byte[] data)
336 {
337
338 }
339
340 public void CreateFromPrimData(PrimData primData)
341 {
342 this.CreateFromPrimData(primData, primData.Position, primData.LocalID, false);
343 }
344
345 public void CreateFromPrimData(PrimData primData, LLVector3 posi, uint localID, bool newprim)
346 {
347
348 }
349
350 #endregion
351
352 #region Packet Update Methods
353 protected void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
354 {
355 objdata.PSBlock = new byte[0];
356 objdata.ExtraParams = new byte[1];
357 objdata.MediaURL = new byte[0];
358 objdata.NameValue = new byte[0];
359 objdata.Text = new byte[0];
360 objdata.TextColor = new byte[4];
361 objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0);
362 objdata.JointPivot = new LLVector3(0, 0, 0);
363 objdata.Material = 3;
364 objdata.TextureAnim = new byte[0];
365 objdata.Sound = LLUUID.Zero;
366 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
367 this.primData.Texture = objdata.TextureEntry = ntex.ToBytes();
368 objdata.State = 0;
369 objdata.Data = new byte[0];
370
371 objdata.ObjectData = new byte[60];
372 objdata.ObjectData[46] = 128;
373 objdata.ObjectData[47] = 63;
374 }
375
376 protected void SetPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData)
377 {
378 objectData.OwnerID = this.primData.OwnerID;
379 objectData.PCode = this.primData.PCode;
380 objectData.PathBegin = this.primData.PathBegin;
381 objectData.PathEnd = this.primData.PathEnd;
382 objectData.PathScaleX = this.primData.PathScaleX;
383 objectData.PathScaleY = this.primData.PathScaleY;
384 objectData.PathShearX = this.primData.PathShearX;
385 objectData.PathShearY = this.primData.PathShearY;
386 objectData.PathSkew = this.primData.PathSkew;
387 objectData.ProfileBegin = this.primData.ProfileBegin;
388 objectData.ProfileEnd = this.primData.ProfileEnd;
389 objectData.Scale = this.primData.Scale;
390 objectData.PathCurve = this.primData.PathCurve;
391 objectData.ProfileCurve = this.primData.ProfileCurve;
392 objectData.ParentID = this.primData.ParentID;
393 objectData.ProfileHollow = this.primData.ProfileHollow;
394 objectData.PathRadiusOffset = this.primData.PathRadiusOffset;
395 objectData.PathRevolutions = this.primData.PathRevolutions;
396 objectData.PathTaperX = this.primData.PathTaperX;
397 objectData.PathTaperY = this.primData.PathTaperY;
398 objectData.PathTwist = this.primData.PathTwist;
399 objectData.PathTwistBegin = this.primData.PathTwistBegin;
400 }
401
402 #endregion
403 protected ObjectUpdatePacket.ObjectDataBlock CreateUpdateBlock()
404 {
405 ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock();
406 this.SetDefaultPacketValues(objupdate);
407 objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456;
408 this.SetPacketShapeData(objupdate);
409 byte[] pb = this.Pos.GetBytes();
410 Array.Copy(pb, 0, objupdate.ObjectData, 0, pb.Length);
411 return objupdate;
412 }
413
414 protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateImprovedBlock()
415 {
416 uint ID = this.localid;
417 byte[] bytes = new byte[60];
418
419 int i = 0;
420 ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
421 dat.TextureEntry = new byte[0];
422 bytes[i++] = (byte)(ID % 256);
423 bytes[i++] = (byte)((ID >> 8) % 256);
424 bytes[i++] = (byte)((ID >> 16) % 256);
425 bytes[i++] = (byte)((ID >> 24) % 256);
426 bytes[i++] = 0;
427 bytes[i++] = 0;
428
429 LLVector3 lPos;
430 Axiom.MathLib.Quaternion lRot;
431 if (this._physActor != null && this.physicsEnabled)
432 {
433 PhysicsVector pPos = this._physActor.Position;
434 lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z);
435 lRot = this._physActor.Orientation;
436 }
437 else
438 {
439 lPos = this.Pos;
440 lRot = this.rotation;
441 }
442 byte[] pb = lPos.GetBytes();
443 Array.Copy(pb, 0, bytes, i, pb.Length);
444 i += 12;
445 ushort ac = 32767;
446
447 //vel
448 bytes[i++] = (byte)(ac % 256);
449 bytes[i++] = (byte)((ac >> 8) % 256);
450 bytes[i++] = (byte)(ac % 256);
451 bytes[i++] = (byte)((ac >> 8) % 256);
452 bytes[i++] = (byte)(ac % 256);
453 bytes[i++] = (byte)((ac >> 8) % 256);
454
455 //accel
456 bytes[i++] = (byte)(ac % 256);
457 bytes[i++] = (byte)((ac >> 8) % 256);
458 bytes[i++] = (byte)(ac % 256);
459 bytes[i++] = (byte)((ac >> 8) % 256);
460 bytes[i++] = (byte)(ac % 256);
461 bytes[i++] = (byte)((ac >> 8) % 256);
462
463 ushort rw, rx, ry, rz;
464 rw = (ushort)(32768 * (lRot.w + 1));
465 rx = (ushort)(32768 * (lRot.x + 1));
466 ry = (ushort)(32768 * (lRot.y + 1));
467 rz = (ushort)(32768 * (lRot.z + 1));
468
469 //rot
470 bytes[i++] = (byte)(rx % 256);
471 bytes[i++] = (byte)((rx >> 8) % 256);
472 bytes[i++] = (byte)(ry % 256);
473 bytes[i++] = (byte)((ry >> 8) % 256);
474 bytes[i++] = (byte)(rz % 256);
475 bytes[i++] = (byte)((rz >> 8) % 256);
476 bytes[i++] = (byte)(rw % 256);
477 bytes[i++] = (byte)((rw >> 8) % 256);
478
479 //rotation vel
480 bytes[i++] = (byte)(ac % 256);
481 bytes[i++] = (byte)((ac >> 8) % 256);
482 bytes[i++] = (byte)(ac % 256);
483 bytes[i++] = (byte)((ac >> 8) % 256);
484 bytes[i++] = (byte)(ac % 256);
485 bytes[i++] = (byte)((ac >> 8) % 256);
486
487 dat.Data = bytes;
488 return dat;
489 }
490 }
491}
diff --git a/OpenSim/OpenSim.RegionServer/world/SceneObject.cs b/OpenSim/OpenSim.RegionServer/world/SceneObject.cs
new file mode 100644
index 0000000..a846fb5
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/SceneObject.cs
@@ -0,0 +1,77 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.types;
5using libsecondlife;
6using libsecondlife.Packets;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Physics.Manager;
9using OpenSim.Framework.Types;
10using OpenSim.Framework.Inventory;
11
12namespace OpenSim.world
13{
14 public class SceneObject : Entity
15 {
16 private LLUUID rootUUID;
17 private Dictionary<LLUUID, Primitive2> ChildPrimitives = new Dictionary<LLUUID, Primitive2>();
18 private Dictionary<uint, ClientView> m_clientThreads;
19 private World m_world;
20
21 public SceneObject()
22 {
23
24 }
25
26 public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID)
27 {
28 }
29
30 public void CreateFromBytes(byte[] data)
31 {
32
33 }
34
35 public override void update()
36 {
37
38 }
39
40 public override void BackUp()
41 {
42
43 }
44
45 public void GetProperites(ClientView client)
46 {
47 /*
48 ObjectPropertiesPacket proper = new ObjectPropertiesPacket();
49 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
50 proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
51 proper.ObjectData[0].ItemID = LLUUID.Zero;
52 proper.ObjectData[0].CreationDate = (ulong)this.primData.CreationDate;
53 proper.ObjectData[0].CreatorID = this.primData.OwnerID;
54 proper.ObjectData[0].FolderID = LLUUID.Zero;
55 proper.ObjectData[0].FromTaskID = LLUUID.Zero;
56 proper.ObjectData[0].GroupID = LLUUID.Zero;
57 proper.ObjectData[0].InventorySerial = 0;
58 proper.ObjectData[0].LastOwnerID = LLUUID.Zero;
59 proper.ObjectData[0].ObjectID = this.uuid;
60 proper.ObjectData[0].OwnerID = primData.OwnerID;
61 proper.ObjectData[0].TouchName = new byte[0];
62 proper.ObjectData[0].TextureID = new byte[0];
63 proper.ObjectData[0].SitName = new byte[0];
64 proper.ObjectData[0].Name = new byte[0];
65 proper.ObjectData[0].Description = new byte[0];
66 proper.ObjectData[0].OwnerMask = this.primData.OwnerMask;
67 proper.ObjectData[0].NextOwnerMask = this.primData.NextOwnerMask;
68 proper.ObjectData[0].GroupMask = this.primData.GroupMask;
69 proper.ObjectData[0].EveryoneMask = this.primData.EveryoneMask;
70 proper.ObjectData[0].BaseMask = this.primData.BaseMask;
71
72 client.OutPacket(proper);
73 * */
74 }
75
76 }
77}
diff --git a/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs b/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs
new file mode 100644
index 0000000..4f32335
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/World.PacketHandlers.cs
@@ -0,0 +1,368 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using libsecondlife.Packets;
6using OpenSim.Physics.Manager;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Types;
9using OpenSim.Framework.Terrain;
10using OpenSim.Framework.Inventory;
11using OpenSim.Framework.Utilities;
12using OpenSim.Assets;
13
14namespace OpenSim.world
15{
16 public partial class World
17 {
18 public void ModifyTerrain(byte action, float north, float west)
19 {
20 switch (action)
21 {
22 case 1:
23 // raise terrain
24 Terrain.raise(north, west, 10.0, 0.001);
25 RegenerateTerrain(true, (int)north, (int)west);
26 break;
27 case 2:
28 //lower terrain
29 Terrain.lower(north, west, 10.0, 0.001);
30 RegenerateTerrain(true, (int)north, (int)west);
31 break;
32 }
33 return;
34 }
35
36 public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
37 {
38 foreach (ClientView client in m_clientThreads.Values)
39 {
40 // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
41 int dis = (int)client.ClientAvatar.Pos.GetDistanceTo(fromPos);
42
43 switch (type)
44 {
45 case 0: // Whisper
46 if ((dis < 10) && (dis > -10))
47 {
48 //should change so the message is sent through the avatar rather than direct to the ClientView
49 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID);
50 }
51 break;
52 case 1: // Say
53 if ((dis < 30) && (dis > -30))
54 {
55 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID);
56 }
57 break;
58 case 2: // Shout
59 if ((dis < 100) && (dis > -100))
60 {
61 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID);
62 }
63 break;
64
65 case 0xff: // Broadcast
66 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID);
67 break;
68 }
69
70 }
71 }
72
73 public void RezObject(AssetBase primAsset, LLVector3 pos)
74 {
75 PrimData primd = new PrimData(primAsset.Data);
76 Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
77 nPrim.CreateFromStorage(primd, pos, this._primCount, true);
78 this.Entities.Add(nPrim.uuid, nPrim);
79 this._primCount++;
80 }
81
82 public void DeRezObject(Packet packet, ClientView simClient)
83 {
84 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)packet;
85
86 //Needs to delete object from physics at a later date
87 if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero)
88 {
89 //currently following code not used (or don't know of any case of destination being zero
90 libsecondlife.LLUUID[] DeRezEnts;
91 DeRezEnts = new libsecondlife.LLUUID[DeRezPacket.ObjectData.Length];
92 int i = 0;
93 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
94 {
95
96 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
97 foreach (Entity ent in this.Entities.Values)
98 {
99 if (ent.localid == Data.ObjectLocalID)
100 {
101 DeRezEnts[i++] = ent.uuid;
102 this.localStorage.RemovePrim(ent.uuid);
103 KillObjectPacket kill = new KillObjectPacket();
104 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
105 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
106 kill.ObjectData[0].ID = ent.localid;
107 foreach (ClientView client in m_clientThreads.Values)
108 {
109 client.OutPacket(kill);
110 }
111 //Uncommenting this means an old UUID will be re-used, thus crashing the asset server
112 //Uncomment when prim/object UUIDs are random or such
113 //2007-03-22 - Randomskk
114 //this._primCount--;
115 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Deleted UUID " + ent.uuid);
116 }
117 }
118 }
119 foreach (libsecondlife.LLUUID uuid in DeRezEnts)
120 {
121 lock (Entities)
122 {
123 Entities.Remove(uuid);
124 }
125 }
126 }
127 else
128 {
129 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
130 {
131 Entity selectedEnt = null;
132 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
133 foreach (Entity ent in this.Entities.Values)
134 {
135 if (ent.localid == Data.ObjectLocalID)
136 {
137 AssetBase primAsset = new AssetBase();
138 primAsset.FullID = LLUUID.Random();//DeRezPacket.AgentBlock.TransactionID.Combine(LLUUID.Zero); //should be combining with securesessionid
139 primAsset.InvType = 6;
140 primAsset.Type = 6;
141 primAsset.Name = "Prim";
142 primAsset.Description = "";
143 primAsset.Data = ((Primitive)ent).GetByteArray();
144 this._assetCache.AddAsset(primAsset);
145 this._inventoryCache.AddNewInventoryItem(simClient, DeRezPacket.AgentBlock.DestinationID, primAsset);
146 selectedEnt = ent;
147 break;
148 }
149 }
150 if (selectedEnt != null)
151 {
152 this.localStorage.RemovePrim(selectedEnt.uuid);
153 KillObjectPacket kill = new KillObjectPacket();
154 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
155 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
156 kill.ObjectData[0].ID = selectedEnt.localid;
157 foreach (ClientView client in m_clientThreads.Values)
158 {
159 client.OutPacket(kill);
160 }
161 lock (Entities)
162 {
163 Entities.Remove(selectedEnt.uuid);
164 }
165 }
166 }
167 }
168
169 }
170
171 public void SendAvatarsToClient(ClientView remoteClient)
172 {
173 foreach (ClientView client in m_clientThreads.Values)
174 {
175 if (client.AgentID != remoteClient.AgentID)
176 {
177 // ObjectUpdatePacket objupdate = client.ClientAvatar.CreateUpdatePacket();
178 // RemoteClient.OutPacket(objupdate);
179 client.ClientAvatar.SendUpdateToOtherClient(remoteClient.ClientAvatar);
180 client.ClientAvatar.SendAppearanceToOtherAgent(remoteClient.ClientAvatar);
181 }
182 }
183 }
184
185 public void LinkObjects(uint parentPrim, List<uint> childPrims)
186 {
187 Primitive parentprim = null;
188 foreach (Entity ent in Entities.Values)
189 {
190 if (ent.localid == parentPrim)
191 {
192 parentprim = (OpenSim.world.Primitive)ent;
193
194 }
195 }
196
197 for (int i = 0; i < childPrims.Count; i++)
198 {
199 uint childId = childPrims[i];
200 foreach (Entity ent in Entities.Values)
201 {
202 if (ent.localid == childId)
203 {
204 ((OpenSim.world.Primitive)ent).MakeParent(parentprim);
205 }
206 }
207 }
208
209 }
210
211 public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
212 {
213 foreach (Entity ent in Entities.Values)
214 {
215 if (ent.localid == primLocalID)
216 {
217 ((OpenSim.world.Primitive)ent).UpdateShape(shapeBlock);
218 break;
219 }
220 }
221 }
222
223 public void SelectPrim(uint primLocalID, ClientView remoteClient)
224 {
225 foreach (Entity ent in Entities.Values)
226 {
227 if (ent.localid == primLocalID)
228 {
229 ((OpenSim.world.Primitive)ent).GetProperites(remoteClient);
230 break;
231 }
232 }
233 }
234
235 public void UpdatePrimFlags(uint localID, Packet packet, ClientView remoteClient)
236 {
237 foreach (Entity ent in Entities.Values)
238 {
239 if (ent.localid == localID)
240 {
241 ((OpenSim.world.Primitive)ent).UpdateObjectFlags((ObjectFlagUpdatePacket) packet);
242 break;
243 }
244 }
245 }
246
247 public void UpdatePrimTexture(uint localID, byte[] texture, ClientView remoteClient)
248 {
249 foreach (Entity ent in Entities.Values)
250 {
251 if (ent.localid == localID)
252 {
253 ((OpenSim.world.Primitive)ent).UpdateTexture(texture);
254 break;
255 }
256 }
257 }
258
259 public void UpdatePrimPosition(uint localID, LLVector3 pos, ClientView remoteClient)
260 {
261 foreach (Entity ent in Entities.Values)
262 {
263 if (ent.localid == localID)
264 {
265 ((OpenSim.world.Primitive)ent).UpdatePosition(pos);
266 break;
267 }
268 }
269 }
270
271 public void UpdatePrimRotation(uint localID, LLQuaternion rot, ClientView remoteClient)
272 {
273 foreach (Entity ent in Entities.Values)
274 {
275 if (ent.localid == localID)
276 {
277 ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
278 ((OpenSim.world.Primitive)ent).UpdateFlag = true;
279 break;
280 }
281 }
282 }
283
284 public void UpdatePrimScale(uint localID, LLVector3 scale, ClientView remoteClient)
285 {
286 foreach (Entity ent in Entities.Values)
287 {
288 if (ent.localid == localID)
289 {
290 ((OpenSim.world.Primitive)ent).Scale = scale;
291 break;
292 }
293 }
294 }
295
296 /*
297 public void RequestMapBlock(ClientView simClient, int minX, int minY, int maxX, int maxY)
298 {
299 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
300 if (((m_regInfo.RegionLocX > minX) && (m_regInfo.RegionLocX < maxX)) && ((m_regInfo.RegionLocY > minY) && (m_regInfo.RegionLocY < maxY)))
301 {
302 MapBlockReplyPacket mapReply = new MapBlockReplyPacket();
303 mapReply.AgentData.AgentID = simClient.AgentID;
304 mapReply.AgentData.Flags = 0;
305 mapReply.Data = new MapBlockReplyPacket.DataBlock[1];
306 mapReply.Data[0] = new MapBlockReplyPacket.DataBlock();
307 mapReply.Data[0].MapImageID = new LLUUID("00000000-0000-0000-9999-000000000007");
308 mapReply.Data[0].X = (ushort)m_regInfo.RegionLocX;
309 mapReply.Data[0].Y = (ushort)m_regInfo.RegionLocY;
310 mapReply.Data[0].WaterHeight = (byte)m_regInfo.RegionWaterHeight;
311 mapReply.Data[0].Name = _enc.GetBytes(this.m_regionName);
312 mapReply.Data[0].RegionFlags = 72458694;
313 mapReply.Data[0].Access = 13;
314 mapReply.Data[0].Agents = 1; //should send number of clients connected
315 simClient.OutPacket(mapReply);
316 }
317 }
318 public bool RezObjectHandler(ClientView simClient, Packet packet)
319 {
320 RezObjectPacket rezPacket = (RezObjectPacket)packet;
321 AgentInventory inven = this._inventoryCache.GetAgentsInventory(simClient.AgentID);
322 if (inven != null)
323 {
324 if (inven.InventoryItems.ContainsKey(rezPacket.InventoryData.ItemID))
325 {
326 AssetBase asset = this._assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID);
327 if (asset != null)
328 {
329 PrimData primd = new PrimData(asset.Data);
330 Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
331 nPrim.CreateFromStorage(primd, rezPacket.RezData.RayEnd, this._primCount, true);
332 this.Entities.Add(nPrim.uuid, nPrim);
333 this._primCount++;
334 this._inventoryCache.DeleteInventoryItem(simClient, rezPacket.InventoryData.ItemID);
335 }
336 }
337 }
338 return true;
339 }
340 public bool ModifyTerrain(ClientView simClient, Packet packet)
341 {
342 ModifyLandPacket modify = (ModifyLandPacket)packet;
343
344 switch (modify.ModifyBlock.Action)
345 {
346 case 1:
347 // raise terrain
348 if (modify.ParcelData.Length > 0)
349 {
350 Terrain.raise(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1);
351 RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West);
352 }
353 break;
354 case 2:
355 //lower terrain
356 if (modify.ParcelData.Length > 0)
357 {
358 Terrain.lower(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1);
359 RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West);
360 }
361 break;
362 }
363 return true;
364 }
365 */
366
367 }
368}
diff --git a/OpenSim/OpenSim.RegionServer/world/World.Scripting.cs b/OpenSim/OpenSim.RegionServer/world/World.Scripting.cs
new file mode 100644
index 0000000..44ef05a
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/World.Scripting.cs
@@ -0,0 +1,124 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.IO;
5using System.Reflection;
6using OpenSim.Framework;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Types;
9using libsecondlife;
10
11namespace OpenSim.world
12{
13 public partial class World
14 {
15 private Dictionary<string, IScriptEngine> scriptEngines = new Dictionary<string, IScriptEngine>();
16
17 private void LoadScriptEngines()
18 {
19 this.LoadScriptPlugins();
20 }
21
22 public void LoadScriptPlugins()
23 {
24 string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "ScriptEngines");
25 string[] pluginFiles = Directory.GetFiles(path, "*.dll");
26
27
28 for (int i = 0; i < pluginFiles.Length; i++)
29 {
30 this.AddPlugin(pluginFiles[i]);
31 }
32 }
33
34 private void AddPlugin(string FileName)
35 {
36 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
37
38 foreach (Type pluginType in pluginAssembly.GetTypes())
39 {
40 if (pluginType.IsPublic)
41 {
42 if (!pluginType.IsAbstract)
43 {
44 Type typeInterface = pluginType.GetInterface("IScriptEngine", true);
45
46 if (typeInterface != null)
47 {
48 IScriptEngine plug = (IScriptEngine)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
49 plug.Init(this);
50 this.scriptEngines.Add(plug.GetName(), plug);
51
52 }
53
54 typeInterface = null;
55 }
56 }
57 }
58
59 pluginAssembly = null;
60 }
61
62 public void LoadScript(string scriptType, string scriptName, string script, Entity ent)
63 {
64 if(this.scriptEngines.ContainsKey(scriptType))
65 {
66 this.scriptEngines[scriptType].LoadScript(script, scriptName, ent.localid);
67 }
68 }
69
70 #region IScriptAPI Methods
71
72 public OSVector3 GetEntityPosition(uint localID)
73 {
74 OSVector3 res = new OSVector3();
75 // Console.WriteLine("script- getting entity " + localID + " position");
76 foreach (Entity entity in this.Entities.Values)
77 {
78 if (entity.localid == localID)
79 {
80 res.X = entity.Pos.X;
81 res.Y = entity.Pos.Y;
82 res.Z = entity.Pos.Z;
83 }
84 }
85 return res;
86 }
87
88 public void SetEntityPosition(uint localID, float x , float y, float z)
89 {
90 foreach (Entity entity in this.Entities.Values)
91 {
92 if (entity.localid == localID && entity is Primitive)
93 {
94 LLVector3 pos = entity.Pos;
95 pos.X = x;
96 pos.Y = y;
97 Primitive prim = entity as Primitive;
98 // Of course, we really should have asked the physEngine if this is possible, and if not, returned false.
99 prim.UpdatePosition(pos);
100 // Console.WriteLine("script- setting entity " + localID + " positon");
101 }
102 }
103
104 }
105
106 public uint GetRandomAvatarID()
107 {
108 //Console.WriteLine("script- getting random avatar id");
109 uint res = 0;
110 foreach (Entity entity in this.Entities.Values)
111 {
112 if (entity is Avatar)
113 {
114 res = entity.localid;
115 }
116 }
117 return res;
118 }
119
120 #endregion
121
122
123 }
124}
diff --git a/OpenSim/OpenSim.RegionServer/world/World.cs b/OpenSim/OpenSim.RegionServer/world/World.cs
new file mode 100644
index 0000000..bb24011
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/World.cs
@@ -0,0 +1,657 @@
1using System;
2using libsecondlife;
3using libsecondlife.Packets;
4using System.Collections.Generic;
5using System.Text;
6using System.Reflection;
7using System.IO;
8using System.Threading;
9using OpenSim.Physics.Manager;
10using OpenSim.Framework.Interfaces;
11using OpenSim.Framework.Types;
12using OpenSim.Framework.Terrain;
13using OpenSim.Framework.Inventory;
14using OpenSim.Assets;
15//using OpenSim.world.scripting;
16using OpenSim.RegionServer.world.scripting;
17using OpenSim.Terrain;
18
19namespace OpenSim.world
20{
21 public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI
22 {
23 public object LockPhysicsEngine = new object();
24 public Dictionary<libsecondlife.LLUUID, Avatar> Avatars;
25 public Dictionary<libsecondlife.LLUUID, Primitive> Prims;
26 //public ScriptEngine Scripts;
27 public uint _localNumber = 0;
28 private PhysicsScene phyScene;
29 private float timeStep = 0.1f;
30 public ILocalStorage localStorage;
31 private Random Rand = new Random();
32 private uint _primCount = 702000;
33 private int storageCount;
34 private Dictionary<LLUUID, ScriptHandler> m_scriptHandlers;
35 private Dictionary<string, ScriptFactory> m_scripts;
36 private Mutex updateLock;
37 public string m_datastore;
38
39 #region Properties
40 public PhysicsScene PhysScene
41 {
42 set
43 {
44 this.phyScene = value;
45 }
46 get
47 {
48 return (this.phyScene);
49 }
50 }
51 #endregion
52
53 #region Constructors
54 /// <summary>
55 /// Creates a new World class, and a region to go with it.
56 /// </summary>
57 /// <param name="clientThreads">Dictionary to contain client threads</param>
58 /// <param name="regionHandle">Region Handle for this region</param>
59 /// <param name="regionName">Region Name for this region</param>
60 public World(Dictionary<uint, ClientView> clientThreads, RegionInfo regInfo, ulong regionHandle, string regionName)
61 {
62 try
63 {
64 updateLock = new Mutex(false);
65 m_clientThreads = clientThreads;
66 m_regionHandle = regionHandle;
67 m_regionName = regionName;
68 m_regInfo = regInfo;
69
70 m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>();
71 m_scripts = new Dictionary<string, ScriptFactory>();
72
73 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs - creating new entitities instance");
74 Entities = new Dictionary<libsecondlife.LLUUID, Entity>();
75 Avatars = new Dictionary<LLUUID, Avatar>();
76 Prims = new Dictionary<LLUUID, Primitive>();
77
78 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs - creating LandMap");
79 TerrainManager = new TerrainManager(new SecondLife());
80 Terrain = new TerrainEngine();
81 Avatar.SetupTemplate("avatar-texture.dat");
82 // MainConsole.Instance.WriteLine("World.cs - Creating script engine instance");
83 // Initialise this only after the world has loaded
84 // Scripts = new ScriptEngine(this);
85 Avatar.LoadAnims();
86 this.SetDefaultScripts();
87 this.LoadScriptEngines();
88 }
89 catch (Exception e)
90 {
91 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "World.cs: Constructor failed with exception " + e.ToString());
92 }
93 }
94 #endregion
95
96 #region Script Methods
97 /// <summary>
98 /// Loads a new script into the specified entity
99 /// </summary>
100 /// <param name="entity">Entity to be scripted</param>
101 /// <param name="script">The script to load</param>
102 public void AddScript(Entity entity, Script script)
103 {
104 try
105 {
106 ScriptHandler scriptHandler = new ScriptHandler(script, entity, this);
107 m_scriptHandlers.Add(scriptHandler.ScriptId, scriptHandler);
108 }
109 catch (Exception e)
110 {
111 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddScript() - Failed with exception " + e.ToString());
112 }
113 }
114
115 /// <summary>
116 /// Loads a new script into the specified entity, using a script loaded from a string.
117 /// </summary>
118 /// <param name="entity">The entity to be scripted</param>
119 /// <param name="scriptData">The string containing the script</param>
120 public void AddScript(Entity entity, string scriptData)
121 {
122 try
123 {
124 int scriptstart = 0;
125 int scriptend = 0;
126 string substring;
127 scriptstart = scriptData.LastIndexOf("<Script>");
128 scriptend = scriptData.LastIndexOf("</Script>");
129 substring = scriptData.Substring(scriptstart + 8, scriptend - scriptstart - 8);
130 substring = substring.Trim();
131 //Console.WriteLine("searching for script to add: " + substring);
132
133 ScriptFactory scriptFactory;
134 //Console.WriteLine("script string is " + substring);
135 if (substring.StartsWith("<ScriptEngine:"))
136 {
137 string substring1 = "";
138 string script = "";
139 // Console.WriteLine("searching for script engine");
140 substring1 = substring.Remove(0, 14);
141 int dev = substring1.IndexOf(',');
142 string sEngine = substring1.Substring(0, dev);
143 substring1 = substring1.Remove(0, dev + 1);
144 int end = substring1.IndexOf('>');
145 string sName = substring1.Substring(0, end);
146 //Console.WriteLine(" script info : " + sEngine + " , " + sName);
147 int startscript = substring.IndexOf('>');
148 script = substring.Remove(0, startscript + 1);
149 // Console.WriteLine("script data is " + script);
150 if (this.scriptEngines.ContainsKey(sEngine))
151 {
152 this.scriptEngines[sEngine].LoadScript(script, sName, entity.localid);
153 }
154 }
155 else if (this.m_scripts.TryGetValue(substring, out scriptFactory))
156 {
157 //Console.WriteLine("added script");
158 this.AddScript(entity, scriptFactory());
159 }
160 }
161 catch (Exception e)
162 {
163 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddScript() - Failed with exception " + e.ToString());
164 }
165 }
166
167 #endregion
168
169 #region Update Methods
170 /// <summary>
171 /// Performs per-frame updates on the world, this should be the central world loop
172 /// </summary>
173 public override void Update()
174 {
175 updateLock.WaitOne();
176 try
177 {
178 if (this.phyScene.IsThreaded)
179 {
180 this.phyScene.GetResults();
181
182 }
183
184 foreach (libsecondlife.LLUUID UUID in Entities.Keys)
185 {
186 Entities[UUID].addForces();
187 }
188
189 lock (this.LockPhysicsEngine)
190 {
191 this.phyScene.Simulate(timeStep);
192 }
193
194 foreach (libsecondlife.LLUUID UUID in Entities.Keys)
195 {
196 Entities[UUID].update();
197 }
198
199 foreach (ScriptHandler scriptHandler in m_scriptHandlers.Values)
200 {
201 scriptHandler.OnFrame();
202 }
203 foreach (IScriptEngine scripteng in this.scriptEngines.Values)
204 {
205 scripteng.OnFrame();
206 }
207 //backup world data
208 this.storageCount++;
209 if (storageCount > 1200) //set to how often you want to backup
210 {
211 this.Backup();
212 storageCount = 0;
213 }
214 }
215 catch (Exception e)
216 {
217 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: Update() - Failed with exception " + e.ToString());
218 }
219 updateLock.ReleaseMutex();
220 }
221
222 public bool Backup()
223 {
224 try
225 {
226 // Terrain backup routines
227 if (Terrain.tainted > 0)
228 {
229 Terrain.tainted = 0;
230 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Terrain tainted, saving.");
231 localStorage.SaveMap(Terrain.getHeights1D());
232 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Terrain saved, informing Physics.");
233 lock (this.LockPhysicsEngine)
234 {
235 phyScene.SetTerrain(Terrain.getHeights1D());
236 }
237 }
238
239 // Primitive backup routines
240 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Backing up Primitives");
241 foreach (libsecondlife.LLUUID UUID in Entities.Keys)
242 {
243 Entities[UUID].BackUp();
244 }
245
246 // Backup successful
247 return true;
248 }
249 catch (Exception e)
250 {
251 // Backup failed
252 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "World.cs: Backup() - Backup Failed with exception " + e.ToString());
253 return false;
254 }
255 }
256 #endregion
257
258 #region Setup Methods
259 /// <summary>
260 /// Loads a new storage subsystem from a named library
261 /// </summary>
262 /// <param name="dllName">Storage Library</param>
263 /// <returns>Successful or not</returns>
264 public bool LoadStorageDLL(string dllName)
265 {
266 try
267 {
268 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
269 ILocalStorage store = null;
270
271 foreach (Type pluginType in pluginAssembly.GetTypes())
272 {
273 if (pluginType.IsPublic)
274 {
275 if (!pluginType.IsAbstract)
276 {
277 Type typeInterface = pluginType.GetInterface("ILocalStorage", true);
278
279 if (typeInterface != null)
280 {
281 ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
282 store = plug;
283
284 store.Initialise(this.m_datastore);
285 break;
286 }
287
288 typeInterface = null;
289 }
290 }
291 }
292 pluginAssembly = null;
293 this.localStorage = store;
294 return (store == null);
295 }
296 catch (Exception e)
297 {
298 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: LoadStorageDLL() - Failed with exception " + e.ToString());
299 return false;
300 }
301 }
302
303 public void SetDefaultScripts()
304 {
305 this.m_scripts.Add("FollowRandomAvatar", delegate()
306 {
307 return new OpenSim.RegionServer.world.scripting.FollowRandomAvatar();
308 });
309 }
310
311 #endregion
312
313 #region Regenerate Terrain
314
315 /// <summary>
316 /// Rebuilds the terrain using a procedural algorithm
317 /// </summary>
318 public void RegenerateTerrain()
319 {
320 try
321 {
322 Terrain.hills();
323
324 lock (this.LockPhysicsEngine)
325 {
326 this.phyScene.SetTerrain(Terrain.getHeights1D());
327 }
328 this.localStorage.SaveMap(this.Terrain.getHeights1D());
329
330 foreach (ClientView client in m_clientThreads.Values)
331 {
332 this.SendLayerData(client);
333 }
334
335 foreach (libsecondlife.LLUUID UUID in Entities.Keys)
336 {
337 Entities[UUID].LandRenegerated();
338 }
339 }
340 catch (Exception e)
341 {
342 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString());
343 }
344 }
345
346 /// <summary>
347 /// Rebuilds the terrain using a 2D float array
348 /// </summary>
349 /// <param name="newMap">256,256 float array containing heights</param>
350 public void RegenerateTerrain(float[,] newMap)
351 {
352 try
353 {
354 this.Terrain.setHeights2D(newMap);
355 lock (this.LockPhysicsEngine)
356 {
357 this.phyScene.SetTerrain(this.Terrain.getHeights1D());
358 }
359 this.localStorage.SaveMap(this.Terrain.getHeights1D());
360
361 foreach (ClientView client in m_clientThreads.Values)
362 {
363 this.SendLayerData(client);
364 }
365
366 foreach (libsecondlife.LLUUID UUID in Entities.Keys)
367 {
368 Entities[UUID].LandRenegerated();
369 }
370 }
371 catch (Exception e)
372 {
373 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString());
374 }
375 }
376
377 /// <summary>
378 /// Rebuilds the terrain assuming changes occured at a specified point[?]
379 /// </summary>
380 /// <param name="changes">???</param>
381 /// <param name="pointx">???</param>
382 /// <param name="pointy">???</param>
383 public void RegenerateTerrain(bool changes, int pointx, int pointy)
384 {
385 try
386 {
387 if (changes)
388 {
389 /* Dont save here, rely on tainting system instead */
390
391 foreach (ClientView client in m_clientThreads.Values)
392 {
393 this.SendLayerData(pointx, pointy, client);
394 }
395 }
396 }
397 catch (Exception e)
398 {
399 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString());
400 }
401 }
402
403 #endregion
404
405 #region Load Terrain
406 /// <summary>
407 /// Loads the World heightmap
408 /// </summary>
409 public override void LoadWorldMap()
410 {
411 try
412 {
413 float[] map = this.localStorage.LoadWorld();
414 if (map == null)
415 {
416 Console.WriteLine("creating new terrain");
417 this.Terrain.hills();
418
419 this.localStorage.SaveMap(this.Terrain.getHeights1D());
420 }
421 else
422 {
423 this.Terrain.setHeights1D(map);
424 }
425 }
426 catch (Exception e)
427 {
428 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: LoadWorldMap() - Failed with exception " + e.ToString());
429 }
430 }
431 #endregion
432
433 #region Primitives Methods
434
435 /// <summary>
436 /// Sends prims to a client
437 /// </summary>
438 /// <param name="RemoteClient">Client to send to</param>
439 public void GetInitialPrims(ClientView RemoteClient)
440 {
441 try
442 {
443 foreach (libsecondlife.LLUUID UUID in Entities.Keys)
444 {
445 if (Entities[UUID] is Primitive)
446 {
447 Primitive primitive = Entities[UUID] as Primitive;
448 primitive.UpdateClient(RemoteClient);
449 }
450 }
451 }
452 catch (Exception e)
453 {
454 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: GetInitialPrims() - Failed with exception " + e.ToString());
455 }
456 }
457
458 /// <summary>
459 /// Loads the World's objects
460 /// </summary>
461 public void LoadPrimsFromStorage()
462 {
463 try
464 {
465 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: LoadPrimsFromStorage() - Loading primitives");
466 this.localStorage.LoadPrimitives(this);
467 }
468 catch (Exception e)
469 {
470 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: LoadPrimsFromStorage() - Failed with exception " + e.ToString());
471 }
472 }
473
474 /// <summary>
475 /// Loads a specific object from storage
476 /// </summary>
477 /// <param name="prim">The object to load</param>
478 public void PrimFromStorage(PrimData prim)
479 {
480 try
481 {
482 if (prim.LocalID >= this._primCount)
483 {
484 _primCount = prim.LocalID + 1;
485 }
486 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: PrimFromStorage() - Reloading prim (localId " + prim.LocalID + " ) from storage");
487 Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
488 nPrim.CreateFromStorage(prim);
489 this.Entities.Add(nPrim.uuid, nPrim);
490 }
491 catch (Exception e)
492 {
493 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: PrimFromStorage() - Failed with exception " + e.ToString());
494 }
495 }
496
497 public void AddNewPrim(Packet addPacket, ClientView agentClient)
498 {
499 AddNewPrim((ObjectAddPacket)addPacket, agentClient.AgentID);
500 }
501
502 public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID)
503 {
504 try
505 {
506 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: AddNewPrim() - Creating new prim");
507 Primitive prim = new Primitive(m_clientThreads, m_regionHandle, this);
508 prim.CreateFromPacket(addPacket, ownerID, this._primCount);
509 PhysicsVector pVec = new PhysicsVector(prim.Pos.X, prim.Pos.Y, prim.Pos.Z);
510 PhysicsVector pSize = new PhysicsVector(0.255f, 0.255f, 0.255f);
511 if (OpenSim.world.Avatar.PhysicsEngineFlying)
512 {
513 lock (this.LockPhysicsEngine)
514 {
515 prim.PhysActor = this.phyScene.AddPrim(pVec, pSize);
516 }
517 }
518
519 this.Entities.Add(prim.uuid, prim);
520 this._primCount++;
521 }
522 catch (Exception e)
523 {
524 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddNewPrim() - Failed with exception " + e.ToString());
525 }
526 }
527
528 #endregion
529
530 #region Add/Remove Avatar Methods
531
532 public override Avatar AddViewerAgent(ClientView agentClient)
533 {
534 //register for events
535 agentClient.OnChatFromViewer += new ChatFromViewer(this.SimChat);
536 agentClient.OnRezObject += new RezObject(this.RezObject);
537 agentClient.OnModifyTerrain += new ModifyTerrain(this.ModifyTerrain);
538 agentClient.OnRegionHandShakeReply += new ClientView.GenericCall(this.SendLayerData);
539 agentClient.OnRequestWearables += new ClientView.GenericCall(this.GetInitialPrims);
540 agentClient.OnRequestAvatarsData += new ClientView.GenericCall(this.SendAvatarsToClient);
541 agentClient.OnLinkObjects += new LinkObjects(this.LinkObjects);
542 agentClient.OnAddPrim += new ClientView.GenericCall4(this.AddNewPrim);
543 agentClient.OnUpdatePrimShape += new ClientView.UpdateShape(this.UpdatePrimShape);
544 agentClient.OnObjectSelect += new ClientView.ObjectSelect(this.SelectPrim);
545 agentClient.OnUpdatePrimFlags += new ClientView.UpdatePrimFlags(this.UpdatePrimFlags);
546 agentClient.OnUpdatePrimTexture += new ClientView.UpdatePrimTexture(this.UpdatePrimTexture);
547 agentClient.OnUpdatePrimPosition += new ClientView.UpdatePrimVector(this.UpdatePrimPosition);
548 agentClient.OnUpdatePrimRotation += new ClientView.UpdatePrimRotation(this.UpdatePrimRotation);
549 agentClient.OnUpdatePrimScale += new ClientView.UpdatePrimVector(this.UpdatePrimScale);
550 agentClient.OnDeRezObject += new ClientView.GenericCall4(this.DeRezObject);
551 Avatar newAvatar = null;
552 try
553 {
554 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
555 newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle, true, 20);
556 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Adding new avatar to world");
557 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake ");
558 newAvatar.SendRegionHandshake(this);
559 //if (!agentClient.m_child)
560 //{
561
562 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
563 lock (this.LockPhysicsEngine)
564 {
565 newAvatar.PhysActor = this.phyScene.AddAvatar(pVec);
566 }
567 // }
568 lock (Entities)
569 {
570 if (!Entities.ContainsKey(agentClient.AgentID))
571 {
572 this.Entities.Add(agentClient.AgentID, newAvatar);
573 }
574 else
575 {
576 Entities[agentClient.AgentID] = newAvatar;
577 }
578 }
579 lock (Avatars)
580 {
581 if (Avatars.ContainsKey(agentClient.AgentID))
582 {
583 Avatars[agentClient.AgentID] = newAvatar;
584 }
585 else
586 {
587 this.Avatars.Add(agentClient.AgentID, newAvatar);
588 }
589 }
590 }
591 catch (Exception e)
592 {
593 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddViewerAgent() - Failed with exception " + e.ToString());
594 }
595 return newAvatar;
596 }
597
598 public override void RemoveViewerAgent(ClientView agentClient)
599 {
600 try
601 {
602 lock (Entities)
603 {
604 Entities.Remove(agentClient.AgentID);
605 }
606 lock (Avatars)
607 {
608 Avatars.Remove(agentClient.AgentID);
609 }
610 if (agentClient.ClientAvatar.PhysActor != null)
611 {
612 this.phyScene.RemoveAvatar(agentClient.ClientAvatar.PhysActor);
613 }
614 }
615 catch (Exception e)
616 {
617 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: RemoveViewerAgent() - Failed with exception " + e.ToString());
618 }
619 }
620 #endregion
621
622 #region Request Avatars List Methods
623 //The idea is to have a group of method that return a list of avatars meeting some requirement
624 // ie it could be all Avatars within a certain range of the calling prim/avatar.
625
626 public List<Avatar> RequestAvatarList()
627 {
628 List<Avatar> result = new List<Avatar>();
629
630 foreach (Avatar avatar in Avatars.Values)
631 {
632 result.Add(avatar);
633 }
634
635 return result;
636 }
637 #endregion
638
639 #region ShutDown
640 /// <summary>
641 /// Tidy before shutdown
642 /// </summary>
643 public override void Close()
644 {
645 try
646 {
647 this.localStorage.ShutDown();
648 }
649 catch (Exception e)
650 {
651 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "World.cs: Close() - Failed with exception " + e.ToString());
652 }
653 }
654 #endregion
655
656 }
657}
diff --git a/OpenSim/OpenSim.RegionServer/world/WorldBase.cs b/OpenSim/OpenSim.RegionServer/world/WorldBase.cs
new file mode 100644
index 0000000..ea71411
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/WorldBase.cs
@@ -0,0 +1,176 @@
1using System;
2using libsecondlife;
3using libsecondlife.Packets;
4using System.Collections.Generic;
5using System.Text;
6using System.Reflection;
7using System.IO;
8using System.Threading;
9using OpenSim.Physics.Manager;
10using OpenSim.Framework.Interfaces;
11using OpenSim.Framework.Types;
12using OpenSim.Framework.Terrain;
13using OpenSim.Framework.Inventory;
14using OpenSim.Assets;
15using OpenSim.RegionServer.world.scripting;
16using OpenSim.Terrain;
17
18namespace OpenSim.world
19{
20 public class WorldBase
21 {
22 public Dictionary<libsecondlife.LLUUID, Entity> Entities;
23 protected Dictionary<uint, ClientView> m_clientThreads;
24 protected ulong m_regionHandle;
25 protected string m_regionName;
26 protected InventoryCache _inventoryCache;
27 protected AssetCache _assetCache;
28 protected RegionInfo m_regInfo;
29
30 public TerrainEngine Terrain; //TODO: Replace TerrainManager with this.
31 protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine
32
33 #region Properties
34 public InventoryCache InventoryCache
35 {
36 set
37 {
38 this._inventoryCache = value;
39 }
40 }
41
42 public AssetCache AssetCache
43 {
44 set
45 {
46 this._assetCache = value;
47 }
48 }
49 #endregion
50
51 #region Constructors
52 public WorldBase()
53 {
54
55 }
56 #endregion
57
58 #region Setup Methods
59 /// <summary>
60 /// Register Packet handler Methods with the packet server (which will register them with the SimClient)
61 /// </summary>
62 /// <param name="packetServer"></param>
63 public virtual void RegisterPacketHandlers(PacketServer packetServer)
64 {
65
66 }
67 #endregion
68
69 #region Update Methods
70 /// <summary>
71 /// Normally called once every frame/tick to let the world preform anything required (like running the physics simulation)
72 /// </summary>
73 public virtual void Update()
74 {
75
76 }
77 #endregion
78
79 #region Terrain Methods
80
81 /// <summary>
82 /// Loads the World heightmap
83 /// </summary>
84 public virtual void LoadWorldMap()
85 {
86
87 }
88
89 /// <summary>
90 /// Send the region heightmap to the client
91 /// </summary>
92 /// <param name="RemoteClient">Client to send to</param>
93 public virtual void SendLayerData(ClientView RemoteClient)
94 {
95 try
96 {
97 int[] patches = new int[4];
98
99 for (int y = 0; y < 16; y++)
100 {
101 for (int x = 0; x < 16; x = x + 4)
102 {
103 patches[0] = x + 0 + y * 16;
104 patches[1] = x + 1 + y * 16;
105 patches[2] = x + 2 + y * 16;
106 patches[3] = x + 3 + y * 16;
107
108 Packet layerpack = TerrainManager.CreateLandPacket(Terrain.getHeights1D(), patches);
109 RemoteClient.OutPacket(layerpack);
110 }
111 }
112 }
113 catch (Exception e)
114 {
115 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: SendLayerData() - Failed with exception " + e.ToString());
116 }
117 }
118
119 /// <summary>
120 /// Sends a specified patch to a client
121 /// </summary>
122 /// <param name="px">Patch coordinate (x) 0..16</param>
123 /// <param name="py">Patch coordinate (y) 0..16</param>
124 /// <param name="RemoteClient">The client to send to</param>
125 public void SendLayerData(int px, int py, ClientView RemoteClient)
126 {
127 try
128 {
129 int[] patches = new int[1];
130 int patchx, patchy;
131 patchx = px / 16;
132 patchy = py / 16;
133
134 patches[0] = patchx + 0 + patchy * 16;
135
136 Packet layerpack = TerrainManager.CreateLandPacket(Terrain.getHeights1D(), patches);
137 RemoteClient.OutPacket(layerpack);
138 }
139 catch (Exception e)
140 {
141 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: SendLayerData() - Failed with exception " + e.ToString());
142 }
143 }
144 #endregion
145
146 #region Add/Remove Agent/Avatar
147 /// <summary>
148 /// Add a new Agent's avatar
149 /// </summary>
150 /// <param name="agentClient"></param>
151 public virtual Avatar AddViewerAgent(ClientView agentClient)
152 {
153 return null;
154 }
155
156 /// <summary>
157 /// Remove a Agent's avatar
158 /// </summary>
159 /// <param name="agentClient"></param>
160 public virtual void RemoveViewerAgent(ClientView agentClient)
161 {
162
163 }
164 #endregion
165
166 #region Shutdown
167 /// <summary>
168 /// Tidy before shutdown
169 /// </summary>
170 public virtual void Close()
171 {
172
173 }
174 #endregion
175 }
176}
diff --git a/OpenSim/OpenSim.RegionServer/world/scripting/IScriptContext.cs b/OpenSim/OpenSim.RegionServer/world/scripting/IScriptContext.cs
new file mode 100644
index 0000000..465c23b
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/scripting/IScriptContext.cs
@@ -0,0 +1,13 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.RegionServer.world.scripting
7{
8 public interface IScriptContext
9 {
10 IScriptEntity Entity { get; }
11 bool TryGetRandomAvatar(out IScriptReadonlyEntity avatar);
12 }
13}
diff --git a/OpenSim/OpenSim.RegionServer/world/scripting/IScriptEntity.cs b/OpenSim/OpenSim.RegionServer/world/scripting/IScriptEntity.cs
new file mode 100644
index 0000000..2ef16a4
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/scripting/IScriptEntity.cs
@@ -0,0 +1,19 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.RegionServer.world.scripting
7{
8 public interface IScriptReadonlyEntity
9 {
10 LLVector3 Pos { get; }
11 string Name { get; }
12 }
13
14 public interface IScriptEntity
15 {
16 LLVector3 Pos { get; set; }
17 string Name { get; }
18 }
19}
diff --git a/OpenSim/OpenSim.RegionServer/world/scripting/IScriptHandler.cs b/OpenSim/OpenSim.RegionServer/world/scripting/IScriptHandler.cs
new file mode 100644
index 0000000..15efc49
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/scripting/IScriptHandler.cs
@@ -0,0 +1,98 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using OpenSim.Physics.Manager;
6using OpenSim.world;
7using Avatar=OpenSim.world.Avatar;
8using Primitive = OpenSim.world.Primitive;
9
10namespace OpenSim.RegionServer.world.scripting
11{
12 public delegate void ScriptEventHandler(IScriptContext context);
13
14 public class ScriptHandler : IScriptContext, IScriptEntity, IScriptReadonlyEntity
15 {
16 private World m_world;
17 private Script m_script;
18 private Entity m_entity;
19
20 public LLUUID ScriptId
21 {
22 get
23 {
24 return m_script.ScriptId;
25 }
26 }
27
28 public void OnFrame()
29 {
30 m_script.OnFrame(this);
31 }
32
33 public ScriptHandler(Script script, Entity entity, World world)
34 {
35 m_script = script;
36 m_entity = entity;
37 m_world = world;
38 }
39
40 #region IScriptContext Members
41
42 IScriptEntity IScriptContext.Entity
43 {
44 get
45 {
46 return this;
47 }
48 }
49
50 bool IScriptContext.TryGetRandomAvatar(out IScriptReadonlyEntity avatar)
51 {
52 foreach (Entity entity in m_world.Entities.Values )
53 {
54 if( entity is Avatar )
55 {
56 avatar = entity;
57 return true;
58 }
59 }
60
61 avatar = null;
62 return false;
63 }
64
65 #endregion
66
67 #region IScriptEntity and IScriptReadonlyEntity Members
68
69 public string Name
70 {
71 get
72 {
73 return m_entity.Name;
74 }
75 }
76
77 public LLVector3 Pos
78 {
79 get
80 {
81 return m_entity.Pos;
82 }
83
84 set
85 {
86 if (m_entity is Primitive)
87 {
88 Primitive prim = m_entity as Primitive;
89 // Of course, we really should have asked the physEngine if this is possible, and if not, returned false.
90 prim.UpdatePosition( value );
91 }
92 }
93 }
94
95 #endregion
96 }
97
98}
diff --git a/OpenSim/OpenSim.RegionServer/world/scripting/Script.cs b/OpenSim/OpenSim.RegionServer/world/scripting/Script.cs
new file mode 100644
index 0000000..48c18ff
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/scripting/Script.cs
@@ -0,0 +1,26 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.RegionServer.world.scripting
7{
8 public class Script
9 {
10 private LLUUID m_scriptId;
11 public virtual LLUUID ScriptId
12 {
13 get
14 {
15 return m_scriptId;
16 }
17 }
18
19 public Script( LLUUID scriptId )
20 {
21 m_scriptId = scriptId;
22 }
23
24 public ScriptEventHandler OnFrame;
25 }
26}
diff --git a/OpenSim/OpenSim.RegionServer/world/scripting/ScriptFactory.cs b/OpenSim/OpenSim.RegionServer/world/scripting/ScriptFactory.cs
new file mode 100644
index 0000000..4c6d373
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/scripting/ScriptFactory.cs
@@ -0,0 +1,8 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.RegionServer.world.scripting
6{
7 public delegate Script ScriptFactory();
8}
diff --git a/OpenSim/OpenSim.RegionServer/world/scripting/Scripts/FollowRandomAvatar.cs b/OpenSim/OpenSim.RegionServer/world/scripting/Scripts/FollowRandomAvatar.cs
new file mode 100644
index 0000000..6a689ab
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/world/scripting/Scripts/FollowRandomAvatar.cs
@@ -0,0 +1,37 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.RegionServer.world.scripting
7{
8 public class FollowRandomAvatar : Script
9 {
10 public FollowRandomAvatar()
11 : base(LLUUID.Random())
12 {
13 OnFrame += MyOnFrame;
14 }
15
16 private void MyOnFrame(IScriptContext context)
17 {
18 LLVector3 pos = context.Entity.Pos;
19
20 IScriptReadonlyEntity avatar;
21
22 if (context.TryGetRandomAvatar(out avatar))
23 {
24 LLVector3 avatarPos = avatar.Pos;
25
26 float x = pos.X + ((float)avatarPos.X.CompareTo(pos.X)) / 2;
27 float y = pos.Y + ((float)avatarPos.Y.CompareTo(pos.Y)) / 2;
28
29 LLVector3 newPos = new LLVector3(x, y, pos.Z);
30
31 context.Entity.Pos = newPos;
32 }
33 }
34 }
35
36
37}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassInstance.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassInstance.cs
new file mode 100644
index 0000000..15ef814
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassInstance.cs
@@ -0,0 +1,18 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Scripting.EmbeddedJVM.Types;
5
6namespace OpenSim.Scripting.EmbeddedJVM
7{
8 public class ClassInstance : Object
9 {
10 public int size;
11 public Dictionary<string, BaseType> Fields = new Dictionary<string, BaseType>();
12
13 public ClassInstance()
14 {
15
16 }
17 }
18}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassRecord.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassRecord.cs
new file mode 100644
index 0000000..f2f0da5
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/ClassRecord.cs
@@ -0,0 +1,476 @@
1using System;
2using System.IO;
3using System.Collections.Generic;
4using System.Text;
5using OpenSim.Scripting.EmbeddedJVM.Types;
6
7namespace OpenSim.Scripting.EmbeddedJVM
8{
9 public class ClassRecord
10 {
11 private ushort _majorVersion;
12 private ushort _minorVersion;
13 private ushort _constantPoolCount;
14 private ushort _accessFlags;
15 private ushort _thisClass;
16 private ushort _supperClass;
17 private ushort _interfaceCount;
18 private ushort _fieldCount;
19 private ushort _methodCount;
20 //private ushort _attributeCount;
21 //private string _name;
22 public Dictionary<string, BaseType> StaticFields = new Dictionary<string, BaseType>();
23 public PoolClass mClass;
24
25 public List<PoolItem> _constantsPool = new List<PoolItem>();
26 private List<MethodInfo> _methodsList = new List<MethodInfo>();
27 private List<FieldInfo> _fieldList = new List<FieldInfo>();
28
29 public ClassRecord()
30 {
31
32 }
33
34 public ClassInstance CreateNewInstance()
35 {
36 return new ClassInstance();
37 }
38
39 public void LoadClassFromFile(string fileName)
40 {
41 Console.WriteLine("loading script " + fileName);
42 FileStream fs = File.OpenRead(fileName);
43 this.LoadClassFromBytes(ReadFully(fs));
44 fs.Close();
45 }
46
47 public void LoadClassFromBytes(byte[] data)
48 {
49 int i = 0;
50 i += 4;
51 _minorVersion = (ushort)((data[i++] << 8) + data[i++] );
52 _majorVersion = (ushort)((data[i++] << 8) + data[i++] );
53 _constantPoolCount = (ushort)((data[i++] << 8) + data[i++] );
54 // Console.WriteLine("there should be " + _constantPoolCount + " items in the pool");
55 for (int count = 0; count < _constantPoolCount -1 ; count++)
56 {
57 //read in the constant pool
58 byte pooltype = data[i++];
59 //Console.WriteLine("#" +count +": new constant type = " +pooltype);
60 //Console.WriteLine("start position is: " + i);
61 switch (pooltype)
62 {
63 case 1: //Utf8
64 ushort uLength = (ushort)((data[i++] << 8) + data[i++] );
65
66 // Console.WriteLine("new utf8 type, length is " + uLength);
67 PoolUtf8 utf8 = new PoolUtf8();
68 utf8.readValue(data, ref i, uLength);
69 this._constantsPool.Add(utf8);
70 break;
71 case 3: //Int
72 break;
73 case 7: //Class
74 PoolClass pClass = new PoolClass(this);
75 pClass.readValue(data, ref i);
76 this._constantsPool.Add(pClass);
77 break;
78 case 10: //Method
79 PoolMethodRef pMeth = new PoolMethodRef(this);
80 pMeth.readValue(data, ref i);
81 this._constantsPool.Add(pMeth);
82 break;
83 case 12: //NamedType
84 PoolNamedType pNamed = new PoolNamedType(this);
85 pNamed.readValue(data, ref i);
86 this._constantsPool.Add(pNamed);
87 break;
88 }
89 }
90
91 _accessFlags = (ushort)((data[i++] << 8) + data[i++] );
92 _thisClass = (ushort)((data[i++] << 8) + data[i++] );
93 _supperClass = (ushort)((data[i++] << 8) + data[i++] );
94
95 if (this._constantsPool[this._thisClass - 1] is PoolClass)
96 {
97 this.mClass = ((PoolClass)this._constantsPool[this._thisClass - 1]);
98 }
99
100 _interfaceCount = (ushort)((data[i++] << 8) + data[i++]);
101 //should now read in the info for each interface
102 _fieldCount = (ushort)((data[i++] << 8) + data[i++]);
103 //should now read in the info for each field
104 _methodCount = (ushort)((data[i++] << 8) + data[i++]);
105 for (int count = 0; count < _methodCount; count++)
106 {
107 MethodInfo methInf = new MethodInfo(this);
108 methInf.ReadData(data, ref i);
109 this._methodsList.Add(methInf);
110 }
111 }
112
113 public void AddMethodsToMemory(MethodMemory memory)
114 {
115 for (int count = 0; count < _methodCount; count++)
116 {
117 this._methodsList[count].AddMethodCode(memory);
118 }
119 }
120
121 public bool StartMethod(Thread thread, string methodName)
122 {
123 for (int count = 0; count < _methodCount; count++)
124 {
125 if (this._constantsPool[this._methodsList[count].NameIndex-1] is PoolUtf8)
126 {
127 if (((PoolUtf8)this._constantsPool[this._methodsList[count].NameIndex-1]).Value == methodName)
128 {
129 //Console.WriteLine("found method: " + ((PoolUtf8)this._constantsPool[this._methodsList[count].NameIndex - 1]).Value);
130 thread.SetPC(this._methodsList[count].CodePointer);
131 return true;
132 }
133 }
134 }
135 return false;
136 }
137
138 public void PrintToConsole()
139 {
140 Console.WriteLine("Class File:");
141 Console.WriteLine("Major version: " + _majorVersion);
142 Console.WriteLine("Minor version: " + _minorVersion);
143 Console.WriteLine("Pool size: " + _constantPoolCount);
144
145 for (int i = 0; i < _constantsPool.Count; i++)
146 {
147 this._constantsPool[i].Print();
148 }
149
150 Console.WriteLine("Access flags: " + _accessFlags);
151 Console.WriteLine("This class: " + _thisClass );
152 Console.WriteLine("Super class: " + _supperClass);
153
154 for (int count = 0; count < _methodCount; count++)
155 {
156 Console.WriteLine();
157 this._methodsList[count].Print();
158 }
159
160 Console.WriteLine("class name is " + this.mClass.Name.Value);
161 }
162
163 public static byte[] ReadFully(Stream stream)
164 {
165 byte[] buffer = new byte[1024];
166 using (MemoryStream ms = new MemoryStream())
167 {
168 while (true)
169 {
170 int read = stream.Read(buffer, 0, buffer.Length);
171 if (read <= 0)
172 return ms.ToArray();
173 ms.Write(buffer, 0, read);
174 }
175 }
176 }
177
178 #region nested classes
179 public class PoolItem
180 {
181 public virtual void Print()
182 {
183
184 }
185 }
186
187 public class PoolUtf8 : PoolItem
188 {
189 public string Value = "";
190
191 public void readValue(byte[] data,ref int pointer , int length)
192 {
193 for (int i = 0; i < length; i++)
194 {
195 int a =(int) data[pointer++];
196 if ((a & 0x80) == 0)
197 {
198 Value = Value + (char)a;
199 }
200 else if ((a & 0x20) == 0)
201 {
202 int b = (int) data[pointer++];
203 Value = Value + (char)(((a & 0x1f) << 6) + (b & 0x3f));
204 }
205 else
206 {
207 int b = (int)data[pointer++];
208 int c = (int)data[pointer++];
209 Value = Value + (char)(((a & 0xf) << 12) + ((b & 0x3f) << 6) + (c & 0x3f));
210 }
211 }
212 }
213
214 public override void Print()
215 {
216 Console.WriteLine("Utf8 type: " + Value);
217 }
218 }
219
220 private class PoolInt : PoolItem
221 {
222
223 }
224
225 public class PoolClass : PoolItem
226 {
227 //public string name = "";
228 public ushort namePointer = 0;
229 private ClassRecord parent;
230 public PoolUtf8 Name;
231
232 public PoolClass(ClassRecord paren)
233 {
234 parent = paren;
235 }
236
237 public void readValue(byte[] data, ref int pointer)
238 {
239 namePointer = (ushort)((data[pointer++] << 8) + data[pointer++] );
240 }
241
242 public override void Print()
243 {
244 this.Name = ((PoolUtf8)this.parent._constantsPool[namePointer - 1]);
245 Console.Write("Class type: " + namePointer);
246 Console.WriteLine(" // " + ((PoolUtf8)this.parent._constantsPool[namePointer - 1]).Value);
247
248 }
249 }
250
251 public class PoolMethodRef : PoolItem
252 {
253 public ushort classPointer = 0;
254 public ushort nameTypePointer = 0;
255 public PoolNamedType mNameType;
256 public PoolClass mClass;
257 private ClassRecord parent;
258
259 public PoolMethodRef(ClassRecord paren)
260 {
261 parent = paren;
262 }
263
264 public void readValue(byte[] data, ref int pointer)
265 {
266 classPointer = (ushort)((data[pointer++] << 8) + data[pointer++]);
267 nameTypePointer = (ushort)((data[pointer++] << 8) + data[pointer++]);
268 }
269
270 public override void Print()
271 {
272 this.mNameType = ((PoolNamedType)this.parent._constantsPool[nameTypePointer - 1]);
273 this.mClass = ((PoolClass)this.parent._constantsPool[classPointer - 1]);
274 Console.WriteLine("MethodRef type: " + classPointer + " , " + nameTypePointer);
275 }
276 }
277
278 public class PoolNamedType : PoolItem
279 {
280 public ushort namePointer = 0;
281 public ushort typePointer = 0;
282 private ClassRecord parent;
283 public PoolUtf8 Name;
284 public PoolUtf8 Type;
285
286 public PoolNamedType(ClassRecord paren)
287 {
288 parent = paren;
289 }
290
291 public void readValue(byte[] data, ref int pointer)
292 {
293 namePointer = (ushort)((data[pointer++] << 8) + data[pointer++] );
294 typePointer = (ushort)((data[pointer++] << 8) + data[pointer++] );
295 }
296
297 public override void Print()
298 {
299 Name = ((PoolUtf8)this.parent._constantsPool[namePointer-1]);
300 Type = ((PoolUtf8)this.parent._constantsPool[typePointer-1]);
301 Console.Write("Named type: " + namePointer + " , " + typePointer );
302 Console.WriteLine(" // "+ ((PoolUtf8)this.parent._constantsPool[namePointer-1]).Value);
303 }
304 }
305
306 //***********************
307 public class MethodInfo
308 {
309 public ushort AccessFlags = 0;
310 public ushort NameIndex = 0;
311 public string Name = "";
312 public ushort DescriptorIndex = 0;
313 public ushort AttributeCount = 0;
314 public List<MethodAttribute> Attributes = new List<MethodAttribute>();
315 private ClassRecord parent;
316 public int CodePointer = 0;
317
318 public MethodInfo(ClassRecord paren)
319 {
320 parent = paren;
321 }
322
323 public void AddMethodCode(MethodMemory memory)
324 {
325 Array.Copy(this.Attributes[0].Code, 0, memory.MethodBuffer, memory.NextMethodPC, this.Attributes[0].Code.Length);
326 memory.Methodcount++;
327 this.CodePointer = memory.NextMethodPC;
328 memory.NextMethodPC += this.Attributes[0].Code.Length;
329 }
330
331 public void ReadData(byte[] data, ref int pointer)
332 {
333 AccessFlags = (ushort)((data[pointer++] << 8) + data[pointer++]);
334 NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
335 DescriptorIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
336 AttributeCount = (ushort)((data[pointer++] << 8) + data[pointer++]);
337 for(int i =0; i< AttributeCount; i++)
338 {
339 MethodAttribute attri = new MethodAttribute(this.parent);
340 attri.ReadData(data, ref pointer);
341 this.Attributes.Add(attri);
342 }
343 }
344
345 public void Print()
346 {
347 Console.WriteLine("Method Info Struct: ");
348 Console.WriteLine("AccessFlags: " + AccessFlags);
349 Console.WriteLine("NameIndex: " + NameIndex +" // "+ ((PoolUtf8)this.parent._constantsPool[NameIndex-1]).Value);
350 Console.WriteLine("DescriptorIndex: " + DescriptorIndex + " // "+ ((PoolUtf8)this.parent._constantsPool[DescriptorIndex-1]).Value);
351 Console.WriteLine("Attribute Count:" + AttributeCount);
352 for (int i = 0; i < AttributeCount; i++)
353 {
354 this.Attributes[i].Print();
355 }
356 }
357
358 public class MethodAttribute
359 {
360 public ushort NameIndex = 0;
361 public string Name = "";
362 public Int32 Length = 0;
363 //for now only support code attribute
364 public ushort MaxStack = 0;
365 public ushort MaxLocals = 0;
366 public Int32 CodeLength = 0;
367 public byte[] Code;
368 public ushort ExceptionTableLength = 0;
369 public ushort SubAttributeCount = 0;
370 public List<SubAttribute> SubAttributes = new List<SubAttribute>();
371 private ClassRecord parent;
372
373 public MethodAttribute(ClassRecord paren)
374 {
375 parent = paren;
376 }
377
378 public void ReadData(byte[] data, ref int pointer)
379 {
380 NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
381 Length = (Int32)((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]);
382 MaxStack = (ushort)((data[pointer++] << 8) + data[pointer++]);
383 MaxLocals = (ushort)((data[pointer++] << 8) + data[pointer++]);
384 CodeLength = (Int32)((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]);
385 Code = new byte[CodeLength];
386 for (int i = 0; i < CodeLength; i++)
387 {
388 Code[i] = data[pointer++];
389 }
390 ExceptionTableLength = (ushort)((data[pointer++] << 8) + data[pointer++]);
391 SubAttributeCount = (ushort)((data[pointer++] << 8) + data[pointer++]);
392 for (int i = 0; i < SubAttributeCount; i++)
393 {
394 SubAttribute subAttri = new SubAttribute(this.parent);
395 subAttri.ReadData(data, ref pointer);
396 this.SubAttributes.Add(subAttri);
397 }
398 }
399
400 public void Print()
401 {
402 Console.WriteLine("Method Attribute: ");
403 Console.WriteLine("Name Index: " + NameIndex + " // "+ ((PoolUtf8)this.parent._constantsPool[NameIndex-1]).Value);
404 Console.WriteLine("Length: " + Length);
405 Console.WriteLine("MaxStack: " + MaxStack);
406 Console.WriteLine("MaxLocals: " + MaxLocals);
407 Console.WriteLine("CodeLength: " + CodeLength);
408 for (int i = 0; i < Code.Length; i++)
409 {
410 Console.WriteLine("OpCode #" + i + " is: " + Code[i]);
411 }
412 Console.WriteLine("SubAttributes: " + SubAttributeCount);
413 for (int i = 0; i < SubAttributeCount; i++)
414 {
415 this.SubAttributes[i].Print();
416 }
417 }
418
419 public class SubAttribute
420 {
421 public ushort NameIndex = 0;
422 public string Name = "";
423 public Int32 Length = 0;
424 public byte[] Data;
425 private ClassRecord parent;
426
427 public SubAttribute(ClassRecord paren)
428 {
429 parent = paren;
430 }
431
432 public void ReadData(byte[] data, ref int pointer)
433 {
434 NameIndex = (ushort)((data[pointer++] << 8) + data[pointer++]);
435 Length = (Int32)((data[pointer++] << 24) + (data[pointer++] << 16) + (data[pointer++] << 8) + data[pointer++]);
436 Data = new byte[Length];
437 for (int i = 0; i < Length; i++)
438 {
439 Data[i] = data[pointer++];
440 }
441 }
442
443 public void Print()
444 {
445 Console.WriteLine("SubAttribute: NameIndex: " + NameIndex + " // " + ((PoolUtf8)this.parent._constantsPool[NameIndex - 1]).Value);
446 }
447
448 }
449 }
450
451 }
452 private class InterfaceInfo
453 {
454 public void ReadData(byte[] data, ref int i)
455 {
456
457 }
458 }
459 private class FieldInfo
460 {
461 public void ReadData(byte[] data, ref int i)
462 {
463
464 }
465 }
466 private class AttributeInfo
467 {
468 public void ReadData(byte[] data, ref int i)
469 {
470
471 }
472 }
473 #endregion
474
475 }
476}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Heap.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Heap.cs
new file mode 100644
index 0000000..138e85e
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Heap.cs
@@ -0,0 +1,16 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM
6{
7 public class Heap
8 {
9 public List<ClassInstance> ClassObjects = new List<ClassInstance>();
10
11 public Heap()
12 {
13
14 }
15 }
16}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Interpreter.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Interpreter.cs
new file mode 100644
index 0000000..b94248c
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Interpreter.cs
@@ -0,0 +1,108 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Scripting.EmbeddedJVM.Types;
5using OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes;
6
7namespace OpenSim.Scripting.EmbeddedJVM
8{
9 partial class Thread
10 {
11 private partial class Interpreter
12 {
13 private Thread _mThread;
14
15 public Interpreter(Thread parentThread)
16 {
17 _mThread = parentThread;
18 }
19
20 public bool Excute()
21 {
22 bool run = true;
23 byte currentOpCode = GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC++];
24 // Console.WriteLine("opCode is: " + currentOpCode);
25 bool handled = false;
26
27 handled = this.IsLogicOpCode(currentOpCode);
28 if (!handled)
29 {
30 handled = this.IsMethodOpCode(currentOpCode);
31 }
32 if (!handled)
33 {
34 if (currentOpCode == 172)
35 {
36 if (this._mThread.stack.StackFrames.Count > 1)
37 {
38 Console.WriteLine("returning int from function");
39 int retPC1 = this._mThread.currentFrame.ReturnPC;
40 BaseType bas1 = this._mThread.currentFrame.OpStack.Pop();
41 this._mThread.stack.StackFrames.Pop();
42 this._mThread.currentFrame = this._mThread.stack.StackFrames.Peek();
43 this._mThread.PC = retPC1;
44 if (bas1 is Int)
45 {
46 this._mThread.currentFrame.OpStack.Push((Int)bas1);
47 }
48 }
49 else
50 {
51 // Console.WriteLine("No parent function so ending program");
52 this._mThread.stack.StackFrames.Pop();
53 run = false;
54 }
55 handled = true;
56 }
57 if (currentOpCode == 174)
58 {
59 if (this._mThread.stack.StackFrames.Count > 1)
60 {
61 Console.WriteLine("returning float from function");
62 int retPC1 = this._mThread.currentFrame.ReturnPC;
63 BaseType bas1 = this._mThread.currentFrame.OpStack.Pop();
64 this._mThread.stack.StackFrames.Pop();
65 this._mThread.currentFrame = this._mThread.stack.StackFrames.Peek();
66 this._mThread.PC = retPC1;
67 if (bas1 is Float)
68 {
69 this._mThread.currentFrame.OpStack.Push((Float)bas1);
70 }
71 }
72 else
73 {
74 // Console.WriteLine("No parent function so ending program");
75 this._mThread.stack.StackFrames.Pop();
76 run = false;
77 }
78 handled = true;
79 }
80 if (currentOpCode == 177)
81 {
82 if (this._mThread.stack.StackFrames.Count > 1)
83 {
84 Console.WriteLine("returning from function");
85 int retPC = this._mThread.currentFrame.ReturnPC;
86 this._mThread.stack.StackFrames.Pop();
87 this._mThread.currentFrame = this._mThread.stack.StackFrames.Peek();
88 this._mThread.PC = retPC;
89 }
90 else
91 {
92 // Console.WriteLine("No parent function so ending program");
93 this._mThread.stack.StackFrames.Pop();
94 run = false;
95 }
96 handled = true;
97 }
98 }
99 if (!handled)
100 {
101 Console.WriteLine("opcode " + currentOpCode + " not been handled ");
102 }
103 return run;
104
105 }
106 }
107 }
108}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterLogic.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterLogic.cs
new file mode 100644
index 0000000..3b7da35
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterLogic.cs
@@ -0,0 +1,400 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Scripting.EmbeddedJVM.Types;
5using OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes;
6
7namespace OpenSim.Scripting.EmbeddedJVM
8{
9 partial class Thread
10 {
11 private partial class Interpreter
12 {
13 private bool IsLogicOpCode(byte opcode)
14 {
15 bool result = false;
16 switch (opcode)
17 {
18 case 2:
19 Int m_int= new Int();
20 m_int.mValue = -1;
21 this._mThread.currentFrame.OpStack.Push(m_int);
22 result = true;
23 break;
24 case 3:
25 m_int= new Int();
26 m_int.mValue = 0;
27 this._mThread.currentFrame.OpStack.Push(m_int);
28 result = true;
29 break;
30 case 4:
31 m_int = new Int();
32 m_int.mValue = 1;
33 this._mThread.currentFrame.OpStack.Push(m_int);
34 result = true;
35 break;
36 case 5:
37 m_int = new Int();
38 m_int.mValue = 2;
39 this._mThread.currentFrame.OpStack.Push(m_int);
40 result = true;
41 break;
42 case 6:
43 m_int = new Int();
44 m_int.mValue = 3;
45 this._mThread.currentFrame.OpStack.Push(m_int);
46 break;
47 case 7:
48 m_int = new Int();
49 m_int.mValue = 4;
50 this._mThread.currentFrame.OpStack.Push(m_int);
51 result = true;
52 break;
53 case 8:
54 m_int = new Int();
55 m_int.mValue = 5;
56 this._mThread.currentFrame.OpStack.Push(m_int);
57 result = true;
58 break;
59 case 11:
60 Float m_float = new Float();
61 m_float.mValue = 0.0f;
62 this._mThread.currentFrame.OpStack.Push(m_float);
63 result = true;
64 break;
65 case 12:
66 m_float = new Float();
67 m_float.mValue = 1.0f;
68 this._mThread.currentFrame.OpStack.Push(m_float);
69 result = true;
70 break;
71 case 13:
72 m_float = new Float();
73 m_float.mValue = 2.0f;
74 this._mThread.currentFrame.OpStack.Push(m_float);
75 result = true;
76 break;
77 case 16:
78 int pushvalue = (int)GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC];
79 Int pushInt = new Int();
80 pushInt.mValue = pushvalue;
81 this._mThread.currentFrame.OpStack.Push(pushInt);
82 this._mThread.PC++;
83 result = true;
84 break;
85 case 17:
86 short pushvalue2 = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC + 1]);
87 Int pushInt2 = new Int();
88 pushInt2.mValue = pushvalue2;
89 this._mThread.currentFrame.OpStack.Push(pushInt2);
90 this._mThread.PC += 2;
91 result = true;
92 break;
93 case 23:
94 short findex1 = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC]));
95 Float fload = new Float();
96 if (this._mThread.currentFrame.LocalVariables[findex1] != null)
97 {
98 if (this._mThread.currentFrame.LocalVariables[findex1] is Float)
99 {
100 fload.mValue = ((Float)this._mThread.currentFrame.LocalVariables[findex1]).mValue;
101 this._mThread.currentFrame.OpStack.Push(fload);
102 }
103 }
104 this._mThread.PC++;
105 result = true;
106 break;
107 case 26:
108 if (this._mThread.currentFrame.LocalVariables[0] != null)
109 {
110 if (this._mThread.currentFrame.LocalVariables[0] is Int)
111 {
112 Int newInt = new Int();
113 newInt.mValue = ((Int)this._mThread.currentFrame.LocalVariables[0]).mValue;
114 this._mThread.currentFrame.OpStack.Push(newInt);
115 }
116 }
117 result = true;
118 break;
119 case 27:
120 if (this._mThread.currentFrame.LocalVariables[1] != null)
121 {
122 if (this._mThread.currentFrame.LocalVariables[1] is Int)
123 {
124 Int newInt = new Int();
125 newInt.mValue = ((Int)this._mThread.currentFrame.LocalVariables[1]).mValue;
126 this._mThread.currentFrame.OpStack.Push(newInt);
127 }
128 }
129 result = true;
130 break;
131 case 34:
132 if (this._mThread.currentFrame.LocalVariables[0] != null)
133 {
134 if (this._mThread.currentFrame.LocalVariables[0] is Float)
135 {
136 Float newfloat = new Float();
137 newfloat.mValue = ((Float)this._mThread.currentFrame.LocalVariables[0]).mValue;
138 this._mThread.currentFrame.OpStack.Push(newfloat);
139 }
140 }
141 result = true;
142 break;
143 case 35:
144 if (this._mThread.currentFrame.LocalVariables[1] != null)
145 {
146 if (this._mThread.currentFrame.LocalVariables[1] is Float)
147 {
148 Float newfloat = new Float();
149 newfloat.mValue = ((Float)this._mThread.currentFrame.LocalVariables[1]).mValue;
150 this._mThread.currentFrame.OpStack.Push(newfloat);
151 }
152 }
153 result = true;
154 break;
155 case 36:
156 if (this._mThread.currentFrame.LocalVariables[2] != null)
157 {
158 if (this._mThread.currentFrame.LocalVariables[2] is Float)
159 {
160 Float newfloat = new Float();
161 newfloat.mValue = ((Float)this._mThread.currentFrame.LocalVariables[2]).mValue;
162 this._mThread.currentFrame.OpStack.Push(newfloat);
163 }
164 }
165 result = true;
166 break;
167 case 37:
168 if (this._mThread.currentFrame.LocalVariables[3] != null)
169 {
170 if (this._mThread.currentFrame.LocalVariables[3] is Float)
171 {
172 Float newfloat = new Float();
173 newfloat.mValue = ((Float)this._mThread.currentFrame.LocalVariables[3]).mValue;
174 this._mThread.currentFrame.OpStack.Push(newfloat);
175 }
176 }
177 result = true;
178 break;
179 case 56:
180 short findex = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] ));
181 BaseType fstor = this._mThread.currentFrame.OpStack.Pop();
182 if (fstor is Float)
183 {
184 this._mThread.currentFrame.LocalVariables[findex] = (Float)fstor;
185 }
186 this._mThread.PC++;
187 result = true;
188 break;
189 case 59:
190 BaseType baset = this._mThread.currentFrame.OpStack.Pop();
191 if (baset is Int)
192 {
193 this._mThread.currentFrame.LocalVariables[0] = (Int)baset;
194 }
195 result = true;
196 break;
197 case 60:
198 baset = this._mThread.currentFrame.OpStack.Pop();
199 if (baset is Int)
200 {
201 this._mThread.currentFrame.LocalVariables[1] = (Int)baset;
202 }
203 result = true;
204 break;
205 case 67:
206 baset = this._mThread.currentFrame.OpStack.Pop();
207 if (baset is Float)
208 {
209 this._mThread.currentFrame.LocalVariables[0] = (Float)baset;
210 }
211 result = true;
212 break;
213 case 68:
214 baset = this._mThread.currentFrame.OpStack.Pop();
215 if (baset is Float)
216 {
217 this._mThread.currentFrame.LocalVariables[1] = (Float)baset;
218 }
219 result = true;
220 break;
221 case 69:
222 baset = this._mThread.currentFrame.OpStack.Pop();
223 if (baset is Float)
224 {
225 this._mThread.currentFrame.LocalVariables[2] = (Float)baset;
226 }
227 result = true;
228 break;
229 case 70:
230 baset = this._mThread.currentFrame.OpStack.Pop();
231 if (baset is Float)
232 {
233 this._mThread.currentFrame.LocalVariables[3] = (Float)baset;
234 }
235 result = true;
236 break;
237 case 87:
238 this._mThread.currentFrame.OpStack.Pop();
239 result = true;
240 break;
241 case 98:
242 BaseType bf2 = this._mThread.currentFrame.OpStack.Pop();
243 BaseType bf1 = this._mThread.currentFrame.OpStack.Pop();
244 if (bf1 is Float && bf2 is Float)
245 {
246 Float nflt = new Float();
247 nflt.mValue = ((Float)bf1).mValue + ((Float)bf2).mValue;
248 this._mThread.currentFrame.OpStack.Push(nflt);
249 }
250 result = true;
251 break;
252 case 102:
253 BaseType bsf2 = this._mThread.currentFrame.OpStack.Pop();
254 BaseType bsf1 = this._mThread.currentFrame.OpStack.Pop();
255 if (bsf1 is Float && bsf2 is Float)
256 {
257 Float resf = new Float();
258 resf.mValue = ((Float)bsf1).mValue - ((Float)bsf2).mValue;
259 this._mThread.currentFrame.OpStack.Push(resf);
260 }
261 result = true;
262 break;
263 case 104: //check the order of the two values off the stack is correct
264 BaseType bs2 = this._mThread.currentFrame.OpStack.Pop();
265 BaseType bs1 = this._mThread.currentFrame.OpStack.Pop();
266 if (bs1 is Int && bs2 is Int)
267 {
268 Int nInt = new Int();
269 nInt.mValue = ((Int)bs1).mValue * ((Int)bs2).mValue;
270 this._mThread.currentFrame.OpStack.Push(nInt);
271 }
272 result = true;
273 break;
274 case 132:
275 if (this._mThread.currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC]] != null)
276 {
277 if (this._mThread.currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC]] is Int)
278 {
279 ((Int)this._mThread.currentFrame.LocalVariables[GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC]]).mValue += (sbyte) GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC + 1];
280 }
281 }
282 this._mThread.PC += 2;
283 result = true;
284 break;
285 case 139:
286 BaseType conv1 = this._mThread.currentFrame.OpStack.Pop();
287 if (conv1 is Float)
288 {
289 Int newconv = new Int();
290 newconv.mValue = (int)((Float)conv1).mValue;
291 this._mThread.currentFrame.OpStack.Push(newconv);
292 }
293 result = true;
294 break;
295 case 149:
296 BaseType flcom2 = this._mThread.currentFrame.OpStack.Pop();
297 BaseType flcom1 = this._mThread.currentFrame.OpStack.Pop();
298 if (flcom1 is Float && flcom2 is Float)
299 {
300 Int compres = new Int();
301 if (((Float)flcom1).mValue < ((Float)flcom2).mValue)
302 {
303 compres.mValue = -1;
304 }
305 else if (((Float)flcom1).mValue > ((Float)flcom2).mValue)
306 {
307 compres.mValue = 1;
308 }
309 else
310 {
311 compres.mValue = 0;
312 }
313 this._mThread.currentFrame.OpStack.Push(compres);
314 }
315 result = true;
316 break;
317 case 158:
318 short compareoffset1 = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC + 1]);
319 BaseType comp1 = this._mThread.currentFrame.OpStack.Pop();
320 if (comp1 is Int)
321 {
322 if (((Int)comp1).mValue <= 0)
323 {
324 this._mThread.PC += -1 + compareoffset1;
325 }
326 else
327 {
328 this._mThread.PC += 2;
329 }
330 }
331 else
332 {
333 this._mThread.PC += 2;
334 }
335 result = true;
336 break;
337 case 162:
338 short compareoffset = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC + 1]);
339 BaseType bc2 = this._mThread.currentFrame.OpStack.Pop();
340 BaseType bc1 = this._mThread.currentFrame.OpStack.Pop();
341 if (bc1 is Int && bc2 is Int)
342 {
343 //Console.WriteLine("comparing " + ((Int)bc1).mValue + " and " + ((Int)bc2).mValue);
344 if (((Int)bc1).mValue >= ((Int)bc2).mValue)
345 {
346 // Console.WriteLine("branch compare true , offset is " +compareoffset);
347 // Console.WriteLine("current PC is " + this._mThread.PC);
348 this._mThread.PC += -1 + compareoffset;
349 //Console.WriteLine("new PC is " + this._mThread.PC);
350 }
351 else
352 {
353 //Console.WriteLine("branch compare false");
354 this._mThread.PC += 2;
355 }
356 }
357 else
358 {
359 this._mThread.PC += 2;
360 }
361 result = true;
362 break;
363 case 164:
364 short compareloffset = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC + 1]);
365 BaseType bcl2 = this._mThread.currentFrame.OpStack.Pop();
366 BaseType bcl1 = this._mThread.currentFrame.OpStack.Pop();
367 if (bcl1 is Int && bcl2 is Int)
368 {
369 //Console.WriteLine("comparing " + ((Int)bcl1).mValue + " and " + ((Int)bcl2).mValue);
370 if (((Int)bcl1).mValue <= ((Int)bcl2).mValue)
371 {
372 // Console.WriteLine("branch compare true , offset is " + compareloffset);
373 // Console.WriteLine("current PC is " + this._mThread.PC);
374 this._mThread.PC += -1 + compareloffset;
375 // Console.WriteLine("new PC is " + this._mThread.PC);
376 }
377 else
378 {
379 //Console.WriteLine("branch compare false");
380 this._mThread.PC += 2;
381 }
382 }
383 else
384 {
385 this._mThread.PC += 2;
386 }
387 result = true;
388 break;
389 case 167:
390 short offset = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC+1]);
391 this._mThread.PC += -1 + offset;
392 result = true;
393 break;
394 }
395
396 return result;
397 }
398 }
399 }
400}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterMethods.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterMethods.cs
new file mode 100644
index 0000000..c66c148
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterMethods.cs
@@ -0,0 +1,141 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Scripting.EmbeddedJVM.Types;
5using OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes;
6using OpenSim.Framework.Interfaces;
7using OpenSim.Framework;
8using OpenSim.Framework.Types;
9
10namespace OpenSim.Scripting.EmbeddedJVM
11{
12 partial class Thread
13 {
14 private partial class Interpreter
15 {
16 private bool IsMethodOpCode(byte opcode)
17 {
18 bool result = false;
19 switch (opcode)
20 {
21 case 184:
22 short refIndex = (short) ((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] << 8) + GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC+1]);
23 //Console.WriteLine("call to method : "+refIndex);
24 if (this._mThread.currentClass._constantsPool[refIndex - 1] is ClassRecord.PoolMethodRef)
25 {
26 // Console.WriteLine("which is " + ((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mClass.Name.Value + "." + ((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mNameType.Name.Value);
27 // Console.WriteLine("of type " + ((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mNameType.Type.Value);
28 string typ = ((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mNameType.Type.Value;
29 string typeparam = "";
30 string typereturn = "";
31 int firstbrak = 0;
32 int secondbrak = 0;
33 firstbrak = typ.LastIndexOf('(');
34 secondbrak = typ.LastIndexOf(')');
35 typeparam = typ.Substring(firstbrak + 1, secondbrak - firstbrak - 1);
36 typereturn = typ.Substring(secondbrak + 1, typ.Length - secondbrak - 1);
37 //Console.WriteLine("split is " + typeparam + " which is length " + typeparam.Length + " , " + typereturn);
38 if (((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mClass.Name.Value == this._mThread.currentClass.mClass.Name.Value)
39 {
40 //calling a method in this class
41 if (typeparam.Length == 0)
42 {
43 this._mThread.JumpToStaticVoidMethod(((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mNameType.Name.Value, (this._mThread.PC + 2));
44 }
45 else
46 {
47 this._mThread.JumpToStaticParamMethod(((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mNameType.Name.Value, typeparam, (this._mThread.PC + 2));
48 }
49 }
50 else
51 {
52 //calling a method of a different class
53
54 //for now we will have a built in OpenSimAPI class, but this should be a java class that then calls native methods
55 if (((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mClass.Name.Value == "OpenSimAPI")
56 {
57 switch (((ClassRecord.PoolMethodRef)this._mThread.currentClass._constantsPool[refIndex - 1]).mNameType.Name.Value)
58 {
59 case "GetEntityID":
60 Int entityID = new Int();
61 entityID.mValue =(int) this._mThread.EntityId;
62 this._mThread.currentFrame.OpStack.Push(entityID);
63 this._mThread.PC += 2;
64 break;
65 case "GetRandomAvatarID":
66 entityID = new Int();
67 entityID.mValue = (int)Thread.OpenSimScriptAPI.GetRandomAvatarID();
68 this._mThread.currentFrame.OpStack.Push(entityID);
69 this._mThread.PC += 2;
70 break;
71 case "GetEntityPositionX":
72 BaseType bs1 = this._mThread.currentFrame.OpStack.Pop();
73 if (bs1 is Int)
74 {
75 //Console.WriteLine("get entity pos for " + ((Int)bs1).mValue);
76 //should get the position of the entity from the IScriptAPI
77 OSVector3 vec3 = Thread.OpenSimScriptAPI.GetEntityPosition((uint)((Int)bs1).mValue);
78 Float pos = new Float();
79 pos.mValue = vec3.X;
80 // Console.WriteLine("returned x value " + vec3.X.ToString());
81 this._mThread.currentFrame.OpStack.Push(pos);
82 }
83 this._mThread.PC += 2;
84 break;
85 case "GetEntityPositionY":
86 bs1 = this._mThread.currentFrame.OpStack.Pop();
87 if (bs1 is Int)
88 {
89 //should get the position of the entity from the IScriptAPI
90 OSVector3 vec3 = Thread.OpenSimScriptAPI.GetEntityPosition((uint)((Int)bs1).mValue);
91 Float pos = new Float();
92 pos.mValue = vec3.Y;
93 this._mThread.currentFrame.OpStack.Push(pos);
94 }
95 this._mThread.PC += 2;
96 break;
97 case "GetEntityPositionZ":
98 bs1 = this._mThread.currentFrame.OpStack.Pop();
99 if (bs1 is Int)
100 {
101 //should get the position of the entity from the IScriptAPI
102 OSVector3 vec3 = Thread.OpenSimScriptAPI.GetEntityPosition((uint)((Int)bs1).mValue);
103 Float pos = new Float();
104 pos.mValue = vec3.Z;
105 this._mThread.currentFrame.OpStack.Push(pos);
106 }
107 this._mThread.PC += 2;
108 break;
109 case "SetEntityPosition":
110 //pop the three float values and the entity id
111 BaseType ft3 = this._mThread.currentFrame.OpStack.Pop();
112 BaseType ft2 = this._mThread.currentFrame.OpStack.Pop();
113 BaseType ft1 = this._mThread.currentFrame.OpStack.Pop();
114 BaseType in1 = this._mThread.currentFrame.OpStack.Pop();
115 if (ft1 is Float && ft2 is Float && ft3 is Float)
116 {
117 if(in1 is Int)
118 {
119 //Console.WriteLine("set: " + ((Int)in1).mValue + " , " + ((Float)ft1).mValue + " , " + ((Float)ft2).mValue + " , " + ((Float)ft3).mValue);
120 Thread.OpenSimScriptAPI.SetEntityPosition((uint)((Int) in1).mValue, ((Float)ft1).mValue, ((Float)ft2).mValue, ((Float)ft3).mValue);
121 }
122 }
123 this._mThread.PC += 2;
124 break;
125 }
126 }
127 }
128 }
129 else
130 {
131 this._mThread.PC += 2;
132 }
133 result = true;
134 break;
135 }
136
137 return result;
138 }
139 }
140 }
141}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterReturn.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterReturn.cs
new file mode 100644
index 0000000..6704e31
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/InterpreterReturn.cs
@@ -0,0 +1,13 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM
6{
7 partial class Thread
8 {
9 private partial class Interpreter
10 {
11 }
12 }
13}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/MainMemory.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/MainMemory.cs
new file mode 100644
index 0000000..ff18f90
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/MainMemory.cs
@@ -0,0 +1,18 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM
6{
7 public class MainMemory
8 {
9 public Heap HeapArea;
10 public MethodMemory MethodArea;
11
12 public MainMemory()
13 {
14 MethodArea = new MethodMemory();
15 HeapArea = new Heap();
16 }
17 }
18}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/MethodMemory.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/MethodMemory.cs
new file mode 100644
index 0000000..2541991
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/MethodMemory.cs
@@ -0,0 +1,19 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM
6{
7 public class MethodMemory
8 {
9 public byte[] MethodBuffer;
10 public List<ClassRecord> Classes = new List<ClassRecord>();
11 public int NextMethodPC = 0;
12 public int Methodcount = 0;
13
14 public MethodMemory()
15 {
16 MethodBuffer = new byte[20000];
17 }
18 }
19}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Object.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Object.cs
new file mode 100644
index 0000000..e6e392c
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Object.cs
@@ -0,0 +1,10 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM
6{
7 public class Object
8 {
9 }
10}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj
new file mode 100644
index 0000000..bd1a332
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj
@@ -0,0 +1,153 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{97A82740-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Scripting.EmbeddedJVM</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Scripting.EmbeddedJVM</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\ScriptEngines\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\ScriptEngines\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 </ItemGroup>
70 <ItemGroup>
71 <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
72 <Name>OpenSim.Framework</Name>
73 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
74 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
75 <Private>False</Private>
76 </ProjectReference>
77 </ItemGroup>
78 <ItemGroup>
79 <Compile Include="ClassInstance.cs">
80 <SubType>Code</SubType>
81 </Compile>
82 <Compile Include="ClassRecord.cs">
83 <SubType>Code</SubType>
84 </Compile>
85 <Compile Include="Heap.cs">
86 <SubType>Code</SubType>
87 </Compile>
88 <Compile Include="Interpreter.cs">
89 <SubType>Code</SubType>
90 </Compile>
91 <Compile Include="InterpreterLogic.cs">
92 <SubType>Code</SubType>
93 </Compile>
94 <Compile Include="InterpreterMethods.cs">
95 <SubType>Code</SubType>
96 </Compile>
97 <Compile Include="InterpreterReturn.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="MainMemory.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 <Compile Include="MethodMemory.cs">
104 <SubType>Code</SubType>
105 </Compile>
106 <Compile Include="Object.cs">
107 <SubType>Code</SubType>
108 </Compile>
109 <Compile Include="OpenSimJVM.cs">
110 <SubType>Code</SubType>
111 </Compile>
112 <Compile Include="Stack.cs">
113 <SubType>Code</SubType>
114 </Compile>
115 <Compile Include="StackFrame.cs">
116 <SubType>Code</SubType>
117 </Compile>
118 <Compile Include="Thread.cs">
119 <SubType>Code</SubType>
120 </Compile>
121 <Compile Include="Properties\AssemblyInfo.cs">
122 <SubType>Code</SubType>
123 </Compile>
124 <Compile Include="Types\ArrayReference.cs">
125 <SubType>Code</SubType>
126 </Compile>
127 <Compile Include="Types\BaseType.cs">
128 <SubType>Code</SubType>
129 </Compile>
130 <Compile Include="Types\ObjectReference.cs">
131 <SubType>Code</SubType>
132 </Compile>
133 <Compile Include="Types\PrimitiveTypes\Byte.cs">
134 <SubType>Code</SubType>
135 </Compile>
136 <Compile Include="Types\PrimitiveTypes\Char.cs">
137 <SubType>Code</SubType>
138 </Compile>
139 <Compile Include="Types\PrimitiveTypes\Float.cs">
140 <SubType>Code</SubType>
141 </Compile>
142 <Compile Include="Types\PrimitiveTypes\Int.cs">
143 <SubType>Code</SubType>
144 </Compile>
145 </ItemGroup>
146 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
147 <PropertyGroup>
148 <PreBuildEvent>
149 </PreBuildEvent>
150 <PostBuildEvent>
151 </PostBuildEvent>
152 </PropertyGroup>
153</Project>
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj.user b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build
new file mode 100644
index 0000000..c5255db
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build
@@ -0,0 +1,62 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Scripting.EmbeddedJVM" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Scripting.EmbeddedJVM" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="ClassInstance.cs" />
15 <include name="ClassRecord.cs" />
16 <include name="Heap.cs" />
17 <include name="Interpreter.cs" />
18 <include name="InterpreterLogic.cs" />
19 <include name="InterpreterMethods.cs" />
20 <include name="InterpreterReturn.cs" />
21 <include name="MainMemory.cs" />
22 <include name="MethodMemory.cs" />
23 <include name="Object.cs" />
24 <include name="OpenSimJVM.cs" />
25 <include name="Stack.cs" />
26 <include name="StackFrame.cs" />
27 <include name="Thread.cs" />
28 <include name="Properties/AssemblyInfo.cs" />
29 <include name="Types/ArrayReference.cs" />
30 <include name="Types/BaseType.cs" />
31 <include name="Types/ObjectReference.cs" />
32 <include name="Types/PrimitiveTypes/Byte.cs" />
33 <include name="Types/PrimitiveTypes/Char.cs" />
34 <include name="Types/PrimitiveTypes/Float.cs" />
35 <include name="Types/PrimitiveTypes/Int.cs" />
36 </sources>
37 <references basedir="${project::get-base-directory()}">
38 <lib>
39 <include name="${project::get-base-directory()}" />
40 <include name="${project::get-base-directory()}/${build.dir}" />
41 </lib>
42 <include name="System.dll" />
43 <include name="System.Xml.dll" />
44 <include name="../../../bin/OpenSim.Framework.dll" />
45 </references>
46 </csc>
47 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/ScriptEngines/" />
48 <mkdir dir="${project::get-base-directory()}/../../../bin/ScriptEngines/"/>
49 <copy todir="${project::get-base-directory()}/../../../bin/ScriptEngines/">
50 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
51 <include name="*.dll"/>
52 <include name="*.exe"/>
53 </fileset>
54 </copy>
55 </target>
56 <target name="clean">
57 <delete dir="${bin.dir}" failonerror="false" />
58 <delete dir="${obj.dir}" failonerror="false" />
59 </target>
60 <target name="doc" description="Creates documentation.">
61 </target>
62</project>
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSimJVM.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSimJVM.cs
new file mode 100644
index 0000000..b47bb50
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/OpenSimJVM.cs
@@ -0,0 +1,134 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.IO;
5using System.Threading;
6using OpenSim.Framework;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Utilities;
9
10namespace OpenSim.Scripting.EmbeddedJVM
11{
12 public class OpenSimJVM : IScriptEngine
13 {
14 private List<Thread> _threads = new List<Thread>();
15 private BlockingQueue<CompileInfo> CompileScripts = new BlockingQueue<CompileInfo>();
16 private MainMemory _mainMemory;
17 private System.Threading.Thread compileThread;
18
19 public OpenSimJVM()
20 {
21
22 }
23
24 public bool Init(IScriptAPI api)
25 {
26 Console.WriteLine("Creating OpenSim JVM scripting engine");
27 _mainMemory = new MainMemory();
28 Thread.GlobalMemory = this._mainMemory;
29 Thread.OpenSimScriptAPI = api;
30 compileThread = new System.Threading.Thread(new ThreadStart(CompileScript));
31 compileThread.IsBackground = true;
32 compileThread.Start();
33 return true;
34 }
35
36 public string GetName()
37 {
38 return "OpenSimJVM";
39 }
40
41 public void LoadScript(string script, string scriptName, uint entityID)
42 {
43 Console.WriteLine("OpenSimJVM - loading new script: " + scriptName);
44 CompileInfo comp = new CompileInfo();
45 comp.entityId = entityID;
46 comp.script = script;
47 comp.scriptName = scriptName;
48 this.CompileScripts.Enqueue(comp);
49 }
50
51 public void CompileScript()
52 {
53 while (true)
54 {
55 CompileInfo comp = this.CompileScripts.Dequeue();
56 string script = comp.script;
57 string scriptName = comp.scriptName;
58 uint entityID = comp.entityId;
59 try
60 {
61 //need to compile the script into a java class file
62
63 //first save it to a java source file
64 TextWriter tw = new StreamWriter(scriptName + ".java");
65 tw.WriteLine(script);
66 tw.Close();
67
68 //now compile
69 System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("javac.exe", "*.java");
70 // psi.RedirectStandardOutput = true;
71 psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
72 psi.UseShellExecute = false;
73
74 System.Diagnostics.Process javacomp;
75 javacomp = System.Diagnostics.Process.Start(psi);
76 javacomp.WaitForExit();
77
78
79 //now load in class file
80 ClassRecord class1 = new ClassRecord();
81 class1.LoadClassFromFile(scriptName + ".class");
82 class1.PrintToConsole();
83 //Console.WriteLine();
84 this._mainMemory.MethodArea.Classes.Add(class1);
85 class1.AddMethodsToMemory(this._mainMemory.MethodArea);
86
87 Thread newThread = new Thread();
88 this._threads.Add(newThread);
89 newThread.EntityId = entityID;
90 newThread.currentClass = class1;
91
92 //now delete the created files
93 System.IO.File.Delete(scriptName + ".java");
94 System.IO.File.Delete(scriptName + ".class");
95 //this.OnFrame();
96 }
97 catch (Exception e)
98 {
99 Console.WriteLine("exception");
100 Console.WriteLine(e.StackTrace);
101 Console.WriteLine(e.Message);
102 }
103 }
104 }
105
106 public void OnFrame()
107 {
108 for (int i = 0; i < this._threads.Count; i++)
109 {
110 if (!this._threads[i].running)
111 {
112 this._threads[i].StartMethod("OnFrame");
113 bool run = true;
114 while (run)
115 {
116 run = this._threads[i].Excute();
117 }
118 }
119 }
120 }
121
122 private class CompileInfo
123 {
124 public string script;
125 public string scriptName;
126 public uint entityId;
127
128 public CompileInfo()
129 {
130
131 }
132 }
133 }
134}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Properties/AssemblyInfo.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..53a0f08
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Scripting.EmbeddedJVM")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.Scripting.EmbeddedJVM")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("087c0917-5a6a-4b47-a4dd-0928dd85bd4b")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("1.0.0.0")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Stack.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Stack.cs
new file mode 100644
index 0000000..d77d82e
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Stack.cs
@@ -0,0 +1,15 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM
6{
7 public class Stack
8 {
9 public Stack<StackFrame> StackFrames = new Stack<StackFrame>();
10
11 public Stack()
12 {
13 }
14 }
15}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/StackFrame.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/StackFrame.cs
new file mode 100644
index 0000000..afca7a9
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/StackFrame.cs
@@ -0,0 +1,22 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Scripting.EmbeddedJVM.Types;
5
6namespace OpenSim.Scripting.EmbeddedJVM
7{
8 public class StackFrame
9 {
10 public BaseType[] LocalVariables;
11 public Stack<BaseType> OpStack = new Stack<BaseType>();
12
13 public int ReturnPC = 0;
14 public ClassRecord CallingClass = null;
15
16 public StackFrame()
17 {
18 LocalVariables = new BaseType[20];
19 }
20
21 }
22}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Thread.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Thread.cs
new file mode 100644
index 0000000..436949c
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Thread.cs
@@ -0,0 +1,88 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Scripting.EmbeddedJVM.Types;
5using OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes;
6using OpenSim.Framework;
7using OpenSim.Framework.Interfaces;
8
9namespace OpenSim.Scripting.EmbeddedJVM
10{
11 public partial class Thread
12 {
13 public static MainMemory GlobalMemory;
14 public static IScriptAPI OpenSimScriptAPI;
15 private int PC = 0;
16 private Stack stack;
17 private Interpreter mInterpreter;
18 public ClassRecord currentClass;
19 public ClassInstance currentInstance;
20 private StackFrame currentFrame;
21 public int excutionCounter = 0;
22 public bool running = false;
23 public uint EntityId = 0;
24
25 public Thread()
26 {
27 this.mInterpreter = new Interpreter(this);
28 this.stack = new Stack();
29 }
30
31 public void SetPC(int methodpointer)
32 {
33 //Console.WriteLine("Thread PC has been set to " + methodpointer);
34 PC = methodpointer;
35 }
36
37 public void StartMethod(ClassRecord rec, string methName)
38 {
39 currentFrame = new StackFrame();
40 this.stack.StackFrames.Push(currentFrame);
41 this.currentClass = rec;
42 currentClass.StartMethod(this, methName);
43 }
44
45 public void StartMethod( string methName)
46 {
47 currentFrame = new StackFrame();
48 this.stack.StackFrames.Push(currentFrame);
49 currentClass.StartMethod(this, methName);
50 }
51
52 public void JumpToStaticVoidMethod(string methName, int returnPC)
53 {
54 currentFrame = new StackFrame();
55 currentFrame.ReturnPC = returnPC;
56 this.stack.StackFrames.Push(currentFrame);
57 currentClass.StartMethod(this, methName);
58 }
59
60 public void JumpToStaticParamMethod(string methName, string param, int returnPC)
61 {
62 if (param == "I")
63 {
64 BaseType bs1 = currentFrame.OpStack.Pop();
65 currentFrame = new StackFrame();
66 currentFrame.ReturnPC = returnPC;
67 this.stack.StackFrames.Push(currentFrame);
68 currentFrame.LocalVariables[0] = ((Int)bs1);
69 currentClass.StartMethod(this, methName);
70 }
71 if (param == "F")
72 {
73
74 }
75 }
76
77 public void JumpToClassStaticVoidMethod(string className, string methName, int returnPC)
78 {
79
80 }
81
82 public bool Excute()
83 {
84 excutionCounter++;
85 return this.mInterpreter.Excute();
86 }
87 }
88}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ArrayReference.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ArrayReference.cs
new file mode 100644
index 0000000..2854eab
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ArrayReference.cs
@@ -0,0 +1,10 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM.Types
6{
7 public class ArrayReference :BaseType
8 {
9 }
10}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/BaseType.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/BaseType.cs
new file mode 100644
index 0000000..270aa7b
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/BaseType.cs
@@ -0,0 +1,10 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM.Types
6{
7 public class BaseType : Object
8 {
9 }
10}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ObjectReference.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ObjectReference.cs
new file mode 100644
index 0000000..da28eaa
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/ObjectReference.cs
@@ -0,0 +1,16 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM.Types
6{
7 public class ObjectReference : BaseType
8 {
9 public ushort Reference;
10
11 public ObjectReference()
12 {
13
14 }
15 }
16}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Byte.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Byte.cs
new file mode 100644
index 0000000..1a3ecff
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Byte.cs
@@ -0,0 +1,10 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes
6{
7 public class Byte : BaseType
8 {
9 }
10}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Char.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Char.cs
new file mode 100644
index 0000000..19002d4
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Char.cs
@@ -0,0 +1,10 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes
6{
7 public class Char : BaseType
8 {
9 }
10}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Float.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Float.cs
new file mode 100644
index 0000000..91f1679
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Float.cs
@@ -0,0 +1,16 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes
6{
7 public class Float : BaseType
8 {
9 public float mValue = 0;
10
11 public Float()
12 {
13
14 }
15 }
16}
diff --git a/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Int.cs b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Int.cs
new file mode 100644
index 0000000..4ecd325
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/EmbeddedJVM/Types/PrimitiveTypes/Int.cs
@@ -0,0 +1,16 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Scripting.EmbeddedJVM.Types.PrimitiveTypes
6{
7 public class Int : BaseType
8 {
9 public int mValue = 0;
10
11 public Int()
12 {
13
14 }
15 }
16}
diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs
new file mode 100644
index 0000000..d4db8c0
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs
@@ -0,0 +1,95 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28// BDB Support
29// Apparently broken on Mono
30
31using System;
32using System.Collections.Generic;
33using System.Data;
34using libsecondlife;
35using OpenSim.Framework.Interfaces;
36using OpenSim.Framework.Types;
37using OpenSim.Framework.Terrain;
38using BerkeleyDb;
39using Kds.Serialization;
40using Kds.Serialization.Buffer;
41
42namespace OpenSim.Storage.LocalStorageBDB
43{
44 public class BDBLocalStorage : ILocalStorage
45 {
46 const string simDbName = "localsim.db";
47
48 DbHash sim;
49 Db DB;
50 //BEFormatter formatter;
51
52 public BDBLocalStorage()
53 {
54 DB = new Db(DbCreateFlags.None);
55 sim = (DbHash)DB.Open(null, simDbName, null, BerkeleyDb.DbType.Hash, Db.OpenFlags.Create, 0);
56 //vendorDb = (DbBTree)db.Open(null, VendorDbName, null, DbType.BTree, Db.OpenFlags.Create, 0);
57 }
58
59 public void Initialise(string file)
60 {
61 // Blank
62 }
63
64 public void StorePrim(PrimData prim)
65 {
66 DbEntry key = new DbEntry();
67 DbEntry data = new DbEntry();
68 lock (sim)
69 {
70 sim.PutUnique(null, ref key, ref data, DbFile.WriteFlags.AutoCommit);
71 }
72 }
73 public void RemovePrim(LLUUID primID)
74 {
75
76 }
77 public void LoadPrimitives(ILocalStorageReceiver receiver)
78 {
79
80 }
81 public float[] LoadWorld()
82 {
83 return new float[65536];
84 }
85 public void SaveMap(float[] heightmap)
86 {
87
88 }
89 public void ShutDown()
90 {
91 sim.GetDb().Close();
92 DB.Close();
93 }
94 }
95} \ 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
new file mode 100644
index 0000000..e615bc5
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj
@@ -0,0 +1,112 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{EE9E5D96-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Storage.LocalStorageBerkeleyDB</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Storage.LocalStorageBerkeleyDB</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="Kds.Serialization.dll" >
74 <HintPath>..\..\..\bin\Kds.Serialization.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="libdb_dotNET43.dll" >
78 <HintPath>..\..\..\bin\libdb_dotNET43.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 <Reference Include="libsecondlife.dll" >
82 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
83 <Private>False</Private>
84 </Reference>
85 </ItemGroup>
86 <ItemGroup>
87 <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
88 <Name>OpenSim.Framework</Name>
89 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
90 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
91 <Private>False</Private>
92 </ProjectReference>
93 <ProjectReference Include="..\..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
94 <Name>OpenSim.Framework.Console</Name>
95 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
96 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
97 <Private>False</Private>
98 </ProjectReference>
99 </ItemGroup>
100 <ItemGroup>
101 <Compile Include="BDBLocalStorage.cs">
102 <SubType>Code</SubType>
103 </Compile>
104 </ItemGroup>
105 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
106 <PropertyGroup>
107 <PreBuildEvent>
108 </PreBuildEvent>
109 <PostBuildEvent>
110 </PostBuildEvent>
111 </PropertyGroup>
112</Project>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.user b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build
new file mode 100644
index 0000000..1c7306a
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build
@@ -0,0 +1,46 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Storage.LocalStorageBerkeleyDB" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Storage.LocalStorageBerkeleyDB" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="BDBLocalStorage.cs" />
15 </sources>
16 <references basedir="${project::get-base-directory()}">
17 <lib>
18 <include name="${project::get-base-directory()}" />
19 <include name="${project::get-base-directory()}/${build.dir}" />
20 </lib>
21 <include name="System.dll" />
22 <include name="System.Xml.dll" />
23 <include name="System.Data.dll" />
24 <include name="../../../bin/Kds.Serialization.dll" />
25 <include name="../../../bin/libdb_dotNET43.dll" />
26 <include name="../../../bin/libsecondlife.dll" />
27 <include name="../../../bin/OpenSim.Framework.dll" />
28 <include name="../../../bin/OpenSim.Framework.Console.dll" />
29 </references>
30 </csc>
31 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
32 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
33 <copy todir="${project::get-base-directory()}/../../../bin/">
34 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
35 <include name="*.dll"/>
36 <include name="*.exe"/>
37 </fileset>
38 </copy>
39 </target>
40 <target name="clean">
41 <delete dir="${bin.dir}" failonerror="false" />
42 <delete dir="${obj.dir}" failonerror="false" />
43 </target>
44 <target name="doc" description="Creates documentation.">
45 </target>
46</project>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/AssemblyInfo.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/AssemblyInfo.cs
new file mode 100644
index 0000000..6610606
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/AssemblyInfo.cs
@@ -0,0 +1,31 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// Information about this assembly is defined by the following
6// attributes.
7//
8// change them to the information which is associated with the assembly
9// you compile.
10
11[assembly: AssemblyTitle("Db4LocalStorage")]
12[assembly: AssemblyDescription("")]
13[assembly: AssemblyConfiguration("")]
14[assembly: AssemblyCompany("")]
15[assembly: AssemblyProduct("Db4LocalStorage")]
16[assembly: AssemblyCopyright("")]
17[assembly: AssemblyTrademark("")]
18[assembly: AssemblyCulture("")]
19
20// This sets the default COM visibility of types in the assembly to invisible.
21// If you need to expose a type to COM, use [ComVisible(true)] on that type.
22[assembly: ComVisible(false)]
23
24// The assembly version has following format :
25//
26// Major.Minor.Build.Revision
27//
28// You can specify all values by your own or you can build default build and revision
29// numbers with the '*' character (the default):
30
31[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs
new file mode 100644
index 0000000..5dceb7f
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs
@@ -0,0 +1,182 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections.Generic;
29using Db4objects.Db4o;
30using Db4objects.Db4o.Query;
31using libsecondlife;
32using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Types;
34using OpenSim.Framework.Terrain;
35
36namespace OpenSim.Storage.LocalStorageDb4o
37{
38 /// <summary>
39 ///
40 /// </summary>
41 public class Db4LocalStorage : ILocalStorage
42 {
43 private IObjectContainer db;
44 private string datastore;
45
46 public Db4LocalStorage()
47 {
48
49 }
50
51 public void Initialise(string dfile)
52 {
53 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Db4LocalStorage Opening " + dfile);
54 datastore = dfile;
55 try
56 {
57 db = Db4oFactory.OpenFile(datastore);
58 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Db4LocalStorage creation");
59 }
60 catch (Exception e)
61 {
62 db.Close();
63 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Db4LocalStorage :Constructor - Exception occured");
64 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString());
65 }
66 }
67
68 public void StorePrim(PrimData prim)
69 {
70 IObjectSet result = db.Query(new UUIDQuery(prim.FullID));
71 if(result.Count>0)
72 {
73 //prim already in storage
74 //so update it
75 PrimData found = (PrimData) result.Next();
76 found.PathBegin = prim.PathBegin;
77 found.PathCurve= prim.PathCurve;
78 found.PathEnd = prim.PathEnd;
79 found.PathRadiusOffset = prim.PathRadiusOffset;
80 found.PathRevolutions = prim.PathRevolutions;
81 found.PathScaleX= prim.PathScaleX;
82 found.PathScaleY = prim.PathScaleY;
83 found.PathShearX = prim.PathShearX;
84 found.PathShearY = prim.PathShearY;
85 found.PathSkew = prim.PathSkew;
86 found.PathTaperX = prim.PathTaperX;
87 found.PathTaperY = prim.PathTaperY;
88 found.PathTwist = prim.PathTwist;
89 found.PathTwistBegin = prim.PathTwistBegin;
90 found.PCode = prim.PCode;
91 found.ProfileBegin = prim.ProfileBegin;
92 found.ProfileCurve = prim.ProfileCurve;
93 found.ProfileEnd = prim.ProfileEnd;
94 found.ProfileHollow = prim.ProfileHollow;
95 found.Position = prim.Position;
96 found.Rotation = prim.Rotation;
97 found.Texture = prim.Texture;
98 db.Set(found);
99 db.Commit();
100 }
101 else
102 {
103 //not in storage
104 db.Set(prim);
105 db.Commit();
106 }
107 }
108
109 public void RemovePrim(LLUUID primID)
110 {
111 IObjectSet result = db.Query(new UUIDQuery(primID));
112 if(result.Count>0)
113 {
114 PrimData found = (PrimData) result.Next();
115 db.Delete(found);
116 }
117 }
118
119
120 public void LoadPrimitives(ILocalStorageReceiver receiver)
121 {
122 IObjectSet result = db.Get(typeof(PrimData));
123 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count);
124 foreach (PrimData prim in result) {
125 receiver.PrimFromStorage(prim);
126 }
127 }
128
129 public float[] LoadWorld()
130 {
131 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"LoadWorld() - Loading world....");
132 //World blank = new World();
133 float[] heightmap = null;
134 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"LoadWorld() - Looking for a heightmap in local DB");
135 IObjectSet world_result = db.Get(typeof(MapStorage));
136 if (world_result.Count > 0)
137 {
138 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"LoadWorld() - Found a heightmap in local database, loading");
139 MapStorage map = (MapStorage)world_result.Next();
140 //blank.LandMap = map.Map;
141 heightmap = map.Map;
142 }
143 else
144 {
145 /*
146 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LoadWorld() - No heightmap found, generating new one");
147 HeightmapGenHills hills = new HeightmapGenHills();
148 // blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
149 // heightmap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
150 heightmap = new float[256, 256];
151 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LoadWorld() - Saving heightmap to local database");
152 MapStorage map = new MapStorage();
153 map.Map = heightmap; //blank.LandMap;
154 db.Set(map);
155 db.Commit();
156 */
157 }
158 return heightmap;
159 }
160
161 public void SaveMap(float[] heightmap)
162 {
163 IObjectSet world_result = db.Get(typeof(MapStorage));
164 if (world_result.Count > 0)
165 {
166 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"SaveWorld() - updating saved copy of heightmap in local database");
167 MapStorage map = (MapStorage)world_result.Next();
168 db.Delete(map);
169 }
170 MapStorage map1 = new MapStorage();
171 map1.Map = heightmap; //OpenSim_Main.local_world.LandMap;
172 db.Set(map1);
173 db.Commit();
174 }
175
176 public void ShutDown()
177 {
178 db.Commit();
179 db.Close();
180 }
181 }
182}
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs
new file mode 100644
index 0000000..db590ff
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs
@@ -0,0 +1,16 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Storage.LocalStorageDb4o
6{
7 public class MapStorage
8 {
9 public float[] Map;
10
11 public MapStorage()
12 {
13
14 }
15 }
16} \ 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
new file mode 100644
index 0000000..9b4ff5d
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj
@@ -0,0 +1,113 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{E1B79ECF-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Storage.LocalStorageDb4o</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Storage.LocalStorageDb4o</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="Db4objects.Db4o.dll" >
70 <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 </ItemGroup>
78 <ItemGroup>
79 <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
80 <Name>OpenSim.Framework</Name>
81 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
82 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
83 <Private>False</Private>
84 </ProjectReference>
85 <ProjectReference Include="..\..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
86 <Name>OpenSim.Framework.Console</Name>
87 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
88 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
89 <Private>False</Private>
90 </ProjectReference>
91 </ItemGroup>
92 <ItemGroup>
93 <Compile Include="AssemblyInfo.cs">
94 <SubType>Code</SubType>
95 </Compile>
96 <Compile Include="Db4LocalStorage.cs">
97 <SubType>Code</SubType>
98 </Compile>
99 <Compile Include="MapStorage.cs">
100 <SubType>Code</SubType>
101 </Compile>
102 <Compile Include="UUIDQuery.cs">
103 <SubType>Code</SubType>
104 </Compile>
105 </ItemGroup>
106 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
107 <PropertyGroup>
108 <PreBuildEvent>
109 </PreBuildEvent>
110 <PostBuildEvent>
111 </PostBuildEvent>
112 </PropertyGroup>
113</Project>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj.user b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build
new file mode 100644
index 0000000..da2db14
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build
@@ -0,0 +1,47 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Storage.LocalStorageDb4o" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Storage.LocalStorageDb4o" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="Db4LocalStorage.cs" />
16 <include name="MapStorage.cs" />
17 <include name="UUIDQuery.cs" />
18 </sources>
19 <references basedir="${project::get-base-directory()}">
20 <lib>
21 <include name="${project::get-base-directory()}" />
22 <include name="${project::get-base-directory()}/${build.dir}" />
23 </lib>
24 <include name="System.dll" />
25 <include name="System.Xml.dll" />
26 <include name="../../../bin/Db4objects.Db4o.dll" />
27 <include name="../../../bin/libsecondlife.dll" />
28 <include name="../../../bin/OpenSim.Framework.dll" />
29 <include name="../../../bin/OpenSim.Framework.Console.dll" />
30 </references>
31 </csc>
32 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
33 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
34 <copy todir="${project::get-base-directory()}/../../../bin/">
35 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
36 <include name="*.dll"/>
37 <include name="*.exe"/>
38 </fileset>
39 </copy>
40 </target>
41 <target name="clean">
42 <delete dir="${bin.dir}" failonerror="false" />
43 <delete dir="${obj.dir}" failonerror="false" />
44 </target>
45 <target name="doc" description="Creates documentation.">
46 </target>
47</project>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDQuery.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDQuery.cs
new file mode 100644
index 0000000..ba9e139
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDQuery.cs
@@ -0,0 +1,25 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Db4objects.Db4o;
5using Db4objects.Db4o.Query;
6using libsecondlife;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Types;
9
10namespace OpenSim.Storage.LocalStorageDb4o
11{
12 public class UUIDQuery : Predicate
13 {
14 private LLUUID _findID;
15
16 public UUIDQuery(LLUUID find)
17 {
18 _findID = find;
19 }
20 public bool Match(PrimData prim)
21 {
22 return (prim.FullID == _findID);
23 }
24 }
25}
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj
new file mode 100644
index 0000000..08ac690
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj
@@ -0,0 +1,111 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{6B20B603-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Storage.LocalStorageSQLite</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Storage.LocalStorageSQLite</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="System.Data.SQLite.dll" >
74 <HintPath>..\..\..\bin\System.Data.SQLite.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="libsecondlife.dll" >
78 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
84 <Name>OpenSim.Framework</Name>
85 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 <ProjectReference Include="..\..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
90 <Name>OpenSim.Framework.Console</Name>
91 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private>
94 </ProjectReference>
95 </ItemGroup>
96 <ItemGroup>
97 <Compile Include="SQLiteLocalStorage.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="Properties\AssemblyInfo.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 </ItemGroup>
104 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
105 <PropertyGroup>
106 <PreBuildEvent>
107 </PreBuildEvent>
108 <PostBuildEvent>
109 </PostBuildEvent>
110 </PropertyGroup>
111</Project>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj.user b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build
new file mode 100644
index 0000000..4c8917a
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build
@@ -0,0 +1,46 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Storage.LocalStorageSQLite" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Storage.LocalStorageSQLite" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="SQLiteLocalStorage.cs" />
15 <include name="Properties/AssemblyInfo.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="System.Xml.dll" />
24 <include name="System.Data.dll" />
25 <include name="../../../bin/System.Data.SQLite.dll" />
26 <include name="../../../bin/libsecondlife.dll" />
27 <include name="../../../bin/OpenSim.Framework.dll" />
28 <include name="../../../bin/OpenSim.Framework.Console.dll" />
29 </references>
30 </csc>
31 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
32 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
33 <copy todir="${project::get-base-directory()}/../../../bin/">
34 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
35 <include name="*.dll"/>
36 <include name="*.exe"/>
37 </fileset>
38 </copy>
39 </target>
40 <target name="clean">
41 <delete dir="${bin.dir}" failonerror="false" />
42 <delete dir="${obj.dir}" failonerror="false" />
43 </target>
44 <target name="doc" description="Creates documentation.">
45 </target>
46</project>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs b/OpenSim/OpenSim.Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..fe81f8a
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Storage.LocalStorageSQLite")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.Storage.LocalStorageSQLite")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("ecd6e0c1-7909-413e-9e3f-659678ac3bc3")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.*")]
35[assembly: AssemblyFileVersion("1.0.0.*")]
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs
new file mode 100644
index 0000000..368405b
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs
@@ -0,0 +1,176 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27
28// SQLite Support
29// A bad idea, but the IRC people told me to!
30
31using System;
32using System.Collections.Generic;
33using System.Data;
34using System.Data.SQLite;
35using libsecondlife;
36using OpenSim.Framework.Interfaces;
37using OpenSim.Framework.Types;
38using OpenSim.Framework.Terrain;
39
40namespace OpenSim.Storage.LocalStorageSQLite
41{
42 public class SQLiteLocalStorage : ILocalStorage
43 {
44 IDbConnection db;
45
46 public SQLiteLocalStorage()
47 {
48 try
49 {
50 string connectionstring = "URI=file:localsim.sdb";
51 db = (IDbConnection)new SQLiteConnection(connectionstring);
52 db.Open();
53 }
54 catch (Exception e)
55 {
56 db.Close();
57 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"SQLiteLocalStorage :Constructor - Exception occured");
58 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString());
59 }
60 }
61
62 public void Initialise(string file)
63 {
64 // Blank
65 }
66
67 public void StorePrim(PrimData prim)
68 {
69 IDbCommand cmd = db.CreateCommand();
70
71 //SECURITY WARNING:
72 // These parameters wont produce SQL injections since they are all integer based, however.
73 // if inserting strings such as name or description, you will need to use appropriate
74 // measures to prevent SQL injection (although the value of SQL injection in this is limited).
75
76 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) ";
77 sql += "VALUES (";
78 sql += "\"" + prim.OwnerID.ToStringHyphenated() + "\","; // KILL ME NOW!
79 sql += "\"" + prim.PCode.ToString() + "\",";
80 sql += "\"" + prim.PathBegin.ToString() + "\",";
81 sql += "\"" + prim.PathEnd.ToString() + "\",";
82 sql += "\"" + prim.PathScaleX.ToString() + "\",";
83 sql += "\"" + prim.PathScaleY.ToString() + "\",";
84 sql += "\"" + prim.PathShearX.ToString() + "\",";
85 sql += "\"" + prim.PathShearY.ToString() + "\",";
86 sql += "\"" + prim.PathSkew.ToString() + "\",";
87 sql += "\"" + prim.ProfileBegin.ToString() + "\",";
88 sql += "\"" + prim.ProfileEnd.ToString() + "\",";
89 sql += "\"" + prim.Scale.ToString() + "\",";
90 sql += "\"" + prim.PathCurve.ToString() + "\",";
91 sql += "\"" + prim.ProfileCurve.ToString() + "\",";
92 sql += "\"" + prim.ParentID.ToString() + "\",";
93 sql += "\"" + prim.ProfileHollow.ToString() + "\",";
94 sql += "\"" + prim.PathRadiusOffset.ToString() + "\",";
95 sql += "\"" + prim.PathRevolutions.ToString() + "\",";
96 sql += "\"" + prim.PathTaperX.ToString() + "\",";
97 sql += "\"" + prim.PathTaperY.ToString() + "\",";
98 sql += "\"" + prim.PathTwist.ToString() + "\",";
99 sql += "\"" + prim.PathTwistBegin.ToString() + "\",";
100 sql += "\"" + prim.Texture.ToString() + "\",";
101 sql += "\"" + prim.CreationDate.ToString() + "\",";
102 sql += "\"" + prim.OwnerMask.ToString() + "\",";
103 sql += "\"" + prim.NextOwnerMask.ToString() + "\",";
104 sql += "\"" + prim.GroupMask.ToString() + "\",";
105 sql += "\"" + prim.EveryoneMask.ToString() + "\",";
106 sql += "\"" + prim.BaseMask.ToString() + "\",";
107 sql += "\"" + prim.Position.ToString() + "\",";
108 sql += "\"" + prim.Rotation.ToString() + "\",";
109 sql += "\"" + prim.LocalID.ToString() + "\",";
110 sql += "\"" + prim.FullID.ToString() + "\")";
111
112 cmd.CommandText = sql;
113
114 try
115 {
116 cmd.ExecuteNonQuery();
117 }
118 catch (Exception e)
119 {
120 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"SQLiteLocalStorage :StorePrim - Exception occured");
121 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString());
122 }
123
124 cmd.Dispose();
125 cmd = null;
126 }
127
128 public void RemovePrim(LLUUID primID)
129 {
130 IDbCommand cmd = db.CreateCommand();
131
132 //SECURITY WARNING:
133 // These parameters wont produce SQL injections since they are all integer based, however.
134 // if inserting strings such as name or description, you will need to use appropriate
135 // measures to prevent SQL injection (although the value of SQL injection in this is limited).
136
137 string sql = "DELETE FROM prim WHERE FullID = \"" + primID.ToStringHyphenated() + "\"";
138
139 cmd.CommandText = sql;
140
141 try
142 {
143 cmd.ExecuteNonQuery();
144 }
145 catch (Exception e)
146 {
147 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"SQLiteLocalStorage :RemovePrim - Exception occured");
148 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString());
149 }
150
151 cmd.Dispose();
152 cmd = null;
153 }
154
155 public void LoadPrimitives(ILocalStorageReceiver receiver)
156 {
157
158 }
159
160 public float[] LoadWorld()
161 {
162 return new float[65536];
163 }
164
165 public void SaveMap(float[] heightmap)
166 {
167
168 }
169
170 public void ShutDown()
171 {
172 db.Close();
173 db = null;
174 }
175 }
176} \ 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
new file mode 100644
index 0000000..65a158c
--- /dev/null
+++ b/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.csproj
@@ -0,0 +1,99 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{2270B8FE-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Terrain.BasicTerrain</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Terrain.BasicTerrain</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Drawing" >
66 <HintPath>System.Drawing.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Data" >
70 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="System.Xml" >
74 <HintPath>System.Xml.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="libTerrain-BSD.dll" >
78 <HintPath>..\..\bin\libTerrain-BSD.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 </ItemGroup>
84 <ItemGroup>
85 <Compile Include="TerrainEngine.cs">
86 <SubType>Code</SubType>
87 </Compile>
88 <Compile Include="Properties\AssemblyInfo.cs">
89 <SubType>Code</SubType>
90 </Compile>
91 </ItemGroup>
92 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
93 <PropertyGroup>
94 <PreBuildEvent>
95 </PreBuildEvent>
96 <PostBuildEvent>
97 </PostBuildEvent>
98 </PropertyGroup>
99</Project>
diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.csproj.user b/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build b/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build
new file mode 100644
index 0000000..9c80ac7
--- /dev/null
+++ b/OpenSim/OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build
@@ -0,0 +1,44 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Terrain.BasicTerrain" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Terrain.BasicTerrain" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="TerrainEngine.cs" />
15 <include name="Properties/AssemblyInfo.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="System.Drawing.dll" />
24 <include name="System.Data.dll" />
25 <include name="System.Xml.dll" />
26 <include name="../../bin/libTerrain-BSD.dll" />
27 </references>
28 </csc>
29 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
30 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
31 <copy todir="${project::get-base-directory()}/../../bin/">
32 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
33 <include name="*.dll"/>
34 <include name="*.exe"/>
35 </fileset>
36 </copy>
37 </target>
38 <target name="clean">
39 <delete dir="${bin.dir}" failonerror="false" />
40 <delete dir="${obj.dir}" failonerror="false" />
41 </target>
42 <target name="doc" description="Creates documentation.">
43 </target>
44</project>
diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/Properties/AssemblyInfo.cs b/OpenSim/OpenSim.Terrain.BasicTerrain/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..bd74993
--- /dev/null
+++ b/OpenSim/OpenSim.Terrain.BasicTerrain/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Terrain.BasicTerrain")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.Terrain.BasicTerrain")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("3263f5b5-0a41-4ed5-91a2-9baaaeecc849")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
new file mode 100644
index 0000000..aa785b0
--- /dev/null
+++ b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
@@ -0,0 +1,484 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Drawing;
5using libTerrain;
6
7namespace OpenSim.Terrain
8{
9 public class TerrainEngine
10 {
11 /// <summary>
12 /// A [normally] 256x256 heightmap
13 /// </summary>
14 public Channel heightmap;
15
16 /// <summary>
17 /// Whether or not the terrain has been modified since it was last saved and sent to the Physics engine.
18 /// Counts the number of modifications since the last save. (0 = Untainted)
19 /// </summary>
20 public int tainted;
21
22 int w, h;
23
24 /// <summary>
25 /// Generate a new TerrainEngine instance and creates a new heightmap
26 /// </summary>
27 public TerrainEngine()
28 {
29 w = 256;
30 h = 256;
31 heightmap = new Channel(w, h);
32
33 tainted++;
34 }
35
36 /// <summary>
37 /// Converts the heightmap to a 65536 value 1D floating point array
38 /// </summary>
39 /// <returns>A float[65536] array containing the heightmap</returns>
40 public float[] getHeights1D()
41 {
42 float[] heights = new float[w * h];
43 int i;
44
45 for (i = 0; i < w * h; i++)
46 {
47 heights[i] = (float)heightmap.map[i / w, i % w];
48 }
49
50 return heights;
51 }
52
53 /// <summary>
54 /// Converts the heightmap to a 256x256 value 2D floating point array.
55 /// </summary>
56 /// <returns>An array of 256,256 values containing the heightmap</returns>
57 public float[,] getHeights2D()
58 {
59 float[,] heights = new float[w, h];
60 int x, y;
61 for (x = 0; x < w; x++)
62 {
63 for (y = 0; y < h; y++)
64 {
65 heights[x, y] = (float)heightmap.map[x, y];
66 }
67 }
68 return heights;
69 }
70
71 /// <summary>
72 /// Imports a 1D floating point array into the 2D heightmap array
73 /// </summary>
74 /// <param name="heights">The array to import (must have 65536 members)</param>
75 public void setHeights1D(float[] heights)
76 {
77 int i;
78 for (i = 0; i < w * h; i++)
79 {
80 heightmap.map[i / w, i % w] = heights[i];
81 }
82
83 tainted++;
84 }
85
86 /// <summary>
87 /// Loads a 2D array of values into the heightmap
88 /// </summary>
89 /// <param name="heights">An array of 256,256 float values</param>
90 public void setHeights2D(float[,] heights)
91 {
92 int x, y;
93 for (x = 0; x < w; x++)
94 {
95 for (y = 0; y < h; y++)
96 {
97 heightmap.set(x, y, (double)heights[x, y]);
98 }
99 }
100 tainted++;
101 }
102
103 /// <summary>
104 /// Processes a terrain-specific command
105 /// </summary>
106 /// <param name="args">Commandline arguments (space seperated)</param>
107 /// <param name="resultText">Reference that returns error or help text if returning false</param>
108 /// <returns>If the operation was successful (if not, the error is placed into resultText)</returns>
109 public bool RunTerrainCmd(string[] args, ref string resultText)
110 {
111 string command = args[0];
112
113 try
114 {
115
116 switch (command)
117 {
118 case "help":
119 resultText += "terrain regenerate - rebuilds the sims terrain using a default algorithm\n";
120 resultText += "terrain seed <seed> - sets the random seed value to <seed>\n";
121 resultText += "terrain load <type> <filename> - loads a terrain from disk, type can be 'F32', 'F64', 'RAW' or 'IMG'\n";
122 resultText += "terrain save <type> <filename> - saves a terrain to disk, type can be 'F32' or 'F64'\n";
123 resultText += "terrain save grdmap <filename> <gradient map> - creates a PNG snapshot of the region using a named gradient map\n";
124 resultText += "terrain rescale <min> <max> - rescales a terrain to be between <min> and <max> meters high\n";
125 resultText += "terrain erode aerobic <windspeed> <pickupmin> <dropmin> <carry> <rounds> <lowest>\n";
126 resultText += "terrain erode thermal <talus> <rounds> <carry>\n";
127 resultText += "terrain multiply <val> - multiplies a terrain by <val>\n";
128 return false;
129
130 case "seed":
131 setSeed(Convert.ToInt32(args[1]));
132 break;
133
134 case "erode":
135 switch (args[1].ToLower())
136 {
137 case "aerobic":
138 // WindSpeed, PickupMinimum,DropMinimum,Carry,Rounds,Lowest
139 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]));
140 break;
141 case "thermal":
142 heightmap.thermalWeathering(Convert.ToDouble(args[2]), Convert.ToInt32(args[3]), Convert.ToDouble(args[4]));
143 break;
144 default:
145 resultText = "Unknown erosion type";
146 return false;
147 }
148 break;
149
150 case "regenerate":
151 hills();
152 break;
153
154 case "rescale":
155 setRange(Convert.ToSingle(args[1]), Convert.ToSingle(args[2]));
156 break;
157
158 case "multiply":
159 heightmap *= Convert.ToDouble(args[1]);
160 break;
161
162 case "load":
163 switch (args[1].ToLower())
164 {
165 case "f32":
166 loadFromFileF32(args[2]);
167 break;
168
169 case "f64":
170 loadFromFileF64(args[2]);
171 break;
172
173 case "raw":
174 loadFromFileSLRAW(args[2]);
175 break;
176
177 case "img":
178 resultText = "Error - IMG mode is presently unsupported.";
179 return false;
180
181 default:
182 resultText = "Unknown image or data format";
183 return false;
184 }
185 break;
186
187 case "save":
188 switch (args[1].ToLower())
189 {
190 case "f32":
191 writeToFileF32(args[2]);
192 break;
193
194 case "f64":
195 writeToFileF64(args[2]);
196 break;
197
198 case "grdmap":
199 exportImage(args[2], args[3]);
200 break;
201
202 default:
203 resultText = "Unknown image or data format";
204 return false;
205 }
206 break;
207
208 default:
209 resultText = "Unknown terrain command";
210 return false;
211 }
212 return true;
213 }
214 catch (Exception e)
215 {
216 resultText = "Error running terrain command: " + e.ToString();
217 return false;
218 }
219 }
220
221 /// <summary>
222 /// Renormalises the array between min and max
223 /// </summary>
224 /// <param name="min">Minimum value of the new array</param>
225 /// <param name="max">Maximum value of the new array</param>
226 public void setRange(float min, float max)
227 {
228 heightmap.normalise((double)min, (double)max);
229 tainted++;
230 }
231
232 /// <summary>
233 /// Loads a file consisting of 256x256 doubles and imports it as an array into the map.
234 /// </summary>
235 /// <remarks>TODO: Move this to libTerrain itself</remarks>
236 /// <param name="filename">The filename of the double array to import</param>
237 public void loadFromFileF64(string filename)
238 {
239 System.IO.FileInfo file = new System.IO.FileInfo(filename);
240 System.IO.FileStream s = file.Open(System.IO.FileMode.Open, System.IO.FileAccess.Read);
241 System.IO.BinaryReader bs = new System.IO.BinaryReader(s);
242 int x, y;
243 for (x = 0; x < w; x++)
244 {
245 for (y = 0; y < h; y++)
246 {
247 heightmap.map[x, y] = bs.ReadDouble();
248 }
249 }
250
251 bs.Close();
252 s.Close();
253
254 tainted++;
255 }
256
257 /// <summary>
258 /// Loads a file consisting of 256x256 floats and imports it as an array into the map.
259 /// </summary>
260 /// <remarks>TODO: Move this to libTerrain itself</remarks>
261 /// <param name="filename">The filename of the float array to import</param>
262 public void loadFromFileF32(string filename)
263 {
264 System.IO.FileInfo file = new System.IO.FileInfo(filename);
265 System.IO.FileStream s = file.Open(System.IO.FileMode.Open, System.IO.FileAccess.Read);
266 System.IO.BinaryReader bs = new System.IO.BinaryReader(s);
267 int x, y;
268 for (x = 0; x < w; x++)
269 {
270 for (y = 0; y < h; y++)
271 {
272 heightmap.map[x, y] = (double)bs.ReadSingle();
273 }
274 }
275
276 bs.Close();
277 s.Close();
278
279 tainted++;
280 }
281
282 /// <summary>
283 /// Loads a file formatted in the SL .RAW Format used on the main grid
284 /// </summary>
285 /// <remarks>This file format stinks and is best avoided.</remarks>
286 /// <param name="filename">A path to the .RAW format</param>
287 public void loadFromFileSLRAW(string filename)
288 {
289 System.IO.FileInfo file = new System.IO.FileInfo(filename);
290 System.IO.FileStream s = file.Open(System.IO.FileMode.Open, System.IO.FileAccess.Read);
291 System.IO.BinaryReader bs = new System.IO.BinaryReader(s);
292 int x, y;
293 for (x = 0; x < w; x++)
294 {
295 for (y = 0; y < h; y++)
296 {
297 heightmap.map[x, y] = (double)bs.ReadByte() * ((double)bs.ReadByte() / 127.0);
298 bs.ReadBytes(11); // Advance the stream to next bytes.
299 }
300 }
301
302 bs.Close();
303 s.Close();
304
305 tainted++;
306 }
307
308 /// <summary>
309 /// Writes the current terrain heightmap to disk, in the format of a 65536 entry double[] array.
310 /// </summary>
311 /// <param name="filename">The desired output filename</param>
312 public void writeToFileF64(string filename)
313 {
314 System.IO.FileInfo file = new System.IO.FileInfo(filename);
315 System.IO.FileStream s = file.Open(System.IO.FileMode.CreateNew, System.IO.FileAccess.Write);
316 System.IO.BinaryWriter bs = new System.IO.BinaryWriter(s);
317
318 int x, y;
319 for (x = 0; x < w; x++)
320 {
321 for (y = 0; y < h; y++)
322 {
323 bs.Write(heightmap.get(x, y));
324 }
325 }
326
327 bs.Close();
328 s.Close();
329 }
330
331 /// <summary>
332 /// Writes the current terrain heightmap to disk, in the format of a 65536 entry float[] array
333 /// </summary>
334 /// <param name="filename">The desired output filename</param>
335 public void writeToFileF32(string filename)
336 {
337 System.IO.FileInfo file = new System.IO.FileInfo(filename);
338 System.IO.FileStream s = file.Open(System.IO.FileMode.CreateNew, System.IO.FileAccess.Write);
339 System.IO.BinaryWriter bs = new System.IO.BinaryWriter(s);
340
341 int x, y;
342 for (x = 0; x < w; x++)
343 {
344 for (y = 0; y < h; y++)
345 {
346 bs.Write((float)heightmap.get(x, y));
347 }
348 }
349
350 bs.Close();
351 s.Close();
352 }
353
354 /// <summary>
355 /// Sets the random seed to be used by procedural functions which involve random numbers.
356 /// </summary>
357 /// <param name="val">The desired seed</param>
358 public void setSeed(int val)
359 {
360 heightmap.seed = val;
361 }
362
363 /// <summary>
364 /// Raises land in a sphere around the specified coordinates
365 /// </summary>
366 /// <param name="rx">Center of the sphere on the X axis</param>
367 /// <param name="ry">Center of the sphere on the Y axis</param>
368 /// <param name="size">The radius of the sphere</param>
369 /// <param name="amount">Scale the height of the sphere by this amount (recommended 0..2)</param>
370 public void raise(double rx, double ry, double size, double amount)
371 {
372 lock (heightmap)
373 {
374 heightmap.raise(rx, ry, size, amount);
375 }
376
377 tainted++;
378 }
379
380 /// <summary>
381 /// Lowers the land in a sphere around the specified coordinates
382 /// </summary>
383 /// <param name="rx">The center of the sphere at the X axis</param>
384 /// <param name="ry">The center of the sphere at the Y axis</param>
385 /// <param name="size">The radius of the sphere in meters</param>
386 /// <param name="amount">Scale the height of the sphere by this amount (recommended 0..2)</param>
387 public void lower(double rx, double ry, double size, double amount)
388 {
389 lock (heightmap)
390 {
391 heightmap.lower(rx, ry, size, amount);
392 }
393
394 tainted++;
395 }
396
397 /// <summary>
398 /// Generates a simple set of hills in the shape of an island
399 /// </summary>
400 public void hills()
401 {
402 lock (heightmap)
403 {
404 heightmap.hillsSpheres(200, 20, 40, true, true, false);
405 heightmap.normalise();
406 heightmap *= 60.0; // Raise to 60m
407 }
408
409 tainted++;
410 }
411
412 /// <summary>
413 /// Multiplies the heightfield by val
414 /// </summary>
415 /// <param name="meep">The heightfield</param>
416 /// <param name="val">The multiplier</param>
417 /// <returns></returns>
418 public static TerrainEngine operator *(TerrainEngine meep, Double val)
419 {
420 meep.heightmap *= val;
421 meep.tainted++;
422 return meep;
423 }
424
425 /// <summary>
426 /// Returns the height at the coordinates x,y
427 /// </summary>
428 /// <param name="x">X Coordinate</param>
429 /// <param name="y">Y Coordinate</param>
430 /// <returns></returns>
431 public float this[int x, int y]
432 {
433 get
434 {
435 return (float)heightmap.get(x, y);
436 }
437 set
438 {
439 tainted++;
440 heightmap.set(x, y, (double)value);
441 }
442 }
443
444 /// <summary>
445 /// Exports the current heightmap to a PNG file
446 /// </summary>
447 /// <param name="filename">The destination filename for the image</param>
448 /// <param name="gradientmap">A 1x*height* image which contains the colour gradient to export with. Must be at least 1x2 pixels, 1x256 or more is ideal.</param>
449 public void exportImage(string filename, string gradientmap)
450 {
451 try
452 {
453 Bitmap gradientmapLd = new Bitmap(gradientmap);
454
455 int pallete = gradientmapLd.Height;
456
457 Bitmap bmp = new Bitmap(heightmap.w, heightmap.h);
458 Color[] colours = new Color[pallete];
459
460 for (int i = 0; i < pallete; i++)
461 {
462 colours[i] = gradientmapLd.GetPixel(0, i);
463 }
464
465 Channel copy = heightmap.copy();
466 for (int x = 0; x < copy.w; x++)
467 {
468 for (int y = 0; y < copy.h; y++)
469 {
470 // 512 is the largest possible height before colours clamp
471 int colorindex = (int)(Math.Max(Math.Min(1.0, copy.get(x, y) / 512.0), 0.0) * pallete);
472 bmp.SetPixel(x, y, colours[colorindex]);
473 }
474 }
475
476 bmp.Save(filename, System.Drawing.Imaging.ImageFormat.Png);
477 }
478 catch (Exception e)
479 {
480 Console.WriteLine("Failed generating terrain map: " + e.ToString());
481 }
482 }
483 }
484} \ No newline at end of file
diff --git a/OpenSim/OpenSim/Application.cs b/OpenSim/OpenSim/Application.cs
new file mode 100644
index 0000000..3f9c0ec
--- /dev/null
+++ b/OpenSim/OpenSim/Application.cs
@@ -0,0 +1,95 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.UserServer;
5using OpenSim.Framework.Console;
6
7namespace OpenSim
8{
9 public class Application
10 {
11 //could move our main function into OpenSimMain and kill this class
12 [STAThread]
13 public static void Main(string[] args)
14 {
15 Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
16 Console.WriteLine("Starting...\n");
17
18 bool sandBoxMode = false;
19 bool startLoginServer = false;
20 string physicsEngine = "basicphysics";
21 bool allowFlying = false;
22 bool userAccounts = false;
23 bool gridLocalAsset = false;
24 bool useConfigFile = false;
25 bool silent = false;
26 string configFile = "simconfig.xml";
27
28 for (int i = 0; i < args.Length; i++)
29 {
30 if (args[i] == "-sandbox")
31 {
32 sandBoxMode = true;
33 startLoginServer = true;
34 }
35 /*
36 if (args[i] == "-loginserver")
37 {
38 startLoginServer = true;
39 }*/
40 if (args[i] == "-accounts")
41 {
42 userAccounts = true;
43 }
44 if (args[i] == "-realphysx")
45 {
46 physicsEngine = "RealPhysX";
47 allowFlying = true;
48 }
49 if (args[i] == "-ode")
50 {
51 physicsEngine = "OpenDynamicsEngine";
52 allowFlying = true;
53 }
54 if (args[i] == "-localasset")
55 {
56 gridLocalAsset = true;
57 }
58 if (args[i] == "-configfile")
59 {
60 useConfigFile = true;
61 }
62 if (args[i] == "-noverbose")
63 {
64 silent = true;
65 }
66 if (args[i] == "-config")
67 {
68 try
69 {
70 i++;
71 configFile = args[i];
72 }
73 catch (Exception e)
74 {
75 Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")");
76 }
77 }
78 }
79
80 OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile);
81 // OpenSimRoot.Instance.Application = sim;
82 sim.m_sandbox = sandBoxMode;
83 sim.user_accounts = userAccounts;
84 sim.gridLocalAsset = gridLocalAsset;
85 OpenSim.world.Avatar.PhysicsEngineFlying = allowFlying;
86
87 sim.StartUp();
88
89 while (true)
90 {
91 OpenSim.Framework.Console.MainConsole.Instance.MainConsolePrompt();
92 }
93 }
94 }
95}
diff --git a/OpenSim/OpenSim/OpenSim.csproj b/OpenSim/OpenSim/OpenSim.csproj
new file mode 100644
index 0000000..069c5c6
--- /dev/null
+++ b/OpenSim/OpenSim/OpenSim.csproj
@@ -0,0 +1,147 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{438A9556-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Exe</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="libsecondlife.dll" >
70 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="Axiom.MathLib.dll" >
74 <HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" >
78 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="..\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj">
84 <Name>OpenSim.Terrain.BasicTerrain</Name>
85 <Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 <ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
90 <Name>OpenSim.Framework</Name>
91 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private>
94 </ProjectReference>
95 <ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
96 <Name>OpenSim.Framework.Console</Name>
97 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
98 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
99 <Private>False</Private>
100 </ProjectReference>
101 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
102 <Name>OpenSim.Physics.Manager</Name>
103 <Project>{8BE16150-0000-0000-0000-000000000000}</Project>
104 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
105 <Private>False</Private>
106 </ProjectReference>
107 <ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
108 <Name>OpenSim.Servers</Name>
109 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
110 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
111 <Private>False</Private>
112 </ProjectReference>
113 <ProjectReference Include="..\OpenSim.RegionServer\OpenSim.RegionServer.csproj">
114 <Name>OpenSim.RegionServer</Name>
115 <Project>{632E1BFD-0000-0000-0000-000000000000}</Project>
116 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
117 <Private>False</Private>
118 </ProjectReference>
119 <ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
120 <Name>OpenSim.GenericConfig.Xml</Name>
121 <Project>{E88EF749-0000-0000-0000-000000000000}</Project>
122 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
123 <Private>False</Private>
124 </ProjectReference>
125 <ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj">
126 <Name>XMLRPC</Name>
127 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
128 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
129 <Private>False</Private>
130 </ProjectReference>
131 </ItemGroup>
132 <ItemGroup>
133 <Compile Include="Application.cs">
134 <SubType>Code</SubType>
135 </Compile>
136 <Compile Include="OpenSimMain.cs">
137 <SubType>Code</SubType>
138 </Compile>
139 </ItemGroup>
140 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
141 <PropertyGroup>
142 <PreBuildEvent>
143 </PreBuildEvent>
144 <PostBuildEvent>
145 </PostBuildEvent>
146 </PropertyGroup>
147</Project>
diff --git a/OpenSim/OpenSim/OpenSim.csproj.user b/OpenSim/OpenSim/OpenSim.csproj.user
new file mode 100644
index 0000000..1422ebf
--- /dev/null
+++ b/OpenSim/OpenSim/OpenSim.csproj.user
@@ -0,0 +1,13 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <StartArguments>-loginserver -sandbox -accounts</StartArguments>
6 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
7 <LastOpenVersion>8.0.50727</LastOpenVersion>
8 <ProjectView>ProjectFiles</ProjectView>
9 <ProjectTrust>0</ProjectTrust>
10 </PropertyGroup>
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
12 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
13</Project>
diff --git a/OpenSim/OpenSim/OpenSim.exe.build b/OpenSim/OpenSim/OpenSim.exe.build
new file mode 100644
index 0000000..4f8ca8a
--- /dev/null
+++ b/OpenSim/OpenSim/OpenSim.exe.build
@@ -0,0 +1,52 @@
1<?xml version="1.0" ?>
2<project name="OpenSim" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
11 <resources prefix="OpenSim" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="Application.cs" />
15 <include name="OpenSimMain.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="System.Xml.dll" />
24 <include name="../../bin/libsecondlife.dll" />
25 <include name="../../bin/Axiom.MathLib.dll" />
26 <include name="../../bin/Db4objects.Db4o.dll" />
27 <include name="../../bin/OpenSim.Terrain.BasicTerrain.dll" />
28 <include name="../../bin/OpenSim.Framework.dll" />
29 <include name="../../bin/OpenSim.Framework.Console.dll" />
30 <include name="../../bin/OpenSim.Physics.Manager.dll" />
31 <include name="../../bin/OpenSim.Servers.dll" />
32 <include name="../../bin/OpenSim.RegionServer.dll" />
33 <include name="../../bin/OpenSim.GenericConfig.Xml.dll" />
34 <include name="../../bin/XMLRPC.dll" />
35 </references>
36 </csc>
37 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
38 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
39 <copy todir="${project::get-base-directory()}/../../bin/">
40 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
41 <include name="*.dll"/>
42 <include name="*.exe"/>
43 </fileset>
44 </copy>
45 </target>
46 <target name="clean">
47 <delete dir="${bin.dir}" failonerror="false" />
48 <delete dir="${obj.dir}" failonerror="false" />
49 </target>
50 <target name="doc" description="Creates documentation.">
51 </target>
52</project>
diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs
new file mode 100644
index 0000000..9025316
--- /dev/null
+++ b/OpenSim/OpenSim/OpenSimMain.cs
@@ -0,0 +1,533 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3
4* All rights reserved.
5*
6* Redistribution and use in source and binary forms, with or without
7* modification, are permitted provided that the following conditions are met:
8* * Redistributions of source code must retain the above copyright
9* notice, this list of conditions and the following disclaimer.
10* * Redistributions in binary form must reproduce the above copyright
11* notice, this list of conditions and the following disclaimer in the
12* documentation and/or other materials provided with the distribution.
13* * Neither the name of the <organization> nor the
14* names of its contributors may be used to endorse or promote products
15* derived from this software without specific prior written permission.
16*
17* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
18* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
21* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*/
28
29using System;
30using System.Text;
31using System.IO;
32using System.Threading;
33using System.Net;
34using System.Net.Sockets;
35using System.Timers;
36using System.Reflection;
37using System.Collections;
38using System.Collections.Generic;
39using libsecondlife;
40using libsecondlife.Packets;
41using OpenSim.world;
42using OpenSim.Terrain;
43using OpenSim.Framework.Interfaces;
44using OpenSim.Framework.Types;
45using OpenSim.UserServer;
46using OpenSim.Assets;
47using OpenSim.CAPS;
48using OpenSim.Framework.Console;
49using OpenSim.Physics.Manager;
50using Nwc.XmlRpc;
51using OpenSim.Servers;
52using OpenSim.GenericConfig;
53
54namespace OpenSim
55{
56
57 public class OpenSimMain : RegionServerBase, conscmd_callback
58 {
59 private CheckSumServer checkServer;
60
61 public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
62 {
63 this.configFileSetup = useConfigFile;
64 m_sandbox = sandBoxMode;
65 m_loginserver = startLoginServer;
66 m_physicsEngine = physicsEngine;
67 m_config = configFile;
68
69 m_console = new ConsoleBase("region-console-" + Guid.NewGuid().ToString() + ".log", "Region", this, silent);
70 OpenSim.Framework.Console.MainConsole.Instance = m_console;
71 }
72
73 /// <summary>
74 /// Performs initialisation of the world, such as loading configuration from disk.
75 /// </summary>
76 public override void StartUp()
77 {
78 this.regionData = new RegionInfo();
79 try
80 {
81 this.localConfig = new XmlConfig(m_config);
82 this.localConfig.LoadData();
83 }
84 catch (Exception e)
85 {
86 Console.WriteLine(e.Message);
87 }
88 if (this.configFileSetup)
89 {
90 this.SetupFromConfigFile(this.localConfig);
91 }
92 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Loading configuration");
93 this.regionData.InitConfig(this.m_sandbox, this.localConfig);
94 this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
95
96 GridServers = new Grid();
97 if (m_sandbox)
98 {
99 this.SetupLocalGridServers();
100 //Authenticate Session Handler
101 AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
102 this.AuthenticateSessionsHandler = authen;
103 this.checkServer = new CheckSumServer(12036);
104 this.checkServer.ServerListener();
105 }
106 else
107 {
108 this.SetupRemoteGridServers();
109 //Authenticate Session Handler
110 AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote();
111 this.AuthenticateSessionsHandler = authen;
112 }
113
114 startuptime = DateTime.Now;
115
116 try
117 {
118 AssetCache = new AssetCache(GridServers.AssetServer);
119 InventoryCache = new InventoryCache();
120 }
121 catch (Exception e)
122 {
123 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup local cache");
124 Environment.Exit(1);
125 }
126
127 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);
128
129 //should be passing a IGenericConfig object to these so they can read the config data they want from it
130 GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey);
131 IGridServer gridServer = GridServers.GridServer;
132 gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey);
133
134 if (!m_sandbox)
135 {
136 this.ConnectToRemoteGridServer();
137 }
138
139 this.SetupLocalWorld();
140
141 if (m_sandbox)
142 {
143 AssetCache.LoadDefaultTextureSet();
144 }
145
146 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Initialising HTTP server");
147
148 this.SetupHttpListener();
149
150 //Login server setup
151 LoginServer loginServer = null;
152 LoginServer adminLoginServer = null;
153
154 bool sandBoxWithLoginServer = m_loginserver && m_sandbox;
155 if (sandBoxWithLoginServer)
156 {
157 loginServer = new LoginServer(regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts);
158 loginServer.Startup();
159 loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler).AddNewSession);
160
161 if (user_accounts)
162 {
163 //sandbox mode with loginserver using accounts
164 this.GridServers.UserServer = loginServer;
165 adminLoginServer = loginServer;
166
167 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.LocalUserManager.XmlRpcLoginMethod);
168 }
169 else
170 {
171 //sandbox mode with loginserver not using accounts
172 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
173 }
174 }
175
176 //Web front end setup
177 AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer);
178 adminWebFront.LoadMethods(httpServer);
179
180 //Start http server
181 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP server");
182 httpServer.Start();
183
184 // Start UDP server
185 this.m_udpServer.ServerListener();
186
187 m_heartbeatTimer.Enabled = true;
188 m_heartbeatTimer.Interval = 100;
189 m_heartbeatTimer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
190 }
191
192 # region Setup methods
193 protected override void SetupLocalGridServers()
194 {
195 GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll";
196 GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll";
197
198 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Sandbox mode");
199
200 try
201 {
202 GridServers.Initialise();
203 }
204 catch (Exception e)
205 {
206 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface");
207 Environment.Exit(1);
208 }
209 }
210
211 protected override void SetupRemoteGridServers()
212 {
213 if (this.gridLocalAsset)
214 {
215 GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll";
216 }
217 else
218 {
219 GridServers.AssetDll = "OpenSim.GridInterfaces.Remote.dll";
220 }
221 GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll";
222
223 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Grid mode");
224
225 try
226 {
227 GridServers.Initialise();
228 }
229 catch (Exception e)
230 {
231 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface");
232 Environment.Exit(1);
233 }
234 }
235
236 protected override void SetupLocalWorld()
237 {
238 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString());
239 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Initialising world");
240 m_console.componentname = "Region " + regionData.RegionName;
241
242 m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName);
243 LocalWorld.InventoryCache = InventoryCache;
244 LocalWorld.AssetCache = AssetCache;
245
246 this.m_udpServer.LocalWorld = LocalWorld;
247 this.m_udpServer.PacketServer.RegisterClientPacketHandlers();
248
249 this.physManager = new OpenSim.Physics.Manager.PhysicsManager();
250 this.physManager.LoadPlugins();
251
252 LocalWorld.m_datastore = this.regionData.DataStore;
253
254 LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded.
255 LocalWorld.LoadWorldMap();
256
257 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting up messaging system");
258 LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
259 LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
260 LocalWorld.LoadPrimsFromStorage();
261 }
262
263 protected override void SetupHttpListener()
264 {
265 httpServer = new BaseHttpServer(regionData.IPListenPort);
266
267 if (this.GridServers.GridServer.GetName() == "Remote")
268 {
269
270 // we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
271 httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler).ExpectUser);
272
273 httpServer.AddXmlRPCHandler("agent_crossing",
274 delegate(XmlRpcRequest request)
275 {
276 Hashtable requestData = (Hashtable)request.Params[0];
277 uint circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
278
279 AgentCircuitData agent_data = new AgentCircuitData();
280 agent_data.firstname = (string)requestData["firstname"];
281 agent_data.lastname = (string)requestData["lastname"];
282 agent_data.circuitcode = circuitcode;
283 agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]), Single.Parse((string)requestData["pos_y"]), Single.Parse((string)requestData["pos_z"]));
284
285 AuthenticateSessionsHandler.UpdateAgentData(agent_data);
286
287 return new XmlRpcResponse();
288 });
289
290 httpServer.AddRestHandler("GET", "/simstatus/",
291 delegate(string request, string path, string param)
292 {
293 return "OK";
294 });
295 }
296 }
297
298 protected override void ConnectToRemoteGridServer()
299 {
300 if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort))
301 {
302 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Success: Got a grid connection OK!");
303 }
304 else
305 {
306 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "Main.cs:Startup() - FAILED: Unable to get connection to grid. Shutting down.");
307 Shutdown();
308 }
309
310 GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]);
311
312 // If we are being told to load a file, load it.
313 string dataUri = (string)((RemoteGridBase)GridServers.GridServer).GridData["data_uri"];
314
315 if (!String.IsNullOrEmpty(dataUri))
316 {
317 this.LocalWorld.m_datastore = dataUri;
318 }
319
320 if (((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString() != "")
321 {
322 // The grid server has told us who we are
323 // We must obey the grid server.
324 try
325 {
326 regionData.RegionLocX = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locx"].ToString());
327 regionData.RegionLocY = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locy"].ToString());
328 regionData.RegionName = ((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString();
329 }
330 catch (Exception e)
331 {
332 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, e.Message + "\nBAD ERROR! THIS SHOULD NOT HAPPEN! Bad GridData from the grid interface!!!! ZOMG!!!");
333 Environment.Exit(1);
334 }
335 }
336 }
337
338 #endregion
339
340 private void SetupFromConfigFile(IGenericConfig configData)
341 {
342 try
343 {
344 // SandBoxMode
345 string attri = "";
346 attri = configData.GetAttribute("SandBox");
347 if ((attri == "") || ((attri != "false") && (attri != "true")))
348 {
349 this.m_sandbox = false;
350 configData.SetAttribute("SandBox", "false");
351 }
352 else
353 {
354 this.m_sandbox = Convert.ToBoolean(attri);
355 }
356
357 // LoginServer
358 attri = "";
359 attri = configData.GetAttribute("LoginServer");
360 if ((attri == "") || ((attri != "false") && (attri != "true")))
361 {
362 this.m_loginserver = false;
363 configData.SetAttribute("LoginServer", "false");
364 }
365 else
366 {
367 this.m_loginserver = Convert.ToBoolean(attri);
368 }
369
370 // Sandbox User accounts
371 attri = "";
372 attri = configData.GetAttribute("UserAccount");
373 if ((attri == "") || ((attri != "false") && (attri != "true")))
374 {
375 this.user_accounts = false;
376 configData.SetAttribute("UserAccounts", "false");
377 }
378 else if (attri == "true")
379 {
380 this.user_accounts = Convert.ToBoolean(attri);
381 }
382
383 // Grid mode hack to use local asset server
384 attri = "";
385 attri = configData.GetAttribute("LocalAssets");
386 if ((attri == "") || ((attri != "false") && (attri != "true")))
387 {
388 this.gridLocalAsset = false;
389 configData.SetAttribute("LocalAssets", "false");
390 }
391 else if (attri == "true")
392 {
393 this.gridLocalAsset = Convert.ToBoolean(attri);
394 }
395
396
397 attri = "";
398 attri = configData.GetAttribute("PhysicsEngine");
399 switch (attri)
400 {
401 default:
402 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Main.cs: SetupFromConfig() - Invalid value for PhysicsEngine attribute, terminating");
403 Environment.Exit(1);
404 break;
405
406 case "":
407 this.m_physicsEngine = "basicphysics";
408 configData.SetAttribute("PhysicsEngine", "basicphysics");
409 OpenSim.world.Avatar.PhysicsEngineFlying = false;
410 break;
411
412 case "basicphysics":
413 this.m_physicsEngine = "basicphysics";
414 configData.SetAttribute("PhysicsEngine", "basicphysics");
415 OpenSim.world.Avatar.PhysicsEngineFlying = false;
416 break;
417
418 case "RealPhysX":
419 this.m_physicsEngine = "RealPhysX";
420 OpenSim.world.Avatar.PhysicsEngineFlying = true;
421 break;
422
423 case "OpenDynamicsEngine":
424 this.m_physicsEngine = "OpenDynamicsEngine";
425 OpenSim.world.Avatar.PhysicsEngineFlying = true;
426 break;
427 }
428
429 configData.Commit();
430 }
431 catch (Exception e)
432 {
433 Console.WriteLine(e.Message);
434 Console.WriteLine("\nSorry, a fatal error occurred while trying to initialise the configuration data");
435 Console.WriteLine("Can not continue starting up");
436 Environment.Exit(1);
437 }
438 }
439
440 /// <summary>
441 /// Performs any last-minute sanity checking and shuts down the region server
442 /// </summary>
443 public virtual void Shutdown()
444 {
445 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing all threads");
446 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing listener thread");
447 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing clients");
448 // IMPLEMENT THIS
449 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing console and terminating");
450 LocalWorld.Close();
451 GridServers.Close();
452 m_console.Close();
453 Environment.Exit(0);
454 }
455
456 /// <summary>
457 /// Performs per-frame updates regularly
458 /// </summary>
459 /// <param name="sender"></param>
460 /// <param name="e"></param>
461 void Heartbeat(object sender, System.EventArgs e)
462 {
463 LocalWorld.Update();
464 }
465
466 #region Console Commands
467 /// <summary>
468 /// Runs commands issued by the server console from the operator
469 /// </summary>
470 /// <param name="command">The first argument of the parameter (the command)</param>
471 /// <param name="cmdparams">Additional arguments passed to the command</param>
472 public void RunCmd(string command, string[] cmdparams)
473 {
474 switch (command)
475 {
476 case "help":
477 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "show users - show info about connected users");
478 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "shutdown - disconnect all clients and shutdown");
479 break;
480
481 case "show":
482 Show(cmdparams[0]);
483 break;
484
485 case "terrain":
486 string result = "";
487 if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams, ref result))
488 {
489 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, result);
490 }
491 break;
492
493 case "shutdown":
494 Shutdown();
495 break;
496
497 default:
498 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "Unknown command");
499 break;
500 }
501 }
502
503 /// <summary>
504 /// Outputs to the console information about the region
505 /// </summary>
506 /// <param name="ShowWhat">What information to display (valid arguments are "uptime", "users")</param>
507 public void Show(string ShowWhat)
508 {
509 switch (ShowWhat)
510 {
511 case "uptime":
512 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "OpenSim has been running since " + startuptime.ToString());
513 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "That is " + (DateTime.Now - startuptime).ToString());
514 break;
515 case "users":
516 OpenSim.world.Avatar TempAv;
517 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP"));
518 foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys)
519 {
520 if (LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
521 {
522 TempAv = (OpenSim.world.Avatar)LocalWorld.Entities[UUID];
523 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, 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()));
524 }
525 }
526 break;
527 }
528 }
529 #endregion
530 }
531
532
533} \ No newline at end of file
diff --git a/Prebuild/Prebuild.build b/Prebuild/Prebuild.build
new file mode 100644
index 0000000..395fb31
--- /dev/null
+++ b/Prebuild/Prebuild.build
@@ -0,0 +1,67 @@
1<?xml version="1.0" ?>
2<project name="Prebuild" default="build">
3 <echo message="Using '${nant.settings.currentframework}' Framework"/>
4
5 <property name="bin.dir" value="bin" />
6 <property name="obj.dir" value="obj" />
7 <property name="doc.dir" value="doc" />
8 <property name="project.main.dir" value="${project::get-base-directory()}" />
9
10 <target name="Debug" description="">
11 <property name="project.config" value="Debug" />
12 <property name="build.debug" value="true" />
13 </target>
14
15 <property name="project.config" value="Release" />
16
17 <target name="Release" description="">
18 <property name="project.config" value="Release" />
19 <property name="build.debug" value="false" />
20 </target>
21
22 <target name="net-1.1" description="Sets framework to .NET 1.1">
23 <property name="nant.settings.currentframework" value="net-1.1" />
24 </target>
25
26 <target name="net-2.0" description="Sets framework to .NET 2.0">
27 <property name="nant.settings.currentframework" value="net-2.0" />
28 </target>
29
30 <target name="mono-2.0" description="Sets framework to mono 2.0">
31 <property name="nant.settings.currentframework" value="mono-2.0" />
32 </target>
33
34 <target name="mono-1.0" description="Sets framework to mono 1.0">
35 <property name="nant.settings.currentframework" value="mono-1.0" />
36 </target>
37
38 <target name="init" description="">
39 <call target="${project.config}" />
40 <sysinfo />
41 <echo message="Platform ${sys.os.platform}" />
42 <property name="build.dir" value="${bin.dir}/${project.config}" />
43 </target>
44
45 <target name="clean" description="">
46 <echo message="Deleting all builds from all configurations" />
47 <delete dir="${bin.dir}" failonerror="false" />
48 <delete dir="${obj.dir}" failonerror="false" />
49 <nant buildfile="src/Prebuild.exe.build" target="clean" />
50 </target>
51
52 <target name="build" depends="init" description="">
53 <nant buildfile="src/Prebuild.exe.build" target="build" />
54 </target>
55
56 <target name="build-release" depends="Release, init, build" description="Builds in Release mode" />
57
58 <target name="build-debug" depends="Debug, init, build" description="Builds in Debug mode" />
59
60 <target name="package" depends="clean, doc" description="Builds all" />
61
62 <target name="doc" depends="build-release">
63 <echo message="Generating all documentation from all builds" />
64 <nant buildfile="src/Prebuild.exe.build" target="doc" />
65 </target>
66
67</project>
diff --git a/Prebuild/Prebuild.sln b/Prebuild/Prebuild.sln
new file mode 100644
index 0000000..449896b
--- /dev/null
+++ b/Prebuild/Prebuild.sln
@@ -0,0 +1,19 @@
1Microsoft Visual Studio Solution File, Format Version 9.00
2# Visual Studio 2005
3Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prebuild", "src\Prebuild.csproj", "{92E80C1C-0000-0000-0000-000000000000}"
4EndProject
5Global
6 GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 Debug|Any CPU = Debug|Any CPU
8 Release|Any CPU = Release|Any CPU
9 EndGlobalSection
10 GlobalSection(ProjectConfigurationPlatforms) = postSolution
11 {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12 {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
13 {92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
14 {92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
15 EndGlobalSection
16 GlobalSection(SolutionProperties) = preSolution
17 HideSolutionNode = FALSE
18 EndGlobalSection
19EndGlobal
diff --git a/Prebuild/README b/Prebuild/README
new file mode 100644
index 0000000..eca6be1
--- /dev/null
+++ b/Prebuild/README
@@ -0,0 +1,230 @@
1Prebuild Instructions
2
3Prebuild 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.
4
5_________________________________________________________________________________
6Overview
7
8Prebuild 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.
9The Prebuild file
10
11_________________________________________________________________________________
12The currently supported developement tools and their associated batch and shell script files.
13
14Visual Studio .NET 2005 (VS2005.bat)
15Visual Studio .NET 2003 (VS2003.bat)
16Visual Studio .NET 2002 (VS2002.bat)
17SharpDevelop (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/
18SharpDevelop2 (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/
19MonoDevelop (MonoDevelop.sh) - http://www.monodevelop.com/
20NAnt (nant.sh and nant.bat) - http://nant.sourceforge.net/
21Autotools (autotools.bat and autotools.sh) http://www.gnu.org. Only partial support
22
23Notes:
24A Unix Shell script is provided for MonoDevelop, as this is more appropriate than a windows batch file.
25Visual Studio .NET 2005 and the Visual Express IDE's can import solutions from older versions of Visual Studio .NET.
26Makefiles are not currently supported.
27
28_________________________________________________________________________________
29Command Line Syntax:
30
31Example:
32>Prebuild /target vs2003
33
34This 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
35
36
37The syntax structure is as below, where commandParameter is optional depending on the command and you can provide several option-value pairs.
38Note: The '>' signified the command line, do not actually enter this manually
39
40>Prebuild /<option> <commandParameter>
41
42>Prebuild /target vs2003 /pause
43
44>Prebuild /target vs2003 /log ../Log.txt /pause /ppo /file ProjectConfig.xml
45
46>Prebuild /target sharpdev /log
47
48>Prebuild /removedir obj|bin
49
50>Prebuild /target vs2003 /allowedgroups Group1|Group2
51
52>Prebuild /clean
53
54>Prebuild /clean /yes
55
56>Prebuild /clean vs2003
57
58_________________________________________________________________________________
59Command Line Options:
60
61/usage - Shows the help information on how to use Prebuild and what the different options are and what they do
62
63/clean - The project files generated for the target type specified as a parameter for this option will be deleted. If no value is specified or if 'all' is specified, then project files for all the target types will be deleted.
64
65/target - Specified the name of the development tool for which project or make files will be generated. Possible parameter values include: vs2003, vs2002, sharpdev
66
67/file - Specifies the name of the XML which defines what files are to be referenced by the generated project files as well as configures the options for them. If not specified, prebuild.xml will be used as the default.
68
69/log - Specified the log file that should be written to for build errors. If this option is not specified, no log file is generated, but if just no value is specified, then the defaul filename will be used for the log (Prebuild.log).
70
71/ppo - Preprocesses the xml file to test for syntax errors or problems but doesn't generate the files
72
73/pause - Shows the console until you press a key so that you can view the messages written while performing the specified actions.
74This allows you to check if an errors occurred and - if so - what it was.
75
76/showtargets - Shows a list of all the targets that can be specified as values for the /clean and /target commands.
77
78/allowedgroups - This is followed by a pipe-delimited list of project group filter flags (eg. Group1|Group2) allow optional filtering of all projects that dont have at least one of these flags
79
80/removedir - This is followed by a pipe-delimited list of directory names that will be deleted while recursivly searching the directory of the prebuild application and its child directories (eg. use obj|bin to delete all output and temporary directories before file releases)
81
82/yes - Answer yes to any warnings (e.g. when cleaning all projects).
83
84_________________________________________________________________________________
85Example Batch Files and Shell Scripts
86
87NOTE: Common batch and shell script files are included with Prebuild source and file releases.
88______________________________
89MonoDevelop
90
91#!/bin/sh
92# Generates a combine (.cmbx) and a set of project files (.prjx)
93# for MonoDevelop, a Mono port of SharpDevelop (http://icsharpcode.net/OpenSource/SD/Default.aspx)
94./Prebuild /target sharpdev /pause
95
96______________________________
97Visual Studio .NET 2003
98
99@rem Generates a solution (.sln) and a set of project files (.csproj)
100@rem for Microsoft Visual Studio .NET 2002
101Prebuild /target vs2003 /pause
102
103Notes:
104Text after lines that start with @rem are comments and are not evaluated
105You can also place pause on the last line instead of specifing the /pause command.
106
107________________________________________________________________________________
108Example XML Configuration File
109
110Note:
111XML Comments (<!-- Comment -->) are used to markup the prebuild.xml file with notes
112The below file may be out-of-date, however the RealmForge Prebuild file serves as an up-to-date and extensive example.
113It can be viewed using Tigris.org's WebSVN (http://realmforge.tigris.org/source/browse/realmforge/trunk/src/prebuild.xml) by just clicking on the "view file" link for the latest revision.
114
115_________________________________
116
117<?xml version="1.0" encoding="utf-8"?>
118 <!--The version of the XML schema specified in the version and xmlns attributes should match the one for which the version of Prebuild.exe used was compiled for. In this example it is the version 1.3 schema, you can find the XSD schema file at the url specified in the xmlns attribute. -->
119<Prebuild version="1.6" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd">
120 <Solution name="RealmForge"> <!--The title and file name for the solution, combine, workspace, or project group (depending on what development tool you are using)-->
121 <!--Configurations found as children of Solution are used as templates for the configurations found in the project, this allows you to avoid writing the same options in each project (and maintaining each of these). You can provide defaults and then override them in the configurations defined for each project. All options are optional.-->
122 <Configuration name="Debug">
123 <Options>
124 <!-- simple logically expressions can be evaluated, if, else, elseif, and endif are valid statements. Note that it is not neccisary to define POSIX or WIN32 -->
125 <?if OS = "Win32" ?>
126 <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines>
127 <?else ?>
128 <CompilerDefines>DEBUG;TRACE;POSIX</CompilerDefines>
129 <?endif ?>
130 <OptimizeCode>false</OptimizeCode>
131 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
132 <AllowUnsafe>false</AllowUnsafe>
133 <WarningLevel>4</WarningLevel>
134 <!-The filter for the number of warnings or errors shown and the tolerance level as to what is an error. This is value from 0 to 4 where 4 is the most strict (least tolerent).-->
135
136 <WarningsAsErrors>false</WarningsAsErrors>
137 <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings>
138 <!-- A semicolon ';' delimited list of the warnings that are filtered and not shown in the output window during compiling a project. Only include the number portion of the warning codes that are shown in output during compilation (eg CS1591, should be entered as 1591)-->
139
140 <OutputPath>..\bin</OutputPath>
141 <DebugInformation>true</DebugInformation>
142 <RegisterComInterop>false</RegisterComInterop>
143 <IncrementalBuild>true</IncrementalBuild>
144 <BaseAddress>285212672</BaseAddress>
145 <FileAlignment>4096</FileAlignment>
146 <NoStdLib>false</NoStdLib>
147 <XmlDocFile>Docs.xml</XmlDocFile>
148 </Options>
149 </Configuration>
150 <Configuration name="Release"> <!-- You can define multple configurations that projects can have, but there is no way to define which one is selected by default as this is a part of the user preferences for a project, not the solution or project files -->
151 <Options>
152 <CompilerDefines>TRACE</CompilerDefines>
153 <OptimizeCode>true</OptimizeCode>
154 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
155 <AllowUnsafe>false</AllowUnsafe>
156 <WarningLevel>4</WarningLevel>
157 <WarningsAsErrors>false</WarningsAsErrors>
158 <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings>
159 <OutputPath>..\bin</OutputPath>
160 <DebugInformation>false</DebugInformation>
161 <RegisterComInterop>false</RegisterComInterop>
162 <IncrementalBuild>true</IncrementalBuild>
163 <BaseAddress>285212672</BaseAddress>
164 <FileAlignment>4096</FileAlignment>
165 <NoStdLib>false</NoStdLib>
166 <GenerateXmlDocFile>true</GenerateXmlDocFile>
167 <XmlDocFile>Docs.xml</XmlDocFile>
168 </Options>
169 </Configuration>
170
171 <!-- One of the projects that is included in the Solution -->
172 <Project name="RealmForge.Utility" Language="VisualBasic" path="Utility" type="Library" assemblyName="RealmForge.Utility" rootNamespace="RealmForge">
173 <Configuration name="Debug">
174 <Options>
175 <OutputPath>..\bin\lib\Utility</OutputPath>
176 <XmlDocFile>RealmForge.Utility.xml</XmlDocFile>
177 </Options>
178 </Configuration>
179 <Configuration name="Release">
180 <Options>
181 <OutputPath>..\bin\lib\Utility</OutputPath>
182 <XmlDocFile>RealmForge.Utility.xml</XmlDocFile>
183 </Options>
184 </Configuration>
185 <ReferencePath>../bin</ReferencePath>
186 <Reference name="System"/>
187 <Reference name="System.Data"/>
188 <Reference name="System.Drawing"/>
189 <Reference name="System.Xml"/>
190 <Reference name="System.Runtime.Serialization.Formatters.Soap"/>
191 <Reference name="ICSharpCode.SharpZipLib"/>
192 <Files>
193 <Match path="." pattern="*.vb" recurse="true"/>
194 </Files>
195 </Project>
196
197 <!-- Another projects that is included in the Solution -->
198 <Project name="DemoGame" Language="C#" path="DemoGame" type="WinExe" icon="..\bin\RealmForge.ico" assemblyName="DemoGame" rootNamespace="RealmForge">
199 <!-- icon is used to define the location of the .ico file that is embeeded in the assembly when the project is compiled. This is relative to the project path -->
200 <!--type defines the type of project, valid types are Library (.dll), WinExe (.exe), and Exe (.exe). WinExe is not windows specific, it just defines that it is a GUI application and that no Console or Command window will show when it is started-->
201
202 <Configuration name="Debug">
203 <Options>
204 <OutputPath>..\bin</OutputPath>
205 <XmlDocFile>DemoGame.xml</XmlDocFile>
206 </Options>
207 </Configuration>
208 <Configuration name="Release">
209 <Options>
210 <OutputPath>..\bin</OutputPath>
211 <XmlDocFile>DemoGame.xml</XmlDocFile>
212 </Options>
213 </Configuration>
214 <ReferencePath>../bin</ReferencePath>
215 <Reference name="System"/> <!-- Assemblies that are located in the GAC (installed, global) can be referenced-->
216 <Reference name="ode"/> <!-- Assemblies that are located in the output directory to which the file is built can be referenced -->
217 <Reference name="RealmForge.Utility"/> <!-- When you reference the name of another project, then that project (and it's output) will be referenced instead of looking for a pre-built assembly-->
218 <Files>
219 <Match path="." pattern="*.cs" recurse="true"/>
220 <Match path="." pattern="*.bmp" recurse="true" buildAction="EmbeddedResource"/>
221 <Match path="." pattern="[^a]*\.(png|jpg)" useRegex="true" buildAction="EmbeddedResource"/>
222
223 <!-- Uses a regex or regular expression to find all files that end with .png or .jpg but dont have the letter 'a' in their name and add them to the project as EmbeddedResource's. Because recurse enabled (default is false), only the values in the files in that are directly in the project directory (not child directories) are checked.-->
224 <!--EmbeddedResource, Content, and Compile are valid buildAction's-->
225 </Files>
226 </Project>
227
228 </Solution>
229</Prebuild>
230
diff --git a/Prebuild/TODO b/Prebuild/TODO
new file mode 100644
index 0000000..d01780a
--- /dev/null
+++ b/Prebuild/TODO
@@ -0,0 +1,21 @@
1* monodev target should be able to detect whether the project is 1.x
2 or 2.x runtime
3
4* make an autotools install target for .exe files
5
6* Fix the autotools target so that
7
8if(numProjects == 1){
9 for($projectDir){
10 generate_a_project_configure_dot_ac()
11 }
12}else{
13 generate_a_solution_configure_dot_ac()
14
15 foreach($project in $projectsList){
16 mkdir $project/
17 cd $project/
18 generate_a_project_configure_dot_ac
19 }
20}
21
diff --git a/Prebuild/doc/prebuild-example1.xml b/Prebuild/doc/prebuild-example1.xml
new file mode 100644
index 0000000..ea6f455
--- /dev/null
+++ b/Prebuild/doc/prebuild-example1.xml
@@ -0,0 +1,300 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Prebuild version="1.6" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd">
3 <Solution name="RealmForge">
4 <Configuration name="Debug">
5 <Options>
6 <CompilerDefines>TRACE;DEBUG</CompilerDefines>
7 <OptimizeCode>false</OptimizeCode>
8 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
9 <AllowUnsafe>false</AllowUnsafe>
10 <WarningLevel>4</WarningLevel>
11 <WarningsAsErrors>false</WarningsAsErrors>
12 <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings>
13 <OutputPath>..\bin</OutputPath>
14 <DebugInformation>true</DebugInformation>
15 <RegisterComInterop>false</RegisterComInterop>
16 <IncrementalBuild>true</IncrementalBuild>
17 <BaseAddress>285212672</BaseAddress>
18 <FileAlignment>4096</FileAlignment>
19 <NoStdLib>false</NoStdLib>
20 <XmlDocFile>Docs.xml</XmlDocFile>
21 </Options>
22 </Configuration>
23 <Configuration name="Release">
24 <Options>
25 <CompilerDefines>TRACE</CompilerDefines>
26 <OptimizeCode>true</OptimizeCode>
27 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
28 <AllowUnsafe>false</AllowUnsafe>
29 <WarningLevel>4</WarningLevel>
30 <WarningsAsErrors>false</WarningsAsErrors>
31 <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings>
32 <OutputPath>..\bin</OutputPath>
33 <DebugInformation>false</DebugInformation>
34 <RegisterComInterop>false</RegisterComInterop>
35 <IncrementalBuild>true</IncrementalBuild>
36 <BaseAddress>285212672</BaseAddress>
37 <FileAlignment>4096</FileAlignment>
38 <NoStdLib>false</NoStdLib>
39 <XmlDocFile>Docs.xml</XmlDocFile>
40 </Options>
41 </Configuration>
42
43 <Project name="RealmForge.Utility" path="Utility" type="Library" assemblyName="RealmForge.Utility" rootNamespace="RealmForge">
44 <Configuration name="Debug">
45 <Options>
46 <OutputPath>..\bin\lib\Utility</OutputPath>
47 <XmlDocFile>RealmForge.Utility.xml</XmlDocFile>
48 </Options>
49 </Configuration>
50 <Configuration name="Release">
51 <Options>
52 <OutputPath>..\bin\lib\Utility</OutputPath>
53 <XmlDocFile>RealmForge.Utility.xml</XmlDocFile>
54 </Options>
55 </Configuration>
56 <ReferencePath>../bin</ReferencePath>
57 <Reference name="System"/>
58 <Reference name="System.Data"/>
59 <Reference name="System.Drawing"/>
60 <Reference name="System.Xml"/>
61 <Reference name="System.Runtime.Serialization.Formatters.Soap"/>
62 <Reference name="ICSharpCode.SharpZipLib"/>
63 <Files>
64 <Match pattern="*.cs" recurse="true"/>
65 </Files>
66 </Project>
67
68 <Project name="RealmForge.Framework" path="Framework" type="Library" assemblyName="RealmForge.Framework" rootNamespace="RealmForge">
69 <Configuration name="Debug">
70 <Options>
71 <OutputPath>..\bin\lib\Framework</OutputPath>
72 <XmlDocFile>RealmForge.Framework.xml</XmlDocFile>
73 </Options>
74 </Configuration>
75 <Configuration name="Release">
76 <Options>
77 <OutputPath>..\bin\lib\Framework</OutputPath>
78 <XmlDocFile>RealmForge.Framework.xml</XmlDocFile>
79 </Options>
80 </Configuration>
81 <ReferencePath>../bin</ReferencePath>
82 <Reference name="System"/>
83 <Reference name="System.Data"/>
84 <Reference name="System.Xml"/>
85 <Reference name="System.Windows.Forms"/>
86 <Reference name="System.Drawing"/>
87 <Reference name="Axiom.MathLib"/>
88 <Reference name="RealmForge.Utility"/>
89 <Reference name="Tao.OpenAl"/>
90 <Reference name="ICSharpCode.SharpZipLib"/>
91 <Reference name="csogg"/>
92 <Reference name="csvorbis"/>
93 <Files>
94 <Match pattern="*.cs" recurse="true"/>
95 <Match pattern="*.txt" recurse="true"/>
96 </Files>
97 </Project>
98
99 <Project name="RealmForge.Genres" path="Genres" type="Library" assemblyName="RealmForge.Genres" rootNamespace="RealmForge">
100 <Configuration name="Debug">
101 <Options>
102 <OutputPath>..\bin\lib\Genres</OutputPath>
103 <XmlDocFile>RealmForge.Genres.xml</XmlDocFile>
104 </Options>
105 </Configuration>
106 <Configuration name="Release">
107 <Options>
108 <OutputPath>..\bin\lib\Genres</OutputPath>
109 <XmlDocFile>RealmForge.Genres.xml</XmlDocFile>
110 </Options>
111 </Configuration>
112 <ReferencePath>../bin</ReferencePath>
113 <Reference name="System"/>
114 <Reference name="System.Data"/>
115 <Reference name="System.Xml"/>
116 <Reference name="System.Windows.Forms"/>
117 <Reference name="System.Drawing"/>
118 <Reference name="Axiom.MathLib"/>
119 <Reference name="RealmForge.Utility"/>
120 <Reference name="RealmForge.Framework"/>
121 <Files>
122 <Match pattern="*.cs" recurse="true"/>
123 </Files>
124 </Project>
125
126 <Project name="RealmForge.UI.Forms" path="Forms" type="Library" assemblyName="RealmForge.UI.Forms" rootNamespace="RealmForge">
127 <Configuration name="Debug">
128 <Options>
129 <OutputPath>..\bin\lib\Forms</OutputPath>
130 <XmlDocFile>RealmForge.UI.Forms.xml</XmlDocFile>
131 <AllowUnsafe>true</AllowUnsafe>
132 </Options>
133 </Configuration>
134 <Configuration name="Release">
135 <Options>
136 <OutputPath>..\bin\lib\Forms</OutputPath>
137 <XmlDocFile>RealmForge.UI.Forms.xml</XmlDocFile>
138 <AllowUnsafe>true</AllowUnsafe>
139 </Options>
140 </Configuration>
141 <ReferencePath>../bin</ReferencePath>
142 <Reference name="System"/>
143 <Reference name="System.Drawing"/>
144 <Reference name="System.Data"/>
145 <Reference name="System.Design"/>
146 <Reference name="System.Windows.Forms"/>
147 <Reference name="System.Xml"/>
148 <Reference name="Axiom.MathLib"/>
149 <Reference name="wx.NET"/>
150 <Reference name="RealmForge.Framework"/>
151 <Reference name="RealmForge.Utility"/>
152 <Files>
153 <File buildAction="EmbeddedResource">IDE\Resources\ImagesCaptionIDE.bmp</File>
154 <File buildAction="EmbeddedResource">IDE\Resources\ImagesCaptionPlain.bmp</File>
155 <File buildAction="EmbeddedResource">IDE\Resources\ImagesMenuControl.bmp</File>
156 <File buildAction="EmbeddedResource">IDE\Resources\ImagesPopupMenu.bmp</File>
157 <File buildAction="EmbeddedResource">IDE\Resources\ImagesTabbedGroups.bmp</File>
158 <File buildAction="EmbeddedResource">IDE\Resources\ImagesTabControl.bmp</File>
159 <File buildAction="EmbeddedResource">IDE\Resources\LibraryIcon.ico</File>
160 <File buildAction="EmbeddedResource">IDE\Resources\TabbedInvalid.cur</File>
161 <File buildAction="EmbeddedResource">IDE\Resources\TabbedValid.cur</File>
162 <File buildAction="EmbeddedResource">IDE\Resources\WizardPicture.bmp</File>
163 <File buildAction="EmbeddedResource">Controls\Trees\tv_minus.bmp</File>
164 <File buildAction="EmbeddedResource">Controls\Trees\tv_plus.bmp</File>
165 <File buildAction="EmbeddedResource">Controls\Trees\treeview.bmp</File>
166 <File buildAction="EmbeddedResource">Controls\Trees\listview.bmp</File>
167 <File buildAction="EmbeddedResource">IDE\Menus\MenuControl.bmp</File>
168 <File buildAction="EmbeddedResource">IDE\Controls\InertButton.bmp</File>
169 <File buildAction="EmbeddedResource">IDE\Controls\TabbedGroups.bmp</File>
170 <File buildAction="EmbeddedResource">IDE\Controls\TabCOntrol.bmp</File>
171 <File buildAction="EmbeddedResource">IDE\Controls\WizardControl.bmp</File>
172 <File buildAction="EmbeddedResource">Forms\IDETest.resx</File>
173 <File buildAction="EmbeddedResource">Forms\IDEWindow.resx</File>
174 <File buildAction="EmbeddedResource">Forms\Launcher.resx</File>
175 <File buildAction="EmbeddedResource">Forms\MainRenderFrame.resx</File>
176 <Match pattern="*.cs" recurse="true"/>
177 </Files>
178 </Project>
179
180 <Project name="RealmForge.RAGE" path="RAGE" type="Library" assemblyName="RealmForge.RAGE" rootNamespace="RealmForge">
181 <Configuration name="Debug">
182 <Options>
183 <OutputPath>..\bin\lib\RAGE</OutputPath>
184 <XmlDocFile>RealmForge.RAGE.xml</XmlDocFile>
185 </Options>
186 </Configuration>
187 <Configuration name="Release">
188 <Options>
189 <OutputPath>..\bin\lib\RAGE</OutputPath>
190 <XmlDocFile>RealmForge.RAGE.xml</XmlDocFile>
191 </Options>
192 </Configuration>
193 <ReferencePath>../bin</ReferencePath>
194 <ReferencePath>../bin</ReferencePath>
195 <Reference name="System"/>
196 <Reference name="System.XML"/>
197 <Reference name="System.Windows.Forms"/>
198 <Reference name="System.Drawing"/>
199 <Reference name="Axiom.Plugins.CgProgramManager"/>
200 <Reference name="Axiom.Engine"/>
201 <Reference name="Axiom.MathLib"/>
202 <Reference name="Axiom.Plugins.ParticleFX"/>
203 <Reference name="Axiom.Platforms.Win32"/>
204 <Reference name="Axiom.RenderSystems.DirectX9"/>
205 <Reference localCopy="false" name="Axiom.RenderSystems.OpenGL"/>
206 <Reference name="Axiom.SceneManagers.Octree"/>
207 <Reference name="ICSharpCode.SharpZipLib"/>
208 <Reference name="System.Data"/>
209 <Reference name="RealmForge.Framework"/>
210 <Reference name="RealmForge.Utility"/>
211 <Reference name="ode"/>
212 <Files>
213 <Match pattern="*.cs" recurse="true"/>
214 </Files>
215 </Project>
216
217
218 <Project name="RealmForge.ScriptLibrary" path="ScriptLibrary" type="Library" assemblyName="RealmForge.ScriptLibrary" rootNamespace="RSL">
219 <Configuration name="Debug">
220 <Options>
221 <OutputPath>..\bin\ScriptLibrary</OutputPath>
222 <XmlDocFile>RealmForge.ScriptLibrary.xml</XmlDocFile>
223 </Options>
224 </Configuration>
225 <Configuration name="Release">
226 <Options>
227 <OutputPath>..\bin\ScriptLibrary</OutputPath>
228 <XmlDocFile>RealmForge.ScriptLibrary.xml</XmlDocFile>
229 </Options>
230 </Configuration>
231 <ReferencePath>../bin</ReferencePath>
232 <Reference name="System"/>
233 <Reference name="System.XML"/>
234 <Reference name="System.Windows.Forms"/>
235 <Reference name="System.Drawing"/>
236 <Reference name="Axiom.MathLib"/>
237 <Reference name="wx.NET"/>
238 <Reference name="RealmForge.UI.Forms"/>
239 <Reference name="RealmForge.RAGE"/>
240 <Reference name="RealmForge.Framework"/>
241 <Reference name="RealmForge.Utility"/>
242 <Files>
243 <Match pattern="*.cs" recurse="true"/>
244 </Files>
245 </Project>
246
247
248 <Project name="Updater" path="Updater" type="WinExe" icon="..\bin\Updater.ico" assemblyName="Updater" rootNamespace="RealmForge">
249 <Configuration name="Debug">
250 <Options>
251 <OutputPath>..\bin\lib\Updater</OutputPath>
252 <XmlDocFile>Updater.xml</XmlDocFile>
253 </Options>
254 </Configuration>
255 <Configuration name="Release">
256 <Options>
257 <OutputPath>..\bin\lib\Updater</OutputPath>
258 <XmlDocFile>Updater.xml</XmlDocFile>
259 </Options>
260 </Configuration>
261 <ReferencePath>../bin</ReferencePath>
262 <Reference name="System"/>
263 <Reference name="RealmForge.UI.Forms"/>
264 <Reference name="RealmForge.Framework"/>
265 <Reference name="RealmForge.Utility"/>
266 <Files>
267 <Match pattern="*.cs" recurse="true"/>
268 </Files>
269 </Project>
270
271
272 <Project name="DemoGame" path="DemoGame" type="WinExe" icon="..\bin\RealmForge.ico" assemblyName="DemoGame" rootNamespace="RealmForge">
273 <Configuration name="Debug">
274 <Options>
275 <OutputPath>..\bin</OutputPath>
276 <XmlDocFile>DemoGame.xml</XmlDocFile>
277 </Options>
278 </Configuration>
279 <Configuration name="Release">
280 <Options>
281 <OutputPath>..\bin</OutputPath>
282 <XmlDocFile>DemoGame.xml</XmlDocFile>
283 </Options>
284 </Configuration>
285 <ReferencePath>../bin</ReferencePath>
286 <Reference name="System"/>
287 <Reference name="RealmForge.UI.Forms"/>
288 <Reference name="RealmForge.ScriptLibrary"/>
289 <Reference name="RealmForge.RAGE"/>
290 <Reference name="RealmForge.Framework"/>
291 <Reference name="RealmForge.Utility"/>
292 <Files>
293 <Match pattern="*.cs" recurse="true"/>
294 </Files>
295 </Project>
296
297 </Solution>
298</Prebuild>
299
300
diff --git a/Prebuild/doc/prebuild-example2.xml b/Prebuild/doc/prebuild-example2.xml
new file mode 100644
index 0000000..02276f6
--- /dev/null
+++ b/Prebuild/doc/prebuild-example2.xml
@@ -0,0 +1,72 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd">
3 <Solution name="Prebuild">
4 <Configuration name="Debug">
5 <Options>
6 <?if OS = "Win32" ?>
7 <CompilerDefines>DEBUG;TRACE;WIN32;NET</CompilerDefines>
8 <?else ?>
9 <CompilerDefines>DEBUG;TRACE;POSIX</CompilerDefines>
10 <?endif ?>
11 <OptimizeCode>false</OptimizeCode>
12 <OutputPath>bin\Debug</OutputPath>
13 <DebugInformation>true</DebugInformation>
14 <SuppressWarnings>1595</SuppressWarnings>
15 </Options>
16 </Configuration>
17 <Configuration name="Release">
18 <Options>
19 <?if OS = "Win32" ?>
20 <CompilerDefines>TRACE;WIN32;NET</CompilerDefines>
21 <?else ?>
22 <CompilerDefines>TRACE;POSIX</CompilerDefines>
23 <?endif ?>
24 <OutputPath>bin\Release</OutputPath>
25 <OptimizeCode>true</OptimizeCode>
26 <DebugInformation>false</DebugInformation>
27 <SuppressWarnings>1595</SuppressWarnings>
28 </Options>
29 </Configuration>
30 <Files>
31 <File>prebuild.xml</File>
32 <Match path="doc" pattern="*.txt"/>
33 </Files>
34 <Project name="Prebuild" path="src" language="C#" assemblyName="Prebuild" icon="App.ico" type="Exe" rootNamespace="Prebuild" startupObject="Prebuild.Prebuild">
35 <Configuration name="Debug">
36 <Options>
37 <?if OS = "Win32" ?>
38 <CompilerDefines>DEBUG;TRACE;WIN32;NET</CompilerDefines>
39 <?else ?>
40 <CompilerDefines>DEBUG;TRACE;POSIX</CompilerDefines>
41 <?endif ?>
42 <OptimizeCode>false</OptimizeCode>
43 <OutputPath>bin\Debug</OutputPath>
44 <DebugInformation>true</DebugInformation>
45 <XmlDocFile>Prebuild.xml</XmlDocFile>
46 <SuppressWarnings>1595</SuppressWarnings>
47 </Options>
48 </Configuration>
49 <Configuration name="Release">
50 <Options>
51 <?if OS = "Win32" ?>
52 <CompilerDefines>TRACE;WIN32;NET</CompilerDefines>
53 <?else ?>
54 <CompilerDefines>TRACE;POSIX</CompilerDefines>
55 <?endif ?>
56 <OutputPath>bin\Release</OutputPath>
57 <OptimizeCode>true</OptimizeCode>
58 <DebugInformation>false</DebugInformation>
59 <XmlDocFile>Prebuild.xml</XmlDocFile>
60 <SuppressWarnings>1595</SuppressWarnings>
61 </Options>
62 </Configuration>
63 <Reference name="System.Xml" />
64 <Reference name="System" />
65 <Files>
66 <Match pattern="App.ico" buildAction="EmbeddedResource"/>
67 <Match path="data" pattern="prebuild-1.6.xsd" buildAction="EmbeddedResource"/>
68 <Match pattern="*.cs" recurse="true"/>
69 </Files>
70 </Project>
71 </Solution>
72</Prebuild>
diff --git a/Prebuild/doc/prebuild-example3.xml b/Prebuild/doc/prebuild-example3.xml
new file mode 100644
index 0000000..1ba38f7
--- /dev/null
+++ b/Prebuild/doc/prebuild-example3.xml
@@ -0,0 +1,113 @@
1<?xml version="1.0" encoding="utf-8"?>
2 <!--The version of the XML schema specified in the version and xmlns attributes should match the one for which the version of Prebuild.exe used was compiled for. In this example it is the version 1.6 schema, you can find the XSD schema file at the url specified in the xmlns attribute. -->
3 <Prebuild version="1.6" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd">
4 <Solution name="RealmForge"> <!--The title and file name for the solution, combine, workspace, or project group (depending on what development tool you are using)-->
5 <!--Configurations found as children of Solution are used as templates for the configurations found in the project, this allows you to avoid writing the same options in each project (and maintaining each of these). You can provide defaults and then override them in the configurations defined for each project. All options are optional.-->
6 <Configuration name="Debug">
7 <Options>
8 <!-- simple logically expressions can be evaluated, if, else, elseif, and endif are valid statements. Note that it is not neccisary to define POSIX or WIN32 -->
9 <?if OS = "Win32" ?>
10 <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines>
11 <?else ?>
12 <CompilerDefines>DEBUG;TRACE;POSIX</CompilerDefines>
13 <?endif ?>
14 <OptimizeCode>false</OptimizeCode>
15 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
16 <AllowUnsafe>false</AllowUnsafe>
17 <WarningLevel>4</WarningLevel>
18 <!--The filter for the number of warnings or errors shown and the tolerance level as to what is an error. This is value from 0 to 4 where 4 is the most strict (least tolerent).-->
19
20 <WarningsAsErrors>false</WarningsAsErrors>
21 <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings>
22 <!-- A semicolon ';' delimited list of the warnings that are filtered and not shown in the output window during compiling a project. Only include the number portion of the warning codes that are shown in output during compilation (eg CS1591, should be entered as 1591)-->
23
24 <OutputPath>..\bin</OutputPath>
25 <DebugInformation>true</DebugInformation>
26 <RegisterComInterop>false</RegisterComInterop>
27 <IncrementalBuild>true</IncrementalBuild>
28 <BaseAddress>285212672</BaseAddress>
29 <FileAlignment>4096</FileAlignment>
30 <NoStdLib>false</NoStdLib>
31 <XmlDocFile>Docs.xml</XmlDocFile>
32 </Options>
33 </Configuration>
34 <Configuration name="Release"> <!-- You can define multple configurations that projects can have, but there is no way to define which one is selected by default as this is a part of the user preferences for a project, not the solution or project files -->
35 <Options>
36 <CompilerDefines>TRACE</CompilerDefines>
37 <OptimizeCode>true</OptimizeCode>
38 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
39 <AllowUnsafe>false</AllowUnsafe>
40 <WarningLevel>4</WarningLevel>
41 <WarningsAsErrors>false</WarningsAsErrors>
42 <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings>
43 <OutputPath>..\bin</OutputPath>
44 <DebugInformation>false</DebugInformation>
45 <RegisterComInterop>false</RegisterComInterop>
46 <IncrementalBuild>true</IncrementalBuild>
47 <BaseAddress>285212672</BaseAddress>
48 <FileAlignment>4096</FileAlignment>
49 <NoStdLib>false</NoStdLib>
50 <XmlDocFile>Docs.xml</XmlDocFile>
51 </Options>
52 </Configuration>
53
54 <!-- One of the projects that is included in the Solution -->
55 <Project name="RealmForge.Utility" path="Utility" type="Library" assemblyName="RealmForge.Utility" rootNamespace="RealmForge">
56 <Configuration name="Debug">
57 <Options>
58 <OutputPath>..\bin\lib\Utility</OutputPath>
59 <XmlDocFile>RealmForge.Utility.xml</XmlDocFile>
60 </Options>
61 </Configuration>
62 <Configuration name="Release">
63 <Options>
64 <OutputPath>..\bin\lib\Utility</OutputPath>
65 <XmlDocFile>RealmForge.Utility.xml</XmlDocFile>
66 </Options>
67 </Configuration>
68 <ReferencePath>../bin</ReferencePath>
69 <Reference name="System"/>
70 <Reference name="System.Data"/>
71 <Reference name="System.Drawing"/>
72 <Reference name="System.Xml"/>
73 <Reference name="System.Runtime.Serialization.Formatters.Soap"/>
74 <Reference name="ICSharpCode.SharpZipLib"/>
75 <Files>
76 <Match pattern="*.cs" recurse="true"/>
77 </Files>
78 </Project>
79
80 <!-- Another projects that is included in the Solution -->
81 <Project name="DemoGame" path="DemoGame" type="WinExe" icon="..\bin\RealmForge.ico" assemblyName="DemoGame" rootNamespace="RealmForge">
82 <!-- icon is used to define the location of the .ico file that is embeeded in the assembly when the project is compiled. This is relative to the project path -->
83 <!--type defines the type of project, valid types are Library (.dll), WinExe (.exe), and Exe (.exe). WinExe is not windows specific, it just defines that it is a GUI application and that no Console or Command window will show when it is started-->
84
85 <Configuration name="Debug">
86 <Options>
87 <OutputPath>..\bin</OutputPath>
88 <XmlDocFile>DemoGame.xml</XmlDocFile>
89 </Options>
90 </Configuration>
91 <Configuration name="Release">
92 <Options>
93 <OutputPath>..\bin</OutputPath>
94 <XmlDocFile>DemoGame.xml</XmlDocFile>
95 </Options>
96 </Configuration>
97 <ReferencePath>../bin</ReferencePath>
98 <Reference name="System"/> <!-- Assemblies that are located in the GAC (installed, global) can be referenced-->
99 <Reference name="ode"/> <!-- Assemblies that are located in the output directory to which the file is built can be referenced -->
100 <Reference name="RealmForge.Utility"/> <!-- When you reference the name of another project, then that project (and it's output) will be referenced instead of looking for a pre-built assembly-->
101 <Files>
102 <!-- path defaults to . or the directory that prebuild.exe resides in -->
103 <Match path="." pattern="*.cs" recurse="true"/>
104 <Match pattern="*.bmp" recurse="true" buildAction="EmbeddedResource"/>
105 <Match pattern="[^a]*\.(png|jpg)" useRegex="true" buildAction="EmbeddedResource"/>
106
107 <!-- Uses a regex or regular expression to find all files that end with .png or .jpg but dont have the letter 'a' in their name and add them to the project as EmbeddedResource's. Because recurse enabled (default is false), only the values in the files in that are directly in the project directory (not child directories) are checked.-->
108 <!--EmbeddedResource, Content, and Compile are valid buildAction's-->
109 </Files>
110 </Project>
111
112 </Solution>
113</Prebuild>
diff --git a/Prebuild/doc/prebuild-example4.xml b/Prebuild/doc/prebuild-example4.xml
new file mode 100644
index 0000000..c6c223f
--- /dev/null
+++ b/Prebuild/doc/prebuild-example4.xml
@@ -0,0 +1,715 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd" version="1.6">
3 <Solution name="SdlDotNet">
4 <Configuration name="Debug">
5 <Options>
6 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
7 <OptimizeCode>false</OptimizeCode>
8 <AllowUnsafe>false</AllowUnsafe>
9 <OutputPath>bin\Debug</OutputPath>
10 <DebugInformation>true</DebugInformation>
11 <WarningLevel>4</WarningLevel>
12 <SuppressWarnings>1595</SuppressWarnings>
13 </Options>
14 </Configuration>
15 <Configuration name="Release">
16 <Options>
17 <CompilerDefines>TRACE</CompilerDefines>
18 <OptimizeCode>true</OptimizeCode>
19 <AllowUnsafe>false</AllowUnsafe>
20 <OutputPath>bin\Release</OutputPath>
21 <DebugInformation>false</DebugInformation>
22 <WarningLevel>1</WarningLevel>
23 <SuppressWarnings>1595</SuppressWarnings>
24 </Options>
25 </Configuration>
26 <Files>
27 <File buildAction="Content">SdlDotNet.build</File>
28 <File buildAction="Content">prebuild.xml</File>
29 </Files>
30 <Project name="SdlDotNet" path="src" language="C#" type="Library" assemblyName="SdlDotNet" rootNamespace="SdlDotNet">
31 <Configuration name="Debug">
32 <Options>
33 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
34 <OptimizeCode>false</OptimizeCode>
35 <AllowUnsafe>false</AllowUnsafe>
36 <OutputPath>bin\Debug</OutputPath>
37 <DebugInformation>true</DebugInformation>
38 <XmlDocFile>SdlDotNet.xml</XmlDocFile>
39 <WarningLevel>4</WarningLevel>
40 <SuppressWarnings>1595</SuppressWarnings>
41 </Options>
42 </Configuration>
43 <Configuration name="Release">
44 <Options>
45 <CompilerDefines>TRACE</CompilerDefines>
46 <OptimizeCode>true</OptimizeCode>
47 <AllowUnsafe>false</AllowUnsafe>
48 <OutputPath>bin\Release</OutputPath>
49 <XmlDocFile>SdlDotNet.xml</XmlDocFile>
50 <DebugInformation>false</DebugInformation>
51 <WarningLevel>1</WarningLevel>
52 <SuppressWarnings>1595</SuppressWarnings>
53 </Options>
54 </Configuration>
55 <Reference name="System" />
56 <Reference name="System.Windows.Forms" />
57 <Reference name="System.Drawing" />
58 <Reference name="Tao.Sdl" localCopy="true" path="..\\lib"/>
59 <Files>
60 <Match path="." pattern="SurfaceControl.cs" subType="Component" recurse="true"/>
61 <Match path="." pattern="*.bmp" buildAction="EmbeddedResource" recurse="true"/>
62 <Match path="." pattern="*.cs" recurse="true">
63 <Exclude name="SurfaceControl.cs"/>
64 </Match>
65 </Files>
66 </Project>
67 <Project name="Rectangles" path="examples\\Rectangles" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.Rectangles.Rectangles" assemblyName="Rectangles" rootNamespace="SdlDotNet.Examples.Rectangles" icon="App.ico">
68 <Configuration name="Debug">
69 <Options>
70 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
71 <OptimizeCode>false</OptimizeCode>
72 <AllowUnsafe>false</AllowUnsafe>
73 <OutputPath>bin\Debug</OutputPath>
74 <DebugInformation>true</DebugInformation>
75 <XmlDocFile>Rectangles.xml</XmlDocFile>
76 <WarningLevel>4</WarningLevel>
77 <SuppressWarnings>1595</SuppressWarnings>
78 </Options>
79 </Configuration>
80 <Configuration name="Release">
81 <Options>
82 <CompilerDefines>TRACE</CompilerDefines>
83 <OptimizeCode>true</OptimizeCode>
84 <AllowUnsafe>false</AllowUnsafe>
85 <OutputPath>bin\Release</OutputPath>
86 <DebugInformation>false</DebugInformation>
87 <XmlDocFile>Rectangles.xml</XmlDocFile>
88 <WarningLevel>1</WarningLevel>
89 <SuppressWarnings>1595</SuppressWarnings>
90 </Options>
91 </Configuration>
92 <Reference name="System" />
93 <Reference name="System.Drawing" />
94 <Reference name="SdlDotNet" localCopy="true"/>
95 <Files>
96 <File buildAction="EmbeddedResource">App.ico</File>
97 <Match path="." pattern="*.cs" recurse="true"/>
98 </Files>
99 </Project>
100 <Project name="Gears" path="examples\\Gears" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.Gears.Gears" assemblyName="Gears" rootNamespace="SdlDotNet.Examples.Gears" icon="App.ico">
101 <Configuration name="Debug">
102 <Options>
103 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
104 <OptimizeCode>false</OptimizeCode>
105 <AllowUnsafe>false</AllowUnsafe>
106 <OutputPath>bin\Debug</OutputPath>
107 <DebugInformation>true</DebugInformation>
108 <XmlDocFile>Gears.xml</XmlDocFile>
109 <WarningLevel>4</WarningLevel>
110 <SuppressWarnings>1595</SuppressWarnings>
111 </Options>
112 </Configuration>
113 <Configuration name="Release">
114 <Options>
115 <CompilerDefines>TRACE</CompilerDefines>
116 <OptimizeCode>true</OptimizeCode>
117 <AllowUnsafe>false</AllowUnsafe>
118 <OutputPath>bin\Release</OutputPath>
119 <DebugInformation>false</DebugInformation>
120 <XmlDocFile>Gears.xml</XmlDocFile>
121 <WarningLevel>1</WarningLevel>
122 <SuppressWarnings>1595</SuppressWarnings>
123 </Options>
124 </Configuration>
125 <Reference name="System" />
126 <Reference name="System.Drawing" />
127 <Reference name="SdlDotNet" localCopy="true"/>
128 <Reference name="Tao.OpenGl" localCopy="true" path="..\\..\\lib"/>
129 <Files>
130 <File buildAction="EmbeddedResource">App.ico</File>
131 <Match path="." pattern="*.cs" recurse="true"/>
132 </Files>
133 </Project>
134 <Project name="CDPlayer" path="examples\\CDPlayer" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.CDPlayer.CDPlayer" assemblyName="CDPlayer" rootNamespace="SdlDotNet.Examples.CDPlayer" icon="App.ico">
135 <Configuration name="Debug">
136 <Options>
137 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
138 <OptimizeCode>false</OptimizeCode>
139 <AllowUnsafe>false</AllowUnsafe>
140 <OutputPath>bin\Debug</OutputPath>
141 <DebugInformation>true</DebugInformation>
142 <XmlDocFile>CDPlayer.xml</XmlDocFile>
143 <WarningLevel>4</WarningLevel>
144 <SuppressWarnings>1595</SuppressWarnings>
145 </Options>
146 </Configuration>
147 <Configuration name="Release">
148 <Options>
149 <CompilerDefines>TRACE</CompilerDefines>
150 <OptimizeCode>true</OptimizeCode>
151 <AllowUnsafe>false</AllowUnsafe>
152 <OutputPath>bin\Release</OutputPath>
153 <DebugInformation>false</DebugInformation>
154 <XmlDocFile>CDPlayer.xml</XmlDocFile>
155 <WarningLevel>1</WarningLevel>
156 <SuppressWarnings>1595</SuppressWarnings>
157 </Options>
158 </Configuration>
159 <Reference name="System" />
160 <Reference name="System.Drawing" />
161 <Reference name="System.Windows.Forms" />
162 <Reference name="SdlDotNet" localCopy="true"/>
163 <Files>
164 <File buildAction="EmbeddedResource">App.ico</File>
165 <File subType="Form">CDPlayer.cs</File>
166 <Match path="." pattern="*.cs" recurse="true">
167 <Exclude name="CDPlayer.cs"/>
168 </Match>
169 </Files>
170 </Project>
171 <Project name="MoviePlayer" path="examples\\MoviePlayer" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.MoviePlayer.MoviePlayer" assemblyName="MoviePlayer" rootNamespace="SdlDotNet.Examples.MoviePlayer" icon="App.ico">
172 <Configuration name="Debug">
173 <Options>
174 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
175 <OptimizeCode>false</OptimizeCode>
176 <AllowUnsafe>false</AllowUnsafe>
177 <OutputPath>bin\Debug</OutputPath>
178 <DebugInformation>true</DebugInformation>
179 <XmlDocFile>MoviePlayer.xml</XmlDocFile>
180 <WarningLevel>4</WarningLevel>
181 <SuppressWarnings>1595</SuppressWarnings>
182 </Options>
183 </Configuration>
184 <Configuration name="Release">
185 <Options>
186 <CompilerDefines>TRACE</CompilerDefines>
187 <OptimizeCode>true</OptimizeCode>
188 <AllowUnsafe>false</AllowUnsafe>
189 <OutputPath>bin\Release</OutputPath>
190 <DebugInformation>false</DebugInformation>
191 <XmlDocFile>MoviePlayer.xml</XmlDocFile>
192 <WarningLevel>1</WarningLevel>
193 <SuppressWarnings>1595</SuppressWarnings>
194 </Options>
195 </Configuration>
196 <Reference name="System" />
197 <Reference name="System.Drawing" />
198 <Reference name="SdlDotNet" localCopy="true"/>
199 <Files>
200 <File buildAction="EmbeddedResource">App.ico</File>
201 <Match path="." pattern="*.cs" recurse="true"/>
202 </Files>
203 </Project>
204 <Project name="SimpleGame" path="examples\\SimpleGame" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.SimpleGame.GameMain" assemblyName="SimpleGame" rootNamespace="SdlDotNet.Examples.SimpleGame" icon="App.ico">
205 <Configuration name="Debug">
206 <Options>
207 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
208 <OptimizeCode>false</OptimizeCode>
209 <AllowUnsafe>false</AllowUnsafe>
210 <OutputPath>bin\Debug</OutputPath>
211 <DebugInformation>true</DebugInformation>
212 <XmlDocFile>SimpleGame.xml</XmlDocFile>
213 <WarningLevel>4</WarningLevel>
214 <SuppressWarnings>1595</SuppressWarnings>
215 </Options>
216 </Configuration>
217 <Configuration name="Release">
218 <Options>
219 <CompilerDefines>TRACE</CompilerDefines>
220 <OptimizeCode>true</OptimizeCode>
221 <AllowUnsafe>false</AllowUnsafe>
222 <OutputPath>bin\Release</OutputPath>
223 <DebugInformation>false</DebugInformation>
224 <XmlDocFile>SimpleGame.xml</XmlDocFile>
225 <WarningLevel>1</WarningLevel>
226 <SuppressWarnings>1595</SuppressWarnings>
227 </Options>
228 </Configuration>
229 <Reference name="System" />
230 <Reference name="System.Drawing" />
231 <Reference name="SdlDotNet" localCopy="true"/>
232 <Files>
233 <File buildAction="EmbeddedResource">App.ico</File>
234 <Match path="." pattern="*.cs" recurse="true"/>
235 </Files>
236 </Project>
237 <Project name="BombRun" path="examples\\BombRun" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.BombRun.BombRun" assemblyName="BombRun" rootNamespace="SdlDotNet.Examples.BombRun" icon="App.ico">
238 <Configuration name="Debug">
239 <Options>
240 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
241 <OptimizeCode>false</OptimizeCode>
242 <AllowUnsafe>false</AllowUnsafe>
243 <OutputPath>bin\Debug</OutputPath>
244 <DebugInformation>true</DebugInformation>
245 <XmlDocFile>BombRun.xml</XmlDocFile>
246 <WarningLevel>4</WarningLevel>
247 <SuppressWarnings>1595</SuppressWarnings>
248 </Options>
249 </Configuration>
250 <Configuration name="Release">
251 <Options>
252 <CompilerDefines>TRACE</CompilerDefines>
253 <OptimizeCode>true</OptimizeCode>
254 <AllowUnsafe>false</AllowUnsafe>
255 <OutputPath>bin\Release</OutputPath>
256 <DebugInformation>false</DebugInformation>
257 <XmlDocFile>BombRun.xml</XmlDocFile>
258 <WarningLevel>1</WarningLevel>
259 <SuppressWarnings>1595</SuppressWarnings>
260 </Options>
261 </Configuration>
262 <Reference name="System" />
263 <Reference name="System.Drawing" />
264 <Reference name="SdlDotNet" localCopy="true"/>
265 <Files>
266 <File buildAction="EmbeddedResource">App.ico</File>
267 <Match path="." pattern="*.cs" recurse="true"/>
268 </Files>
269 </Project>
270 <Project name="SnowDemo" path="examples\\SnowDemo" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.SnowDemo.SnowDemo" assemblyName="SnowDemo" rootNamespace="SdlDotNet.Examples.SnowDemo" icon="App.ico">
271 <Configuration name="Debug">
272 <Options>
273 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
274 <OptimizeCode>false</OptimizeCode>
275 <AllowUnsafe>false</AllowUnsafe>
276 <OutputPath>bin\Debug</OutputPath>
277 <DebugInformation>true</DebugInformation>
278 <XmlDocFile>SnowDemo.xml</XmlDocFile>
279 <WarningLevel>4</WarningLevel>
280 <SuppressWarnings>1595</SuppressWarnings>
281 </Options>
282 </Configuration>
283 <Configuration name="Release">
284 <Options>
285 <CompilerDefines>TRACE</CompilerDefines>
286 <OptimizeCode>true</OptimizeCode>
287 <AllowUnsafe>false</AllowUnsafe>
288 <OutputPath>bin\Release</OutputPath>
289 <DebugInformation>false</DebugInformation>
290 <XmlDocFile>SnowDemo.xml</XmlDocFile>
291 <WarningLevel>1</WarningLevel>
292 <SuppressWarnings>1595</SuppressWarnings>
293 </Options>
294 </Configuration>
295 <Reference name="System" />
296 <Reference name="System.Drawing" />
297 <Reference name="SdlDotNet" localCopy="true"/>
298 <Files>
299 <File buildAction="EmbeddedResource">App.ico</File>
300 <Match path="." pattern="*.cs" recurse="true"/>
301 </Files>
302 </Project>
303 <Project name="BounceSprites" path="examples\\BounceSprites" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.BounceSprites.BounceSprites" assemblyName="BounceSprites" rootNamespace="SdlDotNet.Examples.BounceSprites" icon="App.ico">
304 <Configuration name="Debug">
305 <Options>
306 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
307 <OptimizeCode>false</OptimizeCode>
308 <AllowUnsafe>false</AllowUnsafe>
309 <OutputPath>bin\Debug</OutputPath>
310 <DebugInformation>true</DebugInformation>
311 <XmlDocFile>BounceSprites.xml</XmlDocFile>
312 <WarningLevel>4</WarningLevel>
313 <SuppressWarnings>1595</SuppressWarnings>
314 </Options>
315 </Configuration>
316 <Configuration name="Release">
317 <Options>
318 <CompilerDefines>TRACE</CompilerDefines>
319 <OptimizeCode>true</OptimizeCode>
320 <AllowUnsafe>false</AllowUnsafe>
321 <OutputPath>bin\Release</OutputPath>
322 <DebugInformation>false</DebugInformation>
323 <XmlDocFile>BounceSprites.xml</XmlDocFile>
324 <WarningLevel>1</WarningLevel>
325 <SuppressWarnings>1595</SuppressWarnings>
326 </Options>
327 </Configuration>
328 <Reference name="System" />
329 <Reference name="System.Drawing" />
330 <Reference name="SdlDotNet" localCopy="true"/>
331 <Files>
332 <File buildAction="EmbeddedResource">App.ico</File>
333 <Match path="." pattern="*.cs" recurse="true"/>
334 </Files>
335 </Project>
336 <Project name="Triad" path="examples\\Triad" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.Triad.MainObject" assemblyName="Triad" rootNamespace="SdlDotNet.Examples.Triad" icon="App.ico">
337 <Configuration name="Debug">
338 <Options>
339 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
340 <OptimizeCode>false</OptimizeCode>
341 <AllowUnsafe>false</AllowUnsafe>
342 <OutputPath>bin\Debug</OutputPath>
343 <DebugInformation>true</DebugInformation>
344 <XmlDocFile>Triad.xml</XmlDocFile>
345 <WarningLevel>4</WarningLevel>
346 <SuppressWarnings>1595</SuppressWarnings>
347 </Options>
348 </Configuration>
349 <Configuration name="Release">
350 <Options>
351 <CompilerDefines>TRACE</CompilerDefines>
352 <OptimizeCode>true</OptimizeCode>
353 <AllowUnsafe>false</AllowUnsafe>
354 <OutputPath>bin\Release</OutputPath>
355 <DebugInformation>false</DebugInformation>
356 <XmlDocFile>Triad.xml</XmlDocFile>
357 <WarningLevel>1</WarningLevel>
358 <SuppressWarnings>1595</SuppressWarnings>
359 </Options>
360 </Configuration>
361 <Reference name="System" />
362 <Reference name="System.Drawing" />
363 <Reference name="SdlDotNet" localCopy="true"/>
364 <Reference name="nunit.framework" localCopy="true" path="..\\..\\lib"/>
365 <Files>
366 <File buildAction="EmbeddedResource">App.ico</File>
367 <Match path="." pattern="*.cs" recurse="true"/>
368 </Files>
369 </Project>
370 <Project name="GuiExample" path="examples\\GuiExample" language="C#" type="Library" assemblyName="GuiExample" rootNamespace="SdlDotNet.Examples.GuiExample">
371 <Configuration name="Debug">
372 <Options>
373 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
374 <OptimizeCode>false</OptimizeCode>
375 <AllowUnsafe>false</AllowUnsafe>
376 <OutputPath>bin\Debug</OutputPath>
377 <DebugInformation>true</DebugInformation>
378 <XmlDocFile>GuiExample.xml</XmlDocFile>
379 <WarningLevel>4</WarningLevel>
380 <SuppressWarnings>1595</SuppressWarnings>
381 </Options>
382 </Configuration>
383 <Configuration name="Release">
384 <Options>
385 <CompilerDefines>TRACE</CompilerDefines>
386 <OptimizeCode>true</OptimizeCode>
387 <AllowUnsafe>false</AllowUnsafe>
388 <OutputPath>bin\Release</OutputPath>
389 <DebugInformation>false</DebugInformation>
390 <XmlDocFile>GuiExample.xml</XmlDocFile>
391 <WarningLevel>1</WarningLevel>
392 <SuppressWarnings>1595</SuppressWarnings>
393 </Options>
394 </Configuration>
395 <Reference name="System" />
396 <Reference name="System.Drawing" />
397 <Reference name="SdlDotNet" localCopy="true"/>
398 <Files>
399 <Match path="." pattern="*.cs" recurse="true"/>
400 </Files>
401 </Project>
402 <Project name="SpriteGuiDemos" path="examples\\SpriteGuiDemos" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.SpriteGuiDemos.SdlDemo" assemblyName="SpriteGuiDemo" rootNamespace="SdlDotNet.Examples.SpriteGuiDemos" icon="App.ico">
403 <Configuration name="Debug">
404 <Options>
405 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
406 <OptimizeCode>false</OptimizeCode>
407 <AllowUnsafe>false</AllowUnsafe>
408 <OutputPath>bin\Debug</OutputPath>
409 <DebugInformation>true</DebugInformation>
410 <XmlDocFile>SpriteGuiDemos.xml</XmlDocFile>
411 <WarningLevel>4</WarningLevel>
412 <SuppressWarnings>1595</SuppressWarnings>
413 </Options>
414 </Configuration>
415 <Configuration name="Release">
416 <Options>
417 <CompilerDefines>TRACE</CompilerDefines>
418 <OptimizeCode>true</OptimizeCode>
419 <AllowUnsafe>false</AllowUnsafe>
420 <OutputPath>bin\Release</OutputPath>
421 <DebugInformation>false</DebugInformation>
422 <XmlDocFile>SpriteGuiDemos.xml</XmlDocFile>
423 <WarningLevel>1</WarningLevel>
424 <SuppressWarnings>1595</SuppressWarnings>
425 </Options>
426 </Configuration>
427 <Reference name="System" />
428 <Reference name="System.Drawing" />
429 <Reference name="SdlDotNet" localCopy="true"/>
430 <Reference name="GuiExample" localCopy="true"/>
431 <Files>
432 <File buildAction="EmbeddedResource">App.ico</File>
433 <Match path="." pattern="*.cs" recurse="true"/>
434 </Files>
435 </Project>
436 <Project name="Tests" path="tests" language="C#" type="Library" assemblyName="SdlDotNet.Tests" rootNamespace="SdlDotNet.Tests">
437 <Configuration name="Debug">
438 <Options>
439 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
440 <OptimizeCode>false</OptimizeCode>
441 <AllowUnsafe>false</AllowUnsafe>
442 <OutputPath>bin\Debug</OutputPath>
443 <DebugInformation>true</DebugInformation>
444 <XmlDocFile>SdlDotNet.Tests.xml</XmlDocFile>
445 <WarningLevel>4</WarningLevel>
446 <SuppressWarnings>1595</SuppressWarnings>
447 </Options>
448 </Configuration>
449 <Configuration name="Release">
450 <Options>
451 <CompilerDefines>TRACE</CompilerDefines>
452 <OptimizeCode>true</OptimizeCode>
453 <AllowUnsafe>false</AllowUnsafe>
454 <OutputPath>bin\Release</OutputPath>
455 <DebugInformation>false</DebugInformation>
456 <XmlDocFile>SdlDotNet.Tests.xml</XmlDocFile>
457 <WarningLevel>1</WarningLevel>
458 <SuppressWarnings>1595</SuppressWarnings>
459 </Options>
460 </Configuration>
461 <Reference name="System" />
462 <Reference name="System.Drawing" />
463 <Reference name="SdlDotNet" localCopy="true"/>
464 <Reference name="Tao.Sdl" localCopy="true" path="..\\lib"/>
465 <Reference name="GuiExample" localCopy="true"/>
466 <Reference name="nunit.framework" localCopy="true" path="..\\lib"/>
467 <Files>
468 <Match path="." pattern="*.cs" recurse="true"/>
469 </Files>
470 </Project>
471 <Project name="AudioExample" path="examples\\AudioExample" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.AudioExample.AudioExample" assemblyName="AudioExample" rootNamespace="SdlDotNet.Examples.AudioExample" icon="App.ico">
472 <Configuration name="Debug">
473 <Options>
474 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
475 <OptimizeCode>false</OptimizeCode>
476 <AllowUnsafe>false</AllowUnsafe>
477 <OutputPath>bin\Debug</OutputPath>
478 <DebugInformation>true</DebugInformation>
479 <XmlDocFile>AudioExample.xml</XmlDocFile>
480 <WarningLevel>4</WarningLevel>
481 <SuppressWarnings>1595</SuppressWarnings>
482 </Options>
483 </Configuration>
484 <Configuration name="Release">
485 <Options>
486 <CompilerDefines>TRACE</CompilerDefines>
487 <OptimizeCode>true</OptimizeCode>
488 <AllowUnsafe>false</AllowUnsafe>
489 <OutputPath>bin\Release</OutputPath>
490 <DebugInformation>false</DebugInformation>
491 <XmlDocFile>AudioExample.xml</XmlDocFile>
492 <WarningLevel>1</WarningLevel>
493 <SuppressWarnings>1595</SuppressWarnings>
494 </Options>
495 </Configuration>
496 <Reference name="System" />
497 <Reference name="System.Drawing" />
498 <Reference name="SdlDotNet" localCopy="true"/>
499 <Files>
500 <File buildAction="EmbeddedResource">App.ico</File>
501 <Match path="." pattern="*.cs" recurse="true"/>
502 </Files>
503 </Project>
504 <Project name="SdlDotNet.Particles" path="extras\\Particles" language="C#" type="Library" assemblyName="SdlDotNet.Particles" rootNamespace="SdlDotNet.Particles">
505 <Configuration name="Debug">
506 <Options>
507 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
508 <OptimizeCode>false</OptimizeCode>
509 <AllowUnsafe>false</AllowUnsafe>
510 <OutputPath>bin\Debug</OutputPath>
511 <DebugInformation>true</DebugInformation>
512 <XmlDocFile>SdlDotNet.Particles.xml</XmlDocFile>
513 <WarningLevel>4</WarningLevel>
514 <SuppressWarnings>1595</SuppressWarnings>
515 </Options>
516 </Configuration>
517 <Configuration name="Release">
518 <Options>
519 <CompilerDefines>TRACE</CompilerDefines>
520 <OptimizeCode>true</OptimizeCode>
521 <AllowUnsafe>false</AllowUnsafe>
522 <OutputPath>bin\Release</OutputPath>
523 <DebugInformation>false</DebugInformation>
524 <XmlDocFile>SdlDotNet.Particles.xml</XmlDocFile>
525 <WarningLevel>1</WarningLevel>
526 <SuppressWarnings>1595</SuppressWarnings>
527 </Options>
528 </Configuration>
529 <Reference name="System" />
530 <Reference name="System.Drawing" />
531 <Reference name="SdlDotNet" localCopy="true"/>
532 <Files>
533 <Match path="." pattern="*.cs" recurse="true"/>
534 </Files>
535 </Project>
536 <Project name="ParticlesExample" path="examples\\ParticlesExample" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.ParticlesExample.ParticlesExample" assemblyName="ParticlesExample" rootNamespace="SdlDotNet.Examples.ParticlesExample" icon="App.ico">
537 <Configuration name="Debug">
538 <Options>
539 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
540 <OptimizeCode>false</OptimizeCode>
541 <AllowUnsafe>false</AllowUnsafe>
542 <OutputPath>bin\Debug</OutputPath>
543 <DebugInformation>true</DebugInformation>
544 <XmlDocFile>ParticlesExample.xml</XmlDocFile>
545 <WarningLevel>4</WarningLevel>
546 <SuppressWarnings>1595</SuppressWarnings>
547 </Options>
548 </Configuration>
549 <Configuration name="Release">
550 <Options>
551 <CompilerDefines>TRACE</CompilerDefines>
552 <OptimizeCode>true</OptimizeCode>
553 <AllowUnsafe>false</AllowUnsafe>
554 <OutputPath>bin\Release</OutputPath>
555 <DebugInformation>false</DebugInformation>
556 <XmlDocFile>ParticlesExample.xml</XmlDocFile>
557 <WarningLevel>1</WarningLevel>
558 <SuppressWarnings>1595</SuppressWarnings>
559 </Options>
560 </Configuration>
561 <Reference name="System" />
562 <Reference name="System.Drawing" />
563 <Reference name="SdlDotNet" localCopy="true"/>
564 <Reference name="SdlDotNet.Particles" localCopy="true"/>
565 <Files>
566 <File buildAction="EmbeddedResource">App.ico</File>
567 <Match path="." pattern="*.cs" recurse="true"/>
568 </Files>
569 </Project>
570 <!--<Project name="SdlDotNet.Gui" path="extras\\Gui" language="C#" type="Library" assemblyName="SdlDotNet.Gui" rootNamespace="SdlDotNet.Gui">
571 <Configuration name="Debug">
572 <Options>
573 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
574 <OptimizeCode>false</OptimizeCode>
575 <AllowUnsafe>false</AllowUnsafe>
576 <OutputPath>bin\Debug</OutputPath>
577 <DebugInformation>true</DebugInformation>
578 <XmlDocFile>SdlDotNet.Gui.xml</XmlDocFile>
579 <WarningLevel>4</WarningLevel>
580 </Options>
581 </Configuration>
582 <Configuration name="Release">
583 <Options>
584 <CompilerDefines>TRACE</CompilerDefines>
585 <OptimizeCode>true</OptimizeCode>
586 <AllowUnsafe>false</AllowUnsafe>
587 <OutputPath>bin\Release</OutputPath>
588 <DebugInformation>false</DebugInformation>
589 <XmlDocFile>SdlDotNet.Gui.xml</XmlDocFile>
590 <WarningLevel>1</WarningLevel>
591 </Options>
592 </Configuration>
593 <Reference name="System" />
594 <Reference name="System.Drawing" />
595 <Reference name="SdlDotNet" localCopy="true"/>
596 <Files>
597 <Match path="." pattern="*.cs" recurse="true"/>
598 </Files>
599 </Project>-->
600 <Project name="NeHe" path="examples\\NeHe" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.NeHe.NeHe" assemblyName="NeHe" rootNamespace="SdlDotNet.Examples.NeHe" icon="App.ico">
601 <Configuration name="Debug">
602 <Options>
603 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
604 <OptimizeCode>false</OptimizeCode>
605 <AllowUnsafe>false</AllowUnsafe>
606 <OutputPath>bin\Debug</OutputPath>
607 <DebugInformation>true</DebugInformation>
608 <XmlDocFile>NeHe.xml</XmlDocFile>
609 <WarningLevel>4</WarningLevel>
610 <SuppressWarnings>1595</SuppressWarnings>
611 </Options>
612 </Configuration>
613 <Configuration name="Release">
614 <Options>
615 <CompilerDefines>TRACE</CompilerDefines>
616 <OptimizeCode>true</OptimizeCode>
617 <AllowUnsafe>false</AllowUnsafe>
618 <OutputPath>bin\Release</OutputPath>
619 <DebugInformation>false</DebugInformation>
620 <XmlDocFile>NeHe.xml</XmlDocFile>
621 <WarningLevel>1</WarningLevel>
622 <SuppressWarnings>1595</SuppressWarnings>
623 </Options>
624 </Configuration>
625 <Reference name="System" />
626 <Reference name="System.Drawing" />
627 <Reference name="System.Windows.Forms" />
628 <Reference name="SdlDotNet" localCopy="true"/>
629 <Reference name="Tao.OpenGl" localCopy="true" path="..\\..\\lib"/>
630 <Reference name="Tao.OpenGl.Glu" localCopy="true" path="..\\..\\lib"/>
631 <Reference name="Tao.Platform.Windows" localCopy="true" path="..\\..\\lib"/>
632 <Files>
633 <File buildAction="EmbeddedResource">App.ico</File>
634 <File subType="Form">NeHe.cs</File>
635 <Match path="." pattern="*.cs" recurse="true">
636 <Exclude name="NeHe.cs"/>
637 </Match>
638 </Files>
639 </Project>
640 <Project name="RedBook" path="examples\\RedBook" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.RedBook.RedBook" assemblyName="RedBook" rootNamespace="SdlDotNet.Examples.RedBook" icon="App.ico">
641 <Configuration name="Debug">
642 <Options>
643 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
644 <OptimizeCode>false</OptimizeCode>
645 <AllowUnsafe>false</AllowUnsafe>
646 <OutputPath>bin\Debug</OutputPath>
647 <DebugInformation>true</DebugInformation>
648 <XmlDocFile>RedBook.xml</XmlDocFile>
649 <WarningLevel>4</WarningLevel>
650 <SuppressWarnings>1595</SuppressWarnings>
651 </Options>
652 </Configuration>
653 <Configuration name="Release">
654 <Options>
655 <CompilerDefines>TRACE</CompilerDefines>
656 <OptimizeCode>true</OptimizeCode>
657 <AllowUnsafe>false</AllowUnsafe>
658 <OutputPath>bin\Release</OutputPath>
659 <DebugInformation>false</DebugInformation>
660 <XmlDocFile>RedBook.xml</XmlDocFile>
661 <WarningLevel>1</WarningLevel>
662 <SuppressWarnings>1595</SuppressWarnings>
663 </Options>
664 </Configuration>
665 <Reference name="System" />
666 <Reference name="System.Drawing" />
667 <Reference name="System.Windows.Forms" />
668 <Reference name="SdlDotNet" localCopy="true"/>
669 <Reference name="Tao.OpenGl" localCopy="true" path="..\\..\\lib"/>
670 <Reference name="Tao.OpenGl.Glu" localCopy="true" path="..\\..\\lib"/>
671 <Reference name="Tao.FreeGlut" localCopy="true" path="..\\..\\lib"/>
672 <Files>
673 <File buildAction="EmbeddedResource">App.ico</File>
674 <File subType="Form">RedBook.cs</File>
675 <Match path="." pattern="*.cs" recurse="true">
676 <Exclude name="RedBook.cs" />
677 </Match>
678 </Files>
679 </Project>
680 <Project name="PhysFsTest" path="examples\\PhysFsTest" language="C#" type="WinExe" startupObject="SdlDotNet.Examples.PhysFsTest.PhysFsTest" assemblyName="PhysFsTest" rootNamespace="SdlDotNet.Examples.PhysFsTest" icon="App.ico">
681 <Configuration name="Debug">
682 <Options>
683 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
684 <OptimizeCode>false</OptimizeCode>
685 <AllowUnsafe>false</AllowUnsafe>
686 <OutputPath>bin\Debug</OutputPath>
687 <DebugInformation>true</DebugInformation>
688 <XmlDocFile>PhysFsTest.xml</XmlDocFile>
689 <WarningLevel>4</WarningLevel>
690 <SuppressWarnings>1595</SuppressWarnings>
691 </Options>
692 </Configuration>
693 <Configuration name="Release">
694 <Options>
695 <CompilerDefines>TRACE</CompilerDefines>
696 <OptimizeCode>true</OptimizeCode>
697 <AllowUnsafe>false</AllowUnsafe>
698 <OutputPath>bin\Release</OutputPath>
699 <DebugInformation>false</DebugInformation>
700 <XmlDocFile>PhysFsTest.xml</XmlDocFile>
701 <WarningLevel>1</WarningLevel>
702 <SuppressWarnings>1595</SuppressWarnings>
703 </Options>
704 </Configuration>
705 <Reference name="System" />
706 <Reference name="System.Drawing" />
707 <Reference name="SdlDotNet" localCopy="true"/>
708 <Reference name="Tao.PhysFs" localCopy="true" path="..\\..\\lib"/>
709 <Files>
710 <File buildAction="EmbeddedResource">App.ico</File>
711 <Match path="." pattern="*.cs" recurse="true"/>
712 </Files>
713 </Project>
714 </Solution>
715</Prebuild>
diff --git a/Prebuild/doc/prebuild-example5.xml b/Prebuild/doc/prebuild-example5.xml
new file mode 100644
index 0000000..5221547
--- /dev/null
+++ b/Prebuild/doc/prebuild-example5.xml
@@ -0,0 +1,187 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd" version="1.6">
3 <Solution name="Tao.Sdl">
4 <Configuration name="Debug">
5 <Options>
6 <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines>
7 <OptimizeCode>false</OptimizeCode>
8 <AllowUnsafe>true</AllowUnsafe>
9 <OutputPath>bin\Debug</OutputPath>
10 <XmlDocFile>Tao.Sdl.xml</XmlDocFile>
11 <DebugInformation>true</DebugInformation>
12 </Options>
13 </Configuration>
14 <Configuration name="Release">
15 <Options>
16 <CompilerDefines>TRACE;WIN32</CompilerDefines>
17 <OptimizeCode>true</OptimizeCode>
18 <AllowUnsafe>true</AllowUnsafe>
19 <OutputPath>bin\Release</OutputPath>
20 <XmlDocFile>Tao.Sdl.xml</XmlDocFile>
21 <DebugInformation>false</DebugInformation>
22 </Options>
23 </Configuration>
24 <Files>
25 <File>Tao.Sdl.License.txt</File>
26 <File>Tao.Sdl.Readme.txt</File>
27 <File>Tao.Sdl.snk</File>
28 <File>Tao.Sdl.dll.config</File>
29 </Files>
30 <Project name="Tao.Sdl" path="." language="C#" type="Library">
31 <Reference name="System" />
32 <Files>
33 <File>AssemblyInfo.cs</File>
34 <File>Sdl.cs</File>
35 <File>SdlImage.cs</File>
36 <File>SdlMixer.cs</File>
37 <File>SdlTtf.cs</File>
38 <File>SdlNet.cs</File>
39 <File>SdlGfx.cs</File>
40 <File>Smpeg.cs</File>
41 <File>DelegateCallingConventionCdeclAttribute.cs</File>
42 </Files>
43 </Project>
44 <Project name="Tao.Sdl.Tests" path="..\\..\\tests\\Sdl\\" language="C#" type="Library">
45 <Configuration name="Debug">
46 <Options>
47 <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines>
48 <OptimizeCode>false</OptimizeCode>
49 <AllowUnsafe>false</AllowUnsafe>
50 <OutputPath>bin\Debug</OutputPath>
51 <XmlDocFile>Tao.Sdl.Tests.xml</XmlDocFile>
52 <DebugInformation>true</DebugInformation>
53 </Options>
54 </Configuration>
55 <Configuration name="Release">
56 <Options>
57 <CompilerDefines>TRACE;WIN32</CompilerDefines>
58 <OptimizeCode>true</OptimizeCode>
59 <AllowUnsafe>false</AllowUnsafe>
60 <OutputPath>bin\Release</OutputPath>
61 <XmlDocFile>Tao.Sdl.Tests.xml</XmlDocFile>
62 <DebugInformation>false</DebugInformation>
63 </Options>
64 </Configuration>
65 <Reference name="System" />
66 <Reference name="nunit.framework.dll"/>
67 <Reference name="Tao.Sdl" />
68 <Files>
69 <File>AssemblyInfo.cs</File>
70 <File>SdlTest.cs</File>
71 <File>SdlTestVideo.cs</File>
72 <File>SdlTestImage.cs</File>
73 <File>SdlTestTtf.cs</File>
74 <File>SdlTestMixer.cs</File>
75 <File>SdlTestGfx.cs</File>
76 <File>SmpegTest.cs</File>
77 </Files>
78 </Project>
79 <Project name="SdlExamples.Rectangles" path="..\\..\\examples\\SdlExamples\\Rectangles" language="C#" type="WinExe" startupObject="SdlExamples.Rectangles">
80 <Configuration name="Debug">
81 <Options>
82 <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines>
83 <OptimizeCode>false</OptimizeCode>
84 <AllowUnsafe>false</AllowUnsafe>
85 <OutputPath>bin\Debug</OutputPath>
86 <DebugInformation>true</DebugInformation>
87 </Options>
88 </Configuration>
89 <Configuration name="Release">
90 <Options>
91 <CompilerDefines>TRACE;WIN32</CompilerDefines>
92 <OptimizeCode>true</OptimizeCode>
93 <AllowUnsafe>false</AllowUnsafe>
94 <OutputPath>bin\Release</OutputPath>
95 <DebugInformation>false</DebugInformation>
96 </Options>
97 </Configuration>
98 <Reference name="System" />
99 <Reference name="Tao.Sdl" />
100 <Files>
101 <File>AssemblyInfo.cs</File>
102 <File>Rectangles.cs</File>
103 </Files>
104 </Project>
105 <Project name="SdlExamples.SmpegPlayer" path="..\\..\\examples\\SdlExamples\\SmpegPlayer" language="C#" type="WinExe" startupObject="SdlExamples.SmpegPlayer">
106 <Configuration name="Debug">
107 <Options>
108 <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines>
109 <OptimizeCode>false</OptimizeCode>
110 <AllowUnsafe>false</AllowUnsafe>
111 <OutputPath>bin\Debug</OutputPath>
112 <DebugInformation>true</DebugInformation>
113 </Options>
114 </Configuration>
115 <Configuration name="Release">
116 <Options>
117 <CompilerDefines>TRACE;WIN32</CompilerDefines>
118 <OptimizeCode>true</OptimizeCode>
119 <AllowUnsafe>false</AllowUnsafe>
120 <OutputPath>bin\Release</OutputPath>
121 <DebugInformation>false</DebugInformation>
122 </Options>
123 </Configuration>
124 <Reference name="System" />
125 <Reference name="Tao.Sdl" />
126 <Files>
127 <File>AssemblyInfo.cs</File>
128 <File>SmpegPlayer.cs</File>
129 </Files>
130 </Project>
131 <Project name="SdlExamples.GfxPrimitives" path="..\\..\\examples\\SdlExamples\\GfxPrimitives" language="C#" type="WinExe" startupObject="SdlExamples.GfxPrimitives">
132 <Configuration name="Debug">
133 <Options>
134 <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines>
135 <OptimizeCode>false</OptimizeCode>
136 <AllowUnsafe>false</AllowUnsafe>
137 <OutputPath>bin\Debug</OutputPath>
138 <DebugInformation>true</DebugInformation>
139 </Options>
140 </Configuration>
141 <Configuration name="Release">
142 <Options>
143 <CompilerDefines>TRACE;WIN32</CompilerDefines>
144 <OptimizeCode>true</OptimizeCode>
145 <AllowUnsafe>false</AllowUnsafe>
146 <OutputPath>bin\Release</OutputPath>
147 <DebugInformation>false</DebugInformation>
148 </Options>
149 </Configuration>
150 <Reference name="System" />
151 <Reference name="Tao.Sdl" />
152 <Files>
153 <File>AssemblyInfo.cs</File>
154 <File>GfxPrimitives.cs</File>
155 </Files>
156 </Project>
157 <Project name="Tao.PostProcess" path="..\\Tao.PostProcess\\" language="C#" type="Exe">
158 <Configuration name="Debug">
159 <Options>
160 <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines>
161 <OptimizeCode>false</OptimizeCode>
162 <AllowUnsafe>false</AllowUnsafe>
163 <OutputPath>bin\Debug</OutputPath>
164 <DebugInformation>true</DebugInformation>
165 </Options>
166 </Configuration>
167 <Configuration name="Release">
168 <Options>
169 <CompilerDefines>TRACE;WIN32</CompilerDefines>
170 <OptimizeCode>true</OptimizeCode>
171 <AllowUnsafe>false</AllowUnsafe>
172 <OutputPath>bin\Release</OutputPath>
173 <DebugInformation>false</DebugInformation>
174 </Options>
175 </Configuration>
176 <Reference name="System" />
177 <Files>
178 <File>AssemblyInfo.cs</File>
179 <File>AppMain.cs</File>
180 <File>BuildProcessor.cs</File>
181 <File>Options.cs</File>
182 <File>ReleaseBuildProcessor.cs</File>
183 <File>UsageHelp.cs</File>
184 </Files>
185 </Project>
186 </Solution>
187</Prebuild>
diff --git a/Prebuild/prebuild b/Prebuild/prebuild
new file mode 100644
index 0000000..0dc648d
--- /dev/null
+++ b/Prebuild/prebuild
@@ -0,0 +1,2 @@
1#!/bin/sh
2exec mono [PREFIX]/prebuild.exe "$@"
diff --git a/Prebuild/scripts/Clean.bat b/Prebuild/scripts/Clean.bat
new file mode 100644
index 0000000..39fa685
--- /dev/null
+++ b/Prebuild/scripts/Clean.bat
@@ -0,0 +1,2 @@
1cd ..
2Prebuild.exe /clean /yes /removedir obj /file prebuild.xml /build NET_2_0 /pause
diff --git a/Prebuild/scripts/Help.bat b/Prebuild/scripts/Help.bat
new file mode 100644
index 0000000..a7d3db4
--- /dev/null
+++ b/Prebuild/scripts/Help.bat
@@ -0,0 +1,2 @@
1cd ..
2Prebuild.exe /usage /pause \ No newline at end of file
diff --git a/Prebuild/scripts/MonoDevelop.sh b/Prebuild/scripts/MonoDevelop.sh
new file mode 100644
index 0000000..dae3cf4
--- /dev/null
+++ b/Prebuild/scripts/MonoDevelop.sh
@@ -0,0 +1,2 @@
1#!/bin/sh
2prebuild /target monodev /file ../prebuild.xml /build NET_1_1 /pause
diff --git a/Prebuild/scripts/Prebuild.nsi b/Prebuild/scripts/Prebuild.nsi
new file mode 100644
index 0000000..0c6e2bc
--- /dev/null
+++ b/Prebuild/scripts/Prebuild.nsi
@@ -0,0 +1,231 @@
1!verbose 3
2
3!define PRODUCT_NAME "Prebuild"
4!define PRODUCT_VERSION "1.3.1"
5!define PRODUCT_PUBLISHER "Prebuild"
6!define PRODUCT_PACKAGE "prebuild"
7!define PRODUCT_WEB_SITE "http://dnpb.sourceforge.net"
8!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Prebuild"
9!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\Prebuild"
10!define PRODUCT_UNINST_ROOT_KEY "HKLM"
11!define PRODUCT_PATH ".."
12
13;!define MUI_WELCOMEFINISHPAGE_BITMAP "PrebuildLogo.bmp"
14;!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
15;!define MUI_UNWELCOMEFINISHPAGE_BITMAP "PrebuildLogo.bmp"
16;!define MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH
17
18BrandingText "© 2003-2006 David Hudson, http://dnpb.sourceforge.net/"
19SetCompressor lzma
20CRCCheck on
21
22; File Association defines
23;!include "fileassoc.nsh"
24
25; MUI 1.67 compatible ------
26!include "MUI.nsh"
27
28; MUI Settings
29!define MUI_ABORTWARNING
30!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
31!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
32
33;--------------------------------
34;Variables
35
36;--------------------------------
37;Installer Pages
38
39; Welcome page
40!insertmacro MUI_PAGE_WELCOME
41; License page
42!insertmacro MUI_PAGE_LICENSE "..\doc\license.txt"
43; Directory page
44!insertmacro MUI_PAGE_DIRECTORY
45
46; Instfiles page
47!insertmacro MUI_PAGE_INSTFILES
48
49; Finish page
50!insertmacro MUI_PAGE_FINISH
51
52;------------------------------------
53; Uninstaller pages
54!insertmacro MUI_UNPAGE_CONFIRM
55!insertmacro MUI_UNPAGE_INSTFILES
56!insertmacro MUI_UNPAGE_FINISH
57;------------------------------------
58
59; Language files
60!insertmacro MUI_LANGUAGE "English"
61
62; Reserve files
63!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
64
65; MUI end ------
66
67Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
68OutFile "..\${PRODUCT_PACKAGE}-${PRODUCT_VERSION}-setup.exe"
69InstallDir "$PROGRAMFILES\Prebuild"
70InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
71ShowInstDetails show
72ShowUnInstDetails show
73
74; .NET Framework check
75; http://msdn.microsoft.com/netframework/default.aspx?pull=/library/en-us/dnnetdep/html/redistdeploy1_1.asp
76; Section "Detecting that the .NET Framework 1.1 is installed"
77Function .onInit
78 ReadRegDWORD $R0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v1.1.4322" Install
79 StrCmp $R0 "" 0 CheckPreviousVersion
80 MessageBox MB_OK "Microsoft .NET Framework 1.1 was not found on this system.$\r$\n$\r$\nUnable to continue this installation."
81 Abort
82
83 CheckPreviousVersion:
84 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName"
85 StrCmp $R0 "" CheckOSVersion 0
86 MessageBox MB_OK "An old version of Prebuild is installed on this computer, please uninstall first.$\r$\n$\r$\nUnable to continue this installation."
87 Abort
88
89 CheckOSVersion:
90 Call IsSupportedWindowsVersion
91 Pop $R0
92 StrCmp $R0 "False" NoAbort 0
93 MessageBox MB_OK "The operating system you are using is not supported by Prebuild (95/98/ME/NT3.x/NT4.x)."
94 Abort
95
96 NoAbort:
97FunctionEnd
98
99Section "Source" SecSource
100 SetOverwrite ifnewer
101 SetOutPath "$INSTDIR\src"
102 File /r /x *.swp /x .svn /x *.xml /x *.csproj /x *.user /x *.build /x *.prjx /x *.mdp /x bin /x obj /x *.nsi ${PRODUCT_PATH}\src\*.*
103
104 ;Store installation folder
105 WriteRegStr HKCU "Software\Prebuild" "" $INSTDIR
106
107SectionEnd
108
109Section "Runtime" SecRuntime
110 SetOverwrite ifnewer
111 SetOutPath "$INSTDIR"
112 File /r /x *.swp /x .svn /x *.nsi /x src /x *.sln /x *.cmbx /x *.mds ${PRODUCT_PATH}\Prebuild.exe ${PRODUCT_PATH}\prebuild.xml
113
114 ;Store installation folder
115 WriteRegStr HKCU "Software\Prebuild" "" $INSTDIR
116
117SectionEnd
118
119Section "Documentation" SecDocs
120 SetOverwrite ifnewer
121 SetOutPath "$INSTDIR\doc"
122 File /r /x *.swp /x .svn /x *.exe ${PRODUCT_PATH}\doc\*.*
123
124 ;Store installation folder
125 WriteRegStr HKCU "Software\Prebuild" "" $INSTDIR
126SectionEnd
127
128Section "Scripts" SecScripts
129 SetOverwrite ifnewer
130 SetOutPath "$INSTDIR\scripts"
131 File /r /x *.swp /x .svn /x *.nsi /x *.exe ${PRODUCT_PATH}\scripts\*.*
132
133 ;Store installation folder
134 WriteRegStr HKCU "Software\Prebuild" "" $INSTDIR
135SectionEnd
136
137;Language strings
138
139Section -AdditionalIcons
140 WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
141SectionEnd
142
143Section -Post
144 WriteUninstaller "$INSTDIR\uninst.exe"
145 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
146 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
147 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
148 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
149 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
150SectionEnd
151
152Section Uninstall
153
154 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
155 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
156 RMDir /r "$INSTDIR"
157
158SectionEnd
159
160; GetWindowsVersion, taken from NSIS help, modified for our purposes
161Function IsSupportedWindowsVersion
162
163 Push $R0
164 Push $R1
165
166 ReadRegStr $R0 HKLM \
167 "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
168
169 IfErrors 0 lbl_winnt
170
171 ; we are not NT
172 ReadRegStr $R0 HKLM \
173 "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
174
175 StrCpy $R1 $R0 1
176 StrCmp $R1 '4' 0 lbl_error
177
178 StrCpy $R1 $R0 3
179
180 StrCmp $R1 '4.0' lbl_win32_95
181 StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
182
183 lbl_win32_95:
184 StrCpy $R0 'False'
185 Goto lbl_done
186
187 lbl_win32_98:
188 StrCpy $R0 'False'
189 Goto lbl_done
190
191 lbl_win32_ME:
192 StrCpy $R0 'False'
193 Goto lbl_done
194
195 lbl_winnt:
196
197 StrCpy $R1 $R0 1
198
199 StrCmp $R1 '3' lbl_winnt_x
200 StrCmp $R1 '4' lbl_winnt_x
201
202 StrCpy $R1 $R0 3
203
204 StrCmp $R1 '5.0' lbl_winnt_2000
205 StrCmp $R1 '5.1' lbl_winnt_XP
206 StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
207
208 lbl_winnt_x:
209 StrCpy $R0 'False'
210 Goto lbl_done
211
212 lbl_winnt_2000:
213 Strcpy $R0 'True'
214 Goto lbl_done
215
216 lbl_winnt_XP:
217 Strcpy $R0 'True'
218 Goto lbl_done
219
220 lbl_winnt_2003:
221 Strcpy $R0 'True'
222 Goto lbl_done
223
224 lbl_error:
225 Strcpy $R0 'False'
226 lbl_done:
227
228 Pop $R1
229 Exch $R0
230
231FunctionEnd
diff --git a/Prebuild/scripts/SharpDevelop.bat b/Prebuild/scripts/SharpDevelop.bat
new file mode 100644
index 0000000..483d9c9
--- /dev/null
+++ b/Prebuild/scripts/SharpDevelop.bat
@@ -0,0 +1,4 @@
1@rem Generates a combine (.cmbx) and a set of project files (.prjx)
2@rem for SharpDevelop (http://icsharpcode.net/OpenSource/SD/Default.aspx)
3cd ..
4Prebuild.exe /target sharpdev /file prebuild.xml /build NET_1_1 /pause
diff --git a/Prebuild/scripts/SharpDevelop2.bat b/Prebuild/scripts/SharpDevelop2.bat
new file mode 100644
index 0000000..4ca0272
--- /dev/null
+++ b/Prebuild/scripts/SharpDevelop2.bat
@@ -0,0 +1,4 @@
1@rem Generates a combine (.cmbx) and a set of project files (.prjx)
2@rem for SharpDevelop (http://icsharpcode.net/OpenSource/SD/Default.aspx)
3cd ..
4Prebuild.exe /target sharpdev2 /file prebuild.xml /pause
diff --git a/Prebuild/scripts/VS2002.bat b/Prebuild/scripts/VS2002.bat
new file mode 100644
index 0000000..a11740e
--- /dev/null
+++ b/Prebuild/scripts/VS2002.bat
@@ -0,0 +1,4 @@
1@rem Generates a solution (.sln) and a set of project files (.csproj)
2@rem for Microsoft Visual Studio .NET 2002
3cd ..
4Prebuild.exe /target vs2002 /file prebuild.xml /build NET_1_1 /pause
diff --git a/Prebuild/scripts/VS2003.bat b/Prebuild/scripts/VS2003.bat
new file mode 100644
index 0000000..1be57f8
--- /dev/null
+++ b/Prebuild/scripts/VS2003.bat
@@ -0,0 +1,4 @@
1@rem Generates a solution (.sln) and a set of project files (.csproj)
2@rem for Microsoft Visual Studio .NET 2002
3cd ..
4Prebuild.exe /target vs2003 /file prebuild.xml /build NET_1_1 /pause
diff --git a/Prebuild/scripts/VS2005.bat b/Prebuild/scripts/VS2005.bat
new file mode 100644
index 0000000..86ad3fc
--- /dev/null
+++ b/Prebuild/scripts/VS2005.bat
@@ -0,0 +1,4 @@
1@rem Generates a solution (.sln) and a set of project files (.csproj, .vbproj, etc.)
2@rem for Microsoft Visual Studio .NET 2005
3cd ..
4Prebuild.exe /target vs2005 /file prebuild.xml /build NET_2_0 /pause
diff --git a/Prebuild/scripts/autotools.bat b/Prebuild/scripts/autotools.bat
new file mode 100644
index 0000000..1fd3469
--- /dev/null
+++ b/Prebuild/scripts/autotools.bat
@@ -0,0 +1,4 @@
1@rem Generates Makefiles
2@rem for autotools
3cd ..
4Prebuild.exe /target autotools /file prebuild.xml /pause
diff --git a/Prebuild/scripts/autotools.sh b/Prebuild/scripts/autotools.sh
new file mode 100644
index 0000000..18cd46f
--- /dev/null
+++ b/Prebuild/scripts/autotools.sh
@@ -0,0 +1,2 @@
1#!/bin/sh
2prebuild /target autotools /file ../prebuild.xml /build NET_2_0 /pause
diff --git a/Prebuild/scripts/nant.bat b/Prebuild/scripts/nant.bat
new file mode 100644
index 0000000..2a6ae60
--- /dev/null
+++ b/Prebuild/scripts/nant.bat
@@ -0,0 +1,4 @@
1@rem Generates a .build files
2@rem for NAnt
3cd ..
4Prebuild.exe /target nant /file prebuild.xml /pause
diff --git a/Prebuild/scripts/nant.sh b/Prebuild/scripts/nant.sh
new file mode 100644
index 0000000..54a8254
--- /dev/null
+++ b/Prebuild/scripts/nant.sh
@@ -0,0 +1,2 @@
1#!/bin/sh
2prebuild /target nant /file ../prebuild.xml /pause
diff --git a/Prebuild/src/App.ico b/Prebuild/src/App.ico
new file mode 100644
index 0000000..ac4ea6f
--- /dev/null
+++ b/Prebuild/src/App.ico
Binary files differ
diff --git a/Prebuild/src/Core/Attributes/DataNodeAttribute.cs b/Prebuild/src/Core/Attributes/DataNodeAttribute.cs
new file mode 100644
index 0000000..dbdaf0b
--- /dev/null
+++ b/Prebuild/src/Core/Attributes/DataNodeAttribute.cs
@@ -0,0 +1,81 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36using System.Collections.Specialized;
37
38namespace Prebuild.Core.Attributes
39{
40 /// <summary>
41 ///
42 /// </summary>
43 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
44 public sealed class DataNodeAttribute : Attribute
45 {
46 #region Fields
47
48 private string m_Name = "unknown";
49
50 #endregion
51
52 #region Constructors
53
54 /// <summary>
55 /// Initializes a new instance of the <see cref="DataNodeAttribute"/> class.
56 /// </summary>
57 /// <param name="name">The name.</param>
58 public DataNodeAttribute(string name)
59 {
60 m_Name = name;
61 }
62
63 #endregion
64
65 #region Properties
66
67 /// <summary>
68 /// Gets the name.
69 /// </summary>
70 /// <value>The name.</value>
71 public string Name
72 {
73 get
74 {
75 return m_Name;
76 }
77 }
78
79 #endregion
80 }
81}
diff --git a/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs b/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs
new file mode 100644
index 0000000..edda56d
--- /dev/null
+++ b/Prebuild/src/Core/Attributes/OptionNodeAttribute.cs
@@ -0,0 +1,80 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36
37namespace Prebuild.Core.Attributes
38{
39 /// <summary>
40 ///
41 /// </summary>
42 [AttributeUsage(AttributeTargets.Field)]
43 public sealed class OptionNodeAttribute : Attribute
44 {
45 #region Fields
46
47 private string m_NodeName;
48
49 #endregion
50
51 #region Constructors
52
53 /// <summary>
54 /// Initializes a new instance of the <see cref="OptionNodeAttribute"/> class.
55 /// </summary>
56 /// <param name="nodeName">Name of the node.</param>
57 public OptionNodeAttribute(string nodeName)
58 {
59 m_NodeName = nodeName;
60 }
61
62 #endregion
63
64 #region Properties
65
66 /// <summary>
67 /// Gets the name of the node.
68 /// </summary>
69 /// <value>The name of the node.</value>
70 public string NodeName
71 {
72 get
73 {
74 return m_NodeName;
75 }
76 }
77
78 #endregion
79 }
80}
diff --git a/Prebuild/src/Core/Attributes/TargetAttribute.cs b/Prebuild/src/Core/Attributes/TargetAttribute.cs
new file mode 100644
index 0000000..985f180
--- /dev/null
+++ b/Prebuild/src/Core/Attributes/TargetAttribute.cs
@@ -0,0 +1,80 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36
37namespace Prebuild.Core.Attributes
38{
39 /// <summary>
40 ///
41 /// </summary>
42 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
43 public sealed class TargetAttribute : Attribute
44 {
45 #region Fields
46
47 private string m_Name;
48
49 #endregion
50
51 #region Constructors
52
53 /// <summary>
54 /// Initializes a new instance of the <see cref="TargetAttribute"/> class.
55 /// </summary>
56 /// <param name="name">The name.</param>
57 public TargetAttribute(string name)
58 {
59 m_Name = name;
60 }
61
62 #endregion
63
64 #region Properties
65
66 /// <summary>
67 /// Gets the name.
68 /// </summary>
69 /// <value>The name.</value>
70 public string Name
71 {
72 get
73 {
74 return m_Name;
75 }
76 }
77
78 #endregion
79 }
80}
diff --git a/Prebuild/src/Core/FatalException.cs b/Prebuild/src/Core/FatalException.cs
new file mode 100644
index 0000000..92aad3d
--- /dev/null
+++ b/Prebuild/src/Core/FatalException.cs
@@ -0,0 +1,94 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36using System.Runtime.Serialization;
37
38namespace Prebuild.Core
39{
40 /// <summary>
41 ///
42 /// </summary>
43 [Serializable()]
44 public class FatalException : Exception
45 {
46 #region Constructors
47
48
49 /// <summary>
50 /// Initializes a new instance of the <see cref="FatalException"/> class.
51 /// </summary>
52 public FatalException()
53 {
54 }
55
56 /// <summary>
57 /// Initializes a new instance of the <see cref="FatalException"/> class.
58 /// </summary>
59 /// <param name="format">The format.</param>
60 /// <param name="args">The args.</param>
61 public FatalException(string format, params object[] args)
62 : base(String.Format(format, args))
63 {
64 }
65
66 /// <summary>
67 /// Exception with specified string
68 /// </summary>
69 /// <param name="message">Exception message</param>
70 public FatalException(string message): base(message)
71 {
72 }
73
74 /// <summary>
75 ///
76 /// </summary>
77 /// <param name="message"></param>
78 /// <param name="exception"></param>
79 public FatalException(string message, Exception exception) : base(message, exception)
80 {
81 }
82
83 /// <summary>
84 ///
85 /// </summary>
86 /// <param name="info"></param>
87 /// <param name="context"></param>
88 protected FatalException(SerializationInfo info, StreamingContext context) : base( info, context )
89 {
90 }
91
92 #endregion
93 }
94}
diff --git a/Prebuild/src/Core/Interfaces/IDataNode.cs b/Prebuild/src/Core/Interfaces/IDataNode.cs
new file mode 100644
index 0000000..0bad97c
--- /dev/null
+++ b/Prebuild/src/Core/Interfaces/IDataNode.cs
@@ -0,0 +1,56 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36using System.Xml;
37
38namespace Prebuild.Core.Interfaces
39{
40 /// <summary>
41 ///
42 /// </summary>
43 public interface IDataNode
44 {
45 /// <summary>
46 /// Gets or sets the parent.
47 /// </summary>
48 /// <value>The parent.</value>
49 IDataNode Parent { get; set; }
50 /// <summary>
51 /// Parses the specified node.
52 /// </summary>
53 /// <param name="node">The node.</param>
54 void Parse(XmlNode node);
55 }
56}
diff --git a/Prebuild/src/Core/Interfaces/ITarget.cs b/Prebuild/src/Core/Interfaces/ITarget.cs
new file mode 100644
index 0000000..dac6cd6
--- /dev/null
+++ b/Prebuild/src/Core/Interfaces/ITarget.cs
@@ -0,0 +1,60 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36
37namespace Prebuild.Core.Interfaces
38{
39 /// <summary>
40 ///
41 /// </summary>
42 public interface ITarget
43 {
44 /// <summary>
45 /// Writes the specified kern.
46 /// </summary>
47 /// <param name="kern">The kern.</param>
48 void Write(Kernel kern);
49 /// <summary>
50 /// Cleans the specified kern.
51 /// </summary>
52 /// <param name="kern">The kern.</param>
53 void Clean(Kernel kern);
54 /// <summary>
55 /// Gets the name.
56 /// </summary>
57 /// <value>The name.</value>
58 string Name { get; }
59 }
60} \ No newline at end of file
diff --git a/Prebuild/src/Core/Kernel.cs b/Prebuild/src/Core/Kernel.cs
new file mode 100644
index 0000000..3117e7c
--- /dev/null
+++ b/Prebuild/src/Core/Kernel.cs
@@ -0,0 +1,758 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: robloach $
30 * $Date: 2006-09-26 00:30:53 +0200 (ti, 26 sep 2006) $
31 * $Revision: 165 $
32 */
33#endregion
34
35using System;
36using System.Diagnostics;
37using System.Collections;
38using System.Collections.Specialized;
39using System.IO;
40using System.Reflection;
41using System.Xml;
42using System.Xml.Schema;
43using System.Text;
44
45using Prebuild.Core.Attributes;
46using Prebuild.Core.Interfaces;
47using Prebuild.Core.Nodes;
48using Prebuild.Core.Parse;
49using Prebuild.Core.Utilities;
50
51namespace Prebuild.Core
52{
53 /// <summary>
54 ///
55 /// </summary>
56 public class Kernel : IDisposable
57 {
58 #region Inner Classes
59
60 private struct NodeEntry
61 {
62 public Type Type;
63 public DataNodeAttribute Attribute;
64 }
65
66 #endregion
67
68 #region Fields
69
70 private static Kernel m_Instance = new Kernel();
71
72 /// <summary>
73 /// This must match the version of the schema that is embeeded
74 /// </summary>
75 private static string m_SchemaVersion = "1.7";
76 private static string m_Schema = "prebuild-" + m_SchemaVersion + ".xsd";
77 private static string m_SchemaURI = "http://dnpb.sourceforge.net/schemas/" + m_Schema;
78 bool disposed;
79 private Version m_Version;
80 private string m_Revision = "";
81 private CommandLineCollection m_CommandLine;
82 private Log m_Log;
83 private CurrentDirectory m_CurrentWorkingDirectory;
84 private XmlSchemaCollection m_Schemas;
85
86 private Hashtable m_Targets;
87 private Hashtable m_Nodes;
88
89 ArrayList m_Solutions;
90 string m_Target;
91 string m_Clean;
92 string[] m_RemoveDirectories;
93 string m_CurrentFile;
94 bool m_PauseAfterFinish;
95 string[] m_ProjectGroups;
96 StringCollection m_Refs;
97
98
99 #endregion
100
101 #region Constructors
102
103 private Kernel()
104 {
105 }
106
107 #endregion
108
109 #region Properties
110
111 /// <summary>
112 /// Gets a value indicating whether [pause after finish].
113 /// </summary>
114 /// <value><c>true</c> if [pause after finish]; otherwise, <c>false</c>.</value>
115 public bool PauseAfterFinish
116 {
117 get
118 {
119 return m_PauseAfterFinish;
120 }
121 }
122
123 /// <summary>
124 /// Gets the instance.
125 /// </summary>
126 /// <value>The instance.</value>
127 public static Kernel Instance
128 {
129 get
130 {
131 return m_Instance;
132 }
133 }
134
135 /// <summary>
136 /// Gets the version.
137 /// </summary>
138 /// <value>The version.</value>
139 public string Version
140 {
141 get
142 {
143 return String.Format("{0}.{1}.{2}{3}", m_Version.Major, m_Version.Minor, m_Version.Build, m_Revision);
144 }
145 }
146
147 /// <summary>
148 /// Gets the command line.
149 /// </summary>
150 /// <value>The command line.</value>
151 public CommandLineCollection CommandLine
152 {
153 get
154 {
155 return m_CommandLine;
156 }
157 }
158
159 /// <summary>
160 /// Gets the targets.
161 /// </summary>
162 /// <value>The targets.</value>
163 public Hashtable Targets
164 {
165 get
166 {
167 return m_Targets;
168 }
169 }
170
171 /// <summary>
172 /// Gets the log.
173 /// </summary>
174 /// <value>The log.</value>
175 public Log Log
176 {
177 get
178 {
179 return m_Log;
180 }
181 }
182
183 /// <summary>
184 /// Gets the current working directory.
185 /// </summary>
186 /// <value>The current working directory.</value>
187 public CurrentDirectory CurrentWorkingDirectory
188 {
189 get
190 {
191 return m_CurrentWorkingDirectory;
192 }
193 }
194
195 /// <summary>
196 /// Gets the solutions.
197 /// </summary>
198 /// <value>The solutions.</value>
199 public ArrayList Solutions
200 {
201 get
202 {
203 return m_Solutions;
204 }
205 }
206
207 #endregion
208
209 #region Private Methods
210
211 private void RemoveDirectories(string rootDir, string[] dirNames)
212 {
213 foreach(string dir in Directory.GetDirectories(rootDir))
214 {
215 string simpleName = Path.GetFileName(dir);
216
217 if(Array.IndexOf(dirNames, simpleName) != -1)
218 {
219 //delete if the name matches one of the directory names to delete
220 string fullDirPath = Path.GetFullPath(dir);
221 Directory.Delete(fullDirPath,true);
222 }
223 else//not a match, so check children
224 {
225 RemoveDirectories(dir,dirNames);
226 //recurse, checking children for them
227 }
228 }
229 }
230
231// private void RemoveDirectoryMatches(string rootDir, string dirPattern)
232// {
233// foreach(string dir in Directory.GetDirectories(rootDir))
234// {
235// foreach(string match in Directory.GetDirectories(dir))
236// {//delete all child directories that match
237// Directory.Delete(Path.GetFullPath(match),true);
238// }
239// //recure through the rest checking for nested matches to delete
240// RemoveDirectoryMatches(dir,dirPattern);
241// }
242// }
243
244 private void LoadSchema()
245 {
246 Assembly assembly = this.GetType().Assembly;
247 Stream stream = assembly.GetManifestResourceStream("Prebuild.data." + m_Schema);
248 if(stream == null)
249 {
250 //try without the default namespace prepending to it in case was compiled with SharpDevelop or MonoDevelop instead of Visual Studio .NET
251 stream = assembly.GetManifestResourceStream(m_Schema);
252 if(stream == null)
253 {
254 throw new System.Reflection.TargetException(string.Format("Could not find the scheme embedded resource file '{0}'.", m_Schema));
255 }
256 }
257 XmlReader schema = new XmlTextReader(stream);
258
259 m_Schemas = new XmlSchemaCollection();
260 m_Schemas.Add(m_SchemaURI, schema);
261 }
262
263 private void CacheVersion()
264 {
265 m_Version = Assembly.GetEntryAssembly().GetName().Version;
266 }
267
268 private void CacheTargets(Assembly assm)
269 {
270 foreach(Type t in assm.GetTypes())
271 {
272 TargetAttribute ta = (TargetAttribute)Helper.CheckType(t, typeof(TargetAttribute), typeof(ITarget));
273 if(ta == null)
274 {
275 continue;
276 }
277
278 ITarget target = (ITarget)assm.CreateInstance(t.FullName);
279 if(target == null)
280 {
281 throw new MissingMethodException("Could not create ITarget instance");
282 }
283
284 m_Targets[ta.Name] = target;
285 }
286 }
287
288 private void CacheNodeTypes(Assembly assm)
289 {
290 foreach(Type t in assm.GetTypes())
291 {
292 DataNodeAttribute dna = (DataNodeAttribute)Helper.CheckType(t, typeof(DataNodeAttribute), typeof(IDataNode));
293 if(dna == null)
294 {
295 continue;
296 }
297
298 NodeEntry ne = new NodeEntry();
299 ne.Type = t;
300 ne.Attribute = dna;
301 m_Nodes[dna.Name] = ne;
302 }
303 }
304
305 private void LogBanner()
306 {
307 m_Log.Write("Prebuild v" + this.Version);
308 m_Log.Write("Copyright (c) Matthew Holmes, Dan Moorehead and David Hudson");
309 m_Log.Write("See 'prebuild /usage' for help");
310 m_Log.Write();
311 }
312
313 private void ProcessFile(string file)
314 {
315 m_CurrentWorkingDirectory.Push();
316
317 string path = file;
318 try
319 {
320 try
321 {
322 path = Helper.ResolvePath(path);
323 }
324 catch(ArgumentException)
325 {
326 m_Log.Write("Could not open Prebuild file: " + path);
327 m_CurrentWorkingDirectory.Pop();
328 return;
329 }
330
331 m_CurrentFile = path;
332 Helper.SetCurrentDir(Path.GetDirectoryName(path));
333
334
335 XmlTextReader reader = new XmlTextReader(path);
336
337 Core.Parse.Preprocessor pre = new Core.Parse.Preprocessor();
338
339 //register command line arguments as XML variables
340 IDictionaryEnumerator dict = m_CommandLine.GetEnumerator();
341 while (dict.MoveNext())
342 {
343 string name = dict.Key.ToString().Trim();
344 if (name.Length > 0)
345 pre.RegisterVariable(name, dict.Value.ToString());
346 }
347
348 string xml = pre.Process(reader);//remove script and evaulate pre-proccessing to get schema-conforming XML
349
350
351 XmlDocument doc = new XmlDocument();
352 try
353 {
354 XmlValidatingReader validator = new XmlValidatingReader(new XmlTextReader(new StringReader(xml)));
355
356 //validate while reading from string into XmlDocument DOM structure in memory
357 foreach(XmlSchema schema in m_Schemas)
358 {
359 validator.Schemas.Add(schema);
360 }
361 doc.Load(validator);
362 }
363 catch(XmlException e)
364 {
365 throw new XmlException(e.ToString());
366 }
367
368 //is there a purpose to writing it? An syntax/schema problem would have been found during pre.Process() and reported with details
369 if(m_CommandLine.WasPassed("ppo"))
370 {
371 string ppoFile = m_CommandLine["ppo"];
372 if(ppoFile == null || ppoFile.Trim().Length < 1)
373 {
374 ppoFile = "preprocessed.xml";
375 }
376
377 StreamWriter writer = null;
378 try
379 {
380 writer = new StreamWriter(ppoFile);
381 writer.Write(xml);
382 }
383 catch(IOException ex)
384 {
385 Console.WriteLine("Could not write PPO file '{0}': {1}", ppoFile, ex.Message);
386 }
387 finally
388 {
389 if(writer != null)
390 {
391 writer.Close();
392 }
393 }
394 return;
395 }
396 //start reading the xml config file
397 XmlElement rootNode = doc.DocumentElement;
398 //string suggestedVersion = Helper.AttributeValue(rootNode,"version","1.0");
399 Helper.CheckForOSVariables = Helper.ParseBoolean(rootNode,"checkOsVars",false);
400
401 foreach(XmlNode node in rootNode.ChildNodes)//solutions or if pre-proc instructions
402 {
403 IDataNode dataNode = ParseNode(node, null);
404 if(dataNode is ProcessNode)
405 {
406 ProcessNode proc = (ProcessNode)dataNode;
407 if(proc.IsValid)
408 {
409 ProcessFile(proc.Path);
410 }
411 }
412 else if(dataNode is SolutionNode)
413 {
414 m_Solutions.Add(dataNode);
415 }
416 }
417 }
418 catch(XmlSchemaException xse)
419 {
420 m_Log.Write("XML validation error at line {0} in {1}:\n\n{2}",
421 xse.LineNumber, path, xse.Message);
422 }
423 finally
424 {
425 m_CurrentWorkingDirectory.Pop();
426 }
427 }
428
429 #endregion
430
431 #region Public Methods
432
433 /// <summary>
434 /// Allows the project.
435 /// </summary>
436 /// <param name="projectGroupsFlags">The project groups flags.</param>
437 /// <returns></returns>
438 public bool AllowProject(string projectGroupsFlags)
439 {
440 if(m_ProjectGroups != null && m_ProjectGroups.Length > 0)
441 {
442 if(projectGroupsFlags != null && projectGroupsFlags.Length == 0)
443 {
444 foreach(string group in projectGroupsFlags.Split('|'))
445 {
446 if(Array.IndexOf(m_ProjectGroups, group) != -1) //if included in the filter list
447 {
448 return true;
449 }
450 }
451 }
452 return false;//not included in the list or no groups specified for the project
453 }
454 return true;//no filter specified in the command line args
455 }
456
457 /// <summary>
458 /// Gets the type of the node.
459 /// </summary>
460 /// <param name="node">The node.</param>
461 /// <returns></returns>
462 public Type GetNodeType(XmlNode node)
463 {
464 if( node == null )
465 {
466 throw new ArgumentNullException("node");
467 }
468 if(!m_Nodes.ContainsKey(node.Name))
469 {
470 return null;
471 }
472
473 NodeEntry ne = (NodeEntry)m_Nodes[node.Name];
474 return ne.Type;
475 }
476
477 /// <summary>
478 ///
479 /// </summary>
480 /// <param name="node"></param>
481 /// <param name="parent"></param>
482 /// <returns></returns>
483 public IDataNode ParseNode(XmlNode node, IDataNode parent)
484 {
485 return ParseNode(node, parent, null);
486 }
487
488 //Create an instance of the data node type that is mapped to the name of the xml DOM node
489 /// <summary>
490 /// Parses the node.
491 /// </summary>
492 /// <param name="node">The node.</param>
493 /// <param name="parent">The parent.</param>
494 /// <param name="preNode">The pre node.</param>
495 /// <returns></returns>
496 public IDataNode ParseNode(XmlNode node, IDataNode parent, IDataNode preNode)
497 {
498 IDataNode dataNode = null;
499
500 try
501 {
502 if( node == null )
503 {
504 throw new ArgumentNullException("node");
505 }
506 if(preNode == null)
507 {
508 if(!m_Nodes.ContainsKey(node.Name))
509 {
510 //throw new XmlException("Unknown XML node: " + node.Name);
511 return null;
512 }
513
514 NodeEntry ne = (NodeEntry)m_Nodes[node.Name];
515 Type type = ne.Type;
516 //DataNodeAttribute dna = ne.Attribute;
517
518 dataNode = (IDataNode)type.Assembly.CreateInstance(type.FullName);
519 if(dataNode == null)
520 {
521 throw new System.Reflection.TargetException("Could not create new parser instance: " + type.FullName);
522 }
523 }
524 else
525 dataNode = preNode;
526
527 dataNode.Parent = parent;
528 dataNode.Parse(node);
529 }
530 catch(WarningException wex)
531 {
532 m_Log.Write(LogType.Warning, wex.Message);
533 return null;
534 }
535 catch(FatalException fex)
536 {
537 m_Log.WriteException(LogType.Error, fex);
538 throw;
539 }
540 catch(Exception ex)
541 {
542 m_Log.WriteException(LogType.Error, ex);
543 throw;
544 }
545
546 return dataNode;
547 }
548
549 /// <summary>
550 /// Initializes the specified target.
551 /// </summary>
552 /// <param name="target">The target.</param>
553 /// <param name="args">The args.</param>
554 public void Initialize(LogTargets target, string[] args)
555 {
556 m_Targets = new Hashtable();
557 CacheTargets(this.GetType().Assembly);
558 m_Nodes = new Hashtable();
559 CacheNodeTypes(this.GetType().Assembly);
560 CacheVersion();
561
562 m_CommandLine = new CommandLineCollection(args);
563
564 string logFile = null;
565 if(m_CommandLine.WasPassed("log"))
566 {
567 logFile = m_CommandLine["log"];
568
569 if(logFile != null && logFile.Length == 0)
570 {
571 logFile = "Prebuild.log";
572 }
573 }
574 else
575 {
576 target = target & ~LogTargets.File; //dont output to a file
577 }
578
579 m_Log = new Log(target, logFile);
580 LogBanner();
581
582 m_CurrentWorkingDirectory = new CurrentDirectory();
583
584 m_Target = m_CommandLine["target"];
585 m_Clean = m_CommandLine["clean"];
586 string removeDirs = m_CommandLine["removedir"];
587 if(removeDirs != null && removeDirs.Length == 0)
588 {
589 m_RemoveDirectories = removeDirs.Split('|');
590 }
591
592 string flags = m_CommandLine["allowedgroups"];//allows filtering by specifying a pipe-delimited list of groups to include
593 if(flags != null && flags.Length == 0)
594 {
595 m_ProjectGroups = flags.Split('|');
596 }
597 m_PauseAfterFinish = m_CommandLine.WasPassed("pause");
598
599 LoadSchema();
600
601 m_Solutions = new ArrayList();
602 m_Refs = new StringCollection();
603 }
604
605 /// <summary>
606 /// Processes this instance.
607 /// </summary>
608 public void Process()
609 {
610 bool perfomedOtherTask = false;
611 if(m_RemoveDirectories != null && m_RemoveDirectories.Length > 0)
612 {
613 try
614 {
615 RemoveDirectories(".",m_RemoveDirectories);
616 }
617 catch(IOException e)
618 {
619 m_Log.Write("Failed to remove directories named {0}",m_RemoveDirectories);
620 m_Log.WriteException(LogType.Error,e);
621 }
622 catch(UnauthorizedAccessException e)
623 {
624 m_Log.Write("Failed to remove directories named {0}",m_RemoveDirectories);
625 m_Log.WriteException(LogType.Error,e);
626 }
627 perfomedOtherTask = true;
628 }
629
630 if(m_Target != null && m_Clean != null)
631 {
632 m_Log.Write(LogType.Error, "The options /target and /clean cannot be passed together");
633 return;
634 }
635 else if(m_Target == null && m_Clean == null)
636 {
637 if(perfomedOtherTask) //finished
638 {
639 return;
640 }
641 m_Log.Write(LogType.Error, "Must pass either /target or /clean to process a Prebuild file");
642 return;
643 }
644
645 string file = "./prebuild.xml";
646 if(m_CommandLine.WasPassed("file"))
647 {
648 file = m_CommandLine["file"];
649 }
650
651 ProcessFile(file);
652
653 string target = (m_Target != null ? m_Target.ToLower() : m_Clean.ToLower());
654 bool clean = (m_Target == null);
655 if(clean && target != null && target.Length == 0)
656 {
657 target = "all";
658 }
659 if(clean && target == "all")//default to all if no target was specified for clean
660 {
661 //check if they passed yes
662 if (!m_CommandLine.WasPassed("yes"))
663 {
664 Console.WriteLine("WARNING: This operation will clean ALL project files for all targets, are you sure? (y/n):");
665 string ret = Console.ReadLine();
666 if(ret == null)
667 {
668 return;
669 }
670 ret = ret.Trim().ToLower();
671 if((ret.ToLower() != "y" && ret.ToLower() != "yes"))
672 {
673 return;
674 }
675 }
676 //clean all targets (just cleaning vs2002 target didn't clean nant)
677 foreach(ITarget targ in m_Targets.Values)
678 {
679 targ.Clean(this);
680 }
681 }
682 else
683 {
684 ITarget targ = (ITarget)m_Targets[target];
685
686 if(clean)
687 {
688 targ.Clean(this);
689 }
690 else
691 {
692 targ.Write(this);
693 }
694 }
695
696 m_Log.Flush();
697 }
698
699 #endregion
700
701 #region IDisposable Members
702
703 /// <summary>
704 ///
705 /// </summary>
706 public void Dispose()
707 {
708 Dispose(true);
709 GC.SuppressFinalize(this);
710 }
711
712 /// <summary>
713 /// Dispose objects
714 /// </summary>
715 /// <param name="disposing">
716 /// If true, it will dispose close the handle
717 /// </param>
718 /// <remarks>
719 /// Will dispose managed and unmanaged resources.
720 /// </remarks>
721 protected virtual void Dispose(bool disposing)
722 {
723 if (!this.disposed)
724 {
725 if (disposing)
726 {
727 if (this.m_Log != null)
728 {
729 this.m_Log.Close();
730 this.m_Log = null;
731 }
732 }
733 }
734 this.disposed = true;
735 }
736
737 /// <summary>
738 ///
739 /// </summary>
740 ~Kernel()
741 {
742 this.Dispose(false);
743 }
744
745 /// <summary>
746 /// Closes and destroys this object
747 /// </summary>
748 /// <remarks>
749 /// Same as Dispose(true)
750 /// </remarks>
751 public void Close()
752 {
753 Dispose();
754 }
755
756 #endregion
757 }
758} \ No newline at end of file
diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs
new file mode 100644
index 0000000..e1488a7
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs
@@ -0,0 +1,177 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36using System.Xml;
37
38using Prebuild.Core.Attributes;
39using Prebuild.Core.Interfaces;
40using Prebuild.Core.Utilities;
41
42namespace Prebuild.Core.Nodes
43{
44 /// <summary>
45 ///
46 /// </summary>
47 [DataNode("Configuration")]
48 public class ConfigurationNode : DataNode, ICloneable
49 {
50 #region Fields
51
52 private string m_Name = "unknown";
53 private OptionsNode m_Options;
54
55 #endregion
56
57 #region Constructors
58
59 /// <summary>
60 /// Initializes a new instance of the <see cref="ConfigurationNode"/> class.
61 /// </summary>
62 public ConfigurationNode()
63 {
64 m_Options = new OptionsNode();
65 }
66
67 #endregion
68
69 #region Properties
70
71 /// <summary>
72 /// Gets or sets the parent.
73 /// </summary>
74 /// <value>The parent.</value>
75 public override IDataNode Parent
76 {
77 get
78 {
79 return base.Parent;
80 }
81 set
82 {
83 base.Parent = value;
84 if(base.Parent is SolutionNode)
85 {
86 SolutionNode node = (SolutionNode)base.Parent;
87 if(node != null && node.Options != null)
88 {
89 node.Options.CopyTo(m_Options);
90 }
91 }
92 }
93 }
94
95 /// <summary>
96 /// Gets the name.
97 /// </summary>
98 /// <value>The name.</value>
99 public string Name
100 {
101 get
102 {
103 return m_Name;
104 }
105 }
106
107 /// <summary>
108 /// Gets or sets the options.
109 /// </summary>
110 /// <value>The options.</value>
111 public OptionsNode Options
112 {
113 get
114 {
115 return m_Options;
116 }
117 set
118 {
119 m_Options = value;
120 }
121 }
122
123 #endregion
124
125 #region Public Methods
126
127 /// <summary>
128 /// Parses the specified node.
129 /// </summary>
130 /// <param name="node">The node.</param>
131 public override void Parse(XmlNode node)
132 {
133 m_Name = Helper.AttributeValue(node, "name", m_Name);
134 if( node == null )
135 {
136 throw new ArgumentNullException("node");
137 }
138 foreach(XmlNode child in node.ChildNodes)
139 {
140 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
141 if(dataNode is OptionsNode)
142 {
143 ((OptionsNode)dataNode).CopyTo(m_Options);
144 }
145 }
146 }
147
148 /// <summary>
149 /// Copies to.
150 /// </summary>
151 /// <param name="conf">The conf.</param>
152 public void CopyTo(ConfigurationNode conf)
153 {
154 m_Options.CopyTo(conf.m_Options);
155 }
156
157 #endregion
158
159 #region ICloneable Members
160
161 /// <summary>
162 /// Creates a new object that is a copy of the current instance.
163 /// </summary>
164 /// <returns>
165 /// A new object that is a copy of this instance.
166 /// </returns>
167 public object Clone()
168 {
169 ConfigurationNode ret = new ConfigurationNode();
170 ret.m_Name = m_Name;
171 m_Options.CopyTo(ret.m_Options);
172 return ret;
173 }
174
175 #endregion
176 }
177}
diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs
new file mode 100644
index 0000000..ef5f7ee
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/DataNode.cs
@@ -0,0 +1,82 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36using System.Xml;
37
38using Prebuild.Core.Attributes;
39using Prebuild.Core.Interfaces;
40
41namespace Prebuild.Core.Nodes
42{
43 /// <summary>
44 ///
45 /// </summary>
46 public class DataNode : IDataNode
47 {
48 #region Fields
49
50 private IDataNode parent;
51
52 #endregion
53
54 #region IDataNode Members
55
56 /// <summary>
57 /// Gets or sets the parent.
58 /// </summary>
59 /// <value>The parent.</value>
60 public virtual IDataNode Parent
61 {
62 get
63 {
64 return parent;
65 }
66 set
67 {
68 parent = value;
69 }
70 }
71
72 /// <summary>
73 /// Parses the specified node.
74 /// </summary>
75 /// <param name="node">The node.</param>
76 public virtual void Parse(XmlNode node)
77 {
78 }
79
80 #endregion
81 }
82}
diff --git a/Prebuild/src/Core/Nodes/ExcludeNode.cs b/Prebuild/src/Core/Nodes/ExcludeNode.cs
new file mode 100644
index 0000000..bfcebca
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/ExcludeNode.cs
@@ -0,0 +1,85 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-31 16:35:39 +0100 (ti, 31 jan 2006) $
31 * $Revision: 74 $
32 */
33#endregion
34
35using System;
36using System.Xml;
37
38using Prebuild.Core.Attributes;
39using Prebuild.Core.Interfaces;
40using Prebuild.Core.Utilities;
41
42namespace Prebuild.Core.Nodes
43{
44 /// <summary>
45 ///
46 /// </summary>
47 [DataNode("Exclude")]
48 public class ExcludeNode : DataNode
49 {
50 #region Fields
51
52 private string m_Name = "unknown";
53
54 #endregion
55
56 #region Properties
57
58 /// <summary>
59 /// Gets the name.
60 /// </summary>
61 /// <value>The name.</value>
62 public string Name
63 {
64 get
65 {
66 return m_Name;
67 }
68 }
69
70 #endregion
71
72 #region Public Methods
73
74 /// <summary>
75 /// Parses the specified node.
76 /// </summary>
77 /// <param name="node">The node.</param>
78 public override void Parse(XmlNode node)
79 {
80 m_Name = Helper.AttributeValue(node, "name", m_Name);
81 }
82
83 #endregion
84 }
85}
diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs
new file mode 100644
index 0000000..de3b69e
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/FileNode.cs
@@ -0,0 +1,238 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2007-01-08 17:55:40 +0100 (må, 08 jan 2007) $
31 * $Revision: 197 $
32 */
33#endregion
34
35using System;
36using System.IO;
37using System.Xml;
38
39using Prebuild.Core.Attributes;
40using Prebuild.Core.Interfaces;
41using Prebuild.Core.Utilities;
42
43namespace Prebuild.Core.Nodes
44{
45 /// <summary>
46 ///
47 /// </summary>
48 public enum BuildAction
49 {
50 /// <summary>
51 ///
52 /// </summary>
53 None,
54 /// <summary>
55 ///
56 /// </summary>
57 Compile,
58 /// <summary>
59 ///
60 /// </summary>
61 Content,
62 /// <summary>
63 ///
64 /// </summary>
65 EmbeddedResource
66 }
67
68 /// <summary>
69 ///
70 /// </summary>
71 public enum SubType
72 {
73 /// <summary>
74 ///
75 /// </summary>
76 Code,
77 /// <summary>
78 ///
79 /// </summary>
80 Component,
81 /// <summary>
82 ///
83 /// </summary>
84 Designer,
85 /// <summary>
86 ///
87 /// </summary>
88 Form,
89 /// <summary>
90 ///
91 /// </summary>
92 Settings,
93 /// <summary>
94 ///
95 /// </summary>
96 UserControl
97 }
98
99 public enum CopyToOutput
100 {
101 Never,
102 Always,
103 PreserveNewest
104 }
105
106 /// <summary>
107 ///
108 /// </summary>
109 [DataNode("File")]
110 public class FileNode : DataNode
111 {
112 #region Fields
113
114 private string m_Path;
115 private string m_ResourceName = "";
116 private BuildAction m_BuildAction = BuildAction.Compile;
117 private bool m_Valid;
118 private SubType m_SubType = SubType.Code;
119 private CopyToOutput m_CopyToOutput = CopyToOutput.Never;
120 private bool m_Link = false;
121
122
123 #endregion
124
125 #region Properties
126
127 /// <summary>
128 ///
129 /// </summary>
130 public string Path
131 {
132 get
133 {
134 return m_Path;
135 }
136 }
137
138 /// <summary>
139 ///
140 /// </summary>
141 public string ResourceName
142 {
143 get
144 {
145 return m_ResourceName;
146 }
147 }
148
149 /// <summary>
150 ///
151 /// </summary>
152 public BuildAction BuildAction
153 {
154 get
155 {
156 return m_BuildAction;
157 }
158 }
159
160 public CopyToOutput CopyToOutput
161 {
162 get
163 {
164 return this.m_CopyToOutput;
165 }
166 }
167
168 public bool IsLink
169 {
170 get
171 {
172 return this.m_Link;
173 }
174 }
175
176 /// <summary>
177 ///
178 /// </summary>
179 public SubType SubType
180 {
181 get
182 {
183 return m_SubType;
184 }
185 }
186
187 /// <summary>
188 ///
189 /// </summary>
190 public bool IsValid
191 {
192 get
193 {
194 return m_Valid;
195 }
196 }
197
198 #endregion
199
200 #region Public Methods
201
202 /// <summary>
203 ///
204 /// </summary>
205 /// <param name="node"></param>
206 public override void Parse(XmlNode node)
207 {
208 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction),
209 Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString()));
210 m_SubType = (SubType)Enum.Parse(typeof(SubType),
211 Helper.AttributeValue(node, "subType", m_SubType.ToString()));
212 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
213 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
214 this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString()));
215
216 if( node == null )
217 {
218 throw new ArgumentNullException("node");
219 }
220
221 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
222 if(m_Path == null)
223 {
224 m_Path = "";
225 }
226
227 m_Path = m_Path.Trim();
228 m_Valid = true;
229 if(!File.Exists(m_Path))
230 {
231 m_Valid = false;
232 Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path);
233 }
234 }
235
236 #endregion
237 }
238}
diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs
new file mode 100644
index 0000000..442a45f
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/FilesNode.cs
@@ -0,0 +1,222 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-09-20 09:42:51 +0200 (on, 20 sep 2006) $
31 * $Revision: 164 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Collections.Specialized;
38using System.Xml;
39
40using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces;
42
43namespace Prebuild.Core.Nodes
44{
45 /// <summary>
46 ///
47 /// </summary>
48 [DataNode("Files")]
49 public class FilesNode : DataNode
50 {
51 #region Fields
52
53 private StringCollection m_Files;
54 private Hashtable m_BuildActions;
55 private Hashtable m_SubTypes;
56 private Hashtable m_ResourceNames;
57 private Hashtable m_CopyToOutputs;
58 private Hashtable m_Links;
59
60
61 #endregion
62
63 #region Constructors
64
65 /// <summary>
66 ///
67 /// </summary>
68 public FilesNode()
69 {
70 m_Files = new StringCollection();
71 m_BuildActions = new Hashtable();
72 m_SubTypes = new Hashtable();
73 m_ResourceNames = new Hashtable();
74 m_CopyToOutputs = new Hashtable();
75 m_Links = new Hashtable();
76 }
77
78 #endregion
79
80 #region Properties
81
82 /// <summary>
83 ///
84 /// </summary>
85 public int Count
86 {
87 get
88 {
89 return m_Files.Count;
90 }
91 }
92
93 #endregion
94
95 #region Public Methods
96
97 /// <summary>
98 ///
99 /// </summary>
100 /// <param name="file"></param>
101 /// <returns></returns>
102 public BuildAction GetBuildAction(string file)
103 {
104 if(!m_BuildActions.ContainsKey(file))
105 {
106 return BuildAction.Compile;
107 }
108
109 return (BuildAction)m_BuildActions[file];
110 }
111
112 public CopyToOutput GetCopyToOutput(string file)
113 {
114 if (!this.m_CopyToOutputs.ContainsKey(file))
115 {
116 return CopyToOutput.Never;
117 }
118 return (CopyToOutput) this.m_CopyToOutputs[file];
119 }
120
121 public bool GetIsLink(string file)
122 {
123 if (!this.m_Links.ContainsKey(file))
124 {
125 return false;
126 }
127 return (bool) this.m_Links[file];
128 }
129
130 /// <summary>
131 ///
132 /// </summary>
133 /// <param name="file"></param>
134 /// <returns></returns>
135 public SubType GetSubType(string file)
136 {
137 if(!m_SubTypes.ContainsKey(file))
138 {
139 return SubType.Code;
140 }
141
142 return (SubType)m_SubTypes[file];
143 }
144
145 /// <summary>
146 ///
147 /// </summary>
148 /// <param name="file"></param>
149 /// <returns></returns>
150 public string GetResourceName(string file)
151 {
152 if(!m_ResourceNames.ContainsKey(file))
153 {
154 return "";
155 }
156
157 return (string)m_ResourceNames[file];
158 }
159
160 /// <summary>
161 ///
162 /// </summary>
163 /// <param name="node"></param>
164 public override void Parse(XmlNode node)
165 {
166 if( node == null )
167 {
168 throw new ArgumentNullException("node");
169 }
170 foreach(XmlNode child in node.ChildNodes)
171 {
172 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
173 if(dataNode is FileNode)
174 {
175 FileNode fileNode = (FileNode)dataNode;
176 if(fileNode.IsValid)
177 {
178 if (!m_Files.Contains(fileNode.Path))
179 {
180 m_Files.Add(fileNode.Path);
181 m_BuildActions[fileNode.Path] = fileNode.BuildAction;
182 m_SubTypes[fileNode.Path] = fileNode.SubType;
183 m_ResourceNames[fileNode.Path] = fileNode.ResourceName;
184 this.m_Links[fileNode.Path] = fileNode.IsLink;
185 this.m_CopyToOutputs[fileNode.Path] = fileNode.CopyToOutput;
186
187 }
188 }
189 }
190 else if(dataNode is MatchNode)
191 {
192 foreach(string file in ((MatchNode)dataNode).Files)
193 {
194 if (!m_Files.Contains(file))
195 {
196 m_Files.Add(file);
197 m_BuildActions[file] = ((MatchNode)dataNode).BuildAction;
198 m_SubTypes[file] = ((MatchNode)dataNode).SubType;
199 m_ResourceNames[file] = ((MatchNode)dataNode).ResourceName;
200 this.m_Links[file] = ((MatchNode) dataNode).IsLink;
201 this.m_CopyToOutputs[file] = ((MatchNode) dataNode).CopyToOutput;
202
203 }
204 }
205 }
206 }
207 }
208
209 // TODO: Check in to why StringCollection's enumerator doesn't implement
210 // IEnumerator?
211 /// <summary>
212 ///
213 /// </summary>
214 /// <returns></returns>
215 public StringEnumerator GetEnumerator()
216 {
217 return m_Files.GetEnumerator();
218 }
219
220 #endregion
221 }
222}
diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs
new file mode 100644
index 0000000..e0d2fa8
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/MatchNode.cs
@@ -0,0 +1,299 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-09-20 09:42:51 +0200 (on, 20 sep 2006) $
31 * $Revision: 164 $
32 */
33#endregion
34
35using System;
36using System.Collections.Specialized;
37using System.IO;
38using System.Text.RegularExpressions;
39using System.Xml;
40
41using Prebuild.Core.Attributes;
42using Prebuild.Core.Interfaces;
43using Prebuild.Core.Utilities;
44
45namespace Prebuild.Core.Nodes
46{
47 /// <summary>
48 ///
49 /// </summary>
50 [DataNode("Match")]
51 public class MatchNode : DataNode
52 {
53 #region Fields
54
55 private StringCollection m_Files;
56 private Regex m_Regex;
57 private BuildAction m_BuildAction = BuildAction.Compile;
58 private SubType m_SubType = SubType.Code;
59 string m_ResourceName = "";
60 private CopyToOutput m_CopyToOutput;
61 private bool m_Link;
62
63
64 #endregion
65
66 #region Constructors
67
68 /// <summary>
69 ///
70 /// </summary>
71 public MatchNode()
72 {
73 m_Files = new StringCollection();
74 }
75
76 #endregion
77
78 #region Properties
79
80 /// <summary>
81 ///
82 /// </summary>
83 public StringCollection Files
84 {
85 get
86 {
87 return m_Files;
88 }
89 }
90
91 /// <summary>
92 ///
93 /// </summary>
94 public BuildAction BuildAction
95 {
96 get
97 {
98 return m_BuildAction;
99 }
100 }
101
102 /// <summary>
103 ///
104 /// </summary>
105 public SubType SubType
106 {
107 get
108 {
109 return m_SubType;
110 }
111 }
112
113 public CopyToOutput CopyToOutput
114 {
115 get
116 {
117 return this.m_CopyToOutput;
118 }
119 }
120
121 public bool IsLink
122 {
123 get
124 {
125 return this.m_Link;
126 }
127 }
128
129 /// <summary>
130 ///
131 /// </summary>
132 public string ResourceName
133 {
134 get
135 {
136 return m_ResourceName;
137 }
138 }
139
140
141 #endregion
142
143 #region Private Methods
144
145 /// <summary>
146 /// Recurses the directories.
147 /// </summary>
148 /// <param name="path">The path.</param>
149 /// <param name="pattern">The pattern.</param>
150 /// <param name="recurse">if set to <c>true</c> [recurse].</param>
151 /// <param name="useRegex">if set to <c>true</c> [use regex].</param>
152 private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex)
153 {
154 try
155 {
156 string[] files;
157
158 if(!useRegex)
159 {
160 files = Directory.GetFiles(path, pattern);
161 if(files != null)
162 {
163 string fileTemp;
164 foreach (string file in files)
165 {
166 if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\")
167 {
168 fileTemp = file.Substring(2);
169 }
170 else
171 {
172 fileTemp = file;
173 }
174
175 m_Files.Add(fileTemp);
176 }
177 }
178 else
179 {
180 return;
181 }
182 }
183 else
184 {
185 Match match;
186 files = Directory.GetFiles(path);
187 foreach(string file in files)
188 {
189 match = m_Regex.Match(file);
190 if(match.Success)
191 {
192 m_Files.Add(file);
193 }
194 }
195 }
196
197 if(recurse)
198 {
199 string[] dirs = Directory.GetDirectories(path);
200 if(dirs != null && dirs.Length > 0)
201 {
202 foreach(string str in dirs)
203 {
204 RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex);
205 }
206 }
207 }
208 }
209 catch(DirectoryNotFoundException)
210 {
211 return;
212 }
213 catch(ArgumentException)
214 {
215 return;
216 }
217 }
218
219 #endregion
220
221 #region Public Methods
222
223 /// <summary>
224 ///
225 /// </summary>
226 /// <param name="node"></param>
227 public override void Parse(XmlNode node)
228 {
229 if( node == null )
230 {
231 throw new ArgumentNullException("node");
232 }
233 string path = Helper.AttributeValue(node, "path", ".");
234 string pattern = Helper.AttributeValue(node, "pattern", "*");
235 bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false"));
236 bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false"));
237 m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction),
238 Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString()));
239 m_SubType = (SubType)Enum.Parse(typeof(SubType),
240 Helper.AttributeValue(node, "subType", m_SubType.ToString()));
241 m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
242 this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString()));
243 this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
244
245
246 if(path != null && path.Length == 0)
247 {
248 path = ".";//use current directory
249 }
250 //throw new WarningException("Match must have a 'path' attribute");
251
252 if(pattern == null)
253 {
254 throw new WarningException("Match must have a 'pattern' attribute");
255 }
256
257 path = Helper.NormalizePath(path);
258 if(!Directory.Exists(path))
259 {
260 throw new WarningException("Match path does not exist: {0}", path);
261 }
262
263 try
264 {
265 if(useRegex)
266 {
267 m_Regex = new Regex(pattern);
268 }
269 }
270 catch(ArgumentException ex)
271 {
272 throw new WarningException("Could not compile regex pattern: {0}", ex.Message);
273 }
274
275 RecurseDirectories(path, pattern, recurse, useRegex);
276
277 foreach(XmlNode child in node.ChildNodes)
278 {
279 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
280 if(dataNode is ExcludeNode)
281 {
282 ExcludeNode excludeNode = (ExcludeNode)dataNode;
283 if (m_Files.Contains(Helper.NormalizePath(excludeNode.Name)))
284 {
285 m_Files.Remove(Helper.NormalizePath(excludeNode.Name));
286 }
287 }
288 }
289
290 if(m_Files.Count < 1)
291 {
292 throw new WarningException("Match returned no files: {0}{1}", Helper.EndPath(path), pattern);
293 }
294 m_Regex = null;
295 }
296
297 #endregion
298 }
299}
diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs
new file mode 100644
index 0000000..b5a2f60
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/OptionsNode.cs
@@ -0,0 +1,655 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2007-01-08 17:55:40 +0100 (må, 08 jan 2007) $
31 * $Revision: 197 $
32 */
33#endregion
34
35
36
37using System;
38using System.Collections;
39using System.Collections.Specialized;
40using System.Reflection;
41using System.Xml;
42
43using Prebuild.Core.Attributes;
44using Prebuild.Core.Interfaces;
45using Prebuild.Core.Utilities;
46
47namespace Prebuild.Core.Nodes
48{
49 /// <summary>
50 ///
51 /// </summary>
52 [DataNode("Options")]
53 public class OptionsNode : DataNode
54 {
55 #region Fields
56
57 private static Hashtable m_OptionFields;
58
59 [OptionNode("CompilerDefines")]
60 private string m_CompilerDefines = "";
61
62 /// <summary>
63 ///
64 /// </summary>
65 public string CompilerDefines
66 {
67 get
68 {
69 return m_CompilerDefines;
70 }
71 set
72 {
73 m_CompilerDefines = value;
74 }
75 }
76
77 [OptionNode("OptimizeCode")]
78 private bool m_OptimizeCode;
79
80 /// <summary>
81 ///
82 /// </summary>
83 public bool OptimizeCode
84 {
85 get
86 {
87 return m_OptimizeCode;
88 }
89 set
90 {
91 m_OptimizeCode = value;
92 }
93 }
94
95 [OptionNode("CheckUnderflowOverflow")]
96 private bool m_CheckUnderflowOverflow;
97
98 /// <summary>
99 ///
100 /// </summary>
101 public bool CheckUnderflowOverflow
102 {
103 get
104 {
105 return m_CheckUnderflowOverflow;
106 }
107 set
108 {
109 m_CheckUnderflowOverflow = value;
110 }
111 }
112
113 [OptionNode("AllowUnsafe")]
114 private bool m_AllowUnsafe;
115
116 /// <summary>
117 ///
118 /// </summary>
119 public bool AllowUnsafe
120 {
121 get
122 {
123 return m_AllowUnsafe;
124 }
125 set
126 {
127 m_AllowUnsafe = value;
128 }
129 }
130
131 [OptionNode("PreBuildEvent")]
132 private string m_PreBuildEvent;
133
134 /// <summary>
135 ///
136 /// </summary>
137 public string PreBuildEvent
138 {
139 get
140 {
141 return m_PreBuildEvent;
142 }
143 set
144 {
145 m_PreBuildEvent = value;
146 }
147 }
148
149 [OptionNode("PostBuildEvent")]
150 private string m_PostBuildEvent;
151
152 /// <summary>
153 ///
154 /// </summary>
155 public string PostBuildEvent
156 {
157 get
158 {
159 return m_PostBuildEvent;
160 }
161 set
162 {
163 m_PostBuildEvent = value;
164 }
165 }
166
167 [OptionNode("PreBuildEventArgs")]
168 private string m_PreBuildEventArgs;
169
170 /// <summary>
171 ///
172 /// </summary>
173 public string PreBuildEventArgs
174 {
175 get
176 {
177 return m_PreBuildEventArgs;
178 }
179 set
180 {
181 m_PreBuildEventArgs = value;
182 }
183 }
184
185 [OptionNode("PostBuildEventArgs")]
186 private string m_PostBuildEventArgs;
187
188 /// <summary>
189 ///
190 /// </summary>
191 public string PostBuildEventArgs
192 {
193 get
194 {
195 return m_PostBuildEventArgs;
196 }
197 set
198 {
199 m_PostBuildEventArgs = value;
200 }
201 }
202
203 [OptionNode("RunPostBuildEvent")]
204 private string m_RunPostBuildEvent;
205
206 /// <summary>
207 ///
208 /// </summary>
209 public string RunPostBuildEvent
210 {
211 get
212 {
213 return m_RunPostBuildEvent;
214 }
215 set
216 {
217 m_RunPostBuildEvent = value;
218 }
219 }
220
221 [OptionNode("RunScript")]
222 private string m_RunScript;
223
224 /// <summary>
225 ///
226 /// </summary>
227 public string RunScript
228 {
229 get
230 {
231 return m_RunScript;
232 }
233 set
234 {
235 m_RunScript = value;
236 }
237 }
238
239 [OptionNode("WarningLevel")]
240 private int m_WarningLevel = 4;
241
242 /// <summary>
243 ///
244 /// </summary>
245 public int WarningLevel
246 {
247 get
248 {
249 return m_WarningLevel;
250 }
251 set
252 {
253 m_WarningLevel = value;
254 }
255 }
256
257 [OptionNode("WarningsAsErrors")]
258 private bool m_WarningsAsErrors;
259
260 /// <summary>
261 ///
262 /// </summary>
263 public bool WarningsAsErrors
264 {
265 get
266 {
267 return m_WarningsAsErrors;
268 }
269 set
270 {
271 m_WarningsAsErrors = value;
272 }
273 }
274
275 [OptionNode("SuppressWarnings")]
276 private string m_SuppressWarnings = "";
277
278 /// <summary>
279 ///
280 /// </summary>
281 public string SuppressWarnings
282 {
283 get
284 {
285 return m_SuppressWarnings;
286 }
287 set
288 {
289 m_SuppressWarnings = value;
290 }
291 }
292
293 [OptionNode("OutputPath")]
294 private string m_OutputPath = "bin/";
295
296 /// <summary>
297 ///
298 /// </summary>
299 public string OutputPath
300 {
301 get
302 {
303 return m_OutputPath;
304 }
305 set
306 {
307 m_OutputPath = value;
308 }
309 }
310
311 [OptionNode("GenerateDocumentation")]
312 private bool m_GenerateDocumentation;
313
314 /// <summary>
315 ///
316 /// </summary>
317 public bool GenerateDocumentation
318 {
319 get
320 {
321 return m_GenerateDocumentation;
322 }
323 set
324 {
325 m_GenerateDocumentation = value;
326 }
327 }
328
329 [OptionNode("GenerateXmlDocFile")]
330 private bool m_GenerateXmlDocFile;
331
332 /// <summary>
333 ///
334 /// </summary>
335 public bool GenerateXmlDocFile
336 {
337 get
338 {
339 return m_GenerateXmlDocFile;
340 }
341 set
342 {
343 m_GenerateXmlDocFile = value;
344 }
345 }
346
347 [OptionNode("XmlDocFile")]
348 private string m_XmlDocFile = "";
349
350 /// <summary>
351 ///
352 /// </summary>
353 public string XmlDocFile
354 {
355 get
356 {
357 return m_XmlDocFile;
358 }
359 set
360 {
361 m_XmlDocFile = value;
362 }
363 }
364
365 [OptionNode("KeyFile")]
366 private string m_KeyFile = "";
367
368 /// <summary>
369 ///
370 /// </summary>
371 public string KeyFile
372 {
373 get
374 {
375 return m_KeyFile;
376 }
377 set
378 {
379 m_KeyFile = value;
380 }
381 }
382
383 [OptionNode("DebugInformation")]
384 private bool m_DebugInformation;
385
386 /// <summary>
387 ///
388 /// </summary>
389 public bool DebugInformation
390 {
391 get
392 {
393 return m_DebugInformation;
394 }
395 set
396 {
397 m_DebugInformation = value;
398 }
399 }
400
401 [OptionNode("RegisterComInterop")]
402 private bool m_RegisterComInterop;
403
404 /// <summary>
405 ///
406 /// </summary>
407 public bool RegisterComInterop
408 {
409 get
410 {
411 return m_RegisterComInterop;
412 }
413 set
414 {
415 m_RegisterComInterop = value;
416 }
417 }
418
419 [OptionNode("RemoveIntegerChecks")]
420 private bool m_RemoveIntegerChecks;
421
422 /// <summary>
423 ///
424 /// </summary>
425 public bool RemoveIntegerChecks
426 {
427 get
428 {
429 return m_RemoveIntegerChecks;
430 }
431 set
432 {
433 m_RemoveIntegerChecks = value;
434 }
435 }
436
437 [OptionNode("IncrementalBuild")]
438 private bool m_IncrementalBuild;
439
440 /// <summary>
441 ///
442 /// </summary>
443 public bool IncrementalBuild
444 {
445 get
446 {
447 return m_IncrementalBuild;
448 }
449 set
450 {
451 m_IncrementalBuild = value;
452 }
453 }
454
455 [OptionNode("BaseAddress")]
456 private string m_BaseAddress = "285212672";
457
458 /// <summary>
459 ///
460 /// </summary>
461 public string BaseAddress
462 {
463 get
464 {
465 return m_BaseAddress;
466 }
467 set
468 {
469 m_BaseAddress = value;
470 }
471 }
472
473 [OptionNode("FileAlignment")]
474 private int m_FileAlignment = 4096;
475
476 /// <summary>
477 ///
478 /// </summary>
479 public int FileAlignment
480 {
481 get
482 {
483 return m_FileAlignment;
484 }
485 set
486 {
487 m_FileAlignment = value;
488 }
489 }
490
491 [OptionNode("NoStdLib")]
492 private bool m_NoStdLib;
493
494 /// <summary>
495 ///
496 /// </summary>
497 public bool NoStdLib
498 {
499 get
500 {
501 return m_NoStdLib;
502 }
503 set
504 {
505 m_NoStdLib = value;
506 }
507 }
508
509 private StringCollection m_FieldsDefined;
510
511 #endregion
512
513 #region Constructors
514
515 /// <summary>
516 /// Initializes the <see cref="OptionsNode"/> class.
517 /// </summary>
518 static OptionsNode()
519 {
520 Type t = typeof(OptionsNode);
521
522 m_OptionFields = new Hashtable();
523 foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance))
524 {
525 object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false);
526 if(attrs == null || attrs.Length < 1)
527 {
528 continue;
529 }
530
531 OptionNodeAttribute ona = (OptionNodeAttribute)attrs[0];
532 m_OptionFields[ona.NodeName] = f;
533 }
534 }
535
536 /// <summary>
537 /// Initializes a new instance of the <see cref="OptionsNode"/> class.
538 /// </summary>
539 public OptionsNode()
540 {
541 m_FieldsDefined = new StringCollection();
542 }
543
544 #endregion
545
546 #region Properties
547
548 /// <summary>
549 /// Gets the <see cref="Object"/> at the specified index.
550 /// </summary>
551 /// <value></value>
552 public object this[string index]
553 {
554 get
555 {
556 if(!m_OptionFields.ContainsKey(index))
557 {
558 return null;
559 }
560
561 FieldInfo f = (FieldInfo)m_OptionFields[index];
562 return f.GetValue(this);
563 }
564 }
565
566 /// <summary>
567 /// Gets the <see cref="Object"/> at the specified index.
568 /// </summary>
569 /// <value></value>
570 public object this[string index, object defaultValue]
571 {
572 get
573 {
574 object valueObject = this[index];
575 if(valueObject != null && valueObject is string && ((string)valueObject).Length == 0)
576 {
577 return defaultValue;
578 }
579 return valueObject;
580 }
581 }
582
583
584 #endregion
585
586 #region Private Methods
587
588 private void FlagDefined(string name)
589 {
590 if(!m_FieldsDefined.Contains(name))
591 {
592 m_FieldsDefined.Add(name);
593 }
594 }
595
596 private void SetOption(string nodeName, string val)
597 {
598 lock(m_OptionFields)
599 {
600 if(!m_OptionFields.ContainsKey(nodeName))
601 {
602 return;
603 }
604
605 FieldInfo f = (FieldInfo)m_OptionFields[nodeName];
606 f.SetValue(this, Helper.TranslateValue(f.FieldType, val));
607 FlagDefined(f.Name);
608 }
609 }
610
611 #endregion
612
613 #region Public Methods
614
615 /// <summary>
616 /// Parses the specified node.
617 /// </summary>
618 /// <param name="node">The node.</param>
619 public override void Parse(XmlNode node)
620 {
621 if( node == null )
622 {
623 throw new ArgumentNullException("node");
624 }
625
626 foreach(XmlNode child in node.ChildNodes)
627 {
628 SetOption(child.Name, Helper.InterpolateForEnvironmentVariables(child.InnerText));
629 }
630 }
631
632 /// <summary>
633 /// Copies to.
634 /// </summary>
635 /// <param name="opt">The opt.</param>
636 public void CopyTo(OptionsNode opt)
637 {
638 if(opt == null)
639 {
640 return;
641 }
642
643 foreach(FieldInfo f in m_OptionFields.Values)
644 {
645 if(m_FieldsDefined.Contains(f.Name))
646 {
647 f.SetValue(opt, f.GetValue(this));
648 opt.m_FieldsDefined.Add(f.Name);
649 }
650 }
651 }
652
653 #endregion
654 }
655}
diff --git a/Prebuild/src/Core/Nodes/ProcessNode.cs b/Prebuild/src/Core/Nodes/ProcessNode.cs
new file mode 100644
index 0000000..f546a4b
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/ProcessNode.cs
@@ -0,0 +1,119 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Collections.Specialized;
38using System.Xml;
39
40using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces;
42using Prebuild.Core.Utilities;
43
44namespace Prebuild.Core.Nodes
45{
46 /// <summary>
47 ///
48 /// </summary>
49 [DataNode("Process")]
50 public class ProcessNode : DataNode
51 {
52 #region Fields
53
54 private string m_Path;
55 private bool m_IsValid = true;
56
57 #endregion
58
59 #region Properties
60
61 /// <summary>
62 /// Gets the path.
63 /// </summary>
64 /// <value>The path.</value>
65 public string Path
66 {
67 get
68 {
69 return m_Path;
70 }
71 }
72
73 /// <summary>
74 /// Gets a value indicating whether this instance is valid.
75 /// </summary>
76 /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value>
77 public bool IsValid
78 {
79 get
80 {
81 return m_IsValid;
82 }
83 }
84
85 #endregion
86
87 #region Public Methods
88
89 /// <summary>
90 /// Parses the specified node.
91 /// </summary>
92 /// <param name="node">The node.</param>
93 public override void Parse(XmlNode node)
94 {
95 if( node == null )
96 {
97 throw new ArgumentNullException("node");
98 }
99
100 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
101 if(m_Path == null)
102 {
103 m_Path = "";
104 }
105
106 try
107 {
108 m_Path = Helper.ResolvePath(m_Path);
109 }
110 catch(ArgumentException)
111 {
112 Kernel.Instance.Log.Write(LogType.Warning, "Could not find prebuild file for processing: {0}", m_Path);
113 m_IsValid = false;
114 }
115 }
116
117 #endregion
118 }
119}
diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs
new file mode 100644
index 0000000..84d9f5d
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/ProjectNode.cs
@@ -0,0 +1,494 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-11-11 05:43:20 +0100 (lö, 11 nov 2006) $
31 * $Revision: 192 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.IO;
38using System.Xml;
39
40using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces;
42using Prebuild.Core.Utilities;
43
44namespace Prebuild.Core.Nodes
45{
46 /// <summary>
47 ///
48 /// </summary>
49 public enum ProjectType
50 {
51 /// <summary>
52 ///
53 /// </summary>
54 Exe,
55 /// <summary>
56 ///
57 /// </summary>
58 WinExe,
59 /// <summary>
60 ///
61 /// </summary>
62 Library
63 }
64
65 /// <summary>
66 ///
67 /// </summary>
68 public enum ClrRuntime
69 {
70 /// <summary>
71 ///
72 /// </summary>
73 Microsoft,
74 /// <summary>
75 ///
76 /// </summary>
77 Mono
78 }
79
80 /// <summary>
81 ///
82 /// </summary>
83 [DataNode("Project")]
84 public class ProjectNode : DataNode
85 {
86 #region Fields
87
88 private string m_Name = "unknown";
89 private string m_Path = "";
90 private string m_FullPath = "";
91 private string m_AssemblyName;
92 private string m_AppIcon = "";
93 private string m_DesignerFolder = "";
94 private string m_Language = "C#";
95 private ProjectType m_Type = ProjectType.Exe;
96 private ClrRuntime m_Runtime = ClrRuntime.Microsoft;
97 private string m_StartupObject = "";
98 private string m_RootNamespace;
99 private string m_FilterGroups = "";
100 private Guid m_Guid;
101
102 private Hashtable m_Configurations;
103 private ArrayList m_ReferencePaths;
104 private ArrayList m_References;
105 private FilesNode m_Files;
106
107 #endregion
108
109 #region Constructors
110
111 /// <summary>
112 /// Initializes a new instance of the <see cref="ProjectNode"/> class.
113 /// </summary>
114 public ProjectNode()
115 {
116 m_Configurations = new Hashtable();
117 m_ReferencePaths = new ArrayList();
118 m_References = new ArrayList();
119 }
120
121 #endregion
122
123 #region Properties
124
125 /// <summary>
126 /// Gets the name.
127 /// </summary>
128 /// <value>The name.</value>
129 public string Name
130 {
131 get
132 {
133 return m_Name;
134 }
135 }
136
137 /// <summary>
138 /// Gets the path.
139 /// </summary>
140 /// <value>The path.</value>
141 public string Path
142 {
143 get
144 {
145 return m_Path;
146 }
147 }
148
149 /// <summary>
150 /// Gets the filter groups.
151 /// </summary>
152 /// <value>The filter groups.</value>
153 public string FilterGroups
154 {
155 get
156 {
157 return m_FilterGroups;
158 }
159 }
160
161 /// <summary>
162 /// Gets the full path.
163 /// </summary>
164 /// <value>The full path.</value>
165 public string FullPath
166 {
167 get
168 {
169 return m_FullPath;
170 }
171 }
172
173 /// <summary>
174 /// Gets the name of the assembly.
175 /// </summary>
176 /// <value>The name of the assembly.</value>
177 public string AssemblyName
178 {
179 get
180 {
181 return m_AssemblyName;
182 }
183 }
184
185 /// <summary>
186 /// Gets the app icon.
187 /// </summary>
188 /// <value>The app icon.</value>
189 public string AppIcon
190 {
191 get
192 {
193 return m_AppIcon;
194 }
195 }
196
197 /// <summary>
198 ///
199 /// </summary>
200 public string DesignerFolder
201 {
202 get
203 {
204 return m_DesignerFolder;
205 }
206 }
207
208 /// <summary>
209 /// Gets the language.
210 /// </summary>
211 /// <value>The language.</value>
212 public string Language
213 {
214 get
215 {
216 return m_Language;
217 }
218 }
219
220 /// <summary>
221 /// Gets the type.
222 /// </summary>
223 /// <value>The type.</value>
224 public ProjectType Type
225 {
226 get
227 {
228 return m_Type;
229 }
230 }
231
232 /// <summary>
233 /// Gets the runtime.
234 /// </summary>
235 /// <value>The runtime.</value>
236 public ClrRuntime Runtime
237 {
238 get
239 {
240 return m_Runtime;
241 }
242 }
243
244 private bool m_GenerateAssemblyInfoFile = false;
245
246 /// <summary>
247 ///
248 /// </summary>
249 public bool GenerateAssemblyInfoFile
250 {
251 get
252 {
253 return m_GenerateAssemblyInfoFile;
254 }
255 set
256 {
257 m_GenerateAssemblyInfoFile = value;
258 }
259 }
260
261 /// <summary>
262 /// Gets the startup object.
263 /// </summary>
264 /// <value>The startup object.</value>
265 public string StartupObject
266 {
267 get
268 {
269 return m_StartupObject;
270 }
271 }
272
273 /// <summary>
274 /// Gets the root namespace.
275 /// </summary>
276 /// <value>The root namespace.</value>
277 public string RootNamespace
278 {
279 get
280 {
281 return m_RootNamespace;
282 }
283 }
284
285 /// <summary>
286 /// Gets the configurations.
287 /// </summary>
288 /// <value>The configurations.</value>
289 public ICollection Configurations
290 {
291 get
292 {
293 return m_Configurations.Values;
294 }
295 }
296
297 /// <summary>
298 /// Gets the configurations table.
299 /// </summary>
300 /// <value>The configurations table.</value>
301 public Hashtable ConfigurationsTable
302 {
303 get
304 {
305 return m_Configurations;
306 }
307 }
308
309 /// <summary>
310 /// Gets the reference paths.
311 /// </summary>
312 /// <value>The reference paths.</value>
313 public ArrayList ReferencePaths
314 {
315 get
316 {
317 return m_ReferencePaths;
318 }
319 }
320
321 /// <summary>
322 /// Gets the references.
323 /// </summary>
324 /// <value>The references.</value>
325 public ArrayList References
326 {
327 get
328 {
329 return m_References;
330 }
331 }
332
333 /// <summary>
334 /// Gets the files.
335 /// </summary>
336 /// <value>The files.</value>
337 public FilesNode Files
338 {
339 get
340 {
341 return m_Files;
342 }
343 }
344
345 /// <summary>
346 /// Gets or sets the parent.
347 /// </summary>
348 /// <value>The parent.</value>
349 public override IDataNode Parent
350 {
351 get
352 {
353 return base.Parent;
354 }
355 set
356 {
357 base.Parent = value;
358 if(base.Parent is SolutionNode && m_Configurations.Count < 1)
359 {
360 SolutionNode parent = (SolutionNode)base.Parent;
361 foreach(ConfigurationNode conf in parent.Configurations)
362 {
363 m_Configurations[conf.Name] = conf.Clone();
364 }
365 }
366 }
367 }
368
369 /// <summary>
370 /// Gets the GUID.
371 /// </summary>
372 /// <value>The GUID.</value>
373 public Guid Guid
374 {
375 get
376 {
377 return m_Guid;
378 }
379 }
380
381 #endregion
382
383 #region Private Methods
384
385 private void HandleConfiguration(ConfigurationNode conf)
386 {
387 if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first,
388 //so it *may* override changes to the same properties for configurations defines at the project level
389 {
390 foreach(ConfigurationNode confNode in this.m_Configurations.Values)
391 {
392 conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides
393 }
394 }
395 if(m_Configurations.ContainsKey(conf.Name))
396 {
397 ConfigurationNode parentConf = (ConfigurationNode)m_Configurations[conf.Name];
398 conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides
399 }
400 else
401 {
402 m_Configurations[conf.Name] = conf;
403 }
404 }
405
406 #endregion
407
408 #region Public Methods
409
410 /// <summary>
411 /// Parses the specified node.
412 /// </summary>
413 /// <param name="node">The node.</param>
414 public override void Parse(XmlNode node)
415 {
416 m_Name = Helper.AttributeValue(node, "name", m_Name);
417 m_Path = Helper.AttributeValue(node, "path", m_Path);
418 m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups);
419 m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon);
420 m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder);
421 m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName);
422 m_Language = Helper.AttributeValue(node, "language", m_Language);
423 m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type);
424 m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime);
425 m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject);
426 m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace);
427
428 int hash = m_Name.GetHashCode();
429
430 m_Guid = new Guid( hash, 0, 0, 0, 0, 0, 0,0,0,0,0 );
431
432 m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false);
433
434 if(m_AssemblyName == null || m_AssemblyName.Length < 1)
435 {
436 m_AssemblyName = m_Name;
437 }
438
439 if(m_RootNamespace == null || m_RootNamespace.Length < 1)
440 {
441 m_RootNamespace = m_Name;
442 }
443
444 m_FullPath = m_Path;
445 try
446 {
447 m_FullPath = Helper.ResolvePath(m_FullPath);
448 }
449 catch
450 {
451 throw new WarningException("Could not resolve Solution path: {0}", m_Path);
452 }
453
454 Kernel.Instance.CurrentWorkingDirectory.Push();
455 try
456 {
457 Helper.SetCurrentDir(m_FullPath);
458
459 if( node == null )
460 {
461 throw new ArgumentNullException("node");
462 }
463
464 foreach(XmlNode child in node.ChildNodes)
465 {
466 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
467 if(dataNode is ConfigurationNode)
468 {
469 HandleConfiguration((ConfigurationNode)dataNode);
470 }
471 else if(dataNode is ReferencePathNode)
472 {
473 m_ReferencePaths.Add(dataNode);
474 }
475 else if(dataNode is ReferenceNode)
476 {
477 m_References.Add(dataNode);
478 }
479 else if(dataNode is FilesNode)
480 {
481 m_Files = (FilesNode)dataNode;
482 }
483 }
484 }
485 finally
486 {
487 Kernel.Instance.CurrentWorkingDirectory.Pop();
488 }
489 }
490
491
492 #endregion
493 }
494}
diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs
new file mode 100644
index 0000000..beb50dc
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/ReferenceNode.cs
@@ -0,0 +1,143 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-07-25 18:56:49 +0200 (ti, 25 jul 2006) $
31 * $Revision: 132 $
32 */
33#endregion
34
35using System;
36using System.Xml;
37
38using Prebuild.Core.Attributes;
39using Prebuild.Core.Interfaces;
40using Prebuild.Core.Utilities;
41
42namespace Prebuild.Core.Nodes
43{
44 /// <summary>
45 ///
46 /// </summary>
47 [DataNode("Reference")]
48 public class ReferenceNode : DataNode
49 {
50 #region Fields
51
52 private string m_Name = "unknown";
53 private string m_Path;
54 private string m_LocalCopy;
55 private string m_Version;
56
57 #endregion
58
59 #region Properties
60
61 /// <summary>
62 /// Gets the name.
63 /// </summary>
64 /// <value>The name.</value>
65 public string Name
66 {
67 get
68 {
69 return m_Name;
70 }
71 }
72
73 /// <summary>
74 /// Gets the path.
75 /// </summary>
76 /// <value>The path.</value>
77 public string Path
78 {
79 get
80 {
81 return m_Path;
82 }
83 }
84
85 /// <summary>
86 /// Gets a value indicating whether [local copy specified].
87 /// </summary>
88 /// <value><c>true</c> if [local copy specified]; otherwise, <c>false</c>.</value>
89 public bool LocalCopySpecified
90 {
91 get
92 {
93 return ( m_LocalCopy != null && m_LocalCopy.Length == 0);
94 }
95 }
96
97 /// <summary>
98 /// Gets a value indicating whether [local copy].
99 /// </summary>
100 /// <value><c>true</c> if [local copy]; otherwise, <c>false</c>.</value>
101 public bool LocalCopy
102 {
103 get
104 {
105 if( m_LocalCopy == null)
106 {
107 return false;
108 }
109 return bool.Parse(m_LocalCopy);
110 }
111 }
112
113 /// <summary>
114 /// Gets the version.
115 /// </summary>
116 /// <value>The version.</value>
117 public string Version
118 {
119 get
120 {
121 return m_Version;
122 }
123 }
124
125 #endregion
126
127 #region Public Methods
128
129 /// <summary>
130 /// Parses the specified node.
131 /// </summary>
132 /// <param name="node">The node.</param>
133 public override void Parse(XmlNode node)
134 {
135 m_Name = Helper.AttributeValue(node, "name", m_Name);
136 m_Path = Helper.AttributeValue(node, "path", m_Path);
137 m_LocalCopy = Helper.AttributeValue(node, "localCopy", m_LocalCopy);
138 m_Version = Helper.AttributeValue(node, "version", m_Version);
139 }
140
141 #endregion
142 }
143}
diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs
new file mode 100644
index 0000000..5d98dda
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/ReferencePathNode.cs
@@ -0,0 +1,98 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Collections.Specialized;
38using System.Xml;
39
40using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces;
42using Prebuild.Core.Utilities;
43
44namespace Prebuild.Core.Nodes
45{
46 /// <summary>
47 ///
48 /// </summary>
49 [DataNode("ReferencePath")]
50 public class ReferencePathNode : DataNode
51 {
52 #region Fields
53
54 private string m_Path;
55
56 #endregion
57
58 #region Properties
59
60 /// <summary>
61 /// Gets the path.
62 /// </summary>
63 /// <value>The path.</value>
64 public string Path
65 {
66 get
67 {
68 return m_Path;
69 }
70 }
71
72 #endregion
73
74 #region Public Methods
75
76 /// <summary>
77 /// Parses the specified node.
78 /// </summary>
79 /// <param name="node">The node.</param>
80 public override void Parse(XmlNode node)
81 {
82 if( node == null )
83 {
84 throw new ArgumentNullException("node");
85 }
86
87 m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
88 if(m_Path == null)
89 {
90 m_Path = "";
91 }
92
93 m_Path = m_Path.Trim();
94 }
95
96 #endregion
97 }
98}
diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs
new file mode 100644
index 0000000..0121075
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/SolutionNode.cs
@@ -0,0 +1,284 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-02-28 17:15:42 +0100 (ti, 28 feb 2006) $
31 * $Revision: 92 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Diagnostics;
38using System.IO;
39using System.Xml;
40
41using Prebuild.Core.Attributes;
42using Prebuild.Core.Interfaces;
43using Prebuild.Core.Utilities;
44
45namespace Prebuild.Core.Nodes
46{
47 /// <summary>
48 ///
49 /// </summary>
50 [DataNode("Solution")]
51 public class SolutionNode : DataNode
52 {
53 #region Fields
54
55 private string m_Name = "unknown";
56 private string m_Path = "";
57 private string m_FullPath = "";
58 private string m_ActiveConfig = "Debug";
59
60 private OptionsNode m_Options;
61 private FilesNode m_Files;
62 private Hashtable m_Configurations;
63 private Hashtable m_Projects;
64 private ArrayList m_ProjectsOrder;
65
66 #endregion
67
68 #region Constructors
69
70 /// <summary>
71 /// Initializes a new instance of the <see cref="SolutionNode"/> class.
72 /// </summary>
73 public SolutionNode()
74 {
75 m_Configurations = new Hashtable();
76 m_Projects = new Hashtable();
77 m_ProjectsOrder = new ArrayList();
78 }
79
80 #endregion
81
82 #region Properties
83
84 /// <summary>
85 /// Gets or sets the active config.
86 /// </summary>
87 /// <value>The active config.</value>
88 public string ActiveConfig
89 {
90 get
91 {
92 return m_ActiveConfig;
93 }
94 set
95 {
96 m_ActiveConfig = value;
97 }
98 }
99
100 /// <summary>
101 /// Gets the name.
102 /// </summary>
103 /// <value>The name.</value>
104 public string Name
105 {
106 get
107 {
108 return m_Name;
109 }
110 }
111
112 /// <summary>
113 /// Gets the path.
114 /// </summary>
115 /// <value>The path.</value>
116 public string Path
117 {
118 get
119 {
120 return m_Path;
121 }
122 }
123
124 /// <summary>
125 /// Gets the full path.
126 /// </summary>
127 /// <value>The full path.</value>
128 public string FullPath
129 {
130 get
131 {
132 return m_FullPath;
133 }
134 }
135
136 /// <summary>
137 /// Gets the options.
138 /// </summary>
139 /// <value>The options.</value>
140 public OptionsNode Options
141 {
142 get
143 {
144 return m_Options;
145 }
146 }
147
148 /// <summary>
149 /// Gets the files.
150 /// </summary>
151 /// <value>The files.</value>
152 public FilesNode Files
153 {
154 get
155 {
156 return m_Files;
157 }
158 }
159
160 /// <summary>
161 /// Gets the configurations.
162 /// </summary>
163 /// <value>The configurations.</value>
164 public ICollection Configurations
165 {
166 get
167 {
168 return m_Configurations.Values;
169 }
170 }
171
172 /// <summary>
173 /// Gets the configurations table.
174 /// </summary>
175 /// <value>The configurations table.</value>
176 public Hashtable ConfigurationsTable
177 {
178 get
179 {
180 return m_Configurations;
181 }
182 }
183
184 /// <summary>
185 /// Gets the projects.
186 /// </summary>
187 /// <value>The projects.</value>
188 public ICollection Projects
189 {
190 get
191 {
192 return m_Projects.Values;
193 }
194 }
195
196 /// <summary>
197 /// Gets the projects table.
198 /// </summary>
199 /// <value>The projects table.</value>
200 public Hashtable ProjectsTable
201 {
202 get
203 {
204 return m_Projects;
205 }
206 }
207
208 /// <summary>
209 /// Gets the projects table.
210 /// </summary>
211 /// <value>The projects table.</value>
212 public ArrayList ProjectsTableOrder
213 {
214 get
215 {
216 return m_ProjectsOrder;
217 }
218 }
219
220 #endregion
221
222 #region Public Methods
223
224 /// <summary>
225 /// Parses the specified node.
226 /// </summary>
227 /// <param name="node">The node.</param>
228 public override void Parse(XmlNode node)
229 {
230 m_Name = Helper.AttributeValue(node, "name", m_Name);
231 m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig);
232 m_Path = Helper.AttributeValue(node, "path", m_Path);
233
234 m_FullPath = m_Path;
235 try
236 {
237 m_FullPath = Helper.ResolvePath(m_FullPath);
238 }
239 catch
240 {
241 throw new WarningException("Could not resolve solution path: {0}", m_Path);
242 }
243
244 Kernel.Instance.CurrentWorkingDirectory.Push();
245 try
246 {
247 Helper.SetCurrentDir(m_FullPath);
248
249 if( node == null )
250 {
251 throw new ArgumentNullException("node");
252 }
253
254 foreach(XmlNode child in node.ChildNodes)
255 {
256 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
257 if(dataNode is OptionsNode)
258 {
259 m_Options = (OptionsNode)dataNode;
260 }
261 else if(dataNode is FilesNode)
262 {
263 m_Files = (FilesNode)dataNode;
264 }
265 else if(dataNode is ConfigurationNode)
266 {
267 m_Configurations[((ConfigurationNode)dataNode).Name] = dataNode;
268 }
269 else if(dataNode is ProjectNode)
270 {
271 m_Projects[((ProjectNode)dataNode).Name] = dataNode;
272 m_ProjectsOrder.Add(dataNode);
273 }
274 }
275 }
276 finally
277 {
278 Kernel.Instance.CurrentWorkingDirectory.Pop();
279 }
280 }
281
282 #endregion
283 }
284}
diff --git a/Prebuild/src/Core/Parse/IfContext.cs b/Prebuild/src/Core/Parse/IfContext.cs
new file mode 100644
index 0000000..383049d
--- /dev/null
+++ b/Prebuild/src/Core/Parse/IfContext.cs
@@ -0,0 +1,163 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36
37namespace Prebuild.Core.Parse
38{
39 /// <summary>
40 ///
41 /// </summary>
42 public enum IfState
43 {
44 /// <summary>
45 ///
46 /// </summary>
47 None,
48 /// <summary>
49 ///
50 /// </summary>
51 If,
52 /// <summary>
53 ///
54 /// </summary>
55 ElseIf,
56 /// <summary>
57 ///
58 /// </summary>
59 Else
60 }
61
62 /// <summary>
63 /// Summary description for IfContext.
64 /// </summary>
65 // Inspired by the equivalent WiX class (see www.sourceforge.net/projects/wix/)
66 public class IfContext
67 {
68 #region Properties
69
70 bool m_Active;
71 bool m_Keep;
72 bool m_EverKept;
73 IfState m_State = IfState.None;
74
75 #endregion
76
77 #region Constructors
78
79 /// <summary>
80 /// Initializes a new instance of the <see cref="IfContext"/> class.
81 /// </summary>
82 /// <param name="active">if set to <c>true</c> [active].</param>
83 /// <param name="keep">if set to <c>true</c> [keep].</param>
84 /// <param name="state">The state.</param>
85 public IfContext(bool active, bool keep, IfState state)
86 {
87 m_Active = active;
88 m_Keep = keep;
89 m_EverKept = keep;
90 m_State = state;
91 }
92
93 #endregion
94
95 #region Properties
96
97 /// <summary>
98 /// Gets or sets a value indicating whether this <see cref="IfContext"/> is active.
99 /// </summary>
100 /// <value><c>true</c> if active; otherwise, <c>false</c>.</value>
101 public bool Active
102 {
103 get
104 {
105 return m_Active;
106 }
107 set
108 {
109 m_Active = value;
110 }
111 }
112
113 /// <summary>
114 /// Gets or sets a value indicating whether this <see cref="IfContext"/> is keep.
115 /// </summary>
116 /// <value><c>true</c> if keep; otherwise, <c>false</c>.</value>
117 public bool Keep
118 {
119 get
120 {
121 return m_Keep;
122 }
123 set
124 {
125 m_Keep = value;
126 if(m_Keep)
127 {
128 m_EverKept = true;
129 }
130 }
131 }
132
133 /// <summary>
134 /// Gets a value indicating whether [ever kept].
135 /// </summary>
136 /// <value><c>true</c> if [ever kept]; otherwise, <c>false</c>.</value>
137 public bool EverKept
138 {
139 get
140 {
141 return m_EverKept;
142 }
143 }
144
145 /// <summary>
146 /// Gets or sets the state.
147 /// </summary>
148 /// <value>The state.</value>
149 public IfState State
150 {
151 get
152 {
153 return m_State;
154 }
155 set
156 {
157 m_State = value;
158 }
159 }
160
161 #endregion
162 }
163}
diff --git a/Prebuild/src/Core/Parse/Preprocessor.cs b/Prebuild/src/Core/Parse/Preprocessor.cs
new file mode 100644
index 0000000..85e92c3
--- /dev/null
+++ b/Prebuild/src/Core/Parse/Preprocessor.cs
@@ -0,0 +1,519 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-09-01 19:55:06 +0200 (fr, 01 sep 2006) $
31 * $Revision: 147 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.IO;
38using System.Xml;
39
40namespace Prebuild.Core.Parse
41{
42 /// <summary>
43 ///
44 /// </summary>
45 public enum OperatorSymbol
46 {
47 /// <summary>
48 ///
49 /// </summary>
50 None,
51 /// <summary>
52 ///
53 /// </summary>
54 Equal,
55 /// <summary>
56 ///
57 /// </summary>
58 NotEqual,
59 /// <summary>
60 ///
61 /// </summary>
62 LessThan,
63 /// <summary>
64 ///
65 /// </summary>
66 GreaterThan,
67 /// <summary>
68 ///
69 /// </summary>
70 LessThanEqual,
71 /// <summary>
72 ///
73 /// </summary>
74 GreaterThanEqual
75 }
76
77 /// <summary>
78 ///
79 /// </summary>
80 public class Preprocessor
81 {
82 #region Fields
83
84 XmlDocument m_OutDoc;
85 Stack m_IfStack;
86 Hashtable m_Variables;
87
88 #endregion
89
90 #region Constructors
91
92 /// <summary>
93 /// Initializes a new instance of the <see cref="Preprocessor"/> class.
94 /// </summary>
95 public Preprocessor()
96 {
97 m_OutDoc = new XmlDocument();
98 m_IfStack = new Stack();
99 m_Variables = new Hashtable();
100
101 RegisterVariable("OS", GetOS());
102 RegisterVariable("RuntimeVersion", Environment.Version.Major);
103 RegisterVariable("RuntimeMajor", Environment.Version.Major);
104 RegisterVariable("RuntimeMinor", Environment.Version.Minor);
105 RegisterVariable("RuntimeRevision", Environment.Version.Revision);
106 }
107
108 #endregion
109
110 #region Properties
111
112 /// <summary>
113 /// Gets the processed doc.
114 /// </summary>
115 /// <value>The processed doc.</value>
116 public XmlDocument ProcessedDoc
117 {
118 get
119 {
120 return m_OutDoc;
121 }
122 }
123
124 #endregion
125
126 #region Private Methods
127
128 /// <summary>
129 /// Parts of this code were taken from NAnt and is subject to the GPL
130 /// as per NAnt's license. Thanks to the NAnt guys for this little gem.
131 /// </summary>
132 /// <returns></returns>
133 public static string GetOS()
134 {
135 PlatformID platId = Environment.OSVersion.Platform;
136 if(platId == PlatformID.Win32NT || platId == PlatformID.Win32Windows)
137 {
138 return "Win32";
139 }
140
141 /*
142 * .NET 1.x, under Mono, the UNIX code is 128. Under
143 * .NET 2.x, Mono or MS, the UNIX code is 4
144 */
145 if(Environment.Version.Major == 1)
146 {
147 if((int)platId == 128)
148 {
149 return "UNIX";
150 }
151 }
152 else if((int)platId == 4)
153 {
154 return "UNIX";
155 }
156
157 return "Unknown";
158 }
159
160 private static bool CompareNum(OperatorSymbol oper, int val1, int val2)
161 {
162 switch(oper)
163 {
164 case OperatorSymbol.Equal:
165 return (val1 == val2);
166 case OperatorSymbol.NotEqual:
167 return (val1 != val2);
168 case OperatorSymbol.LessThan:
169 return (val1 < val2);
170 case OperatorSymbol.LessThanEqual:
171 return (val1 <= val2);
172 case OperatorSymbol.GreaterThan:
173 return (val1 > val2);
174 case OperatorSymbol.GreaterThanEqual:
175 return (val1 >= val2);
176 }
177
178 throw new WarningException("Unknown operator type");
179 }
180
181 private static bool CompareStr(OperatorSymbol oper, string val1, string val2)
182 {
183 switch(oper)
184 {
185 case OperatorSymbol.Equal:
186 return (val1 == val2);
187 case OperatorSymbol.NotEqual:
188 return (val1 != val2);
189 case OperatorSymbol.LessThan:
190 return (val1.CompareTo(val2) < 0);
191 case OperatorSymbol.LessThanEqual:
192 return (val1.CompareTo(val2) <= 0);
193 case OperatorSymbol.GreaterThan:
194 return (val1.CompareTo(val2) > 0);
195 case OperatorSymbol.GreaterThanEqual:
196 return (val1.CompareTo(val2) >= 0);
197 }
198
199 throw new WarningException("Unknown operator type");
200 }
201
202 private static char NextChar(int idx, string str)
203 {
204 if((idx + 1) >= str.Length)
205 {
206 return Char.MaxValue;
207 }
208
209 return str[idx + 1];
210 }
211 // Very very simple expression parser. Can only match expressions of the form
212 // <var> <op> <value>:
213 // OS = Windows
214 // OS != Linux
215 // RuntimeMinor > 0
216 private bool ParseExpression(string exp)
217 {
218 if(exp == null)
219 {
220 throw new ArgumentException("Invalid expression, cannot be null");
221 }
222
223 exp = exp.Trim();
224 if(exp.Length < 1)
225 {
226 throw new ArgumentException("Invalid expression, cannot be 0 length");
227 }
228
229 string id = "";
230 string str = "";
231 OperatorSymbol oper = OperatorSymbol.None;
232 bool inStr = false;
233 char c;
234
235 for(int i = 0; i < exp.Length; i++)
236 {
237 c = exp[i];
238 if(Char.IsWhiteSpace(c))
239 {
240 continue;
241 }
242
243 if(Char.IsLetterOrDigit(c) || c == '_')
244 {
245 if(inStr)
246 {
247 str += c;
248 }
249 else
250 {
251 id += c;
252 }
253 }
254 else if(c == '\"')
255 {
256 inStr = !inStr;
257 if(inStr)
258 {
259 str = "";
260 }
261 }
262 else
263 {
264 if(inStr)
265 {
266 str += c;
267 }
268 else
269 {
270 switch(c)
271 {
272 case '=':
273 oper = OperatorSymbol.Equal;
274 break;
275
276 case '!':
277 if(NextChar(i, exp) == '=')
278 {
279 oper = OperatorSymbol.NotEqual;
280 }
281
282 break;
283
284 case '<':
285 if(NextChar(i, exp) == '=')
286 {
287 oper = OperatorSymbol.LessThanEqual;
288 }
289 else
290 {
291 oper = OperatorSymbol.LessThan;
292 }
293
294 break;
295
296 case '>':
297 if(NextChar(i, exp) == '=')
298 {
299 oper = OperatorSymbol.GreaterThanEqual;
300 }
301 else
302 {
303 oper = OperatorSymbol.GreaterThan;
304 }
305
306 break;
307 }
308 }
309 }
310 }
311
312
313 if(inStr)
314 {
315 throw new WarningException("Expected end of string in expression");
316 }
317
318 if(oper == OperatorSymbol.None)
319 {
320 throw new WarningException("Expected operator in expression");
321 }
322 else if(id.Length < 1)
323 {
324 throw new WarningException("Expected identifier in expression");
325 }
326 else if(str.Length < 1)
327 {
328 throw new WarningException("Expected value in expression");
329 }
330
331 bool ret = false;
332 try
333 {
334 object val = m_Variables[id.ToLower()];
335 if(val == null)
336 {
337 throw new WarningException("Unknown identifier '{0}'", id);
338 }
339
340 int numVal, numVal2;
341 string strVal, strVal2;
342 Type t = val.GetType();
343 if(t.IsAssignableFrom(typeof(int)))
344 {
345 numVal = (int)val;
346 numVal2 = Int32.Parse(str);
347 ret = CompareNum(oper, numVal, numVal2);
348 }
349 else
350 {
351 strVal = val.ToString();
352 strVal2 = str;
353 ret = CompareStr(oper, strVal, strVal2);
354 }
355 }
356 catch(ArgumentException ex)
357 {
358 ex.ToString();
359 throw new WarningException("Invalid value type for system variable '{0}', expected int", id);
360 }
361
362 return ret;
363 }
364
365 #endregion
366
367 #region Public Methods
368
369 /// <summary>
370 ///
371 /// </summary>
372 /// <param name="name"></param>
373 /// <param name="variableValue"></param>
374 public void RegisterVariable(string name, object variableValue)
375 {
376 if(name == null || variableValue == null)
377 {
378 return;
379 }
380
381 m_Variables[name.ToLower()] = variableValue;
382 }
383
384 /// <summary>
385 /// Performs validation on the xml source as well as evaluates conditional and flow expresions
386 /// </summary>
387 /// <exception cref="ArgumentException">For invalid use of conditional expressions or for invalid XML syntax. If a XmlValidatingReader is passed, then will also throw exceptions for non-schema-conforming xml</exception>
388 /// <param name="reader"></param>
389 /// <returns>the output xml </returns>
390 public string Process(XmlReader reader)
391 {
392 if(reader == null)
393 {
394 throw new ArgumentException("Invalid XML reader to pre-process");
395 }
396
397 IfContext context = new IfContext(true, true, IfState.None);
398 StringWriter xmlText = new StringWriter();
399 XmlTextWriter writer = new XmlTextWriter(xmlText);
400 writer.Formatting = Formatting.Indented;
401 while(reader.Read())
402 {
403 if(reader.NodeType == XmlNodeType.ProcessingInstruction)
404 {
405 bool ignore = false;
406 switch(reader.LocalName)
407 {
408 case "if":
409 m_IfStack.Push(context);
410 context = new IfContext(context.Keep & context.Active, ParseExpression(reader.Value), IfState.If);
411 ignore = true;
412 break;
413
414 case "elseif":
415 if(m_IfStack.Count == 0)
416 {
417 throw new WarningException("Unexpected 'elseif' outside of 'if'");
418 }
419 else if(context.State != IfState.If && context.State != IfState.ElseIf)
420 {
421 throw new WarningException("Unexpected 'elseif' outside of 'if'");
422 }
423
424 context.State = IfState.ElseIf;
425 if(!context.EverKept)
426 {
427 context.Keep = ParseExpression(reader.Value);
428 }
429 else
430 {
431 context.Keep = false;
432 }
433
434 ignore = true;
435 break;
436
437 case "else":
438 if(m_IfStack.Count == 0)
439 {
440 throw new WarningException("Unexpected 'else' outside of 'if'");
441 }
442 else if(context.State != IfState.If && context.State != IfState.ElseIf)
443 {
444 throw new WarningException("Unexpected 'else' outside of 'if'");
445 }
446
447 context.State = IfState.Else;
448 context.Keep = !context.EverKept;
449 ignore = true;
450 break;
451
452 case "endif":
453 if(m_IfStack.Count == 0)
454 {
455 throw new WarningException("Unexpected 'endif' outside of 'if'");
456 }
457
458 context = (IfContext)m_IfStack.Pop();
459 ignore = true;
460 break;
461 }
462
463 if(ignore)
464 {
465 continue;
466 }
467 }//end pre-proc instruction
468
469 if(!context.Active || !context.Keep)
470 {
471 continue;
472 }
473
474 switch(reader.NodeType)
475 {
476 case XmlNodeType.Element:
477 bool empty = reader.IsEmptyElement;
478 writer.WriteStartElement(reader.Name);
479
480 while (reader.MoveToNextAttribute())
481 {
482 writer.WriteAttributeString(reader.Name, reader.Value);
483 }
484
485 if(empty)
486 {
487 writer.WriteEndElement();
488 }
489
490 break;
491
492 case XmlNodeType.EndElement:
493 writer.WriteEndElement();
494 break;
495
496 case XmlNodeType.Text:
497 writer.WriteString(reader.Value);
498 break;
499
500 case XmlNodeType.CDATA:
501 writer.WriteCData(reader.Value);
502 break;
503
504 default:
505 break;
506 }
507 }
508
509 if(m_IfStack.Count != 0)
510 {
511 throw new WarningException("Mismatched 'if', 'endif' pair");
512 }
513
514 return xmlText.ToString();
515 }
516
517 #endregion
518 }
519}
diff --git a/Prebuild/src/Core/Targets/AutotoolsTarget.cs b/Prebuild/src/Core/Targets/AutotoolsTarget.cs
new file mode 100644
index 0000000..2b4a678
--- /dev/null
+++ b/Prebuild/src/Core/Targets/AutotoolsTarget.cs
@@ -0,0 +1,926 @@
1#region BSD License
2/*
3
4Copyright (c) 2004 - 2006
5Matthew Holmes (matthew@wildfiregames.com),
6Dan Moorehead (dan05a@gmail.com),
7Dave Hudson (jendave@yahoo.com),
8C.J. Adams-Collier (cjcollier@colliertech.org),
9
10Redistribution and use in source and binary forms, with or without
11modification, are permitted provided that the following conditions are
12met:
13
14* Redistributions of source code must retain the above copyright
15notice, this list of conditions and the following disclaimer.
16
17* Redistributions in binary form must reproduce the above copyright
18notice, this list of conditions and the following disclaimer in the
19documentation and/or other materials provided with the distribution.
20
21* The name of the author may not be used to endorse or promote
22products derived from this software without specific prior written
23permission.
24
25THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
29INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
34IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35POSSIBILITY OF SUCH DAMAGE.
36
37*/
38#endregion
39
40#region CVS Information
41/*
42 * $Source$
43 * $Author: jendave $
44 * $Date: 2006-07-28 22:43:24 -0700 (Fri, 28 Jul 2006) $
45 * $Revision: 136 $
46 */
47#endregion
48
49using System;
50using System.Collections;
51using System.Collections.Specialized;
52using System.IO;
53using System.Reflection;
54using System.Text;
55using System.Text.RegularExpressions;
56
57using Prebuild.Core.Attributes;
58using Prebuild.Core.Interfaces;
59using Prebuild.Core.Nodes;
60using Prebuild.Core.Parse;
61using Prebuild.Core.Utilities;
62
63namespace Prebuild.Core.Targets
64{
65 /// <summary>
66 ///
67 /// </summary>
68 [Target("autotools")]
69 public class AutotoolsTarget : ITarget
70 {
71 #region Fields
72
73 private Kernel m_Kernel;
74
75 #endregion
76
77 #region Private Methods
78
79 private static string PrependPath(string path)
80 {
81 string tmpPath = Helper.NormalizePath(path, '/');
82 Regex regex = new Regex(@"(\w):/(\w+)");
83 Match match = regex.Match(tmpPath);
84 if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/')
85 {
86 tmpPath = Helper.NormalizePath(tmpPath);
87 }
88 else
89 {
90 tmpPath = Helper.NormalizePath("./" + tmpPath);
91 }
92
93 return tmpPath;
94 }
95
96 private static string BuildReference(SolutionNode solution, ReferenceNode refr)
97 {
98 string ret = "";
99 if(solution.ProjectsTable.ContainsKey(refr.Name))
100 {
101 ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name];
102 string fileRef = FindFileReference(refr.Name, project);
103 string finalPath = Helper.NormalizePath(Helper.MakeFilePath(project.FullPath + "/$(BUILD_DIR)/$(CONFIG)/", refr.Name, "dll"), '/');
104 ret += finalPath;
105 return ret;
106 }
107 else
108 {
109 ProjectNode project = (ProjectNode)refr.Parent;
110 string fileRef = FindFileReference(refr.Name, project);
111
112 if(refr.Path != null || fileRef != null)
113 {
114 string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path + "/" + refr.Name + ".dll", '/') : fileRef;
115 ret += Path.Combine(project.Path, finalPath);
116 return ret;
117 }
118
119 try
120 {
121 //Assembly assem = Assembly.Load(refr.Name);
122 //if (assem != null)
123 //{
124 // int index = refr.Name.IndexOf(",");
125 // if ( index > 0)
126 // {
127 // ret += assem.Location;
128 // //Console.WriteLine("Location1: " + assem.Location);
129 // }
130 // else
131 // {
132 // ret += (refr.Name + ".dll");
133 // //Console.WriteLine("Location2: " + assem.Location);
134 // }
135 //}
136 //else
137 //{
138 int index = refr.Name.IndexOf(",");
139 if ( index > 0)
140 {
141 ret += refr.Name.Substring(0, index) + ".dll";
142 //Console.WriteLine("Location3: " + assem.Location);
143 }
144 else
145 {
146 ret += (refr.Name + ".dll");
147 //Console.WriteLine("Location4: " + assem.Location);
148 }
149 //}
150 }
151 catch (System.NullReferenceException e)
152 {
153 e.ToString();
154 int index = refr.Name.IndexOf(",");
155 if ( index > 0)
156 {
157 ret += refr.Name.Substring(0, index) + ".dll";
158 //Console.WriteLine("Location5: " + assem.Location);
159 }
160 else
161 {
162 ret += (refr.Name + ".dll");
163 //Console.WriteLine("Location6: " + assem.Location);
164 }
165 }
166 }
167 return ret;
168 }
169
170 private static string BuildReferencePath(SolutionNode solution, ReferenceNode refr)
171 {
172 string ret = "";
173 if(solution.ProjectsTable.ContainsKey(refr.Name))
174 {
175 ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name];
176 string finalPath = Helper.NormalizePath(Helper.MakeReferencePath(project.FullPath + "/${build.dir}/"), '/');
177 ret += finalPath;
178 return ret;
179 }
180 else
181 {
182 ProjectNode project = (ProjectNode)refr.Parent;
183 string fileRef = FindFileReference(refr.Name, project);
184
185
186 if(refr.Path != null || fileRef != null)
187 {
188 string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path, '/') : fileRef;
189 ret += finalPath;
190 return ret;
191 }
192
193 try
194 {
195 Assembly assem = Assembly.Load(refr.Name);
196 if (assem != null)
197 {
198 ret += "";
199 }
200 else
201 {
202 ret += "";
203 }
204 }
205 catch (System.NullReferenceException e)
206 {
207 e.ToString();
208 ret += "";
209 }
210 }
211 return ret;
212 }
213
214 private static string FindFileReference(string refName, ProjectNode project)
215 {
216 foreach(ReferencePathNode refPath in project.ReferencePaths)
217 {
218 string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll");
219
220 if(File.Exists(fullPath))
221 {
222 return fullPath;
223 }
224 }
225
226 return null;
227 }
228
229 /// <summary>
230 /// Gets the XML doc file.
231 /// </summary>
232 /// <param name="project">The project.</param>
233 /// <param name="conf">The conf.</param>
234 /// <returns></returns>
235 public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf)
236 {
237 if( conf == null )
238 {
239 throw new ArgumentNullException("conf");
240 }
241 if( project == null )
242 {
243 throw new ArgumentNullException("project");
244 }
245 string docFile = (string)conf.Options["XmlDocFile"];
246 // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified
247 // {
248 // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml";
249 // }
250 return docFile;
251 }
252
253 /// <summary>
254 /// Normalizes the path.
255 /// </summary>
256 /// <param name="path">The path.</param>
257 /// <returns></returns>
258 public static string NormalizePath(string path)
259 {
260 if(path == null)
261 {
262 return "";
263 }
264
265 StringBuilder tmpPath;
266
267 if (Core.Parse.Preprocessor.GetOS() == "Win32")
268 {
269 tmpPath = new StringBuilder(path.Replace('\\', '/'));
270 tmpPath.Replace("/", @"\\");
271 }
272 else
273 {
274 tmpPath = new StringBuilder(path.Replace('\\', '/'));
275 tmpPath = tmpPath.Replace('/', Path.DirectorySeparatorChar);
276 }
277 return tmpPath.ToString();
278 }
279
280 private void WriteProject(SolutionNode solution, ProjectNode project)
281 {
282 string projFile = Helper.MakeFilePath(project.FullPath, "Include", "am");
283 StreamWriter ss = new StreamWriter(projFile);
284 ss.NewLine = "\n";
285
286 m_Kernel.CurrentWorkingDirectory.Push();
287 Helper.SetCurrentDir(Path.GetDirectoryName(projFile));
288
289 using(ss)
290 {
291 ss.WriteLine(Helper.AssemblyFullName(project.AssemblyName, project.Type) + ":");
292 ss.WriteLine("\tmkdir -p " + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/");
293 foreach(string file in project.Files)
294 {
295 if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings)
296 {
297 ss.Write("\tresgen ");
298 ss.Write(Helper.NormalizePath(Path.Combine(project.Path, file.Substring(0, file.LastIndexOf('.')) + ".resx "), '/'));
299 if (project.Files.GetResourceName(file) != "")
300 {
301 ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources"), '/'));
302 }
303 else
304 {
305 ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources"), '/'));
306 }
307 }
308 }
309 ss.WriteLine("\t$(CSC)\t/out:" + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/" + Helper.AssemblyFullName(project.AssemblyName, project.Type) + " \\");
310 ss.WriteLine("\t\t/target:" + project.Type.ToString().ToLower() + " \\");
311 if (project.References.Count > 0)
312 {
313 ss.Write("\t\t/reference:");
314 bool firstref = true;
315 foreach(ReferenceNode refr in project.References)
316 {
317 if (firstref)
318 {
319 firstref = false;
320 }
321 else
322 {
323 ss.Write(",");
324 }
325 ss.Write("{0}", Helper.NormalizePath(Helper.MakePathRelativeTo(solution.FullPath, BuildReference(solution, refr)), '/'));
326 }
327 ss.WriteLine(" \\");
328 }
329 //ss.WriteLine("\t\tProperties/AssemblyInfo.cs \\");
330
331 foreach(string file in project.Files)
332 {
333 switch(project.Files.GetBuildAction(file))
334 {
335 case BuildAction.EmbeddedResource:
336 ss.Write("\t\t/resource:");
337 ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, file), '/') + " \\");
338 break;
339 default:
340 if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings)
341 {
342 ss.Write("\t\t/resource:");
343 if (project.Files.GetResourceName(file) != "")
344 {
345 ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources"), '/') + "," + project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources" + " \\");
346 }
347 else
348 {
349 ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources"), '/') + "," + project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources" + " \\");
350 }
351 }
352 break;
353 }
354 }
355
356 foreach(ConfigurationNode conf in project.Configurations)
357 {
358 if (conf.Options.KeyFile !="")
359 {
360 ss.WriteLine("\t\t/keyfile:" + Helper.NormalizePath(Path.Combine(project.Path, conf.Options.KeyFile), '/') + " \\");
361 break;
362 }
363 }
364 foreach(ConfigurationNode conf in project.Configurations)
365 {
366 if (conf.Options.AllowUnsafe)
367 {
368 ss.WriteLine("\t\t/unsafe \\");
369 break;
370 }
371 }
372 if (project.AppIcon != "")
373 {
374 ss.WriteLine("\t\t/win32icon:" + Helper.NormalizePath(Path.Combine(project.Path, project.AppIcon), '/') + " \\");
375 }
376
377 foreach(ConfigurationNode conf in project.Configurations)
378 {
379 ss.WriteLine("\t\t/define:{0}", conf.Options.CompilerDefines.Replace(';', ',') + " \\");
380 break;
381 }
382
383 foreach(ConfigurationNode conf in project.Configurations)
384 {
385 if (GetXmlDocFile(project, conf) !="")
386 {
387 ss.WriteLine("\t\t/doc:" + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/" + project.Name + ".xml \\");
388 break;
389 }
390 }
391 foreach(string file in project.Files)
392 {
393 switch(project.Files.GetBuildAction(file))
394 {
395 case BuildAction.Compile:
396 ss.WriteLine("\t\t\\");
397 ss.Write("\t\t" + NormalizePath(Path.Combine(Helper.MakePathRelativeTo(solution.FullPath, project.Path), file)));
398 break;
399 default:
400 break;
401 }
402 }
403 ss.WriteLine();
404 ss.WriteLine();
405
406 if (project.Type == ProjectType.Library)
407 {
408 ss.WriteLine("install-data-local:");
409 ss.WriteLine(" echo \"$(GACUTIL) /i bin/Release/" + project.Name + ".dll /f $(GACUTIL_FLAGS)\"; \\");
410 ss.WriteLine(" $(GACUTIL) /i bin/Release/" + project.Name + ".dll /f $(GACUTIL_FLAGS) || exit 1;");
411 ss.WriteLine();
412 ss.WriteLine("uninstall-local:");
413 ss.WriteLine(" echo \"$(GACUTIL) /u " + project.Name + " $(GACUTIL_FLAGS)\"; \\");
414 ss.WriteLine(" $(GACUTIL) /u " + project.Name + " $(GACUTIL_FLAGS) || exit 1;");
415 ss.WriteLine();
416 }
417 ss.WriteLine("CLEANFILES = $(BUILD_DIR)/$(CONFIG)/" + Helper.AssemblyFullName(project.AssemblyName, project.Type) + " $(BUILD_DIR)/$(CONFIG)/" + project.AssemblyName + ".mdb $(BUILD_DIR)/$(CONFIG)/" + project.AssemblyName + ".pdb " + project.AssemblyName + ".xml");
418 ss.WriteLine("EXTRA_DIST = \\");
419 ss.Write(" $(FILES)");
420 foreach(ConfigurationNode conf in project.Configurations)
421 {
422 if (conf.Options.KeyFile != "")
423 {
424 ss.Write(" \\");
425 ss.WriteLine("\t" + conf.Options.KeyFile);
426 }
427 break;
428 }
429 }
430 m_Kernel.CurrentWorkingDirectory.Pop();
431 }
432 bool hasLibrary = false;
433
434 private void WriteCombine(SolutionNode solution)
435 {
436
437 /* TODO: These vars should be pulled from the prebuild.xml file */
438 string releaseVersion = "2.0.0";
439 string assemblyVersion = "2.1.0.0";
440 string description =
441 "Tao Framework " + solution.Name + " Binding For .NET";
442
443 hasLibrary = false;
444 m_Kernel.Log.Write("Creating Autotools make files");
445 foreach(ProjectNode project in solution.Projects)
446 {
447 if(m_Kernel.AllowProject(project.FilterGroups))
448 {
449 m_Kernel.Log.Write("...Creating makefile: {0}", project.Name);
450 WriteProject(solution, project);
451 }
452 }
453
454 m_Kernel.Log.Write("");
455 string combFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "am");
456 StreamWriter ss = new StreamWriter(combFile);
457 ss.NewLine = "\n";
458
459 m_Kernel.CurrentWorkingDirectory.Push();
460 Helper.SetCurrentDir(Path.GetDirectoryName(combFile));
461
462 using(ss)
463 {
464 foreach(ProjectNode project in solution.ProjectsTableOrder)
465 {
466 if (project.Type == ProjectType.Library)
467 {
468 hasLibrary = true;
469 break;
470 }
471 }
472
473 if (hasLibrary)
474 {
475 ss.Write("pkgconfig_in_files = ");
476 foreach(ProjectNode project in solution.ProjectsTableOrder)
477 {
478 if (project.Type == ProjectType.Library)
479 {
480 string combFilepc = Helper.MakeFilePath(solution.FullPath, project.Name, "pc.in");
481 ss.Write(" " + project.Name + ".pc.in ");
482 StreamWriter sspc = new StreamWriter(combFilepc);
483 sspc.NewLine = "\n";
484 using(sspc)
485 {
486 sspc.WriteLine("prefix=@prefix@");
487 sspc.WriteLine("exec_prefix=${prefix}");
488 sspc.WriteLine("libdir=${exec_prefix}/lib");
489 sspc.WriteLine();
490 sspc.WriteLine("Name: @PACKAGE_NAME@");
491 sspc.WriteLine("Description: @DESCRIPTION@");
492 sspc.WriteLine("Version: @ASSEMBLY_VERSION@");
493 sspc.WriteLine("Libs: -r:${libdir}/mono/gac/@PACKAGE_NAME@/@ASSEMBLY_VERSION@__@PUBKEY@/@PACKAGE_NAME@.dll");
494 }
495 }
496 }
497
498 ss.WriteLine();
499 ss.WriteLine("pkgconfigdir=$(prefix)/lib/pkgconfig");
500 ss.WriteLine("pkgconfig_DATA=$(pkgconfig_in_files:.pc.in=.pc)");
501 }
502 ss.WriteLine();
503 foreach(ProjectNode project in solution.ProjectsTableOrder)
504 {
505 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
506 ss.WriteLine("-include x {0}",
507 Helper.NormalizePath(Helper.MakeFilePath(path, "Include", "am"),'/'));
508 }
509 ss.WriteLine();
510 ss.WriteLine("all: \\");
511 ss.Write("\t");
512 foreach(ProjectNode project in solution.ProjectsTableOrder)
513 {
514 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
515 ss.Write(Helper.AssemblyFullName(project.AssemblyName, project.Type) + " ");
516
517 }
518 ss.WriteLine();
519 if (hasLibrary)
520 {
521 ss.WriteLine("EXTRA_DIST = \\");
522 ss.WriteLine("\t$(pkgconfig_in_files)");
523 }
524 else
525 {
526 ss.WriteLine("EXTRA_DIST = ");
527 }
528 ss.WriteLine();
529 ss.WriteLine("DISTCLEANFILES = \\");
530 ss.WriteLine("\tconfigure \\");
531 ss.WriteLine("\tMakefile.in \\");
532 ss.WriteLine("\taclocal.m4");
533 }
534 combFile = Helper.MakeFilePath(solution.FullPath, "configure", "ac");
535 StreamWriter ts = new StreamWriter(combFile);
536 ts.NewLine = "\n";
537 using(ts)
538 {
539 if (this.hasLibrary)
540 {
541 foreach(ProjectNode project in solution.ProjectsTableOrder)
542 {
543 if (project.Type == ProjectType.Library)
544 {
545 ts.WriteLine("AC_INIT(" + project.Name + ".pc.in)");
546 break;
547 }
548 }
549 }
550 else
551 {
552 ts.WriteLine("AC_INIT(Makefile.am)");
553 }
554 ts.WriteLine("AC_PREREQ(2.53)");
555 ts.WriteLine("AC_CANONICAL_SYSTEM");
556
557 ts.WriteLine("PACKAGE_NAME={0}", solution.Name);
558 ts.WriteLine("PACKAGE_VERSION={0}", releaseVersion);
559 ts.WriteLine("DESCRIPTION=\"{0}\"", description);
560 ts.WriteLine("AC_SUBST(DESCRIPTION)");
561 ts.WriteLine("AM_INIT_AUTOMAKE([$PACKAGE_NAME],[$PACKAGE_VERSION],[$DESCRIPTION])");
562
563 ts.WriteLine("ASSEMBLY_VERSION={0}", assemblyVersion);
564 ts.WriteLine("AC_SUBST(ASSEMBLY_VERSION)");
565
566 ts.WriteLine("PUBKEY=`sn -t $PACKAGE_NAME.snk | grep 'Public Key Token' | awk -F: '{print $2}' | sed -e 's/^ //'`");
567 ts.WriteLine("AC_SUBST(PUBKEY)");
568
569 ts.WriteLine();
570 ts.WriteLine("AM_MAINTAINER_MODE");
571 ts.WriteLine();
572 ts.WriteLine("dnl AC_PROG_INTLTOOL([0.25])");
573 ts.WriteLine();
574 ts.WriteLine("AC_PROG_INSTALL");
575 ts.WriteLine();
576 ts.WriteLine("MONO_REQUIRED_VERSION=1.1");
577 ts.WriteLine();
578 ts.WriteLine("AC_MSG_CHECKING([whether we're compiling from CVS])");
579 ts.WriteLine("if test -f \"$srcdir/.cvs_version\" ; then");
580 ts.WriteLine(" from_cvs=yes");
581 ts.WriteLine("else");
582 ts.WriteLine(" if test -f \"$srcdir/.svn\" ; then");
583 ts.WriteLine(" from_cvs=yes");
584 ts.WriteLine(" else");
585 ts.WriteLine(" from_cvs=no");
586 ts.WriteLine(" fi");
587 ts.WriteLine("fi");
588 ts.WriteLine();
589 ts.WriteLine("AC_MSG_RESULT($from_cvs)");
590 ts.WriteLine();
591 ts.WriteLine("AC_PATH_PROG(MONO, mono)");
592 ts.WriteLine("AC_PATH_PROG(GMCS, gmcs)");
593 ts.WriteLine("AC_PATH_PROG(GACUTIL, gacutil)");
594 ts.WriteLine();
595 ts.WriteLine("AC_MSG_CHECKING([for mono])");
596 ts.WriteLine("dnl if test \"x$MONO\" = \"x\" ; then");
597 ts.WriteLine("dnl AC_MSG_ERROR([Can't find \"mono\" in your PATH])");
598 ts.WriteLine("dnl else");
599 ts.WriteLine(" AC_MSG_RESULT([found])");
600 ts.WriteLine("dnl fi");
601 ts.WriteLine();
602 ts.WriteLine("AC_MSG_CHECKING([for gmcs])");
603 ts.WriteLine("dnl if test \"x$GMCS\" = \"x\" ; then");
604 ts.WriteLine("dnl AC_MSG_ERROR([Can't find \"gmcs\" in your PATH])");
605 ts.WriteLine("dnl else");
606 ts.WriteLine(" AC_MSG_RESULT([found])");
607 ts.WriteLine("dnl fi");
608 ts.WriteLine();
609 //ts.WriteLine("AC_MSG_CHECKING([for gacutil])");
610 //ts.WriteLine("if test \"x$GACUTIL\" = \"x\" ; then");
611 //ts.WriteLine(" AC_MSG_ERROR([Can't find \"gacutil\" in your PATH])");
612 //ts.WriteLine("else");
613 //ts.WriteLine(" AC_MSG_RESULT([found])");
614 //ts.WriteLine("fi");
615 ts.WriteLine();
616 ts.WriteLine("AC_SUBST(PATH)");
617 ts.WriteLine("AC_SUBST(LD_LIBRARY_PATH)");
618 ts.WriteLine();
619 ts.WriteLine("dnl CSFLAGS=\"-debug -nowarn:1574\"");
620 ts.WriteLine("CSFLAGS=\"\"");
621 ts.WriteLine("AC_SUBST(CSFLAGS)");
622 ts.WriteLine();
623 // ts.WriteLine("AC_MSG_CHECKING(--disable-sdl argument)");
624 // ts.WriteLine("AC_ARG_ENABLE(sdl,");
625 // ts.WriteLine(" [ --disable-sdl Disable Sdl interface.],");
626 // ts.WriteLine(" [disable_sdl=$disableval],");
627 // ts.WriteLine(" [disable_sdl=\"no\"])");
628 // ts.WriteLine("AC_MSG_RESULT($disable_sdl)");
629 // ts.WriteLine("if test \"$disable_sdl\" = \"yes\"; then");
630 // ts.WriteLine(" AC_DEFINE(FEAT_SDL)");
631 // ts.WriteLine("fi");
632 ts.WriteLine();
633 ts.WriteLine("dnl Find pkg-config");
634 ts.WriteLine("AC_PATH_PROG(PKGCONFIG, pkg-config, no)");
635 ts.WriteLine("if test \"x$PKG_CONFIG\" = \"xno\"; then");
636 ts.WriteLine(" AC_MSG_ERROR([You need to install pkg-config])");
637 ts.WriteLine("fi");
638 ts.WriteLine();
639 ts.WriteLine("PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)");
640 ts.WriteLine("BUILD_DIR=\"bin\"");
641 ts.WriteLine("AC_SUBST(BUILD_DIR)");
642 ts.WriteLine("CONFIG=\"Release\"");
643 ts.WriteLine("AC_SUBST(CONFIG)");
644 ts.WriteLine();
645 ts.WriteLine("if test \"x$has_mono\" = \"xtrue\"; then");
646 ts.WriteLine(" AC_PATH_PROG(RUNTIME, mono, no)");
647 ts.WriteLine(" AC_PATH_PROG(CSC, gmcs, no)");
648 ts.WriteLine(" if test `uname -s` = \"Darwin\"; then");
649 ts.WriteLine(" LIB_PREFIX=");
650 ts.WriteLine(" LIB_SUFFIX=.dylib");
651 ts.WriteLine(" else");
652 ts.WriteLine(" LIB_PREFIX=.so");
653 ts.WriteLine(" LIB_SUFFIX=");
654 ts.WriteLine(" fi");
655 ts.WriteLine("else");
656 ts.WriteLine(" AC_PATH_PROG(CSC, csc.exe, no)");
657 ts.WriteLine(" if test x$CSC = \"xno\"; then");
658 ts.WriteLine(" AC_MSG_ERROR([You need to install either mono or .Net])");
659 ts.WriteLine(" else");
660 ts.WriteLine(" RUNTIME=");
661 ts.WriteLine(" LIB_PREFIX=");
662 ts.WriteLine(" LIB_SUFFIX=.dylib");
663 ts.WriteLine(" fi");
664 ts.WriteLine("fi");
665 ts.WriteLine();
666 ts.WriteLine("AC_SUBST(LIB_PREFIX)");
667 ts.WriteLine("AC_SUBST(LIB_SUFFIX)");
668 ts.WriteLine();
669 ts.WriteLine("AC_SUBST(BASE_DEPENDENCIES_CFLAGS)");
670 ts.WriteLine("AC_SUBST(BASE_DEPENDENCIES_LIBS)");
671 ts.WriteLine();
672 ts.WriteLine("dnl Find monodoc");
673 ts.WriteLine("MONODOC_REQUIRED_VERSION=1.0");
674 ts.WriteLine("AC_SUBST(MONODOC_REQUIRED_VERSION)");
675 ts.WriteLine("PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, enable_monodoc=yes, enable_monodoc=no)");
676 ts.WriteLine();
677 ts.WriteLine("if test \"x$enable_monodoc\" = \"xyes\"; then");
678 ts.WriteLine(" AC_PATH_PROG(MONODOC, monodoc, no)");
679 ts.WriteLine(" if test x$MONODOC = xno; then");
680 ts.WriteLine(" enable_monodoc=no");
681 ts.WriteLine(" fi");
682 ts.WriteLine("else");
683 ts.WriteLine(" MONODOC=");
684 ts.WriteLine("fi");
685 ts.WriteLine();
686 ts.WriteLine("AC_SUBST(MONODOC)");
687 ts.WriteLine("AM_CONDITIONAL(ENABLE_MONODOC, test \"x$enable_monodoc\" = \"xyes\")");
688 ts.WriteLine();
689 ts.WriteLine("AC_PATH_PROG(GACUTIL, gacutil, no)");
690 ts.WriteLine("if test \"x$GACUTIL\" = \"xno\" ; then");
691 ts.WriteLine(" AC_MSG_ERROR([No gacutil tool found])");
692 ts.WriteLine("fi");
693 ts.WriteLine();
694 // foreach(ProjectNode project in solution.ProjectsTableOrder)
695 // {
696 // if (project.Type == ProjectType.Library)
697 // {
698 // }
699 // }
700 ts.WriteLine("GACUTIL_FLAGS='/package $(PACKAGE_NAME) /gacdir $(DESTDIR)$(prefix)'");
701 ts.WriteLine("AC_SUBST(GACUTIL_FLAGS)");
702 ts.WriteLine();
703 ts.WriteLine("winbuild=no");
704 ts.WriteLine("case \"$host\" in");
705 ts.WriteLine(" *-*-mingw*|*-*-cygwin*)");
706 ts.WriteLine(" winbuild=yes");
707 ts.WriteLine(" ;;");
708 ts.WriteLine("esac");
709 ts.WriteLine("AM_CONDITIONAL(WINBUILD, test x$winbuild = xyes)");
710 ts.WriteLine();
711 // ts.WriteLine("dnl Check for SDL");
712 // ts.WriteLine();
713 // ts.WriteLine("AC_PATH_PROG([SDL_CONFIG], [sdl-config])");
714 // ts.WriteLine("have_sdl=no");
715 // ts.WriteLine("if test -n \"${SDL_CONFIG}\"; then");
716 // ts.WriteLine(" have_sdl=yes");
717 // ts.WriteLine(" SDL_CFLAGS=`$SDL_CONFIG --cflags`");
718 // ts.WriteLine(" SDL_LIBS=`$SDL_CONFIG --libs`");
719 // ts.WriteLine(" #");
720 // ts.WriteLine(" # sdl-config sometimes emits an rpath flag pointing at its library");
721 // ts.WriteLine(" # installation directory. We don't want this, as it prevents users from");
722 // ts.WriteLine(" # linking sdl-viewer against, for example, a locally compiled libGL when a");
723 // ts.WriteLine(" # version of the library also exists in SDL's library installation");
724 // ts.WriteLine(" # directory, typically /usr/lib.");
725 // ts.WriteLine(" #");
726 // ts.WriteLine(" SDL_LIBS=`echo $SDL_LIBS | sed 's/-Wl,-rpath,[[^ ]]* //'`");
727 // ts.WriteLine("fi");
728 // ts.WriteLine("AC_SUBST([SDL_CFLAGS])");
729 // ts.WriteLine("AC_SUBST([SDL_LIBS])");
730 ts.WriteLine();
731 ts.WriteLine("AC_OUTPUT([");
732 ts.WriteLine("Makefile");
733 // TODO: this does not work quite right.
734 //ts.WriteLine("Properties/AssemblyInfo.cs");
735 foreach(ProjectNode project in solution.ProjectsTableOrder)
736 {
737 if (project.Type == ProjectType.Library)
738 {
739 ts.WriteLine(project.Name + ".pc");
740 }
741 // string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
742 // ts.WriteLine(Helper.NormalizePath(Helper.MakeFilePath(path, "Include"),'/'));
743 }
744 ts.WriteLine("])");
745 ts.WriteLine();
746 ts.WriteLine("#po/Makefile.in");
747 ts.WriteLine();
748 ts.WriteLine("echo \"---\"");
749 ts.WriteLine("echo \"Configuration summary\"");
750 ts.WriteLine("echo \"\"");
751 ts.WriteLine("echo \" * Installation prefix: $prefix\"");
752 ts.WriteLine("echo \" * compiler: $CSC\"");
753 ts.WriteLine("echo \" * Documentation: $enable_monodoc ($MONODOC)\"");
754 ts.WriteLine("echo \" * Package Name: $PACKAGE_NAME\"");
755 ts.WriteLine("echo \" * Version: $PACKAGE_VERSION\"");
756 ts.WriteLine("echo \" * Public Key: $PUBKEY\"");
757 ts.WriteLine("echo \"\"");
758 ts.WriteLine("echo \"---\"");
759 ts.WriteLine();
760 }
761
762 ts.NewLine = "\n";
763 foreach (ProjectNode project in solution.ProjectsTableOrder)
764 {
765 if (project.GenerateAssemblyInfoFile)
766 {
767 GenerateAssemblyInfoFile(solution, combFile);
768 }
769 }
770 }
771
772 private static void GenerateAssemblyInfoFile(SolutionNode solution, string combFile)
773 {
774 System.IO.Directory.CreateDirectory(Helper.MakePathRelativeTo(solution.FullPath, "Properties"));
775 combFile = Helper.MakeFilePath(solution.FullPath + "/Properties/", "AssemblyInfo.cs", "in");
776 StreamWriter ai = new StreamWriter(combFile);
777
778 using (ai)
779 {
780 ai.WriteLine("#region License");
781 ai.WriteLine("/*");
782 ai.WriteLine("MIT License");
783 ai.WriteLine("Copyright (c)2003-2006 Tao Framework Team");
784 ai.WriteLine("http://www.taoframework.com");
785 ai.WriteLine("All rights reserved.");
786 ai.WriteLine("");
787 ai.WriteLine("Permission is hereby granted, free of charge, to any person obtaining a copy");
788 ai.WriteLine("of this software and associated documentation files (the \"Software\"), to deal");
789 ai.WriteLine("in the Software without restriction, including without limitation the rights");
790 ai.WriteLine("to use, copy, modify, merge, publish, distribute, sublicense, and/or sell");
791 ai.WriteLine("copies of the Software, and to permit persons to whom the Software is");
792 ai.WriteLine("furnished to do so, subject to the following conditions:");
793 ai.WriteLine("");
794 ai.WriteLine("The above copyright notice and this permission notice shall be included in all");
795 ai.WriteLine("copies or substantial portions of the Software.");
796 ai.WriteLine("");
797 ai.WriteLine("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR");
798 ai.WriteLine("IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,");
799 ai.WriteLine("FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE");
800 ai.WriteLine("AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER");
801 ai.WriteLine("LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,");
802 ai.WriteLine("OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE");
803 ai.WriteLine("SOFTWARE.");
804 ai.WriteLine("*/");
805 ai.WriteLine("#endregion License");
806 ai.WriteLine("");
807 ai.WriteLine("using System;");
808 ai.WriteLine("using System.Reflection;");
809 ai.WriteLine("using System.Runtime.InteropServices;");
810 ai.WriteLine("using System.Security;");
811 ai.WriteLine("using System.Security.Permissions;");
812 ai.WriteLine("");
813 ai.WriteLine("[assembly: AllowPartiallyTrustedCallers]");
814 ai.WriteLine("[assembly: AssemblyCompany(\"Tao Framework -- http://www.taoframework.com\")]");
815 ai.WriteLine("[assembly: AssemblyConfiguration(\"Retail\")]");
816 ai.WriteLine("[assembly: AssemblyCopyright(\"Copyright (c)2003-2006 Tao Framework Team. All rights reserved.\")]");
817 ai.WriteLine("[assembly: AssemblyCulture(\"\")]");
818 ai.WriteLine("[assembly: AssemblyDefaultAlias(\"@PACKAGE_NAME@\")]");
819 ai.WriteLine("[assembly: AssemblyDelaySign(false)]");
820 ai.WriteLine("[assembly: AssemblyDescription(\"@DESCRIPTION@\")]");
821 ai.WriteLine("[assembly: AssemblyFileVersion(\"@ASSEMBLY_VERSION@\")]");
822 ai.WriteLine("[assembly: AssemblyInformationalVersion(\"@ASSEMBLY_VERSION@\")]");
823 ai.WriteLine("[assembly: AssemblyKeyName(\"\")]");
824 ai.WriteLine("[assembly: AssemblyProduct(\"@PACKAGE_NAME@.dll\")]");
825 ai.WriteLine("[assembly: AssemblyTitle(\"@DESCRIPTION@\")]");
826 ai.WriteLine("[assembly: AssemblyTrademark(\"Tao Framework -- http://www.taoframework.com\")]");
827 ai.WriteLine("[assembly: AssemblyVersion(\"@ASSEMBLY_VERSION@\")]");
828 ai.WriteLine("[assembly: CLSCompliant(true)]");
829 ai.WriteLine("[assembly: ComVisible(false)]");
830 ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.Execution)]");
831 ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.SkipVerification)]");
832 ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.UnmanagedCode)]");
833
834 }
835 //return combFile;
836 }
837
838 private void CleanProject(ProjectNode project)
839 {
840 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name);
841 string projectFile = Helper.MakeFilePath(project.FullPath, "Include", "am");
842 Helper.DeleteIfExists(projectFile);
843 }
844
845 private void CleanSolution(SolutionNode solution)
846 {
847 m_Kernel.Log.Write("Cleaning Autotools make files for", solution.Name);
848
849 string slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "am");
850 Helper.DeleteIfExists(slnFile);
851
852 slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "in");
853 Helper.DeleteIfExists(slnFile);
854
855 slnFile = Helper.MakeFilePath(solution.FullPath, "configure", "ac");
856 Helper.DeleteIfExists(slnFile);
857
858 slnFile = Helper.MakeFilePath(solution.FullPath, "configure");
859 Helper.DeleteIfExists(slnFile);
860
861 slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile");
862 Helper.DeleteIfExists(slnFile);
863
864 foreach(ProjectNode project in solution.Projects)
865 {
866 CleanProject(project);
867 }
868
869 m_Kernel.Log.Write("");
870 }
871
872 #endregion
873
874 #region ITarget Members
875
876 /// <summary>
877 /// Writes the specified kern.
878 /// </summary>
879 /// <param name="kern">The kern.</param>
880 public void Write(Kernel kern)
881 {
882 if( kern == null )
883 {
884 throw new ArgumentNullException("kern");
885 }
886 m_Kernel = kern;
887 foreach(SolutionNode solution in kern.Solutions)
888 {
889 WriteCombine(solution);
890 }
891 m_Kernel = null;
892 }
893
894 /// <summary>
895 /// Cleans the specified kern.
896 /// </summary>
897 /// <param name="kern">The kern.</param>
898 public virtual void Clean(Kernel kern)
899 {
900 if( kern == null )
901 {
902 throw new ArgumentNullException("kern");
903 }
904 m_Kernel = kern;
905 foreach(SolutionNode sol in kern.Solutions)
906 {
907 CleanSolution(sol);
908 }
909 m_Kernel = null;
910 }
911
912 /// <summary>
913 /// Gets the name.
914 /// </summary>
915 /// <value>The name.</value>
916 public string Name
917 {
918 get
919 {
920 return "autotools";
921 }
922 }
923
924 #endregion
925 }
926}
diff --git a/Prebuild/src/Core/Targets/DebugTarget.cs b/Prebuild/src/Core/Targets/DebugTarget.cs
new file mode 100644
index 0000000..6baa623
--- /dev/null
+++ b/Prebuild/src/Core/Targets/DebugTarget.cs
@@ -0,0 +1,102 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-09-20 09:42:51 +0200 (on, 20 sep 2006) $
31 * $Revision: 164 $
32 */
33#endregion
34
35using System;
36
37using Prebuild.Core.Attributes;
38using Prebuild.Core.Interfaces;
39using Prebuild.Core.Nodes;
40
41#if (DEBUG && _DEBUG_TARGET)
42namespace Prebuild.Core.Targets
43{
44 [Target("debug")]
45 public class DebugTarget : ITarget
46 {
47#region Fields
48
49 private Kernel m_Kernel = null;
50
51#endregion
52
53#region ITarget Members
54
55 public void Write()
56 {
57 foreach(SolutionNode s in m_Kernel.Solutions)
58 {
59 Console.WriteLine("Solution [ {0}, {1} ]", s.Name, s.Path);
60 foreach(string file in s.Files)
61{
62 Console.WriteLine("\tFile [ {0} ]", file);
63}
64
65 foreach(ProjectNode proj in s.Projects)
66 {
67 Console.WriteLine("\tProject [ {0}, {1}. {2} ]", proj.Name, proj.Path, proj.Language);
68 foreach(string file in proj.Files)
69 Console.WriteLine("\t\tFile [ {0} ]", file);
70 }
71 }
72 }
73
74 public void Clean()
75 {
76 Console.WriteLine("Not implemented");
77 }
78
79 public string Name
80 {
81 get
82 {
83 return "debug";
84 }
85 }
86
87 public Kernel Kernel
88 {
89 get
90 {
91 return m_Kernel;
92 }
93 set
94 {
95 m_Kernel = value;
96 }
97 }
98
99#endregion
100 }
101}
102#endif
diff --git a/Prebuild/src/Core/Targets/MonoDevelopTarget.cs b/Prebuild/src/Core/Targets/MonoDevelopTarget.cs
new file mode 100644
index 0000000..8620e4b
--- /dev/null
+++ b/Prebuild/src/Core/Targets/MonoDevelopTarget.cs
@@ -0,0 +1,458 @@
1#region BSD License
2/*
3Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2007-02-13 22:07:07 +0100 (ti, 13 feb 2007) $
31 * $Revision: 206 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Collections.Specialized;
38using System.IO;
39using System.Reflection;
40using System.Text.RegularExpressions;
41
42using Prebuild.Core.Attributes;
43using Prebuild.Core.Interfaces;
44using Prebuild.Core.Nodes;
45using Prebuild.Core.Utilities;
46
47namespace Prebuild.Core.Targets
48{
49 /// <summary>
50 ///
51 /// </summary>
52 [Target("monodev")]
53 public class MonoDevelopTarget : ITarget
54 {
55 #region Fields
56
57 private Kernel m_Kernel;
58
59 #endregion
60
61 #region Private Methods
62
63 private static string PrependPath(string path)
64 {
65 string tmpPath = Helper.NormalizePath(path, '/');
66 Regex regex = new Regex(@"(\w):/(\w+)");
67 Match match = regex.Match(tmpPath);
68 if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/')
69 {
70 tmpPath = Helper.NormalizePath(tmpPath);
71 }
72 else
73 {
74 tmpPath = Helper.NormalizePath("./" + tmpPath);
75 }
76
77 return tmpPath;
78 }
79
80 private static string BuildReference(SolutionNode solution, ReferenceNode refr)
81 {
82 string ret = "<ProjectReference type=\"";
83 if(solution.ProjectsTable.ContainsKey(refr.Name))
84 {
85 ret += "Project\"";
86 ret += " localcopy=\"" + refr.LocalCopy.ToString() + "\" refto=\"" + refr.Name + "\" />";
87 }
88 else
89 {
90 ProjectNode project = (ProjectNode)refr.Parent;
91 string fileRef = FindFileReference(refr.Name, project);
92
93 if(refr.Path != null || fileRef != null)
94 {
95 ret += "Assembly\" refto=\"";
96
97 string finalPath = (refr.Path != null) ? Helper.MakeFilePath(refr.Path, refr.Name, "dll") : fileRef;
98
99 ret += finalPath;
100 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />";
101 return ret;
102 }
103
104 ret += "Gac\"";
105 ret += " localcopy=\"" + refr.LocalCopy.ToString() + "\"";
106 ret += " refto=\"";
107 try
108 {
109 //Assembly assem = Assembly.Load(refr.Name);
110 //ret += assem.FullName;
111 ret += refr.Name;
112 }
113 catch (System.NullReferenceException e)
114 {
115 e.ToString();
116 ret += refr.Name;
117 }
118 ret += "\" />";
119 }
120
121 return ret;
122 }
123
124 private static string FindFileReference(string refName, ProjectNode project)
125 {
126 foreach(ReferencePathNode refPath in project.ReferencePaths)
127 {
128 string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll");
129
130 if(File.Exists(fullPath))
131 {
132 return fullPath;
133 }
134 }
135
136 return null;
137 }
138
139 /// <summary>
140 /// Gets the XML doc file.
141 /// </summary>
142 /// <param name="project">The project.</param>
143 /// <param name="conf">The conf.</param>
144 /// <returns></returns>
145 public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf)
146 {
147 if( conf == null )
148 {
149 throw new ArgumentNullException("conf");
150 }
151 if( project == null )
152 {
153 throw new ArgumentNullException("project");
154 }
155 string docFile = (string)conf.Options["XmlDocFile"];
156 if(docFile != null && docFile.Length == 0)//default to assembly name if not specified
157 {
158 return "False";
159 }
160 return "True";
161 }
162
163 private void WriteProject(SolutionNode solution, ProjectNode project)
164 {
165 string csComp = "Mcs";
166 string netRuntime = "Mono";
167 if(project.Runtime == ClrRuntime.Microsoft)
168 {
169 csComp = "Csc";
170 netRuntime = "MsNet";
171 }
172
173 string projFile = Helper.MakeFilePath(project.FullPath, project.Name, "mdp");
174 StreamWriter ss = new StreamWriter(projFile);
175
176 m_Kernel.CurrentWorkingDirectory.Push();
177 Helper.SetCurrentDir(Path.GetDirectoryName(projFile));
178
179 using(ss)
180 {
181 ss.WriteLine(
182 "<Project name=\"{0}\" description=\"\" standardNamespace=\"{1}\" newfilesearch=\"None\" enableviewstate=\"True\" fileversion=\"2.0\" language=\"C#\" clr-version=\"Net_2_0\" ctype=\"DotNetProject\">",
183 project.Name,
184 project.RootNamespace
185 );
186
187 int count = 0;
188
189 ss.WriteLine(" <Configurations active=\"{0}\">", solution.ActiveConfig);
190
191 foreach(ConfigurationNode conf in project.Configurations)
192 {
193 ss.WriteLine(" <Configuration name=\"{0}\" ctype=\"DotNetProjectConfiguration\">", conf.Name);
194 ss.Write(" <Output");
195 ss.Write(" directory=\"{0}\"", Helper.EndPath(Helper.NormalizePath(".\\" + conf.Options["OutputPath"].ToString())));
196 ss.Write(" assembly=\"{0}\"", project.AssemblyName);
197 ss.Write(" executeScript=\"{0}\"", conf.Options["RunScript"]);
198 //ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]);
199 //ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]);
200 if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0)
201 {
202 ss.Write(" executeBeforeBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString()));
203 }
204 else
205 {
206 ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]);
207 }
208 if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0)
209 {
210 ss.Write(" executeAfterBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString()));
211 }
212 else
213 {
214 ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]);
215 }
216 ss.Write(" executeBeforeBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]);
217 ss.Write(" executeAfterBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]);
218 ss.WriteLine(" />");
219
220 ss.Write(" <Build");
221 ss.Write(" debugmode=\"True\"");
222 if (project.Type == ProjectType.WinExe)
223 {
224 ss.Write(" target=\"{0}\"", ProjectType.Exe.ToString());
225 }
226 else
227 {
228 ss.Write(" target=\"{0}\"", project.Type);
229 }
230 ss.WriteLine(" />");
231
232 ss.Write(" <Execution");
233 ss.Write(" runwithwarnings=\"True\"");
234 ss.Write(" consolepause=\"True\"");
235 ss.Write(" runtime=\"{0}\"", netRuntime);
236 ss.Write(" clr-version=\"Net_2_0\"");
237 ss.WriteLine(" />");
238
239 ss.Write(" <CodeGeneration");
240 ss.Write(" compiler=\"{0}\"", csComp);
241 ss.Write(" warninglevel=\"{0}\"", conf.Options["WarningLevel"]);
242 ss.Write(" nowarn=\"{0}\"", conf.Options["SuppressWarnings"]);
243 ss.Write(" includedebuginformation=\"{0}\"", conf.Options["DebugInformation"]);
244 ss.Write(" optimize=\"{0}\"", conf.Options["OptimizeCode"]);
245 ss.Write(" unsafecodeallowed=\"{0}\"", conf.Options["AllowUnsafe"]);
246 ss.Write(" generateoverflowchecks=\"{0}\"", conf.Options["CheckUnderflowOverflow"]);
247 ss.Write(" mainclass=\"{0}\"", project.StartupObject);
248 ss.Write(" target=\"{0}\"", project.Type);
249 ss.Write(" definesymbols=\"{0}\"", conf.Options["CompilerDefines"]);
250 ss.Write(" generatexmldocumentation=\"{0}\"", GenerateXmlDocFile(project, conf));
251 ss.Write(" win32Icon=\"{0}\"", project.AppIcon);
252 ss.Write(" ctype=\"CSharpCompilerParameters\"");
253 ss.WriteLine(" />");
254 ss.WriteLine(" </Configuration>");
255
256 count++;
257 }
258 ss.WriteLine(" </Configurations>");
259
260 ss.Write(" <DeploymentInformation");
261 ss.Write(" target=\"\"");
262 ss.Write(" script=\"\"");
263 ss.Write(" strategy=\"File\"");
264 ss.WriteLine(">");
265 ss.WriteLine(" <excludeFiles />");
266 ss.WriteLine(" </DeploymentInformation>");
267
268 ss.WriteLine(" <Contents>");
269 foreach(string file in project.Files)
270 {
271 string buildAction = "Compile";
272 switch(project.Files.GetBuildAction(file))
273 {
274 case BuildAction.None:
275 buildAction = "Nothing";
276 break;
277
278 case BuildAction.Content:
279 buildAction = "Exclude";
280 break;
281
282 case BuildAction.EmbeddedResource:
283 buildAction = "EmbedAsResource";
284 break;
285
286 default:
287 buildAction = "Compile";
288 break;
289 }
290
291 // Sort of a hack, we try and resolve the path and make it relative, if we can.
292 string filePath = PrependPath(file);
293 ss.WriteLine(" <File name=\"{0}\" subtype=\"Code\" buildaction=\"{1}\" dependson=\"\" data=\"\" />", filePath, buildAction);
294 }
295 ss.WriteLine(" </Contents>");
296
297 ss.WriteLine(" <References>");
298 foreach(ReferenceNode refr in project.References)
299 {
300 ss.WriteLine(" {0}", BuildReference(solution, refr));
301 }
302 ss.WriteLine(" </References>");
303
304
305 ss.WriteLine("</Project>");
306 }
307
308 m_Kernel.CurrentWorkingDirectory.Pop();
309 }
310
311 private void WriteCombine(SolutionNode solution)
312 {
313 m_Kernel.Log.Write("Creating MonoDevelop combine and project files");
314 foreach(ProjectNode project in solution.Projects)
315 {
316 if(m_Kernel.AllowProject(project.FilterGroups))
317 {
318 m_Kernel.Log.Write("...Creating project: {0}", project.Name);
319 WriteProject(solution, project);
320 }
321 }
322
323 m_Kernel.Log.Write("");
324 string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds");
325 StreamWriter ss = new StreamWriter(combFile);
326
327 m_Kernel.CurrentWorkingDirectory.Push();
328 Helper.SetCurrentDir(Path.GetDirectoryName(combFile));
329
330 int count = 0;
331
332 using(ss)
333 {
334 ss.WriteLine("<Combine name=\"{0}\" fileversion=\"2.0\" description=\"\">", solution.Name);
335
336 count = 0;
337 foreach(ConfigurationNode conf in solution.Configurations)
338 {
339 if(count == 0)
340 {
341 ss.WriteLine(" <Configurations active=\"{0}\">", conf.Name);
342 }
343
344 ss.WriteLine(" <Configuration name=\"{0}\" ctype=\"CombineConfiguration\">", conf.Name);
345 foreach(ProjectNode project in solution.Projects)
346 {
347 ss.WriteLine(" <Entry configuration=\"{1}\" build=\"True\" name=\"{0}\" />", project.Name, conf.Name);
348 }
349 ss.WriteLine(" </Configuration>");
350
351 count++;
352 }
353 ss.WriteLine(" </Configurations>");
354
355 count = 0;
356
357 foreach(ProjectNode project in solution.Projects)
358 {
359 if(count == 0)
360 ss.WriteLine(" <StartMode startupentry=\"{0}\" single=\"True\">", project.Name);
361
362 ss.WriteLine(" <Execute type=\"None\" entry=\"{0}\" />", project.Name);
363 count++;
364 }
365 ss.WriteLine(" </StartMode>");
366
367 ss.WriteLine(" <Entries>");
368 foreach(ProjectNode project in solution.Projects)
369 {
370 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
371 ss.WriteLine(" <Entry filename=\"{0}\" />",
372 Helper.MakeFilePath(path, project.Name, "mdp"));
373 }
374 ss.WriteLine(" </Entries>");
375
376 ss.WriteLine("</Combine>");
377 }
378
379 m_Kernel.CurrentWorkingDirectory.Pop();
380 }
381
382 private void CleanProject(ProjectNode project)
383 {
384 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name);
385 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "mdp");
386 Helper.DeleteIfExists(projectFile);
387 }
388
389 private void CleanSolution(SolutionNode solution)
390 {
391 m_Kernel.Log.Write("Cleaning MonoDevelop combine and project files for", solution.Name);
392
393 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds");
394 Helper.DeleteIfExists(slnFile);
395
396 foreach(ProjectNode project in solution.Projects)
397 {
398 CleanProject(project);
399 }
400
401 m_Kernel.Log.Write("");
402 }
403
404 #endregion
405
406 #region ITarget Members
407
408 /// <summary>
409 /// Writes the specified kern.
410 /// </summary>
411 /// <param name="kern">The kern.</param>
412 public void Write(Kernel kern)
413 {
414 if( kern == null )
415 {
416 throw new ArgumentNullException("kern");
417 }
418 m_Kernel = kern;
419 foreach(SolutionNode solution in kern.Solutions)
420 {
421 WriteCombine(solution);
422 }
423 m_Kernel = null;
424 }
425
426 /// <summary>
427 /// Cleans the specified kern.
428 /// </summary>
429 /// <param name="kern">The kern.</param>
430 public virtual void Clean(Kernel kern)
431 {
432 if( kern == null )
433 {
434 throw new ArgumentNullException("kern");
435 }
436 m_Kernel = kern;
437 foreach(SolutionNode sol in kern.Solutions)
438 {
439 CleanSolution(sol);
440 }
441 m_Kernel = null;
442 }
443
444 /// <summary>
445 /// Gets the name.
446 /// </summary>
447 /// <value>The name.</value>
448 public string Name
449 {
450 get
451 {
452 return "sharpdev";
453 }
454 }
455
456 #endregion
457 }
458}
diff --git a/Prebuild/src/Core/Targets/NAntTarget.cs b/Prebuild/src/Core/Targets/NAntTarget.cs
new file mode 100644
index 0000000..0f0deb2
--- /dev/null
+++ b/Prebuild/src/Core/Targets/NAntTarget.cs
@@ -0,0 +1,621 @@
1#region BSD License
2/*
3Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2007-02-13 21:58:03 +0100 (ti, 13 feb 2007) $
31 * $Revision: 205 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Collections.Specialized;
38using System.IO;
39using System.Reflection;
40using System.Text.RegularExpressions;
41
42using Prebuild.Core.Attributes;
43using Prebuild.Core.Interfaces;
44using Prebuild.Core.Nodes;
45using Prebuild.Core.Utilities;
46
47namespace Prebuild.Core.Targets
48{
49 /// <summary>
50 ///
51 /// </summary>
52 [Target("nant")]
53 public class NAntTarget : ITarget
54 {
55 #region Fields
56
57 private Kernel m_Kernel;
58
59 #endregion
60
61 #region Private Methods
62
63 private static string PrependPath(string path)
64 {
65 string tmpPath = Helper.NormalizePath(path, '/');
66 Regex regex = new Regex(@"(\w):/(\w+)");
67 Match match = regex.Match(tmpPath);
68 //if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/')
69 //{
70 tmpPath = Helper.NormalizePath(tmpPath);
71 //}
72// else
73// {
74// tmpPath = Helper.NormalizePath("./" + tmpPath);
75// }
76
77 return tmpPath;
78 }
79
80 private static string BuildReference(SolutionNode solution, ProjectNode currentProject, ReferenceNode refr)
81 {
82 string ret = "";
83 if(solution.ProjectsTable.ContainsKey(refr.Name))
84 {
85 ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name];
86
87 string finalPath = Helper.NormalizePath(((ReferencePathNode)currentProject.ReferencePaths[0]).Path + refr.Name + ".dll", '/');
88
89 return finalPath;
90 }
91 else
92 {
93 ProjectNode project = (ProjectNode)refr.Parent;
94 string fileRef = FindFileReference(refr.Name, project);
95
96 if(refr.Path != null || fileRef != null)
97 {
98 string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path + "/" + refr.Name + ".dll", '/') : fileRef;
99 ret += finalPath;
100 return ret;
101 }
102
103 try
104 {
105 //Assembly assem = Assembly.Load(refr.Name);
106 //if (assem != null)
107 //{
108 //ret += (refr.Name + ".dll");
109 //}
110 //else
111 //{
112 ret += (refr.Name + ".dll");
113 //}
114 }
115 catch (System.NullReferenceException e)
116 {
117 e.ToString();
118 ret += refr.Name + ".dll";
119 }
120 }
121 return ret;
122 }
123
124 private static string BuildReferencePath(SolutionNode solution, ReferenceNode refr)
125 {
126 string ret = "";
127 if(solution.ProjectsTable.ContainsKey(refr.Name))
128 {
129 ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name];
130 string finalPath = Helper.NormalizePath(((ReferencePathNode)project.ReferencePaths[0]).Path, '/');
131
132 return finalPath;
133 }
134 else
135 {
136 ProjectNode project = (ProjectNode)refr.Parent;
137 string fileRef = FindFileReference(refr.Name, project);
138
139 if(refr.Path != null || fileRef != null)
140 {
141 string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path, '/') : fileRef;
142 ret += finalPath;
143 return ret;
144 }
145
146 try
147 {
148 Assembly assem = Assembly.Load(refr.Name);
149 if (assem != null)
150 {
151 ret += "";
152 }
153 else
154 {
155 ret += "";
156 }
157 }
158 catch (System.NullReferenceException e)
159 {
160 e.ToString();
161 ret += "";
162 }
163 }
164 return ret;
165 }
166
167 private static string FindFileReference(string refName, ProjectNode project)
168 {
169 foreach(ReferencePathNode refPath in project.ReferencePaths)
170 {
171 string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll");
172
173 if(File.Exists(fullPath))
174 {
175 return fullPath;
176 }
177 }
178
179 return null;
180 }
181
182 /// <summary>
183 /// Gets the XML doc file.
184 /// </summary>
185 /// <param name="project">The project.</param>
186 /// <param name="conf">The conf.</param>
187 /// <returns></returns>
188 public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf)
189 {
190 if( conf == null )
191 {
192 throw new ArgumentNullException("conf");
193 }
194 if( project == null )
195 {
196 throw new ArgumentNullException("project");
197 }
198 string docFile = (string)conf.Options["XmlDocFile"];
199 // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified
200 // {
201 // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml";
202 // }
203 return docFile;
204 }
205
206 private void WriteProject(SolutionNode solution, ProjectNode project)
207 {
208 string projFile = Helper.MakeFilePath(project.FullPath, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build");
209 StreamWriter ss = new StreamWriter(projFile);
210
211 m_Kernel.CurrentWorkingDirectory.Push();
212 Helper.SetCurrentDir(Path.GetDirectoryName(projFile));
213 bool hasDoc = false;
214
215 using(ss)
216 {
217 ss.WriteLine("<?xml version=\"1.0\" ?>");
218 ss.WriteLine("<project name=\"{0}\" default=\"build\">", project.Name);
219 ss.WriteLine(" <target name=\"{0}\">", "build");
220 ss.WriteLine(" <echo message=\"Build Directory is ${project::get-base-directory()}/${build.dir}\" />");
221 ss.WriteLine(" <mkdir dir=\"${project::get-base-directory()}/${build.dir}\" />");
222 ss.WriteLine(" <copy todir=\"${project::get-base-directory()}/${build.dir}\">");
223 ss.WriteLine(" <fileset basedir=\"${project::get-base-directory()}\">");
224 foreach(ReferenceNode refr in project.References)
225 {
226 if (refr.LocalCopy)
227 {
228 ss.WriteLine(" <include name=\"{0}", Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr))+"\" />", '/'));
229 }
230 }
231 ss.WriteLine(" </fileset>");
232 ss.WriteLine(" </copy>");
233 ss.Write(" <csc");
234 ss.Write(" target=\"{0}\"", project.Type.ToString().ToLower());
235 ss.Write(" debug=\"{0}\"", "${build.debug}");
236 foreach(ConfigurationNode conf in project.Configurations)
237 {
238 if (conf.Options.KeyFile !="")
239 {
240 ss.Write(" keyfile=\"{0}\"", conf.Options.KeyFile);
241 break;
242 }
243 }
244 foreach(ConfigurationNode conf in project.Configurations)
245 {
246 ss.Write(" unsafe=\"{0}\"", conf.Options.AllowUnsafe);
247 break;
248 }
249 foreach(ConfigurationNode conf in project.Configurations)
250 {
251 ss.Write(" define=\"{0}\"", conf.Options.CompilerDefines);
252 break;
253 }
254 foreach(ConfigurationNode conf in project.Configurations)
255 {
256 if (GetXmlDocFile(project, conf) !="")
257 {
258 ss.Write(" doc=\"{0}\"", "${project::get-base-directory()}/${build.dir}/" + GetXmlDocFile(project, conf));
259 hasDoc = true;
260 }
261 break;
262 }
263 ss.Write(" output=\"{0}", "${project::get-base-directory()}/${build.dir}/${project::get-name()}");
264 if (project.Type == ProjectType.Library)
265 {
266 ss.Write(".dll\"");
267 }
268 else
269 {
270 ss.Write(".exe\"");
271 }
272 if(project.AppIcon != null && project.AppIcon.Length != 0)
273 {
274 ss.Write(" win32icon=\"{0}\"", Helper.NormalizePath(project.AppIcon,'/'));
275 }
276 ss.WriteLine(">");
277 ss.WriteLine(" <resources prefix=\"{0}\" dynamicprefix=\"true\" >", project.RootNamespace);
278 foreach (string file in project.Files)
279 {
280 switch (project.Files.GetBuildAction(file))
281 {
282 case BuildAction.EmbeddedResource:
283 ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
284 break;
285 default:
286 if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings)
287 {
288 ss.WriteLine(" <include name=\"{0}\" />", file.Substring(0, file.LastIndexOf('.')) + ".resx");
289 }
290 break;
291 }
292 }
293 //if (project.Files.GetSubType(file).ToString() != "Code")
294 //{
295 // ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
296
297 ss.WriteLine(" </resources>");
298 ss.WriteLine(" <sources failonempty=\"true\">");
299 foreach(string file in project.Files)
300 {
301 switch(project.Files.GetBuildAction(file))
302 {
303 case BuildAction.Compile:
304 ss.WriteLine(" <include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
305 break;
306 default:
307 break;
308 }
309 }
310 ss.WriteLine(" </sources>");
311 ss.WriteLine(" <references basedir=\"${project::get-base-directory()}\">");
312 ss.WriteLine(" <lib>");
313 ss.WriteLine(" <include name=\"${project::get-base-directory()}\" />");
314 ss.WriteLine(" <include name=\"${project::get-base-directory()}/${build.dir}\" />");
315 ss.WriteLine(" </lib>");
316 foreach(ReferenceNode refr in project.References)
317 {
318 string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)), '/');
319 ss.WriteLine(" <include name=\""+ path + "\" />" );
320 }
321 ss.WriteLine(" </references>");
322
323 ss.WriteLine(" </csc>");
324
325 foreach (ConfigurationNode conf in project.Configurations)
326 {
327 if (!String.IsNullOrEmpty(conf.Options.OutputPath))
328 {
329 string targetDir = Helper.NormalizePath(conf.Options.OutputPath, '/');
330
331 ss.WriteLine(" <echo message=\"Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/" + targetDir + "\" />");
332
333 ss.WriteLine(" <mkdir dir=\"${project::get-base-directory()}/" + targetDir + "\"/>");
334
335 ss.WriteLine(" <copy todir=\"${project::get-base-directory()}/" + targetDir + "\">");
336 ss.WriteLine(" <fileset basedir=\"${project::get-base-directory()}/${build.dir}/\" >");
337 ss.WriteLine(" <include name=\"*.dll\"/>");
338 ss.WriteLine(" <include name=\"*.exe\"/>");
339 ss.WriteLine(" </fileset>");
340 ss.WriteLine(" </copy>");
341 break;
342 }
343 }
344
345 ss.WriteLine(" </target>");
346
347 ss.WriteLine(" <target name=\"clean\">");
348 ss.WriteLine(" <delete dir=\"${bin.dir}\" failonerror=\"false\" />");
349 ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />");
350 ss.WriteLine(" </target>");
351
352 ss.WriteLine(" <target name=\"doc\" description=\"Creates documentation.\">");
353 if (hasDoc)
354 {
355 ss.WriteLine(" <property name=\"doc.target\" value=\"\" />");
356 ss.WriteLine(" <if test=\"${platform::is-unix()}\">");
357 ss.WriteLine(" <property name=\"doc.target\" value=\"Web\" />");
358 ss.WriteLine(" </if>");
359 ss.WriteLine(" <ndoc failonerror=\"false\" verbose=\"true\">");
360 ss.WriteLine(" <assemblies basedir=\"${project::get-base-directory()}\">");
361 ss.Write(" <include name=\"${build.dir}/${project::get-name()}");
362 if (project.Type == ProjectType.Library)
363 {
364 ss.WriteLine(".dll\" />");
365 }
366 else
367 {
368 ss.WriteLine(".exe\" />");
369 }
370
371 ss.WriteLine(" </assemblies>");
372 ss.WriteLine(" <summaries basedir=\"${project::get-base-directory()}\">");
373 ss.WriteLine(" <include name=\"${build.dir}/${project::get-name()}.xml\"/>");
374 ss.WriteLine(" </summaries>");
375 ss.WriteLine(" <referencepaths basedir=\"${project::get-base-directory()}\">");
376 ss.WriteLine(" <include name=\"${build.dir}\" />");
377 // foreach(ReferenceNode refr in project.References)
378 // {
379 // string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/');
380 // if (path != "")
381 // {
382 // ss.WriteLine(" <include name=\"{0}\" />", path);
383 // }
384 // }
385 ss.WriteLine(" </referencepaths>");
386 ss.WriteLine(" <documenters>");
387 ss.WriteLine(" <documenter name=\"MSDN\">");
388 ss.WriteLine(" <property name=\"OutputDirectory\" value=\"${project::get-base-directory()}/${build.dir}/doc/${project::get-name()}\" />");
389 ss.WriteLine(" <property name=\"OutputTarget\" value=\"${doc.target}\" />");
390 ss.WriteLine(" <property name=\"HtmlHelpName\" value=\"${project::get-name()}\" />");
391 ss.WriteLine(" <property name=\"IncludeFavorites\" value=\"False\" />");
392 ss.WriteLine(" <property name=\"Title\" value=\"${project::get-name()} SDK Documentation\" />");
393 ss.WriteLine(" <property name=\"SplitTOCs\" value=\"False\" />");
394 ss.WriteLine(" <property name=\"DefaulTOC\" value=\"\" />");
395 ss.WriteLine(" <property name=\"ShowVisualBasic\" value=\"True\" />");
396 ss.WriteLine(" <property name=\"AutoDocumentConstructors\" value=\"True\" />");
397 ss.WriteLine(" <property name=\"ShowMissingSummaries\" value=\"${build.debug}\" />");
398 ss.WriteLine(" <property name=\"ShowMissingRemarks\" value=\"${build.debug}\" />");
399 ss.WriteLine(" <property name=\"ShowMissingParams\" value=\"${build.debug}\" />");
400 ss.WriteLine(" <property name=\"ShowMissingReturns\" value=\"${build.debug}\" />");
401 ss.WriteLine(" <property name=\"ShowMissingValues\" value=\"${build.debug}\" />");
402 ss.WriteLine(" <property name=\"DocumentInternals\" value=\"False\" />");
403 ss.WriteLine(" <property name=\"DocumentPrivates\" value=\"False\" />");
404 ss.WriteLine(" <property name=\"DocumentProtected\" value=\"True\" />");
405 ss.WriteLine(" <property name=\"DocumentEmptyNamespaces\" value=\"${build.debug}\" />");
406 ss.WriteLine(" <property name=\"IncludeAssemblyVersion\" value=\"True\" />");
407 ss.WriteLine(" </documenter>");
408 ss.WriteLine(" </documenters>");
409 ss.WriteLine(" </ndoc>");
410 }
411 ss.WriteLine(" </target>");
412 ss.WriteLine("</project>");
413 }
414 m_Kernel.CurrentWorkingDirectory.Pop();
415 }
416
417 private void WriteCombine(SolutionNode solution)
418 {
419 m_Kernel.Log.Write("Creating NAnt build files");
420 foreach(ProjectNode project in solution.Projects)
421 {
422 if(m_Kernel.AllowProject(project.FilterGroups))
423 {
424 m_Kernel.Log.Write("...Creating project: {0}", project.Name);
425 WriteProject(solution, project);
426 }
427 }
428
429 m_Kernel.Log.Write("");
430 string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build");
431 StreamWriter ss = new StreamWriter(combFile);
432
433 m_Kernel.CurrentWorkingDirectory.Push();
434 Helper.SetCurrentDir(Path.GetDirectoryName(combFile));
435
436 using(ss)
437 {
438 ss.WriteLine("<?xml version=\"1.0\" ?>");
439 ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name);
440 ss.WriteLine(" <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>");
441 ss.WriteLine();
442
443 //ss.WriteLine(" <property name=\"dist.dir\" value=\"dist\" />");
444 //ss.WriteLine(" <property name=\"source.dir\" value=\"source\" />");
445 ss.WriteLine(" <property name=\"bin.dir\" value=\"bin\" />");
446 ss.WriteLine(" <property name=\"obj.dir\" value=\"obj\" />");
447 ss.WriteLine(" <property name=\"doc.dir\" value=\"doc\" />");
448 ss.WriteLine(" <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />");
449
450 foreach(ConfigurationNode conf in solution.Configurations)
451 {
452 // Set the project.config to a non-debug configuration
453 if( conf.Options["DebugInformation"].ToString().ToLower() != "true" )
454 {
455 ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", conf.Name);
456 }
457 ss.WriteLine();
458 ss.WriteLine(" <target name=\"{0}\" description=\"\">", conf.Name);
459 ss.WriteLine(" <property name=\"project.config\" value=\"{0}\" />", conf.Name);
460 ss.WriteLine(" <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower());
461 ss.WriteLine(" </target>");
462 ss.WriteLine();
463 }
464
465 ss.WriteLine(" <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">");
466 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />");
467 ss.WriteLine(" </target>");
468 ss.WriteLine();
469
470 ss.WriteLine(" <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">");
471 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />");
472 ss.WriteLine(" </target>");
473 ss.WriteLine();
474
475 ss.WriteLine(" <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">");
476 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />");
477 ss.WriteLine(" </target>");
478 ss.WriteLine();
479
480 ss.WriteLine(" <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">");
481 ss.WriteLine(" <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />");
482 ss.WriteLine(" </target>");
483 ss.WriteLine();
484
485 ss.WriteLine(" <target name=\"init\" description=\"\">");
486 ss.WriteLine(" <call target=\"${project.config}\" />");
487 ss.WriteLine(" <sysinfo />");
488 ss.WriteLine(" <echo message=\"Platform ${sys.os.platform}\" />");
489 ss.WriteLine(" <property name=\"build.dir\" value=\"${bin.dir}/${project.config}\" />");
490 ss.WriteLine(" </target>");
491 ss.WriteLine();
492
493 ss.WriteLine(" <target name=\"clean\" description=\"\">");
494 ss.WriteLine(" <echo message=\"Deleting all builds from all configurations\" />");
495 //ss.WriteLine(" <delete dir=\"${dist.dir}\" failonerror=\"false\" />");
496 ss.WriteLine(" <delete dir=\"${bin.dir}\" failonerror=\"false\" />");
497 ss.WriteLine(" <delete dir=\"${obj.dir}\" failonerror=\"false\" />");
498 foreach(ProjectNode project in solution.Projects)
499 {
500 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
501 ss.Write(" <nant buildfile=\"{0}\"",
502 Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build"),'/'));
503 ss.WriteLine(" target=\"clean\" />");
504 }
505 ss.WriteLine(" </target>");
506 ss.WriteLine();
507
508 ss.WriteLine(" <target name=\"build\" depends=\"init\" description=\"\">");
509
510 foreach(ProjectNode project in solution.ProjectsTableOrder)
511 {
512 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
513 ss.Write(" <nant buildfile=\"{0}\"",
514 Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build"),'/'));
515 ss.WriteLine(" target=\"build\" />");
516 }
517 ss.WriteLine(" </target>");
518 ss.WriteLine();
519
520 ss.WriteLine(" <target name=\"build-release\" depends=\"Release, init, build\" description=\"Builds in Release mode\" />");
521 ss.WriteLine();
522 ss.WriteLine(" <target name=\"build-debug\" depends=\"Debug, init, build\" description=\"Builds in Debug mode\" />");
523 ss.WriteLine();
524 //ss.WriteLine(" <target name=\"package\" depends=\"clean, doc, copyfiles, zip\" description=\"Builds in Release mode\" />");
525 ss.WriteLine(" <target name=\"package\" depends=\"clean, doc\" description=\"Builds all\" />");
526 ss.WriteLine();
527
528 ss.WriteLine(" <target name=\"doc\" depends=\"build-release\">");
529 ss.WriteLine(" <echo message=\"Generating all documentation from all builds\" />");
530 foreach (ProjectNode project in solution.Projects)
531 {
532 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
533 ss.Write(" <nant buildfile=\"{0}\"",
534 Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build"), '/'));
535 ss.WriteLine(" target=\"doc\" />");
536 }
537 ss.WriteLine(" </target>");
538 ss.WriteLine();
539 ss.WriteLine("</project>");
540 }
541
542 m_Kernel.CurrentWorkingDirectory.Pop();
543 }
544
545 private void CleanProject(ProjectNode project)
546 {
547 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name);
548 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build");
549 Helper.DeleteIfExists(projectFile);
550 }
551
552 private void CleanSolution(SolutionNode solution)
553 {
554 m_Kernel.Log.Write("Cleaning NAnt build files for", solution.Name);
555
556 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build");
557 Helper.DeleteIfExists(slnFile);
558
559 foreach(ProjectNode project in solution.Projects)
560 {
561 CleanProject(project);
562 }
563
564 m_Kernel.Log.Write("");
565 }
566
567 #endregion
568
569 #region ITarget Members
570
571 /// <summary>
572 /// Writes the specified kern.
573 /// </summary>
574 /// <param name="kern">The kern.</param>
575 public void Write(Kernel kern)
576 {
577 if( kern == null )
578 {
579 throw new ArgumentNullException("kern");
580 }
581 m_Kernel = kern;
582 foreach(SolutionNode solution in kern.Solutions)
583 {
584 WriteCombine(solution);
585 }
586 m_Kernel = null;
587 }
588
589 /// <summary>
590 /// Cleans the specified kern.
591 /// </summary>
592 /// <param name="kern">The kern.</param>
593 public virtual void Clean(Kernel kern)
594 {
595 if( kern == null )
596 {
597 throw new ArgumentNullException("kern");
598 }
599 m_Kernel = kern;
600 foreach(SolutionNode sol in kern.Solutions)
601 {
602 CleanSolution(sol);
603 }
604 m_Kernel = null;
605 }
606
607 /// <summary>
608 /// Gets the name.
609 /// </summary>
610 /// <value>The name.</value>
611 public string Name
612 {
613 get
614 {
615 return "nant";
616 }
617 }
618
619 #endregion
620 }
621}
diff --git a/Prebuild/src/Core/Targets/SharpDevelop2Target.cs b/Prebuild/src/Core/Targets/SharpDevelop2Target.cs
new file mode 100644
index 0000000..bc84b96
--- /dev/null
+++ b/Prebuild/src/Core/Targets/SharpDevelop2Target.cs
@@ -0,0 +1,90 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-27 16:49:58 -0800 (Fri, 27 Jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36
37using Prebuild.Core.Attributes;
38
39namespace Prebuild.Core.Targets
40{
41 /// <summary>
42 ///
43 /// </summary>
44 [Target("sharpdev2")]
45 public class SharpDevelop2Target : VS2005Target
46 {
47 #region Private Methods
48 private void SetSharpDevelop2()
49 {
50 this.VersionName = "SharpDevelop2";
51 }
52 #endregion
53
54 #region Public Methods
55
56 /// <summary>
57 /// Writes the specified kern.
58 /// </summary>
59 /// <param name="kern">The kern.</param>
60 public override void Write(Kernel kern)
61 {
62 SetSharpDevelop2();
63 base.Write(kern);
64 }
65
66 /// <summary>
67 /// Cleans the specified kern.
68 /// </summary>
69 /// <param name="kern">The kern.</param>
70 public override void Clean(Kernel kern)
71 {
72 SetSharpDevelop2();
73 base.Clean(kern);
74 }
75
76 /// <summary>
77 /// Gets the name.
78 /// </summary>
79 /// <value>The name.</value>
80 public override string Name
81 {
82 get
83 {
84 return "sharpdev2";
85 }
86 }
87
88 #endregion
89 }
90}
diff --git a/Prebuild/src/Core/Targets/SharpDevelopTarget.cs b/Prebuild/src/Core/Targets/SharpDevelopTarget.cs
new file mode 100644
index 0000000..c725730
--- /dev/null
+++ b/Prebuild/src/Core/Targets/SharpDevelopTarget.cs
@@ -0,0 +1,437 @@
1#region BSD License
2/*
3Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2007-02-13 21:58:03 +0100 (ti, 13 feb 2007) $
31 * $Revision: 205 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Collections.Specialized;
38using System.IO;
39using System.Text.RegularExpressions;
40using System.Reflection;
41
42using Prebuild.Core.Attributes;
43using Prebuild.Core.Interfaces;
44using Prebuild.Core.Nodes;
45using Prebuild.Core.Utilities;
46
47namespace Prebuild.Core.Targets
48{
49 /// <summary>
50 ///
51 /// </summary>
52 [Target("sharpdev")]
53 public class SharpDevelopTarget : ITarget
54 {
55 #region Fields
56
57 private Kernel m_Kernel;
58
59 #endregion
60
61 #region Private Methods
62
63 private static string PrependPath(string path)
64 {
65 string tmpPath = Helper.NormalizePath(path, '/');
66 Regex regex = new Regex(@"(\w):/(\w+)");
67 Match match = regex.Match(tmpPath);
68 if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/')
69 {
70 tmpPath = Helper.NormalizePath(tmpPath);
71 }
72 else
73 {
74 tmpPath = Helper.NormalizePath("./" + tmpPath);
75 }
76
77 return tmpPath;
78 }
79
80 private static string BuildReference(SolutionNode solution, ReferenceNode refr)
81 {
82 string ret = "<Reference type=\"";
83 if(solution.ProjectsTable.ContainsKey(refr.Name))
84 {
85 ret += "Project\" refto=\"" + refr.Name;
86 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />";
87 }
88 else
89 {
90 ProjectNode project = (ProjectNode)refr.Parent;
91 string fileRef = FindFileReference(refr.Name, project);
92
93 if(refr.Path != null || fileRef != null)
94 {
95 ret += "Assembly\" refto=\"";
96
97 string finalPath = (refr.Path != null) ? Helper.MakeFilePath(refr.Path, refr.Name, "dll") : fileRef;
98
99 ret += finalPath;
100 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />";
101 return ret;
102 }
103
104 ret += "Gac\" refto=\"";
105 try
106 {
107 //Assembly assem = Assembly.Load(refr.Name);
108 ret += refr.Name;// assem.FullName;
109 }
110 catch (System.NullReferenceException e)
111 {
112 e.ToString();
113 ret += refr.Name;
114 }
115 ret += "\" localcopy=\"" + refr.LocalCopy.ToString() + "\" />";
116 }
117
118 return ret;
119 }
120
121 private static string FindFileReference(string refName, ProjectNode project)
122 {
123 foreach(ReferencePathNode refPath in project.ReferencePaths)
124 {
125 string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll");
126
127 if(File.Exists(fullPath))
128 {
129 return fullPath;
130 }
131 }
132
133 return null;
134 }
135
136 /// <summary>
137 /// Gets the XML doc file.
138 /// </summary>
139 /// <param name="project">The project.</param>
140 /// <param name="conf">The conf.</param>
141 /// <returns></returns>
142 public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf)
143 {
144 if( conf == null )
145 {
146 throw new ArgumentNullException("conf");
147 }
148 if( project == null )
149 {
150 throw new ArgumentNullException("project");
151 }
152 string docFile = (string)conf.Options["XmlDocFile"];
153 if(docFile != null && docFile.Length == 0)//default to assembly name if not specified
154 {
155 return "False";
156 }
157 return "True";
158 }
159
160 private void WriteProject(SolutionNode solution, ProjectNode project)
161 {
162 string csComp = "Csc";
163 string netRuntime = "MsNet";
164 if(project.Runtime == ClrRuntime.Mono)
165 {
166 csComp = "Mcs";
167 netRuntime = "Mono";
168 }
169
170 string projFile = Helper.MakeFilePath(project.FullPath, project.Name, "prjx");
171 StreamWriter ss = new StreamWriter(projFile);
172
173 m_Kernel.CurrentWorkingDirectory.Push();
174 Helper.SetCurrentDir(Path.GetDirectoryName(projFile));
175
176 using(ss)
177 {
178 ss.WriteLine(
179 "<Project name=\"{0}\" standardNamespace=\"{1}\" description=\"\" newfilesearch=\"None\" enableviewstate=\"True\" version=\"1.1\" projecttype=\"C#\">",
180 project.Name,
181 project.RootNamespace
182 );
183
184 ss.WriteLine(" <Contents>");
185 foreach(string file in project.Files)
186 {
187 string buildAction = "Compile";
188 switch(project.Files.GetBuildAction(file))
189 {
190 case BuildAction.None:
191 buildAction = "Nothing";
192 break;
193
194 case BuildAction.Content:
195 buildAction = "Exclude";
196 break;
197
198 case BuildAction.EmbeddedResource:
199 buildAction = "EmbedAsResource";
200 break;
201
202 default:
203 buildAction = "Compile";
204 break;
205 }
206
207 // Sort of a hack, we try and resolve the path and make it relative, if we can.
208 string filePath = PrependPath(file);
209 ss.WriteLine(" <File name=\"{0}\" subtype=\"Code\" buildaction=\"{1}\" dependson=\"\" data=\"\" />", filePath, buildAction);
210 }
211 ss.WriteLine(" </Contents>");
212
213 ss.WriteLine(" <References>");
214 foreach(ReferenceNode refr in project.References)
215 {
216 ss.WriteLine(" {0}", BuildReference(solution, refr));
217 }
218 ss.WriteLine(" </References>");
219
220 ss.Write(" <DeploymentInformation");
221 ss.Write(" target=\"\"");
222 ss.Write(" script=\"\"");
223 ss.Write(" strategy=\"File\"");
224 ss.WriteLine(" />");
225
226 int count = 0;
227
228 ss.WriteLine(" <Configurations active=\"{0}\">", solution.ActiveConfig);
229
230 foreach(ConfigurationNode conf in project.Configurations)
231 {
232 ss.Write(" <Configuration");
233 ss.Write(" runwithwarnings=\"True\"");
234 ss.Write(" name=\"{0}\"", conf.Name);
235 ss.WriteLine(">");
236 ss.Write(" <CodeGeneration");
237 ss.Write(" runtime=\"{0}\"", netRuntime);
238 ss.Write(" compiler=\"{0}\"", csComp);
239 ss.Write(" compilerversion=\"\"");
240 ss.Write(" warninglevel=\"{0}\"", conf.Options["WarningLevel"]);
241 ss.Write(" nowarn=\"{0}\"", conf.Options["SuppressWarnings"]);
242 ss.Write(" includedebuginformation=\"{0}\"", conf.Options["DebugInformation"]);
243 ss.Write(" optimize=\"{0}\"", conf.Options["OptimizeCode"]);
244 ss.Write(" unsafecodeallowed=\"{0}\"", conf.Options["AllowUnsafe"]);
245 ss.Write(" generateoverflowchecks=\"{0}\"", conf.Options["CheckUnderflowOverflow"]);
246 ss.Write(" mainclass=\"{0}\"", project.StartupObject);
247 ss.Write(" target=\"{0}\"", project.Type);
248 ss.Write(" definesymbols=\"{0}\"", conf.Options["CompilerDefines"]);
249 ss.Write(" generatexmldocumentation=\"{0}\"", GenerateXmlDocFile(project, conf));
250 ss.Write(" win32Icon=\"{0}\"", Helper.NormalizePath(".\\" + project.AppIcon));
251 ss.Write(" noconfig=\"{0}\"", "False");
252 ss.Write(" nostdlib=\"{0}\"", conf.Options["NoStdLib"]);
253 ss.WriteLine(" />");
254
255 ss.Write(" <Execution");
256 ss.Write(" commandlineparameters=\"\"");
257 ss.Write(" consolepause=\"True\"");
258 ss.WriteLine(" />");
259
260 ss.Write(" <Output");
261 ss.Write(" directory=\".\\{0}\"", Helper.NormalizePath(conf.Options["OutputPath"].ToString()));
262 ss.Write(" assembly=\"{0}\"", project.AssemblyName);
263 ss.Write(" executeScript=\"{0}\"", conf.Options["RunScript"]);
264 if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0)
265 {
266 ss.Write(" executeBeforeBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString()));
267 }
268 else
269 {
270 ss.Write(" executeBeforeBuild=\"{0}\"", conf.Options["PreBuildEvent"]);
271 }
272 if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0)
273 {
274 ss.Write(" executeAfterBuild=\"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString()));
275 }
276 else
277 {
278 ss.Write(" executeAfterBuild=\"{0}\"", conf.Options["PostBuildEvent"]);
279 }
280 ss.Write(" executeBeforeBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]);
281 ss.Write(" executeAfterBuildArguments=\"{0}\"", conf.Options["PreBuildEventArgs"]);
282 ss.WriteLine(" />");
283 ss.WriteLine(" </Configuration>");
284
285 count++;
286 }
287 ss.WriteLine(" </Configurations>");
288 ss.WriteLine("</Project>");
289 }
290
291 m_Kernel.CurrentWorkingDirectory.Pop();
292 }
293
294 private void WriteCombine(SolutionNode solution)
295 {
296 m_Kernel.Log.Write("Creating SharpDevelop combine and project files");
297 foreach(ProjectNode project in solution.Projects)
298 {
299 if(m_Kernel.AllowProject(project.FilterGroups))
300 {
301 m_Kernel.Log.Write("...Creating project: {0}", project.Name);
302 WriteProject(solution, project);
303 }
304 }
305
306 m_Kernel.Log.Write("");
307 string combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "cmbx");
308 StreamWriter ss = new StreamWriter(combFile);
309
310 m_Kernel.CurrentWorkingDirectory.Push();
311 Helper.SetCurrentDir(Path.GetDirectoryName(combFile));
312
313 using(ss)
314 {
315 ss.WriteLine("<Combine fileversion=\"1.0\" name=\"{0}\" description=\"\">", solution.Name);
316
317 int count = 0;
318 foreach(ProjectNode project in solution.Projects)
319 {
320 if(count == 0)
321 ss.WriteLine(" <StartMode startupentry=\"{0}\" single=\"True\">", project.Name);
322
323 ss.WriteLine(" <Execute entry=\"{0}\" type=\"None\" />", project.Name);
324 count++;
325 }
326 ss.WriteLine(" </StartMode>");
327
328 ss.WriteLine(" <Entries>");
329 foreach(ProjectNode project in solution.Projects)
330 {
331 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
332 ss.WriteLine(" <Entry filename=\"{0}\" />",
333 Helper.MakeFilePath(path, project.Name, "prjx"));
334 }
335 ss.WriteLine(" </Entries>");
336
337 count = 0;
338 foreach(ConfigurationNode conf in solution.Configurations)
339 {
340 if(count == 0)
341 {
342 ss.WriteLine(" <Configurations active=\"{0}\">", conf.Name);
343 }
344
345 ss.WriteLine(" <Configuration name=\"{0}\">", conf.Name);
346 foreach(ProjectNode project in solution.Projects)
347 {
348 ss.WriteLine(" <Entry name=\"{0}\" configurationname=\"{1}\" build=\"True\" />", project.Name, conf.Name);
349 }
350 ss.WriteLine(" </Configuration>");
351
352 count++;
353 }
354 ss.WriteLine(" </Configurations>");
355 ss.WriteLine("</Combine>");
356 }
357
358 m_Kernel.CurrentWorkingDirectory.Pop();
359 }
360
361 private void CleanProject(ProjectNode project)
362 {
363 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name);
364 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "prjx");
365 Helper.DeleteIfExists(projectFile);
366 }
367
368 private void CleanSolution(SolutionNode solution)
369 {
370 m_Kernel.Log.Write("Cleaning SharpDevelop combine and project files for", solution.Name);
371
372 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "cmbx");
373 Helper.DeleteIfExists(slnFile);
374
375 foreach(ProjectNode project in solution.Projects)
376 {
377 CleanProject(project);
378 }
379
380 m_Kernel.Log.Write("");
381 }
382
383 #endregion
384
385 #region ITarget Members
386
387 /// <summary>
388 /// Writes the specified kern.
389 /// </summary>
390 /// <param name="kern">The kern.</param>
391 public void Write(Kernel kern)
392 {
393 if( kern == null )
394 {
395 throw new ArgumentNullException("kern");
396 }
397 m_Kernel = kern;
398 foreach(SolutionNode solution in kern.Solutions)
399 {
400 WriteCombine(solution);
401 }
402 m_Kernel = null;
403 }
404
405 /// <summary>
406 /// Cleans the specified kern.
407 /// </summary>
408 /// <param name="kern">The kern.</param>
409 public virtual void Clean(Kernel kern)
410 {
411 if( kern == null )
412 {
413 throw new ArgumentNullException("kern");
414 }
415 m_Kernel = kern;
416 foreach(SolutionNode sol in kern.Solutions)
417 {
418 CleanSolution(sol);
419 }
420 m_Kernel = null;
421 }
422
423 /// <summary>
424 /// Gets the name.
425 /// </summary>
426 /// <value>The name.</value>
427 public string Name
428 {
429 get
430 {
431 return "sharpdev";
432 }
433 }
434
435 #endregion
436 }
437}
diff --git a/Prebuild/src/Core/Targets/VS2002Target.cs b/Prebuild/src/Core/Targets/VS2002Target.cs
new file mode 100644
index 0000000..66216dc
--- /dev/null
+++ b/Prebuild/src/Core/Targets/VS2002Target.cs
@@ -0,0 +1,96 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36
37using Prebuild.Core.Attributes;
38
39namespace Prebuild.Core.Targets
40{
41 /// <summary>
42 ///
43 /// </summary>
44 [Target("vs2002")]
45 public class VS2002Target : VS2003Target
46 {
47 #region Private Methods
48
49 private void SetVS2002()
50 {
51 this.SolutionVersion = "7.00";
52 this.ProductVersion = "7.0.9254";
53 this.SchemaVersion = "1.0";
54 this.VersionName = "2002";
55 this.Version = VSVersion.VS70;
56 }
57
58 #endregion
59
60 #region Public Methods
61
62 /// <summary>
63 /// Writes the specified kern.
64 /// </summary>
65 /// <param name="kern">The kern.</param>
66 public override void Write(Kernel kern)
67 {
68 SetVS2002();
69 base.Write(kern);
70 }
71
72 /// <summary>
73 /// Cleans the specified kern.
74 /// </summary>
75 /// <param name="kern">The kern.</param>
76 public override void Clean(Kernel kern)
77 {
78 SetVS2002();
79 base.Clean(kern);
80 }
81
82 /// <summary>
83 /// Gets the name.
84 /// </summary>
85 /// <value>The name.</value>
86 public override string Name
87 {
88 get
89 {
90 return "vs2002";
91 }
92 }
93
94 #endregion
95 }
96}
diff --git a/Prebuild/src/Core/Targets/VS2003Target.cs b/Prebuild/src/Core/Targets/VS2003Target.cs
new file mode 100644
index 0000000..b3236a8
--- /dev/null
+++ b/Prebuild/src/Core/Targets/VS2003Target.cs
@@ -0,0 +1,633 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-09-29 21:11:40 +0200 (fr, 29 sep 2006) $
31 * $Revision: 177 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Collections.Specialized;
38using System.IO;
39
40using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces;
42using Prebuild.Core.Nodes;
43using Prebuild.Core.Utilities;
44
45namespace Prebuild.Core.Targets
46{
47 /// <summary>
48 ///
49 /// </summary>
50 public enum VSVersion
51 {
52 /// <summary>
53 ///
54 /// </summary>
55 VS70,
56 /// <summary>
57 ///
58 /// </summary>
59 VS71,
60 /// <summary>
61 ///
62 /// </summary>
63 VS80
64 }
65
66 /// <summary>
67 ///
68 /// </summary>
69 [Target("vs2003")]
70 public class VS2003Target : ITarget
71 {
72
73 #region Fields
74
75 string solutionVersion = "8.00";
76 string productVersion = "7.10.3077";
77 string schemaVersion = "2.0";
78 string versionName = "2003";
79 VSVersion version = VSVersion.VS71;
80
81 Hashtable m_Tools;
82 Kernel m_Kernel;
83
84 /// <summary>
85 /// Gets or sets the solution version.
86 /// </summary>
87 /// <value>The solution version.</value>
88 protected string SolutionVersion
89 {
90 get
91 {
92 return this.solutionVersion;
93 }
94 set
95 {
96 this.solutionVersion = value;
97 }
98 }
99 /// <summary>
100 /// Gets or sets the product version.
101 /// </summary>
102 /// <value>The product version.</value>
103 protected string ProductVersion
104 {
105 get
106 {
107 return this.productVersion;
108 }
109 set
110 {
111 this.productVersion = value;
112 }
113 }
114 /// <summary>
115 /// Gets or sets the schema version.
116 /// </summary>
117 /// <value>The schema version.</value>
118 protected string SchemaVersion
119 {
120 get
121 {
122 return this.schemaVersion;
123 }
124 set
125 {
126 this.schemaVersion = value;
127 }
128 }
129 /// <summary>
130 /// Gets or sets the name of the version.
131 /// </summary>
132 /// <value>The name of the version.</value>
133 protected string VersionName
134 {
135 get
136 {
137 return this.versionName;
138 }
139 set
140 {
141 this.versionName = value;
142 }
143 }
144 /// <summary>
145 /// Gets or sets the version.
146 /// </summary>
147 /// <value>The version.</value>
148 protected VSVersion Version
149 {
150 get
151 {
152 return this.version;
153 }
154 set
155 {
156 this.version = value;
157 }
158 }
159
160 #endregion
161
162 #region Constructors
163
164 /// <summary>
165 /// Initializes a new instance of the <see cref="VS2003Target"/> class.
166 /// </summary>
167 public VS2003Target()
168 {
169 m_Tools = new Hashtable();
170
171 m_Tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP");
172 m_Tools["VB.NET"] = new ToolInfo("VB.NET", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic");
173 }
174
175 #endregion
176
177 #region Private Methods
178
179 private string MakeRefPath(ProjectNode project)
180 {
181 string ret = "";
182 foreach(ReferencePathNode node in project.ReferencePaths)
183 {
184 try
185 {
186 string fullPath = Helper.ResolvePath(node.Path);
187 if(ret.Length < 1)
188 {
189 ret = fullPath;
190 }
191 else
192 {
193 ret += ";" + fullPath;
194 }
195 }
196 catch(ArgumentException)
197 {
198 m_Kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path);
199 }
200 }
201
202 return ret;
203 }
204
205 private void WriteProject(SolutionNode solution, ProjectNode project)
206 {
207 if(!m_Tools.ContainsKey(project.Language))
208 {
209 throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
210 }
211
212 ToolInfo toolInfo = (ToolInfo)m_Tools[project.Language];
213 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
214 StreamWriter ps = new StreamWriter(projectFile);
215
216 m_Kernel.CurrentWorkingDirectory.Push();
217 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile));
218
219 IEnumerator enumerator;
220 //ConfigurationNode scripts;
221
222 using(ps)
223 {
224 ps.WriteLine("<VisualStudioProject>");
225 ps.WriteLine(" <{0}", toolInfo.XmlTag);
226 ps.WriteLine("\t\t\t\tProjectType = \"Local\"");
227 ps.WriteLine("\t\t\t\tProductVersion = \"{0}\"", this.ProductVersion);
228 ps.WriteLine("\t\t\t\tSchemaVersion = \"{0}\"", this.SchemaVersion);
229 ps.WriteLine("\t\t\t\tProjectGuid = \"{{{0}}}\"", project.Guid.ToString().ToUpper());
230 ps.WriteLine("\t\t>");
231
232 ps.WriteLine("\t\t\t\t<Build>");
233 ps.WriteLine(" <Settings");
234 ps.WriteLine("\t\t\t\t ApplicationIcon = \"{0}\"",project.AppIcon);
235 ps.WriteLine("\t\t\t\t AssemblyKeyContainerName = \"\"");
236 ps.WriteLine("\t\t\t\t AssemblyName = \"{0}\"", project.AssemblyName);
237 ps.WriteLine("\t\t\t\t AssemblyOriginatorKeyFile = \"\"");
238 ps.WriteLine("\t\t\t\t DefaultClientScript = \"JScript\"");
239 ps.WriteLine("\t\t\t\t DefaultHTMLPageLayout = \"Grid\"");
240 ps.WriteLine("\t\t\t\t DefaultTargetSchema = \"IE50\"");
241 ps.WriteLine("\t\t\t\t DelaySign = \"false\"");
242
243 if(this.Version == VSVersion.VS70)
244 {
245 ps.WriteLine("\t\t\t\t NoStandardLibraries = \"false\"");
246 }
247
248 ps.WriteLine("\t\t\t\t OutputType = \"{0}\"", project.Type.ToString());
249
250 enumerator = project.Configurations.GetEnumerator();
251 enumerator.Reset();
252 enumerator.MoveNext();
253 foreach(ConfigurationNode conf in project.Configurations)
254 {
255 if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0)
256 {
257 ps.WriteLine("\t\t\t\t PreBuildEvent = \"{0}\"", Helper.NormalizePath(conf.Options["PreBuildEvent"].ToString()));
258 }
259 else
260 {
261 ps.WriteLine("\t\t\t\t PreBuildEvent = \"{0}\"", conf.Options["PreBuildEvent"]);
262 }
263 if (conf.Options["PostBuildEvent"] != null && conf.Options["PostBuildEvent"].ToString().Length != 0)
264 {
265 ps.WriteLine("\t\t\t\t PostBuildEvent = \"{0}\"", Helper.NormalizePath(conf.Options["PostBuildEvent"].ToString()));
266 }
267 else
268 {
269 ps.WriteLine("\t\t\t\t PostBuildEvent = \"{0}\"", conf.Options["PostBuildEvent"]);
270 }
271 if (conf.Options["RunPostBuildEvent"] == null)
272 {
273 ps.WriteLine("\t\t\t\t RunPostBuildEvent = \"{0}\"", "OnBuildSuccess");
274 }
275 else
276 {
277 ps.WriteLine("\t\t\t\t RunPostBuildEvent = \"{0}\"", conf.Options["RunPostBuildEvent"]);
278 }
279 break;
280 }
281
282 ps.WriteLine("\t\t\t\t RootNamespace = \"{0}\"", project.RootNamespace);
283 ps.WriteLine("\t\t\t\t StartupObject = \"{0}\"", project.StartupObject);
284 ps.WriteLine("\t\t >");
285
286 foreach(ConfigurationNode conf in project.Configurations)
287 {
288 ps.WriteLine("\t\t\t\t <Config");
289 ps.WriteLine("\t\t\t\t Name = \"{0}\"", conf.Name);
290 ps.WriteLine("\t\t\t\t AllowUnsafeBlocks = \"{0}\"", conf.Options["AllowUnsafe"].ToString().ToLower());
291 ps.WriteLine("\t\t\t\t BaseAddress = \"{0}\"", conf.Options["BaseAddress"]);
292 ps.WriteLine("\t\t\t\t CheckForOverflowUnderflow = \"{0}\"", conf.Options["CheckUnderflowOverflow"].ToString().ToLower());
293 ps.WriteLine("\t\t\t\t ConfigurationOverrideFile = \"\"");
294 ps.WriteLine("\t\t\t\t DefineConstants = \"{0}\"", conf.Options["CompilerDefines"]);
295 ps.WriteLine("\t\t\t\t DocumentationFile = \"{0}\"", GetXmlDocFile(project, conf));//default to the assembly name
296 ps.WriteLine("\t\t\t\t DebugSymbols = \"{0}\"", conf.Options["DebugInformation"].ToString().ToLower());
297 ps.WriteLine("\t\t\t\t FileAlignment = \"{0}\"", conf.Options["FileAlignment"]);
298 ps.WriteLine("\t\t\t\t IncrementalBuild = \"{0}\"", conf.Options["IncrementalBuild"].ToString().ToLower());
299
300 if(this.Version == VSVersion.VS71)
301 {
302 ps.WriteLine("\t\t\t\t NoStdLib = \"{0}\"", conf.Options["NoStdLib"].ToString().ToLower());
303 ps.WriteLine("\t\t\t\t NoWarn = \"{0}\"", conf.Options["SuppressWarnings"].ToString().ToLower());
304 }
305
306 ps.WriteLine("\t\t\t\t Optimize = \"{0}\"", conf.Options["OptimizeCode"].ToString().ToLower());
307 ps.WriteLine(" OutputPath = \"{0}\"",
308 Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString())));
309 ps.WriteLine(" RegisterForComInterop = \"{0}\"", conf.Options["RegisterComInterop"].ToString().ToLower());
310 ps.WriteLine(" RemoveIntegerChecks = \"{0}\"", conf.Options["RemoveIntegerChecks"].ToString().ToLower());
311 ps.WriteLine(" TreatWarningsAsErrors = \"{0}\"", conf.Options["WarningsAsErrors"].ToString().ToLower());
312 ps.WriteLine(" WarningLevel = \"{0}\"", conf.Options["WarningLevel"]);
313 ps.WriteLine(" />");
314 }
315
316 ps.WriteLine(" </Settings>");
317
318 ps.WriteLine(" <References>");
319 foreach(ReferenceNode refr in project.References)
320 {
321 ps.WriteLine(" <Reference");
322 ps.WriteLine(" Name = \"{0}\"", refr.Name);
323 ps.WriteLine(" AssemblyName = \"{0}\"", refr.Name);
324
325 if(solution.ProjectsTable.ContainsKey(refr.Name))
326 {
327 ProjectNode refProject = (ProjectNode)solution.ProjectsTable[refr.Name];
328 ps.WriteLine(" Project = \"{{{0}}}\"", refProject.Guid.ToString().ToUpper());
329 ps.WriteLine(" Package = \"{0}\"", toolInfo.Guid.ToString().ToUpper());
330 }
331 else
332 {
333 if(refr.Path != null)
334 {
335 ps.WriteLine(" HintPath = \"{0}\"", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
336 }
337
338 }
339
340 if(refr.LocalCopySpecified)
341 {
342 ps.WriteLine(" Private = \"{0}\"",refr.LocalCopy);
343 }
344
345 ps.WriteLine(" />");
346 }
347 ps.WriteLine(" </References>");
348
349 ps.WriteLine(" </Build>");
350 ps.WriteLine(" <Files>");
351
352 ps.WriteLine(" <Include>");
353
354 foreach(string file in project.Files)
355 {
356 string fileName = file.Replace(".\\", "");
357 ps.WriteLine(" <File");
358 ps.WriteLine(" RelPath = \"{0}\"", fileName);
359 ps.WriteLine(" SubType = \"{0}\"", project.Files.GetSubType(file));
360 ps.WriteLine(" BuildAction = \"{0}\"", project.Files.GetBuildAction(file));
361 ps.WriteLine(" />");
362
363 if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings)
364 {
365 ps.WriteLine(" <File");
366 ps.WriteLine(" RelPath = \"{0}\"", fileName.Substring(0, fileName.LastIndexOf('.')) + ".resx");
367 int slash = fileName.LastIndexOf('\\');
368 if (slash == -1)
369 {
370 ps.WriteLine(" DependentUpon = \"{0}\"", fileName);
371 }
372 else
373 {
374 ps.WriteLine(" DependentUpon = \"{0}\"", fileName.Substring(slash + 1, fileName.Length - slash - 1));
375 }
376 ps.WriteLine(" BuildAction = \"{0}\"", "EmbeddedResource");
377 ps.WriteLine(" />");
378
379 }
380 }
381 ps.WriteLine(" </Include>");
382
383 ps.WriteLine(" </Files>");
384 ps.WriteLine(" </{0}>", toolInfo.XmlTag);
385 ps.WriteLine("</VisualStudioProject>");
386 }
387
388 ps = new StreamWriter(projectFile + ".user");
389 using(ps)
390 {
391 ps.WriteLine("<VisualStudioProject>");
392 ps.WriteLine(" <{0}>", toolInfo.XmlTag);
393 ps.WriteLine(" <Build>");
394
395 ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project));
396 foreach(ConfigurationNode conf in project.Configurations)
397 {
398 ps.WriteLine(" <Config");
399 ps.WriteLine(" Name = \"{0}\"", conf.Name);
400 ps.WriteLine(" />");
401 }
402 ps.WriteLine(" </Settings>");
403
404 ps.WriteLine(" </Build>");
405 ps.WriteLine(" </{0}>", toolInfo.XmlTag);
406 ps.WriteLine("</VisualStudioProject>");
407 }
408
409 m_Kernel.CurrentWorkingDirectory.Pop();
410 }
411
412 /// <summary>
413 /// Gets the XML doc file.
414 /// </summary>
415 /// <param name="project">The project.</param>
416 /// <param name="conf">The conf.</param>
417 /// <returns></returns>
418 public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf)
419 {
420 if( conf == null )
421 {
422 throw new ArgumentNullException("conf");
423 }
424 if( project == null )
425 {
426 throw new ArgumentNullException("project");
427 }
428 // if(!(bool)conf.Options["GenerateXmlDocFile"]) //default to none, if the generate option is false
429 // {
430 // return string.Empty;
431 // }
432
433 //default to "AssemblyName.xml"
434 //string defaultValue = Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml";
435 //return (string)conf.Options["XmlDocFile", defaultValue];
436
437 //default to no XmlDocFile file
438 return (string)conf.Options["XmlDocFile", ""];
439 }
440
441 private void WriteSolution(SolutionNode solution)
442 {
443 m_Kernel.Log.Write("Creating Visual Studio {0} solution and project files", this.VersionName);
444
445 foreach(ProjectNode project in solution.Projects)
446 {
447 if(m_Kernel.AllowProject(project.FilterGroups))
448 {
449 m_Kernel.Log.Write("...Creating project: {0}", project.Name);
450 WriteProject(solution, project);
451 }
452 }
453
454 m_Kernel.Log.Write("");
455 string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
456 StreamWriter ss = new StreamWriter(solutionFile);
457
458 m_Kernel.CurrentWorkingDirectory.Push();
459 Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile));
460
461 using(ss)
462 {
463 ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", this.SolutionVersion);
464 foreach(ProjectNode project in solution.Projects)
465 {
466 if(!m_Tools.ContainsKey(project.Language))
467 {
468 throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
469 }
470
471 ToolInfo toolInfo = (ToolInfo)m_Tools[project.Language];
472
473 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
474 ss.WriteLine("Project(\"{0}\") = \"{1}\", \"{2}\", \"{{{3}}}\"",
475 toolInfo.Guid, project.Name, Helper.MakeFilePath(path, project.Name,
476 toolInfo.FileExtension), project.Guid.ToString().ToUpper());
477
478 ss.WriteLine("\tProjectSection(ProjectDependencies) = postProject");
479 ss.WriteLine("\tEndProjectSection");
480
481 ss.WriteLine("EndProject");
482 }
483
484 ss.WriteLine("Global");
485
486 ss.WriteLine("\tGlobalSection(SolutionConfiguration) = preSolution");
487 foreach(ConfigurationNode conf in solution.Configurations)
488 {
489 ss.WriteLine("\t\t{0} = {0}", conf.Name);
490 }
491 ss.WriteLine("\tEndGlobalSection");
492
493 ss.WriteLine("\tGlobalSection(ProjectDependencies) = postSolution");
494 foreach(ProjectNode project in solution.Projects)
495 {
496 for(int i = 0; i < project.References.Count; i++)
497 {
498 ReferenceNode refr = (ReferenceNode)project.References[i];
499 if(solution.ProjectsTable.ContainsKey(refr.Name))
500 {
501 ProjectNode refProject = (ProjectNode)solution.ProjectsTable[refr.Name];
502 ss.WriteLine("\t\t({{{0}}}).{1} = ({{{2}}})",
503 project.Guid.ToString().ToUpper()
504 , i,
505 refProject.Guid.ToString().ToUpper()
506 );
507 }
508 }
509 }
510 ss.WriteLine("\tEndGlobalSection");
511
512 ss.WriteLine("\tGlobalSection(ProjectConfiguration) = postSolution");
513 foreach(ProjectNode project in solution.Projects)
514 {
515 foreach(ConfigurationNode conf in solution.Configurations)
516 {
517 ss.WriteLine("\t\t{{{0}}}.{1}.ActiveCfg = {1}|.NET",
518 project.Guid.ToString().ToUpper(),
519 conf.Name);
520
521 ss.WriteLine("\t\t{{{0}}}.{1}.Build.0 = {1}|.NET",
522 project.Guid.ToString().ToUpper(),
523 conf.Name);
524 }
525 }
526 ss.WriteLine("\tEndGlobalSection");
527
528 if(solution.Files != null)
529 {
530 ss.WriteLine("\tGlobalSection(SolutionItems) = postSolution");
531 foreach(string file in solution.Files)
532 {
533 ss.WriteLine("\t\t{0} = {0}", file);
534 }
535 ss.WriteLine("\tEndGlobalSection");
536 }
537
538 ss.WriteLine("\tGlobalSection(ExtensibilityGlobals) = postSolution");
539 ss.WriteLine("\tEndGlobalSection");
540 ss.WriteLine("\tGlobalSection(ExtensibilityAddIns) = postSolution");
541 ss.WriteLine("\tEndGlobalSection");
542
543 ss.WriteLine("EndGlobal");
544 }
545
546 m_Kernel.CurrentWorkingDirectory.Pop();
547 }
548
549 private void CleanProject(ProjectNode project)
550 {
551 m_Kernel.Log.Write("...Cleaning project: {0}", project.Name);
552
553 ToolInfo toolInfo = (ToolInfo)m_Tools[project.Language];
554 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
555 string userFile = projectFile + ".user";
556
557 Helper.DeleteIfExists(projectFile);
558 Helper.DeleteIfExists(userFile);
559 }
560
561 private void CleanSolution(SolutionNode solution)
562 {
563 m_Kernel.Log.Write("Cleaning Visual Studio {0} solution and project files", this.VersionName, solution.Name);
564
565 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
566 string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo");
567
568 Helper.DeleteIfExists(slnFile);
569 Helper.DeleteIfExists(suoFile);
570
571 foreach(ProjectNode project in solution.Projects)
572 {
573 CleanProject(project);
574 }
575
576 m_Kernel.Log.Write("");
577 }
578
579 #endregion
580
581 #region ITarget Members
582
583 /// <summary>
584 /// Writes the specified kern.
585 /// </summary>
586 /// <param name="kern">The kern.</param>
587 public virtual void Write(Kernel kern)
588 {
589 if( kern == null )
590 {
591 throw new ArgumentNullException("kern");
592 }
593 m_Kernel = kern;
594 foreach(SolutionNode sol in m_Kernel.Solutions)
595 {
596 WriteSolution(sol);
597 }
598 m_Kernel = null;
599 }
600
601 /// <summary>
602 /// Cleans the specified kern.
603 /// </summary>
604 /// <param name="kern">The kern.</param>
605 public virtual void Clean(Kernel kern)
606 {
607 if( kern == null )
608 {
609 throw new ArgumentNullException("kern");
610 }
611 m_Kernel = kern;
612 foreach(SolutionNode sol in m_Kernel.Solutions)
613 {
614 CleanSolution(sol);
615 }
616 m_Kernel = null;
617 }
618
619 /// <summary>
620 /// Gets the name.
621 /// </summary>
622 /// <value>The name.</value>
623 public virtual string Name
624 {
625 get
626 {
627 return "vs2003";
628 }
629 }
630
631 #endregion
632 }
633}
diff --git a/Prebuild/src/Core/Targets/VS2005Target.cs b/Prebuild/src/Core/Targets/VS2005Target.cs
new file mode 100644
index 0000000..23b6116
--- /dev/null
+++ b/Prebuild/src/Core/Targets/VS2005Target.cs
@@ -0,0 +1,883 @@
1#region BSD License
2/*
3Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: robloach $
30 * $Date: 2007-02-27 19:52:34 +0100 (ti, 27 feb 2007) $
31 * $Revision: 207 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Collections.Specialized;
38using System.IO;
39
40using Prebuild.Core.Attributes;
41using Prebuild.Core.Interfaces;
42using Prebuild.Core.Nodes;
43using Prebuild.Core.Utilities;
44
45namespace Prebuild.Core.Targets
46{
47 /// <summary>
48 ///
49 /// </summary>
50 public struct ToolInfo
51 {
52 string name;
53 string guid;
54 string fileExtension;
55 string xmlTag;
56 string importProject;
57
58 /// <summary>
59 /// Gets or sets the name.
60 /// </summary>
61 /// <value>The name.</value>
62 public string Name
63 {
64 get
65 {
66 return name;
67 }
68 set
69 {
70 name = value;
71 }
72 }
73
74 /// <summary>
75 /// Gets or sets the GUID.
76 /// </summary>
77 /// <value>The GUID.</value>
78 public string Guid
79 {
80 get
81 {
82 return guid;
83 }
84 set
85 {
86 guid = value;
87 }
88 }
89
90 /// <summary>
91 /// Gets or sets the file extension.
92 /// </summary>
93 /// <value>The file extension.</value>
94 public string FileExtension
95 {
96 get
97 {
98 return fileExtension;
99 }
100 set
101 {
102 fileExtension = value;
103 }
104 }
105 /// <summary>
106 /// Gets or sets the XML tag.
107 /// </summary>
108 /// <value>The XML tag.</value>
109 public string XmlTag
110 {
111 get
112 {
113 return xmlTag;
114 }
115 set
116 {
117 xmlTag = value;
118 }
119 }
120
121 /// <summary>
122 /// Gets or sets the import project property.
123 /// </summary>
124 /// <value>The ImportProject tag.</value>
125 public string ImportProject
126 {
127 get
128 {
129 return importProject;
130 }
131 set
132 {
133 importProject = value;
134 }
135 }
136
137 /// <summary>
138 /// Initializes a new instance of the <see cref="ToolInfo"/> class.
139 /// </summary>
140 /// <param name="name">The name.</param>
141 /// <param name="guid">The GUID.</param>
142 /// <param name="fileExtension">The file extension.</param>
143 /// <param name="xml">The XML.</param>
144 /// <param name="importProject">The import project.</param>
145 public ToolInfo(string name, string guid, string fileExtension, string xml, string importProject)
146 {
147 this.name = name;
148 this.guid = guid;
149 this.fileExtension = fileExtension;
150 this.xmlTag = xml;
151 this.importProject = importProject;
152 }
153
154 /// <summary>
155 /// Initializes a new instance of the <see cref="ToolInfo"/> class.
156 /// </summary>
157 /// <param name="name">The name.</param>
158 /// <param name="guid">The GUID.</param>
159 /// <param name="fileExtension">The file extension.</param>
160 /// <param name="xml">The XML.</param>
161 public ToolInfo(string name, string guid, string fileExtension, string xml)
162 {
163 this.name = name;
164 this.guid = guid;
165 this.fileExtension = fileExtension;
166 this.xmlTag = xml;
167 this.importProject = "$(MSBuildBinPath)\\Microsoft." + xml + ".Targets";
168 }
169
170 /// <summary>
171 /// Equals operator
172 /// </summary>
173 /// <param name="obj">ToolInfo to compare</param>
174 /// <returns>true if toolInfos are equal</returns>
175 public override bool Equals(object obj)
176 {
177 if (obj == null)
178 {
179 throw new ArgumentNullException("obj");
180 }
181 if (obj.GetType() != typeof(ToolInfo))
182 return false;
183
184 ToolInfo c = (ToolInfo)obj;
185 return ((this.name == c.name) && (this.guid == c.guid) && (this.fileExtension == c.fileExtension) && (this.importProject == c.importProject));
186 }
187
188 /// <summary>
189 /// Equals operator
190 /// </summary>
191 /// <param name="c1">ToolInfo to compare</param>
192 /// <param name="c2">ToolInfo to compare</param>
193 /// <returns>True if toolInfos are equal</returns>
194 public static bool operator ==(ToolInfo c1, ToolInfo c2)
195 {
196 return ((c1.name == c2.name) && (c1.guid == c2.guid) && (c1.fileExtension == c2.fileExtension) && (c1.importProject == c2.importProject) && (c1.xmlTag == c2.xmlTag));
197 }
198
199 /// <summary>
200 /// Not equals operator
201 /// </summary>
202 /// <param name="c1">ToolInfo to compare</param>
203 /// <param name="c2">ToolInfo to compare</param>
204 /// <returns>True if toolInfos are not equal</returns>
205 public static bool operator !=(ToolInfo c1, ToolInfo c2)
206 {
207 return !(c1 == c2);
208 }
209
210 /// <summary>
211 /// Hash Code
212 /// </summary>
213 /// <returns>Hash code</returns>
214 public override int GetHashCode()
215 {
216 return name.GetHashCode() ^ guid.GetHashCode() ^ this.fileExtension.GetHashCode() ^ this.importProject.GetHashCode() ^ this.xmlTag.GetHashCode();
217
218 }
219 }
220
221 /// <summary>
222 ///
223 /// </summary>
224 [Target("vs2005")]
225 public class VS2005Target : ITarget
226 {
227 #region Inner Classes
228
229 #endregion
230
231 #region Fields
232
233 string solutionVersion = "9.00";
234 string productVersion = "8.0.50727";
235 string schemaVersion = "2.0";
236 string versionName = "Visual C# 2005";
237 VSVersion version = VSVersion.VS80;
238
239 Hashtable tools;
240 Kernel kernel;
241
242 /// <summary>
243 /// Gets or sets the solution version.
244 /// </summary>
245 /// <value>The solution version.</value>
246 protected string SolutionVersion
247 {
248 get
249 {
250 return this.solutionVersion;
251 }
252 set
253 {
254 this.solutionVersion = value;
255 }
256 }
257 /// <summary>
258 /// Gets or sets the product version.
259 /// </summary>
260 /// <value>The product version.</value>
261 protected string ProductVersion
262 {
263 get
264 {
265 return this.productVersion;
266 }
267 set
268 {
269 this.productVersion = value;
270 }
271 }
272 /// <summary>
273 /// Gets or sets the schema version.
274 /// </summary>
275 /// <value>The schema version.</value>
276 protected string SchemaVersion
277 {
278 get
279 {
280 return this.schemaVersion;
281 }
282 set
283 {
284 this.schemaVersion = value;
285 }
286 }
287 /// <summary>
288 /// Gets or sets the name of the version.
289 /// </summary>
290 /// <value>The name of the version.</value>
291 protected string VersionName
292 {
293 get
294 {
295 return this.versionName;
296 }
297 set
298 {
299 this.versionName = value;
300 }
301 }
302 /// <summary>
303 /// Gets or sets the version.
304 /// </summary>
305 /// <value>The version.</value>
306 protected VSVersion Version
307 {
308 get
309 {
310 return this.version;
311 }
312 set
313 {
314 this.version = value;
315 }
316 }
317
318 #endregion
319
320 #region Constructors
321
322 /// <summary>
323 /// Initializes a new instance of the <see cref="VS2005Target"/> class.
324 /// </summary>
325 public VS2005Target()
326 {
327 this.tools = new Hashtable();
328
329 this.tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSHARP.Targets");
330 this.tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets");
331 this.tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets");
332 }
333
334 #endregion
335
336 #region Private Methods
337
338 private string MakeRefPath(ProjectNode project)
339 {
340 string ret = "";
341 foreach (ReferencePathNode node in project.ReferencePaths)
342 {
343 try
344 {
345 string fullPath = Helper.ResolvePath(node.Path);
346 if (ret.Length < 1)
347 {
348 ret = fullPath;
349 }
350 else
351 {
352 ret += ";" + fullPath;
353 }
354 }
355 catch (ArgumentException)
356 {
357 this.kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path);
358 }
359 }
360
361 return ret;
362 }
363
364 private void WriteProject(SolutionNode solution, ProjectNode project)
365 {
366 if (!tools.ContainsKey(project.Language))
367 {
368 throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
369 }
370
371 ToolInfo toolInfo = (ToolInfo)tools[project.Language];
372 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
373 StreamWriter ps = new StreamWriter(projectFile);
374
375 kernel.CurrentWorkingDirectory.Push();
376 Helper.SetCurrentDir(Path.GetDirectoryName(projectFile));
377
378 #region Project File
379 using (ps)
380 {
381 ps.WriteLine("<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">");
382 //ps.WriteLine(" <{0}", toolInfo.XMLTag);
383 ps.WriteLine(" <PropertyGroup>");
384 ps.WriteLine(" <ProjectType>Local</ProjectType>");
385 ps.WriteLine(" <ProductVersion>{0}</ProductVersion>", this.ProductVersion);
386 ps.WriteLine(" <SchemaVersion>{0}</SchemaVersion>", this.SchemaVersion);
387 ps.WriteLine(" <ProjectGuid>{{{0}}}</ProjectGuid>", project.Guid.ToString().ToUpper());
388
389 ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>");
390 ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>");
391 //ps.WriteLine(" <Build>");
392
393 //ps.WriteLine(" <Settings");
394 ps.WriteLine(" <ApplicationIcon>{0}</ApplicationIcon>", project.AppIcon);
395 ps.WriteLine(" <AssemblyKeyContainerName>");
396 ps.WriteLine(" </AssemblyKeyContainerName>");
397 ps.WriteLine(" <AssemblyName>{0}</AssemblyName>", project.AssemblyName);
398 foreach (ConfigurationNode conf in project.Configurations)
399 {
400 if (conf.Options.KeyFile != "")
401 {
402 ps.WriteLine(" <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>", conf.Options.KeyFile);
403 ps.WriteLine(" <SignAssembly>true</SignAssembly>");
404 break;
405 }
406 }
407 ps.WriteLine(" <DefaultClientScript>JScript</DefaultClientScript>");
408 ps.WriteLine(" <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>");
409 ps.WriteLine(" <DefaultTargetSchema>IE50</DefaultTargetSchema>");
410 ps.WriteLine(" <DelaySign>false</DelaySign>");
411
412 //if(m_Version == VSVersion.VS70)
413 // ps.WriteLine(" NoStandardLibraries = \"false\"");
414
415 ps.WriteLine(" <OutputType>{0}</OutputType>", project.Type.ToString());
416 ps.WriteLine(" <AppDesignerFolder>{0}</AppDesignerFolder>", project.DesignerFolder);
417 ps.WriteLine(" <RootNamespace>{0}</RootNamespace>", project.RootNamespace);
418 ps.WriteLine(" <StartupObject>{0}</StartupObject>", project.StartupObject);
419 //ps.WriteLine(" >");
420 ps.WriteLine(" <FileUpgradeFlags>");
421 ps.WriteLine(" </FileUpgradeFlags>");
422
423 ps.WriteLine(" </PropertyGroup>");
424
425 foreach (ConfigurationNode conf in project.Configurations)
426 {
427 ps.Write(" <PropertyGroup ");
428 ps.WriteLine("Condition=\" '$(Configuration)|$(Platform)' == '{0}|AnyCPU' \">", conf.Name);
429 ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]);
430 ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]);
431 ps.WriteLine(" <CheckForOverflowUnderflow>{0}</CheckForOverflowUnderflow>", conf.Options["CheckUnderflowOverflow"]);
432 ps.WriteLine(" <ConfigurationOverrideFile>");
433 ps.WriteLine(" </ConfigurationOverrideFile>");
434 ps.WriteLine(" <DefineConstants>{0}</DefineConstants>", conf.Options["CompilerDefines"]);
435 ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", conf.Options["XmlDocFile"]);
436 ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]);
437 ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]);
438 // ps.WriteLine(" <IncrementalBuild = \"{0}\"", conf.Options["IncrementalBuild"]);
439
440 // if(m_Version == VSVersion.VS71)
441 // {
442 // ps.WriteLine(" NoStdLib = \"{0}\"", conf.Options["NoStdLib"]);
443 // ps.WriteLine(" NoWarn = \"{0}\"", conf.Options["SuppressWarnings"]);
444 // }
445
446 ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]);
447 ps.WriteLine(" <OutputPath>{0}</OutputPath>",
448 Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString())));
449 ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]);
450 ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]);
451 ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]);
452 ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]);
453 ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]);
454 ps.WriteLine(" </PropertyGroup>");
455 }
456
457 //ps.WriteLine(" </Settings>");
458
459 // Assembly References
460 ps.WriteLine(" <ItemGroup>");
461 string refPath = ((ReferencePathNode) project.ReferencePaths[0]).Path;
462
463 foreach (ReferenceNode refr in project.References)
464 {
465 if (!solution.ProjectsTable.ContainsKey(refr.Name))
466 {
467 ps.Write(" <Reference");
468 ps.Write(" Include=\"");
469 ps.Write(refr.Name);
470
471 ps.WriteLine("\" >");
472
473 string path;
474
475 if( refr.Name.EndsWith(".dll", StringComparison.InvariantCultureIgnoreCase ))
476 {
477 path = Helper.NormalizePath(Path.Combine( refPath, refr.Name), '\\');
478 }
479 else
480 {
481 path = refr.Name + ".dll";
482 }
483
484 // TODO: Allow reference to *.exe files
485 ps.WriteLine(" <HintPath>{0}</HintPath>", path );
486 ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy);
487 ps.WriteLine(" </Reference>");
488 }
489 }
490 ps.WriteLine(" </ItemGroup>");
491
492 //Project References
493 ps.WriteLine(" <ItemGroup>");
494 foreach (ReferenceNode refr in project.References)
495 {
496 if (solution.ProjectsTable.ContainsKey(refr.Name))
497 {
498 ProjectNode refProject = (ProjectNode)solution.ProjectsTable[refr.Name];
499 // TODO: Allow reference to visual basic projects
500 string path =
501 Helper.MakePathRelativeTo(project.FullPath,
502 Helper.MakeFilePath(refProject.FullPath, refProject.Name, "csproj"));
503 ps.WriteLine(" <ProjectReference Include=\"{0}\">", path );
504 //<ProjectReference Include="..\..\RealmForge\Utility\RealmForge.Utility.csproj">
505 ps.WriteLine(" <Name>{0}</Name>", refProject.Name);
506 // <Name>RealmForge.Utility</Name>
507 ps.WriteLine(" <Project>{{{0}}}</Project>", refProject.Guid.ToString().ToUpper());
508 // <Project>{6880D1D3-69EE-461B-B841-5319845B20D3}</Project>
509 ps.WriteLine(" <Package>{0}</Package>", toolInfo.Guid.ToString().ToUpper());
510 // <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
511 ps.WriteLine("\t\t\t<Private>{0}</Private>", refr.LocalCopy);
512 ps.WriteLine(" </ProjectReference>");
513 //</ProjectReference>
514 }
515 else
516 {
517 }
518 }
519 ps.WriteLine(" </ItemGroup>");
520
521 // ps.WriteLine(" </Build>");
522 ps.WriteLine(" <ItemGroup>");
523
524 // ps.WriteLine(" <Include>");
525 ArrayList list = new ArrayList();
526 foreach (string file in project.Files)
527 {
528 // if (file == "Properties\\Bind.Designer.cs")
529 // {
530 // Console.WriteLine("Wait a minute!");
531 // Console.WriteLine(project.Files.GetSubType(file).ToString());
532 // }
533
534 if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings && project.Files.GetSubType(file) != SubType.Designer)
535 {
536 ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
537
538 int slash = file.LastIndexOf('\\');
539 if (slash == -1)
540 {
541 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", file);
542 }
543 else
544 {
545 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", file.Substring(slash + 1, file.Length - slash - 1));
546 }
547 ps.WriteLine(" <SubType>Designer</SubType>");
548 ps.WriteLine(" </EmbeddedResource>");
549 //
550 }
551
552 if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) == SubType.Designer)
553 {
554 ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
555 ps.WriteLine(" <SubType>" + project.Files.GetSubType(file) + "</SubType>");
556 ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>");
557 ps.WriteLine(" <LastGenOutput>Resources.Designer.cs</LastGenOutput>");
558 ps.WriteLine(" </EmbeddedResource>");
559 ps.WriteLine(" <Compile Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs");
560 ps.WriteLine(" <AutoGen>True</AutoGen>");
561 ps.WriteLine(" <DesignTime>True</DesignTime>");
562 ps.WriteLine(" <DependentUpon>Resources.resx</DependentUpon>");
563 ps.WriteLine(" </Compile>");
564 list.Add(file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs");
565 }
566 if (project.Files.GetSubType(file).ToString() == "Settings")
567 {
568 //Console.WriteLine("File: " + file);
569 //Console.WriteLine("Last index: " + file.LastIndexOf('.'));
570 //Console.WriteLine("Length: " + file.Length);
571 ps.Write(" <{0} ", project.Files.GetBuildAction(file));
572 ps.WriteLine("Include=\"{0}\">", file);
573 int slash = file.LastIndexOf('\\');
574 string fileName = file.Substring(slash + 1, file.Length - slash - 1);
575 if (project.Files.GetBuildAction(file) == BuildAction.None)
576 {
577 ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>");
578
579 //Console.WriteLine("FileName: " + fileName);
580 //Console.WriteLine("FileNameMain: " + fileName.Substring(0, fileName.LastIndexOf('.')));
581 //Console.WriteLine("FileNameExt: " + fileName.Substring(fileName.LastIndexOf('.'), fileName.Length - fileName.LastIndexOf('.')));
582 if (slash == -1)
583 {
584 ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
585 }
586 else
587 {
588 ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
589 }
590 }
591 else
592 {
593 ps.WriteLine(" <SubType>Code</SubType>");
594 ps.WriteLine(" <AutoGen>True</AutoGen>");
595 ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
596 string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.'));
597 string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.'));
598 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", fileNameShorter + ".settings");
599 }
600 ps.WriteLine(" </{0}>", project.Files.GetBuildAction(file));
601 }
602 else if (project.Files.GetSubType(file) != SubType.Designer)
603 {
604 if (!list.Contains(file))
605 {
606 ps.Write(" <{0} ", project.Files.GetBuildAction(file));
607 ps.WriteLine("Include=\"{0}\">", file);
608
609
610 if (file.Contains("Designer.cs"))
611 {
612 ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", file.Substring(0, file.IndexOf(".Designer.cs")) + ".cs");
613 }
614
615 if (project.Files.GetIsLink(file))
616 {
617 ps.WriteLine(" <Link>{0}</Link>", Path.GetFileName(file));
618 }
619 else if (project.Files.GetBuildAction(file) != BuildAction.None)
620 {
621 if (project.Files.GetBuildAction(file) != BuildAction.EmbeddedResource)
622 {
623 ps.WriteLine(" <SubType>{0}</SubType>", project.Files.GetSubType(file));
624 }
625 }
626 if (project.Files.GetCopyToOutput(file) != CopyToOutput.Never)
627 {
628 ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(file));
629 }
630
631 ps.WriteLine(" </{0}>", project.Files.GetBuildAction(file));
632 }
633 }
634 }
635 // ps.WriteLine(" </Include>");
636
637 ps.WriteLine(" </ItemGroup>");
638 ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />");
639 ps.WriteLine(" <PropertyGroup>");
640 ps.WriteLine(" <PreBuildEvent>");
641 ps.WriteLine(" </PreBuildEvent>");
642 ps.WriteLine(" <PostBuildEvent>");
643 ps.WriteLine(" </PostBuildEvent>");
644 ps.WriteLine(" </PropertyGroup>");
645 // ps.WriteLine(" </{0}>", toolInfo.XMLTag);
646 ps.WriteLine("</Project>");
647 }
648 #endregion
649
650 #region User File
651
652 ps = new StreamWriter(projectFile + ".user");
653 using (ps)
654 {
655 ps.WriteLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">");
656 //ps.WriteLine( "<VisualStudioProject>" );
657 //ps.WriteLine(" <{0}>", toolInfo.XMLTag);
658 //ps.WriteLine(" <Build>");
659 ps.WriteLine(" <PropertyGroup>");
660 //ps.WriteLine(" <Settings ReferencePath=\"{0}\">", MakeRefPath(project));
661
662
663 ps.WriteLine(" <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>");
664 ps.WriteLine(" <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>");
665
666 if (projectFile.Contains( "OpenSim.csproj" ))
667 {
668 ps.WriteLine(" <StartArguments>-loginserver -sandbox -accounts</StartArguments>");
669 }
670
671 ps.WriteLine(" <ReferencePath>{0}</ReferencePath>", MakeRefPath(project));
672 ps.WriteLine(" <LastOpenVersion>{0}</LastOpenVersion>", this.ProductVersion);
673 ps.WriteLine(" <ProjectView>ProjectFiles</ProjectView>");
674 ps.WriteLine(" <ProjectTrust>0</ProjectTrust>");
675 ps.WriteLine(" </PropertyGroup>");
676 foreach (ConfigurationNode conf in project.Configurations)
677 {
678 ps.Write(" <PropertyGroup");
679 ps.Write(" Condition = \" '$(Configuration)|$(Platform)' == '{0}|AnyCPU' \"", conf.Name);
680 ps.WriteLine(" />");
681 }
682
683 ps.WriteLine("</Project>");
684 }
685 #endregion
686
687 kernel.CurrentWorkingDirectory.Pop();
688 }
689
690 private void WriteSolution(SolutionNode solution)
691 {
692 kernel.Log.Write("Creating {0} solution and project files", this.VersionName);
693
694 foreach (ProjectNode project in solution.Projects)
695 {
696 kernel.Log.Write("...Creating project: {0}", project.Name);
697 WriteProject(solution, project);
698 }
699
700 kernel.Log.Write("");
701 string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
702 StreamWriter ss = new StreamWriter(solutionFile);
703
704 kernel.CurrentWorkingDirectory.Push();
705 Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile));
706
707 using (ss)
708 {
709 ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", this.SolutionVersion);
710 ss.WriteLine("# Visual Studio 2005");
711 foreach (ProjectNode project in solution.Projects)
712 {
713 if (!tools.ContainsKey(project.Language))
714 {
715 throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
716 }
717
718 ToolInfo toolInfo = (ToolInfo)tools[project.Language];
719
720 string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
721 ss.WriteLine("Project(\"{0}\") = \"{1}\", \"{2}\", \"{{{3}}}\"",
722 toolInfo.Guid, project.Name, Helper.MakeFilePath(path, project.Name,
723 toolInfo.FileExtension), project.Guid.ToString().ToUpper());
724
725 //ss.WriteLine(" ProjectSection(ProjectDependencies) = postProject");
726 //ss.WriteLine(" EndProjectSection");
727
728 ss.WriteLine("EndProject");
729 }
730
731 if (solution.Files != null)
732 {
733 ss.WriteLine("Project(\"{0}\") = \"Solution Items\", \"Solution Items\", \"{1}\"", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", "{468F1D07-AD17-4CC3-ABD0-2CA268E4E1A6}");
734 ss.WriteLine("\tProjectSection(SolutionItems) = preProject");
735 foreach (string file in solution.Files)
736 ss.WriteLine("\t\t{0} = {0}", file);
737 ss.WriteLine("\tEndProjectSection");
738 ss.WriteLine("EndProject");
739 }
740
741 ss.WriteLine("Global");
742
743 ss.WriteLine(" GlobalSection(SolutionConfigurationPlatforms) = preSolution");
744 foreach (ConfigurationNode conf in solution.Configurations)
745 {
746 ss.WriteLine(" {0}|Any CPU = {0}|Any CPU", conf.Name);
747 }
748 ss.WriteLine(" EndGlobalSection");
749
750 if (solution.Projects.Count > 1)
751 {
752 ss.WriteLine(" GlobalSection(ProjectDependencies) = postSolution");
753 }
754 foreach (ProjectNode project in solution.Projects)
755 {
756 for (int i = 0; i < project.References.Count; i++)
757 {
758 ReferenceNode refr = (ReferenceNode)project.References[i];
759 if (solution.ProjectsTable.ContainsKey(refr.Name))
760 {
761 ProjectNode refProject = (ProjectNode)solution.ProjectsTable[refr.Name];
762 ss.WriteLine(" ({{{0}}}).{1} = ({{{2}}})",
763 project.Guid.ToString().ToUpper()
764 , i,
765 refProject.Guid.ToString().ToUpper()
766 );
767 }
768 }
769 }
770 if (solution.Projects.Count > 1)
771 {
772 ss.WriteLine(" EndGlobalSection");
773 }
774 ss.WriteLine(" GlobalSection(ProjectConfigurationPlatforms) = postSolution");
775 foreach (ProjectNode project in solution.Projects)
776 {
777 foreach (ConfigurationNode conf in solution.Configurations)
778 {
779 ss.WriteLine(" {{{0}}}.{1}|Any CPU.ActiveCfg = {1}|Any CPU",
780 project.Guid.ToString().ToUpper(),
781 conf.Name);
782
783 ss.WriteLine(" {{{0}}}.{1}|Any CPU.Build.0 = {1}|Any CPU",
784 project.Guid.ToString().ToUpper(),
785 conf.Name);
786 }
787 }
788 ss.WriteLine(" EndGlobalSection");
789 ss.WriteLine(" GlobalSection(SolutionProperties) = preSolution");
790 ss.WriteLine(" HideSolutionNode = FALSE");
791 ss.WriteLine(" EndGlobalSection");
792
793 ss.WriteLine("EndGlobal");
794 }
795
796 kernel.CurrentWorkingDirectory.Pop();
797 }
798
799 private void CleanProject(ProjectNode project)
800 {
801 kernel.Log.Write("...Cleaning project: {0}", project.Name);
802
803 ToolInfo toolInfo = (ToolInfo)tools[project.Language];
804 string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension);
805 string userFile = projectFile + ".user";
806
807 Helper.DeleteIfExists(projectFile);
808 Helper.DeleteIfExists(userFile);
809 }
810
811 private void CleanSolution(SolutionNode solution)
812 {
813 kernel.Log.Write("Cleaning {0} solution and project files", this.VersionName, solution.Name);
814
815 string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
816 string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo");
817
818 Helper.DeleteIfExists(slnFile);
819 Helper.DeleteIfExists(suoFile);
820
821 foreach (ProjectNode project in solution.Projects)
822 {
823 CleanProject(project);
824 }
825
826 kernel.Log.Write("");
827 }
828
829 #endregion
830
831 #region ITarget Members
832
833 /// <summary>
834 /// Writes the specified kern.
835 /// </summary>
836 /// <param name="kern">The kern.</param>
837 public virtual void Write(Kernel kern)
838 {
839 if (kern == null)
840 {
841 throw new ArgumentNullException("kern");
842 }
843 kernel = kern;
844 foreach (SolutionNode sol in kernel.Solutions)
845 {
846 WriteSolution(sol);
847 }
848 kernel = null;
849 }
850
851 /// <summary>
852 /// Cleans the specified kern.
853 /// </summary>
854 /// <param name="kern">The kern.</param>
855 public virtual void Clean(Kernel kern)
856 {
857 if (kern == null)
858 {
859 throw new ArgumentNullException("kern");
860 }
861 kernel = kern;
862 foreach (SolutionNode sol in kernel.Solutions)
863 {
864 CleanSolution(sol);
865 }
866 kernel = null;
867 }
868
869 /// <summary>
870 /// Gets the name.
871 /// </summary>
872 /// <value>The name.</value>
873 public virtual string Name
874 {
875 get
876 {
877 return "vs2005";
878 }
879 }
880
881 #endregion
882 }
883}
diff --git a/Prebuild/src/Core/UnknownLanguageException.cs b/Prebuild/src/Core/UnknownLanguageException.cs
new file mode 100644
index 0000000..cbd1dc1
--- /dev/null
+++ b/Prebuild/src/Core/UnknownLanguageException.cs
@@ -0,0 +1,63 @@
1/*
2 * $RCSfile$
3 * Copyright (C) 2004, 2005 David Hudson (jendave@yahoo.com)
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20using System;
21using System.Runtime.Serialization;
22
23namespace Prebuild.Core
24{
25 /// <summary>
26 /// </summary>
27 [Serializable()]
28 public class UnknownLanguageException : Exception
29 {
30 /// <summary>
31 /// Basic exception.
32 /// </summary>
33 public UnknownLanguageException()
34 {
35 }
36
37 /// <summary>
38 /// Exception with specified string
39 /// </summary>
40 /// <param name="message">Exception message</param>
41 public UnknownLanguageException(string message): base(message)
42 {
43 }
44
45 /// <summary>
46 ///
47 /// </summary>
48 /// <param name="message"></param>
49 /// <param name="exception"></param>
50 public UnknownLanguageException(string message, Exception exception) : base(message, exception)
51 {
52 }
53
54 /// <summary>
55 ///
56 /// </summary>
57 /// <param name="info"></param>
58 /// <param name="context"></param>
59 protected UnknownLanguageException(SerializationInfo info, StreamingContext context) : base( info, context )
60 {
61 }
62 }
63}
diff --git a/Prebuild/src/Core/Utilities/CommandLineCollection.cs b/Prebuild/src/Core/Utilities/CommandLineCollection.cs
new file mode 100644
index 0000000..496731f
--- /dev/null
+++ b/Prebuild/src/Core/Utilities/CommandLineCollection.cs
@@ -0,0 +1,162 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: robloach $
30 * $Date: 2006-09-26 00:30:53 +0200 (ti, 26 sep 2006) $
31 * $Revision: 165 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Collections.Specialized;
38using System.Diagnostics;
39
40namespace Prebuild.Core.Utilities
41{
42 /// <summary>
43 /// The CommandLine class parses and interprets the command-line arguments passed to
44 /// prebuild.
45 /// </summary>
46 public class CommandLineCollection
47 {
48 #region Fields
49
50 // The raw OS arguments
51 private string[] m_RawArgs;
52
53 // Command-line argument storage
54 private Hashtable m_Arguments;
55
56 #endregion
57
58 #region Constructors
59
60 /// <summary>
61 /// Create a new CommandLine instance and set some internal variables.
62 /// </summary>
63 public CommandLineCollection(string[] args)
64 {
65 m_RawArgs = args;
66 m_Arguments = new Hashtable();
67
68 Parse();
69 }
70
71 #endregion
72
73 #region Private Methods
74
75 private void Parse()
76 {
77 if(m_RawArgs.Length < 1)
78 return;
79
80 int idx = 0;
81 string arg = null, lastArg = null;
82
83 while(idx <m_RawArgs.Length)
84 {
85 arg = m_RawArgs[idx];
86
87 if(arg.Length > 2 && arg[0] == '/')
88 {
89 arg = arg.Substring(1);
90 lastArg = arg;
91 m_Arguments[arg] = "";
92 }
93 else
94 {
95 if(lastArg != null)
96 {
97 m_Arguments[lastArg] = arg;
98 lastArg = null;
99 }
100 }
101
102 idx++;
103 }
104 }
105
106 #endregion
107
108 #region Public Methods
109
110 /// <summary>
111 /// Wases the passed.
112 /// </summary>
113 /// <param name="arg">The arg.</param>
114 /// <returns></returns>
115 public bool WasPassed(string arg)
116 {
117 return (m_Arguments.ContainsKey(arg));
118 }
119
120 #endregion
121
122 #region Properties
123
124 /// <summary>
125 /// Gets the parameter associated with the command line option
126 /// </summary>
127 /// <remarks>Returns null if option was not specified,
128 /// null string if no parameter was specified, and the value if a parameter was specified</remarks>
129 public string this[string index]
130 {
131 get
132 {
133 if(m_Arguments.ContainsKey(index))
134 {
135 return (string)(m_Arguments[index]);
136 }
137 else
138 {
139 return null;
140 }
141 }
142 }
143
144 #endregion
145
146 #region IEnumerable Members
147
148 /// <summary>
149 /// Returns an enumerator that can iterate through a collection.
150 /// </summary>
151 /// <returns>
152 /// An <see cref="T:System.Collections.IDictionaryEnumerator"/>
153 /// that can be used to iterate through the collection.
154 /// </returns>
155 public IDictionaryEnumerator GetEnumerator()
156 {
157 return m_Arguments.GetEnumerator();
158 }
159
160 #endregion
161 }
162}
diff --git a/Prebuild/src/Core/Utilities/CurrentDirectory.cs b/Prebuild/src/Core/Utilities/CurrentDirectory.cs
new file mode 100644
index 0000000..a76d844
--- /dev/null
+++ b/Prebuild/src/Core/Utilities/CurrentDirectory.cs
@@ -0,0 +1,89 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37
38namespace Prebuild.Core.Utilities
39{
40 /// <summary>
41 ///
42 /// </summary>
43 public class CurrentDirectory
44 {
45 #region Fields
46
47 private Stack m_Stack;
48
49 #endregion
50
51 #region Constructors
52
53 /// <summary>
54 /// Initializes a new instance of the <see cref="CurrentDirectory"/> class.
55 /// </summary>
56 public CurrentDirectory()
57 {
58 m_Stack = new Stack();
59 }
60
61 #endregion
62
63 #region Public Methods
64
65 /// <summary>
66 /// Pushes this instance.
67 /// </summary>
68 public void Push()
69 {
70 m_Stack.Push(Environment.CurrentDirectory);
71 }
72
73 /// <summary>
74 /// Pops this instance.
75 /// </summary>
76 public void Pop()
77 {
78 if(m_Stack.Count < 1)
79 {
80 return;
81 }
82
83 string cwd = (string)m_Stack.Pop();
84 Helper.SetCurrentDir(cwd);
85 }
86
87 #endregion
88 }
89}
diff --git a/Prebuild/src/Core/Utilities/Helper.cs b/Prebuild/src/Core/Utilities/Helper.cs
new file mode 100644
index 0000000..33c9618
--- /dev/null
+++ b/Prebuild/src/Core/Utilities/Helper.cs
@@ -0,0 +1,661 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2007-02-13 21:58:03 +0100 (ti, 13 feb 2007) $
31 * $Revision: 205 $
32 */
33#endregion
34
35using System;
36using System.Collections;
37using System.Diagnostics;
38using System.IO;
39using System.Runtime.InteropServices;
40using System.Text.RegularExpressions;
41using System.Collections.Specialized;
42using System.Xml;
43using Prebuild.Core.Nodes;
44
45namespace Prebuild.Core.Utilities
46{
47 /// <summary>
48 ///
49 /// </summary>
50 public class Helper
51 {
52 #region Fields
53
54 private static Stack dirStack;
55 private static Regex varRegex;
56 static bool checkForOSVariables;
57
58 /// <summary>
59 ///
60 /// </summary>
61 public static bool CheckForOSVariables
62 {
63 get
64 {
65 return checkForOSVariables;
66 }
67 set
68 {
69 checkForOSVariables = value;
70 }
71 }
72
73 #endregion
74
75 #region Constructors
76
77 /// <summary>
78 /// Initializes the <see cref="Helper"/> class.
79 /// </summary>
80 static Helper()
81 {
82 dirStack = new Stack();
83 //m_VarRegex = new Regex(@"\${(?<var>[\w|_]+)}");
84 }
85
86 #endregion
87
88 #region Properties
89
90 /// <summary>
91 ///
92 /// </summary>
93 public static Stack DirStack
94 {
95 get
96 {
97 return dirStack;
98 }
99 }
100
101 /// <summary>
102 ///
103 /// </summary>
104 public static Regex VarRegex
105 {
106 get
107 {
108 return varRegex;
109 }
110 set
111 {
112 varRegex = value;
113 }
114 }
115
116 #endregion
117
118 #region Public Methods
119
120 #region String Parsing
121 #region Inner Classes and Delegates
122 /// <summary>
123 ///
124 /// </summary>
125 public delegate string StringLookup(string key);
126
127 #endregion
128
129 /// <summary>
130 /// Gets a collection of StringLocationPair objects that represent the matches
131 /// </summary>
132 /// <param name="target">The target.</param>
133 /// <param name="beforeGroup">The before group.</param>
134 /// <param name="afterGroup">The after group.</param>
135 /// <param name="includeDelimitersInSubstrings">if set to <c>true</c> [include delimiters in substrings].</param>
136 /// <returns></returns>
137 public static StringCollection FindGroups(string target, string beforeGroup, string afterGroup, bool includeDelimitersInSubstrings)
138 {
139 if( beforeGroup == null )
140 {
141 throw new ArgumentNullException("beforeGroup");
142 }
143 if( afterGroup == null )
144 {
145 throw new ArgumentNullException("afterGroup");
146 }
147 StringCollection results = new StringCollection();
148 if(target == null || target.Length == 0)
149 {
150 return results;
151 }
152
153 int beforeMod = 0;
154 int afterMod = 0;
155 if(includeDelimitersInSubstrings)
156 {
157 //be sure to not exlude the delims
158 beforeMod = beforeGroup.Length;
159 afterMod = afterGroup.Length;
160 }
161 int startIndex = 0;
162 while((startIndex = target.IndexOf(beforeGroup,startIndex)) != -1) {
163 int endIndex = target.IndexOf(afterGroup,startIndex);//the index of the char after it
164 if(endIndex == -1)
165 {
166 break;
167 }
168 int length = endIndex - startIndex - beforeGroup.Length;//move to the first char in the string
169 string substring = substring = target.Substring(startIndex + beforeGroup.Length - beforeMod,
170 length - afterMod);
171
172 results.Add(substring);
173 //results.Add(new StringLocationPair(substring,startIndex));
174 startIndex = endIndex + 1;
175 //the Interpolate*() methods will not work if expressions are expandded inside expression due to an optimization
176 //so start after endIndex
177
178 }
179 return results;
180 }
181
182 /// <summary>
183 /// Replaces the groups.
184 /// </summary>
185 /// <param name="target">The target.</param>
186 /// <param name="beforeGroup">The before group.</param>
187 /// <param name="afterGroup">The after group.</param>
188 /// <param name="lookup">The lookup.</param>
189 /// <returns></returns>
190 public static string ReplaceGroups(string target, string beforeGroup, string afterGroup, StringLookup lookup) {
191 if( target == null )
192 {
193 throw new ArgumentNullException("target");
194 }
195 //int targetLength = target.Length;
196 StringCollection strings = FindGroups(target,beforeGroup,afterGroup,false);
197 if( lookup == null )
198 {
199 throw new ArgumentNullException("lookup");
200 }
201 foreach(string substring in strings)
202 {
203 target = target.Replace(beforeGroup + substring + afterGroup, lookup(substring) );
204 }
205 return target;
206 }
207
208 /// <summary>
209 /// Replaces ${var} statements in a string with the corresonding values as detirmined by the lookup delegate
210 /// </summary>
211 /// <param name="target">The target.</param>
212 /// <param name="lookup">The lookup.</param>
213 /// <returns></returns>
214 public static string InterpolateForVariables(string target, StringLookup lookup)
215 {
216 return ReplaceGroups(target, "${" , "}" , lookup);
217 }
218
219 /// <summary>
220 /// Replaces ${var} statements in a string with the corresonding environment variable with name var
221 /// </summary>
222 /// <param name="target"></param>
223 /// <returns></returns>
224 public static string InterpolateForEnvironmentVariables(string target)
225 {
226 return InterpolateForVariables(target, new StringLookup(Environment.GetEnvironmentVariable));
227 }
228
229 #endregion
230
231 /// <summary>
232 /// Translates the value.
233 /// </summary>
234 /// <param name="translateType">Type of the translate.</param>
235 /// <param name="translationItem">The translation item.</param>
236 /// <returns></returns>
237 public static object TranslateValue(Type translateType, string translationItem)
238 {
239 if(translationItem == null)
240 {
241 return null;
242 }
243
244 try
245 {
246 string lowerVal = translationItem.ToLower();
247 if(translateType == typeof(bool))
248 {
249 return (lowerVal == "true" || lowerVal == "1" || lowerVal == "y" || lowerVal == "yes" || lowerVal == "on");
250 }
251 else if(translateType == typeof(int))
252 {
253 return (Int32.Parse(translationItem));
254 }
255 else
256 {
257 return translationItem;
258 }
259 }
260 catch(FormatException)
261 {
262 return null;
263 }
264 }
265
266 /// <summary>
267 /// Deletes if exists.
268 /// </summary>
269 /// <param name="file">The file.</param>
270 /// <returns></returns>
271 public static bool DeleteIfExists(string file)
272 {
273 string resFile = null;
274 try
275 {
276 resFile = ResolvePath(file);
277 }
278 catch(ArgumentException)
279 {
280 return false;
281 }
282
283 if(!File.Exists(resFile))
284 {
285 return false;
286 }
287
288 File.Delete(resFile);
289 return true;
290 }
291
292 // This little gem was taken from the NeL source, thanks guys!
293 /// <summary>
294 /// Makes a relative path
295 /// </summary>
296 /// <param name="startPath">Path to start from</param>
297 /// <param name="endPath">Path to end at</param>
298 /// <returns>Path that will get from startPath to endPath</returns>
299 public static string MakePathRelativeTo(string startPath, string endPath)
300 {
301 string tmp = NormalizePath(startPath, '/');
302 string src = NormalizePath(endPath, '/');
303 string prefix = "";
304
305 while(true)
306 {
307 if((String.Compare(tmp, 0, src, 0, tmp.Length) == 0))
308 {
309 string ret;
310 int size = tmp.Length;
311 if(size == src.Length)
312 {
313 return "./";
314 }
315 if ((src.Length > tmp.Length) && src[tmp.Length-1] != '/' && src[tmp.Length-1] != '\\')
316 {
317 }
318 else
319 {
320 ret = prefix + endPath.Substring(size, endPath.Length - size);
321 ret = ret.Trim();
322 if(ret[0] == '/' || ret[0] == '\\')
323 {
324 ret = "." + ret;
325 }
326
327 return NormalizePath(ret);
328 }
329
330 }
331
332 if(tmp.Length < 2)
333 {
334 break;
335 }
336
337 int lastPos = tmp.LastIndexOf('/', tmp.Length - 2);
338 int prevPos = tmp.IndexOf('/');
339
340 if((lastPos == prevPos) || (lastPos == -1))
341 {
342 break;
343 }
344
345 tmp = tmp.Substring(0, lastPos + 1);
346 prefix += "../";
347 }
348
349 return endPath;
350 }
351
352 /// <summary>
353 /// Resolves the path.
354 /// </summary>
355 /// <param name="path">The path.</param>
356 /// <returns></returns>
357 public static string ResolvePath(string path)
358 {
359 string tmpPath = NormalizePath(path);
360 if(tmpPath.Length < 1)
361 {
362 tmpPath = ".";
363 }
364
365 tmpPath = Path.GetFullPath(tmpPath);
366 if(!File.Exists(tmpPath) && !Directory.Exists(tmpPath))
367 {
368 throw new ArgumentException("Path could not be resolved: " + tmpPath);
369 }
370
371 return tmpPath;
372 }
373
374 /// <summary>
375 /// Normalizes the path.
376 /// </summary>
377 /// <param name="path">The path.</param>
378 /// <param name="separatorCharacter">The separator character.</param>
379 /// <returns></returns>
380 public static string NormalizePath(string path, char separatorCharacter)
381 {
382 if(path == null || path == "" || path.Length < 1)
383 {
384 return "";
385 }
386
387 string tmpPath = path.Replace('\\', '/');
388 tmpPath = tmpPath.Replace('/', separatorCharacter);
389 return tmpPath;
390 }
391
392 /// <summary>
393 /// Normalizes the path.
394 /// </summary>
395 /// <param name="path">The path.</param>
396 /// <returns></returns>
397 public static string NormalizePath(string path)
398 {
399 return NormalizePath(path, Path.DirectorySeparatorChar);
400 }
401
402 /// <summary>
403 /// Ends the path.
404 /// </summary>
405 /// <param name="path">The path.</param>
406 /// <param name="separatorCharacter">The separator character.</param>
407 /// <returns></returns>
408 public static string EndPath(string path, char separatorCharacter)
409 {
410 if(path == null || path == "" || path.Length < 1)
411 {
412 return "";
413 }
414
415 if(!path.EndsWith(separatorCharacter.ToString()))
416 {
417 return (path + separatorCharacter);
418 }
419
420 return path;
421 }
422
423 /// <summary>
424 /// Ends the path.
425 /// </summary>
426 /// <param name="path">The path.</param>
427 /// <returns></returns>
428 public static string EndPath(string path)
429 {
430 return EndPath(path, Path.DirectorySeparatorChar);
431 }
432
433 /// <summary>
434 /// Makes the file path.
435 /// </summary>
436 /// <param name="path">The path.</param>
437 /// <param name="name">The name.</param>
438 /// <param name="ext">The ext.</param>
439 /// <returns></returns>
440 public static string MakeFilePath(string path, string name, string ext)
441 {
442 string ret = EndPath(NormalizePath(path));
443
444 if( name == null )
445 {
446 throw new ArgumentNullException("name");
447 }
448
449 ret += name;
450 if(!name.EndsWith("." + ext))
451 {
452 ret += "." + ext;
453 }
454
455 //foreach(char c in Path.GetInvalidPathChars())
456 //{
457 // ret = ret.Replace(c, '_');
458 //}
459
460 return ret;
461 }
462
463 /// <summary>
464 /// Makes the file path.
465 /// </summary>
466 /// <param name="path">The path.</param>
467 /// <param name="name">The name.</param>
468 /// <returns></returns>
469 public static string MakeFilePath(string path, string name)
470 {
471 string ret = EndPath(NormalizePath(path));
472
473 if( name == null )
474 {
475 throw new ArgumentNullException("name");
476 }
477
478 ret += name;
479
480 //foreach (char c in Path.GetInvalidPathChars())
481 //{
482 // ret = ret.Replace(c, '_');
483 //}
484
485 return ret;
486 }
487
488 /// <summary>
489 ///
490 /// </summary>
491 /// <param name="path"></param>
492 /// <returns></returns>
493 public static string MakeReferencePath(string path)
494 {
495 string ret = EndPath(NormalizePath(path));
496
497 //foreach (char c in Path.GetInvalidPathChars())
498 //{
499 // ret = ret.Replace(c, '_');
500 //}
501
502 return ret;
503 }
504
505 /// <summary>
506 /// Sets the current dir.
507 /// </summary>
508 /// <param name="path">The path.</param>
509 public static void SetCurrentDir(string path)
510 {
511 if( path == null )
512 {
513 throw new ArgumentNullException("path");
514 }
515 if(path.Length < 1)
516 {
517 return;
518 }
519
520 Environment.CurrentDirectory = path;
521 }
522
523 /// <summary>
524 /// Checks the type.
525 /// </summary>
526 /// <param name="typeToCheck">The type to check.</param>
527 /// <param name="attr">The attr.</param>
528 /// <param name="inter">The inter.</param>
529 /// <returns></returns>
530 public static object CheckType(Type typeToCheck, Type attr, Type inter)
531 {
532 if(typeToCheck == null || attr == null)
533 {
534 return null;
535 }
536
537 object[] attrs = typeToCheck.GetCustomAttributes(attr, false);
538 if(attrs == null || attrs.Length < 1)
539 {
540 return null;
541 }
542 if( inter == null )
543 {
544 throw new ArgumentNullException("inter");
545 }
546
547 if(typeToCheck.GetInterface(inter.FullName) == null)
548 {
549 return null;
550 }
551
552 return attrs[0];
553 }
554
555 /* A bit of overhead for simple group parsing, there are problems with Regex in Mono
556 public static string ParseValue(string val)
557 {
558 if(val == null || val.Length < 1 || !CheckForOSVariables)
559 return val;
560
561 string tmp = val;
562 Match m = m_VarRegex.Match(val);
563 while(m.Success)
564 {
565 if(m.Groups["var"] == null)
566 continue;
567
568 Capture c = m.Groups["var"].Captures[0];
569 if(c == null)
570 continue;
571
572 string var = c.Value;
573 string envVal = Environment.GetEnvironmentVariable(var);
574 if(envVal == null)
575 envVal = "";
576
577 tmp = tmp.Replace("${" + var + "}", envVal);
578 m = m.NextMatch();
579 }
580
581 return tmp;
582 }*/
583
584 /// <summary>
585 /// Attributes the value.
586 /// </summary>
587 /// <param name="node">The node.</param>
588 /// <param name="attr">The attr.</param>
589 /// <param name="def">The def.</param>
590 /// <returns></returns>
591 public static string AttributeValue(XmlNode node, string attr, string def)
592 {
593 if( node == null )
594 {
595 throw new ArgumentNullException("node");
596 }
597 if(node.Attributes[attr] == null)
598 {
599 return def;
600 }
601 string val = node.Attributes[attr].Value;
602 if(!CheckForOSVariables)
603 {
604 return val;
605 }
606
607 return InterpolateForEnvironmentVariables(val);
608 }
609
610 /// <summary>
611 /// Parses the boolean.
612 /// </summary>
613 /// <param name="node">The node.</param>
614 /// <param name="attr">The attr.</param>
615 /// <param name="defaultValue">if set to <c>true</c> [default value].</param>
616 /// <returns></returns>
617 public static bool ParseBoolean(XmlNode node, string attr, bool defaultValue)
618 {
619 if( node == null )
620 {
621 throw new ArgumentNullException("node");
622 }
623 if(node.Attributes[attr] == null)
624 {
625 return defaultValue;
626 }
627 return bool.Parse(node.Attributes[attr].Value);
628 }
629
630 /// <summary>
631 /// Enums the attribute value.
632 /// </summary>
633 /// <param name="node">The node.</param>
634 /// <param name="attr">The attr.</param>
635 /// <param name="enumType">Type of the enum.</param>
636 /// <param name="def">The def.</param>
637 /// <returns></returns>
638 public static object EnumAttributeValue(XmlNode node, string attr, Type enumType, object def)
639 {
640 if( def == null )
641 {
642 throw new ArgumentNullException("def");
643 }
644 string val = AttributeValue(node, attr, def.ToString());
645 return Enum.Parse(enumType, val, true);
646 }
647
648 /// <summary>
649 ///
650 /// </summary>
651 /// <param name="assemblyName"></param>
652 /// <param name="projectType"></param>
653 /// <returns></returns>
654 public static string AssemblyFullName(string assemblyName, ProjectType projectType)
655 {
656 return assemblyName + (projectType == ProjectType.Library ? ".dll" : ".exe");
657 }
658
659 #endregion
660 }
661}
diff --git a/Prebuild/src/Core/Utilities/Log.cs b/Prebuild/src/Core/Utilities/Log.cs
new file mode 100644
index 0000000..da2cc96
--- /dev/null
+++ b/Prebuild/src/Core/Utilities/Log.cs
@@ -0,0 +1,279 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36using System.IO;
37
38namespace Prebuild.Core.Utilities
39{
40 /// <summary>
41 ///
42 /// </summary>
43 public enum LogType
44 {
45 /// <summary>
46 ///
47 /// </summary>
48 None,
49 /// <summary>
50 ///
51 /// </summary>
52 Info,
53 /// <summary>
54 ///
55 /// </summary>
56 Warning,
57 /// <summary>
58 ///
59 /// </summary>
60 Error
61 }
62
63 /// <summary>
64 ///
65 /// </summary>
66 [Flags]
67 public enum LogTargets
68 {
69 /// <summary>
70 ///
71 /// </summary>
72 None = 0,
73 /// <summary>
74 ///
75 /// </summary>
76 Null = 1,
77 /// <summary>
78 ///
79 /// </summary>
80 File = 2,
81 /// <summary>
82 ///
83 /// </summary>
84 Console = 4
85 }
86
87 /// <summary>
88 /// Summary description for Log.
89 /// </summary>
90 public class Log : IDisposable
91 {
92 #region Fields
93
94 private StreamWriter m_Writer;
95 private LogTargets m_Target = LogTargets.Null;
96 bool disposed;
97
98 #endregion
99
100 #region Constructors
101
102 /// <summary>
103 /// Initializes a new instance of the <see cref="Log"/> class.
104 /// </summary>
105 /// <param name="target">The target.</param>
106 /// <param name="fileName">Name of the file.</param>
107 public Log(LogTargets target, string fileName)
108 {
109 m_Target = target;
110
111 if((m_Target & LogTargets.File) != 0)
112 {
113 m_Writer = new StreamWriter(fileName, false);
114 }
115 }
116
117 #endregion
118
119 #region Public Methods
120
121 /// <summary>
122 /// Writes this instance.
123 /// </summary>
124 public void Write()
125 {
126 Write(string.Empty);
127 }
128
129 /// <summary>
130 /// Writes the specified MSG.
131 /// </summary>
132 /// <param name="msg">The MSG.</param>
133 public void Write(string msg)
134 {
135 if((m_Target & LogTargets.Null) != 0)
136 {
137 return;
138 }
139
140 if((m_Target & LogTargets.Console) != 0)
141 {
142 Console.WriteLine(msg);
143 }
144 if((m_Target & LogTargets.File) != 0 && m_Writer != null)
145 {
146 m_Writer.WriteLine(msg);
147 }
148 }
149
150 /// <summary>
151 /// Writes the specified format.
152 /// </summary>
153 /// <param name="format">The format.</param>
154 /// <param name="args">The args.</param>
155 public void Write(string format, params object[] args)
156 {
157 Write(string.Format(format,args));
158 }
159
160 /// <summary>
161 /// Writes the specified type.
162 /// </summary>
163 /// <param name="type">The type.</param>
164 /// <param name="format">The format.</param>
165 /// <param name="args">The args.</param>
166 public void Write(LogType type, string format, params object[] args)
167 {
168 if((m_Target & LogTargets.Null) != 0)
169 {
170 return;
171 }
172
173 string str = "";
174 switch(type)
175 {
176 case LogType.Info:
177 str = "[I] ";
178 break;
179 case LogType.Warning:
180 str = "[!] ";
181 break;
182 case LogType.Error:
183 str = "[X] ";
184 break;
185 }
186
187 Write(str + format,args);
188 }
189
190 /// <summary>
191 /// Writes the exception.
192 /// </summary>
193 /// <param name="type">The type.</param>
194 /// <param name="ex">The ex.</param>
195 public void WriteException(LogType type, Exception ex)
196 {
197 if(ex != null)
198 {
199 Write(type, ex.Message);
200 //#if DEBUG
201 m_Writer.WriteLine("Exception @{0} stack trace [[", ex.TargetSite.Name);
202 m_Writer.WriteLine(ex.StackTrace);
203 m_Writer.WriteLine("]]");
204 //#endif
205 }
206 }
207
208 /// <summary>
209 /// Flushes this instance.
210 /// </summary>
211 public void Flush()
212 {
213 if(m_Writer != null)
214 {
215 m_Writer.Flush();
216 }
217 }
218
219 #endregion
220
221 #region IDisposable Members
222
223 /// <summary>
224 /// Performs application-defined tasks associated with freeing, releasing, or
225 /// resetting unmanaged resources.
226 /// </summary>
227 public void Dispose()
228 {
229 Dispose(true);
230 GC.SuppressFinalize(this);
231 }
232
233 /// <summary>
234 /// Dispose objects
235 /// </summary>
236 /// <param name="disposing">
237 /// If true, it will dispose close the handle
238 /// </param>
239 /// <remarks>
240 /// Will dispose managed and unmanaged resources.
241 /// </remarks>
242 protected virtual void Dispose(bool disposing)
243 {
244 if (!this.disposed)
245 {
246 if (disposing)
247 {
248 if (m_Writer != null)
249 {
250 m_Writer.Close();
251 m_Writer = null;
252 }
253 }
254 }
255 this.disposed = true;
256 }
257
258 /// <summary>
259 ///
260 /// </summary>
261 ~Log()
262 {
263 this.Dispose(false);
264 }
265
266 /// <summary>
267 /// Closes and destroys this object
268 /// </summary>
269 /// <remarks>
270 /// Same as Dispose(true)
271 /// </remarks>
272 public void Close()
273 {
274 Dispose();
275 }
276
277 #endregion
278 }
279}
diff --git a/Prebuild/src/Core/WarningException.cs b/Prebuild/src/Core/WarningException.cs
new file mode 100644
index 0000000..a200bdc
--- /dev/null
+++ b/Prebuild/src/Core/WarningException.cs
@@ -0,0 +1,93 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36using System.Runtime.Serialization;
37
38namespace Prebuild.Core
39{
40 /// <summary>
41 ///
42 /// </summary>
43 [Serializable()]
44 public class WarningException : Exception
45 {
46 #region Constructors
47
48 /// <summary>
49 ///
50 /// </summary>
51 public WarningException()
52 {
53 }
54
55 /// <summary>
56 ///
57 /// </summary>
58 /// <param name="format"></param>
59 /// <param name="args"></param>
60 public WarningException(string format, params object[] args)
61 : base(String.Format(format, args))
62 {
63 }
64
65 /// <summary>
66 /// Exception with specified string
67 /// </summary>
68 /// <param name="message">Exception message</param>
69 public WarningException(string message): base(message)
70 {
71 }
72
73 /// <summary>
74 ///
75 /// </summary>
76 /// <param name="message"></param>
77 /// <param name="exception"></param>
78 public WarningException(string message, Exception exception) : base(message, exception)
79 {
80 }
81
82 /// <summary>
83 ///
84 /// </summary>
85 /// <param name="info"></param>
86 /// <param name="context"></param>
87 protected WarningException(SerializationInfo info, StreamingContext context) : base( info, context )
88 {
89 }
90
91 #endregion
92 }
93}
diff --git a/Prebuild/src/Prebuild.cs b/Prebuild/src/Prebuild.cs
new file mode 100644
index 0000000..597db68
--- /dev/null
+++ b/Prebuild/src/Prebuild.cs
@@ -0,0 +1,165 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-09-26 23:43:35 +0200 (ti, 26 sep 2006) $
31 * $Revision: 168 $
32 */
33#endregion
34
35using System;
36using System.Collections.Specialized;
37using System.IO;
38using System.Reflection;
39using System.Runtime.InteropServices;
40using System.EnterpriseServices.Internal;
41
42using Prebuild.Core;
43using Prebuild.Core.Utilities;
44
45namespace Prebuild
46{
47 /// <summary>
48 ///
49 /// </summary>
50 class Prebuild
51 {
52 #region Main
53
54 [STAThread]
55 static void Main(string[] args)
56 {
57 Kernel kernel = null;
58 try
59 {
60 kernel = Kernel.Instance;
61 kernel.Initialize(LogTargets.File | LogTargets.Console, args);
62 bool exit = false;
63
64 if(kernel.CommandLine.WasPassed("usage"))
65 {
66 exit = true;
67 OutputUsage();
68 }
69 if(kernel.CommandLine.WasPassed("showtargets"))
70 {
71 exit = true;
72 OutputTargets(kernel);
73 }
74 if(kernel.CommandLine.WasPassed("install"))
75 {
76 exit = true;
77 InstallAssembly(kernel);
78 }
79 if(kernel.CommandLine.WasPassed("remove"))
80 {
81 exit = true;
82 RemoveAssembly(kernel);
83 }
84
85 if(!exit)
86 {
87 kernel.Process();
88 }
89 }
90 catch(Exception ex)
91 {
92 Console.WriteLine("Unhandled error: {0}", ex.Message);
93 //#if DEBUG
94 Console.WriteLine("{0}", ex.StackTrace);
95 //#endif
96 }
97 finally
98 {
99 if(kernel.PauseAfterFinish)
100 {
101 Console.WriteLine("\nPress enter to continue...");
102 Console.ReadLine();
103 }
104 }
105 }
106
107 #endregion
108
109 #region Private Methods
110
111 private static void InstallAssembly(Kernel kernel)
112 {
113 Publish publish = new Publish();
114 string file = kernel.CommandLine["install"];
115 //Console.WriteLine(".."+file+"..");
116 publish.GacInstall(file);
117 }
118
119 private static void RemoveAssembly(Kernel kernel)
120 {
121 Publish publish = new Publish();
122 string file = kernel.CommandLine["remove"];
123 publish.GacRemove(file);
124 }
125
126 private static void OutputUsage()
127 {
128 Console.WriteLine("Usage: prebuild /target <target> [options]");
129 Console.WriteLine("Available command-line switches:");
130 Console.WriteLine();
131 Console.WriteLine("/target Target for Prebuild");
132 Console.WriteLine("/clean Clean the build files for the given target");
133 Console.WriteLine("/file XML file to process");
134 Console.WriteLine("/log Log file to write to");
135 Console.WriteLine("/ppo Pre-process the file, but perform no other processing");
136 Console.WriteLine("/pause Pauses the application after execution to view the output");
137 Console.WriteLine("/yes Default to yes to any questions asked");
138 Console.WriteLine("/install Install assembly into the GAC");
139 Console.WriteLine("/remove Remove assembly from the GAC");
140 Console.WriteLine();
141 Console.WriteLine("See 'prebuild /showtargets for a list of available targets");
142 Console.WriteLine("See readme.txt or check out http://dnpb.sourceforge.net for more information");
143 Console.WriteLine();
144 }
145
146 private static void OutputTargets(Kernel kern)
147 {
148 Console.WriteLine("Targets available in Prebuild:");
149 Console.WriteLine("");
150 if(kern.Targets.Keys.Count > 0)
151 {
152 string[] targs = new string[kern.Targets.Keys.Count];
153 kern.Targets.Keys.CopyTo(targs, 0);
154 Array.Sort(targs);
155 foreach(string target in targs)
156 {
157 Console.WriteLine(target);
158 }
159 }
160 Console.WriteLine("");
161 }
162
163 #endregion
164 }
165}
diff --git a/Prebuild/src/Prebuild.csproj b/Prebuild/src/Prebuild.csproj
new file mode 100644
index 0000000..55efffa
--- /dev/null
+++ b/Prebuild/src/Prebuild.csproj
@@ -0,0 +1,205 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{92E80C1C-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon>App.ico</ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>prebuild</AssemblyName>
13 <AssemblyOriginatorKeyFile>Prebuild.snk</AssemblyOriginatorKeyFile>
14 <SignAssembly>true</SignAssembly>
15 <DefaultClientScript>JScript</DefaultClientScript>
16 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
17 <DefaultTargetSchema>IE50</DefaultTargetSchema>
18 <DelaySign>false</DelaySign>
19 <OutputType>Exe</OutputType>
20 <AppDesignerFolder></AppDesignerFolder>
21 <RootNamespace>Prebuild</RootNamespace>
22 <StartupObject>Prebuild.Prebuild</StartupObject>
23 <FileUpgradeFlags>
24 </FileUpgradeFlags>
25 </PropertyGroup>
26 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
27 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
28 <BaseAddress>285212672</BaseAddress>
29 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
30 <ConfigurationOverrideFile>
31 </ConfigurationOverrideFile>
32 <DefineConstants>DEBUG;TRACE</DefineConstants>
33 <DocumentationFile></DocumentationFile>
34 <DebugSymbols>True</DebugSymbols>
35 <FileAlignment>4096</FileAlignment>
36 <Optimize>False</Optimize>
37 <OutputPath>..\..\bin\</OutputPath>
38 <RegisterForComInterop>False</RegisterForComInterop>
39 <RemoveIntegerChecks>False</RemoveIntegerChecks>
40 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
41 <WarningLevel>4</WarningLevel>
42 <NoWarn>1595</NoWarn>
43 </PropertyGroup>
44 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
45 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
46 <BaseAddress>285212672</BaseAddress>
47 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
48 <ConfigurationOverrideFile>
49 </ConfigurationOverrideFile>
50 <DefineConstants>TRACE</DefineConstants>
51 <DocumentationFile></DocumentationFile>
52 <DebugSymbols>False</DebugSymbols>
53 <FileAlignment>4096</FileAlignment>
54 <Optimize>True</Optimize>
55 <OutputPath>..\..\bin\</OutputPath>
56 <RegisterForComInterop>False</RegisterForComInterop>
57 <RemoveIntegerChecks>False</RemoveIntegerChecks>
58 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
59 <WarningLevel>4</WarningLevel>
60 <NoWarn>1595</NoWarn>
61 </PropertyGroup>
62 <ItemGroup>
63 <Reference Include="System.EnterpriseServices" >
64 <HintPath>System.EnterpriseServices.dll</HintPath>
65 <Private>False</Private>
66 </Reference>
67 <Reference Include="System.Xml" >
68 <HintPath>System.Xml.dll</HintPath>
69 <Private>False</Private>
70 </Reference>
71 <Reference Include="System" >
72 <HintPath>System.dll</HintPath>
73 <Private>False</Private>
74 </Reference>
75 </ItemGroup>
76 <ItemGroup>
77 </ItemGroup>
78 <ItemGroup>
79 <EmbeddedResource Include="App.ico">
80 </EmbeddedResource>
81 <EmbeddedResource Include="data\prebuild-1.7.xsd">
82 </EmbeddedResource>
83 <Compile Include="Prebuild.cs">
84 <SubType>Code</SubType>
85 </Compile>
86 <Compile Include="Core\FatalException.cs">
87 <SubType>Code</SubType>
88 </Compile>
89 <Compile Include="Core\Kernel.cs">
90 <SubType>Code</SubType>
91 </Compile>
92 <Compile Include="Core\UnknownLanguageException.cs">
93 <SubType>Code</SubType>
94 </Compile>
95 <Compile Include="Core\WarningException.cs">
96 <SubType>Code</SubType>
97 </Compile>
98 <Compile Include="Core\Attributes\DataNodeAttribute.cs">
99 <SubType>Code</SubType>
100 </Compile>
101 <Compile Include="Core\Attributes\OptionNodeAttribute.cs">
102 <SubType>Code</SubType>
103 </Compile>
104 <Compile Include="Core\Attributes\TargetAttribute.cs">
105 <SubType>Code</SubType>
106 </Compile>
107 <Compile Include="Core\Interfaces\IDataNode.cs">
108 <SubType>Code</SubType>
109 </Compile>
110 <Compile Include="Core\Interfaces\ITarget.cs">
111 <SubType>Code</SubType>
112 </Compile>
113 <Compile Include="Core\Nodes\ConfigurationNode.cs">
114 <SubType>Code</SubType>
115 </Compile>
116 <Compile Include="Core\Nodes\DataNode.cs">
117 <SubType>Code</SubType>
118 </Compile>
119 <Compile Include="Core\Nodes\ExcludeNode.cs">
120 <SubType>Code</SubType>
121 </Compile>
122 <Compile Include="Core\Nodes\FileNode.cs">
123 <SubType>Code</SubType>
124 </Compile>
125 <Compile Include="Core\Nodes\FilesNode.cs">
126 <SubType>Code</SubType>
127 </Compile>
128 <Compile Include="Core\Nodes\MatchNode.cs">
129 <SubType>Code</SubType>
130 </Compile>
131 <Compile Include="Core\Nodes\OptionsNode.cs">
132 <SubType>Code</SubType>
133 </Compile>
134 <Compile Include="Core\Nodes\ProcessNode.cs">
135 <SubType>Code</SubType>
136 </Compile>
137 <Compile Include="Core\Nodes\ProjectNode.cs">
138 <SubType>Code</SubType>
139 </Compile>
140 <Compile Include="Core\Nodes\ReferenceNode.cs">
141 <SubType>Code</SubType>
142 </Compile>
143 <Compile Include="Core\Nodes\ReferencePathNode.cs">
144 <SubType>Code</SubType>
145 </Compile>
146 <Compile Include="Core\Nodes\SolutionNode.cs">
147 <SubType>Code</SubType>
148 </Compile>
149 <Compile Include="Core\Parse\IfContext.cs">
150 <SubType>Code</SubType>
151 </Compile>
152 <Compile Include="Core\Parse\Preprocessor.cs">
153 <SubType>Code</SubType>
154 </Compile>
155 <Compile Include="Core\Targets\AutotoolsTarget.cs">
156 <SubType>Code</SubType>
157 </Compile>
158 <Compile Include="Core\Targets\DebugTarget.cs">
159 <SubType>Code</SubType>
160 </Compile>
161 <Compile Include="Core\Targets\MonoDevelopTarget.cs">
162 <SubType>Code</SubType>
163 </Compile>
164 <Compile Include="Core\Targets\NAntTarget.cs">
165 <SubType>Code</SubType>
166 </Compile>
167 <Compile Include="Core\Targets\SharpDevelop2Target.cs">
168 <SubType>Code</SubType>
169 </Compile>
170 <Compile Include="Core\Targets\SharpDevelopTarget.cs">
171 <SubType>Code</SubType>
172 </Compile>
173 <Compile Include="Core\Targets\VS2002Target.cs">
174 <SubType>Code</SubType>
175 </Compile>
176 <Compile Include="Core\Targets\VS2003Target.cs">
177 <SubType>Code</SubType>
178 </Compile>
179 <Compile Include="Core\Targets\VS2005Target.cs">
180 <SubType>Code</SubType>
181 </Compile>
182 <Compile Include="Core\Utilities\CommandLineCollection.cs">
183 <SubType>Code</SubType>
184 </Compile>
185 <Compile Include="Core\Utilities\CurrentDirectory.cs">
186 <SubType>Code</SubType>
187 </Compile>
188 <Compile Include="Core\Utilities\Helper.cs">
189 <SubType>Code</SubType>
190 </Compile>
191 <Compile Include="Core\Utilities\Log.cs">
192 <SubType>Code</SubType>
193 </Compile>
194 <Compile Include="Properties\AssemblyInfo.cs">
195 <SubType>Code</SubType>
196 </Compile>
197 </ItemGroup>
198 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
199 <PropertyGroup>
200 <PreBuildEvent>
201 </PreBuildEvent>
202 <PostBuildEvent>
203 </PostBuildEvent>
204 </PropertyGroup>
205</Project>
diff --git a/Prebuild/src/Prebuild.csproj.user b/Prebuild/src/Prebuild.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/Prebuild/src/Prebuild.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/Prebuild/src/Prebuild.exe.build b/Prebuild/src/Prebuild.exe.build
new file mode 100644
index 0000000..43f5516
--- /dev/null
+++ b/Prebuild/src/Prebuild.exe.build
@@ -0,0 +1,80 @@
1<?xml version="1.0" ?>
2<project name="Prebuild" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="exe" debug="${build.debug}" keyfile="Prebuild.snk" unsafe="False" define="DEBUG;TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe" win32icon="App.ico">
11 <resources prefix="Prebuild" dynamicprefix="true" >
12 <include name="App.ico" />
13 <include name="data/prebuild-1.7.xsd" />
14 </resources>
15 <sources failonempty="true">
16 <include name="Prebuild.cs" />
17 <include name="Core/FatalException.cs" />
18 <include name="Core/Kernel.cs" />
19 <include name="Core/UnknownLanguageException.cs" />
20 <include name="Core/WarningException.cs" />
21 <include name="Core/Attributes/DataNodeAttribute.cs" />
22 <include name="Core/Attributes/OptionNodeAttribute.cs" />
23 <include name="Core/Attributes/TargetAttribute.cs" />
24 <include name="Core/Interfaces/IDataNode.cs" />
25 <include name="Core/Interfaces/ITarget.cs" />
26 <include name="Core/Nodes/ConfigurationNode.cs" />
27 <include name="Core/Nodes/DataNode.cs" />
28 <include name="Core/Nodes/ExcludeNode.cs" />
29 <include name="Core/Nodes/FileNode.cs" />
30 <include name="Core/Nodes/FilesNode.cs" />
31 <include name="Core/Nodes/MatchNode.cs" />
32 <include name="Core/Nodes/OptionsNode.cs" />
33 <include name="Core/Nodes/ProcessNode.cs" />
34 <include name="Core/Nodes/ProjectNode.cs" />
35 <include name="Core/Nodes/ReferenceNode.cs" />
36 <include name="Core/Nodes/ReferencePathNode.cs" />
37 <include name="Core/Nodes/SolutionNode.cs" />
38 <include name="Core/Parse/IfContext.cs" />
39 <include name="Core/Parse/Preprocessor.cs" />
40 <include name="Core/Targets/AutotoolsTarget.cs" />
41 <include name="Core/Targets/DebugTarget.cs" />
42 <include name="Core/Targets/MonoDevelopTarget.cs" />
43 <include name="Core/Targets/NAntTarget.cs" />
44 <include name="Core/Targets/SharpDevelop2Target.cs" />
45 <include name="Core/Targets/SharpDevelopTarget.cs" />
46 <include name="Core/Targets/VS2002Target.cs" />
47 <include name="Core/Targets/VS2003Target.cs" />
48 <include name="Core/Targets/VS2005Target.cs" />
49 <include name="Core/Utilities/CommandLineCollection.cs" />
50 <include name="Core/Utilities/CurrentDirectory.cs" />
51 <include name="Core/Utilities/Helper.cs" />
52 <include name="Core/Utilities/Log.cs" />
53 <include name="Properties/AssemblyInfo.cs" />
54 </sources>
55 <references basedir="${project::get-base-directory()}">
56 <lib>
57 <include name="${project::get-base-directory()}" />
58 <include name="${project::get-base-directory()}/${build.dir}" />
59 </lib>
60 <include name="System.EnterpriseServices.dll" />
61 <include name="System.Xml.dll" />
62 <include name="System.dll" />
63 </references>
64 </csc>
65 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
66 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
67 <copy todir="${project::get-base-directory()}/../../bin/">
68 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
69 <include name="*.dll"/>
70 <include name="*.exe"/>
71 </fileset>
72 </copy>
73 </target>
74 <target name="clean">
75 <delete dir="${bin.dir}" failonerror="false" />
76 <delete dir="${obj.dir}" failonerror="false" />
77 </target>
78 <target name="doc" description="Creates documentation.">
79 </target>
80</project>
diff --git a/Prebuild/src/Prebuild.snk b/Prebuild/src/Prebuild.snk
new file mode 100644
index 0000000..f9dce05
--- /dev/null
+++ b/Prebuild/src/Prebuild.snk
Binary files differ
diff --git a/Prebuild/src/Properties/AssemblyInfo.cs b/Prebuild/src/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..bfa9829
--- /dev/null
+++ b/Prebuild/src/Properties/AssemblyInfo.cs
@@ -0,0 +1,101 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2007-01-26 19:31:34 +0100 (fr, 26 jan 2007) $
31 * $Revision: 203 $
32 */
33#endregion
34
35using System;
36using System.Reflection;
37using System.Runtime.CompilerServices;
38using System.Runtime.InteropServices;
39using System.Security.Permissions;
40using System.Resources;
41
42
43// FxCop recommended attributes
44[assembly: ComVisible(false)]
45[assembly: FileIOPermission(SecurityAction.RequestMinimum, Unrestricted=true)]
46[assembly: CLSCompliant(true)]
47
48//
49// General Information about an assembly is controlled through the following
50// set of attributes. Change these attribute values to modify the information
51// associated with an assembly.
52//
53[assembly: AssemblyTitle(".NET Prebuild")]
54[assembly: AssemblyDescription("A .NET project file build tool")]
55[assembly: AssemblyConfiguration(".NET CLR")]
56[assembly: AssemblyCompany("The Prebuild Project")]
57[assembly: AssemblyProduct("")]
58[assembly: AssemblyCopyright("Copyright 2004-2006 Matthew Holmes, Dan Moorehead and David Hudson")]
59[assembly: AssemblyTrademark("")]
60[assembly: AssemblyCulture("")]
61[assembly: NeutralResourcesLanguageAttribute("en-US")]
62[assembly: AssemblyVersion("2.0.0.*")]
63
64//
65// Version information for an assembly consists of the following four values:
66//
67// Major Version
68// Minor Version
69// Build Number
70// Revision
71//
72// You can specify all the values or you can default the Revision and Build Numbers
73// by using the '*' as shown below:
74
75//
76// In order to sign your assembly you must specify a key to use. Refer to the
77// Microsoft .NET Framework documentation for more information on assembly signing.
78//
79// Use the attributes below to control which key is used for signing.
80//
81// Notes:
82// (*) If no key is specified, the assembly is not signed.
83// (*) KeyName refers to a key that has been installed in the Crypto Service
84// Provider (CSP) on your machine. KeyFile refers to a file which contains
85// a key.
86// (*) If the KeyFile and the KeyName values are both specified, the
87// following processing occurs:
88// (1) If the KeyName can be found in the CSP, that key is used.
89// (2) If the KeyName does not exist and the KeyFile does exist, the key
90// in the KeyFile is installed into the CSP and used.
91// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
92// When specifying the KeyFile, the location of the KeyFile should be
93// relative to the project output directory which is
94// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
95// located in the project directory, you would specify the AssemblyKeyFile
96// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
97// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
98// documentation for more information on this.
99//
100[assembly: AssemblyDelaySign(false)]
101[assembly: AssemblyKeyName("")]
diff --git a/Prebuild/src/data/dnpb-1.0.xsd b/Prebuild/src/data/dnpb-1.0.xsd
new file mode 100644
index 0000000..45cab86
--- /dev/null
+++ b/Prebuild/src/data/dnpb-1.0.xsd
@@ -0,0 +1,183 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<xs:schema elementFormDefault="qualified"
3 xmlns:xs="http://www.w3.org/2001/XMLSchema"
4 targetNamespace="http://dnpb.sourceforge.net/schemas/dnpb-1.0.xsd"
5 xmlns="http://dnpb.sourceforge.net/schemas/dnpb-1.0.xsd"
6>
7 <xs:annotation>
8 <xs:documentation>
9 Copyright (c) 2004 Matthew Holmes (kerion@houston.rr.com)
10
11 Redistribution and use in source and binary forms, with or without modification, are permitted
12 provided that the following conditions are met:
13
14 * Redistributions of source code must retain the above copyright notice, this list of conditions
15 and the following disclaimer.
16 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
17 and the following disclaimer in the documentation and/or other materials provided with the
18 distribution.
19 * The name of the author may not be used to endorse or promote products derived from this software
20 without specific prior written permission.
21
22 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
23 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
28 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 </xs:documentation>
30 </xs:annotation>
31
32 <xs:element name="DNPreBuild">
33 <xs:complexType>
34 <xs:sequence>
35 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
36 <xs:element ref="Solution" minOccurs="1" maxOccurs="unbounded" />
37 </xs:sequence>
38
39 <xs:attribute name="version" use="required" />
40 </xs:complexType>
41 </xs:element>
42
43 <xs:element name="Process" type="xs:string" />
44
45 <xs:element name="Solution">
46 <xs:complexType>
47 <xs:sequence>
48 <xs:element ref="Options" minOccurs="0" />
49 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
50 <xs:element ref="Files" minOccurs="0" />
51 <xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
52 </xs:sequence>
53
54 <xs:attribute name="name" type="xs:string" use="required" />
55 <xs:attribute name="path" type="xs:string" default="" />
56 </xs:complexType>
57 </xs:element>
58
59 <xs:element name="Project">
60 <xs:complexType>
61 <xs:sequence>
62 <xs:element name="Reference" maxOccurs="unbounded">
63 <xs:complexType>
64 <xs:attribute name="name" type="xs:string" use="required" />
65 <xs:attribute name="path" type="xs:string" />
66 <xs:attribute name="localCopy" type="xs:boolean" />
67 <xs:attribute name="version" type="xs:string" />
68 </xs:complexType>
69 </xs:element>
70
71 <xs:element ref="Files" />
72 </xs:sequence>
73
74 <xs:attribute name="name" type="xs:string" use="required" />
75 <xs:attribute name="path" type="xs:string" default="" />
76
77 <xs:attribute name="language" default="C#">
78 <xs:simpleType>
79 <xs:restriction base="xs:string">
80 <xs:enumeration value="C#" />
81 <xs:enumeration value="VB.NET" />
82 </xs:restriction>
83 </xs:simpleType>
84 </xs:attribute>
85
86 <xs:attribute name="type" default="Exe">
87 <xs:simpleType>
88 <xs:restriction base="xs:string">
89 <xs:enumeration value="Exe" />
90 <xs:enumeration value="WinExe" />
91 <xs:enumeration value="Library" />
92 </xs:restriction>
93 </xs:simpleType>
94 </xs:attribute>
95
96 <xs:attribute name="runtime" default="Microsoft">
97 <xs:simpleType>
98 <xs:restriction base="xs:string">
99 <xs:enumeration value="Microsoft" />
100 <xs:enumeration value="Mono" />
101 </xs:restriction>
102 </xs:simpleType>
103 </xs:attribute>
104
105 <xs:attribute name="startupObject" type="xs:string" default="" />
106 </xs:complexType>
107 </xs:element>
108
109 <xs:element name="Configuration">
110 <xs:complexType>
111 <xs:all>
112 <xs:element ref="Options" minOccurs="0" />
113 </xs:all>
114
115 <xs:attribute name="name" type="xs:string" use="required" />
116 </xs:complexType>
117 </xs:element>
118
119 <xs:element name="Options">
120 <xs:complexType>
121 <xs:sequence>
122 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
123 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
124 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
125 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
126 <xs:element name="WarningLevel" minOccurs="0">
127 <xs:simpleType>
128 <xs:restriction base="xs:integer">
129 <xs:minInclusive value="0" />
130 <xs:maxInclusive value="4"/>
131 </xs:restriction>
132 </xs:simpleType>
133 </xs:element>
134 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
135 <xs:element name="SupressWarnings" type="xs:string" minOccurs="0" />
136 <xs:element name="OutputPath" type="xs:string" minOccurs="0" />
137 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
138 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
139 <xs:element name="RegisterCOMInterop" type="xs:boolean" minOccurs="0" />
140 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
141 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
142 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
143 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
144 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
145 </xs:sequence>
146 </xs:complexType>
147 </xs:element>
148
149 <xs:element name="Files">
150 <xs:complexType>
151 <xs:sequence>
152 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
153 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
154 </xs:sequence>
155 </xs:complexType>
156 </xs:element>
157
158 <xs:element name="File">
159 <xs:complexType>
160 <xs:simpleContent>
161 <xs:extension base="xs:string">
162 <xs:attribute name="buildAction" default="Compile">
163 <xs:simpleType>
164 <xs:restriction base="xs:string">
165 <xs:enumeration value="Compile" />
166 <xs:enumeration value="Content" />
167 <xs:enumeration value="EmbeddedResource" />
168 </xs:restriction>
169 </xs:simpleType>
170 </xs:attribute>
171 </xs:extension>
172 </xs:simpleContent>
173 </xs:complexType>
174 </xs:element>
175
176 <xs:element name="Match">
177 <xs:complexType>
178 <xs:attribute name="path" type="xs:string" use="required" />
179 <xs:attribute name="pattern" type="xs:string" use="required" />
180 <xs:attribute name="recurse" type="xs:boolean" default="false" />
181 </xs:complexType>
182 </xs:element>
183</xs:schema> \ No newline at end of file
diff --git a/Prebuild/src/data/dnpb-1.1.xsd b/Prebuild/src/data/dnpb-1.1.xsd
new file mode 100644
index 0000000..c402ceb
--- /dev/null
+++ b/Prebuild/src/data/dnpb-1.1.xsd
@@ -0,0 +1,184 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<xs:schema elementFormDefault="qualified"
3 xmlns:xs="http://www.w3.org/2001/XMLSchema"
4 targetNamespace="http://dnpb.sourceforge.net/schemas/dnpb-1.1.xsd"
5 xmlns="http://dnpb.sourceforge.net/schemas/dnpb-1.1.xsd"
6>
7 <xs:annotation>
8 <xs:documentation>
9 Copyright (c) 2004 Matthew Holmes (kerion@houston.rr.com)
10
11 Redistribution and use in source and binary forms, with or without modification, are permitted
12 provided that the following conditions are met:
13
14 * Redistributions of source code must retain the above copyright notice, this list of conditions
15 and the following disclaimer.
16 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
17 and the following disclaimer in the documentation and/or other materials provided with the
18 distribution.
19 * The name of the author may not be used to endorse or promote products derived from this software
20 without specific prior written permission.
21
22 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
23 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
28 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 </xs:documentation>
30 </xs:annotation>
31
32 <xs:element name="DNPreBuild">
33 <xs:complexType>
34 <xs:sequence>
35 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
36 <xs:element ref="Solution" minOccurs="1" maxOccurs="unbounded" />
37 </xs:sequence>
38
39 <xs:attribute name="version" use="required" />
40 </xs:complexType>
41 </xs:element>
42
43 <xs:element name="Process" type="xs:string" />
44
45 <xs:element name="Solution">
46 <xs:complexType>
47 <xs:sequence>
48 <xs:element ref="Options" minOccurs="0" />
49 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
50 <xs:element ref="Files" minOccurs="0" />
51 <xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
52 </xs:sequence>
53
54 <xs:attribute name="name" type="xs:string" use="required" />
55 <xs:attribute name="path" type="xs:string" default="" />
56 </xs:complexType>
57 </xs:element>
58
59 <xs:element name="Project">
60 <xs:complexType>
61 <xs:sequence>
62 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
63
64 <xs:element name="Reference" maxOccurs="unbounded">
65 <xs:complexType>
66 <xs:attribute name="name" type="xs:string" use="required" />
67 <xs:attribute name="path" type="xs:string" />
68 <xs:attribute name="localCopy" type="xs:boolean" />
69 <xs:attribute name="version" type="xs:string" />
70 </xs:complexType>
71 </xs:element>
72
73 <xs:element ref="Files" />
74 </xs:sequence>
75
76 <xs:attribute name="name" type="xs:string" use="required" />
77 <xs:attribute name="path" type="xs:string" default="" />
78
79 <xs:attribute name="language" default="C#">
80 <xs:simpleType>
81 <xs:restriction base="xs:string">
82 <xs:enumeration value="C#" />
83 <xs:enumeration value="VB.NET" />
84 </xs:restriction>
85 </xs:simpleType>
86 </xs:attribute>
87
88 <xs:attribute name="type" default="Exe">
89 <xs:simpleType>
90 <xs:restriction base="xs:string">
91 <xs:enumeration value="Exe" />
92 <xs:enumeration value="WinExe" />
93 <xs:enumeration value="Library" />
94 </xs:restriction>
95 </xs:simpleType>
96 </xs:attribute>
97
98 <xs:attribute name="runtime" default="Microsoft">
99 <xs:simpleType>
100 <xs:restriction base="xs:string">
101 <xs:enumeration value="Microsoft" />
102 <xs:enumeration value="Mono" />
103 </xs:restriction>
104 </xs:simpleType>
105 </xs:attribute>
106
107 <xs:attribute name="startupObject" type="xs:string" default="" />
108 </xs:complexType>
109 </xs:element>
110
111 <xs:element name="Configuration">
112 <xs:complexType>
113 <xs:all>
114 <xs:element ref="Options" minOccurs="0" />
115 </xs:all>
116
117 <xs:attribute name="name" type="xs:string" use="required" />
118 </xs:complexType>
119 </xs:element>
120
121 <xs:element name="Options">
122 <xs:complexType>
123 <xs:sequence>
124 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
125 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
126 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
127 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
128 <xs:element name="WarningLevel" minOccurs="0">
129 <xs:simpleType>
130 <xs:restriction base="xs:integer">
131 <xs:minInclusive value="0" />
132 <xs:maxInclusive value="4"/>
133 </xs:restriction>
134 </xs:simpleType>
135 </xs:element>
136 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
137 <xs:element name="SupressWarnings" type="xs:string" minOccurs="0" />
138 <xs:element name="OutputPath" type="xs:string" minOccurs="0" />
139 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
140 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
141 <xs:element name="RegisterCOMInterop" type="xs:boolean" minOccurs="0" />
142 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
143 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
144 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
145 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
146 </xs:sequence>
147 </xs:complexType>
148 </xs:element>
149
150 <xs:element name="Files">
151 <xs:complexType>
152 <xs:sequence>
153 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
154 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
155 </xs:sequence>
156 </xs:complexType>
157 </xs:element>
158
159 <xs:element name="File">
160 <xs:complexType>
161 <xs:simpleContent>
162 <xs:extension base="xs:string">
163 <xs:attribute name="buildAction" default="Compile">
164 <xs:simpleType>
165 <xs:restriction base="xs:string">
166 <xs:enumeration value="Compile" />
167 <xs:enumeration value="Content" />
168 <xs:enumeration value="EmbeddedResource" />
169 </xs:restriction>
170 </xs:simpleType>
171 </xs:attribute>
172 </xs:extension>
173 </xs:simpleContent>
174 </xs:complexType>
175 </xs:element>
176
177 <xs:element name="Match">
178 <xs:complexType>
179 <xs:attribute name="path" type="xs:string" use="required" />
180 <xs:attribute name="pattern" type="xs:string" use="required" />
181 <xs:attribute name="recurse" type="xs:boolean" default="false" />
182 </xs:complexType>
183 </xs:element>
184</xs:schema> \ No newline at end of file
diff --git a/Prebuild/src/data/dnpb-1.2.xsd b/Prebuild/src/data/dnpb-1.2.xsd
new file mode 100644
index 0000000..8004af7
--- /dev/null
+++ b/Prebuild/src/data/dnpb-1.2.xsd
@@ -0,0 +1,198 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<xs:schema elementFormDefault="qualified"
3 xmlns:xs="http://www.w3.org/2001/XMLSchema"
4 targetNamespace="http://dnpb.sourceforge.net/schemas/dnpb-1.2.xsd"
5 xmlns="http://dnpb.sourceforge.net/schemas/dnpb-1.2.xsd"
6>
7 <xs:annotation>
8 <xs:documentation>
9 Copyright (c) 2004 Matthew Holmes (calefaction _at_ houston _._ rr _._ com)
10
11 Redistribution and use in source and binary forms, with or without modification, are permitted
12 provided that the following conditions are met:
13
14 * Redistributions of source code must retain the above copyright notice, this list of conditions
15 and the following disclaimer.
16 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
17 and the following disclaimer in the documentation and/or other materials provided with the
18 distribution.
19 * The name of the author may not be used to endorse or promote products derived from this software
20 without specific prior written permission.
21
22 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
23 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
28 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 </xs:documentation>
30 </xs:annotation>
31
32 <xs:element name="DNPreBuild">
33 <xs:complexType>
34 <xs:sequence>
35 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
36 <xs:element ref="Solution" minOccurs="0" maxOccurs="unbounded" />
37 </xs:sequence>
38
39 <xs:attribute name="version" use="required" />
40 </xs:complexType>
41 </xs:element>
42
43 <xs:element name="Process" type="xs:string" />
44
45 <xs:element name="Solution">
46 <xs:complexType>
47 <xs:sequence>
48 <xs:element ref="Options" minOccurs="0" />
49 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
50 <xs:element ref="Files" minOccurs="0" />
51 <xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
52 </xs:sequence>
53
54 <xs:attribute name="name" type="xs:string" use="required" />
55 <xs:attribute name="path" type="xs:string" default="" />
56 </xs:complexType>
57 </xs:element>
58
59 <xs:element name="Project">
60 <xs:complexType>
61 <xs:sequence>
62 <xs:element ref="Configuration" minOccurs="0" maxOccurs="unbounded" />
63
64 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
65
66 <xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
67 <xs:complexType>
68 <xs:attribute name="name" type="xs:string" use="required" />
69 <xs:attribute name="path" type="xs:string" />
70 <xs:attribute name="localCopy" type="xs:boolean" />
71 <xs:attribute name="version" type="xs:string" />
72 </xs:complexType>
73 </xs:element>
74
75 <xs:element ref="Files" />
76 </xs:sequence>
77
78 <xs:attribute name="name" type="xs:string" use="required" />
79 <xs:attribute name="path" type="xs:string" default="" />
80
81 <xs:attribute name="language" default="C#">
82 <xs:simpleType>
83 <xs:restriction base="xs:string">
84 <xs:enumeration value="C#" />
85 <xs:enumeration value="VB.NET" />
86 </xs:restriction>
87 </xs:simpleType>
88 </xs:attribute>
89
90 <xs:attribute name="type" default="Exe">
91 <xs:simpleType>
92 <xs:restriction base="xs:string">
93 <xs:enumeration value="Exe" />
94 <xs:enumeration value="WinExe" />
95 <xs:enumeration value="Library" />
96 </xs:restriction>
97 </xs:simpleType>
98 </xs:attribute>
99
100 <xs:attribute name="runtime" default="Microsoft">
101 <xs:simpleType>
102 <xs:restriction base="xs:string">
103 <xs:enumeration value="Microsoft" />
104 <xs:enumeration value="Mono" />
105 </xs:restriction>
106 </xs:simpleType>
107 </xs:attribute>
108
109 <xs:attribute name="startupObject" type="xs:string" default="" />
110 <xs:attribute name="rootNamespace" type="xs:string" />
111 <xs:attribute name="assemblyName" type="xs:string" />
112 </xs:complexType>
113 </xs:element>
114
115 <xs:element name="Configuration">
116 <xs:complexType>
117 <xs:all>
118 <xs:element ref="Options" minOccurs="0" />
119 </xs:all>
120
121 <xs:attribute name="name" type="xs:string" use="required" />
122 </xs:complexType>
123 </xs:element>
124
125 <xs:element name="Options">
126 <xs:complexType>
127 <xs:all>
128 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
129 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
130 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
131 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
132 <xs:element name="WarningLevel" minOccurs="0">
133 <xs:simpleType>
134 <xs:restriction base="xs:integer">
135 <xs:minInclusive value="0" />
136 <xs:maxInclusive value="4"/>
137 </xs:restriction>
138 </xs:simpleType>
139 </xs:element>
140 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
141 <xs:element name="SupressWarnings" type="xs:string" minOccurs="0" />
142 <xs:element name="OutputPath" type="xs:string" minOccurs="0" />
143 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
144 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
145 <xs:element name="RegisterCOMInterop" type="xs:boolean" minOccurs="0" />
146 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
147 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
148 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
149 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
150 </xs:all>
151 </xs:complexType>
152 </xs:element>
153
154 <xs:element name="Files">
155 <xs:complexType>
156 <xs:sequence>
157 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
158 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
159 </xs:sequence>
160 </xs:complexType>
161 </xs:element>
162
163 <xs:element name="File">
164 <xs:complexType>
165 <xs:simpleContent>
166 <xs:extension base="xs:string">
167 <xs:attribute name="buildAction" default="Compile">
168 <xs:simpleType>
169 <xs:restriction base="xs:string">
170 <xs:enumeration value="Compile" />
171 <xs:enumeration value="Content" />
172 <xs:enumeration value="EmbeddedResource" />
173 </xs:restriction>
174 </xs:simpleType>
175 </xs:attribute>
176 </xs:extension>
177 </xs:simpleContent>
178 </xs:complexType>
179 </xs:element>
180
181 <xs:element name="Match">
182 <xs:complexType>
183 <xs:attribute name="path" type="xs:string" use="required" />
184 <xs:attribute name="pattern" type="xs:string" use="required" />
185 <xs:attribute name="recurse" type="xs:boolean" default="false" />
186 <xs:attribute name="useRegex" type="xs:boolean" default="false" />
187 <xs:attribute name="buildAction" default="Compile">
188 <xs:simpleType>
189 <xs:restriction base="xs:string">
190 <xs:enumeration value="Compile" />
191 <xs:enumeration value="Content" />
192 <xs:enumeration value="EmbeddedResource" />
193 </xs:restriction>
194 </xs:simpleType>
195 </xs:attribute>
196 </xs:complexType>
197 </xs:element>
198</xs:schema> \ No newline at end of file
diff --git a/Prebuild/src/data/dnpb-1.3.xsd b/Prebuild/src/data/dnpb-1.3.xsd
new file mode 100644
index 0000000..5f8ada1
--- /dev/null
+++ b/Prebuild/src/data/dnpb-1.3.xsd
@@ -0,0 +1,206 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<xs:schema elementFormDefault="qualified"
3 xmlns:xs="http://www.w3.org/2001/XMLSchema"
4 targetNamespace="http://dnpb.sourceforge.net/schemas/dnpb-1.3.xsd"
5 xmlns="http://dnpb.sourceforge.net/schemas/dnpb-1.3.xsd"
6>
7 <xs:annotation>
8 <xs:documentation>
9 Copyright (c) 2004-2005 Matthew Holmes (calefaction at houston . rr . com), Dan Moorehead (dan05a at gmail . com)
10
11 .NET Pre-Build is an XML-driven pre-build tool allowing developers to
12 easily generate project or make files for major IDE's and .NET
13 development tools including: Visual Studio 2003, Visual Studio 2002,
14 SharpDevelop, MonoDevelop, and NAnt.
15
16 BSD License:
17
18 Redistribution and use in source and binary forms, with or without modification, are permitted
19 provided that the following conditions are met:
20
21 * Redistributions of source code must retain the above copyright notice, this list of conditions
22 and the following disclaimer.
23 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
24 and the following disclaimer in the documentation and/or other materials provided with the
25 distribution.
26 * The name of the author may not be used to endorse or promote products derived from this software
27 without specific prior written permission.
28
29 THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
30 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
34 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 </xs:documentation>
37 </xs:annotation>
38
39 <xs:element name="DNPreBuild">
40 <xs:complexType>
41 <xs:sequence>
42 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
43 <xs:element ref="Solution" minOccurs="0" maxOccurs="unbounded" />
44 </xs:sequence>
45
46 <xs:attribute name="version" use="required" />
47 </xs:complexType>
48 </xs:element>
49
50 <xs:element name="Process" type="xs:string" />
51
52 <xs:element name="Solution">
53 <xs:complexType>
54 <xs:sequence>
55 <xs:element ref="Options" minOccurs="0" />
56 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
57 <xs:element ref="Files" minOccurs="0" />
58 <xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
59 </xs:sequence>
60
61 <xs:attribute name="name" type="xs:string" use="required" />
62 <xs:attribute name="path" type="xs:string" default="" />
63 </xs:complexType>
64 </xs:element>
65
66 <xs:element name="Project">
67 <xs:complexType>
68 <xs:sequence>
69 <xs:element ref="Configuration" minOccurs="0" maxOccurs="unbounded" />
70
71 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
72
73 <xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
74 <xs:complexType>
75 <xs:attribute name="name" type="xs:string" use="required" />
76 <xs:attribute name="path" type="xs:string" />
77 <xs:attribute name="localCopy" type="xs:boolean" />
78 <xs:attribute name="version" type="xs:string" />
79 </xs:complexType>
80 </xs:element>
81
82 <xs:element ref="Files" />
83 </xs:sequence>
84
85 <xs:attribute name="name" type="xs:string" use="required" />
86 <xs:attribute name="path" type="xs:string" default="" />
87 <xs:attribute name="icon" type="xs:string" default="" />
88
89 <xs:attribute name="language" default="C#">
90 <xs:simpleType>
91 <xs:restriction base="xs:string">
92 <xs:enumeration value="C#" />
93 <xs:enumeration value="VB.NET" />
94 </xs:restriction>
95 </xs:simpleType>
96 </xs:attribute>
97
98 <xs:attribute name="type" default="Exe">
99 <xs:simpleType>
100 <xs:restriction base="xs:string">
101 <xs:enumeration value="Exe" />
102 <xs:enumeration value="WinExe" />
103 <xs:enumeration value="Library" />
104 </xs:restriction>
105 </xs:simpleType>
106 </xs:attribute>
107
108 <xs:attribute name="runtime" default="Microsoft">
109 <xs:simpleType>
110 <xs:restriction base="xs:string">
111 <xs:enumeration value="Microsoft" />
112 <xs:enumeration value="Mono" />
113 </xs:restriction>
114 </xs:simpleType>
115 </xs:attribute>
116
117 <xs:attribute name="startupObject" type="xs:string" default="" />
118 <xs:attribute name="rootNamespace" type="xs:string" />
119 <xs:attribute name="assemblyName" type="xs:string" />
120 </xs:complexType>
121 </xs:element>
122
123 <xs:element name="Configuration">
124 <xs:complexType>
125 <xs:all>
126 <xs:element ref="Options" minOccurs="0" />
127 </xs:all>
128
129 <xs:attribute name="name" type="xs:string" use="required" />
130 </xs:complexType>
131 </xs:element>
132
133 <xs:element name="Options">
134 <xs:complexType>
135 <xs:all>
136 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
137 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
138 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
139 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
140 <xs:element name="WarningLevel" minOccurs="0">
141 <xs:simpleType>
142 <xs:restriction base="xs:integer">
143 <xs:minInclusive value="0" />
144 <xs:maxInclusive value="4"/>
145 </xs:restriction>
146 </xs:simpleType>
147 </xs:element>
148 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
149 <xs:element name="SupressWarnings" type="xs:string" minOccurs="0" />
150 <xs:element name="OutputPath" type="xs:string" minOccurs="0" />
151 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
152 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
153 <xs:element name="RegisterCOMInterop" type="xs:boolean" minOccurs="0" />
154 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
155 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
156 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
157 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
158 </xs:all>
159 </xs:complexType>
160 </xs:element>
161
162 <xs:element name="Files">
163 <xs:complexType>
164 <xs:sequence>
165 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
166 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
167 </xs:sequence>
168 </xs:complexType>
169 </xs:element>
170
171 <xs:element name="File">
172 <xs:complexType>
173 <xs:simpleContent>
174 <xs:extension base="xs:string">
175 <xs:attribute name="buildAction" default="Compile">
176 <xs:simpleType>
177 <xs:restriction base="xs:string">
178 <xs:enumeration value="Compile" />
179 <xs:enumeration value="Content" />
180 <xs:enumeration value="EmbeddedResource" />
181 </xs:restriction>
182 </xs:simpleType>
183 </xs:attribute>
184 </xs:extension>
185 </xs:simpleContent>
186 </xs:complexType>
187 </xs:element>
188
189 <xs:element name="Match">
190 <xs:complexType>
191 <xs:attribute name="path" type="xs:string" />
192 <xs:attribute name="pattern" type="xs:string" use="required" />
193 <xs:attribute name="recurse" type="xs:boolean" default="false" />
194 <xs:attribute name="useRegex" type="xs:boolean" default="false" />
195 <xs:attribute name="buildAction" default="Compile">
196 <xs:simpleType>
197 <xs:restriction base="xs:string">
198 <xs:enumeration value="Compile" />
199 <xs:enumeration value="Content" />
200 <xs:enumeration value="EmbeddedResource" />
201 </xs:restriction>
202 </xs:simpleType>
203 </xs:attribute>
204 </xs:complexType>
205 </xs:element>
206</xs:schema> \ No newline at end of file
diff --git a/Prebuild/src/data/dnpb-1.4.xsd b/Prebuild/src/data/dnpb-1.4.xsd
new file mode 100644
index 0000000..54f9ac0
--- /dev/null
+++ b/Prebuild/src/data/dnpb-1.4.xsd
@@ -0,0 +1,212 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<xs:schema elementFormDefault="qualified"
3 xmlns:xs="http://www.w3.org/2001/XMLSchema"
4 targetNamespace="http://dnpb.sourceforge.net/schemas/dnpb-1.4.xsd"
5 xmlns="http://dnpb.sourceforge.net/schemas/dnpb-1.4.xsd"
6>
7 <xs:annotation>
8 <xs:documentation>
9 Copyright (c) 2004-2005 Matthew Holmes (calefaction at houston . rr . com), Dan Moorehead (dan05a at gmail . com)
10
11 .NET Prebuild is a cross-platform XML-driven pre-build tool which
12 allows developers to easily generate project or make files for major
13 IDE's and .NET development tools including: Visual Studio .NET 2002 and
14 2003, SharpDevelop, MonoDevelop, and NAnt.
15
16 BSD License:
17
18 Redistribution and use in source and binary forms, with or without modification, are permitted
19 provided that the following conditions are met:
20
21 * Redistributions of source code must retain the above copyright notice, this list of conditions
22 and the following disclaimer.
23 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
24 and the following disclaimer in the documentation and/or other materials provided with the
25 distribution.
26 * The name of the author may not be used to endorse or promote products derived from this software
27 without specific prior written permission.
28
29 THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
30 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
34 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 </xs:documentation>
37 </xs:annotation>
38
39 <xs:element name="DNPreBuild">
40 <xs:complexType>
41 <xs:sequence>
42 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
43 <xs:element ref="Solution" minOccurs="0" maxOccurs="unbounded" />
44 </xs:sequence>
45
46 <xs:attribute name="version" />
47 <xs:attribute name="checkOsVars" />
48 </xs:complexType>
49 </xs:element>
50
51 <xs:element name="Process" type="xs:string" />
52
53 <xs:element name="Solution">
54 <xs:complexType>
55 <xs:sequence>
56 <xs:element ref="Options" minOccurs="0" />
57 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
58 <xs:element ref="Files" minOccurs="0" />
59 <xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
60 </xs:sequence>
61
62 <xs:attribute name="name" type="xs:string" use="required" />
63 <xs:attribute name="activeConfig" type="xs:string" default="Debug" />
64 <xs:attribute name="path" type="xs:string" default="" />
65 </xs:complexType>
66 </xs:element>
67
68 <xs:element name="Project">
69 <xs:complexType>
70 <xs:sequence>
71 <xs:element ref="Configuration" minOccurs="0" maxOccurs="unbounded" />
72
73 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
74
75 <xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
76 <xs:complexType>
77 <xs:attribute name="name" type="xs:string" use="required" />
78 <xs:attribute name="path" type="xs:string" />
79 <xs:attribute name="localCopy" type="xs:boolean" />
80 <xs:attribute name="version" type="xs:string" />
81 </xs:complexType>
82 </xs:element>
83
84 <xs:element ref="Files" />
85 </xs:sequence>
86
87 <xs:attribute name="name" type="xs:string" use="required" />
88 <xs:attribute name="path" type="xs:string" default="" />
89 <xs:attribute name="icon" type="xs:string" default="" />
90
91 <xs:attribute name="language" default="C#">
92 <xs:simpleType>
93 <xs:restriction base="xs:string">
94 <xs:enumeration value="C#" />
95 <xs:enumeration value="VB.NET" />
96 </xs:restriction>
97 </xs:simpleType>
98 </xs:attribute>
99
100 <xs:attribute name="type" default="Exe">
101 <xs:simpleType>
102 <xs:restriction base="xs:string">
103 <xs:enumeration value="Exe" />
104 <xs:enumeration value="WinExe" />
105 <xs:enumeration value="Library" />
106 </xs:restriction>
107 </xs:simpleType>
108 </xs:attribute>
109
110 <xs:attribute name="runtime" default="Microsoft">
111 <xs:simpleType>
112 <xs:restriction base="xs:string">
113 <xs:enumeration value="Microsoft" />
114 <xs:enumeration value="Mono" />
115 </xs:restriction>
116 </xs:simpleType>
117 </xs:attribute>
118
119 <xs:attribute name="startupObject" type="xs:string" default="" />
120 <xs:attribute name="rootNamespace" type="xs:string" />
121 <xs:attribute name="assemblyName" type="xs:string" />
122 </xs:complexType>
123 </xs:element>
124
125 <xs:element name="Configuration">
126 <xs:complexType>
127 <xs:sequence>
128 <xs:element ref="Options" minOccurs="0" />
129 </xs:sequence>
130
131 <xs:attribute name="name" type="xs:string" use="required" />
132 </xs:complexType>
133 </xs:element>
134
135 <xs:element name="Options">
136 <xs:complexType>
137 <xs:all>
138 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
139 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
140 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
141 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
142 <xs:element name="WarningLevel" minOccurs="0">
143 <xs:simpleType>
144 <xs:restriction base="xs:integer">
145 <xs:minInclusive value="0" />
146 <xs:maxInclusive value="4"/>
147 </xs:restriction>
148 </xs:simpleType>
149 </xs:element>
150 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
151 <xs:element name="SupressWarnings" type="xs:string" minOccurs="0" />
152 <xs:element name="OutputPath" type="xs:string" minOccurs="0" />
153 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
154 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
155 <xs:element name="RegisterCOMInterop" type="xs:boolean" minOccurs="0" />
156 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
157 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
158 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
159 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
160 </xs:all>
161 </xs:complexType>
162 </xs:element>
163
164 <xs:element name="Files">
165 <xs:complexType>
166 <xs:sequence>
167 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
168 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
169 </xs:sequence>
170 </xs:complexType>
171 </xs:element>
172
173 <xs:element name="File">
174 <xs:complexType>
175 <xs:simpleContent>
176 <xs:extension base="xs:string">
177 <xs:attribute name="buildAction" default="Compile">
178 <xs:simpleType>
179 <xs:restriction base="xs:string">
180 <xs:enumeration value="None" />
181 <xs:enumeration value="Compile" />
182 <xs:enumeration value="Content" />
183 <xs:enumeration value="EmbeddedResource" />
184 </xs:restriction>
185 </xs:simpleType>
186 </xs:attribute>
187 </xs:extension>
188 </xs:simpleContent>
189 </xs:complexType>
190 </xs:element>
191
192 <xs:element name="Match">
193 <xs:complexType>
194 <xs:attribute name="path" type="xs:string" />
195 <xs:attribute name="pattern" type="xs:string" use="required" />
196 <xs:attribute name="recurse" type="xs:boolean" default="false" />
197 <xs:attribute name="useRegex" type="xs:boolean" default="false" />
198 <xs:attribute name="buildAction" default="Compile">
199 <xs:simpleType>
200 <xs:restriction base="xs:string">
201 <xs:enumeration value="None" />
202 <xs:enumeration value="Compile" />
203 <xs:enumeration value="Content" />
204 <xs:enumeration value="EmbeddedResource" />
205 </xs:restriction>
206 </xs:simpleType>
207 </xs:attribute>
208 </xs:complexType>
209 </xs:element>
210</xs:schema>
211
212
diff --git a/Prebuild/src/data/dnpb-1.5.xsd b/Prebuild/src/data/dnpb-1.5.xsd
new file mode 100644
index 0000000..2270e83
--- /dev/null
+++ b/Prebuild/src/data/dnpb-1.5.xsd
@@ -0,0 +1,215 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<xs:schema elementFormDefault="qualified"
3 xmlns:xs="http://www.w3.org/2001/XMLSchema"
4 targetNamespace="http://dnpb.sourceforge.net/schemas/dnpb-1.5.xsd"
5 xmlns="http://dnpb.sourceforge.net/schemas/dnpb-1.5.xsd"
6>
7 <xs:annotation>
8 <xs:documentation>
9 Copyright (c) 2004-2005 Matthew Holmes (calefaction at houston . rr . com), Dan Moorehead (dan05a at gmail . com)
10
11 .NET Prebuild is a cross-platform XML-driven pre-build tool which
12 allows developers to easily generate project or make files for major
13 IDE's and .NET development tools including: Visual Studio .NET 2002 and
14 2003, SharpDevelop, MonoDevelop, and NAnt.
15
16 BSD License:
17
18 Redistribution and use in source and binary forms, with or without modification, are permitted
19 provided that the following conditions are met:
20
21 * Redistributions of source code must retain the above copyright notice, this list of conditions
22 and the following disclaimer.
23 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
24 and the following disclaimer in the documentation and/or other materials provided with the
25 distribution.
26 * The name of the author may not be used to endorse or promote products derived from this software
27 without specific prior written permission.
28
29 THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
30 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
34 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 </xs:documentation>
37 </xs:annotation>
38
39 <xs:element name="DNPreBuild">
40 <xs:complexType>
41 <xs:sequence>
42 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
43 <xs:element ref="Solution" minOccurs="0" maxOccurs="unbounded" />
44 </xs:sequence>
45
46 <xs:attribute name="version" />
47 <xs:attribute name="checkOsVars" />
48 </xs:complexType>
49 </xs:element>
50
51 <xs:element name="Process" type="xs:string" />
52
53 <xs:element name="Solution">
54 <xs:complexType>
55 <xs:sequence>
56 <xs:element ref="Options" minOccurs="0" />
57 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
58 <xs:element ref="Files" minOccurs="0" />
59 <xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
60 </xs:sequence>
61
62 <xs:attribute name="name" type="xs:string" use="required" />
63 <xs:attribute name="activeConfig" type="xs:string" default="Debug" />
64 <xs:attribute name="path" type="xs:string" default="" />
65 </xs:complexType>
66 </xs:element>
67
68 <xs:element name="Project">
69 <xs:complexType>
70 <xs:sequence>
71 <xs:element ref="Configuration" minOccurs="0" maxOccurs="unbounded" />
72
73 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
74
75 <xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
76 <xs:complexType>
77 <xs:attribute name="name" type="xs:string" use="required" />
78 <xs:attribute name="path" type="xs:string" />
79 <xs:attribute name="localCopy" type="xs:boolean" />
80 <xs:attribute name="version" type="xs:string" />
81 </xs:complexType>
82 </xs:element>
83
84 <xs:element ref="Files" />
85 </xs:sequence>
86
87 <xs:attribute name="name" type="xs:string" use="required" />
88 <xs:attribute name="filterGroups" type="xs:string" default="" />
89 <xs:attribute name="path" type="xs:string" default="" />
90 <xs:attribute name="icon" type="xs:string" default="" />
91
92 <xs:attribute name="language" default="C#">
93 <xs:simpleType>
94 <xs:restriction base="xs:string">
95 <xs:enumeration value="C#" />
96 <xs:enumeration value="VB.NET" />
97 </xs:restriction>
98 </xs:simpleType>
99 </xs:attribute>
100
101 <xs:attribute name="type" default="Exe">
102 <xs:simpleType>
103 <xs:restriction base="xs:string">
104 <xs:enumeration value="Exe" />
105 <xs:enumeration value="WinExe" />
106 <xs:enumeration value="Library" />
107 </xs:restriction>
108 </xs:simpleType>
109 </xs:attribute>
110
111 <xs:attribute name="runtime" default="Microsoft">
112 <xs:simpleType>
113 <xs:restriction base="xs:string">
114 <xs:enumeration value="Microsoft" />
115 <xs:enumeration value="Mono" />
116 </xs:restriction>
117 </xs:simpleType>
118 </xs:attribute>
119
120 <xs:attribute name="startupObject" type="xs:string" default="" />
121 <xs:attribute name="rootNamespace" type="xs:string" />
122 <xs:attribute name="assemblyName" type="xs:string" />
123 </xs:complexType>
124 </xs:element>
125
126 <xs:element name="Configuration">
127 <xs:complexType>
128 <xs:sequence>
129 <xs:element ref="Options" minOccurs="0" />
130 </xs:sequence>
131
132 <xs:attribute name="name" type="xs:string" use="required" />
133 </xs:complexType>
134 </xs:element>
135
136 <xs:element name="Options">
137 <xs:complexType>
138 <xs:all>
139 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
140 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
141 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
142 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
143 <xs:element name="WarningLevel" minOccurs="0">
144 <xs:simpleType>
145 <xs:restriction base="xs:integer">
146 <xs:minInclusive value="0" />
147 <xs:maxInclusive value="4"/>
148 </xs:restriction>
149 </xs:simpleType>
150 </xs:element>
151 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
152 <xs:element name="SupressWarnings" type="xs:string" minOccurs="0" />
153 <xs:element name="OutputPath" type="xs:string" minOccurs="0" />
154 <xs:element name="GenerateXmlDocFile" type="xs:boolean" minOccurs="0" />
155 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
156 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
157 <xs:element name="RegisterCOMInterop" type="xs:boolean" minOccurs="0" />
158 <xs:element name="RemoveIntegerChecks" type="xs:boolean" minOccurs="0" />
159 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
160 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
161 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
162 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
163 </xs:all>
164 </xs:complexType>
165 </xs:element>
166
167 <xs:element name="Files">
168 <xs:complexType>
169 <xs:sequence>
170 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
171 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
172 </xs:sequence>
173 </xs:complexType>
174 </xs:element>
175
176 <xs:element name="File">
177 <xs:complexType>
178 <xs:simpleContent>
179 <xs:extension base="xs:string">
180 <xs:attribute name="buildAction" default="Compile">
181 <xs:simpleType>
182 <xs:restriction base="xs:string">
183 <xs:enumeration value="None" />
184 <xs:enumeration value="Compile" />
185 <xs:enumeration value="Content" />
186 <xs:enumeration value="EmbeddedResource" />
187 </xs:restriction>
188 </xs:simpleType>
189 </xs:attribute>
190 </xs:extension>
191 </xs:simpleContent>
192 </xs:complexType>
193 </xs:element>
194
195 <xs:element name="Match">
196 <xs:complexType>
197 <xs:attribute name="path" type="xs:string" />
198 <xs:attribute name="pattern" type="xs:string" use="required" />
199 <xs:attribute name="recurse" type="xs:boolean" default="false" />
200 <xs:attribute name="useRegex" type="xs:boolean" default="false" />
201 <xs:attribute name="buildAction" default="Compile">
202 <xs:simpleType>
203 <xs:restriction base="xs:string">
204 <xs:enumeration value="None" />
205 <xs:enumeration value="Compile" />
206 <xs:enumeration value="Content" />
207 <xs:enumeration value="EmbeddedResource" />
208 </xs:restriction>
209 </xs:simpleType>
210 </xs:attribute>
211 </xs:complexType>
212 </xs:element>
213</xs:schema>
214
215
diff --git a/Prebuild/src/data/prebuild-1.6.xsd b/Prebuild/src/data/prebuild-1.6.xsd
new file mode 100644
index 0000000..f944faf
--- /dev/null
+++ b/Prebuild/src/data/prebuild-1.6.xsd
@@ -0,0 +1,231 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd"
3 xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd">
4 <xs:annotation>
5 <xs:documentation>
6 Copyright (c) 2004-2005 Matthew Holmes (calefaction at houston . rr . com), Dan Moorehead (dan05a at gmail . com)
7
8 .NET Prebuild is a cross-platform XML-driven pre-build tool which
9 allows developers to easily generate project or make files for major
10 IDE's and .NET development tools including: Visual Studio .NET 2002 and
11 2003, SharpDevelop, MonoDevelop, and NAnt.
12
13 BSD License:
14
15 Redistribution and use in source and binary forms, with or without modification, are permitted
16 provided that the following conditions are met:
17
18 * Redistributions of source code must retain the above copyright notice, this list of conditions
19 and the following disclaimer.
20 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
21 and the following disclaimer in the documentation and/or other materials provided with the
22 distribution.
23 * The name of the author may not be used to endorse or promote products derived from this software
24 without specific prior written permission.
25
26 THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
27 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
31 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 </xs:documentation>
34 </xs:annotation>
35 <xs:element name="Prebuild">
36 <xs:complexType>
37 <xs:sequence>
38 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
39 <xs:element ref="Solution" minOccurs="0" maxOccurs="unbounded" />
40 </xs:sequence>
41 <xs:attribute name="version" />
42 <xs:attribute name="checkOsVars" />
43 </xs:complexType>
44 </xs:element>
45 <xs:element name="Process" type="xs:string" />
46 <xs:element name="Solution">
47 <xs:complexType>
48 <xs:sequence>
49 <xs:element ref="Options" minOccurs="0" />
50 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
51 <xs:element ref="Files" minOccurs="0" />
52 <xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
53 </xs:sequence>
54 <xs:attribute name="name" type="xs:string" use="required" />
55 <xs:attribute name="activeConfig" type="xs:string" default="Debug" />
56 <xs:attribute name="path" type="xs:string" default="" />
57 </xs:complexType>
58 </xs:element>
59 <xs:element name="Project">
60 <xs:complexType>
61 <xs:sequence>
62 <xs:element ref="Configuration" minOccurs="0" maxOccurs="unbounded" />
63 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
64 <xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
65 <xs:complexType>
66 <xs:attribute name="name" type="xs:string" use="required" />
67 <xs:attribute name="path" type="xs:string" />
68 <xs:attribute name="localCopy" type="xs:boolean" />
69 <xs:attribute name="version" type="xs:string" />
70 </xs:complexType>
71 </xs:element>
72 <xs:element ref="Files" />
73 </xs:sequence>
74 <xs:attribute name="name" type="xs:string" use="required" />
75 <xs:attribute name="filterGroups" type="xs:string" default="" />
76 <xs:attribute name="path" type="xs:string" default="" />
77 <xs:attribute name="icon" type="xs:string" default="" />
78 <xs:attribute name="language" default="C#">
79 <xs:simpleType>
80 <xs:restriction base="xs:string">
81 <xs:enumeration value="C#" />
82 <xs:enumeration value="VB.NET" />
83 </xs:restriction>
84 </xs:simpleType>
85 </xs:attribute>
86 <xs:attribute name="type" default="Exe">
87 <xs:simpleType>
88 <xs:restriction base="xs:string">
89 <xs:enumeration value="Exe" />
90 <xs:enumeration value="WinExe" />
91 <xs:enumeration value="Library" />
92 </xs:restriction>
93 </xs:simpleType>
94 </xs:attribute>
95 <xs:attribute name="runtime" default="Microsoft">
96 <xs:simpleType>
97 <xs:restriction base="xs:string">
98 <xs:enumeration value="Microsoft" />
99 <xs:enumeration value="Mono" />
100 </xs:restriction>
101 </xs:simpleType>
102 </xs:attribute>
103 <xs:attribute name="startupObject" type="xs:string" default="" />
104 <xs:attribute name="rootNamespace" type="xs:string" />
105 <xs:attribute name="assemblyName" type="xs:string" />
106 </xs:complexType>
107 </xs:element>
108 <xs:element name="Configuration">
109 <xs:complexType>
110 <xs:sequence>
111 <xs:element ref="Options" minOccurs="0" />
112 </xs:sequence>
113 <xs:attribute name="name" type="xs:string" use="required" />
114 </xs:complexType>
115 </xs:element>
116 <xs:element name="Options">
117 <xs:complexType>
118 <xs:all>
119 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
120 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
121 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
122 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
123 <xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" />
124 <xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" />
125 <xs:element name="RunPostBuildEvent" minOccurs="0" default="OnBuildSuccess">
126 <xs:simpleType>
127 <xs:restriction base="xs:string">
128 <xs:enumeration value="OnBuildSuccess" />
129 <xs:enumeration value="Always" />
130 <xs:enumeration value="OnOutputUpdated" />
131 </xs:restriction>
132 </xs:simpleType>
133 </xs:element>
134 <xs:element name="RunScript" type="xs:string" minOccurs="0" />
135 <xs:element name="PreBuildEventArgs" type="xs:string" minOccurs="0" />
136 <xs:element name="PostBuildEventArgs" type="xs:string" minOccurs="0" />
137 <xs:element name="WarningLevel" minOccurs="0">
138 <xs:simpleType>
139 <xs:restriction base="xs:integer">
140 <xs:minInclusive value="0" />
141 <xs:maxInclusive value="4" />
142 </xs:restriction>
143 </xs:simpleType>
144 </xs:element>
145 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
146 <xs:element name="SuppressWarnings" type="xs:string" minOccurs="0" />
147 <xs:element name="OutputPath" type="xs:string" minOccurs="0" />
148 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
149 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
150 <xs:element name="RegisterComInterop" type="xs:boolean" minOccurs="0" />
151 <xs:element name="RemoveIntegerChecks" type="xs:boolean" minOccurs="0" />
152 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
153 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
154 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
155 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
156 </xs:all>
157 </xs:complexType>
158 </xs:element>
159 <xs:element name="Files">
160 <xs:complexType>
161 <xs:sequence>
162 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
163 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
164 </xs:sequence>
165 </xs:complexType>
166 </xs:element>
167 <xs:element name="File">
168 <xs:complexType>
169 <xs:simpleContent>
170 <xs:extension base="xs:string">
171 <xs:attribute name="buildAction" default="Compile">
172 <xs:simpleType>
173 <xs:restriction base="xs:string">
174 <xs:enumeration value="None" />
175 <xs:enumeration value="Compile" />
176 <xs:enumeration value="Content" />
177 <xs:enumeration value="EmbeddedResource" />
178 </xs:restriction>
179 </xs:simpleType>
180 </xs:attribute>
181 <xs:attribute name="subType" default="Code">
182 <xs:simpleType>
183 <xs:restriction base="xs:string">
184 <xs:enumeration value="Code" />
185 <xs:enumeration value="Component" />
186 <xs:enumeration value="Form" />
187 <xs:enumeration value="UserControl" />
188 </xs:restriction>
189 </xs:simpleType>
190 </xs:attribute>
191 </xs:extension>
192 </xs:simpleContent>
193 </xs:complexType>
194 </xs:element>
195 <xs:element name="Match">
196 <xs:complexType>
197 <xs:sequence>
198 <xs:element ref="Exclude" minOccurs="0" />
199 </xs:sequence>
200 <xs:attribute name="path" type="xs:string" />
201 <xs:attribute name="pattern" type="xs:string" use="required" />
202 <xs:attribute name="recurse" type="xs:boolean" default="false" />
203 <xs:attribute name="useRegex" type="xs:boolean" default="false" />
204 <xs:attribute name="buildAction" default="Compile">
205 <xs:simpleType>
206 <xs:restriction base="xs:string">
207 <xs:enumeration value="None" />
208 <xs:enumeration value="Compile" />
209 <xs:enumeration value="Content" />
210 <xs:enumeration value="EmbeddedResource" />
211 </xs:restriction>
212 </xs:simpleType>
213 </xs:attribute>
214 <xs:attribute name="subType" default="Code">
215 <xs:simpleType>
216 <xs:restriction base="xs:string">
217 <xs:enumeration value="Code" />
218 <xs:enumeration value="Component" />
219 <xs:enumeration value="Form" />
220 <xs:enumeration value="UserControl" />
221 </xs:restriction>
222 </xs:simpleType>
223 </xs:attribute>
224 </xs:complexType>
225 </xs:element>
226 <xs:element name="Exclude">
227 <xs:complexType>
228 <xs:attribute name="name" type="xs:string" use="required" />
229 </xs:complexType>
230 </xs:element>
231</xs:schema>
diff --git a/Prebuild/src/data/prebuild-1.7.xsd b/Prebuild/src/data/prebuild-1.7.xsd
new file mode 100644
index 0000000..9d63ce6
--- /dev/null
+++ b/Prebuild/src/data/prebuild-1.7.xsd
@@ -0,0 +1,261 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
3 xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
4 <xs:annotation>
5 <xs:documentation>
6 Copyright (c) 2004-2005 Matthew Holmes (calefaction at houston . rr . com), Dan Moorehead (dan05a at gmail . com), David Hudson (jendave at yahoo dot com)
7
8 .NET Prebuild is a cross-platform XML-driven pre-build tool which
9 allows developers to easily generate project or make files for major
10 IDE's and .NET development tools including: Visual Studio .NET 2002 and
11 2003, SharpDevelop, MonoDevelop, and NAnt.
12
13 BSD License:
14
15 Redistribution and use in source and binary forms, with or without modification, are permitted
16 provided that the following conditions are met:
17
18 * Redistributions of source code must retain the above copyright notice, this list of conditions
19 and the following disclaimer.
20 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
21 and the following disclaimer in the documentation and/or other materials provided with the
22 distribution.
23 * The name of the author may not be used to endorse or promote products derived from this software
24 without specific prior written permission.
25
26 THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
27 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
31 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 </xs:documentation>
34 </xs:annotation>
35 <xs:element name="Prebuild">
36 <xs:complexType>
37 <xs:sequence>
38 <xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
39 <xs:element ref="Solution" minOccurs="0" maxOccurs="unbounded" />
40 </xs:sequence>
41 <xs:attribute name="version" />
42 <xs:attribute name="checkOsVars" />
43 </xs:complexType>
44 </xs:element>
45 <xs:element name="Process" type="xs:string" />
46 <xs:element name="Solution">
47 <xs:complexType>
48 <xs:sequence>
49 <xs:element ref="Options" minOccurs="0" />
50 <xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
51 <xs:element ref="Files" minOccurs="0" />
52 <xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
53 </xs:sequence>
54 <xs:attribute name="name" type="xs:string" use="required" />
55 <xs:attribute name="activeConfig" type="xs:string" default="Debug" />
56 <xs:attribute name="path" type="xs:string" default="" />
57 <xs:attribute name="version" type="xs:string" default="1.0.0" />
58 </xs:complexType>
59 </xs:element>
60 <xs:element name="Project">
61 <xs:complexType>
62 <xs:sequence>
63 <xs:element ref="Configuration" minOccurs="0" maxOccurs="unbounded" />
64 <xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
65 <xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
66 <xs:complexType>
67 <xs:attribute name="name" type="xs:string" use="required" />
68 <xs:attribute name="path" type="xs:string" />
69 <xs:attribute name="localCopy" type="xs:boolean" />
70 <xs:attribute name="version" type="xs:string" default="1.0.0"/>
71 </xs:complexType>
72 </xs:element>
73 <xs:element ref="Files" />
74 </xs:sequence>
75 <xs:attribute name="name" type="xs:string" use="required" />
76 <xs:attribute name="designerFolder" type="xs:string" default="" />
77 <xs:attribute name="filterGroups" type="xs:string" default="" />
78 <xs:attribute name="path" type="xs:string" default="" />
79 <xs:attribute name="icon" type="xs:string" default="" />
80 <xs:attribute name="language" default="C#">
81 <xs:simpleType>
82 <xs:restriction base="xs:string">
83 <xs:enumeration value="C#" />
84 <xs:enumeration value="VB.NET" />
85 </xs:restriction>
86 </xs:simpleType>
87 </xs:attribute>
88 <xs:attribute name="type" default="Exe">
89 <xs:simpleType>
90 <xs:restriction base="xs:string">
91 <xs:enumeration value="Exe" />
92 <xs:enumeration value="WinExe" />
93 <xs:enumeration value="Library" />
94 </xs:restriction>
95 </xs:simpleType>
96 </xs:attribute>
97 <xs:attribute name="runtime" default="Microsoft">
98 <xs:simpleType>
99 <xs:restriction base="xs:string">
100 <xs:enumeration value="Microsoft" />
101 <xs:enumeration value="Mono" />
102 </xs:restriction>
103 </xs:simpleType>
104 </xs:attribute>
105 <xs:attribute name="startupObject" type="xs:string" default="" />
106 <xs:attribute name="rootNamespace" type="xs:string" />
107 <xs:attribute name="assemblyName" type="xs:string" />
108 <xs:attribute name="generateAssemblyInfoFile" type="xs:boolean" default="false"/>
109 </xs:complexType>
110 </xs:element>
111 <xs:element name="Configuration">
112 <xs:complexType>
113 <xs:sequence>
114 <xs:element ref="Options" minOccurs="0" />
115 </xs:sequence>
116 <xs:attribute name="name" type="xs:string" use="required" />
117 </xs:complexType>
118 </xs:element>
119 <xs:element name="Options">
120 <xs:complexType>
121 <xs:all>
122 <xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
123 <xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
124 <xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
125 <xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
126 <xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" />
127 <xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" />
128 <xs:element name="RunPostBuildEvent" minOccurs="0" default="OnBuildSuccess">
129 <xs:simpleType>
130 <xs:restriction base="xs:string">
131 <xs:enumeration value="OnBuildSuccess" />
132 <xs:enumeration value="Always" />
133 <xs:enumeration value="OnOutputUpdated" />
134 </xs:restriction>
135 </xs:simpleType>
136 </xs:element>
137 <xs:element name="RunScript" type="xs:string" minOccurs="0" />
138 <xs:element name="PreBuildEventArgs" type="xs:string" minOccurs="0" />
139 <xs:element name="PostBuildEventArgs" type="xs:string" minOccurs="0" />
140 <xs:element name="WarningLevel" minOccurs="0">
141 <xs:simpleType>
142 <xs:restriction base="xs:integer">
143 <xs:minInclusive value="0" />
144 <xs:maxInclusive value="4" />
145 </xs:restriction>
146 </xs:simpleType>
147 </xs:element>
148 <xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
149 <xs:element name="SuppressWarnings" type="xs:string" minOccurs="0" />
150 <xs:element name="OutputPath" type="xs:string" minOccurs="0" />
151 <xs:element name="GenerateDocumentation" type="xs:boolean" minOccurs="0" />
152 <xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
153 <xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
154 <xs:element name="RegisterComInterop" type="xs:boolean" minOccurs="0" />
155 <xs:element name="RemoveIntegerChecks" type="xs:boolean" minOccurs="0" />
156 <xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
157 <xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
158 <xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
159 <xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
160 <xs:element name="KeyFile" type="xs:string" minOccurs="0" />
161 </xs:all>
162 </xs:complexType>
163 </xs:element>
164 <xs:element name="Files">
165 <xs:complexType>
166 <xs:sequence>
167 <xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
168 <xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
169 </xs:sequence>
170 </xs:complexType>
171 </xs:element>
172 <xs:element name="File">
173 <xs:complexType>
174 <xs:simpleContent>
175 <xs:extension base="xs:string">
176 <xs:attribute name="resourceName" type="xs:string" default="" />
177 <xs:attribute name="buildAction" default="Compile">
178 <xs:simpleType>
179 <xs:restriction base="xs:string">
180 <xs:enumeration value="None" />
181 <xs:enumeration value="Compile" />
182 <xs:enumeration value="Content" />
183 <xs:enumeration value="EmbeddedResource" />
184 </xs:restriction>
185 </xs:simpleType>
186 </xs:attribute>
187 <xs:attribute name="subType" default="Code">
188 <xs:simpleType>
189 <xs:restriction base="xs:string">
190 <xs:enumeration value="Code" />
191 <xs:enumeration value="Component" />
192 <xs:enumeration value="Form" />
193 <xs:enumeration value="Settings" />
194 <xs:enumeration value="UserControl" />
195 </xs:restriction>
196 </xs:simpleType>
197 </xs:attribute>
198 <xs:attribute name="link" type="xs:boolean" />
199 <xs:attribute name="copyToOutput" default="Never">
200 <xs:simpleType>
201 <xs:restriction base="xs:string">
202 <xs:enumeration value="Never" />
203 <xs:enumeration value="Always" />
204 <xs:enumeration value="PreserveNewest" />
205 </xs:restriction>
206 </xs:simpleType>
207 </xs:attribute>
208 </xs:extension>
209 </xs:simpleContent>
210 </xs:complexType>
211 </xs:element>
212 <xs:element name="Match">
213 <xs:complexType>
214 <xs:sequence>
215 <xs:element ref="Exclude" minOccurs="0" maxOccurs="unbounded" />
216 </xs:sequence>
217 <xs:attribute name="path" type="xs:string" />
218 <xs:attribute name="pattern" type="xs:string" use="required" />
219 <xs:attribute name="recurse" type="xs:boolean" default="false" />
220 <xs:attribute name="useRegex" type="xs:boolean" default="false" />
221 <xs:attribute name="buildAction" default="Compile">
222 <xs:simpleType>
223 <xs:restriction base="xs:string">
224 <xs:enumeration value="None" />
225 <xs:enumeration value="Compile" />
226 <xs:enumeration value="Content" />
227 <xs:enumeration value="EmbeddedResource" />
228 </xs:restriction>
229 </xs:simpleType>
230 </xs:attribute>
231 <xs:attribute name="resourceName" type="xs:string" default="" />
232 <xs:attribute name="subType" default="Code">
233 <xs:simpleType>
234 <xs:restriction base="xs:string">
235 <xs:enumeration value="Code" />
236 <xs:enumeration value="Component" />
237 <xs:enumeration value="Designer" />
238 <xs:enumeration value="Form" />
239 <xs:enumeration value="Settings" />
240 <xs:enumeration value="UserControl" />
241 </xs:restriction>
242 </xs:simpleType>
243 </xs:attribute>
244 <xs:attribute name="link" type="xs:boolean" />
245 <xs:attribute name="copyToOutput" default="Never">
246 <xs:simpleType>
247 <xs:restriction base="xs:string">
248 <xs:enumeration value="Never" />
249 <xs:enumeration value="Always" />
250 <xs:enumeration value="PreserveNewest" />
251 </xs:restriction>
252 </xs:simpleType>
253 </xs:attribute>
254 </xs:complexType>
255 </xs:element>
256 <xs:element name="Exclude">
257 <xs:complexType>
258 <xs:attribute name="name" type="xs:string" use="required" />
259 </xs:complexType>
260 </xs:element>
261</xs:schema>
diff --git a/libraries/libLSL/Properties/AssemblyInfo.cs b/libraries/libLSL/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..205dd95
--- /dev/null
+++ b/libraries/libLSL/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("libLSL")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("libLSL")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("65895724-efca-49f8-8efc-211594b4c716")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/libraries/libLSL/libLSL.csproj b/libraries/libLSL/libLSL.csproj
new file mode 100644
index 0000000..fe8822b
--- /dev/null
+++ b/libraries/libLSL/libLSL.csproj
@@ -0,0 +1,49 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ProductVersion>8.0.50727</ProductVersion>
6 <SchemaVersion>2.0</SchemaVersion>
7 <ProjectGuid>{E213BD9C-85C9-4739-B613-E1B58543370C}</ProjectGuid>
8 <OutputType>Library</OutputType>
9 <AppDesignerFolder>Properties</AppDesignerFolder>
10 <RootNamespace>libLSL</RootNamespace>
11 <AssemblyName>libLSL</AssemblyName>
12 </PropertyGroup>
13 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
14 <DebugSymbols>true</DebugSymbols>
15 <DebugType>full</DebugType>
16 <Optimize>false</Optimize>
17 <OutputPath>bin\Debug\</OutputPath>
18 <DefineConstants>DEBUG;TRACE</DefineConstants>
19 <ErrorReport>prompt</ErrorReport>
20 <WarningLevel>4</WarningLevel>
21 </PropertyGroup>
22 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
23 <DebugType>pdbonly</DebugType>
24 <Optimize>true</Optimize>
25 <OutputPath>bin\Release\</OutputPath>
26 <DefineConstants>TRACE</DefineConstants>
27 <ErrorReport>prompt</ErrorReport>
28 <WarningLevel>4</WarningLevel>
29 </PropertyGroup>
30 <ItemGroup>
31 <Reference Include="System" />
32 <Reference Include="System.Data" />
33 <Reference Include="System.Xml" />
34 </ItemGroup>
35 <ItemGroup>
36 <Compile Include="lsl.cs" />
37 <Compile Include="lslByteCode.cs" />
38 <Compile Include="lslscript.cs" />
39 <Compile Include="Properties\AssemblyInfo.cs" />
40 </ItemGroup>
41 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
42 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
43 Other similar extension points exist, see Microsoft.Common.targets.
44 <Target Name="BeforeBuild">
45 </Target>
46 <Target Name="AfterBuild">
47 </Target>
48 -->
49</Project> \ No newline at end of file
diff --git a/libraries/libLSL/lsl.cs b/libraries/libLSL/lsl.cs
new file mode 100644
index 0000000..37a6429
--- /dev/null
+++ b/libraries/libLSL/lsl.cs
@@ -0,0 +1,329 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace libLSL
6{
7
8
9 enum lslVarType : byte
10 {
11 VARTYPE_VOID = 0,
12 VARTYPE_INTEGER = 1,
13 VARTYPE_FLOAT = 2,
14 VARTYPE_STRING = 3,
15 VARTYPE_KEY = 4,
16 VARTYPE_VECTOR = 5,
17 VARTYPE_ROTATION = 6,
18 VARTYPE_LIST = 7
19 }
20
21 enum lslEventType : byte
22 {
23 EVENT_STATE_ENTRY = 0,
24 EVENT_STATE_EXIT = 1,
25 EVENT_TOUCH_START = 2,
26 EVENT_TOUCH = 3,
27 EVENT_TOUCH_END = 4,
28 EVENT_COLLISION_START = 5,
29 EVENT_COLLISION = 6,
30 EVENT_COLLISION_END = 7,
31 EVENT_LAND_COLLISION_START = 8,
32 EVENT_LAND_COLLISION = 9,
33 EVENT_LAND_COLLISION_END = 10,
34 EVENT_TIMER = 11,
35 EVENT_LISTEN = 12,
36 EVENT_ON_REZ = 13,
37 EVENT_SENSOR = 14,
38 EVENT_NO_SENSOR = 15,
39 EVENT_CONTROL = 16,
40 EVENT_MONEY = 17,
41 EVENT_EMAIL = 18,
42 EVENT_AT_TARGET = 19,
43 EVENT_NOT_AT_TARGET = 20,
44 EVENT_AT_ROT_TARGET = 21,
45 EVENT_NOT_AT_ROT_TARGET = 22,
46 EVENT_RUN_TIME_PERMISSIONS = 23,
47 EVENT_CHANGED = 24,
48 EVENT_ATTACH = 25,
49 EVENT_DATASERVER = 26,
50 EVENT_LINK_MESSAGE = 27,
51 EVENT_MOVING_START = 28,
52 EVENT_MOVING_END = 29,
53 EVENT_OBJECT_REZ = 30,
54 EVENT_REMOTE_DATA = 31,
55 EVENT_HTTP_RESPONSE = 32
56 }
57
58 enum lslOpcodes : byte
59 {
60 // No Operation
61 OP_NOOP = 0x00,
62
63 // Pops
64 OP_POP = 0x01,
65 OP_POPS = 0x02,
66 OP_POPL = 0x03,
67 OP_POPV = 0x04,
68 OP_POPQ = 0x05,
69 OP_POPARG = 0x06,
70 OP_POPIP = 0x07,
71 OP_POPBP = 0x08,
72 OP_POPSP = 0x09,
73 OP_POPSLR = 0x0A,
74
75 // Dupes
76 OP_DUP = 0x20,
77 OP_DUPS = 0x21,
78 OP_DUPL = 0x22,
79 OP_DUPV = 0x23,
80 OP_DUPQ = 0x24,
81
82 // Stores
83 OP_STORE = 0x30,
84 OP_STORES = 0x31,
85 OP_STOREL = 0x32,
86 OP_STOREV = 0x33,
87 OP_STOREQ = 0x34,
88 OP_STOREG = 0x35,
89 OP_STOREGS = 0x36,
90 OP_STOREGL = 0x37,
91 OP_STOREGV = 0x38,
92 OP_STOREGQ = 0x39,
93
94 // Loads
95 OP_LOADP = 0x3A,
96 OP_LOADSP = 0x3B,
97 OP_LOADLP = 0x3C,
98 OP_LOADVP = 0x3D,
99 OP_LOADQP = 0x3E,
100 OP_LOADGP = 0x3F,
101 OP_LOADGSP = 0x40,
102 OP_LOADGLP = 0x41,
103 OP_LOADGVP = 0x42,
104 OP_LOADGQP = 0x43,
105
106 // Pushes
107 OP_PUSH = 0x50,
108 OP_PUSHS = 0x51,
109 OP_PUSHL = 0x52,
110 OP_PUSHV = 0x53,
111 OP_PUSHQ = 0x54,
112 OP_PUSHG = 0x55,
113 OP_PUSHGS = 0x56,
114 OP_PUSHGL = 0x57,
115 OP_PUSHGV = 0x58,
116 OP_PUSHGQ = 0x59,
117 OP_PUSHIP = 0x5A,
118 OP_PUSHBP = 0x5B,
119 OP_PUSHSP = 0x5C,
120 OP_PUSHARGB = 0x5D,
121 OP_PUSHARGI = 0x5E,
122 OP_PUSHARGF = 0x5F,
123 OP_PUSHARGS = 0x60,
124 OP_PUSHARGV = 0x61,
125 OP_PUSHARGQ = 0x62,
126 OP_PUSHE = 0x63,
127 OP_PUSHEV = 0x64,
128 OP_PUSHEQ = 0x65,
129 OP_PUSHARGE = 0x66,
130
131 // Numerics
132 OP_ADD = 0x70,
133 OP_SUB = 0x71,
134 OP_MUL = 0x72,
135 OP_DIV = 0x73,
136 OP_MOD = 0x74,
137 OP_EQ = 0x75,
138 OP_NEQ = 0x76,
139 OP_LEQ = 0x77,
140 OP_GEQ = 0x78,
141 OP_LESS = 0x79,
142 OP_GREATER = 0x7A,
143 OP_BITAND = 0x7B,
144 OP_BITOR = 0x7C,
145 OP_BITXOR = 0x7D,
146 OP_BOOLAND = 0x7E,
147 OP_BOOLOR = 0x7F,
148 OP_NEG = 0x80,
149 OP_BITNOT = 0x81,
150 OP_BOOLNOT = 0x82,
151
152 // Sequence
153 OP_JUMP = 0x90,
154 OP_JUMPIF = 0x91,
155 OP_JUMPNIF = 0x92,
156 OP_STATE = 0x93,
157 OP_CALL = 0x94,
158 OP_RETURN = 0x95,
159
160 // Cast
161 OP_CAST = 0xA0,
162
163 // Stack
164 OP_STACKTOS = 0xB0,
165 OP_STACKTOL = 0xB1,
166
167 // Debug
168 OP_PRINT = 0xC0,
169
170 // Library
171 OP_CALLLIB = 0xD0,
172 OP_CALLLIB_TWO_BYTE = 0xD1,
173
174 // More Numerics
175 OP_SHL = 0xE0,
176 OP_SHR = 0xE1
177 }
178
179 class lslHeader
180 {
181 int TM; // Top of memory
182 int IP; // Instruction pointer
183 int VN; // Version Number (0x00000200)
184 int BP; // Base Pointer
185 int SP; // Stack Pointer
186 int HR; // Heap Register
187 int HP; // Heap Pointer
188 int CS; // Current State
189 int NS; // Next State
190 int CE; // Current Events (Which events need running still?)
191 int IE; // In Event
192 int ER; // Event Register
193 int FR; // Fault Register
194 int SLR; // Sleep Register
195 int GVR; // Global Variable Register (Pointer)
196 int GFR; // Global Function Register (Pointer)
197 int PR; // Parameter Register - OnRez Int?
198 int ESR; // Energy Supply Register
199 int SR; // State Register
200 long NCE; // Extended Current Events
201 long NIE; // Extended In Event
202 long NER; // Extended Event Register
203
204 public void readFromBytes(byte[] data)
205 {
206
207 }
208 }
209
210 class lslStaticBlock
211 {
212 int length; // Length (bytes)
213 lslVarType varType;// Variable Type
214 byte unknown; // Unknown
215 Object varObject; // Variable Object
216
217 public void readFromBytes(byte[] data)
218 {
219
220 }
221
222 }
223
224 class lslHeapBlock
225 {
226 int length;
227 lslVarType varType;
228 short referenceCount;
229 Object varObject;
230
231 public void readFromBytes(byte[] data)
232 {
233
234 }
235 }
236
237 class lslStatePointer
238 {
239 int location;
240 long eventMask;
241
242 public void readFromBytes(byte[] data)
243 {
244
245 }
246 }
247
248 class lslStateFrameBlock
249 {
250 int number;
251 lslStatePointer[] pointers;
252
253 public void readFromBytes(byte[] data)
254 {
255
256 }
257 }
258
259 class lslStateBlockElement
260 {
261 int pointerToCode;
262 int callFrameSize;
263
264 public void readFromBytes(byte[] data)
265 {
266
267 }
268 }
269
270 class lslStateBlock
271 {
272 int length;
273 byte unknown;
274
275 lslStateBlockElement[] handlers; // ?
276
277 public void readFromBytes(byte[] data)
278 {
279
280 }
281 }
282
283 class lslFunctioBlock
284 {
285 int number;
286 int[] pointers; // Relative to this -> codechunk
287
288 public void readFromBytes(byte[] data)
289 {
290
291 }
292 }
293
294 class lslCodeArgument
295 {
296 lslVarType type;
297 byte empty;
298
299 public void readFromBytes(byte[] data)
300 {
301
302 }
303 }
304
305 class lslCodeChunkHeader
306 {
307 int length;
308 string comment;
309 lslVarType returnType;
310 lslCodeArgument[] arguments;
311 byte empty;
312
313 public void readFromBytes(byte[] data)
314 {
315
316 }
317 }
318
319 class lslCodeChunk
320 {
321 lslCodeChunkHeader header;
322 lslByteCode bytecode;
323
324 public void readFromBytes(byte[] data)
325 {
326
327 }
328 }
329}
diff --git a/libraries/libLSL/lslByteCode.cs b/libraries/libLSL/lslByteCode.cs
new file mode 100644
index 0000000..4dffe22
--- /dev/null
+++ b/libraries/libLSL/lslByteCode.cs
@@ -0,0 +1,133 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace libLSL
6{
7 class lslByteCode
8 {
9 byte[] bytecode;
10
11 public void executeStep()
12 {
13 byte ins = nextInstruction();
14 lslOpcodes code = (lslOpcodes)ins;
15
16 Object arg1 = (Object)32;
17 Object arg2 = (Object)32;
18
19 switch (code)
20 {
21 case lslOpcodes.OP_NOOP:
22 break;
23
24 case lslOpcodes.OP_POP:
25 popBytes(4);
26 break;
27
28 case lslOpcodes.OP_POPS:
29 case lslOpcodes.OP_POPL:
30 // Do Stuff
31 break;
32
33 case lslOpcodes.OP_POPV:
34 popBytes(12);
35 break;
36 case lslOpcodes.OP_POPQ:
37 popBytes(16);
38 break;
39
40 case lslOpcodes.OP_POPARG:
41 popBytes((Int32)arg1);
42 break;
43
44 case lslOpcodes.OP_POPIP:
45 // Do Stuff
46 break;
47
48 case lslOpcodes.OP_POPBP:
49 // Do Stuff
50 break;
51
52 case lslOpcodes.OP_POPSP:
53 // Do Stuff
54 break;
55
56 case lslOpcodes.OP_POPSLR:
57 // Do Stuff
58 break;
59
60 case lslOpcodes.OP_DUP:
61 pushBytes(getBytes(4));
62 break;
63
64 case lslOpcodes.OP_DUPS:
65 case lslOpcodes.OP_DUPL:
66 // Do Stuff
67 break;
68
69 case lslOpcodes.OP_DUPV:
70 pushBytes(getBytes(12));
71 break;
72
73 case lslOpcodes.OP_DUPQ:
74 pushBytes(getBytes(16));
75 break;
76
77 case lslOpcodes.OP_STORE:
78 // Somefin.
79 break;
80
81 default:
82 break;
83 }
84 }
85
86 /// <summary>
87 /// Advance the instruction pointer, pull the current instruction
88 /// </summary>
89 /// <returns></returns>
90 byte nextInstruction()
91 {
92 return 0;
93 }
94
95 /// <summary>
96 /// Removes bytes from the stack
97 /// </summary>
98 /// <param name="num">Number of bytes</param>
99 void popBytes(int num)
100 {
101
102 }
103
104 /// <summary>
105 /// Pushes Bytes to the stack
106 /// </summary>
107 /// <param name="bytes">Ze bytes!</param>
108 void pushBytes(byte[] bytes)
109 {
110
111 }
112
113 /// <summary>
114 /// Get Bytes from the stack
115 /// </summary>
116 /// <param name="num">Number of bytes</param>
117 /// <returns>Ze bytes!</returns>
118 byte[] getBytes(int num)
119 {
120 return new byte[1];
121 }
122
123 /// <summary>
124 /// Saves bytes to the local frame
125 /// </summary>
126 /// <param name="bytes">Ze bytes!</param>
127 /// <param name="index">Index in local frame</param>
128 void storeBytes(byte[] bytes, int index)
129 {
130
131 }
132 }
133}
diff --git a/libraries/libLSL/lslscript.cs b/libraries/libLSL/lslscript.cs
new file mode 100644
index 0000000..d9d57bd
--- /dev/null
+++ b/libraries/libLSL/lslscript.cs
@@ -0,0 +1,10 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace libLSL
6{
7 public class LSLScript
8 {
9 }
10}
diff --git a/prebuild.xml b/prebuild.xml
new file mode 100644
index 0000000..c91f72a
--- /dev/null
+++ b/prebuild.xml
@@ -0,0 +1,882 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" version="1.7">
3 <Solution name="OpenSim" activeConfig="Debug" path="./">
4 <Configuration name="Debug">
5 <Options>
6 <CompilerDefines>TRACE;DEBUG</CompilerDefines>
7 <OptimizeCode>false</OptimizeCode>
8 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
9 <AllowUnsafe>false</AllowUnsafe>
10 <WarningLevel>4</WarningLevel>
11 <WarningsAsErrors>false</WarningsAsErrors>
12 <SuppressWarnings></SuppressWarnings>
13 <OutputPath>bin</OutputPath>
14 <DebugInformation>true</DebugInformation>
15 <IncrementalBuild>true</IncrementalBuild>
16 <NoStdLib>false</NoStdLib>
17 </Options>
18 </Configuration>
19 <Configuration name="Release">
20 <Options>
21 <CompilerDefines>TRACE</CompilerDefines>
22 <OptimizeCode>true</OptimizeCode>
23 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
24 <AllowUnsafe>false</AllowUnsafe>
25 <WarningLevel>4</WarningLevel>
26 <WarningsAsErrors>false</WarningsAsErrors>
27 <SuppressWarnings></SuppressWarnings>
28 <OutputPath>bin</OutputPath>
29 <DebugInformation>false</DebugInformation>
30 <IncrementalBuild>true</IncrementalBuild>
31 <NoStdLib>false</NoStdLib>
32 </Options>
33 </Configuration>
34
35 <!-- XML-RPC -->
36 <Project name="XMLRPC" path="Common/XmlRpcCS" type="Library">
37 <Configuration name="Debug">
38 <Options>
39 <OutputPath>../../bin/</OutputPath>
40 </Options>
41 </Configuration>
42 <Configuration name="Release">
43 <Options>
44 <OutputPath>../../bin/</OutputPath>
45 </Options>
46 </Configuration>
47
48 <ReferencePath>../../bin/</ReferencePath>
49 <Reference name="System"/>
50 <Reference name="System.Xml"/>
51
52 <Files>
53 <Match pattern="*.cs" recurse="true"/>
54 </Files>
55 </Project>
56
57 <!-- Core OpenSim Projects -->
58
59 <Project name="OpenSim.Framework" path="Common/OpenSim.Framework" type="Library">
60 <Configuration name="Debug">
61 <Options>
62 <OutputPath>../../bin/</OutputPath>
63 </Options>
64 </Configuration>
65 <Configuration name="Release">
66 <Options>
67 <OutputPath>../../bin/</OutputPath>
68 </Options>
69 </Configuration>
70
71 <ReferencePath>../../bin/</ReferencePath>
72 <Reference name="System"/>
73 <Reference name="System.Xml"/>
74 <Reference name="libsecondlife.dll"/>
75 <Reference name="Db4objects.Db4o.dll"/>
76 <Reference name="XMLRPC"/>
77 <Files>
78 <Match pattern="*.cs" recurse="true"/>
79 </Files>
80 </Project>
81
82 <Project name="OpenSim.Framework.Console" path="Common/OpenSim.Framework.Console" type="Library">
83 <Configuration name="Debug">
84 <Options>
85 <OutputPath>../../bin/</OutputPath>
86 </Options>
87 </Configuration>
88 <Configuration name="Release">
89 <Options>
90 <OutputPath>../../bin/</OutputPath>
91 </Options>
92 </Configuration>
93
94 <ReferencePath>../../bin/</ReferencePath>
95 <Reference name="System" localCopy="false"/>
96 <Files>
97 <Match pattern="*.cs" recurse="true"/>
98 </Files>
99 </Project>
100
101 <Project name="OpenSim.Servers" path="Common/OpenSim.Servers" type="Library">
102 <Configuration name="Debug">
103 <Options>
104 <OutputPath>../../bin/</OutputPath>
105 </Options>
106 </Configuration>
107 <Configuration name="Release">
108 <Options>
109 <OutputPath>../../bin/</OutputPath>
110 </Options>
111 </Configuration>
112
113 <ReferencePath>../../bin/</ReferencePath>
114 <Reference name="System"/>
115 <Reference name="System.Xml"/>
116 <Reference name="OpenSim.Framework"/>
117 <Reference name="OpenSim.Framework.Console"/>
118 <Reference name="libsecondlife.dll"/>
119 <Reference name="XMLRPC"/>
120
121 <Files>
122 <Match pattern="*.cs" recurse="true"/>
123 </Files>
124 </Project>
125
126 <!-- Storage Plug-ins -->
127 <Project name="OpenSim.Storage.LocalStorageDb4o" path="OpenSim/OpenSim.Storage/LocalStorageDb4o" type="Library">
128 <Configuration name="Debug">
129 <Options>
130 <OutputPath>../../../bin/</OutputPath>
131 </Options>
132 </Configuration>
133 <Configuration name="Release">
134 <Options>
135 <OutputPath>../../../bin/</OutputPath>
136 </Options>
137 </Configuration>
138
139 <ReferencePath>../../../bin/</ReferencePath>
140 <Reference name="System" localCopy="false"/>
141 <Reference name="System.Xml"/>
142 <Reference name="Db4objects.Db4o.dll"/>
143 <Reference name="libsecondlife.dll"/>
144 <Reference name="OpenSim.Framework"/>
145 <Reference name="OpenSim.Framework.Console"/>
146 <Files>
147 <Match pattern="*.cs" recurse="true"/>
148 </Files>
149 </Project>
150
151 <Project name="OpenSim.Storage.LocalStorageSQLite" path="OpenSim/OpenSim.Storage/LocalStorageSQLite" type="Library">
152 <Configuration name="Debug">
153 <Options>
154 <OutputPath>../../../bin/</OutputPath>
155 </Options>
156 </Configuration>
157 <Configuration name="Release">
158 <Options>
159 <OutputPath>../../../bin/</OutputPath>
160 </Options>
161 </Configuration>
162
163 <ReferencePath>../../../bin/</ReferencePath>
164 <Reference name="System" localCopy="false"/>
165 <Reference name="System.Xml"/>
166 <Reference name="System.Data"/>
167 <Reference name="System.Data.SQLite.dll"/>
168 <Reference name="libsecondlife.dll"/>
169 <Reference name="OpenSim.Framework"/>
170 <Reference name="OpenSim.Framework.Console"/>
171 <Files>
172 <Match pattern="*.cs" recurse="true"/>
173 </Files>
174 </Project>
175
176 <Project name="OpenSim.Storage.LocalStorageBerkeleyDB" path="OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB" type="Library">
177 <Configuration name="Debug">
178 <Options>
179 <OutputPath>../../../bin/</OutputPath>
180 </Options>
181 </Configuration>
182 <Configuration name="Release">
183 <Options>
184 <OutputPath>../../../bin/</OutputPath>
185 </Options>
186 </Configuration>
187
188 <ReferencePath>../../../bin/</ReferencePath>
189 <Reference name="System" localCopy="false"/>
190 <Reference name="System.Xml"/>
191 <Reference name="System.Data"/>
192 <Reference name="Kds.Serialization.dll"/>
193 <Reference name="libdb_dotNET43.dll"/>
194 <Reference name="libsecondlife.dll"/>
195 <Reference name="OpenSim.Framework"/>
196 <Reference name="OpenSim.Framework.Console"/>
197 <Files>
198 <Match pattern="*.cs" recurse="true"/>
199 </Files>
200 </Project>
201
202 <!-- Grid Server Plug-ins -->
203 <Project name="OpenSim.GridInterfaces.Local" path="OpenSim/OpenSim.GridInterfaces/Local" type="Library">
204 <Configuration name="Debug">
205 <Options>
206 <OutputPath>../../../bin/</OutputPath>
207 </Options>
208 </Configuration>
209 <Configuration name="Release">
210 <Options>
211 <OutputPath>../../../bin/</OutputPath>
212 </Options>
213 </Configuration>
214
215 <ReferencePath>../../../bin/</ReferencePath>
216 <Reference name="System" localCopy="false"/>
217 <Reference name="System.Xml"/>
218 <Reference name="Db4objects.Db4o.dll"/>
219 <Reference name="libsecondlife.dll"/>
220 <Reference name="OpenSim.Framework"/>
221 <Reference name="OpenSim.Framework.Console"/>
222 <Files>
223 <Match pattern="*.cs" recurse="true"/>
224 </Files>
225 </Project>
226
227 <Project name="OpenSim.GridInterfaces.Remote" path="OpenSim/OpenSim.GridInterfaces/Remote" type="Library">
228 <Configuration name="Debug">
229 <Options>
230 <OutputPath>../../../bin/</OutputPath>
231 </Options>
232 </Configuration>
233 <Configuration name="Release">
234 <Options>
235 <OutputPath>../../../bin/</OutputPath>
236 </Options>
237 </Configuration>
238
239 <ReferencePath>../../../bin/</ReferencePath>
240 <Reference name="System" localCopy="false"/>
241 <Reference name="System.Xml"/>
242 <Reference name="libsecondlife.dll"/>
243 <Reference name="OpenSim.Framework"/>
244 <Reference name="OpenSim.Framework.Console"/>
245 <Reference name="XMLRPC"/>
246 <Files>
247 <Match pattern="*.cs" recurse="true"/>
248 </Files>
249 </Project>
250
251
252 <Project name="OpenSim.Physics.Manager" path="OpenSim/OpenSim.Physics/Manager" type="Library">
253 <Configuration name="Debug">
254 <Options>
255 <OutputPath>../../../bin/</OutputPath>
256 </Options>
257 </Configuration>
258 <Configuration name="Release">
259 <Options>
260 <OutputPath>../../../bin/</OutputPath>
261 </Options>
262 </Configuration>
263
264 <ReferencePath>../../../bin/</ReferencePath>
265 <Reference name="System" localCopy="false"/>
266 <Reference name="System.Xml" localCopy="false" />
267 <Reference name="Axiom.MathLib.dll" localCopy="false"/>
268 <Reference name="OpenSim.Framework" localCopy="false"/>
269 <Reference name="OpenSim.Framework.Console" localCopy="false"/>
270 <Files>
271 <Match pattern="*.cs" recurse="false"/>
272 </Files>
273 </Project>
274
275
276 <!-- Physics Plug-ins -->
277 <Project name="OpenSim.Physics.BasicPhysicsPlugin" path="OpenSim/OpenSim.Physics/BasicPhysicsPlugin" type="Library">
278 <Configuration name="Debug">
279 <Options>
280 <OutputPath>../../../bin/Physics/</OutputPath>
281 </Options>
282 </Configuration>
283 <Configuration name="Release">
284 <Options>
285 <OutputPath>../../../bin/Physics/</OutputPath>
286 </Options>
287 </Configuration>
288
289 <ReferencePath>../../../bin/</ReferencePath>
290 <Reference name="System" localCopy="false"/>
291 <Reference name="Axiom.MathLib.dll" localCopy="false"/>
292 <Reference name="OpenSim.Physics.Manager" localCopy="false"/>
293 <Files>
294 <Match pattern="*.cs" recurse="true"/>
295 </Files>
296 </Project>
297
298 <Project name="OpenSim.Physics.PhysXPlugin" path="OpenSim/OpenSim.Physics/PhysXPlugin" type="Library">
299 <Configuration name="Debug">
300 <Options>
301 <OutputPath>../../../bin/Physics/</OutputPath>
302 </Options>
303 </Configuration>
304 <Configuration name="Release">
305 <Options>
306 <OutputPath>../../../bin/Physics/</OutputPath>
307 </Options>
308 </Configuration>
309
310 <ReferencePath>../../../bin/</ReferencePath>
311 <Reference name="System" localCopy="false"/>
312 <Reference name="Axiom.MathLib.dll" localCopy="false"/>
313 <Reference name="PhysX_Wrapper_Dotnet.dll" localCopy="false"/>
314 <Reference name="OpenSim.Physics.Manager" localCopy="false"/>
315 <Files>
316 <Match pattern="*.cs" recurse="true"/>
317 </Files>
318 </Project>
319
320 <Project name="OpenSim.Physics.OdePlugin" path="OpenSim/OpenSim.Physics/OdePlugin" type="Library">
321 <Configuration name="Debug">
322 <Options>
323 <OutputPath>../../../bin/Physics/</OutputPath>
324 </Options>
325 </Configuration>
326 <Configuration name="Release">
327 <Options>
328 <OutputPath>../../../bin/Physics/</OutputPath>
329 </Options>
330 </Configuration>
331
332 <ReferencePath>../../../bin/</ReferencePath>
333 <Reference name="System" localCopy="false"/>
334 <Reference name="Axiom.MathLib.dll" localCopy="false"/>
335 <Reference name="OpenSim.Physics.Manager" localCopy="false"/>
336 <Reference name="Ode.NET.dll" localCopy="false" />
337
338 <Files>
339 <Match pattern="*.cs" recurse="true"/>
340 </Files>
341 </Project>
342
343 <!-- Xml Config Dll -->
344 <Project name="OpenSim.GenericConfig.Xml" path="Common/OpenSim.GenericConfig/Xml" type="Library">
345 <Configuration name="Debug">
346 <Options>
347 <OutputPath>../../../bin/</OutputPath>
348 </Options>
349 </Configuration>
350 <Configuration name="Release">
351 <Options>
352 <OutputPath>../../../bin/</OutputPath>
353 </Options>
354 </Configuration>
355
356 <ReferencePath>../../../bin/</ReferencePath>
357 <Reference name="System"/>
358 <Reference name="System.Xml"/>
359 <Reference name="OpenSim.Framework"/>
360
361 <Files>
362 <Match pattern="*.cs" recurse="true"/>
363 </Files>
364 </Project>
365
366 <!-- Basic embedded JVM -->
367 <Project name="OpenSim.Scripting.EmbeddedJVM" path="OpenSim/OpenSim.Scripting/EmbeddedJVM" type="Library">
368 <Configuration name="Debug">
369 <Options>
370 <OutputPath>../../../bin/ScriptEngines/</OutputPath>
371 </Options>
372 </Configuration>
373 <Configuration name="Release">
374 <Options>
375 <OutputPath>../../../bin/ScriptEngines/</OutputPath>
376 </Options>
377 </Configuration>
378
379 <ReferencePath>../../../bin/</ReferencePath>
380 <Reference name="System"/>
381 <Reference name="System.Xml"/>
382 <Reference name="OpenSim.Framework"/>
383
384 <Files>
385 <Match pattern="*.cs" recurse="true"/>
386 </Files>
387 </Project>
388
389
390 <!-- Terrain engine -->
391 <Project name="OpenSim.Terrain.BasicTerrain" path="OpenSim/OpenSim.Terrain.BasicTerrain" type="Library">
392 <Configuration name="Debug">
393 <Options>
394 <OutputPath>../../bin/</OutputPath>
395 </Options>
396 </Configuration>
397 <Configuration name="Release">
398 <Options>
399 <OutputPath>../../bin/</OutputPath>
400 </Options>
401 </Configuration>
402
403 <ReferencePath>../../bin/</ReferencePath>
404 <Reference name="System"/>
405 <Reference name="System.Drawing"/>
406 <Reference name="System.Data"/>
407 <Reference name="System.Xml"/>
408 <Reference name="libTerrain-BSD.dll"/>
409
410 <Files>
411 <Match pattern="*.cs" recurse="true"/>
412 </Files>
413 </Project>
414
415 <Project name="OpenSim.RegionServer" path="OpenSim/OpenSim.RegionServer" type="Library">
416 <Configuration name="Debug">
417 <Options>
418 <OutputPath>../../bin/</OutputPath>
419 </Options>
420 </Configuration>
421 <Configuration name="Release">
422 <Options>
423 <OutputPath>../../bin/</OutputPath>
424 </Options>
425 </Configuration>
426
427 <ReferencePath>../../bin/</ReferencePath>
428 <Reference name="System" localCopy="false"/>
429 <Reference name="System.Xml"/>
430 <Reference name="libsecondlife.dll"/>
431 <Reference name="Axiom.MathLib.dll"/>
432 <Reference name="Db4objects.Db4o.dll"/>
433 <Reference name="OpenSim.Terrain.BasicTerrain"/>
434 <Reference name="OpenSim.Framework"/>
435 <Reference name="OpenSim.Framework.Console"/>
436 <Reference name="OpenSim.GenericConfig.Xml"/>
437 <Reference name="OpenSim.Physics.Manager"/>
438 <Reference name="OpenSim.Servers"/>
439 <Reference name="XMLRPC"/>
440
441 <Files>
442 <Match pattern="*.cs" recurse="true"/>
443 </Files>
444 </Project>
445
446 <!-- OpenSim app -->
447 <Project name="OpenSim" path="OpenSim/OpenSim" type="Exe">
448 <Configuration name="Debug">
449 <Options>
450 <OutputPath>../../bin/</OutputPath>
451 </Options>
452 </Configuration>
453 <Configuration name="Release">
454 <Options>
455 <OutputPath>../../bin/</OutputPath>
456 </Options>
457 </Configuration>
458
459 <ReferencePath>../../bin/</ReferencePath>
460 <Reference name="System" localCopy="false"/>
461 <Reference name="System.Xml"/>
462 <Reference name="libsecondlife.dll"/>
463 <Reference name="Axiom.MathLib.dll"/>
464 <Reference name="Db4objects.Db4o.dll"/>
465 <Reference name="OpenSim.Terrain.BasicTerrain"/>
466 <Reference name="OpenSim.Framework"/>
467 <Reference name="OpenSim.Framework.Console"/>
468 <Reference name="OpenSim.Physics.Manager"/>
469 <Reference name="OpenSim.Servers"/>
470 <Reference name="OpenSim.RegionServer"/>
471 <Reference name="OpenSim.GenericConfig.Xml"/>
472 <Reference name="XMLRPC"/>
473
474 <Files>
475 <Match pattern="*.cs" recurse="true"/>
476 </Files>
477 </Project>
478
479</Solution>
480
481
482<Solution name="OpenGridServices" activeConfig="Debug" path="./">
483 <Configuration name="Debug">
484 <Options>
485 <CompilerDefines>TRACE;DEBUG</CompilerDefines>
486 <OptimizeCode>false</OptimizeCode>
487 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
488 <AllowUnsafe>false</AllowUnsafe>
489 <WarningLevel>4</WarningLevel>
490 <WarningsAsErrors>false</WarningsAsErrors>
491 <SuppressWarnings></SuppressWarnings>
492 <OutputPath>bin</OutputPath>
493 <DebugInformation>true</DebugInformation>
494 <IncrementalBuild>true</IncrementalBuild>
495 <NoStdLib>false</NoStdLib>
496 </Options>
497 </Configuration>
498 <Configuration name="Release">
499 <Options>
500 <CompilerDefines>TRACE</CompilerDefines>
501 <OptimizeCode>true</OptimizeCode>
502 <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
503 <AllowUnsafe>false</AllowUnsafe>
504 <WarningLevel>4</WarningLevel>
505 <WarningsAsErrors>false</WarningsAsErrors>
506 <SuppressWarnings></SuppressWarnings>
507 <OutputPath>bin</OutputPath>
508 <DebugInformation>false</DebugInformation>
509 <IncrementalBuild>true</IncrementalBuild>
510 <NoStdLib>false</NoStdLib>
511 </Options>
512 </Configuration>
513
514
515 <!-- OpenGrid Data Services -->
516 <Project name="OpenGrid.Framework.Data" path="OpenGridServices/OpenGrid.Framework.Data" type="Library">
517 <Configuration name="Debug">
518 <Options>
519 <OutputPath>../../bin/</OutputPath>
520 </Options>
521 </Configuration>
522 <Configuration name="Release">
523 <Options>
524 <OutputPath>../../bin/</OutputPath>
525 </Options>
526 </Configuration>
527
528 <ReferencePath>../../bin/</ReferencePath>
529 <Reference name="System" localCopy="false"/>
530 <Reference name="System.Xml"/>
531 <Reference name="System.Data"/>
532 <Reference name="libsecondlife.dll"/>
533 <Files>
534 <Match pattern="*.cs" recurse="true"/>
535 </Files>
536 </Project>
537
538 <Project name="OpenGrid.Framework.Data.MySQL" path="OpenGridServices/OpenGrid.Framework.Data.MySQL" type="Library">
539 <Configuration name="Debug">
540 <Options>
541 <OutputPath>../../bin/</OutputPath>
542 </Options>
543 </Configuration>
544 <Configuration name="Release">
545 <Options>
546 <OutputPath>../../bin/</OutputPath>
547 </Options>
548 </Configuration>
549
550 <ReferencePath>../../bin/</ReferencePath>
551 <Reference name="System" localCopy="false"/>
552 <Reference name="System.Xml"/>
553 <Reference name="System.Data"/>
554 <Reference name="OpenGrid.Framework.Data"/>
555 <Reference name="libsecondlife.dll"/>
556 <Reference name="MySql.Data.dll"/>
557 <Files>
558 <Match pattern="*.cs" recurse="true"/>
559 </Files>
560 </Project>
561
562 <Project name="OpenGrid.Framework.Data.DB4o" path="OpenGridServices/OpenGrid.Framework.Data.DB4o" type="Library">
563 <Configuration name="Debug">
564 <Options>
565 <OutputPath>../../bin/</OutputPath>
566 </Options>
567 </Configuration>
568 <Configuration name="Release">
569 <Options>
570 <OutputPath>../../bin/</OutputPath>
571 </Options>
572 </Configuration>
573
574 <ReferencePath>../../bin/</ReferencePath>
575 <Reference name="System" localCopy="false"/>
576 <Reference name="System.Xml"/>
577 <Reference name="System.Data"/>
578 <Reference name="OpenGrid.Framework.Data"/>
579 <Reference name="libsecondlife.dll"/>
580 <Reference name="Db4objects.Db4o.dll"/>
581 <Files>
582 <Match pattern="*.cs" recurse="true"/>
583 </Files>
584 </Project>
585
586 <Project name="OpenGrid.Framework.Data.MSSQL" path="OpenGridServices/OpenGrid.Framework.Data.MSSQL" type="Library">
587 <Configuration name="Debug">
588 <Options>
589 <OutputPath>../../bin/</OutputPath>
590 </Options>
591 </Configuration>
592 <Configuration name="Release">
593 <Options>
594 <OutputPath>../../bin/</OutputPath>
595 </Options>
596 </Configuration>
597
598 <ReferencePath>../../bin/</ReferencePath>
599 <Reference name="System" localCopy="false"/>
600 <Reference name="System.Xml"/>
601 <Reference name="System.Data"/>
602 <Reference name="OpenGrid.Framework.Data"/>
603 <Reference name="libsecondlife.dll"/>
604 <Files>
605 <Match pattern="*.cs" recurse="true"/>
606 </Files>
607 </Project>
608
609 <Project name="OpenGrid.Framework.Data.SQLite" path="OpenGridServices/OpenGrid.Framework.Data.SQLite" type="Library">
610 <Configuration name="Debug">
611 <Options>
612 <OutputPath>../../bin/</OutputPath>
613 </Options>
614 </Configuration>
615 <Configuration name="Release">
616 <Options>
617 <OutputPath>../../bin/</OutputPath>
618 </Options>
619 </Configuration>
620
621 <ReferencePath>../../bin/</ReferencePath>
622 <Reference name="System" localCopy="false"/>
623 <Reference name="System.Xml"/>
624 <Reference name="System.Data"/>
625 <Reference name="System.Data.SQLite.dll"/>
626 <Reference name="OpenGrid.Framework.Data"/>
627 <Reference name="libsecondlife.dll"/>
628 <Files>
629 <Match pattern="*.cs" recurse="true"/>
630 </Files>
631 </Project>
632
633 <!-- OGS projects -->
634
635 <Project name="OpenGrid.Framework.Manager" path="OpenGridServices/OpenGrid.Framework.Manager" type="Library">
636 <Configuration name="Debug">
637 <Options>
638 <OutputPath>../../bin/</OutputPath>
639 </Options>
640 </Configuration>
641 <Configuration name="Release">
642 <Options>
643 <OutputPath>../../bin/</OutputPath>
644 </Options>
645 </Configuration>
646
647 <ReferencePath>../../bin/</ReferencePath>
648 <Reference name="System" localCopy="false"/>
649 <Reference name="OpenSim.Framework"/>
650 <Reference name="OpenSim.Servers"/>
651 <Reference name="libsecondlife.dll"/>
652 <Reference name="XMLRPC"/>
653
654
655 <Files>
656 <Match pattern="*.cs" recurse="true"/>
657 </Files>
658 </Project>
659
660
661 <Project name="ServiceManager" path="OpenGridServices/ServiceManager" type="Exe">
662 <Configuration name="Debug">
663 <Options>
664 <OutputPath>../../bin/</OutputPath>
665 </Options>
666 </Configuration>
667 <Configuration name="Release">
668 <Options>
669 <OutputPath>../../bin/</OutputPath>
670 </Options>
671 </Configuration>
672
673 <ReferencePath>../../bin/</ReferencePath>
674 <Reference name="System" localCopy="false"/>
675 <Reference name="System.ServiceProcess" localCopy="false"/>
676 <Reference name="System.Xml" localCopy="false"/>
677
678 <Files>
679 <Match pattern="*.cs" recurse="true"/>
680 </Files>
681 </Project>
682
683
684 <Project name="OpenGridServices.GridServer" path="OpenGridServices/OpenGridServices.GridServer" type="Exe">
685 <Configuration name="Debug">
686 <Options>
687 <OutputPath>../../bin/</OutputPath>
688 </Options>
689 </Configuration>
690 <Configuration name="Release">
691 <Options>
692 <OutputPath>../../bin/</OutputPath>
693 </Options>
694 </Configuration>
695
696 <ReferencePath>../../bin/</ReferencePath>
697 <Reference name="System" localCopy="false"/>
698 <Reference name="System.Data" localCopy="false"/>
699 <Reference name="System.Xml" localCopy="false"/>
700 <Reference name="OpenSim.Framework"/>
701 <Reference name="OpenSim.Framework.Console"/>
702 <Reference name="OpenSim.Servers"/>
703 <Reference name="OpenGrid.Framework.Data"/>
704 <Reference name="OpenGrid.Framework.Manager"/>
705 <Reference name="OpenSim.GenericConfig.Xml"/>
706 <Reference name="libsecondlife.dll"/>
707 <Reference name="Db4objects.Db4o.dll"/>
708 <Reference name="XMLRPC"/>
709
710 <Files>
711 <Match pattern="*.cs" recurse="true"/>
712 </Files>
713 </Project>
714
715 <Project name="OpenGridServices.AssetServer" path="OpenGridServices/OpenGridServices.AssetServer" type="Exe">
716 <Configuration name="Debug">
717 <Options>
718 <OutputPath>../../bin/</OutputPath>
719 </Options>
720 </Configuration>
721 <Configuration name="Release">
722 <Options>
723 <OutputPath>../../bin/</OutputPath>
724 </Options>
725 </Configuration>
726
727 <ReferencePath>../../bin/</ReferencePath>
728 <Reference name="System" localCopy="false"/>
729 <Reference name="System.Data" localCopy="false"/>
730 <Reference name="System.Xml" localCopy="false"/>
731 <Reference name="OpenSim.Framework"/>
732 <Reference name="OpenSim.Framework.Console"/>
733 <Reference name="OpenSim.Servers"/>
734 <Reference name="libsecondlife.dll"/>
735 <Reference name="Db4objects.Db4o.dll"/>
736 <Reference name="XMLRPC"/>
737
738 <Files>
739 <Match pattern="*.cs" recurse="true"/>
740 </Files>
741 </Project>
742
743 <Project name="OpenGridServices.UserServer" path="OpenGridServices/OpenGridServices.UserServer" type="Exe">
744 <Configuration name="Debug">
745 <Options>
746 <OutputPath>../../bin/</OutputPath>
747 </Options>
748 </Configuration>
749 <Configuration name="Release">
750 <Options>
751 <OutputPath>../../bin/</OutputPath>
752 </Options>
753 </Configuration>
754
755 <ReferencePath>../../bin/</ReferencePath>
756 <Reference name="System" localCopy="false"/>
757 <Reference name="System.Data" localCopy="false"/>
758 <Reference name="System.Xml" localCopy="false"/>
759 <Reference name="OpenSim.Framework"/>
760 <Reference name="OpenSim.Framework.Console"/>
761 <Reference name="OpenGrid.Framework.Data"/>
762 <Reference name="OpenSim.GenericConfig.Xml"/>
763 <Reference name="OpenSim.Servers"/>
764 <Reference name="libsecondlife.dll"/>
765 <Reference name="Db4objects.Db4o.dll"/>
766 <Reference name="XMLRPC"/>
767
768 <Files>
769 <Match pattern="*.cs" recurse="true"/>
770 </Files>
771 </Project>
772
773
774
775 <Project name="OpenGrid.Config.GridConfigDb4o" path="OpenGridServices/OpenGrid.Config/GridConfigDb4o" type="Library">
776 <Configuration name="Debug">
777 <Options>
778 <OutputPath>../../../bin/</OutputPath>
779 </Options>
780 </Configuration>
781 <Configuration name="Release">
782 <Options>
783 <OutputPath>../../../bin/</OutputPath>
784 </Options>
785 </Configuration>
786
787 <ReferencePath>../../../bin/</ReferencePath>
788 <Reference name="System" localCopy="false"/>
789 <Reference name="System.Data.dll"/>
790 <Reference name="System.Xml"/>
791 <Reference name="libsecondlife.dll"/>
792 <Reference name="Db4objects.Db4o.dll"/>
793 <Reference name="OpenSim.Framework"/>
794 <Reference name="OpenSim.Framework.Console"/>
795 <Files>
796 <Match pattern="*.cs" recurse="true"/>
797 </Files>
798 </Project>
799
800 <Project name="OpenUser.Config.UserConfigDb4o" path="OpenGridServices/OpenUser.Config/UserConfigDb4o" type="Library">
801 <Configuration name="Debug">
802 <Options>
803 <OutputPath>../../../bin/</OutputPath>
804 </Options>
805 </Configuration>
806 <Configuration name="Release">
807 <Options>
808 <OutputPath>../../../bin/</OutputPath>
809 </Options>
810 </Configuration>
811
812 <ReferencePath>../../../bin/</ReferencePath>
813 <Reference name="System" localCopy="false"/>
814 <Reference name="System.Data.dll"/>
815 <Reference name="System.Xml"/>
816 <Reference name="libsecondlife.dll"/>
817 <Reference name="Db4objects.Db4o.dll"/>
818 <Reference name="OpenSim.Framework"/>
819 <Reference name="OpenSim.Framework.Console"/>
820 <Files>
821 <Match pattern="*.cs" recurse="true"/>
822 </Files>
823 </Project>
824
825</Solution>
826
827
828 <!-- Prebuild tool -->
829 <Solution name="Prebuild" path="Prebuild/" >
830 <Configuration name="Debug">
831 <Options>
832 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
833 <OptimizeCode>false</OptimizeCode>
834 <OutputPath>bin/Debug</OutputPath>
835 <DebugInformation>true</DebugInformation>
836 <SuppressWarnings>1595</SuppressWarnings>
837 </Options>
838 </Configuration>
839 <Configuration name="Release">
840 <Options>
841 <CompilerDefines>TRACE</CompilerDefines>
842 <OutputPath>bin/Release</OutputPath>
843 <OptimizeCode>true</OptimizeCode>
844 <DebugInformation>false</DebugInformation>
845 <SuppressWarnings>1595</SuppressWarnings>
846 </Options>
847 </Configuration>
848 <Project name="Prebuild" path="src/" language="C#" assemblyName="prebuild" icon="App.ico" type="Exe" rootNamespace="Prebuild" startupObject="Prebuild.Prebuild">
849 <Configuration name="Debug">
850 <Options>
851 <CompilerDefines>DEBUG;TRACE</CompilerDefines>
852 <OptimizeCode>false</OptimizeCode>
853 <OutputPath>..\..\bin\</OutputPath>
854 <DebugInformation>true</DebugInformation>
855 <KeyFile>Prebuild.snk</KeyFile>
856 <SuppressWarnings>1595</SuppressWarnings>
857 </Options>
858 </Configuration>
859 <Configuration name="Release">
860 <Options>
861 <CompilerDefines>TRACE</CompilerDefines>
862 <OutputPath>..\..\bin\</OutputPath>
863 <OptimizeCode>true</OptimizeCode>
864 <DebugInformation>false</DebugInformation>
865 <KeyFile>Prebuild.snk</KeyFile>
866 <SuppressWarnings>1595</SuppressWarnings>
867 </Options>
868 </Configuration>
869 <ReferencePath>../../bin/</ReferencePath>
870 <Reference name="System.EnterpriseServices" />
871 <Reference name="System.Xml" />
872 <Reference name="System" />
873 <Files>
874 <Match pattern="App.ico" buildAction="EmbeddedResource"/>
875 <Match path="data" pattern="prebuild-1.7.xsd" buildAction="EmbeddedResource"/>
876 <Match pattern="*.cs" recurse="true"/>
877 </Files>
878 </Project>
879 </Solution>
880</Prebuild>
881
882
diff --git a/releng/CAUTION b/releng/CAUTION
new file mode 100644
index 0000000..6418046
--- /dev/null
+++ b/releng/CAUTION
@@ -0,0 +1,4 @@
1!!!!!!!!!!!!! DANGER DANGER !!!!!!!!!!!!!!!!!!!!!!!!!!!
2DO NOT RUN ANY OF THE SCRIPTS IN THIS DIRECTORY WITHOUT
3READING THEM!!!!!!!!!!!!!
4!!!!!!!!!!!!! DANGER DANGER !!!!!!!!!!!!!!!!!!!!!!!!!!!
diff --git a/releng/README b/releng/README
new file mode 100644
index 0000000..e73f395
--- /dev/null
+++ b/releng/README
@@ -0,0 +1,3 @@
1This directory contains scripts etc for creating a tarball/package out of the SVN tree.
2Use makerel.sh to generate a tarball, do not use other scripts
3It is designed to be run before releases or by developers/users before a local install from source.
diff --git a/releng/createreldir.sh b/releng/createreldir.sh
new file mode 100644
index 0000000..eb470b0
--- /dev/null
+++ b/releng/createreldir.sh
@@ -0,0 +1,9 @@
1#!/bin/sh
2
3# this script creates a new opensim-major.minor directory and copies all the relevant files into it
4# not designed for direct invocation from the command line
5
6mkdir opensim-$OPENSIMMAJOR.$OPENSIMMINOR
7
8cp -R dist/* opensim-$OPENSIMMAJOR.$OPENSIMMINOR
9cp -R build/bin/* opensim-$OPENSIMMAJOR.$OPENSIMMINOR/bin
diff --git a/releng/dist/INSTALL b/releng/dist/INSTALL
new file mode 100644
index 0000000..f67fe43
--- /dev/null
+++ b/releng/dist/INSTALL
@@ -0,0 +1,33 @@
1INSTALLING FROM SOURCE WITH WINDOWS
2
31 - Ensure you have visual studio express (the C# edition)
4
52 - Check you have a clean source tree with the latest VS2005 solution, if unsure run prebuild (See README file)
6
73 - Open the solution in visual studio and build it
8
94 - Look in bin/ for the output
10
115 - ???
12
136 - Profit
14
15INSTALLING FROM SOURCE WITH LINUX/BSD/*NIX
16
171 - Ensure you have a clean source tree with latest nant build files, if not, get one or run prebuild (See README file)
18
192 - Go to a shell prompt and change to the correct directory
20
213 - Type the following:
22
23nant
24
254 - Look in bin/ for the output
26
275 - ???
28
296 - Profit
30
31INSTALLING BINARY RELEASE
32
33Simply extract the tarball into a good location and run straight out of bin/. You may also wish to put all the binaries into /opt/opensim on *nix systems and adjust your path accordingly. At time of writing there is no official way yet to do this. Watch this space.
diff --git a/releng/dist/README b/releng/dist/README
new file mode 100644
index 0000000..125d5da
--- /dev/null
+++ b/releng/dist/README
@@ -0,0 +1,70 @@
1For installation notes, please read INSTALL
2
3RUNNING SANDBOX MODE (the standard way)
4
5To get up and running in sandbox mode, please start up opensim like this from the command line:
6
7(first ensure you are in the right directory)
8
9OpenSim.exe -sandbox (windows)
10
11mono OpenSim.exe -sandbox (linux/BSD/MacOS X)
12
13Then startup your second life viewer with the following parameters:
14
15-loginuri http://yourserver:9000/
16
17The method to do this is dependent upon your OS. "yourserver" will be 127.0.0.1 if you accept the defaults when starting opensim.
18
19
20RUNNING SANDBOX WITH USER ACCOUNTS
21
22* open cmd window, go to /bin and launch
23OpenSim.exe -sandbox -loginserver -useraccounts
24
25* launch web browser, go to
26http://localhost:9000/Admin
27enter password 'Admin'
28
29* Select 'Accounts', enter credentials, press 'Create'
30
31* Now, log on thru your viewer (see above) with your newly created credentials.
32
33* Have Fun!
34
35
36PREBUILD
37
38We use Prebuild to generate vs2005 solutions and nant build scripts.
39
40=== Building Prebuild ===
41
42At the moment, the Prebuild exe is shipped as /bin/Prebuild.exe so you shouldn't really have to build it.
43
44But here's the instructions anyway :
45
46The Prebuild master project is /prebuild.xml
47
48To build it with vs2005 :
49
50* build the solution /Prebuild/Prebuild.sln
51
52To build it with nant :
53
54* cd to /Prebuild/
55* type 'nant'
56
57After you've built it, it will land in the root /bin/ directory,
58
59=== Modyfying the OpenSim solution ===
60
61When adding or changing projects, modify the prebuild.xml and then execute
62
63bin/Prebuild.exe /target {target}
64
65where target is either
66vs2005 - to generate new vs2005 solutions and projects
67nant - to generate new nant build scripts
68
69Remember to run prebuild whenever you've added or removed files as well.
70
diff --git a/releng/dist/bin/OpenSim b/releng/dist/bin/OpenSim
new file mode 100644
index 0000000..9b46075
--- /dev/null
+++ b/releng/dist/bin/OpenSim
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3mono OpenSim.exe $*
diff --git a/releng/dobuild.sh b/releng/dobuild.sh
new file mode 100644
index 0000000..0fbb979
--- /dev/null
+++ b/releng/dobuild.sh
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3# this script does a guaranteed clean build from SVN using a URL specified on the command line
4
5rm -rf build/
6mkdir build
7
8printf "Getting fresh source tree from SVN..."
9svn checkout $1 build
10
11printf "Updating templates..."
12./parsetmpl.sh templates/VersionInfo.cs.tmpl >build/OpenSim.RegionServer/VersionInfo.cs
13
14printf "Running prebuild..."
15cd build
16mono bin/Prebuild.exe /target nant
17
18printf "Doing the build..."
19nant
20
diff --git a/releng/makerel.sh b/releng/makerel.sh
new file mode 100644
index 0000000..b7bc568
--- /dev/null
+++ b/releng/makerel.sh
@@ -0,0 +1,30 @@
1#!/bin/sh
2
3# This is the one!
4
5export OPENSIMMAJOR=0
6export OPENSIMMINOR=2
7export BUILD=`date +%s`
8export BRANCH=DEVEL
9export SVNURL=svn://openmetaverse.org/opensim/trunk
10
11
12
13
14
15# shouldn't have to change anything below here
16
17script dobuild.log -c "./dobuild.sh $SVNURL"
18if [ ! $? -eq 0 ]
19then
20 echo "Build failed!"
21else
22 script createrel.log -c ./createreldir.sh
23 rm -rf build
24 tar cvf opensim-$OPENSIMMAJOR.$OPENSIMMINOR-$BUILD-$BRANCH.tar opensim-$OPENSIMMAJOR.$OPENSIMMINOR/*
25 gzip opensim-$OPENSIMMAJOR.$OPENSIMMINOR-$BUILD-$BRANCH.tar
26fi
27
28rm -rf opensim-$OPENSIMMAJOR.$OPENSIMMINOR
29echo "Produced binary tarball ready for distribution."
30
diff --git a/releng/parsetmpl.sh b/releng/parsetmpl.sh
new file mode 100644
index 0000000..0ce6d24
--- /dev/null
+++ b/releng/parsetmpl.sh
@@ -0,0 +1,5 @@
1#!/bin/sh
2
3# this script parses a template to replace @@ tokens
4
5cat $1 | sed s/@@VERSION/$OPENSIMMAJOR.$OPENSIMMINOR/g | sed s/@@BUILD/$BUILD/g | sed s/@@SVNREV/`svnversion`/g
diff --git a/releng/templates/VersionInfo.cs.tmpl b/releng/templates/VersionInfo.cs.tmpl
new file mode 100644
index 0000000..29159e2
--- /dev/null
+++ b/releng/templates/VersionInfo.cs.tmpl
@@ -0,0 +1,37 @@
1/*
2Copyright (c) OpenSim project, http://osgrid.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*/
26
27using System;
28
29namespace OpenSim
30{
31 /// <summary>
32 /// </summary>
33 public class VersionInfo
34 {
35 public static string Version = "@@VERSION, Build @@BUILD, Revision @@SVNREV";
36 }
37}
diff --git a/runprebuild.bat b/runprebuild.bat
new file mode 100644
index 0000000..c1e5d0e
--- /dev/null
+++ b/runprebuild.bat
@@ -0,0 +1,2 @@
1bin\Prebuild.exe /target nant
2bin\Prebuild.exe /target vs2005 \ No newline at end of file