using LiteNetLib; using MessagePack; namespace GameCult.Networking { /// /// Adds MessagePack-based send helpers for . /// public static class NetPeerExtensions { /// /// Serializes and sends a message using reliable ordered delivery. /// /// The concrete message type. /// The peer to send through. /// The message to serialize and send. public static void Send(this NetPeer peer, T message) where T : Message { peer.Send(MessageSerialization.Serialize(message), DeliveryMethod.ReliableOrdered); } } }