Remove debugging

This commit is contained in:
JustArchi
2015-12-21 10:02:05 +01:00
parent 4cd2444a1a
commit 55000c7653
3 changed files with 1 additions and 30 deletions

View File

@@ -105,9 +105,7 @@ namespace ArchiSteamFarm {
}
internal Bot(string botName) {
Logging.LogGenericDebug(botName, "Created new bot object: " + ToString());
if (Bots.ContainsKey(botName)) {
Logging.LogGenericDebug(botName, "But that name is already in use, so returning!");
return;
}
@@ -340,9 +338,7 @@ namespace ArchiSteamFarm {
}
internal async Task Start() {
Logging.LogGenericDebug(BotName, "Got signal to start!");
if (IsRunning) {
Logging.LogGenericDebug(BotName, "But it's started already, so returning");
return;
}
@@ -354,24 +350,17 @@ namespace ArchiSteamFarm {
}
IsRunning = true;
Logging.LogGenericDebug(BotName, "Connecting steam client!");
SteamClient.Connect();
Logging.LogGenericDebug(BotName, "Turned on callback handle!");
var fireAndForget = Task.Run(() => HandleCallbacks());
}
internal async Task Stop() {
Logging.LogGenericDebug(BotName, "Got signal to stop");
if (!IsRunning) {
Logging.LogGenericDebug(BotName, "But it's stopped already, so returning");
return;
}
Logging.LogGenericDebug(BotName, "Stopping CF module...");
await CardsFarmer.StopFarming().ConfigureAwait(false);
IsRunning = false;
Logging.LogGenericDebug(BotName, "Disconnecting steam client!");
SteamClient.Disconnect();
}
@@ -400,12 +389,10 @@ namespace ArchiSteamFarm {
}
private void HandleCallbacks() {
Logging.LogGenericDebug(BotName, "Started Loop");
TimeSpan timeSpan = TimeSpan.FromMilliseconds(CallbackSleep);
while (IsRunning) {
CallbackManager.RunWaitCallbacks(timeSpan);
}
Logging.LogGenericDebug(BotName, "Stopped Loop");
}
private void SendMessageToUser(ulong steamID, string message) {
@@ -652,8 +639,6 @@ namespace ArchiSteamFarm {
return;
}
Logging.LogGenericDebug(BotName, "Got command: " + message);
if (!message.Contains(" ")) {
switch (message) {
case "!2fa":

View File

@@ -134,15 +134,10 @@ namespace ArchiSteamFarm {
}
internal async Task StartFarming() {
Logging.LogGenericDebug(Bot.BotName, "Got signal to start farming, calling StopFarming firstly");
await StopFarming().ConfigureAwait(false);
Logging.LogGenericDebug(Bot.BotName, "StopFarming done, waiting for semaphore now...");
await Semaphore.WaitAsync().ConfigureAwait(false);
Logging.LogGenericDebug(Bot.BotName, "Got it!");
if (NowFarming) {
Logging.LogGenericDebug(Bot.BotName, "But for some reason farming is already active, probably called in a meantime, so returning!");
Semaphore.Release();
return;
}
@@ -150,7 +145,6 @@ namespace ArchiSteamFarm {
// Check if farming is possible
Logging.LogGenericInfo(Bot.BotName, "Checking possibility to farm...");
NowFarming = true;
Logging.LogGenericDebug(Bot.BotName, "Releasing semaphore while waiting!");
Semaphore.Release();
Bot.ArchiHandler.PlayGames(1337);
@@ -162,9 +156,7 @@ namespace ArchiSteamFarm {
Logging.LogGenericInfo(Bot.BotName, "Farming is possible!");
Logging.LogGenericDebug(Bot.BotName, "Waiting for semaphore...");
await Semaphore.WaitAsync().ConfigureAwait(false);
Logging.LogGenericDebug(Bot.BotName, "Got it!");
if (await Bot.ArchiWebHandler.ReconnectIfNeeded().ConfigureAwait(false)) {
Semaphore.Release();
@@ -308,12 +300,8 @@ namespace ArchiSteamFarm {
}
internal async Task StopFarming() {
Logging.LogGenericDebug(Bot.BotName, "Got signal to stop farming");
Logging.LogGenericDebug(Bot.BotName, "Waiting for semaphore");
await Semaphore.WaitAsync().ConfigureAwait(false);
Logging.LogGenericDebug(Bot.BotName, "Got it!");
if (!NowFarming) {
Logging.LogGenericDebug(Bot.BotName, "Farming is already stopped, so returning");
Semaphore.Release();
return;
}
@@ -326,7 +314,6 @@ namespace ArchiSteamFarm {
}
FarmResetEvent.Reset();
Logging.LogGenericInfo(Bot.BotName, "Farming stopped!");
Logging.LogGenericDebug(Bot.BotName, "Releasing semaphore...");
Semaphore.Release();
}
@@ -335,7 +322,6 @@ namespace ArchiSteamFarm {
return;
}
Logging.LogGenericDebug(Bot.BotName, "START!");
await StartFarming().ConfigureAwait(false);
}

View File

@@ -56,7 +56,7 @@ namespace ArchiSteamFarm {
Log("[*] NOTICE: " + previousMethodName + "() <" + botName + "> " + message);
}
//[Conditional("DEBUG")]
[Conditional("DEBUG")]
internal static void LogGenericDebug(string botName, string message, [CallerMemberName] string previousMethodName = "") {
Log("[#] DEBUG: " + previousMethodName + "() <" + botName + "> " + message);
}