models

package
v1.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountSessions

type AccountSessions struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	AccountID primitive.ObjectID `json:"accountId" bson:"accountId"`
	UserID    primitive.ObjectID `json:"userId" bson:"userId"`
	Expiry    time.Time          `json:"expiry" bson:"expiry"`
}

type AccountState

type AccountState struct {
	Inactive       bool      `json:"inactive" bson:"inactive"`
	InactivityDate time.Time `json:"inactivityDate" bson:"inactivityDate"`
}

type Accounts

type Accounts struct {
	ID          primitive.ObjectID `json:"_id" bson:"_id"`
	AccountName string             `json:"accountName" bson:"accountName"`

	Sessions       primitive.A       `json:"-" bson:"sessions" mson:"collection=accountsessions"`
	SessionObjects []AccountSessions `json:"sessions" bson:"-"`

	Users       primitive.A `json:"-" bson:"users" mson:"collection=users"`
	UserObjects []Users     `json:"users" bson:"-"`

	Agents       primitive.A `json:"-" bson:"agents" mson:"collection=agents"`
	AgentObjects []Agents    `json:"agents" bson:"-"`

	State AccountState `json:"state" bson:"state"`

	CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}

func (*Accounts) PopulateAgents

func (obj *Accounts) PopulateAgents() error

func (*Accounts) PopulateSessions

func (obj *Accounts) PopulateSessions() error

func (*Accounts) PopulateUsers

func (obj *Accounts) PopulateUsers() error

type AgentConfig

type AgentConfig struct {
	Version          string  `json:"version" bson:"version"`
	Port             int     `json:"port" bson:"port"`
	Memory           int64   `json:"memory" bson:"memory"`
	IP               string  `json:"ip" bson:"ip"`
	BackupKeepAmount int     `json:"backupKeepAmount" bson:"backupKeepAmount"`
	BackupInterval   float32 `json:"backupInterval" bson:"backupInterval"`
}

type AgentMapData

type AgentMapData struct {
	Players   []AgentMapDataPlayer   `json:"players" bson:"players"`
	Buildings []AgentMapDataBuilding `json:"buildings" bson:"buildings"`
}

type AgentMapDataBuilding

type AgentMapDataBuilding struct {
	Type     string   `json:"type" bson:"type"`
	Location Vector3F `json:"location" bson:"location"`
	Rotation float32  `json:"rotation" bson:"rotation"`
}

type AgentMapDataPlayer

type AgentMapDataPlayer struct {
	Username string   `json:"username" bson:"username"`
	Location Vector3F `json:"location" bson:"location"`
}

type AgentServerConfig

type AgentServerConfig struct {
	UpdateOnStart bool   `json:"updateOnStart" bson:"updateOnStart"`
	Branch        string `json:"branch" bson:"branch"`
	WorkerThreads int    `json:"workerThreads" bson:"workerThreads"`

	AutoRestart bool `json:"autoRestart" bson:"autoRestart"`

	// Settings for Server Ini files
	MaxPlayers            int  `json:"maxPlayers" bson:"maxPlayers"`
	AutoPause             bool `json:"autoPause" bson:"autoPause"`
	AutoSaveOnDisconnect  bool `json:"autoSaveOnDisconnect" bson:"autoSaveOnDisconnect"`
	AutoSaveInterval      int  `json:"autoSaveInterval" bson:"autoSaveInterval"`
	DisableSeasonalEvents bool `json:"disableSeasonalEvents" bson:"disableSeasonalEvents"`
}

type AgentStatus

type AgentStatus struct {
	Online    bool `json:"online" bson:"online"`
	Running   bool `json:"running" bson:"running"`
	Installed bool `json:"installed" bson:"installed"`

	CPU float64 `json:"cpu" bson:"cpu"`
	RAM float64 `json:"ram" bson:"ram"`
}

type Agents

type Agents struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	AgentName string             `json:"agentName" bson:"agentName"`
	APIKey    string             `json:"apiKey" bson:"apiKey"`
	Status    AgentStatus        `json:"status" bson:"status"`

	Config       AgentConfig       `json:"config" bson:"config"`
	ServerConfig AgentServerConfig `json:"serverConfig" bson:"serverConfig"`

	MapData AgentMapData `json:"mapData" bson:"mapData"`

	CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}

func NewAgent

func NewAgent(agentName string, port int, memory int64) Agents

type User2FAState

type User2FAState struct {
	TwoFASetup  bool   `json:"twoFASetup" bson:"twoFASetup"`
	TwoFASecret string `json:"-" bson:"twoFASecret"`
}

type Users

type Users struct {
	ID       primitive.ObjectID `json:"_id" bson:"_id"`
	Email    string             `json:"email" bson:"email"`
	Password string             `json:"-" bson:"password"`

	IsAccountAdmin bool `json:"isAccountAdmin" bson:"isAccountAdmin"`
	Active         bool `json:"active" bson:"active"`

	TwoFAState User2FAState `json:"twoFAState" bson:"twoFAState"`

	ProfileImageURL string `json:"profileImageUrl" bson:"profileImageUrl"`

	CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}

type Vector3F

type Vector3F struct {
	X float32 `json:"x" bson:"x"`
	Y float32 `json:"y" bson:"y"`
	Z float32 `json:"z" bson:"z"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL