pep.py/events/spectateFramesEvent.py

15 lines
470 B
Python
Raw Normal View History

2016-05-18 17:12:46 +00:00
from objects import glob
from constants import serverPackets
2017-08-12 19:29:24 +00:00
from common.log import logUtils as log
2016-04-19 17:40:59 +00:00
def handle(userToken, packetData):
# get token data
userID = userToken.userID
# Send spectator frames to every spectator
2017-08-12 19:29:24 +00:00
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))
)