Documentation ¶
Index ¶
- Constants
- Variables
- func GetReader(path string, isCompressed bool) (io.ReadCloser, error)
- func IsAzcsFile(path string) (bool, bool, error)
- func LoadHashes(filePath string, registry *HashRegistry) error
- func LoadTypes(filePath string, registry *TypeRegistry) error
- func ResolveStream(stream *Stream, typeResolver TypeResolver, hashResolver HashResolver, ...) (any, error)
- func StoreHashes(filePath string, registry *HashRegistry) error
- func StoreTypes(filePath string, registry *TypeRegistry) error
- type Element
- type HashRegistry
- type HashResolver
- type JsonFloat32
- type JsonFloat64
- type Stream
- type TypeRegistry
- type TypeResolver
Constants ¶
View Source
const ( ST_BINARYFLAG_MASK = 0xF8 ST_BINARY_VALUE_SIZE_MASK = 0x07 ST_BINARYFLAG_ELEMENT_HEADER = 1 << 3 ST_BINARYFLAG_HAS_VALUE = 1 << 4 ST_BINARYFLAG_EXTRA_SIZE_FIELD = 1 << 5 ST_BINARYFLAG_HAS_NAME = 1 << 6 ST_BINARYFLAG_HAS_VERSION = 1 << 7 ST_BINARYFLAG_ELEMENT_END = 0 )
View Source
const ( TypeField = "__type" ValueField = "__value" )
Variables ¶
View Source
var ( DefaultTypeResolver TypeResolver = func(element *Element) string { typ := element.Type.String() if !element.SpecializedType.IsNil() { typ = element.SpecializedType.String() } if DefaultTypeRegistry.Has(typ) { return DefaultTypeRegistry.Get(typ) } return typ } DefaultHashResolver HashResolver = func(element *Element) string { hash := element.NameCrc if DefaultHashRegistry.Has(hash) { return DefaultHashRegistry.Get(hash) } formattedHash := fmt.Sprintf("0x%08x", hash) return formattedHash } )
View Source
var (
EOE = fmt.Errorf("end of element")
)
Functions ¶
func GetReader ¶ added in v0.7.4
func GetReader(path string, isCompressed bool) (io.ReadCloser, error)
func LoadHashes ¶
func LoadHashes(filePath string, registry *HashRegistry) error
func LoadTypes ¶
func LoadTypes(filePath string, registry *TypeRegistry) error
func ResolveStream ¶ added in v0.6.2
func ResolveStream(stream *Stream, typeResolver TypeResolver, hashResolver HashResolver, assetMap map[string]*asset.AssetInfo) (any, error)
func StoreHashes ¶
func StoreHashes(filePath string, registry *HashRegistry) error
func StoreTypes ¶
func StoreTypes(filePath string, registry *TypeRegistry) error
Types ¶
type Element ¶
type Element struct { Type uuid.UUID SpecializedType uuid.UUID NameCrc uint32 Version uint8 DataSize uint32 Data []byte Elements []*Element }
func (Element) ResolveType ¶
type HashRegistry ¶
type HashRegistry struct {
// contains filtered or unexported fields
}
var DefaultHashRegistry *HashRegistry
func NewHashRegistry ¶
func NewHashRegistry() *HashRegistry
func (*HashRegistry) Add ¶
func (registry *HashRegistry) Add(value string) error
func (*HashRegistry) Get ¶
func (registry *HashRegistry) Get(hash uint32) string
func (*HashRegistry) Has ¶
func (registry *HashRegistry) Has(hash uint32) bool
func (*HashRegistry) Hashes ¶
func (registry *HashRegistry) Hashes() map[uint32]string
func (*HashRegistry) Remove ¶
func (registry *HashRegistry) Remove(hash uint32)
type HashResolver ¶ added in v0.6.2
type JsonFloat32 ¶ added in v0.6.2
type JsonFloat32 float32
func (JsonFloat32) MarshalJSON ¶ added in v0.6.2
func (v JsonFloat32) MarshalJSON() ([]byte, error)
func (*JsonFloat32) UnmarshalJSON ¶ added in v0.6.2
func (v *JsonFloat32) UnmarshalJSON(b []byte) error
type JsonFloat64 ¶ added in v0.6.2
type JsonFloat64 float64
func (JsonFloat64) MarshalJSON ¶ added in v0.6.2
func (v JsonFloat64) MarshalJSON() ([]byte, error)
func (*JsonFloat64) UnmarshalJSON ¶ added in v0.6.2
func (v *JsonFloat64) UnmarshalJSON(b []byte) error
type TypeRegistry ¶
type TypeRegistry struct {
// contains filtered or unexported fields
}
var DefaultTypeRegistry *TypeRegistry
func NewTypeRegistry ¶
func NewTypeRegistry() *TypeRegistry
func (*TypeRegistry) Get ¶
func (registry *TypeRegistry) Get(id string) string
func (*TypeRegistry) Has ¶
func (registry *TypeRegistry) Has(id string) bool
func (*TypeRegistry) Remove ¶
func (registry *TypeRegistry) Remove(id string)
func (*TypeRegistry) Types ¶
func (registry *TypeRegistry) Types() map[string]string
type TypeResolver ¶ added in v0.6.2
Source Files ¶
- hash.go
- hashAchievementDataAchievementDataTableAchievementID.go
- hashBlueprintItemDefinitionsBlueprintBlueprintID.go
- hashBuffBucketDataBuffBucketsBuffBucketId.go
- hashGameEventDataEventID.go
- hashGatherableDataGatherablesGatherableID.go
- hashLoreDataLoreLoreID.go
- hashMasterItemDefinitionsItemID.go
- hashNPCDataNPCId.go
- hashObjectivesObjectiveID.go
- hashPerkBucketDataPerkBucketsPerkBucketID.go
- hashPropertiesData.go
- hashRewardModifierDataRewardModifiersModifiers.go
- hashStatusEffectDataEffectCategories.go
- hashStatusEffectDataStatusID.go
- hashTerritoryProgressionDataTerritoryProgressionProjectId.go
- hashVitalsCategoryDataVitalsCategoriesVitalsCategoryID.go
- hashVitalsDataVitalsVitalsID.go
- hashVitalsModifierDataVitalsModifiersCategoryId.go
- parser.go
- resolve.go
- type.go
- typeData.go
Click to show internal directories.
Click to hide internal directories.