changed Makefile; build all commands as an own file
[NeonServV5.git] / main.c
diff --git a/main.c b/main.c
index 2d0ffc2c4bd5e23f0ce5a4e2892656e7b7f2f169..2fcc3dbec18349f0feae58657adb0cb8422dc1d1 100644 (file)
--- a/main.c
+++ b/main.c
@@ -9,7 +9,14 @@
 #include "WHOHandler.h"
 #include "bots.h"
 #include "mysqlConn.h"
+#include "HandleInfoHandler.h"
 #include "lang.h"
+#include "tools.h"
+#include "timeq.h"
+#include "EventLogger.h"
+#include "ModeNode.h"
+
+time_t start_time;
 
 void cleanup() {
     free_sockets();
@@ -21,27 +28,38 @@ void cleanup() {
     free_whoqueue();
     free_bots();
     free_mysql();
+    free_handleinfohandler();
     free_lang();
 }
 
 int main(void)
 {
+    start_time = time(0);
+    
     init_mysql();
     init_lang();
     init_parser();
     init_UserNode();
     init_ChanNode();
+    init_ModeNode();
     init_bind();
        init_modcmd();
+    init_handleinfohandler();
+    init_tools();
     init_bots();
     
+    load_languages();
+    
     time_t socket_wait;
     while(1) {
         socket_wait = time(0) + SOCKET_SELECT_TIME;
         do {
             socket_loop(SOCKET_SELECT_TIME);
-        } while(time(0) > socket_wait);
+        } while(time(0) < socket_wait);
+        timeq_tick();
+        loop_bots();
         clearTempUsers();
+        destroyEvents();
     }
 }