封包功能修正(未完成

This commit is contained in:
Chenx221 2024-10-17 23:19:36 +08:00
parent 8a1b604f6a
commit 25c3ff879e

View File

@ -280,8 +280,9 @@ namespace EscudeTools
{ {
recordCount = Convert.ToInt32(command.ExecuteScalar()); recordCount = Convert.ToInt32(command.ExecuteScalar());
} }
uint dataSize = 4 * colsNum * (uint)recordCount;
//uint dataSize = 4 * colsNum * (uint)recordCount;
uint dataSize = (uint)(sizes.Sum(x => (uint)x) * recordCount);
List<uint> textOffset1 = []; List<uint> textOffset1 = [];
for (int i = 0; i < cnames.Length; i++) for (int i = 0; i < cnames.Length; i++)
@ -337,10 +338,8 @@ namespace EscudeTools
} }
bw.Write(dataSize);//数据大小 bw.Write(dataSize);//数据大小
//填充垃圾 //填充垃圾
for (int i = 0; i < colsNum; i++) byte[] zeroBytes = new byte[sizes.Sum(x => (uint)x)];
{ bw.Write(zeroBytes);
bw.Write((uint)0);
}
//填充数据 //填充数据
using (var command = new SqliteCommand($"SELECT * FROM {tableName};", connection)) using (var command = new SqliteCommand($"SELECT * FROM {tableName};", connection))
using (var reader = command.ExecuteReader()) using (var reader = command.ExecuteReader())