• Welcome to Valhalla Legends Archive.
 

[C#] Another Quick Q.

Started by Godzilla, April 22, 2007, 11:29 PM

Previous topic - Next topic

Godzilla

This time it's about C# and MBNCSUtil:
I just decided to switch over to C# so I'm trying to re-write my code from VB. My question is, how come in C# it's only letting me declare a "new" BncsPacket variable once? The first BncsPacket that the code runs through will work, all the following ones won't the code stops executing when I insert a value to the BncsPacket.
For example:
            BncsPacket WorkingPacket = new BncsPacket(WhateverByte);
            WorkingPacket.Insert(WhateverValue);
            BncsPacket NotWorkingPacket = new BncsPacket(WhateverByte);
            //code fom this line and below will not execute
            NotWorkingPacket.Insert(WhateverValue);
            NotWorkingPacket.Insert(WhateverValue);

Sort of unclear example but if any answers would be greatly appreciated.. im unfamiliar with C#

MyndFyre

So the code stops executing....  Is there an exception raised? 
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Godzilla

Nope. I get no warnings, no errors. It's the bncspacket because when I was debugging it I tested it in multiple ways, and it's always the second BncsPacket i create where it stops

Kp

Does execution return from creating the second BncsPacket?  What happens when the program fails?  Does it go into a CPU spinning loop, exit the process, or something else?
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

MyndFyre

Quote from: Godzilla on April 23, 2007, 09:22 AM
Nope. I get no warnings, no errors. It's the bncspacket because when I was debugging it I tested it in multiple ways, and it's always the second BncsPacket i create where it stops

Have you tried using the MBNCSUtil source code and stepping into it?

I mean, there's not really anything in BncsPacket(byte) doesn't do anything blocking

My guessing is that you've got a cross-thread call that affects the GUI somewhere and it just so happens that the problem is coming up right here.

Do you have a GUI?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Godzilla

#5
Quote from: Kp on April 23, 2007, 09:47 AM
Does execution return from creating the second BncsPacket?
Yes, the second packet is created (only the 4 byte header), then the moment I .Insert() a value the code stops, but I do not get failures. Just nothing happens when im debugging it as if nothing has happened.

Would you guys like me to post some of my code?
btw MyndFyre i used your PacketId enum.

MyndFyre

Yeah, .zip your project and let me see it.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Godzilla

#7
wow omg.. I'm such an idiot. If i looked more closely to my debugging and variable values I could have easily found the problem:

Files[0] = "C:/Program Files/Warcraft III/war3.exe"
Files[1] = "C:/Program Files/Warcraft III/storm.dll"
Files[2] = "C:/Program Files/Warcraft III/game.gll"

funny.
This caused my code to stop executing because my Files for the CheckRevision were wrong :P

MyndFyre

Ahh.  I was wondering what was up - I never got your project.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.