using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkCore.AutoTask; using Service.TBox.Server; namespace Service.TBox.MyTask; [Scope] public class LockTask : ITask { public static readonly string TaskName = "LockTask"; private volatile bool _stop; public string Name() { return TaskName; } public int Interval() { return 500; } public void Handle() { TBoxServerMgr.Server?.SessionMgr.Broadcast(TBoxServerMgr.Server?.LockMsg); } public bool Stoped() { return _stop; } public void Stop() { _stop = true; } public void ResetStop() { _stop = false; } }