Skip to content

trouble connecting the bot to servers #360

Closed

Description

@ChillerDragon

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"]}

Activity

  1. adepierre commented on Jul 10, 2026

    @adepierre
    Owner

    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.x when 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.

  2. ChillerDragon commented on Jul 10, 2026

    @ChillerDragon
    Author

    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.4 did actually work for 2b2t. At least the log looks okay I did not verify if I actually connected.

    $ ./bin/0_HelloWorld --address 2b2t.org --login ""
    [2026-07-10 17:14:51.919] [ INFO  ] [main(140402188000192)] main.cpp(62): Starting connection process
    [2026-07-10 17:14:51.920] [ INFO  ] [main(140402188000192)] Authentifier.cpp(87): Cached Minecraft token for Microsoft account still valid.
    [2026-07-10 17:14:51.920] [ INFO  ] [main(140402188000192)] Authentifier.cpp(90): Getting player certificates...
    [2026-07-10 17:14:51.920] [ INFO  ] [main(140402188000192)] Authentifier.cpp(941): Starting player certificates acquisition process...
    [2026-07-10 17:14:52.498] [ INFO  ] [main(140402188000192)] Authentifier.cpp(96): Player certificates obtained!
    [2026-07-10 17:14:52.498] [ INFO  ] [main(140402188000192)] TCP_Com.cpp(254): Performing SRV DNS lookup on _minecraft._tcp.2b2t.org to find an endpoint
    [2026-07-10 17:14:52.519] [ INFO  ] [main(140402188000192)] TCP_Com.cpp(314): SRV DNS lookup successful!
    [2026-07-10 17:14:52.522] [ INFO  ] [main(140402188000192)] TCP_Com.cpp(30): Trying to connect to connect.2b2t.org:25565
    [2026-07-10 17:14:52.534] [ INFO  ] [NetworkIOService(140402078250688)] TCP_Com.cpp(101): Connection to server established.
    

    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.

  3. adepierre commented on Jul 10, 2026

    @adepierre
    Owner

    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.

  4. ChillerDragon commented on Jul 10, 2026

    @ChillerDragon
    Author

    Ok cool thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions