.BANCHO. .FIX. Fixed some missing references, code cleaning
This commit is contained in:
parent
8173ff3bb6
commit
7fcc9bca5e
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit e30a9a5ddd07ca7fd2e4d92d695f2b1a5374d069
|
Subproject commit ab26c073a72cf73330a145a76e4df7b2fc22ee04
|
|
@ -140,7 +140,7 @@ def userStats(userID, force = False):
|
||||||
[userToken.playcount, dataTypes.UINT32],
|
[userToken.playcount, dataTypes.UINT32],
|
||||||
[userToken.totalScore, dataTypes.UINT64],
|
[userToken.totalScore, dataTypes.UINT64],
|
||||||
[userToken.gameRank, dataTypes.UINT32],
|
[userToken.gameRank, dataTypes.UINT32],
|
||||||
[userToken.pp if userToken.pp <= 65535 and userToken.pp > 0 else 0, dataTypes.UINT16]
|
[userToken.pp if 65535 >= userToken.pp > 0 else 0, dataTypes.UINT16]
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,62 +0,0 @@
|
||||||
import requests
|
|
||||||
from objects import glob
|
|
||||||
from urllib.parse import urlencode
|
|
||||||
|
|
||||||
def sendDiscordMessage(channel, message, alertDev = False, prefix = "**pep.py**"):
|
|
||||||
"""
|
|
||||||
Send a message to a discord server.
|
|
||||||
This is used with ripple's schiavobot.
|
|
||||||
|
|
||||||
channel -- bunk, staff or general
|
|
||||||
message -- message to send
|
|
||||||
alertDev -- if True, hl developers group
|
|
||||||
prefix -- string to prepend to message
|
|
||||||
"""
|
|
||||||
if glob.discord:
|
|
||||||
for _ in range(0,20):
|
|
||||||
try:
|
|
||||||
finalMsg = "{prefix} {message}".format(prefix=prefix, message=message) if alertDev == False else "{prefix} {hl} - {message}".format(prefix=prefix, hl=glob.conf.config["discord"]["devgroup"], message=message)
|
|
||||||
requests.get("{}/{}?{}".format(glob.conf.config["discord"]["boturl"], channel, urlencode({ "message": finalMsg })))
|
|
||||||
break
|
|
||||||
except:
|
|
||||||
continue
|
|
||||||
|
|
||||||
def sendConfidential(message, alertDev = False):
|
|
||||||
"""
|
|
||||||
Send a message to #bunker
|
|
||||||
|
|
||||||
message -- message to send
|
|
||||||
"""
|
|
||||||
sendDiscordMessage("bunk", message, alertDev)
|
|
||||||
|
|
||||||
def sendStaff(message):
|
|
||||||
"""
|
|
||||||
Send a message to #staff
|
|
||||||
|
|
||||||
message -- message to send
|
|
||||||
"""
|
|
||||||
sendDiscordMessage("staff", message)
|
|
||||||
|
|
||||||
def sendGeneral(message):
|
|
||||||
"""
|
|
||||||
Send a message to #general
|
|
||||||
|
|
||||||
message -- message to send
|
|
||||||
"""
|
|
||||||
sendDiscordMessage("general", message)
|
|
||||||
|
|
||||||
def sendChatlog(message):
|
|
||||||
"""
|
|
||||||
Send a message to #chatlog
|
|
||||||
|
|
||||||
message -- message to send
|
|
||||||
"""
|
|
||||||
sendDiscordMessage("chatlog", message, prefix="")
|
|
||||||
|
|
||||||
def sendCM(message):
|
|
||||||
"""
|
|
||||||
Send a message to #communitymanagers
|
|
||||||
|
|
||||||
message -- message to send
|
|
||||||
"""
|
|
||||||
sendDiscordMessage("cm", message)
|
|
|
@ -146,7 +146,7 @@ class Client:
|
||||||
quitmsg = "EOT"
|
quitmsg = "EOT"
|
||||||
except socket.error as x:
|
except socket.error as x:
|
||||||
# Error while reading data, this client will be disconnected
|
# Error while reading data, this client will be disconnected
|
||||||
data = ""
|
data = bytes()
|
||||||
quitmsg = x
|
quitmsg = x
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
|
@ -204,7 +204,7 @@ class Client:
|
||||||
log.debug("[IRC] [{}:{}] <- {}".format(self.ip, self.port, self.__writebuffer[:sent]))
|
log.debug("[IRC] [{}:{}] <- {}".format(self.ip, self.port, self.__writebuffer[:sent]))
|
||||||
self.__writebuffer = self.__writebuffer[sent:]
|
self.__writebuffer = self.__writebuffer[sent:]
|
||||||
except socket.error as x:
|
except socket.error as x:
|
||||||
self.disconnect(x)
|
self.disconnect(str(x))
|
||||||
|
|
||||||
|
|
||||||
def checkAlive(self):
|
def checkAlive(self):
|
||||||
|
|
|
@ -36,6 +36,7 @@ cloudflare = False
|
||||||
chatFilters = None
|
chatFilters = None
|
||||||
userIDCache = {}
|
userIDCache = {}
|
||||||
pool = None
|
pool = None
|
||||||
|
ircServer = None
|
||||||
busyThreads = 0
|
busyThreads = 0
|
||||||
|
|
||||||
debug = False
|
debug = False
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class stream():
|
class stream:
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
"""
|
"""
|
||||||
Initialize a stream object
|
Initialize a stream object
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from objects import stream
|
from objects import stream
|
||||||
|
|
||||||
class streamList():
|
class streamList:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.streams = {}
|
self.streams = {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user