]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 2ccd843145b0db8807a777d9285bf2e5e60478b8..5a360fc210df0b7e6899858542d920e7c44ba801 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 03ab777b941c151ce93fe5cccc92e87cd1d9248e..5187ed5133aafba949f009b9c856753cb4f6db4a 100644 (file)
@@ -990,6 +990,25 @@ float PlayerInIDList(entity p, string idlist)
        return 0;
 }
 
+/*
+=============
+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