Ejemplo n.º 1
0
        /// <summary>
        /// Player continues in his rule violation report
        /// </summary>
        /// <param name="player"></param>
        /// <param name="message"></param>
        public static void PlayerContinueRuleViolationReport(Player player, string message)
        {
            Violation violation = getPlayerRuleViolationReport(player);

            if (violation != null)
            {
                if (violation.Gamemaster != null)
                {
                    violation.Gamemaster.Connection.SendCreatureSay(player, TalkType.RuleViolationContinue, message);
                    player.Connection.SendTextMessage((byte)MessageType.StatusSmall, "Message sent to Gamemaster.");
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Close a player rule violation
        /// </summary>
        /// <param name="player"></param>
        public static void PlayerCloseRuleViolation(Player player)
        {
            Violation violation = getPlayerRuleViolationReport(player);

            if (violation != null)
            {
                player.Connection.SendLockRuleViolationReport();
                Channel ruleViolationChannel = Channels.getChannelById(ChannelID.RuleViolations);
                if (violation.IsOpen && ruleViolationChannel != null)
                {
                    foreach (Player viewer in ruleViolationChannel.ActiveViewers)
                    {
                        viewer.Connection.SendRuleViolationReportRemoval(player.Name);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gamemaster processes a rule violation report
        /// </summary>
        /// <param name="gamemaster"></param>
        /// <param name="owner"></param>
        public static void PlayerProcessRuleViolation(Player gamemaster, Player owner)
        {
            Violation violation = getPlayerRuleViolationReport(owner);

            if (violation != null)
            {
                violation.Gamemaster = gamemaster;
                violation.IsOpen     = false;
                Channel ruleViolationChannel = Channels.getChannelById(ChannelID.RuleViolations);
                if (ruleViolationChannel != null)
                {
                    foreach (Player viewer in ruleViolationChannel.ActiveViewers)
                    {
                        viewer.Connection.SendRuleViolationReportRemoval(owner.Name);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Player closes a rule violation report
        /// </summary>
        /// <param name="player"></param>
        public static void CloseRuleViolationReport(Player player)
        {
            Violation violation = getPlayerRuleViolationReport(player);

            if (violation != null)
            {
                rule_violations.Remove(violation);
                player.Connection.SendLockRuleViolationReport();
                Channel channel = Channels.getChannelById(ChannelID.RuleViolations);
                if (channel != null)
                {
                    foreach (Player viewer in channel.ActiveViewers)
                    {
                        viewer.Connection.SendRuleViolationReportRemoval(player.Name);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Player reports a rule violation with Ctrl + R
        /// </summary>
        /// <param name="player"></param>
        /// <param name="Message"></param>
        public static void PlayerReportRuleViolation(Player player, string message)
        {
            CancelPlayerRuleViolation(player);

            Violation violation = new Violation();

            violation.Player  = player;
            violation.Message = message;
            violation.Time    = 0;
            violation.IsOpen  = true;

            rule_violations.Add(violation);

            Channel ruleViolationChannel = Channels.getChannelById(ChannelID.RuleViolations);

            if (ruleViolationChannel != null)
            {
                foreach (Player viewer in ruleViolationChannel.ActiveViewers)
                {
                    viewer.Connection.SendMessageToChannel(player, TalkType.RuleViolationChannel, message, (short)ChannelID.RuleViolations, violation.Time);
                }
            }
        }