Hi.
I tried following the code in Start () of CombuManager, but I can not call it from my code, could you give an example please?
Thank you in advance.
CombuManager.Start is already called automatically, you only need to wait in your script for the initialization to be finished (client and server exchange security keys to crypt the parameters of webservices):
public class Test : MonoBehaviour { IEnumerator Start () { while (!CombuManager.isInitialized) yield return null; // now Combu has been initialized and can be used to login etc CombuManager.platform.Authenticate (username, password, (bool success, string error) => { Debug.Log("Login: " + success + " -- " + error); }); } }
FRANCESCO CROCETTI @ SKARED CREATIONS
Hi. Thanks for your prompt response.
Sorry, I did not know how to ask my question. What I want is to use Combu to know the time of the server (server information), to validate restricted access per time (for a competition). I see that it is with GetServerInfo, but I can not understand how to call it from my own script. Could you please give an example?
Thank you in advance.
In the previous sample script after waiting for isInitialized you can access CombuManager.instance.serverInfo.time (it should be expressed in UTC), GetServerInfo is automatically called during initialization and the time is what it was during the initialization (in case you'd need to calculate some offset from date/time of clients).
Alternatively you can call GetServerInfo whenever you want (after CombuManager.isInitialized is true):
CombuManager.instance.GetServerInfo((bool success, CombuServerInfo info) => { if (success) { Debug.Log(info.time.ToString()); } });
FRANCESCO CROCETTI @ SKARED CREATIONS
It works perfectly, thank you very much!