Misc optimization of #554 + missing case for bots initialization

This commit is contained in:
JustArchi
2017-05-17 02:09:42 +02:00
parent 888078bb44
commit 45b974fb05

View File

@@ -219,7 +219,7 @@ namespace ArchiSteamFarm {
// Before attempting to connect, initialize our list of CMs
await Bot.InitializeCMs(Program.GlobalDatabase.CellID, Program.GlobalDatabase.ServerListProvider).ConfigureAwait(false);
foreach (string botName in Directory.EnumerateFiles(SharedInfo.ConfigDirectory, "*.json").Select(Path.GetFileNameWithoutExtension)) {
foreach (string botName in Directory.EnumerateFiles(SharedInfo.ConfigDirectory, "*.json").Select(Path.GetFileNameWithoutExtension).Where(botName => !string.IsNullOrEmpty(botName) && (botName[0] != '.'))) {
switch (botName) {
case SharedInfo.ASF:
case "example":
@@ -279,7 +279,7 @@ namespace ArchiSteamFarm {
}
string botName = Path.GetFileNameWithoutExtension(e.Name);
if (string.IsNullOrEmpty(botName) || botName.StartsWith(".")) {
if (string.IsNullOrEmpty(botName) || (botName[0] == '.')) {
return;
}
@@ -329,7 +329,7 @@ namespace ArchiSteamFarm {
}
string botName = Path.GetFileNameWithoutExtension(e.Name);
if (string.IsNullOrEmpty(botName) || botName.StartsWith(".")) {
if (string.IsNullOrEmpty(botName) || (botName[0] == '.')) {
return;
}
@@ -393,7 +393,7 @@ namespace ArchiSteamFarm {
}
string newBotName = Path.GetFileNameWithoutExtension(e.Name);
if (string.IsNullOrEmpty(newBotName) || newBotName.StartsWith(".")) {
if (string.IsNullOrEmpty(newBotName) || (newBotName[0] == '.')) {
return;
}