// Copyright © 2017-2018 Atomic Software, LLC. All Rights Reserved. // See LICENSE.md for full license information. using Atom.Core.Collections; using Atom.Core.Game; using Atom.Core.SQL; namespace Atom.LoginServer.Services { internal static class AccountService { internal static Dictionary CachedAccounts = new Dictionary(); internal static void Login(string sUserName, string sPassword, out int userNo, out int blocked, out int canLogin) { // Build the SQL Query. using (var p_User_Login = new StoredProcedure("p_User_Login", Program.ServerInstance.ODBCConnection)) { p_User_Login.AddParameter("userID", sUserName, 20); p_User_Login.AddParameter("userPW", sPassword, 32); // Declare output variable types. p_User_Login.AddOutput("userNo"); p_User_Login.AddOutput("authID"); p_User_Login.AddOutput("block"); p_User_Login.AddOutput("canLogin"); p_User_Login.Run(); // Run the query. // Get the value of the output variables. userNo = p_User_Login.GetOutput("userNo"); p_User_Login.GetOutput("authID"); // This variable is not used, so we don't assign it to anything. blocked = p_User_Login.GetOutput("block"); canLogin = p_User_Login.GetOutput("canLogin"); } } } }