private static void SendChatMessage(CommandEventArgs e) { var msg = "[" + e.Mobile.Name + "]: " + e.ArgString; var hue = Hue; if (e.Mobile.AccessLevel > AccessLevel.Player) { hue = GMHue; } if (!(e.Mobile as MythikPlayerMobile).ChatEnabled) { e.Mobile.SendAsciiMessage("Enable Chat with .chaton"); return; } Packet p = new AsciiMessage(Serial.MinusOne, -1, MessageType.Regular, hue, 3, "System", msg); List <NetState> list = NetState.Instances; p.Acquire(); for (int i = 0; i < list.Count; ++i) { if (list[i].Mobile != null && ((MythikPlayerMobile)list[i].Mobile).ChatEnabled) { list[i].Send(p); } } p.Release(); NetState.FlushAll(); ChatMessageSent?.Invoke(msg, new EventArgs()); }
internal void OnChatMessageSent(ChatMessage message) => ChatMessageSent?.Invoke(this, new ChatMessageEventArgs(message));