X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=main.c;h=2fcc3dbec18349f0feae58657adb0cb8422dc1d1;hb=795115bf680185ae01043bd1222b78bfed8c1d87;hp=1dd49500f38975fd51173d1dd2224977a6f56c53;hpb=06de317e5217b4a8b2fa60b9a1cdc3d70665a411;p=NeonServV5.git diff --git a/main.c b/main.c index 1dd4950..2fcc3db 100644 --- a/main.c +++ b/main.c @@ -8,6 +8,15 @@ #include "modcmd.h" #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(); @@ -18,24 +27,39 @@ void cleanup() { free_modcmd(); 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(); } }