using System; namespace Mirror { public class NetworkConnectionToServer : NetworkConnection { public override string address => ""; internal override void Send(ArraySegment segment, int channelId = Channels.Reliable) { // Debug.Log("ConnectionSend " + this + " bytes:" + BitConverter.ToString(segment.Array, segment.Offset, segment.Count)); // validate packet size first. if (ValidatePacketSize(segment, channelId)) { Transport.activeTransport.ClientSend(channelId, segment); } } /// Disconnects this connection. public override void Disconnect() { // set not ready and handle clientscene disconnect in any case // (might be client or host mode here) // TODO remove redundant state. have one source of truth for .ready! isReady = false; NetworkClient.ready = false; Transport.activeTransport.ClientDisconnect(); } } }