Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.playfab.PlayFabMultiplayerAPI Maven / Gradle / Ivy
Go to download
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.
package com.playfab;
import com.playfab.internal.*;
import com.playfab.PlayFabMultiplayerModels.*;
import com.playfab.PlayFabErrors.*;
import com.playfab.PlayFabSettings;
import java.util.concurrent.*;
import java.util.*;
import com.google.gson.*;
import com.google.gson.reflect.*;
/** API methods for managing multiplayer servers. API methods for managing parties. */
public class PlayFabMultiplayerAPI {
private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create();
/**
* Cancel all active tickets the player is a member of in a given queue.
* @param request CancelAllMatchmakingTicketsForPlayerRequest
* @return Async Task will return CancelAllMatchmakingTicketsForPlayerResult
*/
@SuppressWarnings("unchecked")
public static FutureTask> CancelAllMatchmakingTicketsForPlayerAsync(final CancelAllMatchmakingTicketsForPlayerRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCancelAllMatchmakingTicketsForPlayerAsync(request);
}
});
}
/**
* Cancel all active tickets the player is a member of in a given queue.
* @param request CancelAllMatchmakingTicketsForPlayerRequest
* @return CancelAllMatchmakingTicketsForPlayerResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CancelAllMatchmakingTicketsForPlayer(final CancelAllMatchmakingTicketsForPlayerRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCancelAllMatchmakingTicketsForPlayerAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Cancel all active tickets the player is a member of in a given queue. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCancelAllMatchmakingTicketsForPlayerAsync(final CancelAllMatchmakingTicketsForPlayerRequest 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("/Match/CancelAllMatchmakingTicketsForPlayer"), 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());
CancelAllMatchmakingTicketsForPlayerResult result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Cancel all active backfill tickets the player is a member of in a given queue.
* @param request CancelAllServerBackfillTicketsForPlayerRequest
* @return Async Task will return CancelAllServerBackfillTicketsForPlayerResult
*/
@SuppressWarnings("unchecked")
public static FutureTask> CancelAllServerBackfillTicketsForPlayerAsync(final CancelAllServerBackfillTicketsForPlayerRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCancelAllServerBackfillTicketsForPlayerAsync(request);
}
});
}
/**
* Cancel all active backfill tickets the player is a member of in a given queue.
* @param request CancelAllServerBackfillTicketsForPlayerRequest
* @return CancelAllServerBackfillTicketsForPlayerResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CancelAllServerBackfillTicketsForPlayer(final CancelAllServerBackfillTicketsForPlayerRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCancelAllServerBackfillTicketsForPlayerAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Cancel all active backfill tickets the player is a member of in a given queue. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCancelAllServerBackfillTicketsForPlayerAsync(final CancelAllServerBackfillTicketsForPlayerRequest 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("/Match/CancelAllServerBackfillTicketsForPlayer"), 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());
CancelAllServerBackfillTicketsForPlayerResult result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Cancel a matchmaking ticket.
* @param request CancelMatchmakingTicketRequest
* @return Async Task will return CancelMatchmakingTicketResult
*/
@SuppressWarnings("unchecked")
public static FutureTask> CancelMatchmakingTicketAsync(final CancelMatchmakingTicketRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCancelMatchmakingTicketAsync(request);
}
});
}
/**
* Cancel a matchmaking ticket.
* @param request CancelMatchmakingTicketRequest
* @return CancelMatchmakingTicketResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CancelMatchmakingTicket(final CancelMatchmakingTicketRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCancelMatchmakingTicketAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Cancel a matchmaking ticket. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCancelMatchmakingTicketAsync(final CancelMatchmakingTicketRequest 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("/Match/CancelMatchmakingTicket"), 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());
CancelMatchmakingTicketResult result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Cancel a server backfill ticket.
* @param request CancelServerBackfillTicketRequest
* @return Async Task will return CancelServerBackfillTicketResult
*/
@SuppressWarnings("unchecked")
public static FutureTask> CancelServerBackfillTicketAsync(final CancelServerBackfillTicketRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCancelServerBackfillTicketAsync(request);
}
});
}
/**
* Cancel a server backfill ticket.
* @param request CancelServerBackfillTicketRequest
* @return CancelServerBackfillTicketResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CancelServerBackfillTicket(final CancelServerBackfillTicketRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCancelServerBackfillTicketAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Cancel a server backfill ticket. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCancelServerBackfillTicketAsync(final CancelServerBackfillTicketRequest 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("/Match/CancelServerBackfillTicket"), 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());
CancelServerBackfillTicketResult result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Creates a multiplayer server build alias.
* @param request CreateBuildAliasRequest
* @return Async Task will return BuildAliasDetailsResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> CreateBuildAliasAsync(final CreateBuildAliasRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateBuildAliasAsync(request);
}
});
}
/**
* Creates a multiplayer server build alias.
* @param request CreateBuildAliasRequest
* @return BuildAliasDetailsResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CreateBuildAlias(final CreateBuildAliasRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateBuildAliasAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Creates a multiplayer server build alias. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCreateBuildAliasAsync(final CreateBuildAliasRequest 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("/MultiplayerServer/CreateBuildAlias"), 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());
BuildAliasDetailsResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Creates a multiplayer server build with a custom container.
* @param request CreateBuildWithCustomContainerRequest
* @return Async Task will return CreateBuildWithCustomContainerResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> CreateBuildWithCustomContainerAsync(final CreateBuildWithCustomContainerRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateBuildWithCustomContainerAsync(request);
}
});
}
/**
* Creates a multiplayer server build with a custom container.
* @param request CreateBuildWithCustomContainerRequest
* @return CreateBuildWithCustomContainerResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CreateBuildWithCustomContainer(final CreateBuildWithCustomContainerRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateBuildWithCustomContainerAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Creates a multiplayer server build with a custom container. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCreateBuildWithCustomContainerAsync(final CreateBuildWithCustomContainerRequest 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("/MultiplayerServer/CreateBuildWithCustomContainer"), 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());
CreateBuildWithCustomContainerResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Creates a multiplayer server build with a managed container.
* @param request CreateBuildWithManagedContainerRequest
* @return Async Task will return CreateBuildWithManagedContainerResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> CreateBuildWithManagedContainerAsync(final CreateBuildWithManagedContainerRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateBuildWithManagedContainerAsync(request);
}
});
}
/**
* Creates a multiplayer server build with a managed container.
* @param request CreateBuildWithManagedContainerRequest
* @return CreateBuildWithManagedContainerResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CreateBuildWithManagedContainer(final CreateBuildWithManagedContainerRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateBuildWithManagedContainerAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Creates a multiplayer server build with a managed container. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCreateBuildWithManagedContainerAsync(final CreateBuildWithManagedContainerRequest 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("/MultiplayerServer/CreateBuildWithManagedContainer"), 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());
CreateBuildWithManagedContainerResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Create a matchmaking ticket as a client.
* @param request CreateMatchmakingTicketRequest
* @return Async Task will return CreateMatchmakingTicketResult
*/
@SuppressWarnings("unchecked")
public static FutureTask> CreateMatchmakingTicketAsync(final CreateMatchmakingTicketRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateMatchmakingTicketAsync(request);
}
});
}
/**
* Create a matchmaking ticket as a client.
* @param request CreateMatchmakingTicketRequest
* @return CreateMatchmakingTicketResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CreateMatchmakingTicket(final CreateMatchmakingTicketRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateMatchmakingTicketAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Create a matchmaking ticket as a client. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCreateMatchmakingTicketAsync(final CreateMatchmakingTicketRequest 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("/Match/CreateMatchmakingTicket"), 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());
CreateMatchmakingTicketResult result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Creates a remote user to log on to a VM for a multiplayer server build.
* @param request CreateRemoteUserRequest
* @return Async Task will return CreateRemoteUserResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> CreateRemoteUserAsync(final CreateRemoteUserRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateRemoteUserAsync(request);
}
});
}
/**
* Creates a remote user to log on to a VM for a multiplayer server build.
* @param request CreateRemoteUserRequest
* @return CreateRemoteUserResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CreateRemoteUser(final CreateRemoteUserRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateRemoteUserAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Creates a remote user to log on to a VM for a multiplayer server build. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCreateRemoteUserAsync(final CreateRemoteUserRequest 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("/MultiplayerServer/CreateRemoteUser"), 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());
CreateRemoteUserResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Create a backfill matchmaking ticket as a server. A backfill ticket represents an ongoing game. The matchmaking service
* automatically starts matching the backfill ticket against other matchmaking tickets. Backfill tickets cannot match with
* other backfill tickets.
* @param request CreateServerBackfillTicketRequest
* @return Async Task will return CreateServerBackfillTicketResult
*/
@SuppressWarnings("unchecked")
public static FutureTask> CreateServerBackfillTicketAsync(final CreateServerBackfillTicketRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateServerBackfillTicketAsync(request);
}
});
}
/**
* Create a backfill matchmaking ticket as a server. A backfill ticket represents an ongoing game. The matchmaking service
* automatically starts matching the backfill ticket against other matchmaking tickets. Backfill tickets cannot match with
* other backfill tickets.
* @param request CreateServerBackfillTicketRequest
* @return CreateServerBackfillTicketResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CreateServerBackfillTicket(final CreateServerBackfillTicketRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateServerBackfillTicketAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/**
* Create a backfill matchmaking ticket as a server. A backfill ticket represents an ongoing game. The matchmaking service
* automatically starts matching the backfill ticket against other matchmaking tickets. Backfill tickets cannot match with
* other backfill tickets.
*/
@SuppressWarnings("unchecked")
private static PlayFabResult privateCreateServerBackfillTicketAsync(final CreateServerBackfillTicketRequest 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("/Match/CreateServerBackfillTicket"), 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());
CreateServerBackfillTicketResult result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Create a matchmaking ticket as a server. The matchmaking service automatically starts matching the ticket against other
* matchmaking tickets.
* @param request CreateServerMatchmakingTicketRequest
* @return Async Task will return CreateMatchmakingTicketResult
*/
@SuppressWarnings("unchecked")
public static FutureTask> CreateServerMatchmakingTicketAsync(final CreateServerMatchmakingTicketRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateServerMatchmakingTicketAsync(request);
}
});
}
/**
* Create a matchmaking ticket as a server. The matchmaking service automatically starts matching the ticket against other
* matchmaking tickets.
* @param request CreateServerMatchmakingTicketRequest
* @return CreateMatchmakingTicketResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CreateServerMatchmakingTicket(final CreateServerMatchmakingTicketRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateServerMatchmakingTicketAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/**
* Create a matchmaking ticket as a server. The matchmaking service automatically starts matching the ticket against other
* matchmaking tickets.
*/
@SuppressWarnings("unchecked")
private static PlayFabResult privateCreateServerMatchmakingTicketAsync(final CreateServerMatchmakingTicketRequest 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("/Match/CreateServerMatchmakingTicket"), 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());
CreateMatchmakingTicketResult result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Deletes a multiplayer server game asset for a title.
* @param request DeleteAssetRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> DeleteAssetAsync(final DeleteAssetRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteAssetAsync(request);
}
});
}
/**
* Deletes a multiplayer server game asset for a title.
* @param request DeleteAssetRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult DeleteAsset(final DeleteAssetRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteAssetAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Deletes a multiplayer server game asset for a title. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateDeleteAssetAsync(final DeleteAssetRequest 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("/MultiplayerServer/DeleteAsset"), 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());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Deletes a multiplayer server build.
* @param request DeleteBuildRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> DeleteBuildAsync(final DeleteBuildRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteBuildAsync(request);
}
});
}
/**
* Deletes a multiplayer server build.
* @param request DeleteBuildRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult DeleteBuild(final DeleteBuildRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteBuildAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Deletes a multiplayer server build. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateDeleteBuildAsync(final DeleteBuildRequest 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("/MultiplayerServer/DeleteBuild"), 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());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Deletes a multiplayer server build alias.
* @param request DeleteBuildAliasRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> DeleteBuildAliasAsync(final DeleteBuildAliasRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteBuildAliasAsync(request);
}
});
}
/**
* Deletes a multiplayer server build alias.
* @param request DeleteBuildAliasRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult DeleteBuildAlias(final DeleteBuildAliasRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteBuildAliasAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Deletes a multiplayer server build alias. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateDeleteBuildAliasAsync(final DeleteBuildAliasRequest 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("/MultiplayerServer/DeleteBuildAlias"), 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());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Removes a multiplayer server build's region.
* @param request DeleteBuildRegionRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> DeleteBuildRegionAsync(final DeleteBuildRegionRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteBuildRegionAsync(request);
}
});
}
/**
* Removes a multiplayer server build's region.
* @param request DeleteBuildRegionRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult DeleteBuildRegion(final DeleteBuildRegionRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteBuildRegionAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Removes a multiplayer server build's region. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateDeleteBuildRegionAsync(final DeleteBuildRegionRequest 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("/MultiplayerServer/DeleteBuildRegion"), 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());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Deletes a multiplayer server game certificate.
* @param request DeleteCertificateRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> DeleteCertificateAsync(final DeleteCertificateRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteCertificateAsync(request);
}
});
}
/**
* Deletes a multiplayer server game certificate.
* @param request DeleteCertificateRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult DeleteCertificate(final DeleteCertificateRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteCertificateAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult exceptionResult = new PlayFabResult();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null);
return exceptionResult;
}
}
/** Deletes a multiplayer server game certificate. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateDeleteCertificateAsync(final DeleteCertificateRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask