/// <summary> /// Sends a ChatMessage directly to a connection. Checkout RoR2.Chat for possible chatmessage types. /// </summary> /// <param name="message">The message to send</param> /// <param name="connection">The network connection to send to.</param> public static void SendDirectMessage(ChatMessageBase message, NetworkConnection?connection) { NetworkWriter writer = new NetworkWriter(); writer.StartMessage((short)59); writer.Write(message.GetTypeIndex()); writer.Write((MessageBase)message); writer.FinishMessage(); connection.SendWriter(writer, RoR2.Networking.QosChannelIndex.chat.intVal); }
public static void SendPM(NetworkConnection conn, ChatMessageBase message) { NetworkWriter networkWriter = new NetworkWriter(); networkWriter.StartMessage(59); networkWriter.Write(message.GetTypeIndex()); networkWriter.Write(message); networkWriter.FinishMessage(); conn.SendWriter(networkWriter, QosChannelIndex.chat.intVal); }