diff --git a/HelpSense/API/API.cs b/HelpSense/API/API.cs index 158cc97..5fbe00f 100644 --- a/HelpSense/API/API.cs +++ b/HelpSense/API/API.cs @@ -5,7 +5,7 @@ namespace HelpSense.API { public static class API { - public static List TimerHidden { get; } = new List(); + public static List TimerHidden { get; } = []; public static bool TryGetLog(string id, out PlayerLog log) { diff --git a/HelpSense/API/Extensions/StringBuilderExtensions.cs b/HelpSense/API/Extensions/StringBuilderExtensions.cs index ffc6f7f..e8f8173 100644 --- a/HelpSense/API/Extensions/StringBuilderExtensions.cs +++ b/HelpSense/API/Extensions/StringBuilderExtensions.cs @@ -1,21 +1,4 @@ -using GameCore; -using HelpSense.API.Features; -using MapGeneration.Distributors; -using PlayerRoles; -using PlayerRoles.PlayableScps.Scp079; -using PluginAPI.Core; -using Respawning; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; -using static HelpSense.API.Features.TimerView; -using HelpSense.Helper; - -namespace HelpSense.API.Extensions +namespace HelpSense.API.Extensions { public static class StringBuilderExtensions { diff --git a/HelpSense/API/Features/Pool/IPool.cs b/HelpSense/API/Features/Pool/IPool.cs index 2118df1..9b6ca7f 100644 --- a/HelpSense/API/Features/Pool/IPool.cs +++ b/HelpSense/API/Features/Pool/IPool.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelpSense.API.Features.Pool +namespace HelpSense.API.Features.Pool { public interface IPool { diff --git a/HelpSense/API/Features/TimerView.cs b/HelpSense/API/Features/TimerView.cs index 825fd0f..d2e5c9a 100644 --- a/HelpSense/API/Features/TimerView.cs +++ b/HelpSense/API/Features/TimerView.cs @@ -1,14 +1,10 @@ -using HelpSense.API.Extensions; -using HelpSense.ConfigSystem; +using HelpSense.ConfigSystem; using PluginAPI.Core; -using Respawning; using Serialization; using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace HelpSense.API.Features { @@ -64,27 +60,28 @@ public static void GetNew(string name) Log.Debug($"{name} 成功加载!", Plugin.Instance.Config.Debug); } - /* public string GetText(int? spectatorCount = null) - { - StringBuilder.Clear(); - StringBuilder.Append( - RespawnManager.Singleton._curSequence is not RespawnManager.RespawnSequencePhase.PlayingEntryAnimations or RespawnManager.RespawnSequencePhase.SpawningSelectedTeam - ? BeforeRespawnString - : DuringRespawnString); + /* public string GetText(int? spectatorCount = null) + { + StringBuilder.Clear(); + StringBuilder.Append( + RespawnManager.Singleton._curSequence is not RespawnManager.RespawnSequencePhase.PlayingEntryAnimations or RespawnManager.RespawnSequencePhase.SpawningSelectedTeam + ? BeforeRespawnString + : DuringRespawnString); - StringBuilder.SetAllProperties(spectatorCount); - StringBuilder.Replace('{', '[').Replace('}', ']'); + StringBuilder.SetAllProperties(spectatorCount); + StringBuilder.Replace('{', '[').Replace('}', ']'); - HintInterval++; - if (HintInterval == Properties.HintInterval) - { - HintInterval = 0; - IncrementHintIndex(); - } + HintInterval++; + if (HintInterval == Properties.HintInterval) + { + HintInterval = 0; + IncrementHintIndex(); + } - return StringBuilder.ToString(); - }*/ + return StringBuilder.ToString(); + }*/ + [Obsolete("SCP:SL 14.0 Obsolete", false)] private void IncrementHintIndex() { HintIndex++; diff --git a/HelpSense/API/InfoExtension.cs b/HelpSense/API/InfoExtension.cs index 47563a1..30c3ffc 100644 --- a/HelpSense/API/InfoExtension.cs +++ b/HelpSense/API/InfoExtension.cs @@ -2,14 +2,11 @@ namespace HelpSense.API { - using System; - using System.Linq; using HelpSense.API.Serialization; - using HelpSense.ConfigSystem; using HelpSense.Helper; using MEC; - using PlayerRoles; using PluginAPI.Core; + using System; public static class InfoExtension { diff --git a/HelpSense/API/Serialization/PlayerLog.cs b/HelpSense/API/Serialization/PlayerLog.cs index 58bfd17..57fc493 100644 --- a/HelpSense/API/Serialization/PlayerLog.cs +++ b/HelpSense/API/Serialization/PlayerLog.cs @@ -1,5 +1,5 @@ -using System; -using LiteDB; +using LiteDB; +using System; namespace HelpSense.API.Serialization { @@ -11,7 +11,7 @@ public class PlayerLog public DateTime LastLeftTime { get; set; } public int PlayedTimes { get; set; } public int PlayerKills { get; set; } - public int PlayerDeath { get; set; } + public int PlayerDeath { get; set; } public int PlayerSCPKills { get; set; } public float PlayerDamage { get; set; } public int RolePlayed { get; set; } diff --git a/HelpSense/Commands/ChatCommand/AcCommand.cs b/HelpSense/Commands/ChatCommand/AcCommand.cs index 1dcd7c8..3cab063 100644 --- a/HelpSense/Commands/ChatCommand/AcCommand.cs +++ b/HelpSense/Commands/ChatCommand/AcCommand.cs @@ -1,9 +1,7 @@ using CommandSystem; -using HelpSense.Helper; using HelpSense.Helper.Chat; using PluginAPI.Core; using System; -using System.Linq; namespace HelpSense.Commands.ChatCommand { @@ -12,7 +10,7 @@ public class AcCommand : ICommand { public string Command => "AC"; - public string[] Aliases => new[]{ "私聊管理" }; + public string[] Aliases => ["私聊管理"]; public string Description => "私聊管理"; @@ -32,13 +30,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s return false; } - if (arguments.At( 0).Contains("<")) - { - response = "包含敏感字符"; - return false; - } - - ChatHelper.SendMessage(player, ChatMessage.MessageType.AdminPrivateChat, string.Join(" ", arguments)); + ChatHelper.SendMessage(player, ChatMessage.MessageType.AdminPrivateChat, $"{string.Join(" ", arguments)}"); Log.Info(player.Nickname + " 发送了 " + arguments.At(0)); response = "发送成功"; diff --git a/HelpSense/Commands/ChatCommand/BcCommand.cs b/HelpSense/Commands/ChatCommand/BcCommand.cs index 5252849..abd6595 100644 --- a/HelpSense/Commands/ChatCommand/BcCommand.cs +++ b/HelpSense/Commands/ChatCommand/BcCommand.cs @@ -1,7 +1,5 @@ using CommandSystem; -using HelpSense.Helper; using HelpSense.Helper.Chat; -using PlayerRoles; using PluginAPI.Core; using System; @@ -12,7 +10,7 @@ public class BcCommand : ICommand { public string Command => "BC"; - public string[] Aliases => new[]{"广播"}; + public string[] Aliases => ["广播"]; public string Description => "全服聊天"; @@ -32,13 +30,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s return false; } - if (arguments.At(0).Contains("<")) - { - response = "包含敏感字符"; - return false; - } - - ChatHelper.SendMessage(player, ChatMessage.MessageType.BroadcastChat, string.Join(" ", arguments)); + ChatHelper.SendMessage(player, ChatMessage.MessageType.BroadcastChat, $"{string.Join(" ", arguments)}"); Log.Info(player.Nickname + " 发送了 " + arguments.At(0)); response = "发送成功"; diff --git a/HelpSense/Commands/ChatCommand/CCommand.cs b/HelpSense/Commands/ChatCommand/CCommand.cs index c414e18..494bdd4 100644 --- a/HelpSense/Commands/ChatCommand/CCommand.cs +++ b/HelpSense/Commands/ChatCommand/CCommand.cs @@ -1,7 +1,5 @@ using CommandSystem; -using HelpSense.Helper; using HelpSense.Helper.Chat; -using PlayerRoles; using PluginAPI.Core; using System; @@ -12,7 +10,7 @@ public class CCommand : ICommand { public string Command => "C"; - public string[] Aliases => new[]{"队伍广播"}; + public string[] Aliases => ["CC", "队伍广播"]; public string Description => "队伍聊天"; @@ -32,13 +30,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s return false; } - if (arguments.At(0).Contains("<")) - { - response = "包含敏感字符"; - return false; - } - - ChatHelper.SendMessage(player, ChatMessage.MessageType.TeamChat, string.Join(" ", arguments)); + ChatHelper.SendMessage(player, ChatMessage.MessageType.TeamChat, $"{string.Join(" ", arguments)}"); Log.Info(player.Nickname + " 发送了 " + arguments.At(0)); diff --git a/HelpSense/Commands/InfoCommand.cs b/HelpSense/Commands/InfoCommand.cs index ea90243..01730f2 100644 --- a/HelpSense/Commands/InfoCommand.cs +++ b/HelpSense/Commands/InfoCommand.cs @@ -11,7 +11,7 @@ public class InfoCommand : ICommand { public string Command => "Info"; - public string[] Aliases => new[] { "info" }; + public string[] Aliases => ["info"]; public string Description => "查询在本服务器游玩的时间和击杀人数"; @@ -19,7 +19,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { Player player; - if(sender is null || (player = Player.Get(sender)) is null) + if (sender is null || (player = Player.Get(sender)) is null) { response = "执行指令时发生错误,请稍后重试"; return false; diff --git a/HelpSense/Commands/RescueCommand.cs b/HelpSense/Commands/RescueCommand.cs index ae3af88..2b9203f 100644 --- a/HelpSense/Commands/RescueCommand.cs +++ b/HelpSense/Commands/RescueCommand.cs @@ -12,7 +12,7 @@ public class RescueCommand : ICommand { public string Command => "ZiJiu"; - public string[] Aliases => new[] { "Rescue", "ZJ" }; + public string[] Aliases => ["Rescue", "ZJ"]; public string Description => "卡虚空自救"; @@ -20,7 +20,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { Player player; - if(sender is null || (player = Player.Get(sender)) is null) + if (sender is null || (player = Player.Get(sender)) is null) { response = "执行指令时发生错误,请稍后再试"; return false; @@ -28,7 +28,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s WaypointBase.GetRelativePosition(player.Position, out byte id, out _); - if (!player.IsAlive || + if (!player.IsAlive || player.Zone is not MapGeneration.FacilityZone.None || !WaypointBase.TryGetWaypoint(id, out WaypointBase waypoint) || waypoint is ElevatorWaypoint) @@ -50,7 +50,7 @@ player.Zone is not MapGeneration.FacilityZone.None || player.IsGodModeEnabled = false; }); } - catch(Exception ex) + catch (Exception ex) { player.IsGodModeEnabled = false; Log.Error(ex.ToString()); diff --git a/HelpSense/Commands/Timer.cs b/HelpSense/Commands/Timer.cs index d7390f0..ca617dc 100644 --- a/HelpSense/Commands/Timer.cs +++ b/HelpSense/Commands/Timer.cs @@ -8,7 +8,7 @@ public class Timer : ICommand { public string Command => "timer"; - public string[] Aliases => Array.Empty(); + public string[] Aliases => []; public string Description => "显示或者关闭刷新时间"; diff --git a/HelpSense/Commands/VersionCommand.cs b/HelpSense/Commands/VersionCommand.cs index ab3a95c..d1c1e27 100644 --- a/HelpSense/Commands/VersionCommand.cs +++ b/HelpSense/Commands/VersionCommand.cs @@ -9,14 +9,14 @@ public class VersionCommand : ICommand { public string Command => "Version"; - public string[] Aliases => new[]{"VersionInfo", "VI"}; + public string[] Aliases => ["VersionInfo", "VI"]; public string Description => "查询HelpSense插件版本和信息"; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { var config = Plugin.Instance.Config; - + var sb = StringBuilderPool.Pool.Get(); //Version and update time @@ -47,10 +47,10 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s response = sb.ToString(); StringBuilderPool.Pool.Return(sb); - + return true; } - public string BoolTranslate(bool value) => value? "✔":"✖"; + public string BoolTranslate(bool value) => value ? "✔" : "✖"; } } diff --git a/HelpSense/ConfigSystem/Config.cs b/HelpSense/ConfigSystem/Config.cs index 3ca74fb..69af842 100644 --- a/HelpSense/ConfigSystem/Config.cs +++ b/HelpSense/ConfigSystem/Config.cs @@ -1,11 +1,10 @@ -using System.ComponentModel; +using HelpSense.Helper.Lobby; using PlayerRoles; -using System.Collections.Generic; -using HelpSense.Helper; using PluginAPI.Helpers; -using System.IO; using System; -using HelpSense.Helper.Lobby; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; namespace HelpSense.ConfigSystem { @@ -92,7 +91,7 @@ public class Config [Description("启用修改SCP血量系统")] public bool EnableChangeSCPHPSystem { get; set; } = true; [Description("SCP173,SCP939,SCP049,SCP049-2,SCP096,SCP106血量")] - public List SCPsHP { get; set; } = new List { 4200,2700,2200,400,2500,2200}; + public List SCPsHP { get; set; } = new List { 4200, 2700, 2200, 400, 2500, 2200 }; // ///////////////////////////////////////////////// [Description("启用.bc和.c聊天系统")] @@ -191,7 +190,7 @@ public class Config /// ////////////////////////////////////////////////////////// [Description("SCP-191")] - public bool SCP191 { get;set; } = true; + public bool SCP191 { get; set; } = true; [Description("子弹对SCP-191造成的单发伤害")] public float SCP191Ammo { get; set; } = 10; [Description("SCP-073")] diff --git a/HelpSense/ConfigSystem/TranslateConfig.cs b/HelpSense/ConfigSystem/TranslateConfig.cs index 4093b03..739784c 100644 --- a/HelpSense/ConfigSystem/TranslateConfig.cs +++ b/HelpSense/ConfigSystem/TranslateConfig.cs @@ -1,12 +1,7 @@ -using HelpSense.Helper; -using HelpSense.Helper.Chat; +using HelpSense.Helper.Chat; using PlayerRoles; -using System; using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace HelpSense.ConfigSystem { diff --git a/HelpSense/Helper/Chat/ChatHelper.cs b/HelpSense/Helper/Chat/ChatHelper.cs index 43c97db..32c1c58 100644 --- a/HelpSense/Helper/Chat/ChatHelper.cs +++ b/HelpSense/Helper/Chat/ChatHelper.cs @@ -1,17 +1,15 @@ -using MEC; -using HelpSense.API.Features.Pool; +using HelpSense.API.Features.Pool; +using HintServiceMeow.Core.Utilities; +using MEC; using PlayerRoles; using PluginAPI.Core; - using System; using System.Collections.Generic; - -using HintServiceMeow.Core.Utilities; using System.Linq; namespace HelpSense.Helper.Chat { - public class ChatMessage + public class ChatMessage(Player sender, ChatMessage.MessageType type, string message) { public enum MessageType { @@ -29,32 +27,23 @@ public enum MessageType TeamChat, } - public DateTime TimeSent { get; } + public DateTime TimeSent { get; } = DateTime.Now; - public MessageType Type { get; } - public string Message { get; } + public MessageType Type { get; } = type; + public string Message { get; } = message; - public string SenderName { get; } - public Team SenderTeam { get; } - public RoleTypeId SenderRole { get; } - public ChatMessage(Player sender, MessageType type, string message) - { - this.TimeSent = DateTime.Now; - this.SenderName = sender.DisplayNickname; - this.SenderTeam = sender.Team; - this.SenderRole = sender.Role; - this.Type = type; - this.Message = message; - } + public string SenderName { get; } = sender.DisplayNickname; + public Team SenderTeam { get; } = sender.Team; + public RoleTypeId SenderRole { get; } = sender.Role; } public static class ChatHelper { private static CoroutineHandle _coroutine; - private static readonly LinkedList MessageList= new(); + private static readonly LinkedList MessageList = new(); - private static readonly Dictionary MessageSlot = new(); + private static readonly Dictionary MessageSlot = []; private static bool HaveAccess(Player player, ChatMessage message) { @@ -78,7 +67,7 @@ private static IEnumerator MessageCoroutineMethod() foreach (var messageSlot in MessageSlot) { - if(!MessageList.Any(x => HaveAccess(messageSlot.Key, x))) + if (!MessageList.Any(x => HaveAccess(messageSlot.Key, x))) { messageSlot.Value.Text = string.Empty; continue; @@ -100,7 +89,7 @@ private static IEnumerator MessageCoroutineMethod() }) .Replace("{SenderNickname}", message.SenderName) .Replace("{SenderTeam}", Plugin.Instance.TranslateConfig.ChatSystemTeamTranslation[message.SenderTeam]) - .Replace("{SenderRole}" , Plugin.Instance.TranslateConfig.ChatSystemRoleTranslation[message.SenderRole]) + .Replace("{SenderRole}", Plugin.Instance.TranslateConfig.ChatSystemRoleTranslation[message.SenderRole]) .Replace("{SenderTeamColor}", message.SenderTeam switch { Team.SCPs => "red", diff --git a/HelpSense/Helper/Event/EventHelper.cs b/HelpSense/Helper/Event/EventHelper.cs index 96d510d..15f1d7c 100644 --- a/HelpSense/Helper/Event/EventHelper.cs +++ b/HelpSense/Helper/Event/EventHelper.cs @@ -1,5 +1,4 @@ using CustomPlayerEffects; -using HelpSense.ConfigSystem; using HelpSense.Helper.SCP; using InventorySystem.Items.Firearms; using MapGeneration; @@ -11,8 +10,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace HelpSense.Helper.Event { @@ -20,7 +17,7 @@ public static class EventHelper { public static Random Random = new Random(); - public static void OnTeamRespawn(SpawnableWaveBase spawnableWaveBase , List referenceHubs) + public static void OnTeamRespawn(SpawnableWaveBase spawnableWaveBase, List referenceHubs) { List players = new List(); referenceHubs.ForEach(x => players.Add(Player.Get(x))); diff --git a/HelpSense/Helper/Lobby/LobbyHelper.cs b/HelpSense/Helper/Lobby/LobbyHelper.cs index 354d99c..0a78a48 100644 --- a/HelpSense/Helper/Lobby/LobbyHelper.cs +++ b/HelpSense/Helper/Lobby/LobbyHelper.cs @@ -1,12 +1,10 @@ using HelpSense.Handler; -using HintServiceMeow.UI.Extension; using MEC; using PlayerRoles.Voice; using PluginAPI.Core; using System; using System.Collections.Generic; using System.Linq; -using UnityEngine; namespace HelpSense.Helper.Lobby { diff --git a/HelpSense/Helper/Misc/HideTutorialsHelper.cs b/HelpSense/Helper/Misc/HideTutorialsHelper.cs index 25ee382..438110d 100644 --- a/HelpSense/Helper/Misc/HideTutorialsHelper.cs +++ b/HelpSense/Helper/Misc/HideTutorialsHelper.cs @@ -1,14 +1,10 @@ using MEC; using Mirror; -using PlayerRoles.FirstPersonControl; using PlayerRoles; +using PlayerRoles.FirstPersonControl; using PluginAPI.Core; using RelativePositioning; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace HelpSense.Helper.Misc diff --git a/HelpSense/Helper/Misc/KeycardSystem.cs b/HelpSense/Helper/Misc/KeycardSystem.cs index d8cc104..8c4f725 100644 --- a/HelpSense/Helper/Misc/KeycardSystem.cs +++ b/HelpSense/Helper/Misc/KeycardSystem.cs @@ -1,7 +1,6 @@ using Interactables.Interobjects.DoorUtils; using InventorySystem.Items.Keycards; using MapGeneration.Distributors; -using PlayerRoles; using PluginAPI.Core; using System.Collections.Generic; using System.Linq; @@ -123,32 +122,32 @@ public static void Unlock(this Scp079Generator gen) } } - public static class DoorsUtils - { - private static readonly List BlacklistedDoors = new List(); - - public static List GetBlacklistedDoors() - { - return BlacklistedDoors; - } +public static class DoorsUtils +{ + private static readonly List BlacklistedDoors = []; - public static void AddBlacklistedDoor(string doorName) - { - BlacklistedDoors.Add(doorName); - } + public static List GetBlacklistedDoors() + { + return BlacklistedDoors; } - public static class LockerUtils + public static void AddBlacklistedDoor(string doorName) { - private static readonly List BlacklistedLockers = new List(); + BlacklistedDoors.Add(doorName); + } +} - public static List GetBlacklistedLockers() - { - return BlacklistedLockers; - } +public static class LockerUtils +{ + private static readonly List BlacklistedLockers = []; - public static void AddBlacklistedLocker(string lockerName) - { - BlacklistedLockers.Add(lockerName); - } - } \ No newline at end of file + public static List GetBlacklistedLockers() + { + return BlacklistedLockers; + } + + public static void AddBlacklistedLocker(string lockerName) + { + BlacklistedLockers.Add(lockerName); + } +} \ No newline at end of file diff --git a/HelpSense/Helper/Misc/RespawnHelper.cs b/HelpSense/Helper/Misc/RespawnHelper.cs index ff25370..88785b3 100644 --- a/HelpSense/Helper/Misc/RespawnHelper.cs +++ b/HelpSense/Helper/Misc/RespawnHelper.cs @@ -1,17 +1,4 @@ -using HelpSense.API.Features; -using Hints; -using HintServiceMeow.UI.Extension; -using MEC; -using NorthwoodLib.Pools; -using PlayerRoles; -using PluginAPI.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelpSense.Helper.Misc +namespace HelpSense.Helper.Misc { public class RespawnHelper { diff --git a/HelpSense/Helper/Misc/SpectatorHelper.cs b/HelpSense/Helper/Misc/SpectatorHelper.cs index 23776dd..1a153af 100644 --- a/HelpSense/Helper/Misc/SpectatorHelper.cs +++ b/HelpSense/Helper/Misc/SpectatorHelper.cs @@ -1,5 +1,4 @@ -using HintServiceMeow.UI.Extension; -using MEC; +using MEC; using NorthwoodLib.Pools; using PlayerRoles; using PlayerRoles.Spectating; diff --git a/HelpSense/Helper/SCP/SCPHPChangeSystem.cs b/HelpSense/Helper/SCP/SCPHPChangeSystem.cs index 8f9effd..d662187 100644 --- a/HelpSense/Helper/SCP/SCPHPChangeSystem.cs +++ b/HelpSense/Helper/SCP/SCPHPChangeSystem.cs @@ -5,7 +5,7 @@ namespace HelpSense.Helper.SCP { public class SCPHPChangeSystem { - public static Dictionary healthDict = new Dictionary() + public static Dictionary healthDict = new() { [RoleTypeId.Scp173] = Plugin.Instance.Config.SCPsHP[0], [RoleTypeId.Scp939] = Plugin.Instance.Config.SCPsHP[1], diff --git a/HelpSense/Helper/SCP/SCPHelper.cs b/HelpSense/Helper/SCP/SCPHelper.cs index 4f4f4fb..b670ff1 100644 --- a/HelpSense/Helper/SCP/SCPHelper.cs +++ b/HelpSense/Helper/SCP/SCPHelper.cs @@ -1,10 +1,6 @@ using PlayerRoles; using PluginAPI.Core; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace HelpSense.Helper.SCP diff --git a/HelpSense/Helper/SpecialRole/SpecialRoleHelper.cs b/HelpSense/Helper/SpecialRole/SpecialRoleHelper.cs index 6188920..5da67ec 100644 --- a/HelpSense/Helper/SpecialRole/SpecialRoleHelper.cs +++ b/HelpSense/Helper/SpecialRole/SpecialRoleHelper.cs @@ -1,19 +1,10 @@ using CustomPlayerEffects; -using HintServiceMeow.Core.Enum; -using HintServiceMeow.Core.Extension; -using HintServiceMeow.Core.Models.Hints; +using HelpSense.ConfigSystem; using HintServiceMeow.UI.Extension; -using InventorySystem.Items.Firearms; -using InventorySystem.Items.Firearms.Attachments; -using InventorySystem.Items.Test; using MEC; using PlayerRoles; using PluginAPI.Core; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace HelpSense.Helper.SpecialRole { @@ -21,19 +12,20 @@ public static class SpecialRoleHelper { public static IEnumerator SpecialRoleInfoHandle() { + TranslateConfig config = Plugin.Instance.TranslateConfig; int SCP703ItemTime = 0; - string SCP029SpecialIntroduction = Plugin.Instance.TranslateConfig.SCP029SpecialIntroduction; - string SCP703SpecialIntroduction = Plugin.Instance.TranslateConfig.SCP703SpecialIntroduction; - string SCP347SpecialIntroduction = Plugin.Instance.TranslateConfig.SCP347SpecialIntroduction; - string SCP1093SpecialIntroduction = Plugin.Instance.TranslateConfig.SCP1093SpecialIntroduction; - string SCP191SpecialIntroduction = Plugin.Instance.TranslateConfig.SCP191SpecialIntroduction; - string SCP2936SpecialIntroduction = Plugin.Instance.TranslateConfig.SCP2936SpecialIntroduction; - string SCP073AbelSpecialIntroduction = Plugin.Instance.TranslateConfig.SCP073AbelSpecialIntroduction; - string SCP073CainSpecialIntroduction = Plugin.Instance.TranslateConfig.SCP073CainSpecialIntroduction; - string SkynetSpecialIntroduction = Plugin.Instance.TranslateConfig.SkynetSpecialIntroduction; - string SeeNoEvilSpecialIntroduction = Plugin.Instance.TranslateConfig.SeeNoEvilSpecialIntroduction; - - List SCP703StringList = Plugin.Instance.TranslateConfig.SCP703SkillIntroduction; + string SCP029SpecialIntroduction = config.SCP029SpecialIntroduction; + string SCP703SpecialIntroduction = config.SCP703SpecialIntroduction; + string SCP347SpecialIntroduction = config.SCP347SpecialIntroduction; + string SCP1093SpecialIntroduction = config.SCP1093SpecialIntroduction; + string SCP191SpecialIntroduction = config.SCP191SpecialIntroduction; + string SCP2936SpecialIntroduction = config.SCP2936SpecialIntroduction; + string SCP073AbelSpecialIntroduction = config.SCP073AbelSpecialIntroduction; + string SCP073CainSpecialIntroduction = config.SCP073CainSpecialIntroduction; + string SkynetSpecialIntroduction = config.SkynetSpecialIntroduction; + string SeeNoEvilSpecialIntroduction = config.SeeNoEvilSpecialIntroduction; + + List SCP703StringList = config.SCP703SkillIntroduction; while (true) { @@ -46,7 +38,7 @@ public static IEnumerator SpecialRoleInfoHandle() if (Plugin.Instance.SCP029 != null && Plugin.Instance.SCP029.Player != null) { - Plugin.Instance.SCP029.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP029SpecialIntroduction, Plugin.Instance.TranslateConfig.SCP029SkillIntroduction , 1.25f); + Plugin.Instance.SCP029.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP029SpecialIntroduction, config.SCP029SkillIntroduction, 1.25f); } if (Plugin.Instance.SCP703 != null && Plugin.Instance.SCP703.Player != null) @@ -67,7 +59,7 @@ public static IEnumerator SpecialRoleInfoHandle() Plugin.Instance.SCP703.Player.AddItem(itemType); } - Plugin.Instance.SCP703.Player.GetPlayerUi().CommonHint.ShowOtherHint(Plugin.Instance.TranslateConfig.SCP703ReceivedItemHint, 5); + Plugin.Instance.SCP703.Player.GetPlayerUi().CommonHint.ShowOtherHint(config.SCP703ReceivedItemHint, 5); SCP703ItemTime = Plugin.Instance.Config.SCP703ItemTime * 60; } } @@ -85,24 +77,24 @@ public static IEnumerator SpecialRoleInfoHandle() } }); - Plugin.Instance.SCP703.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP703SpecialIntroduction, SCP703StringList.ToArray(), 1.25f); + Plugin.Instance.SCP703.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP703SpecialIntroduction, [.. SCP703StringList], 1.25f); } if (Plugin.Instance.SCP347 != null && Plugin.Instance.SCP347.Player != null) { Plugin.Instance.SCP347.Player.EffectsManager.EnableEffect(); - Plugin.Instance.SCP347.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP347SpecialIntroduction, Plugin.Instance.TranslateConfig.SCP347SkillIntroduction, 1.25f); + Plugin.Instance.SCP347.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP347SpecialIntroduction, config.SCP347SkillIntroduction, 1.25f); } if (Plugin.Instance.SCP1093 != null && Plugin.Instance.SCP1093.Player != null) { - Plugin.Instance.SCP1093.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP1093SpecialIntroduction, Plugin.Instance.TranslateConfig.SCP1093SkillIntroduction.ToArray(), 1.25f); + Plugin.Instance.SCP1093.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP1093SpecialIntroduction, [.. config.SCP1093SkillIntroduction], 1.25f); } if (Plugin.Instance.SCP2936 != null && Plugin.Instance.SCP2936.Player != null) { - Plugin.Instance.SCP2936.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP2936SpecialIntroduction, Plugin.Instance.TranslateConfig.SCP29361SkillIntroduction, 1.25f); + Plugin.Instance.SCP2936.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP2936SpecialIntroduction, config.SCP29361SkillIntroduction, 1.25f); } if (Plugin.Instance.SCP073 != null && Plugin.Instance.SCP073.Player != null) @@ -110,31 +102,31 @@ public static IEnumerator SpecialRoleInfoHandle() switch (Plugin.Instance.SCP073.Player.Team) { case Team.FoundationForces: - Plugin.Instance.SCP073.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP073AbelSpecialIntroduction, Plugin.Instance.TranslateConfig.SCP073AbelSkillIntroduction, 1.25f); + Plugin.Instance.SCP073.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP073AbelSpecialIntroduction, config.SCP073AbelSkillIntroduction, 1.25f); break; case Team.ChaosInsurgency: - Plugin.Instance.SCP073.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP073CainSpecialIntroduction, Plugin.Instance.TranslateConfig.SCP073CainSkillIntroduction, 1.25f); + Plugin.Instance.SCP073.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP073CainSpecialIntroduction, config.SCP073CainSkillIntroduction, 1.25f); break; } } if (Plugin.Instance.SCP191 != null && Plugin.Instance.SCP191.Player != null) { - Plugin.Instance.SCP191.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP191SpecialIntroduction, Plugin.Instance.TranslateConfig.SCP191SkillIntroduction.ToArray(), 1.25f); + Plugin.Instance.SCP191.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP191SpecialIntroduction, [.. config.SCP191SkillIntroduction], 1.25f); } if (!Plugin.Instance.SkynetPlayers.IsEmpty()) { foreach (var Player in Plugin.Instance.SkynetPlayers) { - Player.GetPlayerUi().CommonHint.ShowRoleHint(SkynetSpecialIntroduction, Plugin.Instance.TranslateConfig.SkynetSkillIntroduction.ToArray(), 1.25f); + Player.GetPlayerUi().CommonHint.ShowRoleHint(SkynetSpecialIntroduction, [.. config.SkynetSkillIntroduction], 1.25f); } } if (!Plugin.Instance.SeePlayers.IsEmpty()) { foreach (var Player in Plugin.Instance.SeePlayers) { - Player.GetPlayerUi().CommonHint.ShowRoleHint(SeeNoEvilSpecialIntroduction, Plugin.Instance.TranslateConfig.SeeNoEvilSkillIntroduction.ToArray(), 1.25f); + Player.GetPlayerUi().CommonHint.ShowRoleHint(SeeNoEvilSpecialIntroduction, [.. config.SeeNoEvilSkillIntroduction], 1.25f); } } } diff --git a/HelpSense/Helper/XHelper.cs b/HelpSense/Helper/XHelper.cs index bc02adc..57fabae 100644 --- a/HelpSense/Helper/XHelper.cs +++ b/HelpSense/Helper/XHelper.cs @@ -1,30 +1,18 @@ -using InventorySystem.Items.Firearms; -using InventorySystem.Items.Firearms.Attachments; -using InventorySystem.Items.Firearms.BasicMessages; - +using HelpSense.API.Features.Pool; +using Interactables.Interobjects.DoorUtils; +using MEC; +using Mirror; using PlayerRoles; -using PlayerRoles.FirstPersonControl.Spawnpoints; using PlayerRoles.FirstPersonControl; - +using PlayerRoles.FirstPersonControl.Spawnpoints; using PluginAPI.Core; using PluginAPI.Core.Items; - +using Respawning; using System; using System.Collections.Generic; using System.Linq; using System.Text; - -using MEC; -using Respawning; using UnityEngine; -using CustomPlayerEffects; -using Interactables.Interobjects.DoorUtils; -using Mirror; - -using HelpSense.API.Features.Pool; -using HelpSense.ConfigSystem; - -using HintServiceMeow.UI.Extension; namespace HelpSense.Helper { @@ -53,9 +41,9 @@ public static Player GetRandomPlayer(RoleTypeId roleTypeId) return null; } - public static Player GetRandomPlayer(RoleTypeId roleTypeId , List playerList) + public static Player GetRandomPlayer(RoleTypeId roleTypeId, List playerList) { - List players = new List(); + List players = []; foreach (Player player in playerList) { if (player.Role == roleTypeId) @@ -81,7 +69,7 @@ public static Player GetRandomPlayer(List playerList) } public static Player GetRandomSpecialPlayer(RoleTypeId roleTypeId) { - List players = new List(); + List players = []; foreach (Player player in SpecialPlayerList) { if (player.Role == roleTypeId) @@ -192,8 +180,8 @@ public static IEnumerator SCP191CoroutineMethod(Player player) yield break; } - player.ReceiveHint(Plugin.Instance.TranslateConfig.SCP191BatteryHintShow.Replace("%Battery%" , d.ToString()), 11);//Use compatibility adapter - + player.ReceiveHint(Plugin.Instance.TranslateConfig.SCP191BatteryHintShow.Replace("%Battery%", d.ToString()), 11);//Use compatibility adapter + if (player.Room.Name is MapGeneration.RoomName.Hcz079) { if (d <= 4000) @@ -324,36 +312,16 @@ public static bool IsKeycard(this ItemType type) public static Team GetTeam2(this RoleTypeId typeId) { - switch (typeId) + return typeId switch { - case RoleTypeId.ChaosConscript: - case RoleTypeId.ChaosRifleman: - case RoleTypeId.ChaosRepressor: - case RoleTypeId.ChaosMarauder: - return Team.ChaosInsurgency; - case RoleTypeId.Scientist: - return Team.Scientists; - case RoleTypeId.ClassD: - return Team.ClassD; - case RoleTypeId.Scp173: - case RoleTypeId.Scp106: - case RoleTypeId.Scp049: - case RoleTypeId.Scp079: - case RoleTypeId.Scp096: - case RoleTypeId.Scp0492: - case RoleTypeId.Scp939: - return Team.SCPs; - case RoleTypeId.NtfSpecialist: - case RoleTypeId.NtfSergeant: - case RoleTypeId.NtfCaptain: - case RoleTypeId.NtfPrivate: - case RoleTypeId.FacilityGuard: - return Team.FoundationForces; - case RoleTypeId.Tutorial: - return Team.OtherAlive; - default: - return Team.Dead; - } + RoleTypeId.ChaosConscript or RoleTypeId.ChaosRifleman or RoleTypeId.ChaosRepressor or RoleTypeId.ChaosMarauder => Team.ChaosInsurgency, + RoleTypeId.Scientist => Team.Scientists, + RoleTypeId.ClassD => Team.ClassD, + RoleTypeId.Scp173 or RoleTypeId.Scp106 or RoleTypeId.Scp049 or RoleTypeId.Scp079 or RoleTypeId.Scp096 or RoleTypeId.Scp0492 or RoleTypeId.Scp939 or RoleTypeId.Scp3114 => Team.SCPs, + RoleTypeId.NtfSpecialist or RoleTypeId.NtfSergeant or RoleTypeId.NtfCaptain or RoleTypeId.NtfPrivate or RoleTypeId.FacilityGuard => Team.FoundationForces, + RoleTypeId.Tutorial => Team.OtherAlive, + _ => Team.Dead, + }; } public static void Broadcast(string text, ushort time, Broadcast.BroadcastFlags broadcastFlags) @@ -388,7 +356,7 @@ public static void ChangeAppearance(this Player player, RoleTypeId type) { foreach (var pl in PlayerList.Where(x => x.PlayerId != player.PlayerId && x.IsReady)) { - pl.Connection.Send(new RoleSyncInfo(player.ReferenceHub , type , pl.ReferenceHub)); + pl.Connection.Send(new RoleSyncInfo(player.ReferenceHub, type, pl.ReferenceHub)); } } diff --git a/HelpSense/MonoBehaviors/PlayerGlowBehavior.cs b/HelpSense/MonoBehaviors/PlayerGlowBehavior.cs index a6ee395..f1318e4 100644 --- a/HelpSense/MonoBehaviors/PlayerGlowBehavior.cs +++ b/HelpSense/MonoBehaviors/PlayerGlowBehavior.cs @@ -1,10 +1,10 @@ -using Mirror; -using PlayerRoles; -using UnityEngine; -using PluginAPI.Core; -using AdminToys; +using AdminToys; using HelpSense.Helper; using MEC; +using Mirror; +using PlayerRoles; +using PluginAPI.Core; +using UnityEngine; namespace HelpSense.MonoBehaviors { diff --git a/HelpSense/MonoBehaviors/PlayerLightBehavior.cs b/HelpSense/MonoBehaviors/PlayerLightBehavior.cs index f1dd99c..2af3cf4 100644 --- a/HelpSense/MonoBehaviors/PlayerLightBehavior.cs +++ b/HelpSense/MonoBehaviors/PlayerLightBehavior.cs @@ -1,10 +1,7 @@ -using Mirror; -using PlayerRoles; -using UnityEngine; +using AdminToys; +using Mirror; using PluginAPI.Core; -using AdminToys; -using HelpSense.Helper; -using MEC; +using UnityEngine; namespace HelpSense.MonoBehaviors { diff --git a/HelpSense/Patches/PositionSyncingPatch.cs b/HelpSense/Patches/PositionSyncingPatch.cs index db722ee..49db609 100644 --- a/HelpSense/Patches/PositionSyncingPatch.cs +++ b/HelpSense/Patches/PositionSyncingPatch.cs @@ -1,12 +1,11 @@ -using System.Collections.Generic; -using System.Reflection.Emit; -using HarmonyLib; -using HelpSense.Helper; +using HarmonyLib; using HelpSense.Helper.Misc; using NorthwoodLib.Pools; using PlayerRoles; using PlayerRoles.FirstPersonControl.NetworkMessages; using PlayerRoles.Spectating; +using System.Collections.Generic; +using System.Reflection.Emit; using UnityEngine; namespace HelpSense.Patches @@ -20,12 +19,12 @@ private static IEnumerable Transpiler(IEnumerable x.opcode == OpCodes.Newobj); - newInstructions.InsertRange(index, new CodeInstruction[] - { + newInstructions.InsertRange(index, + [ new (OpCodes.Ldarg_1), new (OpCodes.Ldarg_0), new (OpCodes.Call, AccessTools.Method(typeof(PositionSyncingPatch), nameof(CheckTutorialPosition))), - }); + ]); foreach (CodeInstruction instruction in newInstructions) yield return instruction; diff --git a/HelpSense/Plugin.cs b/HelpSense/Plugin.cs index 591c7a6..e888a63 100644 --- a/HelpSense/Plugin.cs +++ b/HelpSense/Plugin.cs @@ -1,53 +1,42 @@ -using System; -using System.IO; -using System.Reflection; -using System.Collections.Generic; -using System.Linq; - -using PluginAPI.Core; -using PluginAPI.Events; -using PluginAPI.Core.Attributes; - -using PlayerRoles.Voice; -using PlayerRoles.PlayableScps.Scp079; -using PlayerRoles.PlayableScps.Scp096; - +using CustomPlayerEffects; +using GameCore; +using HarmonyLib; using HelpSense.API; -using HelpSense.MonoBehaviors; -using HelpSense.Helper; -using HelpSense.API.Features; -using HelpSense.Handler; using HelpSense.ConfigSystem; - +using HelpSense.Handler; +using HelpSense.Helper; +using HelpSense.Helper.Chat; +using HelpSense.Helper.Event; +using HelpSense.Helper.Lobby; +using HelpSense.Helper.Misc; +using HelpSense.Helper.SCP; +using HelpSense.Helper.SpecialRole; +using HelpSense.MonoBehaviors; +using HintServiceMeow.UI.Extension; using InventorySystem; using InventorySystem.Items; using InventorySystem.Items.Firearms; using InventorySystem.Items.Keycards; -using InventorySystem.Items.Firearms.Attachments; - -using GameCore; -using PlayerStatsSystem; -using MapGeneration.Distributors; -using Respawning; -using MapGeneration; -using Footprinting; using LiteDB; -using CustomPlayerEffects; +using MapGeneration; +using MapGeneration.Distributors; using MEC; using PlayerRoles; +using PlayerRoles.PlayableScps.Scp096; +using PlayerRoles.Voice; +using PlayerStatsSystem; +using PluginAPI.Core; +using PluginAPI.Core.Attributes; +using PluginAPI.Events; +using Respawning; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; using UnityEngine; -using HarmonyLib; - using static Broadcast; using Log = PluginAPI.Core.Log; -using HintServiceMeow.UI.Extension; -using HelpSense.Helper.SpecialRole; -using HelpSense.Helper.Lobby; -using HelpSense.Helper.SCP; -using HelpSense.Helper.Chat; -using HelpSense.Helper.Misc; -using InventorySystem.Items.Firearms.Modules; -using HelpSense.Helper.Event; namespace HelpSense { @@ -105,11 +94,11 @@ public class Plugin public ushort SCP1056Id = 0; public ItemBase SCP1056Base; - + public static System.Version PluginVersion => new(1, 3, 7); public static DateTime LastUpdateTime => new(2024, 12, 10, 14, 17, 57); public static System.Version RequiredGameVersion => new(14, 0, 0); - + [PluginEntryPoint("HelpSense", "1.3.7", "HelpSense综合服务器插件", "X小左")] private void LoadPlugin() { @@ -153,9 +142,9 @@ public void OnWaitingForPlayers(WaitingForPlayersEvent ev) if (LobbyTimer.IsRunning) Timing.KillCoroutines(LobbyTimer); - if (CurLobbyLocationType == LobbyLocationType.Intercom && Config.DisplayInIcom) + if (CurLobbyLocationType == LobbyLocationType.Intercom && Config.DisplayInIcom) LobbyTimer = Timing.RunCoroutine(LobbyHelper.LobbyIcomTimer()); - else + else LobbyTimer = Timing.RunCoroutine(LobbyHelper.LobbyTimer()); }); } @@ -320,7 +309,7 @@ bool OnDamage(PlayerDamageEvent ev) void OnPlayerLeft(PlayerLeftEvent ev) { var player = ev.Player; - + if (player == null || string.IsNullOrEmpty(player.UserId)) return; if (Config.SavePlayersInfo) @@ -360,7 +349,7 @@ void OnPlayerEscape(PlayerEscapeEvent ev) { if (newRole == RoleTypeId.NtfSpecialist) { - var firearm = player.ReferenceHub.inventory.ServerAddItem(ItemType.ParticleDisruptor , ItemAddReason.AdminCommand) as ParticleDisruptor; + var firearm = player.ReferenceHub.inventory.ServerAddItem(ItemType.ParticleDisruptor, ItemAddReason.AdminCommand) as ParticleDisruptor; //TODO:子弹 /*firearm.Status = new FirearmStatus(5, FirearmStatusFlags.MagazineInserted, firearm.GetCurrentAttachmentsCode()); firearm.TryGetModule(out var module); @@ -393,7 +382,7 @@ void OnSpecialTeamRespawn(TeamRespawnEvent ev) { SkynetSpawned = true; Cassie.Clear(); - XHelper.MessageTranslated($"MTFUnit Kappa , 10 , and , Mu , 7 , designated scan neck , HasEntered , they will help contain scp 0 7 9 , AllRemaining , AwaitingRecontainment {XHelper.PlayerList.Where(x => x.IsSCP).Count()} SCPSubjects", TranslateConfig.SkynetCassie.Replace("%SCPNum%" , XHelper.PlayerList.Where(x => x.IsSCP).Count().ToString())); + XHelper.MessageTranslated($"MTFUnit Kappa , 10 , and , Mu , 7 , designated scan neck , HasEntered , they will help contain scp 0 7 9 , AllRemaining , AwaitingRecontainment {XHelper.PlayerList.Where(x => x.IsSCP).Count()} SCPSubjects", TranslateConfig.SkynetCassie.Replace("%SCPNum%", XHelper.PlayerList.Where(x => x.IsSCP).Count().ToString())); foreach (Player player in players) { @@ -521,7 +510,7 @@ void OnTeamRespawn(TeamRespawnEvent ev) Timing.CallDelayed(1f, () => { Player player = XHelper.GetRandomPlayer(RoleTypeId.ChaosRepressor, specialPlayers); - + if (player != null) { SpawnSCP2936 = true; @@ -577,12 +566,12 @@ void OnTeamRespawn(TeamRespawnEvent ev) public void OnRoundStarted(RoundStartEvent ev) { WaveManager.OnWaveSpawned += EventHelper.OnTeamRespawn; - Log.Debug("订阅OnWaveSpawned事件" , Config.Debug); + Log.Debug("订阅OnWaveSpawned事件", Config.Debug); if (Config.SavePlayersInfo) { Timing.RunCoroutine(InfoExtension.CollectInfo()); - Log.Debug("开始记录玩家信息" , Config.Debug); + Log.Debug("开始记录玩家信息", Config.Debug); } if (Config.InfiniteAmmo) @@ -592,7 +581,7 @@ public void OnRoundStarted(RoundStartEvent ev) Timing.RunCoroutine(XHelper.InAmmo()); }); } - + if (Config.EnableSCP703) { Timing.CallDelayed(0.5f, () => @@ -625,7 +614,7 @@ public void OnRoundStarted(RoundStartEvent ev) player.ClearInventory(); player.AddItem(ItemType.KeycardContainmentEngineer); - var firearm = player.ReferenceHub.inventory.ServerAddItem(ItemType.GunCOM18 , ItemAddReason.AdminCommand); + var firearm = player.ReferenceHub.inventory.ServerAddItem(ItemType.GunCOM18, ItemAddReason.AdminCommand); //TODO:子弹 //((Firearm)(firearm)).Status = new FirearmStatus(((Firearm)(firearm)).AmmoManagerModule.MaxAmmo, ((Firearm)(firearm)).Status.Flags, ((Firearm)(firearm)).GetCurrentAttachmentsCode()); @@ -642,7 +631,7 @@ public void OnRoundStarted(RoundStartEvent ev) }; }); } - + if (Config.SCP347) { Timing.CallDelayed(1.2f, () => @@ -672,7 +661,7 @@ public void OnRoundStarted(RoundStartEvent ev) if (player != null) { - SCP1093 = new SCPHelper(player , "SCP-1093" , "yellow"); + SCP1093 = new SCPHelper(player, "SCP-1093", "yellow"); player.GameObject.AddComponent(); @@ -993,7 +982,7 @@ void OnRoundEnd(RoundEndEvent ev) SeePlayers.Clear(); WaveManager.OnWaveSpawned -= EventHelper.OnTeamRespawn; - Log.Debug("取消订阅OnWaveSpawned事件" , Config.Debug); + Log.Debug("取消订阅OnWaveSpawned事件", Config.Debug); if (Config.EnableRoundEndInfo) { @@ -1057,7 +1046,7 @@ void OnPlayerSpawn(PlayerSpawnEvent ev) { if (player.Role is RoleTypeId.ClassD) { - player.ReferenceHub.inventory.ServerAddItem(Config.ClassDCard , ItemAddReason.AdminCommand , 1); + player.ReferenceHub.inventory.ServerAddItem(Config.ClassDCard, ItemAddReason.AdminCommand, 1); } }); } @@ -1128,7 +1117,7 @@ void OnPlayerShot(PlayerShotWeaponEvent ev) Player.SetAmmo(ItemType.Ammo762x39, 180); Player.SetAmmo(ItemType.Ammo556x45, 180); }*/ - + [PluginEvent] void OnPlayerShotWeapon(PlayerShotWeaponEvent ev) { @@ -1390,9 +1379,9 @@ void OnRemoteAdminCommandExecuted(RemoteAdminCommandExecutedEvent ev) Player player = Player.Get(sender); if (player != null && !string.IsNullOrEmpty(command)) { - string note = TranslateConfig.AdminLog.Replace("%Nickname%" , player.Nickname).Replace("%Time%" , DateTime.Now.ToString()).Replace("%Command%" , command).Replace("%UserId%" , player.UserId); + string note = TranslateConfig.AdminLog.Replace("%Nickname%", player.Nickname).Replace("%Time%", DateTime.Now.ToString()).Replace("%Command%", command).Replace("%UserId%", player.UserId); if (Config.AdminLogShow) - XHelper.Broadcast(TranslateConfig.AdminLogBroadcast.Replace("%Nickname%" , player.Nickname).Replace("%Command%" , command), 5, BroadcastFlags.Normal); + XHelper.Broadcast(TranslateConfig.AdminLogBroadcast.Replace("%Nickname%", player.Nickname).Replace("%Command%", command), 5, BroadcastFlags.Normal); Log.Info(note); try { diff --git a/HelpSense/Properties/AssemblyInfo.cs b/HelpSense/Properties/AssemblyInfo.cs index cd6fd77..68f54bd 100644 --- a/HelpSense/Properties/AssemblyInfo.cs +++ b/HelpSense/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下