]> git.deb.at Git - rhonda/impostor.git/commitdiff
Upgrade to net7.0
authorjs6pak <kubastaron@hotmail.com>
Sun, 18 Dec 2022 19:13:25 +0000 (20:13 +0100)
committerjs6pak <kubastaron@hotmail.com>
Sun, 18 Dec 2022 19:34:45 +0000 (20:34 +0100)
15 files changed:
.github/workflows/ci.yml
Dockerfile
docs/Building-from-source.md
docs/Running-the-server.md
docs/Writing-a-plugin.md
src/Directory.Build.props
src/Impostor.Api/Impostor.Api.csproj
src/Impostor.Api/Innersloth/GameCodeParser.cs
src/Impostor.Benchmarks/Impostor.Benchmarks.csproj
src/Impostor.Client.App/Impostor.Client.App.csproj
src/Impostor.Plugins.Example/Impostor.Plugins.Example.csproj
src/Impostor.Server/Impostor.Server.csproj
src/Impostor.Tests/Impostor.Tests.csproj
src/Impostor.Tools.Proxy/Impostor.Tools.Proxy.csproj
src/Impostor.Tools.ServerReplay/Impostor.Tools.ServerReplay.csproj

index 91a2736ba46a8cd14839ac5cd85c7074c193f7dd..ab75f975eb6f528259ca2cc171f9f3a33fc5b556 100644 (file)
@@ -34,7 +34,7 @@ jobs:
       - name: Setup .NET
         uses: actions/setup-dotnet@v2
         with:
-          dotnet-version: 6.x
+          dotnet-version: 7.x
 
       - name: Run the Cake script
         uses: cake-build/cake-action@v1
index d13c4f41f445e8ba6036ddbe88928ab4d66469e6..3ca0f2e7e630e5ce7120b348ba389707189d3396 100644 (file)
@@ -1,4 +1,4 @@
-FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build
+FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
 
 # See for all possible platforms
 # https://github.com/containerd/containerd/blob/master/platforms/platforms.go#L17
@@ -36,7 +36,7 @@ RUN case "$TARGETARCH" in \
   dotnet publish -c release -o /app -r "$NETCORE_PLATFORM" -p:VersionSuffix="$VERSIONSUFFIX" --no-restore ./src/Impostor.Server/Impostor.Server.csproj
 
 # Final image.
-FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime:6.0
+FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime:7.0
 WORKDIR /app
 COPY --from=build /app ./
 EXPOSE 22023/udp
index 708bd3f063ed3b776bc740d6878460e5e0167069..2f4b98c988b58ed4040429009a6032fcddafc663 100644 (file)
@@ -1,6 +1,6 @@
 # Building from source
 
