diff --git a/Commands/CommandPlus.cs b/Commands/CommandPlus.cs deleted file mode 100644 index bc3d127..0000000 --- a/Commands/CommandPlus.cs +++ /dev/null @@ -1,20 +0,0 @@ -using CommandSystem; -using System; - -namespace YongAnFrame.Commands -{ - /// - /// 防止不兼容目标框架 - /// - [Obsolete("官方开眼了,终于没有SanitizeResponse这个答辩了")] - public abstract class CommandPlus : ICommand - { - public bool SanitizeResponse => true; - - public abstract string Command { get; } - public abstract string[] Aliases { get; } - public abstract string Description { get; } - - public abstract bool Execute(ArraySegment arguments, ICommandSender sender, out string response); - } -} diff --git a/Commands/PlayerCommand.cs b/Commands/PlayerCommand.cs index 62debc1..19c185e 100644 --- a/Commands/PlayerCommand.cs +++ b/Commands/PlayerCommand.cs @@ -8,11 +8,11 @@ namespace YongAnFrame.Commands [CommandHandler(typeof(ClientCommandHandler))] public class PlayerCommand : ICommand { - public string Command => "player"; + public string Command => "hPlayer"; - public string[] Aliases => ["play", "pl", "pr"]; + public string[] Aliases => ["hPlay", "hp", "h"]; - public string Description => "用于管理自己的用户"; + public string Description => "用于管理自己的YongAnFrame用户"; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -26,7 +26,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { FramePlayer fPlayer = FramePlayer.Get(player); fPlayer.HintManager.Clean(); - fPlayer.ExPlayer.ShowHint($"{YongAnFramePlugin.Instance.Config.BypassDoNotTrackText.Split('\n')}", 10000f); + fPlayer.ExPlayer.ShowHint($"{YongAnFramePlugin.Instance.Translation.BypassDoNotTrack.Split('\n')}", 10000f); } return true; } diff --git a/Components/CapacityList.cs b/Components/CapacityList.cs index 3490115..8a4b96b 100644 --- a/Components/CapacityList.cs +++ b/Components/CapacityList.cs @@ -1,8 +1,10 @@ -using System.Collections.Generic; +using System; +using System.Collections; +using System.Collections.Generic; namespace YongAnFrame.Components { - public class CapacityList(int capacity) + public class CapacityList(int capacity) : ICollection, IEnumerable, IEnumerable { private readonly List list = new(capacity); @@ -10,6 +12,8 @@ public class CapacityList(int capacity) public int Count => list.Count; + public bool IsReadOnly => throw new System.NotImplementedException(); + public T this[int index] { get @@ -43,5 +47,40 @@ public bool Remove(T item) { return list.Remove(item); } + + public IEnumerator GetEnumerator() + { + return list.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return list.GetEnumerator(); + } + + public void Clear() + { + list.Clear(); + } + + public bool Contains(T item) + { + return list.Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + list.CopyTo(array, arrayIndex); + } + + public int IndexOf(T item) + { + return list.IndexOf(item); + } + + public void RemoveAt(int index) + { + list.RemoveAt(index); + } } } diff --git a/Config.cs b/Config.cs new file mode 100644 index 0000000..bee8590 --- /dev/null +++ b/Config.cs @@ -0,0 +1,22 @@ +using Exiled.API.Interfaces; +using System.ComponentModel; + +namespace YongAnFrame +{ + /// + /// 插件的配置 + /// + public sealed class Config : IConfig + { + /// + public bool IsEnabled { get; set; } = true; + /// + public bool Debug { get; set; } + /// + /// 全局的经验加成 + /// + [Description("全局的经验加成")] + public float GlobalExpMultiplier { get; set; } = 1; + + } +} diff --git a/Players/FramePlayer.cs b/Players/FramePlayer.cs index dd08c61..2b3c1fa 100644 --- a/Players/FramePlayer.cs +++ b/Players/FramePlayer.cs @@ -98,7 +98,7 @@ public string RankName get => ExPlayer.RankName; set { - if (RankName == value) + if (RankName != value) { ExPlayer.RankName = value; } @@ -109,9 +109,10 @@ public string RankName /// public string RankColor { - get => ExPlayer.RankColor; set + get => ExPlayer.RankColor; + set { - if (RankColor == value) + if (RankColor != value) { ExPlayer.RankColor = value; } @@ -125,7 +126,7 @@ public string CustomName get => ExPlayer.CustomName; set { - if (CustomName == value) + if (CustomName != value) { ExPlayer.CustomName = value; } diff --git a/Players/HintManager.cs b/Players/HintManager.cs index 820c4de..ab249bd 100644 --- a/Players/HintManager.cs +++ b/Players/HintManager.cs @@ -30,7 +30,7 @@ private IEnumerator Update() string[] text = new string[36]; int used = 0; - text[used] = $"YongAnFrame 1.0.0-Beta3"; + text[used] = $"YongAnFrame 1.0.0-Beta4"; if (fPlayer.ExPlayer.DoNotTrack && !fPlayer.IsBDNT) { diff --git a/Players/ICustomAlgorithm.cs b/Players/ICustomAlgorithm.cs index e1db85b..9e7190b 100644 --- a/Players/ICustomAlgorithm.cs +++ b/Players/ICustomAlgorithm.cs @@ -1,5 +1,8 @@ namespace YongAnFrame.Players { + /// + /// 自定义算法接口 + /// public interface ICustomAlgorithm { /// diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index a9acd8d..70b8fb9 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.11")] -[assembly: AssemblyFileVersion("1.0.0.11")] +[assembly: AssemblyVersion("1.0.0.12")] +[assembly: AssemblyFileVersion("1.0.0.12")] diff --git a/Translation.cs b/Translation.cs new file mode 100644 index 0000000..6eb1ac0 --- /dev/null +++ b/Translation.cs @@ -0,0 +1,17 @@ +using Exiled.API.Interfaces; +using System.ComponentModel; + +namespace YongAnFrame +{ + /// + /// 插件的翻译 + /// + public sealed class Translation : ITranslation + { + /// + /// BDNT(Bypass Do Not Track)协议文本 + /// + [Description("BDNT(Bypass Do Not Track)协议文本")] + public string BypassDoNotTrack { get; set; } = "BDNT(Bypass Do Not Track)协议\n根据VSR(Verified Server Rules) 8.11,所以开启DNT(Do Not Track)的玩家不会进行非服务器安全性的游戏数据收集或保存。\n根据VSR 8.11.5,所以只有签署BDNT的玩家才会对DNT相关的规则不适用。\n根据VSR 8.11.5.3,所以欲签署BDNT的玩家有知晓收集或保存数据内容的权利。\n|||如果你看不懂BDNT协议的条例请不要签署|||\n1.你将会被收集SteamID用来保存等级和称号数据,这个条例收集的数据是公开展示的,任何人都可以访问!\n2.签署玩家依然有请求删除收集或保存数据的权利,请求之后你依然有24小时可以撤销请求(注意!删除数据是不可逆的)!"; + } +} diff --git a/YongAnFrame.csproj b/YongAnFrame.csproj index e83eb38..fcc077f 100644 --- a/YongAnFrame.csproj +++ b/YongAnFrame.csproj @@ -4,7 +4,7 @@ Debug AnyCPU - {913613E0-C6E7-4511-A079-BACC7BC9089C} + {B036C1E0-4D95-487C-BCA3-32AF84D820EA} Library Properties YongAnFrame @@ -39,42 +39,42 @@ lib\net48\Assembly-CSharp-firstpass.dll - packages\ExMod.Exiled.8.13.1\lib\net48\Assembly-CSharp-Publicized.dll + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Assembly-CSharp-Publicized.dll False False - packages\ExMod.Exiled.8.13.1\lib\net48\CommandSystem.Core.dll + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\CommandSystem.Core.dll - - packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.API.dll + + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.API.dll - - packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.CreditTags.dll + + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.CreditTags.dll - - packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.CustomItems.dll + + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.CustomItems.dll - - packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.CustomRoles.dll + + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.CustomRoles.dll - - packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.Events.dll + + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.Events.dll - - packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.Loader.dll + + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.Loader.dll - - packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.Permissions.dll + + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.Permissions.dll lib\net48\Mirror.dll - - packages\ExMod.Exiled.8.13.1\lib\net48\NorthwoodLib.dll + + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\NorthwoodLib.dll - - packages\ExMod.Exiled.8.13.1\lib\net48\PluginAPI.dll + + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\PluginAPI.dll False @@ -95,11 +95,10 @@ lib\net48\UnityEngine.PhysicsModule.dll - packages\ExMod.Exiled.8.13.1\lib\net48\YamlDotNet.dll + packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\YamlDotNet.dll - @@ -115,7 +114,8 @@ - + + @@ -131,21 +131,10 @@ - - - - - - - - - - - - + diff --git a/YongAnFrame.nuspec b/YongAnFrame.nuspec index 458f476..85f9145 100644 --- a/YongAnFrame.nuspec +++ b/YongAnFrame.nuspec @@ -2,14 +2,14 @@ $id$ - 1.0.0-beta3 + 1.0.0-beta4 $title$ $author$ true - LGPL-3-only + LGPL-3.0-only docs\README.md - https://github.com/YongAn404/YongAnFrame + https://github.com/SCP-SL-Plugin-YongAnTeam/YongAnFrame $description$ $version$ $copyright$ diff --git a/YongAnFrameConfig.cs b/YongAnFrameConfig.cs deleted file mode 100644 index 8038cd6..0000000 --- a/YongAnFrameConfig.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Exiled.API.Interfaces; - -namespace YongAnFrame -{ - public sealed class YongAnFrameConfig : IConfig - { - public bool IsEnabled { get; set; } = true; - public bool Debug { get; set; } - public float GlobalExpMultiplier { get; set; } = 1; - public string BypassDoNotTrackText { get; set; } = "BDNT(Bypass Do Not Track)协议\n根据VSR(Verified Server Rules) 8.11,开启DNT(Do Not Track)的玩家不会进行非服务器安全性的游戏数据收集或保存。\n根据VSR 8.11.5,只有签署BDNT的玩家才会对DNT相关的规则不适用。\n根据VSR 8.11.5.3,欲签署BDNT的玩家有知晓收集或保存数据内容的权利。\n|||如果你看不懂BDNT协议的条例请不要签署|||\n1.你将会被收集SteamID用来保存等级和称号数据,这个条例收集的数据是公开展示的,任何人都可以访问!\n2.签署玩家依然有请求删除收集或保存数据的权利,请求之后你依然有24小时可以撤销请求(注意!删除数据是不可逆的)!"; - } -} diff --git a/YongAnFramePlugin.cs b/YongAnFramePlugin.cs index 1ff0081..67d8983 100644 --- a/YongAnFramePlugin.cs +++ b/YongAnFramePlugin.cs @@ -1,22 +1,33 @@ using Exiled.API.Enums; using Exiled.API.Features; +using Exiled.API.Interfaces; +using Exiled.Events.Commands.Reload; using SCPSLAudioApi; using YongAnFrame.Players; using YongAnFrame.Roles; namespace YongAnFrame { - public sealed class YongAnFramePlugin : Plugin + /// + /// 插件的驱动 + /// + public sealed class YongAnFramePlugin : Plugin { private static YongAnFramePlugin instance; + /// + /// 获取单例 + /// public static YongAnFramePlugin Instance => instance; + /// public override PluginPriority Priority => PluginPriority.First; + /// public override bool IgnoreRequiredVersionCheck => true; + /// public override void OnEnabled() { - Log.Info("\r\n __ __ ______ __ __ ______ ______ __ __ \r\n/\\ \\_\\ \\ /\\ __ \\ /\\ \"-.\\ \\ /\\ ___\\ /\\ __ \\ /\\ \"-.\\ \\ \r\n\\ \\____ \\ \\ \\ \\/\\ \\ \\ \\ \\-. \\ \\ \\ \\__ \\ \\ \\ __ \\ \\ \\ \\-. \\ \r\n \\/\\_____\\ \\ \\_____\\ \\ \\_\\\\\"\\_\\ \\ \\_____\\ \\ \\_\\ \\_\\ \\ \\_\\\\\"\\_\\ \r\n \\/_____/ \\/_____/ \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_/ \r\n \r\n ______ ______ ______ __ __ ______ \r\n/\\ ___\\ /\\ == \\ /\\ __ \\ /\\ \"-./ \\ /\\ ___\\ \r\n\\ \\ __\\ \\ \\ __< \\ \\ __ \\ \\ \\ \\-./\\ \\ \\ \\ __\\ \r\n \\ \\_\\ \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_\\ \\ \\_____\\ \r\n \\/_/ \\/_/ /_/ \\/_/\\/_/ \\/_/ \\/_/ \\/_____/ \r\n \r\n "); instance = this; + Log.Info("\r\n __ __ ______ __ __ ______ ______ __ __ \r\n/\\ \\_\\ \\ /\\ __ \\ /\\ \"-.\\ \\ /\\ ___\\ /\\ __ \\ /\\ \"-.\\ \\ \r\n\\ \\____ \\ \\ \\ \\/\\ \\ \\ \\ \\-. \\ \\ \\ \\__ \\ \\ \\ __ \\ \\ \\ \\-. \\ \r\n \\/\\_____\\ \\ \\_____\\ \\ \\_\\\\\"\\_\\ \\ \\_____\\ \\ \\_\\ \\_\\ \\ \\_\\\\\"\\_\\ \r\n \\/_____/ \\/_____/ \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_/ \r\n \r\n ______ ______ ______ __ __ ______ \r\n/\\ ___\\ /\\ == \\ /\\ __ \\ /\\ \"-./ \\ /\\ ___\\ \r\n\\ \\ __\\ \\ \\ __< \\ \\ __ \\ \\ \\ \\-./\\ \\ \\ \\ __\\ \r\n \\ \\_\\ \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_\\ \\ \\_____\\ \r\n \\/_/ \\/_/ /_/ \\/_/\\/_/ \\/_/ \\/_/ \\/_____/ \r\n \r\n "); Log.Info("============System============"); FramePlayer.SubscribeStaticEvents(); MusicManager.Instance.Init(); @@ -25,6 +36,7 @@ public override void OnEnabled() base.OnEnabled(); } + /// public override void OnDisabled() { instance = null; diff --git a/YongAnTool.cs b/YongAnTool.cs index af68928..51e538f 100644 --- a/YongAnTool.cs +++ b/YongAnTool.cs @@ -15,23 +15,6 @@ public static int StrictNext(this Random r, int min, int max) return new Random(BitConverter.ToInt32(Guid.NewGuid().ToByteArray(), 0)).Next(min, max); } - public static T Reflection(Dictionary value) - { - Type type = typeof(T); - object obj = Activator.CreateInstance(type); - - foreach (var item in value) - { - FieldInfo variable = type.GetField(item.Key); - if (variable == null) - { - continue; - } - variable.SetValue(obj, Convert.ChangeType(item.Value, variable.FieldType)); - } - return (T)obj; - } - public static FramePlayer ToFPlayer(this Player p) { return FramePlayer.Get(p); diff --git a/packages.config b/packages.config index 9d0ea98..ab5743d 100644 --- a/packages.config +++ b/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file