SessionPlayerComponentSystem.cs 684 B

123456789101112131415161718192021222324
  1. namespace ET.Server
  2. {
  3. [EntitySystemOf(typeof(SessionPlayerComponent))]
  4. public static partial class SessionPlayerComponentSystem
  5. {
  6. [EntitySystem]
  7. private static void Destroy(this SessionPlayerComponent self)
  8. {
  9. Scene root = self.Root();
  10. if (root.IsDisposed)
  11. {
  12. return;
  13. }
  14. // 发送断线消息
  15. root.GetComponent<MessageLocationSenderComponent>().Get(LocationType.Unit).Send(self.Player.Id, G2M_SessionDisconnect.Create());
  16. }
  17. [EntitySystem]
  18. private static void Awake(this SessionPlayerComponent self)
  19. {
  20. }
  21. }
  22. }