diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-24 04:20:55 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-24 04:20:55 +0000 |
commit | 02d7ceb47709c2ea9cc3734b5b2549c3f8990525 (patch) | |
tree | 7608fbd70e25972bbbc8f270b0a6ecdc66ce9bc8 /src | |
parent | 88a4177e285d65affeb2c2b97e308449a2c0cd4c (diff) |
Added stuff for /map improvements
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1486 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/commands.cpp | 3 | ||||
-rw-r--r-- | src/servers.cpp | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/commands.cpp b/src/commands.cpp index 612444cb0..929a84f38 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -1662,7 +1662,8 @@ void handle_map(char **parameters, int pcnt, userrec *user) { for (int k = 0; k < me[j]->connectors.size(); k++) { - snprintf(line,MAXBUF,"006 %s :%c%c%s",user->nick,islast(me[j]->connectors[k].GetServerName().c_str()),me[j]->connectors[k].GetState() == STATE_CONNECTED ? '-' : '*',me[j]->connectors[k].GetServerName().c_str()); + int state = me[j]->connectors[k].GetState(); + snprintf(line,MAXBUF,"006 %s :%c%s%s",user->nick,islast(me[j]->connectors[k].GetServerName().c_str()),state == STATE_NOAUTH_INBOUND || state == STATE_NOAUTH_OUTBOUND ? "-*" : "--", me[j]->connectors[k].GetServerName().c_str()); while (strlen(line) < 50) strcat(line," "); WriteServ(user->fd,"%s%d (%.2f%%)",line,map_count(me[j]->connectors[k].GetServerName().c_str()),(float)(((float)map_count(me[j]->connectors[k].GetServerName().c_str())/(float)registered_usercount())*100)); diff --git a/src/servers.cpp b/src/servers.cpp index 7ae90e41b..0e47ecfba 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -253,13 +253,19 @@ void serverrec::FlushWriteBuffers() for (int i = 0; i < this->connectors.size(); i++) { // don't try and ping a NOAUTH_OUTBOUND state, its not authed yet! - if (this->connectors[i].GetState() != STATE_NOAUTH_OUTBOUND) + if ((this->connectors[i].GetState() == STATE_NOAUTH_OUTBOUND) && (TIME > this->connectors[i].age+30)) { // however if we reach this timer its connected timed out :) WriteOpers("*** Connection to %s timed out",this->connectors[i].GetServerName().c_str()); DoSplit(this->connectors[i].GetServerName().c_str()); return; } + else if ((this->connectors[i].GetState() == STATE_NOAUTH_INBOUND) && (TIME > this->connectors[i].age+30)) + { + WriteOpers("*** Connection from %s timed out",this->connectors[i].GetServerName().c_str()); + DoSplit(this->connectors[i].GetServerName().c_str()); + return; + } else if (this->connectors[i].GetState() != STATE_DISCONNECTED) { if (!this->connectors[i].CheckPing()) |