From: Paul Date: Mon, 29 Jul 2013 15:05:16 +0000 (+0100) Subject: FAKEUSERS: move noperserv_fakeusers into seperate module X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/6189af131862587a82c5ba7a83f9f665cab7baef FAKEUSERS: move noperserv_fakeusers into seperate module --HG-- branch : fakeuser --- diff --git a/fakeusers/Makefile b/fakeusers/Makefile new file mode 100644 index 00000000..a9c11194 --- /dev/null +++ b/fakeusers/Makefile @@ -0,0 +1,9 @@ +include ../build.mk + +CFLAGS+=$(INCDBAPI) +LDFLAGS+=$(LIBDBAPI) + +.PHONY: all +all: fakeusers.so + +fakeusers.so: fakeusers.o diff --git a/noperserv/noperserv_fakeuser.c b/fakeusers/fakeusers.c similarity index 97% rename from noperserv/noperserv_fakeuser.c rename to fakeusers/fakeusers.c index 259aa71a..41eb23bb 100644 --- a/noperserv/noperserv_fakeuser.c +++ b/fakeusers/fakeusers.c @@ -61,7 +61,7 @@ static DBAPIConn *nofudb; void _init() { if (!fakeuser_loaddb()) { - Error("noperserv_fakeuser", ERR_FATAL, "Cannot load database"); + Error("fakeuser", ERR_FATAL, "Cannot load database"); return; } registercontrolhelpcmd("fakeuser", NO_OPER, 4, &fakeadd, "Usage: FAKEUSER nick \nCreates a fake user."); @@ -102,7 +102,7 @@ void fakeuser_cleanup() int fakeuser_loaddb() { if (!nofudb) { - nofudb = dbapi2open(DBAPI2_DEFAULT, "noperservfakeuser"); + nofudb = dbapi2open(DBAPI2_DEFAULT, "fakeusers"); if(!nofudb) { Error("fakeuser", ERR_STOP, "Could not connect to database."); return 0; @@ -386,7 +386,7 @@ void fakeuser_handler(nick *user, int command, void **params) if (!item) { controlwall(NO_OPER, NL_FAKEUSERS, "Error: A fakeuser was killed, but wasn't found in the list"); - Error("noperserv_fakeuser", ERR_ERROR, "A fakeuser was killed, but wasn't found in the list"); + Error("fakeuser", ERR_ERROR, "A fakeuser was killed, but wasn't found in the list"); return; } @@ -407,7 +407,7 @@ void fakeuser_handler(nick *user, int command, void **params) details->schedule = scheduleoneshot(time(NULL) + KILL_WAIT, &reconnectfake, details); if (!details->schedule) { - Error("noperserv_fakeuser", ERR_ERROR, "Couldn't reschedule fakeuser for reconnect"); + Error("fakeuser", ERR_ERROR, "Couldn't reschedule fakeuser for reconnect"); free(details); return; } @@ -451,14 +451,14 @@ int fakeadd(void *sender, int cargc, char **cargv) else if (err_code == ERR_MEM) { controlreply(sender, "Error: memory error!!"); - Error("noperserv_fakeuser", ERR_STOP, "malloc error"); + Error("fakeuser", ERR_STOP, "malloc error"); } else if (err_code == ERR_WONTKILL) controlreply(sender, "Nick already exists and I won't kill it"); else { controlreply(sender, "Unknown error when adding fakeuser"); - Error("noperserv_fakeuser", ERR_ERROR, "Unknown error when adding fakeuser"); + Error("fakeuser", ERR_ERROR, "Unknown error when adding fakeuser"); } return CMD_ERROR; } diff --git a/noperserv/Makefile b/noperserv/Makefile index 33138d30..8ecc4602 100644 --- a/noperserv/Makefile +++ b/noperserv/Makefile @@ -4,12 +4,10 @@ CFLAGS+=$(INCDBAPI) LDFLAGS+=$(LIBDBAPI) .PHONY: all -all: noperserv.so noperserv_commands.so noperserv_raw.so noperserv_fakeuser.so +all: noperserv.so noperserv_commands.so noperserv_raw.so noperserv.so: noperserv.o noperserv_db.o noperserv_hooks.o noperserv_policy.o noperserv_commands.so: noperserv_commands.o noperserv_raw.so: noperserv_raw.o - -noperserv_fakeuser.so: noperserv_fakeuser.o