anope- supernets anope source code & configuration |
git clone git://git.acid.vegas/anope.git |
Log | Files | Refs | Archive | README |
EVENTS (1390B)
1 Anope Internal Events 2 --------------------- 3 4 1) Intro 5 2) Using Events 6 7 1) Introduction to Internal Events 8 9 Internal Events are setup to give module developers more information 10 about what the core is doing at different times. This information can 11 be as complex as data we are feeding to the uplink, to simple triggered 12 events such as the databases being saved. 13 14 Additionally there is a module included with the core 15 which can provide some clue as to how to use the code in your modules. 16 The rest of this document assumes that you are used to writing modules. 17 18 2) Using Events 19 20 Each Event in Anope calls a function. 21 You must override these functions in your main modules class. 22 The full list of functions and parameters are in modules.h. In this 23 case, you would be overriding OnJoinChannel() and OnPartChannel() like so: 24 25 void OnJoinChannel(User *u, Channel *c) anope_override { } 26 void OnPartChannel(User *u, Channel *c) anope_override { } 27 28 Some of these event overrides can be used to prevent or allow things to 29 happen that would normally not be allowed or denied. You can also use 30 ModuleManager (not explained here) to set control which order the modules 31 are queried (when multiple modules hook to the same event). 32 33 The "anope_override" identifier is for compatibility with C++11. 34 Its usage is highly recommended.