using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkCore.AutoTask; using Service.TBox.Server; namespace Service.TBox.MyTask; [Scope] public class VinTask : ITask { public static readonly string TaskName = "VinTask"; private volatile bool _stop = true; public string Name() { return TaskName; } public int Interval() { return 100; } public void Handle() { if (TBoxServerMgr.Server?.SendVinMsg != null) { foreach (var vinMsg in TBoxServerMgr.Server?.SendVinMsg) { if (vinMsg != null) { TBoxServerMgr.Server?.SessionMgr.Broadcast(vinMsg); } } } } public bool Stoped() { return _stop; } public void Stop() { _stop = true; } public void ResetStop() { _stop = false; } }