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

Constants.SaveFolderName does not include the farm name prefix on multiplayer client game instance #956

Open
MolsonCAD opened this issue Jun 23, 2024 · 0 comments

Comments

@MolsonCAD
Copy link

MolsonCAD commented Jun 23, 2024

Describe the bug
Constants.SaveFolderName returns a string of the form "name_id". The host/main farmer receives the expected result, e.g. "FooBar_304200428" for the farm with name "FooBar" and id "304200428". A guest/farmhand receives a string with no farm name and only the id, e.g. "_304200428". This happens in both split-screen and regular multiplayer modes.

To Reproduce
The issue can be observed without any mods through the standard log output, but I've included a test mod entry file that will showcase the issue with Constants.SaveFolderName directly. It can be observed in either regular multiplayer or split-screen, so the reproduction steps and SMAPI log file will be using split-screen for simplicity.

  1. Launch the game. Optionally include TestMod (below) in the Mods folder.
  2. Load any save and start local co-op. (My save is "FooBar_304200428")
  3. Join the game with a gamepad controller and create/select a character.
  4. View the log output (first and last two lines):
[14:11:13 TRACE SMAPI] Context: loaded save 'FooBar_304200428', starting summer 19 Y1, locale set to . Single-player.
[14:11:13 DEBUG TestMod] FooBar_304200428
[14:11:20 TRACE game] Window_ClientSizeChanged(); Window.ClientBounds={X:0 Y:0 Width:1920 Height:1080}
[14:11:28 TRACE game] Starting multiplayer server for local multiplayer...
[14:11:28 TRACE game] Starting server. Protocol version: 1.6.6
[14:11:28 TRACE game] Starting LAN server
...
[14:11:34 TRACE screen_1 SMAPI] Received context for host 6355978755418457551 running SMAPI 4.0.8 with 3 mods.
[14:11:34 TRACE screen_1 game] gameMode was 'loadingMode (6)', set to 'playingGameMode (3)'.
[14:11:34 TRACE screen_1 SMAPI] Context: loaded save '_304200428', starting summer 19 Y1, locale set to . Farmhand with 2 players online.
[14:11:34 DEBUG screen_1 TestMod] _304200428
// TestMod/ModEntry.cs
using StardewModdingAPI;

namespace TestMod
{
    internal sealed class ModEntry : Mod
    {
        public override void Entry(IModHelper helper)
        {
            helper.Events.GameLoop.SaveLoaded += (_, _) => Monitor.Log($"{Constants.SaveFolderName}", LogLevel.Debug);
        }
    }
}

Log file
Full log output: https://smapi.io/log/ef42253c5868478087181f7c329a20a1

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

No branches or pull requests

1 participant