NetworkConnectionToServer.cs 851 B

123456789101112131415161718192021222324
  1. using System;
  2. namespace Mirror
  3. {
  4. public class NetworkConnectionToServer : NetworkConnection
  5. {
  6. public override string address => "";
  7. // Send stage three: hand off to transport
  8. protected override void SendToTransport(ArraySegment<byte> segment, int channelId = Channels.Reliable) =>
  9. Transport.activeTransport.ClientSend(segment, channelId);
  10. /// <summary>Disconnects this connection.</summary>
  11. public override void Disconnect()
  12. {
  13. // set not ready and handle clientscene disconnect in any case
  14. // (might be client or host mode here)
  15. // TODO remove redundant state. have one source of truth for .ready!
  16. isReady = false;
  17. NetworkClient.ready = false;
  18. Transport.activeTransport.ClientDisconnect();
  19. }
  20. }
  21. }