• Welcome to Valhalla Legends Archive.
 

UDP Issues when adding support to bot in VB

Started by Don Cullen, October 18, 2007, 07:45 PM

Previous topic - Next topic

Don Cullen

I've been having problems getting UDP to work on my machine.

Basically, I added UDP support to my bot. But for some inexplicable reason I was not receiving any UDP packets, even after sending 0x08 or 0x09.

My machine is DMZ'ed, firewall and anti-virus is disabled. So those aren't the issues.

I sent a copy of my bot to l2k-Shadow, and without any modifications, the bot worked fine, INCLUDING UDP support. This came as a surprise to me.

I packet logged via WireShark. No UDP packets...

RealityRipple sent me the source to one of his bots, I added UDP support to it, tested it-- didn't work. Sent the bot back to RealityRipple INCLUDING UDP support. He tested it without any modifications. UDP worked fine.

Now, here's the interesting thing. I went in Starcraft, went on battle.net, and joined a game. Game started. Played. Lost. I won't get into details, but the point is, game was fine. I know for a fact games require UDP. So UDP seems to be working?

This is driving me insane.

So I can confirm it isn't my code. It's likely an issue on my machine or in my network. Or maybe an issue with the winsock driver on my machine? I'm fresh out of ideas.

l2k-Shadow, RealityRipple, and DevCode also were fresh out of ideas.

Any ideas you guys could suggest to pinpoint the problem?
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Tazo

#1
Do you have another machine on your network that you can test it on? This would be effective as to concluding whether the issue is your machine or your network.

Don Cullen

#2
There is another machine on the network, but it's Win Vista. I tried copying over my bot, but it wasn't able to run the bot.

I also ran StarCraft (edit: on my machine), logged on, with WireShark packetlogging it.

Guess what? WireShark shows UDP traffic at the port 6112.

This is bewildering.

Edit: Tried updating VB to SP6. Update was successful. UDP still didn't work though.

Checked mswinsck.ocx version, it's 6.1.97.82. Compared that to RealityRipple's, he had 6.1.97.82, and UDP works fine for him.

Also tried rebooting. Still the same result.

Edit 2: Performed a hard reset of router, and set machine to DMZ once more, the results are still the same.
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Chriso

Haha stupid question probably, but have you set the socket to UDP? It defaults as TCP...

devcode

Quote from: Don Cullen on October 18, 2007, 08:14 PM
There is another machine on the network, but it's Win Vista. I tried copying over my bot, but it wasn't able to run the bot.

I also ran StarCraft (edit: on my machine), logged on, with WireShark packetlogging it.

Guess what? WireShark shows UDP traffic at the port 6112.

This is bewildering.

Edit: Tried updating VB to SP6. Update was successful. UDP still didn't work though.

Checked mswinsck.ocx version, it's 6.1.97.82. Compared that to RealityRipple's, he had 6.1.97.82, and UDP works fine for him.

Also tried rebooting. Still the same result.

Edit 2: Performed a hard reset of router, and set machine to DMZ once more, the results are still the same.

If SC works, then it's most likely your code that's wrong.

l2k-Shadow

He sent the exact same code without any changes to several different people. The exact same code worked on all of their machines. Therefore, it is his machine, not his code.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

devcode

Quote from: l2k-Shadow on October 18, 2007, 09:25 PM
He sent the exact same code without any changes to several different people. The exact same code worked on all of their machines. Therefore, it is his machine, not his code.
Yet SC works. So it MUST be his machine

Don Cullen

Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Yegg

Quote from: devcode on October 18, 2007, 09:36 PM
Quote from: l2k-Shadow on October 18, 2007, 09:25 PM
He sent the exact same code without any changes to several different people. The exact same code worked on all of their machines. Therefore, it is his machine, not his code.
Yet SC works. So it MUST be his machine

Quote from: l2k-Shadow on October 18, 2007, 09:25 PM
He sent the exact same code without any changes to several different people. The exact same code worked on all of their machines. Therefore, it is his machine, not his code.

devcode

Quote from: Don Cullen on October 18, 2007, 08:14 PM
There is another machine on the network, but it's Win Vista. I tried copying over my bot, but it wasn't able to run the bot.

I also ran StarCraft (edit: on my machine), logged on, with WireShark packetlogging it.

Guess what? WireShark shows UDP traffic at the port 6112.


This is bewildering.

Edit: Tried updating VB to SP6. Update was successful. UDP still didn't work though.

Checked mswinsck.ocx version, it's 6.1.97.82. Compared that to RealityRipple's, he had 6.1.97.82, and UDP works fine for him.

Also tried rebooting. Still the same result.

Edit 2: Performed a hard reset of router, and set machine to DMZ once more, the results are still the same.

squiggly

Quote from: Don Cullen on October 18, 2007, 07:45 PM
I've been having problems getting UDP to work on my machine.

Basically, I added UDP support to my bot. But for some inexplicable reason I was not receiving any UDP packets, even after sending 0x08 or 0x09.

My machine is DMZ'ed, firewall and anti-virus is disabled. So those aren't the issues.

I sent a copy of my bot to l2k-Shadow, and without any modifications, the bot worked fine, INCLUDING UDP support. This came as a surprise to me.

I packet logged via WireShark. No UDP packets...

RealityRipple sent me the source to one of his bots, I added UDP support to it, tested it-- didn't work. Sent the bot back to RealityRipple INCLUDING UDP support. He tested it without any modifications. UDP worked fine.

Now, here's the interesting thing. I went in Starcraft, went on battle.net, and joined a game. Game started. Played. Lost. I won't get into details, but the point is, game was fine. I know for a fact games require UDP. So UDP seems to be working?

This is driving me insane.

So I can confirm it isn't my code. It's likely an issue on my machine or in my network. Or maybe an issue with the winsock driver on my machine? I'm fresh out of ideas.

l2k-Shadow, RealityRipple, and DevCode also were fresh out of ideas.

Any ideas you guys could suggest to pinpoint the problem?
- Posso usar um tradutor de língua, devo ser fresco agora!

Banana fanna fo fanna

I feel like there's a NAT somewhere that you missed. Oftentimes when one sends a UDP packet on a certain post to a certain host, the NAT opens a hole in the firewall for packets coming from that host and that port. This is how two people behind NATs can play StarCraft. I'd suggest sending a dummy UDP packet to the host you're trying to reach (BNET) on the port you're trying to use (6112?) before trying to login.

UserLoser

what are you setting the local port to for the UDP socket ?

Don Cullen

#13
Quote from: Banana fanna fo fanna on October 19, 2007, 12:22 AM
I feel like there's a NAT somewhere that you missed. Oftentimes when one sends a UDP packet on a certain post to a certain host, the NAT opens a hole in the firewall for packets coming from that host and that port. This is how two people behind NATs can play StarCraft. I'd suggest sending a dummy UDP packet to the host you're trying to reach (BNET) on the port you're trying to use (6112?) before trying to login.

0x09 is sent prior to logon. No response is gotten. WireShark doesn't even catch the 0x09 outgoing udp packet.

Quote from: UserLoser on October 19, 2007, 12:29 AM
what are you setting the local port to for the UDP socket ?

6112.

I uploaded the source if you'd like to see if the UDP works fine.

If you do test it, basically, you should get a pop up msgbox saying "Got udp" when an udp packet comes in. For me, nothing pops up, but for the others who've tested it so far, it did pop up for them.

http://www.bnetdocs.org/archives/SanityOCX.zip
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Chriso

Shouldn't you be calling BNETUDP.Connect() instead of BNETUDP.Bind()?