summaryrefslogtreecommitdiff
path: root/structures.h
diff options
context:
space:
mode:
Diffstat (limited to 'structures.h')
-rw-r--r--structures.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/structures.h b/structures.h
index d1ec4b0..b96b781 100644
--- a/structures.h
+++ b/structures.h
@@ -27,6 +27,8 @@
#define MAXREALNAMELEN 128 // Randomly picked (TODO - is there an actual maximum real name length?)
#define MAXPORTLEN 6 // Up to 65535, so 5 characters + 1 for null
#define MAXAUTOCHANLEN 1024 // Randomly picked maximum length of the auto channel list
+#define CLIENTCODELEN 17 // Max length of a client code + 1 for null
+#define MAXCLIENTCODES 64 // Max number of client codes to track
struct ircdstate {
char greeting001[MAXDATASIZE];
@@ -95,6 +97,13 @@ struct client {
int pendingwhowas; // Whether the client is waiting to hear back from a "WHOWAS" command
int pendingnames; // Count of RPL_NAMREPLYs the client is waiting on.
int pendingcap; // Whether the client is still negotiating IRCv3 CAPabilities. 0 = no, 1 = yes, -1 = just finished (so register them as if they had just sent USER).
+ char clientcode[CLIENTCODELEN]; // This client's client code
+};
+
+// Structure of client codes. Used to track the last time a client identifying as a given client connected to handle auto replay for a known client.
+struct clientcodes {
+ char code[CLIENTCODELEN]; // The client code string
+ int lastdisconnected; // When this client code last disconnected
};
// Structure of a channel - this struct is expected to be in an array of channel structs