Пример #1
0
 public void HostLobby()
 {
     //makes you the host of the lobby
     networkManager.StartHost();
     //deactivates the landing page panel
     landingPagePanel.SetActive(false);
 }
    public void HostLobby(GameObject gameMode)
    {
        networkManager.gameMode = gameMode;
        networkManager.StartHost();

        landingPagePanel.SetActive(false);
    }
Пример #3
0
    public void HostLobby()
    {
        SavePlayerName();

        networkManager.StartHost();

        mainMenuBackground.SetActive(false);
    }
Пример #4
0
 public void HostLobby()
 {
     if (networkManager == null)
     {
         networkManager = FindObjectOfType <NetworkManagerLobby>();
     }
     networkManager.StartHost();
     landingPagePanel.SetActive(false);
 }
Пример #5
0
        //Starts a game as the host
        public void startGameHost()
        {
            //TODO: load lobby

            //check for valid information
            bool   invalid = false;
            string reason  = "Cannot start host because: ";

            if (!(MaxPlayer.value >= minPlayers))
            {
                invalid = true;
                reason += "invalid max player value, ";
            }
            else
            {
                MaxPlayers = MaxPlayer.value;
                networkManager.maxConnections = MaxPlayers;
            }

            if (!ushort.TryParse(Port_in.text, out port))
            {
                invalid = true;
                reason += "invalid port value, ";
            }
            else
            {
                teleTransport.port = port;
            }

            string name = Name_host.text.Trim();

            if (string.IsNullOrEmpty(name))
            {
                invalid = true;
                reason += "must enter name, ";
            }
            else
            {
                playerName = name;
            }

            if (invalid)
            {
                throwErrorScreen(reason);
                return;
            }

            connectedIP = "localhost:" + port.ToString();
            isLeader    = true;
            isHosting   = true;

            moveTo(4);
            networkManager.StartHost();
        }
Пример #6
0
    public void HostLobby()
    {
        if (playerName == "")
        {
            inputNamePanel.SetActive(true);
            return;
        }

        networkManager.StartHost();

        optionsMenuPanel.SetActive(false);
        lobbyPanel.SetActive(true);
        changeNameButton.SetActive(false);
    }
Пример #7
0
 public void HostGame()
 {
     if (!(CheckForErrors(pseudo) || CheckForErrors(portHost)))
     {
         PlayerPrefs.SetString("Pseudo", pseudo.text);
         networkManager.GetComponent <kcp2k.KcpTransport>().Port = Convert.ToUInt16(portHost.text);
         networkManager.StartHost();
         canvasMenu.enabled = false;
     }
     else
     {
         CheckForErrorsColor(pseudo);
         CheckForErrorsColor(portHost);
     }
 }
        // Updated by John | May 24, 2021
        // Updated by Kyle | May 25, 2021
        public void hostGame()
        {
            if (!ushort.TryParse(portInput.text, out port))
            {
                Debug.LogError("Bad port input");
                return;
            }
            else
            {
                networkManager.Tele.port = port;
            }

            networkManager.networkAddress = "localhost";
            networkManager.StartHost();
            setMenu(3);
        }
Пример #9
0
    public void HostLobby()
    {
        networkManager.StartHost();

        landingPagePanel.SetActive(false);
    }