From: Mattia Basaglia Date: Sat, 31 Jan 2015 21:52:41 +0000 (+0100) Subject: Event log on ClientPreConnect X-Git-Tag: xonotic-v0.8.1~137^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ffa589edc6a990862bbc44b827583643d8effc79;p=xonotic%2Fxonotic-data.pk3dir.git Event log on ClientPreConnect --- diff --git a/qcsrc/dpdefs/progsdefs.qc b/qcsrc/dpdefs/progsdefs.qc index 2ccd84314..5a360fc21 100644 --- a/qcsrc/dpdefs/progsdefs.qc +++ b/qcsrc/dpdefs/progsdefs.qc @@ -73,6 +73,7 @@ void() PlayerPreThink; void() PlayerPostThink; void() ClientKill; +void() ClientPreConnect; void() ClientConnect; void() PutClientInServer; // call after setting the parm1... parms void() ClientDisconnect; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 03ab777b9..5187ed513 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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