コード例 #1
0
        public void Connect_ShouldConnectToHost()
        {
            // Given
            const string hostAddress = "127.0.0.1";

            // When
            _connectToNewGame.Connect(hostAddress);

            // Then
            _spotTheDefuserNetworkManager.Received().Join(hostAddress);
        }
コード例 #2
0
        private void OnDiscoveryAccepted(IPEndPoint ipEndPoint, string text)
        {
            if (!_listeningForHost)
            {
                return;
            }

            Debug.Log($"Discovery request accepted: {ipEndPoint}");
            _listeningForHost = false;
            _connectToNewGame.Connect(ipEndPoint.Address.ToString());
            StopDiscovery();
        }