[source included] Lag auto kick for AC ? + server side accuracy and more !
#1
Hey all
you may have noticed it was sometimes hard to kick laggers, or boring to check ping yourself etc.
That's why I think, a lagger auto-kick could be nice on some servers.

I tried to make one for my ladder, that's what I did :
1) you have to turn on a switch (-l) to enable the auto kick.
you have to specify the ping limit between "normal" player and "laggy" players with this switch; for example, if you want a limit of 700 of ping, you will have to add this to the cmd line :
-l700
(Note that the min value is 500)

2) The server check all players ping. When a ping is too high (compared to the limit) the player is in a lag period. If his ping doesn't go under the limit during the next x milliseconds, the player is auto kicked.
x is calculated from a formula (for my tests, I used :
x = (1.33/ping) * 5500 * 1000)
Lag period is reset only if the ping does under the limit during more than 1 second (this value can be changed).

This is what I actually did (I'm not cpp developper at all, sorry my code must be bad, but it should work, and you will see what I mean) :

serverevents.h
http://paste.debian.net/87957/

protos.h
http://paste.debian.net/87958/

My question : could something like this be implemented ?
Do you agree on the system ? Do you have better values or formulas to suggest ? Would you like something like that to exist ?

(Ask me if you didn't understand something)
Thanks, hope it will help
Thanks given by:
#2
Yes I would want that. And do the same for PJ because PJ matters more :D
Thanks given by:
#3
Sure, I could add pj verif. in is_lagging_autokick().
It would to include everything in client struct/class too.
;)
Thanks given by:
#4
O.o That's great! Especially since I thought it was already in the code...
Why did I think that...
Thanks given by:
#5
I added a server side accuracy + fixed struct.
To see players accuracy, do
/serverextension playersacc
You can ping the server too
(just saying !ping)
the servers answers "pong" with your ping.
Useful to see if you are still connected to a server when it lags.

server.cpp
http://pastebin.ca/1934915

serverevents.h
http://pastebin.ca/1934914

protos.h
http://pastebin.ca/1934916

I hope you like the idea, maybe some things like that could be one day implemented... just a try
Thanks given by:
#6
I changed behavior of the accuracy part (now it's taking in account distance for nades and sprays for shotgun).

You can see here what it gives :
[Image: feb2887915f583cb49918e3ff3e88e53ee8ac5cb.jpeg]

I would like to know statement of some devs, if you think it's shitty say it is, but react please :D
Thanks given by:
#7
I dont know how you figured this, but I dont really think grenades should be counted in there. :P I dont know why, they just dont seem right to add in.
Thanks given by:
#8
OMGBBQ AWESOME FTW
Thanks given by:
#9
Maybe an extension name that doesn't look like "player sac".
Great ideas, though.
Thanks given by:
#10
(07 Sep 10, 10:52PM)Ronald_Reagan Wrote: I dont know how you figured this, but I dont really think grenades should be counted in there. :P I dont know why, they just dont seem right to add in.

why not ? :) if you spam, your accuracy is lower 1st. But if you throw good nades, you're accuracy is better, I think it's fair :)
ty for support :D
Thanks given by:
#11
New update including :
- shuffle by tag system :
/serverextension shuffle "tag1 tag2"
and all players with tag1 will be in the same team, and the players with tag2 in their name will be in the enemy team...
You can use the number of tags you want... with a total limit of 50 chars. In most of the cases, you'll use a max of 2 I think :D
- private message system :
/serverextension msg "cn the message"
will send "the message" to player of client number "cn"
for example :
/serverextension msg "5 defend please"
- demo download limit (3 max downloads by demo) (I have to improve this system)
- fixed accuracy system
- I didn't update playersacc command name, because I didn't know what to use instead of it, sorry V-MAN :p

I recall you I do it to give ideas for 1.1.0.3 (or next version) and to prove it's possible to do :D

server.cpp
http://pastebin.ca/1935808

serverevents.h
http://pastebin.ca/1935810

protos.h
http://pastebin.ca/1935809
oh and join iafmatch.com:28700 if you want to test
admin password is "test"
it's on AC 1.1.0.3
Thanks given by:
#12
XD
playeracc?
Or you could go the opposite way and rename it player_sack.
Or /serverextension teabag [cn]
Thanks given by:
#13
(08 Sep 10, 06:11PM)DES|V-Man Wrote: XD
playeracc?
Or you could go the opposite way and rename it player_sack.
Or /serverextension teabag [cn]
OK I will :)
Wanna come on the server to test ? ;)
Thanks given by:
#14
Oh, what about brief ping spikes? How about if a ping remains in the constant high zone then they get kicked? Not just for an instant of high ping.
Thanks given by:
#15
well, you can do that, just use a lower value for ping limit.
If you want players having 550 of average ping to be kicked (and if their ping is over this most of the time)
just use -l550 or less :) It will do what you want :)
Thanks given by:
#16
So its an average ping then? I missed that part. :P
Thanks given by:
#17
no, it's a lag period limit; if your lag period is too long, you get kicked.
if you have a stable ping of 550, and if the server ping limit is 500, you'll get kicked :)
Thanks given by:
#18
Ok. That sits well with me then :) I really want to help you try these out!
Thanks given by:
#19
ok then compile AC SVN :D
I'm doing it on SVN so I don't have to change everything after next release if I have to update :)
Thanks given by:
#20
but how to do this without loosing anticheat? thats what these mods do right?
a dev can add?
Thanks given by:
#21
The devs had a slight problem with the cheat detection kicking non cheats for hacking because of lag spikes or some junk so,
I would love to hear a devs point of view on this modified server and if it falls under the good or bad category.
Thanks given by:
#22
Although I am not a dev, the anti-cheat lag problem was not because of clients lagging. As Brahma had previously stated, the anti-cheat takes lagging clients into effect. However, the problem with the anti-cheat is that it does not yet take server side lag into effect: if the server lags, pretty much everyone on the server could be kicked.

I think this is a very nice idea, Luc@s.
Thanks given by:
#23
the struct laggyclient should not exist, lagging is property of client and such property should cause disconnect, there should be something easer to discover lagger, if c->ping include lagging server, you must fix c-> ping computation
Thanks given by:
#24
@ everybody : thanks :)

@ Alien : I don't have access to client struct/class so I have to use another one, I know it would be better to integrate it to "client" but I couldn't;
Then, if you had read the last source, I'm using a struct named "cclient" -> custom client for everything.
And I can't just use ping property for lag, I need to know when the client started to lag or stopped to lag ;)
Thanks given by:
#25
Modifying a server is one thing.
Modifying the client means you can't play publicly.
Thanks given by:
#26
Yes, I only modify server, and it's not 24/7, I just run it for tests.
It's not made to be used, just to give ideas of what could be implemented, and how it could work. :)
Thanks given by:
#27
I am making a new game mode for AC, I'll post it later.
If you want to test it with me, please ask here :)

The mode => TKTB (:D) keep the base
Thanks given by:
#28
luc@s let me know when/where on IRC
Thanks given by: