db

package
v0.0.0-...-80cf271 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddToPlayerInventoryParams

type AddToPlayerInventoryParams struct {
	PlayerID        int64         `json:"player_id"`
	ResourceType    int64         `json:"resource_type"`
	ResourceSubtype sql.NullInt64 `json:"resource_subtype"`
	Quantity        sql.NullInt64 `json:"quantity"`
}

type CheckNodePositionParams

type CheckNodePositionParams struct {
	ChunkX int64 `json:"chunk_x"`
	ChunkZ int64 `json:"chunk_z"`
	LocalX int64 `json:"local_x"`
	LocalZ int64 `json:"local_z"`
}

type Chunk

type Chunk struct {
	ChunkX       int64        `json:"chunk_x"`
	ChunkZ       int64        `json:"chunk_z"`
	CreatedAt    sql.NullTime `json:"created_at"`
	LastModified sql.NullTime `json:"last_modified"`
}

type CreateChunkParams

type CreateChunkParams struct {
	ChunkX int64 `json:"chunk_x"`
	ChunkZ int64 `json:"chunk_z"`
}

type CreateHarvestLogParams

type CreateHarvestLogParams struct {
	NodeID          int64 `json:"node_id"`
	PlayerID        int64 `json:"player_id"`
	AmountHarvested int64 `json:"amount_harvested"`
	NodeYieldBefore int64 `json:"node_yield_before"`
	NodeYieldAfter  int64 `json:"node_yield_after"`
}

type CreateNodeParams

type CreateNodeParams struct {
	ChunkX           int64         `json:"chunk_x"`
	ChunkZ           int64         `json:"chunk_z"`
	LocalX           int64         `json:"local_x"`
	LocalZ           int64         `json:"local_z"`
	NodeType         int64         `json:"node_type"`
	NodeSubtype      sql.NullInt64 `json:"node_subtype"`
	MaxYield         int64         `json:"max_yield"`
	CurrentYield     int64         `json:"current_yield"`
	RegenerationRate sql.NullInt64 `json:"regeneration_rate"`
	SpawnType        int64         `json:"spawn_type"`
}

type CreatePlayerParams

type CreatePlayerParams struct {
	Username     string         `json:"username"`
	PasswordHash string         `json:"password_hash"`
	Salt         string         `json:"salt"`
	Email        sql.NullString `json:"email"`
}

type CreatePlayerSessionParams

