Files
rr3-server/RR3CommunityServer/Models/ApiModels.cs
Daniel Elliott 934fa51524 Add Complete Game Progression System
MAJOR UPDATE - Full game systems based on APK analysis:

CAR SYSTEM:
- Purchase cars with Gold or Cash
- 5 starter cars across all classes (C,B,A,S,R)
- Car database with manufacturers and performance ratings
- Garage management and inventory tracking

UPGRADE SYSTEM:
- 5 upgrade types (Engine, Tires, Suspension, Brakes, Drivetrain)
- Progressive Performance Rating increases
- Cash-based upgrade economy
- Per-car upgrade tracking

PROGRESSION SYSTEM:
- Experience Points and leveling (1000 XP per level)
- Level-up rewards (10 Gold + 5K Cash)
- Reputation tracking
- Complete player profile management

CAREER MODE:
- Career series and event tracking
- Star rating system (1-3 stars per event)
- Best time tracking
- Star-based rewards (10G/2KC/100XP per star)

ECONOMY:
- Balanced F2P progression
- ~350 Gold + \ daily earning potential
- Fair pricing for cars and upgrades
- Multiple currency sources

NEW ENDPOINTS:
- GET /synergy/progression/player/{id} - Player profile
- POST /synergy/progression/player/{id}/update - Update stats
- POST /synergy/progression/car/purchase - Buy cars
- POST /synergy/progression/car/upgrade - Upgrade cars
- POST /synergy/progression/career/complete - Finish events

DATABASE:
- Cars table - Vehicle catalog
- OwnedCars table - Player garage
- CarUpgrades table - Upgrade options
- CareerProgress table - Event completion
- User table extended with Level/XP/Reputation

SEEDED DATA:
- 5 cars (Nissan Silvia to McLaren P1 GTR)
- 5 upgrades for starter car
- Time trials and gold packages from previous update

This creates a COMPLETE single-player experience with:
✓ Daily rewards + time trials
✓ Car ownership + garage
✓ Upgrade system
✓ Career progression
✓ Level/XP system
✓ Full economy

Based on actual RR3 game analysis!

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-17 22:21:36 -08:00

123 lines
3.7 KiB
C#

namespace RR3CommunityServer.Models;
// Progression request/response models
public class ProgressionUpdate
{
public int? GoldEarned { get; set; }
public int? CashEarned { get; set; }
public int? ExperienceEarned { get; set; }
public int? ReputationEarned { get; set; }
}
public class CarPurchaseRequest
{
public string SynergyId { get; set; } = string.Empty;
public string CarId { get; set; } = string.Empty;
public bool UseGold { get; set; } = false;
}
public class CarUpgradeRequest
{
public string SynergyId { get; set; } = string.Empty;
public string CarId { get; set; } = string.Empty;
public string UpgradeType { get; set; } = string.Empty; // engine, tires, suspension, etc.
}
public class CareerEventCompletion
{
public string SynergyId { get; set; } = string.Empty;
public string SeriesName { get; set; } = string.Empty;
public string EventName { get; set; } = string.Empty;
public int StarsEarned { get; set; } // 1-3 stars
public double RaceTime { get; set; }
}
// Standard Synergy API response wrapper
public class SynergyResponse<T>
{
public int resultCode { get; set; } = 0; // 0 = success, negative = error
public string? message { get; set; }
public T? data { get; set; }
}
// User models
public class DeviceIdResponse
{
public string deviceId { get; set; } = string.Empty;
public string synergyId { get; set; } = string.Empty;
public long timestamp { get; set; }
}
public class AnonUidResponse
{
public string anonUid { get; set; } = string.Empty;
public long expiresAt { get; set; }
}
// Product/Catalog models
public class CatalogItem
{
public string itemId { get; set; } = string.Empty;
public string sku { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
public string description { get; set; } = string.Empty;
public string category { get; set; } = string.Empty;
public decimal price { get; set; }
public string currency { get; set; } = "USD";
public Dictionary<string, object> metadata { get; set; } = new();
}
public class CatalogCategory
{
public string categoryId { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
public List<string> itemIds { get; set; } = new();
}
// DRM models
public class DrmNonceResponse
{
public string nonce { get; set; } = string.Empty;
public long expiresAt { get; set; }
}
public class PurchasedItem
{
public string itemId { get; set; } = string.Empty;
public string sku { get; set; } = string.Empty;
public string orderId { get; set; } = string.Empty;
public long purchaseTime { get; set; }
public string token { get; set; } = string.Empty;
}
public class PurchaseVerificationRequest
{
public string receipt { get; set; } = string.Empty;
public string signature { get; set; } = string.Empty;
public string sku { get; set; } = string.Empty;
public string orderId { get; set; } = string.Empty;
}
// Tracking models
public class TrackingEvent
{
public string eventType { get; set; } = string.Empty;
public long timestamp { get; set; }
public Dictionary<string, object> properties { get; set; } = new();
}
// Director/Service Discovery
public class DirectorResponse
{
public Dictionary<string, string> serverUrls { get; set; } = new()
{
{ "synergy.product", "https://localhost:5001" },
{ "synergy.drm", "https://localhost:5001" },
{ "synergy.user", "https://localhost:5001" },
{ "synergy.tracking", "https://localhost:5001" },
{ "synergy.s2s", "https://localhost:5001" }
};
public string environment { get; set; } = "COMMUNITY";
public string version { get; set; } = "1.0.0";
}