]> jfr.im git - irc/quakenet/newserv.git/commitdiff
FAKEUSERS: move noperserv_fakeusers into seperate module
authorPaul <redacted>
Mon, 29 Jul 2013 15:05:16 +0000 (16:05 +0100)
committerPaul <redacted>
Mon, 29 Jul 2013 15:05:16 +0000 (16:05 +0100)
--HG--
branch : fakeuser

fakeusers/Makefile [new file with mode: 0644]
fakeusers/fakeusers.c [moved from noperserv/noperserv_fakeuser.c with 97% similarity]
noperserv/Makefile

diff --git a/fakeusers/Makefile b/fakeusers/Makefile
new file mode 100644 (file)
index 0000000..a9c1119
--- /dev/null
@@ -0,0 +1,9 @@
+include ../build.mk
+
+CFLAGS+=$(INCDBAPI)
+LDFLAGS+=$(LIBDBAPI)
+
+.PHONY: all
+all: fakeusers.so
+
+fakeusers.so: fakeusers.o
similarity index 97%
rename from noperserv/noperserv_fakeuser.c
rename to fakeusers/fakeusers.c
index 259aa71abbad64f612af11b2e9326f34d715af21..41eb23bbb439e21a03793f89c79ae2875dc818d1 100644 (file)
@@ -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 <ident> <host> <realname>\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;
   }
index 33138d306bb01ab47d56e5cd2fc2c5f31fbc7e71..8ecc460262b17dcfc851a02d837ecbf13adc81fa 100644 (file)
@@ -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