Skip to content

Commit

Permalink
rm two more from gsihandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Geczy committed Sep 15, 2023
1 parent cb9c374 commit 25ecfe8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions packages/dota/src/dota/GSIHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ export class GSIHandler {

// Server could reboot and lose these in memory
// But that's okay they will get reset based on current match state

blockCache: string | null = null
playingBetMatchId: string | undefined | null = null
playingTeam: 'radiant' | 'dire' | 'spectator' | undefined | null = null
events: DotaEvent[] = []
bountyHeroNames: string[] = []
noTpChatter: {
Expand Down
2 changes: 1 addition & 1 deletion packages/dota/src/dota/events/gsi-events/newdata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const steamDelayDataLookupMap = new Map()
async function saveMatchData(client: SocketClient) {
// This now waits for the bet to complete before checking match data
// Since match data is delayed it will run far fewer than before, when checking actual match id of an ingame match
// the playingBetMatchId is saved when the hero is selected
// the matchid is saved when the hero is selected
const matchId = await redisClient.client.get(`${client.token}:matchId`)
if (!Number(matchId)) return

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Only call to update our local players variable with hero ids

import { GSIHandler } from '../../GSIHandler.js'
import { GSIHandler, redisClient } from '../../GSIHandler'
import eventHandler from '../EventHandler.js'

eventHandler.registerEvent(`saveHeroesForMatchId`, {
handler: async (dotaClient: GSIHandler, { matchId }: { matchId: string }) => {
if (dotaClient.playingBetMatchId && dotaClient.playingBetMatchId === matchId) {
const playingMatchId = await redisClient.client.get(`${dotaClient.getToken()}:matchId`)
if (playingMatchId && playingMatchId === matchId) {
await dotaClient.emitNotablePlayers()
}
},
Expand Down

0 comments on commit 25ecfe8

Please sign in to comment.