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

Fix: saving crash.sav when disconnected from network game #7684

Closed
wants to merge 1 commit into from

Conversation

@nikolas
Copy link
Contributor

nikolas commented Aug 6, 2019

This fixes an assertion failure created by the scenario
outlined here:
#6598 (comment)

When a client gets disconnected from a network game that has an AI, and
then crashes, it tries to write a crash.sav. Attempting to save the AI
instance here, which doesn't exist on the client, causes the assertion
failure.

This change allows openttd to crash properly in this awkward scenario :P

crash.sav and crash.png are now written:

Writing crash log to disk...
Crash log written to /home/nik/.openttd/crash.log. Please add this file
to any bug reports.

Writing crash savegame...
Crash savegame written to /home/nik/.openttd/crash.sav. Please add this
file and the last (auto)save to any bug reports.

Writing crash screenshot...
Crash screenshot written to /home/nik/.openttd/crash.png. Please add
this file to any bug reports.

Aborted
This fixes an assertion failure created by the scenario
outlined here:
#6598 (comment)

When a client gets disconnected from a network game that has an AI, and
then crashes, it tries to write a crash.sav. Attempting to save the AI
instance here, which doesn't exist on the client, causes the assertion
failure.

This change allows openttd to crash properly in this awkward scenario :P

crash.sav and crash.png are now written:

    Writing crash log to disk...
    Crash log written to /home/nik/.openttd/crash.log. Please add this file
    to any bug reports.

    Writing crash savegame...
    Crash savegame written to /home/nik/.openttd/crash.sav. Please add this
    file and the last (auto)save to any bug reports.

    Writing crash screenshot...
    Crash screenshot written to /home/nik/.openttd/crash.png. Please add
    this file to any bug reports.

    Aborted
@nielsmh

This comment has been minimized.

Copy link
Contributor

nielsmh commented Aug 6, 2019

From the surrounding code it seems the _networking global is reset before the emergency save happens, isn't that a problem in itself that the game "forgets" it was a network game?

@nikolas

This comment has been minimized.

Copy link
Contributor Author

nikolas commented Aug 6, 2019

Hmmm, yeah. Maybe that's the real problem to be addressed here.

@nikolas

This comment has been minimized.

Copy link
Contributor Author

nikolas commented Aug 13, 2019

I'm closing this because this doesn't really fix the root problem.

@nikolas nikolas closed this Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.