This is probably a dumb question but I never let that stop me :)
I'm developing a multiplayer game in Unity. The game server will ultimately be on a Linux host but for debugging I'm using Clones Manager and just running it in a copy of the editor locally (i.e. localhost).
When the client starts up it will attempt to connect to the server. I wanted to leverage PlayFab's title data to store the server address so I can change it dynamically even after the WebGL client is deployed.
So I created a PlayFabDataSO Scriptable object and gave it an Initialize() method which will call PlayFabClientAPI.GetTitleData() to get the server address. My NetworkManager class uses this in its Start() method when it tries to start the client.
public override void Start() { base.Start(); #if !UNITY_SERVER if (AutoStartClientBuild) { // todo add error handling for getting server address from PlayFab _playFabData.Initialize(); networkAddress = _playFabData.DutchBlitzServerAddress; Debug.Log($"MidniteOilSoftwareNetworkManager.Start() - Starting client using network address: '{networkAddress}'"); StartClient(); } #endif }
The issue I'm having is that the GetTitleData() calls is failing with the "You must be logged in to call this method".
I'm a little confused because my LoginManager is able to register new users and sign then in using PlayFabClientAPI.RegisterPlayFabUser() and PlayFabClientAPI.LoginWithEmailAddress().
This is where I'm getting into dumb question territory. So far I've only been working within the editor and I'm using the editor extensions to log into PreFab.
How do I go about connecting my app to PreFab when it's deployed. I assume, based on this error I need to call one of the PreFabClientAPI's login methods. How do I this without putting my credentials/secret key out there?
In addition to hosting a WebGL client I plan to publish iOS/Android and desktop clients for this game as well.
Can someone point me to a FAQ or tutorial on how I can secure my credentials and connect my app to PreFab from out in the wild?
Thanks and again I apologize if this is dumb but I'm a newbie when it comes to PreFab.