Download code/engine/network/shared.h from HDTenEightyP/SeafarerEngine: direct link, hf CLI and curl.
- Browser
- Download file 849 Bytes
-
https://huggingface.co/HDTenEightyP/SeafarerEngine/resolve/main/code/engine/network/shared.h
- Command line
-
hf download hf://HDTenEightyP/SeafarerEngine/code/engine/network/shared.h
-
curl -L -o shared.h https://huggingface.co/HDTenEightyP/SeafarerEngine/resolve/main/code/engine/network/shared.h
849 Bytes
| typedef struct { | |
| int id; | |
| char username[MAX_NAME]; | |
| double x, y, z; | |
| double pitch, yaw; | |
| int active; | |
| } Player; | |
| typedef enum { | |
| MSG_JOIN, // Client -> Server: "I want to join with this name" | |
| MSG_WELCOME, // Server -> Client: "Welcome, your ID is X and your position is Y" | |
| MSG_MOVE, // Client -> Server: "I want to move by dx, dy" | |
| MSG_STATE // Server -> Client: "Here is the current world state" | |
| } MsgType; | |
| // Standard communication packet | |
| typedef struct { | |
| MsgType type; | |
| int player_id; | |
| char username[MAX_NAME]; | |
| double x, y, z; | |
| double pitch, yaw; | |
| } Packet; | |
| // World state broadcast packet | |
| typedef struct { | |
| MsgType type; | |
| int player_count; | |
| Player players[MAX_PLAYERS]; | |
| } StatePacket; | |