IEnumerator DownloadHighscoresFromDatabase(string username) { string url = webUrl + publicCode + "/pipe-get/" + UnityWebRequest.EscapeURL(username); UnityWebRequest webRequest = UnityWebRequest.Get(url); yield return(webRequest.SendWebRequest()); if (string.IsNullOrEmpty(webRequest.error)) { FormatHighscores(webRequest.downloadHandler.text); highscoresDisplay.OnHighscoresDownloaded(highscoresList); } else { print("Error downloading: " + webRequest.error); } }
IEnumerator DownloadHighscoresFromDatabase() { WWW www = new WWW(webURL + publicCode + "/pipe/"); yield return(www); if (string.IsNullOrEmpty(www.error)) { FormatHighscores(www.text); highscoreDisplay.OnHighscoresDownloaded(highscoresList); } else { print("Error Downloading: " + www.error); } }
IEnumerator DownloadHighscoresFromDatabase() { UnityWebRequest www = UnityWebRequest.Get("https://www.dreamlo.com/lb/" + publicCode + "/pipe/"); yield return(www.SendWebRequest()); if (string.IsNullOrEmpty(www.error)) { FormatHighscores(www.downloadHandler.text); highscoreDisplay.OnHighscoresDownloaded(highscoresList); } else { print("Error Downloading: " + www.error); } }
IEnumerator DownloadHighscoresFromDatabase() { UnityWebRequest www = UnityWebRequest.Get(webURL + publicCode + "/pipe/"); yield return(www.SendWebRequest()); if (www.isNetworkError) { Debug.LogWarning("Error Downloading: " + www.error); } else { FormatHighscores(www.downloadHandler.text); highscoresDisplay.OnHighscoresDownloaded(highscoresList); } }
IEnumerator DownloadHighscoresFromSite() { WWW www = new WWW(webURL + publicCode + "/pipe/0/10"); //Downloads only the top 10 highestscores from website instead of a 1,000 yield return(www); // The programm waits till www gets the info it needs from the site if (string.IsNullOrEmpty(www.error)) // This is to show if a error has occured in the uploading { { FormatHighscores(www.text); highscoresDisplay.OnHighscoresDownloaded(highscoresList); } } else { print("Error Downloading: " + www.error); } }
IEnumerator DownloadHighscoresFromDatabase() { UnityWebRequest www = new UnityWebRequest(webURL + publicCode + "/pipe/"); www.downloadHandler = new DownloadHandlerBuffer(); yield return(www.SendWebRequest()); if (string.IsNullOrEmpty(www.error)) { FormatHighscores(www.downloadHandler.text); highscoresDisplay.OnHighscoresDownloaded(highscoresList); } else { print("Error downloading: " + www.error); } }
IEnumerator DownloadHighscoresFromDatabase() { WWW www = new WWW(serverURL + "receive"); yield return(www); if (string.IsNullOrEmpty(www.error)) { FormatHighscores(www.text); if (highscoreDisplay != null) { highscoreDisplay.OnHighscoresDownloaded(highscoresList); } } else { print("Error Downloading: " + www.error); } }
IEnumerator DownloadHighScoresFromDatabase() { //creates the web url for fetching highscores WWW web = new WWW(webURL + privateCode + "/pipe/"); //waits for a return rather than immediately continuing with the code yield return(web); if (string.IsNullOrEmpty(web.error)) { //prints the scoreboard FormatHighscores(web.text); highscoresDisplay.OnHighscoresDownloaded(highscoresList); } else { print("Errror downloading: " + web.error); } }
IEnumerator DownloadHighscoresFromDatabase() { UnityWebRequest request = UnityWebRequest.Get(webURL + publicCode + "/pipe/"); yield return(request.SendWebRequest()); if (string.IsNullOrEmpty(request.error)) { var txt = request.downloadHandler.text; Debug.Log(txt); FormatHighscores(txt); highscoreDisplay.OnHighscoresDownloaded(highscoresList); } else { print("Error Downloading: " + request.error); } yield return(new WaitForSecondsRealtime(2)); }
IEnumerator DownloadHighscoreFromDatabase() { WWW www = new WWW(webURL + publicCode + "/pipe/"); yield return(www); // Wait for www to finish getting the scores if (string.IsNullOrEmpty(www.error)) { canCommunicateWithServer = true; FormatHighscores(www.text); if (SceneManager.GetActiveScene().name == "LeaderboardScene") { displayHighscores.OnHighscoresDownloaded(highscoreList); } } else { canCommunicateWithServer = false; print("Error Downloading " + www.error); } }