diff --git a/include/chat/config.h b/include/chat/config.h index 4c2b6e3..257815d 100644 --- a/include/chat/config.h +++ b/include/chat/config.h @@ -23,16 +23,7 @@ along with this program. If not, see . extern "C" { #endif -//MACROS -#define WHY2_CHAT_CODE_ACCEPT_MESSAGES "code_000" -#define WHY2_CHAT_CODE_PICK_USERNAME "code_001" -#define WHY2_CHAT_CODE_SERVER_SIDE_QUIT_COMMUNICATION "code_002" -#define WHY2_CHAT_CODE_INVALID_COMMAND "code_003" -#define WHY2_CHAT_CODE_INVALID_USERNAME "code_004" - -//SHORTCUTS CAUSE I'M LAZY BITCH -#define WHY2_CHAT_CODE_SSQC WHY2_CHAT_CODE_SERVER_SIDE_QUIT_COMMUNICATION - +//CONFIG MACROS #define WHY2_CONFIG_DIR "/home/{USER}/.config" #define WHY2_CHAT_CONFIG_DIR WHY2_CONFIG_DIR "/WHY2" #define WHY2_CHAT_CONFIG_URL "https://raw.githubusercontent.com/ENGO150/WHY2/development/src/chat/config" @@ -42,8 +33,8 @@ extern "C" { void why2_chat_init_server_config(void); //CHECK IF SERVER CONFIG EXISTS, CREATE IT void why2_chat_init_client_config(void); //Dementia is a term used to describe a group of symptoms affecting memory, thinking and social abilities. In people who have dementia, the symptoms interfere with their daily lives. Dementia isn't one specific disease. Several diseases can cause dementia. ... -char *why2_toml_read(const char* path, const char* key); -void why2_toml_read_free(char* s); +char *why2_toml_read(const char* path, const char* key); //READ key FROM path TOML FILE +void why2_toml_read_free(char* s); //DEALLOCATE THE READ VALUE #ifdef __cplusplus } diff --git a/include/chat/flags.h b/include/chat/flags.h index 6b6ff47..c1a96ca 100644 --- a/include/chat/flags.h +++ b/include/chat/flags.h @@ -26,7 +26,7 @@ extern "C" { //MACROS #define WHY2_SA struct sockaddr #define WHY2_SERVER_PORT 1204 //PORT -#define WHY2_MAX_CONNECTIONS 1000 //MAX USERS CONNECTED AT ONE TIME //TODO: Move all to configs +#define WHY2_MAX_CONNECTIONS 1000 //MAX USERS CONNECTED AT ONE TIME #define WHY2_COMMUNICATION_TIME 300 //SECONDS WAITING BEFORE KICKING USER (TIMEOUT) #define WHY2_CHAT_SERVER_USERNAME "server" //THE USERNAME SERVER WILL USE @@ -40,6 +40,16 @@ extern "C" { #define WHY2_MIN_USERNAME_LENGTH 4 //MINIMAL USERNAME LENGTH #define WHY2_MAX_USERNAME_TRIES 3 //MAXIMAL USERNAME ASK COUNT +//CODES +#define WHY2_CHAT_CODE_ACCEPT_MESSAGES "code_000" +#define WHY2_CHAT_CODE_PICK_USERNAME "code_001" +#define WHY2_CHAT_CODE_SERVER_SIDE_QUIT_COMMUNICATION "code_002" +#define WHY2_CHAT_CODE_INVALID_COMMAND "code_003" +#define WHY2_CHAT_CODE_INVALID_USERNAME "code_004" + +//SHORTCUTS CAUSE I'M LAZY BITCH +#define WHY2_CHAT_CODE_SSQC WHY2_CHAT_CODE_SERVER_SIDE_QUIT_COMMUNICATION + #ifdef __cplusplus } #endif