1
0
forked from noxious/server

#140 : Individual log files

This commit is contained in:
2024-09-21 15:39:50 +02:00
parent 90ac7728d9
commit 798bfac643
24 changed files with 136 additions and 135 deletions

View File

@ -1,11 +1,9 @@
import { Server } from 'socket.io'
import { ExtendedCharacter, TSocket } from '../../../utilities/types'
import { TSocket } from '../../../utilities/types'
import { getArgs, isCommand } from '../../../utilities/chat'
import CharacterRepository from '../../../repositories/characterRepository'
import ZoneRepository from '../../../repositories/zoneRepository'
import CharacterManager from '../../../managers/characterManager'
import logger from '../../../utilities/logger'
import prisma from '../../../utilities/prisma'
import { gameMasterLogger } from '../../../utilities/logger'
type TypePayload = {
message: string
@ -76,11 +74,11 @@ export default class TeleportCommandEvent {
})
this.socket.emit('notification', { title: 'Server message', message: `You have been teleported to ${zone.name}` })
logger.info('teleport', `Character ${character.id} teleported to zone ${zone.id}`)
gameMasterLogger.info('teleport', `Character ${character.id} teleported to zone ${zone.id}`)
callback(true)
} catch (error: any) {
logger.error(`Error in teleport command: ${error.message}`)
gameMasterLogger.error(`Error in teleport command: ${error.message}`)
this.socket.emit('notification', { title: 'Server message', message: 'An error occurred while teleporting' })
}
}