Raised This Month: $ Target: $400
 0% 

Prevent server access to high ping players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
binderjeep
Member
Join Date: Jan 2015
Old 01-20-2016 , 18:03   Prevent server access to high ping players
Reply With Quote #1

Anyone know of any code to prevent players with a ping > X from joining the server? i hate having laggy players on our server.
binderjeep is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 01-20-2016 , 19:53   Re: Prevent server access to high ping players
Reply With Quote #2

You cannot "prevent" them from joining based on their ping.

You can restrict your server using country restriction plugins to get something like that, but it won't work 100% as also people from those countries may have a high ping sometimes. Such plugins usually use geographical data on IP addresses, which aren't 100% accurate.

Or you can do it the usual way, by kicking people with any of the anti high ping plugins available, but again, that won't kick them before they have joined.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
binderjeep
Member
Join Date: Jan 2015
Old 01-21-2016 , 08:39   Re: Prevent server access to high ping players
Reply With Quote #3

Quote:
Originally Posted by arne1288 View Post
You cannot "prevent" them from joining based on their ping.

You can restrict your server using country restriction plugins to get something like that, but it won't work 100% as also people from those countries may have a high ping sometimes. Such plugins usually use geographical data on IP addresses, which aren't 100% accurate.

Or you can do it the usual way, by kicking people with any of the anti high ping plugins available, but again, that won't kick them before they have joined.

Conceptually though, would it really be that difficult to acheive? i mean on PlayerConnect could we not hold that players name in an array. Then identify the players "ping" somehow ( i mean the "status" function in the console lists all players and their latency) and the have an If statement, so

If PlayerConnect("player") ping => 100 then
Kick
Else
do nothing


----

Anyone have any issues with this working? if not , anyone want to code it for me. I don't have a problem paying compensation.
binderjeep is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 01-21-2016 , 09:09   Re: Prevent server access to high ping players
Reply With Quote #4

Is kicking them shortly after joining not sufficient? It seems much simpler
Miu is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 01-21-2016 , 09:41   Re: Prevent server access to high ping players
Reply With Quote #5

Quote:
Originally Posted by binderjeep View Post
Conceptually though, would it really be that difficult to acheive? i mean on PlayerConnect could we not hold that players name in an array. Then identify the players "ping" somehow ...
The thing is, latency is very jittery when sampled once, and it's actually nonexistent during OnClientConnected().

Attached is a quick plugin that performs an average latency check during OnClientPutInServer(); they will fully connect, but if their latency is too high, they should be kicked before they can actually play. Recompile with your choice of latency and kick reason. Not sure how well it would work in practice; on my test server, it reports ~80ms when my ping reports ~60 after sitting in-game for a bit.

Keep in mind that since it's only being sampled once, if any player just happens to have an unusually high ping during that period, they will be kicked. I'd personally just stick to the existing anti-high-ping plugins that give clients some leeway before getting the boot.

Could also always use a mix of GeoIP / automated addition to whitelists for players that have previously passed these checks, too.
Attached Files
File Type: sp Get Plugin or Get Source (client_latency_on_join.sp - 322 views - 761 Bytes)
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 01-21-2016 at 09:56.
nosoop is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 01-21-2016 , 12:19   Re: Prevent server access to high ping players
Reply With Quote #6

Adding to what nosoop said, downloading maps also increases your ping by quite a lot.
I have noticed that on my 75mbit/s line when I download larger maps, where my ping goes up to 250-300ms and some packet loss, despite it being 20-30ms usually.
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 01-21-2016 , 12:53   Re: Prevent server access to high ping players
Reply With Quote #7

Quote:
Originally Posted by pcmaster View Post
Adding to what nosoop said, downloading maps also increases your ping by quite a lot.
I have noticed that on my 75mbit/s line when I download larger maps, where my ping goes up to 250-300ms and some packet loss, despite it being 20-30ms usually.
I was thinking of that, plus my client has a tendency to freeze for a bit while connecting -- it won't alt tab or anything, so presumably it can't respond to pings either
Miu is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 01-21-2016 , 13:04   Re: Prevent server access to high ping players
Reply With Quote #8

OP, unless your server is so popular that at any time t you have 50+ people trying to join it, any of the normal high ping kickers will work fine. You're unnecessarily introducing accuracy problems by narrowing the time window (as mentioned earlier with ping sampling).

You hate high ping players, but now the players will hate you for being kicked for no reason.
Potato Uno is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-21-2016 , 17:31   Re: Prevent server access to high ping players
Reply With Quote #9

Whats wrong with this:

https://forums.alliedmods.net/showthread.php?p=2312387
__________________
Neuro Toxin is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 01-21-2016 , 17:33   Re: Prevent server access to high ping players
Reply With Quote #10

Quote:
Originally Posted by pcmaster View Post
Adding to what nosoop said, downloading maps also increases your ping by quite a lot.
I have noticed that on my 75mbit/s line when I download larger maps, where my ping goes up to 250-300ms and some packet loss, despite it being 20-30ms usually.
Isn't fast download meant to solve that?
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode