mirror of
				https://github.com/DerTyp7/defrain-shooter-unity.git
				synced 2025-11-04 07:08:59 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			851 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			851 B
		
	
	
	
		
			C#
		
	
	
	
	
	
using System;
 | 
						|
 | 
						|
namespace Mirror
 | 
						|
{
 | 
						|
    public class NetworkConnectionToServer : NetworkConnection
 | 
						|
    {
 | 
						|
        public override string address => "";
 | 
						|
 | 
						|
        // Send stage three: hand off to transport
 | 
						|
        protected override void SendToTransport(ArraySegment<byte> segment, int channelId = Channels.Reliable) =>
 | 
						|
            Transport.activeTransport.ClientSend(segment, channelId);
 | 
						|
 | 
						|
        /// <summary>Disconnects this connection.</summary>
 | 
						|
        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();
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |