X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmodules.h;h=8ec59102434f90fc7a2b7e139fb234ef114bcb78;hb=20fa9e1038ee3d5c2d0c89bf7e8e6dcda0644aa6;hp=81664d3640c8ece744979e58e195ae6628a4461a;hpb=2ab383f707ec648ceeb29059ce4f54d4bbb056a4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/modules.h b/include/modules.h index 81664d364..8ec591024 100644 --- a/include/modules.h +++ b/include/modules.h @@ -107,7 +107,7 @@ struct ModResult { * and numerical comparisons in preprocessor macros if they wish to support * multiple versions of InspIRCd in one file. */ -#define INSPIRCD_VERSION_API 6 +#define INSPIRCD_VERSION_API 8 /** * This #define allows us to call a method in all @@ -217,13 +217,13 @@ enum Implementation I_OnUserConnect, I_OnUserPreQuit, I_OnUserQuit, I_OnUserDisconnect, I_OnUserJoin, I_OnUserPart, I_OnSendSnotice, I_OnUserPreJoin, I_OnUserPreKick, I_OnUserKick, I_OnOper, I_OnUserPreInvite, I_OnUserInvite, I_OnUserPreMessage, I_OnUserPreNick, - I_OnUserPostMessage, I_OnUserMessageBlocked, I_OnMode, + I_OnUserPostMessage, I_OnUserMessageBlocked, I_OnMode, I_OnShutdown, I_OnDecodeMetaData, I_OnAcceptConnection, I_OnUserInit, I_OnUserPostInit, I_OnChangeHost, I_OnChangeRealName, I_OnAddLine, I_OnDelLine, I_OnExpireLine, I_OnUserPostNick, I_OnPreMode, I_On005Numeric, I_OnKill, I_OnLoadModule, I_OnUnloadModule, I_OnBackgroundTimer, I_OnPreCommand, I_OnCheckReady, I_OnCheckInvite, I_OnRawMode, I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnCheckChannelBan, I_OnExtBanCheck, - I_OnPreChangeHost, I_OnPreTopicChange, + I_OnPreChangeHost, I_OnPreTopicChange, I_OnConnectionFail, I_OnPostTopicChange, I_OnPostConnect, I_OnPostDeoper, I_OnPreChangeRealName, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete, I_OnPostOper, I_OnPostCommand, I_OnPostJoin, @@ -942,6 +942,20 @@ class CoreExport Module : public classbase, public usecountbase * deny the message from being sent, or MOD_RES_PASSTHRU to let another module handle the event. */ virtual ModResult OnUserWrite(LocalUser* user, ClientProtocol::Message& msg); + + /** Called when a user connection has been unexpectedly disconnected. + * @param user The user who has been unexpectedly disconnected. + * @param error The type of error which caused this connection failure. + * @return MOD_RES_ALLOW to explicitly retain the user as a zombie, MOD_RES_DENY to explicitly + * disconnect the user, or MOD_RES_PASSTHRU to let another module handle the event. + */ + virtual ModResult OnConnectionFail(LocalUser* user, BufferedSocketError error); + + /** Called before a server shuts down. + * @param reason The reason the server is shutting down. + * @param restart Whether the server is restarting. + */ + virtual void OnShutdown(const std::string& reason); }; /** ModuleManager takes care of all things module-related