stringsql="select id,username,email,last_ip,last_login from account where username=@username";
{
MySqlCommandcmd=newMySqlCommand(sql,conn);
try
cmd.Parameters.AddWithValue("username",username);
{
MySqlDataReaderrdr=cmd.ExecuteReader();
this.Id=rdr.GetUInt32(0);
this.Username=rdr.GetString(1);
while(rdr.Read())
this.Email=rdr.GetString(2);
this.LastIP=rdr.GetString(3);
this.LastLogin=rdr.GetDateTime(4);
}
catch(Exceptione)
{
Console.WriteLine(e);
}
}
rdr.Close();
sql="select guid,username,name,level,race,class from characters.characters join auth.account on characters.characters.account = auth.account.id where characters.characters.account=@id";
cmd=newMySqlCommand(sql,conn);
cmd.Parameters.AddWithValue("id",this.Id);
rdr=cmd.ExecuteReader();
this.Characters=newList<Character>();
while(rdr.Read())
{
try
{
{
Characterc=newCharacter();
try
c.guid=(int)rdr.GetUInt32(0);
{
c.Username=rdr.GetString(1);
this.Id=rdr.GetUInt32(0);
c.Name=rdr.GetString(2);
this.Username=rdr.GetString(1);
c.Level=rdr.GetByte(3);
this.Email=rdr.GetString(2);
c.Race=rdr.GetByte(4);
this.LastIP=rdr.GetString(3);
c.Class=rdr.GetByte(5);
this.LastLogin=rdr.GetDateTime(4);
this.Characters.Add(c);
}
catch(Exceptione)
{
Console.WriteLine(e);
}
}
}
catch(Exceptione)
rdr.Close();
sql="select guid,username,name,level,race,class from characters.characters join auth.account on characters.characters.account = auth.account.id where characters.characters.account=@id";
cmd=newMySqlCommand(sql,conn);
cmd.Parameters.AddWithValue("id",this.Id);
rdr=cmd.ExecuteReader();
this.Characters=newList<Character>();
while(rdr.Read())
{
{
Console.WriteLine(e);
try
{
Characterc=newCharacter();
c.guid=(int)rdr.GetUInt32(0);
c.Username=rdr.GetString(1);
c.Name=rdr.GetString(2);
c.Level=rdr.GetByte(3);
c.Race=rdr.GetByte(4);
c.Class=rdr.GetByte(5);
this.Characters.Add(c);
}
catch(Exceptione)
{
Console.WriteLine(e);
}
}
}
}
rdr.Close();
rdr.Close();
sql="select SecurityLevel,RealmID from account_access where AccountID=@id";
sql="select SecurityLevel,RealmID from account_access where AccountID=@id";
stringsql="select username,name,level,race,class,at_login from characters.characters join auth.account on characters.characters.account = auth.account.id where characters.characters.guid=@id";
stringsql="select username,name,level,race,class,at_login from characters.characters join auth.account on characters.characters.account = auth.account.id where characters.characters.guid=@id";