type CreatePlayerSessionParams struct {
	PlayerID     int64          `json:"player_id"`
	SessionToken string         `json:"session_token"`
	IpAddress    sql.NullString `json:"ip_address"`
	UserAgent    sql.NullString `json:"user_agent"`
	ExpiresAt    time.Time      `json:"expires_at"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeactivateNodeParams

type DeactivateNodeParams struct {
	RespawnTimer sql.NullTime `json:"respawn_timer"`
	NodeID       int64        `json:"node_id"`
}

type GetChunkNodeCountParams

type GetChunkNodeCountParams struct {
	ChunkX      int64         `json:"chunk_x"`
	ChunkZ      int64         `json:"chunk_z"`
	NodeType    int64         `json:"node_type"`
	NodeSubtype sql.NullInt64 `json:"node_subtype"`
}

type GetChunkNodesParams

type GetChunkNodesParams struct {
	ChunkX int64 `json:"chunk_x"`
	ChunkZ int64 `json:"chunk_z"`
}

type GetChunkOccupiedPositionsParams

type GetChunkOccupiedPositionsParams struct {
	ChunkX int64 `json:"chunk_x"`
	ChunkZ int64 `json:"chunk_z"`
}

type GetChunkOccupiedPositionsRow

type GetChunkOccupiedPositionsRow struct {
	LocalX int64 `json:"local_x"`
	LocalZ int64 `json:"local_z"`
}

type GetChunkParams

type GetChunkParams struct {
	ChunkX int64 `json:"chunk_x"`
	ChunkZ int64 `json:"chunk_z"`
}

type GetDailyNodeCountParams

type GetDailyNodeCountParams struct {
	ChunkX int64       `json:"chunk_x"`
	ChunkZ int64       `json:"chunk_z"`
	Date   interface{} `json:"date"`
}

type GetNodesToRespawnParams

type GetNodesToRespawnParams struct {
	ChunkX       int64        `json:"chunk_x"`
	ChunkZ       int64        `json:"chunk_z"`
	RespawnTimer sql.NullTime `json:"respawn_timer"`
}

type GetNodesToRespawnRow

type GetNodesToRespawnRow struct {
	NodeID   int64 `json:"node_id"`
	MaxYield int64 `json:"max_yield"`
}

type GetPlayerDailyHarvestParams

type GetPlayerDailyHarvestParams struct {
	PlayerID int64 `json:"player_id"`
	NodeID   int64 `json:"node_id"`
}

type GetPlayerInventoryResourceParams

type GetPlayerInventoryResourceParams struct {
	PlayerID        int64         `json:"player_id"`
	ResourceType    int64         `json:"resource_type"`
	ResourceSubtype sql.NullInt64 `json:"resource_subtype"`
}

type GetPlayersInChunkParams

type GetPlayersInChunkParams struct {
	CurrentChunkX sql.NullInt64 `json:"current_chunk_x"`
	CurrentChunkZ sql.NullInt64 `json:"current_chunk_z"`
}

type GetPlayersWithStatsRow

type GetPlayersWithStatsRow struct {
	PlayerID                int64           `json:"player_id"`
	Username                string          `json:"username"`
	PasswordHash            string          `json:"password_hash"`
	Salt                    string          `json:"salt"`
	Email                   sql.NullString  `json:"email"`
	WorldX                  sql.NullFloat64 `json:"world_x"`
	WorldY                  sql.NullFloat64 `json:"world_y"`
	WorldZ                  sql.NullFloat64 `json:"world_z"`
	CurrentChunkX           sql.NullInt64   `json:"current_chunk_x"`
	CurrentChunkZ           sql.NullInt64   `json:"current_chunk_z"`
	IsOnline                sql.NullInt64   `json:"is_online"`
	LastLogin               sql.NullTime    `json:"last_login"`
	LastLogout              sql.NullTime    `json:"last_logout"`
	CreatedAt               sql.NullTime    `json:"created_at"`
	UpdatedAt               sql.NullTime    `json:"updated_at"`
	TotalResourcesHarvested int64           `json:"total_resources_harvested"`
	TotalHarvestSessions    int64           `json:"total_harvest_sessions"`
	SessionsCount           int64           `json:"sessions_count"`
	TotalPlaytimeMinutes    int64           `json:"total_playtime_minutes"`
}

type GetRandomNodeCountParams

type GetRandomNodeCountParams struct {
	ChunkX int64 `json:"chunk_x"`
	ChunkZ int64 `json:"chunk_z"`
}

type GetRespawnDelayParams

type GetRespawnDelayParams struct {
	NodeType    int64         `json:"node_type"`
	NodeSubtype sql.NullInt64 `json:"node_subtype"`
}

type GetTopPlayersByPlaytimeRow

type GetTopPlayersByPlaytimeRow struct {
	Username             string        `json:"username"`
	TotalPlaytimeMinutes sql.NullInt64 `json:"total_playtime_minutes"`
}

type GetTopPlayersByResourcesRow

type GetTopPlayersByResourcesRow struct {
	Username                string        `json:"username"`
	TotalResourcesHarvested sql.NullInt64 `json:"total_resources_harvested"`
}

type HarvestLog

type HarvestLog struct {
	LogID           int64        `json:"log_id"`
	NodeID          int64        `json:"node_id"`
	PlayerID        int64        `json:"player_id"`
	AmountHarvested int64        `json:"amount_harvested"`
	HarvestedAt     sql.NullTime `json:"harvested_at"`
	NodeYieldBefore int64        `json:"node_yield_before"`
	NodeYieldAfter  int64        `json:"node_yield_after"`
}

type LoggingQueries

type LoggingQueries struct {
	*Queries
}

LoggingQueries wraps the generated Queries struct to add debug logging

func NewLoggingQueries

func NewLoggingQueries(db DBTX) *LoggingQueries

NewLoggingQueries creates a new LoggingQueries instance

func (*LoggingQueries) CheckNodePosition

func (lq *LoggingQueries) CheckNodePosition(ctx context.Context, arg CheckNodePositionParams) (int64, error)

CheckNodePosition with logging

func (*LoggingQueries) CreateChunk

func (lq *LoggingQueries) CreateChunk(ctx context.Context, arg CreateChunkParams) error

CreateChunk with logging

func (*LoggingQueries) CreateHarvestLog

func (lq *LoggingQueries) CreateHarvestLog(ctx context.Context, arg CreateHarvestLogParams) error

CreateHarvestLog with logging

func (*LoggingQueries) CreateNode

func (lq *LoggingQueries) CreateNode(ctx context.Context, arg CreateNodeParams) (int64, error)

CreateNode with logging

func (*LoggingQueries) DeactivateNode

func (lq *LoggingQueries) DeactivateNode(ctx context.Context, arg DeactivateNodeParams) error

DeactivateNode with logging

func (*LoggingQueries) GetChunkNodeCount

func (lq *LoggingQueries) GetChunkNodeCount(ctx context.Context, arg GetChunkNodeCountParams) (int64, error)

GetChunkNodeCount with logging

func (*LoggingQueries) GetChunkNodes

func (lq *LoggingQueries) GetChunkNodes(ctx context.Context, arg GetChunkNodesParams) ([]ResourceNode, error)

GetChunkNodes with logging

func (*LoggingQueries) GetChunkOccupiedPositions

GetChunkOccupiedPositions with logging

func (*LoggingQueries) GetNode

func (lq *LoggingQueries) GetNode(ctx context.Context, nodeID int64) (ResourceNode, error)

GetNode with logging

func (*LoggingQueries) GetNodesToRespawn

func (lq *LoggingQueries) GetNodesToRespawn(ctx context.Context, arg GetNodesToRespawnParams) ([]GetNodesToRespawnRow, error)

GetNodesToRespawn with logging

func (*LoggingQueries) GetPlayerDailyHarvest

func (lq *LoggingQueries) GetPlayerDailyHarvest(ctx context.Context, arg GetPlayerDailyHarvestParams) (int64, error)

GetPlayerDailyHarvest with logging

func (*LoggingQueries) GetRespawnDelay

func (lq *LoggingQueries) GetRespawnDelay(ctx context.Context, arg GetRespawnDelayParams) (sql.NullInt64, error)

GetRespawnDelay with logging

func (*LoggingQueries) GetSpawnTemplates

func (lq *LoggingQueries) GetSpawnTemplates(ctx context.Context) ([]NodeSpawnTemplate, error)

GetSpawnTemplates with logging

func (*LoggingQueries) GetWorldConfig

func (lq *LoggingQueries) GetWorldConfig(ctx context.Context, configKey string) (string, error)

GetWorldConfig with logging

func (*LoggingQueries) ReactivateNode

func (lq *LoggingQueries) ReactivateNode(ctx context.Context, arg ReactivateNodeParams) error

ReactivateNode with logging

func (*LoggingQueries) RegenerateNodeYield

func (lq *LoggingQueries) RegenerateNodeYield(ctx context.Context) error

RegenerateNodeYield with logging

func (*LoggingQueries) SetWorldConfig

func (lq *LoggingQueries) SetWorldConfig(ctx context.Context, arg SetWorldConfigParams) error

SetWorldConfig with logging

func (*LoggingQueries) UpdateNodeYield

func (lq *LoggingQueries) UpdateNodeYield(ctx context.Context, arg UpdateNodeYieldParams) error

UpdateNodeYield with logging

func (*LoggingQueries) WithTx

func (lq *LoggingQueries) WithTx(tx *sql.Tx) *LoggingQueries

WithTx creates a new LoggingQueries with a transaction

type NodeSpawnTemplate

type NodeSpawnTemplate struct {
	TemplateID        int64           `json:"template_id"`
	NodeType          int64           `json:"node_type"`
	NodeSubtype       sql.NullInt64   `json:"node_subtype"`
	SpawnType         int64           `json:"spawn_type"`
	MinYield          int64           `json:"min_yield"`
	MaxYield          int64           `json:"max_yield"`
	RegenerationRate  sql.NullInt64   `json:"regeneration_rate"`
	RespawnDelayHours sql.NullInt64   `json:"respawn_delay_hours"`
	SpawnWeight       sql.NullInt64   `json:"spawn_weight"`
	BiomeRestriction  sql.NullString  `json:"biome_restriction"`
	ClusterSizeMin    sql.NullInt64   `json:"cluster_size_min"`
	ClusterSizeMax    sql.NullInt64   `json:"cluster_size_max"`
	ClusterSpreadMin  sql.NullInt64   `json:"cluster_spread_min"`
	ClusterSpreadMax  sql.NullInt64   `json:"cluster_spread_max"`
	ClustersPerChunk  sql.NullInt64   `json:"clusters_per_chunk"`
	NoiseScale        sql.NullFloat64 `json:"noise_scale"`
	NoiseThreshold    sql.NullFloat64 `json:"noise_threshold"`
	NoiseOctaves      sql.NullInt64   `json:"noise_octaves"`
	NoisePersistence  sql.NullFloat64 `json:"noise_persistence"`
}

type Player

type Player struct {
	PlayerID      int64           `json:"player_id"`
	Username      string          `json:"username"`
	PasswordHash  string          `json:"password_hash"`
	Salt          string          `json:"salt"`
	Email         sql.NullString  `json:"email"`
	WorldX        sql.NullFloat64 `json:"world_x"`
	WorldY        sql.NullFloat64 `json:"world_y"`
	WorldZ        sql.NullFloat64 `json:"world_z"`
	CurrentChunkX sql.NullInt64   `json:"current_chunk_x"`
	CurrentChunkZ sql.NullInt64   `json:"current_chunk_z"`
	IsOnline      sql.NullInt64   `json:"is_online"`
	LastLogin     sql.NullTime    `json:"last_login"`
	LastLogout    sql.NullTime    `json:"last_logout"`
	CreatedAt     sql.NullTime    `json:"created_at"`
	UpdatedAt     sql.NullTime    `json:"updated_at"`
}

type PlayerInventory

type PlayerInventory struct {
	InventoryID     int64         `json:"inventory_id"`
	PlayerID        int64         `json:"player_id"`
	ResourceType    int64         `json:"resource_type"`
	ResourceSubtype sql.NullInt64 `json:"resource_subtype"`
	Quantity        sql.NullInt64 `json:"quantity"`
	FirstObtained   sql.NullTime  `json:"first_obtained"`
	LastUpdated     sql.NullTime  `json:"last_updated"`
}

type PlayerSession

type PlayerSession struct {
	SessionID    int64          `json:"session_id"`
	PlayerID     int64          `json:"player_id"`
	SessionToken string         `json:"session_token"`
	IpAddress    sql.NullString `json:"ip_address"`
	UserAgent    sql.NullString `json:"user_agent"`
	CreatedAt    sql.NullTime   `json:"created_at"`
	ExpiresAt    time.Time      `json:"expires_at"`
	LastActivity sql.NullTime   `json:"last_activity"`
}

type PlayerStat

type PlayerStat struct {
	StatID                  int64         `json:"stat_id"`
	PlayerID                int64         `json:"player_id"`
	TotalResourcesHarvested sql.NullInt64 `json:"total_resources_harvested"`
	TotalHarvestSessions    sql.NullInt64 `json:"total_harvest_sessions"`
	IronOreHarvested        sql.NullInt64 `json:"iron_ore_harvested"`
	GoldOreHarvested        sql.NullInt64 `json:"gold_ore_harvested"`
	WoodHarvested           sql.NullInt64 `json:"wood_harvested"`
	StoneHarvested          sql.NullInt64 `json:"stone_harvested"`
	UniqueNodesDiscovered   sql.NullInt64 `json:"unique_nodes_discovered"`
	TotalNodesHarvested     sql.NullInt64 `json:"total_nodes_harvested"`
	TotalPlaytimeMinutes    sql.NullInt64 `json:"total_playtime_minutes"`
	SessionsCount           sql.NullInt64 `json:"sessions_count"`
	FirstHarvest            sql.NullTime  `json:"first_harvest"`
	LastHarvest             sql.NullTime  `json:"last_harvest"`
	StatsUpdated            sql.NullTime  `json:"stats_updated"`
}

type PlayerValidation

type PlayerValidation struct {
	TableName string `json:"table_name"`
	PlayerID  int64  `json:"player_id"`
	Status    string `json:"status"`
}

type Querier

type Querier interface {
	AddToPlayerInventory(ctx context.Context, arg AddToPlayerInventoryParams) error
	CheckNodePosition(ctx context.Context, arg CheckNodePositionParams) (int64, error)
	ClearPlayerInventory(ctx context.Context, playerID int64) error
	CreateChunk(ctx context.Context, arg CreateChunkParams) error
	CreateHarvestLog(ctx context.Context, arg CreateHarvestLogParams) error
	CreateNode(ctx context.Context, arg CreateNodeParams) (int64, error)
	CreatePlayer(ctx context.Context, arg CreatePlayerParams) (Player, error)
	CreatePlayerSession(ctx context.Context, arg CreatePlayerSessionParams) (PlayerSession, error)
	CreatePlayerStats(ctx context.Context, playerID int64) (PlayerStat, error)
	DeactivateNode(ctx context.Context, arg DeactivateNodeParams) error
	DeleteAllPlayerSessions(ctx context.Context, playerID int64) error
	DeleteExpiredSessions(ctx context.Context) error
	DeletePlayer(ctx context.Context, playerID int64) error
	DeletePlayerSession(ctx context.Context, sessionToken string) error
	GetChunk(ctx context.Context, arg GetChunkParams) (Chunk, error)
	GetChunkNodeCount(ctx context.Context, arg GetChunkNodeCountParams) (int64, error)
	GetChunkNodes(ctx context.Context, arg GetChunkNodesParams) ([]ResourceNode, error)
	GetChunkOccupiedPositions(ctx context.Context, arg GetChunkOccupiedPositionsParams) ([]GetChunkOccupiedPositionsRow, error)
	GetDailyNodeCount(ctx context.Context, arg GetDailyNodeCountParams) (int64, error)
	GetNode(ctx context.Context, nodeID int64) (ResourceNode, error)
	GetNodesToRespawn(ctx context.Context, arg GetNodesToRespawnParams) ([]GetNodesToRespawnRow, error)
	GetOnlinePlayers(ctx context.Context) ([]Player, error)
	GetPlayerActiveSessions(ctx context.Context, playerID int64) ([]PlayerSession, error)
	GetPlayerByEmail(ctx context.Context, email sql.NullString) (Player, error)
	GetPlayerByID(ctx context.Context, playerID int64) (Player, error)
	GetPlayerByUsername(ctx context.Context, username string) (Player, error)
	GetPlayerDailyHarvest(ctx context.Context, arg GetPlayerDailyHarvestParams) (int64, error)
	GetPlayerInventory(ctx context.Context, playerID int64) ([]PlayerInventory, error)
	GetPlayerInventoryResource(ctx context.Context, arg GetPlayerInventoryResourceParams) (PlayerInventory, error)
	GetPlayerSession(ctx context.Context, sessionToken string) (PlayerSession, error)
	GetPlayerStats(ctx context.Context, playerID int64) (PlayerStat, error)
	GetPlayersInChunk(ctx context.Context, arg GetPlayersInChunkParams) ([]Player, error)
	GetPlayersWithStats(ctx context.Context) ([]GetPlayersWithStatsRow, error)
	GetRandomNodeCount(ctx context.Context, arg GetRandomNodeCountParams) (int64, error)
	GetRespawnDelay(ctx context.Context, arg GetRespawnDelayParams) (sql.NullInt64, error)
	GetSpawnTemplates(ctx context.Context) ([]NodeSpawnTemplate, error)
	GetTopPlayersByPlaytime(ctx context.Context, limit int64) ([]GetTopPlayersByPlaytimeRow, error)
	GetTopPlayersByResources(ctx context.Context, limit int64) ([]GetTopPlayersByResourcesRow, error)
	GetTotalResourcesInInventory(ctx context.Context, playerID int64) (interface{}, error)
	GetWorldConfig(ctx context.Context, configKey string) (string, error)
	IncrementPlayerSessions(ctx context.Context, playerID int64) error
	ReactivateNode(ctx context.Context, arg ReactivateNodeParams) error
	RegenerateNodeYield(ctx context.Context) error
	RemoveFromPlayerInventory(ctx context.Context, arg RemoveFromPlayerInventoryParams) error
	SetPlayerInventoryQuantity(ctx context.Context, arg SetPlayerInventoryQuantityParams) error
	SetPlayerOffline(ctx context.Context, playerID int64) error
	SetPlayerOnline(ctx context.Context, playerID int64) error
	SetWorldConfig(ctx context.Context, arg SetWorldConfigParams) error
	UpdateChunkModified(ctx context.Context, arg UpdateChunkModifiedParams) error
	UpdateNodeYield(ctx context.Context, arg UpdateNodeYieldParams) error
	UpdatePlayerEmail(ctx context.Context, arg UpdatePlayerEmailParams) error
	UpdatePlayerPassword(ctx context.Context, arg UpdatePlayerPasswordParams) error
	UpdatePlayerPlaytime(ctx context.Context, arg UpdatePlayerPlaytimeParams) error
	UpdatePlayerPosition(ctx context.Context, arg UpdatePlayerPositionParams) error
	UpdatePlayerSessionActivity(ctx context.Context, sessionToken string) error
	UpdatePlayerStats(ctx context.Context, arg UpdatePlayerStatsParams) error
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) AddToPlayerInventory

func (q *Queries) AddToPlayerInventory(ctx context.Context, arg AddToPlayerInventoryParams) error

func (*Queries) CheckNodePosition

func (q *Queries) CheckNodePosition(ctx context.Context, arg CheckNodePositionParams) (int64, error)

func (*Queries) ClearPlayerInventory

func (q *Queries) ClearPlayerInventory(ctx context.Context, playerID int64) error

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) CreateChunk

func (q *Queries) CreateChunk(ctx context.Context, arg CreateChunkParams) error

func (*Queries) CreateHarvestLog

func (q *Queries) CreateHarvestLog(ctx context.Context, arg CreateHarvestLogParams) error

func (*Queries) CreateNode

func (q *Queries) CreateNode(ctx context.Context, arg CreateNodeParams) (int64, error)

func (*Queries) CreatePlayer

func (q *Queries) CreatePlayer(ctx context.Context, arg CreatePlayerParams) (Player, error)

func (*Queries) CreatePlayerSession

func (q *Queries) CreatePlayerSession(ctx context.Context, arg CreatePlayerSessionParams) (PlayerSession, error)

func (*Queries) CreatePlayerStats

func (q *Queries) CreatePlayerStats(ctx context.Context, playerID int64) (PlayerStat, error)

func (*Queries) DeactivateNode

func (q *Queries) DeactivateNode(ctx context.Context, arg DeactivateNodeParams) error

func (*Queries) DeleteAllPlayerSessions

func (q *Queries) DeleteAllPlayerSessions(ctx context.Context, playerID int64) error

func (*Queries) DeleteExpiredSessions

func (q *Queries) DeleteExpiredSessions(ctx context.Context) error

func (*Queries) DeletePlayer

func (q *Queries) DeletePlayer(ctx context.Context, playerID int64) error

func (*Queries) DeletePlayerSession

func (q *Queries) DeletePlayerSession(ctx context.Context, sessionToken string) error

func (*Queries) GetChunk

func (q *Queries) GetChunk(ctx context.Context, arg GetChunkParams) (Chunk, error)

func (*Queries) GetChunkNodeCount

func (q *Queries) GetChunkNodeCount(ctx context.Context, arg GetChunkNodeCountParams) (int64, error)

func (*Queries) GetChunkNodes

func (q *Queries) GetChunkNodes(ctx context.Context, arg GetChunkNodesParams) ([]ResourceNode, error)

func (*Queries) GetChunkOccupiedPositions

func (q *Queries) GetChunkOccupiedPositions(ctx context.Context, arg GetChunkOccupiedPositionsParams) ([]GetChunkOccupiedPositionsRow, error)

func (*Queries) GetDailyNodeCount

func (q *Queries) GetDailyNodeCount(ctx context.Context, arg GetDailyNodeCountParams) (int64, error)

func (*Queries) GetNode

func (q *Queries) GetNode(ctx context.Context, nodeID int64) (ResourceNode, error)

func (*Queries) GetNodesToRespawn

func (q *Queries) GetNodesToRespawn(ctx context.Context, arg GetNodesToRespawnParams) ([]GetNodesToRespawnRow, error)

func (*Queries) GetOnlinePlayers

func (q *Queries) GetOnlinePlayers(ctx context.Context) ([]Player, error)

func (*Queries) GetPlayerActiveSessions

func (q *Queries) GetPlayerActiveSessions(ctx context.Context, playerID int64) ([]PlayerSession, error)

func (*Queries) GetPlayerByEmail

func (q *Queries) GetPlayerByEmail(ctx context.Context, email sql.NullString) (Player, error)

func (*Queries) GetPlayerByID

func (q *Queries) GetPlayerByID(ctx context.Context, playerID int64) (Player, error)

func (*Queries) GetPlayerByUsername

func (q *Queries) GetPlayerByUsername(ctx context.Context, username string) (Player, error)

func (*Queries) GetPlayerDailyHarvest

func (q *Queries) GetPlayerDailyHarvest(ctx context.Context, arg GetPlayerDailyHarvestParams) (int64, error)

func (*Queries) GetPlayerInventory

func (q *Queries) GetPlayerInventory(ctx context.Context, playerID int64) ([]PlayerInventory, error)

func (*Queries) GetPlayerInventoryResource

func (q *Queries) GetPlayerInventoryResource(ctx context.Context, arg GetPlayerInventoryResourceParams) (PlayerInventory, error)

func (*Queries) GetPlayerSession

func (q *Queries) GetPlayerSession(ctx context.Context, sessionToken string) (PlayerSession, error)

func (*Queries) GetPlayerStats

func (q *Queries) GetPlayerStats(ctx context.Context, playerID int64) (PlayerStat, error)

func (*Queries) GetPlayersInChunk

func (q *Queries) GetPlayersInChunk(ctx context.Context, arg GetPlayersInChunkParams) ([]Player, error)

func (*Queries) GetPlayersWithStats

func (q *Queries) GetPlayersWithStats(ctx context.Context) ([]GetPlayersWithStatsRow, error)

func (*Queries) GetRandomNodeCount

func (q *Queries) GetRandomNodeCount(ctx context.Context, arg GetRandomNodeCountParams) (int64, error)

func (*Queries) GetRespawnDelay

func (q *Queries) GetRespawnDelay(ctx context.Context, arg GetRespawnDelayParams) (sql.NullInt64, error)

func (*Queries) GetSpawnTemplates

func (q *Queries) GetSpawnTemplates(ctx context.Context) ([]NodeSpawnTemplate, error)

func (*Queries) GetTopPlayersByPlaytime

func (q *Queries) GetTopPlayersByPlaytime(ctx context.Context, limit int64) ([]GetTopPlayersByPlaytimeRow, error)

func (*Queries) GetTopPlayersByResources

func (q *Queries) GetTopPlayersByResources(ctx context.Context, limit int64) ([]GetTopPlayersByResourcesRow, error)

func (*Queries) GetTotalResourcesInInventory

func (q *Queries) GetTotalResourcesInInventory(ctx context.Context, playerID int64) (interface{}, error)

func (*Queries) GetWorldConfig

func (q *Queries) GetWorldConfig(ctx context.Context, configKey string) (string, error)

func (*Queries) IncrementPlayerSessions

func (q *Queries) IncrementPlayerSessions(ctx context.Context, playerID int64) error

func (*Queries) ReactivateNode

func (q *Queries) ReactivateNode(ctx context.Context, arg ReactivateNodeParams) error

func (*Queries) RegenerateNodeYield

func (q *Queries) RegenerateNodeYield(ctx context.Context) error

func (*Queries) RemoveFromPlayerInventory

func (q *Queries) RemoveFromPlayerInventory(ctx context.Context, arg RemoveFromPlayerInventoryParams) error

func (*Queries) SetPlayerInventoryQuantity

func (q *Queries) SetPlayerInventoryQuantity(ctx context.Context, arg SetPlayerInventoryQuantityParams) error

func (*Queries) SetPlayerOffline

func (q *Queries) SetPlayerOffline(ctx context.Context, playerID int64) error

func (*Queries) SetPlayerOnline

func (q *Queries) SetPlayerOnline(ctx context.Context, playerID int64) error

func (*Queries) SetWorldConfig

func (q *Queries) SetWorldConfig(ctx context.Context, arg SetWorldConfigParams) error

func (*Queries) UpdateChunkModified

func (q *Queries) UpdateChunkModified(ctx context.Context, arg UpdateChunkModifiedParams) error

func (*Queries) UpdateNodeYield

func (q *Queries) UpdateNodeYield(ctx context.Context, arg UpdateNodeYieldParams) error

func (*Queries) UpdatePlayerEmail

func (q *Queries) UpdatePlayerEmail(ctx context.Context, arg UpdatePlayerEmailParams) error

func (*Queries) UpdatePlayerPassword

func (q *Queries) UpdatePlayerPassword(ctx context.Context, arg UpdatePlayerPasswordParams) error

func (*Queries) UpdatePlayerPlaytime

func (q *Queries) UpdatePlayerPlaytime(ctx context.Context, arg UpdatePlayerPlaytimeParams) error

func (*Queries) UpdatePlayerPosition

func (q *Queries) UpdatePlayerPosition(ctx context.Context, arg UpdatePlayerPositionParams) error

func (*Queries) UpdatePlayerSessionActivity

func (q *Queries) UpdatePlayerSessionActivity(ctx context.Context, sessionToken string) error

func (*Queries) UpdatePlayerStats

func (q *Queries) UpdatePlayerStats(ctx context.Context, arg UpdatePlayerStatsParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type ReactivateNodeParams

type ReactivateNodeParams struct {
	CurrentYield int64 `json:"current_yield"`
	NodeID       int64 `json:"node_id"`
}

type RemoveFromPlayerInventoryParams

type RemoveFromPlayerInventoryParams struct {
	Quantity        sql.NullInt64 `json:"quantity"`
	PlayerID        int64         `json:"player_id"`
	ResourceType    int64         `json:"resource_type"`
	ResourceSubtype sql.NullInt64 `json:"resource_subtype"`
	Quantity_2      sql.NullInt64 `json:"quantity_2"`
}

type ResourceNode

type ResourceNode struct {
	NodeID           int64         `json:"node_id"`
	ChunkX           int64         `json:"chunk_x"`
	ChunkZ           int64         `json:"chunk_z"`
	LocalX           int64         `json:"local_x"`
	LocalZ           int64         `json:"local_z"`
	NodeType         int64         `json:"node_type"`
	NodeSubtype      sql.NullInt64 `json:"node_subtype"`
	MaxYield         int64         `json:"max_yield"`
	CurrentYield     int64         `json:"current_yield"`
	RegenerationRate sql.NullInt64 `json:"regeneration_rate"`
	SpawnedAt        sql.NullTime  `json:"spawned_at"`
	LastHarvest      sql.NullTime  `json:"last_harvest"`
	RespawnTimer     sql.NullTime  `json:"respawn_timer"`
	SpawnType        int64         `json:"spawn_type"`
	IsActive         sql.NullInt64 `json:"is_active"`
}

type SetPlayerInventoryQuantityParams

type SetPlayerInventoryQuantityParams struct {
	PlayerID        int64         `json:"player_id"`
	ResourceType    int64         `json:"resource_type"`
	ResourceSubtype sql.NullInt64 `json:"resource_subtype"`
	Quantity        sql.NullInt64 `json:"quantity"`
}

type SetWorldConfigParams

type SetWorldConfigParams struct {
	ConfigKey   string `json:"config_key"`
	ConfigValue string `json:"config_value"`
}

type UpdateChunkModifiedParams

type UpdateChunkModifiedParams struct {
	ChunkX int64 `json:"chunk_x"`
	ChunkZ int64 `json:"chunk_z"`
}

type UpdateNodeYieldParams

type UpdateNodeYieldParams struct {
	CurrentYield int64 `json:"current_yield"`
	NodeID       int64 `json:"node_id"`
}

type UpdatePlayerEmailParams

type UpdatePlayerEmailParams struct {
	Email    sql.NullString `json:"email"`
	PlayerID int64          `json:"player_id"`
}

type UpdatePlayerPasswordParams

type UpdatePlayerPasswordParams struct {
	PasswordHash string `json:"password_hash"`
	Salt         string `json:"salt"`
	PlayerID     int64  `json:"player_id"`
}

type UpdatePlayerPlaytimeParams

type UpdatePlayerPlaytimeParams struct {
	TotalPlaytimeMinutes sql.NullInt64 `json:"total_playtime_minutes"`
	PlayerID             int64         `json:"player_id"`
}

type UpdatePlayerPositionParams

type UpdatePlayerPositionParams struct {
	WorldX        sql.NullFloat64 `json:"world_x"`
	WorldY        sql.NullFloat64 `json:"world_y"`
	WorldZ        sql.NullFloat64 `json:"world_z"`
	CurrentChunkX sql.NullInt64   `json:"current_chunk_x"`
	CurrentChunkZ sql.NullInt64   `json:"current_chunk_z"`
	PlayerID      int64           `json:"player_id"`
}

type UpdatePlayerStatsParams

type UpdatePlayerStatsParams struct {
	TotalResourcesHarvested sql.NullInt64 `json:"total_resources_harvested"`
	TotalHarvestSessions    sql.NullInt64 `json:"total_harvest_sessions"`
	IronOreHarvested        sql.NullInt64 `json:"iron_ore_harvested"`
	GoldOreHarvested        sql.NullInt64 `json:"gold_ore_harvested"`
	WoodHarvested           sql.NullInt64 `json:"wood_harvested"`
	StoneHarvested          sql.NullInt64 `json:"stone_harvested"`
	UniqueNodesDiscovered   sql.NullInt64 `json:"unique_nodes_discovered"`
	TotalNodesHarvested     sql.NullInt64 `json:"total_nodes_harvested"`
	PlayerID                int64         `json:"player_id"`
}

type WorldConfig

type WorldConfig struct {
	ConfigKey   string       `json:"config_key"`
	ConfigValue string       `json:"config_value"`
	CreatedAt   sql.NullTime `json:"created_at"`
}

Jump to

Keyboard shortcuts

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