summaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorkeeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-03-31 18:25:42 +0000
committerkeeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-03-31 18:25:42 +0000
commit8efb093193805c6b57377769cca178f02e31ab5b (patch)
tree974dd69e8604c8a7a78a2ad9d357b8dc4eedc5ea /init.c
parent6f9bbb2d39e28780c5b2b2d3cbf617b54727b11c (diff)
BUILD : 1.7.0 (17) BUGS : NOTES : Implemented MySQL Phase 2, see Changes and docs/MYSQL file for information.
git-svn-id: svn://svn.anope.org/anope/trunk@17 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@10 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'init.c')
-rw-r--r--init.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/init.c b/init.c
index c7df5e25a..fc42a84a4 100644
--- a/init.c
+++ b/init.c
@@ -616,7 +616,7 @@ int init(int ac, char **av)
helpserv_init();
#ifdef USE_RDB
- db_mysql_init();
+ rdb_init();
#endif
/* Initialize proxy detection */
@@ -641,6 +641,11 @@ int init(int ac, char **av)
#endif
/* Load up databases */
+#ifdef USE_RDB
+ if (UseRDB)
+ rdb_load_dbases();
+ if (!UseRDB) {
+#endif
if (!skeleton) {
load_ns_dbase();
if (debug)
@@ -651,7 +656,6 @@ int init(int ac, char **av)
alog("debug: Loaded %s database (2/9)", s_HostServ);
}
if (s_BotServ) {
- load_bs_dbase();
if (debug)
alog("debug: Loaded %s database (3/9)", s_BotServ);
} else if (debug)
@@ -674,12 +678,24 @@ int init(int ac, char **av)
if (debug)
alog("debug: Loaded PreNick database (9/9)");
}
-
+ }
alog("Databases loaded");
/* Save the databases back to file/mysql to reflect any changes */
- save_databases();
-
+#ifdef USE_RDB
+ if (!UseRDB) /* Only save if we are not using remote databases
+ * to avoid floods. As a side effects our nice
+ * FFF databases won't get overwritten if the
+ * mysql db is broken (empty etc.) */
+ {
+#endif
+ alog("Info: Reflecting database records.");
+ save_databases();
+#ifdef USE_RDB
+ } else {
+ alog("Info: Not reflecting database records.");
+ }
+#endif
/* Connect to the remote server */
servsock = conn(RemoteServer, RemotePort, LocalHost, LocalPort);
if (servsock < 0 && RemoteServer2) {