# PES6_LAN_Play
**Repository Path**: loa123/PES6_LAN_Play
## Basic Information
- **Project Name**: PES6_LAN_Play
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-09-17
- **Last Updated**: 2026-09-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# PES6_LAN_Play
Play PES6 (Pro Evolution Soccer 6) over LAN using a lightweight local host server and generated Windows XP helper scripts.
## Overview
This project enables LAN multiplayer functionality for PES6 by providing a local server solution. The Python script runs on a host machine and generates Windows XP helper scripts to facilitate connections between systems. It handles all necessary network configurations including endpoint management, hosts file modifications, firewall rules, and connection coordination between players.
## Features
- **Local PES6 LAN Server**: Runs a compatible LAN server on the host machine with full protocol support
- **Automatic Network Configuration**: Configures hosts file and firewall rules automatically on Windows hosts
- **XP Helper Script Generation**: Creates `PES6_XP_CONNECT.cmd` and `PES6_XP_UNDO.cmd` scripts for Windows XP guests
- **Connection Management**: Handles player profiles, room management, and network endpoints
- **STUN Server Support**: Includes built-in STUN server functionality for NAT traversal
- **Flexible Configuration**: Supports custom IP addresses and UDP ports through command-line arguments
## Requirements
### Host PC (Windows 10/11)
- Python 3.x
- Administrator rights for automatic host setup (hosts/firewall configuration)
### Guest PC (Windows XP)
- No Python installation required
- Administrator account for running helper scripts
## Installation and Setup
### Host PC Setup
1. Clone or download this repository to your host machine
2. Run the Python script with appropriate options:
```bash
py pes6_lan.py
```
### Available Command-Line Options
| Option | Description |
|--------|-------------|
| `--ip
` | Specify the LAN IP address to use |
| `--udp-port ` | Set UDP game port (default: 5739) |
| `--no-setup` | Skip automatic hosts/firewall configuration |
| `--undo` | Revert all network changes made by the script |
| `--debug` | Enable debug logging for troubleshooting |
| `--self-test` | Run built-in offline tests without system changes |
| `--output-dir ` | Specify directory for generated XP scripts |
### Guest PC Setup (Windows XP)
1. After running the host script, copy the generated `PES6_XP_CONNECT.cmd` from the `win_xp_generatedScripts/` directory to your Windows XP machine
2. Run `PES6_XP_CONNECT.cmd` once as Administrator
3. The script will configure necessary network settings automatically
4. Start PES6 and navigate to: **Network → (any non-empty password) → Player → PES6 LAN → LAN**
### Undoing Changes
**On Windows XP Guest:**
```cmd
PES6_XP_CONNECT.cmd --undo
```
or run the pre-generated `PES6_XP_UNDO.cmd`
**On Windows Host:**
```bash
py pes6_lan.py --undo
```
## How It Works
The system operates through coordinated components on both host and guest machines:
1. **Host Server**: The `pes6_lan.py` script runs on the host PC, listening on the specified UDP port and managing all LAN connections
2. **IP Detection**: The script automatically detects or uses a configured LAN IPv4 address for server operations
3. **Network Configuration**: When run with administrator privileges, the script automatically:
- Modifies the hosts file to redirect LAN-only traffic
- Opens required firewall ports for PES6 communication
- Configures network routing for optimal connection
4. **XP Helper Scripts**: The generated `.cmd` files configure Windows XP networking to properly connect to the host server
5. **Connection Flow**: Both systems connect through the host server, which manages player profiles, rooms, and game state
## Protocol Implementation
The server implements the complete PES6 LAN protocol including:
- Player authentication and profile management
- Room creation and management
- STUN protocol for endpoint discovery
- Packet encryption and validation
- Lobby and game state synchronization
## Important Notes
- **Current Baseline Design**: The host is designed for Windows 10/11, while the guest targets Windows XP. Contributions to extend support to other systems are welcome.
- **In-Memory State**: All profiles, rooms, and settings are stored in RAM only and are cleared when the server stops. JSON-based persistence for saving progress between restarts is planned for future versions.
- **Administrator Privileges**: Both host setup and XP guest script execution require administrator rights.
## Security and Network Scope
This solution is designed exclusively for local area network use. The server should never be exposed to or forwarded through the public internet. Always ensure both machines are on the same secure LAN before attempting connections.
## Contributing
Contributions are highly welcome, especially for:
- Supporting additional host operating systems
- Implementing JSON-based persistence for game state
- Improving cross-platform compatibility
- Adding new features or protocol enhancements
## Credits
Protocol implementation and research are based on work from:
- [juce/fiveserver](https://github.com/juce/fiveserver) - Original protocol documentation and implementation reference