From 758a5a96dc1b54a991a790d0d0ab694900ec0f35 Mon Sep 17 00:00:00 2001 From: AlanMoonbase Date: Thu, 17 Jul 2025 14:36:56 -0700 Subject: [PATCH] Add Additional Logging/Diagnostics For Weird Status Behaviours --- QtCNETAPI/Services/ApiService/ApiService.cs | 7 ++++++- qtc-net-client-2/Program.cs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/QtCNETAPI/Services/ApiService/ApiService.cs b/QtCNETAPI/Services/ApiService/ApiService.cs index d42d8f1..5d625ee 100644 --- a/QtCNETAPI/Services/ApiService/ApiService.cs +++ b/QtCNETAPI/Services/ApiService/ApiService.cs @@ -13,6 +13,7 @@ namespace QtCNETAPI.Services.ApiService { private User? user; private RestClient _client; + private LoggingService _loggingService; internal string? sessionToken; internal string apiUri; @@ -30,9 +31,10 @@ namespace QtCNETAPI.Services.ApiService get { return user; } } - public ApiService(string apiUrl) + public ApiService(string apiUrl, LoggingService loggingService) { apiUri = apiUrl; + _loggingService = loggingService; _client = new RestClient(apiUri); } @@ -287,6 +289,9 @@ namespace QtCNETAPI.Services.ApiService if (userResponse != null && userResponse.Success && userResponse.Data != null) { user = userResponse.Data; + + _loggingService.LogString($"Current User's Status Is {userResponse.Data.Status}"); + return userResponse.Data; } else { diff --git a/qtc-net-client-2/Program.cs b/qtc-net-client-2/Program.cs index 76f1432..3b4b8ee 100644 --- a/qtc-net-client-2/Program.cs +++ b/qtc-net-client-2/Program.cs @@ -53,7 +53,7 @@ namespace qtc_net_client_2 // instantiate new ApiService and GatewayService for this session // this will keep the gateway thread in the main thread (i think) - IApiService api = new ApiService($"{clientConfig.ServerUrl}/api"); + IApiService api = new ApiService($"{clientConfig.ServerUrl}/api", loggingService); IGatewayService gateway = new GatewayService($"{clientConfig.ServerUrl}/chat", api, loggingService); // ping api