Table of Contents

Class ChatSystem

Namespace
RisingV.Core.Systems
Assembly
RisingV.Core.ChatEngine.dll
public class ChatSystem : System, ISystem, IManageableLifecycle<SystemManager>, IManageableLifecycle, IReloadable, IManageable<SystemManager>, IManageable
Inheritance
ChatSystem
Implements
Inherited Members
Extension Methods

Methods

DeserializeMessage(string, ulong)

public static bool DeserializeMessage(string message, ulong steamId)

Parameters

message string
steamId ulong

Returns

bool

RegisterClientNonce(ulong, int)

Used by the client to register their nonce so that messages can be deserialised correctly in the client

public static void RegisterClientNonce(ulong steamId, int clientNonce)

Parameters

steamId ulong
clientNonce int

RegisterType<T>(Action<T, ulong>)

public static void RegisterType<T>(Action<T, ulong> onMessageEvent) where T : IChatMessage, new()

Parameters

onMessageEvent Action<T, ulong>

Type Parameters

T

SendToClient<T>(User, T)

Send a IChatMessage message to the client via the in-game chat mechanism. If the client has not yet been initialised (via InitialiseClient) then this will not send any message.

Note: If the client has not registered the IChatMessage type that we are sending, then they will not receive that message.

public static void SendToClient<T>(User toCharacter, T msg) where T : IChatMessage

Parameters

toCharacter User

This is the user that the message will be sent to

msg T

This is the data packet that will be sent to the user

Type Parameters

T

SerialiseMessage<T>(T, int)

public static string SerialiseMessage<T>(T msg, int clientNonce) where T : IChatMessage

Parameters

msg T
clientNonce int

Returns

string

Type Parameters

T

Events

OnClientRegisterEvent

The server should add an action on this event to be able to respond with any start-up requests now that the user is ready for messages.

public static event ClientRegisterMessageHandler? OnClientRegisterEvent

Event Type

ClientRegisterMessageHandler