Suggested Solution: Restore thralls deleted due to decay on officials

Hope this helps someone at Funcom. TBH they probably already figured out what do, but just in case :slight_smile:

Basic Info:

Platform: Steam
Issue Type: Gameplay
Game Mode: Online Official
Server Type: PvE
Map: Exiled Lands
Server Name: all
Mods: =MODS=


Bug Description:

Accidentally set your decay timer to 1 day, and tons of thralls on all of the servers were deleted due to decay.


Bug Reproduction:

1: Set your thrall decay settings to 1 day
2: Wait 1 day
3: Restart the server
4: Find that many thralls have been deleted


How to fix it:

restorethralls.sql
-- Restore all thralls deleted by decay since August 31 at 00:00:00

--working under the following assumptions:
-- a backup exists prior to the decay incident
-- dw_settings has a record for name.serverruntime with functioning value that counts up
-- the game will automatically handle resetting the inserted properties entries for name.'%DecayStartingTime' to a sensible value

-- attach the backup database as game_old
attach database '\\filename\backup_game.db' as 'game_old';

-- sanity check, make sure we get some records
select objectId from game_events where eventType = 179 and worldTime >= 1693454400;

--run these individually to make sure there are no ID collisions (there probably should not be)
select * from actor_position where id in ( select objectId from game_events where eventType = 179 and worldTime >= 1693454400 );
select * from item_inventory where owner_id in ( select objectId from game_events where eventType = 179 and worldTime >= 1693454400 );
select * from item_properties where owner_id in ( select objectId from game_events where eventType = 179 and worldTime >= 1693454400 );
select * from properties where object_id in ( select objectId from game_events where eventType = 179 and worldTime >= 1693454400 );
select * from follower_markers where follower_id in ( select objectId from game_events where eventType = 179 and worldTime >= 1693454400 );

--insert all the matching records from game_old into this database
insert into actor_position select * from game_old.actor_position where id in ( select objectId from game_events where eventType = 179 and worldTime >= 1693454400);
insert into item_inventory select * from game_old.item_inventory where owner_id in ( select objectId from game_events where eventType = 179 and worldTime >= 1693454400);
insert into item_properties select * from game_old.item_properties where owner_id in ( select objectId from game_events where eventType = 179 and worldTime >= 1693454400);
insert into properties select * from game_old.properties where object_id in ( select objectId from game_events where eventType = 179 and worldTime >= 1693454400);
insert into follower_markers select * from game_old.follower_markers where follower_id in ( select objectId from game_events where eventType = 179 and worldTime >= 1693454400);

-- detach the backup database
detach database 'game_old';

--write changes and quit
.quit
2 Likes

Very well formulated response, hopefully this is seen and considered by Funcom if they don’t already have a solution.

1 Like

Tested via the following steps:

  • Generated a new world with serverruntime configured properly
  • Created a new character
  • Placed thralls in creative mode
  • Shut down the server, took a backup as backup_game.db
  • Restarted the server
  • Logged in, deleted that character
  • Created a new character, verified that I don’t own those thralls.
  • Shut down the server
  • Restarted the server.
  • Log in to see that thralls have been decayed in the world.
  • Shut down the server.
  • Downloaded the game.db to inspect: Saw that all those thralls had been deleted (eventType 179).
  • (Deleting the character simulated decay from time, which is the same eventType whether its time decay or char deletion decay)
  • Modified this script to attach the backup_game.db from proper file path
  • Executed script line by line
  • Wrote changes to game_db.
  • Reuploaded game.db to the server
  • Crossed fingers
  • Restarted server
  • Thralls have been restored.
  • Shut down server again to verify that the properties table for impacted thralls had reset DecayStartingTime to a reasonable value
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.