From c6c2dea10c3b2c2bf215d21e2c422462741b12ad Mon Sep 17 00:00:00 2001 From: nugroho Date: Tue, 20 May 2025 15:57:24 +0700 Subject: [PATCH] useraccounts refactor --- Commons.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Commons.cs b/Commons.cs index 46c6129..f800d10 100644 --- a/Commons.cs +++ b/Commons.cs @@ -139,12 +139,13 @@ internal static class Commons Console.Write(" Caching User Accounts... "); await using SqlConnection FConn = new(CS); await FConn.OpenAsync().ConfigureAwait(false); - using SqlCommand FComm = new("SELECT * FROM users",FConn); + using SqlCommand FComm = new("SELECT * FROM useraccounts",FConn); await using (SqlDataReader URead = await FComm.ExecuteReaderAsync(CTS.Token).ConfigureAwait(false)) { - while(await URead.ReadAsync(CTS.Token).ConfigureAwait(false)) + UserAccounts.Clear(); + while (await URead.ReadAsync(CTS.Token).ConfigureAwait(false)) { - _ = UserAccounts.TryAdd((string)URead["uname"], new User((string)URead["uname"],(string)URead["name"],(string)URead["pass"],(byte)URead["level"],(bool)URead["active"])); + _ = UserAccounts.TryAdd((string)URead["uname"], new User((string)URead["uname"], (string)URead["agentid"], (string)URead["pass"], (byte)URead["level"], (bool)URead["active"])); } } Console.WriteLine("Done.");