From 742319702b61282dbd784ea3abf3ad3d847a3b25 Mon Sep 17 00:00:00 2001 From: Test_User Date: Mon, 7 Aug 2023 02:21:58 -0400 Subject: Add some fun client stuff, fix lack of newlines and returns in client stuff --- client_network.c | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/client_network.c b/client_network.c index 05e0787..226688d 100644 --- a/client_network.c +++ b/client_network.c @@ -100,14 +100,14 @@ int client_user_handler(uint64_t argc, struct string *argv) { SEND(argv[3]); SEND(STRING("\n")); - SENDCLIENT(STRING(":hax.irc.andrewyu.org 001 me :Welcome to the LibreIRC IRC Network\n")); - SENDCLIENT(STRING(":hax.irc.andrewyu.org 002 me :Your host is hax.irc.andrewyu.org, running a totally not sus IRCd\n")); - SENDCLIENT(STRING(":hax.irc.andrewyu.org 003 me :This server was created 02:51:36 Apr 03 2023")); - SENDCLIENT(STRING(":hax.irc.andrewyu.org 004 me irc.andrewyu.org InspIRCd-3 BDGHILNORSTWcdghikorswxz ABCDEFGHIJKLMNOPQRSTXYZabcdefghijklmnopqrstuvwz :BEFHIJLXYZabdefghjkloqvw")); - SENDCLIENT(STRING(":hax.irc.andrewyu.org 005 me ACCEPT=100 AWAYLEN=200 BOT=B CALLERID=g CASEMAPPING=ascii CHANLIMIT=#:20 CHANMODES=IXZbegw,k,BEFHJLdfjl,ACDGKMNOPQRSTcimnprstuz CHANNELLEN=60 CHANTYPES=# ELIST=CMNTU ESILENCE=CcdiNnPpTtx EXCEPTS=e :are supported by this server")); - SENDCLIENT(STRING(":hax.irc.andrewyu.org 005 me EXTBAN=,ACNOQRSTUacjmnprswz HOSTLEN=64 INVEX=I KEYLEN=32 KICKLEN=300 LINELEN=512 MAXLIST=I:1000,X:1000,b:1000,e:1000,g:1000,w:1000 MAXTARGETS=20 MODES=20 MONITOR=30 NAMELEN=130 NAMESX NETWORK=LibreIRC :are supported by this server")); - SENDCLIENT(STRING(":hax.irc.andrewyu.org 005 me NICKLEN=30 OVERRIDE=O PREFIX=(Yqaohv)!~&@%+ REMOVE SAFELIST SECURELIST=60 SILENCE=100 STATUSMSG=!~&@%+ TOPICLEN=330 UHNAMES USERIP USERLEN=10 USERMODES=,,s,BDGHILNORSTWcdghikorwxz :are supported by this server")); - SENDCLIENT(STRING(":hax.irc.andrewyu.org 005 me WATCH=32 WHOX :are supported by this server")); + SENDCLIENT(STRING(":hax.irc.andrewyu.org 001 me :Welcome to the AndrewIRC IRC Network\r\n")); + SENDCLIENT(STRING(":hax.irc.andrewyu.org 002 me :Your host is hax.irc.andrewyu.org, running a totally not sus IRCd\r\n")); + SENDCLIENT(STRING(":hax.irc.andrewyu.org 003 me :This server was created 02:51:36 Apr 03 2023\r\n")); + SENDCLIENT(STRING(":hax.irc.andrewyu.org 004 me irc.andrewyu.org InspIRCd-3 BDGHILNORSTWcdghikorswxz ABCDEFGHIJKLMNOPQRSTXYZabcdefghijklmnopqrstuvwz :BEFHIJLXYZabdefghjkloqvw\r\n")); + SENDCLIENT(STRING(":hax.irc.andrewyu.org 005 me ACCEPT=100 AWAYLEN=200 BOT=B CALLERID=g CASEMAPPING=ascii CHANLIMIT=#:20 CHANMODES=IXZbegw,k,BEFHJLdfjl,ACDGKMNOPQRSTcimnprstuz CHANNELLEN=60 CHANTYPES=# ELIST=CMNTU ESILENCE=CcdiNnPpTtx EXCEPTS=e :are supported by this server\r\n")); + SENDCLIENT(STRING(":hax.irc.andrewyu.org 005 me EXTBAN=,ACNOQRSTUacjmnprswz HOSTLEN=64 INVEX=I KEYLEN=32 KICKLEN=300 LINELEN=512 MAXLIST=I:1000,X:1000,b:1000,e:1000,g:1000,w:1000 MAXTARGETS=20 MODES=20 MONITOR=30 NAMELEN=130 NAMESX NETWORK=LibreIRC :are supported by this server\r\n")); + SENDCLIENT(STRING(":hax.irc.andrewyu.org 005 me NICKLEN=30 OVERRIDE=O PREFIX=(Yqaohv)!~&@%+ REMOVE SAFELIST SECURELIST=60 SILENCE=100 STATUSMSG=!~&@%+ TOPICLEN=330 UHNAMES USERIP USERLEN=10 USERMODES=,,s,BDGHILNORSTWcdghikorwxz :are supported by this server\r\n")); + SENDCLIENT(STRING(":hax.irc.andrewyu.org 005 me WATCH=32 WHOX :are supported by this server\r\n")); client_connected = 1; @@ -129,6 +129,29 @@ int client_join_handler(uint64_t argc, struct string *argv) { return 0; } +int client_privmsg_handler(uint64_t argc, struct string *argv) { + if (argc < 2) + return 1; + + SEND(STRING(":1HC000001 PRIVMSG ")); + SEND(argv[0]); + SEND(STRING(" :")); + SEND(argv[1]); + SEND(STRING("\n")); + + return 0; +} + +int client_raw_handler(uint64_t argc, struct string *argv) { + if (argc < 1) + return 1; + + SEND(argv[0]); + SEND(STRING("\n")); + + return 0; +} + int client_fd = -1; int client_listen_fd; @@ -138,6 +161,8 @@ int initclientnetwork(void) { set_table_index(&client_network_commands, STRING("NICK"), &client_nick_handler); set_table_index(&client_network_commands, STRING("USER"), &client_user_handler); set_table_index(&client_network_commands, STRING("JOIN"), &client_join_handler); + set_table_index(&client_network_commands, STRING("PRIVMSG"), &client_privmsg_handler); + set_table_index(&client_network_commands, STRING("RAW"), &client_raw_handler); client_nick.data = malloc(0); -- cgit v1.2.3