1
0
forked from noxious/server
This commit is contained in:
2025-02-12 00:50:51 +01:00
parent c47339dfcd
commit e40a56825a
121 changed files with 468 additions and 3305 deletions

View File

@ -1,7 +1,6 @@
import type { UUID } from '@/application/types'
import { BaseEvent } from '@/application/base/baseEvent'
import { SocketEvent } from '@/application/enums'
import type { UUID } from '@/application/types'
import MapManager from '@/managers/mapManager'
import CharacterHairRepository from '@/repositories/characterHairRepository'
import CharacterRepository from '@/repositories/characterRepository'
@ -27,7 +26,7 @@ export default class CharacterConnectEvent extends BaseEvent {
return
}
const character = await this.characterRepository.getByUserAndId(this.socket.userId!, data.characterId)
const character = await this.characterRepository.getByUserAndId(this.socket.userId, data.characterId)
if (!character) {
this.emitError('Character not found or does not belong to this user')
@ -63,7 +62,7 @@ export default class CharacterConnectEvent extends BaseEvent {
}
private async checkForActiveCharacters(): Promise<boolean> {
const characters = await this.characterRepository.getByUserId(this.socket.userId!)
const characters = await this.characterRepository.getByUserId(this.socket.userId)
return characters?.some((char) => MapManager.getCharacterById(char.id)) ?? false
}
}