Пример #1
0
 public UserAction(string description, UserActionCommands command, string[] cmdWords, params UserActionArgument[] args)
 {
     this.mDescription = Loc.Get(description);
     this.mCommand = command;
     this.mCommandWords = cmdWords;
     this.mArgs = args;
     this.mAdminCommand = false;
 }
Пример #2
0
 private void ProcessUserAction(UserActionCommands action, string[] args)
 {
     try
     {
         this.SystemMessage("<LOC>Unknown command; some chat commands are not enabled in private messages.", new object[0]);
     }
     catch (Exception exception)
     {
         ErrorLog.WriteLine(exception);
     }
 }
Пример #3
0
        internal void ProcessUserAction(UserActionCommands action, string[] args)
        {
            Exception exception;
            try
            {
                string str;
                int num;
                string str2;
                string str3;
                string str4;
                string str5;
                string[] strArray;
                int num2;
                switch (action)
                {
                    case UserActionCommands.DoNotDisturb:
                        this.ToggleDNDStatus();
                        return;

                    case UserActionCommands.Away:
                        this.SetAwayStatus(true);
                        return;

                    case UserActionCommands.Friend:
                        this.InviteAsFriend(args[0]);
                        return;

                    case UserActionCommands.Unfriend:
                        this.RemoveFriend(args[0]);
                        return;

                    case UserActionCommands.Whisper:
                        str = "";
                        num = 1;
                        goto Label_00FB;

                    case UserActionCommands.Kick:
                        this.OnSendKick(args[0]);
                        return;

                    case UserActionCommands.Ban:
                        this.BanUser(args[0]);
                        return;

                    case UserActionCommands.Chatroom:
                        str2 = "";
                        num = 0;
                        goto Label_014D;

                    case UserActionCommands.ViewPlayer:
                        this.OnViewPlayerProfile(args[0]);
                        return;

                    case UserActionCommands.ClanInvite:
                        this.InviteToClan(args[0]);
                        return;

                    case UserActionCommands.ClanRequest:
                        this.RequestClanInvite(args[0]);
                        return;

                    case UserActionCommands.LeaveClan:
                        this.OnLeaveClan();
                        return;

                    case UserActionCommands.CreateClan:
                        this.OnCreateClan();
                        return;

                    case UserActionCommands.ViewClan:
                        this.OnViewClanProfileByPlayer(args[0]);
                        return;

                    case UserActionCommands.ClanPromote:
                        this.PromoteClanMember(args[0]);
                        return;

                    case UserActionCommands.ClanDemote:
                        this.DemoteClanMember(args[0]);
                        return;

                    case UserActionCommands.ClanRemove:
                        this.RemoveClanMember(args[0]);
                        return;

                    case UserActionCommands.Chicken:
                        if (args.Length != 0)
                        {
                            goto Label_0395;
                        }
                        ChatEffects.Current = ChatEffects.Chicken;
                        this.SystemMessage("You are now a chicken.", new object[0]);
                        Messaging.SendCustomCommand(CustomCommands.SetStatus, new object[] { UserStatus.Chicken.Name });
                        return;

                    case UserActionCommands.Canadian:
                        if (args.Length != 0)
                        {
                            goto Label_02E6;
                        }
                        ChatEffects.Current = ChatEffects.Canadian;
                        this.SystemMessage("You are now a Canadian (if you weren't already).", new object[0]);
                        Messaging.SendCustomCommand(CustomCommands.SetStatus, new object[] { UserStatus.Canadian.Name });
                        return;

                    case UserActionCommands.Exit:
                        this.ExitApplication();
                        return;

                    case UserActionCommands.Unban:
                        this.UnbanUser(args[0]);
                        return;

                    case UserActionCommands.Ignore:
                        this.IgnorePlayer(args[0]);
                        return;

                    case UserActionCommands.Unignore:
                        this.UnignorePlayer(args[0]);
                        return;

                    case UserActionCommands.Emote:
                        str = "";
                        strArray = args;
                        num2 = 0;
                        goto Label_042C;

                    case UserActionCommands.Stats:
                        if (User.Current.IsAdmin)
                        {
                            this.SystemMessage("*** STATISTICS DUMP ***", new object[0]);
                            ArrayList logData = DataAccess.GetLogData();
                            foreach (object obj2 in logData)
                            {
                                this.SystemMessage(obj2.ToString(), new object[0]);
                            }
                            this.SystemMessage("*** STATISTICS DUMP ***", new object[0]);
                            this.SystemMessage("DB Calls: " + logData.Count.ToString(), new object[0]);
                            this.SystemMessage("*** STATISTICS DUMP ***", new object[0]);
                        }
                        return;

                    case UserActionCommands.Translate:
                        if (!User.Current.IsAdmin)
                        {
                            return;
                        }
                        str4 = args[0];
                        str5 = "";
                        num = 1;
                        goto Label_0562;

                    case UserActionCommands.Locate:
                        if ((args != null) && (args.Length > 0))
                        {
                            this.LocatePlayer(args[0]);
                        }
                        return;

                    case UserActionCommands.TagTranslate:
                        Messaging.AutoTranslate(args[0], args[1]);
                        return;

                    case UserActionCommands.IgnoreDirectChallenge:
                        this.ToggleDirectChallenge();
                        return;

                    case UserActionCommands.AllowFriends:
                        this.ToggleAllowFriends();
                        return;

                    case UserActionCommands.IPBan:
                        DataAccess.ExecuteQuery("IP Ban", new object[] { args[0] });
                        this.SystemMessage("Address " + args[0] + " has been banned.", new object[0]);
                        return;

                    case UserActionCommands.IPLookup:
                        this.SystemMessage("Here is the IP address and account list for player " + args[0] + ".", new object[0]);
                        try
                        {
                            foreach (DataRecord record in DataAccess.GetQueryData("IP Player Lookup", new object[] { args[0] }))
                            {
                                this.SystemMessage(record[0] + " " + record[1], new object[0]);
                            }
                        }
                        catch (Exception exception1)
                        {
                            exception = exception1;
                            ErrorLog.WriteLine(exception);
                        }
                        return;

                    case UserActionCommands.IPBanCheck:
                        this.SystemMessage("Here is the current ban list.", new object[0]);
                        try
                        {
                            foreach (DataRecord record in DataAccess.GetQueryData("IP Banned List", new object[0]))
                            {
                                this.SystemMessage(record[0], new object[0]);
                            }
                        }
                        catch (Exception exception2)
                        {
                            exception = exception2;
                            ErrorLog.WriteLine(exception);
                        }
                        return;

                    case UserActionCommands.IPUnBan:
                        DataAccess.ExecuteQuery("IP UnBan", new object[] { args[0] });
                        this.SystemMessage("Address " + args[0] + " has been unbanned.", new object[0]);
                        return;

                    default:
                        goto Label_0771;
                }
            Label_00E6:
                str = str + args[num] + " ";
                num++;
            Label_00FB:
                if (num < args.Length)
                {
                    goto Label_00E6;
                }
                str = str.TrimEnd(" ".ToCharArray());
                this.OnSendWhisper(args[0], str);
                return;
            Label_0133:
                str2 = str2 + string.Format("{0} ", args[num]);
                num++;
            Label_014D:
                if (num < args.Length)
                {
                    goto Label_0133;
                }
                str2 = str2.TrimEnd(new char[] { ' ' });
                if ((str2 == null) || (str2.Trim().Length < 1))
                {
                    this.ShowDlgSelectChannel();
                }
                else
                {
                    this.CreateChannelIfNonExist(str2);
                }
                return;
            Label_02E6:
                if (User.Current.IsAdmin)
                {
                    Messaging.SendCustomCommand(args[0], CustomCommands.SetChatEffect, new object[] { ChatEffects.Canadian.Name });
                }
                else
                {
                    this.ErrorMessage(">You do not have permission to make {0} Canadian.", new object[] { args[0] });
                }
                return;
            Label_0395:
                if (User.Current.IsAdmin)
                {
                    Messaging.SendCustomCommand(args[0], CustomCommands.SetChatEffect, new object[] { ChatEffects.Chicken.Name });
                }
                else
                {
                    this.ErrorMessage("You do not have permission to make {0} a chicken.", new object[] { args[0] });
                }
                return;
            Label_0411:
                str3 = strArray[num2];
                str = str + str3 + " ";
                num2++;
            Label_042C:
                if (num2 < strArray.Length)
                {
                    goto Label_0411;
                }
                this.EmoteMessageRoom(str.Trim());
                return;
            Label_054B:
                str5 = str5 + args[num] + " ";
                num++;
            Label_0562:
                if (num < args.Length)
                {
                    goto Label_054B;
                }
                string msg = TranslateUtil.GetTranslatedText(str5, str4, "en");
                this.SendMessage(msg);
                return;
            Label_0771:
                this.SystemMessage("<LOC>Unknown Command.", new object[0]);
            }
            catch (Exception exception3)
            {
                exception = exception3;
                ErrorLog.WriteLine(exception);
            }
        }
Пример #4
0
 public static UserAction AdminAction(string description, UserActionCommands command, string[] cmdWords, params UserActionArgument[] args)
 {
     UserAction action = new UserAction(description, command, cmdWords, args);
     action.mAdminCommand = true;
     return action;
 }