TSOData

**TSOData\_datadefinition.dat** is an interesting file which appears to define many (or all?) of the DBRequestWrapperPDU/DataServiceWrapperPDU request/response bodies and provides names to all of the fields. The file is used by TSODataServiceClientD.dll in every version of the game, however, the code for reading the request/response bodies is hardcoded in DBAppServiceClient.dll which does not use this file (e.g. the code for reading the LoadAvatarByID response body is located at DBAppServiceClientD\_base+0x2f4a0, and it does a series of "read dword", "read string", etc. calls).

The RTTI for EA-Land's version of TSODataServiceClientD.dll also mimics some of the contents of this file.

All integers are little-endian.

Its format is as follows:

* **Timestamp** - A 4-byte Unix timestamp specifying the time that this file was generated
* **1st-level struct count** - A 4-byte unsigned integer specifying the number of 1st-level structs
* **1st-level structs** - For each 1st-level struct:
	+ **Name string ID** - A 4-byte unsigned integer specifying the string ID of a string that represents the name of this struct
	+ **Field count** - A 4-byte unsigned integer specifying the number of fields defined for this struct
	+ **Fields** - For each field:
		- **Name string ID** - A 4-byte unsigned integer specifying the string ID of a string that represents the name of this field
		- **Classification** - 1 byte with a value between 0 and 2 (inclusive), corresponding to the table below:

 1
 2

* + - **Type string ID** - A 4-byte unsigned integer specifying the string ID of a string that represents the type of this field (e.g. "bool", "Uint32", "string")
* **2nd-level struct count** - A 4-byte unsigned integer specifying the number of 2nd-level structs
* **2nd-level structs** - The 2nd-level structs follow the same format as the 1st-level structs but may also declare fields with 1st-level struct types
* **Derived struct count** - A 4-byte unsigned integer specifying the number of derived structs
* **Derived structs** - For each derived struct:
	+ **Derived struct string ID** - A 4-byte unsigned integer specifying the string ID of the name of this derived struct
	+ **Parent struct string ID** - A 4-byte unsigned integer specifying the string ID of the name of the parent struct that this struct derives from
	+ **Field mask count** - A 4-byte unsigned integer specifying the number of field masks defined for this derived struct
	+ **Field masks** - For each List 3.1 entry:
		- **Field name string ID** - A 4-byte unsigned integer specifying the string ID of the name of the field that this mask applies to
		- **Mask value** - 1-byte either 0x01 for "keep" or 0x02 for "remove" from the parent struct; note that the number of field masks does not always equal the number of fields in the parent struct; if a field in the parent struct does not have an associated field mask, it defaults to "keep"
* **String entry count** - A 4-byte unsigned integer specifying the number of string entries
* **String entries** - For each string entry:
	+ **String ID** - A 4-byte unsigned integer that identifies this string entry (and is referenced by the structs above)
	+ **Value** - A null-terminated string
	+ **Category** - 1 byte with a value between 1 and 5 (inclusive), corresponding to the table below:

 2
 3
 4
 5