0

I will preface this by saying I am a little new to some of this and worry I may be over thinking this problem or re-inventing the wheel in some way.

I am making a game in Unity and want to include user validation/authentication so I can have unique usernames for scoreboards etc. I tried some of the built in methods like Google sign in for example but I want my game to be agnostic and not be limited to requiring the user to have a specific account like Google Play for example.

My idea is to store the user name in a database and link it to a unique hash for that player. This hash will also exist in an encrypted file on the players device. Now I want to be able to verify the user and user hash with the database when logging in, but in order to do that I need to decrypt the hash server side. I verified I can do this in python and have a script for it running in a local Xampp server, now I need to figure out how to make calls to this script and receive a response. So here are my questions:

  1. Is this overcomplicated or a flawed design
  2. If not, how do I send and receive data from the python script. In Unity typically use UnityWebRequest which I think is similar to an HTTP request but am unsure how secure this is server side.
  3. Some information I found pointed to this Python library HTTP server but the top of the documentation warns about security issues

Any advice or information would be greatly appreciated!

1 Answer 1

1
  • Regarding the UserID, you can use the Unity Auth package. It will give you a unique ID for each user when they successfully log in (Completely free).
  • On the server side: You can definitely use UnityWebRequest to communicate with a Python server. You can use Postman to test the server before writing client code on Unity.
  • As for server security, it's quite difficult; I think you should start with a simple server first and then upgrade later. Alternatively, you can use available services like PlayFab, so you won't have to worry about the technical aspects of security or scaling the server later. Try this
Sign up to request clarification or add additional context in comments.

3 Comments

You're awesome, thank you for the info! I went the Unity authentication route and I thought it ended with you having to create a UnityID like through a browser window, I could be mistaken or set it up incorrectly.?
Yes, you have to setup your project in Unity Services. There are several tutorials for services like this. Try this one. or this.
Looking around a little more I think for my original idea I should use something like Flask

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.