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

@ -29,20 +29,16 @@ export default class ToggleFogCommand {
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
}
// 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
}
await WeatherManager.toggleFog()
callback(true)
} catch (error: any) {
gameLogger.error('command error', error.message)
callback(false)