Maptool: Campaign can be auto-deleted by overriding when starting a server

Created on 13 Oct 2020  路  4Comments  路  Source: RPTools/maptool

Hello guys,

this happened to me a few days ago and today I was able to reproduce this bug. Since this is no "once in a lifetime" thing for me I thought I might file a bug report here:

Describe the bug
When trying to start a new server for the currently open campaign MapTool gets into a state where it thinks that there is already a server running. It then automatically switches from the currently active campaign to the default "Grasslands" map only campaign. After that, while trying to create a server using UPnP, MapTool presents error popups (I think there where two) stating that there is already a server running (although there is none). Furthermore, an additional error popup regarding not found UPnP appear.
In this state (no server startet and Grasslands campaign open), when saving the campaign, the "blank" Grasslands only campaign will override the previously open campaign and override it. This can also happen automatically if auto-save is configured and you are unlucky with the time-frame (like me that day).

To Reproduce
Steps to reproduce the behavior:

  1. Open a campaign (for me it was a bigger one, containing a Pathfinder Framework: https://forums.rptools.net/viewtopic.php?t=26670) and do a backup of it if you want to keep it after the process ;)
  2. Try to start a server using UPnP (for configuration, see screenshot)
  3. This is very unreliable and only "works" sporadically (but if so, quite dramatically)
  4. When the map resets to Grasslands either wait for an automatic save cycle or save manually
  5. Your current campaign should now be overridden

Expected behavior
Besides from the bug that there where no two servers running at the given time, an automatic reset to the default campaign should in no way lead to overriding an existing campaign.

Screenshots
Screenshot

MapTool Info

  • Version: 1.7.0
  • Install: New

Desktop (please complete the following information):

  • OS: MacOS
  • Version: 10.13.6
bug

All 4 comments

Can't reproduce this under Windows. Starting a server with Use UPnP enabled but failing doesn't reset the campaign to default for me.

Can any other Mac users confirm this?

I am using macOS 10.15.7 (Catalina, with all updates) and cannot reproduce this.

We know there are race conditions in creating/copying the Campaign object, so he's likely seeing an artifact of that.

@si-lang If this is repeatable for you, please turn on full logging before doing Step 2 in your list and then submit the log file after Step 4. To turn on full logging on macOS means running a macro that individually enables the maximum amount of logging for each subsystem. Your log file will be under ~/.maptool-rptools/logs. It can be attached directly or put into a ZIP file and attached. You can navigate to that directory or use 鈬р寴G (Shift-Cmd-G) within Finder and paste that name into the field.

Paste this text into a macro button (if you want to save it) or into the chat window (if you don't care about saving it). If you paste it into a button, click the button afterward to execute the code.

[h: loggers = json.sort(log.getLoggers(),"a","name")]
[r, FOREACH(logger, loggers, "<br/>"), CODE: {
    [r: name = json.get(logger, "name")]
    [r: log.setLevel(json.get(logger, "name"), "DEBUG")]
}]

Hey guys,

thank you for looking into this.
I also can not reconstruct this behavior anymore... Maybe I just had bad luck, having this issue twice in a row.
At least I did some digging and can support the theory, that this might be related to a concurrency issue: The framework I am using uses a macro, that lets players switch to a "Starting Map" on campaign load. This also applies for GMs. After starting a server this Macro is also executed for the GM. Maybe in some unfortunate constellation with autosave, this lead to the lost campaign(s) (luckily the second time I did my homework with proper backups).
I will let the DEBUG mode run whenever I setup a server. If the bug happens again, I will gladly post the log here.

That sounds like a plan. (You likely don't want to leave the DEBUG mode running all the time, though, as it'll generate some pretty huge log files!)

Was this page helpful?
0 / 5 - 0 ratings