extern std::vector<userrec*> local_users;
extern time_t TIME;
class Server;
-extern userrec* fd_ref_table[65536];
+extern userrec* fd_ref_table[MAX_DESCRIPTORS];
extern user_hash clientlist;
extern chan_hash chanlist;
int Module::OnCheckKey(userrec* user, chanrec* chan, std::string keygiven) { return 0; };
int Module::OnCheckLimit(userrec* user, chanrec* chan) { return 0; };
int Module::OnCheckBan(userrec* user, chanrec* chan) { return 0; };
-void Module::OnStats(char symbol) { };
+int Module::OnStats(char symbol, userrec* user) { return 0; };
int Module::OnChangeLocalUserHost(userrec* user, std::string newhost) { return 0; };
int Module::OnChangeLocalUserGECOS(userrec* user, std::string newhost) { return 0; };
int Module::OnLocalTopicChange(userrec* user, chanrec* chan, std::string topic) { return 0; };
void Module::OnDelELine(userrec* source, std::string hostmask) { };
void Module::OnCleanup(int target_type, void* item) { };
void Module::Implements(char* Implements) { for (int j = 0; j < 255; j++) Implements[j] = 0; };
+Priority Module::Prioritize() { return PRIORITY_DONTCARE; }
/* server is a wrapper class that provides methods to all of the C-style
* exports in the core
module_sockets.push_back(sock);
}
+void Server::RemoveSocket(InspSocket* sock)
+{
+ for (std::vector<InspSocket*>::iterator a = module_sockets.begin(); a < module_sockets.end(); a++)
+ {
+ InspSocket* s = (InspSocket*)*a;
+ if (s == sock)
+ {
+ log(DEBUG,"Forcibly removed socket");
+ ServerInstance->SE->DelFd(s->GetFd());
+ s->Close();
+ module_sockets.erase(a);
+ delete s;
+ return;
+ }
+ }
+}
+
void Server::RehashServer()
{
WriteOpers("*** Rehashing config file");
{
chanuserlist userl;
userl.clear();
- std::vector<char*> *list = chan->GetUsers();
- for (std::vector<char*>::iterator i = list->begin(); i != list->end(); i++)
+ std::map<char*,char*> *list = chan->GetUsers();
+ for (std::map<char*,char*>::iterator i = list->begin(); i != list->end(); i++)
{
- char* o = *i;
+ char* o = i->second;
userl.push_back((userrec*)o);
}
return userl;