X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Finspircd.h;h=9f7d07f5d1bec200d3b0c9410291d90960302371;hb=106043620278abc0755377544cfe012c84de4abc;hp=72e49c09ac493d3507e22374ed626ca8c729796a;hpb=e2af2347fc035d702e45f12e772223a8d578410d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/inspircd.h b/include/inspircd.h index 72e49c09a..9f7d07f5d 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -57,27 +57,13 @@ /** A list of failed port bindings, used for informational purposes on startup */ typedef std::vector > FailedPortList; -/** A cached text file stored with its contents as lines - */ -typedef std::deque< std::string > file_cache; - -/** A configuration key and value pair - */ -typedef std::pair< std::string, std::string > KeyVal; - -/** A list of related configuration keys and values - */ -typedef std::vector< KeyVal > KeyValList; - -/** An entire config file, built up of KeyValLists - */ -typedef std::multimap< std::string, KeyValList > ConfigDataHash; - class InspIRCd; -extern InspIRCd* ServerInstance; +CoreExport extern InspIRCd* ServerInstance; #include "inspircd_config.h" #include "inspircd_version.h" +#include "caller.h" +#include "cull_list.h" #include "extensible.h" #include "numerics.h" #include "uid.h" @@ -94,7 +80,6 @@ extern InspIRCd* ServerInstance; #include "mode.h" #include "socketengine.h" #include "snomasks.h" -#include "cull_list.h" #include "filelogger.h" #include "caller.h" #include "modules.h" @@ -223,7 +208,7 @@ template inline char* itoa(const T &in, V *r * It is used by the InspIRCd class, which internally * has an instance of it. */ -class serverstats : public classbase +class serverstats { public: /** Number of accepted connections @@ -293,13 +278,12 @@ class BanCacheManager; */ class CoreExport ConfigReaderThread : public Thread { - InspIRCd* ServerInstance; ServerConfig* Config; bool done; public: std::string TheUserUID; - ConfigReaderThread(InspIRCd* Instance, const std::string &useruid) - : Thread(), ServerInstance(Instance), done(false), TheUserUID(useruid) + ConfigReaderThread(const std::string &useruid) + : Thread(), done(false), TheUserUID(useruid) { } @@ -314,14 +298,12 @@ class CoreExport ConfigReaderThread : public Thread }; /** The main class of the irc server. - * This class contains instances of all the other classes - * in this software, with the exception of the base class, - * classbase. Amongst other things, it contains a ModeParser, - * a DNS object, a CommandParser object, and a list of active - * Module objects, and facilities for Module objects to - * interact with the core system it implements. + * This class contains instances of all the other classes in this software. + * Amongst other things, it contains a ModeParser, a DNS object, a CommandParser + * object, and a list of active Module objects, and facilities for Module + * objects to interact with the core system it implements. */ -class CoreExport InspIRCd : public classbase +class CoreExport InspIRCd { private: /** Holds the current UID. Used to generate the next one. @@ -382,6 +364,8 @@ class CoreExport InspIRCd : public classbase /** Global cull list, will be processed on next iteration */ CullList GlobalCulls; + /** Actions that must happen outside of the current call stack */ + ActionList AtomicActions; /**** Functors ****/ @@ -422,17 +406,15 @@ class CoreExport InspIRCd : public classbase */ void BuildISupport(); - /** List of server names we've seen. - */ - servernamelist servernames; - /** Time this ircd was booted */ time_t startup_time; /** Config file pathname specified on the commandline or via ./configure */ - char ConfigFileName[MAXBUF]; + std::string ConfigFileName; + + ExtensionManager Extensions; /** Mode handler, handles mode setting and removal */ @@ -513,6 +495,14 @@ class CoreExport InspIRCd : public classbase */ ProtocolInterface* PI; + /** Holds extensible for user nickforced + */ + LocalIntExt NICKForced; + + /** Holds extensible for user operquit + */ + LocalStringExt OperQuit; + /** Get the current time * Because this only calls time() once every time around the mainloop, * it is much faster than calling time() directly. @@ -533,24 +523,6 @@ class CoreExport InspIRCd : public classbase */ bool BindSocket(int sockfd, int port, const char* addr, bool dolisten = true); - /** Adds a server name to the list of servers we've seen - * @param The servername to add - */ - void AddServerName(const std::string &servername); - - /** Finds a cached char* pointer of a server name, - * This is used to optimize User by storing only the pointer to the name - * @param The servername to find - * @return A pointer to this name, gauranteed to never become invalid - */ - const char* FindServerNamePtr(const std::string &servername); - - /** Returns true if we've seen the given server name before - * @param The servername to find - * @return True if we've seen this server name before - */ - bool FindServerName(const std::string &servername); - /** Gets the GECOS (description) field of the given server. * If the servername is not that of the local server, the name * is passed to handling modules which will attempt to determine @@ -558,7 +530,7 @@ class CoreExport InspIRCd : public classbase * @param servername The servername to find the description of * @return The description of this server, or of the local server */ - std::string GetServerDescription(const char* servername); + std::string GetServerDescription(const std::string& servername); /** Find a user in the nick hash. * If the user cant be found in the nick hash check the uuid hash @@ -742,12 +714,6 @@ class CoreExport InspIRCd : public classbase */ void RehashServer(); - /** Return the channel whos index number matches that provided - * @param The index number of the channel to fetch - * @return A channel record, or NUll if index < 0 or index >= InspIRCd::ChannelCount() - */ - Channel* GetChannelIndex(long index); - /** Dump text to a user target, splitting it appropriately to fit * @param User the user to dump the text to * @param LinePrefix text to prefix each complete line with @@ -811,12 +777,12 @@ class CoreExport InspIRCd : public classbase * @param server The server to check for uline status * @return True if the server is a uline OR the string is empty */ - bool ULine(const char* server); + bool ULine(const std::string& server); /** Returns true if the uline is 'silent' (doesnt generate * remote connect notices etc). */ - bool SilentULine(const char* server); + bool SilentULine(const std::string& server); /** Returns the subversion revision ID of this ircd * @return The revision ID or an empty string @@ -927,14 +893,14 @@ class CommandModule : public Module { Cmd cmd; public: - CommandModule(InspIRCd*) : cmd(this) + CommandModule() : cmd(this) { ServerInstance->AddCommand(&cmd); } Version GetVersion() { - return Version(cmd.command, VF_VENDOR); + return Version(cmd.command, VF_VENDOR|VF_CORE); } };