using Fantasy; using Fantasy.Entitas.Interface; namespace Hotfix; public static class AccountTimeOuterComponentSystem { public static void TimeOut(this AccountTimeOuterComponent self, long timer) { var scene = self.Scene; self.TimeId = scene.TimerComponent.Net.OnceTimer(timer, () => { var account = self.Parent as Account; self.TimeId = 0; AuthenticationHelper.RemoveCacheAccount(scene, account.Username.GetHashCode()); }); } } public class AccountTimeOuterComponentDestroySystem : DestroySystem { protected override void Destroy(AccountTimeOuterComponent self) { if (self.TimeId != 0) { self.Scene.TimerComponent.Net.Remove(self.TimeId); } self.TimeId = 0; self.UserCode = 0; } }