Ejemplo n.º 1
0
 public bool TryJoin(UInt32 password, UInt32 _uid)
 {
     bool right = false;
     var cmd = new Database.MySqlCommand(Database.MySqlCommandType.SELECT);
     cmd.Select("accounts").Where("EntityID", _uid);
     var r = new Database.MySqlReader(cmd);
     if (r.Read())
         if (password == (uint)r.ReadString("Password").GetHashCode())
             right = true;
     r.Close();
     if (right)
     {
         if (_uid != 0)
             right = ExecutClient(_uid);
     }
     return right;
 }
Ejemplo n.º 2
0
 public bool ExecutClient(uint uid)
 {
     bool right = false;
     var cmd = new Database.MySqlCommand(Database.MySqlCommandType.SELECT);
     cmd.Select("accounts").Where("EntityID", uid);
     var r = new Database.MySqlReader(cmd);
     if (r.Read())
     {
         this.Account = new Conquer_Online_Server.Database.AccountTable(r.ReadString("Username"));
         right = true;
     }
     r.Close();
     return right;
 }
Ejemplo n.º 3
0
 public Boolean TestEntity(UInt32 _uid)
 {
     string names = "";
     var cmd = new Database.MySqlCommand(Database.MySqlCommandType.SELECT);
     cmd.Select("entities").Where("UID", _uid);
     var r = new Database.MySqlReader(cmd);
     if (r.Read())
         names = r.ReadString("Name");
     r.Close();
     if (names == "")
         return false;//"NEW_ROLE";
     else
         return true;//"ANSWER_OK";
 }