#undef ERROR
#endif
+// Required system headers.
#include <time.h>
-#include <string>
-#include <sstream>
-#include <list>
+#include <stdarg.h>
+
#include "inspircd_config.h"
#include "uid.h"
#include "users.h"
-#include "usermanager.h"
#include "channels.h"
+#include "timer.h"
+#include "hashcomp.h"
+#include "typedefs.h"
+#include "logger.h"
+#include "usermanager.h"
#include "socket.h"
+#include "ctables.h"
+#include "command_parse.h"
#include "mode.h"
#include "socketengine.h"
-#include "command_parse.h"
#include "snomasks.h"
#include "cull_list.h"
#include "filelogger.h"
#include "caller.h"
+#include "modules.h"
+#include "configreader.h"
+#include "inspstring.h"
/**
* Used to define the maximum number of parameters a command may have.
/** Used when connecting clients
*/
- insp_sockaddr client, server;
+ irc::sockets::insp_sockaddr client, server;
/** Used when connecting clients
*/
socklen_t length;
- /** Nonblocking file writer
- */
- FileLogger* Logger;
-
/** Time offset in seconds
* This offset is added to all calls to Time(). Use SetTimeDelta() to update
*/
*/
void BuildISupport();
- /** Number of unregistered users online right now.
- * (Unregistered means before USER/NICK/dns)
- */
- int unregistered_count;
-
/** List of server names we've seen.
*/
servernamelist servernames;
/** Socket engine, handles socket activity events
*/
SocketEngine* SE;
+
+ /** LogManager handles logging.
+ */
+ LogManager *Logs;
/** ModuleManager contains everything related to loading/unloading
* modules.
*/
SnomaskManager* SNO;
- /** Client list, a hash_map containing all clients, local and remote
- */
- user_hash* clientlist;
-
- /** Client list stored by UUID. Contains all clients, and is updated
- * automatically by the constructor and destructor of User.
- */
- user_hash* uuidlist;
-
- /** Channel list, a hash_map containing all channels
- */
- chan_hash* chanlist;
-
- /** Local client list, a vector containing only local clients
- */
- std::vector<User*> local_users;
-
- /** Oper list, a vector containing all local and remote opered users
- */
- std::list<User*> all_opers;
-
/** DNS class, provides resolver facilities to the core and modules
*/
DNS* Res;
*/
UserManager *Users;
+ /** Channel list, a hash_map containing all channels XXX move to channel manager class
+ */
+ chan_hash* chanlist;
+
/** Set to the current signal recieved
*/
int s_signal;
* @return The old time delta
*/
int SetTimeDelta(int delta);
-
- /** Number of users with a certain mode set on them
- */
- int ModeCount(const char mode);
/** Get the time offset in seconds
* @return The current time delta (in seconds)
*/
bool OpenLog(char** argv, int argc);
- /** Close the currently open log file
- */
- void CloseLog();
-
- /** Send a server notice to all local users
- * @param text The text format string to send
- * @param ... The format arguments
- */
- void ServerNoticeAll(char* text, ...);
-
- /** Send a server message (PRIVMSG) to all local users
- * @param text The text format string to send
- * @param ... The format arguments
- */
- void ServerPrivmsgAll(char* text, ...);
-
- /** Send text to all users with a specific set of modes
- * @param modes The modes to check against, without a +, e.g. 'og'
- * @param flags one of WM_OR or WM_AND. If you specify WM_OR, any one of the
- * mode characters in the first parameter causes receipt of the message, and
- * if you specify WM_OR, all the modes must be present.
- * @param text The text format string to send
- * @param ... The format arguments
- */
- void WriteMode(const char* modes, int flags, const char* text, ...);
-
/** Return true if a channel name is valid
* @param chname A channel name to verify
* @return True if the name is valid
*/
caller1<User*, int> FindDescriptor;
- /** Add a new mode to this server's mode parser
- * @param mh The modehandler to add
- * @return True if the mode handler was added
- */
- bool AddMode(ModeHandler* mh);
-
- /** Add a new mode watcher to this server's mode parser
- * @param mw The modewatcher to add
- * @return True if the modewatcher was added
- */
- bool AddModeWatcher(ModeWatcher* mw);
-
- /** Delete a mode watcher from this server's mode parser
- * @param mw The modewatcher to delete
- * @return True if the modewatcher was deleted
- */
- bool DelModeWatcher(ModeWatcher* mw);
-
/** Add a dns Resolver class to this server's active set
* @param r The resolver to add
* @param cached If this value is true, then the cache will
* @param LinePrefix text to prefix each complete line with
* @param TextStream the text to send to the user
*/
- void DumpText(User* User, const std::string &LinePrefix, stringstream &TextStream);
+ void DumpText(User* User, const std::string &LinePrefix, std::stringstream &TextStream);
/** Check if the given nickmask matches too many users, send errors to the given user
* @param nick A nickmask to match against
*/
long Duration(const std::string &str);
- /** Attempt to compare an oper password to a string from the config file.
+ /** Attempt to compare a password to a string from the config file.
* This will be passed to handling modules which will compare the data
* against possible hashed equivalents in the input string.
+ * @param ex The object (user, server, whatever) causing the comparison.
* @param data The data from the config file
* @param input The data input by the oper
- * @param tagnum the tag number of the oper's tag in the config file
+ * @param hashtype The hash from the config file
* @return 0 if the strings match, 1 or -1 if they do not
*/
- int OperPassCompare(const char* data,const char* input, int tagnum);
+ int PassCompare(Extensible* ex, const char* data,const char* input, const char* hashtype);
/** Check if a given server is a uline.
* An empty string returns true, this is by design.