Skip to content

Refactor voice chat, bot logging, and in-game settings menu - #10

Open
Arcdashckr wants to merge 3 commits into
DevGreem:contributionfrom
Arcdashckr:master
Open

Refactor voice chat, bot logging, and in-game settings menu#10
Arcdashckr wants to merge 3 commits into
DevGreem:contributionfrom
Arcdashckr:master

Conversation

@Arcdashckr

Copy link
Copy Markdown

Summary

This PR significantly refactors the voice chat persistence, configuration structure, and Discord bot/channel synchronization logic.

Per-save persistence overhaul

  • Moved runtime voice/chat state out of the global config into dedicated per-save JSON files:

    • data/{SaveName}_{SaveId}/players.json
    • data/{SaveName}_{SaveId}/channels.json
  • Added in-memory caches for faster and safer access:

    • LocationChannelsCache
    • PlayerDataCache
  • Added helper utilities for:

    • per-save file read/write operations
    • save-folder name sanitization
    • tracking the active save directory (CurrentSaveDataFolder)
  • Player mute/deafen state and location channel mappings are now persisted independently for each save.

  • Added safer handling when returning to title, including best-effort save-folder migration/move logic.

Voice chat & bot configuration rework

  • Reorganized and renamed config fields for clarity and consistency:

    • team defaults (None)
    • mute/deafen options
    • voice hotkeys
    • keybinds
    • Discord category/channel IDs
  • Updated the config.json schema and expanded i18n coverage with many new translation keys.

  • Removed GMCM mute/deafen options since those settings are now save-specific.

Discord bot improvements

  • Improved startup flow, logging, and error handling.

  • Added safer channel creation and lookup logic with additional try/catch coverage.

  • Added retries and channel-ID overload support to MoveToVoice.

  • Improved location synchronization logic:

    • merge/reset/broadcast location channels
    • synchronized channel mapping between players
  • Voice channels are now tracked strictly by Discord channel ID instead of channel name.

  • Added support for:

    • four selectable team roles (Blue, Green, Red, Yellow)
    • separate channels for cabins

Networking & messaging

  • Added new message types:

    • PlayerWarpedWithChannel
    • LocationChannelsSynced
  • Warp/location updates can now include channel IDs when available.

  • Improved synchronization of location channel maps across connected players.

UI & UX

  • Reworked the GMCM layout into separate pages:

    • User
    • Voice Chat
    • Bot
  • Added keybind configuration pages and cleaned up the in-game settings UI.

  • Minor logging/message formatting cleanup and improved informational messages throughout the mod.

Miscellaneous

  • Tightened nullability/signature checks.
  • Updated README documentation to reflect the new save-specific persistence and configuration behavior.

Arcdashckr added 3 commits May 9, 2026 14:49
Regardless of the name of the voice channel created, it always checks its ID.

Four team roles (blue, green, red, yellow) can be selected, and the cabinets have separate channels.

I added tabs to the in-game settings menu and tidied it up a bit.

I also tried removing the mute and deafen buttons, but it didn't really work.
Rework voice-chat configuration and bot behavior: rename and reorganize Bot/User config fields (Team default 'None', Muted/Deafen, EnableVoiceHotkeys, keybinds, category/channel IDs), update config.json schema, and add many i18n keys.

Improve Discord bot startup and logging with robust error handling, translations, and StardewModdingAPI log level mapping. Add retries and a channel-ID overload to MoveToVoice, MergeLocations logic, Reset/Broadcast location channels, and safer channel creation flow.

Extend messaging and ModEntry handling: new MessageTypes (PlayerWarpedWithChannel, LocationChannelsSynced), broadcast/receive location channel maps, send warp messages with channel IDs when available, and GMCM UI rework (separate pages for user/voice-chat/bot, keybinds and options).
Move per-save state out of global config into dedicated per-save JSON files (data/{SaveName}_{SaveId}/players.json and channels.json). Add in-memory caches (LocationChannelsCache, PlayerDataCache) and helper methods to read/write per-save files, sanitize save folder names, and keep CurrentSaveDataFolder. Persist player mute/deafen state and channel mappings per save; update Bot and ModEntry logic to use caches, persist changes, and attempt safe moves on return-to-title. Refactor several nullability/signature checks and tighten error handling (try/catch around file and lookup ops), remove GMCM options for mute/deafen (now per-save), and update README to reflect new behavior and configuration. Also minor logging formatting cleanups and informational messages adjusted.
@Arcdashckr Arcdashckr mentioned this pull request May 16, 2026
@DevGreem DevGreem self-assigned this May 20, 2026
@DevGreem

DevGreem commented May 20, 2026

Copy link
Copy Markdown
Owner

@Arcdashckr Can you change the base branch to merge it into the tests branch?

EDIT: Forget it, I can change it.

@DevGreem
DevGreem changed the base branch from master to contribution June 10, 2026 05:30
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 this pull request may close these issues.

2 participants