1
0
forked from noxious/server

npm update, removed player store and merged it with socket store, worked on character creation & selection (partially works)

This commit is contained in:
2024-05-31 01:15:54 +02:00
parent d3e1bf0047
commit b19625014a
7 changed files with 97 additions and 30 deletions

View File

@ -20,29 +20,46 @@ datasource db {
}
model User {
id Int @id @default(autoincrement())
username String @unique
password String
id Int @id @default(autoincrement())
username String @unique
password String
characters Character[]
}
model Character {
id Int @id @default(autoincrement())
userId Int
user User @relation(fields: [userId], references: [id])
name String
id Int @id @default(autoincrement())
userId Int
user User @relation(fields: [userId], references: [id])
name String
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])
rotation Int
zoneId Int
zone Zone @relation(fields: [zoneId], references: [id])
chats Chat[]
}
model Zone {
id Int @id @default(autoincrement())
name String
width Int
height Int
tiles Json
characters Character[]
}
id Int @id @default(autoincrement())
name String
width Int
height Int
tiles Json
characters Character[]
chats Chat[]
}
model Chat {
id Int @id @default(autoincrement())
characterId Int
character Character @relation(fields: [characterId], references: [id])
zoneId Int
zone Zone @relation(fields: [zoneId], references: [id])
message String
createdAt DateTime
}