From 339bfcec992b44c5002fcbfa8bd026d112d393be Mon Sep 17 00:00:00 2001 From: Lilith Song Date: Wed, 20 Mar 2024 12:52:22 -0400 Subject: [PATCH] update for .net8 --- TinyCmds/Attributes/ArgumentsAttribute.cs | 4 +-- TinyCmds/CommandAssertionFailureException.cs | 1 - TinyCmds/PluginCommandManager.cs | 3 +- TinyCmds/TinyCmds.csproj | 2 +- TinyCmds/dalamud.props | 2 +- TinyCmds/packages.lock.json | 36 ++++++++++---------- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/TinyCmds/Attributes/ArgumentsAttribute.cs b/TinyCmds/Attributes/ArgumentsAttribute.cs index 28a8744..254621b 100644 --- a/TinyCmds/Attributes/ArgumentsAttribute.cs +++ b/TinyCmds/Attributes/ArgumentsAttribute.cs @@ -5,9 +5,9 @@ namespace PrincessRTFM.TinyCmds.Attributes; [AttributeUsage(AttributeTargets.Class)] internal class ArgumentsAttribute: Attribute { - public string ArgumentDescription => string.Join(" ", this.Arguments.Select(a => a.EndsWith("?") ? $"[{a.TrimEnd('?')}]" : $"<{a}>")); + public string ArgumentDescription => string.Join(" ", this.Arguments.Select(a => a.EndsWith('?') ? $"[{a.TrimEnd('?')}]" : $"<{a}>")); public string[] Arguments { get; } - public int RequiredArguments => this.Arguments.Where(a => !a.EndsWith("?")).Count(); + public int RequiredArguments => this.Arguments.Where(a => !a.EndsWith('?')).Count(); public int MaxArguments => this.Arguments.Length; public ArgumentsAttribute(params string[] args) => this.Arguments = args; diff --git a/TinyCmds/CommandAssertionFailureException.cs b/TinyCmds/CommandAssertionFailureException.cs index 5661c59..a3c84ae 100644 --- a/TinyCmds/CommandAssertionFailureException.cs +++ b/TinyCmds/CommandAssertionFailureException.cs @@ -8,5 +8,4 @@ public class CommandAssertionFailureException: Exception { public CommandAssertionFailureException() { } public CommandAssertionFailureException(string message) : base(message) { } public CommandAssertionFailureException(string message, Exception inner) : base(message, inner) { } - protected CommandAssertionFailureException(SerializationInfo info, StreamingContext context) : base(info, context) { } } diff --git a/TinyCmds/PluginCommandManager.cs b/TinyCmds/PluginCommandManager.cs index c3ef6cd..0e71237 100644 --- a/TinyCmds/PluginCommandManager.cs +++ b/TinyCmds/PluginCommandManager.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.Serialization; using Dalamud.Game.Command; @@ -31,7 +32,7 @@ public PluginCommandManager(Plugin core) { .Select(t => { try { ConstructorInfo ctor = t.GetConstructor(Array.Empty())!; - object instance = FormatterServices.GetUninitializedObject(t); + object instance = RuntimeHelpers.GetUninitializedObject(t); PropertyInfo prop = b .GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) .Where(prop => prop.PropertyType == p) diff --git a/TinyCmds/TinyCmds.csproj b/TinyCmds/TinyCmds.csproj index 9d9916b..07119ee 100644 --- a/TinyCmds/TinyCmds.csproj +++ b/TinyCmds/TinyCmds.csproj @@ -2,7 +2,7 @@ TinyCmds - 8.7.0 + 8.8.0 This plugin adds tiny and simple but useful chat commands, and nothing more. It finally has a UI specifically for command help. https://github.com/PrincessRTFM/TinyCommands Copyleft VariableVixen 2021 diff --git a/TinyCmds/dalamud.props b/TinyCmds/dalamud.props index cf46ef3..c882c06 100644 --- a/TinyCmds/dalamud.props +++ b/TinyCmds/dalamud.props @@ -4,7 +4,7 @@ x64 x64 - net7-windows + net8-windows Library false true diff --git a/TinyCmds/packages.lock.json b/TinyCmds/packages.lock.json index cf43069..2224f3b 100644 --- a/TinyCmds/packages.lock.json +++ b/TinyCmds/packages.lock.json @@ -1,19 +1,19 @@ { - "version": 1, - "dependencies": { - "net7.0-windows7.0": { - "DalamudPackager": { - "type": "Direct", - "requested": "[2.1.12, )", - "resolved": "2.1.12", - "contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg==" - }, - "XivCommon": { - "type": "Direct", - "requested": "[9.0.0, )", - "resolved": "9.0.0", - "contentHash": "avaBp3FmSCi/PiQhntCeBDYOHejdyTWmFtz4pRBVQQ8vHkmRx+YTk1la9dkYBMlXxRXKckEdH1iI1Fu61JlE7w==" - } - } - } -} \ No newline at end of file + "version": 1, + "dependencies": { + "net8.0-windows7.0": { + "DalamudPackager": { + "type": "Direct", + "requested": "[2.1.12, )", + "resolved": "2.1.12", + "contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg==" + }, + "XivCommon": { + "type": "Direct", + "requested": "[9.0.0, )", + "resolved": "9.0.0", + "contentHash": "avaBp3FmSCi/PiQhntCeBDYOHejdyTWmFtz4pRBVQQ8vHkmRx+YTk1la9dkYBMlXxRXKckEdH1iI1Fu61JlE7w==" + } + } + } +}