Search Unity

Check duplicate usernames

Discussion in 'Getting Started' started by Tpleme, Nov 5, 2019.

  1. Tpleme

    Tpleme

    Joined:
    May 10, 2019
    Posts:
    7
    Hello, I've been learning unity and c# for the past 6 months and with that I'm trying to create a simple game, almost totally offline (expect leaderbords), so I don't have any knolage about Internet connections, clous, databases, etc.

    My problem here is that I have a input so player can register their name and I save it with playerprefs, but I wanna know the best and simplest way to store this string online so I can compare and check if it already exists.

    I only wanna use this for the player name.

    Any tip you can give me?

    Best regards
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Asking for the simplest, best, etc, usually doesn't get many answers because to answer requires someone having tried every method, knowing your skill set, and knowing how you'd use it in your game.

    There are database as a service providers you can try, you can roll your own PHP/MySQL database server, you could create your own server build your game client talks to which saves/loads all this data from a text file on the server. There's probably more options. The PHP/MySQL solution is probably the simplest, but you'll need to learn some PHP and how to write SQL queries and rent a server somewhere.
     
  3. Tpleme

    Tpleme

    Joined:
    May 10, 2019
    Posts:
    7
    I understand that. I thought since this is just a text file, there were maybe some simple solution that i was not aware of.

    Thanks for the reply.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I would suggest to create a proper web service API that connects to your back end database. Not offline of course.
     
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    But its not just a text file, at least not what you were asking for. If you were to use a text file somewhere, set so anyone can edit it, the file will get deleted or trashed with garbage data almost immediately after you start sharing your game.