diff --git a/include/chat/flags.h b/include/chat/flags.h index c1a96ca..3b492a8 100644 --- a/include/chat/flags.h +++ b/include/chat/flags.h @@ -25,7 +25,7 @@ extern "C" { //MACROS #define WHY2_SA struct sockaddr -#define WHY2_SERVER_PORT 1204 //PORT +#define WHY2_CHAT_SERVER_PORT 1204 //PORT #define WHY2_MAX_CONNECTIONS 1000 //MAX USERS CONNECTED AT ONE TIME #define WHY2_COMMUNICATION_TIME 300 //SECONDS WAITING BEFORE KICKING USER (TIMEOUT) @@ -34,7 +34,7 @@ extern "C" { #define WHY2_CLEAR_AND_GO_UP "\33[2K\r\033[A" //i mean read the name #define WHY2_INVALID_POINTER (void*) 0xffffffffffffffff -#define WHY2_DEFAULT_USERNAME "anon" +#define WHY2_CHAT_DEFAULT_USERNAME "anon" #define WHY2_MAX_USERNAME_LENGTH 20 //MAXIMAL USERNAME LENGTH #define WHY2_MIN_USERNAME_LENGTH 4 //MINIMAL USERNAME LENGTH diff --git a/src/chat/main/client.c b/src/chat/main/client.c index 57951c5..c47b1f4 100644 --- a/src/chat/main/client.c +++ b/src/chat/main/client.c @@ -47,7 +47,7 @@ int main(void) //DEFINE SERVER ADDRESS struct sockaddr_in server_addr; server_addr.sin_family = AF_INET; - server_addr.sin_port = htons(WHY2_SERVER_PORT); + server_addr.sin_port = htons(WHY2_CHAT_SERVER_PORT); //GET IP printf("Welcome.\n\n"); diff --git a/src/chat/main/server.c b/src/chat/main/server.c index f2d9409..6385bf5 100644 --- a/src/chat/main/server.c +++ b/src/chat/main/server.c @@ -46,7 +46,7 @@ int main(void) //DEFINE SERVER ADDRESS struct sockaddr_in server_addr; server_addr.sin_family = AF_INET; - server_addr.sin_port = htons(WHY2_SERVER_PORT); + server_addr.sin_port = htons(WHY2_CHAT_SERVER_PORT); server_addr.sin_addr.s_addr = INADDR_ANY; //BIND SOCKET diff --git a/src/chat/misc.c b/src/chat/misc.c index afcc780..d62c460 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -199,7 +199,7 @@ why2_bool check_username(char *username) if (username == NULL) return 0; if (username_equal(username, WHY2_CHAT_SERVER_USERNAME)) return 0; //DISABLE 'server' USERNAME - if (username_equal(username, WHY2_DEFAULT_USERNAME)) return 0; //DISABLE 'anon' USERNAME DUE TO ONE USERNAME PER SERVER + if (username_equal(username, WHY2_CHAT_DEFAULT_USERNAME)) return 0; //DISABLE 'anon' USERNAME DUE TO ONE USERNAME PER SERVER for (unsigned long i = 0; i < strlen(username); i++) { @@ -378,7 +378,7 @@ void *why2_communicate_thread(void *arg) why2_bool invalid_username = 1; why2_bool exiting = 0; char *decoded_buffer = NULL; - char *username = why2_strdup(WHY2_DEFAULT_USERNAME); + char *username = why2_strdup(WHY2_CHAT_DEFAULT_USERNAME); int usernames_n = 0; struct json_object *json = json_tokener_parse("{}");