Login problems with Forge on MCServer
#1
Hi all!
I'm currently developping with MCServer, and I'm trying to make it compatible with clients using the Forge mod.

However, the 124 protocol methods are being called, and I cannot understand why I'm getting disconnected.

Does anyone have an idea that could help me?
Reply
Thanks given by:
#2
Hi, welcome to the forums.

I suppose you meant the 1.2.5 protocol, since there's no specific 1.2.4 code. Smile

The difference between 1.2.5 and higher protocols is quite large and the protocol isn't 100 % distinguishable, so MCServer tries to guess whether it's 1.2.5 or higher. See the cProtocolRecognizer class, there's a TryRecognizeProtocol() function. I'd recommend setting a breakpoint there and stepping through that function when your client connects, to see what's wrong.

Basically, the function expects that only two packets may arrive at the beginning of the communication: 0x02 (HANDSHAKE) or 0xfe (SERVER PING). If any other packet type arrives, the function effectively fails forever (which I don't suppose is your case). If the SERVER PING packet arrives, it is handled directly by the cProtocolRecognizer class and the socket gets closed.
Upon receiving a HANDSHAKE packet, the function looks at the first byte of the packet data. Newer protocols send their versions there, whereas the old protocol sends player name length there. Since player names are not supposed to be longer than some 0x3900 bytes (minimum version that sends the Version field there, 1.3.2), if it sees a byte that corresponds to any specifically implemented protocol version, it recognizes that version; otherwise it uses 1.2.5 as default.

So I'm guessing your client is sending an unknown protocol version, therefore it's getting the 1.2.5 default. Try to add that protocol version to the switch statement and it should work, but no guarantees about the protocol being the same. Note that MCServer doesn't implement Weekly protocols, only official releases, so if your client is a Weekly, it probably won't work.

Damn, I'm chattyTongue
Reply
Thanks given by: Boblepointu
#3
Thank's you for this answer Smile
It give us somes clue on how to resolve our problem !
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)