Skip to content

Commit

Permalink
Feat/api (#16)
Browse files Browse the repository at this point in the history
* feat: perf for scoreboard

* feat: improve perf

* feat: improve perf

* feat: improve socket time

* feat: scoreboard weight

* fix: scoreboard event when start game

* feat: db logging

* feat: remove healthz logging

* feat: remove pg layer history

* feat: scoreboard log

* fix: all rooms broadvaster

* fix: subClient connect

* feat: weight score

* feat: weight score clamp

* feat: weight score optimizer

* fix: async order

* perf: order async
  • Loading branch information
PatrickChoDev authored Mar 30, 2024
1 parent 8e39be8 commit 1515bea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/server/src/controller/player.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ export class PlayerController {
async onConnection(socket: Socket) {
this.logger.info(`New connection: ${socket.id}`)

await this.authenticateSocket(socket)
await this.playerService.getGameState().then((game) => {
socket.emit('state', game.id)
socket.emit('events', game.status)
this.authenticateSocket(socket).then(() => {
this.playerService.getGameState().then((game) => {
socket.emit('state', game.id)
socket.emit('events', game.status)
})
})

socket.on('subscribe', (m, cb) => {
Expand Down

0 comments on commit 1515bea

Please sign in to comment.