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