in Facebook.Unity.Windows/WindowsWrapper.cs [449:500]
public void GetTournament(string callbackId, CallbackManager callbackManager)
{
fbg.Tournaments.getTournament(
(fbg.GetTournamentResult tournamentData) =>
{
Dictionary<string, object> resultDict = new Dictionary<string, object>() {
{Constants.CallbackIdKey,callbackId },
};
Dictionary<string, object> response = MiniJSON.Json.Deserialize(tournamentData.Raw) as Dictionary<string, object>;
Dictionary<string, object> success = null;
if (response.TryGetValue("success", out success))
{
string tournamentId;
if (success.TryGetValue("tournamentId", out tournamentId))
{
resultDict["tournament_id"] = tournamentId;
}
string contextId;
if (success.TryGetValue("contextId", out contextId))
{
resultDict["context_id"] = contextId;
}
int endTime;
if (success.TryGetValue("endTime", out endTime))
{
resultDict["end_time"] = endTime;
}
string tournamentTitle;
if (success.TryGetValue("tournamentTitle", out tournamentTitle))
{
resultDict["tournament_title"] = tournamentTitle;
}
IDictionary<string, string> payload;
if (success.TryGetValue("payload", out payload))
{
resultDict["payload"] = payload;
}
}
else
{
resultDict[Constants.ErrorKey] = "ERROR: Wrong Tournament Data";
}
callbackManager.OnFacebookResponse(new TournamentResult(new ResultContainer(resultDict)));
},
(fbg.Error error) =>
{
TournamentResult result = new TournamentResult(WindowsParserBase.SetError(error, callbackId));
callbackManager.OnFacebookResponse(result);
});
}