Commit Graph

55 Commits

Author SHA1 Message Date
Archi
40ab1d848c .NET 8 code enhancements 2023-12-11 23:55:13 +01:00
Archi
f2ff2f4929 Closes #3060 2023-11-14 20:01:29 +01:00
Łukasz Domeradzki
b34f18497d .NET 8 (#3005)
* Initial .NET 8

* Make it compile in release mode ignoring warnings for now

* First round of improvements

* Second round of improvements

* Third round of improvements

* Use new throws

* Fix .NET Framework, YAY, thanks madness!

Madness devs are awesome

* Misc

* Misc

* AF_NETLINK might be required for some http calls

No clue why

* Fix service files

Doesn't do what it should

* Update CardsFarmer.cs

* New improvements

* Address feedback

* Misc

* Misc

* Misc refactor

* Misc
2023-11-14 19:12:33 +01:00
Archi
3a9e9de596 Closes #2980 2023-11-05 23:22:15 +01:00
Łukasz Domeradzki
5d467aca9a Add default bot implementation (#3038)
* Add default bot implementation

* Thought so

* Brain damage for netf
2023-10-18 22:57:58 +02:00
Sebastian Göls
0c125db118 Happy new year! (#2809) 2023-01-25 15:43:12 +01:00
Archi
00f7d2bfb9 Closes #2787 2023-01-24 22:49:41 +01:00
Archi
fc63c28b05 Use local cache for BadBots in case server is unavailable
Bad actors might attempt to DDoS the server in order to refuse the service, fallback to local cache if that happens.
2022-12-17 03:11:07 +01:00
Archi
be5ec43772 Add support for automatically rejecting trade offers from bad bots
With special dedication to the guy who attempted to DDoS ASF STM listing today, hope your business will truly expand from now on! <3
2022-12-17 02:39:37 +01:00
Łukasz Domeradzki
98ef37e722 Extract PublicListing and MatchActively to a plugin, resurrect MatchActively (#2759)
* Start work on extracting remote communication

* ok

* Dockerfile fixes

* More fixes

* Prepare /Api/Announce and /Api/HeartBeat

* Decrease publish race conditions

* OK

* Misc

* Misc

* Misc

* Move Steam group part back to ASF core

* Finally implement match actively v2 core

* Update RemoteCommunication.cs

* Use single round exclusively, report inventories more often

* Use randomization when asking others for assetIDs

* Add support for license and crowdin

* Kill dead code

* Fix return type of inventories

* Fix responses for good

* Unify old backend with new

* Report whole inventory, always

Helps with optimization on the backend side in terms of inventory fetching

* Update RemoteCommunication.cs

* Determine index of each asset and tell server about it

* Update AnnouncementRequest.cs

* Fix ASF screwing up with the order

* Fix warnings

* Misc rename

* Final logging touches
2022-12-15 18:46:37 +01:00
JustArchi
bce0649822 Closes #2728 2022-10-28 19:08:14 +02:00
JustArchi
ee4d5561dd Remove obsolete mapping 2022-09-28 10:15:20 +02:00
JustArchi
1e03077dc7 Implement local response of Fail/AlreadyPurchases for addlicense 2022-08-25 20:38:37 +02:00
JustArchi
bdb8f90a4e Whatever 2022-08-11 22:45:18 +02:00
JustArchi
d67366cd12 Implement cache validity for PackagesData
For unknown to me reason, this breaks for many people with Steam reporting invalid data and ASF caching it until new change number, which may never arrive. Add our own 7-days validity on top, to ensure that user never needs to delete ASF.db manually.
2022-08-11 22:38:19 +02:00
JustArchi
237f23e965 Attempt to silence excessive IL warnings 2022-06-20 21:37:03 +02:00
Sebastian Göls
b8bfcd5df3 Simplify LogNullError calls (#2554)
* Remove necessity of nameof(...) in calls to ArchiLogger.LogNullError(...)

* Upgrade Madness

* Upgrade Madness

* Split up compound null log statements
2022-04-13 23:16:36 +02:00
Archi
78407fbd9c Remove obsolete statistics mapping
This already skipped one monthly cycle, everybody who remotely cares to use up-to-date ASF is already migrated to proper config, everybody else is not making use of it either way
2022-04-12 00:52:19 +02:00
Archi
cc83222c3e Use shorter syntax for json properties 2022-03-22 16:33:47 +01:00
Archi
fec57e0fff Preserve CachedCardCountsForGame across ASF runs 2022-02-11 00:05:43 +01:00
Łukasz Domeradzki
c3c5f33289 Split global statistics into per-bot RemoteConnection (#2505)
* Split global statistics into per-bot RemoteConnection

* Add migration for existing statistics setting
2022-02-03 17:33:04 +01:00
Archi
dae6f9d328 Use newer syntax for Enum.IsDefined() 2022-01-23 01:37:43 +01:00
Archi
1809028c77 Rider cleanup 2022-01-06 20:22:38 +01:00
Archi
f3d491611a Add MinFarmingDelayAfterBlock global config property 2021-12-20 18:10:46 +01:00
Archi
4f598d5c8f Latest Rider cleanups 2021-12-12 01:12:54 +01:00
Archi
d1fc7ebb74 Use C# 10 string interpolation wherever possible 2021-11-11 01:53:34 +01:00
Archi
1e6ab11d9f Use file-scoped namespaces 2021-11-10 21:23:24 +01:00
Sebastian Göls
fb4eb0b03a Use Madness via global usings (#2447)
* Use Madness via global usings

* Apply feedback

* Disable false positive null warning
2021-11-09 16:33:09 +01:00
Archi
2909d4320a Do not bother checking IPC security when IPC itself is disabled 2021-11-02 23:33:35 +01:00
Archi
fc0c916137 Extend warnings for --cryptkey and lack of it
@Abrynos
2021-10-13 23:24:07 +02:00
Sebastian Göls
be027523ac Warn about insecure passwords (#2419)
* 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>
2021-10-13 21:44:48 +02:00
Archi
7e9e90764b Use static lambdas wherever possible
Thanks Rider
2021-09-27 21:33:52 +02:00
Archi
c60d413a70 Misc 2021-09-15 12:43:25 +02:00
Łukasz Domeradzki
9f281c6055 Embrace madness (#2394)
* Embrace madness

* Remove unused code

* Misc

* Address Abry's note

* Update for Madness 0.3.0
2021-08-07 14:03:46 +02:00
Archi
a1955bc881 Mark additional stuff for removal 2021-08-02 22:15:37 +02:00
Archi
6e285178d4 Misc 2021-07-23 20:35:48 +02:00
Archi
7ff747fb6e Misc 2021-07-23 17:05:43 +02:00
Sebastian Göls
4b7edf388c Fix GlobalConfig update via IPC removing IPCPassword (#2379) 2021-07-23 16:54:20 +02:00
Archi
d479eb9f97 Address Rider EAP inspections/cleanup 2021-07-12 21:45:17 +02:00
Archi
cfa23ffe21 Misc 2021-07-01 12:00:23 +02:00
Archi
0060e76829 Make custom swagger limitations more generic to use 2021-06-30 22:23:01 +02:00
Archi
874eb4d3a6 Add helpful limitations on properties for https://github.com/JustArchiNET/ASF-ui/issues/1445
Monologue explaining how it works: https://ptb.discord.com/channels/267292556709068800/332735075315744768/859854787634004049

(eventually also on wiki)
2021-06-30 20:39:38 +02:00
Archi
cca2ab4174 Misc 2021-06-18 23:29:27 +02:00
Archi
346ed72fc7 Enable new storage functionality for plugins usage 2021-06-18 23:27:51 +02:00
Archi
398c93e9b7 Closes #2337 2021-06-18 20:56:32 +02:00
Łukasz Domeradzki
2aab56b775 Rewrite SendMessage() functions to account for new rate-limits (#2335)
* 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>
2021-06-18 19:50:14 +02:00
Archi
59ae27c0d0 Avoid even asking for login keys if it's not needed
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.
2021-05-25 00:08:16 +02:00
Archi
bdf541b058 Implement --no-config-migrate option 2021-05-20 22:42:30 +02:00
JustArchi
e146db732c Misc 2021-05-09 00:05:40 +02:00
JustArchi
5edfaa9840 IPC: true is the new default 2021-05-08 23:44:36 +02:00