Supported Account Types
TheAccountManager (features/account/AccountManager.kt:48) supports multiple authentication methods:
- Microsoft Accounts - Official Microsoft/Xbox authentication
- Cracked Accounts - Offline mode accounts for cracked servers
- Session Accounts - Use existing session tokens
- Altening Accounts - Integration with TheAltening service
Adding Accounts
Microsoft Account
Microsoft accounts use OAuth2 authentication flow:Initiate OAuth Flow
Call
newMicrosoftAccount() which opens a browser window for authentication (AccountManager.kt:177)- Profile key pair generation for secure authentication
- Session service creation
- Existing account replacement if the same account is added again
Cracked Account
For cracked/offline servers:- Username must not be empty
- Username must be 16 characters or less
- Account must not already exist in the list
Session Token
Import accounts using session tokens:Altening Account
Account Management
Switching Accounts
AtomicBoolean (AccountManager.kt:54).
Organizing Accounts
Events
The account system fires events for UI integration:AccountManagerLoginResultEvent- Login success/failureAccountManagerAdditionResultEvent- Account addition resultAccountManagerRemovalResultEvent- Account removal confirmationSessionEvent- Triggered when session changes
Configuration
Accounts are stored in the config system usingValueType.ACCOUNT (AccountManager.kt:50):
Security Features
- Profile Key Pairs: Automatic creation for secure server communication (AccountManager.kt:92-99)
- Service Integration: Proper session service and profile repository setup
- Token Management: Secure handling of access and refresh tokens
- Error Handling: Comprehensive error catching and event reporting