mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
@@ -60,6 +60,7 @@ namespace ConfigGenerator {
|
||||
string botName = Path.GetFileNameWithoutExtension(configFile);
|
||||
switch (botName) {
|
||||
case Program.ASF:
|
||||
case "Main":
|
||||
case "example":
|
||||
case "minimal":
|
||||
continue;
|
||||
@@ -155,6 +156,20 @@ namespace ConfigGenerator {
|
||||
// Get rid of any potential whitespaces in bot name
|
||||
input = Regex.Replace(input, @"\s+", "");
|
||||
|
||||
if (string.IsNullOrEmpty(input)) {
|
||||
Logging.LogGenericErrorWithoutStacktrace("Your bot name is empty!");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (input) {
|
||||
case Program.ASF:
|
||||
case "Main":
|
||||
case "example":
|
||||
case "minimal":
|
||||
Logging.LogGenericErrorWithoutStacktrace("This name is reserved!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ASFConfig.ASFConfigs.Select(config => Path.GetFileNameWithoutExtension(config.FilePath)).Any(fileNameWithoutExtension => (fileNameWithoutExtension == null) || fileNameWithoutExtension.Equals(input))) {
|
||||
Logging.LogGenericErrorWithoutStacktrace("Bot with such name exists already!");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user