git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5175 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-06-10 23:08:02 +00:00
parent f2907ae01c
commit 0c1c265a14
2 changed files with 7 additions and 3 deletions
+1
View File
@@ -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);
+6 -3
View File
@@ -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);