internal static void SendPrivateMessage(Chat.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); }
private void Chat_AddMessage_ChatMessageBase(On.RoR2.Chat.orig_AddMessage_ChatMessageBase orig, Chat.ChatMessageBase message) { if (message.GetType() == typeof(Chat.UserChatMessage)) { var userMessage = (Chat.UserChatMessage)message; var text = userMessage.text; client.SendMessage(channelName ?? username, text); } orig(message); }