Example #1
0
        private void LoadCommandWordsFromDatabase(int accesslevel)
        {
            DataTable dt = Lib.dbService.ThreadManager.GetAllCommands(accesslevel);

            foreach (DataRow row in dt.Rows)
            {
                ICommand command = Lib.GetCommandByName(row[0].ToString());

                if (command != null)
                {
                    switch (accesslevel)
                    {
                    case (int)AccessLevel.System:
                        Lib.AddCommandWord(Lib.SystemCommandWords, command);
                        break;

                    case (int)AccessLevel.Player:
                        Lib.AddCommandWord(Lib.PlayerCommandWords, command);
                        break;

                    case (int)AccessLevel.Builder:
                        Lib.AddCommandWord(Lib.BuilderCommandWords, command);
                        break;

                    case (int)AccessLevel.Admin:
                        Lib.AddCommandWord(Lib.AdminCommandWords, command);
                        break;

                    case (int)AccessLevel.UberAdmin:
                        Lib.AddCommandWord(Lib.UberAdminCommandWords, command);
                        break;
                    }
                }
            }
        }