OvenProofMars / Power_DI

Darktide mod framework for collecting, transforming, and displaying statistical game data
2 stars 2 forks source link

Problem with using "Reconnect" mod, Power DI throws error. #9

Closed ezonius closed 4 months ago

ezonius commented 4 months ago

When using the /retry command from the Reconnect mod, to disconnect from the game and then reconnect to the game again, Power DI throw and error, and as far as I can see, the mod stops recording the game data, after reconnecting.

I'm guessing this also would happens if you just disconnected from the game without the game closing, but I don't recall if this happened before.

https://www.nexusmods.com/warhammer40kdarktide/mods/132

The relevant bit in the log seems to be this.


14:26:45.252 [Lua] Error: [string "./../mods/Power_DI/scripts/mods/Power_DI/modu..."]:191: bad argument #1 to 'next' (table expected, got nil)
<Lua Script.Callstack>
  [0] =[C]: in function callstack
  [1] ./../mods/dmf/scripts/mods/dmf/modules/core/safe_calls.lua:19:in function <[string "./../mods/dmf/scripts/mods/dmf/modules/core/s..."]:15>
  [2] =[C]: in function next
  [3] ./../mods/Power_DI/scripts/mods/Power_DI/modules/save_manager.lua:191: in function get_loaded_auto_save_data
  [4] ./../mods/Power_DI/scripts/mods/Power_DI/modules/session_manager.lua:118: in function resume_or_create_session
  [5] ./../mods/Power_DI/scripts/mods/Power_DI/Power_DI.lua:101:in function <[string "./../mods/Power_DI/scripts/mods/Power_DI/Powe..."]:96>
  [6] =[C]: in function xpcall
  [7] ./../mods/dmf/scripts/mods/dmf/modules/core/safe_calls.lua:66: in function safe_call_nr
  [8] ./../mods/dmf/scripts/mods/dmf/modules/core/events.lua:13: in function run_event
  [9] ./../mods/dmf/scripts/mods/dmf/modules/core/events.lua:67: in function mods_game_state_changed_event
  [10] ./../mods/dmf/scripts/mods/dmf/dmf_loader.lua:102:in function <[string "./../mods/dmf/scripts/mods/dmf/dmf_loader.lua"]:100>
  [11] =[C]: in function pcall
  [12] ./../mods/base/mod_manager.lua:341: in function _run_callback
  [13] ./../mods/base/mod_manager.lua:496: in function on_game_state_changed
  [14] ./mod_loader:277: in function _change_state
  [15] @scripts/foundation/utilities/game_state_machine.lua:97: in function update
  [16] @scripts/game_states/game/state_gameplay.lua:164: in function update
  [17] @scripts/foundation/utilities/game_state_machine.lua:100: in function update
  [18] @scripts/game_states/state_game.lua:610: in function update
  [19] @scripts/foundation/utilities/game_state_machine.lua:100: in function update
  [20] ./mod_loader:388: in function update
  [21] ./mod_loader:434:in function <[string "./mod_loader"]:433>
