.BANCHO. Add ban check in change action event
This commit is contained in:
parent
82c9d2209b
commit
5ae2628b8b
|
@ -2,12 +2,18 @@ import glob
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import actions
|
import actions
|
||||||
|
import userHelper
|
||||||
|
|
||||||
def handle(userToken, packetData):
|
def handle(userToken, packetData):
|
||||||
# Get usertoken data
|
# Get usertoken data
|
||||||
userID = userToken.userID
|
userID = userToken.userID
|
||||||
username = userToken.username
|
username = userToken.username
|
||||||
|
|
||||||
|
# Make sure we are not banned
|
||||||
|
if userHelper.getAllowed(userID) == 0:
|
||||||
|
userToken.enqueue(serverPackets.loginBanned())
|
||||||
|
return
|
||||||
|
|
||||||
# Change action packet
|
# Change action packet
|
||||||
packetData = clientPackets.userActionChange(packetData)
|
packetData = clientPackets.userActionChange(packetData)
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,7 @@ def userStats(userID):
|
||||||
totalScore = userHelper.getTotalScore(userID, userToken.gameMode)
|
totalScore = userHelper.getTotalScore(userID, userToken.gameMode)
|
||||||
gameRank = userHelper.getGameRank(userID, userToken.gameMode)
|
gameRank = userHelper.getGameRank(userID, userToken.gameMode)
|
||||||
pp = int(userHelper.getPP(userID, userToken.gameMode))
|
pp = int(userHelper.getPP(userID, userToken.gameMode))
|
||||||
|
allowed = userHelper.getAllowed(userID)
|
||||||
|
|
||||||
return packetHelper.buildPacket(packetIDs.server_userStats,
|
return packetHelper.buildPacket(packetIDs.server_userStats,
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue
Block a user