.BANCHO. .FIX. Fix mod rank login error, add exception output at login, add some modules
This commit is contained in:
parent
afa6fa8563
commit
993079d2dd
|
@ -1,7 +1,7 @@
|
|||
import glob
|
||||
import serverPackets
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import exceptions
|
||||
|
||||
def handle(userToken, packetData):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import glob
|
||||
import clientPackets
|
||||
import serverPackets
|
||||
import actions
|
||||
from constants import actions
|
||||
import userHelper
|
||||
|
||||
def handle(userToken, packetData):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import glob
|
||||
import clientPackets
|
||||
import matchModModes
|
||||
import mods
|
||||
from constants import mods
|
||||
|
||||
def handle(userToken, packetData):
|
||||
# Get token data
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import glob
|
||||
import clientPackets
|
||||
import matchModModes
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import random
|
||||
import matchTeamTypes
|
||||
import matchTeams
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import clientPackets
|
||||
import glob
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
|
||||
def handle(userToken, packetData):
|
||||
# Get usertoken data
|
||||
|
|
|
@ -3,8 +3,8 @@ Event called when someone joins a channel
|
|||
"""
|
||||
|
||||
import clientPackets
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import serverPackets
|
||||
import glob
|
||||
import exceptions
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
Event called when someone parts a channel
|
||||
"""
|
||||
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import glob
|
||||
import clientPackets
|
||||
import serverPackets
|
||||
|
|
0
constants/__init__.py
Normal file
0
constants/__init__.py
Normal file
|
@ -1,8 +1,8 @@
|
|||
import serverPackets
|
||||
import clientPackets
|
||||
import glob
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import joinMatchEvent
|
||||
import exceptions
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import pymysql
|
||||
import bcolors
|
||||
import consoleHelper
|
||||
from constants import bcolors
|
||||
from helpers import consoleHelper
|
||||
import threading
|
||||
import glob
|
||||
|
||||
|
|
0
events/__init__.py
Normal file
0
events/__init__.py
Normal file
|
@ -1,7 +1,7 @@
|
|||
"""FokaBot related functions"""
|
||||
import userHelper
|
||||
import glob
|
||||
import actions
|
||||
from constants import actions
|
||||
import serverPackets
|
||||
import fokabotCommands
|
||||
|
||||
|
|
0
handlers/__init__.py
Normal file
0
handlers/__init__.py
Normal file
0
helpers/__init__.py
Normal file
0
helpers/__init__.py
Normal file
|
@ -1,6 +1,6 @@
|
|||
"""Some console related functions"""
|
||||
|
||||
import bcolors
|
||||
from constants import bcolors
|
||||
import glob
|
||||
|
||||
def printServerStartHeader(asciiArt):
|
|
@ -1,7 +1,7 @@
|
|||
import serverPackets
|
||||
import glob
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
|
||||
def handle(userToken, _):
|
||||
# Get userToken data
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import clientPackets
|
||||
import serverPackets
|
||||
import glob
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import exceptions
|
||||
|
||||
def handle(userToken, packetData):
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import urllib.request
|
||||
import json
|
||||
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
|
||||
# API URL
|
||||
URL = "http://ip.zxq.co/"
|
||||
|
|
|
@ -2,13 +2,15 @@ import userHelper
|
|||
import serverPackets
|
||||
import exceptions
|
||||
import glob
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import locationHelper
|
||||
import countryHelper
|
||||
import time
|
||||
import generalFunctions
|
||||
import channelJoinEvent
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
def handle(flaskRequest):
|
||||
# Data to return
|
||||
|
@ -123,7 +125,7 @@ def handle(flaskRequest):
|
|||
responseToken.enqueue(serverPackets.onlineUsers())
|
||||
|
||||
# Get location and country from ip.zxq.co or database
|
||||
if generalFunctions.stringToBool(glob.conf.config["server"]["localizeusers"]):
|
||||
if generalFunctions.stringToBool(glob.conf.config["server"]["localizeusers"]):
|
||||
# Get location and country from IP
|
||||
location = locationHelper.getLocation(requestIP)
|
||||
countryLetters = locationHelper.getCountry(requestIP)
|
||||
|
@ -170,6 +172,10 @@ def handle(flaskRequest):
|
|||
# Bancho is restarting
|
||||
responseData += serverPackets.notification("Bancho is restarting. Try again in a few minutes.")
|
||||
responseData += serverPackets.loginError()
|
||||
except:
|
||||
# Unknown exception
|
||||
msg = "UNKNOWN ERROR IN LOGIN!!!\n{}\n{}".format(sys.exc_info(), traceback.format_exc())
|
||||
consoleHelper.printColored("[!] {}".format(msg), bcolors.RED)
|
||||
finally:
|
||||
# Print login failed message to console if needed
|
||||
if err == True:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import glob
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import serverPackets
|
||||
import time
|
||||
|
||||
|
|
4
match.py
4
match.py
|
@ -5,8 +5,8 @@ import matchTeamTypes
|
|||
import matchModModes
|
||||
import slotStatuses
|
||||
import glob
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import serverPackets
|
||||
import dataTypes
|
||||
import matchTeams
|
||||
|
|
0
objects/__init__.py
Normal file
0
objects/__init__.py
Normal file
|
@ -1,10 +1,10 @@
|
|||
import uuid
|
||||
import actions
|
||||
from constants import actions
|
||||
import gameModes
|
||||
import userHelper
|
||||
import time
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import serverPackets
|
||||
import logoutEvent
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import glob
|
||||
import channelPartEvent
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
|
||||
def handle(userToken, _):
|
||||
# Get usertoken data
|
||||
|
|
4
pep.py
4
pep.py
|
@ -10,7 +10,7 @@ from tornado.httpserver import HTTPServer
|
|||
from tornado.ioloop import IOLoop
|
||||
|
||||
# pep.py files
|
||||
import bcolors
|
||||
from constants import bcolors
|
||||
import packetIDs
|
||||
import serverPackets
|
||||
import config
|
||||
|
@ -58,7 +58,7 @@ import matchChangeTeamEvent
|
|||
|
||||
# pep.py helpers
|
||||
import packetHelper
|
||||
import consoleHelper
|
||||
from helpers import consoleHelper
|
||||
import databaseHelper
|
||||
import responseHelper
|
||||
import generalFunctions
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import clientPackets
|
||||
import serverPackets
|
||||
import glob
|
||||
|
|
|
@ -2,8 +2,8 @@ import exceptions
|
|||
import clientPackets
|
||||
import glob
|
||||
import fokabot
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import serverPackets
|
||||
|
||||
def handle(userToken, packetData):
|
||||
|
|
|
@ -103,7 +103,7 @@ def userPanel(userID):
|
|||
elif rank == 4:
|
||||
userRank = userRanks.ADMIN
|
||||
elif rank == 3:
|
||||
userRank = userRank.MOD
|
||||
userRank = userRanks.MOD
|
||||
elif rank == 2:
|
||||
userRank = userRanks.SUPPORTER
|
||||
else:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import glob
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import serverPackets
|
||||
import exceptions
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import clientPackets
|
||||
import serverPackets
|
||||
import exceptions
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import glob
|
||||
import serverPackets
|
||||
import exceptions
|
||||
|
|
|
@ -4,8 +4,8 @@ import psutil
|
|||
import os
|
||||
import sys
|
||||
|
||||
import consoleHelper
|
||||
import bcolors
|
||||
from helpers import consoleHelper
|
||||
from constants import bcolors
|
||||
import threading
|
||||
import signal
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user