Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

WWW and sending/getting information

Discussion in 'Editor & General Support' started by fransh, Apr 29, 2013.

  1. fransh


    Sep 15, 2010
    Is there a way to send information using a WWW, and retrieve the result of that after it has been processed on the server automatically?

    Right now i send my data, and use a second WWW to retrieve the result. Now i got the problem that i need the sending, and the receiving to be in the same session. A unique ID is given when the server receives a request, and it must send back specific information to that same user, and it can do this but i can not get it right in Unity.

    If i take away that restriction of it requiring the same user, but i just take the latest entry and i download that specifically using a second www call, it works perfectly. However this is wrong in my opinion, and open for errors if two people where to connect at almost the same time.

    Quick example of how i am trying it to be:
    1. Player enters name
    2. Game starts
    3. Player dies
    4. Name + score is send to a php script and added to the highscore database, this script than also locates the rank of this new player in the entire highscore list and pushes that in a echo.
    5. Unity should now get back the echo from sending the name + score, and display that on screen so the player got his information.

    That last point is where i fail, how should i approach this?