public void StartServer() { if (AndrickPlugin.ActivateServer(5)) { server = true; testInit.SetActive(false); testServerStuff.SetActive(true); Debug.Log("Server Init Succeeded!"); console.text = "Server Init Succeeded!"; } else { Debug.Log("Server Init Failed!"); console.text = "Server Init Failed!"; } }
public void OnCreateServer() { //Set necessary data that needs to be sent to the server in persistent handler //So then we can ask the server about this info in the lobby int maxUsers = 0; if (int.TryParse(maxUserInput.text.ToString(), out maxUsers)) { Persistent.Instance.isServer = true; Persistent.Instance.ServerInfo.maxUsers = maxUserInput.text; if (AndrickPlugin.ActivateServer(maxUsers)) { Persistent.Instance.isNetworkActive = true; GetSceneTracker().LoadSceneSynchronously(SceneInfoList.SERVER_CONTROL_PANEL); } else { GetSceneTracker().LoadSceneSynchronously(SceneInfoList.TITLE_MENU); } } //GetSceneTracker().LoadSceneAsync(SceneInfoList.LOADING_MENU, UnityEngine.SceneManagement.LoadSceneMode.Single, OnSceneLoaded); }
// Start is called before the first frame update void Start() { Debug.Log(AndrickPlugin.ActivateServer(5)); }