</Lua Script.Callstack>
<Lua Script.Locals>
  [1] error_message = "[string \"./../mods/Power_DI/scripts/mods/Power_DI/modu...\"]:191: bad argument #1 to \'next\' (table expected, got nil)"
  [4] last_session_id = "420be022-e698-4a90-8704-b0bdb6237f0a"; current_session_id = "420be022-e698-4a90-8704-b0bdb6237f0a"; datasources = table: 00000000330C9860
  [5] status = "enter"; state_name = "GameplayStateRun"
  [7] mod = table: 0000000009F9E940; error_prefix_data = "(event) on_game_state_changed"; func = [function]
  [8] mod = table: 0000000009F9E940; event_name = "on_game_state_changed"; event = [function]
  [9] status = "enter"; state_name = "GameplayStateRun"; event_name = "on_game_state_changed"; _ = "Power_DI"; mod = table: 0000000009F9E940
  [10] self = table: 00000000086B7970; status = "enter"; state = "GameplayStateRun"
  [12] self = table: 000000000891A820; mod = table: 0000000004C89800; callback_name = "on_game_state_changed"; object = table: 00000000086B7970; cb = [function]
  [13] self = table: 000000000891A820; status = "enter"; state_name = "GameplayStateRun"; state_object = table: 00000000219CDC00; i = 1; mod = table: 0000000004C89800
  [14] func = [function]; self = table: 00000000233A4370; old_state = table: 000000001B47B4D0; old_state_name = "GameplayStateInit"; result = nil; new_state = table: 00000000219CDC00; new_state_name = "GameplayStateRun"
  [15] self = table: 00000000233A4370; dt = 0.0081780003383755684; t = 5551.1384701319448
  [16] self = table: 0000000028CFC910; main_dt = 0.0081780003383755684; main_t = 5551.1384701319448
  [17] self = table: 0000000007E6B8E0; dt = 0.0081780003383755684; t = 5551.1384701319448
  [18] self = table: 0000000003D04CE0; dt = 0.0081780003383755684; network_is_active = true; t = 5551.1384701319448
  [19] self = table: 0000000003D104B0; dt = 0.0081780003383755684; t = nil
  [20] self = table: 0000000003D03230; dt = 0.0081780003383755684
  [21] dt = 0.0081780003383755684
</Lua Script.Locals>
<Lua Script.Self>
  [12] _chat_print_buffer = table: 000000000891A880; _mod_load_index = 91; _settings = table: 000000000891A8C0; _reload_data = table: 000000000891A9A0; _state = "done"; _mods = table: 000000000891A850; _num_mods = 91; _network_callbacks = table: 000000000891A930; _mod_metadata = table: 000000000891AB60; _ui_time = 0; 
  [13] _chat_print_buffer = table: 000000000891A880; _mod_load_index = 91; _settings = table: 000000000891A8C0; _reload_data = table: 000000000891A9A0; _state = "done"; _mods = table: 000000000891A850; _num_mods = 91; _network_callbacks = table: 000000000891A930; _mod_metadata = table: 000000000891AB60; _ui_time = 0; 
  [14] _state = table: 00000000219CDC00; _name = "GamePlay"; _parent = table: 0000000028CFC910; _state_change_callbacks = table: 00000000224559E0; 
  [15] _state = table: 00000000219CDC00; _name = "GamePlay"; _parent = table: 0000000028CFC910; _state_change_callbacks = table: 00000000224559E0; 
  [16] _state_machine = table: 00000000233A4370; _world_name = "level_world"; _shared_state = table: 0000000026BBC1D0; _is_dedicated_server = false; _game_world_fullscreen_blur_amount = 0; _viewport_name = "player1"; _game_world_fullscreen_blur_enabled = false; 
  [17] _state = table: 0000000028CFC910; _optional_creation_context = table: 0000000003CF5830; _log_breadcrumbs = true; _name = "Game"; _parent = table: 0000000003D04CE0; _state_change_callbacks = table: 0000000007E6A690; 
  [18] _vo_sources_cache = table: 0000000003D4DB90; _approve_channel_delegate = table: 0000000003D46B30; _event_delegate = table: 0000000003D687C0; _sm = table: 0000000007E6B8E0; 
  [19] _name = "Main"; _state_change_callbacks = table: 0000000003D104E0; _state = table: 0000000003D04CE0; 
  [20] _package_manager = table: 0000000003D0FC70; _sm = table: 0000000003D104B0; 
</Lua Script.Self>

14:26:45.253 [Lua] [MOD][Power_DI][ERROR] (event) on_game_state_changed: [string "./../mods/Power_DI/scripts/mods/Power_DI/modu..."]:191: bad argument #1 to 'next' (table expected, got nil)
OvenProofMars commented 4 months ago

This error occurs when it's trying to load auto save data that hasn't been created. I've fixed this issue in the github version, but still have to upload it to Nexus.