36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using Fantasy.Async;
|
|
using Fantasy.Entitas.Interface;
|
|
// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
|
|
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
|
|
|
|
namespace Fantasy;
|
|
|
|
public sealed class GateAccountFlagComponentSystem : DestroySystem<GateAccountFlagComponent>
|
|
{
|
|
protected override void Destroy(GateAccountFlagComponent self)
|
|
{
|
|
// DestroyAsync(self).Coroutine();
|
|
|
|
var selfAccount = self.Account;
|
|
if (selfAccount == null)
|
|
{
|
|
return;
|
|
}
|
|
var selfAccountMailRouteId = selfAccount.MailRouteId;
|
|
GateLoginHelper.Offline(self.Scene, selfAccountMailRouteId).Coroutine();
|
|
self.Account = null;
|
|
selfAccount.Dispose();
|
|
}
|
|
|
|
// private async FTask DestroyAsync(GateAccountFlagComponent self)
|
|
// {
|
|
// var selfAccount = self.Account;
|
|
// if (selfAccount == null)
|
|
// {
|
|
// return;
|
|
// }
|
|
// await GateLoginHelper.Offline(self.Scene,selfAccount.MailRouteId)
|
|
// self.Account = null;
|
|
// selfAccount.Dispose();
|
|
// }
|
|
} |