summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-12 18:13:01 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-12 18:13:01 +0000
commitec1df83c875bb783ca660a1fec700983fe1d9266 (patch)
tree99584d92f4a6053623fd4ab79490d9707cbaf495
parent579e707f017ca237d260165992f0b72bafba152c (diff)
CoreExport changes, clean up DoHostCycle when users are exempted
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11856 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/extensible.h8
-rw-r--r--include/fakeuser.h2
-rw-r--r--include/inspstring.h2
-rw-r--r--src/users.cpp17
4 files changed, 19 insertions, 10 deletions
diff --git a/include/extensible.h b/include/extensible.h
index c491f99b9..3e6bd4c99 100644
--- a/include/extensible.h
+++ b/include/extensible.h
@@ -90,7 +90,7 @@ class CoreExport Extensible : public classbase
};
/** Base class for items that are NOT synchronized between servers */
-class LocalExtItem : public ExtensionItem
+class CoreExport LocalExtItem : public ExtensionItem
{
public:
LocalExtItem(const std::string& key, Module* owner);
@@ -153,7 +153,7 @@ class SimpleExtItem : public LocalExtItem
}
};
-class LocalStringExt : public SimpleExtItem<std::string>
+class CoreExport LocalStringExt : public SimpleExtItem<std::string>
{
public:
LocalStringExt(const std::string& key, Module* owner);
@@ -161,7 +161,7 @@ class LocalStringExt : public SimpleExtItem<std::string>
std::string serialize(SerializeFormat format, const Extensible* container, void* item);
};
-class LocalIntExt : public LocalExtItem
+class CoreExport LocalIntExt : public LocalExtItem
{
public:
LocalIntExt(const std::string& key, Module* owner);
@@ -172,7 +172,7 @@ class LocalIntExt : public LocalExtItem
void free(void* item);
};
-class StringExtItem : public ExtensionItem
+class CoreExport StringExtItem : public ExtensionItem
{
public:
StringExtItem(const std::string& key, Module* owner);
diff --git a/include/fakeuser.h b/include/fakeuser.h
index e21ecf9b8..a46971091 100644
--- a/include/fakeuser.h
+++ b/include/fakeuser.h
@@ -16,7 +16,7 @@
#include "users.h"
-class FakeUser : public User
+class CoreExport FakeUser : public User
{
public:
FakeUser(const std::string &uid) : User(uid)
diff --git a/include/inspstring.h b/include/inspstring.h
index abf8d9cf3..b08ce7647 100644
--- a/include/inspstring.h
+++ b/include/inspstring.h
@@ -40,7 +40,7 @@ CoreExport int charlcat(char* x,char y,int z);
CoreExport bool charremove(char* mp, char remove);
/** Binary to hexadecimal conversion */
-std::string BinToHex(const std::string& data);
+CoreExport std::string BinToHex(const std::string& data);
#endif
diff --git a/src/users.cpp b/src/users.cpp
index 1cf21a029..370387df6 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -1401,7 +1401,8 @@ void User::DoHostCycle(const std::string &quitline)
if (!ServerInstance->Config->CycleHosts)
return;
- uniq_id++;
+ int silent_id = ++uniq_id;
+ int seen_id = ++uniq_id;
if (!already_sent)
InitializeAlreadySent(ServerInstance->SE);
@@ -1416,9 +1417,15 @@ void User::DoHostCycle(const std::string &quitline)
User* u = i->first;
if (IS_LOCAL(u) && !u->quitting)
{
- already_sent[u->fd] = uniq_id;
if (i->second)
+ {
+ already_sent[u->fd] = seen_id;
u->Write(quitline);
+ }
+ else
+ {
+ already_sent[u->fd] = silent_id;
+ }
}
}
for (UCListIter v = include_c.begin(); v != include_c.end(); ++v)
@@ -1439,11 +1446,13 @@ void User::DoHostCycle(const std::string &quitline)
User* u = i->first;
if (u == this || !IS_LOCAL(u))
continue;
+ if (already_sent[u->fd] == silent_id)
+ continue;
- if (already_sent[i->first->fd] != uniq_id)
+ if (already_sent[u->fd] != seen_id)
{
u->Write(quitline);
- already_sent[i->first->fd] = uniq_id;
+ already_sent[i->first->fd] = seen_id;
}
u->Write(joinline);
if (modeline.length() > 0)