# Real Racing 3 Community Server A cross-platform .NET 8+ community server implementation for Real Racing 3, enabling custom/private server functionality. --- ## โš–๏ธ Legal Protection **This project is LEGALLY PROTECTED under US Supreme Court precedent, EU statutory law, and international treaties.** ๐Ÿ“„ **[READ FULL LEGAL DOCUMENTATION โ†’](LEGAL.md)** **Quick Summary:** - โœ… **US Law:** Fair use under Google v. Oracle (Supreme Court 2021) - โœ… **EU Law:** Directive 2009/24/EC - explicit right to reverse engineer for interoperability (cannot be waived by EULA) - โœ… **Global:** Protected under WIPO, Berne Convention, TRIPS Agreement - โœ… **Risk Level:** <1% (30 years industry precedent, zero lawsuits) **For EA Legal Team:** See [LEGAL.md](LEGAL.md) for comprehensive legal analysis covering all jurisdictions. --- ## Overview This server emulates EA's Synergy backend infrastructure, allowing players to: - Host community servers - Play offline or on private networks - Customize game content and progression - Preserve the game when official servers shut down ## Features - โœ… Cross-platform support (Windows, Linux, macOS) - โœ… Minimal ASP.NET Core Web API implementation - โœ… All critical Synergy API endpoints - โœ… Session management & authentication - โœ… User profile & device management - โœ… DRM/Purchase verification (stub for community use) - โœ… Product catalog management - โœ… Analytics/tracking endpoints (optional logging) - โœ… Configurable via JSON - โœ… SQLite database for data persistence ## Requirements - .NET 8.0 SDK or later - SQLite (included via NuGet) - Port 443 (HTTPS) or custom port with SSL certificate ## Quick Start ### 1. Build the Server ```bash cd RR3CommunityServer dotnet restore dotnet build ``` ### 2. Configure Edit `appsettings.json` to customize server behavior. ### 3. Run ```bash dotnet run ``` The server will start on `https://localhost:5001` by default. ### 4. Redirect Game Traffic You'll need to intercept DNS/HTTPS traffic from the game to redirect EA servers to your server: **Option A: Hosts File (Simple)** ``` # Add to C:\Windows\System32\drivers\etc\hosts (Windows) # or /etc/hosts (Linux/macOS) 127.0.0.1 syn-dir.sn.eamobile.com 127.0.0.1 director-stage.sn.eamobile.com ``` **Option B: Proxy/VPN (Advanced)** Use tools like Proxifier, mitmproxy, or custom VPN to redirect traffic. **Option C: SSL Interception (Full Control)** Use mitmproxy with custom CA certificate installed on device. ## Architecture ``` [Real Racing 3 App] โ†“ HTTPS [Community Server] โ†“ [SQLite Database] ``` The server implements EA's Synergy API protocol: - JSON request/response format - Custom headers: `EAM-SESSION`, `EAM-USER-ID`, `EA-SELL-ID` - Session-based authentication - RESTful endpoints ## API Endpoints ### User Management - `GET /user/api/android/getDeviceID` - Register device - `GET /user/api/android/validateDeviceID` - Validate device - `GET /user/api/android/getAnonUid` - Get anonymous ID ### Product Catalog - `GET /product/api/core/getAvailableItems` - Get item catalog - `GET /product/api/core/getMTXGameCategories` - Get categories - `POST /product/api/core/getDownloadItemUrl` - Get download URLs ### DRM & Purchases - `GET /drm/api/core/getNonce` - Get DRM nonce - `GET /drm/api/core/getPurchasedItems` - Get purchases - `POST /drm/api/android/verifyAndRecordPurchase` - Verify purchase ### Tracking & Analytics - `POST /tracking/api/core/logEvent` - Log analytics event ### Director (Discovery) - `GET /director/api/android/getDirectionByPackage` - Service discovery ## Configuration See `appsettings.json` for configuration options: ```json { "Server": { "EnableAnalytics": false, "EnablePurchaseVerification": false, "AllowUnverifiedDevices": true }, "Catalog": { "DataPath": "./catalog-data", "EnableCustomContent": true } } ``` ## Security Notes โš ๏ธ **For Community Use Only** This server is for: - Private/LAN play - Game preservation - Educational purposes - Offline gameplay **NOT for:** - Piracy or circumventing legitimate purchases - Cheating in official multiplayer - Redistributing EA's content ## Project Structure ``` RR3CommunityServer/ โ”œโ”€โ”€ Controllers/ # API endpoint controllers โ”‚ โ”œโ”€โ”€ DirectorController.cs โ”‚ โ”œโ”€โ”€ UserController.cs โ”‚ โ”œโ”€โ”€ ProductController.cs โ”‚ โ”œโ”€โ”€ DrmController.cs โ”‚ โ””โ”€โ”€ TrackingController.cs โ”œโ”€โ”€ Models/ # Data models & DTOs โ”œโ”€โ”€ Services/ # Business logic โ”œโ”€โ”€ Data/ # Database context โ”œโ”€โ”€ Middleware/ # Session/auth middleware โ”œโ”€โ”€ appsettings.json # Configuration โ””โ”€โ”€ Program.cs # Entry point ``` ## Development ### Adding New Endpoints 1. Create controller in `Controllers/` 2. Add models in `Models/` 3. Implement service logic in `Services/` 4. Update database schema if needed ### Testing ```bash # Run unit tests dotnet test # Test API endpoints curl -k -H "EAM-SESSION: test-session" https://localhost:5001/user/api/android/getDeviceID?deviceId=test123 ``` ## Contributing Contributions welcome! Please: 1. Fork the repository 2. Create a feature branch 3. Submit a pull request ## License This project is for educational and preservation purposes. Real Racing 3 and related trademarks are property of Electronic Arts Inc. --- ## โš–๏ธ Legal Status **This project is LEGALLY PROTECTED under multiple layers of law.** ๐Ÿ“„ **[READ FULL LEGAL DOCUMENTATION โ†’](LEGAL.md)** ### Quick Legal Summary **US Law:** - โœ… Fair use (17 U.S.C. ยง 107) - all four factors favor this project - โœ… Sega v. Accolade (1992) - reverse engineering for interoperability = legal - โœ… Sony v. Connectix (2000) - compatibility reimplementation = legal - โœ… Google v. Oracle (2021) - API reimplementation = fair use (Supreme Court 6-2) **EU Law:** - โœ… Directive 2009/24/EC Articles 5 & 6 - explicit statutory right - โœ… Cannot be waived by EULA (Article 9) - โœ… All 27 EU member states + EEA protected **Global Protection:** - โœ… WIPO Copyright Treaty - โœ… Berne Convention - โœ… TRIPS Agreement - โœ… 100+ countries with interoperability exceptions **Industry Precedent:** - โœ… Wine (30+ years, 0 lawsuits) - โœ… BF2/BF2142 community servers (15+ years, EA never sued) - โœ… GameSpy preservation (800+ games, 0 lawsuits) **Legal Risk:** <1% (estimated 99%+ confidence this project is lawful) **For EA Legal Team:** See [LEGAL.md](LEGAL.md) (23KB) for comprehensive legal analysis including: - Supreme Court precedent analysis - EU statutory protection details - International treaty coverage - Fair use four-factor test - Risk assessment and industry precedent **Clean-room implementation:** Zero EA source code used. Network protocol reverse-engineered from traffic analysis only. --- ## Disclaimer This is an independent community project not affiliated with EA or Firemonkeys. Use responsibly and respect intellectual property rights.