Skip to content

Class ServerExtensionProxy

Namespace: DotBoxD.Plugins.Runtime.Rpc
Assembly: DotBoxD.Plugins.dll

A runtime proxy that implements a server-extension interface by marshaling each call through an installed batch kernel. Arguments are converted to sandbox values, the verified IR runs request/ response via DotBoxD.Plugins.Kernel.InstalledKernel.InvokeServerExtensionAsync(System.Collections.Generic.IReadOnlyList{DotBoxD.Kernels.Sandbox.SandboxValue},System.Threading.CancellationToken), and the result is marshaled back to the method’s return type, so server.ServerExtension<IMonsterKiller>().KillMonsters(ids) returns real C# objects. The service is expected to declare a single batch method; synchronous, Task<T>, and ValueTask<T> return shapes are supported.

public class ServerExtensionProxy : DispatchProxy

objectDispatchProxyServerExtensionProxy

DispatchProxy.Create(Type, Type), DispatchProxy.Create<T, TProxy>(), DispatchProxy.Invoke(MethodInfo?, object?[]?), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

public static TService Create<TService>(InstalledKernel kernel) where TService : class

kernel InstalledKernel

TService

TService

Whenever any method on the generated proxy type is called, this method is invoked to dispatch control.

protected override object? Invoke(MethodInfo? targetMethod, object?[]? args)

targetMethod MethodInfo?

The method the caller invoked.

args object?[]?

The arguments the caller passed to the method.

object?

The object to return to the caller, or null for void methods.