Passing client-side username to server on join
For our game, the client first opens a map locally, and executes a REST call to our company's servers to log in. It obtains a user id in this manner. It then joins a server by using the console command
We want our server to be able to see these user ids. Our server can currently pull the player names, but this just ends up being the machine name for PC, or another random number for Gear VR.
How can I keep the user id obtained locally when joining a map on the server? I've tried creating a save game, but this just tries to load a save from the server rather than from the client. Our player state also gets re-created when joining the server, so I'm not able to keep variables in the player state.
asked Aug 15 '16 at 05:50 PM in Blueprint Scripting
Best way to do what you trying to os is to create your own OnlineSubsystem for you online service, it a common interface for online social services like Xbox live, PSN, Steamworks etc., there no documentation for it so you would need to learn form looking at source code of existing subsystem
OnlineSubsystemNull is a base implementation and it'c consider a good base for your own implementation
Alternatively you can make replicabale property with proof of login (remember about security!) in PlayerController or PlayerState classes so it will replicate to server and it can recognize user. But i really recommend OnlineSubsystem implementation if you got C++ programmer in disposal.
answered Aug 15 '16 at 07:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here