* Add warnings about password security
* Warn about weak steam passwords even if they are encrypted
* Apply feedback
* Apply feedback
* Simplify code
* Move return criteria up a bit for increased performance
* Choose more fitting strings for localization
* Extract const value
* Fix incorrect null reference warning
* Switch prefix operator for postfix one
Co-authored-by: Łukasz Domeradzki <JustArchi@JustArchi.net>
* Add tests
* Disable CA1724
The type name Utilities conflicts in whole or in part with the namespace name 'Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities'.
* Tell users why their password is considered weak
* Apply feedback
* Merge resource comments
* Misc.
* Use library for password testing and Run testing in background
* Clean up
* OncSeparate forbidden phrases forfor IPC passwords (once again)
* Additionally check encryption key
* Add comment about {0}
Co-authored-by: Łukasz Domeradzki <JustArchi@JustArchi.net>
* Rewrite SendMessage() functions to account for new rate-limits
* Refactor new message splitting logic into SteamChatMessage.cs
This makes it ready for unit tests
* Change the concept into UTF8-oriented logic
* Misc
* Add fix for another unit test
* Update
* Fix failing test
I SPENT HOURS ON THIS
* Misc
* Misc
* Add additional unit tests ensuring this works as designed
* Misc
* Misc
* Add one more unit test
* Rework the logic to account for new findings
* Misc
* Add unit test verifying exception on too long prefix
* Address first @Abrynos concern
Because we can
* Throw also on too long prefix in regards to newlines
* Correct wrong bytesRead calculation
This worked previously only because we actually never had enough of room for escaped chars anyway and skipped over (2 + 2 missing bytes was smaller than 5 required to make a line)
* Add unit test verifying if calculation was done properly
* Address @Ryzhehvost concern
* Handle empty newlines in the message properly
* Misc
No reason to even calculate utf8 bytes for empty lines
* Misc
* Add unit test verifying the reserved escape message bytes count
* Correct calculation of lines by taking into account \r
* Update ArchiSteamFarm/Steam/Bot.cs
Co-authored-by: Sebastian Göls <6608231+Abrynos@users.noreply.github.com>
* @Abrynos next time check if it compiles without warnings
* Update SteamChatMessage.cs
* Apply @Abrynos idea in a different way
* Rewrite bot part to remove unnecessary delegate
* Add @Ryzhehvost test
* Add debug output
* Extend @Ryzhehvost test for prefix
* Misc
* Misc refactor
* Misc
* Misc
* Add logic for limited accounts, correct for unlimited
Thanks @Ryzhehvost
* Misc
Co-authored-by: Sebastian Göls <6608231+Abrynos@users.noreply.github.com>
ASF is already smart enough to not >use< a login key when it's not needed, but the sole fact of asking for it might screw up Valve's backend and in result cause issues for the client, totally for no reason, as we're not going to use it anyway.
The original idea was to keep it around "just in case" if the user removed his password or 2FA, but that is completely moot the moment we realize the alone fact of that bool property being set can cause the problems.
Login keys should only be used if both:
a) User left it enabled in the config
b) We can't guarantee all the details during login procedure, that is mainly a missing password in the config and/or lack of ASF 2FA. We're not going to enhance the logic for completely insecure accounts as they should opt into SteamGuard or 2FA ASAP, making the login key needed.
Also fix setter visibility for BotConfig while at it, if plugins want to set those properties themselves, they have Bot.SetUserInput() function instead.