Broad Server/Login Question

So I’ve been doing some digging for the last few hours, but I’m still kind of confused about online data management. I’m making a card game with UNET, and I want a way for players to have a stored login with their decks and settings stored online. To my understanding, I need a MySQL and PHP server hosted somewhere that players call to in order to retrieve their info.

So my question is where do I begin? I’ve never actually done this before, so I would like some general guidance. Do any of the Asset Store plugins serve as a good start? Would I gain anything from buying one and breaking them down? Or better yet, are there any online resources that will get me up to speed with this? Also, I might just straight up have the wrong idea with how I’m going about this haha. Thanks for the input in advance!

There are many approaches for database integrations. First thing im curious of is if this will be a authoritative server architechture or peer to peer (client hosts the match)

If its going to be authoritative and very database heavy (lots of inserts, updates and selects) I would recommend you skip over PHP and instead integrate MySQL directly into your server build.

Obviously if its a client hosted game do not do that as it basically gives anyone who can be bothered to look the keys to your DB.

You can access PHP scripts with unitys WWW and WWWForm class and send data.

The php script can then read the data, process it and reply with a return of some kind.

As someone who bought all of the assets and ripped them apart I will tell you now don’t waste your time. There are a few very simple tutorials on YouTube for PHP high scores with unity, follow those to get the hang of things and then from there you can watch more videos regarding PHP’s ins and outs and how it works.

Happy coding!

1 Like