#Troubleshooting AFKManager Plugin

1 messages · Page 1 of 1 (latest)

solid scroll
#

Troubleshooting AFKManager Plugin

latent furnace
solid scroll
#

Thanks. I'll try it out

solid scroll
# latent furnace Seems like the condition for that to happen was wrong written. Fixed https://git...

okay so now it puts players into spectate but there is a new issue that was not happening before and i don't know why. If someone is idle with this plugin it puts them into spectate and then they get respawned based on the value set in forcesurvival and server.cfg. it will start a countdown and it will only give so many retries before the map starts. forcesurvival 2 is supposed to prevent restarts. but now with your plugin its causing map restarts and enabling the retry system.

latent furnace
#

Of course as players are dead after all

#

You'd have to modify the other plugin to detect afk players, you can read the custom keyvalue on the players

#

$s_afkmanager_afk == 1 means player is AFK

solid scroll
#

but its not supposed to do that. and it wasnt before. force survival 2 is no restart mode. it is supposed to just respawn players based on server.cfg respawn timer value

latent furnace
#

Thats what i mean, if you are afk you are prevented from reapawning

#

If there is no alive players the reatart is inminent

solid scroll
#

how do you prevent a restart?

latent furnace
#

You need at least one alive player to prevent a level from reatarting, hardcoded

solid scroll
#

so its impossible to idle in a survival server without it restarting over and over?

#

that makes it difficult to see or join the server if its constantly restarting

latent furnace
#

@lost orbit sorry to bother you, can you look at it for a moment and tell me if doing a fancy hack could work? I.e how the CSurvival checjs before restarting in 10 seconds

latent furnace
#

Also the most important thing is that as it is alive, the map will never restart, if someone is stuck in observer he wont be able to play

solid scroll
#

This is what I am trying to do: Let a player join my server, if they are idle for 3 minutes they go into spectate mode. If they are in spectate mode they do not respawn unless they push e. If no players are alive, nothing happens. They stay in spectate mode and new players can spawn in as if the idle player is not a player.

#

As is, it will constantly restart, with the one by MrOats, it forced player to die and respawn every 3 minutes

latent furnace
#

Then the afk player should be respawned if there are no players alive, i could do that

#

Add this somewhere in line 193```as
int Alives = 0;

for( int i = 0; i <= g_Engine.maxClients; i++ )
{
if( g_PlayerFuncs.FindPlayerByIndex( i ) !is null )
Alives++;
}

if( Alives == 0 )
Leave( pPlayer );

#

This is a stupid hack but i dont think i'd be adding it so its up to you, it iterates over all players each time a player thinks, see if there are not any fps difference in your end

lost orbit
latent furnace
#

Yes i meant how the check is done, technically setting dead flag to dead_no would return IsAlive() as false?

solid scroll
# lost orbit There isn't much that can be done, survival mode is set to restart the map if al...

The main issue I think is that I am trying ultimately to spectate survival mode as admin. And I idle in my server in order to attract players to play with. Unless you have a large rotating cast of players in a survival server, it basically breaks completely because 1 player does not want to play survival mode alone generally and if they idle to wait for more they are either kicked, respawned over and over or the entire server restarts, which makes it harder for new players to join. And if you have afk manager set to 3 minutes that means the server will restart about every 9 minutes.

lost orbit
#

Probably wouldn't work either because IsAlive() checks if a) pev->deadflag is DEAD_NO, b) pev->health > 0, and c) IsConnected() returns true.

solid scroll
#

maybe the solution in my case would be to omit admins from being labelled as a player and make the game think that the server is just empty?

#

Its stuff like this which made me give up on trying to have a survival server. Getting everything perfect so that rtv, antirush, afkmanager, spectate mode, etc all work together seems impossible. Someone can go afk in a survival server with afkmanager and basically force the server to reboot over and over, as if it is being DDOS'd. Which as far as I know takes the server off the list and increases the downtime so players cant join. Not an issue if you have an active playerbase but with the playerbase in sven being this small its kind of a death sentence.

latent furnace
#

then what i suggested about the invisible bot would be the best choice, i'm not familiar with the bot's API, think if you manage to modify RCBOT it would be just add flags FL_FROZEN and FL_NODRAW then just solid to SOLID_NOT, and finally make AFKManager to not do stuff on the bot

#

maybe add takedamage DAMAGE_NO as well, as for how to do that in AFKManager just return if the client ID is "BOT"

lost orbit
#

It's effectively a case of "It wasn't meant to do this in the first place" there, observer mode wasn't intended to be used as a spectator mode which is why this sort of thing happens.

solid scroll
#

Yeah its assuming that there is always at least one active player

latent furnace
#

didn't think on updating the other plugin

#
g_EntityFuncs.DispatchKeyValue( pPlayer.edict(), "$s_afkmanager_afk", "0" );```
solid scroll
#

server.cfg is set to respawn players every 3 seconds. afkmanager is set to put players into spectate every 3 minutes.

latent furnace
#

update it to 0 on your other plugins before respawning the players

solid scroll
#

