From 4b58485976dd3e993027ff1dea2c801a114c8ddc Mon Sep 17 00:00:00 2001 From: Cai <13110818005@qq.com> Date: Sun, 24 Nov 2024 01:35:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0(ZHIPM):=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9zban=E7=9A=84=E9=BB=98=E8=AE=A4=E7=90=86=E7=94=B1,?= =?UTF-8?q?=E5=92=8C=E5=B0=81=E7=A6=81=E7=94=A8=E6=88=B7=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ZHIPlayerManager/README.md | 2 ++ src/ZHIPlayerManager/ZHIPM.Initialize.cs | 22 +++++++++++----------- src/ZHIPlayerManager/ZHIPM.cs | 2 +- src/ZHIPlayerManager/i18n/template.pot | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/ZHIPlayerManager/README.md b/src/ZHIPlayerManager/README.md index ec5333992..8fbf45a51 100644 --- a/src/ZHIPlayerManager/README.md +++ b/src/ZHIPlayerManager/README.md @@ -6,6 +6,8 @@ ## 更新日志 ``` +v.1.0.0.8 +修改zban的默认理由,和封禁用户名 v.1.0.0.6 完善卸载函数 v.1.0.0.5 diff --git a/src/ZHIPlayerManager/ZHIPM.Initialize.cs b/src/ZHIPlayerManager/ZHIPM.Initialize.cs index 7e176a93f..ad5bf4ef8 100644 --- a/src/ZHIPlayerManager/ZHIPM.Initialize.cs +++ b/src/ZHIPlayerManager/ZHIPM.Initialize.cs @@ -3700,7 +3700,7 @@ private void SuperBan(CommandArgs args) return; } - var reason = args.Parameters.Count == 4 ? args.Parameters[3] : GetString("检测到违规行为,请联系管理员"); + var reason = args.Parameters.Count == 4 ? args.Parameters[3] : GetString("你已被管理员封禁!"); TSPlayer? suspect = null; foreach (var v in TShock.Players) { @@ -3711,14 +3711,14 @@ private void SuperBan(CommandArgs args) } } - if (suspect != null && suspect.Ban(reason, "ZHIPlayerManager by " + args.Player.Name)) + if (suspect != null && suspect.Ban(reason, args.Player.Name)) { args.Player.SendMessage(GetString($"用户 {suspect.Name} 已被 {args.Player.Name} 封禁"), broadcastColor); TShock.Log.Info(GetString($"用户 {suspect.Name} 已被 {args.Player.Name} 封禁")); } else { - TShock.Bans.InsertBan("uuid:" + args.Parameters[2], reason, "ZHIPlayerManager by " + args.Player.Name, DateTime.UtcNow, DateTime.MaxValue); + TShock.Bans.InsertBan("uuid:" + args.Parameters[2], reason, args.Player.Name, DateTime.UtcNow, DateTime.MaxValue); TSPlayer.All.SendMessage(GetString($"uuid: {args.Parameters[2]} 已被 {args.Player.Name} 封禁"), broadcastColor); TShock.Log.Info(GetString($"uuid: {args.Parameters[2]} 已被 {args.Player.Name} 封禁")); } @@ -3731,7 +3731,7 @@ private void SuperBan(CommandArgs args) return; } - var reason = args.Parameters.Count == 4 ? args.Parameters[3] : GetString("检测到违规行为,请联系管理员"); + var reason = args.Parameters.Count == 4 ? args.Parameters[3] : GetString("你已被管理员封禁!"); TSPlayer? suspect = null; foreach (var v in TShock.Players) { @@ -3742,14 +3742,14 @@ private void SuperBan(CommandArgs args) } } - if (suspect != null && suspect.Ban(reason, "ZHIPlayerManager by " + args.Player.Name)) + if (suspect != null && suspect.Ban(reason, args.Player.Name)) { args.Player.SendMessage(GetString($"用户 {suspect.Name} 已被 {args.Player.Name} 封禁"), broadcastColor); TShock.Log.Info(GetString($"用户 {suspect.Name} 已被 {args.Player.Name} 封禁")); } else { - TShock.Bans.InsertBan("ip:" + args.Parameters[2], reason, "ZHIPlayerManager by " + args.Player.Name, DateTime.UtcNow, DateTime.MaxValue); + TShock.Bans.InsertBan("ip:" + args.Parameters[2], reason, args.Player.Name, DateTime.UtcNow, DateTime.MaxValue); TSPlayer.All.SendMessage(GetString($"ip: {args.Parameters[2]} 已被 {args.Player.Name} 封禁"), broadcastColor); TShock.Log.Info(GetString($"ip: {args.Parameters[2]} 已被 {args.Player.Name} 封禁")); } @@ -3758,10 +3758,10 @@ private void SuperBan(CommandArgs args) { var list = this.BestFindPlayerByNameOrIndex(args.Parameters[1]); //封禁原因,可不填 - var reason = args.Parameters.Count == 3 ? args.Parameters[2] : "检测到违规行为,请联系管理员"; + var reason = args.Parameters.Count == 3 ? args.Parameters[2] : "你已被管理员封禁!"; if (list.Count == 1) { - if (list[0].Ban(reason, "ZHIPlayerManager by " + args.Player.Name)) + if (list[0].Ban(reason, args.Player.Name)) { args.Player.SendMessage(GetString($"用户 {list[0].Name} 已被 {args.Player.Name} 封禁"), broadcastColor); TShock.Log.Info(GetString($"用户 {list[0].Name} 已被 {args.Player.Name} 封禁")); @@ -3804,12 +3804,12 @@ private void SuperBan(CommandArgs args) if (!string.IsNullOrWhiteSpace(user.Name)) { - TShock.Bans.InsertBan("acc:" + user.Name, reason, "ZHIPlayerManager by " + args.Player.Name, DateTime.UtcNow, DateTime.MaxValue); + TShock.Bans.InsertBan("acc:" + user.Name, reason, args.Player.Name, DateTime.UtcNow, DateTime.MaxValue); } if (!string.IsNullOrWhiteSpace(user.UUID)) { - TShock.Bans.InsertBan("uuid:" + user.UUID, reason, "ZHIPlayerManager by " + args.Player.Name, DateTime.UtcNow, DateTime.MaxValue); + TShock.Bans.InsertBan("uuid:" + user.UUID, reason, args.Player.Name, DateTime.UtcNow, DateTime.MaxValue); } if (!string.IsNullOrWhiteSpace(user.KnownIps)) @@ -3819,7 +3819,7 @@ private void SuperBan(CommandArgs args) { if (!string.IsNullOrWhiteSpace(str)) { - TShock.Bans.InsertBan("ip:" + str, reason, "ZHIPlayerManager by " + args.Player.Name, DateTime.UtcNow, DateTime.MaxValue); + TShock.Bans.InsertBan("ip:" + str, reason, args.Player.Name, DateTime.UtcNow, DateTime.MaxValue); } } } diff --git a/src/ZHIPlayerManager/ZHIPM.cs b/src/ZHIPlayerManager/ZHIPM.cs index cd7ca22ea..c5e7bb199 100644 --- a/src/ZHIPlayerManager/ZHIPM.cs +++ b/src/ZHIPlayerManager/ZHIPM.cs @@ -15,7 +15,7 @@ public partial class ZHIPM : TerrariaPlugin public override string Name => "ZHIPlayerManager"; - public override Version Version => new Version(1, 0, 0, 7); + public override Version Version => new Version(1, 0, 0, 8); #region 字段或属性 /// diff --git a/src/ZHIPlayerManager/i18n/template.pot b/src/ZHIPlayerManager/i18n/template.pot index c4ebb5c0d..08740e2fc 100644 --- a/src/ZHIPlayerManager/i18n/template.pot +++ b/src/ZHIPlayerManager/i18n/template.pot @@ -474,7 +474,7 @@ msgstr "" #: ..\..\ZHIPM.Initialize.cs:3703 #: ..\..\ZHIPM.Initialize.cs:3734 -msgid "检测到违规行为,请联系管理员" +msgid "你已被管理员封禁!" msgstr "" #: ..\..\ZHIPM.Initialize.cs:3787 From dc6dfbbce8e16153b550f7e606fcb4b64448fc0b Mon Sep 17 00:00:00 2001 From: Cai <13110818005@qq.com> Date: Sun, 24 Nov 2024 01:38:49 +0800 Subject: [PATCH 2/2] update version number --- src/ZHIPlayerManager/README.md | 4 +++- src/ZHIPlayerManager/ZHIPM.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ZHIPlayerManager/README.md b/src/ZHIPlayerManager/README.md index 8fbf45a51..5436f87ac 100644 --- a/src/ZHIPlayerManager/README.md +++ b/src/ZHIPlayerManager/README.md @@ -6,8 +6,10 @@ ## 更新日志 ``` -v.1.0.0.8 +v.1.0.0.9 修改zban的默认理由,和封禁用户名 +v.1.0.0.8 +fix:允许非SSC使用 v.1.0.0.6 完善卸载函数 v.1.0.0.5 diff --git a/src/ZHIPlayerManager/ZHIPM.cs b/src/ZHIPlayerManager/ZHIPM.cs index c5e7bb199..720027275 100644 --- a/src/ZHIPlayerManager/ZHIPM.cs +++ b/src/ZHIPlayerManager/ZHIPM.cs @@ -15,7 +15,7 @@ public partial class ZHIPM : TerrariaPlugin public override string Name => "ZHIPlayerManager"; - public override Version Version => new Version(1, 0, 0, 8); + public override Version Version => new Version(1, 0, 0, 9); #region 字段或属性 ///