From bab9f4b4bc0f6aa0e1377745fd216ef9874b3f27 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 9 Dec 2005 20:21:39 +0000 Subject: Added new module docs git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2301 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/modules_8h-source.html | 859 ++++++++++++++++++--------------- 1 file changed, 463 insertions(+), 396 deletions(-) (limited to 'docs/module-doc/modules_8h-source.html') diff --git a/docs/module-doc/modules_8h-source.html b/docs/module-doc/modules_8h-source.html index a66aa14b1..5fc39102d 100644 --- a/docs/module-doc/modules_8h-source.html +++ b/docs/module-doc/modules_8h-source.html @@ -27,424 +27,491 @@ 00018 #ifndef __PLUGIN_H 00019 #define __PLUGIN_H 00020 -00021 // log levels -00022 00023 #define DEBUG 10 00024 #define VERBOSE 20 00025 #define DEFAULT 30 00026 #define SPARSE 40 00027 #define NONE 50 00028 -00029 // used with OnExtendedMode() method of modules -00030 00031 #define MT_CHANNEL 1 00032 #define MT_CLIENT 2 00033 #define MT_SERVER 3 00034 -00035 // used with OnAccessCheck() method of modules -00036 00037 #define ACR_DEFAULT 0 // Do default action (act as if the module isnt even loaded) 00038 #define ACR_DENY 1 // deny the action 00039 #define ACR_ALLOW 2 // allow the action -00040 -00041 #define AC_KICK 0 // a user is being kicked -00042 #define AC_DEOP 1 // a user is being deopped -00043 #define AC_OP 2 // a user is being opped -00044 #define AC_VOICE 3 // a user is being voiced -00045 #define AC_DEVOICE 4 // a user is being devoiced -00046 #define AC_HALFOP 5 // a user is being halfopped -00047 #define AC_DEHALFOP 6 // a user is being dehalfopped -00048 #define AC_INVITE 7 // a user is being invited -00049 #define AC_GENERAL_MODE 8 // a user channel mode is being changed -00050 -00051 // used to define a set of behavior bits for a module -00052 -00053 #define VF_STATIC 1 // module is static, cannot be /unloadmodule'd -00054 #define VF_VENDOR 2 // module is a vendor module (came in the original tarball, not 3rd party) -00055 #define VF_SERVICEPROVIDER 4 // module provides a service to other modules (can be a dependency) -00056 #define VF_COMMON 8 // module needs to be common on all servers in a mesh to link -00057 -00058 #include "dynamic.h" -00059 #include "base.h" -00060 #include "ctables.h" -00061 #include "socket.h" -00062 #include <string> -00063 #include <deque> -00064 #include <sstream> -00065 -00068 typedef std::deque<std::string> file_cache; -00069 typedef file_cache string_list; -00070 -00073 typedef std::deque<userrec*> chanuserlist; -00074 +00040 #define AC_KICK 0 // a user is being kicked +00041 #define AC_DEOP 1 // a user is being deopped +00042 #define AC_OP 2 // a user is being opped +00043 #define AC_VOICE 3 // a user is being voiced +00044 #define AC_DEVOICE 4 // a user is being devoiced +00045 #define AC_HALFOP 5 // a user is being halfopped +00046 #define AC_DEHALFOP 6 // a user is being dehalfopped +00047 #define AC_INVITE 7 // a user is being invited +00048 #define AC_GENERAL_MODE 8 // a user channel mode is being changed +00049 +00052 #define VF_STATIC 1 // module is static, cannot be /unloadmodule'd +00053 #define VF_VENDOR 2 // module is a vendor module (came in the original tarball, not 3rd party) +00054 #define VF_SERVICEPROVIDER 4 // module provides a service to other modules (can be a dependency) +00055 #define VF_COMMON 8 // module needs to be common on all servers in a mesh to link +00056 +00057 #include "dynamic.h" +00058 #include "base.h" +00059 #include "ctables.h" +00060 #include "socket.h" +00061 #include <string> +00062 #include <deque> +00063 #include <sstream> +00064 +00065 class Server; +00066 +00069 typedef std::deque<std::string> file_cache; +00070 typedef file_cache string_list; +00071 +00074 typedef std::deque<userrec*> chanuserlist; 00075 -00076 // This #define allows us to call a method in all -00077 // loaded modules in a readable simple way, e.g.: -00078 // 'FOREACH_MOD OnConnect(user);' -00079 -00080 #define FOREACH_MOD for (int _i = 0; _i <= MODCOUNT; _i++) modules[_i]-> -00081 -00082 // This define is similar to the one above but returns a result in MOD_RESULT. -00083 // The first module to return a nonzero result is the value to be accepted, -00084 // and any modules after are ignored. -00085 -00086 // ********************************************************************************************* -00087 -00088 #define FOREACH_RESULT(x) { MOD_RESULT = 0; \ -00089 for (int _i = 0; _i <= MODCOUNT; _i++) { \ -00090 int res = modules[_i]->x ; \ -00091 if (res != 0) { \ -00092 MOD_RESULT = res; \ -00093 break; \ -00094 } \ -00095 } \ -00096 } -00097 -00098 // ********************************************************************************************* -00099 -00100 #define FD_MAGIC_NUMBER -42 -00101 -00102 extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); -00103 extern void server_mode(char **parameters, int pcnt, userrec *user); -00104 -00105 // class Version holds the version information of a Module, returned -00106 // by Module::GetVersion (thanks RD) -00107 -00112 class Version : public classbase -00113 { -00114 public: -00115 const int Major, Minor, Revision, Build, Flags; -00116 Version(int major, int minor, int revision, int build, int flags); -00117 }; -00118 -00124 class Admin : public classbase -00125 { -00126 public: -00127 const std::string Name, Email, Nick; -00128 Admin(std::string name, std::string email, std::string nick); -00129 }; -00130 +00076 +00077 // This #define allows us to call a method in all +00078 // loaded modules in a readable simple way, e.g.: +00079 // 'FOREACH_MOD OnConnect(user);' +00080 +00081 #define FOREACH_MOD for (int _i = 0; _i <= MODCOUNT; _i++) modules[_i]-> +00082 +00083 // This define is similar to the one above but returns a result in MOD_RESULT. +00084 // The first module to return a nonzero result is the value to be accepted, +00085 // and any modules after are ignored. +00086 +00087 // ********************************************************************************************* +00088 +00089 #define FOREACH_RESULT(x) { MOD_RESULT = 0; \ +00090 for (int _i = 0; _i <= MODCOUNT; _i++) { \ +00091 int res = modules[_i]->x ; \ +00092 if (res != 0) { \ +00093 MOD_RESULT = res; \ +00094 break; \ +00095 } \ +00096 } \ +00097 } +00098 +00099 // ********************************************************************************************* +00100 +00101 #define FD_MAGIC_NUMBER -42 +00102 +00103 extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); +00104 extern void server_mode(char **parameters, int pcnt, userrec *user); +00105 +00106 // class Version holds the version information of a Module, returned +00107 // by Module::GetVersion (thanks RD) +00108 +00113 class Version : public classbase +00114 { +00115 public: +00116 const int Major, Minor, Revision, Build, Flags; +00117 Version(int major, int minor, int revision, int build, int flags); +00118 }; +00119 +00125 class Admin : public classbase +00126 { +00127 public: +00128 const std::string Name, Email, Nick; +00129 Admin(std::string name, std::string email, std::string nick); +00130 }; 00131 -00132 // Forward-delacare module for ModuleMessage etc -00133 class Module; -00134 -00135 // Thanks to Rob (from anope) for the idea of this message passing API -00136 // (its been done before, but this seemed a very neat and tidy way... -00137 -00142 class ModuleMessage : public classbase -00143 { -00144 public: -00147 virtual char* Send() = 0; -00148 virtual ~ModuleMessage() {}; -00149 }; -00150 -00156 class Request : public ModuleMessage -00157 { -00158 protected: -00161 char* data; -00165 Module* source; -00168 Module* dest; -00169 public: -00172 Request(char* anydata, Module* src, Module* dst); -00175 char* GetData(); -00178 Module* GetSource(); -00181 Module* GetDest(); -00187 char* Send(); -00188 }; -00189 +00132 +00133 // Forward-delacare module for ModuleMessage etc +00134 class Module; +00135 +00136 // Thanks to Rob (from anope) for the idea of this message passing API +00137 // (its been done before, but this seemed a very neat and tidy way... +00138 +00143 class ModuleMessage : public classbase +00144 { +00145 public: +00148 virtual char* Send() = 0; +00149 virtual ~ModuleMessage() {}; +00150 }; +00151 +00157 class Request : public ModuleMessage +00158 { +00159 protected: +00162 char* data; +00166 Module* source; +00169 Module* dest; +00170 public: +00173 Request(char* anydata, Module* src, Module* dst); +00176 char* GetData(); +00179 Module* GetSource(); +00182 Module* GetDest(); +00188 char* Send(); +00189 }; 00190 -00196 class Event : public ModuleMessage -00197 { -00198 protected: -00201 char* data; -00205 Module* source; -00210 std::string id; -00211 public: -00214 Event(char* anydata, Module* src, std::string eventid); -00217 char* GetData(); -00220 Module* GetSource(); -00224 std::string GetEventID(); -00229 char* Send(); -00230 }; -00231 +00191 +00197 class Event : public ModuleMessage +00198 { +00199 protected: +00202 char* data; +00206 Module* source; +00211 std::string id; +00212 public: +00215 Event(char* anydata, Module* src, std::string eventid); +00218 char* GetData(); +00221 Module* GetSource(); +00225 std::string GetEventID(); +00230 char* Send(); +00231 }; 00232 -00238 class Module : public classbase -00239 { -00240 public: -00241 -00245 Module(); -00246 -00250 virtual ~Module(); -00251 -00256 virtual Version GetVersion(); -00257 -00261 virtual void OnUserConnect(userrec* user); -00262 -00268 virtual void OnUserQuit(userrec* user); -00269 -00275 virtual void OnUserDisconnect(userrec* user); -00276 -00281 virtual void OnUserJoin(userrec* user, chanrec* channel); +00233 +00239 class Module : public classbase +00240 { +00241 public: +00242 +00247 Module(Server* Me); +00248 +00252 virtual ~Module(); +00253 +00258 virtual Version GetVersion(); +00259 +00264 virtual void OnUserConnect(userrec* user); +00265 +00273 virtual void OnUserQuit(userrec* user, std::string message); +00274 +00281 virtual void OnUserDisconnect(userrec* user); 00282 -00287 virtual void OnUserPart(userrec* user, chanrec* channel); -00288 -00294 virtual void OnPacketTransmit(std::string &data, std::string serv); -00295 -00302 virtual void OnPacketReceive(std::string &data, std::string serv); -00303 -00309 virtual void OnRehash(); -00310 +00289 virtual void OnUserJoin(userrec* user, chanrec* channel); +00290 +00297 virtual void OnUserPart(userrec* user, chanrec* channel); +00298 +00306 virtual void OnRehash(std::string parameter); +00307 00319 virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user); 00320 -00330 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params); -00331 -00345 virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname); -00346 -00352 virtual int OnUserPreKick(userrec* source, userrec* user, chanrec* chan, std::string reason); -00353 -00358 virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, std::string reason); -00359 -00364 virtual void OnOper(userrec* user); -00365 -00374 virtual void OnInfo(userrec* user); -00375 -00380 virtual void OnWhois(userrec* source, userrec* dest); -00381 -00387 virtual int OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel); -00388 -00397 virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text); -00398 -00410 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text); -00411 -00419 virtual int OnUserPreNick(userrec* user, std::string newnick); -00420 -00428 virtual void OnUserPostNick(userrec* user, std::string oldnick); -00429 -00451 virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type); -00452 -00458 virtual string_list OnUserSync(userrec* user); -00459 -00465 virtual string_list OnChannelSync(chanrec* chan); -00466 -00470 virtual void On005Numeric(std::string &output); -00471 -00481 virtual int OnKill(userrec* source, userrec* dest, std::string reason); -00482 -00493 virtual void OnLoadModule(Module* mod,std::string name); -00494 -00505 virtual void OnUnloadModule(Module* mod,std::string name); -00506 -00512 virtual void OnBackgroundTimer(time_t curtime); -00513 -00521 virtual void OnSendList(userrec* user, chanrec* channel, char mode); -00522 -00533 virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user); -00534 -00543 virtual bool OnCheckReady(userrec* user); -00544 -00552 virtual void OnUserRegister(userrec* user); -00553 -00559 virtual int OnRawMode(userrec* user, chanrec* chan, char mode, std::string param, bool adding, int pcnt); -00560 -00566 virtual int OnCheckInvite(userrec* user, chanrec* chan); -00567 -00574 virtual int OnCheckKey(userrec* user, chanrec* chan, std::string keygiven); -00575 -00581 virtual int OnCheckLimit(userrec* user, chanrec* chan); -00582 -00588 virtual int OnCheckBan(userrec* user, chanrec* chan); -00589 -00593 virtual void OnStats(char symbol); -00594 -00598 virtual int OnChangeLocalUserHost(userrec* user, std::string newhost); -00599 -00603 virtual int OnChangeLocalUserGECOS(userrec* user, std::string newhost); -00604 -00608 virtual int OnLocalTopicChange(userrec* user, chanrec* chan, std::string topic); -00609 -00615 virtual void OnEvent(Event* event); -00616 -00623 virtual char* OnRequest(Request* request); -00624 -00631 virtual int OnOperCompare(std::string password, std::string input); -00632 -00638 virtual void OnGlobalOper(userrec* user); -00639 -00644 virtual void OnGlobalConnect(userrec* user); -00645 -00649 virtual int OnAddBan(userrec* source, chanrec* channel,std::string banmask); -00650 -00654 virtual int OnDelBan(userrec* source, chanrec* channel,std::string banmask); +00336 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params); +00337 +00354 virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname); +00355 +00366 virtual int OnUserPreKick(userrec* source, userrec* user, chanrec* chan, std::string reason); +00367 +00376 virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, std::string reason); +00377 +00384 virtual void OnOper(userrec* user, std::string opertype); +00385 +00396 virtual void OnInfo(userrec* user); +00397 +00404 virtual void OnWhois(userrec* source, userrec* dest); +00405 +00415 virtual int OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel); +00416 +00424 virtual void OnUserInvite(userrec* source,userrec* dest,chanrec* channel); +00425 +00439 virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text); +00440 +00457 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text); +00458 +00469 virtual int OnUserPreNick(userrec* user, std::string newnick); +00470 +00479 virtual void OnUserMessage(userrec* user, void* dest, int target_type, std::string text); +00480 +00489 virtual void OnUserNotice(userrec* user, void* dest, int target_type, std::string text); +00490 +00500 virtual void OnMode(userrec* user, void* dest, int target_type, std::string text); +00501 +00510 virtual void OnGetServerDescription(std::string servername,std::string &description); +00511 +00524 virtual void OnSyncUser(userrec* user, Module* proto, void* opaque); +00525 +00541 virtual void OnSyncChannel(chanrec* chan, Module* proto, void* opaque); +00542 +00543 /* Allows modules to syncronize metadata related to channels over the network during a netburst. +00544 * Whenever the linking module wants to send out data, but doesnt know what the data +00545 * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then +00546 * this method is called.You should use the ProtoSendMetaData function after you've +00547 * correctly decided how the data should be represented, to send the metadata on its way if it belongs +00548 * to your module. For a good example of how to use this method, see src/modules/m_swhois.cpp. +00549 * @param chan The channel whos metadata is being syncronized +00550 * @param proto A pointer to the module handling network protocol +00551 * @param opaque An opaque pointer set by the protocol module, should not be modified! +00552 * @param extname The extensions name which is being searched for +00553 */ +00554 virtual void OnSyncChannelMetaData(chanrec* chan, Module* proto,void* opaque, std::string extname); +00555 +00556 /* Allows modules to syncronize metadata related to users over the network during a netburst. +00557 * Whenever the linking module wants to send out data, but doesnt know what the data +00558 * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then +00559 * this method is called. You should use the ProtoSendMetaData function after you've +00560 * correctly decided how the data should be represented, to send the metadata on its way if +00561 * if it belongs to your module. +00562 * @param user The user whos metadata is being syncronized +00563 * @param proto A pointer to the module handling network protocol +00564 * @param opaque An opaque pointer set by the protocol module, should not be modified! +00565 * @param extname The extensions name which is being searched for +00566 */ +00567 virtual void OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, std::string extname); +00568 +00576 virtual void OnDecodeMetaData(int target_type, void* target, std::string extname, std::string extdata); +00577 +00591 virtual void ProtoSendMode(void* opaque, int target_type, void* target, std::string modeline); +00592 +00607 virtual void ProtoSendMetaData(void* opaque, int target_type, void* target, std::string extname, std::string extdata); +00608 +00613 virtual void OnWallops(userrec* user, std::string text); +00614 +00620 virtual void OnChangeHost(userrec* user, std::string newhost); +00621 +00627 virtual void OnChangeName(userrec* user, std::string gecos); +00628 +00636 virtual void OnAddGLine(long duration, userrec* source, std::string reason, std::string hostmask); +00637 +00645 virtual void OnAddZLine(long duration, userrec* source, std::string reason, std::string ipmask); +00646 +00654 virtual void OnAddKLine(long duration, userrec* source, std::string reason, std::string hostmask); 00655 -00662 virtual void OnRawSocketAccept(int fd, std::string ip, int localport); -00663 -00670 virtual int OnRawSocketWrite(int fd, char* buffer, int count); -00671 -00675 virtual void OnRawSocketClose(int fd); -00676 -00687 virtual int OnRawSocketRead(int fd, char* buffer, unsigned int count, int &readresult); -00688 }; -00689 -00690 -00696 class Server : public classbase -00697 { -00698 public: -00702 Server(); -00706 virtual ~Server(); -00707 -00711 virtual void SendOpers(std::string s); -00716 virtual void Log(int level, std::string s); -00721 virtual void Send(int Socket, std::string s); -00726 virtual void SendServ(int Socket, std::string s); -00730 virtual void SendChannelServerNotice(std::string ServName, chanrec* Channel, std::string text); -00735 virtual void SendFrom(int Socket, userrec* User, std::string s); -00750 virtual void SendTo(userrec* Source, userrec* Dest, std::string s); -00757 virtual void SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender); -00762 virtual bool CommonChannels(userrec* u1, userrec* u2); -00770 virtual void SendCommon(userrec* User, std::string text,bool IncludeSender); -00775 virtual void SendWallops(userrec* User, std::string text); -00776 -00780 virtual bool IsNick(std::string nick); -00784 virtual int CountUsers(chanrec* c); -00788 virtual userrec* FindNick(std::string nick); -00792 virtual userrec* FindDescriptor(int socket); -00796 virtual chanrec* FindChannel(std::string channel); -00801 virtual std::string ChanMode(userrec* User, chanrec* Chan); -00805 virtual bool IsOnChannel(userrec* User, chanrec* Chan); -00808 virtual std::string GetServerName(); -00811 virtual std::string GetNetworkName(); -00814 virtual std::string GetServerDescription(); -00820 virtual Admin GetAdmin(); -00839 virtual bool AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off); -00840 -00862 virtual bool AddExtendedListMode(char modechar); -00863 -00881 virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); -00882 -00904 virtual void SendMode(char **parameters, int pcnt, userrec *user); -00905 -00918 virtual void SendToModeMask(std::string modes, int flags, std::string text); -00919 -00925 virtual chanrec* JoinUserToChannel(userrec* user, std::string cname, std::string key); -00926 -00932 virtual chanrec* PartUserFromChannel(userrec* user, std::string cname, std::string reason); -00933 -00939 virtual void ChangeUserNick(userrec* user, std::string nickname); -00940 -00951 virtual void QuitUser(userrec* user, std::string reason); -00952 -00957 virtual bool MatchText(std::string sliteral, std::string spattern); -00958 -00970 virtual void CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user); -00971 -00977 virtual void ChangeHost(userrec* user, std::string host); -00978 -00984 virtual void ChangeGECOS(userrec* user, std::string gecos); -00985 -00994 virtual bool IsUlined(std::string server); -00995 -00999 virtual chanuserlist GetUsers(chanrec* chan); -01000 -01007 virtual bool UserToPseudo(userrec* user,std::string message); -01008 -01015 virtual bool PseudoToUser(userrec* alive,userrec* zombie,std::string message); -01016 -01024 virtual void AddGLine(long duration, std::string source, std::string reason, std::string hostmask); -01025 -01033 virtual void AddQLine(long duration, std::string source, std::string reason, std::string nickname); -01034 -01042 virtual void AddZLine(long duration, std::string source, std::string reason, std::string ipaddr); -01043 -01051 virtual void AddKLine(long duration, std::string source, std::string reason, std::string hostmask); -01052 -01060 virtual void AddELine(long duration, std::string source, std::string reason, std::string hostmask); -01061 -01064 virtual bool DelGLine(std::string hostmask); -01065 -01068 virtual bool DelQLine(std::string nickname); -01069 -01072 virtual bool DelZLine(std::string ipaddr); -01073 -01076 virtual bool DelKLine(std::string hostmask); -01077 -01080 virtual bool DelELine(std::string hostmask); -01081 -01087 virtual long CalcDuration(std::string duration); -01088 -01091 virtual bool IsValidMask(std::string mask); +00663 virtual void OnAddQLine(long duration, userrec* source, std::string reason, std::string nickmask); +00664 +00672 virtual void OnAddELine(long duration, userrec* source, std::string reason, std::string hostmask); +00673 +00679 virtual void OnDelGLine(userrec* source, std::string hostmask); +00680 +00686 virtual void OnDelZLine(userrec* source, std::string ipmask); +00687 +00693 virtual void OnDelKLine(userrec* source, std::string hostmask); +00694 +00700 virtual void OnDelQLine(userrec* source, std::string nickmask); +00701 +00707 virtual void OnDelELine(userrec* source, std::string hostmask); +00708 +00718 virtual void OnCleanup(int target_type, void* item); +00719 +00729 virtual void OnUserPostNick(userrec* user, std::string oldnick); +00730 +00756 virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type); +00757 +00762 virtual void On005Numeric(std::string &output); +00763 +00777 virtual int OnKill(userrec* source, userrec* dest, std::string reason); +00778 +00784 virtual void OnRemoteKill(userrec* source, userrec* dest, std::string reason); +00785 +00798 virtual void OnLoadModule(Module* mod,std::string name); +00799 +00812 virtual void OnUnloadModule(Module* mod,std::string name); +00813 +00820 virtual void OnBackgroundTimer(time_t curtime); +00821 +00832 virtual void OnSendList(userrec* user, chanrec* channel, char mode); +00833 +00849 virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user); +00850 +00861 virtual bool OnCheckReady(userrec* user); +00862 +00871 virtual void OnUserRegister(userrec* user); +00872 +00885 virtual int OnRawMode(userrec* user, chanrec* chan, char mode, std::string param, bool adding, int pcnt); +00886 +00895 virtual int OnCheckInvite(userrec* user, chanrec* chan); +00896 +00906 virtual int OnCheckKey(userrec* user, chanrec* chan, std::string keygiven); +00907 +00916 virtual int OnCheckLimit(userrec* user, chanrec* chan); +00917 +00926 virtual int OnCheckBan(userrec* user, chanrec* chan); +00927 +00932 virtual void OnStats(char symbol); +00933 +00940 virtual int OnChangeLocalUserHost(userrec* user, std::string newhost); +00941 +00948 virtual int OnChangeLocalUserGECOS(userrec* user, std::string newhost); +00949 +00957 virtual int OnLocalTopicChange(userrec* user, chanrec* chan, std::string topic); +00958 +00965 virtual void OnPostLocalTopicChange(userrec* user, chanrec* chan, std::string topic); +00966 +00973 virtual void OnEvent(Event* event); +00974 +00982 virtual char* OnRequest(Request* request); +00983 +00993 virtual int OnOperCompare(std::string password, std::string input); +00994 +01001 virtual void OnGlobalOper(userrec* user); +01002 +01008 virtual void OnGlobalConnect(userrec* user); +01009 +01017 virtual int OnAddBan(userrec* source, chanrec* channel,std::string banmask); +01018 +01026 virtual int OnDelBan(userrec* source, chanrec* channel,std::string banmask); +01027 +01037 virtual void OnRawSocketAccept(int fd, std::string ip, int localport); +01038 +01049 virtual int OnRawSocketWrite(int fd, char* buffer, int count); +01050 +01055 virtual void OnRawSocketClose(int fd); +01056 +01072 virtual int OnRawSocketRead(int fd, char* buffer, unsigned int count, int &readresult); +01073 }; +01074 +01075 +01081 class Server : public classbase +01082 { +01083 public: +01087 Server(); +01091 virtual ~Server(); 01092 -01097 virtual Module* FindModule(std::string name); -01098 -01101 virtual void AddSocket(InspSocket* sock); -01102 -01105 virtual void DelSocket(InspSocket* sock); -01106 }; -01107 -01108 -01109 #define CONF_NOT_A_NUMBER 0x000010 -01110 #define CONF_NOT_UNSIGNED 0x000080 -01111 #define CONF_VALUE_NOT_FOUND 0x000100 -01112 #define CONF_FILE_NOT_FOUND 0x000200 -01113 -01114 -01121 class ConfigReader : public classbase -01122 { -01123 protected: -01129 std::stringstream *cache; -01130 std::stringstream *errorlog; -01133 bool readerror; -01134 long error; -01135 -01136 public: -01141 ConfigReader(); // default constructor reads ircd.conf -01145 ConfigReader(std::string filename); // read a module-specific config -01149 ~ConfigReader(); -01154 std::string ReadValue(std::string tag, std::string name, int index); -01160 bool ReadFlag(std::string tag, std::string name, int index); -01169 long ReadInteger(std::string tag, std::string name, int index, bool needs_unsigned); -01174 long GetError(); -01181 int Enumerate(std::string tag); -01186 bool Verify(); -01193 void DumpErrors(bool bail,userrec* user); -01194 -01200 int EnumerateValues(std::string tag, int index); -01201 }; -01202 -01203 -01204 -01210 class FileReader : public classbase -01211 { -01212 file_cache fc; -01213 public: -01218 FileReader(); -01219 -01225 FileReader(std::string filename); -01226 -01230 ~FileReader(); -01231 -01237 void LoadFile(std::string filename); -01238 -01242 bool Exists(); -01243 -01248 std::string GetLine(int x); -01249 -01255 int FileSize(); -01256 }; -01257 -01258 -01265 class ModuleFactory : public classbase -01266 { -01267 public: -01268 ModuleFactory() { } -01269 virtual ~ModuleFactory() { } -01274 virtual Module * CreateModule() = 0; -01275 }; -01276 -01277 -01278 typedef DLLFactory<ModuleFactory> ircd_module; -01279 -01280 #endif -
Generated on Sun Nov 27 01:43:24 2005 for InspIRCd by  +01096 virtual void SendOpers(std::string s); +01101 virtual void Log(int level, std::string s); +01106 virtual void Send(int Socket, std::string s); +01111 virtual void SendServ(int Socket, std::string s); +01115 virtual void SendChannelServerNotice(std::string ServName, chanrec* Channel, std::string text); +01120 virtual void SendFrom(int Socket, userrec* User, std::string s); +01135 virtual void SendTo(userrec* Source, userrec* Dest, std::string s); +01142 virtual void SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender); +01147 virtual bool CommonChannels(userrec* u1, userrec* u2); +01155 virtual void SendCommon(userrec* User, std::string text,bool IncludeSender); +01160 virtual void SendWallops(userrec* User, std::string text); +01161 +01165 virtual bool IsNick(std::string nick); +01169 virtual int CountUsers(chanrec* c); +01173 virtual userrec* FindNick(std::string nick); +01177 virtual userrec* FindDescriptor(int socket); +01181 virtual chanrec* FindChannel(std::string channel); +01186 virtual std::string ChanMode(userrec* User, chanrec* Chan); +01190 virtual bool IsOnChannel(userrec* User, chanrec* Chan); +01193 virtual std::string GetServerName(); +01196 virtual std::string GetNetworkName(); +01199 virtual std::string GetServerDescription(); +01205 virtual Admin GetAdmin(); +01224 virtual bool AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off); +01225 +01247 virtual bool AddExtendedListMode(char modechar); +01248 +01266 virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); +01267 +01289 virtual void SendMode(char **parameters, int pcnt, userrec *user); +01290 +01303 virtual void SendToModeMask(std::string modes, int flags, std::string text); +01304 +01310 virtual chanrec* JoinUserToChannel(userrec* user, std::string cname, std::string key); +01311 +01317 virtual chanrec* PartUserFromChannel(userrec* user, std::string cname, std::string reason); +01318 +01324 virtual void ChangeUserNick(userrec* user, std::string nickname); +01325 +01336 virtual void QuitUser(userrec* user, std::string reason); +01337 +01342 virtual bool MatchText(std::string sliteral, std::string spattern); +01343 +01355 virtual void CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user); +01356 +01357 virtual bool IsValidModuleCommand(std::string commandname, int pcnt, userrec* user); +01358 +01364 virtual void ChangeHost(userrec* user, std::string host); +01365 +01371 virtual void ChangeGECOS(userrec* user, std::string gecos); +01372 +01381 virtual bool IsUlined(std::string server); +01382 +01386 virtual chanuserlist GetUsers(chanrec* chan); +01387 +01394 virtual bool UserToPseudo(userrec* user,std::string message); +01395 +01402 virtual bool PseudoToUser(userrec* alive,userrec* zombie,std::string message); +01403 +01411 virtual void AddGLine(long duration, std::string source, std::string reason, std::string hostmask); +01412 +01420 virtual void AddQLine(long duration, std::string source, std::string reason, std::string nickname); +01421 +01429 virtual void AddZLine(long duration, std::string source, std::string reason, std::string ipaddr); +01430 +01438 virtual void AddKLine(long duration, std::string source, std::string reason, std::string hostmask); +01439 +01447 virtual void AddELine(long duration, std::string source, std::string reason, std::string hostmask); +01448 +01451 virtual bool DelGLine(std::string hostmask); +01452 +01455 virtual bool DelQLine(std::string nickname); +01456 +01459 virtual bool DelZLine(std::string ipaddr); +01460 +01463 virtual bool DelKLine(std::string hostmask); +01464 +01467 virtual bool DelELine(std::string hostmask); +01468 +01474 virtual long CalcDuration(std::string duration); +01475 +01478 virtual bool IsValidMask(std::string mask); +01479 +01484 virtual Module* FindModule(std::string name); +01485 +01488 virtual void AddSocket(InspSocket* sock); +01489 +01492 virtual void DelSocket(InspSocket* sock); +01493 +01494 virtual void RehashServer(); +01495 }; +01496 +01497 +01498 #define CONF_NOT_A_NUMBER 0x000010 +01499 #define CONF_NOT_UNSIGNED 0x000080 +01500 #define CONF_VALUE_NOT_FOUND 0x000100 +01501 #define CONF_FILE_NOT_FOUND 0x000200 +01502 +01503 +01510 class ConfigReader : public classbase +01511 { +01512 protected: +01518 std::stringstream *cache; +01519 std::stringstream *errorlog; +01522 bool readerror; +01523 long error; +01524 +01525 public: +01530 ConfigReader(); // default constructor reads ircd.conf +01534 ConfigReader(std::string filename); // read a module-specific config +01538 ~ConfigReader(); +01543 std::string ReadValue(std::string tag, std::string name, int index); +01549 bool ReadFlag(std::string tag, std::string name, int index); +01558 long ReadInteger(std::string tag, std::string name, int index, bool needs_unsigned); +01563 long GetError(); +01570 int Enumerate(std::string tag); +01575 bool Verify(); +01582 void DumpErrors(bool bail,userrec* user); +01583 +01589 int EnumerateValues(std::string tag, int index); +01590 }; +01591 +01592 +01593 +01599 class FileReader : public classbase +01600 { +01601 file_cache fc; +01602 public: +01607 FileReader(); +01608 +01614 FileReader(std::string filename); +01615 +01619 ~FileReader(); +01620 +01626 void LoadFile(std::string filename); +01627 +01631 bool Exists(); +01632 +01637 std::string GetLine(int x); +01638 +01644 int FileSize(); +01645 }; +01646 +01647 +01654 class ModuleFactory : public classbase +01655 { +01656 public: +01657 ModuleFactory() { } +01658 virtual ~ModuleFactory() { } +01663 virtual Module * CreateModule(Server* Me) = 0; +01664 }; +01665 +01666 +01667 typedef DLLFactory<ModuleFactory> ircd_module; +01668 +01669 #endif +
Generated on Fri Dec 9 20:20:03 2005 for InspIRCd by  doxygen 1.4.4-20050815
-- cgit v1.2.3