Finished sprite CRUD in asset manager, removed unused DB field, renamed files for consistency

This commit is contained in:
2024-07-23 00:16:25 +02:00
parent bea76e9ace
commit 7531385912
16 changed files with 21 additions and 2 deletions

View File

@ -7,6 +7,10 @@ type Payload = {
name: string
origin_x: number
origin_y: number
frameSpeed: number
frameWidth: number
frameHeight: number
isLooping: boolean
}
/**
@ -28,7 +32,11 @@ export default function (socket: TSocket, io: Server) {
data: {
name: data.name,
origin_x: data.origin_x,
origin_y: data.origin_y
origin_y: data.origin_y,
frameSpeed: data.frameSpeed,
frameWidth: data.frameWidth,
frameHeight: data.frameHeight,
isLooping: data.isLooping
}
})

View File

@ -10,6 +10,7 @@ interface IPayload {
width: number
height: number
tiles: string[][]
pvp: boolean
zoneEventTiles: ZoneEventTile[]
zoneObjects: ZoneObject[]
}
@ -41,6 +42,8 @@ export default function (socket: TSocket, io: Server) {
return
}
console.log(data);
await prisma.zone.update({
where: {
id: data.zoneId
@ -50,6 +53,7 @@ export default function (socket: TSocket, io: Server) {
width: data.width,
height: data.height,
tiles: data.tiles,
pvp: data.pvp,
zoneEventTiles: {
deleteMany: {
zoneId: data.zoneId // Ensure only event tiles related to the zone are deleted