.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],
|
||||
["actionMd5", dataTypes.STRING],
|
||||
["actionMods", dataTypes.UINT32],
|
||||
["gameMode", dataTypes.BYTE]
|
||||
["gameMode", dataTypes.BYTE],
|
||||
["beatmapID", dataTypes.SINT32]
|
||||
])
|
||||
|
||||
def userStatsRequest(stream):
|
||||
|
|
|
@ -134,7 +134,7 @@ def userStats(userID, force = False):
|
|||
[userToken.actionMd5, dataTypes.STRING],
|
||||
[userToken.actionMods, dataTypes.SINT32],
|
||||
[userToken.gameMode, dataTypes.BYTE],
|
||||
[0, dataTypes.SINT32],
|
||||
[userToken.beatmapID, dataTypes.SINT32],
|
||||
[userToken.rankedScore, dataTypes.UINT64],
|
||||
[userToken.accuracy, dataTypes.FFLOAT],
|
||||
[userToken.playcount, dataTypes.UINT32],
|
||||
|
|
|
@ -39,11 +39,12 @@ if userToken.matchID != -1 and userToken.actionID != actions.MULTIPLAYING and us
|
|||
userToken.gameMode = packetData["gameMode"]
|
||||
userToken.updateCachedStats()
|
||||
|
||||
# Always update action id, text and md5
|
||||
# Always update action id, text, md5 and beatmapID
|
||||
userToken.actionID = packetData["actionID"]
|
||||
userToken.actionText = packetData["actionText"]
|
||||
userToken.actionMd5 = packetData["actionMd5"]
|
||||
userToken.actionMods = packetData["actionMods"]
|
||||
userToken.beatmapID = packetData["beatmapID"]
|
||||
|
||||
# Enqueue our new user panel and stats to us and our spectators
|
||||
recipients = [userID]
|
||||
|
@ -64,4 +65,4 @@ if userToken.matchID != -1 and userToken.actionID != actions.MULTIPLAYING and us
|
|||
token.enqueue(serverPackets.userStats(userID, force))
|
||||
|
||||
# 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.actionMods = 0
|
||||
self.gameMode = gameModes.std
|
||||
self.beatmapID = 0
|
||||
self.rankedScore = 0
|
||||
self.accuracy = 0.0
|
||||
self.playcount = 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user