using Fantasy.Entitas.Interface; namespace Hotfix; public static class AccountInfoTimeOuterComponentSystem { public static void TimeOut(this AccountInfoTimeOuterComponent self,int time) { var scene = self.Scene; var parentRunTimeId = self.Parent.RuntimeId; self.TimeId = scene.TimerComponent.Net.OnceTimer(time, () => { if (parentRunTimeId != self.Parent.RuntimeId) { return; } self.TimeId = 0; AuthenticationHelper.RemoveCacheAccountInfo(scene,self.Key); }); } } public class AccountInfoTimeOuterComponentDestroySystem : DestroySystem { protected override void Destroy(AccountInfoTimeOuterComponent self) { if (self.TimeId != 0) { self.Scene.TimerComponent.Net.Remove(self.TimeId); } self.TimeId = 0; self.Key = string.Empty; } }