mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-07 09:53:13 +00:00
Refactor: Comprehensive Security and Architecture Audit (Self-Audit Fixes)
This commit is contained in:
@@ -101,13 +101,17 @@
|
||||
} else if (action === 'seek') {
|
||||
tryMediaAction('seek', payload);
|
||||
} else if (action === 'force_sync_prepare') {
|
||||
isProcessingCommand = true;
|
||||
const video = findVideo();
|
||||
if (video) {
|
||||
video.pause();
|
||||
video.currentTime = payload.targetTime;
|
||||
pollSeekReady(payload.targetTime).then(() => {
|
||||
chrome.runtime.sendMessage({ type: 'FORCE_SYNC_ACK' });
|
||||
setTimeout(() => { isProcessingCommand = false; }, 1000);
|
||||
});
|
||||
} else {
|
||||
isProcessingCommand = false;
|
||||
}
|
||||
} else if (action === 'force_sync_execute') {
|
||||
tryMediaAction('play');
|
||||
|
||||
+3
-2
@@ -137,8 +137,9 @@ io.on('connection', (socket) => {
|
||||
|
||||
log('CONN', `New connection: ${socket.id} from ${clientIp}`);
|
||||
|
||||
socket.on(EVENTS.JOIN_ROOM, async ({ roomId, password, peerId, protocolVersion }) => {
|
||||
if (typeof roomId !== 'string') return;
|
||||
socket.on(EVENTS.JOIN_ROOM, async (payload) => {
|
||||
if (!payload || typeof payload.roomId !== 'string') return;
|
||||
const { roomId, password, peerId, protocolVersion } = payload;
|
||||
try {
|
||||
// Protocol check
|
||||
if (protocolVersion !== '1.0.0') {
|
||||
|
||||
Reference in New Issue
Block a user