server

package
v0.0.0-...-81fef84 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: AGPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start()

Types

type Assets

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

func (*Assets) IsValidPicture

func (a *Assets) IsValidPicture(name string) bool

func (*Assets) IsValidSound

func (a *Assets) IsValidSound(name string) bool

func (*Assets) IsValidSprite

func (a *Assets) IsValidSprite(name string) bool

func (*Assets) IsValidSystem

func (a *Assets) IsValidSystem(name string, ignoreSingleQuotes bool) bool

type Badge

type Badge struct {
	Group           string     `json:"group"`
	Order           int        `json:"order"`
	MapOrder        int        `json:"mapOrder"`
	Bp              int        `json:"bp"`
	ReqType         string     `json:"reqType"`
	ReqInt          int        `json:"reqInt"`
	ReqString       string     `json:"reqString"`
	ReqStrings      []string   `json:"reqStrings"`
	ReqStringArrays [][]string `json:"reqStringArrays"`
	ReqCount        int        `json:"reqCount"`
	Map             int        `json:"map"`
	MapX            int        `json:"mapX"`
	MapY            int        `json:"mapY"`
	Secret          bool       `json:"secret"`
	SecretMap       bool       `json:"secretMap"`
	SecretCondition bool       `json:"secretCondition"`
	Hidden          bool       `json:"hidden"`
	Parent          string     `json:"parent"`
	OverlayType     int        `json:"overlayType"`
	Art             string     `json:"art"`
	Animated        bool       `json:"animated"`
	Batch           int        `json:"batch"`
	Dev             bool       `json:"dev"`
}

type ChatHistory

type ChatHistory struct {
	Players  []*ChatPlayer  `json:"players"`
	Messages []*ChatMessage `json:"messages"`
}

type ChatMessage

type ChatMessage struct {
	MsgId         string    `json:"msgId"`
	Uuid          string    `json:"uuid"`
	MapId         string    `json:"mapId"`
	PrevMapId     string    `json:"prevMapId"`
	PrevLocations string    `json:"prevLocations"`
	X             int       `json:"x"`
	Y             int       `json:"y"`
	Contents      string    `json:"contents"`
	Timestamp     time.Time `json:"timestamp"`
	Party         bool      `json:"party"`
}

type ChatPlayer

type ChatPlayer struct {
	Uuid       string `json:"uuid"`
	Name       string `json:"name"`
	SystemName string `json:"systemName"`
	Rank       int    `json:"rank"`
	Account    bool   `json:"account"`
	Badge      string `json:"badge"`
	Medals     [5]int `json:"medals"`
}

type Condition

type Condition struct {
	ConditionId  string   `json:"conditionId"`
	Map          int      `json:"map"`
	MapX1        int      `json:"mapX1"`
	MapY1        int      `json:"mapY1"`
	MapX2        int      `json:"mapX2"`
	MapY2        int      `json:"mapY2"`
	SwitchId     int      `json:"switchId"`
	SwitchValue  bool     `json:"switchValue"`
	SwitchIds    []int    `json:"switchIds"`
	SwitchValues []bool   `json:"switchValues"`
	SwitchDelay  bool     `json:"switchDelay"`
	VarId        int      `json:"varId"`
	VarValue     int      `json:"varValue"`
	VarValue2    int      `json:"varValue2"`
	VarOp        string   `json:"varOp"`
	VarIds       []int    `json:"varIds"`
	VarValues    []int    `json:"varValues"`
	VarOps       []string `json:"varOps"`
	VarDelay     bool     `json:"varDelay"`
	VarTrigger   bool     `json:"varTrigger"`
	Trigger      string   `json:"trigger"`
	Value        string   `json:"value"`
	Values       []string `json:"values"`
	TimeTrial    bool     `json:"timeTrial"`
	Disabled     bool     `json:"disabled"`
}

type Config

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

type ConfigFile

