示例#1
0
        public void Auth(
            string user,
            string pass
            )
        {
            string passhash = SHA512String(user + pass);

            sql(SPrintF.sprintf("set @auth='%s';", passhash));

            if (checkAuth() == false)
            {
                throw new AuthenticationException(SPrintF.sprintf("Unable to authenticate user %s.", user));
            }
            else
            {
                Log.FormatWarn("Sucessfully Authenticated as %s!", user);
            }
        }
示例#2
0
        public static DataHandle getHandle(string connect_string)
        {
            if (DH_cache.ContainsKey(connect_string))
            {
                return(DH_cache[connect_string]);
            }

            DataHandle self = new DataHandle();

            self.auth = false;

            self.DBH = new MySqlConnection(connect_string);
            self.DBH.Open();
            self.sql(SPrintF.sprintf("set @auth='%s';", "unset"));
            Log.Debug("Dataserver connection sucessful");
            //do other stuff maybe?

            return(self);
        }
示例#3
0
文件: log.cs 项目: Kevok93/logrpg
 public static void FormatFatal(string format, params Object[] args)
 {
     instance.Fatal(SPrintF.sprintf(format, args));
 }
示例#4
0
文件: log.cs 项目: Kevok93/logrpg
 public static void FormatError(string format, params Object[] args)
 {
     instance.Error(SPrintF.sprintf(format, args));
 }
示例#5
0
文件: log.cs 项目: Kevok93/logrpg
 public static void FormatDebug(string format, params Object[] args)
 {
     instance.Debug(SPrintF.sprintf(format, args));
 }
示例#6
0
文件: log.cs 项目: Kevok93/logrpg
 public static void FormatTrace(string format, params Object[] args)
 {
     instance.Trace(SPrintF.sprintf(format, args));
 }