you mean put it to 0 on server.cfg?

latent furnace
#

no

solid scroll
#

force survival is set to respawn players in waves or if no one is alive.

latent furnace
#

it is stored on each player's custom key values, you have to update them before calling any respawn method

latent furnace
#

on the web

solid scroll
latent furnace
#

can't see on android

solid scroll
#

text file

latent furnace
# latent furnace ```as g_EntityFuncs.DispatchKeyValue( pPlayer.edict(), "$s_afkmanager_afk", "0" ...

add this

g_EntityFuncs.DispatchKeyValue( p.edict(), "$s_afkmanager_time", "0" );
g_EntityFuncs.DispatchKeyValue( p.edict(), "$s_afkmanager_afk", "0" );```
[here](
https://github.com/wootguy/ForceSurvival/blob/master/ForceSurvival.as#L409C2-L409C4)
GitHub

Sven Co-op plugin. Contribute to wootguy/ForceSurvival development by creating an account on GitHub.

latent furnace
#

edited

#

line 409, the link will show you where it is

solid scroll
solid scroll
#

@lost orbitis this something that could be added in the next update to sven? an actual spectate mode?

#

@latent furnaceokay so, when you first join it doesnt work. But when the map restarts once, you start in spectate mode. But then the map just restarts.

#

So now its restarting every 5 seconds

#

into a match

latent furnace
#

didn't checked the whole code, just searched for "respawn" in there.

solid scroll
#

im using forcesurvival to solve this issue with it restarting. It lets me put on ForceSurvival 2 which is no restart mode.

latent furnace
#

so it respawn players after all die?

solid scroll
#

its restarting but not because of that plugin. Its restarting because there are no players alive. Forcesurvival lets you create a wave system where players respawn together but thats not respawning the players because i have it set to 10 minutes and the server restarts within 10 seconds and the server.cfg default is set to 3 seconds for players to respawn

#

maybe there is a way to fool it into thinking that players are always alive when they arent so it doesnt restart the server

#

This wasnt an issue with the one by MrOats but it had other issues. That one was able to force players to be killed when afk and respawned when no players were alive. But the issue with that is that players died over and over again, leaving weapon drops and blood.

latent furnace
#

That hapoen because as i said, AFKManager dont kill you, it moves you to spectator as soon as you spawn, if you are afk

latent furnace
solid scroll
#

some reason its not doing it

#

the first time you spawn in you are alive, when map restarts you are in spectate mode, then it restarts in 5 seconds

latent furnace
#

i don't think neither me or w00tguy would be updating our plugins for compatibility, the game's Survival mode is as-is as H2 said, "Spectator Mode" is not a thing, it is just a dead player and they're dead after all

solid scroll
#

Which means youd probably have to trick it somehow

latent furnace
#

there would be amazing if it where a configurable thing, let's say we got a Hook for when survival is going to restart the map, so we could work from there and prevent the map from restarting but we don't have that hability

latent furnace
solid scroll
#

I dont think I have any conflicting plugins

solid scroll
#

actually maybe i do

#

i have "plugin"
{
"name" "SpectateOnDeath"
"script" "SpectateOnDeath"
}

latent furnace
#

you definitelly have

solid scroll
#

and

#

"plugin"
{
"name" "SpectateMode"
"script" "SpectateMode"
}

#

that might be why?

latent furnace
#

if you are afk with mine AFKManager you won't be able to spawn as it moves you to spectator as soon as it happens, then what could happen? SurvivalManager respawns you -> AFKManager moves you to spectator -> No alive players, restarting in 10 seconds

solid scroll
#

okay so this might be progress. I turned off the other plugins. It now puts you into spectate, and then takes you out of spectate. But once it does this three times it restarts the server. Why doesnt it just endlessly loop? Maybe if I make players respawn instantly with server.cfg?

#

by my assumption, if it can respawn players before the game thinks that everyone is dead, it might work.

#

i am assuming this just isn't possible

#

i think the best thing you can do is to try to lengthen the amount of time that a player can idle and the amount of time it takes to respawn players

#

so for instance, 5 minutes and it puts player into spectate, then add 3 seconds for respawn. then server is up for 15 minutes before it restarts

#

the easiest solution would be to increase the amount of retries but thast not possible

#

@latent furnaceso it seems your afk manager is just breaking force survival mode then isnt it? force survival mode is supposed to just respawn players and it was working. it seems like there is no perfect solution to this issue. either players will respawn and die over and over or they get put into spectate mode and the server will restart. so the only way that would work is if spectate mode was off and it simply killed players. now i am confused.

#

so how is forcesurvival mode 2 bypassing this issue? the alternative way to make this work is to get rid of afk manager entirely and use antistall, which kills players instead of putting them into spectate, but that has the issue of ruining maps that don't have linear states of progress such as platforming maps and as far as i can tell has no way to toggle it on or off or choose what maps will work

#

could you add that as a toggle feature? Instead of putting players into spectate mode or kicking them, just kill them?

latent furnace
#

did you even read what i said? Please, don't ping me again asking the same over and over. i've already tell you how to solve your issue.