Skip to content

Conversation

@bas3line
Copy link
Owner

No description provided.

@greptile-apps
Copy link

greptile-apps bot commented Jan 19, 2026

Make sure you do the changes Sensei

Greptile Summary

Implements privacy mode feature across all platforms (macOS, Windows, Linux) to hide server addresses from Discord Rich Presence. Users can toggle privacy mode via UI menu or CLI arguments (--Privacy ON/OFF). Settings persist to ~/.hytale-rpc/settings.json.

Key Changes:

  • Added get_privacy_mode() function in all log watcher modules to read settings from JSON config
  • Updated get_presence() methods to conditionally hide server addresses when privacy mode is enabled
  • Added UI toggles in macOS menu bar and Windows system tray with visual state indicators
  • Added CLI argument handling in all entry point files
  • Updated pypresence imports to use pypresence.presence.Presence for consistency
  • Added comprehensive documentation in README with platform-specific instructions

Issues Found:

  • Critical: src/log_watcher.py has hardcoded macOS path that breaks Linux functionality
  • Minor: Unused config variables (PRIVACY_MODE, HIDE_SERVER_ADDRESS) in config files
  • Minor: Inconsistent pypresence import in src/rpc_windows.py

Confidence Score: 3/5

  • Contains a critical bug that breaks Linux functionality, but safe for macOS/Windows
  • The hardcoded macOS path in src/log_watcher.py:23 will prevent the application from finding Hytale logs on Linux systems. This is a critical issue for Linux users. Additional minor issues include unused variables and inconsistent imports that don't affect functionality but reduce code quality.
  • Critical attention needed for src/log_watcher.py (hardcoded path breaks Linux). Review src/rpc_windows.py for import inconsistency.

Important Files Changed

Filename Overview
src/config.py Added unused PRIVACY_MODE constant (never referenced)
src/config_macos.py Added unused HIDE_SERVER_ADDRESS constant
src/config_windows.py Added unused HIDE_SERVER_ADDRESS constant
src/log_watcher.py Added privacy mode logic and get_privacy_mode() function, but hardcoded macOS path breaks Linux/Windows
src/rpc_windows.py Inconsistent import - uses pypresence instead of pypresence.presence

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI/UI
    participant Config File
    participant LogWatcher
    participant RPC

    User->>CLI/UI: Toggle Privacy Mode
    CLI/UI->>Config File: Write privacy_mode to ~/.hytale-rpc/settings.json
    Config File-->>CLI/UI: Setting saved
    
    loop Every 3 seconds
        RPC->>LogWatcher: update()
        LogWatcher->>Config File: get_privacy_mode()
        Config File-->>LogWatcher: privacy_mode boolean
        LogWatcher->>LogWatcher: Parse game logs
        LogWatcher->>LogWatcher: get_presence()
        alt Privacy Mode Enabled
            LogWatcher-->>RPC: ("Playing Multiplayer", "Online")
        else Privacy Mode Disabled
            LogWatcher-->>RPC: ("Playing Multiplayer", "Server: play.example.com")
        end
        RPC->>RPC: Update Discord presence
    end
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (1)

  1. src/rpc_windows.py, line 3 (link)

    syntax: Inconsistent import - should be from pypresence.presence import Presence like other files.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

13 files reviewed, 6 comments

Edit Code Review Agent Settings | Greptile


CLIENT_ID = "1461306150497550376"

PRIVACY_MODE = False
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: PRIVACY_MODE variable added but never used in the codebase. All privacy logic reads from ~/.hytale-rpc/settings.json via get_privacy_mode() function in log watchers.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/config.py
Line: 7:7

Comment:
**style:** `PRIVACY_MODE` variable added but never used in the codebase. All privacy logic reads from `~/.hytale-rpc/settings.json` via `get_privacy_mode()` function in log watchers.

How can I resolve this? If you propose a fix, please make it concise.


CLIENT_ID = "1461306150497550376"

HIDE_SERVER_ADDRESS = False
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: HIDE_SERVER_ADDRESS variable added but never used in the codebase. All privacy logic reads from ~/.hytale-rpc/settings.json.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/config_macos.py
Line: 7:7

Comment:
**style:** `HIDE_SERVER_ADDRESS` variable added but never used in the codebase. All privacy logic reads from `~/.hytale-rpc/settings.json`.

How can I resolve this? If you propose a fix, please make it concise.


CLIENT_ID = "1461306150497550376"

HIDE_SERVER_ADDRESS = False
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: HIDE_SERVER_ADDRESS variable added but never used in the codebase. All privacy logic reads from ~/.hytale-rpc/settings.json.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/config_windows.py
Line: 7:7

Comment:
**style:** `HIDE_SERVER_ADDRESS` variable added but never used in the codebase. All privacy logic reads from `~/.hytale-rpc/settings.json`.

How can I resolve this? If you propose a fix, please make it concise.

return False


HYTALE_LOG_DIR = Path.home() / "Library/Application Support/Hytale/UserData/Logs"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Hardcoded macOS path in generic Linux/Windows log watcher - should use find_hytale_log_dir() from config.py instead.

Suggested change
HYTALE_LOG_DIR = Path.home() / "Library/Application Support/Hytale/UserData/Logs"
from .config import find_hytale_log_dir
HYTALE_LOG_DIR = find_hytale_log_dir()
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/log_watcher.py
Line: 23:23

Comment:
**logic:** Hardcoded macOS path in generic Linux/Windows log watcher - should use `find_hytale_log_dir()` from config.py instead.

```suggestion
from .config import find_hytale_log_dir
HYTALE_LOG_DIR = find_hytale_log_dir()
```

How can I resolve this? If you propose a fix, please make it concise.

from .log_watcher_macos import LogWatcher
else:
from .config import CLIENT_ID, HYTALE_PROCESS_NAMES, DISCORD_PROCESS_NAMES
from .config import CLIENT_ID, HYTALE_PROCESS_NAMES, DISCORD_PROCESS_NAMES, HIDE_SERVER_ADDRESS
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: HIDE_SERVER_ADDRESS imported but never used in this file.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/rpc_macos.py
Line: 8:8

Comment:
**style:** `HIDE_SERVER_ADDRESS` imported but never used in this file.

How can I resolve this? If you propose a fix, please make it concise.

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