Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/VibeDevelopers/Comet.
Something went wrong. Try again.
790 B · 35 lines
C
at dev
123456789101112131415161718192021222324252627282930313233343536#include "stdinc.h"#include "modules.h"#include "hook.h"#include "client.h"#include "s_conf.h"
static void check_new_user(void *data);mapi_hfn_list_av1 drain_hfnlist[] = { { "new_local_user", check_new_user }, { NULL, NULL }};
static const char drain_desc[] = "Prevents new, non-exempt users from connecting to this server.";
DECLARE_MODULE_AV2(drain, NULL, NULL, NULL, NULL, drain_hfnlist, NULL, NULL, drain_desc);
static voidcheck_new_user(void *vdata){ struct Client *source_p = vdata; const char *drain_reason = ConfigFileEntry.drain_reason;
if (IsAnyDead(source_p)) return;
if (drain_reason == NULL) drain_reason = "This server is not accepting connections.";
if (IsExemptKline(source_p)) return;
exit_client(source_p, source_p, &me, drain_reason);}