2023-11-21 22:11:07 +00:00
|
|
|
#ifndef DEFS_H
|
|
|
|
#define DEFS_H
|
|
|
|
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
|
|
|
|
// Server details
|
|
|
|
#define SERVER_ADDR "127.0.0.1"
|
|
|
|
#define SERVER_PORT 9080
|
|
|
|
|
|
|
|
// ERRORS
|
|
|
|
#define STDOK 0
|
|
|
|
#define STDERR -1
|
|
|
|
#define MEMERR -2
|
|
|
|
|
|
|
|
// SDL2
|
|
|
|
#define WINDOW_FLAGS SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL
|
|
|
|
#define RENDERER_FLAGS SDL_RENDERER_ACCELERATED
|
|
|
|
|
|
|
|
// MCS: Message Communication Standard
|
|
|
|
#define SERVER_MESSAGE_LEN 10
|
2023-11-23 18:58:37 +00:00
|
|
|
#define CLIENT_MESSAGE_LEN 10
|
2023-11-21 22:11:07 +00:00
|
|
|
|
|
|
|
// MFS: Message Format Standard
|
|
|
|
#define PLAYER_CONNECT_FORMAT 0
|
|
|
|
#define OBJECT_PROPERTIES_FORMAT 1
|
|
|
|
#define PLAYER_DISCONNECT_FORMAT 2
|
|
|
|
|
|
|
|
// MSCA: Message Communication Standard Actions
|
|
|
|
#define LEFT_MOVEMENT 0b10000000
|
|
|
|
#define RIGHT_MOVEMENT 0b01000000
|
2023-11-23 18:58:37 +00:00
|
|
|
#define JUMP_MOVEMENT 0b00100000
|
|
|
|
#define CROUCH_MOVEMENT 0b00010000
|
|
|
|
|
|
|
|
// BS: Block Standard
|
|
|
|
#define GRASS_BLOCK 0b10000000
|
|
|
|
#define COBBLE_BLOCK 0b01000000
|
|
|
|
#define LAVA_BLOCK 0b00100000
|
2023-11-21 22:11:07 +00:00
|
|
|
|
|
|
|
#endif
|