summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-05-17 14:09:50 -0400
committerTest_User <hax@andrewyu.org>2023-05-17 14:09:50 -0400
commit6ffe99cd96ec60e56cc6d4bcf6cd9cd9ba8ad5b9 (patch)
tree3b03291087c21511f49c179611c51f80299367ef
parentd11d6c901e8dcbc1e008d3856260255056adb0cd (diff)
downloadcoupserv-6ffe99cd96ec60e56cc6d4bcf6cd9cd9ba8ad5b9.tar.gz
coupserv-6ffe99cd96ec60e56cc6d4bcf6cd9cd9ba8ad5b9.zip
Add some client handling stuff
-rw-r--r--main.c5
-rw-r--r--server_network.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/main.c b/main.c
index b0f7233..21cc727 100644
--- a/main.c
+++ b/main.c
@@ -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();