/* 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<std::string, TreeServer*, nspace::hash_compare<std::string, std::less<std::string> > > server_hash;
+#ifdef HASHMAP_DEPRECATED
+ typedef nspace::hash_map<std::string, TreeServer*, nspace::insensitive, irc::StrHashComp> server_hash;
#else
- #ifdef HASHCOMP_DEPRECATED
- typedef nspace::hash_map<std::string, TreeServer*, nspace::insensitive, irc::StrHashComp> server_hash;
- #else
- typedef nspace::hash_map<std::string, TreeServer*, nspace::hash<std::string>, irc::StrHashComp> server_hash;
- #endif
+ typedef nspace::hash_map<std::string, TreeServer*, nspace::hash<std::string>, irc::StrHashComp> server_hash;
#endif
typedef std::map<TreeServer*,TreeServer*> TreeServerList;
class SpanningTreeUtilities : public classbase
{
public:
+ typedef std::map<TreeSocket*, std::pair<std::string, int> > TimeoutList;
+
/** Creator module
*/
ModuleSpanningTree* Creator;
/** Hash of currently known server ids
*/
server_hash sidlist;
- /** Hash of servers currently bursting but not initialized as connected
- */
- std::map<irc::string,TreeSocket*> burstingserverlist;
/** List of all outgoing sockets and their timeouts
*/
- std::map<TreeSocket*, std::pair<std::string, int> > timeoutlist;
+ TimeoutList timeoutlist;
/** Holds the data from the <link> tags in the conf
*/
std::vector<reference<Link> > LinkBlocks;
/** 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);
+ 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 std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string omit);
-
- /** 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);
-
- /** Send a message from this server to all others, without doing any processing on the command (e.g. send it as-is with colons and all)
- */
- bool DoOneToAllButSenderRaw(const std::string &data, const std::string &omit, const std::string &prefix, const irc::string &command, const parameterlist ¶ms);
-
/** Read the spanningtree module's tags from the config file
*/
void ReadConfiguration();
*/
TreeServer* FindServerMask(const std::string &ServerName);
- /** Returns true if this is a server name we recognise
- */
- bool IsServer(const std::string &ServerName);
-
/** Find a link tag from a server name
*/
Link* FindLink(const std::string& name);
/** 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