Event log on ClientPreConnect
authorMattia Basaglia <mattia.basaglia@gmail.com>
Sat, 31 Jan 2015 21:52:41 +0000 (22:52 +0100)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Sat, 31 Jan 2015 21:52:41 +0000 (22:52 +0100)
qcsrc/dpdefs/progsdefs.qc
qcsrc/server/cl_client.qc

index 2ccd843..5a360fc 100644 (file)
@@ -73,6 +73,7 @@ void()                PlayerPreThink;
 void()                 PlayerPostThink;
 
 void()         ClientKill;
+void()         ClientPreConnect;
 void()         ClientConnect;
 void()                 PutClientInServer;              // call after setting the parm1... parms
 void()         ClientDisconnect;
index 03ab777..5187ed5 100644 (file)
@@ -992,6 +992,25 @@ float PlayerInIDList(entity p, string idlist)
 
 /*
 =============
+ClientPreConnect
+
+Called once (not at each match start) when a client begins a connection to the server
+=============
+*/
+void ClientPreConnect (void)
+{
+       if(autocvar_sv_eventlog)
+       {
+               GameLogEcho(sprintf(":connect:%d:%d:%s",
+                       self.playerid,
+                       num_for_edict(self),
+                       ((IS_REAL_CLIENT(self)) ? self.netaddress : "bot")
+               ));
+       }
+}
+
+/*
+=============
 ClientConnect
 
 Called when a client connects to the server