Class RpcClassBase
Namespace: ReadyM.Api.Multiplayer.RPC
Assembly: ReadyM.Api.Multiplayer.dll
Base class for an RPC container. Each class that defines RPC methods with [RpcEvent] attributes must inherit from this class.
public abstract class RpcClassBase : IHostedService, IDisposable
Inheritanceâ
object â RpcClassBase
Implementsâ
Inherited Membersâ
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructorsâ
RpcClassBase(IRpcClient, IRelaySerializer)â
Base class for an RPC container. Each class that defines RPC methods with [RpcEvent] attributes must inherit from this class.
protected RpcClassBase(IRpcClient client, IRelaySerializer serializer)
Parametersâ
client IRpcClient
RPC client to use for sending RPCs. This is injected by the DI container.
serializer IRelaySerializer
Serializer to use for serializing RPC parameters. This is injected by the DI container.
Propertiesâ
EventsCountâ
Number of RPC events defined in this class. Generated by the source generator in derived classes.
protected abstract byte EventsCount { get; }
Property Valueâ
Offsetâ
Event code offset assigned to this RPC class. Generated by the source generator in derived classes.
protected byte Offset { get; }
Property Valueâ
RelayClientâ
RPC client to use for sending RPCs. This is injected by the DI container.
protected IRpcClient RelayClient { get; }
Property Valueâ
Serializerâ
Serializer to use for serializing RPC parameters. This is injected by the DI container.
protected IRelaySerializer Serializer { get; }
Property Valueâ
Methodsâ
DeInitRpc()â
De-initializes the RPC class, e.g. by unregistering RPC handlers. Generated by the source generator in derived classes.
protected abstract void DeInitRpc()
Dispose()â
public void Dispose()
InitRpc()â
Initializes the RPC class, e.g. by registering RPC handlers. Generated by the source generator in derived classes.
protected abstract void InitRpc()
OnScopeStart()â
Called when the DI container is initialized (on game start). This allows the service to perform any necessary setup at the appropriate time, such as registering event handlers.
public virtual void OnScopeStart()