- Home /
Unity Networking Question [Username/Pass]
Hey there! So I'm making a game for friends and it's going well. I've got networking setup and it works. I had a couple questions. Each player needs to be able to have their own character. The host that runs the server (I've set it up so that anyone can host, but there will be a dedicated server) just allows people to connect and spawns. I want each character to have data loaded when they connect and saved when they leave.
Here's my idea on how to do this: Have a player object that stores all information about a player. When the server shutsdown, it saves this information to a file. (Not hard in C#).
When the server starts up, it loads all that saved information back into the dictionary ingame.
What I'm confused about is a login system. I guess usernames and passwords are the best way to go. (I want characters saved per-server, not locally). Is this a good idea, and how would it work? When a player connects, should they send a message to the server with their user/pass, if it matches the server spawns them in, if not, they are disconnected?
How can I make the server tell the client "Incorrect user/pass"? Should I just use RPC calls? Thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220613154929im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Network.Connect() never returns InvalidPassword 1 Answer
Retrieve server info without password 0 Answers
Best cross platform Http Library? 1 Answer