type ConfigFile struct {
	GameName string `yaml:"game_name"`
	GamePath string `yaml:"game_path"`

	DbUser string `yaml:"db_user"`
	DbPass string `yaml:"db_pass"`
	DbAddr string `yaml:"db_addr"`
	DbName string `yaml:"db_name"`

	SpRooms         string `yaml:"sp_rooms"`
	BadSounds       string `yaml:"bad_sounds"`
	PictureNames    string `yaml:"picture_names"`
	PicturePrefixes string `yaml:"picture_prefixes"`
	BattleAnimIds   string `yaml:"battle_anim_ids"`

	ChatWebhook       string `yaml:"chat_webhook"`
	ScreenshotWebhook string `yaml:"screenshot_webhook"`

	Logging struct {
		MaxSize    int `yaml:"max_size"`
		MaxBackups int `yaml:"max_backups"`
		MaxAge     int `yaml:"max_age"`
	} `yaml:"logging"`
}

type EventExp

type EventExp struct {
	WeekExp   int `json:"weekExp"`
	PeriodExp int `json:"periodExp"`
	TotalExp  int `json:"totalExp"`
}

type EventLocation

type EventLocation struct {
	Id       int       `json:"id"`
	Type     int       `json:"type"`
	Game     string    `json:"game"`
	Title    string    `json:"title"`
	TitleJP  string    `json:"titleJP"`
	Depth    int       `json:"depth"`
	MinDepth int       `json:"minDepth,omitempty"`
	Exp      int       `json:"exp"`
	EndDate  time.Time `json:"endDate"`
	Complete bool      `json:"complete"`
}

type EventLocationData

type EventLocationData struct {
	Title    string   `json:"title"`
	TitleJP  string   `json:"titleJP,omitempty"`
	Depth    int      `json:"depth"`
	MinDepth int      `json:"minDepth"`
	FgColor  string   `json:"fgColor"`
	BgColor  string   `json:"bgColor"`
	MapIds   []string `json:"mapIds"`
	Ignored  bool     `json:"ignored"`
}

type EventPeriod

type EventPeriod struct {
	Id            int       `json:"-"`
	PeriodOrdinal int       `json:"periodOrdinal"`
	EndDate       time.Time `json:"endDate"`
	EnableVms     bool      `json:"enableVms"`
}

type EventVm

type EventVm struct {
	Id       int       `json:"id"`
	Game     string    `json:"game"`
	Exp      int       `json:"exp"`
	EndDate  time.Time `json:"endDate"`
	Complete bool      `json:"complete"`
}

type EventsData

type EventsData struct {
	Locations []*EventLocation `json:"locations"`
	Vms       []*EventVm       `json:"vms"`
}

type Minigame

type Minigame struct {
	Id             string `json:"id"`
	VarId          int    `json:"varId"`
	InitialVarSync bool   `json:"initialVarSync"`
	SwitchId       int    `json:"switchId"`
	SwitchValue    bool   `json:"switchValue"`
	Dev            bool   `json:"dev"`
}

type Party

type Party struct {
	Id          int                   `json:"id"`
	Name        string                `json:"name"`
	Public      bool                  `json:"public"`
	Pass        string                `json:"-"`
	SystemName  string                `json:"systemName"`
	Description string                `json:"description"`
	OwnerUuid   string                `json:"ownerUuid"`
	Members     []*PlayerListFullData `json:"members"`
}

type Picture

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

type PlayerBadge

type PlayerBadge struct {
	BadgeId         string  `json:"badgeId"`
	Game            string  `json:"game"`
	Group           string  `json:"group"`
	Bp              int     `json:"bp"`
	MapId           int     `json:"mapId"`
	MapX            int     `json:"mapX"`
	MapY            int     `json:"mapY"`
	Seconds         int     `json:"seconds"`
	Secret          bool    `json:"secret"`
	SecretCondition bool    `json:"secretCondition"`
	Hidden          bool    `json:"hidden"`
	OverlayType     int     `json:"overlayType"`
	Art             string  `json:"art"`
	Animated        bool    `json:"animated"`
	Percent         float32 `json:"percent"`
	Goals           int     `json:"goals"`
	GoalsTotal      int     `json:"goalsTotal"`
	Unlocked        bool    `json:"unlocked"`
	NewUnlock       bool    `json:"newUnlock"`
}

type PlayerFriend

type PlayerFriend struct {
	PlayerListFullData
	Game     string `json:"game"`
	Incoming bool   `json:"incoming"`
	Accepted bool   `json:"accepted"`
}

type PlayerInfo

