Search Unity

Online Database WITHOUT MySQL or other!

Discussion in 'Community Learning & Teaching' started by Firedan1176, Jul 4, 2014.

  1. Firedan1176

    Firedan1176

    Joined:
    Dec 7, 2013
    Posts:
    48
    Keep in mind, I achieved this literally 3 minutes ago, so this is just a THEORY.

    Without MySQL, PHP or another online database website/connection, I was able to successfully create a simple system to check a 'database' (a txt file XD) for a username and password to see if they match. The only problem is you will need a special separately built client (from the game) to manage your database, but not a big deal. For the sakes of this thread, we'll call it the 'database client'. If you are using Photon Networking, then you can follow along with this theory:

    1.) User enters in username and password. They are stored into 2 strings.
    2.) These 2 strings are sent over RPC to a 1-only 'database client' (mentioned above) instead to everyone else.
    3.) These 2 strings are then ran through a foreach loop in the lines of a text file configuration on the game developer's computer of all the usernames and passwords. If there's a match, the database client will use RPC to tell the connecting user that they are now connecting to the game. If not, they entered information wrong.

    If a user is creating an account, the strings are just added to the text file instead of reading from it (This could be a bool also sent over RPC to see if they're creating or logging in).

    Cons:

    The developer of the game can secretly change users' information >:D
    With Photon, 1 player spot is taken up, so only 19 players can join (for free).
    This can't work with 'dedicated server' method since this special client has to be in the same game (requiring 1 client on your computer per dedicated server).
    Not very secure on the developer's end (same as the first one above)

    Even though there are some cons, the only security threat I see is if someone drives up to your house, takes your WiFi, and finds that txt file. Also, if someone can modify their client to receive those RPC calls, then that's another security threat (HUGE). But keep in mind, this is for games I would probably make (simple and not famous :p). So for anyone serious about their security, you can just learn SQL and/or PHP!

    Thank you for reading my idea!

    There are most likely problems with what I'm thinking but essentially, it could work... Right?

    [Update: I made error corrections. Sorry, it's hard to focus at 1:30 in the morning.]
     
  2. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    the question is why?

    apart from all your cons you mentioned your performance will be terrible as soon as u get a few hundred users, not to mention concurrency problems, file corruption, etc...

    databases and similar where invented for a reason, sorry, but your idea is not original at all, on the contrary you will end up following the natural evolution of txt file -> database
     
    Magiichan likes this.
  3. S3dition

    S3dition

    Joined:
    Jan 6, 2013
    Posts:
    252
    You want to store authentication in plain text and use a non-encrypted retrieval system that has to pull the entire list to iterate through it?

    Is your objective to get your client password list hacked in less than 5 minutes? All they would have to do is look at the stream with something like wireshark to pull the entire list.

    Aside from being slow (as mentioned), it's about as secure as a paper bag.

    If you are running SSL, then that's even more overhead for the transaction. RPC isn't lightweight either. Why would you want to establish that level of connection (secure or otherwise) for a simple login?