Skip to content

Commit

Permalink
https://api.playfab.com/releaseNotes/#161003
Browse files Browse the repository at this point in the history
  • Loading branch information
Playfab Jenkins Bot committed Oct 3, 2016
2 parents 31437c0 + 939e9e6 commit 9f97f96
Show file tree
Hide file tree
Showing 21 changed files with 401 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3953,6 +3953,64 @@ private static PlayFabResult<GetStoreItemsResult> privateGetStoreItemsAsync(fina
return pfResult;
}

/**
* Retrieves the current server time
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<GetTimeResult>> GetTimeAsync(final GetTimeRequest request) {
return new FutureTask(new Callable<PlayFabResult<GetTimeResult>>() {
public PlayFabResult<GetTimeResult> call() throws Exception {
return privateGetTimeAsync(request);
}
});
}

/**
* Retrieves the current server time
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<GetTimeResult> GetTime(final GetTimeRequest request) {
FutureTask<PlayFabResult<GetTimeResult>> task = new FutureTask(new Callable<PlayFabResult<GetTimeResult>>() {
public PlayFabResult<GetTimeResult> call() throws Exception {
return privateGetTimeAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Retrieves the current server time
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<GetTimeResult> privateGetTimeAsync(final GetTimeRequest 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/GetTime", 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<GetTimeResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Retrieves the key-value store of custom title settings
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,18 @@ public static class GetStoreItemsResult {

}

public static class GetTimeRequest {

}

public static class GetTimeResult {
/**
* Current server time when the request was received, in UTC
*/
public Date Time;

}

public static class GetTitleDataRequest {
/**
* Specific keys to search for in the title data (leave null to get all keys)
Expand Down Expand Up @@ -2928,6 +2940,10 @@ public static class PayForPurchaseResult {
* Current virtual currency totals for the user.
*/
public Map<String,Integer> VirtualCurrency;
/**
* A token generated by the provider to authenticate the request (provider-specific).
*/
public String ProviderToken;

}

Expand Down Expand Up @@ -3368,8 +3384,7 @@ public static enum SourceType {
BackEnd,
GameClient,
GameServer,
Partner,
Stream
Partner
}

