Added global oper monitoring through modules and global connect monitoring through modules

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1177 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
brain 2005-04-23 23:33:13 +00:00
parent 69fea681a2
commit ddc514e66d
4 changed files with 28 additions and 3 deletions

View File

@ -627,6 +627,20 @@ class Module : public classbase
* to do nothing.
*/
virtual int OnOperCompare(std::string password, std::string input);
/** Called whenever a user is given usermode +o, anywhere on the network.
* You cannot override this and prevent it from happening as it is already happened and
* such a task must be performed by another server. You can however bounce modes by sending
* servermodes out to reverse mode changes.
*/
virtual void OnGlobalOper(userrec* user);
/** Called whenever a user connects, anywhere on the network.
* This event is informational only. You should not change any user information in this
* event. To do so, use the OnUserConnect method to change the state of local users.
*/
virtual void OnGlobalConnect(userrec* user);
};

View File

@ -2212,9 +2212,14 @@ void handle_N(char token,char* params,serverrec* source,serverrec* reply, char*
clientlist[nick]->idle_lastmsg = TIME; // this is unrealiable and wont actually be used locally
for (int i = 0; i < MAXCHANS; i++)
{
clientlist[nick]->chans[i].channel = NULL;
clientlist[nick]->chans[i].uc_modes = 0;
}
clientlist[nick]->chans[i].channel = NULL;
clientlist[nick]->chans[i].uc_modes = 0;
}
FOREACH_MOD OnGlobalConnect(clientlist[nick]);
if (strchr(clientlist[nick]->modes,'o'))
{
FOREACH_MOD OnGlobalOper(clientlist[nick]);
}
}
void handle_F(char token,char* params,serverrec* source,serverrec* reply, char* tcp_host)

View File

@ -1288,6 +1288,10 @@ void handle_mode(char **parameters, int pcnt, userrec *user)
dmodes[strlen(dmodes)] = parameters[1][i];
outpars[strlen(outpars)+1]='\0';
outpars[strlen(outpars)] = parameters[1][i];
if (parameters[1][i] == 'o')
{
FOREACH_MOD OnGlobalOper(dest);
}
}
}
}

View File

@ -406,6 +406,8 @@ int Module::OnMeshToken(char token,string_list params,serverrec* source,serverre
void Module::OnEvent(Event* event) { return; };
char* Module::OnRequest(Request* request) { return NULL; };
int Module::OnOperCompare(std::string password, std::string input) { return 0; };
void Module::OnGlobalOper(userrec* user) { };
void Module::OnGlobalConnect(userrec* user) { };
// server is a wrapper class that provides methods to all of the C-style
// exports in the core