# PLUS Game SDK for Unreal Engine (preview v0.1.0) Adds PLUS Mainnet (EVM chain ID 88088) to an Unreal Engine 5.1+ game as Blueprint nodes (and C++). Windows, macOS, Linux, Android and iOS. ## Install 1. Copy the `PlusGame` folder into your project's `Plugins` folder (create it if needed). 2. Regenerate project files and build. Enable **PLUS Game SDK** under Edit > Plugins if it is not enabled. ``` Plugins/PlusGame/PlusGame.uplugin Plugins/PlusGame/Source/PlusGame/Public/PlusGameActions.h async Blueprint nodes Plugins/PlusGame/Source/PlusGame/Public/PlusGameLibrary.h helpers and endpoint settings ``` ## Blueprint nodes (category "PLUS") | Node | Outputs | |---|---| | **Get PLUS Balance** (Address) | `On Success (Balance)` decimal string, e.g. `12.5` · `On Failure (Code, Message)` | | **PLUS Pay Checkout** (Invoice Id or URL, Timeout Seconds = 900) | `On Paid (Invoice Id, Tx Hash)` · `On Failure (Code, Message)` | | **Get PLUS Pay Invoice** (Invoice Id or URL) | `On Success (Status, Tx Hash)` status = `pending` / `paid` / `expired` | | Is Valid Address, Parse Invoice Id, Wei Hex To Plus, Set Endpoints | helpers | **PLUS Pay Checkout** opens the PLUS Pay page in the player's browser and checks the invoice every 3 seconds. Call **Cancel** on the returned node object if the player leaves the shop. Failure codes: `EXPIRED`, `TIMEOUT`, `BAD_INVOICE`. ## Purchase flow 1. Game asks YOUR server for an invoice (your server calls `POST https://plusmain.net/api/pay/invoice` with its PLUS Pay API key). 2. Game runs **PLUS Pay Checkout** with the invoice id and shows "Waiting for payment…". 3. Your server receives the signed `invoice.paid` webhook and grants the item. `On Paid` in the client is for the UI only. ## Player sign-in Unreal has no browser wallet inside the game. Sign players in on your web page with Sign-In with PLUS (EIP-4361, see the web SDK) and link the wallet address to the player account on your server. ## C++ ```cpp #include "PlusGameActions.h" UPlusGetBalanceAction* A = UPlusGetBalanceAction::GetPlusBalance(this, PlayerAddress); A->OnSuccess.AddDynamic(this, &AMyShop::HandleBalance); // void HandleBalance(const FString& Balance) A->Activate(); ``` ## Rules - Never put a PLUS Pay API key in the game client. - Gambling games and paid random items for PLUS are not allowed. Rewards and tradable items need a review per country: https://plusmain.net/developers/games/apply - Preview release: test with small amounts. Docs: https://plusmain.net/developers/games