From b12617d293455e80d330d54e7d59bca57afdb0a0 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 29 May 2004 14:46:18 +0000 Subject: Fixed uline synching git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@833 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands.cpp | 17 +++++++++++++++++ src/inspircd.cpp | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/commands.cpp b/src/commands.cpp index ff9a5e41c..7d8523ece 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -1911,6 +1911,23 @@ void handle_H(char token,char* params,serverrec* source,serverrec* reply, char* ircd_connector s; s.SetState(STATE_DISCONNECTED); s.SetServerName(params); + + for (int j = 0; j < 32; j++) + { + if (me[j] != NULL) + { + for (int k = 0; k < me[j]->connectors.size(); k++) + { + if (!strcasecmp(me[j]->connectors[k].GetServerName().c_str(),params)) + { + // dont allow a server to be added twice + log(DEBUG,"ULined server %s already in the map!",params); + return; + } + } + } + } + source->connectors.push_back(s); WriteOpers("Non-Mesh server %s has joined the network",params); } diff --git a/src/inspircd.cpp b/src/inspircd.cpp index a71cf08ab..8b8e3a9d0 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -3010,6 +3010,22 @@ void DoSync(serverrec* serv, char* tcp_host) } // sync global zlines, glines, etc sync_xlines(serv,tcp_host); + + for (int j = 0; j < 32; j++) + { + if (me[j] != NULL) + { + for (int k = 0; k < me[j]->connectors.size(); k++) + { + if (is_uline(me[j]->connectors[k].GetServerName().c_str())) + { + sprintf(data,"H %s",me[j]->connectors[k].GetServerName().c_str()); + serv->SendPacket(data,tcp_host); + } + } + } + } + snprintf(data,MAXBUF,"F %d",time(NULL)); serv->SendPacket(data,tcp_host); log(DEBUG,"Sent sync"); -- cgit v1.2.3