Added logic that allows socket events to exist in sub directories, moved said events for better DX, added logics for tile management (upload & read), started working on (zone) object logics too
This commit is contained in:
@ -19,6 +19,26 @@ datasource db {
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model Objects {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
origin_x Int @default(0)
|
||||
origin_y Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
ZoneObject ZoneObject[]
|
||||
}
|
||||
|
||||
model Item {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
description String
|
||||
stackable Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
characters CharacterItem[]
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
@ -27,42 +47,53 @@ model User {
|
||||
}
|
||||
|
||||
model Character {
|
||||
id Int @id @default(autoincrement())
|
||||
id Int @id @default(autoincrement())
|
||||
userId Int
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
name String @unique
|
||||
hitpoints Int @default(100)
|
||||
mana Int @default(100)
|
||||
level Int @default(1)
|
||||
experience Int @default(0)
|
||||
role String @default("player")
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
name String @unique
|
||||
hitpoints Int @default(100)
|
||||
mana Int @default(100)
|
||||
level Int @default(1)
|
||||
experience Int @default(0)
|
||||
role String @default("player")
|
||||
position_x Int
|
||||
position_y Int
|
||||
rotation Int
|
||||
zoneId Int
|
||||
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
|
||||
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
|
||||
chats Chat[]
|
||||
items CharacterItem[]
|
||||
}
|
||||
|
||||
model CharacterItem {
|
||||
id Int @id @default(autoincrement())
|
||||
characterId Int
|
||||
character Character @relation(fields: [characterId], references: [id], onDelete: Cascade)
|
||||
itemId String
|
||||
item Item @relation(fields: [itemId], references: [id], onDelete: Cascade)
|
||||
quantity Int
|
||||
}
|
||||
|
||||
model Zone {
|
||||
id Int @id @default(autoincrement())
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
width Int
|
||||
height Int
|
||||
tiles Json
|
||||
walls Json
|
||||
decorations ZoneDecoration[]
|
||||
zoneObjects ZoneObject[]
|
||||
characters Character[]
|
||||
chats Chat[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model ZoneDecoration {
|
||||
id Int @id @default(autoincrement())
|
||||
model ZoneObject {
|
||||
id Int @id @default(autoincrement())
|
||||
zoneId Int
|
||||
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
|
||||
type Int
|
||||
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
|
||||
objectId String
|
||||
object Objects @relation(fields: [objectId], references: [id])
|
||||
position_x Int
|
||||
position_y Int
|
||||
}
|
||||
|
Reference in New Issue
Block a user