mirror of
https://codeberg.org/demostf/edit.git
synced 2026-11-30 10:00:50 +01:00
also anonymize data in header
This commit is contained in:
parent
e13ea526e0
commit
74ed41a725
4 changed files with 42 additions and 10 deletions
|
|
@ -3,6 +3,7 @@ use std::collections::HashMap;
|
|||
use std::sync::atomic::AtomicUsize;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use crate::mutate::HeaderMutator;
|
||||
use crate::mutate::MessageMutator;
|
||||
use crate::mutate::MutatorList;
|
||||
use crate::mutate::PacketMutator;
|
||||
|
|
@ -139,7 +140,17 @@ impl MessageMutator for Anonymize {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct AnonymizeHeader;
|
||||
|
||||
impl HeaderMutator for AnonymizeHeader {
|
||||
fn mutate_header(&mut self, header: &mut tf_demo_parser::demo::header::Header) {
|
||||
header.server = String::from("Redacted");
|
||||
header.nick = String::from("Redacted");
|
||||
}
|
||||
}
|
||||
|
||||
pub fn anonymize(mutators: &mut MutatorList) {
|
||||
let mutator = Anonymize::default();
|
||||
mutators.push_packet_mutator(mutator);
|
||||
mutators.push_packet_mutator(Anonymize::default());
|
||||
mutators.push_header_mutator(AnonymizeHeader);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue