recordManager

package
v0.0.0-...-126e10b Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 17 Imported by: 0

README

Record Manager Service

The purpose of this Service Mesh service is to provide a single point of access for all records, which are instances of models that are marshalled from the diablo2 excel files (which are tab-separated value format).

This servicemesh service also exports the records into the lua environment for scripting access.

Dependencies

This service has dependencies on MPQ and TSV file loaders:

Integration with other services

This service integrates with the following services:

The integration is optional; if either of the lua or web router services are omitted from the servicemesh then the integration methods will never be called.

This service exports an integration interface LoadsDiablo2Records with an alias Dependencncy which are intended to be used by other services for dependency resolution (see servicemesh.HasDependencies), and expose just the methods which other services should use.

this is a rather large interface, but there are getters for all of the record types, which are numerous.

type Dependency = LoadsDiablo2Records

type LoadsDiablo2Records interface {
    LoadRecords() error
    Belts() []models.BeltData
    CharStartingAttributes() []models.CharStats
    Inventory() []models.InventoryData
    Overlays() []models.Overlay
    PetTypes() []models.PetType
    AutoMapEntries() []models.AutoMapEntry
    States() []models.State
    Hirelings() []models.Hireling
    HirelingDescriptions() []models.HirelingDescription
    Missiles() []models.Missile
    DifficultyLevels() []models.Difficultylevel
    Shrines() []models.Shrine
    GambleRecords() []models.GambleRecord
    NpcTradeRecords() []models.NPCTrade
    ExperienceBreakpoints() []models.ExperienceData
    ItemArmor() []models.ItemArmor
    ItemWeapon() []models.ItemWeapon
    ItemWeaponClass() []models.WeaponClass
    ItemMisc() []models.MiscItem
    ItemTypes() []models.ItemType
    ItemAutoMagic() []models.AutoMagicData
    ItemStatCost() []models.ItemStatCost
    ItemRatio() []models.ItemRatio
    ItemUnique() []models.ItemUnique
    ItemHiQualityMods() []models.ItemHighQualityModifiers
    ItemProperties() []models.ItemProperty
    CubeRecipes() []models.CubeRecipe
    Books() []models.Book
    Gems() []models.GemData
    Runes() []models.RuneWordData
    SetItems() []models.SetItemData
    SetBonuses() []models.SetBonusData
    Skills() []models.SkillData
    SkillDesc() []models.SkillDescData
    Treasures() []models.TreasureClass
    TreasuresExpansion() []models.TreasureClassEx
    MagicPrefixes() []models.MagicPrefix
    MagicSuffixes() []models.MagicSuffix
    RarePrefixes() []models.RarePrefix
    RareSuffixes() []models.RareSuffix
    UniquePrefixes() []models.UniquePrefix
    UniqueSuffixes() []models.UniqueSuffix
    Objects() []models.Object
    ObjectTypes() []models.ObjectType
    ObjectGroups() []models.ObjectGroup
    ObjectModes() []models.ObjectMode
    Sounds() []models.SoundEntry
    SoundEnvironments() []models.SoundEnvironment
    LevelPresets() []models.LevelPreset
    LevelType() []models.LevelType
    LevelWarp() []models.LevelWarp
    LevelDetails() []models.LevelData
    LevelMaze() []models.LevelMazeData
    LevelSubstitutions() []models.LevelSubstitutionData
    MonsterUniqueModifiers() []models.MonsterUniqueModifier
    MonsterEquipment() []models.MonsterEquipment
    MonsterLevelStats() []models.MonsterLevelStats
    MonsterPresets() []models.MonsterPreset
    MonsterProperties() []models.MonsterProp
    MonsterSequences() []models.MonsterSequence
    MonsterStats() []models.MonsterStats
    MonsterStats2() []models.MonsterStats2
    MonsterSounds() []models.MonsterSounds
    MonsterUniqueNames() []models.MonsterUniqueName
}

