1
0
forked from noxious/server

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

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

View File

@ -0,0 +1,8 @@
/*
Warnings:
- You are about to drop the column `isAnimated` on the `Sprite` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE `Sprite` DROP COLUMN `isAnimated`;

View File

@ -27,7 +27,6 @@ model Sprite {
frameSpeed Int @default(0)
frameWidth Int @default(0)
frameHeight Int @default(0)
isAnimated Boolean @default(false)
isLooping Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

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