Skip to content

Commit

Permalink
chore(clean up): broadcast and spectate code
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilNarayana committed May 21, 2021
1 parent 3a1b461 commit befbaf1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
24 changes: 0 additions & 24 deletions app/domain/BroadcastManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ export class BroadcastManager {
// Log the error messages we get from Dolphin
log.error("[Broadcast] Dolphin connection error\n", err);
});

this._debouncedGameDataLog = _.debounce((cursor, cmd) => {
// I can't figure out how to differentiate when an invocation is triggered by a leading vs
// falling edge, would be useful to log that
log.info(`[Broadcast] Game events edge. ${cursor} 0x${cmd ? cmd.toString(16) : "??"}`);
}, 1000, {
leading: true,
trailing: true,
});
}

/**
Expand Down Expand Up @@ -321,16 +312,6 @@ export class BroadcastManager {
case "start_game":
case "game_event":
case "end_game":
// const payload = event.payload || "";
// const payloadStart = payload.substring(0, 4);
// const buf = Buffer.from(payloadStart, 'base64');
// const command = buf[0];

if (event.type === "game_event" && !event.payload) {
// Don't send empty payload game_event
break;
}

const message = {
type: 'send-event',
broadcastId: this.broadcastId,
Expand All @@ -344,12 +325,7 @@ export class BroadcastManager {
this.wsConnection.sendUTF(JSON.stringify(message), err => {
if (err) {
log.error("[Broadcast] WS send error encountered\n", err);
// return;
}

// if (event.type === "game_event") {
// this._debouncedGameDataLog(event.cursor, command);
// }
});
break;
default:
Expand Down
10 changes: 0 additions & 10 deletions app/domain/SpectateManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import log from 'electron-log';
import { client as WebSocketClient } from 'websocket';
import * as firebase from 'firebase';
import _ from 'lodash';
import fs from 'fs-extra';
import path from 'path';

Expand Down Expand Up @@ -62,15 +61,6 @@ export class SpectateManager {
this.slpFileWriter.on("new-file", (curFilePath) => {
this.dolphinManager.playFile(curFilePath, false);
});

this.debouncedGameDataLog = _.debounce((cursor, cmd) => {
// I can't figure out how to differentiate when an invocation is triggered by a leading vs
// falling edge, would be useful to log that
log.info(`[Spectate] Game events edge. ${cursor} 0x${cmd ? cmd.toString(16) : "??"}`);
}, 1000, {
leading: true,
trailing: true,
});
}

handleEvents(obj) {
Expand Down

0 comments on commit befbaf1

Please sign in to comment.