add state history

This commit is contained in:
Fran Jurmanović
2025-05-27 20:18:58 +02:00
parent e52894c663
commit 56ef5e1484
12 changed files with 173 additions and 27 deletions

View File

@@ -31,11 +31,6 @@ type PlayerState struct {
IsConnected bool
}
type AccServerInstance struct {
Model *Server
State *ServerState
}
type State struct {
Session string `json:"session"`
SessionStart time.Time `json:"sessionStart"`
@@ -53,4 +48,12 @@ type ServerState struct {
MaxConnections int `json:"maxConnections"`
// Players map[int]*PlayerState
// etc.
}
type StateHistory struct {
ID uint `gorm:"primaryKey" json:"id"`
ServerID uint `json:"serverId" gorm:"not null"`
Session string `json:"session"`
PlayerCount int `json:"playerCount"`
DateCreated time.Time `json:"dateCreated"`
}