From e28739ab053f1476093500eeb0c0822747a7614d Mon Sep 17 00:00:00 2001 From: xien <2383759126@qq.com> Date: Sun, 19 May 2024 21:49:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20autoclear=E7=9A=84=5Fu?= =?UTF-8?q?pdateCounte=E6=94=B9=E4=B8=BAlong?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autoclear/Autoclear.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Autoclear/Autoclear.cs b/Autoclear/Autoclear.cs index 2a48eb5e5..79c2883b9 100644 --- a/Autoclear/Autoclear.cs +++ b/Autoclear/Autoclear.cs @@ -15,7 +15,7 @@ public class Autoclear : TerrariaPlugin public static Configuration Config; private bool _sweepScheduled = false; private DateTime _sweepScheduledAt; - private int _updateCounter; + private long _updateCounter; public Autoclear(Main game) : base(game) { @@ -44,6 +44,7 @@ protected override void Dispose(bool disposing) { if (disposing) { + GeneralHooks.ReloadEvent -= ReloadConfig; ServerApi.Hooks.GameUpdate.Deregister(this, OnUpdate); } base.Dispose(disposing); From 2323f8ad1a2800e49c38dc073f28a6e4fa99b04a Mon Sep 17 00:00:00 2001 From: xien <2383759126@qq.com> Date: Sun, 19 May 2024 22:03:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20autoclear,=E5=BB=B6?= =?UTF-8?q?=E8=BF=9F=E5=80=92=E8=AE=A1=E6=97=B6=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=85=B7=E4=BD=93=E6=B6=88=E6=81=AF=E6=9D=A5=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autoclear/Autoclear.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Autoclear/Autoclear.cs b/Autoclear/Autoclear.cs index 79c2883b9..ea2cf4c70 100644 --- a/Autoclear/Autoclear.cs +++ b/Autoclear/Autoclear.cs @@ -71,12 +71,7 @@ private void OnUpdate(EventArgs args) { _sweepScheduled = true; _sweepScheduledAt = DateTime.UtcNow.AddSeconds(Config.DelayedSweepTimeoutSeconds); - - // 发送倒计时消息 - if (Config.SpecificMessage) - { - TSPlayer.All.SendSuccessMessage($"{Config.DelayedSweepCustomMessage}"); - } + TSPlayer.All.SendSuccessMessage($"{Config.DelayedSweepCustomMessage}"); } } if (_sweepScheduled && DateTime.UtcNow >= _sweepScheduledAt)