class
FVisualScriptRpcCodec
- Module
- VisualScripting
- Header
#include "VisualScripting/VisualScriptRpc.h"- Namespace
Mowo
Type aliases
| Alias | Description |
|---|---|
using FObjectToTokenFn = uint32_t (*)(void* user, MObject* object) | Maps a live object argument to a wire token. Return 0 for "cannot map" — the encode FAILS for a non-null object with no token (silently nulling a parameter on the far side is exactly the kind of divergence RPCs exist to prevent). A null object encodes as token 0 without consulting the hook. |
using FTokenToObjectFn = MObject* (*)(void* user, uint32_t token) | Resolves a wire token back to a live object; token 0 and unknown tokens resolve to null. |
using FVisualScriptFunctionInvoker = bool (*)(MObject* target, const std::string& functionName, const std::vector<VisualScriptValue>& args) | A call that names no reflected method but a Visual Script function with RPC flags on the target's synthetic class runs through this hook, which the gameplay layer installs: only it can run a Visual Script function in the target's own context. Null = visual-script-function RPCs are refused. |
Public functions
| Returns | Name | Description |
|---|---|---|
bool | EncodeCall | Serialize a call. |
bool | DecodeAndInvoke | Decode a blob and invoke the named function on target through its reflected thunk. |
void | SetVisualScriptFunctionInvoker |
Function details
EncodeCall
C++
static bool EncodeCall(const std::string& functionName, const VisualScriptValue* args, size_t argCount, FObjectToTokenFn objectToToken, void* tokenUser, std::vector<uint8_t>& out)Serialize a call. args must already be coerced to the callee's parameter types (the VM does this before routing). Fails — with an error log naming the function — on a name longer than 255 bytes, more than 255 args, a container/Custom/Void argument, or an unmappable object.
DecodeAndInvoke
C++
static bool DecodeAndInvoke(MObject* target, MClass* cls, const uint8_t* data, size_t len, bool fromServer, FTokenToObjectFn tokenToObject, void* tokenUser)Decode a blob and invoke the named function on target through its reflected thunk. Refuses — with an error log — a malformed/truncated blob, an unknown function, a function that is NOT RPC-flagged, one whose direction contradicts the packet's origin (fromServer requires Client/Multicast, !fromServer requires Server), a static or non-void function, or an argument list that does not match the parameter types exactly. Side effects only run when every check passes.
SetVisualScriptFunctionInvoker
C++
static void SetVisualScriptFunctionInvoker(FVisualScriptFunctionInvoker invoker)Generated from VisualScripting/VisualScriptRpc.h via visualscripting.json · Nov 5, 2026Version 1.0.0