Table of Contents
Utility functions used for sending messages over the network.
public class MessageUtils
Inheritance System.Object MessageUtils
Old way to send a message
public static Message CreateMessage<T>(T objectToSend, string code="")
where T : Object;
T
objectToSend
T
code
System.String
Il2CppNinjaKiwi.NKMulti.Message
Creates a message to be sent over the network.
The message will be serialized as JSON.
public static Message CreateMessageEx<T>(T objectToSend, string code="");
T
objectToSend
T
The object to be sent. The object's properties will be serialized.
code
System.String
Unique code for your specific message.
Il2CppNinjaKiwi.NKMulti.Message
Reads a message sent from the network.
Assumes message is sent as JSON. (via CreateMessageEx<T>(T, string))
public static T ReadMessage<T>(Il2CppStructArray<byte> serializedMessage);
T
serializedMessage
Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppStructArray
Raw bytes received from the network.
Reads a message sent from the network.
Assumes message is sent as JSON. (via CreateMessageEx<T>(T, string))
public static T ReadMessage<T>(Message message);
T
message
Il2CppNinjaKiwi.NKMulti.Message
Message received from the network.