Skip to content

Conversation

@CarlosNahuelcoy
Copy link
Contributor

Overview

This PR enhances the Player2 integration by adding automatic detection of the Player2 desktop application, providing users with two convenient options for Player2 authentication:

  1. 🎯 Automatic (Recommended): Zero-config experience via local Player2 app
  2. 🔑 Manual: Traditional API key method via web tool

Changes Made

Core Implementation

  • Player2Client.cs: Added CreateAsync() factory method with local app detection
  • ApiConfig.cs: Modified IsValid() to allow Player2 without manual API key
  • Settings.cs: Added immediate status feedback when Player2 is selected
  • AIClientFactory.cs: Updated to use new async Player2 client creation

User Experience Improvements

  • Immediate feedback: Users get instant notification about Player2 app status
  • Clear messaging: Distinct notifications for successful detection vs. setup needed
  • Graceful fallback: Seamlessly falls back to manual API key if app unavailable
  • Zero-config option: When Player2 app is running, no manual setup required

Player2 Integration Options

Option 1: Automatic Detection (Zero-Config) ⭐

  • Download Player2 app: https://player2.game/
  • Install and login to Player2 desktop application
  • Select Player2 in RimTalk → Automatic detection and connection
  • No API key needed - everything works automatically

Option 2: Manual API Key

Technical Details

  • Local detection: Health check to localhost:4315 with 2-second timeout
  • Authentication: Uses Player2's web login endpoint for local app integration
  • Health checks: Optimized to only run for remote connections
  • Game Client ID: Maintains existing 019a8368-b00b-72bc-b367-2825079dc6fb
  • Backward compatibility: Existing Player2 setups continue working unchanged

Benefits

Better UX: Automatic setup reduces friction for new users
Reduced support: Fewer API key related questions and issues
Modern approach: Leverages Player2's intended local app experience
Flexible: Maintains manual option for users who prefer it
Professional: Clear status feedback and error handling

Testing

  • Local Player2 app detection works correctly
  • Fallback to manual API key functions properly
  • Settings show immediate status feedback
  • Backward compatibility maintained
  • Error handling for various scenarios
  • Health checks work for both local and remote connections

Screenshots/Demo

Users will see:

  • ✅ "Player2 desktop app detected and ready for use!" (when app running)
  • ⚠️ "Player2 desktop app not detected. Install Player2 app or add API key manually." (when app not available)

Note: This enhancement makes Player2 significantly more user-friendly while maintaining full backward compatibility. Users can choose the method that works best for their setup.

Sorry, something went wrong.

- Implement automatic Player2 desktop app detection
- Add fallback to manual API key when app not running
- Provide immediate status feedback in settings
- Optimize health checks for local vs remote connections
- Maintain backward compatibility with existing Player2 integration

Benefits:
- Zero-config experience when Player2 app is installed
- Clear user feedback about Player2 availability
- Reduced support burden for API key setup
@jlibrary
Copy link
Owner

LGTM 👍 Merging.

@jlibrary jlibrary merged commit 3efce3b into jlibrary:main Nov 26, 2025
benny30912 pushed a commit to benny30912/RimTalk that referenced this pull request Dec 20, 2025

Unverified

The signature in this commit could not be verified. Someone may be trying to trick you.
…ocal-app-detection

feat: Add Player2 local app auto-detection with manual API key fallback
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.

None yet

2 participants