afk fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5175 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -294,6 +294,7 @@ struct client // server side version of "dynent" type
|
||||
name[0] = demoflags = 0;
|
||||
bottomRTT = ping = 9999;
|
||||
team = TEAM_SPECT;
|
||||
state.state = CS_SPECTATE;
|
||||
loopi(2) skin[i] = 0;
|
||||
position.setsize(0);
|
||||
messages.setsize(0);
|
||||
|
||||
@@ -460,9 +460,12 @@ void check_afk(){
|
||||
loopv(clients)
|
||||
{
|
||||
client &c = *clients[i];
|
||||
if ( c.type != ST_TCPIP ) continue;
|
||||
if ( ( c.state.state == CS_DEAD && !m_arena && c.state.lastdeath + 30 * 1000 < gamemillis ) ||
|
||||
( c.state.state == CS_ALIVE && c.upspawnp && c.inputmillis + 30 * 1000 < servmillis ) ) {
|
||||
if ( c.type != ST_TCPIP || c.connectmillis + 30 * 1000 > servmillis ||
|
||||
c.inputmillis + 30 * 1000 > servmillis ||
|
||||
c.state.lastdeath + 30 * 1000 > gamemillis ) continue;
|
||||
if ( ( c.state.state == CS_DEAD && !m_arena ) ||
|
||||
( c.state.state == CS_ALIVE && c.upspawnp ) ||
|
||||
( c.state.state == CS_SPECTATE && mastermode == MM_OPEN ) ) {
|
||||
logline(ACLOG_INFO, "[%s] %s %s", c.hostname, c.name, "is afk");
|
||||
defformatstring(msg)("%s is afk", c.name);
|
||||
sendservmsg(msg);
|
||||
|
||||
Reference in New Issue
Block a user