Compare commits
1 Commits
7b6041989e
...
6f5dc4bcff
Author | SHA1 | Date | |
---|---|---|---|
6f5dc4bcff |
37
.github/workflows/build.yaml
vendored
37
.github/workflows/build.yaml
vendored
@ -1,37 +0,0 @@
|
|||||||
name: Build
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- "**.rs"
|
|
||||||
- "Cargo.*"
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
errornowatcher:
|
|
||||||
name: errornowatcher
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install build dependencies
|
|
||||||
run: sudo apt install -y libluajit-5.1-dev mold
|
|
||||||
|
|
||||||
- name: Set up build cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: build-${{ runner.os }}-${{ hashFiles('Cargo.*') }}
|
|
||||||
|
|
||||||
- name: Switch to nightly toolchain
|
|
||||||
run: rustup default nightly
|
|
||||||
|
|
||||||
- name: Build in release mode
|
|
||||||
run: cargo build --release
|
|
68
.github/workflows/lint.yaml
vendored
68
.github/workflows/lint.yaml
vendored
@ -1,68 +0,0 @@
|
|||||||
name: Lint
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- "**.rs"
|
|
||||||
- "Cargo.*"
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
cargo-toml:
|
|
||||||
name: Cargo.toml
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install taplo
|
|
||||||
uses: uncenter/setup-taplo@v1
|
|
||||||
|
|
||||||
- name: Run taplo lint
|
|
||||||
run: taplo lint Cargo.toml
|
|
||||||
|
|
||||||
- name: Run taplo fmt
|
|
||||||
if: always()
|
|
||||||
run: taplo fmt --check Cargo.toml
|
|
||||||
|
|
||||||
rust:
|
|
||||||
name: Rust
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install build dependencies
|
|
||||||
run: sudo apt install -y libluajit-5.1-dev mold
|
|
||||||
|
|
||||||
- name: Set up build cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: build-${{ runner.os }}-${{ hashFiles('Cargo.*') }}
|
|
||||||
|
|
||||||
- name: Switch to nightly toolchain
|
|
||||||
run: rustup default nightly
|
|
||||||
|
|
||||||
- name: Install components
|
|
||||||
run: rustup component add clippy rustfmt
|
|
||||||
|
|
||||||
- name: cargo clippy
|
|
||||||
run: >-
|
|
||||||
cargo clippy -- -D clippy::pedantic
|
|
||||||
-A clippy::missing_errors_doc
|
|
||||||
-A clippy::missing_panics_doc
|
|
||||||
-A clippy::must_use_candidate
|
|
||||||
-A clippy::needless-pass-by-value
|
|
||||||
-A clippy::unnecessary-wraps
|
|
||||||
|
|
||||||
- name: cargo fmt
|
|
||||||
if: always()
|
|
||||||
run: cargo fmt --check
|
|
@ -30,33 +30,42 @@ impl Plugin for RecordPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn record_login_packets(mut recorder: ResMut<Recorder>, mut events: EventReader<LoginPacketEvent>) {
|
fn record_login_packets(
|
||||||
for event in events.read() {
|
recorder: Option<ResMut<Recorder>>,
|
||||||
if recorder.should_ignore_compression
|
mut events: EventReader<LoginPacketEvent>,
|
||||||
&& let ClientboundLoginPacket::LoginCompression(_) = *event.packet
|
) {
|
||||||
{
|
if let Some(mut recorder) = recorder {
|
||||||
continue;
|
for event in events.read() {
|
||||||
}
|
if recorder.should_ignore_compression
|
||||||
|
&& let ClientboundLoginPacket::LoginCompression(_) = *event.packet
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(error) = recorder.save_packet(event.packet.as_ref()) {
|
if let Err(error) = recorder.save_packet(event.packet.as_ref()) {
|
||||||
error!("failed to record login packet: {error:?}");
|
error!("failed to record login packet: {error:?}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn record_configuration_packets(
|
fn record_configuration_packets(
|
||||||
mut recorder: ResMut<Recorder>,
|
recorder: Option<ResMut<Recorder>>,
|
||||||
mut events: EventReader<ConfigurationEvent>,
|
mut events: EventReader<ConfigurationEvent>,
|
||||||
) {
|
) {
|
||||||
for event in events.read() {
|
if let Some(mut recorder) = recorder {
|
||||||
if let Err(error) = recorder.save_packet(&event.packet) {
|
for event in events.read() {
|
||||||
error!("failed to record configuration packet: {error:?}");
|
if let Err(error) = recorder.save_packet(&event.packet) {
|
||||||
|
error!("failed to record configuration packet: {error:?}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn record_game_packets(mut recorder: ResMut<Recorder>, query: Query<&RawConnection>) {
|
fn record_game_packets(recorder: Option<ResMut<Recorder>>, query: Query<&RawConnection>) {
|
||||||
for raw_conn in query.iter() {
|
if let Some(mut recorder) = recorder
|
||||||
|
&& let Ok(raw_conn) = query.get_single()
|
||||||
|
{
|
||||||
let queue = raw_conn.incoming_packet_queue();
|
let queue = raw_conn.incoming_packet_queue();
|
||||||
for raw_packet in queue.lock().iter() {
|
for raw_packet in queue.lock().iter() {
|
||||||
if let Err(error) = recorder.save_raw_packet(raw_packet) {
|
if let Err(error) = recorder.save_raw_packet(raw_packet) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user