More map editor work
This commit is contained in:
parent
db7121a4fa
commit
46cfb61cf5
@ -17,7 +17,7 @@ export default class MapListEvent extends BaseEvent {
|
||||
|
||||
const mapRepository = new MapRepository()
|
||||
const maps = await mapRepository.getAll()
|
||||
|
||||
|
||||
return callback(maps)
|
||||
} catch (error: any) {
|
||||
this.logger.error('gm:map:list error', error.message)
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { BaseEvent } from '#application/base/baseEvent'
|
||||
import Database from '#application/database'
|
||||
import { UUID } from '#application/types'
|
||||
import { Map } from '#entities/map'
|
||||
import MapRepository from '#repositories/mapRepository'
|
||||
@ -24,15 +23,16 @@ export default class MapRequestEvent extends BaseEvent {
|
||||
return callback(null)
|
||||
}
|
||||
|
||||
const map = await MapRepository.getById(data.mapId)
|
||||
const mapRepository = new MapRepository()
|
||||
const map = await mapRepository.getById(data.mapId)
|
||||
|
||||
if (!map) {
|
||||
this.logger.info(`User ${(await this.getCharacter())!.getId()} tried to request map ${data.mapId} but it does not exist.`)
|
||||
return callback(null)
|
||||
}
|
||||
|
||||
console.log(map)
|
||||
// await Database.getEntityManager().populate(map, ['mapEventTiles', 'placedMapObjects'])
|
||||
// Populate map with mapEventTiles and placedMapObjects
|
||||
await mapRepository.getEntityManager().populate(map, ['mapEventTiles', 'placedMapObjects'])
|
||||
|
||||
return callback(map)
|
||||
} catch (error: any) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user