From fdde7dfdba99ec3519e52a200ab4f64bf1d97889 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sun, 8 Apr 2018 01:44:42 -0500 Subject: [PATCH] migrating to .NET Core 2.0 --- .gitignore | 1 + IW4MAdmin.sln | 143 +++++---- SharedLibrary/BuildScripts/PostBuild.bat | 3 - SharedLibrary/BuildScripts/PreBuild.bat | 20 -- .../Database/ContextConfiguration.cs | 30 -- SharedLibrary/Database/Repair.cs | 29 -- SharedLibrary/Helpers/Hashing.cs | 77 ----- SharedLibrary/Migrations/Configuration.cs | 56 ---- SharedLibrary/Properties/AssemblyInfo.cs | 36 --- SharedLibrary/SharedLibrary.csproj | 287 ------------------ SharedLibrary/SharedLibrary.sln | 22 -- .../Command.cs | 4 +- .../Commands/NativeCommands.cs | 16 +- .../Configuration/ApplicationConfiguration.cs | 4 +- .../Configuration/MapConfiguration.cs | 4 +- .../Configuration/ServerConfiguration.cs | 2 +- SharedLibraryCore/Database/ContextSeed.cs | 57 ++++ .../Database/DatabaseContext.cs | 81 ++--- .../Database/Importer.cs | 25 +- .../Database/Models/EFAlias.cs | 2 +- .../Database/Models/EFAliasLink.cs | 2 +- .../Database/Models/EFClient.cs | 3 +- .../Database/Models/EFPenalty.cs | 2 +- .../Database/Models/SharedEntity.cs | 2 +- .../Dtos/ChatInfo.cs | 2 +- .../Dtos/ClientInfo.cs | 2 +- .../Dtos/CommandResponseInfo.cs | 2 +- .../Dtos/EventInfo.cs | 2 +- .../Dtos/PenaltyInfo.cs | 2 +- .../Dtos/PlayerInfo.cs | 2 +- .../Dtos/ProfileMeta.cs | 5 +- .../Dtos/ServerInfo.cs | 2 +- .../Dtos/SharedInfo.cs | 2 +- {SharedLibrary => SharedLibraryCore}/Dvar.cs | 2 +- {SharedLibrary => SharedLibraryCore}/Event.cs | 5 +- .../Exceptions/CommandException.cs | 2 +- .../Exceptions/DatabaseException.cs | 2 +- .../Exceptions/DvarException.cs | 2 +- .../Exceptions/NetworkException.cs | 2 +- .../Exceptions/SerializationException.cs | 2 +- .../Exceptions/ServerException.cs | 2 +- {SharedLibrary => SharedLibraryCore}/File.cs | 2 +- .../Helpers/AsyncStatus.cs | 2 +- .../Helpers/BaseConfigurationHandler.cs | 4 +- SharedLibraryCore/Helpers/Hashing.cs | 42 +++ .../Helpers/MessageToken.cs | 2 +- .../Helpers/ParseEnum.cs | 2 +- .../Helpers/PlayerHistory.cs | 2 +- .../Helpers/ThreadSafe.cs | 2 +- .../Helpers/Vector3.cs | 2 +- .../Interfaces/IBaseConfiguration.cs | 2 +- .../Interfaces/IConfigurationHandler.cs | 2 +- .../Interfaces/IEntityService.cs | 2 +- .../Interfaces/ILogger.cs | 2 +- .../Interfaces/IManager.cs | 10 +- .../Interfaces/IPlugin.cs | 2 +- .../Interfaces/ISerializable.cs | 2 +- .../Microsoft.VC90.CRT.manifest | 0 .../x86/Microsoft.VC90.CRT/README_ENU.txt | Bin .../x86/Microsoft.VC90.CRT/msvcr90.dll | Bin .../LibSQLCe}/x86/sqlceca40.dll | Bin .../LibSQLCe}/x86/sqlcecompact40.dll | Bin .../LibSQLCe}/x86/sqlceer40EN.dll | Bin .../LibSQLCe}/x86/sqlceme40.dll | Bin .../LibSQLCe}/x86/sqlceqp40.dll | Bin .../LibSQLCe}/x86/sqlcese40.dll | Bin {SharedLibrary => SharedLibraryCore}/Map.cs | 2 +- .../Objects/Alias.cs | 2 +- .../Objects/Penalty.cs | 4 +- .../Objects/Player.cs | 2 +- .../Objects/Report.cs | 2 +- .../PluginImporter.cs | 4 +- .../RCon/Connection.cs | 6 +- .../RCon/StaticHelpers.cs | 10 +- .../Server.cs | 17 +- .../Services/AliasService.cs | 10 +- .../Services/ClientService.cs | 31 +- .../Services/GenericRepository.cs | 8 +- .../Services/MetaService.cs | 6 +- .../Services/PenaltyService.cs | 14 +- SharedLibraryCore/SharedLibraryCore.csproj | 46 +++ .../Utilities.cs | 9 +- WebfrontCore/Application/API/EventAPI.cs | 20 +- .../Application/ConfigurationGenerator.cs | 4 +- WebfrontCore/Application/Logger.cs | 2 +- WebfrontCore/Application/Main.cs | 10 +- WebfrontCore/Application/Manager.cs | 22 +- WebfrontCore/Application/Server.cs | 58 ++-- WebfrontCore/BuildScripts/PostBuild.bat | 2 +- WebfrontCore/BuildScripts/PostPublish.bat | 2 +- .../Controllers/API/EventController.cs | 9 +- WebfrontCore/Controllers/AccountController.cs | 7 +- WebfrontCore/Controllers/ActionController.cs | 2 +- WebfrontCore/Controllers/BaseController.cs | 13 +- WebfrontCore/Controllers/ClientController.cs | 12 +- WebfrontCore/Controllers/ConsoleController.cs | 6 +- WebfrontCore/Controllers/HomeController.cs | 2 +- WebfrontCore/Controllers/PenaltyController.cs | 10 +- WebfrontCore/Controllers/ServerController.cs | 2 +- WebfrontCore/Program.cs | 32 +- .../PublishProfiles/FolderProfile1.pubxml | 21 -- .../PublishProfiles/Release - S.pubxml | 21 -- .../PublishProfiles/USBPublish.pubxml | 21 -- WebfrontCore/Properties/launchSettings.json | 10 +- WebfrontCore/Startup.cs | 54 ++-- .../PenaltyListViewComponent.cs | 6 +- .../ViewComponents/ServerListViewComponent.cs | 2 +- WebfrontCore/Views/Client/Find/Index.cshtml | 2 +- .../Views/Client/Privileged/Index.cshtml | 2 +- .../Views/Client/Profile/Index.cshtml | 6 +- WebfrontCore/Views/Console/Index.cshtml | 2 +- WebfrontCore/Views/Console/_Response.cshtml | 2 +- WebfrontCore/Views/Penalty/_Penalty.cshtml | 2 +- .../Views/Server/_ClientActivity.cshtml | 2 +- WebfrontCore/Views/Server/_Server.cshtml | 2 +- .../Components/PenaltyList/_List.cshtml | 2 +- .../Shared/Components/ServerList/_List.cshtml | 2 +- WebfrontCore/WebfrontCore.csproj | 86 +----- WebfrontCore2/BuildScripts/PostBuild.bat | 16 - WebfrontCore2/BuildScripts/PostPublish.bat | 9 - WebfrontCore2/BuildScripts/PreBuild.bat | 3 - 121 files changed, 534 insertions(+), 1157 deletions(-) delete mode 100644 SharedLibrary/BuildScripts/PostBuild.bat delete mode 100644 SharedLibrary/BuildScripts/PreBuild.bat delete mode 100644 SharedLibrary/Database/ContextConfiguration.cs delete mode 100644 SharedLibrary/Database/Repair.cs delete mode 100644 SharedLibrary/Helpers/Hashing.cs delete mode 100644 SharedLibrary/Migrations/Configuration.cs delete mode 100644 SharedLibrary/Properties/AssemblyInfo.cs delete mode 100644 SharedLibrary/SharedLibrary.csproj delete mode 100644 SharedLibrary/SharedLibrary.sln rename {SharedLibrary => SharedLibraryCore}/Command.cs (95%) rename {SharedLibrary => SharedLibraryCore}/Commands/NativeCommands.cs (99%) rename {SharedLibrary => SharedLibraryCore}/Configuration/ApplicationConfiguration.cs (95%) rename {SharedLibrary => SharedLibraryCore}/Configuration/MapConfiguration.cs (75%) rename {SharedLibrary => SharedLibraryCore}/Configuration/ServerConfiguration.cs (88%) create mode 100644 SharedLibraryCore/Database/ContextSeed.cs rename {SharedLibrary => SharedLibraryCore}/Database/DatabaseContext.cs (51%) rename {SharedLibrary => SharedLibraryCore}/Database/Importer.cs (82%) rename {SharedLibrary => SharedLibraryCore}/Database/Models/EFAlias.cs (94%) rename {SharedLibrary => SharedLibraryCore}/Database/Models/EFAliasLink.cs (92%) rename {SharedLibrary => SharedLibraryCore}/Database/Models/EFClient.cs (96%) rename {SharedLibrary => SharedLibraryCore}/Database/Models/EFPenalty.cs (95%) rename {SharedLibrary => SharedLibraryCore}/Database/Models/SharedEntity.cs (82%) rename {SharedLibrary => SharedLibraryCore}/Dtos/ChatInfo.cs (85%) rename {SharedLibrary => SharedLibraryCore}/Dtos/ClientInfo.cs (88%) rename {SharedLibrary => SharedLibraryCore}/Dtos/CommandResponseInfo.cs (88%) rename {SharedLibrary => SharedLibraryCore}/Dtos/EventInfo.cs (96%) rename {SharedLibrary => SharedLibraryCore}/Dtos/PenaltyInfo.cs (94%) rename {SharedLibrary => SharedLibraryCore}/Dtos/PlayerInfo.cs (96%) rename {SharedLibrary => SharedLibraryCore}/Dtos/ProfileMeta.cs (86%) rename {SharedLibrary => SharedLibraryCore}/Dtos/ServerInfo.cs (95%) rename {SharedLibrary => SharedLibraryCore}/Dtos/SharedInfo.cs (73%) rename {SharedLibrary => SharedLibraryCore}/Dvar.cs (86%) rename {SharedLibrary => SharedLibraryCore}/Event.cs (97%) rename {SharedLibrary => SharedLibraryCore}/Exceptions/CommandException.cs (88%) rename {SharedLibrary => SharedLibraryCore}/Exceptions/DatabaseException.cs (86%) rename {SharedLibrary => SharedLibraryCore}/Exceptions/DvarException.cs (86%) rename {SharedLibrary => SharedLibraryCore}/Exceptions/NetworkException.cs (86%) rename {SharedLibrary => SharedLibraryCore}/Exceptions/SerializationException.cs (86%) rename {SharedLibrary => SharedLibraryCore}/Exceptions/ServerException.cs (86%) rename {SharedLibrary => SharedLibraryCore}/File.cs (99%) rename {SharedLibrary => SharedLibraryCore}/Helpers/AsyncStatus.cs (97%) rename {SharedLibrary => SharedLibraryCore}/Helpers/BaseConfigurationHandler.cs (94%) create mode 100644 SharedLibraryCore/Helpers/Hashing.cs rename {SharedLibrary => SharedLibraryCore}/Helpers/MessageToken.cs (91%) rename {SharedLibrary => SharedLibraryCore}/Helpers/ParseEnum.cs (92%) rename {SharedLibrary => SharedLibraryCore}/Helpers/PlayerHistory.cs (97%) rename {SharedLibrary => SharedLibraryCore}/Helpers/ThreadSafe.cs (96%) rename {SharedLibrary => SharedLibraryCore}/Helpers/Vector3.cs (97%) rename {SharedLibrary => SharedLibraryCore}/Interfaces/IBaseConfiguration.cs (85%) rename {SharedLibrary => SharedLibraryCore}/Interfaces/IConfigurationHandler.cs (88%) rename {SharedLibrary => SharedLibraryCore}/Interfaces/IEntityService.cs (92%) rename {SharedLibrary => SharedLibraryCore}/Interfaces/ILogger.cs (90%) rename {SharedLibrary => SharedLibraryCore}/Interfaces/IManager.cs (75%) rename {SharedLibrary => SharedLibraryCore}/Interfaces/IPlugin.cs (90%) rename {SharedLibrary => SharedLibraryCore}/Interfaces/ISerializable.cs (97%) rename {SharedLibrary/LibSQLCE => SharedLibraryCore/LibSQLCe}/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest (100%) rename {SharedLibrary/LibSQLCE => SharedLibraryCore/LibSQLCe}/x86/Microsoft.VC90.CRT/README_ENU.txt (100%) rename {SharedLibrary/LibSQLCE => SharedLibraryCore/LibSQLCe}/x86/Microsoft.VC90.CRT/msvcr90.dll (100%) rename {SharedLibrary/LibSQLCE => SharedLibraryCore/LibSQLCe}/x86/sqlceca40.dll (100%) rename {SharedLibrary/LibSQLCE => SharedLibraryCore/LibSQLCe}/x86/sqlcecompact40.dll (100%) rename {SharedLibrary/LibSQLCE => SharedLibraryCore/LibSQLCe}/x86/sqlceer40EN.dll (100%) rename {SharedLibrary/LibSQLCE => SharedLibraryCore/LibSQLCe}/x86/sqlceme40.dll (100%) rename {SharedLibrary/LibSQLCE => SharedLibraryCore/LibSQLCe}/x86/sqlceqp40.dll (100%) rename {SharedLibrary/LibSQLCE => SharedLibraryCore/LibSQLCe}/x86/sqlcese40.dll (100%) rename {SharedLibrary => SharedLibraryCore}/Map.cs (88%) rename {SharedLibrary => SharedLibraryCore}/Objects/Alias.cs (83%) rename {SharedLibrary => SharedLibraryCore}/Objects/Penalty.cs (87%) rename {SharedLibrary => SharedLibraryCore}/Objects/Player.cs (98%) rename {SharedLibrary => SharedLibraryCore}/Objects/Report.cs (92%) rename {SharedLibrary => SharedLibraryCore}/PluginImporter.cs (97%) rename {SharedLibrary => SharedLibraryCore}/RCon/Connection.cs (98%) rename {SharedLibrary => SharedLibraryCore}/RCon/StaticHelpers.cs (64%) rename {SharedLibrary => SharedLibraryCore}/Server.cs (97%) rename {SharedLibrary => SharedLibraryCore}/Services/AliasService.cs (94%) rename {SharedLibrary => SharedLibraryCore}/Services/ClientService.cs (90%) rename {SharedLibrary => SharedLibraryCore}/Services/GenericRepository.cs (96%) rename {SharedLibrary => SharedLibraryCore}/Services/MetaService.cs (86%) rename {SharedLibrary => SharedLibraryCore}/Services/PenaltyService.cs (97%) create mode 100644 SharedLibraryCore/SharedLibraryCore.csproj rename {SharedLibrary => SharedLibraryCore}/Utilities.cs (98%) delete mode 100644 WebfrontCore/Properties/PublishProfiles/FolderProfile1.pubxml delete mode 100644 WebfrontCore/Properties/PublishProfiles/Release - S.pubxml delete mode 100644 WebfrontCore/Properties/PublishProfiles/USBPublish.pubxml delete mode 100644 WebfrontCore2/BuildScripts/PostBuild.bat delete mode 100644 WebfrontCore2/BuildScripts/PostPublish.bat delete mode 100644 WebfrontCore2/BuildScripts/PreBuild.bat diff --git a/.gitignore b/.gitignore index a9b235f1c..8c8878b97 100644 --- a/.gitignore +++ b/.gitignore @@ -202,3 +202,4 @@ ModelManifest.xml /.vs/IW4MAdmin/v15 /.vs/IW4MAdmin/v15 /.vs/IW4MAdmin/v15/Browse.VC.db +**/wwwroot/lib \ No newline at end of file diff --git a/IW4MAdmin.sln b/IW4MAdmin.sln index 08eb4cfcb..cab733f06 100644 --- a/IW4MAdmin.sln +++ b/IW4MAdmin.sln @@ -4,33 +4,26 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 15.0.26730.16 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StatsPlugin", "Plugins\SimpleStats\StatsPlugin.csproj", "{4785AB75-66F3-4391-985D-63A5A049A0FA}" - ProjectSection(ProjectDependencies) = postProject - {D51EECEB-438A-47DA-870F-7D7B41BC24D6} = {D51EECEB-438A-47DA-870F-7D7B41BC24D6} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedLibrary", "SharedLibrary\SharedLibrary.csproj", "{D51EECEB-438A-47DA-870F-7D7B41BC24D6}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WelcomePlugin", "Plugins\Welcome\WelcomePlugin.csproj", "{AF097E6B-48D5-4452-9CCF-0A81A21F341D}" - ProjectSection(ProjectDependencies) = postProject - {D51EECEB-438A-47DA-870F-7D7B41BC24D6} = {D51EECEB-438A-47DA-870F-7D7B41BC24D6} - EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{26E8B310-269E-46D4-A612-24601F16065F}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8C8F3945-0AEF-4949-A1F7-B18E952E50BC}" ProjectSection(SolutionItems) = preProject _customcallbacks.gsc = _customcallbacks.gsc - AfterPublish.bat = AfterPublish.bat README.md = README.md version.txt = version.txt EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Plugins\Tests\Tests.csproj", "{B8C2A759-8663-4F6F-9BA4-19595F5E12C1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebfrontCore", "WebfrontCore\WebfrontCore.csproj", "{65340D7D-5831-406C-ACAD-B13BA634BDE2}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProfanityDeterment", "Plugins\ProfanityDeterment\ProfanityDeterment.csproj", "{3EA31029-C76F-4C8E-AFD4-79F77DEA7033}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharedLibraryCore", "SharedLibraryCore\SharedLibraryCore.csproj", "{AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebfrontCore", "WebfrontCore\WebfrontCore.csproj", "{D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -83,38 +76,6 @@ Global {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x64.Build.0 = Release-Stable|x64 {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x86.ActiveCfg = Release-Stable|x86 {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x86.Build.0 = Release-Stable|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x64.ActiveCfg = Debug|x64 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x64.Build.0 = Debug|x64 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x86.ActiveCfg = Debug|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x86.Build.0 = Debug|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Any CPU.Build.0 = Release|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Mixed Platforms.ActiveCfg = Release-Stable|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Mixed Platforms.Build.0 = Release-Stable|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x64.ActiveCfg = Release|x64 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x64.Build.0 = Release|x64 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x86.ActiveCfg = Release|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x86.Build.0 = Release|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Any CPU.ActiveCfg = Debug|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Any CPU.Build.0 = Debug|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Mixed Platforms.ActiveCfg = Release-Nightly|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Mixed Platforms.Build.0 = Release-Nightly|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x64.ActiveCfg = Release-Nightly|x64 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x64.Build.0 = Release-Nightly|x64 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x86.ActiveCfg = Release-Nightly|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x86.Build.0 = Release-Nightly|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Any CPU.ActiveCfg = Debug|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Any CPU.Build.0 = Debug|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Mixed Platforms.ActiveCfg = Release-Stable|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Mixed Platforms.Build.0 = Release-Stable|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x64.ActiveCfg = Release-Stable|x64 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x64.Build.0 = Release-Stable|x64 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x86.ActiveCfg = Release-Stable|x86 - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x86.Build.0 = Release-Stable|x86 {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Any CPU.Build.0 = Debug|Any CPU {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 @@ -177,38 +138,6 @@ Global {B8C2A759-8663-4F6F-9BA4-19595F5E12C1}.Release-Stable|x64.Build.0 = Release-Stable|Any CPU {B8C2A759-8663-4F6F-9BA4-19595F5E12C1}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU {B8C2A759-8663-4F6F-9BA4-19595F5E12C1}.Release-Stable|x86.Build.0 = Release-Stable|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Debug|x64.ActiveCfg = Debug|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Debug|x64.Build.0 = Debug|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Debug|x86.ActiveCfg = Debug|x86 - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Debug|x86.Build.0 = Debug|x86 - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release|Any CPU.Build.0 = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release|x64.ActiveCfg = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release|x64.Build.0 = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release|x86.ActiveCfg = Release|x86 - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release|x86.Build.0 = Release|x86 - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Nightly|Any CPU.ActiveCfg = Debug|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Nightly|Any CPU.Build.0 = Debug|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Nightly|Mixed Platforms.ActiveCfg = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Nightly|Mixed Platforms.Build.0 = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Nightly|x64.ActiveCfg = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Nightly|x64.Build.0 = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Nightly|x86.ActiveCfg = Release|x86 - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Nightly|x86.Build.0 = Release|x86 - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Stable|Any CPU.ActiveCfg = Debug|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Stable|Any CPU.Build.0 = Debug|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Stable|Mixed Platforms.ActiveCfg = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Stable|Mixed Platforms.Build.0 = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Stable|x64.ActiveCfg = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Stable|x64.Build.0 = Release|Any CPU - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Stable|x86.ActiveCfg = Release|x86 - {65340D7D-5831-406C-ACAD-B13BA634BDE2}.Release-Stable|x86.Build.0 = Release|x86 {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|Any CPU.Build.0 = Debug|Any CPU {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -241,6 +170,70 @@ Global {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release-Stable|x64.Build.0 = Release|Any CPU {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release-Stable|x86.ActiveCfg = Release|x86 {3EA31029-C76F-4C8E-AFD4-79F77DEA7033}.Release-Stable|x86.Build.0 = Release|x86 + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|x64.ActiveCfg = Debug|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|x64.Build.0 = Debug|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|x86.ActiveCfg = Debug|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Debug|x86.Build.0 = Debug|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release|Any CPU.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release|x64.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release|x64.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release|x86.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release|x86.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Nightly|Any CPU.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Nightly|Any CPU.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Nightly|Mixed Platforms.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Nightly|Mixed Platforms.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Nightly|x64.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Nightly|x64.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Nightly|x86.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Nightly|x86.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Stable|Any CPU.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Stable|Mixed Platforms.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Stable|Mixed Platforms.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Stable|x64.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Stable|x64.Build.0 = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Stable|x86.ActiveCfg = Release|Any CPU + {AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}.Release-Stable|x86.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Debug|x64.ActiveCfg = Debug|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Debug|x64.Build.0 = Debug|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Debug|x86.ActiveCfg = Debug|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Debug|x86.Build.0 = Debug|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release|Any CPU.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release|x64.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release|x64.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release|x86.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release|x86.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Nightly|Any CPU.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Nightly|Any CPU.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Nightly|Mixed Platforms.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Nightly|Mixed Platforms.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Nightly|x64.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Nightly|x64.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Nightly|x86.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Nightly|x86.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Stable|Any CPU.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Stable|Mixed Platforms.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Stable|Mixed Platforms.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Stable|x64.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Stable|x64.Build.0 = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Stable|x86.ActiveCfg = Release|Any CPU + {D59AC1F1-2FB9-4BE7-813E-0CCCC4FE9067}.Release-Stable|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SharedLibrary/BuildScripts/PostBuild.bat b/SharedLibrary/BuildScripts/PostBuild.bat deleted file mode 100644 index fbde9f9b5..000000000 --- a/SharedLibrary/BuildScripts/PostBuild.bat +++ /dev/null @@ -1,3 +0,0 @@ -set SolutionDir=%1 -set ProjectDir=%2 -set TargetDir=%3 diff --git a/SharedLibrary/BuildScripts/PreBuild.bat b/SharedLibrary/BuildScripts/PreBuild.bat deleted file mode 100644 index 244c529d3..000000000 --- a/SharedLibrary/BuildScripts/PreBuild.bat +++ /dev/null @@ -1,20 +0,0 @@ -set SolutionDir=%1 -set ProjectDir=%2 -set TargetDir=%3 - -if not exist "%SolutionDir%BUILD" ( - echo "Making build dir" - mkdir "%SolutionDir%BUILD" -) - -if not exist "%SolutionDir%BUILD\Plugins" ( - echo "Making plugin dir" - mkdir "%SolutionDir%BUILD\Plugins" -) - -if not exist "%SolutionDir%BUILD\userraw\scripts" ( - echo "Making userraw dir" - mkdir "%SolutionDir%BUILD\userraw\scripts" -) - -copy "%SolutionDir%_customcallbacks.gsc" "%SolutionDir%BUILD\userraw\scripts\_customcallbacks.gsc" \ No newline at end of file diff --git a/SharedLibrary/Database/ContextConfiguration.cs b/SharedLibrary/Database/ContextConfiguration.cs deleted file mode 100644 index 3350071bc..000000000 --- a/SharedLibrary/Database/ContextConfiguration.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; -using System.Data.Entity.SqlServerCompact; -using System.Data.SqlServerCe; - -namespace SharedLibrary.Database -{ - public class ContextConfiguration : DbConfiguration - { - public ContextConfiguration() - { - if (!Utilities.IsRunningOnMono()) - { - SetExecutionStrategy("System.Data.SqlServerCe.4.0", () => new DefaultExecutionStrategy()); - SetProviderFactory("System.Data.SqlServerCe.4.0", new SqlCeProviderFactory()); - SetProviderServices("System.Data.SqlServerCe.4.0", SqlCeProviderServices.Instance); - SetDefaultConnectionFactory(new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0")); - } - - else - { - SetExecutionStrategy("MySql.Data.MySqlClient", () => new DefaultExecutionStrategy()); - SetProviderFactory("MySql.Data.MySqlClient", new MySql.Data.MySqlClient.MySqlClientFactory()); - SetProviderServices("MySql.Data.MySqlClient", new MySql.Data.MySqlClient.MySqlProviderServices()); - SetDefaultConnectionFactory(new MySql.Data.Entity.MySqlConnectionFactory()); - } - } - } -} diff --git a/SharedLibrary/Database/Repair.cs b/SharedLibrary/Database/Repair.cs deleted file mode 100644 index 2a15216a9..000000000 --- a/SharedLibrary/Database/Repair.cs +++ /dev/null @@ -1,29 +0,0 @@ -using SharedLibrary.Interfaces; -using System; -using System.Data.SqlServerCe; - -namespace SharedLibrary.Database -{ - public class Repair - { - public static void Run(ILogger log) - { - if (!System.IO.File.Exists($"{Utilities.OperatingDirectory}Database.sdf")) - return; - - SqlCeEngine engine = new SqlCeEngine(@"Data Source=|DataDirectory|\Database.sdf"); - if (false == engine.Verify()) - { - log.WriteWarning("Database is corrupted."); - try - { - engine.Repair(null, RepairOption.DeleteCorruptedRows); - } - catch (SqlCeException ex) - { - log.WriteError(ex.Message); - } - } - } - } -} \ No newline at end of file diff --git a/SharedLibrary/Helpers/Hashing.cs b/SharedLibrary/Helpers/Hashing.cs deleted file mode 100644 index cc6dbe3d8..000000000 --- a/SharedLibrary/Helpers/Hashing.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using SimpleCrypto; - -namespace SharedLibrary.Helpers -{ - public class Hashing - { - /// - /// Generate password hash and salt - /// - /// plaintext password - /// - public static string[] Hash(string password, string saltStr = null) - { - - string hash; - string salt; - var CryptoSvc = new PBKDF2(); - - // generate new hash - if (saltStr == null) - { - hash = CryptoSvc.Compute(password); - salt = CryptoSvc.Salt; - return new string[] - { - hash, - salt - }; - } - - else - { - hash = CryptoSvc.Compute(password, saltStr); - return new string[] - { - hash, - "" - }; - } - - - - /*//https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing - - byte[] salt; - - if (saltStr == null) - { - salt = new byte[128 / 8]; - using (var rng = RandomNumberGenerator.Create()) - { - rng.GetBytes(salt); - } - } - - else - { - salt = Convert.FromBase64String(saltStr); - } - - // derive a 256-bit subkey (use HMACSHA1 with 10,000 iterations) - string hashed = Convert.ToBase64String(KeyDerivation.Pbkdf2( - password: password, - salt: salt, - prf: KeyDerivationPrf.HMACSHA1, - iterationCount: 10000, - numBytesRequested: 256 / 8)); - - return new string[] - { - hashed, - Convert.ToBase64String(salt) - };*/ - } - } -} diff --git a/SharedLibrary/Migrations/Configuration.cs b/SharedLibrary/Migrations/Configuration.cs deleted file mode 100644 index 196e788d1..000000000 --- a/SharedLibrary/Migrations/Configuration.cs +++ /dev/null @@ -1,56 +0,0 @@ -namespace SharedLibrary.Migrations -{ - using System; - using System.Data.Entity; - using System.Data.Entity.Migrations; - using System.Linq; - - internal sealed class Configuration : DbMigrationsConfiguration - { - public Configuration() - { - AutomaticMigrationsEnabled = true; - AutomaticMigrationDataLossAllowed = true; - if (Utilities.IsRunningOnMono()) - { - SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator()); - } - } - - protected override void Seed(SharedLibrary.Database.DatabaseContext context) - { - context.AliasLinks.AddOrUpdate(new SharedLibrary.Database.Models.EFAliasLink() - { - AliasLinkId = 1 - }); - - var currentAlias = new SharedLibrary.Database.Models.EFAlias() - { - AliasId = 1, - Active = true, - DateAdded = DateTime.UtcNow, - IPAddress = 0, - Name = "IW4MAdmin", - LinkId = 1 - }; - - context.Aliases.AddOrUpdate(currentAlias); - - context.Clients.AddOrUpdate(new SharedLibrary.Database.Models.EFClient() - { - ClientId = 1, - Active = false, - Connections = 0, - FirstConnection = DateTime.UtcNow, - LastConnection = DateTime.UtcNow, - Level = Objects.Player.Permission.Console, - Masked = true, - NetworkId = 0, - AliasLinkId = 1, - CurrentAliasId = 1, - }); - - base.Seed(context); - } - } -} diff --git a/SharedLibrary/Properties/AssemblyInfo.cs b/SharedLibrary/Properties/AssemblyInfo.cs deleted file mode 100644 index ac893eb8c..000000000 --- a/SharedLibrary/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SharedLibrary")] -[assembly: AssemblyDescription("Common library components for IW4MAdmin")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ForeverNone LLC")] -[assembly: AssemblyProduct("IW4MAdmin")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[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("c434bf30-cd8f-4270-a386-e3b970f02f21")] - -// 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 Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SharedLibrary/SharedLibrary.csproj b/SharedLibrary/SharedLibrary.csproj deleted file mode 100644 index d8b76f1dc..000000000 --- a/SharedLibrary/SharedLibrary.csproj +++ /dev/null @@ -1,287 +0,0 @@ - - - - - PackageReference - Debug - AnyCPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6} - Library - Properties - SharedLibrary - SharedLibrary - v4.5.2 - 512 - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - MinimumRecommendedRules.ruleset - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - false - - - - - - bin\Release-Stable\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - x86 - bin\x86\Debug\ - TRACE;DEBUG - - - x86 - bin\x86\Release\ - true - - - x86 - bin\x86\Release-Stable\ - true - - - true - bin\x64\Debug\ - DEBUG;TRACE - full - x64 - prompt - ..\..\..\RuleSet1.ruleset - - - bin\x64\Release-Nightly\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\x64\Release-Stable\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\Release\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - true - x86 - MinimumRecommendedRules.ruleset - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - OnOutputUpdated - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6.2.0 - - - 6.2.0 - - - 1.1.2 - - - 1.1.2 - - - 1.1.2 - - - 1.1.2 - - - 6.10.6 - - - 6.9.11 - - - 11.0.2 - - - 0.3.30.26 - - - - - False - Microsoft .NET Framework 4.5.2 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - - call $(ProjectDir)BuildScripts\PreBuild.bat $(SolutionDir) $(ProjectDir) $(TargetDir) - - - call $(ProjectDir)BuildScripts\PostBuild.bat $(SolutionDir) $(ProjectDir) $(TargetDir) - - - \ No newline at end of file diff --git a/SharedLibrary/SharedLibrary.sln b/SharedLibrary/SharedLibrary.sln deleted file mode 100644 index a7ca4c011..000000000 --- a/SharedLibrary/SharedLibrary.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedLibrary", "SharedLibrary.csproj", "{D51EECEB-438A-47DA-870F-7D7B41BC24D6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/SharedLibrary/Command.cs b/SharedLibraryCore/Command.cs similarity index 95% rename from SharedLibrary/Command.cs rename to SharedLibraryCore/Command.cs index 768967f55..f0252b982 100644 --- a/SharedLibrary/Command.cs +++ b/SharedLibraryCore/Command.cs @@ -2,9 +2,9 @@ using System.Linq; using System.Threading.Tasks; -using SharedLibrary.Objects; +using SharedLibraryCore.Objects; -namespace SharedLibrary +namespace SharedLibraryCore { public class CommandArgument { diff --git a/SharedLibrary/Commands/NativeCommands.cs b/SharedLibraryCore/Commands/NativeCommands.cs similarity index 99% rename from SharedLibrary/Commands/NativeCommands.cs rename to SharedLibraryCore/Commands/NativeCommands.cs index b1a325692..4b46a658d 100644 --- a/SharedLibrary/Commands/NativeCommands.cs +++ b/SharedLibraryCore/Commands/NativeCommands.cs @@ -1,16 +1,16 @@ -using SharedLibrary.Database; -using SharedLibrary.Database.Models; -using SharedLibrary.Exceptions; -using SharedLibrary.Objects; -using SharedLibrary.Services; +using Microsoft.EntityFrameworkCore; +using SharedLibraryCore.Database; +using SharedLibraryCore.Database.Models; +using SharedLibraryCore.Exceptions; +using SharedLibraryCore.Objects; +using SharedLibraryCore.Services; using System; using System.Collections.Generic; -using System.Data.Entity; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Commands +namespace SharedLibraryCore.Commands { public class CQuit : Command { @@ -575,7 +575,7 @@ namespace SharedLibrary.Commands public override async Task ExecuteAsync(Event E) { - var db_players = (await (E.Owner.Manager.GetClientService() as ClientService) + IList db_players = (await (E.Owner.Manager.GetClientService() as ClientService) .GetClientByName(E.Data)) .OrderByDescending(p => p.LastConnection) .ToList(); diff --git a/SharedLibrary/Configuration/ApplicationConfiguration.cs b/SharedLibraryCore/Configuration/ApplicationConfiguration.cs similarity index 95% rename from SharedLibrary/Configuration/ApplicationConfiguration.cs rename to SharedLibraryCore/Configuration/ApplicationConfiguration.cs index 986f2fb02..ef9613ac0 100644 --- a/SharedLibrary/Configuration/ApplicationConfiguration.cs +++ b/SharedLibraryCore/Configuration/ApplicationConfiguration.cs @@ -1,9 +1,9 @@ -using SharedLibrary.Interfaces; +using SharedLibraryCore.Interfaces; using System; using System.Collections.Generic; using System.Linq; -namespace SharedLibrary.Configuration +namespace SharedLibraryCore.Configuration { public class ApplicationConfiguration : IBaseConfiguration { diff --git a/SharedLibrary/Configuration/MapConfiguration.cs b/SharedLibraryCore/Configuration/MapConfiguration.cs similarity index 75% rename from SharedLibrary/Configuration/MapConfiguration.cs rename to SharedLibraryCore/Configuration/MapConfiguration.cs index db37b5f1a..54bdbbe70 100644 --- a/SharedLibrary/Configuration/MapConfiguration.cs +++ b/SharedLibraryCore/Configuration/MapConfiguration.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using static SharedLibrary.Server; +using static SharedLibraryCore.Server; -namespace SharedLibrary.Configuration +namespace SharedLibraryCore.Configuration { public class MapConfiguration { diff --git a/SharedLibrary/Configuration/ServerConfiguration.cs b/SharedLibraryCore/Configuration/ServerConfiguration.cs similarity index 88% rename from SharedLibrary/Configuration/ServerConfiguration.cs rename to SharedLibraryCore/Configuration/ServerConfiguration.cs index 0220cb1b3..811101232 100644 --- a/SharedLibrary/Configuration/ServerConfiguration.cs +++ b/SharedLibraryCore/Configuration/ServerConfiguration.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace SharedLibrary.Configuration +namespace SharedLibraryCore.Configuration { public class ServerConfiguration { diff --git a/SharedLibraryCore/Database/ContextSeed.cs b/SharedLibraryCore/Database/ContextSeed.cs new file mode 100644 index 000000000..a1615db97 --- /dev/null +++ b/SharedLibraryCore/Database/ContextSeed.cs @@ -0,0 +1,57 @@ +using Microsoft.EntityFrameworkCore; +using SharedLibraryCore.Database.Models; +using System; +using System.Linq; +using System.Threading.Tasks; + +namespace SharedLibraryCore.Database +{ + public class ContextSeed + { + private DatabaseContext context; + + public ContextSeed(DatabaseContext ctx) + { + context = ctx; + } + + public async Task Seed() + { + if (context.AliasLinks.Count() == 0) + { + context.AliasLinks.Add(new EFAliasLink() + { + AliasLinkId = 1 + }); + + var currentAlias = new EFAlias() + { + AliasId = 1, + Active = true, + DateAdded = DateTime.UtcNow, + IPAddress = 0, + Name = "IW4MAdmin", + LinkId = 1 + }; + + context.Aliases.Add(currentAlias); + + context.Clients.Add(new EFClient() + { + ClientId = 1, + Active = false, + Connections = 0, + FirstConnection = DateTime.UtcNow, + LastConnection = DateTime.UtcNow, + Level = Objects.Player.Permission.Console, + Masked = true, + NetworkId = 0, + AliasLinkId = 1, + CurrentAliasId = 1, + }); + + await context.SaveChangesAsync(); + } + } + } +} diff --git a/SharedLibrary/Database/DatabaseContext.cs b/SharedLibraryCore/Database/DatabaseContext.cs similarity index 51% rename from SharedLibrary/Database/DatabaseContext.cs rename to SharedLibraryCore/Database/DatabaseContext.cs index 6e6c6ba40..b964e92f6 100644 --- a/SharedLibrary/Database/DatabaseContext.cs +++ b/SharedLibraryCore/Database/DatabaseContext.cs @@ -1,22 +1,14 @@ using System; -using System.Collections.Generic; -using System.Data.Entity; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SharedLibrary.Database.Models; -using System.Data.SqlServerCe; -using System.Data.Entity.ModelConfiguration.Conventions; +using Microsoft.EntityFrameworkCore; +using SharedLibraryCore.Database.Models; using System.Reflection; -using System.Data.Entity.Infrastructure; -using System.Data.Entity.SqlServerCompact; using System.IO; -using System.Data.Common; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Data.Sqlite; -namespace SharedLibrary.Database +namespace SharedLibraryCore.Database { - - [DbConfigurationType(typeof(ContextConfiguration))] public class DatabaseContext : DbContext { public DbSet Clients { get; set; } @@ -24,47 +16,60 @@ namespace SharedLibrary.Database public DbSet AliasLinks { get; set; } public DbSet Penalties { get; set; } - public static string ConnectionString; + public DatabaseContext(DbContextOptions opt) : base(opt) { } - public DatabaseContext() : base(ConnectionString) + public DatabaseContext() { - // todo: make this work with MySQL - if (!Utilities.IsRunningOnMono()) - System.Data.Entity.Database.SetInitializer(new MigrateDatabaseToLatestVersion()); - //Database.CreateIfNotExists(); - Configuration.LazyLoadingEnabled = true; } - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - modelBuilder.Entity() - .HasRequired(p => p.Offender) + string currentPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase); + var connectionStringBuilder = new SqliteConnectionStringBuilder { DataSource = $"{currentPath}{Path.DirectorySeparatorChar}Database.db".Substring(6) }; + var connectionString = connectionStringBuilder.ToString(); + var connection = new SqliteConnection(connectionString); + + optionsBuilder.UseSqlite(connection); + } + + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + // make network id unique + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.NetworkId).IsUnique(); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(p => p.Offender) .WithMany(c => c.ReceivedPenalties) .HasForeignKey(c => c.OffenderId) - .WillCascadeOnDelete(false); + .OnDelete(DeleteBehavior.Restrict); - modelBuilder.Entity() - .HasRequired(p => p.Punisher) - .WithMany(c => c.AdministeredPenalties) + entity.HasOne(p => p.Punisher) + .WithMany(p => p.AdministeredPenalties) .HasForeignKey(c => c.PunisherId) - .WillCascadeOnDelete(false); + .OnDelete(DeleteBehavior.Restrict); + }); - modelBuilder.Entity() - .HasMany(e => e.Children) - .WithRequired(a => a.Link) - .HasForeignKey(a => a.LinkId) - .WillCascadeOnDelete(true); - - modelBuilder.Conventions.Remove(); + modelBuilder.Entity(entity => + { + entity.HasMany(e => e.Children) + .WithOne(a => a.Link) + .HasForeignKey(k => k.LinkId) + .OnDelete(DeleteBehavior.Restrict); + }); // https://aleemkhan.wordpress.com/2013/02/28/dynamically-adding-dbset-properties-in-dbcontext-for-entity-framework-code-first/ #if !DEBUG - foreach (string dllPath in System.IO.Directory.GetFiles($"{Utilities.OperatingDirectory}Plugins")) + foreach (string dllPath in Directory.GetFiles($"{Utilities.OperatingDirectory}Plugins")) #else IEnumerable directoryFiles; try { - directoryFiles = Directory.GetFiles($@"{Environment.CurrentDirectory}{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}x86{Path.DirectorySeparatorChar}Debug{Path.DirectorySeparatorChar}Plugins").Where(f => f.Contains(".dll")); + directoryFiles = Directory.GetFiles($@"{Environment.CurrentDirectory}{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}Debug{Path.DirectorySeparatorChar}netcoreapp2.0{Path.DirectorySeparatorChar}Plugins").Where(f => f.Contains(".dll")); } catch (Exception) diff --git a/SharedLibrary/Database/Importer.cs b/SharedLibraryCore/Database/Importer.cs similarity index 82% rename from SharedLibrary/Database/Importer.cs rename to SharedLibraryCore/Database/Importer.cs index bcc297850..6bc89cc80 100644 --- a/SharedLibrary/Database/Importer.cs +++ b/SharedLibraryCore/Database/Importer.cs @@ -1,12 +1,13 @@ -using SharedLibrary.Database.Models; -using SharedLibrary.Objects; +using Microsoft.EntityFrameworkCore; +using SharedLibraryCore.Database.Models; +using SharedLibraryCore.Objects; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Database +namespace SharedLibraryCore.Database { //https://stackoverflow.com/questions/5940225/fastest-way-of-inserting-in-entity-framework public static class Importer @@ -18,9 +19,6 @@ namespace SharedLibrary.Database try { context = new DatabaseContext(); - context.Configuration.AutoDetectChangesEnabled = false; - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; int count = 0; foreach (var entityToInsert in clients) @@ -83,9 +81,6 @@ namespace SharedLibrary.Database { context.Dispose(); context = new DatabaseContext(); - context.Configuration.AutoDetectChangesEnabled = false; - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; } } @@ -99,9 +94,6 @@ namespace SharedLibrary.Database try { context = new DatabaseContext(); - context.Configuration.AutoDetectChangesEnabled = false; - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; int count = 0; foreach (var entityToInsert in penalties) @@ -161,9 +153,6 @@ namespace SharedLibrary.Database { context.Dispose(); context = new DatabaseContext(); - context.Configuration.AutoDetectChangesEnabled = false; - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; } } @@ -177,9 +166,6 @@ namespace SharedLibrary.Database try { context = new DatabaseContext(); - context.Configuration.AutoDetectChangesEnabled = false; - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; int count = 0; foreach (var entityToInsert in SQLiteData) @@ -217,9 +203,6 @@ namespace SharedLibrary.Database { context.Dispose(); context = new DatabaseContext(); - context.Configuration.AutoDetectChangesEnabled = false; - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; } } return context; diff --git a/SharedLibrary/Database/Models/EFAlias.cs b/SharedLibraryCore/Database/Models/EFAlias.cs similarity index 94% rename from SharedLibrary/Database/Models/EFAlias.cs rename to SharedLibraryCore/Database/Models/EFAlias.cs index 68108f604..6abd43052 100644 --- a/SharedLibrary/Database/Models/EFAlias.cs +++ b/SharedLibraryCore/Database/Models/EFAlias.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace SharedLibrary.Database.Models +namespace SharedLibraryCore.Database.Models { public class EFAlias : SharedEntity { diff --git a/SharedLibrary/Database/Models/EFAliasLink.cs b/SharedLibraryCore/Database/Models/EFAliasLink.cs similarity index 92% rename from SharedLibrary/Database/Models/EFAliasLink.cs rename to SharedLibraryCore/Database/Models/EFAliasLink.cs index 05d869a37..b6b08eb17 100644 --- a/SharedLibrary/Database/Models/EFAliasLink.cs +++ b/SharedLibraryCore/Database/Models/EFAliasLink.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; -namespace SharedLibrary.Database.Models +namespace SharedLibraryCore.Database.Models { public class EFAliasLink : SharedEntity { diff --git a/SharedLibrary/Database/Models/EFClient.cs b/SharedLibraryCore/Database/Models/EFClient.cs similarity index 96% rename from SharedLibrary/Database/Models/EFClient.cs rename to SharedLibraryCore/Database/Models/EFClient.cs index 726ef086c..620e2f6f0 100644 --- a/SharedLibrary/Database/Models/EFClient.cs +++ b/SharedLibraryCore/Database/Models/EFClient.cs @@ -3,13 +3,12 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace SharedLibrary.Database.Models +namespace SharedLibraryCore.Database.Models { public class EFClient : SharedEntity { [Key] public int ClientId { get; set; } - [Index(IsUnique = true)] public long NetworkId { get; set; } [Required] public int Connections { get; set; } diff --git a/SharedLibrary/Database/Models/EFPenalty.cs b/SharedLibraryCore/Database/Models/EFPenalty.cs similarity index 95% rename from SharedLibrary/Database/Models/EFPenalty.cs rename to SharedLibraryCore/Database/Models/EFPenalty.cs index 624594b19..f8cf4a4ee 100644 --- a/SharedLibrary/Database/Models/EFPenalty.cs +++ b/SharedLibraryCore/Database/Models/EFPenalty.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Database.Models +namespace SharedLibraryCore.Database.Models { public class EFPenalty : SharedEntity { diff --git a/SharedLibrary/Database/Models/SharedEntity.cs b/SharedLibraryCore/Database/Models/SharedEntity.cs similarity index 82% rename from SharedLibrary/Database/Models/SharedEntity.cs rename to SharedLibraryCore/Database/Models/SharedEntity.cs index 6def65bdb..7784cbcaf 100644 --- a/SharedLibrary/Database/Models/SharedEntity.cs +++ b/SharedLibraryCore/Database/Models/SharedEntity.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Database.Models +namespace SharedLibraryCore.Database.Models { public class SharedEntity { diff --git a/SharedLibrary/Dtos/ChatInfo.cs b/SharedLibraryCore/Dtos/ChatInfo.cs similarity index 85% rename from SharedLibrary/Dtos/ChatInfo.cs rename to SharedLibraryCore/Dtos/ChatInfo.cs index 21a2007ce..4bdd24cd2 100644 --- a/SharedLibrary/Dtos/ChatInfo.cs +++ b/SharedLibraryCore/Dtos/ChatInfo.cs @@ -1,6 +1,6 @@ using System; -namespace SharedLibrary.Dtos +namespace SharedLibraryCore.Dtos { public class ChatInfo { diff --git a/SharedLibrary/Dtos/ClientInfo.cs b/SharedLibraryCore/Dtos/ClientInfo.cs similarity index 88% rename from SharedLibrary/Dtos/ClientInfo.cs rename to SharedLibraryCore/Dtos/ClientInfo.cs index 8b4136db6..ec9efa4e7 100644 --- a/SharedLibrary/Dtos/ClientInfo.cs +++ b/SharedLibraryCore/Dtos/ClientInfo.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Dtos +namespace SharedLibraryCore.Dtos { public class ClientInfo { diff --git a/SharedLibrary/Dtos/CommandResponseInfo.cs b/SharedLibraryCore/Dtos/CommandResponseInfo.cs similarity index 88% rename from SharedLibrary/Dtos/CommandResponseInfo.cs rename to SharedLibraryCore/Dtos/CommandResponseInfo.cs index 387e802d6..39f906c48 100644 --- a/SharedLibrary/Dtos/CommandResponseInfo.cs +++ b/SharedLibraryCore/Dtos/CommandResponseInfo.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Dtos +namespace SharedLibraryCore.Dtos { public class CommandResponseInfo { diff --git a/SharedLibrary/Dtos/EventInfo.cs b/SharedLibraryCore/Dtos/EventInfo.cs similarity index 96% rename from SharedLibrary/Dtos/EventInfo.cs rename to SharedLibraryCore/Dtos/EventInfo.cs index fc3a383f1..c8079182e 100644 --- a/SharedLibrary/Dtos/EventInfo.cs +++ b/SharedLibraryCore/Dtos/EventInfo.cs @@ -1,6 +1,6 @@ using System; -namespace SharedLibrary.Dtos +namespace SharedLibraryCore.Dtos { public class EventInfo { diff --git a/SharedLibrary/Dtos/PenaltyInfo.cs b/SharedLibraryCore/Dtos/PenaltyInfo.cs similarity index 94% rename from SharedLibrary/Dtos/PenaltyInfo.cs rename to SharedLibraryCore/Dtos/PenaltyInfo.cs index f90cd98c2..925bd98b7 100644 --- a/SharedLibrary/Dtos/PenaltyInfo.cs +++ b/SharedLibraryCore/Dtos/PenaltyInfo.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Dtos +namespace SharedLibraryCore.Dtos { public class PenaltyInfo : SharedInfo { diff --git a/SharedLibrary/Dtos/PlayerInfo.cs b/SharedLibraryCore/Dtos/PlayerInfo.cs similarity index 96% rename from SharedLibrary/Dtos/PlayerInfo.cs rename to SharedLibraryCore/Dtos/PlayerInfo.cs index c21bd6064..095bf9e80 100644 --- a/SharedLibrary/Dtos/PlayerInfo.cs +++ b/SharedLibraryCore/Dtos/PlayerInfo.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Dtos +namespace SharedLibraryCore.Dtos { public class PlayerInfo { diff --git a/SharedLibrary/Dtos/ProfileMeta.cs b/SharedLibraryCore/Dtos/ProfileMeta.cs similarity index 86% rename from SharedLibrary/Dtos/ProfileMeta.cs rename to SharedLibraryCore/Dtos/ProfileMeta.cs index cb554c0ab..fda4492e2 100644 --- a/SharedLibrary/Dtos/ProfileMeta.cs +++ b/SharedLibraryCore/Dtos/ProfileMeta.cs @@ -1,11 +1,10 @@ -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Dtos +namespace SharedLibraryCore.Dtos { public class ProfileMeta : SharedInfo { diff --git a/SharedLibrary/Dtos/ServerInfo.cs b/SharedLibraryCore/Dtos/ServerInfo.cs similarity index 95% rename from SharedLibrary/Dtos/ServerInfo.cs rename to SharedLibraryCore/Dtos/ServerInfo.cs index 91ed259eb..f2c363a6d 100644 --- a/SharedLibrary/Dtos/ServerInfo.cs +++ b/SharedLibraryCore/Dtos/ServerInfo.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Dtos +namespace SharedLibraryCore.Dtos { public class ServerInfo { diff --git a/SharedLibrary/Dtos/SharedInfo.cs b/SharedLibraryCore/Dtos/SharedInfo.cs similarity index 73% rename from SharedLibrary/Dtos/SharedInfo.cs rename to SharedLibraryCore/Dtos/SharedInfo.cs index 956318ffb..018ab38a0 100644 --- a/SharedLibrary/Dtos/SharedInfo.cs +++ b/SharedLibraryCore/Dtos/SharedInfo.cs @@ -1,5 +1,5 @@  -namespace SharedLibrary.Dtos +namespace SharedLibraryCore.Dtos { public class SharedInfo { diff --git a/SharedLibrary/Dvar.cs b/SharedLibraryCore/Dvar.cs similarity index 86% rename from SharedLibrary/Dvar.cs rename to SharedLibraryCore/Dvar.cs index a3a456e1d..238debbaf 100644 --- a/SharedLibrary/Dvar.cs +++ b/SharedLibraryCore/Dvar.cs @@ -1,4 +1,4 @@ -namespace SharedLibrary +namespace SharedLibraryCore { public class DVAR { diff --git a/SharedLibrary/Event.cs b/SharedLibraryCore/Event.cs similarity index 97% rename from SharedLibrary/Event.cs rename to SharedLibraryCore/Event.cs index 5c75587ad..d62b23933 100644 --- a/SharedLibrary/Event.cs +++ b/SharedLibraryCore/Event.cs @@ -1,12 +1,11 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; -using SharedLibrary.Objects; +using SharedLibraryCore.Objects; -namespace SharedLibrary +namespace SharedLibraryCore { public class Event { diff --git a/SharedLibrary/Exceptions/CommandException.cs b/SharedLibraryCore/Exceptions/CommandException.cs similarity index 88% rename from SharedLibrary/Exceptions/CommandException.cs rename to SharedLibraryCore/Exceptions/CommandException.cs index b56b9df71..bdb51c085 100644 --- a/SharedLibrary/Exceptions/CommandException.cs +++ b/SharedLibraryCore/Exceptions/CommandException.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Exceptions +namespace SharedLibraryCore.Exceptions { public class CommandException : ServerException { diff --git a/SharedLibrary/Exceptions/DatabaseException.cs b/SharedLibraryCore/Exceptions/DatabaseException.cs similarity index 86% rename from SharedLibrary/Exceptions/DatabaseException.cs rename to SharedLibraryCore/Exceptions/DatabaseException.cs index f4229a5be..62dd02fbf 100644 --- a/SharedLibrary/Exceptions/DatabaseException.cs +++ b/SharedLibraryCore/Exceptions/DatabaseException.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Exceptions +namespace SharedLibraryCore.Exceptions { public class DatabaseException : Exception { diff --git a/SharedLibrary/Exceptions/DvarException.cs b/SharedLibraryCore/Exceptions/DvarException.cs similarity index 86% rename from SharedLibrary/Exceptions/DvarException.cs rename to SharedLibraryCore/Exceptions/DvarException.cs index d1556716b..f4f8a7c82 100644 --- a/SharedLibrary/Exceptions/DvarException.cs +++ b/SharedLibraryCore/Exceptions/DvarException.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Exceptions +namespace SharedLibraryCore.Exceptions { public class DvarException : ServerException { diff --git a/SharedLibrary/Exceptions/NetworkException.cs b/SharedLibraryCore/Exceptions/NetworkException.cs similarity index 86% rename from SharedLibrary/Exceptions/NetworkException.cs rename to SharedLibraryCore/Exceptions/NetworkException.cs index 79292471e..b4015d24e 100644 --- a/SharedLibrary/Exceptions/NetworkException.cs +++ b/SharedLibraryCore/Exceptions/NetworkException.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Exceptions +namespace SharedLibraryCore.Exceptions { public class NetworkException : ServerException { diff --git a/SharedLibrary/Exceptions/SerializationException.cs b/SharedLibraryCore/Exceptions/SerializationException.cs similarity index 86% rename from SharedLibrary/Exceptions/SerializationException.cs rename to SharedLibraryCore/Exceptions/SerializationException.cs index 8d6fb1999..e8641547b 100644 --- a/SharedLibrary/Exceptions/SerializationException.cs +++ b/SharedLibraryCore/Exceptions/SerializationException.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Exceptions +namespace SharedLibraryCore.Exceptions { public class SerializeException : Exception { diff --git a/SharedLibrary/Exceptions/ServerException.cs b/SharedLibraryCore/Exceptions/ServerException.cs similarity index 86% rename from SharedLibrary/Exceptions/ServerException.cs rename to SharedLibraryCore/Exceptions/ServerException.cs index 17c8363c2..5b96ec0d8 100644 --- a/SharedLibrary/Exceptions/ServerException.cs +++ b/SharedLibraryCore/Exceptions/ServerException.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Exceptions +namespace SharedLibraryCore.Exceptions { public class ServerException : Exception { diff --git a/SharedLibrary/File.cs b/SharedLibraryCore/File.cs similarity index 99% rename from SharedLibrary/File.cs rename to SharedLibraryCore/File.cs index 81547b9fe..8d0e09a21 100644 --- a/SharedLibrary/File.cs +++ b/SharedLibraryCore/File.cs @@ -5,7 +5,7 @@ using System.IO; using System.Net; using System.Net.Http; -namespace SharedLibrary +namespace SharedLibraryCore { public class RemoteFile : IFile { diff --git a/SharedLibrary/Helpers/AsyncStatus.cs b/SharedLibraryCore/Helpers/AsyncStatus.cs similarity index 97% rename from SharedLibrary/Helpers/AsyncStatus.cs rename to SharedLibraryCore/Helpers/AsyncStatus.cs index dfebd736c..c6679f636 100644 --- a/SharedLibrary/Helpers/AsyncStatus.cs +++ b/SharedLibraryCore/Helpers/AsyncStatus.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -namespace SharedLibrary.Helpers +namespace SharedLibraryCore.Helpers { public sealed class AsyncStatus { diff --git a/SharedLibrary/Helpers/BaseConfigurationHandler.cs b/SharedLibraryCore/Helpers/BaseConfigurationHandler.cs similarity index 94% rename from SharedLibrary/Helpers/BaseConfigurationHandler.cs rename to SharedLibraryCore/Helpers/BaseConfigurationHandler.cs index f2998e604..35223e657 100644 --- a/SharedLibrary/Helpers/BaseConfigurationHandler.cs +++ b/SharedLibraryCore/Helpers/BaseConfigurationHandler.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Configuration; using Newtonsoft.Json; -using SharedLibrary.Interfaces; +using SharedLibraryCore.Interfaces; using System; using System.Collections.Generic; using System.IO; @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Configuration +namespace SharedLibraryCore.Configuration { public class BaseConfigurationHandler : IConfigurationHandler where T : IBaseConfiguration { diff --git a/SharedLibraryCore/Helpers/Hashing.cs b/SharedLibraryCore/Helpers/Hashing.cs new file mode 100644 index 000000000..7ea47625c --- /dev/null +++ b/SharedLibraryCore/Helpers/Hashing.cs @@ -0,0 +1,42 @@ +using SimpleCrypto; + +namespace SharedLibraryCore.Helpers +{ + public class Hashing + { + /// + /// Generate password hash and salt + /// + /// plaintext password + /// + public static string[] Hash(string password, string saltStr = null) + { + + string hash; + string salt; + var CryptoSvc = new PBKDF2(); + + // generate new hash + if (saltStr == null) + { + hash = CryptoSvc.Compute(password); + salt = CryptoSvc.Salt; + return new string[] + { + hash, + salt + }; + } + + else + { + hash = CryptoSvc.Compute(password, saltStr); + return new string[] + { + hash, + "" + }; + } + } + } +} diff --git a/SharedLibrary/Helpers/MessageToken.cs b/SharedLibraryCore/Helpers/MessageToken.cs similarity index 91% rename from SharedLibrary/Helpers/MessageToken.cs rename to SharedLibraryCore/Helpers/MessageToken.cs index 285ba9c73..409d89195 100644 --- a/SharedLibrary/Helpers/MessageToken.cs +++ b/SharedLibraryCore/Helpers/MessageToken.cs @@ -1,6 +1,6 @@ using System; -namespace SharedLibrary.Helpers +namespace SharedLibraryCore.Helpers { public class MessageToken { diff --git a/SharedLibrary/Helpers/ParseEnum.cs b/SharedLibraryCore/Helpers/ParseEnum.cs similarity index 92% rename from SharedLibrary/Helpers/ParseEnum.cs rename to SharedLibraryCore/Helpers/ParseEnum.cs index 4dbdbf069..ec17f253e 100644 --- a/SharedLibrary/Helpers/ParseEnum.cs +++ b/SharedLibraryCore/Helpers/ParseEnum.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Helpers +namespace SharedLibraryCore.Helpers { public class ParseEnum { diff --git a/SharedLibrary/Helpers/PlayerHistory.cs b/SharedLibraryCore/Helpers/PlayerHistory.cs similarity index 97% rename from SharedLibrary/Helpers/PlayerHistory.cs rename to SharedLibraryCore/Helpers/PlayerHistory.cs index 4d7b844e1..d7c543dcd 100644 --- a/SharedLibrary/Helpers/PlayerHistory.cs +++ b/SharedLibraryCore/Helpers/PlayerHistory.cs @@ -1,6 +1,6 @@ using System; -namespace SharedLibrary.Helpers +namespace SharedLibraryCore.Helpers { public class PlayerHistory { diff --git a/SharedLibrary/Helpers/ThreadSafe.cs b/SharedLibraryCore/Helpers/ThreadSafe.cs similarity index 96% rename from SharedLibrary/Helpers/ThreadSafe.cs rename to SharedLibraryCore/Helpers/ThreadSafe.cs index 2951e4450..170b937e1 100644 --- a/SharedLibrary/Helpers/ThreadSafe.cs +++ b/SharedLibraryCore/Helpers/ThreadSafe.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Helpers +namespace SharedLibraryCore.Helpers { /// /// Excuse this monstrosity diff --git a/SharedLibrary/Helpers/Vector3.cs b/SharedLibraryCore/Helpers/Vector3.cs similarity index 97% rename from SharedLibrary/Helpers/Vector3.cs rename to SharedLibraryCore/Helpers/Vector3.cs index d15307468..b0d232a38 100644 --- a/SharedLibrary/Helpers/Vector3.cs +++ b/SharedLibraryCore/Helpers/Vector3.cs @@ -5,7 +5,7 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; -namespace SharedLibrary.Helpers +namespace SharedLibraryCore.Helpers { public class Vector3 { diff --git a/SharedLibrary/Interfaces/IBaseConfiguration.cs b/SharedLibraryCore/Interfaces/IBaseConfiguration.cs similarity index 85% rename from SharedLibrary/Interfaces/IBaseConfiguration.cs rename to SharedLibraryCore/Interfaces/IBaseConfiguration.cs index 49f1701d0..bc685e1c3 100644 --- a/SharedLibrary/Interfaces/IBaseConfiguration.cs +++ b/SharedLibraryCore/Interfaces/IBaseConfiguration.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Interfaces +namespace SharedLibraryCore.Interfaces { public interface IBaseConfiguration { diff --git a/SharedLibrary/Interfaces/IConfigurationHandler.cs b/SharedLibraryCore/Interfaces/IConfigurationHandler.cs similarity index 88% rename from SharedLibrary/Interfaces/IConfigurationHandler.cs rename to SharedLibraryCore/Interfaces/IConfigurationHandler.cs index 4fc8820f3..299c952cc 100644 --- a/SharedLibrary/Interfaces/IConfigurationHandler.cs +++ b/SharedLibraryCore/Interfaces/IConfigurationHandler.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Interfaces +namespace SharedLibraryCore.Interfaces { public interface IConfigurationHandler where T : IBaseConfiguration { diff --git a/SharedLibrary/Interfaces/IEntityService.cs b/SharedLibraryCore/Interfaces/IEntityService.cs similarity index 92% rename from SharedLibrary/Interfaces/IEntityService.cs rename to SharedLibraryCore/Interfaces/IEntityService.cs index 625babc19..642b20960 100644 --- a/SharedLibrary/Interfaces/IEntityService.cs +++ b/SharedLibraryCore/Interfaces/IEntityService.cs @@ -5,7 +5,7 @@ using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Interfaces +namespace SharedLibraryCore.Interfaces { public interface IEntityService { diff --git a/SharedLibrary/Interfaces/ILogger.cs b/SharedLibraryCore/Interfaces/ILogger.cs similarity index 90% rename from SharedLibrary/Interfaces/ILogger.cs rename to SharedLibraryCore/Interfaces/ILogger.cs index 1471a5359..fa04182af 100644 --- a/SharedLibrary/Interfaces/ILogger.cs +++ b/SharedLibraryCore/Interfaces/ILogger.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Interfaces +namespace SharedLibraryCore.Interfaces { public interface ILogger { diff --git a/SharedLibrary/Interfaces/IManager.cs b/SharedLibraryCore/Interfaces/IManager.cs similarity index 75% rename from SharedLibrary/Interfaces/IManager.cs rename to SharedLibraryCore/Interfaces/IManager.cs index 785f9a6ba..c8eeb0ae2 100644 --- a/SharedLibrary/Interfaces/IManager.cs +++ b/SharedLibraryCore/Interfaces/IManager.cs @@ -1,12 +1,10 @@ using System.Collections.Generic; -using SharedLibrary.Objects; -using SharedLibrary.Database.Models; -using SharedLibrary.Services; +using SharedLibraryCore.Objects; +using SharedLibraryCore.Services; using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; -using SharedLibrary.Configuration; +using SharedLibraryCore.Configuration; -namespace SharedLibrary.Interfaces +namespace SharedLibraryCore.Interfaces { public interface IManager { diff --git a/SharedLibrary/Interfaces/IPlugin.cs b/SharedLibraryCore/Interfaces/IPlugin.cs similarity index 90% rename from SharedLibrary/Interfaces/IPlugin.cs rename to SharedLibraryCore/Interfaces/IPlugin.cs index a6b24fcae..04394e160 100644 --- a/SharedLibrary/Interfaces/IPlugin.cs +++ b/SharedLibraryCore/Interfaces/IPlugin.cs @@ -1,7 +1,7 @@ using System; using System.Threading.Tasks; -namespace SharedLibrary.Interfaces +namespace SharedLibraryCore.Interfaces { public interface IPlugin { diff --git a/SharedLibrary/Interfaces/ISerializable.cs b/SharedLibraryCore/Interfaces/ISerializable.cs similarity index 97% rename from SharedLibrary/Interfaces/ISerializable.cs rename to SharedLibraryCore/Interfaces/ISerializable.cs index 1af45f07b..515bc4cab 100644 --- a/SharedLibrary/Interfaces/ISerializable.cs +++ b/SharedLibraryCore/Interfaces/ISerializable.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.IO; -namespace SharedLibrary.Interfaces +namespace SharedLibraryCore.Interfaces { interface ISerializable { diff --git a/SharedLibrary/LibSQLCE/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/SharedLibraryCore/LibSQLCe/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest similarity index 100% rename from SharedLibrary/LibSQLCE/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest rename to SharedLibraryCore/LibSQLCe/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest diff --git a/SharedLibrary/LibSQLCE/x86/Microsoft.VC90.CRT/README_ENU.txt b/SharedLibraryCore/LibSQLCe/x86/Microsoft.VC90.CRT/README_ENU.txt similarity index 100% rename from SharedLibrary/LibSQLCE/x86/Microsoft.VC90.CRT/README_ENU.txt rename to SharedLibraryCore/LibSQLCe/x86/Microsoft.VC90.CRT/README_ENU.txt diff --git a/SharedLibrary/LibSQLCE/x86/Microsoft.VC90.CRT/msvcr90.dll b/SharedLibraryCore/LibSQLCe/x86/Microsoft.VC90.CRT/msvcr90.dll similarity index 100% rename from SharedLibrary/LibSQLCE/x86/Microsoft.VC90.CRT/msvcr90.dll rename to SharedLibraryCore/LibSQLCe/x86/Microsoft.VC90.CRT/msvcr90.dll diff --git a/SharedLibrary/LibSQLCE/x86/sqlceca40.dll b/SharedLibraryCore/LibSQLCe/x86/sqlceca40.dll similarity index 100% rename from SharedLibrary/LibSQLCE/x86/sqlceca40.dll rename to SharedLibraryCore/LibSQLCe/x86/sqlceca40.dll diff --git a/SharedLibrary/LibSQLCE/x86/sqlcecompact40.dll b/SharedLibraryCore/LibSQLCe/x86/sqlcecompact40.dll similarity index 100% rename from SharedLibrary/LibSQLCE/x86/sqlcecompact40.dll rename to SharedLibraryCore/LibSQLCe/x86/sqlcecompact40.dll diff --git a/SharedLibrary/LibSQLCE/x86/sqlceer40EN.dll b/SharedLibraryCore/LibSQLCe/x86/sqlceer40EN.dll similarity index 100% rename from SharedLibrary/LibSQLCE/x86/sqlceer40EN.dll rename to SharedLibraryCore/LibSQLCe/x86/sqlceer40EN.dll diff --git a/SharedLibrary/LibSQLCE/x86/sqlceme40.dll b/SharedLibraryCore/LibSQLCe/x86/sqlceme40.dll similarity index 100% rename from SharedLibrary/LibSQLCE/x86/sqlceme40.dll rename to SharedLibraryCore/LibSQLCe/x86/sqlceme40.dll diff --git a/SharedLibrary/LibSQLCE/x86/sqlceqp40.dll b/SharedLibraryCore/LibSQLCe/x86/sqlceqp40.dll similarity index 100% rename from SharedLibrary/LibSQLCE/x86/sqlceqp40.dll rename to SharedLibraryCore/LibSQLCe/x86/sqlceqp40.dll diff --git a/SharedLibrary/LibSQLCE/x86/sqlcese40.dll b/SharedLibraryCore/LibSQLCe/x86/sqlcese40.dll similarity index 100% rename from SharedLibrary/LibSQLCE/x86/sqlcese40.dll rename to SharedLibraryCore/LibSQLCe/x86/sqlcese40.dll diff --git a/SharedLibrary/Map.cs b/SharedLibraryCore/Map.cs similarity index 88% rename from SharedLibrary/Map.cs rename to SharedLibraryCore/Map.cs index a527a8089..b4c2705d3 100644 --- a/SharedLibrary/Map.cs +++ b/SharedLibraryCore/Map.cs @@ -1,7 +1,7 @@ using System; using System.Reflection; -namespace SharedLibrary +namespace SharedLibraryCore { public class Map { diff --git a/SharedLibrary/Objects/Alias.cs b/SharedLibraryCore/Objects/Alias.cs similarity index 83% rename from SharedLibrary/Objects/Alias.cs rename to SharedLibraryCore/Objects/Alias.cs index c38554876..9a25ed76c 100644 --- a/SharedLibrary/Objects/Alias.cs +++ b/SharedLibraryCore/Objects/Alias.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Objects +namespace SharedLibraryCore.Objects { public class Alias : Database.Models.EFAlias { diff --git a/SharedLibrary/Objects/Penalty.cs b/SharedLibraryCore/Objects/Penalty.cs similarity index 87% rename from SharedLibrary/Objects/Penalty.cs rename to SharedLibraryCore/Objects/Penalty.cs index 42343855f..1ba55dcec 100644 --- a/SharedLibrary/Objects/Penalty.cs +++ b/SharedLibraryCore/Objects/Penalty.cs @@ -1,7 +1,7 @@ using System; -using SharedLibrary; +using SharedLibraryCore; -namespace SharedLibrary.Objects +namespace SharedLibraryCore.Objects { public class Penalty : Database.Models.EFPenalty { diff --git a/SharedLibrary/Objects/Player.cs b/SharedLibraryCore/Objects/Player.cs similarity index 98% rename from SharedLibrary/Objects/Player.cs rename to SharedLibraryCore/Objects/Player.cs index 04ff54d35..8b0574c6c 100644 --- a/SharedLibrary/Objects/Player.cs +++ b/SharedLibraryCore/Objects/Player.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Threading.Tasks; -namespace SharedLibrary.Objects +namespace SharedLibraryCore.Objects { public class Player : Database.Models.EFClient { diff --git a/SharedLibrary/Objects/Report.cs b/SharedLibraryCore/Objects/Report.cs similarity index 92% rename from SharedLibrary/Objects/Report.cs rename to SharedLibraryCore/Objects/Report.cs index e1955dff1..823f4e3df 100644 --- a/SharedLibrary/Objects/Report.cs +++ b/SharedLibraryCore/Objects/Report.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Objects +namespace SharedLibraryCore.Objects { public class Report { diff --git a/SharedLibrary/PluginImporter.cs b/SharedLibraryCore/PluginImporter.cs similarity index 97% rename from SharedLibrary/PluginImporter.cs rename to SharedLibraryCore/PluginImporter.cs index 74daa3d3b..d24ce227b 100644 --- a/SharedLibrary/PluginImporter.cs +++ b/SharedLibraryCore/PluginImporter.cs @@ -2,9 +2,9 @@ using System.IO; using System.Collections.Generic; using System.Reflection; -using SharedLibrary.Interfaces; +using SharedLibraryCore.Interfaces; -namespace SharedLibrary.Plugins +namespace SharedLibraryCore.Plugins { public class PluginImporter { diff --git a/SharedLibrary/RCon/Connection.cs b/SharedLibraryCore/RCon/Connection.cs similarity index 98% rename from SharedLibrary/RCon/Connection.cs rename to SharedLibraryCore/RCon/Connection.cs index 2008953e0..098323c84 100644 --- a/SharedLibrary/RCon/Connection.cs +++ b/SharedLibraryCore/RCon/Connection.cs @@ -1,5 +1,5 @@ -using SharedLibrary.Exceptions; -using SharedLibrary.Interfaces; +using SharedLibraryCore.Exceptions; +using SharedLibraryCore.Interfaces; using System; using System.Linq; using System.Net; @@ -8,7 +8,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -namespace SharedLibrary.RCon +namespace SharedLibraryCore.RCon { class ConnectionState { diff --git a/SharedLibrary/RCon/StaticHelpers.cs b/SharedLibraryCore/RCon/StaticHelpers.cs similarity index 64% rename from SharedLibrary/RCon/StaticHelpers.cs rename to SharedLibraryCore/RCon/StaticHelpers.cs index 3e9edf5ac..0782d0391 100644 --- a/SharedLibrary/RCon/StaticHelpers.cs +++ b/SharedLibraryCore/RCon/StaticHelpers.cs @@ -1,12 +1,6 @@ -using SharedLibrary.Objects; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; +using System; -namespace SharedLibrary.RCon +namespace SharedLibraryCore.RCon { public static class StaticHelpers { diff --git a/SharedLibrary/Server.cs b/SharedLibraryCore/Server.cs similarity index 97% rename from SharedLibrary/Server.cs rename to SharedLibraryCore/Server.cs index 7665a4e18..79f5c53ab 100644 --- a/SharedLibrary/Server.cs +++ b/SharedLibraryCore/Server.cs @@ -1,19 +1,15 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.InteropServices; -using System.Text; using System.Threading; - -using SharedLibrary.RCon; -using SharedLibrary.Commands; using System.Threading.Tasks; -using SharedLibrary.Helpers; -using SharedLibrary.Objects; -using SharedLibrary.Dtos; -using SharedLibrary.Configuration; -namespace SharedLibrary +using SharedLibraryCore.Helpers; +using SharedLibraryCore.Objects; +using SharedLibraryCore.Dtos; +using SharedLibraryCore.Configuration; + +namespace SharedLibraryCore { public abstract class Server { @@ -171,6 +167,7 @@ namespace SharedLibrary } if (CommandResult.Count > 15) CommandResult.RemoveAt(0); + CommandResult.Add(new CommandResponseInfo() { Response = Utilities.StripColors(Message), diff --git a/SharedLibrary/Services/AliasService.cs b/SharedLibraryCore/Services/AliasService.cs similarity index 94% rename from SharedLibrary/Services/AliasService.cs rename to SharedLibraryCore/Services/AliasService.cs index 3b7c23306..34679d5b1 100644 --- a/SharedLibrary/Services/AliasService.cs +++ b/SharedLibraryCore/Services/AliasService.cs @@ -4,13 +4,13 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Linq.Expressions; -using System.Data.Entity; -using SharedLibrary.Interfaces; -using SharedLibrary.Database.Models; -using SharedLibrary.Database; +using SharedLibraryCore.Interfaces; +using SharedLibraryCore.Database.Models; +using SharedLibraryCore.Database; +using Microsoft.EntityFrameworkCore; -namespace SharedLibrary.Services +namespace SharedLibraryCore.Services { public class AliasService : IEntityService { diff --git a/SharedLibrary/Services/ClientService.cs b/SharedLibraryCore/Services/ClientService.cs similarity index 90% rename from SharedLibrary/Services/ClientService.cs rename to SharedLibraryCore/Services/ClientService.cs index 64ba40a0e..291e89dbb 100644 --- a/SharedLibrary/Services/ClientService.cs +++ b/SharedLibraryCore/Services/ClientService.cs @@ -3,14 +3,14 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Data.Entity; -using SharedLibrary.Database; -using SharedLibrary.Database.Models; +using SharedLibraryCore.Database; +using SharedLibraryCore.Database.Models; using System.Linq.Expressions; -using SharedLibrary.Objects; +using SharedLibraryCore.Objects; +using Microsoft.EntityFrameworkCore; -namespace SharedLibrary.Services +namespace SharedLibraryCore.Services { public class ClientService : Interfaces.IEntityService @@ -94,9 +94,6 @@ namespace SharedLibrary.Services { using (var context = new DatabaseContext()) { - context.Configuration.AutoDetectChangesEnabled = false; - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; return context.Clients .AsNoTracking() .Include(c => c.CurrentAlias) @@ -110,8 +107,6 @@ namespace SharedLibrary.Services { using (var context = new DatabaseContext()) { - context.Configuration.LazyLoadingEnabled = false; - //context.Configuration.ProxyCreationEnabled = false; return await new DatabaseContext().Clients .AsNoTracking() .Include(c => c.CurrentAlias) @@ -206,10 +201,6 @@ namespace SharedLibrary.Services { using (var context = new DatabaseContext()) { - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; - context.Configuration.AutoDetectChangesEnabled = false; - var iqMatching = from alias in context.Aliases where alias.IPAddress == clientIP join client in context.Clients @@ -225,10 +216,6 @@ namespace SharedLibrary.Services { using (var context = new DatabaseContext()) { - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; - context.Configuration.AutoDetectChangesEnabled = false; - return await new DatabaseContext().Clients .AsNoTracking() .Include(c => c.CurrentAlias) @@ -241,10 +228,6 @@ namespace SharedLibrary.Services { using (var context = new DatabaseContext()) { - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; - context.Configuration.AutoDetectChangesEnabled = false; - var iqClients = (from alias in context.Aliases .AsNoTracking() where alias.Name @@ -267,10 +250,6 @@ namespace SharedLibrary.Services { using (var context = new DatabaseContext()) { - context.Configuration.LazyLoadingEnabled = false; - context.Configuration.ProxyCreationEnabled = false; - context.Configuration.AutoDetectChangesEnabled = false; - var iqClients = (from alias in context.Aliases .AsNoTracking() where alias.IPAddress == ipAddress diff --git a/SharedLibrary/Services/GenericRepository.cs b/SharedLibraryCore/Services/GenericRepository.cs similarity index 96% rename from SharedLibrary/Services/GenericRepository.cs rename to SharedLibraryCore/Services/GenericRepository.cs index 6ef449355..616366614 100644 --- a/SharedLibrary/Services/GenericRepository.cs +++ b/SharedLibraryCore/Services/GenericRepository.cs @@ -1,13 +1,13 @@ -using SharedLibrary.Database; +using Microsoft.EntityFrameworkCore; +using SharedLibraryCore.Database; using System; using System.Collections.Generic; -using System.Data.Entity; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Services +namespace SharedLibraryCore.Services { // https://stackoverflow.com/questions/43677906/crud-operations-with-entityframework-using-generic-type public class GenericRepository where TEntity : class @@ -74,7 +74,7 @@ namespace SharedLibrary.Services public virtual TEntity Insert(TEntity entity) { - return this.DBSet.Add(entity); + return DBSet.Add(entity).Entity; } public virtual void Update(T entity) where T : class diff --git a/SharedLibrary/Services/MetaService.cs b/SharedLibraryCore/Services/MetaService.cs similarity index 86% rename from SharedLibrary/Services/MetaService.cs rename to SharedLibraryCore/Services/MetaService.cs index c9704c2af..e78793f78 100644 --- a/SharedLibrary/Services/MetaService.cs +++ b/SharedLibraryCore/Services/MetaService.cs @@ -1,11 +1,9 @@ -using SharedLibrary.Dtos; +using SharedLibraryCore.Dtos; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; -namespace SharedLibrary.Services +namespace SharedLibraryCore.Services { public class MetaService { diff --git a/SharedLibrary/Services/PenaltyService.cs b/SharedLibraryCore/Services/PenaltyService.cs similarity index 97% rename from SharedLibrary/Services/PenaltyService.cs rename to SharedLibraryCore/Services/PenaltyService.cs index 77d4686b8..1179350a3 100644 --- a/SharedLibrary/Services/PenaltyService.cs +++ b/SharedLibraryCore/Services/PenaltyService.cs @@ -3,14 +3,14 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Data.Entity; -using SharedLibrary.Database; -using SharedLibrary.Database.Models; +using SharedLibraryCore.Database; +using SharedLibraryCore.Database.Models; using System.Linq.Expressions; -using SharedLibrary.Dtos; +using SharedLibraryCore.Dtos; +using Microsoft.EntityFrameworkCore; -namespace SharedLibrary.Services +namespace SharedLibraryCore.Services { public class PenaltyService : Interfaces.IEntityService { @@ -126,9 +126,9 @@ namespace SharedLibrary.Services { using (var context = new DatabaseContext()) { - context.Configuration.LazyLoadingEnabled = false; + /*context.Configuration.LazyLoadingEnabled = false; context.Configuration.ProxyCreationEnabled = false; - context.Configuration.AutoDetectChangesEnabled = false; + context.Configuration.AutoDetectChangesEnabled = false;*/ if (victim) { diff --git a/SharedLibraryCore/SharedLibraryCore.csproj b/SharedLibraryCore/SharedLibraryCore.csproj new file mode 100644 index 000000000..b7c2c1c6e --- /dev/null +++ b/SharedLibraryCore/SharedLibraryCore.csproj @@ -0,0 +1,46 @@ + + + + Library + netcoreapp2.0 + + + RaidMax.IW4MAdmin.SharedLibraryCore + 2.0.0 + RaidMax + Forever None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SharedLibrary/Utilities.cs b/SharedLibraryCore/Utilities.cs similarity index 98% rename from SharedLibrary/Utilities.cs rename to SharedLibraryCore/Utilities.cs index 521b442db..86dff080d 100644 --- a/SharedLibrary/Utilities.cs +++ b/SharedLibraryCore/Utilities.cs @@ -4,18 +4,17 @@ using System.Text; using System.Text.RegularExpressions; using System.Linq; using System.Collections.Generic; -using System.Management; -using SharedLibrary.Objects; -using static SharedLibrary.Server; +using SharedLibraryCore.Objects; +using static SharedLibraryCore.Server; using System.Reflection; using System.IO; using System.Diagnostics; using System.Threading.Tasks; -using static SharedLibrary.RCon.StaticHelpers; +using static SharedLibraryCore.RCon.StaticHelpers; using System.Runtime.InteropServices; -namespace SharedLibrary +namespace SharedLibraryCore { public static class Utilities { diff --git a/WebfrontCore/Application/API/EventAPI.cs b/WebfrontCore/Application/API/EventAPI.cs index e2259e93a..20305f9ef 100644 --- a/WebfrontCore/Application/API/EventAPI.cs +++ b/WebfrontCore/Application/API/EventAPI.cs @@ -1,4 +1,6 @@ -using SharedLibrary; +using SharedLibraryCore; +using SharedLibraryCore.Dtos; +using SharedLibraryCore.Objects; using System; using System.Collections.Generic; @@ -6,7 +8,7 @@ namespace WebfrontCore.Application.API { class EventAPI { - public static Queue Events = new Queue(); + public static Queue Events = new Queue(); static DateTime LastFlagEvent; static string[] FlaggedMessageContains = { @@ -24,7 +26,7 @@ namespace WebfrontCore.Application.API public static void OnServerEventOccurred(object sender, Event E) { - if (E.Type == Event.GType.Say && E.Origin.Level < SharedLibrary.Objects.Player.Permission.Trusted) + if (E.Type == Event.GType.Say && E.Origin.Level < Player.Permission.Trusted) { bool flaggedMessage = false; foreach (string msg in FlaggedMessageContains) @@ -41,9 +43,9 @@ namespace WebfrontCore.Application.API FlaggedMessageCount = 0; E.Owner.Broadcast("If you suspect someone of ^5CHEATING ^7use the ^5!report ^7command").Wait(); - Events.Enqueue(new SharedLibrary.Dtos.EventInfo( - SharedLibrary.Dtos.EventInfo.EventType.ALERT, - SharedLibrary.Dtos.EventInfo.EventVersion.IW4MAdmin, + Events.Enqueue(new EventInfo( + EventInfo.EventType.ALERT, + EventInfo.EventVersion.IW4MAdmin, "Chat indicates there may be a cheater", "Alert", E.Owner.Hostname, "")); @@ -58,9 +60,9 @@ namespace WebfrontCore.Application.API if (E.Type == Event.GType.Report) { - Events.Enqueue(new SharedLibrary.Dtos.EventInfo( - SharedLibrary.Dtos.EventInfo.EventType.ALERT, - SharedLibrary.Dtos.EventInfo.EventVersion.IW4MAdmin, + Events.Enqueue(new EventInfo( + EventInfo.EventType.ALERT, + EventInfo.EventVersion.IW4MAdmin, $"**{E.Origin.Name}** has reported **{E.Target.Name}** for: {E.Data.Trim()}", E.Target.Name, E.Origin.Name, "")); } diff --git a/WebfrontCore/Application/ConfigurationGenerator.cs b/WebfrontCore/Application/ConfigurationGenerator.cs index 70eab71d0..0e528f6c6 100644 --- a/WebfrontCore/Application/ConfigurationGenerator.cs +++ b/WebfrontCore/Application/ConfigurationGenerator.cs @@ -1,5 +1,5 @@ -using SharedLibrary; -using SharedLibrary.Configuration; +using SharedLibraryCore; +using SharedLibraryCore.Configuration; using System; using System.Collections.Generic; using System.Linq; diff --git a/WebfrontCore/Application/Logger.cs b/WebfrontCore/Application/Logger.cs index 358fa8e76..ac88c1cc7 100644 --- a/WebfrontCore/Application/Logger.cs +++ b/WebfrontCore/Application/Logger.cs @@ -3,7 +3,7 @@ using System.IO; namespace IW4MAdmin { - class Logger : SharedLibrary.Interfaces.ILogger + class Logger : SharedLibraryCore.Interfaces.ILogger { enum LogType { diff --git a/WebfrontCore/Application/Main.cs b/WebfrontCore/Application/Main.cs index 0ce11a5fb..5dd8f0748 100644 --- a/WebfrontCore/Application/Main.cs +++ b/WebfrontCore/Application/Main.cs @@ -1,12 +1,10 @@  using System; -using System.Runtime.InteropServices; -using SharedLibrary; +using SharedLibraryCore; using System.Threading.Tasks; using System.IO; -using SharedLibrary.Objects; +using SharedLibraryCore.Objects; using System.Reflection; -using System.Linq; namespace IW4MAdmin { @@ -31,13 +29,9 @@ namespace IW4MAdmin try { - /*var v1 = SharedLibrary.Helpers.Vector3.Parse("(737, 1117, 268)"); - var v2 = SharedLibrary.Helpers.Vector3.Parse("(1510, 672.98, -228.66)"); - double angleBetween = v1.AngleBetween(v2);*/ CheckDirectories(); ServerManager = ApplicationManager.GetInstance(); - SharedLibrary.Database.Repair.Run(ServerManager.Logger); ServerManager.Init().Wait(); Task.Run(() => ServerManager.Start()); diff --git a/WebfrontCore/Application/Manager.cs b/WebfrontCore/Application/Manager.cs index 3b9c28630..eedaa6c3b 100644 --- a/WebfrontCore/Application/Manager.cs +++ b/WebfrontCore/Application/Manager.cs @@ -5,17 +5,17 @@ using System.Threading; using System.IO; using System.Threading.Tasks; -using SharedLibrary; -using SharedLibrary.Interfaces; -using SharedLibrary.Commands; -using SharedLibrary.Helpers; -using SharedLibrary.Exceptions; -using SharedLibrary.Objects; -using SharedLibrary.Services; +using SharedLibraryCore; +using SharedLibraryCore.Interfaces; +using SharedLibraryCore.Commands; +using SharedLibraryCore.Helpers; +using SharedLibraryCore.Exceptions; +using SharedLibraryCore.Objects; +using SharedLibraryCore.Services; using WebfrontCore.Application.API; using Microsoft.Extensions.Configuration; using WebfrontCore; -using SharedLibrary.Configuration; +using SharedLibraryCore.Configuration; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -136,9 +136,9 @@ namespace IW4MAdmin #region PLUGINS - SharedLibrary.Plugins.PluginImporter.Load(this); + SharedLibraryCore.Plugins.PluginImporter.Load(this); - foreach (var Plugin in SharedLibrary.Plugins.PluginImporter.ActivePlugins) + foreach (var Plugin in SharedLibraryCore.Plugins.PluginImporter.ActivePlugins) { try { @@ -232,7 +232,7 @@ namespace IW4MAdmin Commands.Add(new CKillServer()); Commands.Add(new CSetPassword()); - foreach (Command C in SharedLibrary.Plugins.PluginImporter.ActiveCommands) + foreach (Command C in SharedLibraryCore.Plugins.PluginImporter.ActiveCommands) Commands.Add(C); #endregion diff --git a/WebfrontCore/Application/Server.cs b/WebfrontCore/Application/Server.cs index 1e5906a7e..790762b37 100644 --- a/WebfrontCore/Application/Server.cs +++ b/WebfrontCore/Application/Server.cs @@ -6,13 +6,13 @@ using System.Linq; using System.Threading.Tasks; using System.Text.RegularExpressions; -using SharedLibrary; -using SharedLibrary.Interfaces; -using SharedLibrary.Objects; -using SharedLibrary.Services; -using SharedLibrary.Database.Models; -using SharedLibrary.Dtos; -using SharedLibrary.Configuration; +using SharedLibraryCore; +using SharedLibraryCore.Interfaces; +using SharedLibraryCore.Objects; +using SharedLibraryCore.Services; +using SharedLibraryCore.Database.Models; +using SharedLibraryCore.Dtos; +using SharedLibraryCore.Configuration; using WebfrontCore.Application.Misc; @@ -229,7 +229,7 @@ namespace IW4MAdmin if (C == null) { await E.Origin.Tell("You entered an unknown command"); - throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} entered unknown command \"{CommandString}\""); + throw new SharedLibraryCore.Exceptions.CommandException($"{E.Origin} entered unknown command \"{CommandString}\""); } E.Data = E.Data.RemoveWords(1); @@ -238,14 +238,14 @@ namespace IW4MAdmin if (E.Origin.Level < C.Permission) { await E.Origin.Tell("You do not have access to that command"); - throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} does not have access to \"{C.Name}\""); + throw new SharedLibraryCore.Exceptions.CommandException($"{E.Origin} does not have access to \"{C.Name}\""); } if (Args.Length < (C.RequiredArgumentCount)) { await E.Origin.Tell($"Not enough arguments supplied"); await E.Origin.Tell(C.Syntax); - throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} did not supply enough arguments for \"{C.Name}\""); + throw new SharedLibraryCore.Exceptions.CommandException($"{E.Origin} did not supply enough arguments for \"{C.Name}\""); } if (C.RequiresTarget || Args.Length > 0) @@ -293,7 +293,7 @@ namespace IW4MAdmin if (matchingPlayers.Count > 1) { await E.Origin.Tell("Multiple players match that name"); - throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} had multiple players found for {C.Name}"); + throw new SharedLibraryCore.Exceptions.CommandException($"{E.Origin} had multiple players found for {C.Name}"); } else if (matchingPlayers.Count == 1) { @@ -307,7 +307,7 @@ namespace IW4MAdmin { await E.Origin.Tell($"Not enough arguments supplied!"); await E.Origin.Tell(C.Syntax); - throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} did not supply enough arguments for \"{C.Name}\""); + throw new SharedLibraryCore.Exceptions.CommandException($"{E.Origin} did not supply enough arguments for \"{C.Name}\""); } } } @@ -320,7 +320,7 @@ namespace IW4MAdmin await E.Origin.Tell("Multiple players match that name"); foreach (var p in matchingPlayers) await E.Origin.Tell($"[^3{p.ClientNumber}^7] {p.Name}"); - throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} had multiple players found for {C.Name}"); + throw new SharedLibraryCore.Exceptions.CommandException($"{E.Origin} had multiple players found for {C.Name}"); } else if (matchingPlayers.Count == 1) { @@ -337,7 +337,7 @@ namespace IW4MAdmin { await E.Origin.Tell($"Not enough arguments supplied!"); await E.Origin.Tell(C.Syntax); - throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} did not supply enough arguments for \"{C.Name}\""); + throw new SharedLibraryCore.Exceptions.CommandException($"{E.Origin} did not supply enough arguments for \"{C.Name}\""); } } } @@ -345,7 +345,7 @@ namespace IW4MAdmin if (E.Target == null && C.RequiresTarget) { await E.Origin.Tell("Unable to find specified player."); - throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} specified invalid player for \"{C.Name}\""); + throw new SharedLibraryCore.Exceptions.CommandException($"{E.Origin} specified invalid player for \"{C.Name}\""); } } E.Data = E.Data.Trim(); @@ -360,7 +360,7 @@ namespace IW4MAdmin await ProcessEvent(E); ((ApplicationManager)Manager).ServerEventOccurred(this, E); - foreach (IPlugin P in SharedLibrary.Plugins.PluginImporter.ActivePlugins) + foreach (IPlugin P in SharedLibraryCore.Plugins.PluginImporter.ActivePlugins) { //#if !DEBUG try @@ -394,7 +394,7 @@ namespace IW4MAdmin } // when the server has lost connection - catch (SharedLibrary.Exceptions.NetworkException) + catch (SharedLibraryCore.Exceptions.NetworkException) { Throttled = true; return ClientNum; @@ -456,7 +456,7 @@ namespace IW4MAdmin LastPoll = DateTime.Now; } - catch (SharedLibrary.Exceptions.NetworkException e) + catch (SharedLibraryCore.Exceptions.NetworkException e) { ConnectionErrors++; if (ConnectionErrors == 1) @@ -473,7 +473,7 @@ namespace IW4MAdmin if ((DateTime.Now - tickTime).TotalMilliseconds >= 1000) { - foreach (var Plugin in SharedLibrary.Plugins.PluginImporter.ActivePlugins) + foreach (var Plugin in SharedLibraryCore.Plugins.PluginImporter.ActivePlugins) { if (cts.IsCancellationRequested) break; @@ -483,11 +483,11 @@ namespace IW4MAdmin tickTime = DateTime.Now; } - if ((lastCount - playerCountStart).TotalMinutes >= SharedLibrary.Helpers.PlayerHistory.UpdateInterval) + if ((lastCount - playerCountStart).TotalMinutes >= SharedLibraryCore.Helpers.PlayerHistory.UpdateInterval) { - while (PlayerHistory.Count > ((60 / SharedLibrary.Helpers.PlayerHistory.UpdateInterval) * 12)) // 12 times a hour for 12 hours + while (PlayerHistory.Count > ((60 / SharedLibraryCore.Helpers.PlayerHistory.UpdateInterval) * 12)) // 12 times a hour for 12 hours PlayerHistory.Dequeue(); - PlayerHistory.Enqueue(new SharedLibrary.Helpers.PlayerHistory(ClientNum)); + PlayerHistory.Enqueue(new SharedLibraryCore.Helpers.PlayerHistory(ClientNum)); playerCountStart = DateTime.Now; } @@ -542,7 +542,7 @@ namespace IW4MAdmin l_size = LogFile.Length(); if (!((ApplicationManager)Manager).Running) { - foreach (var plugin in SharedLibrary.Plugins.PluginImporter.ActivePlugins) + foreach (var plugin in SharedLibraryCore.Plugins.PluginImporter.ActivePlugins) await plugin.OnUnloadAsync(); for (int i = 0; i < Players.Count; i++) @@ -551,7 +551,7 @@ namespace IW4MAdmin return true; } //#if !DEBUG - catch (SharedLibrary.Exceptions.NetworkException) + catch (SharedLibraryCore.Exceptions.NetworkException) { Logger.WriteError($"Could not communicate with {IP}:{Port}"); return false; @@ -611,7 +611,7 @@ namespace IW4MAdmin Website = website.Value; } - catch (SharedLibrary.Exceptions.DvarException) + catch (SharedLibraryCore.Exceptions.DvarException) { Website = "this server's website"; } @@ -656,7 +656,7 @@ namespace IW4MAdmin { Logger.WriteError($"Gamelog {logPath} does not exist!"); #if !DEBUG - throw new SharedLibrary.Exceptions.ServerException($"Invalid gamelog file {logPath}"); + throw new SharedLibraryCore.Exceptions.ServerException($"Invalid gamelog file {logPath}"); #endif } else @@ -714,7 +714,7 @@ namespace IW4MAdmin C = await ValidateCommand(E); } - catch (SharedLibrary.Exceptions.CommandException e) + catch (SharedLibraryCore.Exceptions.CommandException e) { Logger.WriteInfo(e.Message); } @@ -963,8 +963,8 @@ namespace IW4MAdmin override public void InitializeTokens() { - Manager.GetMessageTokens().Add(new SharedLibrary.Helpers.MessageToken("TOTALPLAYERS", Manager.GetClientService().GetTotalClientsAsync().Result.ToString)); - Manager.GetMessageTokens().Add(new SharedLibrary.Helpers.MessageToken("VERSION", Program.Version.ToString)); + Manager.GetMessageTokens().Add(new SharedLibraryCore.Helpers.MessageToken("TOTALPLAYERS", Manager.GetClientService().GetTotalClientsAsync().Result.ToString)); + Manager.GetMessageTokens().Add(new SharedLibraryCore.Helpers.MessageToken("VERSION", Program.Version.ToString)); } } } diff --git a/WebfrontCore/BuildScripts/PostBuild.bat b/WebfrontCore/BuildScripts/PostBuild.bat index 2009b3abc..749859ba0 100644 --- a/WebfrontCore/BuildScripts/PostBuild.bat +++ b/WebfrontCore/BuildScripts/PostBuild.bat @@ -5,7 +5,7 @@ set TargetDir=%3 if not exist "%TargetDir%x86" ( echo "Copying SQLCe binaries" md "%TargetDir%x86" - xcopy /y "%SolutionDir%SharedLibrary\LibSQLCe\x86" "%TargetDir%x86\" + xcopy /y "%SolutionDir%SharedLibraryCore\LibSQLCe\x86" "%TargetDir%x86\" ) if not exist "%TargetDir%Plugins" ( diff --git a/WebfrontCore/BuildScripts/PostPublish.bat b/WebfrontCore/BuildScripts/PostPublish.bat index e5486b1ab..5676cf5a9 100644 --- a/WebfrontCore/BuildScripts/PostPublish.bat +++ b/WebfrontCore/BuildScripts/PostPublish.bat @@ -5,5 +5,5 @@ set TargetDir=%3 if "TargetDir" == "*Undefined*" ( echo "Copying extra files to publish dir" xcopy /Y "%SolutionDir%BUILD\Plugins" "%SolutionDir%Publish\Plugins\" - xcopy /Y "%SolutionDir%SharedLibrary\LibSQLCe\x86" "%SolutionDir%Publish\x86\" + xcopy /Y "%SolutionDir%SharedLibraryCore\LibSQLCe\x86" "%SolutionDir%Publish\x86\" ) \ No newline at end of file diff --git a/WebfrontCore/Controllers/API/EventController.cs b/WebfrontCore/Controllers/API/EventController.cs index 182317eb6..f5730aacc 100644 --- a/WebfrontCore/Controllers/API/EventController.cs +++ b/WebfrontCore/Controllers/API/EventController.cs @@ -1,8 +1,7 @@ -using Microsoft.AspNetCore.Mvc; -using System; +using SharedLibraryCore.Dtos; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + using WebfrontCore.Application.API; namespace WebfrontCore.Controllers.API @@ -14,7 +13,7 @@ namespace WebfrontCore.Controllers.API public ActionResult Index() { var events = EventAPI.Events; - var eventsDto = new List(); + var eventsDto = new List(); while (events.Count > 0) eventsDto.Add(events.Dequeue()); return Json(eventsDto); diff --git a/WebfrontCore/Controllers/AccountController.cs b/WebfrontCore/Controllers/AccountController.cs index 9f72b062d..ccc6a448f 100644 --- a/WebfrontCore/Controllers/AccountController.cs +++ b/WebfrontCore/Controllers/AccountController.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication.Cookies; using System.Security.Claims; using System; +using Microsoft.AspNetCore.Authentication; namespace WebfrontCore.Controllers { @@ -19,7 +20,7 @@ namespace WebfrontCore.Controllers try { var client = IW4MAdmin.Program.ServerManager.PrivilegedClients[clientId]; - string[] hashedPassword = await Task.FromResult(SharedLibrary.Helpers.Hashing.Hash(password, client.PasswordSalt)); + string[] hashedPassword = await Task.FromResult(SharedLibraryCore.Helpers.Hashing.Hash(password, client.PasswordSalt)); if (hashedPassword[0] == client.Password) { @@ -32,7 +33,7 @@ namespace WebfrontCore.Controllers var claimsIdentity = new ClaimsIdentity(claims, "login"); var claimsPrinciple = new ClaimsPrincipal(claimsIdentity); - await HttpContext.Authentication.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, claimsPrinciple, new Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties() + await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, claimsPrinciple, new AuthenticationProperties() { AllowRefresh = true, ExpiresUtc = DateTime.UtcNow.AddDays(30), @@ -55,7 +56,7 @@ namespace WebfrontCore.Controllers [HttpGet] public async Task LogoutAsync() { - await HttpContext.Authentication.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); + await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); return RedirectToAction("Index", "Home"); } } diff --git a/WebfrontCore/Controllers/ActionController.cs b/WebfrontCore/Controllers/ActionController.cs index b4886f761..ba4b74763 100644 --- a/WebfrontCore/Controllers/ActionController.cs +++ b/WebfrontCore/Controllers/ActionController.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -using SharedLibrary; +using SharedLibraryCore; using WebfrontCore.ViewModels; namespace WebfrontCore.Controllers diff --git a/WebfrontCore/Controllers/BaseController.cs b/WebfrontCore/Controllers/BaseController.cs index dfe03123f..0529982f2 100644 --- a/WebfrontCore/Controllers/BaseController.cs +++ b/WebfrontCore/Controllers/BaseController.cs @@ -1,9 +1,10 @@ using IW4MAdmin; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; -using SharedLibrary; -using SharedLibrary.Database.Models; -using SharedLibrary.Objects; +using SharedLibraryCore; +using SharedLibraryCore.Database; +using SharedLibraryCore.Database.Models; +using SharedLibraryCore.Objects; using System; using System.Collections.Generic; using System.Linq; @@ -14,9 +15,15 @@ namespace WebfrontCore.Controllers public class BaseController : Controller { protected ApplicationManager Manager; + protected readonly DatabaseContext Context; protected bool Authorized { get; private set; } protected EFClient User { get; private set; } + /* public BaseController(DatabaseContext ctx) + { + Context = ctx; + }*/ + public override void OnActionExecuting(ActionExecutingContext context) { Manager = IW4MAdmin.Program.ServerManager; diff --git a/WebfrontCore/Controllers/ClientController.cs b/WebfrontCore/Controllers/ClientController.cs index 2fe00abd6..0168ed2c3 100644 --- a/WebfrontCore/Controllers/ClientController.cs +++ b/WebfrontCore/Controllers/ClientController.cs @@ -1,7 +1,8 @@ using Microsoft.AspNetCore.Mvc; -using SharedLibrary; -using SharedLibrary.Dtos; -using SharedLibrary.Services; +using SharedLibraryCore; +using SharedLibraryCore.Database; +using SharedLibraryCore.Dtos; +using SharedLibraryCore.Services; using System; using System.Collections.Generic; using System.Linq; @@ -14,6 +15,7 @@ namespace WebfrontCore.Controllers public async Task ProfileAsync(int id) { var client = await Manager.GetClientService().Get(id); + var clientDto = new PlayerInfo() { Name = client.Name, @@ -46,7 +48,7 @@ namespace WebfrontCore.Controllers var administeredPenaltiesMeta = await Manager.GetPenaltyService() .ReadGetClientPenaltiesAsync(client.ClientId, false); - if (Authorized && client.Level > SharedLibrary.Objects.Player.Permission.Trusted) + if (Authorized && client.Level > SharedLibraryCore.Objects.Player.Permission.Trusted) clientDto.Meta.Add(new ProfileMeta() { Key = "Masked", @@ -91,7 +93,7 @@ namespace WebfrontCore.Controllers var admins = (await Manager.GetClientService().GetPrivilegedClients()) .Where(a => a.Active) .OrderByDescending(a => a.Level); - var adminsDict = new Dictionary>(); + var adminsDict = new Dictionary>(); foreach (var admin in admins) { diff --git a/WebfrontCore/Controllers/ConsoleController.cs b/WebfrontCore/Controllers/ConsoleController.cs index c21713993..970cff025 100644 --- a/WebfrontCore/Controllers/ConsoleController.cs +++ b/WebfrontCore/Controllers/ConsoleController.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Mvc; -using SharedLibrary; -using SharedLibrary.Dtos; -using SharedLibrary.Objects; +using SharedLibraryCore; +using SharedLibraryCore.Dtos; +using SharedLibraryCore.Objects; using System; using System.Collections.Generic; using System.Linq; diff --git a/WebfrontCore/Controllers/HomeController.cs b/WebfrontCore/Controllers/HomeController.cs index b08e7a6ab..6a391ffd7 100644 --- a/WebfrontCore/Controllers/HomeController.cs +++ b/WebfrontCore/Controllers/HomeController.cs @@ -4,7 +4,7 @@ using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -using SharedLibrary.Dtos; +using SharedLibraryCore.Dtos; namespace WebfrontCore.Controllers { diff --git a/WebfrontCore/Controllers/PenaltyController.cs b/WebfrontCore/Controllers/PenaltyController.cs index c3836b122..4c1bb8753 100644 --- a/WebfrontCore/Controllers/PenaltyController.cs +++ b/WebfrontCore/Controllers/PenaltyController.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Mvc; -using SharedLibrary; -using SharedLibrary.Database.Models; -using SharedLibrary.Dtos; -using SharedLibrary.Services; +using SharedLibraryCore; +using SharedLibraryCore.Database.Models; +using SharedLibraryCore.Dtos; +using SharedLibraryCore.Services; using System; using System.Collections.Generic; using System.Linq; @@ -30,7 +30,7 @@ namespace WebfrontCore.Controllers public async Task PublicAsync() { var penalties = await (new GenericRepository()) - .FindAsync(p => p.Type == SharedLibrary.Objects.Penalty.PenaltyType.Ban && p.Active); + .FindAsync(p => p.Type == SharedLibraryCore.Objects.Penalty.PenaltyType.Ban && p.Active); var penaltiesDto = penalties.Select(p => new PenaltyInfo() { diff --git a/WebfrontCore/Controllers/ServerController.cs b/WebfrontCore/Controllers/ServerController.cs index 727e533f4..123122fe7 100644 --- a/WebfrontCore/Controllers/ServerController.cs +++ b/WebfrontCore/Controllers/ServerController.cs @@ -1,5 +1,5 @@ using Microsoft.AspNetCore.Mvc; -using SharedLibrary.Dtos; +using SharedLibraryCore.Dtos; using System; using System.Collections.Generic; using System.Linq; diff --git a/WebfrontCore/Program.cs b/WebfrontCore/Program.cs index 88ff0ae53..ba50af8df 100644 --- a/WebfrontCore/Program.cs +++ b/WebfrontCore/Program.cs @@ -1,7 +1,5 @@ -using System; -using System.IO; +using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; namespace WebfrontCore { @@ -9,26 +7,14 @@ namespace WebfrontCore { public static void Main(string[] args) { - var config = new ConfigurationBuilder() - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .Build(); - - var host = new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .UseUrls(config["Web:Address"]) - .Build(); - - if (!SharedLibrary.Utilities.IsRunningOnMono()) - { - host.Run(); - } - - else - { - Console.ReadLine(); - } + BuildWebHost(args).Run(); } + + public static IWebHost BuildWebHost(string[] args) => + new WebHostBuilder() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseKestrel() + .UseStartup() + .Build(); } } diff --git a/WebfrontCore/Properties/PublishProfiles/FolderProfile1.pubxml b/WebfrontCore/Properties/PublishProfiles/FolderProfile1.pubxml deleted file mode 100644 index 416719679..000000000 --- a/WebfrontCore/Properties/PublishProfiles/FolderProfile1.pubxml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - FileSystem - FileSystem - Debug - x86 - - True - False - 65340d7d-5831-406c-acad-b13ba634bde2 - bin\Debug\PublishOutput - True - net452 - win7-x86 - - \ No newline at end of file diff --git a/WebfrontCore/Properties/PublishProfiles/Release - S.pubxml b/WebfrontCore/Properties/PublishProfiles/Release - S.pubxml deleted file mode 100644 index 5f7e9d2c2..000000000 --- a/WebfrontCore/Properties/PublishProfiles/Release - S.pubxml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - FileSystem - FileSystem - Release - Any CPU - - True - False - 65340d7d-5831-406c-acad-b13ba634bde2 - C:\Projects\IW4M-Admin\Publish - True - net452 - win7-x86 - - \ No newline at end of file diff --git a/WebfrontCore/Properties/PublishProfiles/USBPublish.pubxml b/WebfrontCore/Properties/PublishProfiles/USBPublish.pubxml deleted file mode 100644 index 5f1ad3a00..000000000 --- a/WebfrontCore/Properties/PublishProfiles/USBPublish.pubxml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - FileSystem - FileSystem - Release - x86 - - True - False - 65340d7d-5831-406c-acad-b13ba634bde2 - D:\IW4M-Admin\Publish - True - net452 - win7-x86 - - \ No newline at end of file diff --git a/WebfrontCore/Properties/launchSettings.json b/WebfrontCore/Properties/launchSettings.json index b013ebeee..b347f5f88 100644 --- a/WebfrontCore/Properties/launchSettings.json +++ b/WebfrontCore/Properties/launchSettings.json @@ -3,7 +3,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:38815/", + "applicationUrl": "http://localhost:61369/", "sslPort": 0 } }, @@ -15,13 +15,13 @@ "ASPNETCORE_ENVIRONMENT": "Development" } }, - "WebfrontCore": { + "WebfrontCore2": { "commandName": "Project", "launchBrowser": true, - "launchUrl": "http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:61370/" } } -} \ No newline at end of file +} diff --git a/WebfrontCore/Startup.cs b/WebfrontCore/Startup.cs index 57968f545..6466a1a76 100644 --- a/WebfrontCore/Startup.cs +++ b/WebfrontCore/Startup.cs @@ -1,15 +1,21 @@ -using System; -using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using SharedLibraryCore.Database; +using System; +using System.IO; namespace WebfrontCore { public class Startup { + private IHostingEnvironment _appHost; + public static IConfigurationRoot Configuration { get; private set; } + public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() @@ -18,28 +24,34 @@ namespace WebfrontCore .AddEnvironmentVariables(); Configuration = builder.Build(); - // fixme: this is really really terrible - if (!SharedLibrary.Utilities.IsRunningOnMono()) - { - SharedLibrary.Database.DatabaseContext.ConnectionString = Configuration["ConnectionStrings:WindowsConnection"]; - } - else - { - SharedLibrary.Database.DatabaseContext.ConnectionString = Configuration["ConnectionStrings:LinuxConnection"]; - } + _appHost = env; - if (!IW4MAdmin.Program.Start()) - Environment.Exit(-1); + using (var db = new DatabaseContext()) + { + db.Database.EnsureCreated(); + db.Database.Migrate(); + new ContextSeed(db).Seed().Wait(); + } } - public static IConfigurationRoot Configuration { get; private set; } - // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // Add framework services. services.AddMvc(); + services.AddEntityFrameworkSqlite() + .AddDbContext(); + + services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) + .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options => + { + options.AccessDeniedPath = "/"; + options.LoginPath = "/"; + }); + + if (!IW4MAdmin.Program.Start()) + Environment.Exit(-1); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -59,16 +71,7 @@ namespace WebfrontCore } app.UseStaticFiles(); - - app.UseCookieAuthentication(new CookieAuthenticationOptions() - { - AccessDeniedPath = "/", - AuthenticationScheme = CookieAuthenticationDefaults.AuthenticationScheme, - AutomaticAuthenticate = true, - AutomaticChallenge = true, - LoginPath = "/", - ExpireTimeSpan = TimeSpan.FromDays(30), - }); + app.UseAuthentication(); app.UseMvc(routes => { @@ -76,7 +79,6 @@ namespace WebfrontCore name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); - } } } diff --git a/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs b/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs index 4411bc687..275fb3d9a 100644 --- a/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs +++ b/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -using SharedLibrary; -using SharedLibrary.Dtos; +using SharedLibraryCore; +using SharedLibraryCore.Dtos; using System; using System.Collections.Generic; using System.Linq; @@ -40,7 +40,7 @@ namespace WebfrontCore.ViewComponents Type = p.Type.ToString(), TimePunished = Utilities.GetTimePassed(p.When, false), TimeRemaining = DateTime.UtcNow > p.Expires ? "" : Utilities.TimeSpanText(p.Expires - DateTime.UtcNow), - Sensitive = p.Type == SharedLibrary.Objects.Penalty.PenaltyType.Flag + Sensitive = p.Type == SharedLibraryCore.Objects.Penalty.PenaltyType.Flag }); penaltiesDto = authed ? penaltiesDto.ToList() : penaltiesDto.Where(p => !p.Sensitive).ToList(); diff --git a/WebfrontCore/ViewComponents/ServerListViewComponent.cs b/WebfrontCore/ViewComponents/ServerListViewComponent.cs index e14e5d30e..3111a4678 100644 --- a/WebfrontCore/ViewComponents/ServerListViewComponent.cs +++ b/WebfrontCore/ViewComponents/ServerListViewComponent.cs @@ -1,5 +1,5 @@ using Microsoft.AspNetCore.Mvc; -using SharedLibrary.Dtos; +using SharedLibraryCore.Dtos; using System; using System.Collections.Generic; using System.Linq; diff --git a/WebfrontCore/Views/Client/Find/Index.cshtml b/WebfrontCore/Views/Client/Find/Index.cshtml index 549fd27f8..2c6f8039c 100644 --- a/WebfrontCore/Views/Client/Find/Index.cshtml +++ b/WebfrontCore/Views/Client/Find/Index.cshtml @@ -1,4 +1,4 @@ -@model List +@model List

@ViewBag.Title

diff --git a/WebfrontCore/Views/Client/Privileged/Index.cshtml b/WebfrontCore/Views/Client/Privileged/Index.cshtml index 317cffa33..f6279fc9b 100644 --- a/WebfrontCore/Views/Client/Privileged/Index.cshtml +++ b/WebfrontCore/Views/Client/Privileged/Index.cshtml @@ -1,4 +1,4 @@ -@model Dictionary> +@model Dictionary>

@ViewBag.Title

diff --git a/WebfrontCore/Views/Client/Profile/Index.cshtml b/WebfrontCore/Views/Client/Profile/Index.cshtml index de40b22bd..c40e2e655 100644 --- a/WebfrontCore/Views/Client/Profile/Index.cshtml +++ b/WebfrontCore/Views/Client/Profile/Index.cshtml @@ -1,4 +1,4 @@ -@model SharedLibrary.Dtos.PlayerInfo +@model SharedLibraryCore.Dtos.PlayerInfo @{ string match = System.Text.RegularExpressions.Regex.Match(Model.Name.ToUpper(), "[A-Z]").Value; string shortCode = match == string.Empty ? "?" : match; @@ -21,13 +21,13 @@
@if (Model.LevelInt < (int)ViewBag.User.Level && - (SharedLibrary.Objects.Player.Permission)Model.LevelInt != SharedLibrary.Objects.Player.Permission.Banned) + (SharedLibraryCore.Objects.Player.Permission)Model.LevelInt != SharedLibraryCore.Objects.Player.Permission.Banned) { } @if (Model.LevelInt < (int)ViewBag.User.Level && - (SharedLibrary.Objects.Player.Permission)Model.LevelInt == SharedLibrary.Objects.Player.Permission.Banned) + (SharedLibraryCore.Objects.Player.Permission)Model.LevelInt == SharedLibraryCore.Objects.Player.Permission.Banned) { } diff --git a/WebfrontCore/Views/Console/Index.cshtml b/WebfrontCore/Views/Console/Index.cshtml index 63d68a853..51fe50899 100644 --- a/WebfrontCore/Views/Console/Index.cshtml +++ b/WebfrontCore/Views/Console/Index.cshtml @@ -1,4 +1,4 @@ -@model IEnumerable +@model IEnumerable
diff --git a/WebfrontCore/Views/Console/_Response.cshtml b/WebfrontCore/Views/Console/_Response.cshtml index c3a94b4dc..cd7c7e649 100644 --- a/WebfrontCore/Views/Console/_Response.cshtml +++ b/WebfrontCore/Views/Console/_Response.cshtml @@ -1,4 +1,4 @@ -@model List +@model List @{ Layout = null; } diff --git a/WebfrontCore/Views/Penalty/_Penalty.cshtml b/WebfrontCore/Views/Penalty/_Penalty.cshtml index 213ba3ce3..d429999a8 100644 --- a/WebfrontCore/Views/Penalty/_Penalty.cshtml +++ b/WebfrontCore/Views/Penalty/_Penalty.cshtml @@ -2,7 +2,7 @@ Layout = null; } -@model SharedLibrary.Dtos.PenaltyInfo +@model SharedLibraryCore.Dtos.PenaltyInfo Name diff --git a/WebfrontCore/Views/Server/_ClientActivity.cshtml b/WebfrontCore/Views/Server/_ClientActivity.cshtml index a0c3bf811..464d92847 100644 --- a/WebfrontCore/Views/Server/_ClientActivity.cshtml +++ b/WebfrontCore/Views/Server/_ClientActivity.cshtml @@ -1,4 +1,4 @@ -@model SharedLibrary.Dtos.ServerInfo +@model SharedLibraryCore.Dtos.ServerInfo @{ Layout = null; diff --git a/WebfrontCore/Views/Server/_Server.cshtml b/WebfrontCore/Views/Server/_Server.cshtml index 0d0e373ae..1a2ea4351 100644 --- a/WebfrontCore/Views/Server/_Server.cshtml +++ b/WebfrontCore/Views/Server/_Server.cshtml @@ -1,5 +1,5 @@  -@model SharedLibrary.Dtos.ServerInfo +@model SharedLibraryCore.Dtos.ServerInfo @{ Layout = null; diff --git a/WebfrontCore/Views/Shared/Components/PenaltyList/_List.cshtml b/WebfrontCore/Views/Shared/Components/PenaltyList/_List.cshtml index 59b1837e5..70b50c4d3 100644 --- a/WebfrontCore/Views/Shared/Components/PenaltyList/_List.cshtml +++ b/WebfrontCore/Views/Shared/Components/PenaltyList/_List.cshtml @@ -1,7 +1,7 @@ @{ Layout = null; } -@model List +@model List @{ foreach (var penalty in Model) diff --git a/WebfrontCore/Views/Shared/Components/ServerList/_List.cshtml b/WebfrontCore/Views/Shared/Components/ServerList/_List.cshtml index 5360684aa..e31f16f35 100644 --- a/WebfrontCore/Views/Shared/Components/ServerList/_List.cshtml +++ b/WebfrontCore/Views/Shared/Components/ServerList/_List.cshtml @@ -1,7 +1,7 @@ @{ Layout = null; } -@model IEnumerable +@model IEnumerable @{ foreach (var s in Model) diff --git a/WebfrontCore/WebfrontCore.csproj b/WebfrontCore/WebfrontCore.csproj index 1da35da94..1f9267d2e 100644 --- a/WebfrontCore/WebfrontCore.csproj +++ b/WebfrontCore/WebfrontCore.csproj @@ -1,32 +1,19 @@ - + - net452 - true - IW4MAdmin - Exe + netcoreapp2.0 + 2.6 RaidMax.IW4MAdmin.WebfrontCore - AnyCPU;x86 - wwwroot\favicon.ico - false - 1.6.0 + 2.0.0 RaidMax - ForeverNone + Forever None + IW4MAdmin + IW4MAdmin is a complete server administration tool for IW4x and most Call of Duty® dedicated server 2018 https://github.com/RaidMax/IW4M-Admin/blob/master/LICENSE - Complete administration tool designed for IW4x and compatible with most Call Of Duty® dedicated servers - https://raidmax.org/IW4Madmin/ - https://raidmax.org/IW4Madmin/img/iw4adminicon-3.png + https://raidmax.org/IW4MAdmin https://github.com/RaidMax/IW4M-Admin - en - - - - x86 - - - - bin\x86\Debug\ + https://raidmax.org/IW4MAdmin/img/iw4adminicon-3.png @@ -36,39 +23,8 @@ - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -78,9 +34,11 @@ - - true - + + + + + @@ -92,16 +50,4 @@ - - - - - - - - - - - - diff --git a/WebfrontCore2/BuildScripts/PostBuild.bat b/WebfrontCore2/BuildScripts/PostBuild.bat deleted file mode 100644 index 2009b3abc..000000000 --- a/WebfrontCore2/BuildScripts/PostBuild.bat +++ /dev/null @@ -1,16 +0,0 @@ -set SolutionDir=%1 -set ProjectDir=%2 -set TargetDir=%3 - -if not exist "%TargetDir%x86" ( - echo "Copying SQLCe binaries" - md "%TargetDir%x86" - xcopy /y "%SolutionDir%SharedLibrary\LibSQLCe\x86" "%TargetDir%x86\" -) - -if not exist "%TargetDir%Plugins" ( - echo "Making plugin dir" - md "%TargetDir%Plugins" -) - -xcopy /y "%SolutionDir%Build\Plugins" "%TargetDir%Plugins\" \ No newline at end of file diff --git a/WebfrontCore2/BuildScripts/PostPublish.bat b/WebfrontCore2/BuildScripts/PostPublish.bat deleted file mode 100644 index e5486b1ab..000000000 --- a/WebfrontCore2/BuildScripts/PostPublish.bat +++ /dev/null @@ -1,9 +0,0 @@ -set SolutionDir=%1 -set ProjectDir=%2 -set TargetDir=%3 - -if "TargetDir" == "*Undefined*" ( - echo "Copying extra files to publish dir" - xcopy /Y "%SolutionDir%BUILD\Plugins" "%SolutionDir%Publish\Plugins\" - xcopy /Y "%SolutionDir%SharedLibrary\LibSQLCe\x86" "%SolutionDir%Publish\x86\" -) \ No newline at end of file diff --git a/WebfrontCore2/BuildScripts/PreBuild.bat b/WebfrontCore2/BuildScripts/PreBuild.bat deleted file mode 100644 index fbde9f9b5..000000000 --- a/WebfrontCore2/BuildScripts/PreBuild.bat +++ /dev/null @@ -1,3 +0,0 @@ -set SolutionDir=%1 -set ProjectDir=%2 -set TargetDir=%3