Lua service integration

A global records table is exported to lua. All of the getter-methods which yield the array of records are available from within the lua environment.

Here is an example of its usage:

for i, sound in ipairs(records.Sounds) do
    print("Sound " .. i .. ": Sound=" .. sound.Sound .. " FileName=" .. sound.FileName)
end

Web router service integration

If the web router service is present at servicemesh, this service will register routes for retrieving data.

The route slug for this service is records, so all routes defined will be under that route group.

route method purpose
records/ GET serves a web page with information about all of the records files
records/Belts GET yields the Belts records array
records/CharStartingAttributes GET yields the CharStartingAttributes records array
records/Inventory GET yields the Inventory records array
records/Overlays GET yields the Overlays records array
records/PetTypes GET yields the PetTypes records array
records/AutoMapEntries GET yields the AutoMapEntries records array
records/States GET yields the States records array
records/Hirelings GET yields the Hirelings records array
records/HirelingDescriptions GET yields the HirelingDescriptions records array
records/Missiles GET yields the Missiles records array
records/DifficultyLevels GET yields the DifficultyLevels records array
records/Shrines GET yields the Shrines records array
records/GambleRecords GET yields the GambleRecords records array
records/NpcTradeRecords GET yields the NpcTradeRecords records array
records/ExperienceBreakpoints GET yields the ExperienceBreakpoints records array
records/ItemArmor GET yields the ItemArmor records array
records/ItemWeapon GET yields the ItemWeapon records array
records/ItemWeaponClass GET yields the ItemWeaponClass records array
records/ItemMisc GET yields the ItemMisc records array
records/ItemTypes GET yields the ItemTypes records array
records/ItemAutoMagic GET yields the ItemAutoMagic records array
records/ItemStatCost GET yields the ItemStatCost records array
records/ItemRatio GET yields the ItemRatio records array
records/ItemUnique GET yields the ItemUnique records array
records/ItemHiQualityMods GET yields the ItemHiQualityMods records array
records/ItemProperties GET yields the ItemProperties records array
records/CubeRecipes GET yields the CubeRecipes records array
records/Books GET yields the Books records array
records/Gems GET yields the Gems records array
records/Runes GET yields the Runes records array
records/SetItems GET yields the SetItems records array
records/SetBonuses GET yields the SetBonuses records array
records/Skills GET yields the Skills records array
records/SkillDesc GET yields the SkillDesc records array
records/Treasures GET yields the Treasures records array
records/TreasuresEx GET yields the TreasuresEx records array
records/MagicPrefixes GET yields the MagicPrefixes records array
records/MagicSuffixes GET yields the MagicSuffixes records array
records/RarePrefixes GET yields the RarePrefixes records array
records/RareSuffixes GET yields the RareSuffixes records array
records/UniquePrefixes GET yields the UniquePrefixes records array
records/UniqueSuffixes GET yields the UniqueSuffixes records array
records/Objects GET yields the Objects records array
records/ObjectTypes GET yields the ObjectTypes records array
records/ObjectGroups GET yields the ObjectGroups records array
records/ObjectModes GET yields the ObjectModes records array
records/Sounds GET yields the Sounds records array
records/SoundEnvironments GET yields the SoundEnvironments records array
records/LevelPresets GET yields the LevelPresets records array
records/LevelType GET yields the LevelType records array
records/LevelWarp GET yields the LevelWarp records array
records/LevelDetails GET yields the LevelDetails records array
records/LevelMaze GET yields the LevelMaze records array
records/LevelSubstitutions GET yields the LevelSubstitutions records array
records/MonsterUniqueModifiers GET yields the MonsterUniqueModifiers records array
records/MonsterEquipment GET yields the MonsterEquipment records array
records/MonsterLevelStats GET yields the MonsterLevelStats records array
records/MonsterPresets GET yields the MonsterPresets records array
records/MonsterProperties GET yields the MonsterProperties records array
records/MonsterSequences GET yields the MonsterSequences records array
records/MonsterStats GET yields the MonsterStats records array
records/MonsterStats2 GET yields the MonsterStats2 records array
records/MonsterSounds GET yields the MonsterSounds records array
records/MonsterUniqueNames GET yields the MonsterUniqueNames records array

