Vixen
caa30e12
csharp
public readonly record struct DefId

What a piece of authored content is called on the wire and in a saved row.

Read the guide page for this →

Remarks

The stable hash of an address, which means no registry and no exchange. Doc 28 § Definitions: DefId.From("items/flamebrand") is the same number in the editor, in the realm, in the grain and in the client, computed independently by each of them from content they already agreed on. The alternative — the numbered definition list every game without a content pipeline grows — is an ordered array whose indices are the wire format, and it desynchronises the first time two people add an item on two branches.

Deliberately the same construction as NetworkPrefabId and NetworkSceneId ([16](../../../docs/plan/16-networking.md)): 32-bit FNV-1a over the address, zero reserved for "nothing". Deliberately the address and not the content hash — the content hash changes with every edit to the item, so every balance patch would renumber the wire.

⚠ Thirty-two bits collide, and the collision is refused rather than tolerated. Two addresses hashing alike would be two definitions nothing can tell apart, so DefinitionCatalogBuilder fails the content build and names both. At ten thousand definitions the odds are about one in a hundred, which is a number a project should be told rather than left to discover in a support ticket.

Fields and properties (3)

  • public uint Value

    The hash. Zero is None.

  • public static DefId None

    Not a definition.

  • public bool IsSome

    Whether this names one.

Methods (3)

  • public DefId(uint Value)

    What a piece of authored content is called on the wire and in a saved row.

  • public static DefId From(string? address)

    The id an address hashes to.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

Used by (225, showing 40)

  • AddressTestsMmo.Content.Tests
  • ContentTestsMmo.Content.Tests
  • CoverageTestsMmo.Content.Tests
  • CreatureMmo.Shared
  • CreatureLibraryMmo.Shared
  • FleetMmo.Soak
  • MmoAddressesMmo.Shared
  • MmoRulesMmo.Shared
  • ReferenceTestsMmo.Content.Tests
  • ShardMmo.Soak
  • TypeRegistrationMmo.Shared
  • DefinitionImporterTestsVixen.Editor.Assets.Tests
  • EventChainVixen.Editor.Gameplay.Quests
  • EventChainEdgeVixen.Editor.Gameplay.Quests
  • EventChainProjectionVixen.Editor.Gameplay.Quests
  • EventChainProjectionTestsVixen.Editor.Gameplay.Quests.Tests
  • EventChainTestsVixen.Editor.Gameplay.Quests.Tests
  • LootItemStatisticsVixen.Editor.Gameplay.Loot
  • LootOutlineVixen.Editor.Gameplay.Loot
  • LootOutlineRowVixen.Editor.Gameplay.Loot
  • LootOutlineTestsVixen.Editor.Gameplay.Loot.Tests
  • LootSimulatorVixen.Editor.Gameplay.Loot
  • LootSimulatorTestsVixen.Editor.Gameplay.Loot.Tests
  • LootTableModelTestsVixen.Editor.Gameplay.Loot.Tests
  • AbilityCasterVixen.Gameplay.Combat
  • AbilityCasterTestsVixen.Gameplay.Combat.Tests
  • AbilityEventVixen.Gameplay.Combat
  • AbilityLibraryVixen.Gameplay.Combat
  • AbilityLibraryTestsVixen.Gameplay.Combat.Tests
  • AbilityTemplateVixen.Gameplay.Combat
  • AchievementVixen.Gameplay.Collections
  • ActiveQuestVixen.Gameplay.Quests
  • AffixTemplateVixen.Gameplay.Items
  • AssetMoveVixen.Gameplay.Economy
  • AuctionHouseVixen.Gameplay.Economy
  • AuctionListingVixen.Gameplay.Economy
  • BindingTestsVixen.Gameplay.Inventory.Tests
  • BuybackEntryVixen.Gameplay.Economy
  • ChannelVixen.Gameplay.Interaction
  • ChatChannelVixen.Gameplay.Chat