public static void Authentication(Forms.Authentication auth, string username, string password, string hwid) { Worker.instance.Send( pack.Serialize( (int)PacketHeader.Authentication, username, password, hwid ) ); }
public Worker() { running = true; /** * Make the worker instance globally available. */ instance = this; /** * Setup the context. */ context = new ApplicationContext(); /** * Initialize the client. */ client = new UserClient(); /** * Register events. */ client.ExceptionThrown += Events.Client_ExceptionThrown; client.ReadPacket += Events.Client_ReadPacket; client.StateChanged += Events.Client_StateChanged; client.WritePacket += Events.Client_WritePacket;; /** * Connect to the server. */ client.Connect(Config.host, Config.port); /** * Show the authentication form. */ auth = new Forms.Authentication(this); auth.Show(); #if DEBUG /** * Show the debugging form. */ new Forms.Debug().Show(); #endif }