Exemplo n.º 1
0
    public void CustomJoinLobby()
    {
        lobby_manager.StartMatchMaker();
        //lobby_manager.StartClient();

        matchmaker_lobby.SetActive(true);

        matchmaking = lobby_manager.GetComponent <CustomMatchmakingLobby>();
        matchmaking.PopulateLobby();

        hide_menu.SetActive(false);

        in_menu = true;
    }
        // Game handlers
        public void ConnectToServer()
        {
            // Set network address
            string serverAddress = serverAddressInput.text;

            if (string.IsNullOrEmpty(serverAddress))
            {
                serverAddress = DefaultServerAddress;
            }

            // Set network port
            ushort serverPort = DefaultServerPort;

            if (serverPortInput.text.Length >= 4)
            {
                ushort.TryParse(serverPortInput.text, out serverPort);
            }

            // Init network client
            Logger.LogFormat("Client trying to connect to {0}:{1}", Category.Connections, serverAddress, serverPort);

            networkManager.networkAddress = serverAddress;
            networkManager.GetComponent <TelepathyTransport>().port = serverPort;
            networkManager.StartClient();
        }
Exemplo n.º 3
0
        // Game handlers
        void ConnectToServer()
        {
            // Set network address
            string serverAddress = serverAddressInput.text;

            if (string.IsNullOrEmpty(serverAddress))
            {
                if (BuildPreferences.isForRelease)
                {
                    serverAddress = Managers.instance.serverIP;
                }
                if (string.IsNullOrEmpty(serverAddress))
                {
                    serverAddress = DefaultServerAddress;
                }
            }

            // Set network port
            ushort serverPort = 0;

            if (serverPortInput.text.Length >= 4)
            {
                ushort.TryParse(serverPortInput.text, out serverPort);
            }
            if (serverPort == 0)
            {
                serverPort = DefaultServerPort;
            }

            // Init network client
            networkManager.networkAddress = serverAddress;
            networkManager.GetComponent <TelepathyTransport>().port = serverPort;
            networkManager.StartClient();
        }
Exemplo n.º 4
0
        void DoServerConnect()
        {
            // Set network address
            string serverAddress = serverAddressInput.text;

            if (string.IsNullOrEmpty(serverAddress))
            {
                serverAddress = DefaultServerAddress;
            }

            // Set network port
            ushort serverPort = DefaultServerPort;

            if (serverPortInput.text.Length >= 4)
            {
                ushort.TryParse(serverPortInput.text, out serverPort);
            }

            // Init network client
            Logger.LogFormat("Client trying to connect to {0}:{1}", Category.Connections, serverAddress, serverPort);

            networkManager.networkAddress = serverAddress;

            var telepathy = networkManager.GetComponent <TelepathyTransport>();

            if (telepathy != null)
            {
                telepathy.port = serverPort;
            }

            var ignorance = networkManager.GetComponent <IgnoranceThreaded>();

            if (ignorance != null)
            {
                ignorance.CommunicationPort = serverPort;
            }

            var booster = networkManager.GetComponent <BoosterTransport>();

            if (booster != null)
            {
                booster.port = serverPort;
            }
            networkManager.StartClient();
        }
Exemplo n.º 5
0
        public JoinOrHostState(CustomNetworkManager networkManager)
            : base(networkManager)
        {
            MenuGUI menuGUI = networkManager.GetComponent <MenuGUI>();

            menuGUI.textPlane.SetActive(true);
            menuGUI.instructions.SetActive(true);
            Camera.main.transform.rotation = Quaternion.identity;
        }
Exemplo n.º 6
0
 public JoinOrHostState(CustomNetworkManager networkManager)
     : base(networkManager)
 {
     MenuGUI menuGUI = networkManager.GetComponent<MenuGUI>();
     menuGUI.textPlane.SetActive(true);
     menuGUI.instructions.SetActive(true);
     Camera.main.transform.rotation = Quaternion.identity;
 }