Database

package
v0.0.0-...-cb03f6c Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContestEntry

func CreateContestEntry(entryData []byte, playerId uint64) int64

// InsertContEST_ENTRY adds a new contest_entry to the CONTEST_ENTRY table.

func CreatePlayer

func CreatePlayer() (uint32, error)

CreatePlayerS adds a new players to the PLAYERS table and returns the generated ID.

func FindOpponentEntry

func FindOpponentEntry(notPlayerId uint64) (uint64, []byte, error)

func GetContestByPlayerId

func GetContestByPlayerId(myInternalId uint64) ([]byte, error)

GetContestByPlayerId retrieves a contest data by Player ID

func GetPlayerByID

func GetPlayerByID(pyroId uint32) (uint64, error)

GetPlayerSByID retrieves a players by their ID.

func InitializeDatabase

func InitializeDatabase()

InitializeDatabase creates the necessary tables if they don't exist.

func InsertContest

func InsertContest(myInternalId uint64, opponentEntryId uint64, contest_data []byte) error

InsertContest adds a new contest data to the CONTEST_DATA table.

func SetContestRetrieved

func SetContestRetrieved(myInternalId uint64) error

Types

type Player

type Player struct {
	PlayerID     uint32 // Primary key (auto-incremented)
	CheckID      uint16 // Not null
	Arena        uint16 // Nullable
	Rating       uint16 // Nullable
	EmailAddr    string // Nullable
	MFAEnabled   int    // Nullable
	MFAMethod    int    // Nullable
	ContestEntry uint64 // Foreign key referencing CONTEST_ENTRY(ENTRY_ID)
	TeamName     string // Nullable
	Location     string // Nullable
	PlayerName   string // Nullable
}

Player represents a player in the game.

Jump to

Keyboard shortcuts

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