Closed seanbarr1988 closed 4 years ago
Can you easily reproduce the behaviour? For me it is working fine, high ping player is kicked as expected and a /reconnect will not protect him.
What is your value of "task_frequency" in file "conf/settings.conf"? This is the interval for checking ping. So a high ping player will get kicked after max 4 x 60 secs if the task_frequency = 60
I tried 60, 45 and now currently on 30 but have yet to notice the problem happen again (most players are under 200ms)
Is there away to bypass the warnings and just kick a player after 2 or 3 checks that result is positive for high ping? (kicking provides a reason so i see no need to warn a player 3 times and take 4 mins to eventually kick them)
you can change the max value of ping... no its in the code defined to warn everyone 3 times before kicking... you would need to change the code. the ping warn counter will also be reset when the player has during the next check a better ping. a player will get kicked only in case he has for 3 intervals a bad ping.
well currently on my server there is a player playing for 9 mins with 225-250ms ping and no kick.
there is also a player that uses a vpn and consistently has 298ms all maps all day and never gets kicked, so im not sure its even working for me even though i enabled it and saw it work once ingame.
the autokick is working only for users and moderators, admins will never get kicked.
so if you have always a player on your server, I could add a admin command to check the his ping. maybe the detection is not working correct.
what is your value for "warn_expiration" ? what is your value for "max_ping" ?
to test this i added warn_expiration 900 and max_ping 200. I can see in the live console on the server that the client is being warned by the bot through rcon_tell but not sure why is never kicked. the player stayed for 20 mins and the whole time i saw their ping in game as 215ms lowest 254ms highest whilst checking their ping every 30 seconds in game
ok, I will prepare a special debug version, which will add some debug log to the logfile "devel.log" and add a command !ping
please check this version: https://www.dropbox.com/s/k6vxrx8gg7rpomf/spunky63.py?dl=0
and you need to set the value "verbose" in the "conf/settings.conf" file to
verbose = 1
this will enable debug logging and show more details.
this spunky63.py has a command
!ping <name>
to check ingame the ping value of players.
If you are using systemd or sysvinit, stop the bot, rename the original spunky.py to spunky.py.org and rename spunky63.py to spunky.py and start the bot again.
by the way: I would recommend the default values for "warn_expiration" and "task_frequency".
ok, but i really don't want to wait 4mins to kick high ping players that is why I tried 30s (4x 30s seemed much nicer)
Agreed, but do not forget, that this timer is also used for:
If you are facing such an issue with high pingers, why are you not already blocking them by joining your server with the server value "sv_maxping" ?
I would prefer to solve the issue with sv_maxping unfortunately it seems broken as when connecting to the server your ping seems to spike briefly to 999 and is enough to stop you from connecting to the server due to being higher than any value set sometimes it also does not happen and you connect with no problem. I have a ping of 45ms to my server and even when setting a max_ping of 300 I am prevented from connecting to the server randomly.
I am currently back to using the 60 second task frequency. If I experience this issue again I will try to gather logs and see if I can see if the bot issued the warnings or not.
This connect issue is since years, introduced in 4.2. So for FS more or less a normal behavior :-) So this is not really related to sv_maxping...
Are you running the spunky63.py with verbose = 1 in the config?
fix urbanterror code open source then all can help with sv_maxping and 24832948 other easy bugs why not already opensource if fs not maintain it? Keeping close to let it die? Egoistic and disrespectfull decision for all players and devs that played/coded game
The source code is not open source... It is dead since years... Same as the "new" unreal based version
ok as far as i can tell ping kick seems to work fine and i must have been experiencing players that where upto no good trying to avoid the kick. however my current problem now is that the bot takes 4mins to kick a player that takes 5seconds to /reconnect and play again for another 4 mins. which kind of defeats the purpose. :/
If i add:
player.add_ban_point('fix your ping', 100)
to the taskmanager function, would this be sufficient to temporary "ban" high ping players that are kicked from the server for 5mins (duration * 3) ?
no, this would not work as you expect. a player needs two ban_points to get banned.
ban_points make only sense for TK and bad words/spam which appear in a short range. If player gets kicked due to TK, he gets ban_points, and if he reconnects and continues with TK, then he will be banned directly.
You would need to use the real ban function
player.ban(duration=300, reason='fix your ping')
but I am not sure if you would have friends on the server...
[17.03.2020 21:09:46] ERROR 'Player' object has no attribute 'num'
Traceback (most recent call last):
File "./spunky.py", line 635, in taskmanager
self.check_player_ping()
File "./spunky.py", line 651, in check_player_ping
gameplayer = self.game.players[player.num]
AttributeError: 'Player' object has no attribute 'num'
[17.03.2020 21:10:15] ERROR not enough arguments for format string
Traceback (most recent call last):
File "./spunky.py", line 681, in parse_line
option[action](line)
File "./spunky.py", line 741, in handle_callvote
''' % (self.failed_vote_timer, time.time())
TypeError: not enough arguments for format string
[17.03.2020 21:10:47] ERROR 'Player' object has no attribute 'num'
Traceback (most recent call last):
File "./spunky.py", line 635, in taskmanager
self.check_player_ping()
File "./spunky.py", line 651, in check_player_ping
gameplayer = self.game.players[player.num]
AttributeError: 'Player' object has no attribute 'num'
[17.03.2020 21:11:48] ERROR 'Player' object has no attribute 'num'
Traceback (most recent call last):
File "./spunky.py", line 635, in taskmanager
self.check_player_ping()
File "./spunky.py", line 651, in check_player_ping
gameplayer = self.game.players[player.num]
AttributeError: 'Player' object has no attribute 'num'
[17.03.2020 21:12:49] ERROR 'Player' object has no attribute 'num'
Traceback (most recent call last):
File "./spunky.py", line 635, in taskmanager
self.check_player_ping()
File "./spunky.py", line 651, in check_player_ping
gameplayer = self.game.players[player.num]
AttributeError: 'Player' object has no attribute 'num'
[17.03.2020 21:13:50] ERROR 'Player' object has no attribute 'num'
Traceback (most recent call last):
File "./spunky.py", line 635, in taskmanager
self.check_player_ping()
File "./spunky.py", line 651, in check_player_ping
gameplayer = self.game.players[player.num]
AttributeError: 'Player' object has no attribute 'num'
found this in devel.log perhaps it helps? this maybe why the player gets some warnings, but never enough to kick ?
No, the player.num erroris now caused by using the incompatible pyquake lib from madprof which does not has the value "player number"
Did you add some code to handle_callvote? I cannot find any code snippet which contains "self.failed_vote_timer", which is also shown above in the debug log as error...
yes sorry i was debugging something i added to spunky when i found the errors in the log. I think Madprof version uses player.slot instead?
anyways wheres best to send you code snippets for a feature i added that veto's nextmap votes for (configurable time in seconds) after a nextmap vote failed (not sure i can do a pull request or diff patch as i have changes a whole load of other things like the colour tags to colours i prefer vs default spunky colour scheme)
could by player.slot...
If it is easier for you, you can send me the code snippet instead of cleaning the code to create a pull request. So you added a "handle_vote_failed" function? Or is "handle_callvote" allowing an additional nextmap vote when the timer expires instead of disabling the vote until end of map?
I added (with help from others) handle_vote_failed function i will send you the code snippets so you can choose if you wish to add it. its a nice feature for prevents constant call vote spam from multiple players until a vote passes after the initial vote that fails players on my server need to wait 5 minutes before they can call vote again.
https://pastebin.fun/AvJexFinQu
also in settings.conf
failed_vote_delay = 300 ; Interval in seconds next map voting will be disabled for after a failed vote.
ah, it is a vote delay just for nextmap votes.
Uh there is a bad coding with double type conversion.
But I started to implement a vote fail function as well, so I will add your feature to that one.
awesome, Im a python n00b so it probably has errors but it does work as far as i could tell. im sure you'll fix it no bother though 👍
Currently the ping kick function takes forever to finally kick someone and as soon as they /reconnect in console they are no longer kicked by the bot and are left to play for as long as they like.