[Enhance] Link Play log & video download

- Add support for downloading `video_720.mp4` & `video_1080.mp4`
- More detailed log for Link Play #135
This commit is contained in:
Lost-MSth
2023-10-23 22:21:49 +08:00
parent 1f389e4073
commit 04010d9c33
5 changed files with 43 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
import logging
import time
from .udp_class import Room, bi
@@ -44,6 +45,8 @@ class CommandParser:
for i in self.room.players:
if i.player_id == player_id and i.online == 1:
self.room.host_id = player_id
logging.info(
f'Player `{i.name}` becomes the host of room `{self.room.room_code}`')
self.s.random_code = self.command[16:24]
self.room.command_queue.append(self.s.command_10())
@@ -189,6 +192,8 @@ class CommandParser:
# 将换房主时间提前到此刻
self.room.make_round()
logging.info(f'Room `{self.room.room_code}` starts playing')
if self.room.state in (4, 5, 6):
timestamp = round(time.time() * 1000)
self.room.countdown -= timestamp - self.room.timestamp