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,11 +1,9 @@
import { Server } from 'socket.io'
import type { TSocket } from '@/application/types'
import { SocketEvent } from '@/application/enums'
import Logger, { LoggerType } from '@/application/logger'
import type { TSocket } from '@/application/types'
import { Character } from '@/entities/character'
import CharacterRepository from '@/repositories/characterRepository'
import { Server } from 'socket.io'
export abstract class BaseEvent {
protected readonly logger = Logger.type(LoggerType.GAME)
@@ -31,7 +29,7 @@ export abstract class BaseEvent {
protected async getCharacter(): Promise<Character | null> {
const characterRepository = new CharacterRepository()
return characterRepository.getById(this.socket.characterId!)
return characterRepository.getById(this.socket.characterId)
}
protected async isCharacterGM(): Promise<boolean> {