void SendChatMessage(string msg) { //No point of sending if you have nothing to send if (msg.Length == 0) { return; } if (msg.Length > MaxChatMessageLength) { msg.Remove(MaxChatMessageLength); } string textToSend = MultiplayerManager.instance.MyNetworkPlayer.Name + ": " + msg; MessageSendChatMessage messageSendChat = new MessageSendChatMessage(); messageSendChat.chatMessage = textToSend; MultiplayerManager.instance.SendNetworkMessage(messageSendChat, SendTo.All); }
void SendChatMessage(string msg) { //No point of sending if you have nothing to send if (msg.Length == 0) return; if (msg.Length > MaxChatMessageLength) msg.Remove(MaxChatMessageLength); string textToSend = MultiplayerManager.instance.MyNetworkPlayer.Name + ": " + msg; MessageSendChatMessage messageSendChat = new MessageSendChatMessage(); messageSendChat.chatMessage = textToSend; MultiplayerManager.instance.SendNetworkMessage(messageSendChat, SendTo.All); }
public override void OnCalled(Message msg, NetIncomingMessage netMsg = null) { MessageSendChatMessage message = msg as MessageSendChatMessage; MultiplayerManager.instance.Chat.OnReceiveChatMessage(message.chatMessage); }