Skip to content

Commit

Permalink
Merge pull request #50 from PlayFab/master
Browse files Browse the repository at this point in the history
Weekly Versioning PR
  • Loading branch information
zac-playfab committed Jan 26, 2016
2 parents fa67af1 + f5cd80b commit e576d7f
Show file tree
Hide file tree
Showing 16 changed files with 1,548 additions and 64 deletions.
74 changes: 74 additions & 0 deletions PlayFabClientSDK/source/PlayFabClientAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,31 @@ public static async Task<PlayFabResult<GetPlayFabIDsFromGoogleIDsResult>> GetPla
return new PlayFabResult<GetPlayFabIDsFromGoogleIDsResult> { Result = result };
}

/// <summary>
/// Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: http://developers.kongregate.com/docs/client/getUserId).
/// </summary>
public static async Task<PlayFabResult<GetPlayFabIDsFromKongregateIDsResult>> GetPlayFabIDsFromKongregateIDsAsync(GetPlayFabIDsFromKongregateIDsRequest request)
{
if (_authKey == null) throw new Exception ("Must be logged in to call this method");

object httpResult = await PlayFabHTTP.DoPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromKongregateIDs", request, "X-Authorization", _authKey);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<GetPlayFabIDsFromKongregateIDsResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabSettings.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<GetPlayFabIDsFromKongregateIDsResult>>(new JsonTextReader(new StringReader(resultRawJson)));

GetPlayFabIDsFromKongregateIDsResult result = resultData.data;

return new PlayFabResult<GetPlayFabIDsFromKongregateIDsResult> { Result = result };
}

/// <summary>
/// Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers.
/// </summary>
Expand Down Expand Up @@ -2602,6 +2627,31 @@ public static async Task<PlayFabResult<GetCharacterLeaderboardResult>> GetCharac
return new PlayFabResult<GetCharacterLeaderboardResult> { Result = result };
}

/// <summary>
/// Retrieves the details of all title-specific statistics for the user
/// </summary>
public static async Task<PlayFabResult<GetCharacterStatisticsResult>> GetCharacterStatisticsAsync(GetCharacterStatisticsRequest request)
{
if (_authKey == null) throw new Exception ("Must be logged in to call this method");

object httpResult = await PlayFabHTTP.DoPost(PlayFabSettings.GetURL() + "/Client/GetCharacterStatistics", request, "X-Authorization", _authKey);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<GetCharacterStatisticsResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabSettings.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<GetCharacterStatisticsResult>>(new JsonTextReader(new StringReader(resultRawJson)));

GetCharacterStatisticsResult result = resultData.data;

return new PlayFabResult<GetCharacterStatisticsResult> { Result = result };
}

/// <summary>
/// Retrieves a list of ranked characters for the given statistic, centered on the requested Character ID
/// </summary>
Expand Down Expand Up @@ -2677,6 +2727,30 @@ public static async Task<PlayFabResult<GrantCharacterToUserResult>> GrantCharact
return new PlayFabResult<GrantCharacterToUserResult> { Result = result };
}

/// <summary>
/// Updates the values of the specified title-specific statistics for the specific character
/// </summary>
public static async Task<PlayFabResult<UpdateCharacterStatisticsResult>> UpdateCharacterStatisticsAsync(UpdateCharacterStatisticsRequest request)
{

object httpResult = await PlayFabHTTP.DoPost(PlayFabSettings.GetURL() + "/Client/UpdateCharacterStatistics", request, null, null);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<UpdateCharacterStatisticsResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabSettings.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<UpdateCharacterStatisticsResult>>(new JsonTextReader(new StringReader(resultRawJson)));

UpdateCharacterStatisticsResult result = resultData.data;

return new PlayFabResult<UpdateCharacterStatisticsResult> { Result = result };
}

/// <summary>
/// Retrieves the title-specific custom data for the character which is readable and writable by the client
/// </summary>
Expand Down
Loading

0 comments on commit e576d7f

Please sign in to comment.