Skip to content

Merit-Circle/beam-sdk-unreal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beam Plugin for Unreal Engine

Setup

  1. When in the /.openapi-generator/ folder, run npm run generate
  2. This will generate the cpp files in the /Source/PlayerClient/ folder.
  3. Additionally, it will run generate-unreal-header.mjs if you have node.js installed which will create a header file at /BeamSdk/Public/BeamPlayerClientAPI.h

Usage

An example implementation compatible with versions of Unreal newer than 5.2.1 is provided at: beam-sdk-unreal-example

Initialize a Beam Client

Initialize a BeamClient to interact with the Beam API.

BeamStorage = UBeamSaveGameStorage::LoadOrCreate();
BeamClient = NewObject<UBeamClient>(this)
    ->SetBeamApiKey(BeamApiKey) // Required
    ->SetEnvironment(EBeamEnvironment::Testnet) // Optional, defaults to testnet if not set
    ->SetDebugLogging(true) // Optional, defaults to false if not set
    ->SetStorage(BeamStorage); // Required: Defaults to an Unreal SaveGame if you don't provide your own implementation
BeamStorage->Save();

Checking for an active Session

BeamClient->GetActiveSessionAsync(EntityId, ChainId)
.Next([&, Callback](const BeamOperationResult& Response) {
    // Do something with response
});

Creating a Session

BeamClient->CreateSessionAsync(EntityId)
.Next([&, Callback](const BeamSessionResult& Response) {
    // Do something with response
});

Revoking a Session

BeamClient->RevokeSessionAsync(EntityId, SessionAddress)
.Next([&, Callback](const BeamOperationResult& Response) {
    // Do something with response
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages