Esempio n. 1
0
        public static void Serialize([NotNull] this NetworkWriter writer, DissonanceNetworkMessage value)
        {
            writer.WriteUInt16((ushort)value.Data.Count);
            writer.WriteBytes(value.Data.Array, value.Data.Offset, value.Data.Count);

            //Recyle array now that it has been serialized
            // ReSharper disable once AssignNullToNotNullAttribute (Justification: can't be null)
            SerializationBuffers.Put(value.Data.Array);
        }
Esempio n. 2
0
        internal static void NullMessageReceivedHandler(NetworkConnection source, DissonanceNetworkMessage msg)
        {
            if (Logs.GetLogLevel(LogCategory.Network) <= LogLevel.Trace)
            {
                Debug.Log("Discarding Dissonance network message");
            }

            msg.Dispose();
        }
Esempio n. 3
0
 private void OnMessageReceived(NetworkConnection source, DissonanceNetworkMessage msg)
 {
     using (msg)
         NetworkReceivedPacket(msg.Data);
 }