public static class StartGameRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ public static enum PlayFabErrorCode {
RequestAlreadyRunning(1249),
ActionGroupNotFound(1250),
MaximumSegmentBulkActionJobsRunning(1251),
NoActionsOnPlayersInSegmentJob(1252);
NoActionsOnPlayersInSegmentJob(1252),
DuplicateStatisticName(1253),
ScheduledTaskNameConflict(1254),
ScheduledTaskCreateConflict(1255),
InvalidScheduledTaskName(1256),
InvalidTaskSchedule(1257);

public int id;

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.37.160919";
public static String SdkVersion = "0.38.161003";
public static String BuildIdentifier = "jbuild_javasdk_1";
public static String SdkVersionString = "JavaSDK-0.37.160919";
public static String SdkVersionString = "JavaSDK-0.38.161003";

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
58 changes: 58 additions & 0 deletions PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3952,6 +3952,64 @@ private static PlayFabResult<GetStoreItemsResult> privateGetStoreItemsAsync(fina
return pfResult;
}

/**
* Retrieves the current server time
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<GetTimeResult>> GetTimeAsync(final GetTimeRequest request) {
return new FutureTask(new Callable<PlayFabResult<GetTimeResult>>() {
public PlayFabResult<GetTimeResult> call() throws Exception {
return privateGetTimeAsync(request);
}
});
}

/**
* Retrieves the current server time
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<GetTimeResult> GetTime(final GetTimeRequest request) {
FutureTask<PlayFabResult<GetTimeResult>> task = new FutureTask(new Callable<PlayFabResult<GetTimeResult>>() {
public PlayFabResult<GetTimeResult> call() throws Exception {
return privateGetTimeAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Retrieves the current server time
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<GetTimeResult> privateGetTimeAsync(final GetTimeRequest 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/GetTime", 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<GetTimeResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Retrieves the key-value store of custom title settings
*/
Expand Down
19 changes: 17 additions & 2 deletions PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,18 @@ public static class GetStoreItemsResult {

}

public static class GetTimeRequest {

}

public static class GetTimeResult {
/**
* Current server time when the request was received, in UTC
*/
public Date Time;

}

public static class GetTitleDataRequest {
/**
* Specific keys to search for in the title data (leave null to get all keys)
Expand Down Expand Up @@ -2928,6 +2940,10 @@ public static class PayForPurchaseResult {
* Current virtual currency totals for the user.
*/
public Map<String,Integer> VirtualCurrency;
/**
* A token generated by the provider to authenticate the request (provider-specific).
*/
public String ProviderToken;

}

Expand Down Expand Up @@ -3368,8 +3384,7 @@ public static enum SourceType {
BackEnd,
GameClient,
GameServer,
Partner,
Stream
Partner
}

public static class StartGameRequest {
Expand Down
7 changes: 6 additions & 1 deletion PlayFabClientSDK/src/com/playfab/PlayFabErrors.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ public static enum PlayFabErrorCode {
RequestAlreadyRunning(1249),
ActionGroupNotFound(1250),
MaximumSegmentBulkActionJobsRunning(1251),
NoActionsOnPlayersInSegmentJob(1252);
NoActionsOnPlayersInSegmentJob(1252),
DuplicateStatisticName(1253),
ScheduledTaskNameConflict(1254),
ScheduledTaskCreateConflict(1255),
InvalidScheduledTaskName(1256),
InvalidTaskSchedule(1257);

public int id;

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.37.160919";
public static String SdkVersion = "0.38.161003";
public static String BuildIdentifier = "jbuild_javasdk_1";
public static String SdkVersionString = "JavaSDK-0.37.160919";
public static String SdkVersionString = "JavaSDK-0.38.161003";

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
14 changes: 2 additions & 12 deletions PlayFabSDK/src/PlayFabApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ public class PlayFabApiTest
private static final String CHAR_TEST_TYPE = "Test";

// Fixed values provided from testInputs
private static String USER_NAME;
private static String USER_EMAIL;
private static String USER_PASSWORD;
private static String CHAR_NAME;
private static boolean TITLE_CAN_UPDATE_SETTINGS;

Expand Down Expand Up @@ -70,9 +68,7 @@ private class TitleData
public String titleId;
public String developerSecretKey;
public String titleCanUpdateSettings;
public String userName;
public String userEmail;
public String userPassword;
public String characterName;
}

Expand All @@ -93,9 +89,7 @@ public static void oneTimeSetUp() {
//PlayFabSettings.TitleId = "TODO: TitleID";
//PlayFabSettings.DeveloperSecretKey = "TODO: A big long secret key that you should NEVER publish with your client";
//TITLE_CAN_UPDATE_SETTINGS = false; // TODO: Set to true if you've enabled this in your title.
//USER_NAME = "TODO: a test username (make this up for yourself)";
//USER_EMAIL = "TODO: a test email (use your own)";
//USER_PASSWORD = "TODO: a test password (this is the existing password for the user above, or the new password if the user doesn't exist yet)";
//USER_EMAIL = "TODO: an email associated with an existing account on your title";
//CHAR_NAME = "TODO: a test character (make this up for yourself)";
return;
}
Expand All @@ -104,9 +98,7 @@ public static void oneTimeSetUp() {
PlayFabSettings.TitleId = resultData.titleId;
PlayFabSettings.DeveloperSecretKey = resultData.developerSecretKey;
TITLE_CAN_UPDATE_SETTINGS = Boolean.parseBoolean(resultData.titleCanUpdateSettings);
USER_NAME = resultData.userName;
USER_EMAIL = resultData.userEmail;
USER_PASSWORD = resultData.userPassword;
CHAR_NAME = resultData.characterName;
}

Expand All @@ -121,7 +113,7 @@ public void InvalidLogin()
PlayFabClientModels.LoginWithEmailAddressRequest request = new PlayFabClientModels.LoginWithEmailAddressRequest();
request.TitleId = PlayFabSettings.TitleId;
request.Email = USER_EMAIL;
request.Password = USER_PASSWORD + "invalid";
request.Password = "INVALID";

PlayFabResult<PlayFabClientModels.LoginResult> result = PlayFabClientAPI.LoginWithEmailAddress(request);
VerifyResult(result, false);
Expand Down Expand Up @@ -168,8 +160,6 @@ public void LoginOrRegister()
VerifyResult(result, true);
assertNotNull(result.Result.PlayFabId);
playFabId = result.Result.PlayFabId;

// TODO: Register if the login failed
}

/// <summary>
Expand Down
3 changes: 1 addition & 2 deletions PlayFabSDK/src/com/playfab/PlayFabAdminModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -2219,8 +2219,7 @@ public static enum SourceType {
BackEnd,
GameClient,
GameServer,
Partner,
Stream
Partner
}

public static enum StatisticAggregationMethod {
Expand Down
58 changes: 58 additions & 0 deletions PlayFabSDK/src/com/playfab/PlayFabClientAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3952,6 +3952,64 @@ private static PlayFabResult<GetStoreItemsResult> privateGetStoreItemsAsync(fina
return pfResult;
}

/**
* Retrieves the current server time
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<GetTimeResult>> GetTimeAsync(final GetTimeRequest request) {
return new FutureTask(new Callable<PlayFabResult<GetTimeResult>>() {
public PlayFabResult<GetTimeResult> call() throws Exception {
return privateGetTimeAsync(request);
}
});
}

/**
* Retrieves the current server time
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<GetTimeResult> GetTime(final GetTimeRequest request) {
FutureTask<PlayFabResult<GetTimeResult>> task = new FutureTask(new Callable<PlayFabResult<GetTimeResult>>() {
public PlayFabResult<GetTimeResult> call() throws Exception {
return privateGetTimeAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Retrieves the current server time
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<GetTimeResult> privateGetTimeAsync(final GetTimeRequest 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/GetTime", 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<GetTimeResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Retrieves the key-value store of custom title settings
*/
Expand Down
Loading

0 comments on commit 9f97f96

Please sign in to comment.