• Welcome to Valhalla Legends Archive.
 

Lost UDP?

Started by ;i, December 21, 2004, 08:22 PM

Previous topic - Next topic

;i

I am writing a battle.net proxy program that sits between battle.net and the game client, relaying messages from each.  The problem that I am having is that when logged on through the proxy, I can no longer join games.  The packet is sent requesting the game list, the server replies, and then nothing happens.  Any attempt to join a game results in a "Latency too high" error.  When logging without the proxy, UDP pings are sent to each game in the list.  These pings don't seem to be sent off with the proxy in place.  If anyone has suggestions, I'm open.

Mephisto

I think that error results when Battle.net determines that the time it takes to send packets between the game host and the client is too long.  This is probably because you're using a proxy which are known to be extremely slow/laggy.

;i

Somehow, I don't think so.  The proxy software is local so any time spent communicating with it would be next to 0.

;i

It looks like this:

Starcraft <-> Proxy <-> Battle.net

All the proxy does is forward data, no proxying protocol involved.

tA-Kane

Be sure that your proxy is relaying data for not only TCP, but UDP as well, especially if the proxy is on a different public IP address. If the server thinks your client IP is one thing (your proxy's address), but it's really another (your local IP), then it may report that IP address to clients whom wish to join your game.

Additionally, if your proxy is running on the same machine and has the UDP socket bound to the same port as the client binds its UDP socket to (a very annoying thing, in my opinion, but I've heard it's possible under some operating systems), that could be the cause.

Have you tried setting up a game server on a different machine, and then packetlogging data on both machines for both connection setups (client connecting with and without proxy)? That may be useful if both of my other ideas are unhelpful.
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

;i

#5
I am relaying data for UDP as well, as I receive the initial UDP pings during the logon process.  I have not yet tried creating a game, but for the moment, it is joining that I would like to get working.  I do bind my UDP socket to 6112, so I guess that could be the problem, but I don't see any alternative if I want to be able to receive the UDP data during logon.  No, I've not tried setting up a server on a different machine and logging both...  Mainly because I don't have a server.

Edit: Last night, I tried using a proxy UserLoser made and tested on his computer.  He said that he was able to join games with it, but when I attempted to use it, logging on told me that I didn't support UDP.  So I don't know if that's indicative of a problem with my connection or problems with the software.

iago

The problem is that when you join a game, the other players are given your "address", which happens to be the address of the proxy.  They all send their UDP packets to the proxy, and the proxy has no idea what to do with them (how is it supposed to know the UDP packets are destined for you?). 
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


;i

#7
The address of the proxy is my address.

Edit: And I hadn't tested this before, but this morning, I was able to create a game and people were able to join it just fine...  So I don't know what's going on with my being able to join games.

Adron

Both you and Starcraft want to bind to the same port. If you're on an OS where it succeeds, perhaps who actually gets the packets will be different from time to time.

You need to modify packet contents to translate IP addresses to connect to as well as ports of clients if you want the packets to pass through your proxy. This you have to do both to parts of the tcp stream and to the udp data.

If you don't want the udp packets to pass through your proxy, and they're on the same IP, just don't bind any udp port in your proxy and everything should work just fine.

;i

Quote from: Adron on December 22, 2004, 01:14 PM
You need to modify packet contents to translate IP addresses to connect to as well as ports of clients if you want the packets to pass through your proxy. This you have to do both to parts of the tcp stream and to the udp data.

Which TCP packets need modifying?  When I request game list and get host IP/port, shouldn't the game client respond to receiving that by sending UDP pings to each host?

Quote from: Adron on December 22, 2004, 01:14 PM
If you don't want the udp packets to pass through your proxy, and they're on the same IP, just don't bind any udp port in your proxy and everything should work just fine.

I tried just doing the TCP and (as with using UserLoser's proxy), I was given the no UDP support error and greyed out Create/Join buttons in Starcraft.

UserLoser.

My proxy just forwarded TCP, I was able to join games and didn't get the no UDP icon when logging on.  Odd?

;i

Something else that's rather odd...  I ran the proxy on my system and connected to it using Brood War on another computer.  That one is able to join games even with the proxy in place.

MyndFyre

Quote from: UserLoser on December 22, 2004, 02:19 PM
My proxy just forwarded TCP, I was able to join games and didn't get the no UDP icon when logging on.  Odd?

So then perhaps you can be sending data from a different apparent IP address than the TCP data is coming?
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.

Adron

Quote from: ;i on December 22, 2004, 01:54 PM
Quote from: Adron on December 22, 2004, 01:14 PM
You need to modify packet contents to translate IP addresses to connect to as well as ports of clients if you want the packets to pass through your proxy. This you have to do both to parts of the tcp stream and to the udp data.

Which TCP packets need modifying?  When I request game list and get host IP/port, shouldn't the game client respond to receiving that by sending UDP pings to each host?

If you want the packets to pass through your proxy, you need to modify the host IP/port to point to your proxy..... Shouldn't that be obvious?

;i

Quote from: Adron on December 23, 2004, 10:16 PM
If you want the packets to pass through your proxy, you need to modify the host IP/port to point to your proxy..... Shouldn't that be obvious?

Oh, you mean excepting the fact that it works completely for some people as is?  And that for others, they can create games fine, but not join them?  And others are told they have no UDP on connect?  All with the same build, I might add.  This sounds like a problem other than the "obvious" modification of host IP and port.