1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-03 17:23:13 +02:00

* EventAdd() changed the order of parameters and expects every_msec now

which specifies the time in milliseconds rather than seconds. This
  allows for additional precision, or at least multiple calls per second.
  The minimum allowed every_msec value is 100 at this time.
  The prototype is now: EventAdd(Module *module, char *name,
  vFP event, void *data, long every_msec, int count);
This commit is contained in:
Bram Matthys
2019-09-22 15:05:00 +02:00
parent 4d277ccef8
commit 5b8f393a8f
22 changed files with 103 additions and 89 deletions
+1 -1
View File
@@ -190,7 +190,7 @@ MOD_INIT()
MOD_LOAD()
{
EventAdd(modinfo->handle, "modef_event", 10, 0, modef_event, NULL);
EventAdd(modinfo->handle, "modef_event", modef_event, NULL, 10000, 0);
floodprot_rehash_complete();
return MOD_SUCCESS;
}
+1 -1
View File
@@ -103,7 +103,7 @@ MOD_INIT()
MOD_LOAD()
{
EventAdd(modinfo->handle, "history_clean", HISTORY_TIMER_EVERY, 0, history_clean, NULL);
EventAdd(modinfo->handle, "history_clean", history_clean, NULL, HISTORY_TIMER_EVERY*1000, 0);
return MOD_SUCCESS;
}
+1 -1
View File
@@ -97,7 +97,7 @@ MOD_INIT()
MOD_LOAD()
{
EventAdd(modinfo->handle, "channeldb_write_channeldb", CHANNELDB_SAVE_EVERY, 0, write_channeldb_evt, NULL);
EventAdd(modinfo->handle, "channeldb_write_channeldb", write_channeldb_evt, NULL, CHANNELDB_SAVE_EVERY*1000, 0);
if (ModuleGetError(modinfo->handle) != MODERR_NOERROR)
{
config_error("A critical error occurred when loading module %s: %s", MOD_HEADER.name, ModuleGetErrorStr(modinfo->handle));
+1 -1
View File
@@ -111,7 +111,7 @@ MOD_INIT()
MOD_LOAD()
{
EventAdd(modinfo->handle, "connthrottle_evt", 1, 0, connthrottle_evt, NULL);
EventAdd(modinfo->handle, "connthrottle_evt", connthrottle_evt, NULL, 1000, 0);
return MOD_SUCCESS;
}
+1 -1
View File
@@ -89,7 +89,7 @@ ExtbanInfo extban;
return MOD_FAILED;
}
EventAdd(modinfo->handle, "timedban_timeout", TIMEDBAN_TIMER, 0, timedban_timeout, NULL);
EventAdd(modinfo->handle, "timedban_timeout", timedban_timeout, NULL, TIMEDBAN_TIMER*1000, 0);
return MOD_SUCCESS;
}
+1 -1
View File
@@ -24,7 +24,7 @@ MOD_INIT()
{
MARK_AS_OFFICIAL_MODULE(modinfo);
ModuleSetOptions(modinfo->handle, MOD_OPT_PERM, 1); /* needed? or not? */
EventAdd(NULL, "check_ident_timeout", 1, 0, check_ident_timeout, NULL);
EventAdd(NULL, "check_ident_timeout", check_ident_timeout, NULL, 1000, 0);
HookAdd(modinfo->handle, HOOKTYPE_IDENT_LOOKUP, 0, ident_lookup_connect);
return MOD_SUCCESS;
+1 -1
View File
@@ -100,7 +100,7 @@ MOD_INIT()
MOD_LOAD()
{
EventAdd(ModInfo->handle, "jointhrottle_cleanup_structs", 60, 0, jointhrottle_cleanup_structs, NULL);
EventAdd(ModInfo->handle, "jointhrottle_cleanup_structs", jointhrottle_cleanup_structs, NULL, 60000, 0);
return MOD_SUCCESS;
}
+1 -1
View File
@@ -81,7 +81,7 @@ MOD_LOAD()
cap.parameter = link_security_capability_parameter;
ClientCapabilityAdd(modinfo->handle, &cap, NULL);
EventAdd(modinfo->handle, "checklinksec", 2, 0, checklinksec, NULL);
EventAdd(modinfo->handle, "checklinksec", checklinksec, NULL, 2000, 0);
checklinksec(NULL);
return MOD_SUCCESS;
}
+1 -1
View File
@@ -90,7 +90,7 @@ MOD_INIT()
}
CommandAdd(modinfo->handle, MSG_LIST, cmd_list, MAXPARA, M_USER);
EventAdd(modinfo->handle, "send_queued_list_data", 1, 0, send_queued_list_data, NULL);
EventAdd(modinfo->handle, "send_queued_list_data", send_queued_list_data, NULL, 1500, 0);
return MOD_SUCCESS;
}
+3 -3
View File
@@ -175,9 +175,9 @@ MOD_LOAD()
load_db();
if (reputation_starttime == 0)
reputation_starttime = TStime();
EventAdd(ModInf.handle, "delete_old_records", DELETE_OLD_EVERY, 0, delete_old_records, NULL);
EventAdd(ModInf.handle, "add_scores", BUMP_SCORE_EVERY, 0, add_scores, NULL);
EventAdd(ModInf.handle, "save_db", SAVE_DB_EVERY, 0, save_db_evt, NULL);
EventAdd(ModInf.handle, "delete_old_records", delete_old_records, NULL, DELETE_OLD_EVERY*1000, 0);
EventAdd(ModInf.handle, "add_scores", add_scores, NULL, BUMP_SCORE_EVERY*1000, 0);
EventAdd(ModInf.handle, "save_db", save_db_evt, NULL, SAVE_DB_EVERY*1000, 0);
return MOD_SUCCESS;
}
+1 -1
View File
@@ -195,7 +195,7 @@ MOD_INIT()
MOD_LOAD()
{
EventAdd(modinfo->handle, "tklexpire", 5, 0, tkl_check_expire, NULL);
EventAdd(modinfo->handle, "tklexpire", tkl_check_expire, NULL, 5000, 0);
return MOD_SUCCESS;
}
+1 -1
View File
@@ -134,7 +134,7 @@ MOD_INIT()
MOD_LOAD()
{
EventAdd(modinfo->handle, "tkldb_write_tkldb", TKL_DB_SAVE_EVERY, 0, write_tkldb_evt, NULL);
EventAdd(modinfo->handle, "tkldb_write_tkldb", write_tkldb_evt, NULL, TKL_DB_SAVE_EVERY*1000, 0);
if (ModuleGetError(modinfo->handle) != MODERR_NOERROR)
{
config_error("A critical error occurred when loading module %s: %s", MOD_HEADER.name, ModuleGetErrorStr(modinfo->handle));