Add password length and non-ascii character warning

Fixes #601
This commit is contained in:
Pavel Djundik
2025-03-12 11:34:42 +02:00
parent be3682cd4b
commit 2682d44684

View File

@@ -356,6 +356,21 @@ namespace DepotDownloader
}
}
if (!string.IsNullOrEmpty(password))
{
const int MAX_PASSWORD_SIZE = 64;
if (password.Length >= MAX_PASSWORD_SIZE)
{
Console.Error.WriteLine($"Warning: Password is longer than {MAX_PASSWORD_SIZE} characters, which is not supported by Steam.");
}
if (!password.All(char.IsAscii))
{
Console.Error.WriteLine("Warning: Password contains non-ASCII characters, which is not supported by Steam.");
}
}
return ContentDownloader.InitializeSteam3(username, password);
}