X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Futils.h;h=5559b3459b5defe2b1942a618f6077acacd7b7c9;hb=ccd4c11ea1a43d079eaae9708482ef4a9148796c;hp=ace33ad3ba4681d889f34a5fa627d51b2c9541e9;hpb=b858571125fa0822f42b49ed8829e4c6719565e6;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index ace33ad3b..5559b3459 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -36,14 +36,10 @@ class SpanningTreeUtilities; /* This hash_map holds the hash equivalent of the server * tree, used for rapid linear lookups. */ -#if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED) - typedef nspace::hash_map > > server_hash; +#ifdef HASHMAP_DEPRECATED + typedef nspace::hash_map server_hash; #else - #ifdef HASHCOMP_DEPRECATED - typedef nspace::hash_map server_hash; - #else - typedef nspace::hash_map, irc::StrHashComp> server_hash; - #endif + typedef nspace::hash_map, irc::StrHashComp> server_hash; #endif typedef std::map TreeServerList; @@ -54,6 +50,8 @@ typedef std::map TreeServerList; class SpanningTreeUtilities : public classbase { public: + typedef std::map > TimeoutList; + /** Creator module */ ModuleSpanningTree* Creator; @@ -92,12 +90,9 @@ class SpanningTreeUtilities : public classbase /** Hash of currently known server ids */ server_hash sidlist; - /** Hash of servers currently bursting but not initialized as connected - */ - std::map burstingserverlist; /** List of all outgoing sockets and their timeouts */ - std::map > timeoutlist; + TimeoutList timeoutlist; /** Holds the data from the tags in the conf */ std::vector > LinkBlocks; @@ -133,24 +128,16 @@ class SpanningTreeUtilities : public classbase /** Send a message from this server to one other local or remote */ - bool DoOneToOne(const std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string target); - - /** Send a message from this server to all but one other, local or remote - */ - bool DoOneToAllButSender(const std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string omit); + bool DoOneToOne(const std::string &prefix, const std::string &command, const parameterlist ¶ms, const std::string& target); /** Send a message from this server to all but one other, local or remote */ - bool DoOneToAllButSender(const char* prefix, const char* command, const parameterlist ¶ms, std::string omit); + bool DoOneToAllButSender(const std::string &prefix, const std::string &command, const parameterlist ¶ms, const std::string& omit); /** Send a message from this server to all others */ bool DoOneToMany(const std::string &prefix, const std::string &command, const parameterlist ¶ms); - /** Send a message from this server to all others - */ - bool DoOneToMany(const char* prefix, const char* command, const parameterlist ¶ms); - /** Read the spanningtree module's tags from the config file */ void ReadConfiguration(); @@ -186,6 +173,11 @@ class SpanningTreeUtilities : public classbase /** Refresh the IP cache used for allowing inbound connections */ void RefreshIPCache(); + + /** Recreate serverlist and sidlist, this is needed because of m_nationalchars changing + * national_case_insensitive_map which is used by the hash function + */ + void Rehash(); }; #endif