*Added everything
parent
dfdcd4a6e0
commit
1a7aa1adc5
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,329 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim\Region\Application\OpenSim.csproj", "{438A9556-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework", "OpenSim\Framework\General\OpenSim.Framework.csproj", "{8ACA2445-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Communications", "OpenSim\Framework\Communications\OpenSim.Framework.Communications.csproj", "{CB52B7E7-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Configuration", "OpenSim\Framework\Configuration\OpenSim.Framework.Configuration.csproj", "{A45242A2-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Console", "OpenSim\Framework\Console\OpenSim.Framework.Console.csproj", "{A7CD0630-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data", "OpenSim\Framework\Data\OpenSim.Framework.Data.csproj", "{36B72A9B-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data.DB4o", "OpenSim\Framework\Data.DB4o\OpenSim.Framework.Data.DB4o.csproj", "{FD2D303D-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Servers", "OpenSim\Framework\Servers\OpenSim.Framework.Servers.csproj", "{2CC71860-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Services", "OpenSim\Framework\Services\OpenSim.Framework.Services.csproj", "{6251A10E-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.UserManagement", "OpenSim\Framework\UserManager\OpenSim.Framework.UserManagement.csproj", "{586E2916-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.AssetServer", "OpenSim\Grid\AssetServer\OpenSim.Grid.AssetServer.csproj", "{E5F1A03B-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.GridServer", "OpenSim\Grid\GridServer\OpenSim.Grid.GridServer.csproj", "{60FCC3A6-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.Services.Asset", "OpenSim\Grid\Services\Asset\OpenSim.Grid.Services.Asset.csproj", "{F22B4FF8-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.Services.CoreFunctions.Local", "OpenSim\Grid\Services\CoreFunctions\Local\OpenSim.Grid.Services.CoreFunctions.Local.csproj", "{FE7B9CD5-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.Services.CoreFunctions.Remote", "OpenSim\Grid\Services\CoreFunctions\Remote\OpenSim.Grid.Services.CoreFunctions.Remote.csproj", "{E5E729AD-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.Services.Grid", "OpenSim\Grid\Services\Grid\OpenSim.Grid.Services.Grid.csproj", "{C14E4DD8-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.Services.User", "OpenSim\Grid\Services\User\OpenSim.Grid.Services.User.csproj", "{DCF71AE6-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.UserServer", "OpenSim\Grid\UserServer\OpenSim.Grid.UserServer.csproj", "{2FC96F92-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Caches", "OpenSim\Region\Caches\OpenSim.Region.Caches.csproj", "{61FCCDB3-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Capabilities", "OpenSim\Region\Capabilities\OpenSim.Region.Capabilities.csproj", "{39038E85-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.ClientStack", "OpenSim\Region\ClientStack\OpenSim.Region.ClientStack.csproj", "{DC3698B2-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Communications.Local", "OpenSim\Region\Communications\Local\OpenSim.Region.Communications.Local.csproj", "{BFB5D807-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Communications.OGS1", "OpenSim\Region\Communications\OGS1\OpenSim.Region.Communications.OGS1.csproj", "{4806E378-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Environment", "OpenSim\Region\Environment\OpenSim.Region.Environment.csproj", "{DCBA491C-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.GridInterfaces.Local", "OpenSim\Region\GridInterfaces\Local\OpenSim.Region.GridInterfaces.Local.csproj", "{241A8CDD-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.GridInterfaces.Remote", "OpenSim\Region\GridInterfaces\Remote\OpenSim.Region.GridInterfaces.Remote.csproj", "{98C7B681-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Physics.BasicPhysicsPlugin", "OpenSim\Region\Physics\BasicPhysicsPlugin\OpenSim.Region.Physics.BasicPhysicsPlugin.csproj", "{15B4FEF3-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Physics.Manager", "OpenSim\Region\Physics\Manager\OpenSim.Region.Physics.Manager.csproj", "{F4FF31EB-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Physics.OdePlugin", "OpenSim\Region\Physics\OdePlugin\OpenSim.Region.Physics.OdePlugin.csproj", "{90620634-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Physics.PhysXPlugin", "OpenSim\Region\Physics\PhysXPlugin\OpenSim.Region.Physics.PhysXPlugin.csproj", "{A6D191D8-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Storage.LocalStorageBerkeleyDB", "OpenSim\Region\Storage\LocalStorageBerkeleyDB\OpenSim.Region.Storage.LocalStorageBerkeleyDB.csproj", "{A4691E59-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Storage.LocalStorageDb4o", "OpenSim\Region\Storage\LocalStorageDb4o\OpenSim.Region.Storage.LocalStorageDb4o.csproj", "{43DB702D-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Storage.LocalStorageSQLite", "OpenSim\Region\Storage\LocalStorageSQLite\OpenSim.Region.Storage.LocalStorageSQLite.csproj", "{477B9270-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Region.Terrain.BasicTerrain", "OpenSim\Region\Terrain.BasicTerrain\OpenSim.Region.Terrain.BasicTerrain.csproj", "{C9E0F891-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleApp", "OpenSim\Region\Examples\SimpleApp\SimpleApp.csproj", "{24B12448-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectDependencies) = postSolution
|
||||
({438A9556-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).4 = ({CB52B7E7-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).5 = ({A45242A2-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).6 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).7 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).8 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).9 = ({586E2916-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).10 = ({61FCCDB3-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).11 = ({DC3698B2-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).12 = ({BFB5D807-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).13 = ({4806E378-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).14 = ({DCBA491C-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).15 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).16 = ({C9E0F891-0000-0000-0000-000000000000})
|
||||
({8ACA2445-0000-0000-0000-000000000000}).2 = ({A45242A2-0000-0000-0000-000000000000})
|
||||
({8ACA2445-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({CB52B7E7-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({CB52B7E7-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({A45242A2-0000-0000-0000-000000000000}).0 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({A45242A2-0000-0000-0000-000000000000}).1 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({FD2D303D-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({2CC71860-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({2CC71860-0000-0000-0000-000000000000}).2 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({586E2916-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({586E2916-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({586E2916-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({586E2916-0000-0000-0000-000000000000}).6 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({E5F1A03B-0000-0000-0000-000000000000}).0 = ({A45242A2-0000-0000-0000-000000000000})
|
||||
({E5F1A03B-0000-0000-0000-000000000000}).1 = ({F22B4FF8-0000-0000-0000-000000000000})
|
||||
({60FCC3A6-0000-0000-0000-000000000000}).0 = ({A45242A2-0000-0000-0000-000000000000})
|
||||
({60FCC3A6-0000-0000-0000-000000000000}).1 = ({C14E4DD8-0000-0000-0000-000000000000})
|
||||
({F22B4FF8-0000-0000-0000-000000000000}).0 = ({A45242A2-0000-0000-0000-000000000000})
|
||||
({F22B4FF8-0000-0000-0000-000000000000}).1 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({F22B4FF8-0000-0000-0000-000000000000}).2 = ({6251A10E-0000-0000-0000-000000000000})
|
||||
({F22B4FF8-0000-0000-0000-000000000000}).3 = ({FE7B9CD5-0000-0000-0000-000000000000})
|
||||
({F22B4FF8-0000-0000-0000-000000000000}).4 = ({E5E729AD-0000-0000-0000-000000000000})
|
||||
({FE7B9CD5-0000-0000-0000-000000000000}).0 = ({6251A10E-0000-0000-0000-000000000000})
|
||||
({E5E729AD-0000-0000-0000-000000000000}).0 = ({6251A10E-0000-0000-0000-000000000000})
|
||||
({C14E4DD8-0000-0000-0000-000000000000}).0 = ({A45242A2-0000-0000-0000-000000000000})
|
||||
({C14E4DD8-0000-0000-0000-000000000000}).1 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({C14E4DD8-0000-0000-0000-000000000000}).2 = ({6251A10E-0000-0000-0000-000000000000})
|
||||
({C14E4DD8-0000-0000-0000-000000000000}).3 = ({FE7B9CD5-0000-0000-0000-000000000000})
|
||||
({C14E4DD8-0000-0000-0000-000000000000}).4 = ({E5E729AD-0000-0000-0000-000000000000})
|
||||
({DCF71AE6-0000-0000-0000-000000000000}).0 = ({A45242A2-0000-0000-0000-000000000000})
|
||||
({DCF71AE6-0000-0000-0000-000000000000}).1 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({DCF71AE6-0000-0000-0000-000000000000}).2 = ({6251A10E-0000-0000-0000-000000000000})
|
||||
({DCF71AE6-0000-0000-0000-000000000000}).3 = ({FE7B9CD5-0000-0000-0000-000000000000})
|
||||
({DCF71AE6-0000-0000-0000-000000000000}).4 = ({E5E729AD-0000-0000-0000-000000000000})
|
||||
({2FC96F92-0000-0000-0000-000000000000}).0 = ({A45242A2-0000-0000-0000-000000000000})
|
||||
({2FC96F92-0000-0000-0000-000000000000}).1 = ({DCF71AE6-0000-0000-0000-000000000000})
|
||||
({61FCCDB3-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({39038E85-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({39038E85-0000-0000-0000-000000000000}).2 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({39038E85-0000-0000-0000-000000000000}).3 = ({61FCCDB3-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).4 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).5 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).6 = ({61FCCDB3-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).7 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).8 = ({C9E0F891-0000-0000-0000-000000000000})
|
||||
({BFB5D807-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({BFB5D807-0000-0000-0000-000000000000}).2 = ({CB52B7E7-0000-0000-0000-000000000000})
|
||||
({BFB5D807-0000-0000-0000-000000000000}).3 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({BFB5D807-0000-0000-0000-000000000000}).4 = ({586E2916-0000-0000-0000-000000000000})
|
||||
({4806E378-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({4806E378-0000-0000-0000-000000000000}).2 = ({CB52B7E7-0000-0000-0000-000000000000})
|
||||
({4806E378-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({4806E378-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({4806E378-0000-0000-0000-000000000000}).5 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).4 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).5 = ({CB52B7E7-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).6 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).8 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).9 = ({61FCCDB3-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).10 = ({39038E85-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).11 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).12 = ({C9E0F891-0000-0000-0000-000000000000})
|
||||
({241A8CDD-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({241A8CDD-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({98C7B681-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({98C7B681-0000-0000-0000-000000000000}).2 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({15B4FEF3-0000-0000-0000-000000000000}).1 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({F4FF31EB-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({F4FF31EB-0000-0000-0000-000000000000}).2 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({90620634-0000-0000-0000-000000000000}).2 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({A6D191D8-0000-0000-0000-000000000000}).1 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({A4691E59-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({A4691E59-0000-0000-0000-000000000000}).4 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({43DB702D-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({43DB702D-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({477B9270-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({477B9270-0000-0000-0000-000000000000}).2 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).2 = ({CB52B7E7-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).4 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).5 = ({586E2916-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).6 = ({61FCCDB3-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).7 = ({39038E85-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).8 = ({DC3698B2-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).9 = ({BFB5D807-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).10 = ({DCBA491C-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).11 = ({241A8CDD-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).12 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{438A9556-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{438A9556-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8ACA2445-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8ACA2445-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8ACA2445-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8ACA2445-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CB52B7E7-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CB52B7E7-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CB52B7E7-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CB52B7E7-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A45242A2-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A45242A2-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A45242A2-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A45242A2-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A7CD0630-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A7CD0630-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A7CD0630-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A7CD0630-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2CC71860-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2CC71860-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2CC71860-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2CC71860-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6251A10E-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6251A10E-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6251A10E-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6251A10E-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{586E2916-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{586E2916-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F22B4FF8-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F22B4FF8-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F22B4FF8-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F22B4FF8-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FE7B9CD5-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FE7B9CD5-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FE7B9CD5-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FE7B9CD5-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E5E729AD-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E5E729AD-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E5E729AD-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E5E729AD-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C14E4DD8-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C14E4DD8-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C14E4DD8-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C14E4DD8-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DCF71AE6-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DCF71AE6-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DCF71AE6-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DCF71AE6-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{61FCCDB3-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{61FCCDB3-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{61FCCDB3-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{61FCCDB3-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{39038E85-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{39038E85-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{39038E85-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{39038E85-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DC3698B2-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DC3698B2-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DC3698B2-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DC3698B2-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BFB5D807-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BFB5D807-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BFB5D807-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BFB5D807-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4806E378-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4806E378-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4806E378-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4806E378-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DCBA491C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DCBA491C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DCBA491C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DCBA491C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{241A8CDD-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{241A8CDD-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{241A8CDD-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{241A8CDD-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{98C7B681-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{98C7B681-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{98C7B681-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{98C7B681-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{15B4FEF3-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{15B4FEF3-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{15B4FEF3-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{15B4FEF3-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F4FF31EB-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F4FF31EB-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F4FF31EB-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F4FF31EB-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{90620634-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{90620634-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{90620634-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{90620634-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A6D191D8-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A6D191D8-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A6D191D8-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A6D191D8-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A4691E59-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A4691E59-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A4691E59-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A4691E59-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{43DB702D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{43DB702D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{43DB702D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{43DB702D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{477B9270-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{477B9270-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{477B9270-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{477B9270-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C9E0F891-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C9E0F891-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C9E0F891-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C9E0F891-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{24B12448-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{24B12448-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{24B12448-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{24B12448-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
Binary file not shown.
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
using libsecondlife.Packets;
|
||||
using OpenSim.Framework.Data;
|
||||
using OpenSim.Framework.Interfaces;
|
||||
using OpenSim.Framework.Types;
|
||||
|
||||
namespace OpenSim.Framework.Communications
|
||||
{
|
||||
|
||||
public class CommunicationsManager
|
||||
{
|
||||
public IUserServices UserServer;
|
||||
public IGridServices GridServer;
|
||||
public IInterRegionCommunications InterRegion;
|
||||
|
||||
public NetworkServersInfo ServersInfo;
|
||||
public CommunicationsManager(NetworkServersInfo serversInfo)
|
||||
{
|
||||
ServersInfo = serversInfo;
|
||||
}
|
||||
|
||||
#region Packet Handlers
|
||||
public void HandleUUIDNameRequest(LLUUID uuid, IClientAPI remote_client)
|
||||
{
|
||||
Encoding enc = Encoding.ASCII;
|
||||
UserProfileData profileData = this.UserServer.GetUserProfile(uuid);
|
||||
if (profileData != null)
|
||||
{
|
||||
UUIDNameReplyPacket packet = new UUIDNameReplyPacket();
|
||||
packet.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[1];
|
||||
packet.UUIDNameBlock[0] = new UUIDNameReplyPacket.UUIDNameBlockBlock();
|
||||
packet.UUIDNameBlock[0].ID = profileData.UUID;
|
||||
packet.UUIDNameBlock[0].FirstName = enc.GetBytes(profileData.username + "\0");
|
||||
packet.UUIDNameBlock[0].LastName = enc.GetBytes(profileData.surname +"\0");
|
||||
remote_client.OutPacket((Packet)packet);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenSim.Framework.Types;
|
||||
|
||||
namespace OpenSim.Framework.Communications
|
||||
{
|
||||
|
||||
|
||||
public interface IGridServices
|
||||
{
|
||||
RegionCommsListener RegisterRegion(RegionInfo regionInfos);
|
||||
List<RegionInfo> RequestNeighbours(RegionInfo regionInfo);
|
||||
RegionInfo RequestNeighbourInfo(ulong regionHandle);
|
||||
List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using libsecondlife;
|
||||
using OpenSim.Framework.Types;
|
||||
|
||||
namespace OpenSim.Framework.Communications
|
||||
{
|
||||
public interface IInterRegionCommunications
|
||||
{
|
||||
bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData);
|
||||
bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using libsecondlife;
|
||||
using OpenSim.Framework.Data;
|
||||
|
||||
namespace OpenSim.Framework.Communications
|
||||
{
|
||||
public interface IUserServices
|
||||
{
|
||||
UserProfileData GetUserProfile(string firstName, string lastName);
|
||||
UserProfileData GetUserProfile(string name);
|
||||
UserProfileData GetUserProfile(LLUUID avatarID);
|
||||
|
||||
UserProfileData SetupMasterUser(string firstName, string lastName);
|
||||
UserProfileData SetupMasterUser(string firstName, string lastName, string password);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{CB52B7E7-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Framework.Communications</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Framework.Communications</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="libsecondlife.dll" >
|
||||
<HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" >
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" >
|
||||
<HintPath>System.Xml.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\General\OpenSim.Framework.csproj">
|
||||
<Name>OpenSim.Framework</Name>
|
||||
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Data\OpenSim.Framework.Data.csproj">
|
||||
<Name>OpenSim.Framework.Data</Name>
|
||||
<Project>{36B72A9B-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="IUserServices.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="IGridServices.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CommunicationsManager.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="IInterRegionCommunications.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\Sugilite\bin\</ReferencePath>
|
||||
<LastOpenVersion>8.0.50727</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
</Project>
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenGrid.Framework.Communications")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenGrid.Framework.Communications")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("13e7c396-78a9-4a5c-baf2-6f980ea75d95")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
..\..\..\bin\OpenSim.Framework.Communications.dll
|
||||
obj\Release\ResolveAssemblyReference.cache
|
||||
obj\Release\OpenSim.Framework.Communications.dll
|
||||
obj\Debug\ResolveAssemblyReference.cache
|
||||
obj\Debug\OpenSim.Framework.Communications.dll
|
||||
obj\Debug\OpenSim.Framework.Communications.pdb
|
||||
..\..\..\bin\OpenSim.Framework.Communications.pdb
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,65 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenSim.Framework.Console;
|
||||
namespace OpenSim.Framework.Configuration
|
||||
{
|
||||
|
||||
public class ConfigurationManager
|
||||
{
|
||||
List<ConfigurationMember> configurationMembers = new List<ConfigurationMember>();
|
||||
|
||||
public ConfigurationManager()
|
||||
{
|
||||
}
|
||||
|
||||
public void addConfigurationMember(ConfigurationMember configMember)
|
||||
{
|
||||
if (!configurationMembers.Contains(configMember))
|
||||
{
|
||||
configurationMembers.Add(configMember);
|
||||
}
|
||||
}
|
||||
|
||||
public void gatherConfiguration()
|
||||
{
|
||||
foreach (ConfigurationMember configMember in configurationMembers)
|
||||
{
|
||||
if (configMember.configurationFilename.Trim() != "")
|
||||
{
|
||||
XmlConfiguration xmlConfig = new XmlConfiguration(configMember.configurationFilename);
|
||||
xmlConfig.LoadData();
|
||||
string attribute = "";
|
||||
foreach (ConfigurationOption configOption in configMember.configurationOptions)
|
||||
{
|
||||
attribute = xmlConfig.GetAttribute(configOption.configurationKey);
|
||||
if (attribute == "")
|
||||
{
|
||||
if (configMember.configurationDescription.Trim() != "")
|
||||
{
|
||||
attribute = MainLog.Instance.CmdPrompt(configMember.configurationDescription + ": " + configOption.configurationQuestion, configOption.configurationDefault);
|
||||
}
|
||||
else
|
||||
{
|
||||
attribute = MainLog.Instance.CmdPrompt(configMember.configurationDescription + ": " + configOption.configurationQuestion, configOption.configurationDefault);
|
||||
}
|
||||
xmlConfig.SetAttribute(configOption.configurationKey, attribute);
|
||||
}
|
||||
configMember.handleConfigurationItem(configOption.configurationKey, attribute);
|
||||
}
|
||||
xmlConfig.Commit();
|
||||
xmlConfig.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Error out, no filename specified
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void clearConfigurationMembers()
|
||||
{
|
||||
configurationMembers.Clear();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework.Configuration
|
||||
{
|
||||
public abstract class ConfigurationMember
|
||||
{
|
||||
public List<ConfigurationOption> configurationOptions = new List<ConfigurationOption>();
|
||||
public string configurationFilename = "";
|
||||
public string configurationDescription = "";
|
||||
public abstract void handleConfigurationItem(string configuration_key, string configuration_value);
|
||||
|
||||
|
||||
public void setConfigurationFilename(string filename)
|
||||
{
|
||||
configurationFilename = filename;
|
||||
}
|
||||
public void setConfigurationDescription(string desc)
|
||||
{
|
||||
configurationDescription = desc;
|
||||
}
|
||||
public void addConfigurationOption(string configuration_key, string configuration_question, string configuration_default)
|
||||
{
|
||||
ConfigurationOption configOption = new ConfigurationOption();
|
||||
configOption.configurationKey = configuration_key;
|
||||
configOption.configurationQuestion = configuration_question;
|
||||
configOption.configurationDefault = configuration_default;
|
||||
|
||||
if (configuration_key != "" && configuration_question != "")
|
||||
{
|
||||
if (!configurationOptions.Contains(configOption))
|
||||
{
|
||||
configurationOptions.Add(configOption);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Can't add it, error out.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework.Configuration
|
||||
{
|
||||
public class ConfigurationOption
|
||||
{
|
||||
public string configurationKey = "";
|
||||
public string configurationQuestion = "";
|
||||
public string configurationDefault = "";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A45242A2-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Framework.Configuration</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Framework.Configuration</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" >
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" >
|
||||
<HintPath>System.Xml.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\General\OpenSim.Framework.csproj">
|
||||
<Name>OpenSim.Framework</Name>
|
||||
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Console\OpenSim.Framework.Console.csproj">
|
||||
<Name>OpenSim.Framework.Console</Name>
|
||||
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ConfigurationManager.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ConfigurationOption.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="XmlConfiguration.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ConfigurationMember.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\Sugilite\bin\</ReferencePath>
|
||||
<LastOpenVersion>8.0.50727</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
</Project>
|
|
@ -0,0 +1,90 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{752716E0-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Framework.GenericConfig</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Framework.GenericConfig</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" >
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" >
|
||||
<HintPath>System.Xml.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\General\OpenSim.Framework.csproj">
|
||||
<Name>OpenSim.Framework</Name>
|
||||
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="XmlConfig.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\Sugilite\bin\</ReferencePath>
|
||||
<LastOpenVersion>8.0.50727</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
</Project>
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
namespace OpenSim.Framework.Configuration
|
||||
{
|
||||
public class XmlConfiguration
|
||||
{
|
||||
private XmlDocument doc;
|
||||
private XmlNode rootNode;
|
||||
private XmlNode configNode;
|
||||
private string fileName;
|
||||
private bool createdFile = false;
|
||||
|
||||
public XmlConfiguration(string filename)
|
||||
{
|
||||
fileName = filename;
|
||||
}
|
||||
|
||||
public void LoadData()
|
||||
{
|
||||
doc = new XmlDocument();
|
||||
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
XmlTextReader reader = new XmlTextReader(fileName);
|
||||
reader.WhitespaceHandling = WhitespaceHandling.None;
|
||||
doc.Load(reader);
|
||||
reader.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
createdFile = true;
|
||||
rootNode = doc.CreateNode(XmlNodeType.Element, "Root", "");
|
||||
doc.AppendChild(rootNode);
|
||||
configNode = doc.CreateNode(XmlNodeType.Element, "Config", "");
|
||||
rootNode.AppendChild(configNode);
|
||||
}
|
||||
|
||||
|
||||
rootNode = doc.FirstChild;
|
||||
if (rootNode.Name != "Root")
|
||||
throw new Exception("Error: Invalid .xml File. Missing <Root>");
|
||||
|
||||
configNode = rootNode.FirstChild;
|
||||
if (configNode.Name != "Config")
|
||||
throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>");
|
||||
|
||||
if (createdFile)
|
||||
{
|
||||
this.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
public string GetAttribute(string attributeName)
|
||||
{
|
||||
string result = "";
|
||||
if (configNode.Attributes[attributeName] != null)
|
||||
{
|
||||
result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool SetAttribute(string attributeName, string attributeValue)
|
||||
{
|
||||
if (configNode.Attributes[attributeName] != null)
|
||||
{
|
||||
((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlAttribute attri;
|
||||
attri = doc.CreateAttribute(attributeName);
|
||||
attri.Value = attributeValue;
|
||||
configNode.Attributes.Append(attri);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Commit()
|
||||
{
|
||||
doc.Save(fileName);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
configNode = null;
|
||||
rootNode = null;
|
||||
doc = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
obj\Release\ResolveAssemblyReference.cache
|
||||
..\..\..\bin\OpenSim.Framework.Configuration.dll
|
||||
obj\Release\OpenSim.Framework.Configuration.dll
|
||||
..\..\..\bin\OpenSim.Framework.Configuration.pdb
|
||||
obj\Debug\ResolveAssemblyReference.cache
|
||||
obj\Debug\OpenSim.Framework.Configuration.dll
|
||||
obj\Debug\OpenSim.Framework.Configuration.pdb
|
Binary file not shown.
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: AssemblyTitle("ServerConsole")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ServerConsole")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
namespace OpenSim.Framework.Console
|
||||
{
|
||||
public interface conscmd_callback
|
||||
{
|
||||
void RunCmd(string cmd, string[] cmdparams);
|
||||
void Show(string ShowWhat);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,282 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace OpenSim.Framework.Console
|
||||
{
|
||||
public enum LogPriority : int
|
||||
{
|
||||
CRITICAL,
|
||||
HIGH,
|
||||
MEDIUM,
|
||||
NORMAL,
|
||||
LOW,
|
||||
VERBOSE,
|
||||
EXTRAVERBOSE
|
||||
}
|
||||
|
||||
public class LogBase
|
||||
{
|
||||
StreamWriter Log;
|
||||
public conscmd_callback cmdparser;
|
||||
public string componentname;
|
||||
private bool m_silent;
|
||||
|
||||
public LogBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent)
|
||||
{
|
||||
this.componentname = componentname;
|
||||
this.cmdparser = cmdparser;
|
||||
this.m_silent = silent;
|
||||
System.Console.WriteLine("ServerConsole.cs - creating new local console");
|
||||
|
||||
if (String.IsNullOrEmpty(LogFile))
|
||||
{
|
||||
LogFile = componentname + ".log";
|
||||
}
|
||||
|
||||
System.Console.WriteLine("Logs will be saved to current directory in " + LogFile);
|
||||
Log = File.AppendText(LogFile);
|
||||
Log.WriteLine("========================================================================");
|
||||
Log.WriteLine(componentname + " Started at " + DateTime.Now.ToString());
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Log.WriteLine("Shutdown at " + DateTime.Now.ToString());
|
||||
Log.Close();
|
||||
}
|
||||
|
||||
public void Write(string format, params object[] args)
|
||||
{
|
||||
Notice(format, args);
|
||||
return;
|
||||
}
|
||||
|
||||
public void WriteLine(LogPriority importance, string format, params object[] args)
|
||||
{
|
||||
Log.WriteLine(format, args);
|
||||
Log.Flush();
|
||||
if (!m_silent)
|
||||
{
|
||||
System.Console.WriteLine(format, args);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
public void Warn(string format, params object[] args)
|
||||
{
|
||||
WriteNewLine(ConsoleColor.Yellow, format, args);
|
||||
return;
|
||||
}
|
||||
|
||||
public void Notice(string format, params object[] args)
|
||||
{
|
||||
WriteNewLine(ConsoleColor.White, format, args);
|
||||
return;
|
||||
}
|
||||
|
||||
public void Error(string format, params object[] args)
|
||||
{
|
||||
WriteNewLine(ConsoleColor.Red, format, args);
|
||||
return;
|
||||
}
|
||||
|
||||
public void Verbose(string format, params object[] args)
|
||||
{
|
||||
WriteNewLine(ConsoleColor.Gray, format, args);
|
||||
return;
|
||||
}
|
||||
|
||||
public void Status(string format, params object[] args)
|
||||
{
|
||||
WriteNewLine(ConsoleColor.Blue, format, args);
|
||||
return;
|
||||
}
|
||||
|
||||
private void WriteNewLine(ConsoleColor color, string format, params object[] args)
|
||||
{
|
||||
Log.WriteLine(format, args);
|
||||
Log.Flush();
|
||||
if (!m_silent)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Console.ForegroundColor = color;
|
||||
System.Console.WriteLine(format, args);
|
||||
System.Console.ResetColor();
|
||||
}
|
||||
catch (ArgumentNullException)
|
||||
{
|
||||
// Some older systems dont support coloured text.
|
||||
System.Console.WriteLine(format, args);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
public string ReadLine()
|
||||
{
|
||||
string TempStr = System.Console.ReadLine();
|
||||
Log.WriteLine(TempStr);
|
||||
return TempStr;
|
||||
}
|
||||
|
||||
public int Read()
|
||||
{
|
||||
int TempInt = System.Console.Read();
|
||||
Log.Write((char)TempInt);
|
||||
return TempInt;
|
||||
}
|
||||
|
||||
public IPAddress CmdPromptIPAddress(string prompt, string defaultvalue)
|
||||
{
|
||||
IPAddress address;
|
||||
string addressStr;
|
||||
|
||||
while (true)
|
||||
{
|
||||
addressStr = MainLog.Instance.CmdPrompt(prompt, defaultvalue);
|
||||
if (IPAddress.TryParse(addressStr, out address))
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Error("Illegal address. Please re-enter.");
|
||||
}
|
||||
}
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
public int CmdPromptIPPort(string prompt, string defaultvalue)
|
||||
{
|
||||
int port;
|
||||
string portStr;
|
||||
|
||||
while (true)
|
||||
{
|
||||
portStr = MainLog.Instance.CmdPrompt(prompt, defaultvalue);
|
||||
if (int.TryParse(portStr, out port))
|
||||
{
|
||||
if (port >= IPEndPoint.MinPort && port <= IPEndPoint.MaxPort)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MainLog.Instance.Error("Illegal address. Please re-enter.");
|
||||
}
|
||||
|
||||
return port;
|
||||
}
|
||||
|
||||
// Displays a prompt and waits for the user to enter a string, then returns that string
|
||||
// Done with no echo and suitable for passwords
|
||||
public string PasswdPrompt(string prompt)
|
||||
{
|
||||
// FIXME: Needs to be better abstracted
|
||||
Log.WriteLine(prompt);
|
||||
this.Write(prompt);
|
||||
ConsoleColor oldfg = System.Console.ForegroundColor;
|
||||
System.Console.ForegroundColor = System.Console.BackgroundColor;
|
||||
string temp = System.Console.ReadLine();
|
||||
System.Console.ForegroundColor = oldfg;
|
||||
return temp;
|
||||
}
|
||||
|
||||
// Displays a command prompt and waits for the user to enter a string, then returns that string
|
||||
public string CmdPrompt(string prompt)
|
||||
{
|
||||
this.Write(String.Format("{0}: ", prompt));
|
||||
return this.ReadLine();
|
||||
}
|
||||
|
||||
// Displays a command prompt and returns a default value if the user simply presses enter
|
||||
public string CmdPrompt(string prompt, string defaultresponse)
|
||||
{
|
||||
string temp = CmdPrompt(String.Format("{0} [{1}]", prompt, defaultresponse));
|
||||
if (temp == "")
|
||||
{
|
||||
return defaultresponse;
|
||||
}
|
||||
else
|
||||
{
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
|
||||
// Displays a command prompt and returns a default value, user may only enter 1 of 2 options
|
||||
public string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB)
|
||||
{
|
||||
bool itisdone = false;
|
||||
string temp = CmdPrompt(prompt, defaultresponse);
|
||||
while (itisdone == false)
|
||||
{
|
||||
if ((temp == OptionA) || (temp == OptionB))
|
||||
{
|
||||
itisdone = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Notice("Valid options are " + OptionA + " or " + OptionB);
|
||||
temp = CmdPrompt(prompt, defaultresponse);
|
||||
}
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
// Runs a command with a number of parameters
|
||||
public Object RunCmd(string Cmd, string[] cmdparams)
|
||||
{
|
||||
cmdparser.RunCmd(Cmd, cmdparams);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Shows data about something
|
||||
public void ShowCommands(string ShowWhat)
|
||||
{
|
||||
cmdparser.Show(ShowWhat);
|
||||
}
|
||||
|
||||
public void MainLogPrompt()
|
||||
{
|
||||
string[] tempstrarray;
|
||||
string tempstr = this.CmdPrompt(this.componentname + "# ");
|
||||
tempstrarray = tempstr.Split(' ');
|
||||
string cmd = tempstrarray[0];
|
||||
Array.Reverse(tempstrarray);
|
||||
Array.Resize<string>(ref tempstrarray, tempstrarray.Length - 1);
|
||||
Array.Reverse(tempstrarray);
|
||||
string[] cmdparams = (string[])tempstrarray;
|
||||
RunCmd(cmd, cmdparams);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
namespace OpenSim.Framework.Console
|
||||
{
|
||||
public class MainLog {
|
||||
|
||||
private static LogBase instance;
|
||||
|
||||
public static LogBase Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
set
|
||||
{
|
||||
instance = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A7CD0630-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Framework.Console</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Framework.Console</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" >
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LogBase.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ConsoleCallbacksBase.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainLog.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\Sugilite\bin\</ReferencePath>
|
||||
<LastOpenVersion>8.0.50727</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
</Project>
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
..\..\..\bin\OpenSim.Framework.Console.dll
|
||||
obj\Release\ResolveAssemblyReference.cache
|
||||
obj\Release\OpenSim.Framework.Console.dll
|
||||
obj\Debug\ResolveAssemblyReference.cache
|
||||
obj\Debug\OpenSim.Framework.Console.dll
|
||||
obj\Debug\OpenSim.Framework.Console.pdb
|
||||
..\..\..\bin\OpenSim.Framework.Console.pdb
|
Binary file not shown.
|
@ -0,0 +1,162 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data.DB4o
|
||||
{
|
||||
/// <summary>
|
||||
/// A grid server storage mechanism employing the DB4o database system
|
||||
/// </summary>
|
||||
class DB4oGridData : IGridData
|
||||
{
|
||||
/// <summary>
|
||||
/// The database manager object
|
||||
/// </summary>
|
||||
DB4oGridManager manager;
|
||||
|
||||
/// <summary>
|
||||
/// Called when the plugin is first loaded (as constructors are not called)
|
||||
/// </summary>
|
||||
public void Initialise() {
|
||||
manager = new DB4oGridManager("gridserver.yap");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of regions within the specified ranges
|
||||
/// </summary>
|
||||
/// <param name="a">minimum X coordinate</param>
|
||||
/// <param name="b">minimum Y coordinate</param>
|
||||
/// <param name="c">maximum X coordinate</param>
|
||||
/// <param name="d">maximum Y coordinate</param>
|
||||
/// <returns>An array of region profiles</returns>
|
||||
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a region located at the specified regionHandle (warning multiple regions may occupy the one spot, first found is returned)
|
||||
/// </summary>
|
||||
/// <param name="handle">The handle to search for</param>
|
||||
/// <returns>A region profile</returns>
|
||||
public SimProfileData GetProfileByHandle(ulong handle) {
|
||||
lock (manager.simProfiles)
|
||||
{
|
||||
foreach (LLUUID UUID in manager.simProfiles.Keys)
|
||||
{
|
||||
if (manager.simProfiles[UUID].regionHandle == handle)
|
||||
{
|
||||
return manager.simProfiles[UUID];
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new Exception("Unable to find profile with handle (" + handle.ToString() + ")");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a specific region
|
||||
/// </summary>
|
||||
/// <param name="uuid">The region ID code</param>
|
||||
/// <returns>A region profile</returns>
|
||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
{
|
||||
lock (manager.simProfiles)
|
||||
{
|
||||
if (manager.simProfiles.ContainsKey(uuid))
|
||||
return manager.simProfiles[uuid];
|
||||
}
|
||||
throw new Exception("Unable to find profile with UUID (" + uuid.ToStringHyphenated() + "). Total Registered Regions: " + manager.simProfiles.Count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new specified region to the database
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile to add</param>
|
||||
/// <returns>A dataresponse enum indicating success</returns>
|
||||
public DataResponse AddProfile(SimProfileData profile)
|
||||
{
|
||||
lock (manager.simProfiles)
|
||||
{
|
||||
if (manager.AddRow(profile))
|
||||
{
|
||||
return DataResponse.RESPONSE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DataResponse.RESPONSE_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Authenticates a new region using the shared secrets. NOT SECURE.
|
||||
/// </summary>
|
||||
/// <param name="uuid">The UUID the region is authenticating with</param>
|
||||
/// <param name="handle">The location the region is logging into (unused in Db4o)</param>
|
||||
/// <param name="key">The shared secret</param>
|
||||
/// <returns>Authenticated?</returns>
|
||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string key) {
|
||||
if (manager.simProfiles[uuid].regionRecvKey == key)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down the database
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
manager = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the providers name
|
||||
/// </summary>
|
||||
/// <returns>The name of the storage system</returns>
|
||||
public string getName()
|
||||
{
|
||||
return "DB4o Grid Provider";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the providers version
|
||||
/// </summary>
|
||||
/// <returns>The version of the storage system</returns>
|
||||
public string getVersion()
|
||||
{
|
||||
return "0.1";
|
||||
}
|
||||
|
||||
public ReservationData GetReservationAtPoint(uint x, uint y)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Db4objects.Db4o;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data.DB4o
|
||||
{
|
||||
/// <summary>
|
||||
/// A Database manager for Db4o
|
||||
/// </summary>
|
||||
class DB4oGridManager
|
||||
{
|
||||
/// <summary>
|
||||
/// A list of the current regions connected (in-memory cache)
|
||||
/// </summary>
|
||||
public Dictionary<LLUUID, SimProfileData> simProfiles = new Dictionary<LLUUID, SimProfileData>();
|
||||
/// <summary>
|
||||
/// Database File Name
|
||||
/// </summary>
|
||||
string dbfl;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new grid storage manager
|
||||
/// </summary>
|
||||
/// <param name="db4odb">Filename to the database file</param>
|
||||
public DB4oGridManager(string db4odb)
|
||||
{
|
||||
dbfl = db4odb;
|
||||
IObjectContainer database;
|
||||
database = Db4oFactory.OpenFile(dbfl);
|
||||
IObjectSet result = database.Get(typeof(SimProfileData));
|
||||
// Loads the file into the in-memory cache
|
||||
foreach(SimProfileData row in result) {
|
||||
simProfiles.Add(row.UUID, row);
|
||||
}
|
||||
database.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new profile to the database (Warning: Probably slow.)
|
||||
/// </summary>
|
||||
/// <param name="row">The profile to add</param>
|
||||
/// <returns>Successful?</returns>
|
||||
public bool AddRow(SimProfileData row)
|
||||
{
|
||||
if (simProfiles.ContainsKey(row.UUID))
|
||||
{
|
||||
simProfiles[row.UUID] = row;
|
||||
}
|
||||
else
|
||||
{
|
||||
simProfiles.Add(row.UUID, row);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IObjectContainer database;
|
||||
database = Db4oFactory.OpenFile(dbfl);
|
||||
database.Set(row);
|
||||
database.Close();
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A manager for the DB4o database (user profiles)
|
||||
/// </summary>
|
||||
class DB4oUserManager
|
||||
{
|
||||
/// <summary>
|
||||
/// A list of the user profiles (in memory cache)
|
||||
/// </summary>
|
||||
public Dictionary<LLUUID, UserProfileData> userProfiles = new Dictionary<LLUUID, UserProfileData>();
|
||||
/// <summary>
|
||||
/// Database filename
|
||||
/// </summary>
|
||||
string dbfl;
|
||||
|
||||
/// <summary>
|
||||
/// Initialises a new DB manager
|
||||
/// </summary>
|
||||
/// <param name="db4odb">The filename to the database</param>
|
||||
public DB4oUserManager(string db4odb)
|
||||
{
|
||||
dbfl = db4odb;
|
||||
IObjectContainer database;
|
||||
database = Db4oFactory.OpenFile(dbfl);
|
||||
// Load to cache
|
||||
IObjectSet result = database.Get(typeof(UserProfileData));
|
||||
foreach (UserProfileData row in result)
|
||||
{
|
||||
userProfiles.Add(row.UUID, row);
|
||||
}
|
||||
database.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new profile to the database (Warning: Probably slow.)
|
||||
/// </summary>
|
||||
/// <param name="row">The profile to add</param>
|
||||
/// <returns>Successful?</returns>
|
||||
public bool AddRow(UserProfileData row)
|
||||
{
|
||||
if (userProfiles.ContainsKey(row.UUID))
|
||||
{
|
||||
userProfiles[row.UUID] = row;
|
||||
}
|
||||
else
|
||||
{
|
||||
userProfiles.Add(row.UUID, row);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IObjectContainer database;
|
||||
database = Db4oFactory.OpenFile(dbfl);
|
||||
database.Set(row);
|
||||
database.Close();
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,202 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data.DB4o
|
||||
{
|
||||
/// <summary>
|
||||
/// A User storage interface for the DB4o database system
|
||||
/// </summary>
|
||||
public class DB4oUserData : IUserData
|
||||
{
|
||||
/// <summary>
|
||||
/// The database manager
|
||||
/// </summary>
|
||||
DB4oUserManager manager;
|
||||
|
||||
/// <summary>
|
||||
/// Artificial constructor called upon plugin load
|
||||
/// </summary>
|
||||
public void Initialise()
|
||||
{
|
||||
manager = new DB4oUserManager("userprofiles.yap");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a specified user profile from a UUID
|
||||
/// </summary>
|
||||
/// <param name="uuid">The users UUID</param>
|
||||
/// <returns>A user profile</returns>
|
||||
public UserProfileData getUserByUUID(LLUUID uuid)
|
||||
{
|
||||
if(manager.userProfiles.ContainsKey(uuid))
|
||||
return manager.userProfiles[uuid];
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a user by searching for its name
|
||||
/// </summary>
|
||||
/// <param name="name">The users account name</param>
|
||||
/// <returns>A matching users profile</returns>
|
||||
public UserProfileData getUserByName(string name)
|
||||
{
|
||||
return getUserByName(name.Split(' ')[0], name.Split(' ')[1]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a user by searching for its name
|
||||
/// </summary>
|
||||
/// <param name="fname">The first part of the users account name</param>
|
||||
/// <param name="lname">The second part of the users account name</param>
|
||||
/// <returns>A matching users profile</returns>
|
||||
public UserProfileData getUserByName(string fname, string lname)
|
||||
{
|
||||
foreach (UserProfileData profile in manager.userProfiles.Values)
|
||||
{
|
||||
if (profile.username == fname && profile.surname == lname)
|
||||
return profile;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a user by UUID direct
|
||||
/// </summary>
|
||||
/// <param name="uuid">The users account ID</param>
|
||||
/// <returns>A matching users profile</returns>
|
||||
public UserAgentData getAgentByUUID(LLUUID uuid)
|
||||
{
|
||||
try
|
||||
{
|
||||
return getUserByUUID(uuid).currentAgent;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a session by account name
|
||||
/// </summary>
|
||||
/// <param name="name">The account name</param>
|
||||
/// <returns>The users session agent</returns>
|
||||
public UserAgentData getAgentByName(string name)
|
||||
{
|
||||
return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a session by account name
|
||||
/// </summary>
|
||||
/// <param name="fname">The first part of the users account name</param>
|
||||
/// <param name="lname">The second part of the users account name</param>
|
||||
/// <returns>A user agent</returns>
|
||||
public UserAgentData getAgentByName(string fname, string lname)
|
||||
{
|
||||
try
|
||||
{
|
||||
return getUserByName(fname,lname).currentAgent;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new user profile
|
||||
/// </summary>
|
||||
/// <param name="user">The profile to add to the database</param>
|
||||
public void addNewUserProfile(UserProfileData user)
|
||||
{
|
||||
try
|
||||
{
|
||||
manager.AddRow(user);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new user agent
|
||||
/// </summary>
|
||||
/// <param name="agent">The agent to add to the database</param>
|
||||
public void addNewUserAgent(UserAgentData agent)
|
||||
{
|
||||
// Do nothing. yet.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transfers money between two user accounts
|
||||
/// </summary>
|
||||
/// <param name="from">Starting account</param>
|
||||
/// <param name="to">End account</param>
|
||||
/// <param name="amount">The amount to move</param>
|
||||
/// <returns>Success?</returns>
|
||||
public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transfers inventory between two accounts
|
||||
/// </summary>
|
||||
/// <remarks>Move to inventory server</remarks>
|
||||
/// <param name="from">Senders account</param>
|
||||
/// <param name="to">Recievers account</param>
|
||||
/// <param name="item">Inventory item</param>
|
||||
/// <returns>Success?</returns>
|
||||
public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of the storage provider
|
||||
/// </summary>
|
||||
/// <returns>Storage provider name</returns>
|
||||
public string getName()
|
||||
{
|
||||
return "DB4o Userdata";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the version of the storage provider
|
||||
/// </summary>
|
||||
/// <returns>Storage provider version</returns>
|
||||
public string getVersion()
|
||||
{
|
||||
return "0.1";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{FD2D303D-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Framework.Data.DB4o</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Framework.Data.DB4o</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Db4objects.Db4o.dll" >
|
||||
<HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="libsecondlife.dll" >
|
||||
<HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" >
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" >
|
||||
<HintPath>System.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" >
|
||||
<HintPath>System.Xml.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Data\OpenSim.Framework.Data.csproj">
|
||||
<Name>OpenSim.Framework.Data</Name>
|
||||
<Project>{36B72A9B-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DB4oUserData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DB4oManager.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DB4oGridData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\Sugilite\bin\</ReferencePath>
|
||||
<LastOpenVersion>8.0.50727</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
</Project>
|
|
@ -0,0 +1,33 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenSim.Framework.Data.DB4o")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenSim.Framework.Data.DB4o")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("57991e15-79da-41b7-aa06-2e6b49165a63")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
..\..\..\bin\OpenSim.Framework.Data.DB4o.dll
|
||||
obj\Release\ResolveAssemblyReference.cache
|
||||
obj\Release\OpenSim.Framework.Data.DB4o.dll
|
||||
obj\Debug\ResolveAssemblyReference.cache
|
||||
obj\Debug\OpenSim.Framework.Data.DB4o.dll
|
||||
obj\Debug\OpenSim.Framework.Data.DB4o.pdb
|
||||
..\..\..\bin\OpenSim.Framework.Data.DB4o.pdb
|
Binary file not shown.
|
@ -0,0 +1,194 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data.MSSQL
|
||||
{
|
||||
/// <summary>
|
||||
/// A grid data interface for Microsoft SQL Server
|
||||
/// </summary>
|
||||
public class SqlGridData : IGridData
|
||||
{
|
||||
/// <summary>
|
||||
/// Database manager
|
||||
/// </summary>
|
||||
private MSSqlManager database;
|
||||
|
||||
/// <summary>
|
||||
/// Initialises the Grid Interface
|
||||
/// </summary>
|
||||
public void Initialise()
|
||||
{
|
||||
database = new MSSqlManager("localhost", "db", "user", "password", "false");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down the grid interface
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
database.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the storage system name
|
||||
/// </summary>
|
||||
/// <returns>A string containing the storage system name</returns>
|
||||
public string getName()
|
||||
{
|
||||
return "Sql OpenGridData";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the storage system version
|
||||
/// </summary>
|
||||
/// <returns>A string containing the storage system version</returns>
|
||||
public string getVersion()
|
||||
{
|
||||
return "0.1";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of regions within the specified ranges
|
||||
/// </summary>
|
||||
/// <param name="a">minimum X coordinate</param>
|
||||
/// <param name="b">minimum Y coordinate</param>
|
||||
/// <param name="c">maximum X coordinate</param>
|
||||
/// <param name="d">maximum Y coordinate</param>
|
||||
/// <returns>An array of region profiles</returns>
|
||||
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from it's location
|
||||
/// </summary>
|
||||
/// <param name="handle">Region location handle</param>
|
||||
/// <returns>Sim profile</returns>
|
||||
public SimProfileData GetProfileByHandle(ulong handle)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["handle"] = handle.ToString();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.getRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from it's UUID
|
||||
/// </summary>
|
||||
/// <param name="uuid">The region UUID</param>
|
||||
/// <returns>The sim profile</returns>
|
||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["uuid"] = uuid.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.getRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new specified region to the database
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile to add</param>
|
||||
/// <returns>A dataresponse enum indicating success</returns>
|
||||
public DataResponse AddProfile(SimProfileData profile)
|
||||
{
|
||||
if (database.insertRow(profile))
|
||||
{
|
||||
return DataResponse.RESPONSE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DataResponse.RESPONSE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
|
||||
/// </summary>
|
||||
/// <param name="uuid">The UUID of the challenger</param>
|
||||
/// <param name="handle">The attempted regionHandle of the challenger</param>
|
||||
/// <param name="authkey">The secret</param>
|
||||
/// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
|
||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey)
|
||||
{
|
||||
bool throwHissyFit = false; // Should be true by 1.0
|
||||
|
||||
if (throwHissyFit)
|
||||
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
|
||||
|
||||
SimProfileData data = GetProfileByLLUUID(uuid);
|
||||
|
||||
return (handle == data.regionHandle && authkey == data.regionSecret);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region
|
||||
/// </summary>
|
||||
/// <remarks>This requires a security audit.</remarks>
|
||||
/// <param name="uuid"></param>
|
||||
/// <param name="handle"></param>
|
||||
/// <param name="authhash"></param>
|
||||
/// <param name="challenge"></param>
|
||||
/// <returns></returns>
|
||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
||||
{
|
||||
SHA512Managed HashProvider = new SHA512Managed();
|
||||
ASCIIEncoding TextProvider = new ASCIIEncoding();
|
||||
|
||||
byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
|
||||
byte[] hash = HashProvider.ComputeHash(stream);
|
||||
return false;
|
||||
}
|
||||
public ReservationData GetReservationAtPoint(uint x, uint y)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data.MSSQL
|
||||
{
|
||||
/// <summary>
|
||||
/// A management class for the MS SQL Storage Engine
|
||||
/// </summary>
|
||||
class MSSqlManager
|
||||
{
|
||||
/// <summary>
|
||||
/// The database connection object
|
||||
/// </summary>
|
||||
IDbConnection dbcon;
|
||||
|
||||
/// <summary>
|
||||
/// Initialises and creates a new Sql connection and maintains it.
|
||||
/// </summary>
|
||||
/// <param name="hostname">The Sql server being connected to</param>
|
||||
/// <param name="database">The name of the Sql database being used</param>
|
||||
/// <param name="username">The username logging into the database</param>
|
||||
/// <param name="password">The password for the user logging in</param>
|
||||
/// <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>
|
||||
public MSSqlManager(string hostname, string database, string username, string password, string cpooling)
|
||||
{
|
||||
try
|
||||
{
|
||||
string connectionString = "Server=" + hostname + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";";
|
||||
dbcon = new SqlConnection(connectionString);
|
||||
|
||||
dbcon.Open();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exception("Error initialising Sql Database: " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down the database connection
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs a query with protection against SQL Injection by using parameterised input.
|
||||
/// </summary>
|
||||
/// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param>
|
||||
/// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param>
|
||||
/// <returns>A Sql DB Command</returns>
|
||||
public IDbCommand Query(string sql, Dictionary<string, string> parameters)
|
||||
{
|
||||
SqlCommand dbcommand = (SqlCommand)dbcon.CreateCommand();
|
||||
dbcommand.CommandText = sql;
|
||||
foreach (KeyValuePair<string, string> param in parameters)
|
||||
{
|
||||
dbcommand.Parameters.AddWithValue(param.Key, param.Value);
|
||||
}
|
||||
|
||||
return (IDbCommand)dbcommand;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs a database reader object and returns a region row
|
||||
/// </summary>
|
||||
/// <param name="reader">An active database reader</param>
|
||||
/// <returns>A region row</returns>
|
||||
public SimProfileData getRow(IDataReader reader)
|
||||
{
|
||||
SimProfileData regionprofile = new SimProfileData();
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
// Region Main
|
||||
regionprofile.regionHandle = (ulong)reader["regionHandle"];
|
||||
regionprofile.regionName = (string)reader["regionName"];
|
||||
regionprofile.UUID = new LLUUID((string)reader["uuid"]);
|
||||
|
||||
// Secrets
|
||||
regionprofile.regionRecvKey = (string)reader["regionRecvKey"];
|
||||
regionprofile.regionSecret = (string)reader["regionSecret"];
|
||||
regionprofile.regionSendKey = (string)reader["regionSendKey"];
|
||||
|
||||
// Region Server
|
||||
regionprofile.regionDataURI = (string)reader["regionDataURI"];
|
||||
regionprofile.regionOnline = false; // Needs to be pinged before this can be set.
|
||||
regionprofile.serverIP = (string)reader["serverIP"];
|
||||
regionprofile.serverPort = (uint)reader["serverPort"];
|
||||
regionprofile.serverURI = (string)reader["serverURI"];
|
||||
|
||||
// Location
|
||||
regionprofile.regionLocX = (uint)((int)reader["locX"]);
|
||||
regionprofile.regionLocY = (uint)((int)reader["locY"]);
|
||||
regionprofile.regionLocZ = (uint)((int)reader["locZ"]);
|
||||
|
||||
// Neighbours - 0 = No Override
|
||||
regionprofile.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"];
|
||||
regionprofile.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"];
|
||||
regionprofile.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"];
|
||||
regionprofile.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"];
|
||||
|
||||
// Assets
|
||||
regionprofile.regionAssetURI = (string)reader["regionAssetURI"];
|
||||
regionprofile.regionAssetRecvKey = (string)reader["regionAssetRecvKey"];
|
||||
regionprofile.regionAssetSendKey = (string)reader["regionAssetSendKey"];
|
||||
|
||||
// Userserver
|
||||
regionprofile.regionUserURI = (string)reader["regionUserURI"];
|
||||
regionprofile.regionUserRecvKey = (string)reader["regionUserRecvKey"];
|
||||
regionprofile.regionUserSendKey = (string)reader["regionUserSendKey"];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("No rows to return");
|
||||
}
|
||||
return regionprofile;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new region in the database
|
||||
/// </summary>
|
||||
/// <param name="profile">The region profile to insert</param>
|
||||
/// <returns>Successful?</returns>
|
||||
public bool insertRow(SimProfileData profile)
|
||||
{
|
||||
string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
|
||||
sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
|
||||
sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES ";
|
||||
|
||||
sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, ";
|
||||
sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, ";
|
||||
sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);";
|
||||
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>();
|
||||
|
||||
parameters["regionHandle"] = profile.regionHandle.ToString();
|
||||
parameters["regionName"] = profile.regionName;
|
||||
parameters["uuid"] = profile.UUID.ToString();
|
||||
parameters["regionRecvKey"] = profile.regionRecvKey;
|
||||
parameters["regionSendKey"] = profile.regionSendKey;
|
||||
parameters["regionDataURI"] = profile.regionDataURI;
|
||||
parameters["serverIP"] = profile.serverIP;
|
||||
parameters["serverPort"] = profile.serverPort.ToString();
|
||||
parameters["serverURI"] = profile.serverURI;
|
||||
parameters["locX"] = profile.regionLocX.ToString();
|
||||
parameters["locY"] = profile.regionLocY.ToString();
|
||||
parameters["locZ"] = profile.regionLocZ.ToString();
|
||||
parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString();
|
||||
parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString();
|
||||
parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString();
|
||||
parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString();
|
||||
parameters["regionAssetURI"] = profile.regionAssetURI;
|
||||
parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey;
|
||||
parameters["regionAssetSendKey"] = profile.regionAssetSendKey;
|
||||
parameters["regionUserURI"] = profile.regionUserURI;
|
||||
parameters["regionUserRecvKey"] = profile.regionUserRecvKey;
|
||||
parameters["regionUserSendKey"] = profile.regionUserSendKey;
|
||||
|
||||
bool returnval = false;
|
||||
|
||||
try
|
||||
{
|
||||
IDbCommand result = Query(sql, parameters);
|
||||
|
||||
if (result.ExecuteNonQuery() == 1)
|
||||
returnval = true;
|
||||
|
||||
result.Dispose();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return returnval;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{17F7F694-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Framework.Data.MSSQL</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Framework.Data.MSSQL</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="libsecondlife.dll" >
|
||||
<HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="OpenSim.Framework.Data" >
|
||||
<HintPath>OpenSim.Framework.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" >
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" >
|
||||
<HintPath>System.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" >
|
||||
<HintPath>System.Xml.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MSSQLGridData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MSSQLManager.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\Sugilite\bin\</ReferencePath>
|
||||
<LastOpenVersion>8.0.50727</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
</Project>
|
|
@ -0,0 +1,33 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenSim.Framework.Data.MSSQL")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenSim.Framework.Data.MSSQL")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("0e1c1ca4-2cf2-4315-b0e7-432c02feea8a")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
..\..\..\bin\OpenSim.Framework.Data.MSSQL.dll
|
||||
obj\Release\ResolveAssemblyReference.cache
|
||||
obj\Release\OpenSim.Framework.Data.MSSQL.dll
|
||||
obj\Debug\ResolveAssemblyReference.cache
|
||||
obj\Debug\OpenSim.Framework.Data.MSSQL.dll
|
||||
obj\Debug\OpenSim.Framework.Data.MSSQL.pdb
|
||||
..\..\..\bin\OpenSim.Framework.Data.MSSQL.pdb
|
Binary file not shown.
|
@ -0,0 +1,287 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data.MySQL
|
||||
{
|
||||
/// <summary>
|
||||
/// A MySQL Interface for the Grid Server
|
||||
/// </summary>
|
||||
public class MySQLGridData : IGridData
|
||||
{
|
||||
/// <summary>
|
||||
/// MySQL Database Manager
|
||||
/// </summary>
|
||||
private MySQLManager database;
|
||||
|
||||
/// <summary>
|
||||
/// Initialises the Grid Interface
|
||||
/// </summary>
|
||||
public void Initialise()
|
||||
{
|
||||
IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
|
||||
string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
|
||||
string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
|
||||
string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
|
||||
string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
|
||||
string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
|
||||
string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
|
||||
|
||||
database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down the grid interface
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
database.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the plugin name
|
||||
/// </summary>
|
||||
/// <returns>Plugin name</returns>
|
||||
public string getName()
|
||||
{
|
||||
return "MySql OpenGridData";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the plugin version
|
||||
/// </summary>
|
||||
/// <returns>Plugin version</returns>
|
||||
public string getVersion()
|
||||
{
|
||||
return "0.1";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all the specified region profiles within coordates -- coordinates are inclusive
|
||||
/// </summary>
|
||||
/// <param name="xmin">Minimum X coordinate</param>
|
||||
/// <param name="ymin">Minimum Y coordinate</param>
|
||||
/// <param name="xmax">Maximum X coordinate</param>
|
||||
/// <param name="ymax">Maximum Y coordinate</param>
|
||||
/// <returns></returns>
|
||||
public SimProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?xmin"] = xmin.ToString();
|
||||
param["?ymin"] = ymin.ToString();
|
||||
param["?xmax"] = xmax.ToString();
|
||||
param["?ymax"] = ymax.ToString();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row;
|
||||
|
||||
List<SimProfileData> rows = new List<SimProfileData>();
|
||||
|
||||
while ((row = database.readSimRow(reader)) != null)
|
||||
{
|
||||
rows.Add(row);
|
||||
}
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return rows.ToArray();
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from it's location
|
||||
/// </summary>
|
||||
/// <param name="handle">Region location handle</param>
|
||||
/// <returns>Sim profile</returns>
|
||||
public SimProfileData GetProfileByHandle(ulong handle)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?handle"] = handle.ToString();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.readSimRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from it's UUID
|
||||
/// </summary>
|
||||
/// <param name="uuid">The region UUID</param>
|
||||
/// <returns>The sim profile</returns>
|
||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?uuid"] = uuid.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.readSimRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new profile to the database
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile to add</param>
|
||||
/// <returns>Successful?</returns>
|
||||
public DataResponse AddProfile(SimProfileData profile)
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
if (database.insertRegion(profile))
|
||||
{
|
||||
return DataResponse.RESPONSE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DataResponse.RESPONSE_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
|
||||
/// </summary>
|
||||
/// <param name="uuid">The UUID of the challenger</param>
|
||||
/// <param name="handle">The attempted regionHandle of the challenger</param>
|
||||
/// <param name="authkey">The secret</param>
|
||||
/// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
|
||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey)
|
||||
{
|
||||
bool throwHissyFit = false; // Should be true by 1.0
|
||||
|
||||
if (throwHissyFit)
|
||||
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
|
||||
|
||||
SimProfileData data = GetProfileByLLUUID(uuid);
|
||||
|
||||
return (handle == data.regionHandle && authkey == data.regionSecret);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region
|
||||
/// </summary>
|
||||
/// <remarks>This requires a security audit.</remarks>
|
||||
/// <param name="uuid"></param>
|
||||
/// <param name="handle"></param>
|
||||
/// <param name="authhash"></param>
|
||||
/// <param name="challenge"></param>
|
||||
/// <returns></returns>
|
||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
||||
{
|
||||
SHA512Managed HashProvider = new SHA512Managed();
|
||||
ASCIIEncoding TextProvider = new ASCIIEncoding();
|
||||
|
||||
byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
|
||||
byte[] hash = HashProvider.ComputeHash(stream);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public ReservationData GetReservationAtPoint(uint x, uint y)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?x"] = x.ToString();
|
||||
param["?y"] = y.ToString();
|
||||
IDbCommand result = database.Query("SELECT * FROM reservations WHERE resXMin <= ?x AND resXMax >= ?x AND resYMin <= ?y AND resYMax >= ?y", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
ReservationData row = database.readReservationRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,309 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data.MySQL
|
||||
{
|
||||
/// <summary>
|
||||
/// A MySQL interface for the inventory server
|
||||
/// </summary>
|
||||
class MySQLInventoryData : IInventoryData
|
||||
{
|
||||
/// <summary>
|
||||
/// The database manager
|
||||
/// </summary>
|
||||
public MySQLManager database;
|
||||
|
||||
/// <summary>
|
||||
/// Loads and initialises this database plugin
|
||||
/// </summary>
|
||||
public void Initialise()
|
||||
{
|
||||
IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
|
||||
string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
|
||||
string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
|
||||
string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
|
||||
string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
|
||||
string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
|
||||
string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
|
||||
|
||||
database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The name of this DB provider
|
||||
/// </summary>
|
||||
/// <returns>Name of DB provider</returns>
|
||||
public string getName()
|
||||
{
|
||||
return "MySQL Inventory Data Interface";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes this DB provider
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the version of this DB provider
|
||||
/// </summary>
|
||||
/// <returns>A string containing the DB provider</returns>
|
||||
public string getVersion()
|
||||
{
|
||||
return "0.1";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of items in a specified folder
|
||||
/// </summary>
|
||||
/// <param name="folderID">The folder to search</param>
|
||||
/// <returns>A list containing inventory items</returns>
|
||||
public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?uuid"] = folderID.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM inventoryitems WHERE parentFolderID = ?uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
List<InventoryItemBase> items = database.readInventoryItems(reader);
|
||||
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of the root folders within a users inventory
|
||||
/// </summary>
|
||||
/// <param name="user">The user whos inventory is to be searched</param>
|
||||
/// <returns>A list of folder objects</returns>
|
||||
public List<InventoryFolderBase> getUserRootFolders(LLUUID user)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?uuid"] = user.ToStringHyphenated();
|
||||
param["?zero"] = LLUUID.Zero.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
List<InventoryFolderBase> items = database.readInventoryFolders(reader);
|
||||
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of folders in a users inventory contained within the specified folder
|
||||
/// </summary>
|
||||
/// <param name="parentID">The folder to search</param>
|
||||
/// <returns>A list of inventory folders</returns>
|
||||
public List<InventoryFolderBase> getInventoryFolders(LLUUID parentID)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?uuid"] = parentID.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
List<InventoryFolderBase> items = database.readInventoryFolders(reader);
|
||||
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a specified inventory item
|
||||
/// </summary>
|
||||
/// <param name="item">The item to return</param>
|
||||
/// <returns>An inventory item</returns>
|
||||
public InventoryItemBase getInventoryItem(LLUUID item)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?uuid"] = item.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM inventoryitems WHERE inventoryID = ?uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
List<InventoryItemBase> items = database.readInventoryItems(reader);
|
||||
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
if (items.Count > 0)
|
||||
{
|
||||
return items[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a specified inventory folder
|
||||
/// </summary>
|
||||
/// <param name="folder">The folder to return</param>
|
||||
/// <returns>A folder class</returns>
|
||||
public InventoryFolderBase getInventoryFolder(LLUUID folder)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?uuid"] = folder.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE folderID = ?uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
List<InventoryFolderBase> items = database.readInventoryFolders(reader);
|
||||
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
if (items.Count > 0)
|
||||
{
|
||||
return items[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a specified item to the database
|
||||
/// </summary>
|
||||
/// <param name="item">The inventory item</param>
|
||||
public void addInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
database.insertItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the specified inventory item
|
||||
/// </summary>
|
||||
/// <param name="item">Inventory item to update</param>
|
||||
public void updateInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
addInventoryItem(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new inventory folder
|
||||
/// </summary>
|
||||
/// <param name="folder">Folder to create</param>
|
||||
public void addInventoryFolder(InventoryFolderBase folder)
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
database.insertFolder(folder);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates an inventory folder
|
||||
/// </summary>
|
||||
/// <param name="folder">Folder to update</param>
|
||||
public void updateInventoryFolder(InventoryFolderBase folder)
|
||||
{
|
||||
addInventoryFolder(folder);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
|
||||
namespace OpenSim.Framework.Data.MySQL
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface to the log database for MySQL
|
||||
/// </summary>
|
||||
class MySQLLogData : ILogData
|
||||
{
|
||||
/// <summary>
|
||||
/// The database manager
|
||||
/// </summary>
|
||||
public MySQLManager database;
|
||||
|
||||
/// <summary>
|
||||
/// Artificial constructor called when the plugin is loaded
|
||||
/// </summary>
|
||||
public void Initialise()
|
||||
{
|
||||
IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
|
||||
string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
|
||||
string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
|
||||
string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
|
||||
string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
|
||||
string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
|
||||
string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
|
||||
|
||||
database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves a log item to the database
|
||||
/// </summary>
|
||||
/// <param name="serverDaemon">The daemon triggering the event</param>
|
||||
/// <param name="target">The target of the action (region / agent UUID, etc)</param>
|
||||
/// <param name="methodCall">The method call where the problem occured</param>
|
||||
/// <param name="arguments">The arguments passed to the method</param>
|
||||
/// <param name="priority">How critical is this?</param>
|
||||
/// <param name="logMessage">The message to log</param>
|
||||
public void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage)
|
||||
{
|
||||
try
|
||||
{
|
||||
database.insertLogRow(serverDaemon, target, methodCall, arguments, priority, logMessage);
|
||||
}
|
||||
catch
|
||||
{
|
||||
database.Reconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of this DB provider
|
||||
/// </summary>
|
||||
/// <returns>A string containing the DB provider name</returns>
|
||||
public string getName()
|
||||
{
|
||||
return "MySQL Logdata Interface";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes the database provider
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the version of this DB provider
|
||||
/// </summary>
|
||||
/// <returns>A string containing the provider version</returns>
|
||||
public string getVersion()
|
||||
{
|
||||
return "0.1";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,602 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using libsecondlife;
|
||||
using MySql.Data.MySqlClient;
|
||||
|
||||
namespace OpenSim.Framework.Data.MySQL
|
||||
{
|
||||
/// <summary>
|
||||
/// A MySQL Database manager
|
||||
/// </summary>
|
||||
class MySQLManager
|
||||
{
|
||||
/// <summary>
|
||||
/// The database connection object
|
||||
/// </summary>
|
||||
IDbConnection dbcon;
|
||||
/// <summary>
|
||||
/// Connection string for ADO.net
|
||||
/// </summary>
|
||||
string connectionString;
|
||||
|
||||
/// <summary>
|
||||
/// Initialises and creates a new MySQL connection and maintains it.
|
||||
/// </summary>
|
||||
/// <param name="hostname">The MySQL server being connected to</param>
|
||||
/// <param name="database">The name of the MySQL database being used</param>
|
||||
/// <param name="username">The username logging into the database</param>
|
||||
/// <param name="password">The password for the user logging in</param>
|
||||
/// <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>
|
||||
public MySQLManager(string hostname, string database, string username, string password, string cpooling, string port)
|
||||
{
|
||||
try
|
||||
{
|
||||
connectionString = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";";
|
||||
dbcon = new MySqlConnection(connectionString);
|
||||
|
||||
dbcon.Open();
|
||||
|
||||
Console.WriteLine("MySQL connection established");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exception("Error initialising MySql Database: " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down the database connection
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reconnects to the database
|
||||
/// </summary>
|
||||
public void Reconnect()
|
||||
{
|
||||
lock (dbcon)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Close the DB connection
|
||||
dbcon.Close();
|
||||
// Try reopen it
|
||||
dbcon = new MySqlConnection(connectionString);
|
||||
dbcon.Open();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("Unable to reconnect to database " + e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs a query with protection against SQL Injection by using parameterised input.
|
||||
/// </summary>
|
||||
/// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param>
|
||||
/// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param>
|
||||
/// <returns>A MySQL DB Command</returns>
|
||||
public IDbCommand Query(string sql, Dictionary<string, string> parameters)
|
||||
{
|
||||
try
|
||||
{
|
||||
MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand();
|
||||
dbcommand.CommandText = sql;
|
||||
foreach (KeyValuePair<string, string> param in parameters)
|
||||
{
|
||||
dbcommand.Parameters.Add(param.Key, param.Value);
|
||||
}
|
||||
|
||||
return (IDbCommand)dbcommand;
|
||||
}
|
||||
catch
|
||||
{
|
||||
lock (dbcon)
|
||||
{
|
||||
// Close the DB connection
|
||||
try
|
||||
{
|
||||
dbcon.Close();
|
||||
}
|
||||
catch { }
|
||||
|
||||
// Try reopen it
|
||||
try
|
||||
{
|
||||
dbcon = new MySqlConnection(connectionString);
|
||||
dbcon.Open();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("Unable to reconnect to database " + e.ToString());
|
||||
}
|
||||
|
||||
// Run the query again
|
||||
try
|
||||
{
|
||||
MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand();
|
||||
dbcommand.CommandText = sql;
|
||||
foreach (KeyValuePair<string, string> param in parameters)
|
||||
{
|
||||
dbcommand.Parameters.Add(param.Key, param.Value);
|
||||
}
|
||||
|
||||
return (IDbCommand)dbcommand;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// Return null if it fails.
|
||||
Console.WriteLine("Failed during Query generation: " + e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a region row from a database reader
|
||||
/// </summary>
|
||||
/// <param name="reader">An active database reader</param>
|
||||
/// <returns>A region profile</returns>
|
||||
public SimProfileData readSimRow(IDataReader reader)
|
||||
{
|
||||
SimProfileData retval = new SimProfileData();
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
// Region Main
|
||||
retval.regionHandle = Convert.ToUInt64(reader["regionHandle"].ToString());
|
||||
retval.regionName = (string)reader["regionName"];
|
||||
retval.UUID = new LLUUID((string)reader["uuid"]);
|
||||
|
||||
// Secrets
|
||||
retval.regionRecvKey = (string)reader["regionRecvKey"];
|
||||
retval.regionSecret = (string)reader["regionSecret"];
|
||||
retval.regionSendKey = (string)reader["regionSendKey"];
|
||||
|
||||
// Region Server
|
||||
retval.regionDataURI = (string)reader["regionDataURI"];
|
||||
retval.regionOnline = false; // Needs to be pinged before this can be set.
|
||||
retval.serverIP = (string)reader["serverIP"];
|
||||
retval.serverPort = (uint)reader["serverPort"];
|
||||
retval.serverURI = (string)reader["serverURI"];
|
||||
|
||||
// Location
|
||||
retval.regionLocX = Convert.ToUInt32(reader["locX"].ToString());
|
||||
retval.regionLocY = Convert.ToUInt32(reader["locY"].ToString());
|
||||
retval.regionLocZ = Convert.ToUInt32(reader["locZ"].ToString());
|
||||
|
||||
// Neighbours - 0 = No Override
|
||||
retval.regionEastOverrideHandle = Convert.ToUInt64(reader["eastOverrideHandle"].ToString());
|
||||
retval.regionWestOverrideHandle = Convert.ToUInt64(reader["westOverrideHandle"].ToString());
|
||||
retval.regionSouthOverrideHandle = Convert.ToUInt64(reader["southOverrideHandle"].ToString());
|
||||
retval.regionNorthOverrideHandle = Convert.ToUInt64(reader["northOverrideHandle"].ToString());
|
||||
|
||||
// Assets
|
||||
retval.regionAssetURI = (string)reader["regionAssetURI"];
|
||||
retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"];
|
||||
retval.regionAssetSendKey = (string)reader["regionAssetSendKey"];
|
||||
|
||||
// Userserver
|
||||
retval.regionUserURI = (string)reader["regionUserURI"];
|
||||
retval.regionUserRecvKey = (string)reader["regionUserRecvKey"];
|
||||
retval.regionUserSendKey = (string)reader["regionUserSendKey"];
|
||||
|
||||
// World Map Addition
|
||||
string tempRegionMap = reader["regionMapTexture"].ToString();
|
||||
if (tempRegionMap != "")
|
||||
{
|
||||
retval.regionMapTextureID = new LLUUID(tempRegionMap);
|
||||
}
|
||||
else
|
||||
{
|
||||
retval.regionMapTextureID = new LLUUID();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a reservation row from a database reader
|
||||
/// </summary>
|
||||
/// <param name="reader">An active database reader</param>
|
||||
/// <returns>A reservation data object</returns>
|
||||
public ReservationData readReservationRow(IDataReader reader)
|
||||
{
|
||||
ReservationData retval = new ReservationData();
|
||||
if (reader.Read())
|
||||
{
|
||||
retval.gridRecvKey = (string)reader["gridRecvKey"];
|
||||
retval.gridSendKey = (string)reader["gridSendKey"];
|
||||
retval.reservationCompany = (string)reader["resCompany"];
|
||||
retval.reservationMaxX = Convert.ToInt32(reader["resXMax"].ToString());
|
||||
retval.reservationMaxY = Convert.ToInt32(reader["resYMax"].ToString());
|
||||
retval.reservationMinX = Convert.ToInt32(reader["resXMin"].ToString());
|
||||
retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString());
|
||||
retval.reservationName = (string)reader["resName"];
|
||||
retval.status = Convert.ToInt32(reader["status"].ToString()) == 1;
|
||||
retval.userUUID = new LLUUID((string)reader["userUUID"]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
/// <summary>
|
||||
/// Reads an agent row from a database reader
|
||||
/// </summary>
|
||||
/// <param name="reader">An active database reader</param>
|
||||
/// <returns>A user session agent</returns>
|
||||
public UserAgentData readAgentRow(IDataReader reader)
|
||||
{
|
||||
UserAgentData retval = new UserAgentData();
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
// Agent IDs
|
||||
retval.UUID = new LLUUID((string)reader["UUID"]);
|
||||
retval.sessionID = new LLUUID((string)reader["sessionID"]);
|
||||
retval.secureSessionID = new LLUUID((string)reader["secureSessionID"]);
|
||||
|
||||
// Agent Who?
|
||||
retval.agentIP = (string)reader["agentIP"];
|
||||
retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString());
|
||||
retval.agentOnline = Convert.ToBoolean(reader["agentOnline"].ToString());
|
||||
|
||||
// Login/Logout times (UNIX Epoch)
|
||||
retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString());
|
||||
retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString());
|
||||
|
||||
// Current position
|
||||
retval.currentRegion = (string)reader["currentRegion"];
|
||||
retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString());
|
||||
LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a user profile from an active data reader
|
||||
/// </summary>
|
||||
/// <param name="reader">An active database reader</param>
|
||||
/// <returns>A user profile</returns>
|
||||
public UserProfileData readUserRow(IDataReader reader)
|
||||
{
|
||||
UserProfileData retval = new UserProfileData();
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
retval.UUID = new LLUUID((string)reader["UUID"]);
|
||||
retval.username = (string)reader["username"];
|
||||
retval.surname = (string)reader["lastname"];
|
||||
|
||||
retval.passwordHash = (string)reader["passwordHash"];
|
||||
retval.passwordSalt = (string)reader["passwordSalt"];
|
||||
|
||||
retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
|
||||
retval.homeLocation = new LLVector3(
|
||||
Convert.ToSingle(reader["homeLocationX"].ToString()),
|
||||
Convert.ToSingle(reader["homeLocationY"].ToString()),
|
||||
Convert.ToSingle(reader["homeLocationZ"].ToString()));
|
||||
retval.homeLookAt = new LLVector3(
|
||||
Convert.ToSingle(reader["homeLookAtX"].ToString()),
|
||||
Convert.ToSingle(reader["homeLookAtY"].ToString()),
|
||||
Convert.ToSingle(reader["homeLookAtZ"].ToString()));
|
||||
|
||||
retval.created = Convert.ToInt32(reader["created"].ToString());
|
||||
retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
|
||||
|
||||
retval.userInventoryURI = (string)reader["userInventoryURI"];
|
||||
retval.userAssetURI = (string)reader["userAssetURI"];
|
||||
|
||||
retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString());
|
||||
retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString());
|
||||
|
||||
retval.profileAboutText = (string)reader["profileAboutText"];
|
||||
retval.profileFirstText = (string)reader["profileFirstText"];
|
||||
|
||||
retval.profileImage = new LLUUID((string)reader["profileImage"]);
|
||||
retval.profileFirstImage = new LLUUID((string)reader["profileFirstImage"]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a list of inventory folders returned by a query.
|
||||
/// </summary>
|
||||
/// <param name="reader">A MySQL Data Reader</param>
|
||||
/// <returns>A List containing inventory folders</returns>
|
||||
public List<InventoryFolderBase> readInventoryFolders(IDataReader reader)
|
||||
{
|
||||
List<InventoryFolderBase> rows = new List<InventoryFolderBase>();
|
||||
|
||||
while(reader.Read())
|
||||
{
|
||||
try
|
||||
{
|
||||
InventoryFolderBase folder = new InventoryFolderBase();
|
||||
|
||||
folder.agentID = new LLUUID((string)reader["agentID"]);
|
||||
folder.parentID = new LLUUID((string)reader["parentFolderID"]);
|
||||
folder.folderID = new LLUUID((string)reader["folderID"]);
|
||||
folder.name = (string)reader["folderName"];
|
||||
|
||||
rows.Add(folder);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a collection of items from an SQL result
|
||||
/// </summary>
|
||||
/// <param name="reader">The SQL Result</param>
|
||||
/// <returns>A List containing Inventory Items</returns>
|
||||
public List<InventoryItemBase> readInventoryItems(IDataReader reader)
|
||||
{
|
||||
List<InventoryItemBase> rows = new List<InventoryItemBase>();
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
try
|
||||
{
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
|
||||
item.assetID = new LLUUID((string)reader["assetID"]);
|
||||
item.avatarID = new LLUUID((string)reader["avatarID"]);
|
||||
item.inventoryCurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"].ToString());
|
||||
item.inventoryDescription = (string)reader["inventoryDescription"];
|
||||
item.inventoryID = new LLUUID((string)reader["inventoryID"]);
|
||||
item.inventoryName = (string)reader["inventoryName"];
|
||||
item.inventoryNextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"].ToString());
|
||||
item.parentFolderID = new LLUUID((string)reader["parentFolderID"]);
|
||||
item.type = Convert.ToInt32(reader["type"].ToString());
|
||||
|
||||
rows.Add(item);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts a new row into the log database
|
||||
/// </summary>
|
||||
/// <param name="serverDaemon">The daemon which triggered this event</param>
|
||||
/// <param name="target">Who were we operating on when this occured (region UUID, user UUID, etc)</param>
|
||||
/// <param name="methodCall">The method call where the problem occured</param>
|
||||
/// <param name="arguments">The arguments passed to the method</param>
|
||||
/// <param name="priority">How critical is this?</param>
|
||||
/// <param name="logMessage">Extra message info</param>
|
||||
/// <returns>Saved successfully?</returns>
|
||||
public bool insertLogRow(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage)
|
||||
{
|
||||
string sql = "INSERT INTO logs (`target`, `server`, `method`, `arguments`, `priority`, `message`) VALUES ";
|
||||
sql += "(?target, ?server, ?method, ?arguments, ?priority, ?message)";
|
||||
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>();
|
||||
parameters["?server"] = serverDaemon;
|
||||
parameters["?target"] = target;
|
||||
parameters["?method"] = methodCall;
|
||||
parameters["?arguments"] = arguments;
|
||||
parameters["?priority"] = priority.ToString();
|
||||
parameters["?message"] = logMessage;
|
||||
|
||||
bool returnval = false;
|
||||
|
||||
try
|
||||
{
|
||||
IDbCommand result = Query(sql, parameters);
|
||||
|
||||
if (result.ExecuteNonQuery() == 1)
|
||||
returnval = true;
|
||||
|
||||
result.Dispose();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
return returnval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts a new item into the database
|
||||
/// </summary>
|
||||
/// <param name="item">The item</param>
|
||||
/// <returns>Success?</returns>
|
||||
public bool insertItem(InventoryItemBase item)
|
||||
{
|
||||
string sql = "REPLACE INTO inventoryitems (inventoryID, assetID, type, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions) VALUES ";
|
||||
sql += "(?inventoryID, ?assetID, ?type, ?parentFolderID, ?avatarID, ?inventoryName, ?inventoryDescription, ?inventoryNextPermissions, ?inventoryCurrentPermissions)";
|
||||
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>();
|
||||
parameters["?inventoryID"] = item.inventoryID.ToStringHyphenated();
|
||||
parameters["?assetID"] = item.assetID.ToStringHyphenated();
|
||||
parameters["?type"] = item.type.ToString();
|
||||
parameters["?parentFolderID"] = item.parentFolderID.ToStringHyphenated();
|
||||
parameters["?avatarID"] = item.avatarID.ToStringHyphenated();
|
||||
parameters["?inventoryName"] = item.inventoryName;
|
||||
parameters["?inventoryDescription"] = item.inventoryDescription;
|
||||
parameters["?inventoryNextPermissions"] = item.inventoryNextPermissions.ToString();
|
||||
parameters["?inventoryCurrentPermissions"] = item.inventoryCurrentPermissions.ToString();
|
||||
|
||||
bool returnval = false;
|
||||
|
||||
try
|
||||
{
|
||||
IDbCommand result = Query(sql, parameters);
|
||||
|
||||
if (result.ExecuteNonQuery() == 1)
|
||||
returnval = true;
|
||||
|
||||
result.Dispose();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
return returnval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts a new folder into the database
|
||||
/// </summary>
|
||||
/// <param name="folder">The folder</param>
|
||||
/// <returns>Success?</returns>
|
||||
public bool insertFolder(InventoryFolderBase folder)
|
||||
{
|
||||
string sql = "REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName) VALUES ";
|
||||
sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName)";
|
||||
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>();
|
||||
parameters["?folderID"] = folder.folderID.ToStringHyphenated();
|
||||
parameters["?agentID"] = folder.agentID.ToStringHyphenated();
|
||||
parameters["?parentFolderID"] = folder.parentID.ToStringHyphenated();
|
||||
parameters["?folderName"] = folder.name;
|
||||
|
||||
bool returnval = false;
|
||||
try
|
||||
{
|
||||
IDbCommand result = Query(sql, parameters);
|
||||
|
||||
if (result.ExecuteNonQuery() == 1)
|
||||
returnval = true;
|
||||
|
||||
result.Dispose();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
return false;
|
||||
}
|
||||
return returnval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts a new region into the database
|
||||
/// </summary>
|
||||
/// <param name="profile">The region to insert</param>
|
||||
/// <returns>Success?</returns>
|
||||
public bool insertRegion(SimProfileData regiondata)
|
||||
{
|
||||
string sql = "REPLACE INTO regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
|
||||
sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
|
||||
sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture) VALUES ";
|
||||
|
||||
sql += "(?regionHandle, ?regionName, ?uuid, ?regionRecvKey, ?regionSecret, ?regionSendKey, ?regionDataURI, ";
|
||||
sql += "?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, ";
|
||||
sql += "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture);";
|
||||
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>();
|
||||
|
||||
parameters["?regionHandle"] = regiondata.regionHandle.ToString();
|
||||
parameters["?regionName"] = regiondata.regionName.ToString();
|
||||
parameters["?uuid"] = regiondata.UUID.ToStringHyphenated();
|
||||
parameters["?regionRecvKey"] = regiondata.regionRecvKey.ToString();
|
||||
parameters["?regionSecret"] = regiondata.regionSecret.ToString();
|
||||
parameters["?regionSendKey"] = regiondata.regionSendKey.ToString();
|
||||
parameters["?regionDataURI"] = regiondata.regionDataURI.ToString();
|
||||
parameters["?serverIP"] = regiondata.serverIP.ToString();
|
||||
parameters["?serverPort"] = regiondata.serverPort.ToString();
|
||||
parameters["?serverURI"] = regiondata.serverURI.ToString();
|
||||
parameters["?locX"] = regiondata.regionLocX.ToString();
|
||||
parameters["?locY"] = regiondata.regionLocY.ToString();
|
||||
parameters["?locZ"] = regiondata.regionLocZ.ToString();
|
||||
parameters["?eastOverrideHandle"] = regiondata.regionEastOverrideHandle.ToString();
|
||||
parameters["?westOverrideHandle"] = regiondata.regionWestOverrideHandle.ToString();
|
||||
parameters["?northOverrideHandle"] = regiondata.regionNorthOverrideHandle.ToString();
|
||||
parameters["?southOverrideHandle"] = regiondata.regionSouthOverrideHandle.ToString();
|
||||
parameters["?regionAssetURI"] = regiondata.regionAssetURI.ToString();
|
||||
parameters["?regionAssetRecvKey"] = regiondata.regionAssetRecvKey.ToString();
|
||||
parameters["?regionAssetSendKey"] = regiondata.regionAssetSendKey.ToString();
|
||||
parameters["?regionUserURI"] = regiondata.regionUserURI.ToString();
|
||||
parameters["?regionUserRecvKey"] = regiondata.regionUserRecvKey.ToString();
|
||||
parameters["?regionUserSendKey"] = regiondata.regionUserSendKey.ToString();
|
||||
parameters["?regionMapTexture"] = regiondata.regionMapTextureID.ToStringHyphenated();
|
||||
|
||||
bool returnval = false;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
IDbCommand result = Query(sql, parameters);
|
||||
|
||||
//Console.WriteLine(result.CommandText);
|
||||
|
||||
if (result.ExecuteNonQuery() == 1)
|
||||
returnval = true;
|
||||
|
||||
result.Dispose();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
return returnval;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,256 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data.MySQL
|
||||
{
|
||||
/// <summary>
|
||||
/// A database interface class to a user profile storage system
|
||||
/// </summary>
|
||||
class MySQLUserData : IUserData
|
||||
{
|
||||
/// <summary>
|
||||
/// Database manager for MySQL
|
||||
/// </summary>
|
||||
public MySQLManager database;
|
||||
|
||||
/// <summary>
|
||||
/// Loads and initialises the MySQL storage plugin
|
||||
/// </summary>
|
||||
public void Initialise()
|
||||
{
|
||||
// Load from an INI file connection details
|
||||
// TODO: move this to XML?
|
||||
IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
|
||||
string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
|
||||
string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
|
||||
string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
|
||||
string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
|
||||
string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
|
||||
string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
|
||||
|
||||
database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Searches the database for a specified user profile
|
||||
/// </summary>
|
||||
/// <param name="name">The account name of the user</param>
|
||||
/// <returns>A user profile</returns>
|
||||
public UserProfileData getUserByName(string name)
|
||||
{
|
||||
return getUserByName(name.Split(' ')[0], name.Split(' ')[1]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Searches the database for a specified user profile by name components
|
||||
/// </summary>
|
||||
/// <param name="user">The first part of the account name</param>
|
||||
/// <param name="last">The second part of the account name</param>
|
||||
/// <returns>A user profile</returns>
|
||||
public UserProfileData getUserByName(string user, string last)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?first"] = user;
|
||||
param["?second"] = last;
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM users WHERE username = ?first AND lastname = ?second", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
UserProfileData row = database.readUserRow(reader);
|
||||
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Searches the database for a specified user profile by UUID
|
||||
/// </summary>
|
||||
/// <param name="uuid">The account ID</param>
|
||||
/// <returns>The users profile</returns>
|
||||
public UserProfileData getUserByUUID(LLUUID uuid)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?uuid"] = uuid.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM users WHERE UUID = ?uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
UserProfileData row = database.readUserRow(reader);
|
||||
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a user session searching by name
|
||||
/// </summary>
|
||||
/// <param name="name">The account name</param>
|
||||
/// <returns>The users session</returns>
|
||||
public UserAgentData getAgentByName(string name)
|
||||
{
|
||||
return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a user session by account name
|
||||
/// </summary>
|
||||
/// <param name="user">First part of the users account name</param>
|
||||
/// <param name="last">Second part of the users account name</param>
|
||||
/// <returns>The users session</returns>
|
||||
public UserAgentData getAgentByName(string user, string last)
|
||||
{
|
||||
UserProfileData profile = getUserByName(user, last);
|
||||
return getAgentByUUID(profile.UUID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an agent session by account UUID
|
||||
/// </summary>
|
||||
/// <param name="uuid">The accounts UUID</param>
|
||||
/// <returns>The users session</returns>
|
||||
public UserAgentData getAgentByUUID(LLUUID uuid)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?uuid"] = uuid.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
UserAgentData row = database.readAgentRow(reader);
|
||||
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
Console.WriteLine(e.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new users profile
|
||||
/// </summary>
|
||||
/// <param name="user">The user profile to create</param>
|
||||
public void addNewUserProfile(UserProfileData user)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new agent
|
||||
/// </summary>
|
||||
/// <param name="agent">The agent to create</param>
|
||||
public void addNewUserAgent(UserAgentData agent)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a money transfer request between two accounts
|
||||
/// </summary>
|
||||
/// <param name="from">The senders account ID</param>
|
||||
/// <param name="to">The recievers account ID</param>
|
||||
/// <param name="amount">The amount to transfer</param>
|
||||
/// <returns>Success?</returns>
|
||||
public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an inventory transfer request between two accounts
|
||||
/// </summary>
|
||||
/// <remarks>TODO: Move to inventory server</remarks>
|
||||
/// <param name="from">The senders account ID</param>
|
||||
/// <param name="to">The recievers account ID</param>
|
||||
/// <param name="item">The item to transfer</param>
|
||||
/// <returns>Success?</returns>
|
||||
public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Database provider name
|
||||
/// </summary>
|
||||
/// <returns>Provider name</returns>
|
||||
public string getName()
|
||||
{
|
||||
return "MySQL Userdata Interface";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Database provider version
|
||||
/// </summary>
|
||||
/// <returns>provider version</returns>
|
||||
public string getVersion()
|
||||
{
|
||||
return "0.1";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{17F7F6BE-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Framework.Data.MySQL</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Framework.Data.MySQL</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="libsecondlife.dll" >
|
||||
<HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data.dll" >
|
||||
<HintPath>..\..\..\bin\MySql.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="OpenSim.Framework.Data" >
|
||||
<HintPath>OpenSim.Framework.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" >
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" >
|
||||
<HintPath>System.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" >
|
||||
<HintPath>System.Xml.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MySQLInventoryData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MySQLUserData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MySQLManager.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MySQLLogData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MySQLGridData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\Sugilite\bin\</ReferencePath>
|
||||
<LastOpenVersion>8.0.50727</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
</Project>
|
|
@ -0,0 +1,33 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenSim.Framework.Data.MySQL")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenSim.Framework.Data.MySQL")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("e49826b2-dcef-41be-a5bd-596733fa3304")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
..\..\..\bin\OpenSim.Framework.Data.MySQL.dll
|
||||
obj\Release\ResolveAssemblyReference.cache
|
||||
obj\Release\OpenSim.Framework.Data.MySQL.dll
|
||||
obj\Debug\ResolveAssemblyReference.cache
|
||||
obj\Debug\OpenSim.Framework.Data.MySQL.dll
|
||||
obj\Debug\OpenSim.Framework.Data.MySQL.pdb
|
||||
..\..\..\bin\OpenSim.Framework.Data.MySQL.pdb
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,106 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{6ECC56A9-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Framework.Data.SQLite</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Framework.Data.SQLite</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="libsecondlife.dll" >
|
||||
<HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="OpenSim.Framework.Data" >
|
||||
<HintPath>OpenSim.Framework.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" >
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" >
|
||||
<HintPath>System.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SQLite.dll" >
|
||||
<HintPath>..\..\..\bin\System.Data.SQLite.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" >
|
||||
<HintPath>System.Xml.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="SQLiteManager.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SQLiteGridData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\Sugilite\bin\</ReferencePath>
|
||||
<LastOpenVersion>8.0.50727</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
</Project>
|
|
@ -0,0 +1,33 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenSim.Framework.Data.SQLite")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenSim.Framework.Data.SQLite")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("6113d5ce-4547-49f4-9236-0dcc503457b1")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,197 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data.SQLite
|
||||
{
|
||||
/// <summary>
|
||||
/// A Grid Interface to the SQLite database
|
||||
/// </summary>
|
||||
public class SQLiteGridData : IGridData
|
||||
{
|
||||
/// <summary>
|
||||
/// A database manager
|
||||
/// </summary>
|
||||
private SQLiteManager database;
|
||||
|
||||
/// <summary>
|
||||
/// Initialises the Grid Interface
|
||||
/// </summary>
|
||||
public void Initialise()
|
||||
{
|
||||
database = new SQLiteManager("localhost", "db", "user", "password", "false");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down the grid interface
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
database.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of this grid interface
|
||||
/// </summary>
|
||||
/// <returns>A string containing the grid interface</returns>
|
||||
public string getName()
|
||||
{
|
||||
return "SQLite OpenGridData";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the version of this grid interface
|
||||
/// </summary>
|
||||
/// <returns>A string containing the version</returns>
|
||||
public string getVersion()
|
||||
{
|
||||
return "0.1";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of regions within the specified ranges
|
||||
/// </summary>
|
||||
/// <param name="a">minimum X coordinate</param>
|
||||
/// <param name="b">minimum Y coordinate</param>
|
||||
/// <param name="c">maximum X coordinate</param>
|
||||
/// <param name="d">maximum Y coordinate</param>
|
||||
/// <returns>An array of region profiles</returns>
|
||||
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from it's location
|
||||
/// </summary>
|
||||
/// <param name="handle">Region location handle</param>
|
||||
/// <returns>Sim profile</returns>
|
||||
public SimProfileData GetProfileByHandle(ulong handle)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["handle"] = handle.ToString();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.getRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from it's UUID
|
||||
/// </summary>
|
||||
/// <param name="uuid">The region UUID</param>
|
||||
/// <returns>The sim profile</returns>
|
||||
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["uuid"] = uuid.ToStringHyphenated();
|
||||
|
||||
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
|
||||
SimProfileData row = database.getRow(reader);
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new specified region to the database
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile to add</param>
|
||||
/// <returns>A dataresponse enum indicating success</returns>
|
||||
public DataResponse AddProfile(SimProfileData profile)
|
||||
{
|
||||
if (database.insertRow(profile))
|
||||
{
|
||||
return DataResponse.RESPONSE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DataResponse.RESPONSE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
|
||||
/// </summary>
|
||||
/// <param name="uuid">The UUID of the challenger</param>
|
||||
/// <param name="handle">The attempted regionHandle of the challenger</param>
|
||||
/// <param name="authkey">The secret</param>
|
||||
/// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
|
||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey)
|
||||
{
|
||||
bool throwHissyFit = false; // Should be true by 1.0
|
||||
|
||||
if (throwHissyFit)
|
||||
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
|
||||
|
||||
SimProfileData data = GetProfileByLLUUID(uuid);
|
||||
|
||||
return (handle == data.regionHandle && authkey == data.regionSecret);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region
|
||||
/// </summary>
|
||||
/// <remarks>This requires a security audit.</remarks>
|
||||
/// <param name="uuid"></param>
|
||||
/// <param name="handle"></param>
|
||||
/// <param name="authhash"></param>
|
||||
/// <param name="challenge"></param>
|
||||
/// <returns></returns>
|
||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
||||
{
|
||||
SHA512Managed HashProvider = new SHA512Managed();
|
||||
ASCIIEncoding TextProvider = new ASCIIEncoding();
|
||||
|
||||
byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
|
||||
byte[] hash = HashProvider.ComputeHash(stream);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public ReservationData GetReservationAtPoint(uint x, uint y)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,206 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SQLite;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data.SQLite
|
||||
{
|
||||
class SQLiteManager
|
||||
{
|
||||
IDbConnection dbcon;
|
||||
|
||||
/// <summary>
|
||||
/// Initialises and creates a new SQLite connection and maintains it.
|
||||
/// </summary>
|
||||
/// <param name="hostname">The SQLite server being connected to</param>
|
||||
/// <param name="database">The name of the SQLite database being used</param>
|
||||
/// <param name="username">The username logging into the database</param>
|
||||
/// <param name="password">The password for the user logging in</param>
|
||||
/// <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>
|
||||
public SQLiteManager(string hostname, string database, string username, string password, string cpooling)
|
||||
{
|
||||
try
|
||||
{
|
||||
string connectionString = "URI=file:GridServerSqlite.db;";
|
||||
dbcon = new SQLiteConnection(connectionString);
|
||||
|
||||
dbcon.Open();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exception("Error initialising SQLite Database: " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down the database connection
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
dbcon.Close();
|
||||
dbcon = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs a query with protection against SQL Injection by using parameterised input.
|
||||
/// </summary>
|
||||
/// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param>
|
||||
/// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param>
|
||||
/// <returns>A SQLite DB Command</returns>
|
||||
public IDbCommand Query(string sql, Dictionary<string, string> parameters)
|
||||
{
|
||||
SQLiteCommand dbcommand = (SQLiteCommand)dbcon.CreateCommand();
|
||||
dbcommand.CommandText = sql;
|
||||
foreach (KeyValuePair<string, string> param in parameters)
|
||||
{
|
||||
SQLiteParameter paramx = new SQLiteParameter(param.Key,param.Value);
|
||||
dbcommand.Parameters.Add(paramx);
|
||||
}
|
||||
|
||||
return (IDbCommand)dbcommand;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a region row from a database reader
|
||||
/// </summary>
|
||||
/// <param name="reader">An active database reader</param>
|
||||
/// <returns>A region profile</returns>
|
||||
public SimProfileData getRow(IDataReader reader)
|
||||
{
|
||||
SimProfileData retval = new SimProfileData();
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
// Region Main
|
||||
retval.regionHandle = (ulong)reader["regionHandle"];
|
||||
retval.regionName = (string)reader["regionName"];
|
||||
retval.UUID = new LLUUID((string)reader["uuid"]);
|
||||
|
||||
// Secrets
|
||||
retval.regionRecvKey = (string)reader["regionRecvKey"];
|
||||
retval.regionSecret = (string)reader["regionSecret"];
|
||||
retval.regionSendKey = (string)reader["regionSendKey"];
|
||||
|
||||
// Region Server
|
||||
retval.regionDataURI = (string)reader["regionDataURI"];
|
||||
retval.regionOnline = false; // Needs to be pinged before this can be set.
|
||||
retval.serverIP = (string)reader["serverIP"];
|
||||
retval.serverPort = (uint)reader["serverPort"];
|
||||
retval.serverURI = (string)reader["serverURI"];
|
||||
|
||||
// Location
|
||||
retval.regionLocX = (uint)((int)reader["locX"]);
|
||||
retval.regionLocY = (uint)((int)reader["locY"]);
|
||||
retval.regionLocZ = (uint)((int)reader["locZ"]);
|
||||
|
||||
// Neighbours - 0 = No Override
|
||||
retval.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"];
|
||||
retval.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"];
|
||||
retval.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"];
|
||||
retval.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"];
|
||||
|
||||
// Assets
|
||||
retval.regionAssetURI = (string)reader["regionAssetURI"];
|
||||
retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"];
|
||||
retval.regionAssetSendKey = (string)reader["regionAssetSendKey"];
|
||||
|
||||
// Userserver
|
||||
retval.regionUserURI = (string)reader["regionUserURI"];
|
||||
retval.regionUserRecvKey = (string)reader["regionUserRecvKey"];
|
||||
retval.regionUserSendKey = (string)reader["regionUserSendKey"];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("No rows to return");
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts a new region into the database
|
||||
/// </summary>
|
||||
/// <param name="profile">The region to insert</param>
|
||||
/// <returns>Success?</returns>
|
||||
public bool insertRow(SimProfileData profile)
|
||||
{
|
||||
string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
|
||||
sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
|
||||
sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES ";
|
||||
|
||||
sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, ";
|
||||
sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, ";
|
||||
sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);";
|
||||
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>();
|
||||
|
||||
parameters["regionHandle"] = profile.regionHandle.ToString();
|
||||
parameters["regionName"] = profile.regionName;
|
||||
parameters["uuid"] = profile.UUID.ToString();
|
||||
parameters["regionRecvKey"] = profile.regionRecvKey;
|
||||
parameters["regionSendKey"] = profile.regionSendKey;
|
||||
parameters["regionDataURI"] = profile.regionDataURI;
|
||||
parameters["serverIP"] = profile.serverIP;
|
||||
parameters["serverPort"] = profile.serverPort.ToString();
|
||||
parameters["serverURI"] = profile.serverURI;
|
||||
parameters["locX"] = profile.regionLocX.ToString();
|
||||
parameters["locY"] = profile.regionLocY.ToString();
|
||||
parameters["locZ"] = profile.regionLocZ.ToString();
|
||||
parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString();
|
||||
parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString();
|
||||
parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString();
|
||||
parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString();
|
||||
parameters["regionAssetURI"] = profile.regionAssetURI;
|
||||
parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey;
|
||||
parameters["regionAssetSendKey"] = profile.regionAssetSendKey;
|
||||
parameters["regionUserURI"] = profile.regionUserURI;
|
||||
parameters["regionUserRecvKey"] = profile.regionUserRecvKey;
|
||||
parameters["regionUserSendKey"] = profile.regionUserSendKey;
|
||||
|
||||
bool returnval = false;
|
||||
|
||||
try
|
||||
{
|
||||
IDbCommand result = Query(sql, parameters);
|
||||
|
||||
if (result.ExecuteNonQuery() == 1)
|
||||
returnval = true;
|
||||
|
||||
result.Dispose();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return returnval;
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
..\..\..\bin\OpenSim.Framework.Data.SQLite.dll
|
||||
obj\Release\ResolveAssemblyReference.cache
|
||||
obj\Release\OpenSim.Framework.Data.SQLite.dll
|
||||
obj\Debug\ResolveAssemblyReference.cache
|
||||
obj\Debug\OpenSim.Framework.Data.SQLite.dll
|
||||
obj\Debug\OpenSim.Framework.Data.SQLite.pdb
|
||||
..\..\..\bin\OpenSim.Framework.Data.SQLite.pdb
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data
|
||||
{
|
||||
public enum DataResponse
|
||||
{
|
||||
RESPONSE_OK,
|
||||
RESPONSE_AUTHREQUIRED,
|
||||
RESPONSE_INVALIDCREDENTIALS,
|
||||
RESPONSE_ERROR
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A standard grid interface
|
||||
/// </summary>
|
||||
public interface IGridData
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a sim profile from a regionHandle
|
||||
/// </summary>
|
||||
/// <param name="regionHandle">A 64bit Region Handle</param>
|
||||
/// <returns>A simprofile</returns>
|
||||
SimProfileData GetProfileByHandle(ulong regionHandle);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from a UUID
|
||||
/// </summary>
|
||||
/// <param name="UUID">A 128bit UUID</param>
|
||||
/// <returns>A sim profile</returns>
|
||||
SimProfileData GetProfileByLLUUID(LLUUID UUID);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all profiles within the specified range
|
||||
/// </summary>
|
||||
/// <param name="Xmin">Minimum sim coordinate (X)</param>
|
||||
/// <param name="Ymin">Minimum sim coordinate (Y)</param>
|
||||
/// <param name="Xmax">Maximum sim coordinate (X)</param>
|
||||
/// <param name="Ymin">Maximum sim coordinate (Y)</param>
|
||||
/// <returns>An array containing all the sim profiles in the specified range</returns>
|
||||
SimProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax);
|
||||
|
||||
/// <summary>
|
||||
/// Authenticates a sim by use of it's recv key.
|
||||
/// WARNING: Insecure
|
||||
/// </summary>
|
||||
/// <param name="UUID">The UUID sent by the sim</param>
|
||||
/// <param name="regionHandle">The regionhandle sent by the sim</param>
|
||||
/// <param name="simrecvkey">The recieving key sent by the sim</param>
|
||||
/// <returns>Whether the sim has been authenticated</returns>
|
||||
bool AuthenticateSim(LLUUID UUID, ulong regionHandle, string simrecvkey);
|
||||
|
||||
/// <summary>
|
||||
/// Initialises the interface
|
||||
/// </summary>
|
||||
void Initialise();
|
||||
|
||||
/// <summary>
|
||||
/// Closes the interface
|
||||
/// </summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>
|
||||
/// The plugin being loaded
|
||||
/// </summary>
|
||||
/// <returns>A string containing the plugin name</returns>
|
||||
string getName();
|
||||
|
||||
/// <summary>
|
||||
/// The plugins version
|
||||
/// </summary>
|
||||
/// <returns>A string containing the plugin version</returns>
|
||||
string getVersion();
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new profile to the database
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile to add</param>
|
||||
/// <returns>RESPONSE_OK if successful, error if not.</returns>
|
||||
DataResponse AddProfile(SimProfileData profile);
|
||||
|
||||
ReservationData GetReservationAtPoint(uint x, uint y);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
namespace OpenSim.Framework.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// The severity of an individual log message
|
||||
/// </summary>
|
||||
public enum LogSeverity : int
|
||||
{
|
||||
/// <summary>
|
||||
/// Critical: systems failure
|
||||
/// </summary>
|
||||
CRITICAL = 1,
|
||||
/// <summary>
|
||||
/// Major: warning prior to systems failure
|
||||
/// </summary>
|
||||
MAJOR = 2,
|
||||
/// <summary>
|
||||
/// Medium: an individual non-critical task failed
|
||||
/// </summary>
|
||||
MEDIUM = 3,
|
||||
/// <summary>
|
||||
/// Low: Informational warning
|
||||
/// </summary>
|
||||
LOW = 4,
|
||||
/// <summary>
|
||||
/// Info: Information
|
||||
/// </summary>
|
||||
INFO = 5,
|
||||
/// <summary>
|
||||
/// Verbose: Debug Information
|
||||
/// </summary>
|
||||
VERBOSE = 6
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An interface to a LogData storage system
|
||||
/// </summary>
|
||||
public interface ILogData
|
||||
{
|
||||
void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority,string logMessage);
|
||||
/// <summary>
|
||||
/// Initialises the interface
|
||||
/// </summary>
|
||||
void Initialise();
|
||||
|
||||
/// <summary>
|
||||
/// Closes the interface
|
||||
/// </summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>
|
||||
/// The plugin being loaded
|
||||
/// </summary>
|
||||
/// <returns>A string containing the plugin name</returns>
|
||||
string getName();
|
||||
|
||||
/// <summary>
|
||||
/// The plugins version
|
||||
/// </summary>
|
||||
/// <returns>A string containing the plugin version</returns>
|
||||
string getVersion();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
/*
|
||||
Taken from public code listing at by Alex Pinsker
|
||||
http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html
|
||||
*/
|
||||
|
||||
namespace OpenSim.Framework.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Parse settings from ini-like files
|
||||
/// </summary>
|
||||
public class IniFile
|
||||
{
|
||||
static IniFile()
|
||||
{
|
||||
_iniKeyValuePatternRegex = new Regex(
|
||||
@"((\s)*(?<Key>([^\=^\s^\n]+))[\s^\n]*
|
||||
# key part (surrounding whitespace stripped)
|
||||
\=
|
||||
(\s)*(?<Value>([^\n^\s]+(\n){0,1})))
|
||||
# value part (surrounding whitespace stripped)
|
||||
",
|
||||
RegexOptions.IgnorePatternWhitespace |
|
||||
RegexOptions.Compiled |
|
||||
RegexOptions.CultureInvariant);
|
||||
}
|
||||
static private Regex _iniKeyValuePatternRegex;
|
||||
|
||||
public IniFile(string iniFileName)
|
||||
{
|
||||
_iniFileName = iniFileName;
|
||||
}
|
||||
|
||||
public string ParseFileReadValue(string key)
|
||||
{
|
||||
using (StreamReader reader =
|
||||
new StreamReader(_iniFileName))
|
||||
{
|
||||
do
|
||||
{
|
||||
string line = reader.ReadLine();
|
||||
Match match =
|
||||
_iniKeyValuePatternRegex.Match(line);
|
||||
if (match.Success)
|
||||
{
|
||||
string currentKey =
|
||||
match.Groups["Key"].Value as string;
|
||||
if (currentKey != null &&
|
||||
currentKey.Trim().CompareTo(key) == 0)
|
||||
{
|
||||
string value =
|
||||
match.Groups["Value"].Value as string;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
while (reader.Peek() != -1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public string IniFileName
|
||||
{
|
||||
get { return _iniFileName; }
|
||||
} private string _iniFileName;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,185 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System.Collections.Generic;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Inventory Item - contains all the properties associated with an individual inventory piece.
|
||||
/// </summary>
|
||||
public class InventoryItemBase
|
||||
{
|
||||
/// <summary>
|
||||
/// A UUID containing the ID for the inventory item itself
|
||||
/// </summary>
|
||||
public LLUUID inventoryID;
|
||||
/// <summary>
|
||||
/// The UUID of the associated asset on the asset server
|
||||
/// </summary>
|
||||
public LLUUID assetID;
|
||||
/// <summary>
|
||||
/// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
|
||||
/// </summary>
|
||||
public int type;
|
||||
/// <summary>
|
||||
/// The folder this item is contained in (NULL_KEY = Inventory Root)
|
||||
/// </summary>
|
||||
public LLUUID parentFolderID;
|
||||
/// <summary>
|
||||
/// The owner of this inventory item
|
||||
/// </summary>
|
||||
public LLUUID avatarID;
|
||||
/// <summary>
|
||||
/// The name of the inventory item (must be less than 64 characters)
|
||||
/// </summary>
|
||||
public string inventoryName;
|
||||
/// <summary>
|
||||
/// The description of the inventory item (must be less than 64 characters)
|
||||
/// </summary>
|
||||
public string inventoryDescription;
|
||||
/// <summary>
|
||||
/// A mask containing the permissions for the next owner (cannot be enforced)
|
||||
/// </summary>
|
||||
public uint inventoryNextPermissions;
|
||||
/// <summary>
|
||||
/// A mask containing permissions for the current owner (cannot be enforced)
|
||||
/// </summary>
|
||||
public uint inventoryCurrentPermissions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Class for folders which contain users inventory
|
||||
/// </summary>
|
||||
public class InventoryFolderBase
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the folder (64 characters or less)
|
||||
/// </summary>
|
||||
public string name;
|
||||
/// <summary>
|
||||
/// The agent who's inventory this is contained by
|
||||
/// </summary>
|
||||
public LLUUID agentID;
|
||||
/// <summary>
|
||||
/// The folder this folder is contained in (NULL_KEY for root)
|
||||
/// </summary>
|
||||
public LLUUID parentID;
|
||||
/// <summary>
|
||||
/// The UUID for this folder
|
||||
/// </summary>
|
||||
public LLUUID folderID;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An interface for accessing inventory data from a storage server
|
||||
/// </summary>
|
||||
public interface IInventoryData
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialises the interface
|
||||
/// </summary>
|
||||
void Initialise();
|
||||
|
||||
/// <summary>
|
||||
/// Closes the interface
|
||||
/// </summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>
|
||||
/// The plugin being loaded
|
||||
/// </summary>
|
||||
/// <returns>A string containing the plugin name</returns>
|
||||
string getName();
|
||||
|
||||
/// <summary>
|
||||
/// The plugins version
|
||||
/// </summary>
|
||||
/// <returns>A string containing the plugin version</returns>
|
||||
string getVersion();
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of inventory items contained within the specified folder
|
||||
/// </summary>
|
||||
/// <param name="folderID">The UUID of the target folder</param>
|
||||
/// <returns>A List of InventoryItemBase items</returns>
|
||||
List<InventoryItemBase> getInventoryInFolder(LLUUID folderID);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of folders in the users inventory root.
|
||||
/// </summary>
|
||||
/// <param name="user">The UUID of the user who is having inventory being returned</param>
|
||||
/// <returns>A list of folders</returns>
|
||||
List<InventoryFolderBase> getUserRootFolders(LLUUID user);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of inventory folders contained in the folder 'parentID'
|
||||
/// </summary>
|
||||
/// <param name="parentID">The folder to get subfolders for</param>
|
||||
/// <returns>A list of inventory folders</returns>
|
||||
List<InventoryFolderBase> getInventoryFolders(LLUUID parentID);
|
||||
|
||||
/// <summary>
|
||||
/// Returns an inventory item by its UUID
|
||||
/// </summary>
|
||||
/// <param name="item">The UUID of the item to be returned</param>
|
||||
/// <returns>A class containing item information</returns>
|
||||
InventoryItemBase getInventoryItem(LLUUID item);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a specified inventory folder by its UUID
|
||||
/// </summary>
|
||||
/// <param name="folder">The UUID of the folder to be returned</param>
|
||||
/// <returns>A class containing folder information</returns>
|
||||
InventoryFolderBase getInventoryFolder(LLUUID folder);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new inventory item based on item
|
||||
/// </summary>
|
||||
/// <param name="item">The item to be created</param>
|
||||
void addInventoryItem(InventoryItemBase item);
|
||||
|
||||
/// <summary>
|
||||
/// Updates an inventory item with item (updates based on ID)
|
||||
/// </summary>
|
||||
/// <param name="item">The updated item</param>
|
||||
void updateInventoryItem(InventoryItemBase item);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new folder specified by folder
|
||||
/// </summary>
|
||||
/// <param name="folder">The inventory folder</param>
|
||||
void addInventoryFolder(InventoryFolderBase folder);
|
||||
|
||||
/// <summary>
|
||||
/// Updates a folder based on its ID with folder
|
||||
/// </summary>
|
||||
/// <param name="folder">The inventory folder</param>
|
||||
void updateInventoryFolder(InventoryFolderBase folder);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{36B72A9B-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Framework.Data</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Framework.Data</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="libsecondlife.dll" >
|
||||
<HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" >
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" >
|
||||
<HintPath>System.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" >
|
||||
<HintPath>System.Xml.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="XMLRPC.dll" >
|
||||
<HintPath>..\..\..\bin\XMLRPC.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ReservationData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GridData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ILogData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="IniConfig.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="InventoryData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UserData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UserProfileData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SimProfileData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\Sugilite\bin\</ReferencePath>
|
||||
<LastOpenVersion>8.0.50727</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
</Project>
|
|
@ -0,0 +1,33 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenSim.Framework.Data")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenSim.Framework.Data")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("3a711c34-b0c0-4264-b0fe-f366eabf9d7b")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data
|
||||
{
|
||||
public class ReservationData
|
||||
{
|
||||
public LLUUID userUUID = new LLUUID();
|
||||
public int reservationMinX = 0;
|
||||
public int reservationMinY = 0;
|
||||
public int reservationMaxX = 65536;
|
||||
public int reservationMaxY = 65536;
|
||||
|
||||
public string reservationName = "";
|
||||
public string reservationCompany = "";
|
||||
public bool status = true;
|
||||
|
||||
public string gridSendKey = "";
|
||||
public string gridRecvKey = "";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using libsecondlife;
|
||||
using Nwc.XmlRpc;
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace OpenSim.Framework.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// A class which contains information known to the grid server about a region
|
||||
/// </summary>
|
||||
public class SimProfileData
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the region
|
||||
/// </summary>
|
||||
public string regionName = "";
|
||||
|
||||
/// <summary>
|
||||
/// A 64-bit number combining map position into a (mostly) unique ID
|
||||
/// </summary>
|
||||
public ulong regionHandle;
|
||||
|
||||
/// <summary>
|
||||
/// OGS/OpenSim Specific ID for a region
|
||||
/// </summary>
|
||||
public LLUUID UUID;
|
||||
|
||||
/// <summary>
|
||||
/// Coordinates of the region
|
||||
/// </summary>
|
||||
public uint regionLocX;
|
||||
public uint regionLocY;
|
||||
public uint regionLocZ; // Reserved (round-robin, layers, etc)
|
||||
|
||||
/// <summary>
|
||||
/// Authentication secrets
|
||||
/// </summary>
|
||||
/// <remarks>Not very secure, needs improvement.</remarks>
|
||||
public string regionSendKey = "";
|
||||
public string regionRecvKey = "";
|
||||
public string regionSecret = "";
|
||||
|
||||
/// <summary>
|
||||
/// Whether the region is online
|
||||
/// </summary>
|
||||
public bool regionOnline;
|
||||
|
||||
/// <summary>
|
||||
/// Information about the server that the region is currently hosted on
|
||||
/// </summary>
|
||||
public string serverIP = "";
|
||||
public uint serverPort;
|
||||
public string serverURI = "";
|
||||
|
||||
/// <summary>
|
||||
/// Set of optional overrides. Can be used to create non-eulicidean spaces.
|
||||
/// </summary>
|
||||
public ulong regionNorthOverrideHandle;
|
||||
public ulong regionSouthOverrideHandle;
|
||||
public ulong regionEastOverrideHandle;
|
||||
public ulong regionWestOverrideHandle;
|
||||
|
||||
/// <summary>
|
||||
/// Optional: URI Location of the region database
|
||||
/// </summary>
|
||||
/// <remarks>Used for floating sim pools where the region data is not nessecarily coupled to a specific server</remarks>
|
||||
public string regionDataURI = "";
|
||||
|
||||
/// <summary>
|
||||
/// Region Asset Details
|
||||
/// </summary>
|
||||
public string regionAssetURI = "";
|
||||
public string regionAssetSendKey = "";
|
||||
public string regionAssetRecvKey = "";
|
||||
|
||||
/// <summary>
|
||||
/// Region Userserver Details
|
||||
/// </summary>
|
||||
public string regionUserURI = "";
|
||||
public string regionUserSendKey = "";
|
||||
public string regionUserRecvKey = "";
|
||||
|
||||
/// <summary>
|
||||
/// Region Map Texture Asset
|
||||
/// </summary>
|
||||
public LLUUID regionMapTextureID = new LLUUID("00000000-0000-0000-9999-000000000006");
|
||||
|
||||
/// <summary>
|
||||
/// Get Sim profile data from grid server when in grid mode
|
||||
/// </summary>
|
||||
/// <param name="region_uuid"></param>
|
||||
/// <param name="gridserver_url"></param>
|
||||
/// <param name="?"></param>
|
||||
/// <returns></returns>
|
||||
public SimProfileData RequestSimProfileData(LLUUID region_uuid, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey)
|
||||
{
|
||||
Hashtable requestData = new Hashtable();
|
||||
requestData["region_uuid"] = region_uuid.UUID.ToString();
|
||||
requestData["authkey"] = gridserver_sendkey;
|
||||
ArrayList SendParams = new ArrayList();
|
||||
SendParams.Add(requestData);
|
||||
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
|
||||
XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000);
|
||||
|
||||
Hashtable responseData = (Hashtable)GridResp.Value;
|
||||
|
||||
if (responseData.ContainsKey("error"))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
SimProfileData simData = new SimProfileData();
|
||||
simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]);
|
||||
simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]);
|
||||
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256));
|
||||
simData.serverIP = (string)responseData["sim_ip"];
|
||||
simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]);
|
||||
simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/";
|
||||
simData.UUID = new LLUUID((string)responseData["region_UUID"]);
|
||||
simData.regionName = (string)responseData["region_name"];
|
||||
|
||||
return simData;
|
||||
}
|
||||
public SimProfileData RequestSimProfileData(ulong region_handle, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey)
|
||||
{
|
||||
Hashtable requestData = new Hashtable();
|
||||
requestData["region_handle"] = region_handle.ToString();
|
||||
requestData["authkey"] = gridserver_sendkey;
|
||||
ArrayList SendParams = new ArrayList();
|
||||
SendParams.Add(requestData);
|
||||
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
|
||||
XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000);
|
||||
|
||||
Hashtable responseData = (Hashtable)GridResp.Value;
|
||||
|
||||
if (responseData.ContainsKey("error"))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
SimProfileData simData = new SimProfileData();
|
||||
simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]);
|
||||
simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]);
|
||||
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256));
|
||||
simData.serverIP = (string)responseData["sim_ip"];
|
||||
simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]);
|
||||
simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/";
|
||||
simData.UUID = new LLUUID((string)responseData["region_UUID"]);
|
||||
simData.regionName = (string)responseData["region_name"];
|
||||
|
||||
return simData;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface for connecting to user storage servers.
|
||||
/// </summary>
|
||||
public interface IUserData
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a user profile from a database via their UUID
|
||||
/// </summary>
|
||||
/// <param name="user">The accounts UUID</param>
|
||||
/// <returns>The user data profile</returns>
|
||||
UserProfileData getUserByUUID(LLUUID user);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a users profile by searching their username
|
||||
/// </summary>
|
||||
/// <param name="name">The users username</param>
|
||||
/// <returns>The user data profile</returns>
|
||||
UserProfileData getUserByName(string name);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a users profile by searching their username parts
|
||||
/// </summary>
|
||||
/// <param name="fname">Account firstname</param>
|
||||
/// <param name="lname">Account lastname</param>
|
||||
/// <returns>The user data profile</returns>
|
||||
UserProfileData getUserByName(string fname, string lname);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current agent for a user searching by it's UUID
|
||||
/// </summary>
|
||||
/// <param name="user">The users UUID</param>
|
||||
/// <returns>The current agent session</returns>
|
||||
UserAgentData getAgentByUUID(LLUUID user);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current session agent for a user searching by username
|
||||
/// </summary>
|
||||
/// <param name="name">The users account name</param>
|
||||
/// <returns>The current agent session</returns>
|
||||
UserAgentData getAgentByName(string name);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current session agent for a user searching by username parts
|
||||
/// </summary>
|
||||
/// <param name="fname">The users first account name</param>
|
||||
/// <param name="lname">The users account surname</param>
|
||||
/// <returns>The current agent session</returns>
|
||||
UserAgentData getAgentByName(string fname, string lname);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new User profile to the database
|
||||
/// </summary>
|
||||
/// <param name="user">UserProfile to add</param>
|
||||
void addNewUserProfile(UserProfileData user);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new agent to the database
|
||||
/// </summary>
|
||||
/// <param name="agent">The agent to add</param>
|
||||
void addNewUserAgent(UserAgentData agent);
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES)
|
||||
/// </summary>
|
||||
/// <param name="from">The account to transfer from</param>
|
||||
/// <param name="to">The account to transfer to</param>
|
||||
/// <param name="amount">The amount to transfer</param>
|
||||
/// <returns>Successful?</returns>
|
||||
bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount);
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to move inventory between accounts, if inventory is copyable it will be copied into the target account.
|
||||
/// </summary>
|
||||
/// <param name="from">User to transfer from</param>
|
||||
/// <param name="to">User to transfer to</param>
|
||||
/// <param name="inventory">Specified inventory item</param>
|
||||
/// <returns>Successful?</returns>
|
||||
bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the plugin version
|
||||
/// </summary>
|
||||
/// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns>
|
||||
string getVersion();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the plugin name
|
||||
/// </summary>
|
||||
/// <returns>Plugin name, eg MySQL User Provider</returns>
|
||||
string getName();
|
||||
|
||||
/// <summary>
|
||||
/// Initialises the plugin (artificial constructor)
|
||||
/// </summary>
|
||||
void Initialise();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,180 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Information about a particular user known to the userserver
|
||||
/// </summary>
|
||||
public class UserProfileData
|
||||
{
|
||||
/// <summary>
|
||||
/// The ID value for this user
|
||||
/// </summary>
|
||||
public LLUUID UUID;
|
||||
|
||||
/// <summary>
|
||||
/// The first component of a users account name
|
||||
/// </summary>
|
||||
public string username;
|
||||
/// <summary>
|
||||
/// The second component of a users account name
|
||||
/// </summary>
|
||||
public string surname;
|
||||
|
||||
/// <summary>
|
||||
/// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt)
|
||||
/// </summary>
|
||||
/// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks>
|
||||
public string passwordHash;
|
||||
/// <summary>
|
||||
/// The salt used for the users hash, should be 32 bytes or longer
|
||||
/// </summary>
|
||||
public string passwordSalt;
|
||||
|
||||
/// <summary>
|
||||
/// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into
|
||||
/// </summary>
|
||||
public ulong homeRegion;
|
||||
/// <summary>
|
||||
/// The coordinates inside the region of the home location
|
||||
/// </summary>
|
||||
public LLVector3 homeLocation;
|
||||
/// <summary>
|
||||
/// Where the user will be looking when they rez.
|
||||
/// </summary>
|
||||
public LLVector3 homeLookAt;
|
||||
|
||||
/// <summary>
|
||||
/// A UNIX Timestamp (seconds since epoch) for the users creation
|
||||
/// </summary>
|
||||
public int created;
|
||||
/// <summary>
|
||||
/// A UNIX Timestamp for the users last login date / time
|
||||
/// </summary>
|
||||
public int lastLogin;
|
||||
|
||||
/// <summary>
|
||||
/// A URI to the users inventory server, used for foreigners and large grids
|
||||
/// </summary>
|
||||
public string userInventoryURI;
|
||||
/// <summary>
|
||||
/// A URI to the users asset server, used for foreigners and large grids.
|
||||
/// </summary>
|
||||
public string userAssetURI;
|
||||
|
||||
/// <summary>
|
||||
/// A uint mask containing the "I can do" fields of the users profile
|
||||
/// </summary>
|
||||
public uint profileCanDoMask;
|
||||
/// <summary>
|
||||
/// A uint mask containing the "I want to do" part of the users profile
|
||||
/// </summary>
|
||||
public uint profileWantDoMask; // Profile window "I want to" mask
|
||||
|
||||
/// <summary>
|
||||
/// The about text listed in a users profile.
|
||||
/// </summary>
|
||||
public string profileAboutText;
|
||||
/// <summary>
|
||||
/// The first life about text listed in a users profile
|
||||
/// </summary>
|
||||
public string profileFirstText;
|
||||
|
||||
/// <summary>
|
||||
/// The profile image for an avatar stored on the asset server
|
||||
/// </summary>
|
||||
public LLUUID profileImage;
|
||||
/// <summary>
|
||||
/// The profile image for the users first life tab
|
||||
/// </summary>
|
||||
public LLUUID profileFirstImage;
|
||||
/// <summary>
|
||||
/// The users last registered agent (filled in on the user server)
|
||||
/// </summary>
|
||||
public UserAgentData currentAgent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Information about a users session
|
||||
/// </summary>
|
||||
public class UserAgentData
|
||||
{
|
||||
/// <summary>
|
||||
/// The UUID of the users avatar (not the agent!)
|
||||
/// </summary>
|
||||
public LLUUID UUID;
|
||||
/// <summary>
|
||||
/// The IP address of the user
|
||||
/// </summary>
|
||||
public string agentIP = String.Empty;
|
||||
/// <summary>
|
||||
/// The port of the user
|
||||
/// </summary>
|
||||
public uint agentPort;
|
||||
/// <summary>
|
||||
/// Is the user online?
|
||||
/// </summary>
|
||||
public bool agentOnline;
|
||||
/// <summary>
|
||||
/// The session ID for the user (also the agent ID)
|
||||
/// </summary>
|
||||
public LLUUID sessionID;
|
||||
/// <summary>
|
||||
/// The "secure" session ID for the user
|
||||
/// </summary>
|
||||
/// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks>
|
||||
public LLUUID secureSessionID;
|
||||
/// <summary>
|
||||
/// The region the user logged into initially
|
||||
/// </summary>
|
||||
public LLUUID regionID;
|
||||
/// <summary>
|
||||
/// A unix timestamp from when the user logged in
|
||||
/// </summary>
|
||||
public int loginTime;
|
||||
/// <summary>
|
||||
/// When this agent expired and logged out, 0 if still online
|
||||
/// </summary>
|
||||
public int logoutTime;
|
||||
/// <summary>
|
||||
/// Current region the user is logged into
|
||||
/// </summary>
|
||||
public LLUUID currentRegion;
|
||||
/// <summary>
|
||||
/// Region handle of the current region the user is in
|
||||
/// </summary>
|
||||
public ulong currentHandle;
|
||||
/// <summary>
|
||||
/// The position of the user within the region
|
||||
/// </summary>
|
||||
public LLVector3 currentPos;
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
..\..\..\bin\OpenSim.Framework.Data.dll
|
||||
obj\Release\ResolveAssemblyReference.cache
|
||||
obj\Release\OpenSim.Framework.Data.dll
|
||||
obj\Debug\ResolveAssemblyReference.cache
|
||||
obj\Debug\OpenSim.Framework.Data.dll
|
||||
obj\Debug\OpenSim.Framework.Data.pdb
|
||||
..\..\..\bin\OpenSim.Framework.Data.pdb
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,265 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System.Collections.Generic;
|
||||
using libsecondlife;
|
||||
using libsecondlife.Packets;
|
||||
using OpenSim.Framework.Types;
|
||||
using OpenSim.Framework.Utilities;
|
||||
|
||||
namespace OpenSim.Framework.Inventory
|
||||
{
|
||||
public class AgentInventory
|
||||
{
|
||||
//Holds the local copy of Inventory info for a agent
|
||||
public Dictionary<LLUUID, InventoryFolder> InventoryFolders;
|
||||
public Dictionary<LLUUID, InventoryItem> InventoryItems;
|
||||
public InventoryFolder InventoryRoot;
|
||||
public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server
|
||||
public LLUUID AgentID;
|
||||
public AvatarWearable[] Wearables;
|
||||
|
||||
public AgentInventory()
|
||||
{
|
||||
InventoryFolders = new Dictionary<LLUUID, InventoryFolder>();
|
||||
InventoryItems = new Dictionary<LLUUID, InventoryItem>();
|
||||
this.Initialise();
|
||||
}
|
||||
|
||||
public virtual void Initialise()
|
||||
{
|
||||
Wearables = new AvatarWearable[13]; //should be 12 of these
|
||||
for (int i = 0; i < 13; i++)
|
||||
{
|
||||
Wearables[i] = new AvatarWearable();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public bool CreateNewFolder(LLUUID folderID, ushort type)
|
||||
{
|
||||
InventoryFolder Folder = new InventoryFolder();
|
||||
Folder.FolderID = folderID;
|
||||
Folder.OwnerID = this.AgentID;
|
||||
Folder.DefaultType = type;
|
||||
this.InventoryFolders.Add(Folder.FolderID, Folder);
|
||||
return (true);
|
||||
}
|
||||
|
||||
public void CreateRootFolder(LLUUID newAgentID, bool createTextures)
|
||||
{
|
||||
this.AgentID = newAgentID;
|
||||
InventoryRoot = new InventoryFolder();
|
||||
InventoryRoot.FolderID = LLUUID.Random();
|
||||
InventoryRoot.ParentID = new LLUUID();
|
||||
InventoryRoot.Version = 1;
|
||||
InventoryRoot.DefaultType = 8;
|
||||
InventoryRoot.OwnerID = this.AgentID;
|
||||
InventoryRoot.FolderName = "My Inventory";
|
||||
InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot);
|
||||
InventoryRoot.OwnerID = this.AgentID;
|
||||
if (createTextures)
|
||||
{
|
||||
this.CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID);
|
||||
}
|
||||
}
|
||||
|
||||
public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName)
|
||||
{
|
||||
InventoryFolder Folder = new InventoryFolder();
|
||||
Folder.FolderID = folderID;
|
||||
Folder.OwnerID = this.AgentID;
|
||||
Folder.DefaultType = type;
|
||||
Folder.FolderName = folderName;
|
||||
this.InventoryFolders.Add(Folder.FolderID, Folder);
|
||||
|
||||
return (true);
|
||||
}
|
||||
|
||||
public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent)
|
||||
{
|
||||
if (!this.InventoryFolders.ContainsKey(folderID))
|
||||
{
|
||||
System.Console.WriteLine("creating new folder called " + folderName + " in agents inventory");
|
||||
InventoryFolder Folder = new InventoryFolder();
|
||||
Folder.FolderID = folderID;
|
||||
Folder.OwnerID = this.AgentID;
|
||||
Folder.DefaultType = type;
|
||||
Folder.FolderName = folderName;
|
||||
Folder.ParentID = parent;
|
||||
this.InventoryFolders.Add(Folder.FolderID, Folder);
|
||||
}
|
||||
|
||||
return (true);
|
||||
}
|
||||
|
||||
public bool HasFolder(LLUUID folderID)
|
||||
{
|
||||
if (this.InventoryFolders.ContainsKey(folderID))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public LLUUID GetFolderID(string folderName)
|
||||
{
|
||||
foreach (InventoryFolder inv in this.InventoryFolders.Values)
|
||||
{
|
||||
if (inv.FolderName == folderName)
|
||||
{
|
||||
return inv.FolderID;
|
||||
}
|
||||
}
|
||||
|
||||
return LLUUID.Zero;
|
||||
}
|
||||
|
||||
public bool UpdateItemAsset(LLUUID itemID, AssetBase asset)
|
||||
{
|
||||
if(this.InventoryItems.ContainsKey(itemID))
|
||||
{
|
||||
InventoryItem Item = this.InventoryItems[itemID];
|
||||
Item.AssetID = asset.FullID;
|
||||
System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated());
|
||||
//TODO need to update the rest of the info
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet)
|
||||
{
|
||||
System.Console.WriteLine("updating inventory item details");
|
||||
if (this.InventoryItems.ContainsKey(itemID))
|
||||
{
|
||||
System.Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name));
|
||||
InventoryItem Item = this.InventoryItems[itemID];
|
||||
Item.Name = Util.FieldToString(packet.Name);
|
||||
System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated());
|
||||
//TODO need to update the rest of the info
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public LLUUID AddToInventory(LLUUID folderID, AssetBase asset)
|
||||
{
|
||||
if (this.InventoryFolders.ContainsKey(folderID))
|
||||
{
|
||||
LLUUID NewItemID = LLUUID.Random();
|
||||
|
||||
InventoryItem Item = new InventoryItem();
|
||||
Item.FolderID = folderID;
|
||||
Item.OwnerID = AgentID;
|
||||
Item.AssetID = asset.FullID;
|
||||
Item.ItemID = NewItemID;
|
||||
Item.Type = asset.Type;
|
||||
Item.Name = asset.Name;
|
||||
Item.Description = asset.Description;
|
||||
Item.InvType = asset.InvType;
|
||||
this.InventoryItems.Add(Item.ItemID, Item);
|
||||
InventoryFolder Folder = InventoryFolders[Item.FolderID];
|
||||
Folder.Items.Add(Item);
|
||||
return (Item.ItemID);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (null);
|
||||
}
|
||||
}
|
||||
|
||||
public bool DeleteFromInventory(LLUUID itemID)
|
||||
{
|
||||
bool res = false;
|
||||
if (this.InventoryItems.ContainsKey(itemID))
|
||||
{
|
||||
InventoryItem item = this.InventoryItems[itemID];
|
||||
this.InventoryItems.Remove(itemID);
|
||||
foreach (InventoryFolder fold in InventoryFolders.Values)
|
||||
{
|
||||
if (fold.Items.Contains(item))
|
||||
{
|
||||
fold.Items.Remove(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
res = true;
|
||||
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
public class InventoryFolder
|
||||
{
|
||||
public List<InventoryItem> Items;
|
||||
//public List<InventoryFolder> Subfolders;
|
||||
public LLUUID FolderID;
|
||||
public LLUUID OwnerID;
|
||||
public LLUUID ParentID = LLUUID.Zero;
|
||||
public string FolderName;
|
||||
public ushort DefaultType;
|
||||
public ushort Version;
|
||||
|
||||
public InventoryFolder()
|
||||
{
|
||||
Items = new List<InventoryItem>();
|
||||
//Subfolders = new List<InventoryFolder>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class InventoryItem
|
||||
{
|
||||
public LLUUID FolderID;
|
||||
public LLUUID OwnerID;
|
||||
public LLUUID ItemID;
|
||||
public LLUUID AssetID;
|
||||
public LLUUID CreatorID;
|
||||
public sbyte InvType;
|
||||
public sbyte Type;
|
||||
public string Name ="";
|
||||
public string Description;
|
||||
|
||||
public InventoryItem()
|
||||
{
|
||||
this.CreatorID = LLUUID.Zero;
|
||||
}
|
||||
|
||||
public string ExportString()
|
||||
{
|
||||
string typ = "notecard";
|
||||
string result = "";
|
||||
result += "\tinv_object\t0\n\t{\n";
|
||||
result += "\t\tobj_id\t%s\n";
|
||||
result += "\t\tparent_id\t"+ ItemID.ToString() +"\n";
|
||||
result += "\t\ttype\t"+ typ +"\n";
|
||||
result += "\t\tname\t" + Name+"|\n";
|
||||
result += "\t}\n";
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue