Send the api some data when a multiplayer match ends

This commit is contained in:
goeo_
2017-07-31 17:54:50 -04:00
parent 8c3fc6842d
commit 2cf1cdf1fd
3 changed files with 61 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
from objects import glob
from constants import serverPackets
from constants import serverPackets, clientPackets
def handle(userToken, packetData):
# Get usertoken data
@@ -22,5 +22,11 @@ def handle(userToken, packetData):
# Change slot id in packetData
slotID = match.getUserSlotID(userID)
# Parse the data
data = clientPackets.matchFrames(packetData)
# Update the score
match.updateScore(slotID, data["totalScore"])
# Enqueue frames to who's playing
glob.streams.broadcast(match.playingStreamName, serverPackets.matchFrames(slotID, packetData))