From 2682d44684fc2df0e48ce17df7a25ee367f85f82 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 12 Mar 2025 11:34:42 +0200 Subject: [PATCH] Add password length and non-ascii character warning Fixes #601 --- DepotDownloader/Program.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index edbf011d..81c0b824 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -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); }