Hey guys and girls (:,
so since i am making a game that needs to recognize the players everytime they join on servers hosted by players themself, i needed a way to give them a unique ID.
The server would check the ID that the player gives him and returns his inventory or creates a new savegame for him if the ID couldnt be found.
So using a MySQL Database with a table for accounts was the first thing i thought about.
I searched the forum, the hub and several over non UE4 related sites but i couldn’t find a tutorial for this.
What i found were bunch of people saying that you shouldn’t use the MySQL queries directly in the game.
So i needed a way to communicate with the Database over a php Script. I found the HttpRequests and managed to implement the libraries
in the UE4. Now i was able to send POST data (json) to my php script. Making the Request function blueprintcallable gave me the opportunity to
use the new UMG to make a login screen, which uses the Editable Textboxes for Username and password.
Now i let the loginscreen widget check an int Value named “AccountID” on my character with the tick.
Each time i perform a request by clicking on login, the php script sends back an echo with false (0) or the id of the user from the database.
If the echo is unequal to 0, we login and save the ID to our character.
With this ID, i can now track the player and its inventory, because it is the primary key inside the MySQL database.
What i want to ask now is:
Is this a valid way to perform this, or are there security issues or something else?
Is there a better idea on how to do this that i haven’t found by now?
AND do you guys want me to make a small tutorial on how to do this?
Because i can’t find any tutorial on how to make a login system connected to a database with UE4 by now
and i can’t imagine that no one of you needs a login connected with a database (all of you mmo makers for example).
I would be happy if we could discuss this a bit (: