1
0
forked from noxious/server

Attempt to fix performance :(((

This commit is contained in:
2025-01-05 07:22:23 +01:00
parent d7982493e1
commit cc1dbe5179
7 changed files with 31 additions and 35 deletions

View File

@ -32,7 +32,6 @@ interface IPayload {
}
export default class MapUpdateEvent extends BaseEvent {
private readonly populateOptions = ['mapEventTiles', 'placedMapObjects', 'mapEffects'];
public listen(): void {
this.socket.on('gm:map:update', this.handleEvent.bind(this))
}
@ -57,8 +56,7 @@ export default class MapUpdateEvent extends BaseEvent {
return callback(null)
}
// @ts-ignore
await mapRepository.getEntityManager().populate(map, this.populateOptions)
await mapRepository.getEntityManager().populate(map, mapRepository.POPULATE_MAP_EDITOR as any)
// Validation logic remains the same
if (data.tiles.length > data.height) {
@ -122,9 +120,7 @@ export default class MapUpdateEvent extends BaseEvent {
// Reload map from database to get fresh data
map = await mapRepository.getById(data.mapId)
// @ts-ignore
await mapRepository.getEntityManager().populate(map!, this.populateOptions)
await mapRepository.getEntityManager().populate(map!, mapRepository.POPULATE_MAP_EDITOR as any)
if (!map) {
this.logger.info(`User ${character!.getId()} tried to update map ${data.mapId} but it does not exist after update.`)