diff options
Diffstat (limited to 'server_network.c')
-rw-r--r-- | server_network.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/server_network.c b/server_network.c index 3e8e6dd..a49e775 100644 --- a/server_network.c +++ b/server_network.c @@ -374,7 +374,7 @@ int kill_handler(struct string sender, uint64_t argc, struct string *argv) { if (!user) return 0; // TODO: Currently not all local users are considered; fix that, then make this give an error - if (STRING_EQ(user->server, STRING("1HC"))) { + if (STRING_EQ(user->server, STRING(SID))) { char user_time[21]; snprintf(user_time, 21, "%ld", user->user_ts); char nick_time[21]; @@ -438,7 +438,7 @@ int nick_handler(struct string sender, uint64_t argc, struct string *argv) { for (uint64_t i = 0; i < channel_list.len; i++) { // TODO: More efficient way of doing this struct channel_info *channel = channel_list.array[i].ptr; - if (has_table_index(channel->user_list, sender) && has_table_index(channel->user_list, STRING("1HC000001"))) { + if (has_table_index(channel->user_list, sender) && has_table_index(channel->user_list, STRING(SID"000001"))) { SENDCLIENT(STRING(":")); SENDCLIENT(info->nick); SENDCLIENT(STRING("!")); @@ -543,7 +543,7 @@ int fjoin_handler(struct string sender, uint64_t argc, struct string *argv) { if (userlist.len < 10) // Not enough for any users return 0; - uint8_t sendclient = has_table_index(channel->user_list, STRING("1HC000001")); + uint8_t sendclient = has_table_index(channel->user_list, STRING(SID"000001")); uint64_t offset = 0; while (1) { @@ -625,7 +625,7 @@ int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { server = 0; if (argv[0].data[0] == '#') { struct channel_info *channel = get_table_index(channel_list, argv[0]); - if (channel && has_table_index(channel->user_list, STRING("1HC000001"))) { + if (channel && has_table_index(channel->user_list, STRING(SID"000001"))) { SENDCLIENT(STRING(":")); SENDCLIENT(user->nick); SENDCLIENT(STRING("!")); @@ -638,7 +638,7 @@ int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { SENDCLIENT(argv[1]); SENDCLIENT(STRING("\r\n")); } - } else if (STRING_EQ(argv[0], STRING("1HC000001"))) { + } else if (STRING_EQ(argv[0], STRING(SID"000001"))) { SENDCLIENT(STRING(":")); SENDCLIENT(user->nick); SENDCLIENT(STRING("!")); @@ -656,7 +656,7 @@ int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { if (server) { if (argv[0].data[0] == '#') { struct channel_info *channel = get_table_index(channel_list, argv[0]); - if (channel && has_table_index(channel->user_list, STRING("1HC000001"))) { + if (channel && has_table_index(channel->user_list, STRING(SID"000001"))) { SENDCLIENT(STRING(":")); SENDCLIENT(server->address); SENDCLIENT(STRING(" PRIVMSG ")); @@ -665,7 +665,7 @@ int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { SENDCLIENT(argv[1]); SENDCLIENT(STRING("\r\n")); } - } else if (STRING_EQ(argv[0], STRING("1HC000001"))) { + } else if (STRING_EQ(argv[0], STRING(SID"000001"))) { SENDCLIENT(STRING(":")); SENDCLIENT(server->address); SENDCLIENT(STRING(" PRIVMSG ")); @@ -683,7 +683,7 @@ int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { return 0; offset = command_prefix.len; - } else if (STRING_EQ(argv[0], STRING("1HC000000"))) { + } else if (STRING_EQ(argv[0], STRING(SID"000000"))) { offset = 0; } else { return 0; @@ -731,7 +731,7 @@ int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { if (!user) { WRITES(2, STRING("User is unknown!\n")); - SEND(STRING(":1HC000000 NOTICE ")); + SEND(STRING(":"SID"000000 NOTICE ")); if (argv[0].data[0] == '#') SEND(argv[0]); else @@ -743,7 +743,7 @@ int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { if (user->opertype.len != cmd->privs.len || memcmp(user->opertype.data, cmd->privs.data, cmd->privs.len)) { // TODO: complain about missing privs - SEND(STRING(":1HC000000 NOTICE ")); + SEND(STRING(":"SID"000000 NOTICE ")); if (argv[0].data[0] == '#') SEND(argv[0]); else @@ -756,13 +756,13 @@ int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { struct string message[] = { user ? STRING("User ") : (server ? STRING("Server ") : STRING("An unknown user (something desycned... this shouldn't happen)")), - user ? user->nick : (server ? server->address : STRING("")), + user ? user->nick : (server ? server->address : STRING()), STRING(" executes `"), argv[1], STRING("'\n"), }; - privmsg(STRING("1HC000000"), log_channel, sizeof(message)/sizeof(*message), message); + privmsg(STRING(SID"000000"), log_channel, sizeof(message)/sizeof(*message), message); return cmd->func(sender, argv[1], argv[0], command_argc, command_argv); } else { @@ -771,7 +771,7 @@ int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { return 0; } } else { - SEND(STRING(":1HC000000 NOTICE ")); + SEND(STRING(":"SID"000000 NOTICE ")); if (argv[0].data[0] == '#') SEND(argv[0]); else @@ -791,7 +791,7 @@ int part_handler(struct string sender, uint64_t argc, struct string *argv) { struct channel_info *channel = get_table_index(channel_list, argv[0]); struct user_info *user = get_table_index(user_list, sender); - if (user && channel && has_table_index(channel->user_list, STRING("1HC000001"))) { + if (user && channel && has_table_index(channel->user_list, STRING(SID"000001"))) { SENDCLIENT(STRING(":")); SENDCLIENT(user->nick); SENDCLIENT(STRING("!")); @@ -833,7 +833,7 @@ int notice_handler(struct string sender, uint64_t argc, struct string *argv) { if (argv[0].data[0] == '#') { struct channel_info *channel = get_table_index(channel_list, argv[0]); - if (channel && has_table_index(channel->user_list, STRING("1HC000001"))) { + if (channel && has_table_index(channel->user_list, STRING(SID"000001"))) { SENDCLIENT(STRING(":")); if (user) { SENDCLIENT(user->nick); @@ -851,7 +851,7 @@ int notice_handler(struct string sender, uint64_t argc, struct string *argv) { SENDCLIENT(argv[1]); SENDCLIENT(STRING("\r\n")); } - } else if (STRING_EQ(argv[0], STRING("1HC000001"))) { + } else if (STRING_EQ(argv[0], STRING(SID"000001"))) { SENDCLIENT(STRING(":")); if (user) { SENDCLIENT(user->nick); @@ -905,14 +905,14 @@ int initservernetwork(void) { SEND(server_name); SEND(STRING(" ")); SEND(send_password); - SEND(STRING(" 0 1HC :HaxServ\n")); + SEND(STRING(" 0 "SID" :HaxServ\n")); SEND(STRING("BURST ")); time_t current_time = time(NULL); char current_time_str[21]; // C HaxServ will be deprecated long before we reach 20-digit timestamps snprintf(current_time_str, 21, "%ld", current_time); SEND(NULSTR(current_time_str)); SEND(STRING("\n")); - if (add_local_client(STRING("1HC000000"), nick, hostmask, nick, nick, current_time) != 0) + if (add_local_client(STRING(SID"000000"), nick, hostmask, nick, nick, current_time) != 0) return 1; for (uint64_t i = 0; i < num_prejoin_channels; i++) { @@ -920,9 +920,9 @@ int initservernetwork(void) { SEND(prejoin_channels[i]); SEND(STRING(" ")); SEND(NULSTR(current_time_str)); - SEND(STRING(" + :,1HC000000\nMODE ")); + SEND(STRING(" + :,"SID"000000\nMODE ")); SEND(prejoin_channels[i]); - SEND(STRING(" +o 1HC000000\n")); + SEND(STRING(" +o "SID"000000\n")); } SEND(STRING("ENDBURST\n")); |