Valhalla Legends Forums Archive | Battle.net Bot Development | [C#] Another Quick Q.

AuthorMessageTime
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:
[code]            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);[/code]
Sort of unclear example but if any answers would be greatly appreciated.. im unfamiliar with C#
April 23, 2007, 4:29 AM
Myndfyr
So the code stops executing....  Is there an exception raised? 
April 23, 2007, 7:16 AM
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
April 23, 2007, 2:22 PM
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?
April 23, 2007, 2:47 PM
Myndfyr
[quote author=Godzilla link=topic=16638.msg168306#msg168306 date=1177338136]
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
[/quote]

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?
April 23, 2007, 4:46 PM
Godzilla
[quote author=Kp link=topic=16638.msg168307#msg168307 date=1177339638]
Does execution return from creating the second BncsPacket?
[/quote]
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.
April 23, 2007, 8:12 PM
Myndfyr
Yeah, .zip your project and let me see it.
April 24, 2007, 1:35 AM
Godzilla
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:
[code]
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"
[/code]
funny.
This caused my code to stop executing because my Files for the CheckRevision were wrong :P
April 24, 2007, 1:55 AM
Myndfyr
Ahh.  I was wondering what was up - I never got your project.
April 26, 2007, 4:27 PM

Search