DFC - kukfa/mmoserver GitHub Wiki

DFC stands for Dave Foundation Class (ironically unrelated), which is a core component of the game and can be seen almost everywhere throughout the game client. DFC has an object-oriented structure, with DFC Classes and DFC Objects.

DFC Class

DFC Classes

DFC Object

DFC Objects are instances of DFC Classes, and can be serialized to transfer data back and forth between the client and the server. They are composed of the following:

  1. DFC Class, which this is an object of
    • Referred to as "native class" in the game logs
  2. Node ID (??)
    • 4-byte value, not sure what this is called or what it's used for
  3. Node name (??)
    • String, not sure what this is called or what it's used for
  4. Nodes
    • Other DFC Objects that will be a child of this DFC Object
  5. GC Class
    • Local game asset associated with the DFC Object, if any
  6. Properties
    • Key-value pairs to add additional info to the object

Serialization

DFC Objects are serialized as follows:

  1. [1] Version (0x2D)
  2. [4] djb2 hash of DFC Class name, little-endian
  3. [4] Node ID (??), little-endian
  4. [Variable] Node name (??) string
  5. [4] Number of nodes, little-endian
  6. [Variable] Entire serialized DFC Objects (Nodes)
  7. [4] djb2 hash of GC Class name, little-endian
  8. [4] djb2 hash of Property name, little-endian (repeated for each Property)
  9. [Variable depending on value type] Property value (repeated for each Property)
  10. [4] 4 * 0x00 (signifies end of Object)
  11. [Variable] Additional data, if any. Some DFC Objects (such as Player) read in additional data after the DFC Object when they're being serialized

DFC Message

TODO - Address format