[PLUGIN] USQLite

Hi I’ve got another issue that I thought I fixed. For some reason all previously written row ID’s get copied to subsequent database writes, even to other database files.

This was previously fixed by forcing a garbage update between the saves but as of this morning that doesn’t work anymore. I run all saves sequentially and as a synchronous tasks.

Here is a log:

[2022.06.19-15.13.41:014][ 27]USQLog: {USQL}:: CREATE TABLE IF NOT EXISTS DB_DataStore (ID TEXT PRIMARY KEY NOT NULL,ItemRowName TEXT,NumItems INT,OwnerUID INT,CurrentDurability REAL,MaxDurability REAL,ContainerItemUID INT,ContainerItemRowName TEXT,ContainerItemNumItems INT);

[2022.06.19-15.13.41:014][ 27]USQLog: {USQL}:: [DB_DataStore] DB Table : OK
[2022.06.19-15.13.41:014][ 27]USQLog: {USQL}:: SELECT ID FROM DB_DataStore

[2022.06.19-15.13.41:015][ 27]USQLog: {USQL}:: CREATE TABLE IF NOT EXISTS DB_DataStore (ID TEXT PRIMARY KEY NOT NULL,ItemRowName TEXT,NumItems INT,OwnerUID INT,CurrentDurability REAL,MaxDurability REAL,ContainerItemUID INT,ContainerItemRowName TEXT,ContainerItemNumItems INT);
[2022.06.19-15.13.41:015][ 27]USQLog: {USQL}:: [DB_DataStore] DB Table : OK

[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1793694’,‘UName>>CLOTHING_TSHIRT’,1,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1865382’,‘UName>>RESOURCE_WOOD’,666,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1124149’,‘UName>>CLOTHING_TSHIRT’,1,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1626026’,‘UName>>CLOTHING_TSHIRT’,1,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1110324’,‘UName>>DRUG_WEED’,5,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1058320’,‘UName>>RESOURCE_WOOD’,2000,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1485427’,‘UName>>RESOURCE_WOOD’,2000,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1594775’,‘UName>>RESOURCE_WOOD’,1300,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1326456’,‘UName>>RESOURCE_STONE’,1800,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1615558’,‘UName>>WEAPON_BLOWPIPE’,1,1337,0.000000,0.000000,1820276,‘UName>>AMMO_BLOWDART_SLOW’,1);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1820276’,‘UName>>AMMO_BLOWDART_SLOW’,1,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1202642’,‘UName>>TOOL_PICKAXE’,1,1337,100.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1758110’,‘UName>>TOOL_HATCHET’,1,1337,100.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1791955’,‘UName>>WEAPON_BLOWPIPE’,1,1337,100.000000,0.000000,1773796,‘UName>>AMMO_BLOWDART_SLOW’,8);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1773796’,‘UName>>AMMO_BLOWDART_SLOW’,8,1337,0.000000,0.000000,0,‘UName>>None’,0);
[2022.06.19-15.13.41:027][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1581621’,‘UName>>RIFLE_OK47’,1,1337,100.000000,0.000000,1136875,‘UName>>AMMO_556’,30);
[2022.06.19-15.13.41:029][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_DataStore (ID,ItemRowName,NumItems,OwnerUID,CurrentDurability,MaxDurability,ContainerItemUID,ContainerItemRowName,ContainerItemNumItems) VALUES (‘1136875’,‘UName>>AMMO_556’,30,1337,0.000000,0.000000,0,‘UName>>None’,0);

[2022.06.19-15.13.41:039][ 27]LogBlueprintUserMessages: [BP_GameMode_Server_C_0] Server: Prepare save: DB_DataStore

[2022.06.19-15.13.41:045][ 27]USQLog: {USQL}:: SAVE PROGRESS:: 100.00

[2022.06.19-15.13.41:070][ 27]LogBlueprintUserMessages: [BP_GameMode_Server_C_0] Server: Save Data Finish: DB_DataStore

[2022.06.19-15.13.41:074][ 27]USQLog: {USQL}:: CREATE TABLE IF NOT EXISTS DB_PlayerInventories (ID TEXT PRIMARY KEY NOT NULL,PlayerHotbar TEXT,PlayerInventory TEXT,PlayerEquipment TEXT,PlayerClothing TEXT);

[2022.06.19-15.13.41:074][ 27]USQLog: {USQL}:: [DB_PlayerInventories] DB Table : OK

[2022.06.19-15.13.41:074][ 27]USQLog: {USQL}:: SELECT ID FROM DB_PlayerInventories

[2022.06.19-15.13.41:074][ 27]USQLog: {USQL}:: CREATE TABLE IF NOT EXISTS DB_PlayerInventories (ID TEXT PRIMARY KEY NOT NULL,PlayerHotbar TEXT,PlayerInventory TEXT,PlayerEquipment TEXT,PlayerClothing TEXT);

[2022.06.19-15.13.41:075][ 27]USQLog: {USQL}:: [DB_PlayerInventories] DB Table : OK

[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1337’,‘UArray>>{
“PlayerHotbar”: [ 1581621, 1791955, 1758110, 1202642, 1615558, 0 ]
}’,‘UArray>>{
“PlayerInventory”: [ 1594775, 1485427, 1058320, 1110324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
}’,‘UArray>>{
“PlayerEquipment”: [ 0, 0 ]
}’,‘UArray>>{
“PlayerClothing”: [ 1626026, 0, 0, 0, 0, 0, 0, 0 ]
}’);

[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1793694’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1865382’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1124149’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1626026’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1110324’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1058320’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1485427’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1594775’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1326456’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1615558’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1820276’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1202642’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1758110’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1791955’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1773796’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1581621’,NULL,NULL,NULL,NULL);
[2022.06.19-15.13.41:086][ 27]USQLog: {USQL}:: INSERT OR REPLACE INTO DB_PlayerInventories (ID,PlayerHotbar,PlayerInventory,PlayerEquipment,PlayerClothing) VALUES (‘1136875’,NULL,NULL,NULL,NULL);

[2022.06.19-15.13.41:096][ 27]LogBlueprintUserMessages: [BP_GameMode_Server_C_0] Server: Prepare save: DB_PlayerInventories

[2022.06.19-15.13.41:100][ 27]USQLog: {USQL}:: SAVE PROGRESS:: 100.00

As you can see in the log, the items in the DataStore db also get written to the PlayerInventories db with null values.

Maybe my way of serializing the objects from server memory is incorrect, can I e-mail you some screenshots?

EDIT: Everything seems to work fine if I create different functions for each database operation and don’t run them sequentially in the same blueprint. Using a delay between each save also seems to be working though it’s not a great solution.