MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / loadPluginItems

Function loadPluginItems

internal/items/plugin.go:37–43  ·  view source on GitHub ↗

loadPluginItems walks every sub-filesystem of every registered plugin FS, reading item YAML files from an "items/" prefix and merging them into dst.

(dst map[int]*ItemSpec)

Source from the content-addressed store, hash-verified

35// loadPluginItems walks every sub-filesystem of every registered plugin FS,
36// reading item YAML files from an "items/" prefix and merging them into dst.
37func loadPluginItems(dst map[int]*ItemSpec) {
38 for _, groupFS := range pluginFileSystems {
39 for subFS := range groupFS.AllFileSubSystems {
40 loadItemsFromFS(subFS, dst)
41 }
42 }
43}
44
45func loadItemsFromFS(subFS fs.ReadFileFS, dst map[int]*ItemSpec) {
46 // PluginFiles does not support directory traversal, so use KnownPaths

Callers 1

LoadDataFilesFunction · 0.85

Calls 1

loadItemsFromFSFunction · 0.85

Tested by

no test coverage detected