ok tomas, i'll take the time to explain this to you one more time, just because you are doing this in java, and there are not that much support around.
Before i begin, i'll restate that what ever i am going to tell you now has been mentioned, but better organized. But i'll be pissed off if you are NOT going to read and understand EVERY word.
1. client detects if the IP in the auth msg is 127.0.0.1, that is a clear sign of proxy usage. So, 127.0.0.1 cannot be used; you know this already through testing.
2. You have to feedback an ip to your client so that it knows what to connect to. All you need to do is to find what your current IP is. Start cmd prompt, type in "ipconfig" without the qoutation marks. Look for [IPv4 address]. If you do not know how to do cmd prompt, go to Control Panel -> Network and Internet -> Network Connections, double click the network adapter you are using -> details, check for IPv4 address. It does not matter what kind of network you are connected to, it will give you a xx.xx.xx.xx address.
Now you know what your IPv4 address is, you have what you want to send to the client.
With this, all your previous questions have been FULLY answered. If you have any doubts, just re-read all my posts.
Regarding the extra packet that client is sending to login server. I do not know what it is, but i have observed that this packet do exist. I have done tests with it, and i found out that this packet is not always sent. and does not matter if you dont send it to auth server. Probably is just some double checking packet only. This is only my perception.
So, this is probably what you should have done.
connect to auth server,
obtain password seed from server, relay to client
get auth request from client, relay to server
get auth msg from server, edit IP (and port depending on your implementation), start a socketlistener game connection, relay auth msg to client.
Then your Log in is complete. ( the last packet that you just detect can be ignored completely)
As for the game packet relay part. Since you already know from auth msg where your game server is, AND you have already set up your socket listener for client connection, simply upon client connect, relay this connection to actual game server. Ignore all the packet encryption for a start.. just concentrate on getting the packets going.
Here is an example
Code:
byte[] packetBuffer = byte[6000]; // some times if you log in on a map with too many players, there will be a huge packet coming.
if (clientGameSocket.available() > 0)//packet buffer has data
{
int packetSize = clientGameSocket.read(packetBuffer);
serverGameSocket.write(packetBuffer, packetSize);
}
Just a sample snippet for handling unprocessed packets going from client to server.
Last but not least, I really suggest you sit down with a piece of paper and a pen, sort out your logic before going back to your codes.
That is really all my input, and i do not believe this can be simplified any further.