FAQ
Table Conversion Issues
When will the output_censored directory be generated?
-
When generating a single table, if
--censored-fields <fields>
is passed, both censored version and complete version output files will be generated, corresponding to theoutput_censored/
andoutput/
directories respectively. -
When batch generating tables, if
censoredTable
orcensoredFields
fields are configured in $tables.xlsx, both censored version and complete version output files will be generated. Tables marked withcensoredTable
will not be output to theoutput_censored/
directory, only tooutput/
. -
If
censoredTable
orcensoredFields
fields are not configured, only oneoutput/
will be generated.
About file_identifier
When using x2f, the .fbs file content’s SHA-256 hash is calculated, and the first four characters are used as the file_identifier.
You can use the BufferHasIdentifier
method in the generated code to verify whether the binary file matches the code. (If you are using a Unity Loader class generated by x2f, the Load
function will automatically perform this validation.)
uint64/int64 Precision Issues
When storing numbers like 9007199254740993 in the table, precision may be lost. You can set the cell to text format to preserve precision.
Runtime Issues
[ C# ] System.OverflowException: Value was either too large or too small for an Int16.
-
Trigger condition: When verifying the buffer, for example:
Xls.SomeTable.Instance.LoadAsync();
Xls.MergeTableLoader.LoadAllAsync(); -
Cause: When there is a large amount of data in the table, the offset exceeds the range of the
short
type in the verification method.FlatBuffers/FlatBufferVerify.csprivate short GetVRelOffset(int pos, short vtableOffset)
{
short VOffset = 0;
// Used try/catch because pos typa as int 32bit
try
{
// First, get vtable offset
short vtable = Convert.ToInt16(pos - ReadSOffsetT(verifier_buffer, pos));
// Check that offset points to vtable area (is smaller than vtable size)
if (vtableOffset < ReadVOffsetT(verifier_buffer, vtable))
{
// Now, we can read offset value - TODO check this value against size of table data
VOffset = ReadVOffsetT(verifier_buffer, vtable + vtableOffset);
}
// (...)
} -
Solutions:
- Modify the
GetVRelOffset
method in FlatBuffers to useint
type instead ofshort
type.
FlatBuffers/FlatBufferVerify.cs// short vtable = Convert.ToInt16(pos - ReadSOffsetT(verifier_buffer, pos));
// 👇 Change to this
int vtable = pos - ReadSOffsetT(verifier_buffer, pos);- Or modify the
TableValidator.Validate
method in UnityTemplate to only verify that theidentifier
matches, without verifying thebuffer
structure.
- Modify the