DisconnectingWithReasonState.cs 434 B

1234567891011121314151617
  1. //服务端带消息主动断开连接。该状态只是等待服务端触发OnClientDisconnect
  2. class DisconnectingWithReasonState : OnlineState
  3. {
  4. public override void Enter()
  5. {
  6. }
  7. public override void Exit()
  8. {
  9. }
  10. //与服务端断开,切换到OfflineState
  11. public override void OnClientDisconnect(ulong client)
  12. {
  13. m_ConnectionManager.ChangeState(m_ConnectionManager.m_Offline);
  14. }
  15. }