Page 1 of 1
"You are inactive" bug
Posted: 15 Feb 2013, 19:21
by Filipe1020
That is a really annoying bug, it's happening with me all the time out of nowhere, and when I click the Resume playing button, it brings me back to spectacting mode and it get stuck there and I need to wait for the round to finish, please fix this
Re: "You are inactive" bug
Posted: 15 Feb 2013, 19:43
by steeffeen
the AFK script of nadeo is indeed kind of buggy, but i think it's not the script but the IdleDuration of the player
i took a look at the value and it pretty much jumps from high to low and sometimes it's even increasing while running and looking around and stuff...
besides as far as i know 180000 milliseconds equals 3 minutes instead of 1 minute 30 seconds
Code: Select all
/**
* Library to manage Passive AFK players
*/
#Const Version "2013-02-06"
#Include "TextLib" as TextLib
#Include "MathLib" as MathLib
#Const Lib_AFK_IdleTimeLimit 180000 // after 1 minute and 30 sec. of inactivity, a player is considered AFK
#Const Lib_AFK_SpawnTimeLimit 40000 // A player cannot be considered AFK during 20 s. after spawning
Boolean IsAFK(CSmPlayer _Player) {
if(_Player.SpawnStatus != CSmPlayer::ESpawnStatus::Spawned) return False;
declare UI <=> UIManager.GetUI(_Player);
// not for bots
if(UI == Null) return False;
if((UI.UISequence != CUIConfig::EUISequence::Playing) && (UI.UISequence != CUIConfig::EUISequence::None)) return False;
if(UI.ForceSpectator) return False;
if((Now - _Player.StartTime) < Lib_AFK_SpawnTimeLimit) return False;
return (_Player.IdleDuration > Lib_AFK_IdleTimeLimit);
}
Void ManageAFKPlayers() {
foreach(Player in Players) {
declare Boolean PlayerIsAFK = IsAFK(Player);
if(PlayerIsAFK) {
declare UI <=> UIManager.GetUI(Player);
if(UI != Null) { // not for bots
// log(Now^"> "^Player.User.Name^" is afk.");
UIManager.UIAll.SendNotice(
TextLib::Compose(_("$<%1$> is inactive (switched to spectator)"), Player.User.Name),
CUIConfig::ENoticeLevel::PlayerInfo, Null, CUIConfig::EAvatarVariant::Default,
CUIConfig::EUISound::Silence, 0);
Users_RequestSwitchToSpectator(Player.User);
}
}
}
}
Re: "You are inactive" bug
Posted: 15 Feb 2013, 21:56
by TMarc
steeffeen wrote:besides as far as i know 180000 milliseconds equals 3 minutes instead of 1 minute 30 seconds
Code: Select all
#Const Lib_AFK_IdleTimeLimit 180000 // after 1 minute and 30 sec. of inactivity, a player is considered AFK
#Const Lib_AFK_SpawnTimeLimit 40000 // A player cannot be considered AFK during 20 s. after spawning
It's the typical "let's change values to test and forget to update the comments" bug
