pep.py/events/spectateFramesEvent.py
Giuseppe Guerra at an airport 34e7a332e6 Add spect lock back
2017-08-12 21:29:27 +02:00

15 lines
470 B
Python

from objects import glob
from constants import serverPackets
from common.log import logUtils as log
def handle(userToken, packetData):
# get token data
userID = userToken.userID
# Send spectator frames to every spectator
streamName = "spect/{}".format(userID)
glob.streams.broadcast(streamName, serverPackets.spectatorFrames(packetData[7:]))
log.debug("Broadcasting {}'s frames to {} clients".format(
userID,
len(glob.streams.streams[streamName].clients))
)