-The solution contains the Impostor server and its dependencies, like Hazel and the plugin API. The server is built using [.NET 6](https://dotnet.microsoft.com/download/dotnet/6.0).
+The solution contains the Impostor server and its dependencies, like Hazel and the plugin API. The server is built using [.NET 7](https://dotnet.microsoft.com/download/dotnet/7.0).
 
 ## Cloning Impostor
 
@@ -14,7 +14,7 @@ git clone https://github.com/Impostor/Impostor.git
 
 ### Dependencies
 
-- [.NET 6 SDK](https://dotnet.microsoft.com/download/dotnet/6.0)
+- [.NET 7 SDK](https://dotnet.microsoft.com/download/dotnet/7.0)
 - [Rider](https://www.jetbrains.com/rider/) or [Visual Studio](https://visualstudio.microsoft.com/vs/) (Optional, only if you want the full IDE experience)
 
 ### Build using the CLI
index e96d9d5525934eb7809f5cde5fe30694a8a81282..56e54976c8595f61842674d0a533990bf593690b 100644 (file)
@@ -6,7 +6,7 @@ There are currently two modes to run the Impostor server. The first way, Single
 
 ### Without Docker
 
-1. Install the [.NET 6.0 runtime](https://dotnet.microsoft.com/download/dotnet/6.0). Installing the SDK also works, but is not necessary unless you plan on developing Impostor or Impostor plugins. If you're asked to pick between the normal, desktop or server runtime, the normal runtime is enough, but some plugins may require the ASP.NET Core Runtime as well.
+1. Install the [.NET 7.0 runtime](https://dotnet.microsoft.com/download/dotnet/7.0). Installing the SDK also works, but is not necessary unless you plan on developing Impostor or Impostor plugins. If you're asked to pick between the normal, desktop or server runtime, the normal runtime is enough, but some plugins may require the ASP.NET Core Runtime as well.
 2. Find the [latest release](https://github.com/Impostor/Impostor/releases) or the [latest CI build](https://nightly.link/Impostor/Impostor/workflows/ci/master).
 3. Download the version for your OS (linux/win/osx). Impostor is built for multiple CPU-architectures, you most likely want the x64 version, unless you are running on a Raspberry Pi or another device with an ARM processor.
 4. Extract the zip.
index d40056e890aa51424fe6add6e44f0bcb744c6d38..e931709a85e2be8401059da603add591a670bffa 100644 (file)
@@ -27,23 +27,24 @@ https://dotnet.microsoft.com/download
 
 ## 2. Create a C# project
 
-The first step is creating a new C# project, it must be a **Class Library (.NET Standard)**. The target framework can be any of those compatible with .NET 6, which includes:
+The first step is creating a new C# project, it must be a **Class Library (.NET Standard)**. The target framework can be any of those compatible with .NET 7, which includes:
 
 - .NET Standard 2.0
 - .NET Standard 2.1
 - .NET 5
 - .NET 6
+- .NET 7
 
 For more information about compatibility, see https://docs.microsoft.com/en-us/dotnet/standard/net-standard.
 
-> At the moment of writing this document, I recommend you to use **.NET Standard 2.1**. This should give you enough functionality. If not, upgrade to .NET 6.
+> At the moment of writing this document, I recommend you to use **.NET 7.0**.
 
 When the project has been created, you should have `Class.cs` and `Project.csproj` files. Your `Project.csproj` should look something like this.
 
 ```xml
 <Project Sdk="Microsoft.NET.Sdk">
     <PropertyGroup>
-        <TargetFramework>netstandard2.1</TargetFramework>
+        <TargetFramework>net7.0</TargetFramework>
     </PropertyGroup>
 </Project>
 ```
@@ -269,7 +270,7 @@ Now your plugin is ready to be tested.
 
 1. Right click your project and press `Build`.
 2. Right click your project and press `Open Folder in File Explorer`.
-3. Go to `bin/Debug/netstandard2.1/`.
+3. Go to `bin/Debug/net7.0/`.
 4. In this directory, you should find your plugin named `Project.dll`.
 5. Copy the `Project.dll` to the `plugins` directory in your Impostor server directory.
 6. (Re)start your Impostor server.
@@ -309,7 +310,7 @@ Constantly copying the plugin dll to your server directory can be pretty annoyin
   },
   "PluginLoader": {
     "Paths": [
-      "D:\\Projects\\Impostor\\src\\Impostor.Plugins.Example\\bin\\Debug\\netstandard2.1"
+      "D:\\Projects\\Impostor\\src\\Impostor.Plugins.Example\\bin\\Debug\\net7.0"
     ],
     "LibraryPaths": []
   }
index dea9033024ca440116b7b12853cfc8628d605270..044731ef32f8bb216aba6104a495ae9a7031682d 100644 (file)
@@ -1,6 +1,7 @@
 <Project>
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
+    <LangVersion>11</LangVersion>
     <VersionPrefix>1.7.3</VersionPrefix>
     <VersionSuffix>dev</VersionSuffix>
     <EnforceCodeStyleInBuild Condition="$(MSBuildProjectName)!='Hazel'">true</EnforceCodeStyleInBuild>
index a21ba48a5a8d1c8bc995ef649f4c032fe09ed442..9c7b0f23a47f623aafb4e7915fd919136bd2175b 100644 (file)
@@ -1,9 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>netstandard2.1</TargetFramework>
     <CodeAnalysisRuleSet>../ProjectRules.ruleset</CodeAnalysisRuleSet>
-    <LangVersion>9</LangVersion>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <Nullable>enable</Nullable>
     <IncludeSymbols>true</IncludeSymbols>
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
-    <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
-    <PackageReference Include="Nullable" Version="1.3.0">
-      <PrivateAssets>all</PrivateAssets>
-      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
-    </PackageReference>
-    <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
-      <PrivateAssets>all</PrivateAssets>
-      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
-    </PackageReference>
+    <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="all" />
   </ItemGroup>
 
 </Project>
index f4743c5642dbfd09b8e2fffeaa0c842e757dae3d..583587cb371dc4f499fb5de5f7ea03c9e723b6b0 100644 (file)
@@ -12,8 +12,6 @@ namespace Impostor.Api.Innersloth
 
         private static readonly int[] V2Map = Enumerable.Range(65, 26).Select(v => V2.IndexOf((char)v)).ToArray();
 
-        private static readonly RNGCryptoServiceProvider Random = new RNGCryptoServiceProvider();
-
         public static string IntToGameName(int input)
         {
             // V2.
@@ -67,7 +65,7 @@ namespace Impostor.Api.Innersloth
 #else
             Span<byte> data = stackalloc byte[len];
 #endif
-            Random.GetBytes(data);
+            RandomNumberGenerator.Fill(data);
 
             // Convert to their char representation.
             Span<char> dataChar = stackalloc char[len];
index e747e831865d3e0a8977946aa8477cf06410ce93..11288b3b2e6909acd40329330ed92596f332f6d5 100644 (file)
@@ -6,7 +6,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
+    <PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
   </ItemGroup>
 
   <ItemGroup>
index fa708b1880a4dcd831027f2b68f8860adf6a33bd..fe5471d0758ca6100e5353fec72372efc657a2ad 100644 (file)
@@ -9,7 +9,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
+    <PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
   </ItemGroup>
 
 </Project>
index 2cfa53b0045fe015ae37992151b177a22d27be80..a6b5d403979327121cf069892ebdd140cb9a9e3e 100644 (file)
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>netstandard2.1</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
 
     <Version>1.0.0</Version>
     <AssemblyTitle>Example</AssemblyTitle>
index f05e3c7b30690426e31bf1708de50e09a1824269..4bbb38308e4f27ac36c3110858c514eb97933edc 100644 (file)
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.5" />
-    <PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="6.0.0" />
-    <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
-    <PackageReference Include="Microsoft.Extensions.ObjectPool" Version="6.0.5" />
-    <PackageReference Include="Serilog.Extensions.Hosting" Version="4.2.0" />
-    <PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
-    <PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.1" />
+    <PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.ObjectPool" Version="7.0.1" />
+    <PackageReference Include="Serilog.Extensions.Hosting" Version="5.0.1" />
+    <PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
+    <PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
     <PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.435">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
-    <!-- HACK: Some plugins depend on System.IO.Pipelines and expect the version to be 6.0.0.0, but Hazel still depends on version 5.0.0.0. Figure out why this happens. -->
-    <PackageReference Include="System.IO.Pipelines" Version="6.0.0" />
   </ItemGroup>
 
   <ItemGroup>
index faa60d7264a4f684f30b9a9bc5e2ba648d6c208d..368281d9bd9798e45e49e270e0e328d43fe19255 100644 (file)
@@ -5,14 +5,14 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
-    <PackageReference Include="xunit" Version="2.4.1" />
-    <PackageReference Include="xunit.runner.reporters" Version="2.4.1" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
+    <PackageReference Include="xunit" Version="2.4.2" />
+    <PackageReference Include="xunit.runner.reporters" Version="2.4.2" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
-    <PackageReference Include="coverlet.collector" Version="3.1.2">
+    <PackageReference Include="coverlet.collector" Version="3.2.0">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
index 4e07db1e2f328426eabcdf64d2e3edf97430add9..a626da1db1842dba05fd0c01729d7be54ec1e49b 100644 (file)
@@ -5,7 +5,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
     <PackageReference Include="Pcap.Net.x64" Version="1.0.4.1">
       <NoWarn>NU1701</NoWarn>
     </PackageReference>
index becb7429cd62b9289287958aeaa437e918c16d99..66cd32af6c89d91c4ff4c925b71a06b1fd2e89c2 100644 (file)
@@ -9,7 +9,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
+    <PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
   </ItemGroup>
 
 </Project>