forked from noxious/server
Cleanup
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user