How to tell if a player is not sending replies to the server. (Timing out)

I’m trying to get player’s in to god mode if they’re “timing out” or not sending replies to the server. I figured I would just scale damage to 0 in EntityTakeDamage if the player is timing out, but I can’t seem to find a function that determines whether a player is timing out or not. If anyone has any suggestions, I’d greatly appreciate it. Thanks!

Dont think you can do it instantly.

you can create a ping system hooked on player initial spawn + player disconnected so that when they dont send a certain amount of pings back to the server after X time, mark the player as is timed out

c’mon author of some popular anti cheat.

what’s to stop me not sending the ping packet and just getting god mode.

if u stop sending it kicks u faget

that defeats the purpose of the op fagot

There was a module for that, back in gmod12. I am pretty sure it is still functional,
you just need to find someone to update/recompile it for you.

I mean I don’t have to give them god mode… It’s one of the ideas I had. Regardless of how I do it, as long as I have a way to define"timing out" It’s fine.
See The main issue is that I’m running a gamemode that saves everything about the player to a database, this includes their currently equipped weapons, armor and ammunition. I have an issue that people are exploiting this system by unplugging their internet and having their friends kill them. They then close out of the game, reconnect and they still have their weapons, armor and ammo. even though they dropped it. I’m thinking of instead just having them not drop anything when they die while timing out since combat logging is easier to administrate than duping.

Also I tried messing with sv_timeout, but if I make it too low it causes some issues with players joining.

could just ply:Lock() too - would fix that problem.

You could check if this is 999, right?

just do over >=500, depending if you care who is on your server though, i guess. I’m what you call a douchebag and i’ll boot anyone 200+(consistent) :D. I don’t want those high ping bastards on there

Yeah, pretty much any ‘high’ value. This guy wants to check for timing out, so I’d use 999 as that is what ping is used when you stop sending messages to the server, as far as I can tell.

Well I figured that I’d use the system they’re abusing against them, since the system refuses to save their character when they die because it doesn’t want to actually run functions on timing out player, I figure I can set it so that when a player dies, the player sends a net message and only when this message is read by the server will it drop the player’s items. If the player is timing out, he/she can’t send this message… however I’m not sure how exploitable this could be since I don’t want people to somehow be able to block their items from dropping, but it’s still better than duping the items as far as I’m concerned considering how hard I worked to balance the economy in the gamemode I’m working on. Like I said before, combat logging is easier to administrate than duping.

Try my gmsv_sourcenetinfo_win32. It works the same way as the old gmsv_timeoutif you use it like this:


local Chan = ply:GetNetChannel()
if Chan then
print( Chan:IsTimingOut() )

Or you could just keep the player information separate from them, then when they disconnect/die/lag-out/whatever you still have the information. Much simpler solution all-around.

Everything is being stored to an SQL database on the server, but for some reason when the player dies while timing out, the information that their dead character no longer has a weapon in their “weapons” column in the profile table. Normally it would save the character on death, but the system refuses to save them if they are timing out. Also, thanks mfsinc, I’ll try that.