[C#] Offline Seal
#1

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);
}



Messages In This Thread
[No subject] - by Nikolee - 10-19-2012, 07:38 PM
[No subject] - by someone - 10-19-2012, 09:57 PM
[No subject] - by Nikolee - 10-19-2012, 10:01 PM
[No subject] - by HateMe - 10-20-2012, 08:40 AM
[No subject] - by Mr.Speedy - 10-20-2012, 09:14 AM
[No subject] - by TheEvilAnt - 10-20-2012, 09:32 AM
[No subject] - by Nikolee - 10-20-2012, 10:59 AM
[No subject] - by Creep - 10-30-2012, 10:58 PM
[No subject] - by X4lfur0z - 11-04-2012, 05:01 PM
[No subject] - by HateMe - 11-04-2012, 06:16 PM
[No subject] - by Nikolee - 11-04-2012, 10:16 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)