Skip to content

Commit

Permalink
Upgrade core to netstandard2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooshua committed Aug 16, 2023
1 parent 360296c commit 064d78b
Show file tree
Hide file tree
Showing 34 changed files with 62 additions and 46 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
strategy:
matrix:
runtime: [ 'win-x64', 'win-x86', 'linux-x64', linux-musl-x64 ]
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -26,7 +28,7 @@ jobs:
run: dotnet restore

- name: Build ${{ matrix.runtime }}
run: dotnet publish -c Release -r ${{ matrix.runtime }}
run: dotnet publish -f net6.0 -c Release -r ${{ matrix.runtime }}

- name: Upload Files
uses: actions/upload-artifact@v3
Expand All @@ -39,9 +41,9 @@ jobs:
strategy:
matrix:
framework-version: [ 'net6.0' ]

fail-fast: false

steps:

- name: Checkout
uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Attributes/Targets/BitEventAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class BitEventAttribute : BitTargetAttribute
public override string Name => "BitEvent";

internal override bool IsValidEvent(Type arg)
=> arg.IsAssignableTo(typeof(IEventArgs));
=> typeof(IEventArgs).IsAssignableFrom(arg);

internal override void Setup(RouterContext context, LilikoiMutator mutator)
{
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Attributes/Targets/BitHookAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public BitHookAttribute(byte priority = 128)
public override string Name => "BitHook";

internal override bool IsValidEvent(Type arg)
=> arg.IsAssignableTo(typeof(IHookArgs));
=> typeof(IHookArgs).IsAssignableFrom(arg);


internal override void Setup(RouterContext context, LilikoiMutator mutator)
Expand Down
3 changes: 2 additions & 1 deletion api/BitMod/BitMod.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>BitMod</RootNamespace>
Expand All @@ -10,6 +10,7 @@
<DebugType>embedded</DebugType>
<Configurations>Debug;Release;Publish</Configurations>
<Platforms>AnyCPU</Platforms>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions api/BitMod/Events/Player/PlayerChangedRoleEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public class PlayerChangedRoleEventArgs : IEventArgs, IResponsiblePlayerEvent
/// <summary>
/// The player who changed role.
/// </summary>
public BitPlayer Player { get; init; }
public BitPlayer Player { get; }

/// <summary>
/// The new role of the player.
/// </summary>
public GameRole Role { get; init; }
public GameRole Role { get; }

internal PlayerChangedRoleEventArgs(BitServer server, BitPlayer player, GameRole role)
{
Expand Down
4 changes: 2 additions & 2 deletions api/BitMod/Events/Player/PlayerChangedTeamEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public class PlayerChangedTeamEventArgs : IEventArgs, IResponsiblePlayerEvent
/// <summary>
/// The player who joined a team.
/// </summary>
public BitPlayer Player { get; init; }
public BitPlayer Player { get; }

/// <summary>
/// The new team which the player joined.
/// </summary>
public Team Team { get; init; }
public Team Team { get; }

internal PlayerChangedTeamEventArgs(BitServer server, BitPlayer player, Team team)
{
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Events/Player/PlayerConnectedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PlayerConnectedEventArgs(BitServer server, BitPlayer player)
/// <summary>
/// The player that connected
/// </summary>
public BitPlayer Player { get; init; }
public BitPlayer Player { get; }

/// <inheritdoc />
public BitPlayer ResponsiblePlayer => Player;
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Events/Player/PlayerDiedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public PlayerDiedEventArgs(BitServer server, BitPlayer player)
/// The player that died.
/// For information on the killer, hook PlayerKilledPlayer instead.
/// </summary>
public BitPlayer Player { get; init; }
public BitPlayer Player { get; }

/// <inheritdoc />
public BitPlayer ResponsiblePlayer => Player;
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Events/Player/PlayerDisconnectedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PlayerDisconnectedEventArgs(BitServer server, BitPlayer player)
/// <summary>
/// The player that just disconnected.
/// </summary>
public BitPlayer Player { get; init; }
public BitPlayer Player { get; }

/// <inheritdoc />
public BitPlayer ResponsiblePlayer => Player;
Expand Down
14 changes: 7 additions & 7 deletions api/BitMod/Events/Player/PlayerKilledPlayerEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@ public class PlayerKilledPlayerEventArgs : IEventArgs, IResponsiblePlayerEvent
/// <summary>
/// The killer.
/// </summary>
public BitPlayer Killer { get; init; }
public BitPlayer Killer { get; }

/// <summary>
/// The position of the killer.
/// </summary>
public Vector3 KillerPosition { get; init; }
public Vector3 KillerPosition { get; }

/// <summary>
/// The target.
/// </summary>
public BitPlayer Target { get; init; }
public BitPlayer Target { get; }

/// <summary>
/// The position of the target.
/// </summary>
public Vector3 TargetPosition { get; init; }
public Vector3 TargetPosition { get; }

/// <summary>
/// The tool used to kill the target.
/// </summary>
public string Tool { get; init; }
public string Tool { get; }

public PlayerBody BodyPart { get; init; }
public PlayerBody BodyPart { get; }

public ReasonOfDamage Source { get; init; }
public ReasonOfDamage Source { get; }

internal PlayerKilledPlayerEventArgs(BitServer server, BitPlayer killer, Vector3 killerPosition, BitPlayer target, Vector3 targetPosition, string tool, PlayerBody bodyPart, ReasonOfDamage source)
{
Expand Down
8 changes: 4 additions & 4 deletions api/BitMod/Events/Player/PlayerReportedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ public class PlayerReportedEventArgs : IEventArgs, IResponsiblePlayerEvent
/// <summary>
/// The player who made the report.
/// </summary>
public BitPlayer Reporter { get; init; }
public BitPlayer Reporter { get; }

/// <summary>
/// The player being reported.
/// </summary>
public BitPlayer Reported { get; init; }
public BitPlayer Reported { get; }

/// <summary>
/// The report reason.
/// </summary>
public ReportReason Reason { get; init; }
public ReportReason Reason { get; }

/// <summary>
/// Additional details about the report.
/// </summary>
public string Detail { get; init; }
public string Detail { get; }

internal PlayerReportedEventArgs(BitServer server, BitPlayer reporter, BitPlayer reported, ReportReason reason, string detail)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public class PlayerRequestingToChangeRoleEventArgs : IHookArgs, IResponsiblePlay
/// <summary>
/// The player requesting.
/// </summary>
public BitPlayer Player { get; init; }
public BitPlayer Player { get; }

/// <summary>
/// The role the player asking to change.
/// </summary>
public GameRole Role { get; init; }
public GameRole Role { get; }

public PlayerRequestingToChangeRoleEventArgs(BitServer server, BitPlayer player, GameRole role)
{
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Events/Player/PlayerSpawnedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PlayerSpawnedEventArgs(BitServer server, BitPlayer player)
/// <summary>
/// The player that just spawned.
/// </summary>
public BitPlayer Player { get; init; }
public BitPlayer Player { get; }

/// <inheritdoc />
public BitPlayer ResponsiblePlayer => Player;
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Events/Player/PlayerSpawningEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class PlayerSpawningEventArgs : IProducerArgs<SpawnRequest>, IResponsible
/// <summary>
/// The player who is spawning.
/// </summary>
public BitPlayer Player { get; init; }
public BitPlayer Player { get; }

/// <summary>
/// The spawn request (which you can modify).
Expand Down
6 changes: 3 additions & 3 deletions api/BitMod/Events/Player/PlayerTypedMessageEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ public class PlayerTypedMessageEventArgs : IHookArgs, IResponsiblePlayerEvent
/// <summary>
/// The player who typed the message.
/// </summary>
public BitPlayer Player { get; init; }
public BitPlayer Player { get; }

/// <summary>
/// The channel the message was sent in.
/// </summary>
public ChatChannel ChatChannel { get; init; }
public ChatChannel ChatChannel { get; }

/// <summary>
/// The message.
/// </summary>
public string Message { get; init; }
public string Message { get; }

internal PlayerTypedMessageEventArgs(BitServer server, BitPlayer player, ChatChannel chatChannel, string message)
{
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Events/Server/GameServerConnectedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public GameServerConnectedEventArgs(BitServer server)
/// <summary>
/// The server that successfully connected
/// </summary>
public BitServer Server { get; init; }
public BitServer Server { get; }

/// <inheritdoc />
public BitServer RelevantGameserver => Server;
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Events/Server/GameServerConnectingEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class GameServerConnectingEventArgs : IHookArgs
/// <summary>
/// IP of incoming connection
/// </summary>
public IPAddress IPAddress { get; init; }
public IPAddress IPAddress { get; }

public GameServerConnectingEventArgs(IPAddress ipAddress)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public GameServerDisconnectedEventArgs(BitServer server)
/// <summary>
/// The server that was disconnected
/// </summary>
public BitServer Server { get; init; }
public BitServer Server { get; }

/// <inheritdoc />
public BitServer RelevantGameserver => Server;
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Events/Server/GameServerReconnectedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public GameServerReconnectedEventArgs(BitServer server)
/// <summary>
/// The server that successfully reconnected
/// </summary>
public BitServer Server { get; init; }
public BitServer Server { get; }

/// <inheritdoc />
public BitServer RelevantGameserver => Server;
Expand Down
2 changes: 1 addition & 1 deletion api/BitMod/Events/Server/GameServerTickEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public GameServerTickEventArgs(BitServer server)
/// <summary>
/// The server that is currently ticking
/// </summary>
public BitServer Server { get; init; }
public BitServer Server { get; }

/// <inheritdoc />
public BitServer RelevantGameserver => Server;
Expand Down
4 changes: 2 additions & 2 deletions api/BitMod/Events/Stats/GetPlayerStatsEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ public class GetPlayerStatsEventArgs : IProducerArgs<PlayerStats>
/// <summary>
/// The player's SteamID
/// </summary>
public ulong SteamID { get; init; }
public ulong SteamID { get; }

/// <summary>
/// The player's stats (which you can modify)
/// </summary>
public PlayerStats OfficialStats { get; set; }
public PlayerStats OfficialStats { get; }

public GetPlayerStatsEventArgs(ulong steamID, PlayerStats officialStats)
{
Expand Down
4 changes: 2 additions & 2 deletions api/BitMod/Events/Stats/SavingPlayerStatsEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ public class SavingPlayerStatsEventArgs : IEventArgs
/// <summary>
/// The player's SteamID
/// </summary>
public ulong SteamID { get; init; }
public ulong SteamID { get; }

/// <summary>
/// The player's stats
/// </summary>
public PlayerStats PlayerStats { get; init; }
public PlayerStats PlayerStats { get; }

internal SavingPlayerStatsEventArgs(ulong steamID, PlayerStats playerStats)
{
Expand Down
5 changes: 3 additions & 2 deletions builtin/BitMod.Commands/BitMod.Commands.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>bitmod_commands</AssemblyName>
Expand All @@ -10,8 +10,9 @@

<OutDir>../../dev/plugins/$(AssemblyName)/</OutDir>
<PublishDir>../../build/plugins/$(AssemblyName)</PublishDir>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Private="true" Include="..\..\api\BitMod\BitMod.csproj" />
</ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion builtin/BitMod.Flags/BitMod.Flags.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>bitmod_flags</AssemblyName>
Expand All @@ -10,6 +10,7 @@

<OutDir>../../dev/plugins/$(AssemblyName)/</OutDir>
<PublishDir>../../build/plugins/$(AssemblyName)</PublishDir>
<LangVersion>latest</LangVersion>
</PropertyGroup>


Expand Down
3 changes: 2 additions & 1 deletion builtin/BitMod.Moderation/BitMod.Moderation.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>bitmod_moderation</AssemblyName>

<OutDir>../../dev/plugins/$(AssemblyName)/</OutDir>
<PublishDir>../../build/plugins/$(AssemblyName)</PublishDir>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion builtin/BitMod.Provision/BitMod.Provision.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<AssemblyName>bitmod_provision</AssemblyName>

<OutDir>../../dev/plugins/$(AssemblyName)/</OutDir>
<PublishDir>../../build/plugins/$(AssemblyName)</PublishDir>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 064d78b

Please sign in to comment.