Oarcinae / FactorioScenarioMultiplayerSpawn

A custom scenario for Factorio which provides each player a unique starting spawn point in a multiplayer game.
MIT License
49 stars 30 forks source link

Spawn control gui exception? #118

Closed cielo closed 4 years ago

cielo commented 4 years ago

Hello,

Was testing out 'dev_special_map_features' branch (commit fdb0bb8b05b54d50cb7359924b05b1e4f79b0dea), and encountered this error below.

I am unsure if this action is related, but few seconds before the server crash, one of the admins clicked the 'Re-spawn' for one of the existing players to reset his base.

31863.507 Script @/factorio/temp/currently-playing/lib/game_opts.lua:35: Resetting gogo5515
31870.012 Script @/factorio/temp/currently-playing/lib/oarc_utils.lua:587: spawn: x=2544, y=-2384
31880.808 Script @/factorio/temp/currently-playing/lib/oarc_enemies.lua:35: OarcModifyEnemyGroup MODIFYING command TYPE=5
31880.808 Script @/factorio/temp/currently-playing/lib/oarc_enemies.lua:123: OarcModifyEnemyGroup RELEASING enemy group since player is ONLINE
31894.348 Error MainLoop.cpp:1207: Exception at tick 1183639: The scenario level caused a non-recoverable error.
Please report this error to the scenario author.

Error while running event level::on_gui_selected_tab_changed (ID 145)
...orio/temp/currently-playing/lib/separate_spawns_guis.lua:599: attempt to index field '?' (a nil value)
stack traceback:
    ...orio/temp/currently-playing/lib/separate_spawns_guis.lua:599: in function '?'
    /factorio/temp/currently-playing/lib/oarc_gui_tabs.lua:245: in function 'SetOarGuiTabContent'
    /factorio/temp/currently-playing/lib/oarc_gui_tabs.lua:147: in function 'TabChangeOarcGui'
    /factorio/temp/currently-playing/control.lua:197: in function </factorio/temp/currently-playing/control.lua:196>
31894.348 Error ServerMultiplayerManager.cpp:90: MultiplayerManager failed: "The scenario level caused a non-recoverable error.
Please report this error to the scenario author.

Error while running event level::on_gui_selected_tab_changed (ID 145)
...orio/temp/currently-playing/lib/separate_spawns_guis.lua:599: attempt to index field '?' (a nil value)
stack traceback:
    ...orio/temp/currently-playing/lib/separate_spawns_guis.lua:599: in function '?'
    /factorio/temp/currently-playing/lib/oarc_gui_tabs.lua:245: in function 'SetOarGuiTabContent'
    /factorio/temp/currently-playing/lib/oarc_gui_tabs.lua:147: in function 'TabChangeOarcGui'
    /factorio/temp/currently-playing/control.lua:197: in function </factorio/temp/currently-playing/control.lua:196>"
31894.348 Info ServerMultiplayerManager.cpp:769: updateTick(1183639) changing state from(InGame) to(Failed)
31894.348 Quitting: multiplayer error.
31894.734 Info ServerMultiplayerManager.cpp:136: Quitting multiplayer connection.
31894.734 Info ServerMultiplayerManager.cpp:769: updateTick(4294967295) changing state from(Failed) to(Closed)
31894.736 Info HttpSharedState.cpp:54: Downloading https://multiplayer.factorio.com/remove-game/7954563
31895.150 Info UDPSocket.cpp:218: Closing socket
31895.150 Info UDPSocket.cpp:248: Socket closed
31895.151 Goodbye
Oarcinae commented 4 years ago

Thanks for the report! I'll look into it when I get some time.

Oarcinae commented 4 years ago

I think I have a fix but I don't know how to reproduce the issue you saw so I'm not 100% sure... Do you know how to easily reproduce the issue? Did it only happen once? @cielo

cielo commented 4 years ago

It happened only once, and hasn't encountered it again. Feel free to close the issue. I will bring it up again if I see it happening again in the future.

Oarcinae commented 4 years ago

I can reproduce it manually by clearing a specific global table entry. I'm just not sure the conditions that get into that state. Regardless, I just pushed a fix that will make sure that even if that happens again, it shouldn't hit the same error at least.

Good luck!