//select username,name,level,race,class from characters.characters join auth.account on characters.characters.account = auth.account.id where characters.characters.online = 1;
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";
MySqlCommandcmd=newMySqlCommand(sql,conn);
cmd.Parameters.AddWithValue("id",guid);
MySqlDataReaderrdr=cmd.ExecuteReader();
while(rdr.Read())
{
try
{
this.guid=guid;
this.Username=rdr.GetString(0);
this.Name=rdr.GetString(1);
this.Level=rdr.GetByte(2);
this.Race=rdr.GetByte(3);
this.Class=rdr.GetByte(4);
this.AtLogin=(AtLoginOptions)rdr.GetUInt16(5);
}
catch(Exceptione)
{
Console.WriteLine(e);
}
}
rdr.Close();
conn.Close();
}
publicvoidSetAtLogin(MySqlConnectionconn){
conn.Open();
stringsql="update characters.characters set at_login=@loginOpts where guid=@guid";