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); }
internal static void NullMessageReceivedHandler(NetworkConnection source, DissonanceNetworkMessage msg) { if (Logs.GetLogLevel(LogCategory.Network) <= LogLevel.Trace) { Debug.Log("Discarding Dissonance network message"); } msg.Dispose(); }
private void OnMessageReceived(NetworkConnection source, DissonanceNetworkMessage msg) { using (msg) NetworkReceivedPacket(msg.Data); }