Ejemplo n.º 1
0
        static byte[] FormatMessage(BitStream payload, ushort domainId, ushort typeId, ulong senderId)
        {
            Log.Entered();
            BitStream stream = new BitStream();

            stream.ResetWrite();
            HandlerRegistrar.SerializeHeaders(ref stream, ref domainId, ref typeId, ref senderId);
            Log.Trace($"Adding payload of length {payload.ByteLength} to formatted message of length {stream.ByteLength}");
            payload.ResetRead();
            stream.WriteBitStream(payload);
            Log.Trace($"Formatted message final length {stream.ByteLength}");
            return(stream.ToBytes());
        }
Ejemplo n.º 2
0
 void Terminate()
 {
     Log.Entered();
     MyAPIGateway.Multiplayer.UnregisterMessageHandler(HandlerId, HandleMessage);
     Static = null;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initialized by ComponentSession
 /// </summary>
 public HandlerRegistrar()
 {
     Log.Entered();
     MyAPIGateway.Multiplayer.RegisterMessageHandler(HandlerId, HandleMessage);
     Static = this;
 }