Skip to content

Commit

Permalink
Merge pull request #43 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 75309cd + 88784fa commit c302f35
Show file tree
Hide file tree
Showing 20 changed files with 1,719 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,64 @@ private static PlayFabResult<GetPlayFabIDsFromGoogleIDsResult> privateGetPlayFab
return pfResult;
}

/**
* 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).
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<GetPlayFabIDsFromKongregateIDsResult>> GetPlayFabIDsFromKongregateIDsAsync(final GetPlayFabIDsFromKongregateIDsRequest request) {
return new FutureTask(new Callable<PlayFabResult<GetPlayFabIDsFromKongregateIDsResult>>() {
public PlayFabResult<GetPlayFabIDsFromKongregateIDsResult> call() throws Exception {
return privateGetPlayFabIDsFromKongregateIDsAsync(request);
}
});
}

/**
* 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).
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<GetPlayFabIDsFromKongregateIDsResult> GetPlayFabIDsFromKongregateIDs(final GetPlayFabIDsFromKongregateIDsRequest request) {
FutureTask<PlayFabResult<GetPlayFabIDsFromKongregateIDsResult>> task = new FutureTask(new Callable<PlayFabResult<GetPlayFabIDsFromKongregateIDsResult>>() {
public PlayFabResult<GetPlayFabIDsFromKongregateIDsResult> call() throws Exception {
return privateGetPlayFabIDsFromKongregateIDsAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* 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).
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<GetPlayFabIDsFromKongregateIDsResult> privateGetPlayFabIDsFromKongregateIDsAsync(final GetPlayFabIDsFromKongregateIDsRequest request) throws Exception {
if (_authKey == null) throw new Exception ("Must be logged in to call this method");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromKongregateIDs", request, "X-Authorization", _authKey);
task.run();
Object httpResult = task.get();
if(httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult<GetPlayFabIDsFromKongregateIDsResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

PlayFabJsonSuccess<GetPlayFabIDsFromKongregateIDsResult> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<GetPlayFabIDsFromKongregateIDsResult>>(){}.getType());
GetPlayFabIDsFromKongregateIDsResult result = resultData.data;

PlayFabResult<GetPlayFabIDsFromKongregateIDsResult> pfResult = new PlayFabResult<GetPlayFabIDsFromKongregateIDsResult>();
pfResult.Result = result;
return pfResult;
}

/**
* Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers.
*/
Expand Down Expand Up @@ -5972,6 +6030,64 @@ private static PlayFabResult<GetCharacterLeaderboardResult> privateGetCharacterL
return pfResult;
}

/**
* Retrieves the details of all title-specific statistics for the user
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<GetCharacterStatisticsResult>> GetCharacterStatisticsAsync(final GetCharacterStatisticsRequest request) {
return new FutureTask(new Callable<PlayFabResult<GetCharacterStatisticsResult>>() {
public PlayFabResult<GetCharacterStatisticsResult> call() throws Exception {
return privateGetCharacterStatisticsAsync(request);
}
});
}

/**
* Retrieves the details of all title-specific statistics for the user
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<GetCharacterStatisticsResult> GetCharacterStatistics(final GetCharacterStatisticsRequest request) {
FutureTask<PlayFabResult<GetCharacterStatisticsResult>> task = new FutureTask(new Callable<PlayFabResult<GetCharacterStatisticsResult>>() {
public PlayFabResult<GetCharacterStatisticsResult> call() throws Exception {
return privateGetCharacterStatisticsAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Retrieves the details of all title-specific statistics for the user
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<GetCharacterStatisticsResult> privateGetCharacterStatisticsAsync(final GetCharacterStatisticsRequest request) throws Exception {
if (_authKey == null) throw new Exception ("Must be logged in to call this method");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterStatistics", request, "X-Authorization", _authKey);
task.run();
Object httpResult = task.get();
if(httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult<GetCharacterStatisticsResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

PlayFabJsonSuccess<GetCharacterStatisticsResult> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<GetCharacterStatisticsResult>>(){}.getType());
GetCharacterStatisticsResult result = resultData.data;

PlayFabResult<GetCharacterStatisticsResult> pfResult = new PlayFabResult<GetCharacterStatisticsResult>();
pfResult.Result = result;
return pfResult;
}

/**
* Retrieves a list of ranked characters for the given statistic, centered on the requested Character ID
*/
Expand Down Expand Up @@ -6146,6 +6262,63 @@ private static PlayFabResult<GrantCharacterToUserResult> privateGrantCharacterTo
return pfResult;
}

/**
* Updates the values of the specified title-specific statistics for the specific character
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<UpdateCharacterStatisticsResult>> UpdateCharacterStatisticsAsync(final UpdateCharacterStatisticsRequest request) {
return new FutureTask(new Callable<PlayFabResult<UpdateCharacterStatisticsResult>>() {
public PlayFabResult<UpdateCharacterStatisticsResult> call() throws Exception {
return privateUpdateCharacterStatisticsAsync(request);
}
});
}

/**
* Updates the values of the specified title-specific statistics for the specific character
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<UpdateCharacterStatisticsResult> UpdateCharacterStatistics(final UpdateCharacterStatisticsRequest request) {
FutureTask<PlayFabResult<UpdateCharacterStatisticsResult>> task = new FutureTask(new Callable<PlayFabResult<UpdateCharacterStatisticsResult>>() {
public PlayFabResult<UpdateCharacterStatisticsResult> call() throws Exception {
return privateUpdateCharacterStatisticsAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Updates the values of the specified title-specific statistics for the specific character
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<UpdateCharacterStatisticsResult> privateUpdateCharacterStatisticsAsync(final UpdateCharacterStatisticsRequest request) throws Exception {

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateCharacterStatistics", request, null, null);
task.run();
Object httpResult = task.get();
if(httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult<UpdateCharacterStatisticsResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

PlayFabJsonSuccess<UpdateCharacterStatisticsResult> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<UpdateCharacterStatisticsResult>>(){}.getType());
UpdateCharacterStatisticsResult result = resultData.data;

PlayFabResult<UpdateCharacterStatisticsResult> pfResult = new PlayFabResult<UpdateCharacterStatisticsResult>();
pfResult.Result = result;
return pfResult;
}

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

0 comments on commit c302f35

Please sign in to comment.