10-19-2012, 07:38 PM
Hey Guys im back but not with a problem, its more an question for a Idea ^^
I wanna make a Offline Seal System in C# with a Console.
But im stuck on a Method how i work on the Accounts which are offline^^
I select in t_users the Accounts who are offline and then i wanna seal the Armor & Weapon if the character is logged off ^^
But to be serious i have no idea there to start.
i thougt so:
Get the Accounts which are Offline
Select the Characters from the Accounts
Seal the Items..
But how i make this for every account who is offline?
I can make it with 1 but how for 100 ?^^
Sry i cant explain it right ^^
Here i select the Accounts which are offline so what i gonna do now?
public void GetCharacterToSeal()
{
Read();
Console.BackgroundColor = ConsoleColor.Black;
Console.ForegroundColor = ConsoleColor.White;
DateTime date = DateTime.Now;
MySqlConnection con;
MySqlConnectionStringBuilder csb = new MySqlConnectionStringBuilder();
csb.Server = Ip;
csb.UserID = User;
csb.Database = user_db;
csb.Password = pw;
con = new MySqlConnection(csb.ConnectionString);
MySqlConnection connection = new MySqlConnection(csb.ConnectionString);
connection.Open();
string sql = @"SELECT count(a_index) FROM t_users WHERE a_zone_num = -1 "; //Zählen
MySqlCommand Command = new MySqlCommand(sql, connection);
int i = Command.ExecuteNonQuery();
MySqlDataAdapter dtAdp = new MySqlDataAdapter(sql, connection);
string result = Convert.ToString(Command.ExecuteScalar());
Console.WriteLine(date + " : : People offline and able to Seal Items: "+result);
}

