pet the dog more often during login

This commit is contained in:
p2r3
2025-08-20 06:37:28 +03:00
parent a89043394c
commit a2b0796988

View File

@@ -97,6 +97,8 @@ void handlePacket (int client_fd, int length, int packet_id) {
sc_synchronizePlayerPosition(client_fd, spawn_x, spawn_y, spawn_z, spawn_yaw, spawn_pitch);
wdt_reset();
for (uint8_t i = 0; i < 41; i ++) {
sc_setContainerSlot(client_fd, 0, serverSlotToClientSlot(0, i), player->inventory_count[i], player->inventory_items[i]);
}
@@ -113,6 +115,8 @@ void handlePacket (int client_fd, int length, int packet_id) {
sc_startWaitingForChunks(client_fd);
sc_setCenterChunk(client_fd, _x, _z);
wdt_reset();
// Send spawn chunk first
sc_chunkDataAndUpdateLight(client_fd, _x, _z);
for (int i = -2; i <= 2; i ++) {
@@ -124,6 +128,8 @@ void handlePacket (int client_fd, int length, int packet_id) {
// Re-synchronize player position after all chunks have been sent
sc_synchronizePlayerPosition(client_fd, spawn_x, spawn_y, spawn_z, spawn_yaw, spawn_pitch);
wdt_reset();
// Register all existing players and spawn their entities, and broadcast
// information about the joining player to all existing players.
for (int i = 0; i < MAX_PLAYERS; i ++) {