Skip to content

Commit

Permalink
https://api.playfab.com/releaseNotes/#161121
Browse files Browse the repository at this point in the history
  • Loading branch information
Playfab Jenkins Bot committed Nov 21, 2016
2 parents cc40800 + a63615d commit e174619
Show file tree
Hide file tree
Showing 13 changed files with 408 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public static class CatalogItem implements Comparable<CatalogItem> {
*/
public Boolean IsLimitedEdition;
/**
* If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1.
* If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited edition item, this value determines the total number of instances to allocate for the title. Once this limit has been reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less than zero, it will be ignored.
*/
public Integer InitialLimitedEditionCount;

Expand Down Expand Up @@ -323,7 +323,7 @@ public static class CatalogItemConsumableInfo {
*/
public Long UsageCount;
/**
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on this item's details have completed)
*/
public Long UsagePeriod;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import com.playfab.PlayFabErrors.ErrorCallback;

public class PlayFabSettings {
public static String SdkVersion = "0.40.161107";
public static String SdkVersion = "0.41.161121";
public static String BuildIdentifier = "jbuild_javasdk_1";
public static String SdkVersionString = "JavaSDK-0.40.161107";
public static String SdkVersionString = "JavaSDK-0.41.161121";

public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website)
public static ErrorCallback GlobalErrorHandler;
Expand Down
4 changes: 2 additions & 2 deletions PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public static class CatalogItem implements Comparable<CatalogItem> {
*/
public Boolean IsLimitedEdition;
/**
* If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1.
* If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited edition item, this value determines the total number of instances to allocate for the title. Once this limit has been reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less than zero, it will be ignored.
*/
public Integer InitialLimitedEditionCount;

Expand Down Expand Up @@ -323,7 +323,7 @@ public static class CatalogItemConsumableInfo {
*/
public Long UsageCount;
/**
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on this item's details have completed)
*/
public Long UsagePeriod;
/**
Expand Down
4 changes: 2 additions & 2 deletions PlayFabClientSDK/src/com/playfab/PlayFabSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import com.playfab.PlayFabErrors.ErrorCallback;

public class PlayFabSettings {
public static String SdkVersion = "0.40.161107";
public static String SdkVersion = "0.41.161121";
public static String BuildIdentifier = "jbuild_javasdk_1";
public static String SdkVersionString = "JavaSDK-0.40.161107";
public static String SdkVersionString = "JavaSDK-0.41.161121";

public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website)
public static ErrorCallback GlobalErrorHandler;
Expand Down
116 changes: 116 additions & 0 deletions PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,122 @@
public class PlayFabAdminAPI {
private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create();

/**
* Gets the requested policy.
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<GetPolicyResponse>> GetPolicyAsync(final GetPolicyRequest request) {
return new FutureTask(new Callable<PlayFabResult<GetPolicyResponse>>() {
public PlayFabResult<GetPolicyResponse> call() throws Exception {
return privateGetPolicyAsync(request);
}
});
}

/**
* Gets the requested policy.
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<GetPolicyResponse> GetPolicy(final GetPolicyRequest request) {
FutureTask<PlayFabResult<GetPolicyResponse>> task = new FutureTask(new Callable<PlayFabResult<GetPolicyResponse>>() {
public PlayFabResult<GetPolicyResponse> call() throws Exception {
return privateGetPolicyAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Gets the requested policy.
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<GetPolicyResponse> privateGetPolicyAsync(final GetPolicyRequest 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/GetPolicy", 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<GetPolicyResponse>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Changes a policy for a title
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<UpdatePolicyResponse>> UpdatePolicyAsync(final UpdatePolicyRequest request) {
return new FutureTask(new Callable<PlayFabResult<UpdatePolicyResponse>>() {
public PlayFabResult<UpdatePolicyResponse> call() throws Exception {
return privateUpdatePolicyAsync(request);
}
});
}

/**
* Changes a policy for a title
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<UpdatePolicyResponse> UpdatePolicy(final UpdatePolicyRequest request) {
FutureTask<PlayFabResult<UpdatePolicyResponse>> task = new FutureTask(new Callable<PlayFabResult<UpdatePolicyResponse>>() {
public PlayFabResult<UpdatePolicyResponse> call() throws Exception {
return privateUpdatePolicyAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Changes a policy for a title
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<UpdatePolicyResponse> privateUpdatePolicyAsync(final UpdatePolicyRequest 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/UpdatePolicy", 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<UpdatePolicyResponse>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Bans users by PlayFab ID with optional IP address, or MAC address for the provided game.
*/
Expand Down
87 changes: 79 additions & 8 deletions PlayFabSDK/src/com/playfab/PlayFabAdminModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public static class CatalogItem implements Comparable<CatalogItem> {
*/
public Boolean IsLimitedEdition;
/**
* If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1.
* If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited edition item, this value determines the total number of instances to allocate for the title. Once this limit has been reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less than zero, it will be ignored.
*/
public Integer InitialLimitedEditionCount;

Expand Down Expand Up @@ -428,7 +428,7 @@ public static class CatalogItemConsumableInfo {
*/
public Long UsageCount;
/**
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on this item's details have completed)
*/
public Long UsagePeriod;
/**
Expand Down Expand Up @@ -1114,6 +1114,10 @@ public static class DeleteUsersResult {

}

public static enum EffectType {
Allow
}

public static class EmptyResult {

}
Expand Down Expand Up @@ -1554,6 +1558,26 @@ public static class GetPlayerTagsResult {

}

public static class GetPolicyRequest {
/**
* The name of the policy to read. Only supported name is 'ApiPolicy'.
*/
public String PolicyName;

}

public static class GetPolicyResponse {
/**
* The name of the policy read.
*/
public String PolicyName;
/**
* The statements in the requested policy.
*/
public ArrayList<PermissionStatement> Statements;

}

public static class GetPublisherDataRequest {
/**
* array of keys to get back data from the Publisher data blob, set by the admin tools
Expand Down Expand Up @@ -2286,6 +2310,30 @@ public static class NameIdentifier {

}

public static class PermissionStatement {
/**
* The resource this statements effects. The only supported resources look like 'pfrn:api--*' for all apis, or 'pfrn:api--/Client/ConfirmPurchase' for specific apis.
*/
public String Resource;
/**
* The action this statement effects. The only supported action is 'Execute'.
*/
public String Action;
/**
* The effect this statement will have. The only supported effect is 'Allow'.
*/
public EffectType Effect;
/**
* The principal this statement will effect. The only supported principal is '*'.
*/
public String Principal;
/**
* A comment about the statement. Intended solely for bookeeping and debugging.
*/
public String Comment;

}

public static class PlayerLinkedAccount {
/**
* Authentication platform
Expand Down Expand Up @@ -3187,6 +3235,34 @@ public static class UpdatePlayerStatisticDefinitionResult {

}

public static class UpdatePolicyRequest {
/**
* The name of the policy being updated. Only supported name is 'ApiPolicy'
*/
public String PolicyName;
/**
* The new statements to include in the policy.
*/
public ArrayList<PermissionStatement> Statements;
/**
* Whether to overwrite or append to the existing policy.
*/
public Boolean OverwritePolicy;

}

public static class UpdatePolicyResponse {
/**
* The name of the policy that was updated.
*/
public String PolicyName;
/**
* The statements included in the new version of the policy.
*/
public ArrayList<PermissionStatement> Statements;

}

public static class UpdateRandomResultTablesRequest {
/**
* which catalog is being updated. If null, update the current default catalog version
Expand Down Expand Up @@ -3404,11 +3480,6 @@ public static class UserCredentials {
* Username of user to reset
*/
public String Username;
/**
* @deprecated Do not use
*/
@Deprecated
public String Password;

}

Expand Down Expand Up @@ -3614,7 +3685,7 @@ public static class UserXboxInfo {

public static class VirtualCurrencyData {
/**
* unique one- or two-character identifier for this currency type (e.g.: "CC", "G")
* unique two-character identifier for this currency type (e.g.: "CC")
*/
public String CurrencyCode;
/**
Expand Down
4 changes: 2 additions & 2 deletions PlayFabSDK/src/com/playfab/PlayFabClientModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public static class CatalogItem implements Comparable<CatalogItem> {
*/
public Boolean IsLimitedEdition;
/**
* If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1.
* If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited edition item, this value determines the total number of instances to allocate for the title. Once this limit has been reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less than zero, it will be ignored.
*/
public Integer InitialLimitedEditionCount;

Expand Down Expand Up @@ -323,7 +323,7 @@ public static class CatalogItemConsumableInfo {
*/
public Long UsageCount;
/**
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on this item's details have completed)
*/
public Long UsagePeriod;
/**
Expand Down
4 changes: 2 additions & 2 deletions PlayFabSDK/src/com/playfab/PlayFabServerModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ public static class CatalogItem implements Comparable<CatalogItem> {
*/
public Boolean IsLimitedEdition;
/**
* If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1.
* If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited edition item, this value determines the total number of instances to allocate for the title. Once this limit has been reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less than zero, it will be ignored.
*/
public Integer InitialLimitedEditionCount;

Expand Down Expand Up @@ -404,7 +404,7 @@ public static class CatalogItemConsumableInfo {
*/
public Long UsageCount;
/**
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on this item's details have completed)
*/
public Long UsagePeriod;
/**
Expand Down
4 changes: 2 additions & 2 deletions PlayFabSDK/src/com/playfab/PlayFabSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import com.playfab.PlayFabErrors.ErrorCallback;

public class PlayFabSettings {
public static String SdkVersion = "0.40.161107";
public static String SdkVersion = "0.41.161121";
public static String BuildIdentifier = "jbuild_javasdk_1";
public static String SdkVersionString = "JavaSDK-0.40.161107";
public static String SdkVersionString = "JavaSDK-0.41.161121";

public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website)
public static ErrorCallback GlobalErrorHandler;
Expand Down
Loading

0 comments on commit e174619

Please sign in to comment.