示例#1
0
        public void AddCharacter(CharacterSheet sheet, bool overrideExisting, bool saveImmediatly = false)
        {
            // Check for duplicate sheets
            if (!characterSheets.Contains(sheet))
            {
                // Check if a sheet with two of the same character names exist. If the override
                // is true, remove the old one. If not set then we abort.
                CharacterSheet oldSheet = null;
                foreach (CharacterSheet characterSheet in characterSheets)
                {
                    if (characterSheet.Name == sheet.Name)
                    {
                        if (overrideExisting == false)
                        {
                            return;
                        }

                        oldSheet = characterSheet;
                    }
                }

                if (oldSheet != null)
                {
                    characterSheets.Remove(oldSheet);
                }
                characterSheets.Add(sheet);

                if (saveImmediatly)
                {
                    InfoExportClass.ExportCharacterSheet(sheet, overrideExisting);
                }

                Console.WriteLine("Added new character to library");
            }
        }
示例#2
0
        public async Task ExportAbilityLibrary()
        {
            if (BotInfo.UsewhiteList && !BotInfo.Permissions.IsUserInWhiteList(Context.User.ToString()))
            {
                if (BotInfo.UseblackListCaughtUsers && !BotInfo.Permissions.IsUserInBlackList(Context.User.ToString()))
                {
                    await Log("The user " + Context.User.ToString() + " attempted to export the ability library!", LogSeverity.Critical);

                    BotInfo.Permissions.AddUserToBlacklist(Context.User.ToString());
                    return;
                }
            }

            InfoExportClass.ExportAbilityLibrary();
            await Log("The user " + Context.User.ToString() + " has exported the AbilityLibrary");
            await ReplyAsync("The AbilityLibrary has been exported.");
        }
示例#3
0
        public async Task DumpLogs()
        {
            if (BotInfo.UsewhiteList && !BotInfo.Permissions.IsUserInWhiteList(Context.User.ToString()))
            {
                if (BotInfo.UseblackListCaughtUsers && !BotInfo.Permissions.IsUserInBlackList(Context.User.ToString()))
                {
                    await Log("The user " + Context.User.ToString() + " attempted to use the command AnnoyDeath", LogSeverity.Critical);

                    BotInfo.Permissions.AddUserToBlacklist(Context.User.ToString());
                    return;
                }
            }

            await Log(Context.User.ToString() + " is dumping logs", LogSeverity.Debug);
            await ReplyAsync("Dumped Logs");
            await Log("Log has been dumped to " + Directory.GetCurrentDirectory() + "Logs\\LogDump.txt");

            InfoExportClass.DumpLogOutput();
        }
示例#4
0
 public async Task ExportBlacklist()
 {
     InfoExportClass.ExportBlacklist();
     await ReplyAsync("Exported blacklist!");
     await Log(Context.User.ToString() + " export the blacklist.");
 }
示例#5
0
 public async Task ExportWhitelist()
 {
     InfoExportClass.ExportWhiteList();
     await ReplyAsync("Exported whitelist!");
     await Log(Context.User.ToString() + " export the whitelist.");
 }