summaryrefslogtreecommitdiff
path: root/structures.h
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-06-17 01:46:28 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-06-17 01:46:28 +0100
commitc70cd5cccc966a35f175913f2281ce251fd62425 (patch)
treecd95e1bbb28ad4df94db87b9e3080cb05d00645b /structures.h
parentfa37193c83f82784e826b8477ee7d4a4cd96d7cf (diff)
Implement a per-client identifier so auto replay can replay everything a given client has missed.
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