public void OnEvent(ShPlayer player, string message) { if (chatted.Limit(player)) { return; } if (player.GetExtendedPlayer().Muted) { player.TS("muted_player"); return; } if (CommandHandler.OnEvent(player, message)) // 'true' if message starts with command prefix { return; } Core.Instance.Logger.LogInfo($"[GLOBAL] {player.username}: {message}"); switch (player.GetExtendedPlayer().CurrentChat) { case Chat.StaffChat: ChatUtils.SendStaffChatMessage(player, message); return; case Chat.Disabled: player.TS("chat_disabled"); return; default: ChatUtils.SendToAllEnabledChat(ChatUtils.FormatMessage(player, message), false); return; } }
public void OnEvent(ShPlayer player, string message) { if (chatted.Limit(player)) { return; } Core.Instance.Logger.LogInfo($"[LOCAL] {player.username.CleanerMessage()}: {message.CleanerMessage()}"); if (CommandHandler.OnEvent(player, message)) // 'true' if message starts with command prefix { return; } if (Core.Instance.Settings.General.LocalChatOverHead) { player.svPlayer.Send(SvSendType.LocalOthers, Channel.Unsequenced, ClPacket.LocalChatMessage, player.ID, message.CleanerMessage()); } if (Core.Instance.Settings.General.LocalChatInChat) { player.svPlayer.Send(SvSendType.LocalOthers, Channel.Unsequenced, ClPacket.GameMessage, ChatUtils.FormatMessage(player, message, "localformat")); } }