summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-08-09 23:15:35 -0400
committerTest_User <hax@andrewyu.org>2023-08-09 23:15:35 -0400
commit0a4de3b7f0159fc44f87996e1d25678e3b456878 (patch)
tree9b584c1e59cb14f432b1425251a7a53f88a02ad3
parent23003e705b1818d647a89ed415ced1d199561cca (diff)
downloadcoupserv-0a4de3b7f0159fc44f87996e1d25678e3b456878.tar.gz
coupserv-0a4de3b7f0159fc44f87996e1d25678e3b456878.zip
de-hardcode hax.irc.andrewyu.org, place example in config.h
-rw-r--r--client_network.c57
-rw-r--r--config.h26
-rw-r--r--general_network.c8
-rw-r--r--server_network.c4
4 files changed, 60 insertions, 35 deletions
diff --git a/client_network.c b/client_network.c
index 08b9aea..3ddad6e 100644
--- a/client_network.c
+++ b/client_network.c
@@ -228,28 +228,41 @@ int client_user_handler(uint64_t argc, struct string *argv) {
if (add_local_client(STRING("1HC000001"), client_nick, client_hostmask, argv[0], argv[3], time(NULL)) != 0)
return 1;
- SENDCLIENT(STRING(":hax.irc.andrewyu.org 001 "));
+ SENDCLIENT(STRING(":"));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" 001 "));
SENDCLIENT(client_nick);
- SENDCLIENT(STRING(" :Welcome to the Rexnet IRC Network\r\n"));
- SENDCLIENT(STRING(":hax.irc.andrewyu.org 002 "));
+ SENDCLIENT(STRING(" :Welcome to the Rexnet IRC Network\r\n:"));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" 002 "));
SENDCLIENT(client_nick);
- SENDCLIENT(STRING(" :Your host is hax.irc.andrewyu.org, running a totally not sus IRCd\r\n"));
- SENDCLIENT(STRING(":hax.irc.andrewyu.org 003 "));
+ SENDCLIENT(STRING(" :Your host is "));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(", running a totally not sus IRCd\r\n:"));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" 003 "));
SENDCLIENT(client_nick);
- SENDCLIENT(STRING(" :This server was created 02:51:36 Apr 03 2023\r\n"));
- SENDCLIENT(STRING(":hax.irc.andrewyu.org 004 "));
+ SENDCLIENT(STRING(" :This server was created 02:51:36 Apr 03 2023\r\n:"));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" 004 "));
SENDCLIENT(client_nick);
- SENDCLIENT(STRING(" irc.andrewyu.org InspIRCd-3 BDGHILNORSTWcdghikorswxz ABCDEFGHIJKLMNOPQRSTXYZabcdefghijklmnopqrstuvwz :BEFHIJLXYZabdefghjkloqvw\r\n"));
- SENDCLIENT(STRING(":hax.irc.andrewyu.org 005 "));
+ SENDCLIENT(STRING(" "));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" InspIRCd-3 BDGHILNORSTWcdghikorswxz ABCDEFGHIJKLMNOPQRSTXYZabcdefghijklmnopqrstuvwz :BEFHIJLXYZabdefghjkloqvw\r\n:"));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" 005 "));
SENDCLIENT(client_nick);
- SENDCLIENT(STRING(" 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 "));
+ SENDCLIENT(STRING(" 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(server_name);
+ SENDCLIENT(STRING(" 005 "));
SENDCLIENT(client_nick);
- SENDCLIENT(STRING(" 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 "));
+ SENDCLIENT(STRING(" 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(server_name);
+ SENDCLIENT(STRING(" 005 "));
SENDCLIENT(client_nick);
- SENDCLIENT(STRING(" 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 "));
+ SENDCLIENT(STRING(" 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(server_name);
+ SENDCLIENT(STRING(" 005 "));
SENDCLIENT(client_nick);
SENDCLIENT(STRING(" WATCH=32 WHOX :are supported by this server\r\n"));
@@ -322,8 +335,9 @@ int client_join_handler(uint64_t argc, struct string *argv) {
SENDCLIENT(STRING(" "));
SENDCLIENT(user);
} else {
- SENDCLIENT(STRING("\r\n"));
- SENDCLIENT(STRING(":hax.irc.andrewyu.org 353 "));
+ SENDCLIENT(STRING("\r\n:"));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" 353 "));
SENDCLIENT(client_nick);
SENDCLIENT(STRING(" = "));
SENDCLIENT(channels);
@@ -331,8 +345,9 @@ int client_join_handler(uint64_t argc, struct string *argv) {
SENDCLIENT(user);
}
}
- SENDCLIENT(STRING("\r\n"));
- SENDCLIENT(STRING(":hax.irc.andrewyu.org 366 "));
+ SENDCLIENT(STRING("\r\n:"));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" 366 "));
SENDCLIENT(client_nick);
SENDCLIENT(STRING(" "));
SENDCLIENT(channels);
@@ -459,7 +474,9 @@ int client_ping_handler(uint64_t argc, struct string *argv) {
if (argc < 1)
return 1;
- SENDCLIENT(STRING(":hax.irc.andrewyu.org PONG :"));
+ SENDCLIENT(STRING(":"));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" PONG :"));
SENDCLIENT(argv[0]);
SENDCLIENT(STRING("\r\n"));
diff --git a/config.h b/config.h
index 9011e6e..3a783e5 100644
--- a/config.h
+++ b/config.h
@@ -32,18 +32,20 @@
#include "types.h"
-extern struct string address;
-extern struct string port;
-extern struct string nick;
-extern struct string log_channel;
-extern struct string recv_password;
-extern struct string send_password;
-extern struct string hostmask;
-extern struct string prejoin_channels[];
-extern uint64_t num_prejoin_channels;
+extern struct string address; // = STRING("irc.nowhere.net");
+extern struct string port; // = STRING("1234");
+extern struct string nick; // = STRING("HaxServ");
+extern struct string server_name; // = STRING("hax.irc.nowhere.net");
-extern struct string command_prefix;
+extern struct string log_channel; // = STRING("#logs");
+extern struct string recv_password; // = STRING("password we should get back from the other server");
+extern struct string send_password; // = STRING("password to send for auth");
+extern struct string hostmask; // = STRING("NetworkHaxxors/HaxServ");
+extern struct string prejoin_channels[]; // = {STRING("#logs"), STRING("#services"), STRING("#blahblahblah")}
+extern uint64_t num_prejoin_channels; // = sizeof(prejoin_channels) / sizeof(*prejoin_channels);
-extern struct string client_hostmask;
+extern struct string command_prefix; // = STRING(".");
-extern struct string opertype;
+extern struct string client_hostmask; // = STRING("127.0.0.1");
+
+extern struct string opertype; // = STRING("Admin");
diff --git a/general_network.c b/general_network.c
index 86b60ca..475591a 100644
--- a/general_network.c
+++ b/general_network.c
@@ -120,11 +120,15 @@ int PRIVMSG(struct string source, struct string target, struct string message) {
SENDCLIENT(STRING("@"));
SENDCLIENT(hostmask);
} else if (source.len == 3 && memcmp(source.data, "1HC", 3) == 0) {
- SENDCLIENT(STRING(":hax.irc.andrewyu.org "));
+ SENDCLIENT(STRING(":"));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" "));
}
SENDCLIENT(STRING(" PRIVMSG "));
} else {
- SENDCLIENT(STRING(":hax.irc.andrewyu.org PRIVMSG "));
+ SENDCLIENT(STRING(":"));
+ SENDCLIENT(server_name);
+ SENDCLIENT(STRING(" PRIVMSG "));
}
if (target.len == 9 && memcmp(target.data, "1HC000001", 9) == 0)
diff --git a/server_network.c b/server_network.c
index 055e86d..6f32425 100644
--- a/server_network.c
+++ b/server_network.c
@@ -847,7 +847,9 @@ int initservernetwork(void) {
}
// probably inefficient to be calling SSL_write this frequently, but also less effort
- SEND(STRING("SERVER hax.irc.andrewyu.org "));
+ SEND(STRING("SERVER "));
+ SEND(server_name);
+ SEND(STRING(" "));
SEND(send_password);
SEND(STRING(" 0 1HC :HaxServ\n"));
SEND(STRING("BURST "));