Add comprehensive documentation and unit tests

Documentation:
- Add detailed README files for all services (auth, character, database, launcher, packet, utils, world)
- Create API documentation for the database service with detailed endpoint specifications
- Document database schema and relationships
- Add service architecture overviews and configuration instructions

Unit Tests:
- Implement comprehensive test suite for database repositories (user, character, session)
- Add gRPC service tests for database interactions
- Create tests for packet service components (bufferpool, connection, packets)
- Add utility service tests (health check, logging, load balancer, redis cache, service discovery)
- Implement auth service user tests
- Add character service tests

Code Structure:
- Reorganize test files into a more consistent structure
- Create a dedicated tests crate for integration testing
- Add test helpers and mock implementations for easier testing
This commit is contained in:
2025-04-09 13:29:38 -04:00
parent d47d5f44b1
commit a8755bd3de
85 changed files with 4218 additions and 764 deletions

78
launcher/README.md Normal file
View File

@@ -0,0 +1,78 @@
# Game Launcher
The Game Launcher is a client-side application that launches the MMORPG game client with the appropriate connection parameters.
## Overview
The Launcher is responsible for:
- Parsing launch URLs from the web authentication system
- Extracting connection parameters (server IP, port, session tokens)
- Launching the game client with the correct command-line arguments
- Handling updates (future functionality)
## URL Format
The launcher accepts URLs in the following format:
```
launcher://launch?ip=127.0.0.1&port=29000&session=SESSION_TOKEN&username=USERNAME
```
Parameters:
- `ip`: Game server IP address
- `port`: Game server port
- `otp`: One-time password (for direct login)
- `session`: Session token (for direct login)
- `username`: User's username
- `password`: User's password (only used for non-direct login)
## Command-Line Arguments
The launcher passes the following arguments to the game client:
- `@TRIGGER_SOFT@`: Required trigger argument
- `_server`: Server IP address
- `_port`: Server port
- `_direct`: Direct login flag
- `_otp`: One-time password
- `_session`: Session token
- `_userid`: User's username
- `_pass`: User's password
## Platform Support
The launcher supports:
- Windows: Launches TRose.exe directly
- Linux: Uses Bottles to run the Windows client
## Configuration
No additional configuration is required. The launcher extracts all necessary information from the launch URL.
## Building the Launcher
```bash
cargo build --release
```
## Usage
The launcher is typically invoked by clicking a link on the game's website:
```html
<a href="launcher://launch?ip=127.0.0.1&port=29000&session=SESSION_TOKEN&username=USERNAME">
Launch Game
</a>
```
It can also be run directly from the command line:
```bash
launcher "launcher://launch?ip=127.0.0.1&port=29000&session=SESSION_TOKEN&username=USERNAME"
```
## Integration with External Systems
The Launcher integrates with:
- **Web Authentication System**: Receives launch parameters via URL
- **Game Client**: Launches the client with the appropriate parameters

View File

@@ -1,14 +1,15 @@
use crate::format_shell_command;
use crate::wait_for_keypress;
use std::borrow::Cow;
use std::env;
use std::process::exit;
use std::process::{Command, Stdio};
use tracing::{debug, error, info, warn};
use url::Url;
#[cfg(target_os = "windows")]
fn create_command() -> Command {
use crate::wait_for_keypress;
use std::env;
use std::process::exit;
let exe_dir_path = env::current_exe().unwrap().parent().unwrap().to_path_buf();
// Change the working directory
@@ -76,10 +77,7 @@ pub(crate) fn launch_game(url: String) {
}
}
command
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::null());
command.stdin(Stdio::null()).stdout(Stdio::null()).stderr(Stdio::null());
info!("Executing: {:?}", format_shell_command(&command));