Esempio n. 1
0
        public void OnCommand(GameClient client, string[] args)
        {
			if (IsSpammingCommand(client.Player, "appeal"))
				return;

			if (ServerProperties.Properties.DISABLE_APPEALSYSTEM)
            {
                AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.SystemDisabled"));
                return;
            }

			if (client.Player.IsMuted)
			{
				return;
			}

            //Help display
            if (args.Length == 1)
            {
                DisplaySyntax(client);
                if (client.Account.PrivLevel > (uint)ePrivLevel.Player)
                {
                    AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.UseGMappeal"));
                }
            }

            //Support for EU Clients

            if (args.Length == 2 && args[1].ToLower() == "cancel")
            {
                CheckAppealCommandHandler cch = new CheckAppealCommandHandler();
                cch.OnCommand(client, args);
                return;
            }

            if (args.Length > 1)
            {
                bool HasPendingAppeal = client.Player.TempProperties.getProperty<bool>("HasPendingAppeal");
                if (HasPendingAppeal)
                {
                    AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.AlreadyActiveAppeal", client.Player.Name));
                    return;
                }
                if (args.Length < 5)
                {
                    AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.NeedMoreDetail"));
                    return;
                }
                int severity = 0;
                switch (args[1].ToLower())
                {
                    case "harassment":
                        {
                            severity = (int)AppealMgr.eSeverity.High;
                            args[1] = "";
                            break;
                        }
                    case "naming":
                        {
                            severity = (int)AppealMgr.eSeverity.Low;
                            args[1] = "";
                            break;
                        }
                    case "other":
                    case "conduct":
                        {
                            severity = (int)AppealMgr.eSeverity.Medium;
                            args[1] = "";
                            break;
                        }
                    case "stuck":
                    case "emergency":
                        {
                            severity = (int)AppealMgr.eSeverity.Critical;
                            args[1] = "";
                            break;
                        }
                    default:
                        {
                            severity = (int)AppealMgr.eSeverity.Medium;
                            break;
                        }

                }
                string message = string.Join(" ", args, 1, args.Length - 1);
                GamePlayer p = client.Player as GamePlayer;
                AppealMgr.CreateAppeal(p, severity, "Open", message);
                return;
            }
            return;
        }
Esempio n. 2
0
        public void OnCommand(GameClient client, string[] args)
        {
            if (IsSpammingCommand(client.Player, "appeal"))
            {
                return;
            }

            if (ServerProperties.Properties.DISABLE_APPEALSYSTEM)
            {
                AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.SystemDisabled"));
                return;
            }

            if (client.Player.IsMuted)
            {
                return;
            }

            //Help display
            if (args.Length == 1)
            {
                DisplaySyntax(client);
                if (client.Account.PrivLevel > (uint)ePrivLevel.Player)
                {
                    AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.UseGMappeal"));
                }
            }

            //Support for EU Clients

            if (args.Length == 2 && args[1].ToLower() == "cancel")
            {
                CheckAppealCommandHandler cch = new CheckAppealCommandHandler();
                cch.OnCommand(client, args);
                return;
            }

            if (args.Length > 1)
            {
                bool HasPendingAppeal = client.Player.TempProperties.getProperty <bool>("HasPendingAppeal");
                if (HasPendingAppeal)
                {
                    AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.AlreadyActiveAppeal", client.Player.Name));
                    return;
                }
                if (args.Length < 5)
                {
                    AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.NeedMoreDetail"));
                    return;
                }
                int severity = 0;
                switch (args[1].ToLower())
                {
                case "harassment":
                {
                    severity = (int)AppealMgr.eSeverity.High;
                    args[1]  = "";
                    break;
                }

                case "naming":
                {
                    severity = (int)AppealMgr.eSeverity.Low;
                    args[1]  = "";
                    break;
                }

                case "other":
                case "conduct":
                {
                    severity = (int)AppealMgr.eSeverity.Medium;
                    args[1]  = "";
                    break;
                }

                case "stuck":
                case "emergency":
                {
                    severity = (int)AppealMgr.eSeverity.Critical;
                    args[1]  = "";
                    break;
                }

                default:
                {
                    severity = (int)AppealMgr.eSeverity.Medium;
                    break;
                }
                }
                string     message = string.Join(" ", args, 1, args.Length - 1);
                GamePlayer p       = client.Player as GamePlayer;
                AppealMgr.CreateAppeal(p, severity, "Open", message);
                return;
            }
            return;
        }