// This method intercepts a server side event handler then activates the original, nothing is lost // if IRSE were to bug out, it will probally kill all chat on the game // protected void OnPacketChatMessage(RPCData data) { m_delegate.Invoke(data); try { Player player = ServerInstance.Instance.Handlers .PlayerHandler.Players.GetPlayerByConnectionId((long)data.OriginalMessage.SenderConnectionId); string name = player.Name; ClientChatMessage obj = (ClientChatMessage)data.DeserializedObject; ChatMessages.Add(new ChatMessage(player.Name, obj.message, player.ID)); string formatted = String.Format("[All]{0}({1}): {2}", player.Name, player.ID, obj.message); //if (obj.channel == "All" || obj.channel == "System") { mainLog.Info(formatted); Program.GUI.AddChatLine(formatted); //} } catch (Exception ex) { mainLog.Error(ex.ToString()); } }
protected override void InternalParse() { var type = ClientChatMessage.GetTypeByOpcode((WowOpcodes)this.Packet.Opcode); var message = Activator.CreateInstance(type) as ClientChatMessage; message.Read(this.Reader); message.ToString(this.Output); }
public ChatMessageWidget(ClientChatMessage message) : this(message.MessageId, message.SenderUuid, message.Message, message.Timestamp, message.Status) { }
public bool TryGetMessage(string messageId, out ClientChatMessage message) => chat.TryGetMessage(messageId, out message);