GenvidRequests

New in version 1.42.0.

header:

Genvid/Public/GenvidRequests.h

implementation:

Genvid/Private/GenvidRequests.cpp

class UGenvidRequests

The base class that allows you to subscribe to Requests from the Genvid Stack.

Functions

static void CreateRequests()

Static method that subscribes to all requests defined in the UGenvidRequests instance pass in entry.

void SubmitRequestReply(const FString &topic, const FString &replyTo, ...)

A set of overloaded methods allowing you to send a reply to the requester.

FString UTF8ToString(const TArray<uint8> &data)

A utility method to convert a byte array to an UTF8String. Useful when the payload of request needs to be converted within a blueprint.

void InternalReceiveBeginPlay()

Acts as a superset of the AActor BeginPlay. It’s the first function called when the UGenvidRequests is created.

Properties

TArray<FGenvidRequest> Requests

A list of FGenvidRequest to subscribe to. See CreateRequests().

bool bIsCreated

Read-only variable for reporting if the requests have been successfully subscribed to.

bool bCompressJsonString

Flag that determine if the reply received in the SubmitRequestReply() must be compressed before sending.

Note

If true, for consistency with similar methods, the reply will be compressed even when passing a string (TCHAR * overload). Use the TArray overload to avoid it.

class FGenvidRequest

This class hold the topic of the request to subscribe and its delegate.

Properties

FString Topic

The topic of the request to subscribe.

FOnGenvidRequest OnGenvidRequestDelegate
Display Name:

Delegate

The delegate to call when the request is received.

class FOnGenvidRequest

An Unreal Dynamic Delegate with three parameters:

  • const FString& topic: the topic of the command.

  • const FString& replyTo: the replyTo address of the request.

  • const TArray<unit8>& data: the payload of the request.

The delegate is actually declared this way:

DECLARE_DYNAMIC_DELEGATE_ThreeParams(FOnGenvidRequest, const FString&, topic, const FString&, replyTo, const TArray<uint8>&, data);