Skip to content

Commit

Permalink
created server_kick event handler and call that to prevent cmd packet…
Browse files Browse the repository at this point in the history
… spamming clients from reconnecting
  • Loading branch information
fdChasm committed Jun 1, 2010
1 parent 74146e2 commit 193014d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/fpsgame/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ namespace server
{
//disconnect_client(ci->clientnum, DISC_KICK);
//instead of kicking the player from here lets add a ban to the db
SbPy::triggerEventIntInt("player_kick", -1, ci->clientnum);
SbPy::triggerEventIntInt("server_kick", ci->clientnum);
}
}
else
Expand Down
5 changes: 5 additions & 0 deletions src/pyscripts/plugins/bans.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ def allowClient(cn, pwd):
@masterRequired
def onKick(cn, tcn):
ban(tcn, 14500, config['Main']['default_reason'], cn)

@eventHandler('server_kick')
@masterRequired
def onKick(cn):
ban(cn, 14500, config['Main']['default_reason'], -1)

@commandHandler('kick')
@masterRequired
Expand Down

0 comments on commit 193014d

Please sign in to comment.