Skip to content

Commit

Permalink
Update deps, add warning for non x86 series arch
Browse files Browse the repository at this point in the history
  • Loading branch information
sgkoishi committed Jan 3, 2025
1 parent c740aeb commit a56bcbf
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Core/AttachedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Chireiden.TShock.Omni;

public partial class Plugin
{
private readonly ConditionalWeakTable<TShockAPI.TSPlayer, AttachedData> _playerData = new ConditionalWeakTable<TShockAPI.TSPlayer, AttachedData>();
private readonly ConditionalWeakTable<TShockAPI.TSPlayer, AttachedData> _playerData = [];

public AttachedData? this[TShockAPI.TSPlayer player]
{
Expand Down Expand Up @@ -62,7 +62,7 @@ public AttachedData(TShockAPI.TSPlayer player, int logCount, List<Config.Limiter
this.Player = player;
this.PermissionHistory = new Ring<PermissionCheckHistory>(logCount);
this.RecentPings = Terraria.Main.item.Select(_ => new PendingAck()).ToArray();
this.DelayCommands = new List<DelayCommand>();
this.DelayCommands = [];
this.ChatSpamRestrict = chatLimiter.Select(lc => (Limiter) lc).ToArray();
}

Expand Down
2 changes: 0 additions & 2 deletions Core/CliConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ internal enum PendingConfig
/// </item>
/// </list>
/// </summary>

MaxPlayers,

/// <summary>
Expand Down Expand Up @@ -154,7 +153,6 @@ internal enum PendingConfig
/// </summary>
Port,


/// <summary>
/// Order:
/// <list type="bullet">
Expand Down
2 changes: 1 addition & 1 deletion Core/Enhancements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private void TAHook_NameCollision(TerrariaApi.Server.NameCollisionEventArgs args
}

internal Dictionary<string, string> _localizedCommandsMap = [];
private readonly System.Runtime.CompilerServices.ConditionalWeakTable<TShockAPI.Command, List<string>> _addedAlias = new();
private readonly System.Runtime.CompilerServices.ConditionalWeakTable<TShockAPI.Command, List<string>> _addedAlias = [];
private string Detour_HelpAliases(Func<object, TShockAPI.Command, string> orig, object _instance, TShockAPI.Command command)
{
var ac = this.config.Enhancements.Value.ShowCommandAlias.Value;
Expand Down
2 changes: 1 addition & 1 deletion Core/FirstChance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Chireiden.TShock.Omni;
public partial class Plugin
{
private readonly ThreadLocal<int> inFirstChance = new ThreadLocal<int>(() => 0);
private readonly HashSet<string> exceptions = new HashSet<string>();
private readonly HashSet<string> exceptions = [];

private void FirstChanceExceptionHandler(object? sender, FirstChanceExceptionEventArgs args)
{
Expand Down
7 changes: 3 additions & 4 deletions Core/Json.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@

namespace Chireiden.TShock.Omni.Json;


public static class JsonUtils
{
private static readonly List<JsonConverter> _jsonconverters = new List<JsonConverter>
{
private static readonly List<JsonConverter> _jsonconverters =
[
new OptionalConverter(),
new LimiterConverter(),
new StringEnumConverter(),
new PacketFilterConverter(),
};
];

public static T DeserializeConfig<T>(string value)
{
Expand Down
2 changes: 1 addition & 1 deletion Core/Modded.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public partial class Plugin
{
private readonly HashSet<PacketTypes> AllowedPackets = new HashSet<PacketTypes>();
private readonly HashSet<PacketTypes> AllowedPackets = [];
private void OTHook_Modded_GetData(object? sender, OTAPI.Hooks.MessageBuffer.GetDataEventArgs args)
{
static bool ModdedEarlyChatSpam(int whoAmI, PacketTypes packetId, HashSet<PacketTypes> allowedPackets)
Expand Down
2 changes: 1 addition & 1 deletion Core/PacketSpam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public partial class Plugin
internal class ConnectionStore
{
public ConcurrentDictionary<string, Connection> Connections { get; } = new ConcurrentDictionary<string, Connection>();
public ConditionalWeakTable<Terraria.Net.Sockets.ISocket, AttachedRawData> AttachedData { get; } = new ConditionalWeakTable<Terraria.Net.Sockets.ISocket, AttachedRawData>();
public ConditionalWeakTable<Terraria.Net.Sockets.ISocket, AttachedRawData> AttachedData { get; } = [];

internal class Connection
{
Expand Down
6 changes: 6 additions & 0 deletions Core/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public Plugin(Main game) : base(game)
Utils.AssemblyMutex(this);
AppDomain.CurrentDomain.AssemblyResolve += this.AssemblyResolveHandler;
AppDomain.CurrentDomain.FirstChanceException += this.FirstChanceExceptionHandler;
var pa = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture;
if (pa is not System.Runtime.InteropServices.Architecture.X64 and not System.Runtime.InteropServices.Architecture.X86)
{
Console.WriteLine($"TShock is running under {pa}, some features may not work.");
}

this.Order = -1_000_000;
this.ReadConfig(Utils.ConsolePlayer.Instance, true);

Expand Down
3 changes: 1 addition & 2 deletions Core/Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="TShock" Version="5.2.0">
<PackageReference Include="TShock" Version="5.2.1">
<ExcludeAssets>ContentFiles</ExcludeAssets>
</PackageReference>
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-hvm9-wc8j-mgrc" />
<None Include="../README.md" Pack="true" PackagePath="\" />
</ItemGroup>

Expand Down
3 changes: 1 addition & 2 deletions Misc/Misc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="TShock" Version="5.2.0">
<PackageReference Include="TShock" Version="5.2.1">
<ExcludeAssets>ContentFiles</ExcludeAssets>
</PackageReference>
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-hvm9-wc8j-mgrc" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions SourceGen/SourceGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23165.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
<Compile Include="../Core/LanguagePolyfill.cs" />
</ItemGroup>

Expand Down

0 comments on commit a56bcbf

Please sign in to comment.