Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: DT fails to connect to running DF game except on DT's initial startup #227

Closed
aerostarlegacy opened this issue Aug 20, 2020 · 9 comments · Fixed by #228
Closed

BUG: DT fails to connect to running DF game except on DT's initial startup #227

aerostarlegacy opened this issue Aug 20, 2020 · 9 comments · Fixed by #228

Comments

@aerostarlegacy
Copy link

I am using LNP 0.47.04-r06. DT ver 41.1.7 on win 10 x64. DF ver 0.47.04.

DT works just fine if/when I can get it connected to the running DF instance. The only way this happens is if I start up DF, then start a game, then start up DT and it auto-connects.

If I close DF or go the save screen, DT won't reconnect when I resume the DF game. DT does not throw the "A fort has not been loaded" error. It seems to fail silently. It does correctly throw the error when DF is not running at all.

Steps to reproduce:

  1. Close all DF related apps/utils/etc
  2. use LNP to start playing DF with DT as a listed auto-run utility
  3. DT starts up faster, and can't connect to DF because there is no game loaded yet. "A fort has not been loaded yet" error appears.
  4. DF finishes loading and I start a game
  5. Attempt to connect DT to DF with "connect" button, but nothing seems to happen.
  6. Closing DT and re-running by double clicking on the LNP util list while DF has an open fort causes DT to successfully connect automatically and function.
  7. Saving the game in DF causes DT to disconnect.
  8. resume the DF game
  9. try to connect DT to running DF game causes no error or success and fails to connect.
  10. exiting DT and restarting DT causes it to correctly auto-connect and function as expected.

I was unable to find logs or debugging output. I can include this if someone tells me where it is.

Thanks for all the amazing work you do!

@aerostarlegacy aerostarlegacy changed the title DT fails to connect to running DF game except on DT's initial startup BUG: DT fails to connect to running DF game except on DT's initial startup Aug 20, 2020
@cvuchener
Copy link
Contributor

FileOpen log directory to find the logs.

@cvuchener
Copy link
Contributor

  1. Attempt to connect DT to DF with "connect" button, but nothing seems to happen.

Works for me with PeridexisErrant's pack 0.47.04-r07 on Win10. Either it is fixed in the latest pack (and I don't know where to find the previous version, but DT was not updated so it don't that's it), or there is something else required to reproduce the bug. I hope you find something in the logs.

@aerostarlegacy
Copy link
Author

Here's the logs. I closed DT and started a new log file. Here's what I did:

  1. have DF running in game (paused)
  2. started DT, it connected to game
  3. unpaused DF for about 3 seconds, then paused again
  4. saved DF game, causing DT to show no connected fort message
  5. resumed the DF game
  6. tried to get DT to connect, but it exhibited the same behavior as stated in my original report.

I've attached the logs of this activity.
dwarftherapist.log

@cvuchener
Copy link
Contributor

Disable automatic updates and try again.

@aerostarlegacy
Copy link
Author

DT now functions as expected. Disabling the "automatically check for updates" checkbox seems to mitigate the issue.

Is this the line that was relevant?
2020-Aug-20 14:15:03.867 WARNING core "illegal value" [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\updater.cpp:182] (Updater::load_manifest)

@cvuchener
Copy link
Contributor

There is some weird stuff happening when you are trying to re-connect:

2020-Aug-20 14:14:22.495 ERROR	core	("No Game Loaded", "A fort has not been loaded.", "", "") [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\mainwindow.cpp:510] (MainWindow::lost_df_connection)
2020-Aug-20 14:14:26.871 INFO	core	attempting connection to running DF game [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\mainwindow.cpp:425] (MainWindow::connect_to_df)
...
2020-Aug-20 14:14:48.371 INFO	core	attempting connection to running DF game [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\mainwindow.cpp:425] (MainWindow::connect_to_df)
2020-Aug-20 14:14:48.371 INFO	core	already connected, disconnecting [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\mainwindow.cpp:427] (MainWindow::connect_to_df)
...
2020-Aug-20 14:14:48.463 INFO	core	Checking for layout for checksum:  "0x5e5b1983" [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\updater.cpp:134] (Updater::check_layouts)
2020-Aug-20 14:15:03.829 INFO	core	Beginning shutdown [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\mainwindow.cpp:400] (MainWindow::closeEvent)
2020-Aug-20 14:15:03.829 INFO	core	beginning to write settings [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\mainwindow.cpp:377] (MainWindow::write_settings)
2020-Aug-20 14:15:03.832 INFO	core	finished writing settings [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\mainwindow.cpp:395] (MainWindow::write_settings)
2020-Aug-20 14:15:03.832 INFO	core	Closing Dwarf Therapist normally [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\mainwindow.cpp:406] (MainWindow::closeEvent)
2020-Aug-20 14:15:03.867 WARNING	core	"illegal value" [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\updater.cpp:182] (Updater::load_manifest)
2020-Aug-20 14:15:03.868 INFO	core	Setting memory layout for DF checksum "0x5e5b1983" [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\dfinstance.cpp:1132] (DFInstance::set_memory_layout)
2020-Aug-20 14:15:03.868 INFO	core	Detected Dwarf Fortress version "v0.47.04 (graphics) win64" using MemoryLayout from "C:/Users/KEVINM~1/Desktop/DORF/2x2_fort/LNP/Utilities/Dwarf Therapist/data/memory_layouts/windows/v0.47.04_graphics_win64.ini" [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\dfinstance.cpp:1137] (DFInstance::set_memory_layout)
2020-Aug-20 14:15:03.868 INFO	core	Connection to DF version "v0.47.04 (graphics) win64" established. [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\mainwindow.cpp:450] (MainWindow::connect_to_df)
2020-Aug-20 14:15:04.445 INFO	core	Loading built-in default gridviews [C:\Users\travis\build\Dwarf-Therapist\Dwarf-Therapist\src\viewmanager.cpp:135] (ViewManager::reload_views)

So 14:14:22 DT disconnects because the game was unloaded, 14:14:26 (4 seconds later) you try to re-connect, no error/warning message but no data is loaded either. 14:14:48 (22 seconds later) a new attempt to connect (is it from you?). 14:15:03 (15 seconds later), DT main window is closed, but just after that data is finally loaded (and the updater logs a warning). Can you make sense of that?

@aerostarlegacy
Copy link
Author

I suspect that the 15 seconds later part is the "automatically connect (beta)" option that I had enabled in an attempt to fix this. should I try the same thing without the auto-reconnect enabled? Any other steps that would be helpful?

@aerostarlegacy
Copy link
Author

Could be connected to:
#186

@cvuchener
Copy link
Contributor

Yes, it is possible that is the same bug. The updater gets stuck for some reason and prevents the loading to progress. The updater has several issue, and I already started some attempt to rewrite it, but I'm stalled as I am not sure where I am going with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants