Skip to main content

MessageExpanderPatch

A class in TavernLib, TavernLib.Patches.

Replaces the game's network message type header with an 8-bit one, for 256 message types, so TavernLib and mods have room for their own. It changes the wire format, so server and client both need it.

Constructors​

MemberWhat it is
MessageExpanderPatch()Created by TavernLib; mods don't make one.

Methods​

MemberWhat it is
static bool LogMessageHandler(Connection connection, ArraySegment<byte> data, ConnectionChannel channel, out MessageType messageType, ref int __result)Prefix on MessageProcessor.ProcessSingleMessageFromData that skips it, reading the type as 8 bits and handing the message on.
static bool StartSerializeCustom(Connection connection, MessageType type, ref StreamWriter __result)Prefix on OutgoingPacketManager.StartSerialize that skips it, writing the message type as 8 bits.