Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by kailanadams02 · Oct 10, 2020 at 09:37 AM · wwwwebrequest

ERROR SAME REQUEST WITHIN A SECOND: 4

I am trying to upload a high score to dreamlo and am getting an error. "ERROR SAME REQUEST WITHIN A SECOND: 4 UnityEngine.MonoBehaviour:print(Object) HighScoreManager:FormatHighscores(String) (at Assets/Scripts/HighScoreManager.cs:68) d__10:MoveNext() (at Assets/Scripts/HighScoreManager.cs:52) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)"

 using System.Collections;
 using UnityEngine;
 using UnityEngine.Networking;
 
 public class HighScoreManager : MonoBehaviour
 {
     const string privateCode = "";
     const string publicCode = "";
     const string webURL = "http://dreamlo.com/lb/";
 
     DisplayHighScore highscoreDisplay;
     public Highscore[] highscoresList;
     static HighScoreManager instance;
 
     void Awake()
     {
         highscoreDisplay = GetComponent<DisplayHighScore>();
         instance = this;
     }
 
     public static void AddNewHighscore(string username, int score)
     {
         instance.StartCoroutine(instance.UploadNewHighscore(username, score));
     }
 
     IEnumerator UploadNewHighscore(string username, int score)
     {
         WWW www = new WWW(webURL + privateCode + "/add/" + UnityWebRequest.EscapeURL(username) + "/" + score);
         yield return www;
 
         if (string.IsNullOrEmpty(www.error))
         {
             print("Upload Successful");
             DownloadHighscores();
         }
         else
         {
             print("Error uploading: " + www.error);
         }
     }
 
     public void DownloadHighscores()
     {
         StartCoroutine("DownloadHighscoresFromDatabase");
     }
 
     IEnumerator DownloadHighscoresFromDatabase()
     {
         WWW www = new WWW(webURL + publicCode + "/pipe/");
         yield return www;
 
         FormatHighscores(www.text);
         highscoreDisplay.OnHighscoresDownloaded(highscoresList);
     }
 
     void FormatHighscores(string textStream)
     {
         string[] entries = textStream.Split(new char[] { '\n' }, System.StringSplitOptions.RemoveEmptyEntries);
         highscoresList = new Highscore[entries.Length];
 
         for (int i = 0; i < entries.Length; i++)
         {
             string[] entryInfo = entries[i].Split(new char[] { '|' });
             string username = entryInfo[0];
             int score = int.Parse(entryInfo[1]);
             highscoresList[i] = new Highscore(username, score);
             print(highscoresList[i].username + ": " + highscoresList[i].score);
         }
     }
 }
 
 public struct Highscore
 {
     public string username;
     public int score;
 
     public Highscore(string _username, int _score)
     {
         username = _username;
         score = _score;
     }
 }

I have tried looking for a solution and have not found anything.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hellium · Oct 10, 2020 at 12:42 AM 0
Share

Isn't the error explicit enough? You are perfor$$anonymous$$g the same request multiple a times within a single second and the web service you use does not seem to like this.

avatar image kailanadams02 Hellium · Oct 10, 2020 at 05:47 AM 0
Share

I have tied to slowing it down with a wait before and after but it still gives that same error.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ma69kra · Jul 29, 2021 at 05:20 AM

@kailanadams02 did you find any solution for this issue? edit - i found a fix replace /pipe/ with /pipe

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kailanadams02 · Jul 29, 2021 at 01:57 PM 0
Share

Yes, I found a solution, different than the one you have found. I just slowed the number of times it is requesting the data.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

142 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to constantly get new JSON information with GET request from a stream? Help!! 0 Answers

How to get audioclip from UnityWebRequest 1 Answer

Download multiple files from server 2 Answers

UnityEngine.WWW' has been forwarded to an assembly that is not referenced 1 Answer

Data pass using POST method - WebRequest object 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges