forked from MagicBane/Server
45 lines
1.3 KiB
Markdown
45 lines
1.3 KiB
Markdown
# Race Handler Documentation
|
|||
|
|
|
||
|
|
## Overview
|
||
|
|
This document describes the database relationships and interactions for the `dbRaceHandler` class. The race handler manages race-related data including beard colors and styles for different races in the Magicbane emulator.
|
||
|
|
|
||
|
|
## Handler Class
|
||
|
|
**File:** `src/engine/db/handlers/dbRaceHandler.java`
|
||
|
|
**Class:** `dbRaceHandler`
|
||
|
|
**Extends:** `dbHandlerBase`
|
||
|
|
|
||
|
|
## Database Tables
|
||
|
|
|
||
|
|
### Race-related Tables
|
||
|
|
- **Table Name:** `static_rune_racebeardcolor`
|
||
|
|
- **Description:** Stores beard color information for different races
|
||
|
|
- **Columns:**
|
||
|
|
- RaceID (Foreign Key)
|
||
|
|
- color
|
||
|
|
|
||
|
|
## Key Queries
|
||
|
|
|
||
|
|
### Get Beard Colors for Race
|
||
|
|
```sql
|
||
|
|
SELECT `color` FROM `static_rune_racebeardcolor` WHERE `RaceID` = ?
|
||
|
|
```
|
||
|
|
**File:** `dbRaceHandler.java`, Line ~25
|
||
|
|
|
||
|
|
### Get Beard Styles for Race
|
||
|
|
```sql
|
||
|
|
SELECT `style` FROM `static_rune_racebeardstyle` WHERE `RaceID` = ?
|
||
|
|
```
|
||
|
|
**File:** `dbRaceHandler.java`, Line ~40
|
||
|
|
|
||
|
|
## Relationships
|
||
|
|
|
||
|
|
1. **Race to Beard Colors:** One-to-many (via `static_rune_racebeardcolor.RaceID`)
|
||
|
|
2. **Race to Beard Styles:** One-to-many (via `static_rune_racebeardstyle.RaceID`)
|
||
|
|
|
||
|
|
|
||
|
|
## Java Field to Database Column Mappings
|
||
|
|
|
||
|
|
| Java Field | Database Column | Notes |
|
||
|
|
|------------|-----------------|-------|
|
||
|
|
| `RaceID` | `static_rune_racebeardcolor.RaceID` | Foreign key to race |
|
||
|
|
| `color` | `static_rune_racebeardcolor.color` | Beard color value |
|