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

Function LoadDataFiles

internal/items/itemspec.go:556–579  ·  view source on GitHub ↗

file self loads due to init()

()

Source from the content-addressed store, hash-verified

554
555// file self loads due to init()
556func LoadDataFiles() {
557
558 start := time.Now()
559
560 tmpItems, err := fileloader.LoadAllFlatFiles[int, *ItemSpec](string(configs.GetFilePathsConfig().DataFiles) + `/items`)
561 if err != nil {
562 panic(err)
563 }
564
565 items = tmpItems
566
567 // Merge items from plugin file systems.
568 loadPluginItems(items)
569
570 tmpAttackMessages, err := fileloader.LoadAllFlatFiles[ItemSubType, *WeaponAttackMessageGroup](string(configs.GetFilePathsConfig().DataFiles) + `/combat-messages`)
571 if err != nil {
572 panic(err)
573 }
574
575 attackMessages = tmpAttackMessages
576
577 mudlog.Info("itemspec.LoadDataFiles()", "itemLoadedCount", len(items), "attackMessageCount", len(attackMessages), "Time Taken", time.Since(start))
578
579}

Callers 3

loadAllDataFilesFunction · 0.92
loadTestDataFunction · 0.92
ReloadFunction · 0.92

Calls 3

GetFilePathsConfigFunction · 0.92
InfoFunction · 0.92
loadPluginItemsFunction · 0.85

Tested by 1

loadTestDataFunction · 0.74