type PlayerInfo struct {
	Uuid            string `json:"uuid"`
	Name            string `json:"name"`
	Rank            int    `json:"rank"`
	Badge           string `json:"badge"`
	BadgeSlotRows   int    `json:"badgeSlotRows"`
	BadgeSlotCols   int    `json:"badgeSlotCols"`
	ScreenshotLimit int    `json:"screenshotLimit"`
	Medals          [5]int `json:"medals"`
}

type PlayerListData

type PlayerListData struct {
	Uuid       string `json:"uuid"`
	Name       string `json:"name"`
	SystemName string `json:"systemName"`
	Rank       int    `json:"rank"`
	Account    bool   `json:"account"`
	Badge      string `json:"badge"`
	Medals     [5]int `json:"medals"`

	SpriteName  string `json:"spriteName"`
	SpriteIndex int    `json:"spriteIndex"`
}

type PlayerListFullData

type PlayerListFullData struct {
	PlayerListData

	MapId         string `json:"mapId,omitempty"`
	PrevMapId     string `json:"prevMapId,omitempty"`
	PrevLocations string `json:"prevLocations,omitempty"`
	X             int    `json:"x"`
	Y             int    `json:"y"`

	Online     bool      `json:"online"`
	LastActive time.Time `json:"lastActive"`
}

type PlayerScreenshotData

type PlayerScreenshotData struct {
	Id         string    `json:"id"`
	Uuid       string    `json:"uuid"`
	Game       string    `json:"game"`
	MapId      string    `json:"mapId"`
	MapX       int       `json:"mapX"`
	MapY       int       `json:"mapY"`
	SystemName string    `json:"systemName"`
	Timestamp  time.Time `json:"timestamp"`
	Public     bool      `json:"public"`
	Spoiler    bool      `json:"spoiler"`
	LikeCount  int       `json:"likeCount"`
	Liked      bool      `json:"liked"`
}

type Room

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

type RoomClient

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

RoomClient

type SClientMap

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

func NewSCMap

func NewSCMap() *SClientMap

func (*SClientMap) Delete

func (m *SClientMap) Delete(uuid string)

func (*SClientMap) Exists

func (m *SClientMap) Exists(uuid string) bool

func (*SClientMap) Get

func (m *SClientMap) Get() []*SessionClient

func (*SClientMap) GetAmount

func (m *SClientMap) GetAmount() int

func (*SClientMap) Load

func (m *SClientMap) Load(uuid string) (*SessionClient, bool)

func (*SClientMap) Store

func (m *SClientMap) Store(uuid string, client *SessionClient)

type ScreenshotData

type ScreenshotData struct {
	Id        string           `json:"id"`
	Owner     *ScreenshotOwner `json:"owner"`
	Game      string           `json:"game"`
	MapId     string           `json:"mapId"`
	MapX      int              `json:"mapX"`
	MapY      int              `json:"mapY"`
	Timestamp time.Time        `json:"timestamp"`
	Spoiler   bool             `json:"spoiler"`
	LikeCount int              `json:"likeCount"`
	Liked     bool             `json:"liked"`
}

type ScreenshotOwner

type ScreenshotOwner struct {
	Uuid       string `json:"uuid"`
	Name       string `json:"name"`
	Rank       int    `json:"rank"`
	Badge      string `json:"badge"`
	SystemName string `json:"systemName"`
}

type SessionClient

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

SessionClient

type SimplePlayerBadge

type SimplePlayerBadge struct {
	BadgeId     string `json:"badgeId"`
	Game        string `json:"game"`
	Group       string `json:"group"`
	Bp          int    `json:"bp"`
	Hidden      bool   `json:"hidden"`
	OverlayType int    `json:"overlayType"`
	Animated    bool   `json:"animated"`
	Unlocked    bool   `json:"unlocked"`
	NewUnlock   bool   `json:"newUnlock"`
}

type TimeTrialRecord

type TimeTrialRecord struct {
	MapId   int `json:"mapId"`
	Seconds int `json:"seconds"`
}

type WebhookRequest

type WebhookRequest struct {
	Username        string `json:"username"`
	AvatarUrl       string `json:"avatar_url"`
	Content         string `json:"content"`
	AllowedMentions struct {
		Parse []string `json:"parse"`
	} `json:"allowed_mentions"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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