Documentation

Index

Constants

View Source
const (
	PathLevelPreset           = "/data/global/excel/LvlPrest.txt"
	PathLevelType             = "/data/global/excel/LvlTypes.txt"
	PathObjectType            = "/data/global/excel/objtype.txt"
	PathLevelWarp             = "/data/global/excel/LvlWarp.txt"
	PathLevelDetails          = "/data/global/excel/Levels.txt"
	PathLevelMaze             = "/data/global/excel/LvlMaze.txt"
	PathLevelGroups           = "/data/global/excel/LevelGroups.txt"
	PathLevelSubstitutions    = "/data/global/excel/LvlSub.txt"
	PathObjectDetails         = "/data/global/excel/Objects.txt"
	PathObjectMode            = "/data/global/excel/ObjMode.txt"
	PathObjectGroup           = "/data/global/excel/objgroup.txt"
	PathSoundSettings         = "/data/global/excel/Sounds.txt"
	PathItemStatCost          = "/data/global/excel/ItemStatCost.txt"
	PathItemRatio             = "/data/global/excel/itemratio.txt"
	PathItemTypes             = "/data/global/excel/ItemTypes.txt"
	PathQualityItems          = "/data/global/excel/qualityitems.txt"
	PathOverlays              = "/data/global/excel/Overlay.txt"
	PathRunes                 = "/data/global/excel/runes.txt"
	PathSets                  = "/data/global/excel/Sets.txt"
	PathSetItems              = "/data/global/excel/SetItems.txt"
	PathAutoMagic             = "/data/global/excel/automagic.txt"
	PathProperties            = "/data/global/excel/Properties.txt"
	PathHireling              = "/data/global/excel/hireling.txt"
	PathHirelingDescription   = "/data/global/excel/HireDesc.txt"
	PathDifficultyLevels      = "/data/global/excel/difficultylevels.txt"
	PathAutoMap               = "/data/global/excel/AutoMap.txt"
	PathCubeRecipes           = "/data/global/excel/cubemain.txt"
	PathSkills                = "/data/global/excel/skills.txt"
	PathSkillDesc             = "/data/global/excel/skilldesc.txt"
	PathTreasureClass         = "/data/global/excel/TreasureClass.txt"
	PathTreasureClassEx       = "/data/global/excel/TreasureClassEx.txt"
	PathStates                = "/data/global/excel/states.txt"
	PathSoundEnvirons         = "/data/global/excel/soundenviron.txt"
	PathShrines               = "/data/global/excel/shrines.txt"
	PathPetType               = "/data/global/excel/pettype.txt"
	PathNPC                   = "/data/global/excel/npc.txt"
	PathMonsterUniqueModifier = "/data/global/excel/monumod.txt"
	PathMonsterEquipment      = "/data/global/excel/monequip.txt"
	PathUniqueAppellation     = "/data/global/excel/UniqueAppellation.txt"
	PathMonsterLevel          = "/data/global/excel/monlvl.txt"
	PathMonsterPreset         = "/data/global/excel/MonPreset.txt"
	PathMonsterProperties     = "/data/global/excel/MonProp.txt"
	PathMonsterStats          = "/data/global/excel/monstats.txt"
	PathMonsterStats2         = "/data/global/excel/monstats2.txt"
	PathMonsterSound          = "/data/global/excel/monsounds.txt"
	PathMonsterSequence       = "/data/global/excel/monseq.txt"
	PathBelts                 = "/data/global/excel/belts.txt"
	PathGamble                = "/data/global/excel/gamble.txt"
	PathInventory             = "/data/global/excel/inventory.txt"
	PathWeapons               = "/data/global/excel/weapons.txt"
	PathArmor                 = "/data/global/excel/armor.txt"
	PathWeaponClass           = "/data/global/excel/WeaponClass.txt"
	PathBooks                 = "/data/global/excel/books.txt"
	PathMisc                  = "/data/global/excel/misc.txt"
	PathUniqueItems           = "/data/global/excel/UniqueItems.txt"
	PathGems                  = "/data/global/excel/gems.txt"
	PathMagicPrefix           = "/data/global/excel/MagicPrefix.txt"
	PathMagicSuffix           = "/data/global/excel/MagicSuffix.txt"
	PathRarePrefix            = "/data/global/excel/RarePrefix.txt" // these are for item names
	PathRareSuffix            = "/data/global/excel/RareSuffix.txt"
	PathUniquePrefix          = "/data/global/excel/UniquePrefix.txt"
	PathUniqueSuffix          = "/data/global/excel/UniqueSuffix.txt"
	PathExperience            = "/data/global/excel/experience.txt"
	PathCharStats             = "/data/global/excel/charstats.txt"
	PathMissiles              = "/data/global/excel/Missiles.txt"

	StringTable      = "/data/local/lng/ENG/string.tbl"
	PatchStringTable = "/data/local/lng/ENG/patchstring.tbl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency = LoadsDiablo2Records

type LoadsDiablo2Records

type LoadsDiablo2Records interface {
	LoadRecords() error
	IsLoaded() bool
	Belts() []models.BeltData
	CharStartingAttributes() []models.CharStats
	Inventory() []models.InventoryData
	Overlays() []models.Overlay
	PetTypes() []models.PetType
	AutoMapEntries() []models.AutoMapEntry
	States() []models.State
	Hirelings() []models.Hireling
	HirelingDescriptions() []models.HirelingDescription
	Missiles() []models.Missile
	DifficultyLevels() []models.Difficultylevel
	Shrines() []models.Shrine
	GambleRecords() []models.GambleRecord
	NpcTradeRecords() []models.NPCTrade
	ExperienceBreakpoints() []models.ExperienceData
	ItemArmor() []models.ItemArmor
	ItemWeapon() []models.ItemWeapon
	ItemWeaponClass() []models.WeaponClass
	ItemMisc() []models.MiscItem
	ItemTypes() []models.ItemType
	ItemAutoMagic() []models.AutoMagicData
	ItemStatCost() []models.ItemStatCost
	ItemRatio() []models.ItemRatio
	ItemUnique() []models.ItemUnique
	ItemHiQualityMods() []models.ItemHighQualityModifiers
	ItemProperties() []models.ItemProperty
	CubeRecipes() []models.CubeRecipe
	Books() []models.Book
	Gems() []models.GemData
	Runes() []models.RuneWordData
	SetItems() []models.SetItemData
	SetBonuses() []models.SetBonusData
	Skills() []models.SkillData
	SkillDesc() []models.SkillDescData
	Treasures() []models.TreasureClass
	TreasuresExpansion() []models.TreasureClassEx
	MagicPrefixes() []models.MagicPrefix
	MagicSuffixes() []models.MagicSuffix
	RarePrefixes() []models.RarePrefix
	RareSuffixes() []models.RareSuffix
	UniquePrefixes() []models.UniquePrefix
	UniqueSuffixes() []models.UniqueSuffix
	Objects() []models.Object
	ObjectTypes() []models.ObjectType
	ObjectGroups() []models.ObjectGroup
	ObjectModes() []models.ObjectMode
	Sounds() []models.SoundEntry
	SoundEnvironments() []models.SoundEnvironment
	LevelPresets() []models.LevelPreset
	LevelType() []models.LevelType
	LevelWarp() []models.LevelWarp
	LevelDetails() []models.LevelData
	LevelMaze() []models.LevelMazeData
	LevelSubstitutions() []models.LevelSubstitutionData
	MonsterUniqueModifiers() []models.MonsterUniqueModifier
	MonsterEquipment() []models.MonsterEquipment
	MonsterLevelStats() []models.MonsterLevelStats
	MonsterPresets() []models.MonsterPreset
	MonsterProperties() []models.MonsterProp
	MonsterSequences() []models.MonsterSequence
	MonsterStats() []models.MonsterStats
	MonsterStats2() []models.MonsterStats2
	MonsterSounds() []models.MonsterSounds
	MonsterUniqueNames() []models.MonsterUniqueName
}

type Service

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

func (*Service) AutoMapEntries

func (s *Service) AutoMapEntries() []models.AutoMapEntry

func (*Service) Belts

func (s *Service) Belts() []models.BeltData

func (*Service) Books

func (s *Service) Books() []models.Book

func (*Service) CharStartingAttributes

func (s *Service) CharStartingAttributes() []models.CharStats

func (*Service) CubeRecipes

func (s *Service) CubeRecipes() []models.CubeRecipe

func (*Service) DependenciesResolved

func (s *Service) DependenciesResolved() bool

func (*Service) DifficultyLevels

func (s *Service) DifficultyLevels() []models.Difficultylevel

func (*Service) ExperienceBreakpoints

func (s *Service) ExperienceBreakpoints() []models.ExperienceData

func (*Service) ExportToLua

func (s *Service) ExportToLua(state *lua.LState)

func (*Service) GambleRecords

func (s *Service) GambleRecords() []models.GambleRecord

func (*Service) Gems

func (s *Service) Gems() []models.GemData

func (*Service) HirelingDescriptions

func (s *Service) HirelingDescriptions() []models.HirelingDescription

func (*Service) Hirelings

func (s *Service) Hirelings() []models.Hireling

func (*Service) Init

func (s *Service) Init(mesh servicemesh.Mesh)

func (*Service) InitRoutes

func (s *Service) InitRoutes(group *gin.RouterGroup)

func (*Service) Inventory

func (s *Service) Inventory() []models.InventoryData

func (*Service) IsLoaded

func (s *Service) IsLoaded() bool

func (*Service) ItemArmor

func (s *Service) ItemArmor() []models.ItemArmor

func (*Service) ItemAutoMagic

func (s *Service) ItemAutoMagic() []models.AutoMagicData

func (*Service) ItemHiQualityMods

func (s *Service) ItemHiQualityMods() []models.ItemHighQualityModifiers

func (*Service) ItemMisc

func (s *Service) ItemMisc() []models.MiscItem

func (*Service) ItemProperties

func (s *Service) ItemProperties() []models.ItemProperty

func (*Service) ItemRatio

func (s *Service) ItemRatio() []models.ItemRatio

func (*Service) ItemStatCost

func (s *Service) ItemStatCost() []models.ItemStatCost

func (*Service) ItemTypes

func (s *Service) ItemTypes() []models.ItemType

func (*Service) ItemUnique

func (s *Service) ItemUnique() []models.ItemUnique

func (*Service) ItemWeapon

func (s *Service) ItemWeapon() []models.ItemWeapon

func (*Service) ItemWeaponClass

func (s *Service) ItemWeaponClass() []models.WeaponClass

func (*Service) LevelDetails

func (s *Service) LevelDetails() []models.LevelData

func (*Service) LevelMaze

func (s *Service) LevelMaze() []models.LevelMazeData

func (*Service) LevelPresets

func (s *Service) LevelPresets() []models.LevelPreset

func (*Service) LevelSubstitutions

func (s *Service) LevelSubstitutions() []models.LevelSubstitutionData

func (*Service) LevelType

func (s *Service) LevelType() []models.LevelType

func (*Service) LevelWarp

func (s *Service) LevelWarp() []models.LevelWarp

func (*Service) LoadRecords

func (s *Service) LoadRecords() error

func (*Service) Logger

func (s *Service) Logger() *slog.Logger

func (*Service) MagicPrefixes

func (s *Service) MagicPrefixes() []models.MagicPrefix

func (*Service) MagicSuffixes

func (s *Service) MagicSuffixes() []models.MagicSuffix

func (*Service) Missiles

func (s *Service) Missiles() []models.Missile

func (*Service) MonsterEquipment

func (s *Service) MonsterEquipment() []models.MonsterEquipment

func (*Service) MonsterLevelStats

func (s *Service) MonsterLevelStats() []models.MonsterLevelStats

func (*Service) MonsterPresets

func (s *Service) MonsterPresets() []models.MonsterPreset

func (*Service) MonsterProperties

func (s *Service) MonsterProperties() []models.MonsterProp

func (*Service) MonsterSequences

func (s *Service) MonsterSequences() []models.MonsterSequence

func (*Service) MonsterSounds

func (s *Service) MonsterSounds() []models.MonsterSounds

func (*Service) MonsterStats

func (s *Service) MonsterStats() []models.MonsterStats

func (*Service) MonsterStats2

func (s *Service) MonsterStats2() []models.MonsterStats2

func (*Service) MonsterUniqueModifiers

func (s *Service) MonsterUniqueModifiers() []models.MonsterUniqueModifier

func (*Service) MonsterUniqueNames

func (s *Service) MonsterUniqueNames() []models.MonsterUniqueName

func (*Service) Name

func (s *Service) Name() string

func (*Service) NpcTradeRecords

func (s *Service) NpcTradeRecords() []models.NPCTrade

func (*Service) ObjectGroups

func (s *Service) ObjectGroups() []models.ObjectGroup

func (*Service) ObjectModes

func (s *Service) ObjectModes() []models.ObjectMode

func (*Service) ObjectTypes

func (s *Service) ObjectTypes() []models.ObjectType

func (*Service) Objects

func (s *Service) Objects() []models.Object

func (*Service) Overlays

func (s *Service) Overlays() []models.Overlay

func (*Service) PetTypes

func (s *Service) PetTypes() []models.PetType

func (*Service) RarePrefixes

func (s *Service) RarePrefixes() []models.RarePrefix

func (*Service) RareSuffixes

func (s *Service) RareSuffixes() []models.RareSuffix

func (*Service) Ready

func (s *Service) Ready() bool

func (*Service) ResolveDependencies

func (s *Service) ResolveDependencies(services []servicemesh.Service)

func (*Service) Runes

func (s *Service) Runes() []models.RuneWordData

func (*Service) SetBonuses

func (s *Service) SetBonuses() []models.SetBonusData

func (*Service) SetItems

func (s *Service) SetItems() []models.SetItemData

func (*Service) SetLogger

func (s *Service) SetLogger(logger *slog.Logger)

func (*Service) Shrines

func (s *Service) Shrines() []models.Shrine

func (*Service) SkillDesc

func (s *Service) SkillDesc() []models.SkillDescData

func (*Service) Skills

func (s *Service) Skills() []models.SkillData

func (*Service) Slug

func (s *Service) Slug() string

func (*Service) SoundEnvironments

func (s *Service) SoundEnvironments() []models.SoundEnvironment

func (*Service) Sounds

func (s *Service) Sounds() []models.SoundEntry

func (*Service) States

func (s *Service) States() []models.State

func (*Service) Treasures

func (s *Service) Treasures() []models.TreasureClass

func (*Service) TreasuresExpansion

func (s *Service) TreasuresExpansion() []models.TreasureClassEx

func (*Service) UnexportFromLua

func (s *Service) UnexportFromLua(state *lua.LState)

func (*Service) UniquePrefixes

func (s *Service) UniquePrefixes() []models.UniquePrefix

func (*Service) UniqueSuffixes

func (s *Service) UniqueSuffixes() []models.UniqueSuffix

Jump to

Keyboard shortcuts

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