Repository navigation
trouble connecting the bot to servers #360
Copy link
Copy link
Closed
Description
Hi I just started playing around with this. Looks like a cool project thanks for that ❤️
I could use some help to get things started. I managed to login but did not manage to connect the bot to the two online servers I tried.
$ ./bin/0_HelloWorld --address 2b2t.org --login ""
[2026-07-10 10:30:57.560] [ INFO ] [main(140454477720512)] main.cpp(62): Starting connection process
[2026-07-10 10:30:57.561] [ INFO ] [main(140454477720512)] Authentifier.cpp(87): Cached Minecraft token for Microsoft account still valid.
[2026-07-10 10:30:57.561] [ INFO ] [main(140454477720512)] Authentifier.cpp(90): Getting player certificates...
[2026-07-10 10:30:57.561] [ INFO ] [main(140454477720512)] Authentifier.cpp(941): Starting player certificates acquisition process...
[2026-07-10 10:30:58.351] [ INFO ] [main(140454477720512)] Authentifier.cpp(96): Player certificates obtained!
[2026-07-10 10:30:58.351] [ INFO ] [main(140454477720512)] TCP_Com.cpp(254): Performing SRV DNS lookup on _minecraft._tcp.2b2t.org to find an endpoint
[2026-07-10 10:30:58.372] [ INFO ] [main(140454477720512)] TCP_Com.cpp(314): SRV DNS lookup successful!
[2026-07-10 10:30:58.396] [ INFO ] [main(140454477720512)] TCP_Com.cpp(30): Trying to connect to connect.2b2t.org:25565
[2026-07-10 10:30:58.408] [ INFO ] [NetworkIOService(140454425257664)] TCP_Com.cpp(101): Connection to server established.
[2026-07-10 10:30:59.574] [ INFO ] [NetworkPacketProcessing - ZillyHuhn(140454433650368)] ConnectionClient.cpp(99): Disconnect during login with reason: {"color":"gold","text":"Server is on versions 1.12.2 to 1.21.11"}
$ ./bin/0_HelloWorld --address zillyhuhn.com --login ""
[2026-07-10 10:31:45.310] [ INFO ] [main(140289289239488)] main.cpp(62): Starting connection process
[2026-07-10 10:31:45.311] [ INFO ] [main(140289289239488)] Authentifier.cpp(87): Cached Minecraft token for Microsoft account still valid.
[2026-07-10 10:31:45.311] [ INFO ] [main(140289289239488)] Authentifier.cpp(90): Getting player certificates...
[2026-07-10 10:31:45.311] [ INFO ] [main(140289289239488)] Authentifier.cpp(941): Starting player certificates acquisition process...
[2026-07-10 10:31:45.964] [ INFO ] [main(140289289239488)] Authentifier.cpp(96): Player certificates obtained!
[2026-07-10 10:31:45.965] [ INFO ] [main(140289289239488)] TCP_Com.cpp(254): Performing SRV DNS lookup on _minecraft._tcp.zillyhuhn.com to find an endpoint
[2026-07-10 10:31:45.977] [ INFO ] [main(140289289239488)] TCP_Com.cpp(314): SRV DNS lookup successful!
[2026-07-10 10:31:45.979] [ INFO ] [main(140289289239488)] TCP_Com.cpp(30): Trying to connect to lgl.zillyhuhn.com:25565
[2026-07-10 10:31:45.995] [ INFO ] [NetworkIOService(140289236788928)] TCP_Com.cpp(101): Connection to server established.
[2026-07-10 10:31:46.080] [ INFO ] [NetworkPacketProcessing - ZillyHuhn(140289245181632)] ConnectionClient.cpp(99): Disconnect during login with reason: {"translate":"multiplayer.disconnect.incompatible","with":["1.21.8"]}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
adepierre commentedon Jul 10, 2026
Hello, it looks like you are using botcraft compiled for (probably) the latest version (currently 26.2), but the servers only support 1.12.2 to 1.21.11 for 2b2t and 1.21.8 for zillyhuhn. If you are compiling it from source you can use
-DBOTCRAFT_GAME_VERSION=x.xx.xwhen configuring cmake to change the version. If you are using the precompiled binaries from the release page and a version is missing, you can request it using this link.ChillerDragon commentedon Jul 10, 2026
Oh yes I am using self compiled at 3eafaf5 without any cmake flags sorry for not specifying that.
Nice it looks like
cmake .. -DBOTCRAFT_GAME_VERSION=1.21.4did actually work for 2b2t. At least the log looks okay I did not verify if I actually connected.I did not expect the version to be fixed at compile time. I was looking for a version string in the example code. When I did not find that I assumed it would just detect the version based on what the server sends. Is this documented somewhere and I missed it? Maybe the runtime error message could also mention the cmake flag.
adepierre commentedon Jul 10, 2026
C++ is a compiled language and the packets fields can change from a version to another. So in order to know which fields should be present for each packet at compile time we need to know the version while compiling.
You can find all the available compilation flags in the building section of the readme.
The runtime error message is sent by the server and is not standardized (you can see with your two examples that the messages are completely different for the same error). It is not really feasible to parse the reason sent by the server to know that it's because of a version mismatch.
ChillerDragon commentedon Jul 10, 2026
Ok cool thanks