1
0
forked from noxious/server

improved zone manager

This commit is contained in:
2024-05-11 18:50:51 +02:00
parent a2f21229d8
commit ebfbae864b
8 changed files with 77 additions and 202 deletions

View File

@ -23,12 +23,19 @@ model User {
id Int @id @default(autoincrement())
username String @unique
password String
position_x Int?
position_y Int?
rotation Int?
zoneId Int? @unique
zone Zone? @relation(fields: [zoneId], references: [id])
chatlogs Chatlogs[]
characters Character[]
}
model Character {
id Int @id @default(autoincrement())
name String
position_x Int
position_y Int
rotation Int
userId Int
user User @relation(fields: [userId], references: [id])
zoneId Int
zone Zone @relation(fields: [zoneId], references: [id])
}
model Zone {
@ -37,15 +44,5 @@ model Zone {
width Int
height Int
tiles Json
users User[] // One-to-many relation: A map can have multiple users
chatlogs Chatlogs[]
}
model Chatlogs {
id Int @id @default(autoincrement())
userId Int
message String
zoneId Int
zone Zone @relation(fields: [zoneId], references: [id])
user User @relation(fields: [userId], references: [id])
characters Character[]
}