mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 22:40:30 +00:00
Add debugging and NetHookAnalyzer
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -8,8 +8,9 @@ ArchiSteamFarm/config/*
|
||||
!ArchiSteamFarm/config/example.json
|
||||
!ArchiSteamFarm/config/minimal.json
|
||||
|
||||
# Ignore local debugging log file
|
||||
# Ignore local debugging
|
||||
ArchiSteamFarm/log.txt
|
||||
ArchiSteamFarm/debug/*
|
||||
|
||||
#################
|
||||
## Eclipse
|
||||
|
||||
@@ -193,6 +193,19 @@ namespace ArchiSteamFarm {
|
||||
// Initialize
|
||||
SteamClient = new SteamClient();
|
||||
|
||||
if (Program.GlobalConfig.Debug && !Debugging.NetHookAlreadyInitialized) {
|
||||
try {
|
||||
if (Directory.Exists(Program.DebugDirectory)) {
|
||||
Directory.Delete(Program.DebugDirectory, true);
|
||||
}
|
||||
Directory.CreateDirectory(Program.DebugDirectory);
|
||||
SteamClient.DebugNetworkListener = new NetHookNetworkListener(Program.DebugDirectory);
|
||||
Debugging.NetHookAlreadyInitialized = true;
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e, botName);
|
||||
}
|
||||
}
|
||||
|
||||
ArchiHandler = new ArchiHandler();
|
||||
SteamClient.AddHandler(ArchiHandler);
|
||||
|
||||
|
||||
@@ -31,5 +31,7 @@ namespace ArchiSteamFarm {
|
||||
#endif
|
||||
|
||||
internal static bool IsReleaseBuild => !IsDebugBuild;
|
||||
|
||||
internal static bool NetHookAlreadyInitialized { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using SteamAuth;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -39,6 +38,9 @@ namespace ArchiSteamFarm {
|
||||
// This is hardcoded blacklist which should not be possible to change
|
||||
internal static readonly HashSet<uint> GlobalBlacklist = new HashSet<uint> { 267420, 303700, 335590, 368020, 425280 };
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool Debug { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool AutoUpdates { get; private set; } = true;
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal const string ASF = "ASF";
|
||||
internal const string ConfigDirectory = "config";
|
||||
internal const string DebugDirectory = "debug";
|
||||
internal const string LogFile = "log.txt";
|
||||
internal const string GlobalConfigFile = ASF + ".json";
|
||||
internal const string GlobalDatabaseFile = ASF + ".db";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"Debug": false,
|
||||
"AutoUpdates": true,
|
||||
"UpdateChannel": 1,
|
||||
"HttpTimeout": 30,
|
||||
|
||||
BIN
tools/NetHookAnalyzer2.exe
Normal file
BIN
tools/NetHookAnalyzer2.exe
Normal file
Binary file not shown.
Reference in New Issue
Block a user