.BANCHO. Add automatic beatmap download when spectating someone
This commit is contained in:
parent
ba774bf567
commit
8e4c44b857
|
@ -12,7 +12,8 @@ def userActionChange(stream):
|
||||||
["actionText", dataTypes.STRING],
|
["actionText", dataTypes.STRING],
|
||||||
["actionMd5", dataTypes.STRING],
|
["actionMd5", dataTypes.STRING],
|
||||||
["actionMods", dataTypes.UINT32],
|
["actionMods", dataTypes.UINT32],
|
||||||
["gameMode", dataTypes.BYTE]
|
["gameMode", dataTypes.BYTE],
|
||||||
|
["beatmapID", dataTypes.SINT32]
|
||||||
])
|
])
|
||||||
|
|
||||||
def userStatsRequest(stream):
|
def userStatsRequest(stream):
|
||||||
|
|
|
@ -134,7 +134,7 @@ def userStats(userID, force = False):
|
||||||
[userToken.actionMd5, dataTypes.STRING],
|
[userToken.actionMd5, dataTypes.STRING],
|
||||||
[userToken.actionMods, dataTypes.SINT32],
|
[userToken.actionMods, dataTypes.SINT32],
|
||||||
[userToken.gameMode, dataTypes.BYTE],
|
[userToken.gameMode, dataTypes.BYTE],
|
||||||
[0, dataTypes.SINT32],
|
[userToken.beatmapID, dataTypes.SINT32],
|
||||||
[userToken.rankedScore, dataTypes.UINT64],
|
[userToken.rankedScore, dataTypes.UINT64],
|
||||||
[userToken.accuracy, dataTypes.FFLOAT],
|
[userToken.accuracy, dataTypes.FFLOAT],
|
||||||
[userToken.playcount, dataTypes.UINT32],
|
[userToken.playcount, dataTypes.UINT32],
|
||||||
|
|
|
@ -39,11 +39,12 @@ if userToken.matchID != -1 and userToken.actionID != actions.MULTIPLAYING and us
|
||||||
userToken.gameMode = packetData["gameMode"]
|
userToken.gameMode = packetData["gameMode"]
|
||||||
userToken.updateCachedStats()
|
userToken.updateCachedStats()
|
||||||
|
|
||||||
# Always update action id, text and md5
|
# Always update action id, text, md5 and beatmapID
|
||||||
userToken.actionID = packetData["actionID"]
|
userToken.actionID = packetData["actionID"]
|
||||||
userToken.actionText = packetData["actionText"]
|
userToken.actionText = packetData["actionText"]
|
||||||
userToken.actionMd5 = packetData["actionMd5"]
|
userToken.actionMd5 = packetData["actionMd5"]
|
||||||
userToken.actionMods = packetData["actionMods"]
|
userToken.actionMods = packetData["actionMods"]
|
||||||
|
userToken.beatmapID = packetData["beatmapID"]
|
||||||
|
|
||||||
# Enqueue our new user panel and stats to us and our spectators
|
# Enqueue our new user panel and stats to us and our spectators
|
||||||
recipients = [userID]
|
recipients = [userID]
|
||||||
|
@ -64,4 +65,4 @@ if userToken.matchID != -1 and userToken.actionID != actions.MULTIPLAYING and us
|
||||||
token.enqueue(serverPackets.userStats(userID, force))
|
token.enqueue(serverPackets.userStats(userID, force))
|
||||||
|
|
||||||
# Console output
|
# Console output
|
||||||
log.info("{} changed action: {} [{}][{}]".format(username, str(userToken.actionID), userToken.actionText, userToken.actionMd5))
|
log.info("{} changed action: {} [{}][{}][{}]".format(username, str(userToken.actionID), userToken.actionText, userToken.actionMd5, userToken.beatmapID))
|
||||||
|
|
|
@ -58,6 +58,7 @@ class token:
|
||||||
self.actionMd5 = ""
|
self.actionMd5 = ""
|
||||||
self.actionMods = 0
|
self.actionMods = 0
|
||||||
self.gameMode = gameModes.std
|
self.gameMode = gameModes.std
|
||||||
|
self.beatmapID = 0
|
||||||
self.rankedScore = 0
|
self.rankedScore = 0
|
||||||
self.accuracy = 0.0
|
self.accuracy = 0.0
|
||||||
self.playcount = 0
|
self.playcount = 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user