Search Unity

Questions making web requests Unity

Discussion in 'Getting Started' started by ChaseRLewis73003, Jan 26, 2020.

  1. ChaseRLewis73003

    ChaseRLewis73003

    Joined:
    Apr 23, 2012
    Posts:
    85
    Background
    I'm an experienced developer having done stuff from Fluid Simulation in Unity to Full Stack development for non-game companies. I've never done much networking in Unity though and so am left with some questions about how to go about things.
    Goal
    I'm planning a game where player inventories and such are always synced to the server. This gives the user ease of recovery when moving devices and will prevent cheating for rewards. However, I'm not super worried about cheating for most gameplay since it won't be PvP. I really just want the server to determine rewards, save player progress, and make sure the players payed the appropriate cost to get their rewards. If someone wants to cheat themselves out of game play well ... good on them. There are some other things I can do there, but don't consider that super high priority at the moment.

    This means the average person should only be sending a few web requests per minute. For such infrequent calls I'd think a basic REST framework with some server side session state would scale very well.

    Questions
    1.What primitives should be used in Unity for making basic Web Requests?
    2. Does UnityWebRequest pool connections like .NET WebRequest?
    3. Are there any idioms for cleanly calling web requests in Unity?