ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.68k stars 623 forks source link

[CS 1.6/CZ][Feature Request] Add cvar to control idle time before player gets kick. #767

Open MasteRs-git opened 11 years ago

MasteRs-git commented 11 years ago

Add cvar to control idle time before player gets kick. Idle detection mechanism also need to be tweaked for better detection. As I know there is only mp_autokick cvar.

hAnnahf commented 11 years ago

It's already existing, I think. Check _svtimeout (server side) and _cltimeout (client side).

MasteRs-git commented 11 years ago

Well, sv_timeout also controls other functions plus this cvar is on both sides. I think separate server side cvar will be the best variant.

alfred-valve commented 11 years ago

mp_autokick_timeout cvar will be added to next beta update, when set it will let you control the timeout (in seconds) for idle.

MasteRs-git commented 11 years ago

When mp_autokick_timeout cvar will be available?

hAnnahf commented 11 years ago

As soon as next beta update come out. ;)

MasteRs-git commented 11 years ago

Already are out.

MasteRs-git commented 11 years ago

New beta update released, still not included.

alfred-valve commented 11 years ago

It is in the last beta update, and the one from today. If you are using steamcmd to update make sure you have the right command line to get the beta release.

MasteRs-git commented 11 years ago

BUILD 6004, mp_autokick_timeout cvar not available.

alfred-valve commented 11 years ago

] version Protocol version 48 Exe version 1.1.2.7/Stdio (cstrike) Exe build: 17:27:00 Apr 4 2013 (6006) ] mp_autokick_timeout "mp_autokick_timeout" is "-1"

MasteRs-git commented 11 years ago

When this update are going to be included in dedicated server? I am seeing 6004 as latest BUILD. Only client got update.

ghost commented 11 years ago

@alfred-valve there's definitely something wrong

] version 
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 17:27:00 Apr  4 2013 (6006)
] mp_autokick_timeout
] mp_autokick_timeout
] mp_autokick_timeout 1
] mp_autokick_timeout

the latest available hlds

] version
Protocol version 48
Exe version 1.1.2.7 (cstrike)
Exe build: 10:15:23 Apr  3 2013 (6004)
] mp_autokick
"mp_autokick" is "1"
] mp_autokick_timeout
] mp_autokick_timeout
ghost commented 11 years ago

Huh... I can't access mp_autokicktimeout in HLDS because of old version and I can't access most of mp* cvars in client until I create a listen server: image image

alfred-valve commented 11 years ago

@MaxKorz , this is by design, the games server.dll isn't loaded until you create a server. I'll dig into the hlds not getting the beta cs bits.

alfred-valve commented 11 years ago

@MasteRs-git , I see the issue, it looks like the steamcmd tool isn't correctly opting into the beta feed for Counter-Strike, we will work on a fix for the tool.

MasteRs-git commented 11 years ago

@alfred-valve Hmm, seems that idle kicking isn't working. I have set mp_autokick_timeout to 30, but even after 2 mins in idle I am still in server. BUILD 6027 (client and server). Server - running Centos 6.3. Client - running Windows Server 2012.

MasteRs-git commented 11 years ago

Really? Nobody are going to take a look?

MasteRs-git commented 11 years ago

BUMP. Feature is still not working how it's supposed to.

kNowo commented 10 years ago

This is buggy. When the afk player dies, his pdata 124 (m_flLastActivityTime) is updated because his last button is set to IN_SCORE at that time. So the the players wont be kicked unless if he didn't get killed during his afk time. So the solution is not to set IN_SCORE button at when a player dies.

@alfred-valve Please look into this.

ConnorMcLeod commented 10 years ago

It is not m_afButtonLast, m_afButtonLast is only updated with pev->button value in CBasePlayer::PostThink.

Seems that during dying process, pev->button contains IN_SCORE even if player is not holding it in pfnCmdStart, cmd.buttons also contains IN_SCORE so the problem doesn't seems to come from dll. You should investigate in the engine or in client.

Or rather that searching the cause, you could do something as it is done is PlayerPreThink [edit : sorry, i meant PlayerDeathThink], not considering IN_SCORE since it is only used on client, so, prethink looks to something like that :

void CBasePlayer::PreThink(void) { int buttonsChanged = (m_afButtonLast ^ pev->button); // These buttons have changed this frame if ( buttonsChanged ) { m_fLastMovement = gpGlobals->time; }

You could do something like that :

void CBasePlayer::PreThink(void) { int buttonsChanged = (m_afButtonLast ^ pev->button) & ~IN_SCORE; // These buttons have changed this frame if ( buttonsChanged ) { m_fLastMovement = gpGlobals->time; }

jaycs1723658 commented 4 years ago

@alfred-valve hello, players wont be kicked if he get killed during his afk time. please fix. thx