• 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

#15
Quote from: Chriso.de on October 19, 2007, 01:04 AM
Shouldn't you be calling BNETUDP.Connect() instead of BNETUDP.Bind()?

UDP is stateless/connectionless, so no. .Bind is used.

For more information on UDP:

http://en.wikipedia.org/wiki/User_Datagram_Protocol

Edit:

I just realized something. It's definitely not a network issue.

Here's my logic:

SanityOCX sends 0x09 (udp) during the connection rountine. That's an originating packet. So, as per that logic, even if there was network issues preventing outgoing UDP packets, WireShark should have been able to log the outgoing UDP packet at the very least since it originated on my machine. The fact WireShark logged absolutely no UDP packets, either outgoing or incoming, indicates that it isn't a network issue, the issue is on my machine.

So we definitely can rule out network issues, especially all the more so since my machine has a static ip, and has DMZ set for it.
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

Ahh I see, I've never really been interested in UDP protocol, guess I should have a read.

Banana fanna fo fanna


tagban

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.

Vista works fine with VB bots. I can still use Invigoration. You need to make sure all the OCX files and whatnot are registered on your Vista machine though just like you would an XP machine. I also have Visual Studio 6 installed on this vista machine.

Leaky

sound like your windows firewall didn't allow your program to send try manually adding it to the allowed list on the windows firewall

Falcon[anti-yL]

Quote from: Leaky on October 19, 2007, 08:51 AM
sound like your windows firewall didn't allow your program to send try manually adding it to the allowed list on the windows firewall

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

Leaky

i do ISP tech support so i can tell you that disabling the windows firewall doesn't always disable it.. that's like saying turning off automatic updates turns automatic updates off... i would still add your program to the exception list trust me i've seen that be the issue way to many times to ignore it

Barabajagal

That's why one disables the Windows Firewall and Automatic Update services ;D

Michael

what router do you use? as some linksys routers have dmz problems. and since starcraft uses upnp (i think, don't quite remember.) that would explain why it works and your bot doesn't. or reformat :D

Don Cullen

I added the application to the exception. No change.

I'm using a DI-604 router to go online. However, I just went over to my girlfriend's home, and went on their internet (2wire), then tested my program. No change.

So it's definitely not a network issue. The problem is localized on my laptop. I'm not sure what's wrong... :\

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'.

Kp

What does sendto return when you try to send the datagram?  What is the value of the last error code?
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Don Cullen

#26
Quote from: Kp on October 20, 2007, 10:58 AM
What does sendto return when you try to send the datagram?  What is the value of the last error code?

Sendto? And how would I obtain the value of the last error code?

Edit: The value of last error code is 0. As in zero. Using FormatMessage in conjunction with lastdllerror, it returns: The operation completed successfully.

I'm not sure what you mean by 'sendto'... I just googled it, VB 6 doesn't make use of sendto. However, if the socket had errored when attempting transmission, I assume it'd trip the error event.

Private Sub BNETUDP_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String,
ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
    RaiseError 4
    OCXEvents 1, "BNETUDP Error #" & Trim(Str(Number)) & ": " & Description
    RaiseEvent BNETConnectionStatus(False)
    BNETUDP.Close
    BNETSock.Close
    BNLSSock.Close
End Sub


It doesn't raise the error. So I assume, as far as VB knows, it was successful (which is wrong, as WireShark shows no outgoing UDP packets).

[Edit: broke up long line that was disrupting table layout.]
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'.

devcode

Quote from: Don Cullen on October 20, 2007, 11:13 AM
Quote from: Kp on October 20, 2007, 10:58 AM
What does sendto return when you try to send the datagram?  What is the value of the last error code?

Sendto? And how would I obtain the value of the last error code?

Edit: The value of last error code is 0. As in zero. Using FormatMessage in conjunction with lastdllerror, it returns: The operation completed successfully.

I'm not sure what you mean by 'sendto'...

sendto and recvfrom are the winsock api used for udp

Ringo

Just at a glance of replys, I would guess the problem is your remote address (that is, if its bind'ing)
afaik, you should resolve the host name to the ip address with the TCP socket, then use the result address to send UDP messages to.

hope this helps

Don Cullen

What the flaming hell? I opened VB 6 again, and ran the bot once again, knowing it'd have the same results. No modifications or anything.

And what do you know? NOW it's receiving UDP packets. When I get home Sunday night, I'll test the bot again. If it stops working at home, then it's a network issue.

Either that or I'm incredibly unlucky.
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'.

|