SpockBotMC / RikerBot

C++20/Python based Minecraft bot
zlib License
46 stars 7 forks source link

ValueError: invalid null reference in method 'ServerboundLoginStart_username_set', argument 2 of type 'std::string const &' #18

Closed Powana closed 3 years ago

Powana commented 3 years ago

Error occurs when starting the SimpleClient in the example plugin, if the server the client is connecting to is up. Installation seems to be fine, no errors when importing.

The full traceback is:

Traceback (most recent call last):
  File "/<path>/.venv/lib/python3.9/site-packages/rikerbot/plugins/StartPlugin.py", line 30, in handle_connect
    packet.username = self.auth.username
ValueError: invalid null reference in method 'ServerboundLoginStart_username_set', argument 2 of type 'std::string const &'

Server output is: [14:24:36] [Server thread/INFO]: /[0:0:0:0:0:0:0:1%0]:48808 lost connection: Disconnected

Tried on 1.16.4/5 server, on Arch.

nickelpro commented 3 years ago

Pretty certain this is a login failure that's failing to be logged/propagate correctly.

The login fails on something, expired token, Yggdrasil error, w/e, therefore the username doesn't get set, so Python tries to fill in the LoginStart structure it passes a null reference for the username. Need to track down why we're not catching the login failure initially.