From 5ae2628b8badecbab51c508fc6b7d9d90dedf65a Mon Sep 17 00:00:00 2001 From: Nyo Date: Wed, 4 May 2016 23:41:33 +0200 Subject: [PATCH] .BANCHO. Add ban check in change action event --- changeActionEvent.py | 6 ++++++ serverPackets.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/changeActionEvent.py b/changeActionEvent.py index 0a51659..b7505c3 100644 --- a/changeActionEvent.py +++ b/changeActionEvent.py @@ -2,12 +2,18 @@ import glob import clientPackets import serverPackets import actions +import userHelper def handle(userToken, packetData): # Get usertoken data userID = userToken.userID username = userToken.username + # Make sure we are not banned + if userHelper.getAllowed(userID) == 0: + userToken.enqueue(serverPackets.loginBanned()) + return + # Change action packet packetData = clientPackets.userActionChange(packetData) diff --git a/serverPackets.py b/serverPackets.py index f660cf2..1adbd97 100644 --- a/serverPackets.py +++ b/serverPackets.py @@ -135,7 +135,8 @@ def userStats(userID): totalScore = userHelper.getTotalScore(userID, userToken.gameMode) gameRank = userHelper.getGameRank(userID, userToken.gameMode) pp = int(userHelper.getPP(userID, userToken.gameMode)) - + allowed = userHelper.getAllowed(userID) + return packetHelper.buildPacket(packetIDs.server_userStats, [ [userID, dataTypes.uInt32],