]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules.cpp
Tweaks to closed socket detection
[user/henk/code/inspircd.git] / src / modules.cpp
index fa1c9e7bdfbd4effe74713e1768a7b2cd2afba78..9b6a0d826a5afdc3d10c8adb6035c2ffce3dfa42 100644 (file)
@@ -391,6 +391,34 @@ void Server::DelSocket(InspSocket* sock)
        }
 }
 
+long Server::GetChannelCount()
+{
+       return (long)chanlist.size();
+}
+
+/* This is ugly, yes, but hash_map's arent designed to be
+ * addressed in this manner, and this is a bit of a kludge.
+ * Luckily its a specialist function and rarely used by
+ * many modules (in fact, it was specially created to make
+ * m_safelist possible, initially).
+ */
+
+chanrec* Server::GetChannelIndex(long index)
+{
+       int target = 0;
+       for (chan_hash::iterator n = chanlist.begin(); n != chanlist.end(); n++, target++)
+       {
+               if (index == target)
+                       return n->second;
+       }
+       return NULL;
+}
+
+void Server::AddTimer(InspTimer* T)
+{
+       ::AddTimer(T);
+}
+
 void Server::SendOpers(std::string s)
 {
        WriteOpers("%s",s.c_str());