Remote Procedure Call
Gamium provides the ability to remotely invoke functions contained in the Game through the Gamium Client
.
The following C# code can be invoked through the function executeRpc in Gamium Client
.
C#
internal static class CodebaseSample
{
public static void CallParam1(double param1)
{
Logger.Verbose($"CodebaseSample.CallParam1: {param1}");
}
}
Typescript
await game.executeRpc(
RpcBy.method('Gamium.Private.CodebaseSample', 'CallParam1', 10),
);
Restrictions
- Only static functions can be called
- Only types such as int, float, and string can be passed as factors and used as return values
- Don't forget to add the Preserve Attribute if the function is not being called from anywhere.