diff --git a/TextChatMeow/Commands/ProximityChat.cs b/TextChatMeow/Commands/ProximityChat.cs index c1df4ea..ac58ebe 100644 --- a/TextChatMeow/Commands/ProximityChat.cs +++ b/TextChatMeow/Commands/ProximityChat.cs @@ -1,8 +1,7 @@ using CommandSystem; -using System; -using System.Linq; using Exiled.API.Features; using TextChatMeow.Model; +using TextChatMeow.MessageHandler; namespace TextChatMeow.Commands { @@ -11,7 +10,7 @@ public class ProximityChat : ICommand { public string Command => "ProximityChat"; - public string[] Aliases => new[] { "c" }; + public string[] Aliases => ["c"]; public string Description => Plugin.Instance.Translation.ProximityChatDescription; @@ -22,7 +21,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s if (!CheckPermission(player, out response)) return false; - var message = string.Join(" ", arguments.ToArray()); + var message = string.Join(" ", [.. arguments]); SendMessage(message, player); response = Plugin.Instance.Translation.ResponseWhenSend.Replace("{Message}", message); diff --git a/TextChatMeow/Commands/PublicChat.cs b/TextChatMeow/Commands/PublicChat.cs index 541b05f..3597472 100644 --- a/TextChatMeow/Commands/PublicChat.cs +++ b/TextChatMeow/Commands/PublicChat.cs @@ -1,8 +1,7 @@ -using CommandSystem; -using System; -using System.Linq; +using CommandSystem; using Exiled.API.Features; using TextChatMeow.Model; +using TextChatMeow.MessageHandler; namespace TextChatMeow.Commands { @@ -11,7 +10,7 @@ public class PublicChat : ICommand { public string Command => "PublicChat"; - public string[] Aliases => new[] { "pc" }; + public string[] Aliases => ["pc"]; public string Description => Plugin.Instance.Translation.PublicChatDescription; @@ -22,7 +21,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s if (!CheckPermission(player, out response)) return false; - var message = string.Join(" ", arguments.ToArray()); + var message = string.Join(" ", [.. arguments]); SendMessage(message, player); response = Plugin.Instance.Translation.ResponseWhenSend.Replace("{Message}", message); diff --git a/TextChatMeow/Commands/RadioChat.cs b/TextChatMeow/Commands/RadioChat.cs index d57ed5d..9690245 100644 --- a/TextChatMeow/Commands/RadioChat.cs +++ b/TextChatMeow/Commands/RadioChat.cs @@ -1,9 +1,8 @@ -using CommandSystem; +using CommandSystem; using Exiled.API.Features.Items; -using System; -using System.Linq; using Exiled.API.Features; using TextChatMeow.Model; +using TextChatMeow.MessageHandler; namespace TextChatMeow.Commands { @@ -12,7 +11,7 @@ public class RadioChat : ICommand { public string Command => "RadioChat"; - public string[] Aliases => new[] { "rc" }; + public string[] Aliases => ["rc"]; public string Description => Plugin.Instance.Translation.RadioChatDescription; @@ -23,7 +22,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s if (!CheckPermission(player, out response)) return false; - var message = string.Join(" ", arguments.ToArray()); + var message = string.Join(" ", [.. arguments]); SendMessage(message, player); response = Plugin.Instance.Translation.ResponseWhenSend.Replace("{Message}", message); diff --git a/TextChatMeow/Commands/TeamChat.cs b/TextChatMeow/Commands/TeamChat.cs index db45148..ba5978d 100644 --- a/TextChatMeow/Commands/TeamChat.cs +++ b/TextChatMeow/Commands/TeamChat.cs @@ -1,8 +1,7 @@ -using CommandSystem; -using System; -using System.Linq; +using CommandSystem; using Exiled.API.Features; using TextChatMeow.Model; +using TextChatMeow.MessageHandler; namespace TextChatMeow.Commands { @@ -11,7 +10,7 @@ public class TeamChat : ICommand { public string Command => "TeamChat"; - public string[] Aliases => new[] { "tc" }; + public string[] Aliases => new[] ["tc"]; public string Description => Plugin.Instance.Translation.TeamChatDescription; @@ -22,7 +21,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s if (!CheckPermission(player, out response)) return false; - var message = string.Join(" ", arguments.ToArray()); + var message = string.Join(" ", [.. arguments]); SendMessage(message, player); response = Plugin.Instance.Translation.ResponseWhenSend.Replace("{Message}", message); diff --git a/TextChatMeow/MessageHandler/DisplayManager.cs b/TextChatMeow/MessageHandler/DisplayManager.cs index e617c80..b0de8b2 100644 --- a/TextChatMeow/MessageHandler/DisplayManager.cs +++ b/TextChatMeow/MessageHandler/DisplayManager.cs @@ -1,8 +1,5 @@ using Exiled.API.Features; using MEC; -using System; -using System.Collections.Generic; -using System.Linq; using Exiled.Events.EventArgs.Player; using HintServiceMeow.Core.Utilities; using TextChatMeow.Model; @@ -14,37 +11,34 @@ namespace TextChatMeow.MessageHandler internal class DisplayManager { private static Config Config => Plugin.Instance.Config; - - private static readonly List MessagesManagers = new List(); + + private static readonly List MessagesManagers = []; private static CoroutineHandle _autoUpdateCoroutine; - - private readonly Hint _textChatTip = new Hint + private static readonly Hint hint = new() { Text = Config.ChatTip, YCoordinate = Config.MessageYCoordinate, Alignment = Config.MessageAlignment, }; - private readonly List _messageSlots = new List() - { - new Hint - { + private readonly Hint _textChatTip = hint; + private readonly List _messageSlots = + [ + new() { YCoordinate = Config.MessageYCoordinate + 25, Alignment = Config.MessageAlignment, SyncSpeed = HintSyncSpeed.Fast }, - new Hint - { + new() { YCoordinate = Config.MessageYCoordinate + 50, Alignment = Config.MessageAlignment, SyncSpeed = HintSyncSpeed.Fast }, - new Hint - { + new() { YCoordinate = Config.MessageYCoordinate + 75, Alignment = Config.MessageAlignment, SyncSpeed = HintSyncSpeed.Fast } - }; + ]; private readonly DateTime _timeCreated = DateTime.Now; private readonly TimeSpan _tipTimeToDisplay = TimeSpan.FromSeconds(Plugin.Instance.Config.TipDisappearTime); @@ -53,7 +47,7 @@ internal class DisplayManager public DisplayManager(VerifiedEventArgs ev) { - this._player = ev.Player; + _player = ev.Player; var playerDisplay = PlayerDisplay.Get(ev.Player); playerDisplay.AddHint(_textChatTip); diff --git a/TextChatMeow/MessageHandler/MessagesList.cs b/TextChatMeow/MessageHandler/MessagesList.cs index 3a684e7..5e47dc4 100644 --- a/TextChatMeow/MessageHandler/MessagesList.cs +++ b/TextChatMeow/MessageHandler/MessagesList.cs @@ -1,12 +1,9 @@ using Exiled.API.Features; using Exiled.Events.EventArgs.Server; using MEC; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; using TextChatMeow.Model; -namespace TextChatMeow +namespace TextChatMeow.MessageHandler { /// /// Contain all the messages that sent by the player @@ -32,7 +29,7 @@ public static void RemoveMessage(AbstractChatMessage ms) MessageList.Remove(ms); } - public static void ClearMessageList(RoundEndedEventArgs ev) + public static void ClearMessageList(RoundEndedEventArgs __) { MessageList.Clear(); } diff --git a/TextChatMeow/Plugin.cs b/TextChatMeow/Plugin.cs index 1f31972..1c40e43 100644 --- a/TextChatMeow/Plugin.cs +++ b/TextChatMeow/Plugin.cs @@ -1,6 +1,5 @@ using Exiled.API.Features; using Exiled.Events.EventArgs.Player; -using System; using TextChatMeow.MessageHandler; // V1.2.0 @@ -33,11 +32,11 @@ namespace TextChatMeow { internal class Plugin : Plugin { - public static Plugin Instance { get; set; } + public static Plugin Instance { get; set; } = new(); public override string Name => "TextChatMeow"; public override string Author => "MeowServerOwner"; - public override Version Version => new Version(1, 4, 2); + public override Version Version => new (1, 4, 2); public override void OnEnabled() { @@ -60,7 +59,9 @@ public override void OnDisabled() Exiled.Events.Handlers.Server.RoundEnded -= MessagesList.ClearMessageList; base.OnDisabled(); +#pragma warning disable CS8625 //null。 Instance = null; +#pragma warning restore CS8625 //null。 } } diff --git a/TextChatMeow/TextChatMeow.csproj b/TextChatMeow/TextChatMeow.csproj index 9950ccc..7f7477f 100644 --- a/TextChatMeow/TextChatMeow.csproj +++ b/TextChatMeow/TextChatMeow.csproj @@ -1,334 +1,54 @@ - - - + + - Debug - AnyCPU - {E8C2EDC2-9322-4A23-AD7C-666D58C68E4B} - Library - Properties - TextChatMeow - TextChatMeow - v4.8.1 - 512 - true + net4.8 + enable + enable + latest + x64 + True - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + + + True + + + + + + - - ..\..\HintServiceMeow\HintServiceMeow\bin\Debug\Assembly-CSharp.dll - - ..\..\SCPSL插件依赖\Dev\Assembly-CSharp-firstpass.dll - - - ..\..\SCPSL插件依赖\Dev\BouncyCastle.Cryptography.dll - - - ..\..\SCPSL插件依赖\Dev\Caress.dll - - - ..\packages\EXILED.8.8.0\lib\net48\CommandSystem.Core.dll - - - ..\packages\EXILED.8.8.0\lib\net48\Exiled.API.dll - - - ..\packages\EXILED.8.8.0\lib\net48\Exiled.CreditTags.dll - - - ..\packages\EXILED.8.8.0\lib\net48\Exiled.CustomItems.dll - - - ..\packages\EXILED.8.8.0\lib\net48\Exiled.CustomRoles.dll + E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp-firstpass.dll - - ..\packages\EXILED.8.8.0\lib\net48\Exiled.Events.dll + + E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\CommandSystem.Core.dll - - ..\packages\EXILED.8.8.0\lib\net48\Exiled.Loader.dll - - - ..\packages\EXILED.8.8.0\lib\net48\Exiled.Permissions.dll - - - False - ..\..\..\SCPSL-Framework\HintServiceMeow\HintServiceMeow\bin\Debug\HintServiceMeow.dll - - - ..\..\..\SCPSL-Framework\LogWritterMeow\LogWritterMeow\bin\Debug\LogWriterMeow.dll + + E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\LabApi.dll - ..\..\SCPSL插件依赖\Dev\Mirror.dll + E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Mirror.dll - - ..\..\SCPSL插件依赖\Dev\Mirror.Components.dll + + E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\NorthwoodLib.dll - - ..\packages\EXILED.8.8.0\lib\net48\NorthwoodLib.dll + + E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Pooling.dll - - ..\packages\EXILED.8.8.0\lib\net48\PluginAPI.dll - - - - - - - - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.AccessibilityModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.AIModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.AndroidJNIModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.AnimationModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.ARModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.AssetBundleModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.AudioModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.ClothModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.ClusterInputModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.ClusterRendererModule.dll + E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.dll - ..\..\SCPSL插件依赖\Dev\UnityEngine.CoreModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.CrashReportingModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.DirectorModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.DSPGraphModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.GameCenterModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.GIModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.GridModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.HotReloadModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.ImageConversionModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.IMGUIModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.InputLegacyModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.InputModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.JSONSerializeModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.LocalizationModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.NVIDIAModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.ParticleSystemModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.PerformanceReportingModule.dll + E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.CoreModule.dll - ..\..\SCPSL插件依赖\Dev\UnityEngine.Physics2DModule.dll + E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.Physics2DModule.dll - ..\..\SCPSL插件依赖\Dev\UnityEngine.PhysicsModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.ProfilerModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.PhysicsModule.dll - - ..\..\SCPSL插件依赖\Dev\UnityEngine.ScreenCaptureModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.SharedInternalsModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.SpriteMaskModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.SpriteShapeModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.StreamingModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.SubstanceModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.SubsystemsModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.TerrainModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.TerrainPhysicsModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.TextCoreFontEngineModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.TextCoreTextEngineModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.TextRenderingModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.TilemapModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.TLSModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UI.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UIElementsModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UIElementsNativeModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UIModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UmbraModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UNETModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UnityAnalyticsCommonModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UnityAnalyticsModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UnityConnectModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UnityCurlModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UnityTestProtocolModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UnityWebRequestAssetBundleModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UnityWebRequestAudioModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UnityWebRequestModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UnityWebRequestTextureModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.UnityWebRequestWWWModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.VehiclesModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.VFXModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.VideoModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.VirtualTexturingModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.VRModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.WindModule.dll - - - ..\..\SCPSL插件依赖\Dev\UnityEngine.XRModule.dll - - - ..\packages\EXILED.8.8.0\lib\net48\YamlDotNet.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + +