Skip to main content

EntranceMessageHandler

A class in TavernLib, TavernLib.Backend.

Receives the roles message on a client and keeps the local player's roles. Registered as a service on both sides, but only sets its handler when not a server.

Constructors​

MemberWhat it is
EntranceMessageHandler()Subscribes to the socket created event.

Properties​

MemberWhat it is
UserConfig.User LocalUser { get; private set; }The local player as a UserConfig.User. Only its Roles are filled in, from the last roles message the server sent.

Methods​

3 private and internal methods
MemberWhat it is
private void OnRolesReceived(Connection connection, Stream stream)Client side: reads the role list the server sent into LocalUser and logs it.
private void OnSocketCreated(ISocket socket)Hooks the new socket's connection created event.
private void SetMessageHandlerForConnection(Connection connection)On a client, sets the handler for the roles message from the server.

Used in​

Members of other types that take, return or hold a EntranceMessageHandler: