1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-02 07:35:08 +02:00

optimize chunk transmission

This commit is contained in:
p2r3
2025-08-17 17:28:42 +03:00
parent c2f04f2b0c
commit d66175d91f
3 changed files with 61 additions and 35 deletions

View File

@@ -20,6 +20,10 @@
#define PORT 25565
#define MAX_PLAYERS 16
#define GAMEMODE 0
#define VIEW_DISTANCE 2
// How many visited chunks to "remember"
// The server will not re-send chunks that the player has recently been in
#define VISITED_HISTORY 4
#define STATE_NONE 0
#define STATE_STATUS 1
@@ -49,6 +53,8 @@ typedef struct {
short x;
short y;
short z;
short visited_x[VISITED_HISTORY];
short visited_z[VISITED_HISTORY];
int8_t yaw;
int8_t pitch;
uint8_t hotbar;