//MuteAction public static void ProcessAction(Client client, Player player, MuteAction action) { var target = DbInterface.GetPlayer(action.Name); if (target != null) { if (string.IsNullOrEmpty(Mute.FindMuteReason(target.UserId, ""))) { if (action.BanIp == true) { Mute.Add( target.User, action.DurationDays, action.Reason, player.Name, target.Client?.GetIp() ?? "" ); } else { Mute.Add(target.User, action.DurationDays, action.Reason, player.Name, ""); } PacketSender.SendChatMsg(player, Strings.Account.muted.ToString(target.Name), Color.Red); } else { PacketSender.SendChatMsg(player, Strings.Account.alreadymuted.ToString(target.Name), Color.Red); } } else { PacketSender.SendChatMsg(player, Strings.Player.offline); } }
public MuteOption(MuteAction mute, MuteAction unMute, Text text, int x, int y, int w, int h) : base(x, y, w, h) { this.mute = mute; this.unMute = unMute; this.text = text; imagePosition = new Vector2(rect.x, y); Initialize(); }
public SoundOption(string labelText, int index, MuteAction mute, MuteAction unMute) { int xPos = 200; int yPos = 100 * index; int width = 300; int height = 7; int fontSize = 25; trackBar = new TrackBar(xPos, yPos, width, height, Color.ORANGE, Color.MAGENTA); label = new Text(xPos - 10 - MeasureText(labelText, fontSize), yPos - fontSize / 2, fontSize, labelText, Color.RAYWHITE); var muteText = new Text(xPos + width + 25, yPos - 45, fontSize, "Mute?", Color.RAYWHITE); muteOption = new MuteOption(mute, unMute, muteText, xPos + width + 50, yPos - 20, 50, 50); }