void IncreaseAFKIndicator(long playerid, AwarenessContext playercontext) { Logger.Info(this, $"AFK signs for player '{playerid}'"); if (++playercontext.AFKIndications >= 5) { context.GetModule <AdventureModule>().Rest(playerid); } }
void OnPlayerActiveChanged(long playerid, bool isactive) { if (isactive) { afkdetection[playerid] = new AwarenessContext { AFKIndications = 0, LastTrigger = DateTime.Now, Level = context.GetModule <SkillModule>().GetSkillLevel(playerid, SkillType.Awareness) } } ; else { afkdetection.Remove(playerid); } }