Complete documentation for all 44 database handlers with centralized performance considerations
This commit is contained in:
+8203
File diff suppressed because one or more lines are too long
+87
@@ -0,0 +1,87 @@
|
||||
# Account Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbAccountHandler` class. The account handler manages user authentication and account-related data in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbAccountHandler.java`
|
||||
**Class:** `dbAccountHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Account Table
|
||||
- **Table Name:** `obj_account`
|
||||
- **Description:** Core account information including login credentials, status, and account details
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- username
|
||||
- password
|
||||
- email
|
||||
- accountStatus
|
||||
- lastLogin
|
||||
- creationDate
|
||||
- isBanned
|
||||
- banReason
|
||||
- isDeleted
|
||||
- deletedDate
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_account_wipe` | Account wipe history records | AccountID → obj_account.UID |
|
||||
| `dyn_login_history` | Login attempt and session history | AccountID → obj_account.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Account by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_account` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbAccountHandler.java`, Line ~60
|
||||
|
||||
### Get Account by Username
|
||||
```sql
|
||||
SELECT * FROM `obj_account` WHERE `username`=?
|
||||
```
|
||||
**File:** `dbAccountHandler.java`, Line ~85
|
||||
|
||||
### Create New Account
|
||||
```sql
|
||||
INSERT INTO `obj_account` (`username`, `password`, `email`, `accountStatus`, `creationDate`) VALUES (?, ?, ?, ?, ?)
|
||||
```
|
||||
**File:** `dbAccountHandler.java`, Line ~105
|
||||
|
||||
### Update Account Status
|
||||
```sql
|
||||
UPDATE `obj_account` SET `accountStatus`=?, `lastLogin`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbAccountHandler.java`, Line ~132
|
||||
|
||||
### Check Username Availability
|
||||
```sql
|
||||
SELECT `username` FROM `obj_account` WHERE `username`=?
|
||||
```
|
||||
**File:** `dbAccountHandler.java`, Line ~158
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Account to Character:** One-to-many (via `obj_character.accountID` field)
|
||||
2. **Account to Account Wipe History:** One-to-many (via `obj_account_wipe.AccountID`)
|
||||
3. **Account to Login History:** One-to-many (via `dyn_login_history.AccountID`)
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `username` | `obj_account.username` | Unique account username |
|
||||
| `password` | `obj_account.password` | Encrypted password |
|
||||
| `email` | `obj_account.email` | Account email address |
|
||||
| `accountStatus` | `obj_account.accountStatus` | Current account status |
|
||||
| `lastLogin` | `obj_account.lastLogin` | Timestamp of last login |
|
||||
| `creationDate` | `obj_account.creationDate` | Account creation date |
|
||||
| `isBanned` | `obj_account.isBanned` | Boolean flag for banned status |
|
||||
| `banReason` | `obj_account.banReason` | Reason for ban |
|
||||
| `isDeleted` | `obj_account.isDeleted` | Boolean flag for deleted status |
|
||||
| `deletedDate` | `obj_account.deletedDate` | Timestamp of deletion |
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
# dbBaneHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbBaneHandler` class. The bane handler manages special objects in cities that have specific properties and behaviors, including their ownership, location, and time-based effects.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbBaneHandler.java`
|
||||
**Class:** `dbBaneHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Bane Table
|
||||
- **Table Name:** `dyn_banes`
|
||||
- **Description:** Stores information about bane objects placed in cities, including their owner, location, and time-based properties
|
||||
- **Columns:**
|
||||
- cityUUID (Primary Key)
|
||||
- ownerUUID
|
||||
- stoneUUID
|
||||
- placementDate
|
||||
- liveDate
|
||||
|
||||
## Key Queries
|
||||
|
||||
### CREATE_BANE
|
||||
```sql
|
||||
INSERT INTO `dyn_banes` (`cityUUID`, `ownerUUID`, `stoneUUID`, `placementDate`) VALUES(?,?,?,?)
|
||||
```
|
||||
**File:** `dbBaneHandler.java`, Line ~17
|
||||
|
||||
### LOAD_BANE
|
||||
```sql
|
||||
SELECT * FROM `dyn_banes` WHERE `dyn_banes`.`cityUUID` = ?
|
||||
```
|
||||
**File:** `dbBaneHandler.java`, Line ~30
|
||||
|
||||
### SET_BANE_TIME
|
||||
```sql
|
||||
UPDATE `dyn_banes` SET `liveDate`=? WHERE `cityUUID`=?
|
||||
```
|
||||
**File:** `dbBaneHandler.java`, Line ~45
|
||||
|
||||
### REMOVE_BANE
|
||||
```sql
|
||||
DELETE FROM `dyn_banes` WHERE `cityUUID` = ?
|
||||
```
|
||||
**File:** `dbBaneHandler.java`, Line ~57
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Bane to City:** One-to-one relationship via cityUUID (primary key) referencing obj_city.UID
|
||||
2. **Bane to Owner:** Many-to-one relationship via ownerUUID referencing obj_character.UID
|
||||
3. **Bane to Stone:** Many-to-one relationship via stoneUUID referencing obj_building.UID
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `cityUUID` | `dyn_banes.cityUUID` | Unique identifier for the city where bane is placed |
|
||||
| `ownerUUID` | `dyn_banes.ownerUUID` | Character UID of the owner of this bane |
|
||||
| `stoneUUID` | `dyn_banes.stoneUUID` | Building UID of the stone used to create this bane |
|
||||
| `placementDate` | `dyn_banes.placementDate` | Timestamp when bane was placed |
|
||||
| `liveDate` | `dyn_banes.liveDate` | Timestamp for when bane becomes active |
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
# dbBaseClassHandler Documentation
|
||||
|
||||
## Overview
|
||||
The `dbBaseClassHandler` is responsible for managing base class data in the Magicbane database. Base classes represent fundamental character classifications that define core attributes and capabilities. This handler manages retrieval of base class information, including fetching specific base classes by ID, retrieving base classes associated with a particular race, and getting all available base classes.
|
||||
|
||||
## Database Table Structure
|
||||
|
||||
### Table: `static_rune_baseclass`
|
||||
|
||||
| Column Name | Data Type | Nullable | Key | Description |
|
||||
|-------------|-----------|----------|-----|-------------|
|
||||
| ID | int unsigned | NO | PRIMARY | Unique identifier for the base class |
|
||||
| name | varchar(45) | NO | | Name of the base class |
|
||||
| description | varchar(200) | NO | | Description of the base class |
|
||||
| strMod | tinyint | NO | | Strength modifier for this base class |
|
||||
| dexMod | tinyint | NO | | Dexterity modifier for this base class |
|
||||
| conMod | tinyint | NO | | Constitution modifier for this base class |
|
||||
| intMod | tinyint | NO | | Intelligence modifier for this base class |
|
||||
| wisMod | tinyint | NO | | Wisdom modifier for this base class |
|
||||
| chaMod | tinyint | NO | | Charisma modifier for this base class |
|
||||
| healthMod | tinyint | NO | | Health modifier for this base class |
|
||||
| manaMod | tinyint | NO | | Mana modifier for this base class |
|
||||
| staminaMod | tinyint | NO | | Stamina modifier for this base class |
|
||||
|
||||
### Table: `static_rune_racebaseclass`
|
||||
|
||||
| Column Name | Data Type | Nullable | Key | Description |
|
||||
|-------------|-----------|----------|-----|-------------|
|
||||
| ID | int unsigned | NO | PRIMARY | Unique identifier for the relationship |
|
||||
| RaceID | int unsigned | NO | FOREIGN KEY | Reference to race in `static_rune_race` |
|
||||
| BaseClassID | int unsigned | NO | FOREIGN KEY | Reference to base class in `static_rune_baseclass` |
|
||||
|
||||
## Java Field to Database Column Mapping
|
||||
|
||||
| Java Field | Database Column | Type | Description |
|
||||
|------------|-----------------|------|-------------|
|
||||
| baseClass.getId() | ID | int unsigned | Base class unique identifier |
|
||||
| baseClass.getName() | name | varchar(45) | Base class name |
|
||||
| baseClass.getDescription() | description | varchar(200) | Base class description |
|
||||
| baseClass.getStrMod() | strMod | tinyint | Strength modifier |
|
||||
| baseClass.getDexMod() | dexMod | tinyint | Dexterity modifier |
|
||||
| baseClass.getConMod() | conMod | tinyint | Constitution modifier |
|
||||
| baseClass.getIntMod() | intMod | tinyint | Intelligence modifier |
|
||||
| baseClass.getWisMod() | wisMod | tinyint | Wisdom modifier |
|
||||
| baseClass.getChaMod() | chaMod | tinyint | Charisma modifier |
|
||||
| baseClass.getHealthMod() | healthMod | tinyint | Health modifier |
|
||||
| baseClass.getManaMod() | manaMod | tinyint | Mana modifier |
|
||||
| baseClass.getStaminaMod() | staminaMod | tinyint | Stamina modifier |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### GET_BASE_CLASS
|
||||
- **Query**: `SELECT * FROM \`static_rune_baseclass\` WHERE \`ID\`=?`
|
||||
- **Parameter**: id (base class ID)
|
||||
- **Note**: Fixed from original bug - was selecting from obj_account table instead of static_rune_baseclass
|
||||
|
||||
### GET_BASECLASS_FOR_RACE
|
||||
- **Query**: `SELECT b.* FROM \`static_rune_baseclass\` b, \`static_rune_racebaseclass\` r WHERE b.\`ID\` = r.\`BaseClassID\` && r.\`RaceID\` = ?`
|
||||
- **Parameter**: id (race ID)
|
||||
|
||||
### GET_ALL_BASE_CLASSES
|
||||
- **Query**: `SELECT * FROM \`static_rune_baseclass\`;`
|
||||
- **Note**: Returns all base classes from the static table
|
||||
|
||||
## Relationships
|
||||
|
||||
### Foreign Key Relationships
|
||||
- `static_rune_racebaseclass.BaseClassID` references `static_rune_baseclass.ID`
|
||||
- `static_rune_racebaseclass.RaceID` references `static_rune_race.ID`
|
||||
|
||||
### Associated Objects
|
||||
- **BaseClass**: Core character classification data
|
||||
- **Race**: Associated races that can use specific base classes (via `static_rune_racebaseclass`)
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
# dbBlueprintHandler Documentation
|
||||
|
||||
## Overview
|
||||
The `dbBlueprintHandler` is responsible for managing building blueprint data and door number mappings in the Magicbane database. This handler loads blueprint information used for building construction and handles door mesh-to-number mappings.
|
||||
|
||||
## Database Table Structure
|
||||
|
||||
### Table: `static_building_blueprint`
|
||||
|
||||
| Column Name | Data Type | Nullable | Key | Description |
|
||||
|-------------|-----------|----------|-----|-------------|
|
||||
| Rank0UUID | bigint unsigned | NO | PRIMARY | Unique identifier for the blueprint (rank 0) |
|
||||
| MeshName | varchar(100) | NO | | Name of the mesh used for the building |
|
||||
| BuildingGroup | enum | NO | | Group classification of the building type |
|
||||
| MaintGroup | varchar(45) | YES | | Maintenance group associated with the building |
|
||||
| Rank1UUID | bigint unsigned | YES | | UUID for rank 1 upgrade |
|
||||
| Rank2UUID | bigint unsigned | YES | | UUID for rank 2 upgrade |
|
||||
| Rank3UUID | bigint unsigned | YES | | UUID for rank 3 upgrade |
|
||||
| Rank4UUID | bigint unsigned | YES | | UUID for rank 4 upgrade |
|
||||
| Rank5UUID | bigint unsigned | YES | | UUID for rank 5 upgrade |
|
||||
| Rank6UUID | bigint unsigned | YES | | UUID for rank 6 upgrade |
|
||||
| Rank7UUID | bigint unsigned | YES | | UUID for rank 7 upgrade |
|
||||
| UpgradeCost | int | YES | | Cost to upgrade the building |
|
||||
| UpgradeTime | int | YES | | Time required to upgrade the building |
|
||||
| MaxHP | int | YES | | Maximum hit points of the building |
|
||||
| MaxGold | int | YES | | Maximum gold storage capacity |
|
||||
| MaxLevel | int | YES | | Maximum level for this building |
|
||||
| MaxRank | int | YES | | Maximum rank for this building |
|
||||
| MinLevel | int | YES | | Minimum level required to build |
|
||||
| Scale | float | YES | | Scale factor for the building mesh |
|
||||
| SizeX | float | YES | | X dimension size |
|
||||
| SizeY | float | YES | | Y dimension size |
|
||||
| SizeZ | float | YES | | Z dimension size |
|
||||
| DoorCount | int | YES | | Number of doors in this building |
|
||||
| MaxDoorCount | int | YES | | Maximum number of doors allowed |
|
||||
| IsWall | tinyint(1) | YES | | Flag indicating if building is a wall |
|
||||
| IsGate | tinyint(1) | YES | | Flag indicating if building is a gate |
|
||||
| IsTower | tinyint(1) | YES | | Flag indicating if building is a tower |
|
||||
| IsKeep | tinyint(1) | YES | | Flag indicating if building is a keep |
|
||||
| IsFortress | tinyint(1) | YES | | Flag indicating if building is a fortress |
|
||||
| IsCastle | tinyint(1) | YES | | Flag indicating if building is a castle |
|
||||
| IsBarracks | tinyint(1) | YES | | Flag indicating if building is barracks |
|
||||
| IsChurch | tinyint(1) | YES | | Flag indicating if building is a church |
|
||||
| IsForge | tinyint(1) | YES | | Flag indicating if building is a forge |
|
||||
| IsSpire | tinyint(1) | YES | | Flag indicating if building is a spire |
|
||||
| IsShrine | tinyint(1) | YES | | Flag indicating if building is a shrine |
|
||||
| IsRunegate | tinyint(1) | YES | | Flag indicating if building is a runegate |
|
||||
| IsMine | tinyint(1) | YES | | Flag indicating if building is a mine |
|
||||
| IsWarehouse | tinyint(1) | YES | | Flag indicating if building is a warehouse |
|
||||
|
||||
### Table: `static_building_doors`
|
||||
|
||||
| Column Name | Data Type | Nullable | Key | Description |
|
||||
|-------------|-----------|----------|-----|-------------|
|
||||
| doorMeshUUID | int | NO | PRIMARY | Unique identifier for the door mesh |
|
||||
| doorNumber | int | NO | | Door number associated with this mesh |
|
||||
|
||||
## Java Field to Database Column Mapping
|
||||
|
||||
| Java Field | Database Column | Type | Description |
|
||||
|------------|-----------------|------|-------------|
|
||||
| blueprint.getBlueprintUUID() | Rank0UUID | bigint unsigned | Blueprint unique identifier |
|
||||
| blueprint.getMeshName() | MeshName | varchar(100) | Name of the building mesh |
|
||||
| blueprint.getBuildingGroup() | BuildingGroup | enum | Group classification of the building |
|
||||
| blueprint.getMaintGroup() | MaintGroup | varchar(45) | Maintenance group for this building |
|
||||
| blueprint.getRank1UUID() | Rank1UUID | bigint unsigned | UUID for rank 1 upgrade |
|
||||
| blueprint.getRank2UUID() | Rank2UUID | bigint unsigned | UUID for rank 2 upgrade |
|
||||
| blueprint.getRank3UUID() | Rank3UUID | bigint unsigned | UUID for rank 3 upgrade |
|
||||
| blueprint.getRank4UUID() | Rank4UUID | bigint unsigned | UUID for rank 4 upgrade |
|
||||
| blueprint.getRank5UUID() | Rank5UUID | bigint unsigned | UUID for rank 5 upgrade |
|
||||
| blueprint.getRank6UUID() | Rank6UUID | bigint unsigned | UUID for rank 6 upgrade |
|
||||
| blueprint.getRank7UUID() | Rank7UUID | bigint unsigned | UUID for rank 7 upgrade |
|
||||
| blueprint.getUpgradeCost() | UpgradeCost | int | Cost to upgrade the building |
|
||||
| blueprint.getUpgradeTime() | UpgradeTime | int | Time required to upgrade |
|
||||
| blueprint.getMaxHP() | MaxHP | int | Maximum hit points |
|
||||
| blueprint.getMaxGold() | MaxGold | int | Maximum gold storage |
|
||||
| blueprint.getMaxLevel() | MaxLevel | int | Maximum level for this building |
|
||||
| blueprint.getMaxRank() | MaxRank | int | Maximum rank |
|
||||
| blueprint.getMinLevel() | MinLevel | int | Minimum level required |
|
||||
| blueprint.getScale() | Scale | float | Scale factor for mesh |
|
||||
| blueprint.getSizeX() | SizeX | float | X dimension size |
|
||||
| blueprint.getSizeY() | SizeY | float | Y dimension size |
|
||||
| blueprint.getSizeZ() | SizeZ | float | Z dimension size |
|
||||
| blueprint.getDoorCount() | DoorCount | int | Number of doors |
|
||||
| blueprint.getMaxDoorCount() | MaxDoorCount | int | Maximum number of doors |
|
||||
| blueprint.getIsWall() | IsWall | tinyint(1) | Wall flag |
|
||||
| blueprint.getIsGate() | IsGate | tinyint(1) | Gate flag |
|
||||
| blueprint.getIsTower() | IsTower | tinyint(1) | Tower flag |
|
||||
| blueprint.getIsKeep() | IsKeep | tinyint(1) | Keep flag |
|
||||
| blueprint.getIsFortress() | IsFortress | tinyint(1) | Fortress flag |
|
||||
| blueprint.getIsCastle() | IsCastle | tinyint(1) | Castle flag |
|
||||
| blueprint.getIsBarracks() | IsBarracks | tinyint(1) | Barracks flag |
|
||||
| blueprint.getIsChurch() | IsChurch | tinyint(1) | Church flag |
|
||||
| blueprint.getIsForge() | IsForge | tinyint(1) | Forge flag |
|
||||
| blueprint.getIsSpire() | IsSpire | tinyint(1) | Spire flag |
|
||||
| blueprint.getIsShrine() | IsShrine | tinyint(1) | Shrine flag |
|
||||
| blueprint.getIsRunegate() | IsRunegate | tinyint(1) | Runegate flag |
|
||||
| blueprint.getIsMine() | IsMine | tinyint(1) | Mine flag |
|
||||
| blueprint.getIsWarehouse() | IsWarehouse | tinyint(1) | Warehouse flag |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### LOAD_ALL_DOOR_NUMBERS
|
||||
- **Query**: `SELECT * FROM static_building_doors ORDER BY doorMeshUUID ASC`
|
||||
- **Note**: Loads all door mesh-to-number mappings for building doors
|
||||
|
||||
### LOAD_ALL_BLUEPRINTS
|
||||
- **Query**: `SELECT * FROM static_building_blueprint`
|
||||
- **Note**: Loads all blueprint definitions for buildings
|
||||
|
||||
## Relationships
|
||||
|
||||
### Foreign Key Relationships
|
||||
- None explicitly defined in the handler code (these are likely static lookup tables)
|
||||
|
||||
### Associated Objects
|
||||
- **Blueprint**: Building construction data with mesh information and upgrade paths
|
||||
- **Door**: Door mesh mappings used for building construction
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
# Boon Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbBoonHandler` class. The boon system in Magicbane is used to manage item bonuses and enhancements that are associated with specific item bases.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbBoonHandler.java`
|
||||
**Class:** `dbBoonHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Boon Table
|
||||
- **Table Name:** `static_item_boons`
|
||||
- **Description:** Contains information about boons (bonuses/enhancements) that can be applied to item bases
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- itemBaseID (Foreign Key to obj_itembase)
|
||||
- boonType
|
||||
- boonValue
|
||||
- boonLevel
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Boon Amounts for Item Base
|
||||
```sql
|
||||
SELECT * FROM `static_item_boons` WHERE `itemBaseID` = ?
|
||||
```
|
||||
**File:** `dbBoonHandler.java`, Line ~28
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Item Base to Boons:** One-to-many relationship where each item base can have multiple boons associated with it
|
||||
- Foreign key: `static_item_boons.itemBaseID` references `obj_itembase.UID`
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `itemBaseID` | `static_item_boons.itemBaseID` | References the item base this boon belongs to |
|
||||
| `boonType` | `static_item_boons.boonType` | Type of boon (e.g., damage, defense) |
|
||||
| `boonValue` | `static_item_boons.boonValue` | Value of the boon |
|
||||
| `boonLevel` | `static_item_boons.boonLevel` | Level of the boon |
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
# Building Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbBuildingHandler` class. The building handler manages all aspects of building objects in Magicbane, including creation, modification, deletion, and various properties like health, protection state, and ownership.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbBuildingHandler.java`
|
||||
**Class:** `dbBuildingHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Building Table
|
||||
- **Table Name:** `obj_building`
|
||||
- **Description:** Core building information including location, mesh, health, and ownership details
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- parent (Foreign Key to obj_zone)
|
||||
- ownerUUID (Foreign Key to obj_character)
|
||||
- name
|
||||
- meshUUID (Foreign Key to static_building_mesh)
|
||||
- locX, locY, locZ (Location coordinates)
|
||||
- meshScale
|
||||
- currentHP
|
||||
- protectionState
|
||||
- currentGold
|
||||
- rank
|
||||
- upgradeDate
|
||||
- blueprintUUID (Foreign Key to static_building_blueprint)
|
||||
- w, rotY (Rotation data)
|
||||
- isDeleted
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `dyn_building_friendslist` | Stores friends that can access this building | BuildingID → obj_building.UID |
|
||||
| `dyn_building_condemnedlist` | Stores characters/guilds marked as condemned for this building | BuildingID → obj_building.UID |
|
||||
| `dyn_building_patrolpoints` | Stores patrol points for building guards | BuildingID → obj_building.UID |
|
||||
| `dyn_building_regions` | Stores region information for buildings | BuildingID → obj_building.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Create Building (Stored Procedure)
|
||||
```sql
|
||||
CALL `building_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
```
|
||||
**File:** `dbBuildingHandler.java`, Line ~38
|
||||
|
||||
### Get All Buildings for Zone
|
||||
```sql
|
||||
SELECT * FROM `obj_building` WHERE `parent` = ?
|
||||
```
|
||||
**File:** `dbBuildingHandler.java`, Line ~91
|
||||
|
||||
### Get Building by UUID
|
||||
```sql
|
||||
SELECT * FROM `obj_building` WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbBuildingHandler.java`, Line ~110
|
||||
|
||||
### Get Building by Mesh
|
||||
```sql
|
||||
SELECT * FROM `obj_building` WHERE `meshUUID` = ?
|
||||
```
|
||||
**File:** `dbBuildingHandler.java`, Line ~135
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Building to Zone:** Many-to-one relationship through `obj_building.parent` field
|
||||
2. **Building to Owner:** Many-to-one relationship through `obj_building.ownerUUID` field (references obj_character.UID)
|
||||
3. **Building to Blueprint:** Many-to-one relationship through `obj_building.blueprintUUID` field (references static_building_blueprint.Rank0UUID)
|
||||
4. **Building to Mesh:** Many-to-one relationship through `obj_building.meshUUID` field (references static_building_mesh.UID)
|
||||
5. **Building to Friends List:** One-to-many relationship through `dyn_building_friendslist.BuildingID`
|
||||
6. **Building to Condemned List:** One-to-many relationship through `dyn_building_condemnedlist.BuildingID`
|
||||
7. **Building to Patrol Points:** One-to-many relationship through `dyn_building_patrolpoints.BuildingID`
|
||||
8. **Building to Regions:** One-to-many relationship through `dyn_building_regions.BuildingID`
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `parent` | `obj_building.parent` | Zone parent ID |
|
||||
| `ownerUUID` | `obj_building.ownerUUID` | Owner character UID |
|
||||
| `name` | `obj_building.name` | Building name |
|
||||
| `meshUUID` | `obj_building.meshUUID` | Mesh identifier |
|
||||
| `locX` | `obj_building.locX` | X coordinate |
|
||||
| `locY` | `obj_building.locY` | Y coordinate |
|
||||
| `locZ` | `obj_building.locZ` | Z coordinate |
|
||||
| `meshScale` | `obj_building.meshScale` | Scale of mesh |
|
||||
| `currentHP` | `obj_building.currentHP` | Current health points |
|
||||
| `protectionState` | `obj_building.protectionState` | Protection state |
|
||||
| `currentGold` | `obj_building.currentGold` | Current gold amount |
|
||||
| `rank` | `obj_building.rank` | Building rank |
|
||||
| `upgradeDate` | `obj_building.upgradeDate` | Upgrade timestamp |
|
||||
| `blueprintUUID` | `obj_building.blueprintUUID` | Blueprint identifier |
|
||||
| `w` | `obj_building.w` | Rotation data |
|
||||
| `rotY` | `obj_building.rotY` | Y rotation angle |
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
# Building Location Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbBuildingLocationHandler` class. This handler manages building location data, specifically loading locations for buildings based on type and slot.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbBuildingLocationHandler.java`
|
||||
**Class:** `dbBuildingLocationHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table
|
||||
- **Table Name:** `static_building_location`
|
||||
- **Description:** Stores location data for building components including position and rotation information
|
||||
- **Columns:**
|
||||
- ID (Primary Key)
|
||||
- BuildingID
|
||||
- type
|
||||
- slot
|
||||
- unknown
|
||||
- locX
|
||||
- locY
|
||||
- locZ
|
||||
- w
|
||||
- rotX
|
||||
- rotY
|
||||
- rotZ
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Load Building Locations
|
||||
```sql
|
||||
SELECT `ID`, `BuildingID`, `type`, `slot`, `unknown`, `locX`, `locY`, `locZ`, `w`, `rotX`, `rotY`, `rotZ`
|
||||
FROM static_building_location
|
||||
WHERE type = 6 OR type = 8
|
||||
GROUP BY buildingID, slot
|
||||
ORDER BY buildingID, slot ASC;
|
||||
```
|
||||
**File:** `dbBuildingLocationHandler.java`, Line ~17
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Building Location to Building:** Many-to-one relationship via `BuildingID` field referencing `obj_building.UID`
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `id` | `static_building_location.ID` | Unique identifier |
|
||||
| `buildingID` | `static_building_location.BuildingID` | Reference to building |
|
||||
| `type` | `static_building_location.type` | Location type |
|
||||
| `slot` | `static_building_location.slot` | Slot number |
|
||||
| `unknown` | `static_building_location.unknown` | Unknown field |
|
||||
| `locX` | `static_building_location.locX` | X coordinate |
|
||||
| `locY` | `static_building_location.locY` | Y coordinate |
|
||||
| `locZ` | `static_building_location.locZ` | Z coordinate |
|
||||
| `w` | `static_building_location.w` | W rotation value |
|
||||
| `rotX` | `static_building_location.rotX` | X rotation |
|
||||
| `rotY` | `static_building_location.rotY` | Y rotation |
|
||||
| `rotZ` | `static_building_location.rotZ` | Z rotation |
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
# dbCSSessionHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbCSSessionHandler` class. The session handler manages user login sessions, tracking account activity, character associations, and session-based authentication.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbCSSessionHandler.java`
|
||||
**Class:** `dbCSSessionHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Session Table
|
||||
- **Table Name:** `dyn_cs_session`
|
||||
- **Description:** Stores information about active and inactive user sessions, including account associations and character details
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- accountID
|
||||
- characterID
|
||||
- sessionKey
|
||||
- lastLoginDate
|
||||
- lastLogoutDate
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_account` | Accounts associated with sessions | accountID → obj_account.UID |
|
||||
| `obj_character` | Characters associated with sessions | characterID → obj_character.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Create Session
|
||||
```sql
|
||||
INSERT INTO `dyn_cs_session` (`accountID`, `characterID`, `sessionKey`, `lastLoginDate`) VALUES(?,?,?,?)
|
||||
```
|
||||
**File:** `dbCSSessionHandler.java`, Line ~35
|
||||
|
||||
### Load Session by Account
|
||||
```sql
|
||||
SELECT * FROM `dyn_cs_session` WHERE `accountID` = ?
|
||||
```
|
||||
**File:** `dbCSSessionHandler.java`, Line ~50
|
||||
|
||||
### Load Session by Character
|
||||
```sql
|
||||
SELECT * FROM `dyn_cs_session` WHERE `characterID` = ?
|
||||
```
|
||||
**File:** `dbCSSessionHandler.java`, Line ~65
|
||||
|
||||
### Update Session Last Login
|
||||
```sql
|
||||
UPDATE `dyn_cs_session` SET `lastLoginDate`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbCSSessionHandler.java`, Line ~80
|
||||
|
||||
### Update Session Last Logout
|
||||
```sql
|
||||
UPDATE `dyn_cs_session` SET `lastLogoutDate`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbCSSessionHandler.java`, Line ~95
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Session to Account:** Many-to-one relationship via accountID field referencing obj_account.UID
|
||||
2. **Session to Character:** Many-to-one relationship via characterID field referencing obj_character.UID
|
||||
3. **Session to Login History:** One-to-many relationship via session UID (via dyn_login_history table)
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `accountID` | `dyn_cs_session.accountID` | Account UID associated with this session |
|
||||
| `characterID` | `dyn_cs_session.characterID` | Character UID associated with this session |
|
||||
| `sessionKey` | `dyn_cs_session.sessionKey` | Session identifier for authentication |
|
||||
| `lastLoginDate` | `dyn_cs_session.lastLoginDate` | Timestamp of last login |
|
||||
| `lastLogoutDate` | `dyn_cs_session.lastLogoutDate` | Timestamp of last logout |
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
# Character Power Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbCharacterPowerHandler` class. This handler manages character power data, including adding, deleting, retrieving, and updating character powers.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbCharacterPowerHandler.java`
|
||||
**Class:** `dbCharacterPowerHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table
|
||||
- **Table Name:** `dyn_character_power`
|
||||
- **Description:** Stores dynamic power information for characters including power token, character ID, and training levels
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- CharacterID
|
||||
- powersBaseToken
|
||||
- trains
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Add Character Power
|
||||
```sql
|
||||
INSERT INTO `dyn_character_power` (`CharacterID`, `powersBaseToken`, `trains`) VALUES (?, ?, ?);
|
||||
```
|
||||
**File:** `dbCharacterPowerHandler.java`, Line ~20
|
||||
|
||||
### Delete Character Power
|
||||
```sql
|
||||
DELETE FROM `dyn_character_power` WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbCharacterPowerHandler.java`, Line ~41
|
||||
|
||||
### Get Character Power by ID
|
||||
```sql
|
||||
SELECT * FROM `dyn_character_power` WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbCharacterPowerHandler.java`, Line ~57
|
||||
|
||||
### Get All Powers for Character
|
||||
```sql
|
||||
SELECT * FROM `dyn_character_power` WHERE CharacterID = ?
|
||||
```
|
||||
**File:** `dbCharacterPowerHandler.java`, Line ~76
|
||||
|
||||
### Update Trains
|
||||
```sql
|
||||
UPDATE `dyn_character_power` SET `trains`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbCharacterPowerHandler.java`, Line ~98
|
||||
|
||||
### Update Database
|
||||
```sql
|
||||
UPDATE `dyn_character_power` SET `PowersBaseToken`=?, `CharacterID`=?, `trains`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbCharacterPowerHandler.java`, Line ~115
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Character Power to Character:** Many-to-one relationship via `CharacterID` field referencing `obj_character.UID`
|
||||
2. **Character Power to Power Base:** Many-to-one relationship via `powersBaseToken` field referencing `static_powers_base.token`
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `characterID` | `dyn_character_power.CharacterID` | Reference to character |
|
||||
| `powerToken` | `dyn_character_power.powersBaseToken` | Reference to power base |
|
||||
| `trains` | `dyn_character_power.trains` | Training level |
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
# Character Rune Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbCharacterRuneHandler` class. This handler manages character rune data, including adding, retrieving, deleting, and updating character runes.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbCharacterRuneHandler.java`
|
||||
**Class:** `dbCharacterRuneHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table
|
||||
- **Table Name:** `dyn_character_rune`
|
||||
- **Description:** Stores dynamic rune information for characters including character ID and rune base ID
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- CharacterID
|
||||
- RuneBaseID
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Add Character Rune
|
||||
```sql
|
||||
INSERT INTO `dyn_character_rune` (`CharacterID`, `RuneBaseID`) VALUES (?, ?);
|
||||
```
|
||||
**File:** `dbCharacterRuneHandler.java`, Line ~20
|
||||
|
||||
### Get Character Rune by ID
|
||||
```sql
|
||||
SELECT * FROM `dyn_character_rune` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbCharacterRuneHandler.java`, Line ~43
|
||||
|
||||
### Delete Character Rune
|
||||
```sql
|
||||
DELETE FROM `dyn_character_rune` WHERE `UID`=?;
|
||||
```
|
||||
**File:** `dbCharacterRuneHandler.java`, Line ~61
|
||||
|
||||
### Get All Runes for Character
|
||||
```sql
|
||||
SELECT * FROM `dyn_character_rune` WHERE `CharacterID` = ?
|
||||
```
|
||||
**File:** `dbCharacterRuneHandler.java`, Line ~74
|
||||
|
||||
### Update Database
|
||||
```sql
|
||||
UPDATE `dyn_character_rune` SET `CharacterID`=?, `RuneBaseID`=? WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbCharacterRuneHandler.java`, Line ~91
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Character Rune to Character:** Many-to-one relationship via `CharacterID` field referencing `obj_character.UID`
|
||||
2. **Character Rune to Rune Base:** Many-to-one relationship via `RuneBaseID` field referencing `static_rune_base.ID`
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `playerID` | `dyn_character_rune.CharacterID` | Reference to character |
|
||||
| `runeBaseID` | `dyn_character_rune.RuneBaseID` | Reference to rune base |
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
# Character Skill Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbCharacterSkillHandler` class. This handler manages character skill data, including adding, deleting, retrieving, and updating character skills.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbCharacterSkillHandler.java`
|
||||
**Class:** `dbCharacterSkillHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table
|
||||
- **Table Name:** `dyn_character_skill`
|
||||
- **Description:** Stores dynamic skill information for characters including skill base ID, character ID, and training levels
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- CharacterID
|
||||
- skillsBaseID
|
||||
- trains
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Add Skill
|
||||
```sql
|
||||
INSERT INTO `dyn_character_skill` (`CharacterID`, `skillsBaseID`, `trains`) VALUES (?, ?, ?);
|
||||
```
|
||||
**File:** `dbCharacterSkillHandler.java`, Line ~20
|
||||
|
||||
### Delete Skill
|
||||
```sql
|
||||
DELETE FROM `dyn_character_skill` WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbCharacterSkillHandler.java`, Line ~43
|
||||
|
||||
### Get Skill by ID
|
||||
```sql
|
||||
SELECT * FROM `dyn_character_skill` WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbCharacterSkillHandler.java`, Line ~59
|
||||
|
||||
### Get All Skills for Character
|
||||
```sql
|
||||
SELECT * FROM `dyn_character_skill` WHERE `CharacterID` = ?
|
||||
```
|
||||
**File:** `dbCharacterSkillHandler.java`, Line ~80
|
||||
|
||||
### Update Trains
|
||||
```sql
|
||||
UPDATE `dyn_character_skill` SET `trains`=? WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbCharacterSkillHandler.java`, Line ~104
|
||||
|
||||
### Update Database
|
||||
```sql
|
||||
UPDATE `dyn_character_skill` SET `skillsBaseID`=?, `CharacterID`=?, `trains`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbCharacterSkillHandler.java`, Line ~123
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Character Skill to Character:** Many-to-one relationship via `CharacterID` field referencing `obj_character.UID`
|
||||
2. **Character Skill to Skill Base:** Many-to-one relationship via `skillsBaseID` field referencing `static_skills_base.ID`
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `characterID` | `dyn_character_skill.CharacterID` | Reference to character |
|
||||
| `skillBaseID` | `dyn_character_skill.skillsBaseID` | Reference to skill base |
|
||||
| `trains` | `dyn_character_skill.trains` | Training level |
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
# City Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbCityHandler` class. The city handler manages city-related data including city creation, zone information, and building structures within the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbCityHandler.java`
|
||||
**Class:** `dbCityHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main City Table
|
||||
- **Table Name:** `obj_city`
|
||||
- **Description:** Core city information including name, motto, and metadata
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- motto
|
||||
- treeOfLifeUUID
|
||||
- established
|
||||
- realmTaxDate
|
||||
- population
|
||||
- siegesWithstood
|
||||
- isNpc
|
||||
- isCapital
|
||||
- isNoobIsle
|
||||
- bindX
|
||||
- bindZ
|
||||
- bindRadius
|
||||
- radiusType
|
||||
- forceRename
|
||||
- open
|
||||
- hash
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_zone` | Zone information within cities | CityID → obj_city.UID |
|
||||
| `obj_building` | Building information within zones | ZoneID → obj_zone.UID |
|
||||
| `object` | Base object table that links to obj_city | UID → obj_city.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Load City Data
|
||||
```sql
|
||||
SELECT * FROM `object` o
|
||||
JOIN `obj_city` c ON o.`UID` = c.`UID`
|
||||
WHERE o.`type` = 'city' AND o.`parent` = ?
|
||||
```
|
||||
**File:** `dbCityHandler.java`, Line ~45
|
||||
|
||||
### Load Zones for City
|
||||
```sql
|
||||
SELECT * FROM `object` o
|
||||
JOIN `obj_zone` z ON o.`UID` = z.`UID`
|
||||
WHERE o.`type` = 'zone' AND o.`parent` = ?
|
||||
```
|
||||
**File:** `dbCityHandler.java`, Line ~60
|
||||
|
||||
### Load Buildings for Zone
|
||||
```sql
|
||||
SELECT * FROM `object` o
|
||||
JOIN `obj_building` b ON o.`UID` = b.`UID`
|
||||
WHERE o.`type` = 'building' AND o.`parent` = ?
|
||||
```
|
||||
**File:** `dbCityHandler.java`, Line ~75
|
||||
|
||||
### Create New City
|
||||
```sql
|
||||
CALL `city_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
```
|
||||
**File:** `dbCityHandler.java`, Line ~90
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **City to Object:** One-to-one (City is a type of object)
|
||||
2. **Zone to City:** Many-to-one (Multiple zones per city)
|
||||
3. **Building to Zone:** Many-to-one (Multiple buildings per zone)
|
||||
4. **City to Zones:** One-to-many (via `obj_zone.parent` field)
|
||||
5. **Zone to Buildings:** One-to-many (via `obj_building.parent` field)
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_city.name` | City name |
|
||||
| `motto` | `obj_city.motto` | City motto |
|
||||
| `established` | `obj_city.established` | Date established |
|
||||
| `population` | `obj_city.population` | Population count |
|
||||
| `isNpc` | `obj_city.isNpc` | NPC flag |
|
||||
| `bindX` | `obj_city.bindX` | X binding coordinate |
|
||||
| `bindZ` | `obj_city.bindZ` | Z binding coordinate |
|
||||
| `bindRadius` | `obj_city.bindRadius` | Binding radius |
|
||||
| `isCapital` | `obj_city.isCapital` | Capital city flag |
|
||||
| `isNoobIsle` | `obj_city.isNoobIsle` | Noob island flag |
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
# Contract Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbContractHandler` class. This handler manages contract data for NPCs, including loading contracts, their inventory sets, and sell lists.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbContractHandler.java`
|
||||
**Class:** `dbContractHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table
|
||||
- **Table Name:** `static_npc_contract`
|
||||
- **Description:** Stores static contract information for NPCs including contract ID, name, mob base ID, class ID, vendor dialog, and icon ID
|
||||
- **Columns:**
|
||||
- ID (Primary Key)
|
||||
- contractID
|
||||
- name
|
||||
- mobbaseID
|
||||
- classID
|
||||
- vendorDialog
|
||||
- iconID
|
||||
- allowedBuildingTypeID
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `static_npc_inventoryset` | Stores inventory items for contracts | inventorySet → static_npc_contract.inventorySet |
|
||||
| `static_npc_contract_selltype` | Stores sell type information for contracts | contractID → static_npc_contract.ID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Contract by ID
|
||||
```sql
|
||||
SELECT * FROM `static_npc_contract` WHERE `ID` = ?
|
||||
```
|
||||
**File:** `dbContractHandler.java`, Line ~17
|
||||
|
||||
### Load Contract Inventory
|
||||
```sql
|
||||
SELECT * FROM `static_npc_inventoryset` WHERE `inventorySet` = ?;
|
||||
```
|
||||
**File:** `dbContractHandler.java`, Line ~43
|
||||
|
||||
### Load Sell List for Contract
|
||||
```sql
|
||||
SELECT * FROM `static_npc_contract_selltype` WHERE `contractID` = ?;
|
||||
```
|
||||
**File:** `dbContractHandler.java`, Line ~65
|
||||
|
||||
### Update Allowed Buildings
|
||||
```sql
|
||||
UPDATE `static_npc_contract` SET `allowedBuildingTypeID`=? WHERE `contractID`=?
|
||||
```
|
||||
**File:** `dbContractHandler.java`, Line ~87
|
||||
|
||||
### Update Database
|
||||
```sql
|
||||
UPDATE `static_npc_contract` SET `contractID`=?, `name`=?, `mobbaseID`=?, `classID`=?, vendorDialog=?, iconID=?, allowedBuildingTypeID=? WHERE `ID`=?
|
||||
```
|
||||
**File:** `dbContractHandler.java`, Line ~100
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Contract to Mob Base:** Many-to-one relationship via `mobbaseID` field referencing `obj_mobbase.ID`
|
||||
2. **Contract to Vendor Dialog:** Many-to-one relationship via `vendorDialog` field referencing `obj_vendor_dialog.UID`
|
||||
3. **Contract to Inventory Set:** One-to-many relationship via `inventorySet` field
|
||||
4. **Contract to Sell Types:** One-to-many relationship via `contractID` field
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `contractID` | `static_npc_contract.contractID` | Contract identifier |
|
||||
| `name` | `static_npc_contract.name` | Contract name |
|
||||
| `mobbaseID` | `static_npc_contract.mobbaseID` | Reference to mob base |
|
||||
| `classID` | `static_npc_contract.classID` | Class identifier |
|
||||
| `vendorDialogID` | `static_npc_contract.vendorDialog` | Reference to vendor dialog |
|
||||
| `iconID` | `static_npc_contract.iconID` | Icon identifier |
|
||||
| `allowedBuildings` | `static_npc_contract.allowedBuildingTypeID` | Allowed building types |
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
# dbEffectsBaseHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbEffectsBaseHandler` class. This handler manages static data about power effects in Magicbane, including their base properties and modifiers.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbEffectsBaseHandler.java`
|
||||
**Class:** `dbEffectsBaseHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Effect Base Table
|
||||
- **Table Name:** `static_power_effectbase`
|
||||
- **Description:** Core table containing base information about power effects, including names and types
|
||||
- **Columns:**
|
||||
- IDString (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- effectType
|
||||
|
||||
### Modifier Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `static_power_effectmod` | Stores modifier properties for effects | EffectBaseID → static_power_effectbase.IDString |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get All Effects Base
|
||||
```sql
|
||||
SELECT * FROM static_power_effectbase ORDER BY `IDString` DESC
|
||||
```
|
||||
**File:** `dbEffectsBaseHandler.java`, Line ~25
|
||||
|
||||
### Get Effect Modifiers
|
||||
```sql
|
||||
SELECT * FROM static_power_effectmod WHERE `effectBaseID` = ?
|
||||
```
|
||||
**File:** `dbEffectsBaseHandler.java`, Line ~40
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Effect Base to Modifiers:** One-to-many relationship via effectBaseID field in static_power_effectmod referencing static_power_effectbase.IDString
|
||||
2. **Effect Base to Resources Cost:** Many-to-many relationship through static_power_effectcost table
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `IDString` | `static_power_effectbase.IDString` | Unique identifier for the effect |
|
||||
| `name` | `static_power_effectbase.name` | Display name of the effect |
|
||||
| `description` | `static_power_effectbase.description` | Description of the effect |
|
||||
| `effectType` | `static_power_effectbase.effectType` | Type of effect |
|
||||
| `modType` | `static_power_effectmod.modType` | Modifier type for effect modifiers |
|
||||
| `modValue` | `static_power_effectmod.modValue` | Value of the modifier |
|
||||
| `other fields...` | Various columns | Other properties related to effects and modifiers |
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
# dbEffectsResourceCostHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbEffectsResourceCostHandler` class. This handler manages the resource costs associated with power effects, including mana, health, and other resource types required to use specific powers.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbEffectsResourceCostHandler.java`
|
||||
**Class:** `dbEffectsResourceCostHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Resource Cost Table
|
||||
- **Table Name:** `static_power_effectcost`
|
||||
- **Description:** Stores resource cost information for power effects, defining what resources are required to use specific effects
|
||||
- **Columns:**
|
||||
- IDString (Primary Key)
|
||||
- resourceType
|
||||
- resourceAmount
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Resource Cost by Effect ID
|
||||
```sql
|
||||
SELECT * FROM static_power_effectcost WHERE `IDString` = ?
|
||||
```
|
||||
**File:** `dbEffectsResourceCostHandler.java`, Line ~25
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Effect Cost to Effect Base:** Many-to-one relationship via IDString field referencing static_power_effectbase.IDString
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `idString` | `static_power_effectcost.IDString` | Unique identifier linking to effect base |
|
||||
| `resourceType` | `static_power_effectcost.resourceType` | Type of resource required (mana, health, etc.) |
|
||||
| `resourceAmount` | `static_power_effectcost.resourceAmount` | Amount of resource required |
|
||||
| `other fields...` | Various columns | Other properties related to resource costs |
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
# dbEnchantmentHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbEnchantmentHandler` class. This handler manages item enchantments, which are special properties applied to items that modify their attributes or provide additional abilities.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbEnchantmentHandler.java`
|
||||
**Class:** `dbEnchantmentHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Enchantment Table
|
||||
- **Table Name:** `dyn_item_enchantment`
|
||||
- **Description:** Stores enchantment information for items, including the type of power action and rank level
|
||||
- **Columns:**
|
||||
- itemID (Primary Key)
|
||||
- powerAction
|
||||
- rank
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Enchantments by Item ID
|
||||
```sql
|
||||
SELECT * FROM dyn_item_enchantment WHERE `itemID` = ?
|
||||
```
|
||||
**File:** `dbEnchantmentHandler.java`, Line ~25
|
||||
|
||||
### Save Enchantment
|
||||
```sql
|
||||
INSERT INTO `dyn_item_enchantment` (`itemID`, `powerAction`, `rank`) VALUES(?,?,?)
|
||||
```
|
||||
**File:** `dbEnchantmentHandler.java`, Line ~40
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Enchantment to Item:** Many-to-one relationship via itemID field referencing obj_item.UID
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `itemID` | `dyn_item_enchantment.itemID` | Unique identifier for the item |
|
||||
| `powerAction` | `dyn_item_enchantment.powerAction` | The power action associated with the enchantment |
|
||||
| `rank` | `dyn_item_enchantment.rank` | The rank or strength level of the enchantment |
|
||||
| `other fields...` | Various columns | Other properties related to item enchantments |
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
# Guild Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbGuildHandler` class. The guild system in Magicbane is complex, involving multiple related tables for managing guilds, their history, alliances, enemies, and member management.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbGuildHandler.java`
|
||||
**Class:** `dbGuildHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Guild Table
|
||||
- **Table Name:** `obj_guild`
|
||||
- **Description:** Core guild information including name, leader, tags, charter, and ownership details
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- leaderUID
|
||||
- backgroundColor01
|
||||
- backgroundColor02
|
||||
- symbolColor
|
||||
- backgroundDesign
|
||||
- symbol
|
||||
- charter
|
||||
- leadershipType
|
||||
- motto
|
||||
- ownedCity
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `dyn_character_guildhistory` | Tracks character's guild membership history | CharacterID → obj_character.UID, GuildID → obj_guild.UID |
|
||||
| `dyn_guild_allianceenemylist` | Stores alliance/enemy relationships between guilds | GuildID → obj_guild.UID, OtherGuildID → obj_guild.UID |
|
||||
| `dyn_guild_banishlist` | Lists characters banned from guilds | GuildID → obj_guild.UID, CharacterID → obj_character.UID |
|
||||
| `dyn_guild_characterkoslist` | Stores characters marked as KOS (Kill on Sight) for guilds | GuildID → obj_guild.UID, KOSCharacterID → obj_character.UID |
|
||||
| `dyn_guild_guildkoslist` | Stores guilds marked as KOS for other guilds | GuildID → obj_guild.UID, KOSGuildID → obj_guild.UID |
|
||||
| `object` | Base object table that links to obj_guild | UID → obj_guild.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Guild by ID
|
||||
```sql
|
||||
SELECT `obj_guild`.*, `object`.`parent`
|
||||
FROM `obj_guild`
|
||||
INNER JOIN `object` ON `object`.`UID` = `obj_guild`.`UID`
|
||||
WHERE `object`.`UID`=?
|
||||
```
|
||||
**File:** `dbGuildHandler.java`, Line ~450
|
||||
|
||||
### Get Guild History of Player
|
||||
```sql
|
||||
SELECT g.* FROM `obj_guild` g, `dyn_character_guildhistory` l
|
||||
WHERE g.`UID` = l.`GuildID` && l.`CharacterID` = ?
|
||||
```
|
||||
**File:** `dbGuildHandler.java`, Line ~200
|
||||
|
||||
### Get Guild Allies
|
||||
```sql
|
||||
SELECT g.* FROM `obj_guild` g, `dyn_guild_allianceenemylist` l
|
||||
WHERE l.isAlliance = 1 && l.OtherGuildID = g.UID && l.GuildID=?
|
||||
```
|
||||
**File:** `dbGuildHandler.java`, Line ~230
|
||||
|
||||
### Get Guild Enemies
|
||||
```sql
|
||||
SELECT g.* FROM `obj_guild` g, `dyn_guild_allianceenemylist` l
|
||||
WHERE l.isAlliance = 0 && l.OtherGuildID = g.UID && l.GuildID=?
|
||||
```
|
||||
**File:** `dbGuildHandler.java`, Line ~253
|
||||
|
||||
### Get Guild KOS Characters
|
||||
```sql
|
||||
SELECT c.* FROM `obj_character` c, `dyn_guild_characterkoslist` l
|
||||
WHERE c.`char_isActive` = 1 && l.`KOSCharacterID` = c.`UID` && l.`GuildID`=?
|
||||
```
|
||||
**File:** `dbGuildHandler.java`, Line ~273
|
||||
|
||||
### Get Guild KOS Guilds
|
||||
```sql
|
||||
SELECT g.* FROM `obj_guild` g, `dyn_guild_guildkoslist` l
|
||||
WHERE l.KOSGuildID = g.UID && l.GuildID = ?
|
||||
```
|
||||
**File:** `dbGuildHandler.java`, Line ~295
|
||||
|
||||
### Save Guild (Stored Procedure)
|
||||
```sql
|
||||
CALL `guild_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
```
|
||||
**File:** `dbGuildHandler.java`, Line ~483
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Guild to Character:** Many-to-many through `obj_character.guildUID` field
|
||||
2. **Guild to Guild History:** One-to-many (via `dyn_character_guildhistory.GuildID`)
|
||||
3. **Guild to Alliances/Enemies:** Many-to-many (via `dyn_guild_allianceenemylist`)
|
||||
4. **Guild to Bans List:** One-to-many (via `dyn_guild_banishlist.GuildID`)
|
||||
5. **Guild to KOS Characters:** One-to-many (via `dyn_guild_characterkoslist.GuildID`)
|
||||
6. **Guild to KOS Guilds:** One-to-many (via `dyn_guild_guildkoslist.GuildID`)
|
||||
7. **Guild to Sub-Guilds:** Parent-child relationship via `object.parent` field
|
||||
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_guild.name` | Guild name |
|
||||
| `leaderUID` | `obj_guild.leaderUID` | Leader character UID |
|
||||
| `backgroundColor01` | `obj_guild.backgroundColor01` | First background color |
|
||||
| `backgroundColor02` | `obj_guild.backgroundColor02` | Second background color |
|
||||
| `symbolColor` | `obj_guild.symbolColor` | Symbol color |
|
||||
| `backgroundDesign` | `obj_guild.backgroundDesign` | Background design ID |
|
||||
| `symbol` | `obj_guild.symbol` | Guild symbol ID |
|
||||
| `charter` | `obj_guild.charter` | Charter information |
|
||||
| `leadershipType` | `obj_guild.leadershipType` | Leadership type |
|
||||
| `motto` | `obj_guild.motto` | Guild motto |
|
||||
| `ownedCity` | `obj_guild.ownedCity` | Owned city ID |
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
# dbHeightMapHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbHeightMapHandler` class. This handler manages height map data for zones, which is used to determine terrain elevation in the game world.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbHeightMapHandler.java`
|
||||
**Class:** `dbHeightMapHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Height Map Table
|
||||
- **Table Name:** `static_zone_heightmap`
|
||||
- **Description:** Stores raw height map data for zones, representing terrain elevation information
|
||||
- **Columns:**
|
||||
- zoneLoadID (Primary Key)
|
||||
- heightMapData
|
||||
- width
|
||||
- height
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Height Map by Zone Load ID
|
||||
```sql
|
||||
SELECT * FROM static_zone_heightmap WHERE `zoneLoadID` = ?
|
||||
```
|
||||
**File:** `dbHeightMapHandler.java`, Line ~25
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Height Map to Zone:** Many-to-one relationship via zoneLoadID field referencing static_zone_load.zoneLoadID
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `zoneLoadID` | `static_zone_heightmap.zoneLoadID` | Unique identifier for the zone |
|
||||
| `heightMapData` | `static_zone_heightmap.heightMapData` | Raw height map data for terrain elevation |
|
||||
| `width` | `static_zone_size.width` | Width dimension of the zone |
|
||||
| `height` | `static_zone_size.height` | Height dimension of the zone |
|
||||
| `other fields...` | Various columns | Other properties related to height maps |
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
# dbItemBaseHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbItemBaseHandler` class. This handler manages static item base data, including item properties, stats, and appearance information.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbItemBaseHandler.java`
|
||||
**Class:** `dbItemBaseHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Item Base Table
|
||||
- **Table Name:** `static_itembase`
|
||||
- **Description:** Core table storing base properties of items, including names, descriptions, and appearance settings
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- itemClass
|
||||
- icon
|
||||
- mesh
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `static_item_bakedinstat` | Stores stat information for items | ItemBaseID → static_itembase.UID |
|
||||
| `static_itembase_animations` | Stores animation settings for items | ItemBaseID → static_itembase.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Item Base by UID
|
||||
```sql
|
||||
SELECT * FROM static_itembase WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbItemBaseHandler.java`, Line ~25
|
||||
|
||||
### Get Item Stats
|
||||
```sql
|
||||
SELECT * FROM static_item_bakedinstat WHERE `itemBaseID` = ?
|
||||
```
|
||||
**File:** `dbItemBaseHandler.java`, Line ~40
|
||||
|
||||
### Get Item Animations
|
||||
```sql
|
||||
SELECT * FROM static_itembase_animations WHERE `itemBaseID` = ?
|
||||
```
|
||||
**File:** `dbItemBaseHandler.java`, Line ~55
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Item Base to Stats:** One-to-many relationship via itemBaseID field in static_item_bakedinstat referencing static_itembase.UID
|
||||
2. **Item Base to Animations:** One-to-many relationship via itemBaseID field in static_itembase_animations referencing static_itembase.UID
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `UID` | `static_itembase.UID` | Unique identifier for the item |
|
||||
| `name` | `static_itembase.name` | Name of the item |
|
||||
| `description` | `static_itembase.description` | Description of the item |
|
||||
| `itemClass` | `static_itembase.itemClass` | Class of the item |
|
||||
| `icon` | `static_itembase.icon` | Icon identifier for the item |
|
||||
| `mesh` | `static_itembase.mesh` | Mesh identifier for the item |
|
||||
| `fromUse` | `static_item_bakedinstat.fromUse` | Flag indicating if stat is from use |
|
||||
| `animation` | `static_itembase_animations.animation` | Animation associated with the item |
|
||||
| `rightHand` | `static_itembase_animations.rightHand` | Flag indicating right hand animation |
|
||||
| `runeSet` | `static_npc_runeSet.runeSet` | NPC rune set identifier |
|
||||
| `runeBase` | `static_npc_runeSet.runeBase` | Base rune identifier |
|
||||
| `other fields...` | Various columns | Other properties related to item base data |
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
# dbItemHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbItemHandler` class. This handler manages item data in players' inventories, including item properties, location information, and ownership details.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbItemHandler.java`
|
||||
**Class:** `dbItemHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Item Table
|
||||
- **Table Name:** `obj_item`
|
||||
- **Description:** Stores information about items in player inventories, including location, ownership, and attributes
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- ownerUID
|
||||
- containerID
|
||||
- itemBaseID
|
||||
- item_container
|
||||
- equipSlot
|
||||
- flags
|
||||
- customName
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Item by UID
|
||||
```sql
|
||||
SELECT * FROM obj_item WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbItemHandler.java`, Line ~25
|
||||
|
||||
### Save Item
|
||||
```sql
|
||||
INSERT INTO `obj_item` (`ownerUID`, `containerID`, `itemBaseID`, `item_container`, `equipSlot`, `flags`, `customName`) VALUES(?,?,?,?,?,?,?)
|
||||
```
|
||||
**File:** `dbItemHandler.java`, Line ~40
|
||||
|
||||
### Get Items by Owner
|
||||
```sql
|
||||
SELECT * FROM obj_item WHERE `ownerUID` = ?
|
||||
```
|
||||
**File:** `dbItemHandler.java`, Line ~55
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Item to Owner:** Many-to-one relationship via ownerUID field referencing obj_character.UID
|
||||
2. **Item to Container:** Many-to-one relationship via containerID field referencing obj_container.UID
|
||||
3. **Item to Item Base:** Many-to-one relationship via itemBaseID field referencing static_itembase.UID
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `UID` | `obj_item.UID` | Unique identifier for the item |
|
||||
| `ownerUID` | `obj_item.ownerUID` | UID of the character who owns this item |
|
||||
| `containerID` | `obj_item.containerID` | Container ID where item is stored |
|
||||
| `itemBaseID` | `obj_item.itemBaseID` | UID of the base item definition |
|
||||
| `item_container` | `obj_item.item_container` | Container type (inventory, equip, bank, etc.) |
|
||||
| `equipSlot` | `obj_item.equipSlot` | Slot where item is equipped |
|
||||
| `flags` | `obj_item.flags` | Item flags for special properties |
|
||||
| `customName` | `obj_item.customName` | Custom name of the item |
|
||||
| `other fields...` | Various columns | Other item-specific properties |
|
||||
@@ -0,0 +1,54 @@
|
||||
# dbKitHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbKitHandler` class. The kit handler manages static data about game kits, which are predefined sets of items or abilities that players can obtain or use in the game.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbKitHandler.java`
|
||||
**Class:** `dbKitHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Kit Table
|
||||
- **Table Name:** `static_rune_validkit`
|
||||
- **Description:** Stores information about valid kits available in the game, including their properties and restrictions
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- kitName
|
||||
- description
|
||||
- raceRestriction
|
||||
- classRestriction
|
||||
- itemLimit
|
||||
- isAvailable
|
||||
|
||||
## Key Queries
|
||||
|
||||
### GET_ALL_KITS
|
||||
```sql
|
||||
SELECT * FROM `static_rune_validkit`
|
||||
```
|
||||
**File:** `dbKitHandler.java`, Line ~29
|
||||
|
||||
### GET_KIT_BY_NAME
|
||||
```sql
|
||||
SELECT * FROM `static_rune_validkit` WHERE `kitName`=?
|
||||
```
|
||||
**File:** `dbKitHandler.java`, Line ~45
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Kit to Race Restrictions:** Many-to-many relationship through raceRestriction field
|
||||
2. **Kit to Class Restrictions:** Many-to-many relationship through classRestriction field
|
||||
3. **Kit to Items:** One-to-many relationship via itemLimit referencing items in the game
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `kitName` | `static_rune_validkit.kitName` | Unique name identifier for the kit |
|
||||
| `description` | `static_rune_validkit.description` | Description of the kit's purpose and benefits |
|
||||
| `raceRestriction` | `static_rune_validkit.raceRestriction` | Race restriction for the kit |
|
||||
| `classRestriction` | `static_rune_validkit.classRestriction` | Class restriction for the kit |
|
||||
| `itemLimit` | `static_rune_validkit.itemLimit` | Maximum number of items allowed in this kit |
|
||||
| `isAvailable` | `static_rune_validkit.isAvailable` | Boolean flag indicating if kit is currently available |
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
# dbLootHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbLootHandler` class. The loot handler manages static loot tables and item generation data used in the game's loot system, including general tables, item tables, modifier tables, and booty sets.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbLootHandler.java`
|
||||
**Class:** `dbLootHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Tables
|
||||
- **Table Name:** `static_loot_gen`
|
||||
- **Description:** Stores general loot table entries for item generation
|
||||
- **Columns:**
|
||||
- genTable (Primary Key)
|
||||
- itemID
|
||||
- weight
|
||||
- minLevel
|
||||
- maxLevel
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `static_loot_item` | Stores item-specific loot table entries | One-to-many with genTable |
|
||||
| `static_loot_mod` | Stores modifier information for loot items | One-to-many with modTable |
|
||||
| `static_loot_modtype` | Defines modifier types used in loot systems | One-to-many with modType |
|
||||
| `static_loot_bootySet` | Stores booty set definitions for loot generation | One-to-many with bootySet |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### LOAD_GEN_ITEM_TABLES
|
||||
```sql
|
||||
SELECT * FROM `static_loot_gen`
|
||||
```
|
||||
**File:** `dbLootHandler.java`, Line ~32
|
||||
|
||||
### LOAD_ITEM_TABLES
|
||||
```sql
|
||||
SELECT * FROM `static_loot_item`
|
||||
```
|
||||
**File:** `dbLootHandler.java`, Line ~64
|
||||
|
||||
### LOAD_MOD_TABLES
|
||||
```sql
|
||||
SELECT * FROM `static_loot_mod`
|
||||
```
|
||||
**File:** `dbLootHandler.java`, Line ~96
|
||||
|
||||
### LOAD_MOD_TYPE_TABLES
|
||||
```sql
|
||||
SELECT * FROM `static_loot_modtype`
|
||||
```
|
||||
**File:** `dbLootHandler.java`, Line ~128
|
||||
|
||||
### LOAD_BOOTY_TABLES
|
||||
```sql
|
||||
SELECT * FROM static_loot_bootySet
|
||||
```
|
||||
**File:** `dbLootHandler.java`, Line ~160
|
||||
|
||||
### LOAD_ENCHANT_VALUES
|
||||
```sql
|
||||
SELECT `IDString`, `minMod` FROM `static_power_effectmod` WHERE `modType` = ?
|
||||
```
|
||||
**File:** `dbLootHandler.java`, Line ~192
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Loot Generation Tables:** The main loot tables are related through the genTable, itemTable, and modTable fields to form a hierarchical loot generation system
|
||||
2. **Item Tables:** Connected to general tables through itemID fields for specific item definitions
|
||||
3. **Modifier Tables:** Linked through modTable and modType fields for modifier definitions
|
||||
4. **Booty Sets:** Connected through bootySet field for specific booty set configurations
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `genTableID` | `static_loot_gen.genTable` | Unique identifier for the loot table |
|
||||
| `itemID` | `static_loot_gen.itemID` | Item ID for this loot entry |
|
||||
| `weight` | `static_loot_gen.weight` | Weight for random selection |
|
||||
| `minLevel` | `static_loot_gen.minLevel` | Minimum level requirement |
|
||||
| `maxLevel` | `static_loot_gen.maxLevel` | Maximum level requirement |
|
||||
| `itemTableID` | `static_loot_item.itemTable` | Item table identifier |
|
||||
| `modTableID` | `static_loot_mod.modTable` | Modifier table identifier |
|
||||
| `modTypeID` | `static_loot_modtype.modType` | Modifier type identifier |
|
||||
| `bootySetID` | `static_loot_bootySet.bootySet` | Booty set identifier |
|
||||
| `IDString` | `static_power_effectmod.IDString` | ID string for effect modifiers |
|
||||
| `minMod` | `static_power_effectmod.minMod` | Minimum modifier value |
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
# dbMenuHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbMenuHandler` class. The menu handler manages NPC menu options and their associated data, providing functionality to retrieve menu options based on menu IDs.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbMenuHandler.java`
|
||||
**Class:** `dbMenuHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table
|
||||
- **Table Name:** `static_npc_menuoption`
|
||||
- **Description:** Stores NPC menu option data including text, actions, and relationships to parent menus
|
||||
- **Columns:**
|
||||
- menuID (Primary Key)
|
||||
- optionText
|
||||
- actionType
|
||||
- actionValue
|
||||
- nextMenuID
|
||||
- conditionType
|
||||
- conditionValue
|
||||
|
||||
## Key Queries
|
||||
|
||||
### GET_MENU_OPTIONS
|
||||
```sql
|
||||
SELECT * FROM `static_npc_menuoption` WHERE menuID = ?
|
||||
```
|
||||
**File:** `dbMenuHandler.java`, Line ~25
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Menu Options to Menu:** One-to-many relationship via menuID field referencing parent menu structure
|
||||
2. **Menu Options to Next Menu:** Many-to-one relationship via nextMenuID field for navigation between menus
|
||||
3. **Menu Options to Conditions:** Zero-to-many relationship via conditionType and conditionValue fields for dynamic menu display
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `menuID` | `static_npc_menuoption.menuID` | Unique identifier for the parent menu |
|
||||
| `optionText` | `static_npc_menuoption.optionText` | Text displayed for this menu option |
|
||||
| `actionType` | `static_npc_menuoption.actionType` | Type of action to perform when selected |
|
||||
| `actionValue` | `static_npc_menuoption.actionValue` | Value associated with the action |
|
||||
| `nextMenuID` | `static_npc_menuoption.nextMenuID` | ID of the menu to navigate to when selected |
|
||||
| `conditionType` | `static_npc_menuoption.conditionType` | Type of condition for displaying this option |
|
||||
| `conditionValue` | `static_npc_menuoption.conditionValue` | Value associated with the condition |
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
# dbMineHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbMineHandler` class. The mine handler manages mine objects and their properties, including ownership, resource types, production types, and flags for various mine behaviors.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbMineHandler.java`
|
||||
**Class:** `dbMineHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table
|
||||
- **Table Name:** `obj_mine`
|
||||
- **Description:** Stores mine-specific data including owner, resource type, production type, and flags
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- mine_ownerUID
|
||||
- mine_resource
|
||||
- mine_type
|
||||
- flags
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_building` | Base building data for mines | One-to-one with obj_mine via UID |
|
||||
| `object` | Generic object data including parent relationships | One-to-one with obj_mine via UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### GET_MINE
|
||||
```sql
|
||||
SELECT `obj_building`.*, `object`.`parent` FROM `object` INNER JOIN `obj_building` ON `obj_building`.`UID` = `object`.`UID` WHERE `object`.`UID` = ?
|
||||
```
|
||||
**File:** `dbMineHandler.java`, Line ~25
|
||||
|
||||
### GET_ALL_MINES_FOR_SERVER
|
||||
```sql
|
||||
SELECT `obj_mine`.*, `object`.`parent` FROM `object` INNER JOIN `obj_mine` ON `obj_mine`.`UID` = `object`.`UID`
|
||||
```
|
||||
**File:** `dbMineHandler.java`, Line ~43
|
||||
|
||||
### CHANGE_OWNER
|
||||
```sql
|
||||
UPDATE `obj_mine` SET `mine_ownerUID`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbMineHandler.java`, Line ~57
|
||||
|
||||
### CHANGE_RESOURCE
|
||||
```sql
|
||||
UPDATE `obj_mine` SET `mine_resource`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbMineHandler.java`, Line ~71
|
||||
|
||||
### CHANGE_TYPE
|
||||
```sql
|
||||
UPDATE `obj_mine` SET `mine_type`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbMineHandler.java`, Line ~85
|
||||
|
||||
### SET_FLAGS
|
||||
```sql
|
||||
UPDATE `obj_mine` SET `flags`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbMineHandler.java`, Line ~99
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Mine to Building:** One-to-one relationship via UID field (mine data extends building data)
|
||||
2. **Mine to Owner:** Many-to-one relationship via mine_ownerUID referencing obj_character.UID
|
||||
3. **Mine to Resource:** Many-to-one relationship via mine_resource field linking to resource definitions
|
||||
4. **Mine to Parent Object:** One-to-one relationship through object table for parent-child hierarchies
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `mine_ownerUID` | `obj_mine.mine_ownerUID` | Character UID of the mine owner |
|
||||
| `mine_resource` | `obj_mine.mine_resource` | Resource type being mined |
|
||||
| `mine_type` | `obj_mine.mine_type` | Production type of the mine |
|
||||
| `flags` | `obj_mine.flags` | Bit flags for mine properties |
|
||||
| `UID` | `obj_mine.UID` | Unique identifier for the mine object |
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
# dbMobBaseHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbMobBaseHandler` class. This handler manages static data about mob (monster) base properties in Magicbane, including their characteristics, stats, and behaviors.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbMobBaseHandler.java`
|
||||
**Class:** `dbMobBaseHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Mob Base Table
|
||||
- **Table Name:** `static_mob_base`
|
||||
- **Description:** Core table storing base properties of mobs, including names, descriptions, and basic characteristics
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- mobType
|
||||
- level
|
||||
- health
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `static_mob_stats` | Stores stat information for mobs | MobBaseID → static_mob_base.UID |
|
||||
| `static_mob_loot` | Stores loot information for mobs | MobBaseID → static_mob_base.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Mob Base by UID
|
||||
```sql
|
||||
SELECT * FROM static_mob_base WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbMobBaseHandler.java`, Line ~25
|
||||
|
||||
### Get Mob Stats
|
||||
```sql
|
||||
SELECT * FROM static_mob_stats WHERE `mobBaseID` = ?
|
||||
```
|
||||
**File:** `dbMobBaseHandler.java`, Line ~40
|
||||
|
||||
### Get Mob Loot
|
||||
```sql
|
||||
SELECT * FROM static_mob_loot WHERE `mobBaseID` = ?
|
||||
```
|
||||
**File:** `dbMobBaseHandler.java`, Line ~55
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Mob Base to Stats:** One-to-many relationship via mobBaseID field in static_mob_stats referencing static_mob_base.UID
|
||||
2. **Mob Base to Loot:** One-to-many relationship via mobBaseID field in static_mob_loot referencing static_mob_base.UID
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `UID` | `static_mob_base.UID` | Unique identifier for the mob |
|
||||
| `name` | `static_mob_base.name` | Name of the mob |
|
||||
| `description` | `static_mob_base.description` | Description of the mob |
|
||||
| `mobType` | `static_mob_base.mobType` | Type of mob |
|
||||
| `level` | `static_mob_base.level` | Level of the mob |
|
||||
| `health` | `static_mob_base.health` | Base health of the mob |
|
||||
| `other fields...` | Various columns | Other properties related to mob base data |
|
||||
@@ -0,0 +1,70 @@
|
||||
# dbMobHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbMobHandler` class. This handler manages dynamic mob data in the game world, including their current state, location, and behavior.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbMobHandler.java`
|
||||
**Class:** `dbMobHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Mob Table
|
||||
- **Table Name:** `dyn_mob`
|
||||
- **Description:** Stores current state information for mobs in the game world, including location, health, and status
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- mobBaseID
|
||||
- zoneUUID
|
||||
- x
|
||||
- y
|
||||
- z
|
||||
- health
|
||||
- isAlive
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_character` | Characters that may interact with mobs | OwnerUID → obj_character.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Mob by UID
|
||||
```sql
|
||||
SELECT * FROM dyn_mob WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbMobHandler.java`, Line ~25
|
||||
|
||||
### Save Mob
|
||||
```sql
|
||||
INSERT INTO `dyn_mob` (`mobBaseID`, `zoneUUID`, `x`, `y`, `z`, `health`, `isAlive`) VALUES(?,?,?,?,?,?,?)
|
||||
```
|
||||
**File:** `dbMobHandler.java`, Line ~40
|
||||
|
||||
### Get Mobs by Zone
|
||||
```sql
|
||||
SELECT * FROM dyn_mob WHERE `zoneUUID` = ?
|
||||
```
|
||||
**File:** `dbMobHandler.java`, Line ~55
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Mob to Mob Base:** Many-to-one relationship via mobBaseID field referencing static_mob_base.UID
|
||||
2. **Mob to Zone:** Many-to-one relationship via zoneUUID field referencing obj_zone.UID
|
||||
3. **Mob to Owner:** Many-to-one relationship via ownerUID field referencing obj_character.UID (if applicable)
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `UID` | `dyn_mob.UID` | Unique identifier for the mob |
|
||||
| `mobBaseID` | `dyn_mob.mobBaseID` | UID of the base mob definition |
|
||||
| `zoneUUID` | `dyn_mob.zoneUUID` | Zone where the mob is located |
|
||||
| `x` | `dyn_mob.x` | X coordinate of mob position |
|
||||
| `y` | `dyn_mob.y` | Y coordinate of mob position |
|
||||
| `z` | `dyn_mob.z` | Z coordinate of mob position |
|
||||
| `health` | `dyn_mob.health` | Current health of the mob |
|
||||
| `isAlive` | `dyn_mob.isAlive` | Flag indicating if mob is alive |
|
||||
| `other fields...` | Various columns | Other properties related to mob state |
|
||||
@@ -0,0 +1,71 @@
|
||||
# dbNPCHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbNPCHandler` class. This handler manages non-player character (NPC) data, including their base properties, current state, and behaviors in the game world.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbNPCHandler.java`
|
||||
**Class:** `dbNPCHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main NPC Table
|
||||
- **Table Name:** `dyn_npc`
|
||||
- **Description:** Stores current state information for NPCs, including location, health, and behavior flags
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- npcBaseID
|
||||
- zoneUUID
|
||||
- x
|
||||
- y
|
||||
- z
|
||||
- health
|
||||
- isAlive
|
||||
- behavior
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `static_npc_base` | Base properties of NPCs | npcBaseID → static_npc_base.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get NPC by UID
|
||||
```sql
|
||||
SELECT * FROM dyn_npc WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbNPCHandler.java`, Line ~25
|
||||
|
||||
### Save NPC
|
||||
```sql
|
||||
INSERT INTO `dyn_npc` (`npcBaseID`, `zoneUUID`, `x`, `y`, `z`, `health`, `isAlive`, `behavior`) VALUES(?,?,?,?,?,?,?,?)
|
||||
```
|
||||
**File:** `dbNPCHandler.java`, Line ~40
|
||||
|
||||
### Get NPCs by Zone
|
||||
```sql
|
||||
SELECT * FROM dyn_npc WHERE `zoneUUID` = ?
|
||||
```
|
||||
**File:** `dbNPCHandler.java`, Line ~55
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **NPC to NPC Base:** Many-to-one relationship via npcBaseID field referencing static_npc_base.UID
|
||||
2. **NPC to Zone:** Many-to-one relationship via zoneUUID field referencing obj_zone.UID
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `UID` | `dyn_npc.UID` | Unique identifier for the NPC |
|
||||
| `npcBaseID` | `dyn_npc.npcBaseID` | UID of the base NPC definition |
|
||||
| `zoneUUID` | `dyn_npc.zoneUUID` | Zone where the NPC is located |
|
||||
| `x` | `dyn_npc.x` | X coordinate of NPC position |
|
||||
| `y` | `dyn_npc.y` | Y coordinate of NPC position |
|
||||
| `z` | `dyn_npc.z` | Z coordinate of NPC position |
|
||||
| `health` | `dyn_npc.health` | Current health of the NPC |
|
||||
| `isAlive` | `dyn_npc.isAlive` | Flag indicating if NPC is alive |
|
||||
| `behavior` | `dyn_npc.behavior` | Behavior type or state of the NPC |
|
||||
| `other fields...` | Various columns | Other properties related to NPC state |
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
# dbPetitionHandler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbPetitionHandler` class. This handler manages player petitions, which are requests or complaints submitted by players to game administrators.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbPetitionHandler.java`
|
||||
**Class:** `dbPetitionHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Petition Table
|
||||
- **Table Name:** `dyn_petition`
|
||||
- **Description:** Stores information about player petitions, including submission details, status, and resolution
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- characterID
|
||||
- petitionType
|
||||
- description
|
||||
- status
|
||||
- submittedDate
|
||||
- resolvedDate
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_character` | Characters who submitted petitions | characterID → obj_character.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Petition by UID
|
||||
```sql
|
||||
SELECT * FROM dyn_petition WHERE `UID` = ?
|
||||
```
|
||||
**File:** `dbPetitionHandler.java`, Line ~25
|
||||
|
||||
### Save Petition
|
||||
```sql
|
||||
INSERT INTO `dyn_petition` (`characterID`, `petitionType`, `description`, `status`, `submittedDate`) VALUES(?,?,?,?,?)
|
||||
```
|
||||
**File:** `dbPetitionHandler.java`, Line ~40
|
||||
|
||||
### Get Petitions by Character
|
||||
```sql
|
||||
SELECT * FROM dyn_petition WHERE `characterID` = ?
|
||||
```
|
||||
**File:** `dbPetitionHandler.java`, Line ~55
|
||||
|
||||
### Update Petition Status
|
||||
```sql
|
||||
UPDATE `dyn_petition` SET `status`=?, `resolvedDate`=? WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbPetitionHandler.java`, Line ~70
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Petition to Character:** Many-to-one relationship via characterID field referencing obj_character.UID
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `UID` | `dyn_petition.UID` | Unique identifier for the petition |
|
||||
| `characterID` | `dyn_petition.characterID` | UID of the character who submitted the petition |
|
||||
| `petitionType` | `dyn_petition.petitionType` | Type or category of the petition |
|
||||
| `description` | `dyn_petition.description` | Description of the petition |
|
||||
| `status` | `dyn_petition.status` | Current status of the petition (open, in progress, resolved) |
|
||||
| `submittedDate` | `dyn_petition.submittedDate` | Timestamp when petition was submitted |
|
||||
| `resolvedDate` | `dyn_petition.resolvedDate` | Timestamp when petition was resolved |
|
||||
| `other fields...` | Various columns | Other properties related to petition data |
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
# Player Character Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbPlayerCharacterHandler` class. The player character handler manages all aspects of character data including creation, updates, and retrieval operations within the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbPlayerCharacterHandler.java`
|
||||
**Class:** `dbPlayerCharacterHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Character Table
|
||||
- **Table Name:** `obj_character`
|
||||
- **Description:** Core character information including attributes, stats, and personal details
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- char_firstname
|
||||
- char_lastname
|
||||
- char_isActive
|
||||
- char_raceID
|
||||
- char_baseClassID
|
||||
- char_promotionClassID
|
||||
- char_strMod
|
||||
- char_dexMod
|
||||
- char_conMod
|
||||
- char_intMod
|
||||
- char_spiMod
|
||||
- char_experience
|
||||
- char_skinColor
|
||||
- char_hairColor
|
||||
- char_hairStyle
|
||||
- char_beardColor
|
||||
- char_beardStyle
|
||||
- char_bindBuilding
|
||||
- guildUID
|
||||
- guild_isInnerCouncil
|
||||
- guild_isRecruiter
|
||||
- guild_isTaxCollector
|
||||
- guild_isFullMember
|
||||
- guild_title
|
||||
- anniversery
|
||||
- hash
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `dyn_character_ignore` | Stores character ignore lists for players | accountUID → obj_account.UID |
|
||||
| `dyn_character_friends` | Manages friendship relationships between characters | CharacterID → obj_character.UID |
|
||||
| `dyn_character_guildhistory` | Tracks character's guild membership history | CharacterID → obj_character.UID, GuildID → obj_guild.UID |
|
||||
| `dyn_character_heraldy` | Stores heraldry information for characters | CharacterID → obj_character.UID |
|
||||
| `dyn_character_killmap` | Records kill statistics for characters | CharacterID → obj_character.UID |
|
||||
| `dyn_character_murdermap` | Tracks murder statistics for characters | CharacterID → obj_character.UID |
|
||||
| `dyn_character_power` | Manages character powers/abilities | CharacterID → obj_character.UID |
|
||||
| `dyn_character_rune` | Stores rune information for characters | CharacterID → obj_character.UID |
|
||||
| `dyn_character_skill` | Manages character skills and training | CharacterID → obj_character.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Create New Character
|
||||
```sql
|
||||
CALL `character_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
```
|
||||
**File:** `dbPlayerCharacterHandler.java`, Line ~35
|
||||
|
||||
### Get Characters for Account
|
||||
```sql
|
||||
SELECT `obj_character`.*, `object`.`parent` FROM `object` INNER JOIN `obj_character` ON `obj_character`.`UID` = `object`.`UID` WHERE `object`.`parent`=? && `obj_character`.`char_isActive`='1';
|
||||
```
|
||||
**File:** `dbPlayerCharacterHandler.java`, Line ~109
|
||||
|
||||
### Get All Active Characters
|
||||
```sql
|
||||
SELECT `obj_character`.*, `object`.`parent` FROM `object` INNER JOIN `obj_character` ON `obj_character`.`UID` = `object`.`UID` WHERE `obj_character`.`char_isActive`='1';
|
||||
```
|
||||
**File:** `dbPlayerCharacterHandler.java`, Line ~127
|
||||
|
||||
### Get Character by UID
|
||||
```sql
|
||||
SELECT `obj_character`.*, `object`.`parent` FROM `object` INNER JOIN `obj_character` ON `obj_character`.`UID` = `object`.`UID` WHERE `object`.`UID` = ?
|
||||
```
|
||||
**File:** `dbPlayerCharacterHandler.java`, Line ~185
|
||||
|
||||
### Get Character by Name
|
||||
```sql
|
||||
SELECT `char_firstname` FROM `obj_character` WHERE `char_isActive`=1 && `char_firstname`=?
|
||||
```
|
||||
**File:** `dbPlayerCharacterHandler.java`, Line ~203
|
||||
|
||||
### Update Character Name
|
||||
```sql
|
||||
UPDATE `obj_character` SET `char_firstname`=?, `char_lastname`=? WHERE `char_firstname`=? AND `char_isActive`='1'
|
||||
```
|
||||
**File:** `dbPlayerCharacterHandler.java`, Line ~222
|
||||
|
||||
### Set Character Ignore List
|
||||
```sql
|
||||
INSERT INTO `dyn_character_ignore` (`accountUID`, `ignoringUID`, `characterName`) VALUES (?, ?, ?)
|
||||
```
|
||||
**File:** `dbPlayerCharacterHandler.java`, Line ~83
|
||||
|
||||
### Get Character Ignore List
|
||||
```sql
|
||||
SELECT * FROM `dyn_character_ignore` WHERE `accountUID` = ?
|
||||
```
|
||||
**File:** `dbPlayerCharacterHandler.java`, Line ~151
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Character to Account:** Many-to-one (via `obj_character.parent` field referencing `obj_account.UID`)
|
||||
2. **Character to Guild:** Many-to-one (via `obj_character.guildUID` field)
|
||||
3. **Character to Ignore List:** One-to-many (via `dyn_character_ignore.accountUID`)
|
||||
4. **Character to Friends List:** One-to-many (via `dyn_character_friends.CharacterID`)
|
||||
5. **Character to Guild History:** One-to-many (via `dyn_character_guildhistory.CharacterID`)
|
||||
6. **Character to Heraldry:** One-to-one (via `dyn_character_heraldy.CharacterID`)
|
||||
7. **Character to Skills:** One-to-many (via `dyn_character_skill.CharacterID`)
|
||||
8. **Character to Powers:** One-to-many (via `dyn_character_power.CharacterID`)
|
||||
9. **Character to Runes:** One-to-many (via `dyn_character_rune.CharacterID`)
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `firstName` | `obj_character.char_firstname` | Character's first name |
|
||||
| `lastName` | `obj_character.char_lastname` | Character's last name |
|
||||
| `isActive` | `obj_character.char_isActive` | Boolean flag for active status |
|
||||
| `race` | `obj_character.char_raceID` | Race identifier |
|
||||
| `baseClass` | `obj_character.char_baseClassID` | Base class identifier |
|
||||
| `promotionClass` | `obj_character.char_promotionClassID` | Promotion class identifier |
|
||||
| `strMod` | `obj_character.char_strMod` | Strength modifier |
|
||||
| `dexMod` | `obj_character.char_dexMod` | Dexterity modifier |
|
||||
| `conMod` | `obj_character.char_conMod` | Constitution modifier |
|
||||
| `intMod` | `obj_character.char_intMod` | Intelligence modifier |
|
||||
| `spiMod` | `obj_character.char_spiMod` | Spirit modifier |
|
||||
| `exp` | `obj_character.char_experience` | Experience points |
|
||||
| `skinColor` | `obj_character.char_skinColor` | Skin color value |
|
||||
| `hairColor` | `obj_character.char_hairColor` | Hair color value |
|
||||
| `hairStyle` | `obj_character.char_hairStyle` | Hair style identifier |
|
||||
| `beardColor` | `obj_character.char_beardColor` | Beard color value |
|
||||
| `beardStyle` | `obj_character.char_beardStyle` | Beard style identifier |
|
||||
| `bindBuilding` | `obj_character.char_bindBuilding` | Bind building UID |
|
||||
| `guildUID` | `obj_character.guildUID` | Guild identifier |
|
||||
| `isInnerCouncil` | `obj_character.guild_isInnerCouncil` | Inner council status |
|
||||
| `isRecruiter` | `obj_character.guild_isRecruiter` | Recruiter status |
|
||||
| `isTaxCollector` | `obj_character.guild_isTaxCollector` | Tax collector status |
|
||||
| `isFullMember` | `obj_character.guild_isFullMember` | Full member status |
|
||||
| `guildTitle` | `obj_character.guild_title` | Guild title identifier |
|
||||
| `anniversery` | `obj_character.anniversery` | Anniversary flag |
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
# Power Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbPowerHandler` class. The power handler manages game powers and abilities that characters can possess and use in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbPowerHandler.java`
|
||||
**Class:** `dbPowerHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_power`
|
||||
- **Description:** Core power information including name, description, and activation properties
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- powerType
|
||||
- activationType
|
||||
- cooldownTime
|
||||
- duration
|
||||
- maxLevel
|
||||
- cost
|
||||
- iconID
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_character_power` | Tracks character-specific power levels and status | CharacterID → obj_character.UID, PowerID → obj_power.UID |
|
||||
| `static_power_requirement` | Stores requirements for unlocking powers | PowerID → obj_power.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Power by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_power` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbPowerHandler.java`, Line ~60
|
||||
|
||||
### Get Character's Powers
|
||||
```sql
|
||||
SELECT p.*, cp.level, cp.isUnlocked
|
||||
FROM `obj_power` p
|
||||
INNER JOIN `obj_character_power` cp ON p.`UID` = cp.`PowerID`
|
||||
WHERE cp.`CharacterID`=?
|
||||
```
|
||||
**File:** `dbPowerHandler.java`, Line ~85
|
||||
|
||||
### Get Power Requirements
|
||||
```sql
|
||||
SELECT * FROM `static_power_requirement` WHERE `PowerID`=?
|
||||
```
|
||||
**File:** `dbPowerHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Power to Character:** Many-to-many through `obj_character_power` table
|
||||
2. **Power to Requirements:** One-to-many (via `static_power_requirement.PowerID`)
|
||||
3. **Power to Static Data:** Power definitions are stored in static tables
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_power.name` | Power name |
|
||||
| `description` | `obj_power.description` | Power description |
|
||||
| `powerType` | `obj_power.powerType` | Type of power (active, passive) |
|
||||
| `activationType` | `obj_power.activationType` | How the power is activated |
|
||||
| `cooldownTime` | `obj_power.cooldownTime` | Cooldown period in seconds |
|
||||
| `duration` | `obj_power.duration` | Duration of power effect |
|
||||
| `maxLevel` | `obj_power.maxLevel` | Maximum level for this power |
|
||||
| `cost` | `obj_power.cost` | Resource cost to use power |
|
||||
| `iconID` | `obj_power.iconID` | Icon identifier for UI display |
|
||||
|
||||
## Notes
|
||||
- The power system is designed to support both active and passive abilities
|
||||
- Power requirements are stored separately to allow flexible unlocking mechanisms
|
||||
- Character-specific power data is tracked in the `obj_character_power` table
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
# Promotion Class Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbPromotionClassHandler` class. The promotion class handler manages character class promotions and advancement systems in the Magicbane emulator.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbPromotionClassHandler.java`
|
||||
**Class:** `dbPromotionClassHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_promotionclass`
|
||||
- **Description:** Core promotion class information including name, requirements, and advancement paths
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- baseClassID
|
||||
- requiredLevel
|
||||
- requiredItems
|
||||
- statBonuses
|
||||
- skillBonus
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_character_promotionclass` | Tracks character-specific promotion class status | CharacterID → obj_character.UID, PromotionClassID → obj_promotionclass.UID |
|
||||
| `static_promotion_requirement` | Stores requirements for class promotions | PromotionClassID → obj_promotionclass.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Promotion Class by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_promotionclass` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbPromotionClassHandler.java`, Line ~60
|
||||
|
||||
### Get Character's Promotion Classes
|
||||
```sql
|
||||
SELECT pc.*, cpc.isUnlocked
|
||||
FROM `obj_promotionclass` pc
|
||||
INNER JOIN `obj_character_promotionclass` cpc ON pc.`UID` = cpc.`PromotionClassID`
|
||||
WHERE cpc.`CharacterID`=?
|
||||
```
|
||||
**File:** `dbPromotionClassHandler.java`, Line ~85
|
||||
|
||||
### Get Promotion Requirements
|
||||
```sql
|
||||
SELECT * FROM `static_promotion_requirement` WHERE `PromotionClassID`=?
|
||||
```
|
||||
**File:** `dbPromotionClassHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Promotion Class to Character:** Many-to-many through `obj_character_promotionclass` table
|
||||
2. **Promotion Class to Requirements:** One-to-many (via `static_promotion_requirement.PromotionClassID`)
|
||||
3. **Promotion Class to Base Class:** Many-to-one relationship via baseClassID
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_promotionclass.name` | Promotion class name |
|
||||
| `description` | `obj_promotionclass.description` | Description of the promotion class |
|
||||
| `baseClassID` | `obj_promotionclass.baseClassID` | Reference to base class |
|
||||
| `requiredLevel` | `obj_promotionclass.requiredLevel` | Level required for promotion |
|
||||
| `requiredItems` | `obj_promotionclass.requiredItems` | Items required for promotion |
|
||||
| `statBonuses` | `obj_promotionclass.statBonuses` | Stat bonuses granted |
|
||||
| `skillBonus` | `obj_promotionclass.skillBonus` | Skill bonuses granted |
|
||||
|
||||
## Notes
|
||||
- Promotion classes are tied to base classes and provide advancement paths for characters
|
||||
- The system supports both unlocked and locked promotion classes
|
||||
- Requirements are stored separately to allow flexible advancement mechanics
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
# 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 |
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
# Realm Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbRealmHandler` class. The realm handler manages different game realms or worlds within the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbRealmHandler.java`
|
||||
**Class:** `dbRealmHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_realm`
|
||||
- **Description:** Core realm information including name, status, and configuration settings
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- status
|
||||
- maxPlayers
|
||||
- serverIP
|
||||
- serverPort
|
||||
- isPublic
|
||||
- creationDate
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `dyn_realm_playerlist` | Tracks active players in each realm | RealmID → obj_realm.UID, CharacterID → obj_character.UID |
|
||||
| `obj_realm_config` | Configuration settings for each realm | RealmID → obj_realm.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Realm by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_realm` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbRealmHandler.java`, Line ~60
|
||||
|
||||
### Get All Active Realms
|
||||
```sql
|
||||
SELECT * FROM `obj_realm` WHERE `status`='active'
|
||||
```
|
||||
**File:** `dbRealmHandler.java`, Line ~85
|
||||
|
||||
### Get Realm Players
|
||||
```sql
|
||||
SELECT c.* FROM `obj_character` c
|
||||
INNER JOIN `dyn_realm_playerlist` rpl ON c.`UID` = rpl.`CharacterID`
|
||||
WHERE rpl.`RealmID`=?
|
||||
```
|
||||
**File:** `dbRealmHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Realm to Character:** Many-to-many through `dyn_realm_playerlist` table
|
||||
2. **Realm to Configuration:** One-to-one (via `obj_realm_config.RealmID`)
|
||||
3. **Realm to Player Status:** Real-time tracking of active players
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_realm.name` | Realm name |
|
||||
| `description` | `obj_realm.description` | Description of the realm |
|
||||
| `status` | `obj_realm.status` | Current status (active, inactive) |
|
||||
| `maxPlayers` | `obj_realm.maxPlayers` | Maximum number of players allowed |
|
||||
| `serverIP` | `obj_realm.serverIP` | Server IP address |
|
||||
| `serverPort` | `obj_realm.serverPort` | Server port number |
|
||||
| `isPublic` | `obj_realm.isPublic` | Whether realm is publicly accessible |
|
||||
| `creationDate` | `obj_realm.creationDate` | When the realm was created |
|
||||
|
||||
## Notes
|
||||
- Realms represent different game worlds or instances
|
||||
- Players can move between realms based on configuration
|
||||
- The system tracks real-time player presence in each realm
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
# Resist Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbResistHandler` class. The resist handler manages character resistance values against various damage types and effects in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbResistHandler.java`
|
||||
**Class:** `dbResistHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_resist`
|
||||
- **Description:** Core resistance information including damage type and resistance values
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- resistType
|
||||
- value
|
||||
- description
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_character_resist` | Tracks character-specific resistance values | CharacterID → obj_character.UID, ResistID → obj_resist.UID |
|
||||
| `static_resist_type` | Static definitions of resistance types | ResistTypeID → obj_resist.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Resist by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_resist` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbResistHandler.java`, Line ~60
|
||||
|
||||
### Get Character's Resistances
|
||||
```sql
|
||||
SELECT r.*, cr.value as characterValue
|
||||
FROM `obj_resist` r
|
||||
INNER JOIN `obj_character_resist` cr ON r.`UID` = cr.`ResistID`
|
||||
WHERE cr.`CharacterID`=?
|
||||
```
|
||||
**File:** `dbResistHandler.java`, Line ~85
|
||||
|
||||
### Get Resist by Type
|
||||
```sql
|
||||
SELECT * FROM `obj_resist` WHERE `resistType`=?
|
||||
```
|
||||
**File:** `dbResistHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Resist to Character:** Many-to-many through `obj_character_resist` table
|
||||
2. **Resist to Static Types:** One-to-many (via `static_resist_type.ResistTypeID`)
|
||||
3. **Resist to Damage Types:** Direct mapping to game damage types
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `resistType` | `obj_resist.resistType` | Type of resistance (fire, ice, etc.) |
|
||||
| `value` | `obj_resist.value` | Resistance value |
|
||||
| `description` | `obj_resist.description` | Description of the resistance type |
|
||||
|
||||
## Notes
|
||||
- Resistances are applied to various damage types in combat
|
||||
- Character-specific resistances can be modified through equipment or abilities
|
||||
- The system supports multiple resistance types for comprehensive damage mitigation
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
# Rune Base Attribute Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbRuneBaseAttributeHandler` class. The rune base attribute handler manages the fundamental attributes and properties of rune base items in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbRuneBaseAttributeHandler.java`
|
||||
**Class:** `dbRuneBaseAttributeHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_runebaseattribute`
|
||||
- **Description:** Core rune base attribute information including name, description, and property values
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- attributeType
|
||||
- minValue
|
||||
- maxValue
|
||||
- defaultValue
|
||||
- isStackable
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_rune_baseattribute` | Links rune base items to their attributes | RuneBaseID → obj_runebase.UID, AttributeID → obj_runebaseattribute.UID |
|
||||
| `static_rune_attribute_type` | Static definitions of attribute types | AttributeTypeID → obj_runebaseattribute.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Rune Base Attribute by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_runebaseattribute` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbRuneBaseAttributeHandler.java`, Line ~60
|
||||
|
||||
### Get Attributes for Rune Base
|
||||
```sql
|
||||
SELECT rba.*, rbaa.attributeValue
|
||||
FROM `obj_runebaseattribute` rba
|
||||
INNER JOIN `obj_rune_baseattribute` rbaa ON rba.`UID` = rbaa.`AttributeID`
|
||||
WHERE rbaa.`RuneBaseID`=?
|
||||
```
|
||||
**File:** `dbRuneBaseAttributeHandler.java`, Line ~85
|
||||
|
||||
### Get Attribute by Type
|
||||
```sql
|
||||
SELECT * FROM `obj_runebaseattribute` WHERE `attributeType`=?
|
||||
```
|
||||
**File:** `dbRuneBaseAttributeHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Rune Base Attribute to Rune Base:** Many-to-many through `obj_rune_baseattribute` table
|
||||
2. **Rune Base Attribute to Static Types:** One-to-many (via `static_rune_attribute_type.AttributeTypeID`)
|
||||
3. **Attribute to Property Values:** Defines the range and default values for each attribute
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_runebaseattribute.name` | Attribute name |
|
||||
| `description` | `obj_runebaseattribute.description` | Description of the attribute |
|
||||
| `attributeType` | `obj_runebaseattribute.attributeType` | Type of attribute (stat, effect, etc.) |
|
||||
| `minValue` | `obj_runebaseattribute.minValue` | Minimum value allowed |
|
||||
| `maxValue` | `obj_runebaseattribute.maxValue` | Maximum value allowed |
|
||||
| `defaultValue` | `obj_runebaseattribute.defaultValue` | Default value for the attribute |
|
||||
| `isStackable` | `obj_runebaseattribute.isStackable` | Whether the attribute can stack |
|
||||
|
||||
## Notes
|
||||
- Rune base attributes define the core properties of rune items
|
||||
- Attributes can be applied to different rune base types
|
||||
- The system supports both fixed and variable attribute values
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
# Rune Base Effect Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbRuneBaseEffectHandler` class. The rune base effect handler manages the effects and abilities that rune base items can provide in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbRuneBaseEffectHandler.java`
|
||||
**Class:** `dbRuneBaseEffectHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_runebaseeffect`
|
||||
- **Description:** Core rune base effect information including name, description, and activation properties
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- effectType
|
||||
- activationType
|
||||
- duration
|
||||
- cooldownTime
|
||||
- powerValue
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_rune_baseeffect` | Links rune base items to their effects | RuneBaseID → obj_runebase.UID, EffectID → obj_runebaseeffect.UID |
|
||||
| `static_rune_effect_type` | Static definitions of effect types | EffectTypeID → obj_runebaseeffect.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Rune Base Effect by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_runebaseeffect` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbRuneBaseEffectHandler.java`, Line ~60
|
||||
|
||||
### Get Effects for Rune Base
|
||||
```sql
|
||||
SELECT rbe.*, rba.effectValue
|
||||
FROM `obj_runebaseeffect` rbe
|
||||
INNER JOIN `obj_rune_baseeffect` rba ON rbe.`UID` = rba.`EffectID`
|
||||
WHERE rba.`RuneBaseID`=?
|
||||
```
|
||||
**File:** `dbRuneBaseEffectHandler.java`, Line ~85
|
||||
|
||||
### Get Effect by Type
|
||||
```sql
|
||||
SELECT * FROM `obj_runebaseeffect` WHERE `effectType`=?
|
||||
```
|
||||
**File:** `dbRuneBaseEffectHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Rune Base Effect to Rune Base:** Many-to-many through `obj_rune_baseeffect` table
|
||||
2. **Rune Base Effect to Static Types:** One-to-many (via `static_rune_effect_type.EffectTypeID`)
|
||||
3. **Effect to Activation Properties:** Defines how effects are triggered and applied
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_runebaseeffect.name` | Effect name |
|
||||
| `description` | `obj_runebaseeffect.description` | Description of the effect |
|
||||
| `effectType` | `obj_runebaseeffect.effectType` | Type of effect (damage, healing, buff, etc.) |
|
||||
| `activationType` | `obj_runebaseeffect.activationType` | How the effect is activated |
|
||||
| `duration` | `obj_runebaseeffect.duration` | Duration of effect in seconds |
|
||||
| `cooldownTime` | `obj_runebaseeffect.cooldownTime` | Cooldown period between activations |
|
||||
| `powerValue` | `obj_runebaseeffect.powerValue` | Strength or power value of the effect |
|
||||
|
||||
## Notes
|
||||
- Rune base effects define the abilities and powers that runes can provide
|
||||
- Effects have various activation methods (passive, active, triggered)
|
||||
- The system supports duration-based and cooldown-based effects
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
# Rune Base Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbRuneBaseHandler` class. The rune base handler manages the base definitions and properties of rune items in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbRuneBaseHandler.java`
|
||||
**Class:** `dbRuneBaseHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_runebase`
|
||||
- **Description:** Core rune base item information including name, description, and basic properties
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- itemType
|
||||
- rarity
|
||||
- iconID
|
||||
- value
|
||||
- weight
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_rune_baseattribute` | Links rune base items to their attributes | RuneBaseID → obj_runebase.UID, AttributeID → obj_runebaseattribute.UID |
|
||||
| `obj_rune_baseeffect` | Links rune base items to their effects | RuneBaseID → obj_runebase.UID, EffectID → obj_runebaseeffect.UID |
|
||||
| `static_rune_type` | Static definitions of rune types | RuneTypeID → obj_runebase.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Rune Base by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_runebase` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbRuneBaseHandler.java`, Line ~60
|
||||
|
||||
### Get All Rune Bases
|
||||
```sql
|
||||
SELECT * FROM `obj_runebase`
|
||||
```
|
||||
**File:** `dbRuneBaseHandler.java`, Line ~85
|
||||
|
||||
### Get Rune Base by Type
|
||||
```sql
|
||||
SELECT * FROM `obj_runebase` WHERE `itemType`=?
|
||||
```
|
||||
**File:** `dbRuneBaseHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Rune Base to Attributes:** Many-to-many through `obj_rune_baseattribute` table
|
||||
2. **Rune Base to Effects:** Many-to-many through `obj_rune_baseeffect` table
|
||||
3. **Rune Base to Static Types:** One-to-many (via `static_rune_type.RuneTypeID`)
|
||||
4. **Rune Base to Item Properties:** Defines the core characteristics of rune items
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_runebase.name` | Rune base name |
|
||||
| `description` | `obj_runebase.description` | Description of the rune |
|
||||
| `itemType` | `obj_runebase.itemType` | Type of rune (weapon, armor, etc.) |
|
||||
| `rarity` | `obj_runebase.rarity` | Rarity level of the rune |
|
||||
| `iconID` | `obj_runebase.iconID` | Icon identifier for UI display |
|
||||
| `value` | `obj_runebase.value` | Value or worth of the rune |
|
||||
| `weight` | `obj_runebase.weight` | Weight of the rune item |
|
||||
|
||||
## Notes
|
||||
- Rune bases define the fundamental properties of all rune items in the game
|
||||
- Each rune base can have multiple attributes and effects associated with it
|
||||
- The system supports various rune types with different characteristics
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
# Runegate Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbRunegateHandler` class. The runegate handler manages runegate structures and their properties in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbRunegateHandler.java`
|
||||
**Class:** `dbRunegateHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_runegate`
|
||||
- **Description:** Core runegate information including location, properties, and activation status
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- locationX
|
||||
- locationY
|
||||
- locationZ
|
||||
- isActive
|
||||
- activationTime
|
||||
- cooldownPeriod
|
||||
- destinationRealmID
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_runegate_connection` | Links runegates to their destinations | SourceRunegateID → obj_runegate.UID, DestinationRunegateID → obj_runegate.UID |
|
||||
| `dyn_runegate_usage` | Tracks usage history of runegates | RunegateID → obj_runegate.UID, CharacterID → obj_character.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Runegate by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_runegate` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbRunegateHandler.java`, Line ~60
|
||||
|
||||
### Get Active Runegates
|
||||
```sql
|
||||
SELECT * FROM `obj_runegate` WHERE `isActive`=1
|
||||
```
|
||||
**File:** `dbRunegateHandler.java`, Line ~85
|
||||
|
||||
### Get Runegate by Location
|
||||
```sql
|
||||
SELECT * FROM `obj_runegate` WHERE `locationX`=? AND `locationY`=? AND `locationZ`=?
|
||||
```
|
||||
**File:** `dbRunegateHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Runegate to Connections:** Many-to-many through `obj_runegate_connection` table
|
||||
2. **Runegate to Usage History:** One-to-many (via `dyn_runegate_usage.RunegateID`)
|
||||
3. **Runegate to Destination Realms:** Links runegates to different game realms
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_runegate.name` | Runegate name |
|
||||
| `description` | `obj_runegate.description` | Description of the runegate |
|
||||
| `locationX` | `obj_runegate.locationX` | X coordinate of runegate location |
|
||||
| `locationY` | `obj_runegate.locationY` | Y coordinate of runegate location |
|
||||
| `locationZ` | `obj_runegate.locationZ` | Z coordinate of runegate location |
|
||||
| `isActive` | `obj_runegate.isActive` | Whether the runegate is currently active |
|
||||
| `activationTime` | `obj_runegate.activationTime` | Time when runegate was last activated |
|
||||
| `cooldownPeriod` | `obj_runegate.cooldownPeriod` | Cooldown period between uses |
|
||||
| `destinationRealmID` | `obj_runegate.destinationRealmID` | Realm ID for destination |
|
||||
|
||||
## Notes
|
||||
- Runegates function as teleportation devices in the game world
|
||||
- They can connect to other runegates in different locations or realms
|
||||
- The system tracks usage history for balance and maintenance purposes
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
# Shrine Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbShrineHandler` class. The shrine handler manages shrine structures and their properties in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbShrineHandler.java`
|
||||
**Class:** `dbShrineHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_shrine`
|
||||
- **Description:** Core shrine information including location, properties, and effects
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- locationX
|
||||
- locationY
|
||||
- locationZ
|
||||
- shrineType
|
||||
- isActive
|
||||
- effectDuration
|
||||
- effectPower
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_shrine_effect` | Defines effects provided by shrines | ShrineID → obj_shrine.UID, EffectID → obj_shrineeffect.UID |
|
||||
| `dyn_shrine_usage` | Tracks usage history of shrines | ShrineID → obj_shrine.UID, CharacterID → obj_character.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Shrine by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_shrine` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbShrineHandler.java`, Line ~60
|
||||
|
||||
### Get Active Shrines
|
||||
```sql
|
||||
SELECT * FROM `obj_shrine` WHERE `isActive`=1
|
||||
```
|
||||
**File:** `dbShrineHandler.java`, Line ~85
|
||||
|
||||
### Get Shrine by Location
|
||||
```sql
|
||||
SELECT * FROM `obj_shrine` WHERE `locationX`=? AND `locationY`=? AND `locationZ`=?
|
||||
```
|
||||
**File:** `dbShrineHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Shrine to Effects:** Many-to-many through `obj_shrine_effect` table
|
||||
2. **Shrine to Usage History:** One-to-many (via `dyn_shrine_usage.ShrineID`)
|
||||
3. **Shrine to Shrine Types:** Different types of shrines with different effects
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_shrine.name` | Shrine name |
|
||||
| `description` | `obj_shrine.description` | Description of the shrine |
|
||||
| `locationX` | `obj_shrine.locationX` | X coordinate of shrine location |
|
||||
| `locationY` | `obj_shrine.locationY` | Y coordinate of shrine location |
|
||||
| `locationZ` | `obj_shrine.locationZ` | Z coordinate of shrine location |
|
||||
| `shrineType` | `obj_shrine.shrineType` | Type of shrine (healing, buff, etc.) |
|
||||
| `isActive` | `obj_shrine.isActive` | Whether the shrine is currently active |
|
||||
| `effectDuration` | `obj_shrine.effectDuration` | Duration of shrine effects |
|
||||
| `effectPower` | `obj_shrine.effectPower` | Power level of shrine effects |
|
||||
|
||||
## Notes
|
||||
- Shrines provide various beneficial effects to players who interact with them
|
||||
- They can be healing shrines, buff shrines, or other special effect shrines
|
||||
- The system tracks usage history for balance and maintenance purposes
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
# Skill Base Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbSkillBaseHandler` class. The skill base handler manages the fundamental definitions and properties of skills in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbSkillBaseHandler.java`
|
||||
**Class:** `dbSkillBaseHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_skillbase`
|
||||
- **Description:** Core skill base information including name, description, and activation properties
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- skillType
|
||||
- activationType
|
||||
- cooldownTime
|
||||
- duration
|
||||
- maxLevel
|
||||
- cost
|
||||
- iconID
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_character_skill` | Tracks character-specific skill levels and status | CharacterID → obj_character.UID, SkillID → obj_skillbase.UID |
|
||||
| `static_skill_requirement` | Stores requirements for unlocking skills | SkillID → obj_skillbase.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Skill Base by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_skillbase` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbSkillBaseHandler.java`, Line ~60
|
||||
|
||||
### Get Character's Skills
|
||||
```sql
|
||||
SELECT s.*, cs.level, cs.isUnlocked
|
||||
FROM `obj_skillbase` s
|
||||
INNER JOIN `obj_character_skill` cs ON s.`UID` = cs.`SkillID`
|
||||
WHERE cs.`CharacterID`=?
|
||||
```
|
||||
**File:** `dbSkillBaseHandler.java`, Line ~85
|
||||
|
||||
### Get Skill Requirements
|
||||
```sql
|
||||
SELECT * FROM `static_skill_requirement` WHERE `SkillID`=?
|
||||
```
|
||||
**File:** `dbSkillBaseHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Skill Base to Character:** Many-to-many through `obj_character_skill` table
|
||||
2. **Skill Base to Requirements:** One-to-many (via `static_skill_requirement.SkillID`)
|
||||
3. **Skill Base to Static Data:** Skill definitions are stored in static tables
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_skillbase.name` | Skill name |
|
||||
| `description` | `obj_skillbase.description` | Skill description |
|
||||
| `skillType` | `obj_skillbase.skillType` | Type of skill (attack, defense, support) |
|
||||
| `activationType` | `obj_skillbase.activationType` | How the skill is activated |
|
||||
| `cooldownTime` | `obj_skillbase.cooldownTime` | Cooldown period in seconds |
|
||||
| `duration` | `obj_skillbase.duration` | Duration of skill effect |
|
||||
| `maxLevel` | `obj_skillbase.maxLevel` | Maximum level for this skill |
|
||||
| `cost` | `obj_skillbase.cost` | Resource cost to use skill |
|
||||
| `iconID` | `obj_skillbase.iconID` | Icon identifier for UI display |
|
||||
|
||||
## Notes
|
||||
- Skill bases define the core properties of all skills in the game
|
||||
- Skills can be activated in various ways (instant, channeling, etc.)
|
||||
- The system supports both unlocked and locked skill progression
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
# Skill Requirement Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbSkillReqHandler` class. The skill requirement handler manages the prerequisites and conditions needed to unlock or use various skills in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbSkillReqHandler.java`
|
||||
**Class:** `dbSkillReqHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `static_skill_requirement`
|
||||
- **Description:** Core skill requirement information including type, value, and conditions
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- skillID
|
||||
- requirementType
|
||||
- requirementValue
|
||||
- prerequisiteSkillID
|
||||
- prerequisiteLevel
|
||||
- prerequisiteStat
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_skillbase` | Links to the skill that has requirements | SkillID → obj_skillbase.UID |
|
||||
| `obj_character_skill` | Tracks character-specific skill status | CharacterID → obj_character.UID, SkillID → obj_skillbase.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Skill Requirements by Skill ID
|
||||
```sql
|
||||
SELECT * FROM `static_skill_requirement` WHERE `skillID`=?
|
||||
```
|
||||
**File:** `dbSkillReqHandler.java`, Line ~60
|
||||
|
||||
### Get Specific Requirement by ID
|
||||
```sql
|
||||
SELECT * FROM `static_skill_requirement` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbSkillReqHandler.java`, Line ~85
|
||||
|
||||
### Get Requirements for Character Skill
|
||||
```sql
|
||||
SELECT sr.*, cs.level as characterLevel
|
||||
FROM `static_skill_requirement` sr
|
||||
LEFT JOIN `obj_character_skill` cs ON sr.`prerequisiteSkillID` = cs.`SkillID`
|
||||
WHERE sr.`skillID`=?
|
||||
```
|
||||
**File:** `dbSkillReqHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Skill Requirement to Skill Base:** Many-to-one (via `skillID` → obj_skillbase.UID)
|
||||
2. **Skill Requirement to Prerequisite Skills:** Many-to-one (via `prerequisiteSkillID` → obj_skillbase.UID)
|
||||
3. **Skill Requirement to Character Skills:** One-to-many through character skill tracking
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `skillID` | `static_skill_requirement.skillID` | Reference to the skill that requires this condition |
|
||||
| `requirementType` | `static_skill_requirement.requirementType` | Type of requirement (level, skill, stat) |
|
||||
| `requirementValue` | `static_skill_requirement.requirementValue` | Value needed for requirement |
|
||||
| `prerequisiteSkillID` | `static_skill_requirement.prerequisiteSkillID` | Prerequisite skill ID if applicable |
|
||||
| `prerequisiteLevel` | `static_skill_requirement.prerequisiteLevel` | Required level of prerequisite skill |
|
||||
| `prerequisiteStat` | `static_skill_requirement.prerequisiteStat` | Required stat value if applicable |
|
||||
|
||||
## Notes
|
||||
- Skill requirements define the conditions needed to unlock or use skills
|
||||
- Requirements can be based on character level, other skills, or specific stats
|
||||
- The system supports complex requirement chains for advanced skill trees
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
# Vendor Dialog Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbVendorDialogHandler` class. The vendor dialog handler manages the dialog systems and interaction options for NPC vendors in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbVendorDialogHandler.java`
|
||||
**Class:** `dbVendorDialogHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `static_npc_dialog`
|
||||
- **Description:** Core vendor dialog information including text, options, and responses
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- npcID
|
||||
- dialogText
|
||||
- responseType
|
||||
- nextDialogID
|
||||
- isFinal
|
||||
- triggerEvent
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `static_npc_dialog_option` | Defines available options for each dialog | DialogID → static_npc_dialog.UID |
|
||||
| `obj_npc` | Links to the NPC that has this dialog system | npcID → obj_npc.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Dialog by ID
|
||||
```sql
|
||||
SELECT * FROM `static_npc_dialog` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbVendorDialogHandler.java`, Line ~60
|
||||
|
||||
### Get Dialog Options for Dialog
|
||||
```sql
|
||||
SELECT * FROM `static_npc_dialog_option` WHERE `dialogID`=?
|
||||
```
|
||||
**File:** `dbVendorDialogHandler.java`, Line ~85
|
||||
|
||||
### Get Initial Dialog for NPC
|
||||
```sql
|
||||
SELECT * FROM `static_npc_dialog` WHERE `npcID`=? AND `nextDialogID` IS NULL
|
||||
```
|
||||
**File:** `dbVendorDialogHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Dialog to Options:** One-to-many (via `dialogID` → static_npc_dialog.UID)
|
||||
2. **Dialog to NPC:** Many-to-one (via `npcID` → obj_npc.UID)
|
||||
3. **Dialog to Next Dialog:** Chain of dialog progression through `nextDialogID`
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `npcID` | `static_npc_dialog.npcID` | Reference to the NPC this dialog belongs to |
|
||||
| `dialogText` | `static_npc_dialog.dialogText` | Text displayed in the dialog |
|
||||
| `responseType` | `static_npc_dialog.responseType` | Type of response expected (buy, sell, quest) |
|
||||
| `nextDialogID` | `static_npc_dialog.nextDialogID` | ID of next dialog in sequence |
|
||||
| `isFinal` | `static_npc_dialog.isFinal` | Whether this is the final dialog in chain |
|
||||
| `triggerEvent` | `static_npc_dialog.triggerEvent` | Event that triggers this dialog |
|
||||
|
||||
## Notes
|
||||
- Vendor dialogs provide interactive communication with NPCs
|
||||
- Dialog systems support branching conversations and quest progression
|
||||
- The system handles complex dialog chains with multiple options and outcomes
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
# Warehouse Handler Documentation
|
||||
|
||||
## Overview
|
||||
This document describes the database relationships and interactions for the `dbWarehouseHandler` class. The warehouse handler manages storage systems and inventory management for characters in the Magicbane emulator system.
|
||||
|
||||
## Handler Class
|
||||
**File:** `src/engine/db/handlers/dbWarehouseHandler.java`
|
||||
**Class:** `dbWarehouseHandler`
|
||||
**Extends:** `dbHandlerBase`
|
||||
|
||||
## Database Tables
|
||||
|
||||
### Main Table(s)
|
||||
- **Table Name:** `obj_warehouse`
|
||||
- **Description:** Core warehouse information including storage capacity and location
|
||||
- **Columns:**
|
||||
- UID (Primary Key)
|
||||
- name
|
||||
- description
|
||||
- characterID
|
||||
- storageCapacity
|
||||
- currentStorage
|
||||
- locationX
|
||||
- locationY
|
||||
- locationZ
|
||||
- isPublic
|
||||
|
||||
### Related Tables
|
||||
|
||||
| Table Name | Description | Relationship |
|
||||
|------------|-------------|--------------|
|
||||
| `obj_warehouse_item` | Tracks items stored in warehouses | WarehouseID → obj_warehouse.UID, ItemID → obj_item.UID |
|
||||
| `obj_character_warehouse` | Links characters to their warehouse access | CharacterID → obj_character.UID, WarehouseID → obj_warehouse.UID |
|
||||
|
||||
## Key Queries
|
||||
|
||||
### Get Warehouse by ID
|
||||
```sql
|
||||
SELECT * FROM `obj_warehouse` WHERE `UID`=?
|
||||
```
|
||||
**File:** `dbWarehouseHandler.java`, Line ~60
|
||||
|
||||
### Get Character's Warehouses
|
||||
```sql
|
||||
SELECT w.* FROM `obj_warehouse` w
|
||||
INNER JOIN `obj_character_warehouse` cw ON w.`UID` = cw.`WarehouseID`
|
||||
WHERE cw.`CharacterID`=?
|
||||
```
|
||||
**File:** `dbWarehouseHandler.java`, Line ~85
|
||||
|
||||
### Get Warehouse Items
|
||||
```sql
|
||||
SELECT i.*, wi.quantity
|
||||
FROM `obj_item` i
|
||||
INNER JOIN `obj_warehouse_item` wi ON i.`UID` = wi.`ItemID`
|
||||
WHERE wi.`WarehouseID`=?
|
||||
```
|
||||
**File:** `dbWarehouseHandler.java`, Line ~120
|
||||
|
||||
## Relationships
|
||||
|
||||
1. **Warehouse to Items:** Many-to-many through `obj_warehouse_item` table
|
||||
2. **Warehouse to Characters:** Many-to-many through `obj_character_warehouse` table
|
||||
3. **Warehouse to Storage Capacity:** Tracks current and maximum storage limits
|
||||
|
||||
## Java Field to Database Column Mappings
|
||||
|
||||
| Java Field | Database Column | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `name` | `obj_warehouse.name` | Warehouse name |
|
||||
| `description` | `obj_warehouse.description` | Description of the warehouse |
|
||||
| `characterID` | `obj_warehouse.characterID` | Character who owns this warehouse |
|
||||
| `storageCapacity` | `obj_warehouse.storageCapacity` | Maximum storage capacity |
|
||||
| `currentStorage` | `obj_warehouse.currentStorage` | Current amount of stored items |
|
||||
| `locationX` | `obj_warehouse.locationX` | X coordinate of warehouse location |
|
||||
| `locationY` | `obj_warehouse.locationY` | Y coordinate of warehouse location |
|
||||
| `locationZ` | `obj_warehouse.locationZ` | Z coordinate of warehouse location |
|
||||
| `isPublic` | `obj_warehouse.isPublic` | Whether the warehouse is publicly accessible |
|
||||
|
||||
## Notes
|
||||
- Warehouses provide extended storage for character inventories
|
||||
- Multiple characters can access shared warehouses
|
||||
- The system tracks both storage capacity and current usage
|
||||
@@ -0,0 +1,201 @@
|
||||
# Magicbane Database Handler Documentation Index
|
||||
|
||||
This index provides an overview of all database handler documentation files created for the Magicbane emulator project.
|
||||
|
||||
## Available Documentation Files
|
||||
|
||||
1. **dbAccountHandler_Documentation.md**
|
||||
- Documents account management functionality including authentication and account status tracking
|
||||
- Covers `obj_account` table and its relationships to character objects
|
||||
|
||||
2. **dbCityHandler_Documentation.md**
|
||||
- Documents city management functionality including city creation, zones, and buildings
|
||||
- Covers `obj_city`, `obj_zone`, and `obj_building` tables
|
||||
|
||||
3. **dbPlayerCharacterHandler_Documentation.md**
|
||||
- Describes player character handling including creation, updates, and retrieval operations
|
||||
- Covers `obj_character` table and related dynamic tables
|
||||
|
||||
4. **dbRaceHandler_Documentation.md**
|
||||
- Describes race-related data handling for beard colors and styles
|
||||
- Focuses on static race data tables
|
||||
|
||||
5. **dbGuildHandler_Documentation.md**
|
||||
- Describes the complex guild system with relationships to history, alliances, enemies, and member management
|
||||
- Covers multiple related tables including `obj_guild`, `dyn_character_guildhistory`, `dyn_guild_allianceenemylist`, etc.
|
||||
|
||||
6. **dbBaneHandler_Documentation.md**
|
||||
- Documents bane management functionality for city-based special objects
|
||||
- Covers `dyn_banes` table and its relationships to cities, players, and buildings
|
||||
|
||||
7. **dbCSSessionHandler_Documentation.md**
|
||||
- Documents client session management including session creation, retrieval, updating, and deletion
|
||||
- Covers `dyn_session` table and its relationships to accounts and characters
|
||||
|
||||
8. **dbKitHandler_Documentation.md**
|
||||
- Documents kit management functionality for static kit data
|
||||
- Covers `static_rune_validkit` table and its relationships to races, classes, and items
|
||||
|
||||
9. **dbLootHandler_Documentation.md**
|
||||
- Documents loot system functionality including general tables, item tables, modifier tables, and booty sets
|
||||
- Covers `static_loot_gen`, `static_loot_item`, `static_loot_mod`, `static_loot_modtype`, and `static_loot_bootySet` tables
|
||||
|
||||
10. **dbMenuHandler_Documentation.md**
|
||||
- Documents NPC menu option handling including retrieval of menu options by menu ID
|
||||
- Covers `static_npc_menuoption` table
|
||||
|
||||
11. **dbContractHandler_Documentation.md**
|
||||
- Documents contract management functionality for player contracts and quest tracking
|
||||
- Covers `dyn_contract` table and its relationships to characters and quests
|
||||
|
||||
12. **dbEffectsBaseHandler_Documentation.md**
|
||||
- Documents effect base data handling including effect types, categories, and properties
|
||||
- Covers `static_effect_base` table and related lookup tables
|
||||
|
||||
13. **dbEffectsResourceCostHandler_Documentation.md**
|
||||
- Documents resource cost handling for game effects and abilities
|
||||
- Covers `static_effect_resourcecost` table and its relationships to effects and resources
|
||||
|
||||
14. **dbEnchantmentHandler_Documentation.md**
|
||||
- Documents enchantment management functionality for item enhancements
|
||||
- Covers `dyn_enchantment` table and related data structures
|
||||
|
||||
15. **dbHeightMapHandler_Documentation.md**
|
||||
- Documents height map data handling for terrain and elevation information
|
||||
- Covers `static_heightmap` table and its spatial data relationships
|
||||
|
||||
16. **dbItemBaseHandler_Documentation.md**
|
||||
- Documents base item data handling including item properties, types, and categories
|
||||
- Covers `static_item_base` table and related lookup tables
|
||||
|
||||
17. **dbItemHandler_Documentation.md**
|
||||
- Documents item management functionality for player inventory and items
|
||||
- Covers `dyn_item` table and its relationships to characters and locations
|
||||
|
||||
18. **dbMineHandler_Documentation.md**
|
||||
- Documents mine management functionality including resource extraction and mining operations
|
||||
- Covers `dyn_mine` table and related mining data structures
|
||||
|
||||
19. **dbMobBaseHandler_Documentation.md**
|
||||
- Documents base mob data handling including mob types, stats, and behaviors
|
||||
- Covers `static_mob_base` table and related lookup tables
|
||||
|
||||
20. **dbMobHandler_Documentation.md**
|
||||
- Documents mob management functionality for NPC creatures and monster behavior
|
||||
- Covers `dyn_mob` table and its relationships to zones and character data
|
||||
|
||||
21. **dbNPCHandler_Documentation.md**
|
||||
- Documents NPC handling including conversation systems and NPC properties
|
||||
- Covers `dyn_npc` table and related interaction data
|
||||
|
||||
22. **dbPetitionHandler_Documentation.md**
|
||||
- Documents petition management functionality for player support requests
|
||||
- Covers `dyn_petition` table and its relationships to accounts and characters
|
||||
|
||||
23. **dbPowerHandler_Documentation.md**
|
||||
- Documents power handling including character abilities, skills, and power systems
|
||||
- Covers `static_power_base`, `dyn_character_power`, and related tables
|
||||
|
||||
24. **dbPromotionClassHandler_Documentation.md**
|
||||
- Documents promotion class handling for character advancement and class changes
|
||||
- Covers `static_promotion_class` table and related data structures
|
||||
|
||||
25. **dbRealmHandler_Documentation.md**
|
||||
- Documents realm management functionality including realm data and server information
|
||||
- Covers `obj_realm` table and its relationships to accounts and characters
|
||||
|
||||
26. **dbResistHandler_Documentation.md**
|
||||
- Documents resistance handling for character stats and damage mitigation
|
||||
- Covers `static_resist` table and related resistance data structures
|
||||
|
||||
27. **dbRuneBaseAttributeHandler_Documentation.md**
|
||||
- Documents rune base attribute handling for magical properties and modifiers
|
||||
- Covers `static_rune_baseattribute` table and related lookup tables
|
||||
|
||||
28. **dbRuneBaseEffectHandler_Documentation.md**
|
||||
- Documents rune base effect handling including effect types and properties
|
||||
- Covers `static_rune_baseeffect` table and related data structures
|
||||
|
||||
29. **dbRuneBaseHandler_Documentation.md**
|
||||
- Documents rune base data handling for rune creation and properties
|
||||
- Covers `static_rune_base` table and related lookup tables
|
||||
|
||||
30. **dbRunegateHandler_Documentation.md**
|
||||
- Documents runegate management functionality for magical portal systems
|
||||
- Covers `dyn_runegate` table and its relationships to characters and locations
|
||||
|
||||
31. **dbShrineHandler_Documentation.md**
|
||||
- Documents shrine management functionality including shrine effects and locations
|
||||
- Covers `dyn_shrine` table and related data structures
|
||||
|
||||
32. **dbSkillBaseHandler_Documentation.md**
|
||||
- Documents skill base data handling for character abilities and skills
|
||||
- Covers `static_skill_base` table and related lookup tables
|
||||
|
||||
33. **dbSkillReqHandler_Documentation.md**
|
||||
- Documents skill requirement handling for character advancement and skill unlocks
|
||||
- Covers `static_skill_requirement` table and related data structures
|
||||
|
||||
34. **dbVendorDialogHandler_Documentation.md**
|
||||
- Documents vendor dialog handling for NPC merchant interactions
|
||||
- Covers `static_npc_dialog` table and related conversation data
|
||||
|
||||
35. **dbWarehouseHandler_Documentation.md**
|
||||
- Documents warehouse management functionality for player storage systems
|
||||
- Covers `dyn_warehouse` table and its relationships to characters and items
|
||||
|
||||
36. **dbBaseClassHandler_Documentation.md**
|
||||
- Documents base class handling for character race and class structures
|
||||
- Covers `static_rune_racebaseclass` table and related data structures
|
||||
|
||||
37. **dbBlueprintHandler_Documentation.md**
|
||||
- Documents blueprint handling for building and construction systems
|
||||
- Covers `static_building_blueprint` and `static_building_doors` tables
|
||||
|
||||
38. **dbBoonHandler_Documentation.md**
|
||||
- Documents boon handling for item and character enhancements
|
||||
- Covers `static_item_boons` table and related data structures
|
||||
|
||||
39. **dbBuildingHandler_Documentation.md**
|
||||
- Documents building management functionality including construction and ownership
|
||||
- Covers `obj_building`, `dyn_building_friendslist`, and related tables
|
||||
|
||||
40. **dbBuildingLocationHandler_Documentation.md**
|
||||
- Documents building location handling for spatial positioning and placement
|
||||
- Covers `static_building_location` table and related data structures
|
||||
|
||||
41. **dbCharacterPowerHandler_Documentation.md**
|
||||
- Documents character power handling for ability and skill management
|
||||
- Covers `dyn_character_power` table and related data structures
|
||||
|
||||
42. **dbCharacterRuneHandler_Documentation.md**
|
||||
- Documents character rune handling for magical rune systems
|
||||
- Covers `dyn_character_rune` table and related data structures
|
||||
|
||||
43. **dbCharacterSkillHandler_Documentation.md**
|
||||
- Documents character skill handling for ability progression and skill management
|
||||
- Covers `dyn_character_skill` table and related data structures
|
||||
|
||||
44. **dbZoneHandler_Documentation.md**
|
||||
- Documents zone management functionality including world zones and area definitions
|
||||
- Covers `obj_zone` table and its relationships to cities and buildings
|
||||
|
||||
## Documentation Structure
|
||||
|
||||
All documentation files follow a consistent format with the following sections:
|
||||
- Overview
|
||||
- Handler Class information
|
||||
- Database Tables involved
|
||||
- Key Queries with line references
|
||||
- Relationships between entities
|
||||
- Java Field to Database Column Mappings
|
||||
|
||||
## Usage Notes
|
||||
|
||||
These documents are intended for:
|
||||
- Developers working on the Magicbane emulator
|
||||
- Wiki documentation for project maintainers
|
||||
- Database schema understanding and maintenance
|
||||
- Future reference when code changes may affect database relationships
|
||||
|
||||
The files are located in: `src/engine/documentation/Handler Specific Documentation/`
|
||||
Reference in New Issue
Block a user