diff --git a/.env.local b/.env.local new file mode 100644 index 000000000..20a3f9da2 --- /dev/null +++ b/.env.local @@ -0,0 +1,16 @@ +# Database settings +POSTGRES_USER="openperpetuum" +POSTGRES_PASSWORD="openperpetuum" +POSTGRES_DB="openperpetuum" +PGDATA="/var/lib/postgres/data" + +# Port mapping setting +# Here you can modify the default values +# Only the SERVER and the ASSET ports are required +# The SERVER port is used to allow access to the server when you connect your client +# The ASSET port is used by the client to fetch assets when connecting to the server +# The DB port is optional, used for debugging + +SERVER_PORT=17700 +ASSET_PORT=17701 +DB_PORT=17702 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6740e4f0a..0556a8b0c 100644 --- a/.gitignore +++ b/.gitignore @@ -259,3 +259,5 @@ paket-files/ __pycache__/ *.pyc /PerpetuumTests +/src/Perpetuum.ServerService/Properties/Resources.Designer.cs +/src/Perpetuum.ServerService/Properties/Settings.Designer.cs diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..9859a7c6a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "db"] + path = db + url = git@github.com:OpenPerpetuum/OPDB.git +[submodule "asset"] + path = asset + url = git@github.com:OpenPerpetuum/OPResource.git diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..37bd9c043 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ + +local_dockerfile="docker-compose-local.yml" +compose="docker compose -f '$(local_dockerfile)'" "$@" + + +help: + echo Commands to compile, deploy, log services used to run an OpenPerpetuum server (used for local development) + +compose-up: + ./script/compose.sh up -d --build --remove-orphans --wait + +compose-down: + ./script/compose.sh down --volumes + +compose-restart: compose-down compose-up + +log-asset: + ./script/compose.sh logs asset -f + +log-db: + ./script/compose.sh logs db -f + +log-server: + ./script/compose.sh logs server -f + +phonyx: help compose-start compose-stop compose-down log-asset log-db log-server diff --git a/Perpetuum.sln b/Perpetuum.sln index bab491d9c..7312713dd 100644 --- a/Perpetuum.sln +++ b/Perpetuum.sln @@ -1,32 +1,24 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2010 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34607.119 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perpetuum", "src\Perpetuum\Perpetuum.csproj", "{8587A597-848E-497F-8036-3B6F8047EC45}" - ProjectSection(ProjectDependencies) = postProject - {E322BF83-76B8-4395-9FF2-26DF13F6816C} = {E322BF83-76B8-4395-9FF2-26DF13F6816C} - EndProjectSection +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perpetuum", "src\Perpetuum\Perpetuum.csproj", "{8587A597-848E-497F-8036-3B6F8047EC45}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perpetuum.ExportedTypes", "src\Perpetuum.ExportedTypes\Perpetuum.ExportedTypes.csproj", "{E322BF83-76B8-4395-9FF2-26DF13F6816C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perpetuum.ExportedTypes", "src\Perpetuum.ExportedTypes\Perpetuum.ExportedTypes.csproj", "{E322BF83-76B8-4395-9FF2-26DF13F6816C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perpetuum.Server", "src\Perpetuum.Server\Perpetuum.Server.csproj", "{8A6EF898-EF64-4159-96D1-6C742122342F}" - ProjectSection(ProjectDependencies) = postProject - {E322BF83-76B8-4395-9FF2-26DF13F6816C} = {E322BF83-76B8-4395-9FF2-26DF13F6816C} - {8587A597-848E-497F-8036-3B6F8047EC45} = {8587A597-848E-497F-8036-3B6F8047EC45} - EndProjectSection +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perpetuum.Server", "src\Perpetuum.Server\Perpetuum.Server.csproj", "{8A6EF898-EF64-4159-96D1-6C742122342F}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F39303D9-9F20-4463-AF88-C70D0DA29E07}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perpetuum.RequestHandlers", "src\Perpetuum.RequestHandlers\Perpetuum.RequestHandlers.csproj", "{F69F19CA-DF42-420E-BC21-2ADD28C50A0C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perpetuum.RequestHandlers", "src\Perpetuum.RequestHandlers\Perpetuum.RequestHandlers.csproj", "{F69F19CA-DF42-420E-BC21-2ADD28C50A0C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{7DE0E6B2-17B2-4988-9A45-BC3FA49AB223}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perpetuum.AdminTool", "src\Perpetuum.AdminTool\Perpetuum.AdminTool.csproj", "{4736AD6B-6565-4EEF-ABCB-19454342A986}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perpetuum.AdminTool", "src\Perpetuum.AdminTool\Perpetuum.AdminTool.csproj", "{4736AD6B-6565-4EEF-ABCB-19454342A986}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perpetuum.Bootstrapper", "src\Perpetuum.Bootstrapper\Perpetuum.Bootstrapper.csproj", "{E113962C-AD5D-4F17-8D08-656221CBD2D4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perpetuum.Bootstrapper", "src\Perpetuum.Bootstrapper\Perpetuum.Bootstrapper.csproj", "{E113962C-AD5D-4F17-8D08-656221CBD2D4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perpetuum.ServerService", "src\Perpetuum.ServerService\Perpetuum.ServerService.csproj", "{9C77CE95-825E-4BB1-9129-66835BDB8C96}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perpetuum.ServerService", "src\Perpetuum.ServerService\Perpetuum.ServerService.csproj", "{9C77CE95-825E-4BB1-9129-66835BDB8C96}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -62,18 +54,18 @@ Global {E322BF83-76B8-4395-9FF2-26DF13F6816C}.Release|x64.Build.0 = Release|Any CPU {E322BF83-76B8-4395-9FF2-26DF13F6816C}.Release|x86.ActiveCfg = Release|Any CPU {E322BF83-76B8-4395-9FF2-26DF13F6816C}.Release|x86.Build.0 = Release|Any CPU - {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|Any CPU.ActiveCfg = Debug|x64 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|Any CPU.Build.0 = Debug|x64 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|x64.ActiveCfg = Debug|x64 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|x64.Build.0 = Debug|x64 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|x86.ActiveCfg = Debug|x86 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|x86.Build.0 = Debug|x86 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|Any CPU.ActiveCfg = Release|x64 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|Any CPU.Build.0 = Release|x64 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|x64.ActiveCfg = Release|x64 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|x64.Build.0 = Release|x64 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|x86.ActiveCfg = Release|x86 - {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|x86.Build.0 = Release|x86 + {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|x64.ActiveCfg = Debug|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|x64.Build.0 = Debug|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|x86.ActiveCfg = Debug|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Debug|x86.Build.0 = Debug|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|Any CPU.Build.0 = Release|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|x64.ActiveCfg = Release|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|x64.Build.0 = Release|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|x86.ActiveCfg = Release|Any CPU + {8A6EF898-EF64-4159-96D1-6C742122342F}.Release|x86.Build.0 = Release|Any CPU {F69F19CA-DF42-420E-BC21-2ADD28C50A0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F69F19CA-DF42-420E-BC21-2ADD28C50A0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {F69F19CA-DF42-420E-BC21-2ADD28C50A0C}.Debug|x64.ActiveCfg = Debug|Any CPU diff --git a/docker-compose-local.yml b/docker-compose-local.yml new file mode 100644 index 000000000..ce81ee8f3 --- /dev/null +++ b/docker-compose-local.yml @@ -0,0 +1,57 @@ +networks: + dev_env: + driver: bridge + +volumes: + asset: + db: + server: + +services: + asset: + build: + context: ./asset + dockerfile: ../docker/Dockerfile.asset.dev + restart: unless-stopped + networks: + - dev_env + volumes: + - .:/asset + env_file: + - .env.local + ports: + - ${ASSET_PORT}:80 + + # TODO switch back to use mssql to keep refactor small + # db: + # image: postgres:15.2-alpine + # restart: unless-stopped + # networks: + # - dev_env + # command: postgres -c 'max_connections=1000' + # volumes: + # - db:/var/lib/postgresql/data + # ports: + # - ${DB_PORT}:5432 + # env_file: + # - .env.local + # environment: + # PGDATA: /var/lib/postgresql/data + + ## TODO: plan for migration service + + server: + build: + context: . + dockerfile: ./docker/Dockerfile.server.dev + restart: unless-stopped + volumes: + - .:/server + - ./data:/data + ports: + - ${SERVER_PORT}:17700 + env_file: + - .env.local + depends_on: + - asset + # - db diff --git a/docker/Dockerfile.asset.dev b/docker/Dockerfile.asset.dev new file mode 100644 index 000000000..2179767e7 --- /dev/null +++ b/docker/Dockerfile.asset.dev @@ -0,0 +1,11 @@ +# Development dockerfile for the asset + +FROM node:10-alpine + +WORKDIR /var/www/OPResource + +COPY . . + +RUN npm install . + +CMD ["node", "index.js"] \ No newline at end of file diff --git a/docker/Dockerfile.server.dev b/docker/Dockerfile.server.dev new file mode 100644 index 000000000..77788e568 --- /dev/null +++ b/docker/Dockerfile.server.dev @@ -0,0 +1,33 @@ +# Development dockerfile for PerpetuumServer + +FROM mcr.microsoft.com/dotnet/sdk:8.0 + +WORKDIR /server + +# RUN apt-get update && apt-get install -y gnupg + +# RUN gpg --homedir /tmp --no-default-keyring \ +# --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg \ +# --keyserver hkp://keyserver.ubuntu.com:80 \ +# --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF + +# RUN apt-get update + +# RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates wget mono-complete dotnet-sdk-8.0 + +# RUN wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -O nuget.exe + +# TODO, use different FROM starting next line + +COPY . . + +# RUN mono nuget.exe restore +RUN dotnet restore + + +# RUN msbuild -m -v:quiet Perpetuum.sln -p:Configuration=Release + +RUN dotnet build Perpetuum.sln -p:Configuration=Release + +RUN echo 1 | dotnet ./bin/x64/Release/Perpetuum.Server/Perpetuum.Server.exe /data + diff --git a/script/compose.sh b/script/compose.sh new file mode 100755 index 000000000..c2a6c92f5 --- /dev/null +++ b/script/compose.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eux + +docker compose -f "docker-compose-local.yml" --env-file ".env.local" "$@" diff --git a/src/Perpetuum.AdminTool/App.config b/src/Perpetuum.AdminTool/App.config index 731f6de6c..4bfa00561 100644 --- a/src/Perpetuum.AdminTool/App.config +++ b/src/Perpetuum.AdminTool/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/src/Perpetuum.AdminTool/Perpetuum.AdminTool.csproj b/src/Perpetuum.AdminTool/Perpetuum.AdminTool.csproj index 7ebcfe590..1d3895dc6 100644 --- a/src/Perpetuum.AdminTool/Perpetuum.AdminTool.csproj +++ b/src/Perpetuum.AdminTool/Perpetuum.AdminTool.csproj @@ -1,39 +1,19 @@ - - - + - Debug - AnyCPU - {4736AD6B-6565-4EEF-ABCB-19454342A986} + net8.0-windows WinExe - Perpetuum.AdminTool - Perpetuum.AdminTool - v4.6.1 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true + false + true + true + true x64 - true - full - false ..\..\bin\x64\Debug\Perpetuum.AdminTool\ - DEBUG;TRACE - prompt - 4 - false x64 - pdbonly - true ..\..\bin\x64\Release\Perpetuum.AdminTool\ - TRACE - prompt - 4 - false @@ -43,171 +23,16 @@ icon.ico - - ..\..\packages\Autofac.4.6.1\lib\net45\Autofac.dll - - - ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - - - 4.0 - - - - + + - - MSBuild:Compile - Designer - - - AccountCreateControl.xaml - - - AccountEditControl.xaml - - - - - - AccountsPage.xaml - - - - - - - - LedControl.xaml - - - LocalServerPage.xaml - - - - - - LoggerControl.xaml - - - AuthPage.xaml - - - - - - ServerInfoPage.xaml - - - StatusTextControl.xaml - - - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - MainWindow.xaml - Code - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - {e322bf83-76b8-4395-9ff2-26df13f6816c} - Perpetuum.ExportedTypes - - - {8587a597-848e-497f-8036-3b6f8047ec45} - Perpetuum - + - + + + + - \ No newline at end of file diff --git a/src/Perpetuum.AdminTool/Properties/AssemblyInfo.cs b/src/Perpetuum.AdminTool/Properties/AssemblyInfo.cs deleted file mode 100644 index 09c9b793c..000000000 --- a/src/Perpetuum.AdminTool/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; -using System.Windows; - -// 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("Perpetuum.AdminTool")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Perpetuum.AdminTool")] -[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)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// 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/src/Perpetuum.AdminTool/Properties/Resources.Designer.cs b/src/Perpetuum.AdminTool/Properties/Resources.Designer.cs index 462013854..9b1981e08 100644 --- a/src/Perpetuum.AdminTool/Properties/Resources.Designer.cs +++ b/src/Perpetuum.AdminTool/Properties/Resources.Designer.cs @@ -1,69 +1,61 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Ce code a été généré par un outil. +// Version du runtime :4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si +// le code est régénéré. // //------------------------------------------------------------------------------ -namespace Perpetuum.AdminTool.Properties -{ - - +namespace Perpetuum.AdminTool.Properties { + using System; + + /// - /// A strongly-typed resource class, for looking up localized strings, etc. + /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder + // à l'aide d'un outil, tel que ResGen ou Visual Studio. + // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen + // avec l'option /str ou régénérez votre projet VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// - /// Returns the cached ResourceManager instance used by this class. + /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Perpetuum.AdminTool.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. + /// Remplace la propriété CurrentUICulture du thread actuel pour toutes + /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/src/Perpetuum.AdminTool/Properties/Settings.Designer.cs b/src/Perpetuum.AdminTool/Properties/Settings.Designer.cs index 65ecd68a2..2a3d5ef45 100644 --- a/src/Perpetuum.AdminTool/Properties/Settings.Designer.cs +++ b/src/Perpetuum.AdminTool/Properties/Settings.Designer.cs @@ -1,28 +1,24 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Ce code a été généré par un outil. +// Version du runtime :4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si +// le code est régénéré. // //------------------------------------------------------------------------------ -namespace Perpetuum.AdminTool.Properties -{ - - +namespace Perpetuum.AdminTool.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/src/Perpetuum.AdminTool/packages.config b/src/Perpetuum.AdminTool/packages.config deleted file mode 100644 index 4e5036580..000000000 --- a/src/Perpetuum.AdminTool/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Perpetuum.Bootstrapper/Perpetuum.Bootstrapper.csproj b/src/Perpetuum.Bootstrapper/Perpetuum.Bootstrapper.csproj index 687f24d99..90607edf3 100644 --- a/src/Perpetuum.Bootstrapper/Perpetuum.Bootstrapper.csproj +++ b/src/Perpetuum.Bootstrapper/Perpetuum.Bootstrapper.csproj @@ -1,90 +1,35 @@ - - - + - Debug - AnyCPU - {E113962C-AD5D-4F17-8D08-656221CBD2D4} + net8.0 Library - Properties - Perpetuum.Bootstrapper - Perpetuum.Bootstrapper - v4.6.1 - 512 - + false + Perpetuum.Bootstrapper.PerpetuumBootstrapper + Perpetuum.Bootstrapper.PerpetuumBootstrapper + Copyright © 2017 + 1.0.0.0 + 1.0.0.0 - true - full - false ..\..\bin\x64\Debug\Perpetuum.Bootstrapper\ - DEBUG;TRACE - prompt - 4 x64 - pdbonly - true ..\..\bin\x64\Release\Perpetuum.Bootstrapper\ - TRACE - prompt - 4 x64 - - ..\..\packages\Autofac.4.6.1\lib\net45\Autofac.dll - - - ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - ..\..\packages\Open.NAT.2.1.0.0\lib\net45\Open.Nat.dll - - - - ..\..\packages\System.Collections.Immutable.1.4.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - - - - - ..\..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll - - - - - - + + + - - + + + + - - {e322bf83-76b8-4395-9ff2-26df13f6816c} - Perpetuum.ExportedTypes - - - {f69f19ca-df42-420e-bc21-2add28c50a0c} - Perpetuum.RequestHandlers - - - {8587a597-848e-497f-8036-3b6f8047ec45} - Perpetuum - + + - - - - - \ No newline at end of file diff --git a/src/Perpetuum.Bootstrapper/PerpetuumBootstrapper.cs b/src/Perpetuum.Bootstrapper/PerpetuumBootstrapper.cs index c71b95cdf..bba6512a1 100644 --- a/src/Perpetuum.Bootstrapper/PerpetuumBootstrapper.cs +++ b/src/Perpetuum.Bootstrapper/PerpetuumBootstrapper.cs @@ -565,7 +565,7 @@ private void InitContainer(string gameRoot) _ = _builder.Register(x => { - string connectionString = x.Resolve().ConnectionString; + string connectionString = x.Resolve().ConnectionStringNetCore; return () => new SqlConnection(connectionString); }); diff --git a/src/Perpetuum.Bootstrapper/Properties/AssemblyInfo.cs b/src/Perpetuum.Bootstrapper/Properties/AssemblyInfo.cs index b6a7bf65a..ebf416ede 100644 --- a/src/Perpetuum.Bootstrapper/Properties/AssemblyInfo.cs +++ b/src/Perpetuum.Bootstrapper/Properties/AssemblyInfo.cs @@ -1,15 +1,5 @@ using System.Reflection; using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Perpetuum.Bootstrapper.PerpetuumBootstrapper")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Perpetuum.Bootstrapper.PerpetuumBootstrapper")] -[assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,16 +10,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e113962c-ad5d-4f17-8d08-656221cbd2d4")] - -// 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/src/Perpetuum.Bootstrapper/packages.config b/src/Perpetuum.Bootstrapper/packages.config deleted file mode 100644 index f6af12342..000000000 --- a/src/Perpetuum.Bootstrapper/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/Perpetuum.ExportedTypes/Perpetuum.ExportedTypes.csproj b/src/Perpetuum.ExportedTypes/Perpetuum.ExportedTypes.csproj index 89ba0019c..eae6fe54d 100644 --- a/src/Perpetuum.ExportedTypes/Perpetuum.ExportedTypes.csproj +++ b/src/Perpetuum.ExportedTypes/Perpetuum.ExportedTypes.csproj @@ -1,63 +1,19 @@ - - - + - Debug - AnyCPU - {E322BF83-76B8-4395-9FF2-26DF13F6816C} + net8.0 Library - Properties - Perpetuum.ExportedTypes - Perpetuum.ExportedTypes - v4.6.1 - 512 - + false + Perpetuum.ExportedTypes + Perpetuum.ExportedTypes + Copyright © 2017 + 1.0.0.0 + 1.0.0.0 - true - full - false ..\..\bin\x64\Debug\Perpetuum.ExportedTypes\ - DEBUG;TRACE - prompt - 4 x64 - pdbonly - true ..\..\bin\x64\Release\Perpetuum.ExportedTypes\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Perpetuum.ExportedTypes/Properties/AssemblyInfo.cs b/src/Perpetuum.ExportedTypes/Properties/AssemblyInfo.cs index ffa07531a..d5d17f647 100644 --- a/src/Perpetuum.ExportedTypes/Properties/AssemblyInfo.cs +++ b/src/Perpetuum.ExportedTypes/Properties/AssemblyInfo.cs @@ -1,15 +1,5 @@ using System.Reflection; using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Perpetuum.ExportedTypes")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Perpetuum.ExportedTypes")] -[assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,16 +10,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e322bf83-76b8-4395-9ff2-26df13f6816c")] - -// 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/src/Perpetuum.RequestHandlers/Perpetuum.RequestHandlers.csproj b/src/Perpetuum.RequestHandlers/Perpetuum.RequestHandlers.csproj index a0a729793..14f92aed3 100644 --- a/src/Perpetuum.RequestHandlers/Perpetuum.RequestHandlers.csproj +++ b/src/Perpetuum.RequestHandlers/Perpetuum.RequestHandlers.csproj @@ -1,650 +1,29 @@ - - - + - Debug - AnyCPU - {F69F19CA-DF42-420E-BC21-2ADD28C50A0C} + net8.0 Library - Properties - Perpetuum.RequestHandlers - Perpetuum.RequestHandlers - v4.6.1 - 512 - + false + Perpetuum.RequestHandlers + Perpetuum.RequestHandlers + Copyright © 2017 + 1.0.0.0 + 1.0.0.0 - true - full - false ..\..\bin\x64\Debug\Perpetuum.RequestHandlers\ - DEBUG;TRACE - prompt - 4 x64 - pdbonly - true ..\..\bin\x64\Release\Perpetuum.RequestHandlers\ - TRACE - prompt - 4 x64 - - - ..\..\packages\System.Collections.Immutable.1.4.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - {e322bf83-76b8-4395-9ff2-26df13f6816c} - Perpetuum.ExportedTypes - - - {8587a597-848e-497f-8036-3b6f8047ec45} - Perpetuum - - - - - - \ No newline at end of file diff --git a/src/Perpetuum.RequestHandlers/Properties/AssemblyInfo.cs b/src/Perpetuum.RequestHandlers/Properties/AssemblyInfo.cs index f5689c095..b696b3f00 100644 --- a/src/Perpetuum.RequestHandlers/Properties/AssemblyInfo.cs +++ b/src/Perpetuum.RequestHandlers/Properties/AssemblyInfo.cs @@ -1,15 +1,5 @@ using System.Reflection; using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Perpetuum.RequestHandlers")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Perpetuum.RequestHandlers")] -[assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,16 +10,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("f69f19ca-df42-420e-bc21-2add28c50a0c")] - -// 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/src/Perpetuum.RequestHandlers/packages.config b/src/Perpetuum.RequestHandlers/packages.config deleted file mode 100644 index d205d2758..000000000 --- a/src/Perpetuum.RequestHandlers/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/Perpetuum.Server/Perpetuum.Server.csproj b/src/Perpetuum.Server/Perpetuum.Server.csproj index b4b385ded..70efd376b 100644 --- a/src/Perpetuum.Server/Perpetuum.Server.csproj +++ b/src/Perpetuum.Server/Perpetuum.Server.csproj @@ -1,147 +1,86 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {8A6EF898-EF64-4159-96D1-6C742122342F} - Exe - Properties - Perpetuum.Server - Perpetuum.Server - v4.6.1 - - - 512 - ..\ - true - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 3 - 1.0.0.%2a - false - true - false - - - x64 - true - full - false - ..\..\bin\x64\Debug\Perpetuum.Server\ - DEBUG;TRACE - prompt - 4 - false - false - - - x64 - pdbonly - true - ..\..\bin\x64\Release\Perpetuum.Server\ - TRACE - prompt - 4 - false - false - - - true - ..\..\bin\x64\Debug\Perpetuum.Server\ - DEBUG;TRACE - full - x64 - false - prompt - MinimumRecommendedRules.ruleset - - - ..\..\bin\x64\Release\Perpetuum.Server\ - TRACE - true - pdbonly - x64 - false - prompt - MinimumRecommendedRules.ruleset - - - BBE0B0FC062BF613BA4D53B392AF06C7499CDA91 - - - Perpetuum.Server_TemporaryKey.pfx - - - false - - - LocalIntranet - - - - false - - - - - ..\..\packages\Microsoft.Extensions.CommandLineUtils.1.1.1\lib\net451\Microsoft.Extensions.CommandLineUtils.dll - - - - - - - - - - False - .NET Framework 3.5 SP1 - false - - - - - Designer - - - - - - - - - {e113962c-ad5d-4f17-8d08-656221cbd2d4} - Perpetuum.Bootstrapper - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + net8.0 + x86 + Exe + ..\ + true + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 3 + 1.0.0.%2a + false + true + false + false + + + x64 + ..\..\bin\x64\Debug\Perpetuum.Server\ + false + + + x64 + ..\..\bin\x64\Release\Perpetuum.Server\ + false + + + ..\..\bin\x64\Debug\Perpetuum.Server\ + false + MinimumRecommendedRules.ruleset + + + ..\..\bin\x64\Release\Perpetuum.Server\ + false + MinimumRecommendedRules.ruleset + + + BBE0B0FC062BF613BA4D53B392AF06C7499CDA91 + + + Perpetuum.Server_TemporaryKey.pfx + + + false + + + LocalIntranet + + + false + + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + + + + + + + + PreserveNewest + + + + + \ No newline at end of file diff --git a/src/Perpetuum.Server/Program.cs b/src/Perpetuum.Server/Program.cs index 7e1610a32..a7300fb9c 100644 --- a/src/Perpetuum.Server/Program.cs +++ b/src/Perpetuum.Server/Program.cs @@ -1,6 +1,6 @@ using System; using System.IO; -using Microsoft.Extensions.CommandLineUtils; +using McMaster.Extensions.CommandLineUtils; using Perpetuum.Bootstrapper; namespace Perpetuum.Server diff --git a/src/Perpetuum.Server/Properties/launchSettings.json b/src/Perpetuum.Server/Properties/launchSettings.json new file mode 100644 index 000000000..47719e590 --- /dev/null +++ b/src/Perpetuum.Server/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "PerpetuumCore.Server": { + "commandName": "Project", + "commandLineArgs": "C:\\PerpetuumServer\\data" + } + } +} \ No newline at end of file diff --git a/src/Perpetuum.Server/app.config b/src/Perpetuum.Server/app.config index 3dbff35f4..3e0e37cfc 100644 --- a/src/Perpetuum.Server/app.config +++ b/src/Perpetuum.Server/app.config @@ -1,3 +1,3 @@ - + diff --git a/src/Perpetuum.Server/packages.config b/src/Perpetuum.Server/packages.config deleted file mode 100644 index e5b993747..000000000 --- a/src/Perpetuum.Server/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/Perpetuum.Server/perpetuum.ini b/src/Perpetuum.Server/perpetuum.ini new file mode 100644 index 000000000..d3b558414 --- /dev/null +++ b/src/Perpetuum.Server/perpetuum.ini @@ -0,0 +1,23 @@ +{ + "ListenerPort": 17700, + "EnableUpnp": false, + + "PersonalConfig": "startup_standalone", + "ConnectionString": "Server=localhost\\PERPSQL;Database=perpetuumsa;Trusted_Connection=True;Pooling=True;Connection Timeout=30;Connection Lifetime=260;Connection Reset=True;Min Pool Size=20;Max Pool Size=60;", + "ConnectionStringNetCore": "Server=localhost\\PERPSQL;Database=perpetuumsa;Trusted_Connection=True;Pooling=True;Connection Timeout=30;Connection Lifetime=260;Min Pool Size=20;Max Pool Size=60;", + + "ResourceServerURL": "http://127.0.0.1:1337/", + + "Corporation":{ + "Price" : 250000, + "HangarPrice" : 50000, + "RentPeriod" : 7, + "LeavePeriod" : 1440, + "NumberOfHangarFolders" : 10, + "FoundingPrice" : 25000 + }, + + "StartCredit": 1000000, + "LevelCredit": 1250000, + "StartEP": 50000 +} \ No newline at end of file diff --git a/src/Perpetuum.ServerService/App.config b/src/Perpetuum.ServerService/App.config index 56c89d4da..a39312d9a 100644 --- a/src/Perpetuum.ServerService/App.config +++ b/src/Perpetuum.ServerService/App.config @@ -1,12 +1,12 @@ - + - -
+ +
- + @@ -15,4 +15,4 @@ - \ No newline at end of file + diff --git a/src/Perpetuum.ServerService/PerpServer.cs b/src/Perpetuum.ServerService/PerpServer.cs index a4e7ca62e..00e95727f 100644 --- a/src/Perpetuum.ServerService/PerpServer.cs +++ b/src/Perpetuum.ServerService/PerpServer.cs @@ -1,13 +1,11 @@ -using Perpetuum.Bootstrapper; +using Autofac; +using Perpetuum.Bootstrapper; +using Perpetuum.Host; +using Perpetuum.Log; using System; -using System.ComponentModel; -using System.IO; using System.ServiceProcess; -using System.Threading.Tasks; -using Autofac; -using Perpetuum.Host; using System.Threading; -using Perpetuum.Log; +using System.Threading.Tasks; namespace Perpetuum.ServerService { diff --git a/src/Perpetuum.ServerService/Perpetuum.ServerService.csproj b/src/Perpetuum.ServerService/Perpetuum.ServerService.csproj index a226ff8d8..ac7d234bf 100644 --- a/src/Perpetuum.ServerService/Perpetuum.ServerService.csproj +++ b/src/Perpetuum.ServerService/Perpetuum.ServerService.csproj @@ -1,16 +1,7 @@ - - - + - Debug - AnyCPU - {9C77CE95-825E-4BB1-9129-66835BDB8C96} + net8.0 WinExe - Perpetuum.ServerService - Perpetuum.ServerService - v4.6.1 - 512 - true publish\ true Disk @@ -26,85 +17,42 @@ false false true - - - x64 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - + false x64 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - ..\..\packages\Autofac.4.6.1\lib\net45\Autofac.dll - - - - - - - - - - - - - - - - + Component - + PerpServer.cs - + Component - - + True True Resources.resx - + True True Settings.settings - - - + SettingsSingleFileGenerator Settings.Designer.cs - - {E113962C-AD5D-4F17-8D08-656221CBD2D4} - Perpetuum.Bootstrapper - - - {8587A597-848E-497F-8036-3B6F8047EC45} - Perpetuum - + + - + PublicResXFileCodeGenerator Resources.Designer.cs @@ -121,5 +69,12 @@ false - + + + + + + + + \ No newline at end of file diff --git a/src/Perpetuum.ServerService/Program.cs b/src/Perpetuum.ServerService/Program.cs index 61b7a4a29..d73efe84f 100644 --- a/src/Perpetuum.ServerService/Program.cs +++ b/src/Perpetuum.ServerService/Program.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; +using System.ComponentModel; using System.Configuration.Install; -using System.Linq; -using System.Reflection; using System.ServiceProcess; -using System.Text; -using System.Threading.Tasks; namespace Perpetuum.ServerService { diff --git a/src/Perpetuum.ServerService/Properties/AssemblyInfo.cs b/src/Perpetuum.ServerService/Properties/AssemblyInfo.cs deleted file mode 100644 index d18b979fe..000000000 --- a/src/Perpetuum.ServerService/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("Perpetuum.ServerService")] -[assembly: AssemblyDescription("Perpetuum Windows Server Service")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("The OpenPerpetuum Project")] -[assembly: AssemblyProduct("Perpetuum.ServerService")] -[assembly: AssemblyCopyright("Copyright © 2018 The OpenPerpetuum Project")] -[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("9c77ce95-825e-4bb1-9129-66835bdb8c96")] - -// 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/src/Perpetuum.ServerService/Properties/Resources.Designer.cs b/src/Perpetuum.ServerService/Properties/Resources.Designer.cs deleted file mode 100644 index 58f9c9d07..000000000 --- a/src/Perpetuum.ServerService/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Perpetuum.ServerService.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Perpetuum.ServerService.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/src/Perpetuum.ServerService/Properties/Settings.Designer.cs b/src/Perpetuum.ServerService/Properties/Settings.Designer.cs deleted file mode 100644 index 43ce4cc26..000000000 --- a/src/Perpetuum.ServerService/Properties/Settings.Designer.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Perpetuum.ServerService.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("C:\\PerpetuumServer\\data\\")] - public string GameRoot { - get { - return ((string)(this["GameRoot"])); - } - } - } -} diff --git a/src/Perpetuum.ServerService/packages.config b/src/Perpetuum.ServerService/packages.config deleted file mode 100644 index 1903d4393..000000000 --- a/src/Perpetuum.ServerService/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/Perpetuum/ByteArrayExtensions.cs b/src/Perpetuum/ByteArrayExtensions.cs index e41b84856..3ee9f2bee 100644 --- a/src/Perpetuum/ByteArrayExtensions.cs +++ b/src/Perpetuum/ByteArrayExtensions.cs @@ -2,6 +2,7 @@ using System.IO; using System.Runtime.InteropServices; using System.Runtime.Serialization.Formatters.Binary; +using System.Text.Json; namespace Perpetuum { @@ -59,10 +60,7 @@ public static T Deserialize(this byte[] data) return default(T); } - using (var ms = new MemoryStream(data)) - { - return (T)(new BinaryFormatter().Deserialize(ms)); - } + return JsonSerializer.Deserialize(new ReadOnlySpan(data)); } } } \ No newline at end of file diff --git a/src/Perpetuum/GenericTypeExtensions.cs b/src/Perpetuum/GenericTypeExtensions.cs index 44a923f6f..4f2aa9dc4 100644 --- a/src/Perpetuum/GenericTypeExtensions.cs +++ b/src/Perpetuum/GenericTypeExtensions.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; @@ -58,13 +59,8 @@ public static T Clone(this T source) Debug.Assert(typeof(T).IsSerializable, "EZ NEM SERIALIZALHATO: " + typeof(T)); - using (var ms = new MemoryStream()) - { - var bf = new BinaryFormatter(); - bf.Serialize(ms, source); - ms.Seek(0, SeekOrigin.Begin); - return (T)(bf.Deserialize(ms)); - } + var serialized = JsonConvert.SerializeObject(source); + return JsonConvert.DeserializeObject(serialized); } } } diff --git a/src/Perpetuum/GlobalConfiguration.cs b/src/Perpetuum/GlobalConfiguration.cs index 7cfbe2de4..3f91db556 100644 --- a/src/Perpetuum/GlobalConfiguration.cs +++ b/src/Perpetuum/GlobalConfiguration.cs @@ -12,6 +12,8 @@ public class GlobalConfiguration public string WebServiceIP { get; set; } public string PersonalConfig { get; set; } public string ConnectionString { get; set; } + public string ConnectionStringNetCore { get; set; } + public string RelayName => "relay"; public bool EnableUpnp { get; set; } diff --git a/src/Perpetuum/Modules/DrillerModule.cs b/src/Perpetuum/Modules/DrillerModule.cs index fed8937ad..3be22c8cf 100644 --- a/src/Perpetuum/Modules/DrillerModule.cs +++ b/src/Perpetuum/Modules/DrillerModule.cs @@ -105,8 +105,8 @@ protected override int CalculateEp(int materialType) } TimeSpan avgCycleTime = activeGathererModules.Select(m => m.CycleTime).Average(); - TimeSpan t = TimeSpan.FromDays(1).Divide(avgCycleTime); - double chance = (double)MAX_EP_PER_DAY / t.Ticks; + double t = TimeSpan.FromDays(1).Divide(avgCycleTime); + double chance = (double)MAX_EP_PER_DAY / t; chance /= activeGathererModules.Length; diff --git a/src/Perpetuum/Modules/HarvesterModule.cs b/src/Perpetuum/Modules/HarvesterModule.cs index 652e3616c..7df23aa45 100644 --- a/src/Perpetuum/Modules/HarvesterModule.cs +++ b/src/Perpetuum/Modules/HarvesterModule.cs @@ -69,8 +69,8 @@ protected override int CalculateEp(int materialType) } TimeSpan avgCycleTime = activeGathererModules.Select(m => m.CycleTime).Average(); - TimeSpan t = TimeSpan.FromDays(1).Divide(avgCycleTime); - double chance = (double)MAX_EP_PER_DAY / t.Ticks; + double t = TimeSpan.FromDays(1).Divide(avgCycleTime); + double chance = (double)MAX_EP_PER_DAY / t; chance /= activeGathererModules.Length; diff --git a/src/Perpetuum/Perpetuum.csproj b/src/Perpetuum/Perpetuum.csproj index 8192ad755..e9d7bf1a5 100644 --- a/src/Perpetuum/Perpetuum.csproj +++ b/src/Perpetuum/Perpetuum.csproj @@ -1,1348 +1,19 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {8587A597-848E-497F-8036-3B6F8047EC45} + net8.0 Library - Properties - Perpetuum - Perpetuum - - - 2.0 - - - - - 3.5 - - - v4.6.1 - false - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - ..\ - true + false - true - full - false ..\..\bin\x64\Debug\Perpetuum\ - TRACE;DEBUG - prompt - 4 - true - false - true - -!Microsoft.Design#CA1012;-!Microsoft.Design#CA2210;-!Microsoft.Design#CA1040;-!Microsoft.Design#CA1005;-!Microsoft.Design#CA1020;-!Microsoft.Design#CA1021;-!Microsoft.Design#CA1010;-!Microsoft.Design#CA1011;-!Microsoft.Design#CA1009;-!Microsoft.Design#CA1050;-!Microsoft.Design#CA1026;-!Microsoft.Design#CA1019;-!Microsoft.Design#CA1031;-!Microsoft.Design#CA1047;-!Microsoft.Design#CA1000;-!Microsoft.Design#CA1048;-!Microsoft.Design#CA1051;-!Microsoft.Design#CA1002;-!Microsoft.Design#CA1061;-!Microsoft.Design#CA1006;-!Microsoft.Design#CA1046;-!Microsoft.Design#CA1045;-!Microsoft.Design#CA1065;-!Microsoft.Design#CA1038;-!Microsoft.Design#CA1008;-!Microsoft.Design#CA1028;-!Microsoft.Design#CA1064;-!Microsoft.Design#CA1004;-!Microsoft.Design#CA1035;-!Microsoft.Design#CA1063;-!Microsoft.Design#CA1032;-!Microsoft.Design#CA1023;-!Microsoft.Design#CA1033;-!Microsoft.Design#CA1039;-!Microsoft.Design#CA1016;-!Microsoft.Design#CA1014;-!Microsoft.Design#CA1017;-!Microsoft.Design#CA1018;-!Microsoft.Design#CA1027;-!Microsoft.Design#CA1059;-!Microsoft.Design#CA1060;-!Microsoft.Design#CA1034;-!Microsoft.Design#CA1013;-!Microsoft.Design#CA1036;-!Microsoft.Design#CA1044;-!Microsoft.Design#CA1041;-!Microsoft.Design#CA1025;-!Microsoft.Design#CA1052;-!Microsoft.Design#CA1053;-!Microsoft.Design#CA1057;-!Microsoft.Design#CA1058;-!Microsoft.Design#CA1001;-!Microsoft.Design#CA1049;-!Microsoft.Design#CA1054;-!Microsoft.Design#CA1056;-!Microsoft.Design#CA1055;-!Microsoft.Design#CA1030;-!Microsoft.Design#CA1003;-!Microsoft.Design#CA1007;-!Microsoft.Design#CA1043;-!Microsoft.Design#CA1024;-!Microsoft.Globalization#CA1301;-!Microsoft.Globalization#CA1302;-!Microsoft.Globalization#CA1308;-!Microsoft.Globalization#CA1306;-!Microsoft.Globalization#CA1304;-!Microsoft.Globalization#CA1305;-!Microsoft.Globalization#CA2101;-!Microsoft.Globalization#CA1300;-!Microsoft.Globalization#CA1307;-!Microsoft.Globalization#CA1309;-!Microsoft.Interoperability#CA1403;-!Microsoft.Interoperability#CA1406;-!Microsoft.Interoperability#CA1413;-!Microsoft.Interoperability#CA1402;-!Microsoft.Interoperability#CA1407;-!Microsoft.Interoperability#CA1404;-!Microsoft.Interoperability#CA1410;-!Microsoft.Interoperability#CA1411;-!Microsoft.Interoperability#CA1405;-!Microsoft.Interoperability#CA1409;-!Microsoft.Interoperability#CA1415;-!Microsoft.Interoperability#CA1408;-!Microsoft.Interoperability#CA1414;-!Microsoft.Interoperability#CA1412;-!Microsoft.Interoperability#CA1400;-!Microsoft.Interoperability#CA1401;-!Microsoft.Maintainability#CA1506;-!Microsoft.Maintainability#CA1502;-!Microsoft.Maintainability#CA1501;-!Microsoft.Maintainability#CA1505;-!Microsoft.Maintainability#CA1504;-!Microsoft.Maintainability#CA1500;-!Microsoft.Mobility#CA1600;-!Microsoft.Mobility#CA1601;-!Microsoft.Naming#CA1702;-!Microsoft.Naming#CA1700;-!Microsoft.Naming#CA1712;-!Microsoft.Naming#CA1713;-!Microsoft.Naming#CA1714;-!Microsoft.Naming#CA1709;-!Microsoft.Naming#CA1704;-!Microsoft.Naming#CA1708;-!Microsoft.Naming#CA1715;-!Microsoft.Naming#CA1710;-!Microsoft.Naming#CA1720;-!Microsoft.Naming#CA1707;-!Microsoft.Naming#CA1722;-!Microsoft.Naming#CA1711;-!Microsoft.Naming#CA1716;-!Microsoft.Naming#CA1717;-!Microsoft.Naming#CA1725;-!Microsoft.Naming#CA1719;-!Microsoft.Naming#CA1721;-!Microsoft.Naming#CA1701;-!Microsoft.Naming#CA1703;-!Microsoft.Naming#CA1724;-!Microsoft.Naming#CA1726;-!Microsoft.Performance#CA1809;-!Microsoft.Performance#CA1811;-!Microsoft.Performance#CA1812;-!Microsoft.Performance#CA1813;-!Microsoft.Performance#CA1823;-!Microsoft.Performance#CA1800;-!Microsoft.Performance#CA1805;-!Microsoft.Performance#CA1810;-!Microsoft.Performance#CA1824;-!Microsoft.Performance#CA1822;-!Microsoft.Performance#CA1815;-!Microsoft.Performance#CA1814;-!Microsoft.Performance#CA1819;-!Microsoft.Performance#CA1821;-!Microsoft.Performance#CA1804;-!Microsoft.Performance#CA1820;-!Microsoft.Performance#CA1802;-!Microsoft.Portability#CA1901;-!Microsoft.Portability#CA1900;-!Microsoft.Reliability#CA2001;-!Microsoft.Reliability#CA2002;-!Microsoft.Reliability#CA2003;-!Microsoft.Reliability#CA2004;-!Microsoft.Reliability#CA2006;-!Microsoft.Security#CA2116;-!Microsoft.Security#CA2117;-!Microsoft.Security#CA2105;-!Microsoft.Security#CA2115;-!Microsoft.Security#CA2102;-!Microsoft.Security#CA2104;-!Microsoft.Security#CA2122;-!Microsoft.Security#CA2114;-!Microsoft.Security#CA2123;-!Microsoft.Security#CA2111;-!Microsoft.Security#CA2108;-!Microsoft.Security#CA2107;-!Microsoft.Security#CA2103;-!Microsoft.Security#CA2118;-!Microsoft.Security#CA2109;-!Microsoft.Security#CA2119;-!Microsoft.Security#CA2106;-!Microsoft.Security#CA2112;-!Microsoft.Security#CA2120;-!Microsoft.Security#CA2121;-!Microsoft.Security#CA2126;-!Microsoft.Security#CA2124;-!Microsoft.Security#CA2127;-!Microsoft.Security#CA2128;-!Microsoft.Security#CA2129;-!Microsoft.Usage#CA2243;-!Microsoft.Usage#CA2236;-!Microsoft.Usage#CA1816;-!Microsoft.Usage#CA2227;-!Microsoft.Usage#CA2213;-!Microsoft.Usage#CA2216;-!Microsoft.Usage#CA2214;-!Microsoft.Usage#CA2222;-!Microsoft.Usage#CA1806;-!Microsoft.Usage#CA2217;-!Microsoft.Usage#CA2212;-!Microsoft.Usage#CA2219;-!Microsoft.Usage#CA2201;-!Microsoft.Usage#CA2228;-!Microsoft.Usage#CA2221;-!Microsoft.Usage#CA2220;-!Microsoft.Usage#CA2240;-!Microsoft.Usage#CA2229;-!Microsoft.Usage#CA2238;-!Microsoft.Usage#CA2207;-!Microsoft.Usage#CA2208;-!Microsoft.Usage#CA2235;-!Microsoft.Usage#CA2237;-!Microsoft.Usage#CA2232;-!Microsoft.Usage#CA2223;-!Microsoft.Usage#CA2211;-!Microsoft.Usage#CA2233;-!Microsoft.Usage#CA2225;-!Microsoft.Usage#CA2226;-!Microsoft.Usage#CA2231;-!Microsoft.Usage#CA2224;-!Microsoft.Usage#CA2218;-!Microsoft.Usage#CA2234;-!Microsoft.Usage#CA2239;-!Microsoft.Usage#CA2200;-!Microsoft.Usage#CA1801;-!Microsoft.Usage#CA2242;-!Microsoft.Usage#CA2205;-!Microsoft.Usage#CA2230 - false - false - true - false x64 - pdbonly - true ..\..\bin\x64\Release\Perpetuum\ - TRACE;PARALLEL,RELEASE - prompt - 4 - true - false x64 - - ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - - ..\..\packages\System.Collections.Immutable.1.4.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - - - - - - - ..\..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll - - - - - ..\..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - false - - - - - - - - {e322bf83-76b8-4395-9ff2-26df13f6816c} - Perpetuum.ExportedTypes - + @@ -1352,19 +23,26 @@ - + + + + + + + + + + + + + + + + + + - - - - + True - \ No newline at end of file diff --git a/src/Perpetuum/Zones/Intrusion/PassiveHackingSAP.cs b/src/Perpetuum/Zones/Intrusion/PassiveHackingSAP.cs index b9134da73..b9aeee326 100644 --- a/src/Perpetuum/Zones/Intrusion/PassiveHackingSAP.cs +++ b/src/Perpetuum/Zones/Intrusion/PassiveHackingSAP.cs @@ -16,7 +16,7 @@ public class PassiveHackingSAP : SAP { private static readonly TimeSpan _updateScoreInterval = TimeSpan.FromSeconds(2); private static TimeSpan _takeoverTime = TimeSpan.FromMinutes(8); - private static readonly int _maxScore = (int) _takeoverTime.Divide(_updateScoreInterval).Ticks; + private static readonly int _maxScore = (int) _takeoverTime.Divide(_updateScoreInterval); private const int RANGE = 5; private readonly IntervalTimer _updateScoreTimer = new IntervalTimer(_updateScoreInterval); diff --git a/src/Perpetuum/packages.config b/src/Perpetuum/packages.config deleted file mode 100644 index 5f43db920..000000000 --- a/src/Perpetuum/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file