forked from noxious/server
Removed func.
This commit is contained in:
parent
1839bd9a22
commit
550b961505
@ -36,7 +36,7 @@ export default class CharacterConnectEvent {
|
||||
const characterService = new CharacterService()
|
||||
await characterService.updateHair(characterId, characterHairId ?? null)
|
||||
|
||||
const character = await this.connectCharacter(characterId)
|
||||
const character = await CharacterRepository.getByUserAndId(this.socket.userId!, characterId)
|
||||
if (!character) {
|
||||
this.emitError('Character not found or does not belong to this user')
|
||||
return
|
||||
@ -54,10 +54,6 @@ export default class CharacterConnectEvent {
|
||||
return characters?.some((char) => ZoneManager.getCharacter(char.id)) ?? false
|
||||
}
|
||||
|
||||
private async connectCharacter(characterId: number) {
|
||||
return CharacterRepository.getByUserAndId(this.socket.userId!, characterId)
|
||||
}
|
||||
|
||||
private emitError(message: string): void {
|
||||
this.socket.emit('notification', { title: 'Server message', message })
|
||||
gameLogger.error('character:connect error', `Player ${this.socket.userId}: ${message}`)
|
||||
|
Loading…
x
Reference in New Issue
Block a user