Notifications
Clear all
Combu Server/Client
2
Posts
2
Users
0
Reactions
644
Views
Topic starter
Hello, I am unsure of how one might retrieve another players data like a json file. Is there documentation on how to go about that?
On a totally unrelated topic, is there a way to send/receive server time using the combu api?
Appreciate any help, thanks so much.
Posted : 08/04/2015 2:38 pm
Players data are always returned for example by LoadContacts or LeaderboardHighscore and other functions involving accounts, but you can use LoadUser/LoadUsers.
About the server time, there's no built-in method but it's really easy:
- create a new file servertime.php in your Combu web folder and put this line into it (make sure it's at the very beginning of the file):
<%
echo date("Y-m-d H:i:s");
exit();
echo date("Y-m-d H:i:s");
exit();
- in your Unity script call:
CBManager.instance.CallWebservice(CBManager.instance.GetUrl("servertime.php"),
null,
(string text, string error) => {
System.DateTime serverDateTime = System.DateTime.ParseExact(text,
"yyyy-MM-dd HH:mm:ss",
System.Globalization.CultureInfo.CurrentCulture,
System.Globalization.DateTimeStyles.None);
});
null,
(string text, string error) => {
System.DateTime serverDateTime = System.DateTime.ParseExact(text,
"yyyy-MM-dd HH:mm:ss",
System.Globalization.CultureInfo.CurrentCulture,
System.Globalization.DateTimeStyles.None);
});
FRANCESCO CROCETTI @ SKARED CREATIONS
Posted : 08/04/2015 2:54 pm