1
0
forked from noxious/server

Moved models to simplify and improve prisma schemas , added logic to update characterTypes

This commit is contained in:
2024-11-17 17:53:25 +01:00
parent 27f8bc8784
commit ec3bf0f51e
14 changed files with 80 additions and 103 deletions

View File

@ -28,26 +28,23 @@ export default class AlertCommandEvent {
const character = await CharacterRepository.getByUserAndId(this.socket.userId!, this.socket.characterId!)
if (!character) {
gameLogger.error('chat:alert_command error', 'Character not found')
callback(false)
return
return callback(false)
}
// Check if the user is the GM
if (character.role !== 'gm') {
gameLogger.info(`User ${character.id} tried to set time but is not a game master.`)
callback(false)
return
return callback(false)
}
const args = getArgs('alert', data.message)
if (!args) {
callback(false)
return
return callback(false)
}
this.io.emit('notification', { title: 'Message from GM', message: args.join(' ') })
callback(true)
return callback(true)
} catch (error: any) {
gameLogger.error('chat:alert_command error', error.message)
callback(false)