Search Unity

Question about simple network

Discussion in 'Getting Started' started by killerKeks26601, May 5, 2021.

  1. killerKeks26601

    killerKeks26601

    Joined:
    Jan 13, 2021
    Posts:
    31
    Hello
    what i am trying to achieve is that players can send messages to a database and other players will randomly receive a random message from that database.
    I have no idea about networking and how to even start learning about it.
    My theoretical approach to this would be to just set up my computer as a server of some sort and the game instances will get a random message of that pool on their local events, but i have no idea on how to even set up my computer as a server.
    I dont expect a blueprint on how to do this.
    Just having a good starting point to learn networking would be more than enough for me to figure this all out.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I think the easiest way, overall, would be to set your computer up as a web server (or use some web server in the cloud). It could run a simple script written in PHP or Python or whatever, which accepts messages from users and stores them in a db (which could be just a file if there's not too many), or serves up a random message upon request.

    You can test and get that working using a web browser or a command-line tool like curl. Then, from your Unity app, do the same thing via the UnityWebRequest class.
     
    BrandyStarbrite likes this.
  3. killerKeks26601

    killerKeks26601

    Joined:
    Jan 13, 2021
    Posts:
    31
    That is exactly what i needed.
    Some more specific stuff to look up and learn about i'm sure i can figure it out from here on out.
    Thanks a lot!
     
    JoeStrout likes this.