Skip to content

Commit

Permalink
remove payload introspection
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilNarayana committed May 12, 2021
1 parent b65c440 commit 0083e39
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions app/domain/SpectateManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,35 +83,15 @@ export class SpectateManager {
break;
case 'end_game':
// End the current game if it's not already ended
// log.info("[Spectate] Game end explicit");
this.slpFileWriter.endGame();
this.gameStarted = false;
break;
case 'game_event':
const payloadStart = event.payload.substring(0, 4);
const payloadStartBuf = Buffer.from(payloadStart, 'base64');
const command = payloadStartBuf[0];

// this.debouncedGameDataLog(event.cursor, command);

if (command === 0x35) {
this.gameStarted = true;
// log.info("[Spectate] Game start");
}

// Only forward data to the file writer when it's an active game
if (this.gameStarted) {
const buf = Buffer.from(event.payload, 'base64');
this.slpFileWriter.handleData(buf);
}

if (command === 0x39) {
// End the current game if it's not already ended
// log.info("[Spectate] Game end 0x39");
this.slpFileWriter.endGame();
this.gameStarted = false;
}

break;
default:
log.error(`[Spectate] Event type ${event.type} not supported`);
Expand Down

0 comments on commit 0083e39

Please sign in to comment.