Add client app simple crypt function and CMD functions. Add server app simple chat bot SVR.

master
Nick_Kramer 2023-02-17 00:33:43 -04:00
parent 99decfc7e9
commit 7063430e6c
2 changed files with 7 additions and 9 deletions

View File

@ -189,7 +189,7 @@ void recv_msg_crpt_handler(char* pswd)
}
else
{
fc_xor(message, pswd, decryt);
fc_xor(message, pswd, decrypt);
printf("%s", decrypt);
str_overwrite_stdout();
}
@ -278,7 +278,7 @@ int main(int argc, char **argv)
// Send name to Server.
send(sockfd, name, 32, 0);
printf("--=== WELCOME TO THE CHAT NT117 v0 (Client v0.1.6) ===--\n");
printf("--=== WELCOME TO THE CHAT NT117 v0 (Client v0.1.7) ===--\n");
// Creat threads Send||Recive with||not crypt masseges.
if(argc == 4)
@ -330,3 +330,4 @@ int main(int argc, char **argv)
close(sockfd);
return EXIT_SUCCESS;
}

View File

@ -176,14 +176,11 @@ void *handle_client(void *arg)
int receive = recv(cli->sockfd, buff_out, BUFFER_SZ, 0);
if (receive > 0)
{
//printf("[*] - str: %s", buff_out);
if(strncmp(buff_out, "SRV:con", 7) == 0 && strlen(buff_out) > 0)
{
sprintf(buff_out, "SRV_BOT: ID - %u | Username: %s \n", cli->uid ,cli->name);
send_message_u(buff_out, cli->uid);
} //if( && v == '0')
}
else if(strlen(buff_out) > 0)
{
send_message(buff_out, cli->uid);
@ -257,8 +254,8 @@ int main(int argc, char **argv)
}
printf("Server IP address: %s \n", ip);
printf("Server Port: %d \n", port);
printf("Server Password: %s \n", pswd);
printf("Server Port: %d \n", port);
printf("Server Password: %s \n", pswd);
int option = 1;
int listenfd = 0, connfd = 0;
@ -295,7 +292,7 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
printf("--=== WELCOME TO THE CHAT NT117 v0 (Server v0.1.4) ===--\n");
printf("--=== WELCOME TO THE CHAT NT117 v0 (Server v0.1.5) ===--\n");
while(1)
{