MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin-Playground / loadConfig

Function loadConfig

plugin/games/gamesystem/main.go:163–175  ·  view source on GitHub ↗

载入游戏状态

(cfgFile string)

Source from the content-addressed store, hash-verified

161
162// 载入游戏状态
163func loadConfig(cfgFile string) error {
164 if file.IsExist(cfgFile) {
165 reader, err := os.Open(cfgFile)
166 if err == nil {
167 err = json.NewDecoder(reader).Decode(&gameManager)
168 }
169 if err != nil {
170 return err
171 }
172 return reader.Close()
173 }
174 return saveConfig(cfgFile)
175}
176
177// 保存游戏状态
178func saveConfig(cfgFile string) error {

Callers 2

RegisterFunction · 0.85
whichGamePlayInFunction · 0.85

Calls 1

saveConfigFunction · 0.85

Tested by

no test coverage detected