.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 glob
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import exceptions
|
import exceptions
|
||||||
|
|
||||||
def handle(userToken, packetData):
|
def handle(userToken, packetData):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import actions
|
from constants import actions
|
||||||
import userHelper
|
import userHelper
|
||||||
|
|
||||||
def handle(userToken, packetData):
|
def handle(userToken, packetData):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import matchModModes
|
import matchModModes
|
||||||
import mods
|
from constants import mods
|
||||||
|
|
||||||
def handle(userToken, packetData):
|
def handle(userToken, packetData):
|
||||||
# Get token data
|
# Get token data
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import glob
|
import glob
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import matchModModes
|
import matchModModes
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import random
|
import random
|
||||||
import matchTeamTypes
|
import matchTeamTypes
|
||||||
import matchTeams
|
import matchTeams
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import glob
|
import glob
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
|
|
||||||
def handle(userToken, packetData):
|
def handle(userToken, packetData):
|
||||||
# Get usertoken data
|
# Get usertoken data
|
||||||
|
|
|
@ -3,8 +3,8 @@ Event called when someone joins a channel
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import glob
|
import glob
|
||||||
import exceptions
|
import exceptions
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
Event called when someone parts a channel
|
Event called when someone parts a channel
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import glob
|
import glob
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import serverPackets
|
import serverPackets
|
||||||
|
|
0
constants/__init__.py
Normal file
0
constants/__init__.py
Normal file
|
@ -1,8 +1,8 @@
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import glob
|
import glob
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import joinMatchEvent
|
import joinMatchEvent
|
||||||
import exceptions
|
import exceptions
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import pymysql
|
import pymysql
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import threading
|
import threading
|
||||||
import glob
|
import glob
|
||||||
|
|
||||||
|
|
0
events/__init__.py
Normal file
0
events/__init__.py
Normal file
|
@ -1,7 +1,7 @@
|
||||||
"""FokaBot related functions"""
|
"""FokaBot related functions"""
|
||||||
import userHelper
|
import userHelper
|
||||||
import glob
|
import glob
|
||||||
import actions
|
from constants import actions
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import fokabotCommands
|
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"""
|
"""Some console related functions"""
|
||||||
|
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import glob
|
import glob
|
||||||
|
|
||||||
def printServerStartHeader(asciiArt):
|
def printServerStartHeader(asciiArt):
|
|
@ -1,7 +1,7 @@
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import glob
|
import glob
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
|
|
||||||
def handle(userToken, _):
|
def handle(userToken, _):
|
||||||
# Get userToken data
|
# Get userToken data
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import glob
|
import glob
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import exceptions
|
import exceptions
|
||||||
|
|
||||||
def handle(userToken, packetData):
|
def handle(userToken, packetData):
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
|
|
||||||
# API URL
|
# API URL
|
||||||
URL = "http://ip.zxq.co/"
|
URL = "http://ip.zxq.co/"
|
||||||
|
|
|
@ -2,13 +2,15 @@ import userHelper
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import exceptions
|
import exceptions
|
||||||
import glob
|
import glob
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import locationHelper
|
import locationHelper
|
||||||
import countryHelper
|
import countryHelper
|
||||||
import time
|
import time
|
||||||
import generalFunctions
|
import generalFunctions
|
||||||
import channelJoinEvent
|
import channelJoinEvent
|
||||||
|
import sys
|
||||||
|
import traceback
|
||||||
|
|
||||||
def handle(flaskRequest):
|
def handle(flaskRequest):
|
||||||
# Data to return
|
# Data to return
|
||||||
|
@ -123,7 +125,7 @@ def handle(flaskRequest):
|
||||||
responseToken.enqueue(serverPackets.onlineUsers())
|
responseToken.enqueue(serverPackets.onlineUsers())
|
||||||
|
|
||||||
# Get location and country from ip.zxq.co or database
|
# 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
|
# Get location and country from IP
|
||||||
location = locationHelper.getLocation(requestIP)
|
location = locationHelper.getLocation(requestIP)
|
||||||
countryLetters = locationHelper.getCountry(requestIP)
|
countryLetters = locationHelper.getCountry(requestIP)
|
||||||
|
@ -170,6 +172,10 @@ def handle(flaskRequest):
|
||||||
# Bancho is restarting
|
# Bancho is restarting
|
||||||
responseData += serverPackets.notification("Bancho is restarting. Try again in a few minutes.")
|
responseData += serverPackets.notification("Bancho is restarting. Try again in a few minutes.")
|
||||||
responseData += serverPackets.loginError()
|
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:
|
finally:
|
||||||
# Print login failed message to console if needed
|
# Print login failed message to console if needed
|
||||||
if err == True:
|
if err == True:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import glob
|
import glob
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
4
match.py
4
match.py
|
@ -5,8 +5,8 @@ import matchTeamTypes
|
||||||
import matchModModes
|
import matchModModes
|
||||||
import slotStatuses
|
import slotStatuses
|
||||||
import glob
|
import glob
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import dataTypes
|
import dataTypes
|
||||||
import matchTeams
|
import matchTeams
|
||||||
|
|
0
objects/__init__.py
Normal file
0
objects/__init__.py
Normal file
|
@ -1,10 +1,10 @@
|
||||||
import uuid
|
import uuid
|
||||||
import actions
|
from constants import actions
|
||||||
import gameModes
|
import gameModes
|
||||||
import userHelper
|
import userHelper
|
||||||
import time
|
import time
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import logoutEvent
|
import logoutEvent
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import channelPartEvent
|
import channelPartEvent
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
|
|
||||||
def handle(userToken, _):
|
def handle(userToken, _):
|
||||||
# Get usertoken data
|
# Get usertoken data
|
||||||
|
|
4
pep.py
4
pep.py
|
@ -10,7 +10,7 @@ from tornado.httpserver import HTTPServer
|
||||||
from tornado.ioloop import IOLoop
|
from tornado.ioloop import IOLoop
|
||||||
|
|
||||||
# pep.py files
|
# pep.py files
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import packetIDs
|
import packetIDs
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import config
|
import config
|
||||||
|
@ -58,7 +58,7 @@ import matchChangeTeamEvent
|
||||||
|
|
||||||
# pep.py helpers
|
# pep.py helpers
|
||||||
import packetHelper
|
import packetHelper
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import databaseHelper
|
import databaseHelper
|
||||||
import responseHelper
|
import responseHelper
|
||||||
import generalFunctions
|
import generalFunctions
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import glob
|
import glob
|
||||||
|
|
|
@ -2,8 +2,8 @@ import exceptions
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import glob
|
import glob
|
||||||
import fokabot
|
import fokabot
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import serverPackets
|
import serverPackets
|
||||||
|
|
||||||
def handle(userToken, packetData):
|
def handle(userToken, packetData):
|
||||||
|
|
|
@ -103,7 +103,7 @@ def userPanel(userID):
|
||||||
elif rank == 4:
|
elif rank == 4:
|
||||||
userRank = userRanks.ADMIN
|
userRank = userRanks.ADMIN
|
||||||
elif rank == 3:
|
elif rank == 3:
|
||||||
userRank = userRank.MOD
|
userRank = userRanks.MOD
|
||||||
elif rank == 2:
|
elif rank == 2:
|
||||||
userRank = userRanks.SUPPORTER
|
userRank = userRanks.SUPPORTER
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import glob
|
import glob
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import exceptions
|
import exceptions
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import clientPackets
|
import clientPackets
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import exceptions
|
import exceptions
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import glob
|
import glob
|
||||||
import serverPackets
|
import serverPackets
|
||||||
import exceptions
|
import exceptions
|
||||||
|
|
|
@ -4,8 +4,8 @@ import psutil
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import consoleHelper
|
from helpers import consoleHelper
|
||||||
import bcolors
|
from constants import bcolors
|
||||||
import threading
|
import threading
|
||||||
import signal
|
import signal
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user