Class ChatSystem
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
Returns
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
RegisterType<T>(Action<T, ulong>)
public static void RegisterType<T>(Action<T, ulong> onMessageEvent) where T : IChatMessage, new()
Parameters
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
UserThis is the user that the message will be sent to
msg
TThis 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
TclientNonce
int
Returns
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