21 thoughts on “Godot Multiplayer – Player Authentication | Godot Dedicated Server #3

  1. So, at the moment I am opening all of them up in order that you do and I get the "error listening on port 1909" from both client and server 🙁 Sorry Im trying my best to understand it all and you have done the best job at explaining than anyone ive ever seen so TY for making it MUCH easier!

  2. So, when we disconnect the peer from the gateway server, the reason for that is because the gateway is basically only acting as a doorway inside. The server is the house, if that makes sense right? So that is why we disconnect them, because they are connected both to the gateway and the server now after authentication, correct? BUt they are still and now, connected to the server?

  3. Is it possible to create an "Automatically connect" button?
    Do I need to save the username and password in a file on the PC ?
    Is a file encryption secure enough ? ( OS.get_unique_id () ) Should I use another encryption ?
    Or should I do it completely different ?

  4. Amazing tutorial! i have a question, if a game is match based like csgo or dota, is it better to have separate game server instances per match or have couple game servers that can create separate matches independent from each other?

  5. Awasome tutorials.. can you please share, what you have in PlayerData.gd in Authentication ? this?
    var player_data_file = File.new()
    player_data_file.open("res://Data/PlayerData – Sheet1.json", File.READ)
    var player_data_json = JSON.parse(player_data_file.get_as_text())
    player_data_file.close()
    PlayerIDs = player_data_json.result

  6. when i trying to connect nothing happens. it prints this "attempting to login" and not "Failed to connect to login server". nice Tutorial anyway 🙂

    func ConnectToServer(_username, _password):

    network = NetworkedMultiplayerENet.new()

    gateway_api = MultiplayerAPI.new()

    username = _username

    password = _password

    network.create_client(ip, port)

    set_custom_multiplayer(gateway_api)

    custom_multiplayer.set_root_node(self)

    custom_multiplayer.set_network_peer(network)

    network.connect("connection_failed", self, "_OnConnectionFailed")

    network.connect("connection_succeeded", self, "_OnConnectionSucceeded")

    func _OnConnectionFailed():

    print("Failed to connect to login server")

    print("Pop-up server offline or something")

  7. Fantastic work on the tutorials. I work in web services, and I appreciate the attention to security, as well as the step-by-step mapping of concepts I already know from that world into Godot. Truly wonderful content, and I'm looking forward to continuing on this series!

  8. Please also point people to articles (or maybe another tutorial?) showing how to do proper password authentication using hash + salt rather than storing passwords on the server. For anyone reading this, it is HIGHLY RECOMMENDED to use an existing authentication library that has been battle-tested and proven. The way auth is generally done is to generate a random salt value for each user (usually 32 random bytes, maybe more), then add the salt to their password and generate a hash from the combined password+salt, then store that hash as well as the newly generated salt against this user in your database. Note the salt must be completely random for each user, not shared. Note also the actual password itself is never stored anywhere. Now when a user logs in, you can look up the username in the database, get the salt for that user, add the salt to the provided password, generate the hash and compare that hash to the one in your database. If it matches, you're all good. If not, return "login failed". Also note, if the username wasn't found – make sure to send exactly the same result "login failed" – and make sure the time taken to perform the request is the same in both cases. As mentioned in the video above, if a hacker can figure out that a username already exists, they know they only need to crack the password. Let's not make it that easy for them.

    Once again, it is HIGHLY RECOMMENDED to use an existing well-tested library for doing authentication, but if you must roll your own, know that it is very easy to get something wrong. Here is an article I found that covers all of the above and more, including which hash algorithm to use: https://crackstation.net/hashing-security.htm

  9. Awesome tutorial. This teaches everything someone needs to know to scale their game, and the fact you were able to demonstrate a working example with code in this time frame and still have it clear and understandable is just amazing. Full credit to you.

  10. Hey there, I want to make a mobile app and watched your videos. I want to connect the game from my phone to my pc but i have no idea how to do that. I asume that it has something to do with the ip and port but i dont know how to set it up… My pc is connected via lan. Hope you can help me out. Great Videos man, good job 🙂

  11. I am a novice in Godot (and game development in general too) and my question is that how do you access a node (talking about the login button) from a singleton script and how are the scenes in your game are actually managed? There is another problem I have noticed is that in the Authentication Server and the Gateway Server, I see that the print statements, "Gateway/Authentication Server started" are being printed twice inspite of only one such print statement in the whole project of the different server projects (Authentication Server and Gateway Server).

Leave a Reply

Your email address will not be published. Required fields are marked *