From b9b44a62bcd13a20e48dff5b2c12e2f40934d56d Mon Sep 17 00:00:00 2001 From: Bigjango13 Date: Sun, 21 Jan 2024 18:24:06 -0500 Subject: [PATCH] Fix worldgen desync (and add some symbols) --- dependencies/symbol-processor/src | 2 +- mods/src/server/server.cpp | 5 +++++ symbols/CMakeLists.txt | 1 + symbols/src/entity/Entity.def | 10 +++++++--- symbols/src/network/packet/Packet.def | 1 + symbols/src/network/packet/PlayerEquipmentPacket.def | 7 +++++++ 6 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 symbols/src/network/packet/PlayerEquipmentPacket.def diff --git a/dependencies/symbol-processor/src b/dependencies/symbol-processor/src index 930eae47c6..6b4d6d9239 160000 --- a/dependencies/symbol-processor/src +++ b/dependencies/symbol-processor/src @@ -1 +1 @@ -Subproject commit 930eae47c6353a4dceba3e483f022aa76369ddaf +Subproject commit 6b4d6d923910f66830d511d4dd8cb3ca4552bd02 diff --git a/mods/src/server/server.cpp b/mods/src/server/server.cpp index f07b6a33c2..ad77583c1b 100644 --- a/mods/src/server/server.cpp +++ b/mods/src/server/server.cpp @@ -572,6 +572,11 @@ static void server_init() { patch((void *) 0x1685c, player_patch); // Start World On Launch misc_run_on_update(Minecraft_update_injection); + // Send the full level, not only changed chunks + unsigned char nop[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" + patch((void *) 0x717c4, nop); + unsigned char mov_r3_ff[4] = {0xff, 0x30, 0xa0, 0xe3}; // "mov r3, #0xff" + patch((void *) 0x7178c, mov_r3_ff) // Set Max Players unsigned char max_players_patch[4] = {get_max_players(), 0x30, 0xa0, 0xe3}; // "mov r3, #MAX_PLAYERS" patch((void *) 0x166d0, max_players_patch); diff --git a/symbols/CMakeLists.txt b/symbols/CMakeLists.txt index 4f8f5e0453..7b84c3ef89 100644 --- a/symbols/CMakeLists.txt +++ b/symbols/CMakeLists.txt @@ -22,6 +22,7 @@ set(SRC src/network/raknet/RakNet_RakPeer.def src/network/ServerSideNetworkHandler.def src/network/packet/LoginPacket.def + src/network/packet/PlayerEquipmentPacket.def src/network/packet/Packet.def src/network/packet/StartGamePacket.def src/network/packet/ChatPacket.def diff --git a/symbols/src/entity/Entity.def b/symbols/src/entity/Entity.def index bc0a07bcc8..a004387179 100644 --- a/symbols/src/entity/Entity.def +++ b/symbols/src/entity/Entity.def @@ -1,3 +1,4 @@ +virtual-method void tick() = 0x34; virtual-method bool hurt(Entity *attacker, int damage) = 0xa4; virtual-method int getEntityTypeId() = 0xdc; method void moveTo(float x, float y, float z, float pitch, float yaw) = 0x7a834; @@ -5,11 +6,14 @@ method void moveTo(float x, float y, float z, float pitch, float yaw) = 0x7a834; property float x = 0x4; property float y = 0x8; property float z = 0xc; -property float yaw = 0x40; -property float pitch = 0x44; +property int id = 0x1c; property float old_x = 0x28; property float old_y = 0x2c; property float old_z = 0x30; +property float yaw = 0x40; +property float pitch = 0x44; property float old_yaw = 0x48; property float old_pitch = 0x4c; -property int id = 0x1c; +property float head_height = 0x68; +property bool on_ground = 0xb2; +property bool freeze_physics = 0xb9; diff --git a/symbols/src/network/packet/Packet.def b/symbols/src/network/packet/Packet.def index b4d5519d70..abfa163c8f 100644 --- a/symbols/src/network/packet/Packet.def +++ b/symbols/src/network/packet/Packet.def @@ -1 +1,2 @@ +constructor () = 0x6fc18; virtual-method void read(uchar *bit_stream) = 0xc; diff --git a/symbols/src/network/packet/PlayerEquipmentPacket.def b/symbols/src/network/packet/PlayerEquipmentPacket.def new file mode 100644 index 0000000000..b953251639 --- /dev/null +++ b/symbols/src/network/packet/PlayerEquipmentPacket.def @@ -0,0 +1,7 @@ +extends Packet; + +vtable 0x105e70; + +property int entity_id = 0xc; +property ushort item_id = 0x10; +property ushort item_aux = 0x12;