|
|||
|
|||
|


Public Member Functions | |
| ModuleChgHost (InspIRCd *Me) | |
| void | Implements (char *List) |
| The Implements function specifies which methods a module should receive events for. | |
| void | OnRehash (userrec *user, const std::string ¶meter) |
| Called on rehash. | |
| ~ModuleChgHost () | |
| Version | GetVersion () |
| Returns the version number of a Module. | |
Private Attributes | |
| cmd_chghost * | mycommand |
| char | hostmap [256] |
Definition at line 78 of file m_chghost.cpp.
|
|
Definition at line 83 of file m_chghost.cpp. References InspIRCd::AddCommand(), hostmap, mycommand, OnRehash(), and Module::ServerInstance. 00084 : Module(Me) 00085 { 00086 OnRehash(NULL,""); 00087 mycommand = new cmd_chghost(ServerInstance, hostmap); 00088 ServerInstance->AddCommand(mycommand); 00089 }
|
|
|
Definition at line 109 of file m_chghost.cpp.
|
|
|
Returns the version number of a Module. The method should return a Version object with its version information assigned via Version::Version Reimplemented from Module. Definition at line 113 of file m_chghost.cpp. References API_VERSION, VF_COMMON, and VF_VENDOR. 00114 { 00115 return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); 00116 }
|
|
|
The Implements function specifies which methods a module should receive events for. The char* parameter passed to this function contains a set of true or false values (1 or 0) which indicate wether each function is implemented. You must use the Iimplementation enum (documented elsewhere on this page) to mark functions as active. For example, to receive events for OnUserJoin(): Implements[I_OnUserJoin] = 1;
Reimplemented from Module. Definition at line 91 of file m_chghost.cpp. References I_OnRehash. 00092 { 00093 List[I_OnRehash] = 1; 00094 }
|
|
||||||||||||
|
Called on rehash. This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application. If a parameter is given, the core has done nothing. The module receiving the event can decide if this parameter has any relevence to it.
Reimplemented from Module. Definition at line 96 of file m_chghost.cpp. References Conf, hostmap, ConfigReader::ReadValue(), and Module::ServerInstance. Referenced by ModuleChgHost(). 00097 { 00098 ConfigReader Conf(ServerInstance); 00099 std::string hmap = Conf.ReadValue("hostname", "charmap", 0); 00100 00101 if (hmap.empty()) 00102 hmap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789"; 00103 00104 memset(&hostmap, 0, 255); 00105 for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++) 00106 hostmap[(unsigned char)*n] = 1; 00107 }
|
|
|
Definition at line 81 of file m_chghost.cpp. Referenced by ModuleChgHost(), and OnRehash(). |
|
|
Definition at line 80 of file m_chghost.cpp. Referenced by ModuleChgHost(). |