Add client app simple crypt function and CMD functions. Add server app simple chat bot SVR.
parent
99decfc7e9
commit
7063430e6c
|
@ -189,7 +189,7 @@ void recv_msg_crpt_handler(char* pswd)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fc_xor(message, pswd, decryt);
|
fc_xor(message, pswd, decrypt);
|
||||||
printf("%s", decrypt);
|
printf("%s", decrypt);
|
||||||
str_overwrite_stdout();
|
str_overwrite_stdout();
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ int main(int argc, char **argv)
|
||||||
// Send name to Server.
|
// Send name to Server.
|
||||||
send(sockfd, name, 32, 0);
|
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.
|
// Creat threads Send||Recive with||not crypt masseges.
|
||||||
if(argc == 4)
|
if(argc == 4)
|
||||||
|
@ -330,3 +330,4 @@ int main(int argc, char **argv)
|
||||||
close(sockfd);
|
close(sockfd);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,14 +176,11 @@ void *handle_client(void *arg)
|
||||||
int receive = recv(cli->sockfd, buff_out, BUFFER_SZ, 0);
|
int receive = recv(cli->sockfd, buff_out, BUFFER_SZ, 0);
|
||||||
if (receive > 0)
|
if (receive > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
//printf("[*] - str: %s", buff_out);
|
|
||||||
|
|
||||||
if(strncmp(buff_out, "SRV:con", 7) == 0 && strlen(buff_out) > 0)
|
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);
|
sprintf(buff_out, "SRV_BOT: ID - %u | Username: %s \n", cli->uid ,cli->name);
|
||||||
send_message_u(buff_out, cli->uid);
|
send_message_u(buff_out, cli->uid);
|
||||||
} //if( && v == '0')
|
}
|
||||||
else if(strlen(buff_out) > 0)
|
else if(strlen(buff_out) > 0)
|
||||||
{
|
{
|
||||||
send_message(buff_out, cli->uid);
|
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 IP address: %s \n", ip);
|
||||||
printf("Server Port: %d \n", port);
|
printf("Server Port: %d \n", port);
|
||||||
printf("Server Password: %s \n", pswd);
|
printf("Server Password: %s \n", pswd);
|
||||||
|
|
||||||
int option = 1;
|
int option = 1;
|
||||||
int listenfd = 0, connfd = 0;
|
int listenfd = 0, connfd = 0;
|
||||||
|
@ -295,7 +292,7 @@ int main(int argc, char **argv)
|
||||||
return EXIT_FAILURE;
|
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)
|
while(1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue