adepierre / Botcraft

Botcraft is a cross-platform C++ library to create bots that connect and interact with Minecraft servers with (optional) integrated OpenGL renderer
GNU General Public License v3.0
405 stars 43 forks source link

Not connecting to the server #101

Closed SeaN0X closed 1 year ago

SeaN0X commented 1 year ago

I've downloaded the binaries, started a local minecraft server and tried to execute this line on binaries folder:

5_MobHitterExample.exe --address 192.168.0.101 --login "examplenickname"

the program returns this log:

[2022-11-08 13:49:50.683] [INFO] [main(7244)] AssetsManager.cpp(33): Loading blocks from file...
[2022-11-08 13:50:04.813] [INFO] [main(7244)] AssetsManager.cpp(35): Done!
[2022-11-08 13:50:04.820] [INFO] [main(7244)] AssetsManager.cpp(36): Loading biomes from file...
[2022-11-08 13:50:04.825] [INFO] [main(7244)] AssetsManager.cpp(38): Done!
[2022-11-08 13:50:04.826] [INFO] [main(7244)] AssetsManager.cpp(39): Loading items from file...
[2022-11-08 13:50:04.841] [INFO] [main(7244)] AssetsManager.cpp(41): Done!
[2022-11-08 13:50:04.841] [INFO] [main(7244)] AssetsManager.cpp(43): Loading textures...
[2022-11-08 13:50:10.172] [INFO] [main(7244)] Atlas.cpp(144): All textures packed, resultant atlas size: 816x816
[2022-11-08 13:50:10.288] [INFO] [main(7244)] AssetsManager.cpp(46): Done!
[2022-11-08 13:50:10.289] [INFO] [main(7244)] AssetsManager.cpp(47): Updating models with Atlas data...
[2022-11-08 13:50:14.099] [INFO] [main(7244)] AssetsManager.cpp(49): Done!
[2022-11-08 13:50:14.123] [INFO] [main(7244)] AssetsManager.cpp(51): Clearing cache from memory...
[2022-11-08 13:50:14.682] [INFO] [main(7244)] AssetsManager.cpp(53): Done!
[2022-11-08 13:50:14.686] [INFO] [main(7244)] main.cpp(83): Starting connection process
[2022-11-08 13:50:14.696] [INFO] [main(7244)] TCP_Com.cpp(245): Performing SRV DNS lookup on _minecraft._tcp.192.168.0.101 to find an endpoint
[2022-11-08 13:50:14.734] [WARNING] [main(7244)] TCP_Com.cpp(308): SRV DNS lookup failed to find an address
[2022-11-08 13:50:14.738] [INFO] [main(7244)] TCP_Com.cpp(28): Trying to connect to 192.168.0.101:25565
[2022-11-08 13:50:14.742] [INFO] [NetworkIOService(5928)] TCP_Com.cpp(93): Connected to server.

After all this log the program just closes.

On the last log line it says "Connected to server", but the server prompt haven't logged any new player on the game, i've also tried to connect to the server and test myself if the bot is joining, but nothing happens.

My server software is Cuberite.

I don't know if i did something wrong.

adepierre commented 1 year ago

Hello and thanks for the detailed report!

Could you confirm the same exe works for you with a vanilla server? I'll try to see if I can reproduce the issue with a Cuberite server.

Edit: just to make sure, your Cuberite server is using version 1.19.2 right? Edit: After checking, it seems that Cuberite only supports clients from 1.8 to 1.12.2, so precompiled binaries won't work as they are for 1.19.2.

You'll have to compile Botcraft and the example targeting 1.12.2 if you want to connect to Cuberite.

SeaN0X commented 1 year ago

It works as expected now! Thanks.