From a441bb40364738748598959b28aa1c19321a41a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=AD=A6?= <1242509682@qq.com> Date: Sun, 14 Apr 2024 21:23:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86Dispose=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=B8=AD=E5=85=B3=E6=9C=8D=E5=BC=95=E5=8F=91=E7=9A=84?= =?UTF-8?q?=E8=B6=85=E5=A0=86=E6=A0=88=E9=97=AE=E9=A2=98=EF=BC=8C=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E4=B8=AA=E5=85=8D=E7=96=AB=E9=98=BB=E6=AD=A2=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=E7=9A=84=E6=9D=83=E9=99=90=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plugin.sln | 18 +++++++++--------- ShortCommand/Plugin.cs | 12 +++++++++--- ShortCommand/README.md | 21 +++++++++++++++------ ShortCommand/ShortCommand.sln | 25 +++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 ShortCommand/ShortCommand.sln diff --git a/Plugin.sln b/Plugin.sln index 7e3fc169..f96a6aa1 100644 --- a/Plugin.sln +++ b/Plugin.sln @@ -74,7 +74,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProgressRestrict", "Progres EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CriticalHit", "CriticalHit\CriticalHit.csproj", "{FB53565D-8A75-4A8D-9DBA-F3F260D714CE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PacketsStop", "..\Plugin\PacketsStop\PacketsStop.csproj", "{EA684BA7-CA95-46BA-B053-02192000FDC5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PacketsStop", "PacketsStop\PacketsStop.csproj", "{CD2CC460-4CF6-4106-9F4E-C152C63E3D9E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -348,14 +348,14 @@ Global {FB53565D-8A75-4A8D-9DBA-F3F260D714CE}.Release|Any CPU.Build.0 = Release|Any CPU {FB53565D-8A75-4A8D-9DBA-F3F260D714CE}.Release|x64.ActiveCfg = Release|Any CPU {FB53565D-8A75-4A8D-9DBA-F3F260D714CE}.Release|x64.Build.0 = Release|Any CPU - {EA684BA7-CA95-46BA-B053-02192000FDC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA684BA7-CA95-46BA-B053-02192000FDC5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA684BA7-CA95-46BA-B053-02192000FDC5}.Debug|x64.ActiveCfg = Debug|Any CPU - {EA684BA7-CA95-46BA-B053-02192000FDC5}.Debug|x64.Build.0 = Debug|Any CPU - {EA684BA7-CA95-46BA-B053-02192000FDC5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA684BA7-CA95-46BA-B053-02192000FDC5}.Release|Any CPU.Build.0 = Release|Any CPU - {EA684BA7-CA95-46BA-B053-02192000FDC5}.Release|x64.ActiveCfg = Release|Any CPU - {EA684BA7-CA95-46BA-B053-02192000FDC5}.Release|x64.Build.0 = Release|Any CPU + {CD2CC460-4CF6-4106-9F4E-C152C63E3D9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD2CC460-4CF6-4106-9F4E-C152C63E3D9E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD2CC460-4CF6-4106-9F4E-C152C63E3D9E}.Debug|x64.ActiveCfg = Debug|Any CPU + {CD2CC460-4CF6-4106-9F4E-C152C63E3D9E}.Debug|x64.Build.0 = Debug|Any CPU + {CD2CC460-4CF6-4106-9F4E-C152C63E3D9E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD2CC460-4CF6-4106-9F4E-C152C63E3D9E}.Release|Any CPU.Build.0 = Release|Any CPU + {CD2CC460-4CF6-4106-9F4E-C152C63E3D9E}.Release|x64.ActiveCfg = Release|Any CPU + {CD2CC460-4CF6-4106-9F4E-C152C63E3D9E}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ShortCommand/Plugin.cs b/ShortCommand/Plugin.cs index c25203c4..541ff9de 100644 --- a/ShortCommand/Plugin.cs +++ b/ShortCommand/Plugin.cs @@ -26,9 +26,9 @@ public CommandCD(string name, string cmd) public override string Name => "简短指令改良版"; - public override string Author => "GK 超级改良"; + public override string Author => "GK 少司命修复版"; - public override Version Version => new Version(1, 0, 1, 7); + public override Version Version => new Version(1, 3, 0, 0); public override string Description => "由GK改良的简短指令插件!"; @@ -107,7 +107,7 @@ protected override void Dispose(bool disposing) ServerApi.Hooks.GameInitialize.Deregister(this, this.OnInitialize); PlayerHooks.PlayerCommand -= this.OnChat; } - this.Dispose(disposing); + base.Dispose(disposing); } private void OnInitialize(EventArgs args) @@ -121,6 +121,12 @@ private void OnChat(PlayerCommandEventArgs args) { return; } + + if (args.Player.HasPermission("免禁指令")) + { + return; + } + if (this.NotSourceCmd.Contains(args.CommandName)) { args.Player.SendErrorMessage("该指令已被禁止使用!"); diff --git a/ShortCommand/README.md b/ShortCommand/README.md index ce744848..00e653ed 100644 --- a/ShortCommand/README.md +++ b/ShortCommand/README.md @@ -1,18 +1,24 @@ -# ShortCommand 短指令 +# ShortCommand 简短指令 -- 作者: GK -- 出处: GK -- 使命令更加简洁 +- 作者: GK、少司命、羽学 +- 出处: QQ群(232109072) +- 这是一个Tshock服务器插件主要用于将插件或原生自带的Tshock命令映射成一个自己想要的命令 +- 并可通过配置文件中的【阻止原始】彻底禁用一个命令,加了Reload重载配置文件方法 +- 并配备了一个权限名【免检指令】使特定用户组不受【阻止原始】的影响 ## 更新日志 ``` -暂无 +v1.3.0 +修复了Dispose方法中关服引发的超堆栈问题 +加了个免疫阻止原始的权限名 ``` ## 指令 -无 +| 语法 | 权限 | 说明 | +| -------------- | :-----------------: | :------: | +| 无 | 免禁指令 |插件不对其禁止使用原始命令| ## 配置 @@ -40,3 +46,6 @@ ] } ``` +## 反馈 +- 共同维护的插件库:https://github.com/THEXN/TShockPlugin/ +- 国内社区trhub.cn 或 TShock官方群等 diff --git a/ShortCommand/ShortCommand.sln b/ShortCommand/ShortCommand.sln new file mode 100644 index 00000000..132cdf28 --- /dev/null +++ b/ShortCommand/ShortCommand.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34330.188 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShortCommand", "ShortCommand.csproj", "{64385012-194B-4096-BF7D-030DD7CD805F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {64385012-194B-4096-BF7D-030DD7CD805F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {64385012-194B-4096-BF7D-030DD7CD805F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64385012-194B-4096-BF7D-030DD7CD805F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {64385012-194B-4096-BF7D-030DD7CD805F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {322FAC12-B22C-4547-8EA7-2F4081CA2894} + EndGlobalSection +EndGlobal From 04314d1696541b9fff7b25655219b6041608f25a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=91=E5=8F=B8=E5=91=BD?= <79201070+Controllerdestiny@users.noreply.github.com> Date: Sun, 14 Apr 2024 21:30:48 +0800 Subject: [PATCH 2/2] Delete ShortCommand/ShortCommand.sln --- ShortCommand/ShortCommand.sln | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 ShortCommand/ShortCommand.sln diff --git a/ShortCommand/ShortCommand.sln b/ShortCommand/ShortCommand.sln deleted file mode 100644 index 132cdf28..00000000 --- a/ShortCommand/ShortCommand.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.8.34330.188 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShortCommand", "ShortCommand.csproj", "{64385012-194B-4096-BF7D-030DD7CD805F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {64385012-194B-4096-BF7D-030DD7CD805F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {64385012-194B-4096-BF7D-030DD7CD805F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {64385012-194B-4096-BF7D-030DD7CD805F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {64385012-194B-4096-BF7D-030DD7CD805F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {322FAC12-B22C-4547-8EA7-2F4081CA2894} - EndGlobalSection -EndGlobal