mirror of
https://github.com/p2r3/bareiron.git
synced 2025-10-01 23:25:09 +02:00
57 lines
896 B
C
57 lines
896 B
C
#ifndef H_GLOBALS
|
|
#define H_GLOBALS
|
|
|
|
#include <stdint.h>
|
|
#include <unistd.h>
|
|
|
|
#define true 1
|
|
#define false 0
|
|
|
|
#define PORT 25565
|
|
#define MAX_PLAYERS 16
|
|
#define GAMEMODE 0
|
|
|
|
#define STATE_NONE 0
|
|
#define STATE_STATUS 1
|
|
#define STATE_LOGIN 2
|
|
#define STATE_TRANSFER 3
|
|
#define STATE_CONFIGURATION 4
|
|
#define STATE_PLAY 5
|
|
|
|
extern ssize_t recv_count;
|
|
extern uint8_t recv_buffer[256];
|
|
|
|
extern uint32_t world_seed;
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
typedef struct {
|
|
short x;
|
|
short y;
|
|
short z;
|
|
uint8_t block;
|
|
} BlockChange;
|
|
|
|
typedef struct {
|
|
uint8_t uuid[16];
|
|
int client_fd;
|
|
short x;
|
|
short y;
|
|
short z;
|
|
int8_t yaw;
|
|
int8_t pitch;
|
|
uint8_t hotbar;
|
|
uint16_t inventory_items[41];
|
|
uint16_t craft_items[9];
|
|
uint8_t inventory_count[41];
|
|
} PlayerData;
|
|
|
|
#pragma pack(pop)
|
|
|
|
extern BlockChange block_changes[20000];
|
|
extern int block_changes_count;
|
|
|
|
extern PlayerData player_data[MAX_PLAYERS];
|
|
|
|
#endif
|