]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
Add irc::portparser, a class to parse port ranges in the form "6660,6661,6662-6669...
[user/henk/code/inspircd.git] / include / inspircd.h
index 1a56978a2d5e21758fb46b57c834beaa146b31f9..ea3194ff27620c00fca1bdef0ececd3d8521f496 100644 (file)
@@ -339,6 +339,11 @@ class InspIRCd : public classbase
         */
        FileLogger* Logger;
 
+       /** Time offset in seconds
+        * This offset is added to all calls to Time(). Use SetTimeDelta() to update
+        */
+       int time_delta;
+
  public:
         /** List of server names we've seen.
         */
@@ -424,9 +429,18 @@ class InspIRCd : public classbase
        /** Get the current time
         * Because this only calls time() once every time around the mainloop,
         * it is much faster than calling time() directly.
+        * @param delta True to use the delta as an offset, false otherwise
         * @return The current time as an epoch value (time_t)
         */
-       time_t Time();
+       time_t Time(bool delta = false);
+
+       /** Set the time offset in seconds
+        * This offset is added to Time() to offset the system time by the specified
+        * number of seconds.
+        * @param delta The number of seconds to offset
+        * @return The old time delta
+        */
+       int SetTimeDelta(int delta);
 
        /** Process a user whos socket has been flagged as active
         * @param cu The user to process
@@ -448,9 +462,10 @@ class InspIRCd : public classbase
 
        /** Bind all ports specified in the configuration file.
         * @param bail True if the function should bail back to the shell on failure
+        * @param found_ports The actual number of ports found in the config, as opposed to the number actually bound
         * @return The number of ports actually bound without error
         */
-       int BindPorts(bool bail);
+       int BindPorts(bool bail, int &found_ports);
 
        /** Returns true if this server has the given port bound to the given address
         * @param port The port number