Base working for damage

This commit is contained in:
2026-10-09 23:10:40 -06:00
parent 2895be91c4
commit 3e0ad62cf2
31 changed files with 9758 additions and 67 deletions
+72 -6
View File
@@ -7,6 +7,10 @@
**Powered by** <a href="https://github.com/mazurwiktor/aoaddons-python"> **pyaoaddons** </a> & <a href="https://github.com/mazurwiktor/albion-online-addons"> **albion online addons** </a>
> On Linux the app no longer depends on `pyaoaddons`: it ships a pure-Python
> Protocol18 decoder and captures packets directly through `AF_PACKET`
> (no libpcap needed). `pyaoaddons` is still used on Windows and macOS.
[![Discord](https://discordapp.com/api/guilds/639922572368150552/widget.png?style=banner2)](https://discord.gg/3U2rpyV)
@@ -30,15 +34,65 @@ Albion online stats is an extension to MMORPG game - Albion Online. It tracks ne
## Installation
1. On windows make sure that WinPcap is installed in your system. [Npcap 0.9983 installer for Windows Vista/2008, 7/2008R2, 8/2012, 8.1/2012R2, 10/2016 (x86 and x64)](https://nmap.org/npcap/dist/npcap-0.9983.exe) **Make sure to install with the "Install Npcap in WinPcap API-compatible Mode"**
### Windows
1. Make sure that WinPcap is installed in your system. [Npcap 0.9983 installer for Windows Vista/2008, 7/2008R2, 8/2012, 8.1/2012R2, 10/2016 (x86 and x64)](https://nmap.org/npcap/dist/npcap-0.9983.exe) **Make sure to install with the "Install Npcap in WinPcap API-compatible Mode"**
2. Install python [all platforms installation instructions](https://docs.python.org/3/using/) or via [Microsoft Store](https://www.microsoft.com/en-us/p/python-39/9p7qfqmjrfp7).
3. Download latest launcher from https://github.com/mazurwiktor/albion-online-stats/releases/latest (albion-online-stats.bat for windows albion-online-stats.sh for linux and mac)
3. Enjoy :)
3. Download the latest launcher from https://github.com/mazurwiktor/albion-online-stats/releases/latest (`albion-online-stats.bat`).
4. Enjoy :)
### Linux / macOS
1. Install python 3 and the `venv` module with your package manager. On macOS also install libpcap:
```shell
# Debian / Ubuntu
sudo apt install python3 python3-venv python3-pip
# Fedora
sudo dnf install python3 python3-pip
# Arch
sudo pacman -S python
# macOS
brew install libpcap
```
2. Capturing network traffic requires elevated privileges. Either run the app with `sudo`, or grant the Python interpreter the capabilities it needs:
```shell
sudo setcap cap_net_raw,cap_net_admin=eip "$(readlink -f "$(command -v python3)")"
```
The app can do this for you from the **Fix capture permissions** button in its error dialog.
3. Download the latest launcher from https://github.com/mazurwiktor/albion-online-stats/releases/latest (`albion-online-stats.sh`), make it executable and run it:
```shell
chmod +x albion-online-stats.sh
./albion-online-stats.sh
```
4. Enjoy :)
> **Note:** on macOS (and Windows) the packet capture backend (`pyaoaddons`) only ships prebuilt wheels for CPython 3.6-3.10. If you use a newer Python, `pyaoaddons` is not installed automatically and the app will report that the backend is missing. Either use Python 3.10 (or older) or build `pyaoaddons` from source (requires a Rust toolchain). This does not affect Linux, where the built-in decoder is used.
## Configuration
After first execution the app is going to create default configuration file named `albion-online-stats.cfg`. Feel free to edit it according to your needs.
## Debugging
Start the app with `--verbose` (or set `AOSTATS_VERBOSE=1`) to enable detailed logging of the app and the packet capture backend:
```shell
aostats --verbose
```
This prints the backend initialization result, the capture-permission probe, and every received game event to the terminal. On Windows/macOS the capture backend also writes its own log to `aoaddons.log` in the current working directory.
On Linux the app uses its own `AF_PACKET` capture and Protocol18 decoder; every interface it listens on and every decoded event is logged with `--verbose`.
On Linux, when the app has no permission to capture packets the backend still reports successful initialization; the app detects this and shows a "Fix capture permissions" button regardless.
## Is This Allowed
<p align="center">
<img src="assets/sbistatement.png">
@@ -60,8 +114,9 @@ After first execution the app is going to create default configuration file name
## Prerequisites
- Python installed (python3.6+)
- Python installed (python3.6+). On Linux the built-in decoder requires no extra runtime. On Windows/macOS use CPython 3.6-3.10 to get the `pyaoaddons` capture backend as a prebuilt wheel; newer versions require building it from source.
- *Windows only prerequisites* https://github.com/libpnet/libpnet#windows
- *macOS only prerequisites* libpcap (`brew install libpcap`)
## All platforms
@@ -79,10 +134,21 @@ After first execution the app is going to create default configuration file name
```
3. Install package
3. Install the package with pip (this also installs the dependencies).
On Linux this is all you need. On Windows/macOS, use Python 3.6-3.10 to get the `pyaoaddons` capture backend automatically.
```shell
python setup.py install
python -m pip install .
```
On Windows/macOS with Python 3.11+ the capture backend is not installed
automatically. Either use a Python 3.6-3.10 interpreter, or build
`pyaoaddons` from source first:
```shell
pip install setuptools-rust
pip install --no-build-isolation git+https://github.com/mazurwiktor/aoaddons-python.git
python -m pip install ".[capture]"
```
4. Run the application