Added code comment for #246

This commit is contained in:
2024-11-15 01:58:05 +01:00
parent fda8cc532e
commit f7072acdd2
2 changed files with 20 additions and 19 deletions

View File

@ -39,10 +39,10 @@ export default class ZoneUpdateEvent {
) {}
public listen(): void {
this.socket.on('gm:zone_editor:zone:update', this.handleZoneUpdate.bind(this))
this.socket.on('gm:zone_editor:zone:update', this.handleEvent.bind(this))
}
private async handleZoneUpdate(data: IPayload, callback: (response: Zone | null) => void): Promise<void> {
private async handleEvent(data: IPayload, callback: (response: Zone | null) => void): Promise<void> {
try {
const character = await CharacterRepository.getById(this.socket.characterId as number)
if (!character) {
@ -146,6 +146,9 @@ export default class ZoneUpdateEvent {
callback(zone)
/**
* @TODO #246: Reload zone for players who are currently in the zone
*/
zoneManager.unloadZone(data.zoneId)
await zoneManager.loadZone(zone)
} catch (error: any) {