https://github.com/allejo/rrlog
A PHP command-line tool for translating BZFlag replays to JSON or other formats
https://github.com/allejo/rrlog
bzflag
Last synced: 10 months ago
JSON representation
A PHP command-line tool for translating BZFlag replays to JSON or other formats
- Host: GitHub
- URL: https://github.com/allejo/rrlog
- Owner: allejo
- License: mit
- Created: 2019-09-01T03:01:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-18T21:44:30.000Z (over 3 years ago)
- Last Synced: 2025-01-15T03:04:03.434Z (12 months ago)
- Topics: bzflag
- Language: PHP
- Size: 75.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# rrlog
[](https://github.com/allejo/rrlog/releases/latest)
[](LICENSE.md)
A PHP port of the [rrlog](https://github.com/BZFlag-Dev/bzflag/blob/2.4/misc/rrlog.cxx) project to allow server owners to convert replay files into flat JSON files. This tool is built around the [bzflag-networking.php](https://github.com/allejo/bzflag-networking.php) library that unpacks BZFlag packets into PHP objects.
## Usage
You need PHP 7.1+ and download the latest PHAR from our [GitHub releases](https://github.com/allejo/rrlog/releases/latest).
```bash
./rrlog.phar [command] [options]
```
### `export` Command
Use the `export` command to translate a replay file from raw packets into a JSON representation.
```bash
./rrlog.phar export
# Exclude chat messages
./rrlog.phar export --blacklist MsgMessage
# Include only chat messages
./rrlog.phar export --whitelist MsgMessage
```
#### Available Flags
- `--blacklist` - a comma separated list of packet types to exclude from the JSON file
- `--whitelist` - a comma separated list of the only packet types that will be written to the JSON file
- `--format` or `-f` - The format of the output file; only `json` is supported right now
- `--output` or `-o` - The location of where the output file will be written to. By default, the output file will be at the same location of the replay file with a `.json` extension added to the filename.
##### Notes
- For packet types, the official packet names used in the BZFS source code are used
- The `--blacklist` and `--whitelist` flags cannot be used together
## License
[MIT](./LICENSE.md)