1
0
forked from noxious/server

Map event tile improvements

This commit is contained in:
2025-01-05 06:22:22 +01:00
parent 57b21f1499
commit d7982493e1
23 changed files with 198 additions and 115 deletions

View File

@ -1,6 +1,6 @@
import { Server } from 'socket.io'
import { TSocket } from '#application/types'
import { TSocket, UUID } from '#application/types'
import { Character } from '#entities/character'
import MapManager from '#managers/mapManager'
import SocketManager from '#managers/socketManager'
@ -15,11 +15,15 @@ class MapCharacter {
this.character = character
}
public getCharacter(): Character {
return this.character
}
public async savePosition() {
await this.character.setPositionX(this.character.positionX).setPositionY(this.character.positionY).setRotation(this.character.rotation).setMap(this.character.map).save()
}
public async teleport(mapId: number, targetX: number, targetY: number): Promise<void> {
public async teleport(mapId: UUID, targetX: number, targetY: number): Promise<void> {
await TeleportService.teleportCharacter(this.character.id, {
targetMapId: mapId,
targetX,