# Burst Axis SDK — .NET only

Use the **C# / .NET** client for your EXE or mod. Python and C++ folders are kept for reference only — **do not use them for new projects**.

Logic guide: [AUTH_DATABASE_LOGIC.md](AUTH_DATABASE_LOGIC.md)

## Quick start (.NET 8)

1. Edit `csharp/src/Config.cs` (URL, app name, version, secret from **Manage Apps**).
2. Run the example:

```bash
cd sdk/csharp
dotnet run --project NewModAuth.Example.csproj
```

## Use in your own .NET app

**Option A — reference the class library**

```bash
cd sdk/csharp
dotnet build BurstAxis.Auth.csproj
```

Add reference to `BurstAxis.Auth.dll` (from `bin/Debug/net8.0/`) in your project, or add a project reference:

```xml
<ProjectReference Include="path\to\sdk\csharp\BurstAxis.Auth.csproj" />
```

**Option B — copy source files**

Copy into your project:

- `src/Config.cs`
- `src/HwidHelper.cs`
- `src/BurstAxisAuthClient.cs`

## Configure

| Setting | File | Field |
|---------|------|--------|
| Panel URL | `Config.cs` | `BaseUrl` |
| App name | `Config.cs` | `AppName` |
| Version | `Config.cs` | `AppVersion` |
| Secret | `Config.cs` | `IntegrationSecret` |

No trailing slash on `BaseUrl`.

## API methods (`BurstAxisAuthClient`)

| Method | Description |
|--------|-------------|
| `InitAsync()` | Validate app + secret + version |
| `CheckVersionAsync()` | Version check |
| `LoginAsync(user, pass, hwid?)` | Username + password (HWID auto if omitted) |
| `RegisterAsync(user, pass, license, hwid?)` | New user with license key |
| `LicenseAsync(license, hwid?)` | License-only login |
| `LoginFullAsync(user, pass)` | Init → version → login → session |
| `LicenseFullAsync(license)` | Init → version → license → session |
| `CheckSessionAsync()` | Validate session token |
| `UserInfoAsync()` | Subscription info |

`HwidHelper.GetDeviceId()` — send on every login (device lock 1/1 in panel).

## Auth flows

1. **Username + password** — `LoginFullAsync`
2. **Register + license** — `RegisterAsync` (first login activates duration)
3. **License key only** — `LicenseFullAsync`

## Common API errors (handle in your EXE)

| Message | Meaning |
|---------|---------|
| `Device limit reached` | Wrong PC — HWID does not match |
| `HWID required` | Send `hwid` parameter |
| `Subscription expired` | Account past end date |
| `Account banned` | Banned in panel |
| Owner/Admin/Reseller cannot log in | Staff account — panel only |

## Pending activation

Users/licenses created in panel start **Pending** until first app login. First successful login sets start/end dates and binds HWID.

## Projects

| Project | Purpose |
|---------|---------|
| `BurstAxis.Auth.csproj` | Class library (`net8.0`) for your app |
| `NewModAuth.Example.csproj` | Console example (`net8.0`) |

## Legacy

| Folder | Status |
|--------|--------|
| `csharp/` | **Use this** |
| `python/` | Deprecated — reference only |
| `cpp/` | Deprecated — reference only |
