1234567891011121314151617181920212223242526272829303132333435 |
- namespace ET.Server
- {
- [FriendOf(typeof (SessionPlayerComponent))]
- public static class SessionPlayerComponentSystem
- {
- public class SessionPlayerComponentDestroySystem: DestroySystem<SessionPlayerComponent>
- {
- protected override void Destroy(SessionPlayerComponent self)
- {
- Player player = self.GetMyPlayer();
- if (player == null)
- {
- return;
- }
- Log.Info($"玩家断线了, playerId={self.PlayerId}, name={player.Name}");
-
-
-
-
- player.Dispose();
- }
- }
-
-
-
-
-
- public static Player GetMyPlayer(this SessionPlayerComponent self)
- {
- return self.DomainScene().GetComponent<GamePlayerComponent>().Get(self.PlayerId);
- }
- }
- }
|