more kill info

This commit is contained in:
Robin Appelman 2026-11-12 19:38:41 +01:00
commit 5d1729110b
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE
7 changed files with 196 additions and 99 deletions

View file

@ -4,17 +4,17 @@ use crate::raw_event::{subject_parser, RawSubject};
use crate::{Error, Event, Result};
use std::net::SocketAddr;
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct ShotFiredEvent<'a> {
pub weapon: Option<&'a str>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct ShotHitEvent<'a> {
pub weapon: Option<&'a str>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct DamageEvent<'a> {
#[event(name = "against")]
#[event(default)]
@ -25,18 +25,20 @@ pub struct DamageEvent<'a> {
pub weapon: Option<&'a str>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct KillEvent<'a> {
#[event(unnamed)]
#[event(subject)]
pub target: RawSubject<'a>,
#[event(name = "with")]
pub weapon: &'a str,
#[event(name = "customkill")]
pub custom_kill: Option<&'a str>,
pub attacker_position: Option<(i32, i32, i32)>,
pub victim_position: Option<(i32, i32, i32)>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct KillAssistEvent<'a> {
#[event(name = "against")]
pub target: RawSubject<'a>,
@ -44,75 +46,75 @@ pub struct KillAssistEvent<'a> {
pub victim_position: Option<(i32, i32, i32)>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct SpawnEvent {
#[event(name = "as")]
pub class: Option<Class>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct RoleChangeEvent {
#[event(name = "to")]
pub class: Option<Class>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct ConnectedEvent {
#[event(name = "address")]
pub address: SocketAddr,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct JoinedTeamEvent {
pub team: Team,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct CommittedSuicideEvent<'a> {
#[event(name = "with")]
pub weapon: &'a str,
pub attacker_position: Option<(i32, i32, i32)>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct PickedUpEvent<'a> {
pub item: &'a str,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct DominationEvent<'a> {
pub against: RawSubject<'a>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct RevengeEvent<'a> {
pub against: RawSubject<'a>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct DisconnectEvent<'a> {
pub reason: Option<&'a str>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct BuiltObjectEvent<'a> {
pub object: Option<&'a str>,
pub position: Option<(i32, i32, i32)>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct BuiltCarryEvent<'a> {
pub object: Option<&'a str>,
pub position: Option<(i32, i32, i32)>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct DropObjectEvent<'a> {
pub object: Option<&'a str>,
pub position: Option<(i32, i32, i32)>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct KilledObjectEvent<'a> {
pub object: Option<&'a str>,
pub weapon: Option<&'a str>,
@ -121,14 +123,14 @@ pub struct KilledObjectEvent<'a> {
pub attacker_position: Option<(i32, i32, i32)>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct ObjectDetonatedEvent<'a> {
pub object: Option<&'a str>,
#[event(name = "attacker_position")]
pub position: Option<(i32, i32, i32)>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct ExtinguishedEvent<'a> {
pub against: RawSubject<'a>,
pub with: &'a str,
@ -136,13 +138,13 @@ pub struct ExtinguishedEvent<'a> {
pub victim_position: Option<(i32, i32, i32)>,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct SayEvent<'a> {
#[event(unnamed)]
pub text: &'a str,
}
#[derive(Debug, Event)]
#[derive(Debug, Event, Clone)]
pub struct SayTeamEvent<'a> {
#[event(unnamed)]
pub text: &'a str,