]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Moved some other stuff into ServerConfig
[user/henk/code/inspircd.git] / src / channels.cpp
index 6d6c15f13e85977de72e4bae2778aa701047603a..573289db918027d73f71482fdce0d3999b3c0862 100644 (file)
  * ---------------------------------------------------
  */
 
+using namespace std;
+
+#include "inspircd_config.h"
 #include "inspircd.h"
 #include "inspircd_io.h"
 #include "inspircd_util.h"
-#include "inspircd_config.h"
 #include <unistd.h>
-#include <fcntl.h>
 #include <sys/errno.h>
 #include <sys/ioctl.h>
 #include <sys/utsname.h>
-#include <cstdio>
 #include <time.h>
 #include <string>
 #ifdef GCC3
 #include <map>
 #include <sstream>
 #include <vector>
-#include <errno.h>
 #include <deque>
-#include <errno.h>
-#include <unistd.h>
-#include <sched.h>
-#include "connection.h"
 #include "users.h"
-#include "servers.h"
 #include "ctables.h"
 #include "globals.h"
 #include "modules.h"
@@ -51,6 +45,7 @@
 #include "mode.h"
 #include "xline.h"
 #include "inspstring.h"
+#include "helperfuncs.h"
 
 #ifdef GCC3
 #define nspace __gnu_cxx
 #define nspace std
 #endif
 
-using namespace std;
+extern ServerConfig* Config;
 
 extern int MODCOUNT;
 extern std::vector<Module*> modules;
 extern std::vector<ircd_module*> factory;
-
-extern int LogLevel;
-extern char ServerName[MAXBUF];
-extern char Network[MAXBUF];
-extern char ServerDesc[MAXBUF];
-extern char AdminName[MAXBUF];
-extern char AdminEmail[MAXBUF];
-extern char AdminNick[MAXBUF];
-extern char diepass[MAXBUF];
-extern char restartpass[MAXBUF];
-extern char motd[MAXBUF];
-extern char rules[MAXBUF];
-extern char list[MAXBUF];
-extern char PrefixQuit[MAXBUF];
-extern char DieValue[MAXBUF];
-
-extern int debugging;
 extern int WHOWAS_STALE;
 extern int WHOWAS_MAX;
-extern int DieDelay;
 extern time_t startup_time;
-extern int NetBufferSize;
-int MaxWhoResults;
-extern time_t nb_start;
-
-extern std::vector<int> fd_reap;
 extern std::vector<std::string> module_names;
-
 extern int boundPortCount;
-extern int portCount;
-extern int SERVERportCount;
-extern int ports[MAXSOCKS];
-extern int defaultRoute;
-
-extern std::vector<long> auth_cookies;
 extern std::stringstream config_f;
-
-extern serverrec* me[32];
-
-extern FILE *log_file;
-
 extern time_t TIME;
 
 using namespace std;
@@ -117,8 +77,8 @@ chanrec::chanrec()
        strcpy(topic,"");
        strcpy(setby,"");
        strcpy(key,"");
-       created = topicset = limit = users = 0;
-       topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
+       created = topicset = limit = 0;
+       binarymodes = 0;
        internal_userlist.clear();
 }
 
@@ -180,8 +140,7 @@ void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on)
 
 bool chanrec::IsCustomModeSet(char mode)
 {
-       log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes);
-       return (strchr(this->custom_modes,mode) != 0);
+       return (strchr(this->custom_modes,mode));
 }
 
 std::string chanrec::GetModeParameter(char mode)
@@ -199,22 +158,9 @@ std::string chanrec::GetModeParameter(char mode)
        return "";
 }
 
-void chanrec::IncUserCounter()
-{
-       this->users++;
-       log(DEBUG,"Incremented channel user count for %s to %lu",name,(unsigned long)users);
-}
-
-void chanrec::DecUserCounter()
-{
-       if (this->users > 0)
-               this->users--;
-       log(DEBUG,"Decremented channel user count for %s to %lu",name,(unsigned long)users);
-}
-
 long chanrec::GetUserCounter()
 {
-       return (this->users);
+       return (this->internal_userlist.size());
 }
 
 void chanrec::AddUser(char* castuser)