ammaraskar / pyCraft

Minecraft-client networking library in Python
Other
805 stars 183 forks source link

My PyCraft client gets disconnected from server #98

Open Czikoss opened 6 years ago

Czikoss commented 6 years ago

Hi, my PyCraft client is getting disconnected from public server (Internal Network Exception) when i'm sending any chat message starting with "/". I checked on oryginal MC client and it is not disconnecting me from server. I checked Minecraft Console Client and it isnt getting disconnected as well. Checked on different server and it isnt disconnecting PyCraft client. So i dont know if problem is on client site or server site, but i just really want my bot to work :P

joodicator commented 6 years ago

Hello; thanks for the report. Can you set packet listeners as in start.py to print the incoming and outgoing packets, and post here the packet log preceding the disconnection?

Czikoss commented 6 years ago
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x2E PlayerListItemPacket
IN: 0x0F ChatMessagePacket(json_data='{"text":"§aJestes zalogowany, wybierz serwer."}', position=GAME_INFO)
Message (GAME_INFO): {"text":"§aJestes zalogowany, wybierz serwer."}

OUT: 0x02 ChatPacket(message='/test')
IN: 0x1A DisconnectPacket(json_data='{"text":"Internal Network Exception"}')

I'm using slightly modified start.py, so it was printing all packets already :) It happens every single time i try sending some command, but only using PyCraft and on this exact server.

edit: now i think that it can be some protocol version problem, but not i'm sure how to define protocol version that i want my bot to use

Czikoss commented 6 years ago

I'm getting this error

[...]
minecraft\networking\connection.py", line 128, in __init__
    allowed_versions = set(map(proto_version, allowed_versions))
TypeError: 'int' object is not iterable

when connection = Connection( ADRESS_IP, username=NICK,allowed_versions=340)

ammaraskar commented 6 years ago

try

allowed_versions=[340]

Also, is there any way you can get the error stack trace on the server side if it gets printed?

Czikoss commented 6 years ago

I don't think getting server side error stack trace from this server is possible for me, but i will try anyway