NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.46k stars 13.66k forks source link

steam, xivlauncher: Time in game for FFXIV (XIVLauncher) and FFXI (steam) is incorrectly reported #279893

Open witchof0x20 opened 8 months ago

witchof0x20 commented 8 months ago

Describe the bug

FFXIV and FFXI seem to incorrectly report the local time. This issue seems entirely isolated to NixOS users, and in all cases, Steam's runtime is involved.

Steps To Reproduce

Steps to reproduce the behavior:

  1. use nixos-unstable
  2. nix-shell -p xivlauncher
  3. Launch the game
  4. View the local time and system time via the top bar

This also occurs in Final Fantasy XI (a completely different game) via Steam.

  1. launch steam
  2. Launch Final Fantasy XI
  3. View local time via the chat log

Expected behavior

Time is reported correctly

Additional context

XIVLauncher distributes its own WINE, optimized for XIV. Relaunching XIVLauncher without steam-run in the wrapper, and using a NixOS wine does not have this issue.

The same issue occurs in XI, though it is using proton. I believe this bug is somewhere in steam-run

Currently talking to XIVLauncher folks to see if we can shed some light on why this happens, but we are fairly confident it is a NixOS issue given that only NixOS users of xivl have reported it.

Potentially related issues:

Notify maintainers

@jagajaga @jonringer @sersorrel @witchof0x20

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.69, NixOS, 23.11 (Tapir), 23.11.20240103.b0b2c54`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(jade): `""`
 - channels(root): `""`
 - nixpkgs: `/nix/store/lgwgz45xgp04xspicd2xkkhb0krq5j2a-source`
witchof0x20 commented 8 months ago

The first time I can find of me talking about this bug was 23 May 2023 (I probably should have filed here earlier), for reference.

witchof0x20 commented 8 months ago

It seems like windows (MSVC) and Linux have different conceptions of the TZ environment variable (America/New_York vs EST5EDT), and FFXIV (which surely inherited code from FFXI) acts differently when the TZ environment value is present, but expects its value in windows format (https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset?view=msvc-170)

TZ=EST5EDT XIVLauncher also causes the game's time to work correctly (for me)

(channels.unstable.xivlauncher.override {
      steam = (channels.unstable.steam.override {
        extraProfile = ''
          unset TZ
        '';
      });

also displays time correctly. So it seems like https://github.com/NixOS/nixpkgs/pull/44602 causes issues for FFXIV by setting TZ

witchof0x20 commented 8 months ago

Consider this low-priority for now. If XIVLauncher devs decide to unset TZ in the launcher itself, there will be no change to nixpkgs, otherwise, I'll put in a PR for the above override.

For FFXI, i'm still running tests.

njdom24 commented 6 months ago

I've found that this issue exists in all Steam games, or at least those launched with Proton.