# Forge Player Module

## Overview
The Player module provides a comprehensive system for managing player data, persistence, and state in the Forge client. It includes features for player initialization, data management, and integration with other systems.

## Dependencies
- forge_client_main
- ArmaDragonflyClient

## Authors
- J. Schmidt
- Creedcoder
- IDSolutions

## Features

### Player Management
1. **Initialization**
   - First-time player setup
   - Data loading from database
   - Default values assignment
   - State initialization
   - Profile creation

2. **Data Persistence**
   - Automatic data saving
   - Periodic state synchronization
   - Position and direction tracking
   - Loadout persistence
   - Equipment state management

3. **State Management**
   - Player position tracking
   - Direction tracking
   - Stance management
   - Weapon holstering
   - Current weapon tracking

### Data Management
1. **Player Data**
   - Armory unlocks
   - Garage unlocks
   - Locker contents
   - Vehicle inventory
   - Financial information
   - Contact details
   - Organization membership
   - Player statistics
   - Equipment loadouts
   - Position and state

2. **Profile Data**
   - Email address
   - Phone number
   - Paygrade
   - Organization
   - Reputation
   - Custom settings
   - Preferences

3. **Save System**
   - Automatic saving
   - Periodic backups
   - Data validation
   - Error recovery
   - State verification

### Integration
1. **Database System**
   - Data persistence
   - State synchronization
   - Profile management
   - Error handling
   - Data validation

2. **Organization System**
   - Member management
   - Role assignment
   - Organization tracking
   - Asset management
   - Financial integration

3. **Financial System**
   - Cash management
   - Bank integration
   - Transaction tracking
   - Paygrade system
   - Financial persistence

## Event Handlers
The module uses several event handlers for initialization and execution:
- `XEH_preInit.sqf`: Pre-initialization setup
- `XEH_postInit.sqf`: Post-initialization tasks
- `XEH_preStart.sqf`: Pre-start configuration

## Usage
To use the player module:
```sqf
// Initialize player
[] call forge_client_init_fnc_initPlayer;

// Load player data
[] call forge_client_init_fnc_playerDBLoad;

// Save player data
[] call forge_client_init_fnc_playerDBSave;

// Handle player load
[_data] call forge_client_init_fnc_handlePlayerLoad;
```

## Debugging
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
```cpp
#define DEBUG_MODE_FULL
```

## Version Information
Version information is managed through the main Forge client system configuration.

## Technical Details
- Real-time data synchronization
- Secure data management
- Comprehensive validation
- Error handling
- State persistence
- Profile management
- Cross-module integration
- Event system integration
- Data versioning
- Backup support
- Transaction logging
- Data integrity checks 