Skip to content

Commit

Permalink
rename transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen3H committed Jul 27, 2024
1 parent bd1b4ba commit acdc54f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aurora/slashcommands/townless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default {
`${p.name} (Seen ${(diff / 1000).toFixed(0)}s ago)`
}).join('\n').match(/(?:^.*$\n?){1,15}/mg)

console.log(townless.map(p => `${p.name} - ${p.transitions} transitions.`))
console.log(townless.map(p => `${p.name} - vanished ${p.timesVanished} times. Currently: ${p.online ? "Online" : "Offline"}`))

return send(interaction, allData, townless)
}, data: new SlashCommandBuilder()
Expand Down
2 changes: 1 addition & 1 deletion bot/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export interface V3Player extends Entity {
}

export interface SeenPlayer extends SquaremapOnlinePlayer {
transitions: number
timesVanished: number
online: boolean
timestamp: number
}
Expand Down
6 changes: 3 additions & 3 deletions bot/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ async function updateLastSeen() {
for (const op of ops) {
const seen = lastSeenPlayers.get(op.name)

if (!op['transitions']) op['transitions'] = 0
if (!seen?.online) op['transitions']++
if (!op['timesVanished']) op['timesVanished'] = 0
if (seen && !seen.online) op['timesVanished']++

op['timestamp'] = now
op['timesVanished'] = now

lastSeenPlayers.set(op.name, op as SeenPlayer)
}
Expand Down

0 comments on commit acdc54f

Please sign in to comment.