Y u no work?

05/09/2012 04:29 denominator#1
Code:
private void button1_Click(object sender, EventArgs e)
        {

            
            List<COClient> Clients = new List<COClient>();

            COClient client = new COClient();

            

            client.Attached += (delegate()
            {
                {
                    this.Invoke(new MethodInvoker(delegate { List<string> lines = textBox1.Lines.ToList(); lines.Insert(0, Text); if (lines.Count > 100) lines.RemoveAt(100); textBox1.Lines = lines.ToArray(); textBox1.Refresh(); }));
                }

                textBox1.Text = +client.ProcessId + "";


            });
            client.PacketSent += (delegate(byte[] packet)
            {
                textBox1.Text = "SENT: " + BitConverter.ToString(packet).Replace("-", " ");

            });

            client.PacketReceived += (delegate(byte[] packet)
            {
                textBox1.Text = "RECV: " + BitConverter.ToString(packet).Replace("-", " ");

            });
            
            client.Start();
             
            client.SendPacket(new byte[] { 0, 0 }); <<<-----This being the reason it doesn't load the Conquer.exe up?
        }
05/09/2012 08:40 I don't have a username#2
At least say what's not working.

#Edit nevermind

And ermm most likely yeah. Since there is no packet on the size of 2 bytes. Conquer packets take at least 4 bytes as packet-header.

2 bytes for the size (uint16)
2 bytes for the type (uint16)
05/09/2012 09:16 denominator#3
So what should those two zeros actually be o.0? Or better still how should I find what they should be?
05/09/2012 09:40 I don't have a username#4
Depends what packet you want to send o.o
05/09/2012 09:48 denominator#5
Hmmm well without "client.SendPacket(new byte[] { 0, 0 });" I can start the client so do I even need that? I'm assuming I must need it for something >.<

I'm assuming it's for login or something? I've noticed though that without it I can close the GUI and the client stays open even though I added something that should close the client if the GUI is closed which is why I assume it is needed for something lol.

Code:
private void Form_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
         {
            List<COClient> clients = new List<COClient>();
            foreach (COClient client in clients)
            {
                client.Detach();
            }

         }
Code:
private void Main_Load(object sender, EventArgs e)
        {            
            FormClosing += Form_FormClosing;
        }
05/09/2012 09:52 Spirited#6
[Only registered and activated users can see links. Click Here To Register...]

Couldn't resist.
Also, I don't see where you're assigning the socket to the send.
05/09/2012 10:03 denominator#7
Now I'm puzzled >.< I'm also using Google to try to answer most of the things and this puzzled me

Quote:
Also, I don't see where you're assigning the socket to the send.
So I decided to take a look at this

[Only registered and activated users can see links. Click Here To Register...]
05/09/2012 10:16 IAmHawtness#8
What the fuck? Sigh..
Why the hell are you sending a { 0x00, 0x00 } packet? There is no need for this. This isn't even a valid packet and it probably crashes Conquer.exe because you're basically telling it to send a 2-byte packet with size 0

You don't call "Detach" to close the client, you call "Kill"
05/09/2012 10:27 denominator#9
So basically as I was I can just take
Code:
 client.SendPacket(new byte[] { 0, 0 });
out because yes it loads without it and yes it sends data back and forth from what I can see in the textBox1?

I have changed it to kill rather than disconnect now, that's the problem I find when looking on Google.

Code:
private void Form_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
         {
            FormClosing += Form_FormClosing;
            List<COClient> clients = new List<COClient>();
            foreach (COClient client in clients)
            {
                client.Kill();
            }

         }
Code:
 private void Main_Load(object sender, EventArgs e)
        {
            FormClosing += Form_FormClosing;
        }
That still doesn't close the client if I close the GUI >.<
05/09/2012 11:08 I don't have a username#10
Process.Kill(), aye?
05/09/2012 11:23 IAmHawtness#11
Oh my god....
05/09/2012 11:33 denominator#12
Oh my god what? I even did a simple test and it STILL didn't close the Conquer.exe >.<

Code:
 private void button3_Click(object sender, EventArgs e)
        {
            
            COClient client = new COClient();
            {
                client.Kill();
            }
}
05/09/2012 11:35 IAmHawtness#13
Quote:
Originally Posted by denominator View Post
Oh my god what? I even did a simple test and it STILL didn't close the Conquer.exe >.<

Code:
 private void button3_Click(object sender, EventArgs e)
        {
            
            COClient client = new COClient();
            {
                client.Kill();
            }
}
Are you fucking retarded or what? Read a book about programming, please.
05/09/2012 11:41 denominator#14
Sorry for TRYING to learn! Guess I'll just go back to dotnetperls.com and continue to read as I have been doing all night.
05/09/2012 11:59 I don't have a username#15
Quote:
Originally Posted by denominator View Post
Oh my god what? I even did a simple test and it STILL didn't close the Conquer.exe >.<

Code:
 private void button3_Click(object sender, EventArgs e)
        {
            
            COClient client = new COClient();
            {
                client.Kill();
            }
}
Because making a new client and killing it will help much.