public void AddLocalMessage(string text) { ChatMessageEventArgs args = new ChatMessageEventArgs(text, null); if (RecordMessages) { ChatMessages.Add(args); } MessageReceived?.Invoke(this, args); }
private void OnMessageReceived(object sender, ChatMessageEventArgs e) { if (e.MessageSender == null) // local message { ShowMessage(e.Message); } else { ShowMessage(e.MessageSender.NickName + ": " + e.Message); } }
private async void ChatMessageReceived(short textId, PhotonMessageInfo messageInfo) { string text = await NetworkedStringManager.GetString(textId); ChatMessageEventArgs args = new ChatMessageEventArgs(text, messageInfo.Sender); if (RecordMessages) { ChatMessages.Add(args); } MessageReceived?.Invoke(this, args); }