### Set Up Stats Example (C#) Source: https://dev.epicgames.com/docs/en-US/game-services/stats/stats-guide/stats-intro This snippet demonstrates the setup process for the Stats Interface using the EOS SDK API in C#. ```csharp // C# code for setting up Stats Interface // Requires EOS SDK API ``` -------------------------------- ### EOS Setup and Features Guidance (C# Example) Source: https://dev.epicgames.com/docs/en-US/epic-online-services/eos-get-started/get-started-resources This snippet outlines the process of setting up Epic Online Services (EOS) and implementing various features. It uses C# as an example language, but the concepts are transferable to C, Android, and iOS development. Key features covered include player authentication, presence, friend status, game services, cloud data, player statistics, leaderboards, and achievements. ```csharp 1. How to set up Epic Online Services (EOS) 2. Setting up a C# solution for EOS in Visual Studio 2019 3. Player authentication with Epic Account Services 4. Getting and setting player presence 5. Querying for Epic friends and their status 6. Accessing EOS Game Services with the Connect Interface 7. Retrieve game-specific data from the cloud 8. Storing and retrieving player-specific data 9. Manage player statistics with Epic Online Services 10. Rank player scores using leaderboards 11. Adding achievements to your game ``` -------------------------------- ### Set Up Stats Example (C++) Source: https://dev.epicgames.com/docs/en-US/game-services/stats/stats-guide/stats-intro This snippet demonstrates the setup process for the Stats Interface using the EOS SDK API in C++. ```cpp // C++ code for setting up Stats Interface // Requires EOS SDK API ``` -------------------------------- ### EOS SDK Initialization Example in Java Source: https://dev.epicgames.com/docs/en-US/epic-online-services/platforms/android This Java example demonstrates a basic flow for initializing the EOS SDK on Android, including loading the library and passing the application context. ```java public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); System.loadLibrary("EOSSDK"); EOSSDK.init(this); } } ``` -------------------------------- ### Run UE3Redist Installer via BuildPatchTool Command Line Source: https://dev.epicgames.com/docs/en-US/epic-games-store/services/game-prereqs-installer Example of a batch file snippet demonstrating how to initiate the UE3Redist installer as a prerequisite step using the BuildPatchTool command line. This method allows the Epic Games Launcher to manage prerequisite installations, ensuring users only see the process on their first launch or upon product updates. ```batch BuildPatchTool.exe -Command="InstallPrerequisites -PrerequisiteId=UE3Redist -InstallerArguments=\""-silent\""" ``` -------------------------------- ### EOS Bootstrapper Configuration File Example Source: https://dev.epicgames.com/docs/en-US/epic-account-services/crossplay/redistributable-installer An example of the configuration file used by the EOS bootstrapper application. This file specifies runtime options such as the application path, working directory, and flags for operating without EOS services or waiting for the target application to exit. ```configuration ApplicationPath=GameClient.exe WorkingDirectory= NoOperation=0 WaitForExit=0 ``` -------------------------------- ### Build Voice Server Sample App (macOS/Linux) Source: https://dev.epicgames.com/docs/en-US/game-services/real-time-communication-interface/voice/voice-sample Guide for building the Voice Server sample application on macOS or Linux. Prerequisites include installing cmake and gcc. The process involves unzipping the SDK, updating constants in SampleConstants.h, and executing a build script in the terminal. ```bash Unzip EOS-SDK.zip In Terminal, navigate to /EOS-SDK/Samples/Voice/Server/ Open SampleConstants.h and update your Test App values Run: ./Build.sh (or Build.command) ``` -------------------------------- ### Run EOS Bootstrapper Tool Command Line Source: https://dev.epicgames.com/docs/en-US/epic-account-services/crossplay/redistributable-installer Example of how to execute the EOS Bootstrapper Tool from the command line to create a new bootstrapper executable. It specifies the output path for the new executable and the path to the target application. ```command-line EOSBootstrapperTool.exe --output-path ..\GameBuild\Bin\LaunchGame.exe --app-path GameClient.exe ``` -------------------------------- ### Setting up the Platform (C#) Source: https://dev.epicgames.com/docs/en-US/epic-online-services/eos-get-started/working-with-the-eos-sdk/eossdkc-sharp-getting-started Provides a C# code snippet demonstrating the initial steps for setting up the Epic Online Services platform. This typically involves creating platform interface options and then creating the platform instance. ```csharp using Epic.OnlineServices; using Epic.OnlineServices.Platform; public class PlatformSetup { public static void SetupPlatform() { // Define platform options PlatformOptions platformOptions = new PlatformOptions(); platformOptions.ApiVersion = PlatformOptions.ApiVersion; platformOptions.ProductName = "MyGame"; platformOptions.ProductVersion = "1.0"; // ... set other platform options as needed // Create the platform instance try { PlatformInterface platform = PlatformInterface.Create(platformOptions); // Use the platform instance for subsequent EOS operations System.Diagnostics.Debug.WriteLine("Platform created successfully."); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine($"Failed to create platform: {ex.Message}"); } } } ``` -------------------------------- ### Sign In with Epic Account Services (C++ and C#) Source: https://dev.epicgames.com/docs/en-US/epic-account-services/auth/auth-guide/auth-intro Demonstrates how to integrate with Epic Account Services for player sign-in using the EOS SDK. This functionality allows players to authenticate directly from a game or application, enabling access to services like Friends, Presence, and Ecom. The examples are provided for both C++ and C#. ```cpp // C++ Example Snippet (Placeholder - actual code not provided in the text) // This section would typically contain C++ code using the EOS SDK for authentication. ``` ```csharp // C# Example Snippet (Placeholder - actual code not provided in the text) // This section would typically contain C# code using the EOS SDK for authentication. ``` -------------------------------- ### Install EOS Anti-Cheat Setup on Windows/Linux Source: https://dev.epicgames.com/docs/en-US/game-services/anti-cheat/anti-cheat-samples Installs the Epic Online Services Anti-Cheat setup for a specified product ID. This is a crucial step for integrating anti-cheat functionality. ```shell EasyAntiCheat_EOS_Setup.exe install YOUR_EOS_PRODUCT_ID ``` -------------------------------- ### Synchronize Sanctions Events (REST API) Source: https://dev.epicgames.com/docs/en-US/web-api-ref/sanctions-web-apis This snippet shows how to synchronize sanction events from the Sanctions Web API. It involves a GET request to the `/sanctions/v1/sync` endpoint, requiring authorization. An optional `lastLogId` query parameter can be used to specify the starting point for synchronization. ```HTTP GET /sanctions/v1/sync?lastLogId= Authorization: Bearer Content-Type: application/json ``` -------------------------------- ### Initialize and Create Platform Interface (C#) Source: https://dev.epicgames.com/docs/en-US/epic-online-services/eos-get-started/working-with-the-eos-sdk/eossdkc-sharp-getting-started Demonstrates the process of initializing the EOS SDK and creating a Platform Interface instance, which is the entry point for interacting with the SDK. It requires application information and developer portal credentials. ```csharp try { var options = new InitializeOptions() { ProductName = "MyProductName", ProductVersion = "1.0.0", // ... other options }; // Initialize the SDK var result = Epic.OnlineServices.Platform.PlatformInterface.Initialize(options); // Create a Platform Interface instance var platformConfig = new Epic.OnlineServices.Platform.PlatformConfig() { ProductId = "YOUR_PRODUCT_ID", SandboxId = "YOUR_SANDBOX_ID", DeploymentId = "YOUR_DEPLOYMENT_ID", ClientCredentialsId = "YOUR_CLIENT_ID", ClientCredentialsSecret = "YOUR_CLIENT_SECRET", EncryptionKey = "YOUR_ENCRYPTION_KEY" }; var platform = Epic.OnlineServices.Platform.PlatformInterface.Create(platformConfig); // Get AuthInterface var authInterface = platform.GetAuthInterface(); // ... use the platform and authInterface } catch (Exception ex) { // Handle exceptions Console.WriteLine($"Error initializing EOS SDK: {ex.Message}"); } ``` -------------------------------- ### List Binaries Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-140 Retrieves a list of already registered binaries from the backend. ```APIDOC ## GET /BuildPatchTool ### Description Queries the backend to retrieve a list of binaries that have already been registered. ### Method GET ### Endpoint /BuildPatchTool ### Parameters #### Query Parameters - **mode** (string) - Required - The mode to run the tool in, should be 'ListBinaries'. ### Response #### Success Response (200) - **binaries** (array) - A list of registered binaries, where each binary object contains details like ID, version, and artifact information. #### Response Example ```json { "binaries": [ { "id": "bin_abc123", "version": "1.0.0", "artifact": "artifact_xyz789" }, { "id": "bin_def456", "version": "1.1.0", "artifact": "artifact_uvw456" } ] } ``` ``` -------------------------------- ### Verify Anti-Cheat Service Installation (Windows Command Prompt) Source: https://dev.epicgames.com/docs/en-US/game-services/anti-cheat/anti-cheat-integration-check-list Installs the Anti-Cheat service as a player would and verifies its successful installation and stopped state. Requires Administrator rights for setup execution. ```cmd sc query EasyAntiCheat_EOS ``` -------------------------------- ### GET Verification Response Source: https://dev.epicgames.com/docs/en-US/kids-web-services/set-up-pv-service/config-the-pv-service-verification-response Example of the GET request sent to your redirect URL upon successful parent verification. ```APIDOC ## GET /your-redirect-url ### Description This endpoint receives the verification response from the PV service after a parent successfully verifies their identity. It includes status, payload, and a signature for verification. ### Method GET ### Endpoint `https://www.yourdomain.com/your-redirect-url` ### Query Parameters - **status** (string) - Required - A JSON string containing verification status, transaction ID, and error codes. - **externalPayload** (string) - Required - The payload associated with the verification event. - **signature** (string) - Required - The signature generated by KWS to verify the authenticity of the request. ### Response Example ``` https://www.yourdomain.com/your-redirect-url?status=%7B%22verified%22%3Atrue%2C%22transactionId%22%3A%22%22%2C%22errorCode%22%3Anull%7D&externalPayload=&signature= ``` ``` -------------------------------- ### List Binaries with BuildPatchTool Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-160 This code example shows how to use the BuildPatchTool to list existing binaries. It requires OrganizationID, ProductID, ArtifactID, ClientId, and ClientSecretEnvVar. Optional parameters include OnlyLabeled to filter by labeled binaries, Num to limit the number of results, and OutputFile to specify a file for the output. ```cmd Engine\Binaries\Win64>BuildPatchTool.exe -OrganizationId="" -ProductId="" -ArtifactId="" -ClientId="" -ClientSecretEnvVar="" -mode=ListBinaries Optional: -OnlyLabeled -Num="" -OutputFile="" ``` -------------------------------- ### Build Voice Server Sample App (Windows) Source: https://dev.epicgames.com/docs/en-US/game-services/real-time-communication-interface/voice/voice-sample Instructions for building the Voice Server sample application for Windows 32-bit and 64-bit systems. This involves unzipping the SDK, configuring Visual Studio projects with specific IDs, selecting build configurations and platforms, and finally building the executable. ```bash Unzip EOS-SDK.zip Navigate to \EOS-SDK\Samples\ Double-click Samples.sln Set StartUp Project to VoiceServer Update SampleConstants.h with your Test App values Select Solution Configuration (Release/Debug) Select Solution Platform (x64/x86) Right-click VoiceServer project and select Build ``` -------------------------------- ### BuildPatchTool Configuration for Batch Script Installer Source: https://dev.epicgames.com/docs/en-US/epic-games-store/services/game-prereqs-installer Illustrates the BuildPatchTool setup for integrating a batch script as a prerequisite installer. This configuration specifies the batch file as the executable to be run, ensuring that the prerequisite checks and installations defined within the script are handled correctly by the Epic Games Launcher. ```json { "Installers": [ { "AppName": "YourGame", "Installers": [ { "AppName": "YourGame", "PrerequisiteId": "UE3Redist", "ExecutablePath": "YourGame.exe", "ExecutableArguments": "" } ] } ] } ``` -------------------------------- ### EOS SDK Initialization with Product Credentials (C/C++) Source: https://dev.epicgames.com/docs/en-US/dev-portal/product-management Demonstrates how to use generated product-specific IDs and a client secret to initialize the EOS SDK. These credentials are added to a header file and used when creating the EOS Platform Interface. ```cpp #include // Example struct for holding EOS SDK credentials struct EpicOnlineServicesCredentials { const char* ClientId; const char* ClientSecret; const char* DeploymentId; const char* Environment; }; // Function to initialize the EOS Platform Interface void InitializeEOSSDK(EpicOnlineServicesCredentials creds) { EOS_InitializeOptions initializeOptions = {}; initializeOptions.ApiVersion = EOS_INITIALIZE_API_LATEST; initializeOptions.ProductName = "Your Product Name"; initializeOptions.ProductVersion = "1.0.0"; initializeOptions.ClientCredentials.ClientId = creds.ClientId; initializeOptions.ClientCredentials.ClientSecret = creds.ClientSecret; initializeOptions.DeploymentId = creds.DeploymentId; // initializeOptions.Flags = ...; // initializeOptions.SystemInformation = ...; EOS_HPlatform handle = EOS_Platform_Create(&initializeOptions); if (handle) { // SDK initialized successfully // Proceed with other EOS operations } else { // Failed to initialize SDK } } ``` -------------------------------- ### Upload Binary using BuildPatchTool.exe Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-150 This code snippet demonstrates how to use the BuildPatchTool.exe in `UploadBinary` mode from the command line. It requires specifying organization, product, artifact, and client details, along with build location and version. Optional parameters allow for file list, attribute list, and ignore list customization. ```batch Engine\Binaries\Win64>BuildPatchTool.exe -OrganizationId="" -ProductId="" -ArtifactId="" -ClientId="" -ClientSecretEnvVar="" -mode=UploadBinary -BuildRoot="" -CloudDir="" -BuildVersion="" -AppLaunch="" -AppArgs="" Optional: -FileList="" -FileAttributeList="" -FileIgnoreList="" ``` -------------------------------- ### EOS_UserInfo_QueryUserInfoByExternalAccount Source: https://dev.epicgames.com/docs/en-US/api-ref/functions/eos-user-info-query-user-info-by-external-account Starts an asynchronous query to retrieve user information by external accounts. This can be useful for getting the EOS_EpicAccountId for external accounts. ```APIDOC ## EOS_UserInfo_QueryUserInfoByExternalAccount ### Description Starts an asynchronous query to retrieve user information by external accounts. This can be useful for getting the EOS_EpicAccountId for external accounts. Once the callback has been fired with a successful ResultCode, it is possible to call CopyUserInfo to receive an EOS_UserInfo containing the available information. ### Method POST ### Endpoint /websites/dev_epicgames_en-us ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **Handle** (EOS_HUserInfo) - Required - User information handle. - **Options** (const EOS_UserInfo_QueryUserInfoByExternalAccountOptions*) - Required - Structure containing the input parameters. - **ClientData** (void*) - Optional - Arbitrary data that is passed back to you in the CompletionDelegate. - **CompletionDelegate** (const EOS_UserInfo_OnQueryUserInfoByExternalAccountCallback) - Required - A callback that is fired when the async operation completes, either successfully or in error. ### Request Example ```json { "Handle": "eos_user_info_handle", "Options": { "ApiVersion": "0", "IssuerId": "string", "IssuerAccountIdType": "EOS_EExternalAccountType", "AccountId": "string" }, "ClientData": null, "CompletionDelegate": "callback_function" } ``` ### Response #### Success Response (200) - **ResultCode** (EOS_EResult) - The result code for the operation. - **ClientData** (void*) - The arbitrary data that was passed in. #### Response Example ```json { "ResultCode": "EOS_Success", "ClientData": null } ``` ### Callback Function Information This function is asynchronous and employs a callback of type `EOS_UserInfo_OnQueryUserInfoByExternalAccountCallback` to report the results of its operation. #### Callback Remarks Function prototype definition for callbacks passed to `EOS_UserInfo_QueryUserInfoByExternalAccount`. #### Callback Parameters - **Data** (const EOS_UserInfo_QueryUserInfoByExternalAccountCallbackInfo*) - A `EOS_UserInfo_QueryUserInfoByExternalAccountCallbackInfo` containing the output information and result. ``` -------------------------------- ### Approve Pending Sanctions Response (Example) Source: https://dev.epicgames.com/docs/en-US/web-api-ref/sanctions-web-apis An example of a successful HTTP response (200 OK) for approving pending sanctions. Includes a JSON payload with a list of approved sanctions and detailed results. ```json { "elements": [ { "sanctionId": "sanction_id_1", "status": "Approved", "reason": "User violation" } ], "result": { "approvedCount": 1 } } ``` -------------------------------- ### Upload Binary using BuildPatchTool Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-170 This section details how to use the BuildPatchTool to upload a binary. It outlines the command structure and provides descriptions for all available arguments. ```APIDOC ## BuildPatchTool - Upload Binary ### Description Navigate to the `Engine/Binaries/Win64/` directory. From a command line, run BuildPatchTool.exe in `UploadBinary` mode, and point it at your binary. This will process your binary, upload it to cloud storage, and register it with the backend. ### Method Command Line Execution ### Endpoint `BuildPatchTool.exe -mode=UploadBinary` ### Parameters #### Required Arguments - **OrganizationID** (string) - Use the Organization ID string that was provided along with your credentials. - **ProductID** (string) - Use the Product ID string that was provided along with your credentials. - **ArtifactID** (string) - Specify the Artifact ID string that was provided along with your credentials. - **ClientId** (string) - See Authentication section. - **ClientSecretEnvVar** (string) - See Authentication section. - **BuildRoot** (string) - The path to the directory containing the binary to be read and processed. It can be an absolute path from the drive root or a relative path from the current working directory. It is recommended that this path be located near the drive root to avoid any files exceeding the OS MAX_PATH limit (typically 260 characters). - **CloudDir** (string) - A directory where BuildPatchTool can save files to be uploaded; this can be empty each run. As with the BuildRoot, this can be an absolute or a relative path. This location is used to cache information about existing binaries and should be a different directory from the BuildRoot parameter. It is OK if this directory is initially empty; BuildPatchTool will download information as needed from the Epic backend and store it in the CloudDir. - **BuildVersion** (string) - The version string for the build. This needs to be unique for each build of a specific artifact, independent of platform. For example, `BuildVersion-1.0` can only exist for Windows or Mac, not both. The build version string has the following restrictions: Must be between 1 and 100 characters in length, whitespace is not allowed, should only contain characters from the following sets: a-z, A-Z, 0-9, or .+-_. - **AppLaunch** (string) - The path to the app executable that should be launched when running your game, relative to (and inside of) the BuildRoot. For Mac binaries, this should be the executable file contained within the .app folder, usually in the location Game.app/Contents/MacOS/Game. - **AppArgs** (string) - The commandline to send to the app on launch. This can be set to "" when no additional arguments are needed. #### Optional Arguments - **FileList** (string) - A path to a text file containing files to be included in the binary. The files must be BuildRoot relative. This is an alternative to using FileIgnoreList. - **FileAttributeList** (string) - A path to a text file containing a list of files and corresponding special attributes (e.g. executable bit) that should be set. The attributes file should not be inside your BuildRoot to ensure that it does not get erroneously included in your binary upload. - **FileIgnoreList** (string) - A path to a text file containing a list of files that should be excluded from the generated patch data. Each entry should be on a new line, and be a relative path from BuildRoot. A forward slash ("/") separator should be used. If the ignore file is located inside BuildRoot, its own relative file path needs to be included in the ignore list to avoid it being included in the patch data. - **PrereqIds** (string) - A comma-separated list of identifiers, wrapped in double quotes, that the prerequisites satisfy. At install time, a machine that has all the prerequisites with these ids installed skips prerequisite installation. Documentation: Game Prerequisites Installers–Epic Games Launcher via the BuildPatchTool Command Line - **PrereqPath** (string) - The prerequisite installer that you want to launch on a successful product install. Specify a path, in double quotes, relative to the build root. - **PrereqArgs** (string) - The command line, wrapped in double quotes, that you want to send on launch to the prerequisite installer specified in `PrereqPath`. This parameter supports string replacements for `"$[RootDirectory]"` and `"$[LogDirectory]"`. The replacements include trailing `/` symbols. `RootDirectory` is replaced with the root path of the installed product before the product executes. `LogDirectory` is the path to the program's log output directory. You can use `"$[Quote]"` to get a quote character, which is important because the BPT command line already uses quotes for token parsing. ### Request Example ``` "C:\Program Files\Epic Games\BuildPatchTool\BuildPatchTool.exe" -mode=UploadBinary -OrganizationID=YOUR_ORG_ID -ProductID=YOUR_PRODUCT_ID -ArtifactID=YOUR_ARTIFACT_ID -ClientId=YOUR_CLIENT_ID -ClientSecretEnvVar=YOUR_CLIENT_SECRET_ENV_VAR -BuildRoot=C:\Builds\MyGame -CloudDir=C:\BuildCache -BuildVersion=1.0.0 -AppLaunch=MyGame.exe -AppArgs="-log" ``` ### Response #### Success Response (0) Upon successful execution, BuildPatchTool.exe typically returns an exit code of 0. #### Response Example ``` Exit Code: 0 ``` ### Error Handling Use the `-help` option after any mode (e.g., `"BuildPatchTool.exe -mode=UploadBinary -help"`) to get information about the required arguments. The `-help` option in BuildPatchTool contains optional FeatureLevel arguments; use this argument only after direct instruction from Epic Games. ``` -------------------------------- ### Approve Pending Sanctions Request (Example) Source: https://dev.epicgames.com/docs/en-US/web-api-ref/sanctions-web-apis An example of an HTTP request to approve pending sanctions. Requires an EOS Client Auth access token for authorization and specific path, header, and JSON payload parameters. ```http PATCH /sanctions/v1/{deploymentId}/sanctions/pending/approve HTTP/1.1 Host: api.epicgames.com Authorization: Bearer Content-Type: application/json Eos-Organization-Id: YOUR_ORGANIZATION_ID Eos-Client-Id: YOUR_CLIENT_ID Eos-Deployment-Id: YOUR_DEPLOYMENT_ID { "referenceIds": ["sanction_id_1", "sanction_id_2"] } ``` -------------------------------- ### Node.js Setup and Run Source: https://dev.epicgames.com/docs/en-US/epic-games-store/store-presence/web-shops/manage-webhooks Instructions for setting up Node.js dependencies and running the development server. The server is accessible at http://localhost:3000/api/event by default. ```bash npm install ``` ```bash npm run dev ``` -------------------------------- ### Upload Binary Command - BuildPatchTool Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-160 This command demonstrates how to upload a binary using the BuildPatchTool. It requires organization, product, and artifact IDs, along with paths to local build and cloud directories, and the build version. Optional parameters allow for specifying file lists, attributes, ignored files, prerequisites, and uninstall actions. ```powershell Engine\Binaries\Win64>BuildPatchTool.exe -OrganizationId="" -ProductId="" -ArtifactId="" -ClientId="" -ClientSecretEnvVar="" -mode=UploadBinary -BuildRoot="" -CloudDir="" -BuildVersion="" -AppLaunch="" -AppArgs="" Optional: -FileList="" -FileAttributeList="" -FileIgnoreList="" -PrereqIds="" -PrereqPath="" -PrereqArgs="" -UninstallActionPath="" -UninstallActionArgs="" ``` -------------------------------- ### EOS_Mods_InstallMod Source: https://dev.epicgames.com/docs/en-US/api-ref/functions/eos-mods-install-mod Starts an asynchronous task to install a specified mod using the EOS SDK. This function utilizes a callback to report the operation's results. ```APIDOC ## POST /websites/dev_epicgames_en-us ### Description Starts an asynchronous task that makes a request to install the specified mod. ### Method POST ### Endpoint /websites/dev_epicgames_en-us ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **Handle** (EOS_HMods) - Handle to the Mods interface. - **Options** (EOS_Mods_InstallModOptions*) - Structure containing the game and mod identifiers. - **ClientData** (void*) - Arbitrary data passed back in the CompletionDelegate. - **CompletionDelegate** (EOS_Mods_OnInstallModCallback) - Callback fired when the async operation completes. ### Request Example ```json { "Handle": "your_hmods_handle", "Options": { "GameId": "your_game_id", "ModId": "your_mod_id" }, "ClientData": null, "CompletionDelegate": "your_callback_function" } ``` ### Response #### Success Response (200) - **ResultCode** (EOS_EResult) - Result of the operation. - **ClientData** (void*) - Data that was passed into the function. #### Response Example ```json { "ResultCode": "EOS_Success", "ClientData": null } ``` ``` -------------------------------- ### Copy Binary Example (Windows Command Line) Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-140 Demonstrates how to use the CopyBinary mode of the BuildPatchTool to copy binaries from one artifact to another. This is useful for migrating builds between staging and live environments. ```windows C:\Users\Name.Name\Desktop\Engine\Binaries\Win64>BuildPatchTool.exe -help -mode=CopyBinary ``` -------------------------------- ### BuildPatchTool LabelBinary Mode Example Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-160 This example demonstrates how to use the BuildPatchTool in LabelBinary mode to apply a label and platform to a binary. This is crucial for making binaries accessible through the Epic Games Launcher. ```command-line Engine\Binaries\Win64>BuildPatchTool.exe -OrganizationId="" -ProductId="" -ArtifactId="" -ClientId="" -ClientSecretEnvVar="" -mode=LabelBinary -BuildVersion="" -Label="" -Platform="" Optional: -SandboxId="" ``` -------------------------------- ### Retrieve Stats Example (C#) Source: https://dev.epicgames.com/docs/en-US/game-services/stats/stats-guide/stats-intro This snippet demonstrates how to retrieve player statistics using the EOS SDK API in C#. ```csharp // C# code for retrieving player stats // Requires EOS SDK API ``` -------------------------------- ### Retrieve Stats Example (C++) Source: https://dev.epicgames.com/docs/en-US/game-services/stats/stats-guide/stats-intro This snippet demonstrates how to retrieve player statistics using the EOS SDK API in C++. ```cpp // C++ code for retrieving player stats // Requires EOS SDK API ``` -------------------------------- ### Upload Binary using BuildPatchTool Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-170 This command uploads a binary to cloud storage and registers it with the backend. It requires various IDs and paths, and supports optional arguments for file inclusion/exclusion and application launch configuration. ```bash BuildPatchTool.exe -mode=UploadBinary -OrganizationID="" -ProductID="" -ArtifactID="" -ClientId="" -ClientSecretEnvVar="" -BuildRoot="" -CloudDir="" -BuildVersion="" -AppLaunch="" -AppArgs="" ``` -------------------------------- ### GET /sanctions/v1/{deploymentId}/users/{productUserId} Source: https://dev.epicgames.com/docs/en-US/web-api-ref/sanctions-web-apis Retrieves a list of sanctions for a specific user within a deployment. Supports pagination. ```APIDOC ## GET /sanctions/v1/{deploymentId}/users/{productUserId} ### Description Retrieves a list of sanctions for a specific user within a deployment. Supports pagination. ### Method GET ### Endpoint /sanctions/v1/{deploymentId}/users/{productUserId} ### Parameters #### Path Parameters - **deploymentId** (String) - Required - The `deploymentId` to query for - **productUserId** (String) - Required - The `productUserId` to query for #### Query Parameters - **limit** (integer) - Optional - The number of elements to return. Default `100`. - **offset** (integer) - Optional - The number of elements to skip. Default `0`. ### Response #### Success Response (200) - **elements** (Array) - List of sanctions ordered by createdAt descending. - **paging** (Object) - Pagination information #### Response Example { "elements": [ { "referenceId": "123e4567-e89b-12d3-a456-426614174000", "userId": "user123", "origin": "EpicGames", "type": "AccountLevel", "action": "AccountRestriction", "reason": "Violation of Terms of Service", "createdAt": "2023-10-27T10:00:00Z", "expiresAt": "2024-10-27T10:00:00Z", "notes": "Temporary restriction due to suspicious activity.", "metadata": {}, "tags": ["fraud", "suspicious"] } ], "paging": { "offset": 0, "limit": 100, "total": 1 } } ``` -------------------------------- ### BuildPatchTool Binary Delta Optimization Example Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-150 Demonstrates the command-line execution of BuildPatchTool for binary delta optimization between two build versions. It shows the expected output when optimization has already been completed. ```bash Running optimisation for patching 1.3.0-Windows -> 1.3.1-Windows ** Chunk delta optimization already completed for provided manifests. ** Loaded- optimised delta file E:/CloudDir/Deltas/jd63jdu7-jsg58dh58dki8dk323/a5nbd0jbweof98fvytsvnthcsvf.delta ``` -------------------------------- ### List Binaries Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-150 Retrieves a list of registered binaries, optionally filtered by labels. ```APIDOC ## POST /BuildPatchTool ### Description Retrieves a list of binaries that have been registered. You can filter the results to include only labeled binaries and specify the number of results. ### Method POST ### Endpoint /BuildPatchTool ### Parameters #### Path Parameters None #### Query Parameters - **mode** (string) - Required - Must be set to `ListBinaries`. - **OnlyLabeled** (boolean) - Optional - If true, only list binaries with labels. - **Num** (integer) - Optional - Limits the number of binaries returned. Results are ordered by date, most recent first. - **OutputFile** (string) - Optional - Specifies a file path to output the list of binaries as a JSON array. #### Request Body - **OrganizationId** (string) - Required - Your organization identifier. - **ProductId** (string) - Required - The product identifier. - **ArtifactId** (string) - Required - The artifact identifier. - **ClientId** (string) - Required - Your client identifier. - **ClientSecretEnvVar** (string) - Required - Environment variable containing your client secret. ### Request Example ```json { "OrganizationId": "", "ProductId": "", "ArtifactId": "", "ClientId": "", "ClientSecretEnvVar": "", "mode": "ListBinaries", "OnlyLabeled": true, "Num": 10, "OutputFile": "binary_list.json" } ``` ### Response #### Success Response (200) (Details of success response not provided in the source text. Expected to be a JSON array of binary information.) #### Response Example (No example provided in the source text) ``` -------------------------------- ### Synchronizing Sanctions to an External Service Source: https://dev.epicgames.com/docs/en-US/web-api-ref/sanctions-web-apis Synchronizes sanction events to an external service, optionally starting from a specific log entry. ```APIDOC ## GET /sanctions/v1/sync ### Description Synchronizes sanction events to an external service. This endpoint can be used to poll for new or updated sanction events. ### Method GET ### Endpoint `/sanctions/v1/sync` ### Parameters #### Query Parameters - **lastLogId** (String) - Optional - Optional ID of the last sanction event entry processed in the previous call. If omitted, the sync starts from the beginning. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) (Response details not specified in the provided text for this endpoint) #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### Get Leaderboard Definition Count Options Source: https://dev.epicgames.com/docs/en-US/game-services/leaderboards/leaderboards-guide/retrieve-leaderboards-for-your-game Sets up the options structure required to query the number of cached leaderboard definitions. It specifies the API version for compatibility. ```cpp EOS_Leaderboards_GetLeaderboardDefinitionCountOptions GetDefinitionCountOptions = {}; GetDefinitionCountOptions.ApiVersion = EOS_LEADERBOARDS_GETLEADERBOARDDEFINITIONCOUNT_API_LATEST; ``` -------------------------------- ### List Binaries with BuildPatchTool Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-150 This command retrieves a list of registered binaries. You can optionally filter the list to show only labeled binaries, specify the number of returned binaries, or output the list to a file. Requires OrganizationId, ProductId, ArtifactId, ClientId, and ClientSecretEnvVar. ```bash Engine\Binaries\Win64>BuildPatchTool.exe -OrganizationId="" -ProductId="" -ArtifactId="" -ClientId="" -ClientSecretEnvVar="" -mode=ListBinaries Optional: -OnlyLabeled -Num="" -OutputFile="" ``` -------------------------------- ### Update Values for Stats Example (C#) Source: https://dev.epicgames.com/docs/en-US/game-services/stats/stats-guide/stats-intro This snippet demonstrates how to update stat values for a player using the EOS SDK API in C#. ```csharp // C# code for updating stat values // Requires EOS SDK API ``` -------------------------------- ### Command Line Path Syntax Examples Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-140 Demonstrates valid ways to specify directory paths in BuildPatchTool arguments on the command line, addressing issues with backslashes and quotes. ```command-line -BuildRoot="D:/MyFolder/" -BuildRoot=D:\MyFolder\ -BuildRoot=D:\MyFolder -BuildRoot="D:\MyFolder" -BuildRoot=D:/MyFolder/ -BuildRoot=D:/MyFolder -BuildRoot="D:\MyFolder\\" ``` -------------------------------- ### Update Values for Stats Example (C++) Source: https://dev.epicgames.com/docs/en-US/game-services/stats/stats-guide/stats-intro This snippet demonstrates how to update stat values for a player using the EOS SDK API in C++. ```cpp // C++ code for updating stat values // Requires EOS SDK API ``` -------------------------------- ### BuildPatchTool - Failed to retrieve list of binaries Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-150 This error indicates an issue with the provided organization, product, or artifact IDs, or insufficient permissions to create binaries for the artifact. Ensure your client credentials are correct and have the necessary permissions. ```text Please check your provided %OrganizationId%, %ProductId% and ArtifactId are correct, and that you should have access to create binaries for this artifact. Tool exited with: 6 ``` -------------------------------- ### Valid Path Syntax Examples for BuildPatchTool Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-160 Demonstrates correct ways to specify directory paths in BuildPatchTool command-line arguments, addressing issues with backslashes and quotes on Windows. ```bash -BuildRoot="D:/MyFolder/" ``` ```bash -BuildRoot=D:\MyFolder\ ``` ```bash -BuildRoot=D:\MyFolder ``` ```bash -BuildRoot=D:/MyFolder/ ``` ```bash -BuildRoot=D:/MyFolder ``` ```bash -BuildRoot="D:\MyFolder\" ``` -------------------------------- ### Achievements - Remove Notification for Unlocked Achievements Source: https://dev.epicgames.com/docs/en-US/game-services/achievements/achievements-guide/achievement-notifications Removes a previously subscribed notification for achievement unlocks. ```APIDOC ## EOS_Achievements_RemoveNotifyAchievementsUnlocked ### Description Stops receiving notifications for unlocked achievements. You must provide the notification ID obtained during subscription. ### Method DELETE ### Endpoint /websites/dev_epicgames_en-us ### Parameters #### Query Parameters - **NotificationId** (string) - Required - The ID of the notification to remove, received when subscribing. ### Request Example ```json { "NotificationId": "NOTIF_12345" } ``` ### Response #### Success Response (200) - **ResultCode** (string) - The result code of the operation. #### Response Example ```json { "ResultCode": "Success" } ``` ``` -------------------------------- ### Get Leaderboard Definition Count Source: https://dev.epicgames.com/docs/en-US/game-services/leaderboards/leaderboards-guide/retrieve-leaderboards-for-your-game Calls the EOS API to retrieve the total number of leaderboard definitions stored in the local cache. This count is used to iterate through the definitions. ```cpp uint32_t DefinitionCount = EOS_Leaderboards_GetLeaderboardDefinitionCount( LeaderboardsHandle, &GetDefinitionCountOptions); ``` -------------------------------- ### Achievements Manager API Source: https://dev.epicgames.com/docs/en-US/game-services/achievements/achievements-guide/achievement-notifications This section provides documentation for the AchievementsManager class, which handles player achievement notifications. ```APIDOC ## AchievementsManager Class ### Description Manages player achievements, including subscribing to and unsubscribing from unlock notifications. ### Constructor Initializes the AchievementsManager with platform and user handles. ### Destructor Cleans up resources used by the AchievementsManager. ## POST /Achievements/Subscribe ### Description Subscribes the program to notifications for when achievements are unlocked by the player. ### Method POST ### Endpoint `/Achievements/Subscribe` ### Parameters #### Request Body - **InPlatformHandle** (EOS_HPlatform) - Required - The handle for the platform interface. - **InLocalProductUserId** (EOS_ProductUserId) - Required - The ProductUserID of the local player. ### Request Example ```json { "InPlatformHandle": "", "InLocalProductUserId": "" } ``` ### Response #### Success Response (200) Indicates successful subscription to achievement unlock notifications. ## DELETE /Achievements/Unsubscribe ### Description Unsubscribes the program from achievement unlock notifications. ### Method DELETE ### Endpoint `/Achievements/Unsubscribe` ### Parameters #### Request Body - **NotificationId** (EOS_NotificationId) - Required - The notification ID obtained during subscription. ### Request Example ```json { "NotificationId": "" } ``` ### Response #### Success Response (200) Indicates successful unsubscription from achievement unlock notifications. ## AchievementsManager.h ### Description Header file defining the AchievementsManager class. ### Code ```cpp // AchievementsManager.h #pragma once #include #include #include #include class AchievementsManager { public: /** * Constructor * * @param InPlatformHandle - The handle for the platform interface obtained during platform setup. * * @param InLocalProductUserId - The ProductUserID of the local player obtained during login. */ AchievementsManager(EOS_HPlatform InPlatformHandle, EOS_ProductUserId InLocalProductUserId); /** Deconstructor */ ~AchievementsManager(); /** Subscribes your program to notifications from EOS for when achievements are unlocked. */ void SubscribeToAchievementNotificationsExample(); /** Unsubscribes your program from EOS achievement notifications. */ void UnsubscribeFromAchievementNotificationsExample(); private: /** * Callback called by the EOS SDK whenever an achievement unlock notification is sent. * * @param Data - Information passed to the callback function by the EOS SDK. */ static void EOS_CALL OnAchievementUnlockNotification(const EOS_Achievements_OnAchievementsUnlockedCallbackV2Info* Data); /** The Platform Interface handle. */ EOS_HPlatform PlatformHandle = nullptr; /** The Achievements Interface handle. */ EOS_HAchievements AchievementsHandle = nullptr; /** The Product User ID of the local player. */ EOS_ProductUserId LocalProductUserId = nullptr; /** Keeps track of the player's notification subscription. */ EOS_NotificationId NotificationId; }; ``` ## AchievementsManager.cpp ### Description Implementation file for the AchievementsManager class. ### Code ```cpp // AchievementsManager.cpp #include "AchievementsManager.h" #include // Constructor AchievementsManager::AchievementsManager(EOS_HPlatform InPlatformHandle, EOS_ProductUserId InLocalProductUserId) : PlatformHandle(InPlatformHandle) , LocalProductUserId(InLocalProductUserId) { // Get and save a handle to the Achievements Interface. AchievementsHandle = EOS_Platform_GetAchievementsInterface(PlatformHandle); } AchievementsManager::~AchievementsManager() { } void AchievementsManager::SubscribeToAchievementNotificationsExample() { EOS_Achievements_AddNotifyAchievementsUnlockedV2Options NotificationOptions = {}; NotificationOptions.ApiVersion = EOS_ACHIEVEMENTS_ADDNOTIFYACHIEVEMENTSUNLOCKEDV2_API_LATEST; // Set up notifications for achievement unlocks. The callback function will be called when an achievement is unlocked. NotificationId = EOS_Achievements_AddNotifyAchievementsUnlockedV2(AchievementsHandle, &NotificationOptions, nullptr, OnAchievementUnlockNotification); } void AchievementsManager::UnsubscribeFromAchievementNotificationsExample() { EOS_Achievements_RemoveNotifyAchievementsUnlocked(AchievementsHandle, NotificationId); } void EOS_CALL AchievementsManager::OnAchievementUnlockNotification(const EOS_Achievements_OnAchievementsUnlockedCallbackV2Info* Data) { std::cout << "Unlocked Achievement ID: " << Data->AchievementId << " at time " << Data->UnlockTime << std::endl; } ``` ``` -------------------------------- ### BuildPatchTool Optimization Results Example Source: https://dev.epicgames.com/docs/en-US/epic-games-store/publishing-tools/uploading-binaries/bpt-instructions-160 Presents an example of the output from BuildPatchTool after running an optimization process, showing the final compressed bytes, original compressed bytes, and the percentage improvement. ```text Final unknown compressed bytes, plus meta 400000 Original unknown compressed bytes 1000000 Improvement: 60% ```