Skip to content

Commit

Permalink
Merge pull request #61 from PlayFab/master
Browse files Browse the repository at this point in the history
Weekly Versioning PR: 160411
  • Loading branch information
zac-playfab committed Apr 12, 2016
2 parents d80c198 + 9578cf9 commit f12b00f
Show file tree
Hide file tree
Showing 20 changed files with 1,059 additions and 966 deletions.
280 changes: 140 additions & 140 deletions AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,7 @@ public static class LinkGameCenterAccountResult {

public static class LinkGoogleAccountRequest {
/**
* Unique token from Google Play for the user.
* Unique token (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods) from Google Play for the user.
*/
public String AccessToken;

Expand Down Expand Up @@ -2144,7 +2144,7 @@ public static class LoginWithGoogleAccountRequest {
*/
public String TitleId;
/**
* Unique token from Google Play for the user.
* Unique token (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods) from Google Play for the user.
*/
public String AccessToken;
/**
Expand Down Expand Up @@ -2489,22 +2489,6 @@ public static class PlayerStatisticVersion {

}

public static class PlayStreamEventHistory {
/**
* The ID of the trigger that caused this event to be created.
*/
public String ParentTriggerId;
/**
* The ID of the previous event that caused this event to be created by hitting a trigger.
*/
public String ParentEventId;
/**
* If true, then this event was allowed to trigger subsequent events in a trigger.
*/
public Boolean TriggeredEvents;

}

public static class PurchaseItemRequest {
/**
* Unique identifier of the item to purchase.
Expand Down Expand Up @@ -2847,15 +2831,6 @@ public static class SharedGroupDataRecord {

}

public static enum SourceType {
Admin,
BackEnd,
GameClient,
GameServer,
Partner,
Stream
}

public static class StartGameRequest {
/**
* version information for the build of the game server which is to be started
Expand Down Expand Up @@ -3399,7 +3374,7 @@ public static class UpdateUserDataResult {

public static class UpdateUserStatisticsRequest {
/**
* Statistics to be updated with the provided values.
* Statistics to be updated with the provided values. UserStatistics object must follow the Key(string), Value(int) pattern.
*/
public Map<String,Integer> UserStatistics;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ public static enum PlayFabErrorCode {
CloudScriptHTTPRequestError(1211),
InsufficientGuildRole(1212),
GuildNotFound(1213),
OverLimit(1214);
OverLimit(1214),
EventNotFound(1215),
InvalidEventEntity(1216),
InvalidEventName(1217);

public int id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.playfab.internal;

public class PlayFabVersion {
public static String SdkRevision = "0.20.160328";
public static String SdkRevision = "0.21.160411";
public static String getVersionString() {
return "JavaSDK-" + SdkRevision;
}
Expand Down
280 changes: 140 additions & 140 deletions PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java

Large diffs are not rendered by default.

31 changes: 3 additions & 28 deletions PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,7 @@ public static class LinkGameCenterAccountResult {

public static class LinkGoogleAccountRequest {
/**
* Unique token from Google Play for the user.
* Unique token (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods) from Google Play for the user.
*/
public String AccessToken;

Expand Down Expand Up @@ -2144,7 +2144,7 @@ public static class LoginWithGoogleAccountRequest {
*/
public String TitleId;
/**
* Unique token from Google Play for the user.
* Unique token (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods) from Google Play for the user.
*/
public String AccessToken;
/**
Expand Down Expand Up @@ -2489,22 +2489,6 @@ public static class PlayerStatisticVersion {

}

public static class PlayStreamEventHistory {
/**
* The ID of the trigger that caused this event to be created.
*/
public String ParentTriggerId;
/**
* The ID of the previous event that caused this event to be created by hitting a trigger.
*/
public String ParentEventId;
/**
* If true, then this event was allowed to trigger subsequent events in a trigger.
*/
public Boolean TriggeredEvents;

}

public static class PurchaseItemRequest {
/**
* Unique identifier of the item to purchase.
Expand Down Expand Up @@ -2847,15 +2831,6 @@ public static class SharedGroupDataRecord {

}

public static enum SourceType {
Admin,
BackEnd,
GameClient,
GameServer,
Partner,
Stream
}

public static class StartGameRequest {
/**
* version information for the build of the game server which is to be started
Expand Down Expand Up @@ -3399,7 +3374,7 @@ public static class UpdateUserDataResult {

public static class UpdateUserStatisticsRequest {
/**
* Statistics to be updated with the provided values.
* Statistics to be updated with the provided values. UserStatistics object must follow the Key(string), Value(int) pattern.
*/
public Map<String,Integer> UserStatistics;

Expand Down
5 changes: 4 additions & 1 deletion PlayFabClientSDK/src/com/playfab/PlayFabErrors.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ public static enum PlayFabErrorCode {
CloudScriptHTTPRequestError(1211),
InsufficientGuildRole(1212),
GuildNotFound(1213),
OverLimit(1214);
OverLimit(1214),
EventNotFound(1215),
InvalidEventEntity(1216),
InvalidEventName(1217);

public int id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.playfab.internal;

public class PlayFabVersion {
public static String SdkRevision = "0.20.160328";
public static String SdkRevision = "0.21.160411";
public static String getVersionString() {
return "JavaSDK-" + SdkRevision;
}
Expand Down
116 changes: 58 additions & 58 deletions PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,64 @@ private static PlayFabResult<GetCatalogItemsResult> privateGetCatalogItemsAsync(
return pfResult;
}

/**
* Retrieves the key-value store of custom publisher settings
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<GetPublisherDataResult>> GetPublisherDataAsync(final GetPublisherDataRequest request) {
return new FutureTask(new Callable<PlayFabResult<GetPublisherDataResult>>() {
public PlayFabResult<GetPublisherDataResult> call() throws Exception {
return privateGetPublisherDataAsync(request);
}
});
}

/**
* Retrieves the key-value store of custom publisher settings
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<GetPublisherDataResult> GetPublisherData(final GetPublisherDataRequest request) {
FutureTask<PlayFabResult<GetPublisherDataResult>> task = new FutureTask(new Callable<PlayFabResult<GetPublisherDataResult>>() {
public PlayFabResult<GetPublisherDataResult> call() throws Exception {
return privateGetPublisherDataAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Retrieves the key-value store of custom publisher settings
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<GetPublisherDataResult> privateGetPublisherDataAsync(final GetPublisherDataRequest request) throws Exception {
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/GetPublisherData", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
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<GetPublisherDataResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Retrieves the random drop table configuration for the title
*/
Expand Down Expand Up @@ -3032,64 +3090,6 @@ private static PlayFabResult<RemoveServerBuildResult> privateRemoveServerBuildAs
return pfResult;
}

/**
* Retrieves the key-value store of custom publisher settings
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<GetPublisherDataResult>> GetPublisherDataAsync(final GetPublisherDataRequest request) {
return new FutureTask(new Callable<PlayFabResult<GetPublisherDataResult>>() {
public PlayFabResult<GetPublisherDataResult> call() throws Exception {
return privateGetPublisherDataAsync(request);
}
});
}

/**
* Retrieves the key-value store of custom publisher settings
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<GetPublisherDataResult> GetPublisherData(final GetPublisherDataRequest request) {
FutureTask<PlayFabResult<GetPublisherDataResult>> task = new FutureTask(new Callable<PlayFabResult<GetPublisherDataResult>>() {
public PlayFabResult<GetPublisherDataResult> call() throws Exception {
return privateGetPublisherDataAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Retrieves the key-value store of custom publisher settings
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<GetPublisherDataResult> privateGetPublisherDataAsync(final GetPublisherDataRequest request) throws Exception {
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/GetPublisherData", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
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<GetPublisherDataResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Updates the key-value store of custom publisher settings
*/
Expand Down
Loading

0 comments on commit f12b00f

Please sign in to comment.