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
stringsql="select id,username,email,last_ip,last_login from account where username=@username";
MySqlCommandcmd=newMySqlCommand(sql,conn);
cmd.Parameters.AddWithValue("username",username);
MySqlDataReaderrdr=cmd.ExecuteReader();
while(rdr.Read())
{
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);
try
{
this.Id=rdr.GetUInt32(0);
this.Username=rdr.GetString(1);
this.Email=rdr.GetString(2);
this.LastIP=rdr.GetString(3);
this.LastLogin=rdr.GetDateTime(4);
}
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";
cmd=newMySqlCommand(sql,conn);
cmd.Parameters.AddWithValue("id",this.Id);
rdr=cmd.ExecuteReader();
this.Access=newList<AccountAccess>();
while(rdr.Read())
{
try
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";