Account Register & Password Recovery
Integrated Login Screen Account Management System
Tutorial Video
What is Account Register & Password Recovery?
This is a built-in account management system integrated directly into the game's login screen. Players can create new accounts and reset forgotten passwords without leaving the game client. The system features dark-themed modern UI, real-time validation, email verification support, and admin control toggles for enabling/disabling features.
How It Works
📝 Account Registration
- Access: Click "Register" button on game login screen
- Modern UI: Dark-themed popup window with green "A" icon header
- Required Fields: Username, Password, Email, Phone
- Validation: Username 4-16 characters, Password 6-32 characters, Email format check
- Duplicate Prevention: System checks for existing username/email
- Instant Feedback: Real-time error messages or success confirmation
- Quick Action: Register button (green) and Cancel button (gray)
🔐 Password Recovery
- Access: Click "Forgot Password?" link below registration form
- Reset Window: Dark-themed popup with blue "i" icon header
- Required Fields: Username, Old Password, New Password, Confirm Password
- Verification: Old password must match database for security
- Password Rules: New password 6-32 characters, must match confirmation
- Instant Update: Password changed immediately in database
- Action Buttons: Blue "Reset Password" button and gray "Cancel" button
🛡️ Security Features
- Input Validation: Client-side and server-side validation for all fields
- Password Verification: Old password required for reset - prevents unauthorized changes
- Duplicate Detection: Prevents multiple accounts with same username/email
- Admin Control: Toggle features on/off via AuthControl configuration
- Custom Messages: Configurable disabled messages when features are turned off
- Logging: All registration and reset attempts logged for security monitoring
Database Architecture
📊 TB_User Table (Account Database)
Purpose: Store all user account information
- JID: INT IDENTITY PRIMARY KEY - Unique account identifier
- StrUserID: VARCHAR(50) NOT NULL - Username (unique)
- Password: VARCHAR(50) NOT NULL - Hashed password
- EMail: VARCHAR(100) - Email address (unique)
- Phone: VARCHAR(20) - Phone number
- RegDate: DATETIME DEFAULT GETDATE() - Registration timestamp
Security: Passwords stored with hashing, duplicate username/email prevention enforced
⚙️ Stored Procedures
sp_RegisterAccount: Handle new account registration
- Parameters: @Username, @Password, @Email, @Phone
- Returns: 0 = Success, 1 = Username exists, 2 = Email exists, 3 = Database error
- Process: Validates uniqueness, inserts new account, returns status
sp_ResetPassword: Handle password reset with verification
- Parameters: @Username, @OldPassword, @NewPassword
- Returns: 0 = Success, 1 = Account not found, 2 = Old password incorrect, 3 = Database error
- Process: Verifies account exists, validates old password, updates to new password
Key Features
🎨 Modern Dark UI Design
- Consistent Theme: Dark background with blue borders matching login screen
- Icon Headers: Green "A" icon for registration, blue "i" icon for password reset
- Color-Coded Buttons: Green for positive actions (Register/Reset), gray for Cancel
- Input Fields: Clean bordered text boxes with labels
- Smooth Animations: Popup windows with fade-in effects
- Close Button: X button in top-right corner for quick dismissal
✅ Comprehensive Validation
- Username Rules: 4-16 characters, alphanumeric
- Password Rules: 6-32 characters minimum length
- Email Validation: Proper email format checking
- Duplicate Prevention: Username and email uniqueness enforced
- Real-Time Feedback: Instant error messages for invalid inputs
- Password Confirmation: Confirm password must match new password for reset
🔐 Security & Admin Control
- Toggle Features: Enable/disable registration and password reset independently
- Custom Messages: Configure messages shown when features are disabled
- Old Password Verification: Reset requires old password - prevents unauthorized changes
- Logging System: All attempts logged with username, IP, and result
- Database Validation: Server-side checks prevent SQL injection
- Admin Override: Administrators can manually manage accounts via database
⚡ Instant & Seamless
- No Page Reload: All operations happen in popup windows
- Instant Registration: Accounts created immediately - ready to play
- Quick Password Reset: Password changed instantly - log in right away
- No External Tools: Everything integrated in game client
- User-Friendly: Simple forms with clear instructions
- Error Recovery: Clear error messages guide users to fix issues
Admin Configuration
Auth Control Settings
Configure registration and password reset features via Auth Control tab:
- AllowRegistration: true = enable registration, false = disable (default: true)
- RegistrationDisabledMessage: Custom message shown when registration disabled
- AllowPasswordReset: true = enable password reset, false = disable (default: true)
- PasswordResetDisabledMessage: Custom message shown when reset disabled
- Use Cases: Disable during maintenance, closed beta testing, or private servers
Example Configuration
Common configuration scenarios:
| Scenario | AllowRegistration | AllowPasswordReset |
|---|---|---|
| Public Server | ✅ true | ✅ true |
| Closed Beta | ❌ false | ✅ true |
| Maintenance Mode | ❌ false | ❌ false |
| Private Server | ❌ false | ✅ true |
Player Guide
How to Create New Account
- Launch Game: Start the game client and reach the login screen
- Click Register: Click "Register" button at bottom of login screen
- Registration Window Opens: Dark popup with green "A" icon appears
- Enter Username: Type your desired username (4-16 characters)
- Enter Password: Type a secure password (6-32 characters)
- Enter Email: Provide your email address (optional but recommended)
- Enter Phone: Provide phone number (optional)
- Click Register: Press green "Register" button
- Success! Message appears: "Registration successful!"
- Login: Use your new username and password to log in immediately
How to Reset Password
- Launch Game: Start the game client and reach the login screen
- Click Register: Click "Register" button first
- Click Forgot Password: Click "Forgot Password?" link below registration form
- Reset Window Opens: Dark popup with blue "i" icon appears
- Enter Username: Type your account username
- Enter Old Password: Type your current password (for security verification)
- Enter New Password: Type your desired new password (6-32 characters)
- Confirm Password: Re-type new password to confirm
- Click Reset: Press blue "Reset Password" button
- Success! Message appears: "Password reset successful!"
- Login: Use your username and new password to log in
Response Codes & Error Messages
Registration Response Codes
| Code | Message | Meaning |
|---|---|---|
| 0 | Registration successful! | ✅ Account created |
| 1 | Username already exists | ❌ Choose different username |
| 2 | Email already registered | ❌ Email in use |
| 3 | Registration disabled / Error | ❌ System error or disabled |
| 4 | Username must be 4-16 characters | ❌ Invalid username length |
| 5 | Password must be 6-32 characters | ❌ Invalid password length |
| 6 | Invalid email format | ❌ Email format wrong |
Password Reset Response Codes
| Code | Message | Meaning |
|---|---|---|
| 0 | Password reset successful! | ✅ Password changed |
| 1 | Account not found | ❌ Username doesn't exist |
| 2 | Old password is incorrect | ❌ Wrong old password |
| 3 | Password reset disabled / Error | ❌ System error or disabled |
| 4 | Invalid username | ❌ Username format wrong |
| 5 | Old password is required | ❌ Must provide old password |
| 6 | New password must be 6-32 characters | ❌ Invalid new password |
Tips & Best Practices
👥 For Players
- Strong Passwords: Use combination of letters, numbers for security
- Remember Email: Provide valid email during registration for future support
- Username Choice: Choose memorable username - cannot be changed later
- Old Password Required: Keep your old password until reset is confirmed successful
- Immediate Login: After registration/reset, you can log in right away
- Case Sensitivity: Username and password are case-sensitive
✅ For Server Administrators
- Enable for Public Servers: Keep both features enabled for convenience
- Disable for Closed Beta: Turn off registration during testing phases
- Monitor Logs: Check registration logs regularly for spam accounts
- Custom Messages: Configure helpful disabled messages for players
- Database Backups: Regular backups of TB_User table recommended
- Email Uniqueness: Email validation prevents multiple accounts per user
- Security Testing: Test both features after server setup
⚠️ Important Notes
- Old Password Requirement: Password reset requires old password for security
- No Email Recovery: Current system doesn't support email-based recovery
- Instant Changes: Password changes take effect immediately
- Username Uniqueness: Cannot create duplicate usernames
- Email Uniqueness: One email per account only
- No Username Changes: Usernames cannot be changed after registration
- Admin Access: Administrators can manually reset passwords via database if needed
Summary
The Account Register & Password Recovery system provides a seamless, integrated solution for account management directly within the game client. Players can create accounts and reset passwords without leaving the game, while administrators maintain full control through simple toggle switches!
Core Advantages
- Integrated UI: Dark-themed popups matching login screen design
- Instant Registration: Create accounts and play immediately - no website needed
- Secure Password Reset: Old password verification prevents unauthorized changes
- Comprehensive Validation: Client and server-side checks for all inputs
- Admin Control: Toggle features on/off with custom disabled messages
- Complete Logging: All registration and reset attempts logged for security
- User-Friendly: Clear error messages and smooth user experience
Perfect For
Public Servers: Enable registration for easy player onboarding
Closed Communities: Disable registration, enable password reset only
Self-Service: Players manage accounts without admin intervention
Convenience: Everything done in-game without external websites
Security: Old password verification ensures account safety
🔐 Account Management, Simplified 🔐
No websites, no external tools - just open the game and go!
Register, reset, and play - all from the login screen.
X9 Filter - Professional Silkroad Online Enhancement Suite
Seamless account management for modern gaming servers
0 Comments