summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-25 13:03:03 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-25 13:03:03 +0000
commit382e95752145e6c8408ec8ff69176575c9258cd4 (patch)
tree93db3bb003798d282fd1be46112daba1e7e9b87b /src
parent6cd3c99ca10220ca1451307f3b8d03cf6e3c4b7e (diff)
Fixes for removal of serverrec
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1946 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp6
-rw-r--r--src/commands.cpp6
-rw-r--r--src/helperfuncs.cpp52
-rw-r--r--src/inspircd.cpp5
-rw-r--r--src/mode.cpp1
-rw-r--r--src/modules.cpp8
-rw-r--r--src/xline.cpp36
7 files changed, 13 insertions, 101 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index d448f77e2..6af23d3b0 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -85,15 +85,11 @@ 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;
diff --git a/src/commands.cpp b/src/commands.cpp
index 17401e0e9..a67829ffe 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -113,14 +113,12 @@ extern std::vector<std::string> module_names;
extern char MyExecutable[1024];
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;
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index d6df39dbb..9f457868c 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -36,7 +36,6 @@ using namespace std;
#include <stdarg.h>
#include "connection.h"
#include "users.h"
-#include "servers.h"
#include "ctables.h"
#include "globals.h"
#include "modules.h"
@@ -66,7 +65,7 @@ extern int LogLevel;
extern std::stringstream config_f;
-extern serverrec* me[32];
+
extern FILE *log_file;
extern userrec* fd_ref_table[65536];
@@ -378,19 +377,6 @@ void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...)
std::string GetServerDescription(char* servername)
{
- for (int j = 0; j < 32; j++)
- {
- if (me[j] != NULL)
- {
- for (unsigned int k = 0; k < me[j]->connectors.size(); k++)
- {
- if (!strcasecmp(me[j]->connectors[k].GetServerName().c_str(),servername))
- {
- return me[j]->connectors[k].GetDescription();
- }
- }
- }
- }
return ServerDesc; // not a remote server that can be found, it must be me.
}
@@ -1097,21 +1083,7 @@ long chancount(void)
long count_servs(void)
{
- int c = 0;
- for (int i = 0; i < 32; i++)
- {
- if (me[i] != NULL)
- {
- for (vector<ircd_connector>::iterator j = me[i]->connectors.begin(); j != me[i]->connectors.end(); j++)
- {
- if (strcasecmp(j->GetServerName().c_str(),ServerName))
- {
- c++;
- }
- }
- }
- }
- return c;
+ return 0;
}
long servercount(void)
@@ -1183,25 +1155,7 @@ bool AllModulesReportReady(userrec* user)
char islast(const char* s)
{
- char c = '`';
- for (int j = 0; j < 32; j++)
- {
- if (me[j] != NULL)
- {
- for (unsigned int k = 0; k < me[j]->connectors.size(); k++)
- {
- if (strcasecmp(me[j]->connectors[k].GetServerName().c_str(),s))
- {
- c = '|';
- }
- if (!strcasecmp(me[j]->connectors[k].GetServerName().c_str(),s))
- {
- c = '`';
- }
- }
- }
- }
- return c;
+ return '+';
}
long map_count(const char* s)
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 88b9e2042..17ad9d59d 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -140,7 +140,7 @@ userrec* fd_ref_table[65536];
int statsAccept = 0, statsRefused = 0, statsUnknown = 0, statsCollisions = 0, statsDns = 0, statsDnsGood = 0, statsDnsBad = 0, statsConnects = 0, statsSent= 0, statsRecv = 0;
-serverrec* me[32];
+
FILE *log_file;
@@ -160,7 +160,7 @@ struct linger linger = { 0 };
char MyExecutable[1024];
int boundPortCount = 0;
int portCount = 0, SERVERportCount = 0, ports[MAXSOCKS];
-int defaultRoute = 0;
+
char ModPath[MAXBUF];
/* prototypes */
@@ -172,7 +172,6 @@ char* Passwd(userrec *user);
bool IsDenied(userrec *user);
void AddWhoWas(userrec* u);
-std::vector<long> auth_cookies;
std::stringstream config_f(stringstream::in | stringstream::out);
std::vector<userrec*> all_opers;
diff --git a/src/mode.cpp b/src/mode.cpp
index 5d6d65094..32033e7f4 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -35,7 +35,6 @@ using namespace std;
#include <deque>
#include "connection.h"
#include "users.h"
-#include "servers.h"
#include "ctables.h"
#include "globals.h"
#include "modules.h"
diff --git a/src/modules.cpp b/src/modules.cpp
index 3436ebd4d..0c2f36f0d 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -105,14 +105,14 @@ 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;
diff --git a/src/xline.cpp b/src/xline.cpp
index 24c37324a..0f329602c 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -78,15 +78,11 @@ 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;
typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash;
@@ -310,36 +306,6 @@ bool zline_make_global(const char* ipaddr)
return false;
}
-void sync_xlines(serverrec* serv, char* tcp_host)
-{
- char data[MAXBUF];
-
- // for zlines and qlines, we should first check if theyre global...
- for (std::vector<ZLine>::iterator i = zlines.begin(); i != zlines.end(); i++)
- {
- if (i->is_global)
- {
- snprintf(data,MAXBUF,"%s } %s %s %lu %lu :%s",CreateSum().c_str(),i->ipaddr,i->source,(unsigned long)i->set_time,(unsigned long)i->duration,i->reason);
- serv->SendPacket(data,tcp_host);
- }
- }
- for (std::vector<QLine>::iterator i = qlines.begin(); i != qlines.end(); i++)
- {
- if (i->is_global)
- {
- snprintf(data,MAXBUF,"%s { %s %s %lu %lu :%s",CreateSum().c_str(),i->nick,i->source,(unsigned long)i->set_time,(unsigned long)i->duration,i->reason);
- serv->SendPacket(data,tcp_host);
- }
- }
- // glines are always global, so no need to check
- for (std::vector<GLine>::iterator i = glines.begin(); i != glines.end(); i++)
- {
- snprintf(data,MAXBUF,"%s # %s %s %lu %lu :%s",CreateSum().c_str(),i->hostmask,i->source,(unsigned long)i->set_time,(unsigned long)i->duration,i->reason);
- serv->SendPacket(data,tcp_host);
- }
-}
-
-
// deletes a z:line, returns true if the line existed and was removed
bool del_zline(const char* ipaddr)