Open KingRainbow44 opened 3 years ago
cant really debug this either because of the indirect reference.
edit: forgot about logging the file from exceptions. file:
phar:///home/container/plugins/BigBrother.phar/src/shoghicp/BigBrother/network/protocol/Play/Server/UpdateViewPositionPacket.php
update: OutboundPacket ids might be outdated. UPDATE_VIEW_POSITION_PACKET
belongs to 0x40
which was taken by SET_EXPERIENCE_PACKET
which is actually 0x48
edit: 100% the ids are outdated. another error from:
phar:///home/container/plugins/BigBrother.phar/src/shoghicp/BigBrother/network/protocol/Play/Server/UpdateHealthPacket.php
Undefined constant shoghicp\BigBrother\network\protocol\Play\Server\UpdateHealthPacket::UPDATE_HEALTH_PACKET
edit 2: that error above was my doing (I commented out the update_health_packet line). ig ill take some time to refactor the packets class
update: it seems like the OutboundPacket class actually contains Client Bound Packets and InboundPacket actually contains Server Bound Packets its either this or my source is wrong. edit: i have refactored the classes to the opposite of each other. will be trying to implement the missing packets shortly edit 2: this was not the smartest of decisions as now every packet class extends the "wrong" class (by name) but it will work for debugging purposes for now edit 3: ill have to revert my changes but yes, most of the packets are messed up
update: i will begin refactoring packet ids. im using this to get the ids. edit: just want to note that only SOME ids are incorrect. not all. edit 2: finished updating InboundPacket ids. edit 3: finished updating OutboundPacket ids. edit 4: packets are STILL messed up because of the naming scheme. inboundpacket contains outbound and vice versa. i wont fix this issue but someone else can after cherry-picking commits from my fork
update: packet ids have been updated, im now going to test and pray this works! edit 1: the refactor does work but now there's a few other issues. will continue bug fixing. edit 2: the player can now connect, but is immediately disconnected because of a buffer issue
We thank you for your cooperation. To tell the truth, I don't have a Java version of Minecraft and I worked with my friends. So I knew that the java version of Minecraft version 1.16.5 couldn't connect and the packet was the cause, but I couldn't fix the program because I didn't know where to fix it. bottom. I'm sorry I can't do anything. Would you please send me a pull request when you're done? Again, thank you for your cooperation.
as long as you have a pc or an android phone you can connect using offline mode using a separate launcher like TLauncher. and for sure I will send a pull request when I get a working version
EDIT
The title is not related to this initial issue. It is related to everything that happens after.
Issue description
UpdateViewPositionPacket::UPDATE_VIEW_POSITION_PACKET is undefined. This is caused by the ProtocolTranslator. I got the message after changing the catch block to send the exception message.
$data = chr(ServerManager::PACKET_SEND_PACKET) . Binary::writeInt($target) . $packet->write();
Prerequisite
BigBrother, Clean PMMP server, PHP 8.0.
How to reproduce
Connect to the server on 1.16.5.
Server log(crash dump)