Esempio n. 1
0
        public static List <Dictionary <string, object> > UserDataQuery(string query, params object[] args)
        {
            AuthDB.Connection = AuthDB.Connect(UserDataDBConfig.Instance.Host, UserDataDBConfig.Instance.Username, UserDataDBConfig.Instance.Password, UserDataDBConfig.Instance.Database);
            var res = AuthDB.Query(query, args);

            AuthDB.Connection = null;
            return(res);
        }
Esempio n. 2
0
        public static int CheckAccount(string username, string password)
        {
            int _res = 0;
            var res  = AuthDB.UserDataQuery("CALL `getAccountAuthResult`('{0}', '{1}');", username, password);

            foreach (var r in res[0])
            {
                _res = (int)r.Value;
            }
            return(_res);
        }
Esempio n. 3
0
        public static int GetAccountID(string username)
        {
            int _res = 0;
            var res  = AuthDB.UserDataQuery("CALL `getAccountID`('{0}');", username);

            foreach (var r in res[0])
            {
                _res = (int)r.Value;
            }
            return(_res);
        }
Esempio n. 4
0
 public static void UserDataExecute(string query, params object[] args)
 {
     AuthDB.Connection = AuthDB.Connect(UserDataDBConfig.Instance.Host, UserDataDBConfig.Instance.Username, UserDataDBConfig.Instance.Password, UserDataDBConfig.Instance.Database);
     AuthDB.Execute(query, args);
     AuthDB.Connection = null;
 }