- Home /
How can I create a database with a Photon Network Server?
I've been reading about Photon Networking in Unity recently and so far it appears to be a good package to use, but I was wondering whether a server-side database would be possible to create? I'd need a database to store account information such as a player's stats, money, anything that would be saved during login sessions. I heard that it is impossible to do such a thing with Photon but I remain unsure. Could anyone help with this? I've never handled a database before with any language, but I know how they work and it shouldn't be too hard to implement.
Thanks.
Answer by clunk47 · Jun 28, 2013 at 05:05 PM
You'd need to do some homework. I know in Unity, you can have a script communicate with a php script online in order to change values in an sql database. Check out Unity Serverside Highscores Tutorial for help learning this part. For that, I believe you need the Unity Wiki MD5 class. You would look at the WWW class to communicate with php scripts in this way. In order to run your standalone server with photon, you need to have a look at the Photon Server Reference. Hope this helps you get started.
How would I go about modifying that server to work with a database then?
Edited my answer to be a bit more detailed on where to look. Unity Wiki is having tech difficulties at the moment, but you can always look at the Photon Server Ref link for now.
Heya Clunk47, I know the feeling. I was fed up with my accept rate being so low, especially with my answer being the only one on a question and not being accepted by the OP. But accepting your own answer doesn't give any karma (if it did, $$anonymous$$e would be double!), unless this is not true now with recent changes to the UA 'site. Let me finish going through your answers and accept the suitable ones for you.
=]
Ahh man I appreciate it!!! I wasn't really doing it just to get karma or bring up my accept rate, I was doing it to show others that there has been a resolution that works for this question. I wouldn't accept my own answer if I knew it was incorrect. But I DO greatly appreciate the help w/ my rate and karma! That's always a plus when people see my profile ;)
No worries, going through them it is obvious you put a lot of time and effort (and code) in for the OP. Looks like I was too late for most of them, so am upvoting too. I find it amazing people upvote comments (and lolcatz and bloody memes on FB) but don't do it here for good answers. Havagood1
Your answer
Follow this Question
Related Questions
Switching weapons in PhotonNetwork 1 Answer
Photon Selfhost? 0 Answers
Unity3D Photon movement synchronization 0 Answers
Multiple Cars not working 1 Answer
Photon Authoritative Using MasterClient 2 Answers