prepared WHY2_CHAT_CODEs handler

This commit is contained in:
Václav Šmejkal 2023-05-02 19:08:43 +02:00
parent 037521b871
commit 884efa1a92
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -466,12 +466,24 @@ void *why2_listen_server(void *socket)
for (;;)
{
read = why2_read_socket(*((int*) socket));
printf(WHY2_CLEAR_AND_GO_UP);
printf("%s\n\n>>> ", read);
fflush(stdout);
if (strncmp(read, "server: code", 12) == 0) //CODE WAS SENT
{
if (strcmp(read + 8, WHY2_CHAT_CODE_PICK_USERNAME) == 0) //PICK USERNAME
{
//TODO: Check username
}
} else
{
printf(WHY2_CLEAR_AND_GO_UP);
printf("%s\n\n>>> ", read);
fflush(stdout);
}
why2_deallocate(read);
}
return NULL;
}
//TODO: Client formatting fix