Skip to content

Commit

Permalink
https://docs.microsoft.com/en-us/gaming/playfab/release-notes/#220926
Browse files Browse the repository at this point in the history
  • Loading branch information
PlayFab SDK Team authored and PlayFab SDK Team committed Sep 26, 2022
2 parents 371e7ca + b71a7f0 commit 0672eff
Show file tree
Hide file tree
Showing 28 changed files with 411 additions and 27 deletions.
2 changes: 1 addition & 1 deletion AndroidStudioExample/app/packageMe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds
popd

cd target
Copy-Item client-sdk-0.171.220908.jar -Destination ../../builds/client-sdk-0.171.220908.jar
Copy-Item client-sdk-0.174.220926.jar -Destination ../../builds/client-sdk-0.174.220926.jar
2 changes: 1 addition & 1 deletion AndroidStudioExample/app/packageMe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ mkdir -p ./builds
popd

cd target
cp client-sdk-0.171.220908.jar ../../builds/client-sdk-0.171.220908.jar
cp client-sdk-0.174.220926.jar ../../builds/client-sdk-0.174.220926.jar
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,68 @@
public class PlayFabAuthenticationAPI {
private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create();

/**
* Create a game_server entity token and return a new or existing game_server entity.
* @param request AuthenticateCustomIdRequest
* @return Async Task will return AuthenticateCustomIdResult
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<AuthenticateCustomIdResult>> AuthenticateGameServerWithCustomIdAsync(final AuthenticateCustomIdRequest request) {
return new FutureTask(new Callable<PlayFabResult<AuthenticateCustomIdResult>>() {
public PlayFabResult<AuthenticateCustomIdResult> call() throws Exception {
return privateAuthenticateGameServerWithCustomIdAsync(request);
}
});
}

/**
* Create a game_server entity token and return a new or existing game_server entity.
* @param request AuthenticateCustomIdRequest
* @return AuthenticateCustomIdResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<AuthenticateCustomIdResult> AuthenticateGameServerWithCustomId(final AuthenticateCustomIdRequest request) {
FutureTask<PlayFabResult<AuthenticateCustomIdResult>> task = new FutureTask(new Callable<PlayFabResult<AuthenticateCustomIdResult>>() {
public PlayFabResult<AuthenticateCustomIdResult> call() throws Exception {
return privateAuthenticateGameServerWithCustomIdAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult<AuthenticateCustomIdResult> exceptionResult = new PlayFabResult<AuthenticateCustomIdResult>();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null);
return exceptionResult;
}
}

/** Create a game_server entity token and return a new or existing game_server entity. */
@SuppressWarnings("unchecked")
private static PlayFabResult<AuthenticateCustomIdResult> privateAuthenticateGameServerWithCustomIdAsync(final AuthenticateCustomIdRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/GameServerIdentity/AuthenticateGameServerWithCustomId"), request, "X-EntityToken", PlayFabSettings.EntityToken);
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<AuthenticateCustomIdResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Delete a game_server entity.
* @param request DeleteRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@

public class PlayFabAuthenticationModels {

/** Create or return a game_server entity token. Caller must be a title entity. */
public static class AuthenticateCustomIdRequest {
/**
* The customId used to create and retrieve game_server entity tokens. This is unique at the title level. CustomId must be
* between 32 and 100 characters.
*/
public String CustomId;
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
public Map<String,String> CustomTags;

}

public static class AuthenticateCustomIdResult {
/** The token generated used to set X-EntityToken for game_server calls. */
public EntityTokenResponse EntityToken;
/** True if the account was newly created on this authentication. */
public Boolean NewlyCreated;

}

/**
* Delete a game_server entity. The caller can be the game_server entity attempting to delete itself. Or a title entity
* attempting to delete game_server entities for this title.
Expand Down Expand Up @@ -46,6 +66,16 @@ public static class EntityLineage {

}

public static class EntityTokenResponse {
/** The entity id and type. */
public EntityKey Entity;
/** The token used to set X-EntityToken for all entity based API calls. */
public String EntityToken;
/** The time the token will expire, if it is an expiring token, in UTC. */
public Date TokenExpiration;

}

/**
* This API must be called with X-SecretKey, X-Authentication or X-EntityToken headers. An optional EntityKey may be
* included to attempt to set the resulting EntityToken to a specific entity, however the entity must be a relation of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import com.playfab.PlayFabErrors.ErrorCallback;

public class PlayFabSettings {
public static String SdkVersion = "0.171.220908";
public static String BuildIdentifier = "adobuild_javasdk_114";
public static String SdkVersionString = "JavaSDK-0.171.220908";
public static String SdkVersion = "0.174.220926";
public static String BuildIdentifier = "adobuild_javasdk_116";
public static String SdkVersionString = "JavaSDK-0.174.220926";

public static Map<String, String> RequestGetParams;
static {
Expand Down
2 changes: 1 addition & 1 deletion PlayFabClientSDK/packageMe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds
popd

cd target
Copy-Item client-sdk-0.171.220908.jar -Destination ../../builds/client-sdk-0.171.220908.jar
Copy-Item client-sdk-0.174.220926.jar -Destination ../../builds/client-sdk-0.174.220926.jar
2 changes: 1 addition & 1 deletion PlayFabClientSDK/packageMe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ mkdir -p ./builds
popd

cd target
cp client-sdk-0.171.220908.jar ../../builds/client-sdk-0.171.220908.jar
cp client-sdk-0.174.220926.jar ../../builds/client-sdk-0.174.220926.jar
2 changes: 1 addition & 1 deletion PlayFabClientSDK/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- GAV & Meta -->
<groupId>com.playfab</groupId>
<artifactId>client-sdk</artifactId>
<version>0.171.220908</version>
<version>0.174.220926</version>
<name>PlayFab Client API</name>
<description>PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience. </description>
<url>https://docs.microsoft.com/gaming/playfab/</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,68 @@
public class PlayFabAuthenticationAPI {
private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create();

/**
* Create a game_server entity token and return a new or existing game_server entity.
* @param request AuthenticateCustomIdRequest
* @return Async Task will return AuthenticateCustomIdResult
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<AuthenticateCustomIdResult>> AuthenticateGameServerWithCustomIdAsync(final AuthenticateCustomIdRequest request) {
return new FutureTask(new Callable<PlayFabResult<AuthenticateCustomIdResult>>() {
public PlayFabResult<AuthenticateCustomIdResult> call() throws Exception {
return privateAuthenticateGameServerWithCustomIdAsync(request);
}
});
}

/**
* Create a game_server entity token and return a new or existing game_server entity.
* @param request AuthenticateCustomIdRequest
* @return AuthenticateCustomIdResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<AuthenticateCustomIdResult> AuthenticateGameServerWithCustomId(final AuthenticateCustomIdRequest request) {
FutureTask<PlayFabResult<AuthenticateCustomIdResult>> task = new FutureTask(new Callable<PlayFabResult<AuthenticateCustomIdResult>>() {
public PlayFabResult<AuthenticateCustomIdResult> call() throws Exception {
return privateAuthenticateGameServerWithCustomIdAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult<AuthenticateCustomIdResult> exceptionResult = new PlayFabResult<AuthenticateCustomIdResult>();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null);
return exceptionResult;
}
}

/** Create a game_server entity token and return a new or existing game_server entity. */
@SuppressWarnings("unchecked")
private static PlayFabResult<AuthenticateCustomIdResult> privateAuthenticateGameServerWithCustomIdAsync(final AuthenticateCustomIdRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/GameServerIdentity/AuthenticateGameServerWithCustomId"), request, "X-EntityToken", PlayFabSettings.EntityToken);
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<AuthenticateCustomIdResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Delete a game_server entity.
* @param request DeleteRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@

public class PlayFabAuthenticationModels {

/** Create or return a game_server entity token. Caller must be a title entity. */
public static class AuthenticateCustomIdRequest {
/**
* The customId used to create and retrieve game_server entity tokens. This is unique at the title level. CustomId must be
* between 32 and 100 characters.
*/
public String CustomId;
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
public Map<String,String> CustomTags;

}

public static class AuthenticateCustomIdResult {
/** The token generated used to set X-EntityToken for game_server calls. */
public EntityTokenResponse EntityToken;
/** True if the account was newly created on this authentication. */
public Boolean NewlyCreated;

}

/**
* Delete a game_server entity. The caller can be the game_server entity attempting to delete itself. Or a title entity
* attempting to delete game_server entities for this title.
Expand Down Expand Up @@ -46,6 +66,16 @@ public static class EntityLineage {

}

public static class EntityTokenResponse {
/** The entity id and type. */
public EntityKey Entity;
/** The token used to set X-EntityToken for all entity based API calls. */
public String EntityToken;
/** The time the token will expire, if it is an expiring token, in UTC. */
public Date TokenExpiration;

}

/**
* This API must be called with X-SecretKey, X-Authentication or X-EntityToken headers. An optional EntityKey may be
* included to attempt to set the resulting EntityToken to a specific entity, however the entity must be a relation of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import com.playfab.PlayFabErrors.ErrorCallback;

public class PlayFabSettings {
public static String SdkVersion = "0.171.220908";
public static String BuildIdentifier = "adobuild_javasdk_114";
public static String SdkVersionString = "JavaSDK-0.171.220908";
public static String SdkVersion = "0.174.220926";
public static String BuildIdentifier = "adobuild_javasdk_116";
public static String SdkVersionString = "JavaSDK-0.174.220926";

public static Map<String, String> RequestGetParams;
static {
Expand Down
2 changes: 1 addition & 1 deletion PlayFabSDK/packageMe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds
popd

cd target
Copy-Item combo-sdk-0.171.220908.jar -Destination ../../builds/combo-sdk-0.171.220908.jar
Copy-Item combo-sdk-0.174.220926.jar -Destination ../../builds/combo-sdk-0.174.220926.jar
2 changes: 1 addition & 1 deletion PlayFabSDK/packageMe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ mkdir -p ./builds
popd

cd target
cp combo-sdk-0.171.220908.jar ../../builds/combo-sdk-0.171.220908.jar
cp combo-sdk-0.174.220926.jar ../../builds/combo-sdk-0.174.220926.jar
2 changes: 1 addition & 1 deletion PlayFabSDK/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- GAV & Meta -->
<groupId>com.playfab</groupId>
<artifactId>combo-sdk</artifactId>
<version>0.171.220908</version>
<version>0.174.220926</version>
<name>PlayFab Combo API</name>
<description>PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience. </description>
<url>https://docs.microsoft.com/gaming/playfab/</url>
Expand Down
62 changes: 62 additions & 0 deletions PlayFabSDK/src/main/java/com/playfab/PlayFabAuthenticationAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,68 @@
public class PlayFabAuthenticationAPI {
private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create();

/**
* Create a game_server entity token and return a new or existing game_server entity.
* @param request AuthenticateCustomIdRequest
* @return Async Task will return AuthenticateCustomIdResult
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<AuthenticateCustomIdResult>> AuthenticateGameServerWithCustomIdAsync(final AuthenticateCustomIdRequest request) {
return new FutureTask(new Callable<PlayFabResult<AuthenticateCustomIdResult>>() {
public PlayFabResult<AuthenticateCustomIdResult> call() throws Exception {
return privateAuthenticateGameServerWithCustomIdAsync(request);
}
});
}

/**
* Create a game_server entity token and return a new or existing game_server entity.
* @param request AuthenticateCustomIdRequest
* @return AuthenticateCustomIdResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<AuthenticateCustomIdResult> AuthenticateGameServerWithCustomId(final AuthenticateCustomIdRequest request) {
FutureTask<PlayFabResult<AuthenticateCustomIdResult>> task = new FutureTask(new Callable<PlayFabResult<AuthenticateCustomIdResult>>() {
public PlayFabResult<AuthenticateCustomIdResult> call() throws Exception {
return privateAuthenticateGameServerWithCustomIdAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult<AuthenticateCustomIdResult> exceptionResult = new PlayFabResult<AuthenticateCustomIdResult>();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null);
return exceptionResult;
}
}

/** Create a game_server entity token and return a new or existing game_server entity. */
@SuppressWarnings("unchecked")
private static PlayFabResult<AuthenticateCustomIdResult> privateAuthenticateGameServerWithCustomIdAsync(final AuthenticateCustomIdRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/GameServerIdentity/AuthenticateGameServerWithCustomId"), request, "X-EntityToken", PlayFabSettings.EntityToken);
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<AuthenticateCustomIdResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Delete a game_server entity.
* @param request DeleteRequest
Expand Down
Loading

0 comments on commit 0672eff

Please sign in to comment.