diff options
author | Test_User <hax@andrewyu.org> | 2023-05-17 14:09:50 -0400 |
---|---|---|
committer | Test_User <hax@andrewyu.org> | 2023-05-17 14:09:50 -0400 |
commit | 6ffe99cd96ec60e56cc6d4bcf6cd9cd9ba8ad5b9 (patch) | |
tree | 3b03291087c21511f49c179611c51f80299367ef | |
parent | d11d6c901e8dcbc1e008d3856260255056adb0cd (diff) | |
download | coupserv-6ffe99cd96ec60e56cc6d4bcf6cd9cd9ba8ad5b9.tar.gz coupserv-6ffe99cd96ec60e56cc6d4bcf6cd9cd9ba8ad5b9.zip |
Add some client handling stuff
Diffstat (limited to '')
-rw-r--r-- | main.c | 5 | ||||
-rw-r--r-- | server_network.c | 10 |
2 files changed, 15 insertions, 0 deletions
@@ -201,6 +201,11 @@ void *client_loop(void *ign) { } } disconnect_client: + if (client_connected) { + SEND(STRING(":1HC000001 QUIT :Ping timeout: -240 seconds\n")); + client_connected = 0; + } + close(client_fd); free(full_msg.data); listen(client_listen_fd, 1); diff --git a/server_network.c b/server_network.c index 0a471bd..901554d 100644 --- a/server_network.c +++ b/server_network.c @@ -450,6 +450,15 @@ int nick_handler(struct string sender, uint64_t argc, struct string *argv) { return 0; } +int fjoin_handler(struct string sender, uint64_t argc, struct string **argv) { + if (argc < 4) { + WRITES(2, STRING("Invalid FJOIN recieved! (Missing parameters")); + return 1; + } + + return 0; +} + int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { if (argc < 2) { WRITES(2, STRING("Invalid PRIVMSG recieved (Missing parameters)\n")); @@ -588,6 +597,7 @@ int initservernetwork(void) { set_table_index(&server_network_commands, STRING("QUIT"), &quit_handler); set_table_index(&server_network_commands, STRING("KILL"), &kill_handler); set_table_index(&server_network_commands, STRING("NICK"), &nick_handler); + set_table_index(&server_network_commands, STRING("FJOIN"), &fjoin_handler); init_user_commands(); |