gamedata

package
v0.1.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindCommitRef

func FindCommitRef(resVersion string) (string, error)

FindCommitRef checks whether specified resource version exists or not. If exists, it returns the corresponded commit reference, otherwise, it returns an empty string.

func FindLatestCommitRef

func FindLatestCommitRef() (resVersion string, commitRef string, err error)

FindLatestCommitRef finds the latest gamedata update commit of CN server.

func Get

func Get(resVersion string, dataPath string, dest string) error

Get downloads the Arknights gamedata from https://github.com/Kengxxiao/ArknightsGameData.

Firstly, it downloads the repository archive from GitHub. Then, it extracts the repository archive (only files under "zh_CN/gamedata/") to the specified path.

For example, saying that path is "story/" and dest is "./arkwaifu/". What Get does is to download the full gamedata archive and extract files in the archive under "zh_CN/gamedata/story/" into "./arkwaifu/story".

func GetResourcesFromStoryText

func GetResourcesFromStoryText(storyText string) (images []string, backgrounds []string)

func GetStoryText

func GetStoryText(gamedataDir string, storyTextPath string) (string, error)

func GetText

func GetText(gamedata string, dataPath string) (string, error)

Types

type ActType

type ActType string
const (
	ActTypeNone   ActType = "NONE"
	ActivityStory ActType = "ACTIVITY_STORY"
	MainStory     ActType = "MAIN_STORY"
	MiniStory     ActType = "MINI_STORY"
)

type AvgTag

type AvgTag string

type EntryType

type EntryType string
const (
	EntryTypeNone EntryType = "NONE"
	Activity      EntryType = "ACTIVITY"
	Mainline      EntryType = "MAINLINE"
	MiniActivity  EntryType = "MINI_ACTIVITY"
)

type StoryData

type StoryData struct {
	StoryID    string `json:"storyId"`
	StoryGroup string `json:"storyGroup"`
	StorySort  int64  `json:"storySort"`
	StoryCode  string `json:"storyCode"`
	StoryName  string `json:"storyName"`
	StoryTxt   string `json:"storyTxt"`
	AvgTag     AvgTag `json:"avgTag"`
}

type StoryReviewData

type StoryReviewData struct {
	ID              string      `json:"id"`
	Name            string      `json:"name"`
	EntryType       EntryType   `json:"entryType"`
	ActType         ActType     `json:"actType"`
	StartTime       int64       `json:"startTime"`
	InfoUnlockDatas []StoryData `json:"infoUnlockDatas"`
}

func GetStoryReviewData

func GetStoryReviewData(gamedata string) ([]StoryReviewData, error)

type StoryReviewTable

type StoryReviewTable map[string]StoryReviewData

Jump to

Keyboard shortcuts

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