From c70cd5cccc966a35f175913f2281ce251fd62425 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Mon, 17 Jun 2019 01:46:28 +0100 Subject: Implement a per-client identifier so auto replay can replay everything a given client has missed. --- structures.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'structures.h') 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 -- cgit v1.2.3