Metadata-Version: 2.4
Name: Splatlogger
Version: 1.6.8
Summary: PID (Principal ID)/Network ID grabber and match logger for Splatoon
Author-email: Shadow Doggo <shadowdoggo@protonmail.com>
License-Expression: MIT
Project-URL: Source Code, https://codeberg.org/ShadowDoggo/Splatlogger
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: userpaths
Requires-Dist: requests
Requires-Dist: psutil
Requires-Dist: pymemoryeditor>=2.0.0
Requires-Dist: colorama
Requires-Dist: clean-text

# Splatlogger
A CLI PID (Principal ID)/Network ID grabber and match logger for Splatoon, written in Python.

Both the Wii U and Cemu (Windows & Linux, macOS not tested) are supported.

## Prerequisites (Wii U)
Your console will need to have either the Tiramisu or Aroma environment set up or have another way to run homebrew,
such as Haxchi or the browser exploit.

On Tiramisu, use [TCPGecko](https://github.com/BullyWiiPlaza/tcpgecko), [Geckiine](https://hb-app.store/wiiu/geckiine),
or any other app with the TCPGecko server.

On Aroma, use [TCPGeckoAroma](https://codeberg.org/ShadowDoggo/TCPGeckoAroma)
or [TCPGecko-Plugin](https://github.com/PinkDiamondTeam/TCPGecko-Plugin).

## Installation
### Windows executable
On Windows, you can use the executable provided on the releases page;
though if you already have Python installed, it's recommended to use the package instead.

### Python package
To use the package, you'll need to have Python 3.11 or newer installed on your system.
On Android devices you can use Termux.

Install the package from PyPI:
```
pip install Splatlogger
```
(To upgrade from an older version, use `pip install --upgrade`)

Or download the latest release from Codeberg and run:
```
pip install path/to/Splatlogger-v1.x.zip
```

If you do have Python installed but do not wish to install the package, you can run it from the source code.

Install the required dependencies:
```
cd path/to/Splatlogger-v1.x/ && pip install -r requirements.txt
```
Then run:
```
cd src/ && python -m splatlogger
```

## Usage
Run Splatlogger with:
```
python -m splatlogger --ip IP [options]
```
where `IP` is your Wii U's LAN IP address
(if you have your scripts directory in your PATH, you can omit `python -m`).

If using the Windows executable, run:
```
path/to/Splatlogger-1.x.exe --ip IP [options]
```
(Open a command prompt window and drag the executable into it to automatically get the path).

Options:
- `--aroma` - Switch to port 7332 and enable support for the TCPGeckoAroma plugin.

- `--cemu [PID]` - Switch to Cemu mode. The `--ip` argument is not required.
  - `PID` - PID of the Cemu process (optional).

- `--log-level option` - Set how much data should be logged.
  - `none` - Don't create a log file.
  - `standard` - Log only basic player information, the same as what's printed to the console (default).
  - `extended` - Log all player information and additional match information.
  - `stats` - Same as above with the addition of player stats (points, K/D). Requires the match to end to finish logging; if it ends abruptly, the stats won't be logged.

- `--auto [option]` - Enable auto logging. When enabled will automatically log every match you play. The log level must be at least `standard`.
  - `all` - Save a log of all matches you play (default).
  - `latest` - Save a log of only the latest match.

- `--stack Address (in hex)` - (Cemu only, optional) Beginning address of the stack space for Default Core 1 (Debug > View PPC threads).
Only required for logging stats. If the default values don't work, you'll need to specify this manually.

  <img src="stack.png" width="600" alt="(example)">

- `--spfn` - Fetch SFID instead of PNID. Enable if playing on SPFN.

- `--no-fetch` - Disable fetching network IDs and Mii names.

- `--silent` - Disable printing logs to the console.

For example, `splatlogger --ip 192.168.1.100 --log-level extended --auto latest` will save an extended log of the latest match you play
(replace `192.168.1.100` with your actual IP address).

Logs are saved in `(User)/Documents/Splatlogger/logs/`.

To always run with the same IP and options without having to type them in manually, create a `options.txt` file in
`(User)/Documents/Splatlogger/` and put them in there.
Afterward, run `splatlogger` without any arguments.

Only one program can be connected to TCPGecko at a time. If you have something else connected, disconnect it beforehand.

If it keeps failing to connect, make sure that:
- Your device and Wii U are on the same local network.
- Port 7331/7332 isn't blocked by the firewall.
- The TCPGecko server is enabled.

For Cemu users on Linux, if you have ptrace protection enabled, you'll need to run Python as root. It's best to run the package from source in that case.

## Important notes
- The data collected by Splatlogger is public player info shared by the game with every user you encounter in online matches.

- Network IDs and Mii names are fetched from the Pretendo or SPFN account server; this can be disabled with the `--no-fetch` option.

- Splatlogger does not collect any sensitive information such as account email addresses or IP addresses.

- All data collected stays on your machine and is not sent anywhere.

- Please handle the logs responsibly. I do not encourage sharing other users' data without their permission, even if no real harm can be done with it.

## Acknowledgments
- [pyGecko](https://github.com/wiiudev/pyGecko) authors for the reference implementation of a Python TCPGecko library.

- Everyone who contributed to [PNIDGrab](https://github.com/JerrySM64/PNIDGrab), including:
  - [JerrySM64](https://github.com/JerrySM64)
  - [c8ff](https://github.com/c8ff)
  - [javiig8](https://github.com/javiig8)
  - [Tombuntu](https://github.com/ReXiSp)
  - [CrafterPika](https://github.com/CrafterPika)
  - [RusticMaple](https://github.com/RusticMaple)
  - [vyrval](https://github.com/tvyrval)
  - [oomi_the_octo](https://github.com/oomi-the-octo)

  Their work helped in making this.

- Special thanks to Pirlo for helping me with certain stuff and to 2Epik4u for testing and reporting issues.

## License
This project is licensed under the MIT license; see [LICENSE.md](LICENSE.md).

The Windows executable includes third-party components; their license texts are contained in [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).
