diff --git a/AndroidStudioExample/app/packageMe.ps1 b/AndroidStudioExample/app/packageMe.ps1 index 0a883d7f..58f170c0 100644 --- a/AndroidStudioExample/app/packageMe.ps1 +++ b/AndroidStudioExample/app/packageMe.ps1 @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds popd cd target -Copy-Item client-sdk-0.206.231124.jar -Destination ../../builds/client-sdk-0.206.231124.jar \ No newline at end of file +Copy-Item client-sdk-0.207.231208.jar -Destination ../../builds/client-sdk-0.207.231208.jar \ No newline at end of file diff --git a/AndroidStudioExample/app/packageMe.sh b/AndroidStudioExample/app/packageMe.sh index 0628cb2f..44e4d80b 100644 --- a/AndroidStudioExample/app/packageMe.sh +++ b/AndroidStudioExample/app/packageMe.sh @@ -7,4 +7,4 @@ mkdir -p ./builds popd cd target -cp client-sdk-0.206.231124.jar ../../builds/client-sdk-0.206.231124.jar +cp client-sdk-0.207.231208.jar ../../builds/client-sdk-0.207.231208.jar diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java index 7c9a0ec1..371a414f 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java @@ -563,6 +563,7 @@ public static enum PlayFabErrorCode { LeaderboardColumnLengthMismatch(1562), InvalidStatisticScore(1563), LeaderboardColumnsNotSpecified(1564), + LeaderboardMaxSizeTooLarge(1565), MatchmakingEntityInvalid(2001), MatchmakingPlayerAttributesInvalid(2002), MatchmakingQueueNotFound(2016), @@ -606,6 +607,7 @@ public static enum PlayFabErrorCode { CatalogItemTypeInvalid(4012), CatalogBadRequest(4013), CatalogTooManyRequests(4014), + InvalidCatalogItemConfiguration(4015), ExportInvalidStatusUpdate(5000), ExportInvalidPrefix(5001), ExportBlobContainerDoesNotExist(5002), diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerAPI.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerAPI.java index 1bbae772..a3abcdd2 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerAPI.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerAPI.java @@ -2831,6 +2831,68 @@ private static PlayFabResult privateJoinLobbyAsync(final JoinLo return pfResult; } + /** + * Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. + * @param request JoinLobbyAsServerRequest + * @return Async Task will return JoinLobbyAsServerResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> JoinLobbyAsServerAsync(final JoinLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateJoinLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. + * @param request JoinLobbyAsServerRequest + * @return JoinLobbyAsServerResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult JoinLobbyAsServer(final JoinLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateJoinLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateJoinLobbyAsServerAsync(final JoinLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/JoinLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + JoinLobbyAsServerResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Join a matchmaking ticket. * @param request JoinMatchmakingTicketRequest @@ -2955,6 +3017,68 @@ private static PlayFabResult privateLeaveLobbyAsync(final Leav return pfResult; } + /** + * Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. + * @param request LeaveLobbyAsServerRequest + * @return Async Task will return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> LeaveLobbyAsServerAsync(final LeaveLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLeaveLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. + * @param request LeaveLobbyAsServerRequest + * @return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LeaveLobbyAsServer(final LeaveLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLeaveLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLeaveLobbyAsServerAsync(final LeaveLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/LeaveLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LobbyEmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Lists archived multiplayer server sessions for a build. * @param request ListMultiplayerServersRequest @@ -4648,6 +4772,76 @@ private static PlayFabResult privateUpdateLobbyAsync(final Upd return pfResult; } + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + * @param request UpdateLobbyAsServerRequest + * @return Async Task will return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdateLobbyAsServerAsync(final UpdateLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + * @param request UpdateLobbyAsServerRequest + * @return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdateLobbyAsServer(final UpdateLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdateLobbyAsServerAsync(final UpdateLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/UpdateLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LobbyEmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Uploads a multiplayer server game certificate. * @param request UploadCertificateRequest diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerModels.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerModels.java index 4c5c3924..e804dcbb 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerModels.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerModels.java @@ -1703,6 +1703,45 @@ public static class JoinArrangedLobbyRequest { } + /** + * Preview: Request to join a lobby as a server. Only callable by a game_server entity and this is restricted to client + * owned lobbies which are using connections. + */ + public static class JoinLobbyAsServerRequest { + /** + * A field which indicates which lobby the game_server will be joining. This field is opaque to everyone except the Lobby + * service. + */ + public String ConnectionString; + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** + * The private key-value pairs which are visible to all entities in the lobby but can only be modified by the joined + * server.At most 30 key - value pairs may be stored here, keys are limited to 30 characters and values to 1000.The total + * size of all serverData values may not exceed 4096 bytes. + */ + public Map ServerData; + /** + * The game_server entity which is joining the Lobby. If a different game_server entity has already joined the request will + * fail unless the joined entity is disconnected, in which case the incoming game_server entity will replace the + * disconnected entity. + */ + public EntityKey ServerEntity; + + } + + public static class JoinLobbyAsServerResult { + /** Successfully joined lobby's id. */ + public String LobbyId; + /** + * A setting that describes the state of the ServerData after JoinLobbyAsServer call is completed. It is "Initialized", the + * first time a server joins the lobby. It is "Ignored" in any subsequent JoinLobbyAsServer calls after it has been + * initialized. Any new server taking over should call UpdateLobbyAsServer to update ServerData fields. + */ + public ServerDataStatus ServerDataStatus; + + } + /** Request to join a lobby. Only a client can join a lobby. */ public static class JoinLobbyRequest { /** A field which indicates which lobby the user will be joining. This field is opaque to everyone except the Lobby service. */ @@ -1748,6 +1787,23 @@ public static class JoinMatchmakingTicketResult { } + /** + * Preview: Request for server to leave a lobby. Only a game_server entity can leave and this is restricted to client owned + * lobbies which are using connections. + */ + public static class LeaveLobbyAsServerRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** The id of the lobby. */ + public String LobbyId; + /** + * The game_server entity leaving the lobby. If the game_server was subscribed to notifications, it will be unsubscribed. + * If a the given game_server entity is not in the lobby, it will fail. + */ + public EntityKey ServerEntity; + + } + /** Request to leave a lobby. Only a client can leave a lobby. */ public static class LeaveLobbyRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ @@ -2457,6 +2513,11 @@ public static class ScheduledStandbySettings { } + public static enum ServerDataStatus { + Initialized, + Ignored + } + public static class ServerDetails { /** The fully qualified domain name of the virtual machine that is hosting this multiplayer server. */ public String Fqdn; @@ -2627,6 +2688,37 @@ public static class UpdateBuildRegionsRequest { } + /** + * Preview: Request to update the serverData and serverEntity in case of migration. Only a game_server entity can update + * this information and this is restricted to client owned lobbies which are using connections. + */ + public static class UpdateLobbyAsServerRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** The id of the lobby. */ + public String LobbyId; + /** + * The lobby server. Optional. Set a different server as the joined server of the lobby (there can only be 1 joined + * server). When changing the server the previous server will automatically be unsubscribed. + */ + public EntityKey Server; + /** + * The private key-value pairs which are visible to all entities in the lobby and modifiable by the joined server. + * Optional. Sets or updates key-value pairs on the lobby. Only the current lobby lobby server can set serverData. Keys may + * be an arbitrary string of at most 30 characters. The total size of all serverData values may not exceed 4096 bytes. + * Values are not individually limited. There can be up to 30 key-value pairs stored here. Keys are case sensitive. + */ + public Map ServerData; + /** + * The keys to delete from the lobby serverData. Optional. Optional. Deletes key-value pairs on the lobby. Only the current + * joined lobby server can delete serverData. All the specified keys will be removed from the serverData. Keys that do not + * exist in the lobby are a no-op. If the key to delete exists in the serverData (same request) it will result in a bad + * request. + */ + public ArrayList ServerDataToDelete; + + } + /** Request to update a lobby. */ public static class UpdateLobbyRequest { /** diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java index e66c4af3..a0239a9d 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java @@ -9,9 +9,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.206.231124"; + public static String SdkVersion = "0.207.231208"; public static String BuildIdentifier = "adobuild_javasdk_118"; - public static String SdkVersionString = "JavaSDK-0.206.231124"; + public static String SdkVersionString = "JavaSDK-0.207.231208"; public static Map RequestGetParams; static { diff --git a/PlayFabClientSDK/packageMe.ps1 b/PlayFabClientSDK/packageMe.ps1 index 0a883d7f..58f170c0 100644 --- a/PlayFabClientSDK/packageMe.ps1 +++ b/PlayFabClientSDK/packageMe.ps1 @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds popd cd target -Copy-Item client-sdk-0.206.231124.jar -Destination ../../builds/client-sdk-0.206.231124.jar \ No newline at end of file +Copy-Item client-sdk-0.207.231208.jar -Destination ../../builds/client-sdk-0.207.231208.jar \ No newline at end of file diff --git a/PlayFabClientSDK/packageMe.sh b/PlayFabClientSDK/packageMe.sh index 0628cb2f..44e4d80b 100644 --- a/PlayFabClientSDK/packageMe.sh +++ b/PlayFabClientSDK/packageMe.sh @@ -7,4 +7,4 @@ mkdir -p ./builds popd cd target -cp client-sdk-0.206.231124.jar ../../builds/client-sdk-0.206.231124.jar +cp client-sdk-0.207.231208.jar ../../builds/client-sdk-0.207.231208.jar diff --git a/PlayFabClientSDK/pom.xml b/PlayFabClientSDK/pom.xml index 4a5ffe60..0ecf5a3a 100644 --- a/PlayFabClientSDK/pom.xml +++ b/PlayFabClientSDK/pom.xml @@ -14,7 +14,7 @@ com.playfab client-sdk - 0.206.231124 + 0.207.231208 PlayFab Client API 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. https://docs.microsoft.com/gaming/playfab/ diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabErrors.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabErrors.java index 7c9a0ec1..371a414f 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabErrors.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabErrors.java @@ -563,6 +563,7 @@ public static enum PlayFabErrorCode { LeaderboardColumnLengthMismatch(1562), InvalidStatisticScore(1563), LeaderboardColumnsNotSpecified(1564), + LeaderboardMaxSizeTooLarge(1565), MatchmakingEntityInvalid(2001), MatchmakingPlayerAttributesInvalid(2002), MatchmakingQueueNotFound(2016), @@ -606,6 +607,7 @@ public static enum PlayFabErrorCode { CatalogItemTypeInvalid(4012), CatalogBadRequest(4013), CatalogTooManyRequests(4014), + InvalidCatalogItemConfiguration(4015), ExportInvalidStatusUpdate(5000), ExportInvalidPrefix(5001), ExportBlobContainerDoesNotExist(5002), diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java index 1bbae772..a3abcdd2 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java @@ -2831,6 +2831,68 @@ private static PlayFabResult privateJoinLobbyAsync(final JoinLo return pfResult; } + /** + * Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. + * @param request JoinLobbyAsServerRequest + * @return Async Task will return JoinLobbyAsServerResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> JoinLobbyAsServerAsync(final JoinLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateJoinLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. + * @param request JoinLobbyAsServerRequest + * @return JoinLobbyAsServerResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult JoinLobbyAsServer(final JoinLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateJoinLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateJoinLobbyAsServerAsync(final JoinLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/JoinLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + JoinLobbyAsServerResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Join a matchmaking ticket. * @param request JoinMatchmakingTicketRequest @@ -2955,6 +3017,68 @@ private static PlayFabResult privateLeaveLobbyAsync(final Leav return pfResult; } + /** + * Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. + * @param request LeaveLobbyAsServerRequest + * @return Async Task will return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> LeaveLobbyAsServerAsync(final LeaveLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLeaveLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. + * @param request LeaveLobbyAsServerRequest + * @return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LeaveLobbyAsServer(final LeaveLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLeaveLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLeaveLobbyAsServerAsync(final LeaveLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/LeaveLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LobbyEmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Lists archived multiplayer server sessions for a build. * @param request ListMultiplayerServersRequest @@ -4648,6 +4772,76 @@ private static PlayFabResult privateUpdateLobbyAsync(final Upd return pfResult; } + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + * @param request UpdateLobbyAsServerRequest + * @return Async Task will return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdateLobbyAsServerAsync(final UpdateLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + * @param request UpdateLobbyAsServerRequest + * @return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdateLobbyAsServer(final UpdateLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdateLobbyAsServerAsync(final UpdateLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/UpdateLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LobbyEmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Uploads a multiplayer server game certificate. * @param request UploadCertificateRequest diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java index 4c5c3924..e804dcbb 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java @@ -1703,6 +1703,45 @@ public static class JoinArrangedLobbyRequest { } + /** + * Preview: Request to join a lobby as a server. Only callable by a game_server entity and this is restricted to client + * owned lobbies which are using connections. + */ + public static class JoinLobbyAsServerRequest { + /** + * A field which indicates which lobby the game_server will be joining. This field is opaque to everyone except the Lobby + * service. + */ + public String ConnectionString; + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** + * The private key-value pairs which are visible to all entities in the lobby but can only be modified by the joined + * server.At most 30 key - value pairs may be stored here, keys are limited to 30 characters and values to 1000.The total + * size of all serverData values may not exceed 4096 bytes. + */ + public Map ServerData; + /** + * The game_server entity which is joining the Lobby. If a different game_server entity has already joined the request will + * fail unless the joined entity is disconnected, in which case the incoming game_server entity will replace the + * disconnected entity. + */ + public EntityKey ServerEntity; + + } + + public static class JoinLobbyAsServerResult { + /** Successfully joined lobby's id. */ + public String LobbyId; + /** + * A setting that describes the state of the ServerData after JoinLobbyAsServer call is completed. It is "Initialized", the + * first time a server joins the lobby. It is "Ignored" in any subsequent JoinLobbyAsServer calls after it has been + * initialized. Any new server taking over should call UpdateLobbyAsServer to update ServerData fields. + */ + public ServerDataStatus ServerDataStatus; + + } + /** Request to join a lobby. Only a client can join a lobby. */ public static class JoinLobbyRequest { /** A field which indicates which lobby the user will be joining. This field is opaque to everyone except the Lobby service. */ @@ -1748,6 +1787,23 @@ public static class JoinMatchmakingTicketResult { } + /** + * Preview: Request for server to leave a lobby. Only a game_server entity can leave and this is restricted to client owned + * lobbies which are using connections. + */ + public static class LeaveLobbyAsServerRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** The id of the lobby. */ + public String LobbyId; + /** + * The game_server entity leaving the lobby. If the game_server was subscribed to notifications, it will be unsubscribed. + * If a the given game_server entity is not in the lobby, it will fail. + */ + public EntityKey ServerEntity; + + } + /** Request to leave a lobby. Only a client can leave a lobby. */ public static class LeaveLobbyRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ @@ -2457,6 +2513,11 @@ public static class ScheduledStandbySettings { } + public static enum ServerDataStatus { + Initialized, + Ignored + } + public static class ServerDetails { /** The fully qualified domain name of the virtual machine that is hosting this multiplayer server. */ public String Fqdn; @@ -2627,6 +2688,37 @@ public static class UpdateBuildRegionsRequest { } + /** + * Preview: Request to update the serverData and serverEntity in case of migration. Only a game_server entity can update + * this information and this is restricted to client owned lobbies which are using connections. + */ + public static class UpdateLobbyAsServerRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** The id of the lobby. */ + public String LobbyId; + /** + * The lobby server. Optional. Set a different server as the joined server of the lobby (there can only be 1 joined + * server). When changing the server the previous server will automatically be unsubscribed. + */ + public EntityKey Server; + /** + * The private key-value pairs which are visible to all entities in the lobby and modifiable by the joined server. + * Optional. Sets or updates key-value pairs on the lobby. Only the current lobby lobby server can set serverData. Keys may + * be an arbitrary string of at most 30 characters. The total size of all serverData values may not exceed 4096 bytes. + * Values are not individually limited. There can be up to 30 key-value pairs stored here. Keys are case sensitive. + */ + public Map ServerData; + /** + * The keys to delete from the lobby serverData. Optional. Optional. Deletes key-value pairs on the lobby. Only the current + * joined lobby server can delete serverData. All the specified keys will be removed from the serverData. Keys that do not + * exist in the lobby are a no-op. If the key to delete exists in the serverData (same request) it will result in a bad + * request. + */ + public ArrayList ServerDataToDelete; + + } + /** Request to update a lobby. */ public static class UpdateLobbyRequest { /** diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java index 0a339eae..349affcb 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java @@ -8,9 +8,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.206.231124"; + public static String SdkVersion = "0.207.231208"; public static String BuildIdentifier = "adobuild_javasdk_118"; - public static String SdkVersionString = "JavaSDK-0.206.231124"; + public static String SdkVersionString = "JavaSDK-0.207.231208"; public static Map RequestGetParams; static { diff --git a/PlayFabSDK/packageMe.ps1 b/PlayFabSDK/packageMe.ps1 index 0fdb4220..2c796321 100644 --- a/PlayFabSDK/packageMe.ps1 +++ b/PlayFabSDK/packageMe.ps1 @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds popd cd target -Copy-Item combo-sdk-0.206.231124.jar -Destination ../../builds/combo-sdk-0.206.231124.jar \ No newline at end of file +Copy-Item combo-sdk-0.207.231208.jar -Destination ../../builds/combo-sdk-0.207.231208.jar \ No newline at end of file diff --git a/PlayFabSDK/packageMe.sh b/PlayFabSDK/packageMe.sh index de70af58..a059ddd7 100644 --- a/PlayFabSDK/packageMe.sh +++ b/PlayFabSDK/packageMe.sh @@ -7,4 +7,4 @@ mkdir -p ./builds popd cd target -cp combo-sdk-0.206.231124.jar ../../builds/combo-sdk-0.206.231124.jar +cp combo-sdk-0.207.231208.jar ../../builds/combo-sdk-0.207.231208.jar diff --git a/PlayFabSDK/pom.xml b/PlayFabSDK/pom.xml index 60ae562f..17128847 100644 --- a/PlayFabSDK/pom.xml +++ b/PlayFabSDK/pom.xml @@ -14,7 +14,7 @@ com.playfab combo-sdk - 0.206.231124 + 0.207.231208 PlayFab Combo API 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. https://docs.microsoft.com/gaming/playfab/ diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabAdminModels.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabAdminModels.java index e0615df7..6a7cb6c2 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabAdminModels.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabAdminModels.java @@ -109,6 +109,20 @@ public static class AdCampaignSegmentFilter { } + public static class AddInventoryItemsV2SegmentAction { + /** Amount of the item to be granted to a player */ + public Integer Amount; + /** The collection id for where the item will be granted in the player inventory */ + public String CollectionId; + /** The duration in seconds of the subscription to be granted to a player */ + public Integer DurationInSeconds; + /** The id of item to be granted to the player */ + public String ItemId; + /** The stack id for where the item will be granted in the player inventory */ + public String StackId; + + } + public static class AddInventoryItemV2Content { /** Amount of the item to be granted to a player */ public Integer Amount; @@ -1118,6 +1132,16 @@ public static class DeleteContentRequest { } + public static class DeleteInventoryItemsV2SegmentAction { + /** The collection id for where the item will be removed from the player inventory */ + public String CollectionId; + /** The id of item to be removed from the player */ + public String ItemId; + /** The stack id for where the item will be removed from the player inventory */ + public String StackId; + + } + public static class DeleteInventoryItemV2Content { /** The collection id for where the item will be removed from the player inventory */ public String CollectionId; @@ -2028,6 +2052,7 @@ public static enum GenericErrorCodes { LeaderboardColumnLengthMismatch, InvalidStatisticScore, LeaderboardColumnsNotSpecified, + LeaderboardMaxSizeTooLarge, MatchmakingEntityInvalid, MatchmakingPlayerAttributesInvalid, MatchmakingQueueNotFound, @@ -2071,6 +2096,7 @@ public static enum GenericErrorCodes { CatalogItemTypeInvalid, CatalogBadRequest, CatalogTooManyRequests, + InvalidCatalogItemConfiguration, ExportInvalidStatusUpdate, ExportInvalidPrefix, ExportBlobContainerDoesNotExist, @@ -4447,8 +4473,12 @@ public static enum SegmentPushNotificationDevicePlatform { } public static class SegmentTrigger { + /** Add inventory item v2 segment trigger action. */ + public AddInventoryItemsV2SegmentAction AddInventoryItemsV2Action; /** Ban player segment trigger action. */ public BanPlayerSegmentAction BanPlayerAction; + /** Delete inventory item v2 segment trigger action. */ + public DeleteInventoryItemsV2SegmentAction DeleteInventoryItemsV2Action; /** Delete player segment trigger action. */ public DeletePlayerSegmentAction DeletePlayerAction; /** Delete player statistic segment trigger action. */ @@ -4467,6 +4497,8 @@ public static class SegmentTrigger { public IncrementPlayerStatisticSegmentAction IncrementPlayerStatisticAction; /** Push notification segment trigger action. */ public PushNotificationSegmentAction PushNotificationAction; + /** Subtract inventory item v2 segment trigger action. */ + public SubtractInventoryItemsV2SegmentAction SubtractInventoryItemsV2Action; } @@ -4775,6 +4807,20 @@ public static enum SubscriptionProviderStatus { PaymentPending } + public static class SubtractInventoryItemsV2SegmentAction { + /** Amount of the item to removed from the player */ + public Integer Amount; + /** The collection id for where the item will be removed from the player inventory */ + public String CollectionId; + /** The duration in seconds to be removed from the subscription in the players inventory */ + public Integer DurationInSeconds; + /** The id of item to be removed from the player */ + public String ItemId; + /** The stack id for where the item will be removed from the player inventory */ + public String StackId; + + } + public static class SubtractInventoryItemV2Content { /** Amount of the item to removed from the player */ public Integer Amount; diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabErrors.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabErrors.java index 7c9a0ec1..371a414f 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabErrors.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabErrors.java @@ -563,6 +563,7 @@ public static enum PlayFabErrorCode { LeaderboardColumnLengthMismatch(1562), InvalidStatisticScore(1563), LeaderboardColumnsNotSpecified(1564), + LeaderboardMaxSizeTooLarge(1565), MatchmakingEntityInvalid(2001), MatchmakingPlayerAttributesInvalid(2002), MatchmakingQueueNotFound(2016), @@ -606,6 +607,7 @@ public static enum PlayFabErrorCode { CatalogItemTypeInvalid(4012), CatalogBadRequest(4013), CatalogTooManyRequests(4014), + InvalidCatalogItemConfiguration(4015), ExportInvalidStatusUpdate(5000), ExportInvalidPrefix(5001), ExportBlobContainerDoesNotExist(5002), diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java index 1bbae772..a3abcdd2 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java @@ -2831,6 +2831,68 @@ private static PlayFabResult privateJoinLobbyAsync(final JoinLo return pfResult; } + /** + * Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. + * @param request JoinLobbyAsServerRequest + * @return Async Task will return JoinLobbyAsServerResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> JoinLobbyAsServerAsync(final JoinLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateJoinLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. + * @param request JoinLobbyAsServerRequest + * @return JoinLobbyAsServerResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult JoinLobbyAsServer(final JoinLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateJoinLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateJoinLobbyAsServerAsync(final JoinLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/JoinLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + JoinLobbyAsServerResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Join a matchmaking ticket. * @param request JoinMatchmakingTicketRequest @@ -2955,6 +3017,68 @@ private static PlayFabResult privateLeaveLobbyAsync(final Leav return pfResult; } + /** + * Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. + * @param request LeaveLobbyAsServerRequest + * @return Async Task will return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> LeaveLobbyAsServerAsync(final LeaveLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLeaveLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. + * @param request LeaveLobbyAsServerRequest + * @return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LeaveLobbyAsServer(final LeaveLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLeaveLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLeaveLobbyAsServerAsync(final LeaveLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/LeaveLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LobbyEmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Lists archived multiplayer server sessions for a build. * @param request ListMultiplayerServersRequest @@ -4648,6 +4772,76 @@ private static PlayFabResult privateUpdateLobbyAsync(final Upd return pfResult; } + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + * @param request UpdateLobbyAsServerRequest + * @return Async Task will return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdateLobbyAsServerAsync(final UpdateLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + * @param request UpdateLobbyAsServerRequest + * @return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdateLobbyAsServer(final UpdateLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdateLobbyAsServerAsync(final UpdateLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/UpdateLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LobbyEmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Uploads a multiplayer server game certificate. * @param request UploadCertificateRequest diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java index 4c5c3924..e804dcbb 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java @@ -1703,6 +1703,45 @@ public static class JoinArrangedLobbyRequest { } + /** + * Preview: Request to join a lobby as a server. Only callable by a game_server entity and this is restricted to client + * owned lobbies which are using connections. + */ + public static class JoinLobbyAsServerRequest { + /** + * A field which indicates which lobby the game_server will be joining. This field is opaque to everyone except the Lobby + * service. + */ + public String ConnectionString; + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** + * The private key-value pairs which are visible to all entities in the lobby but can only be modified by the joined + * server.At most 30 key - value pairs may be stored here, keys are limited to 30 characters and values to 1000.The total + * size of all serverData values may not exceed 4096 bytes. + */ + public Map ServerData; + /** + * The game_server entity which is joining the Lobby. If a different game_server entity has already joined the request will + * fail unless the joined entity is disconnected, in which case the incoming game_server entity will replace the + * disconnected entity. + */ + public EntityKey ServerEntity; + + } + + public static class JoinLobbyAsServerResult { + /** Successfully joined lobby's id. */ + public String LobbyId; + /** + * A setting that describes the state of the ServerData after JoinLobbyAsServer call is completed. It is "Initialized", the + * first time a server joins the lobby. It is "Ignored" in any subsequent JoinLobbyAsServer calls after it has been + * initialized. Any new server taking over should call UpdateLobbyAsServer to update ServerData fields. + */ + public ServerDataStatus ServerDataStatus; + + } + /** Request to join a lobby. Only a client can join a lobby. */ public static class JoinLobbyRequest { /** A field which indicates which lobby the user will be joining. This field is opaque to everyone except the Lobby service. */ @@ -1748,6 +1787,23 @@ public static class JoinMatchmakingTicketResult { } + /** + * Preview: Request for server to leave a lobby. Only a game_server entity can leave and this is restricted to client owned + * lobbies which are using connections. + */ + public static class LeaveLobbyAsServerRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** The id of the lobby. */ + public String LobbyId; + /** + * The game_server entity leaving the lobby. If the game_server was subscribed to notifications, it will be unsubscribed. + * If a the given game_server entity is not in the lobby, it will fail. + */ + public EntityKey ServerEntity; + + } + /** Request to leave a lobby. Only a client can leave a lobby. */ public static class LeaveLobbyRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ @@ -2457,6 +2513,11 @@ public static class ScheduledStandbySettings { } + public static enum ServerDataStatus { + Initialized, + Ignored + } + public static class ServerDetails { /** The fully qualified domain name of the virtual machine that is hosting this multiplayer server. */ public String Fqdn; @@ -2627,6 +2688,37 @@ public static class UpdateBuildRegionsRequest { } + /** + * Preview: Request to update the serverData and serverEntity in case of migration. Only a game_server entity can update + * this information and this is restricted to client owned lobbies which are using connections. + */ + public static class UpdateLobbyAsServerRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** The id of the lobby. */ + public String LobbyId; + /** + * The lobby server. Optional. Set a different server as the joined server of the lobby (there can only be 1 joined + * server). When changing the server the previous server will automatically be unsubscribed. + */ + public EntityKey Server; + /** + * The private key-value pairs which are visible to all entities in the lobby and modifiable by the joined server. + * Optional. Sets or updates key-value pairs on the lobby. Only the current lobby lobby server can set serverData. Keys may + * be an arbitrary string of at most 30 characters. The total size of all serverData values may not exceed 4096 bytes. + * Values are not individually limited. There can be up to 30 key-value pairs stored here. Keys are case sensitive. + */ + public Map ServerData; + /** + * The keys to delete from the lobby serverData. Optional. Optional. Deletes key-value pairs on the lobby. Only the current + * joined lobby server can delete serverData. All the specified keys will be removed from the serverData. Keys that do not + * exist in the lobby are a no-op. If the key to delete exists in the serverData (same request) it will result in a bad + * request. + */ + public ArrayList ServerDataToDelete; + + } + /** Request to update a lobby. */ public static class UpdateLobbyRequest { /** diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java index 8f9f8683..58ee6e6e 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java @@ -1657,6 +1657,7 @@ public static enum GenericErrorCodes { LeaderboardColumnLengthMismatch, InvalidStatisticScore, LeaderboardColumnsNotSpecified, + LeaderboardMaxSizeTooLarge, MatchmakingEntityInvalid, MatchmakingPlayerAttributesInvalid, MatchmakingQueueNotFound, @@ -1700,6 +1701,7 @@ public static enum GenericErrorCodes { CatalogItemTypeInvalid, CatalogBadRequest, CatalogTooManyRequests, + InvalidCatalogItemConfiguration, ExportInvalidStatusUpdate, ExportInvalidPrefix, ExportBlobContainerDoesNotExist, diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java index 0a339eae..349affcb 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java @@ -8,9 +8,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.206.231124"; + public static String SdkVersion = "0.207.231208"; public static String BuildIdentifier = "adobuild_javasdk_118"; - public static String SdkVersionString = "JavaSDK-0.206.231124"; + public static String SdkVersionString = "JavaSDK-0.207.231208"; public static Map RequestGetParams; static { diff --git a/PlayFabServerSDK/packageMe.ps1 b/PlayFabServerSDK/packageMe.ps1 index 972a5a4b..9cc6adb9 100644 --- a/PlayFabServerSDK/packageMe.ps1 +++ b/PlayFabServerSDK/packageMe.ps1 @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds popd cd target -Copy-Item server-sdk-0.206.231124.jar -Destination ../../builds/server-sdk-0.206.231124.jar \ No newline at end of file +Copy-Item server-sdk-0.207.231208.jar -Destination ../../builds/server-sdk-0.207.231208.jar \ No newline at end of file diff --git a/PlayFabServerSDK/packageMe.sh b/PlayFabServerSDK/packageMe.sh index a9328563..ac997cca 100644 --- a/PlayFabServerSDK/packageMe.sh +++ b/PlayFabServerSDK/packageMe.sh @@ -7,4 +7,4 @@ mkdir -p ./builds popd cd target -cp server-sdk-0.206.231124.jar ../../builds/server-sdk-0.206.231124.jar +cp server-sdk-0.207.231208.jar ../../builds/server-sdk-0.207.231208.jar diff --git a/PlayFabServerSDK/pom.xml b/PlayFabServerSDK/pom.xml index aba9afdf..962bd244 100644 --- a/PlayFabServerSDK/pom.xml +++ b/PlayFabServerSDK/pom.xml @@ -14,7 +14,7 @@ com.playfab server-sdk - 0.206.231124 + 0.207.231208 PlayFab Server API 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. https://docs.microsoft.com/gaming/playfab/ diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabAdminModels.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabAdminModels.java index e0615df7..6a7cb6c2 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabAdminModels.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabAdminModels.java @@ -109,6 +109,20 @@ public static class AdCampaignSegmentFilter { } + public static class AddInventoryItemsV2SegmentAction { + /** Amount of the item to be granted to a player */ + public Integer Amount; + /** The collection id for where the item will be granted in the player inventory */ + public String CollectionId; + /** The duration in seconds of the subscription to be granted to a player */ + public Integer DurationInSeconds; + /** The id of item to be granted to the player */ + public String ItemId; + /** The stack id for where the item will be granted in the player inventory */ + public String StackId; + + } + public static class AddInventoryItemV2Content { /** Amount of the item to be granted to a player */ public Integer Amount; @@ -1118,6 +1132,16 @@ public static class DeleteContentRequest { } + public static class DeleteInventoryItemsV2SegmentAction { + /** The collection id for where the item will be removed from the player inventory */ + public String CollectionId; + /** The id of item to be removed from the player */ + public String ItemId; + /** The stack id for where the item will be removed from the player inventory */ + public String StackId; + + } + public static class DeleteInventoryItemV2Content { /** The collection id for where the item will be removed from the player inventory */ public String CollectionId; @@ -2028,6 +2052,7 @@ public static enum GenericErrorCodes { LeaderboardColumnLengthMismatch, InvalidStatisticScore, LeaderboardColumnsNotSpecified, + LeaderboardMaxSizeTooLarge, MatchmakingEntityInvalid, MatchmakingPlayerAttributesInvalid, MatchmakingQueueNotFound, @@ -2071,6 +2096,7 @@ public static enum GenericErrorCodes { CatalogItemTypeInvalid, CatalogBadRequest, CatalogTooManyRequests, + InvalidCatalogItemConfiguration, ExportInvalidStatusUpdate, ExportInvalidPrefix, ExportBlobContainerDoesNotExist, @@ -4447,8 +4473,12 @@ public static enum SegmentPushNotificationDevicePlatform { } public static class SegmentTrigger { + /** Add inventory item v2 segment trigger action. */ + public AddInventoryItemsV2SegmentAction AddInventoryItemsV2Action; /** Ban player segment trigger action. */ public BanPlayerSegmentAction BanPlayerAction; + /** Delete inventory item v2 segment trigger action. */ + public DeleteInventoryItemsV2SegmentAction DeleteInventoryItemsV2Action; /** Delete player segment trigger action. */ public DeletePlayerSegmentAction DeletePlayerAction; /** Delete player statistic segment trigger action. */ @@ -4467,6 +4497,8 @@ public static class SegmentTrigger { public IncrementPlayerStatisticSegmentAction IncrementPlayerStatisticAction; /** Push notification segment trigger action. */ public PushNotificationSegmentAction PushNotificationAction; + /** Subtract inventory item v2 segment trigger action. */ + public SubtractInventoryItemsV2SegmentAction SubtractInventoryItemsV2Action; } @@ -4775,6 +4807,20 @@ public static enum SubscriptionProviderStatus { PaymentPending } + public static class SubtractInventoryItemsV2SegmentAction { + /** Amount of the item to removed from the player */ + public Integer Amount; + /** The collection id for where the item will be removed from the player inventory */ + public String CollectionId; + /** The duration in seconds to be removed from the subscription in the players inventory */ + public Integer DurationInSeconds; + /** The id of item to be removed from the player */ + public String ItemId; + /** The stack id for where the item will be removed from the player inventory */ + public String StackId; + + } + public static class SubtractInventoryItemV2Content { /** Amount of the item to removed from the player */ public Integer Amount; diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabErrors.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabErrors.java index 7c9a0ec1..371a414f 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabErrors.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabErrors.java @@ -563,6 +563,7 @@ public static enum PlayFabErrorCode { LeaderboardColumnLengthMismatch(1562), InvalidStatisticScore(1563), LeaderboardColumnsNotSpecified(1564), + LeaderboardMaxSizeTooLarge(1565), MatchmakingEntityInvalid(2001), MatchmakingPlayerAttributesInvalid(2002), MatchmakingQueueNotFound(2016), @@ -606,6 +607,7 @@ public static enum PlayFabErrorCode { CatalogItemTypeInvalid(4012), CatalogBadRequest(4013), CatalogTooManyRequests(4014), + InvalidCatalogItemConfiguration(4015), ExportInvalidStatusUpdate(5000), ExportInvalidPrefix(5001), ExportBlobContainerDoesNotExist(5002), diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java index 1bbae772..a3abcdd2 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerAPI.java @@ -2831,6 +2831,68 @@ private static PlayFabResult privateJoinLobbyAsync(final JoinLo return pfResult; } + /** + * Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. + * @param request JoinLobbyAsServerRequest + * @return Async Task will return JoinLobbyAsServerResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> JoinLobbyAsServerAsync(final JoinLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateJoinLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. + * @param request JoinLobbyAsServerRequest + * @return JoinLobbyAsServerResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult JoinLobbyAsServer(final JoinLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateJoinLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Preview: Join a lobby as a server entity. This is restricted to client lobbies which are using connections. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateJoinLobbyAsServerAsync(final JoinLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/JoinLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + JoinLobbyAsServerResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Join a matchmaking ticket. * @param request JoinMatchmakingTicketRequest @@ -2955,6 +3017,68 @@ private static PlayFabResult privateLeaveLobbyAsync(final Leav return pfResult; } + /** + * Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. + * @param request LeaveLobbyAsServerRequest + * @return Async Task will return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> LeaveLobbyAsServerAsync(final LeaveLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLeaveLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. + * @param request LeaveLobbyAsServerRequest + * @return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LeaveLobbyAsServer(final LeaveLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLeaveLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Preview: Request for server to leave a lobby. This is restricted to client owned lobbies which are using connections. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLeaveLobbyAsServerAsync(final LeaveLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/LeaveLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LobbyEmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Lists archived multiplayer server sessions for a build. * @param request ListMultiplayerServersRequest @@ -4648,6 +4772,76 @@ private static PlayFabResult privateUpdateLobbyAsync(final Upd return pfResult; } + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + * @param request UpdateLobbyAsServerRequest + * @return Async Task will return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdateLobbyAsServerAsync(final UpdateLobbyAsServerRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateLobbyAsServerAsync(request); + } + }); + } + + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + * @param request UpdateLobbyAsServerRequest + * @return LobbyEmptyResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdateLobbyAsServer(final UpdateLobbyAsServerRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateLobbyAsServerAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** + * Preview: Update fields related to a joined server in the lobby the server is in. Servers can keep a lobby from expiring + * by being the one to "update" the lobby in some way. Servers have no impact on last member leave/last member disconnect + * behavior. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdateLobbyAsServerAsync(final UpdateLobbyAsServerRequest request) throws Exception { + if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Lobby/UpdateLobbyAsServer"), 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(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LobbyEmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Uploads a multiplayer server game certificate. * @param request UploadCertificateRequest diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java index 4c5c3924..e804dcbb 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java @@ -1703,6 +1703,45 @@ public static class JoinArrangedLobbyRequest { } + /** + * Preview: Request to join a lobby as a server. Only callable by a game_server entity and this is restricted to client + * owned lobbies which are using connections. + */ + public static class JoinLobbyAsServerRequest { + /** + * A field which indicates which lobby the game_server will be joining. This field is opaque to everyone except the Lobby + * service. + */ + public String ConnectionString; + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** + * The private key-value pairs which are visible to all entities in the lobby but can only be modified by the joined + * server.At most 30 key - value pairs may be stored here, keys are limited to 30 characters and values to 1000.The total + * size of all serverData values may not exceed 4096 bytes. + */ + public Map ServerData; + /** + * The game_server entity which is joining the Lobby. If a different game_server entity has already joined the request will + * fail unless the joined entity is disconnected, in which case the incoming game_server entity will replace the + * disconnected entity. + */ + public EntityKey ServerEntity; + + } + + public static class JoinLobbyAsServerResult { + /** Successfully joined lobby's id. */ + public String LobbyId; + /** + * A setting that describes the state of the ServerData after JoinLobbyAsServer call is completed. It is "Initialized", the + * first time a server joins the lobby. It is "Ignored" in any subsequent JoinLobbyAsServer calls after it has been + * initialized. Any new server taking over should call UpdateLobbyAsServer to update ServerData fields. + */ + public ServerDataStatus ServerDataStatus; + + } + /** Request to join a lobby. Only a client can join a lobby. */ public static class JoinLobbyRequest { /** A field which indicates which lobby the user will be joining. This field is opaque to everyone except the Lobby service. */ @@ -1748,6 +1787,23 @@ public static class JoinMatchmakingTicketResult { } + /** + * Preview: Request for server to leave a lobby. Only a game_server entity can leave and this is restricted to client owned + * lobbies which are using connections. + */ + public static class LeaveLobbyAsServerRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** The id of the lobby. */ + public String LobbyId; + /** + * The game_server entity leaving the lobby. If the game_server was subscribed to notifications, it will be unsubscribed. + * If a the given game_server entity is not in the lobby, it will fail. + */ + public EntityKey ServerEntity; + + } + /** Request to leave a lobby. Only a client can leave a lobby. */ public static class LeaveLobbyRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ @@ -2457,6 +2513,11 @@ public static class ScheduledStandbySettings { } + public static enum ServerDataStatus { + Initialized, + Ignored + } + public static class ServerDetails { /** The fully qualified domain name of the virtual machine that is hosting this multiplayer server. */ public String Fqdn; @@ -2627,6 +2688,37 @@ public static class UpdateBuildRegionsRequest { } + /** + * Preview: Request to update the serverData and serverEntity in case of migration. Only a game_server entity can update + * this information and this is restricted to client owned lobbies which are using connections. + */ + public static class UpdateLobbyAsServerRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** The id of the lobby. */ + public String LobbyId; + /** + * The lobby server. Optional. Set a different server as the joined server of the lobby (there can only be 1 joined + * server). When changing the server the previous server will automatically be unsubscribed. + */ + public EntityKey Server; + /** + * The private key-value pairs which are visible to all entities in the lobby and modifiable by the joined server. + * Optional. Sets or updates key-value pairs on the lobby. Only the current lobby lobby server can set serverData. Keys may + * be an arbitrary string of at most 30 characters. The total size of all serverData values may not exceed 4096 bytes. + * Values are not individually limited. There can be up to 30 key-value pairs stored here. Keys are case sensitive. + */ + public Map ServerData; + /** + * The keys to delete from the lobby serverData. Optional. Optional. Deletes key-value pairs on the lobby. Only the current + * joined lobby server can delete serverData. All the specified keys will be removed from the serverData. Keys that do not + * exist in the lobby are a no-op. If the key to delete exists in the serverData (same request) it will result in a bad + * request. + */ + public ArrayList ServerDataToDelete; + + } + /** Request to update a lobby. */ public static class UpdateLobbyRequest { /** diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java index 8f9f8683..58ee6e6e 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java @@ -1657,6 +1657,7 @@ public static enum GenericErrorCodes { LeaderboardColumnLengthMismatch, InvalidStatisticScore, LeaderboardColumnsNotSpecified, + LeaderboardMaxSizeTooLarge, MatchmakingEntityInvalid, MatchmakingPlayerAttributesInvalid, MatchmakingQueueNotFound, @@ -1700,6 +1701,7 @@ public static enum GenericErrorCodes { CatalogItemTypeInvalid, CatalogBadRequest, CatalogTooManyRequests, + InvalidCatalogItemConfiguration, ExportInvalidStatusUpdate, ExportInvalidPrefix, ExportBlobContainerDoesNotExist, diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java index b9730383..619c57af 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java @@ -8,9 +8,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.206.231124"; + public static String SdkVersion = "0.207.231208"; public static String BuildIdentifier = "adobuild_javasdk_118"; - public static String SdkVersionString = "JavaSDK-0.206.231124"; + public static String SdkVersionString = "JavaSDK-0.207.231208"; public static Map RequestGetParams; static { diff --git a/builds/client-sdk-0.207.231208.jar b/builds/client-sdk-0.207.231208.jar new file mode 100644 index 00000000..5a013443 Binary files /dev/null and b/builds/client-sdk-0.207.231208.jar differ diff --git a/builds/combo-sdk-0.207.231208.jar b/builds/combo-sdk-0.207.231208.jar new file mode 100644 index 00000000..360c7a3b Binary files /dev/null and b/builds/combo-sdk-0.207.231208.jar differ diff --git a/builds/server-sdk-0.207.231208.jar b/builds/server-sdk-0.207.231208.jar new file mode 100644 index 00000000..630ed92c Binary files /dev/null and b/builds/server-sdk-0.207.231208.jar differ