mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 18:24:05 +02:00
cleanup
This commit is contained in:
parent
3783eb5d9e
commit
9f622385ca
20 changed files with 132 additions and 173 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
#[allow(unused_variables)]
|
|
||||||
use std::error::Error;
|
|
||||||
use std::fs;
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
use std::fs;
|
||||||
|
|
||||||
pub use tf_demo_parser::{Demo, DemoParser, Parse, ParseError, ParserState, Result, Stream};
|
pub use tf_demo_parser::{Demo, DemoParser, Parse, ParseError, ParserState, Result, Stream};
|
||||||
|
|
||||||
|
|
@ -14,8 +12,8 @@ fn main() -> std::result::Result<(), Box<ParseError>> {
|
||||||
let file = fs::read(path).expect("Unable to read file");
|
let file = fs::read(path).expect("Unable to read file");
|
||||||
let demo = Demo::new(file);
|
let demo = Demo::new(file);
|
||||||
let stream: Stream = demo.get_stream();
|
let stream: Stream = demo.get_stream();
|
||||||
let mut parser = DemoParser::new(stream);
|
let parser = DemoParser::new(stream);
|
||||||
let (header, state) = parser.parse_demo()?;
|
let (_, state) = parser.parse_demo()?;
|
||||||
let json = serde_json::to_string(&state).unwrap_or("err".to_string());
|
let json = serde_json::to_string(&state).unwrap_or("err".to_string());
|
||||||
println!("{}", json);
|
println!("{}", json);
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
use super::gamevent::{FromGameEventValue, FromRawGameEvent, GameEventValue, RawGameEvent};
|
use super::gamevent::{FromGameEventValue, FromRawGameEvent, GameEventValue, RawGameEvent};
|
||||||
use crate::{ParseError, Result};
|
use crate::{ParseError, Result};
|
||||||
use bitstream_reader::BitRead;
|
|
||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
// auto generated, nobody in their right mind would write this manually
|
// auto generated, nobody in their right mind would write this manually
|
||||||
|
|
||||||
|
|
@ -617,7 +615,7 @@ impl FromRawGameEvent for ClientFullConnectEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct HostQuitEvent {}
|
pub struct HostQuitEvent {}
|
||||||
impl FromRawGameEvent for HostQuitEvent {
|
impl FromRawGameEvent for HostQuitEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(HostQuitEvent {})
|
Ok(HostQuitEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1327,7 +1325,7 @@ impl FromRawGameEvent for BasePlayerTeleportedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct GameInitEvent {}
|
pub struct GameInitEvent {}
|
||||||
impl FromRawGameEvent for GameInitEvent {
|
impl FromRawGameEvent for GameInitEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(GameInitEvent {})
|
Ok(GameInitEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1741,7 +1739,7 @@ impl FromRawGameEvent for FlareIgniteNpcEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct HelicopterGrenadePuntMissEvent {}
|
pub struct HelicopterGrenadePuntMissEvent {}
|
||||||
impl FromRawGameEvent for HelicopterGrenadePuntMissEvent {
|
impl FromRawGameEvent for HelicopterGrenadePuntMissEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(HelicopterGrenadePuntMissEvent {})
|
Ok(HelicopterGrenadePuntMissEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1749,7 +1747,7 @@ impl FromRawGameEvent for HelicopterGrenadePuntMissEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct UserDataDownloadedEvent {}
|
pub struct UserDataDownloadedEvent {}
|
||||||
impl FromRawGameEvent for UserDataDownloadedEvent {
|
impl FromRawGameEvent for UserDataDownloadedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(UserDataDownloadedEvent {})
|
Ok(UserDataDownloadedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1841,7 +1839,7 @@ impl FromRawGameEvent for HLTVChangedTargetEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct VoteEndedEvent {}
|
pub struct VoteEndedEvent {}
|
||||||
impl FromRawGameEvent for VoteEndedEvent {
|
impl FromRawGameEvent for VoteEndedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(VoteEndedEvent {})
|
Ok(VoteEndedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2091,7 +2089,7 @@ impl FromRawGameEvent for VoteOptionsEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ReplaySavedEvent {}
|
pub struct ReplaySavedEvent {}
|
||||||
impl FromRawGameEvent for ReplaySavedEvent {
|
impl FromRawGameEvent for ReplaySavedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(ReplaySavedEvent {})
|
Ok(ReplaySavedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2099,7 +2097,7 @@ impl FromRawGameEvent for ReplaySavedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct EnteredPerformanceModeEvent {}
|
pub struct EnteredPerformanceModeEvent {}
|
||||||
impl FromRawGameEvent for EnteredPerformanceModeEvent {
|
impl FromRawGameEvent for EnteredPerformanceModeEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(EnteredPerformanceModeEvent {})
|
Ok(EnteredPerformanceModeEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2107,7 +2105,7 @@ impl FromRawGameEvent for EnteredPerformanceModeEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct BrowseReplaysEvent {}
|
pub struct BrowseReplaysEvent {}
|
||||||
impl FromRawGameEvent for BrowseReplaysEvent {
|
impl FromRawGameEvent for BrowseReplaysEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(BrowseReplaysEvent {})
|
Ok(BrowseReplaysEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2149,7 +2147,7 @@ impl FromRawGameEvent for ReplayYoutubeStatsEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct InventoryUpdatedEvent {}
|
pub struct InventoryUpdatedEvent {}
|
||||||
impl FromRawGameEvent for InventoryUpdatedEvent {
|
impl FromRawGameEvent for InventoryUpdatedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(InventoryUpdatedEvent {})
|
Ok(InventoryUpdatedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2157,7 +2155,7 @@ impl FromRawGameEvent for InventoryUpdatedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct CartUpdatedEvent {}
|
pub struct CartUpdatedEvent {}
|
||||||
impl FromRawGameEvent for CartUpdatedEvent {
|
impl FromRawGameEvent for CartUpdatedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(CartUpdatedEvent {})
|
Ok(CartUpdatedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2165,7 +2163,7 @@ impl FromRawGameEvent for CartUpdatedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct StorePriceSheetUpdatedEvent {}
|
pub struct StorePriceSheetUpdatedEvent {}
|
||||||
impl FromRawGameEvent for StorePriceSheetUpdatedEvent {
|
impl FromRawGameEvent for StorePriceSheetUpdatedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(StorePriceSheetUpdatedEvent {})
|
Ok(StorePriceSheetUpdatedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2173,7 +2171,7 @@ impl FromRawGameEvent for StorePriceSheetUpdatedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct GcConnectedEvent {}
|
pub struct GcConnectedEvent {}
|
||||||
impl FromRawGameEvent for GcConnectedEvent {
|
impl FromRawGameEvent for GcConnectedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(GcConnectedEvent {})
|
Ok(GcConnectedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2181,7 +2179,7 @@ impl FromRawGameEvent for GcConnectedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ItemSchemaInitializedEvent {}
|
pub struct ItemSchemaInitializedEvent {}
|
||||||
impl FromRawGameEvent for ItemSchemaInitializedEvent {
|
impl FromRawGameEvent for ItemSchemaInitializedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(ItemSchemaInitializedEvent {})
|
Ok(ItemSchemaInitializedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2375,7 +2373,7 @@ impl FromRawGameEvent for CtfFlagCapturedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ControlPointInitializedEvent {}
|
pub struct ControlPointInitializedEvent {}
|
||||||
impl FromRawGameEvent for ControlPointInitializedEvent {
|
impl FromRawGameEvent for ControlPointInitializedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(ControlPointInitializedEvent {})
|
Ok(ControlPointInitializedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2587,7 +2585,7 @@ impl FromRawGameEvent for TeamPlayRoundStartEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlayRoundActiveEvent {}
|
pub struct TeamPlayRoundActiveEvent {}
|
||||||
impl FromRawGameEvent for TeamPlayRoundActiveEvent {
|
impl FromRawGameEvent for TeamPlayRoundActiveEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlayRoundActiveEvent {})
|
Ok(TeamPlayRoundActiveEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2595,7 +2593,7 @@ impl FromRawGameEvent for TeamPlayRoundActiveEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlayWaitingBeginsEvent {}
|
pub struct TeamPlayWaitingBeginsEvent {}
|
||||||
impl FromRawGameEvent for TeamPlayWaitingBeginsEvent {
|
impl FromRawGameEvent for TeamPlayWaitingBeginsEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlayWaitingBeginsEvent {})
|
Ok(TeamPlayWaitingBeginsEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2603,7 +2601,7 @@ impl FromRawGameEvent for TeamPlayWaitingBeginsEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlayWaitingEndsEvent {}
|
pub struct TeamPlayWaitingEndsEvent {}
|
||||||
impl FromRawGameEvent for TeamPlayWaitingEndsEvent {
|
impl FromRawGameEvent for TeamPlayWaitingEndsEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlayWaitingEndsEvent {})
|
Ok(TeamPlayWaitingEndsEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2611,7 +2609,7 @@ impl FromRawGameEvent for TeamPlayWaitingEndsEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlayWaitingAboutToEndEvent {}
|
pub struct TeamPlayWaitingAboutToEndEvent {}
|
||||||
impl FromRawGameEvent for TeamPlayWaitingAboutToEndEvent {
|
impl FromRawGameEvent for TeamPlayWaitingAboutToEndEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlayWaitingAboutToEndEvent {})
|
Ok(TeamPlayWaitingAboutToEndEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2619,7 +2617,7 @@ impl FromRawGameEvent for TeamPlayWaitingAboutToEndEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlayRestartRoundEvent {}
|
pub struct TeamPlayRestartRoundEvent {}
|
||||||
impl FromRawGameEvent for TeamPlayRestartRoundEvent {
|
impl FromRawGameEvent for TeamPlayRestartRoundEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlayRestartRoundEvent {})
|
Ok(TeamPlayRestartRoundEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2627,7 +2625,7 @@ impl FromRawGameEvent for TeamPlayRestartRoundEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlayReadyRestartEvent {}
|
pub struct TeamPlayReadyRestartEvent {}
|
||||||
impl FromRawGameEvent for TeamPlayReadyRestartEvent {
|
impl FromRawGameEvent for TeamPlayReadyRestartEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlayReadyRestartEvent {})
|
Ok(TeamPlayReadyRestartEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2733,7 +2731,7 @@ impl FromRawGameEvent for TeamPlayRoundWinEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlayUpdateTimerEvent {}
|
pub struct TeamPlayUpdateTimerEvent {}
|
||||||
impl FromRawGameEvent for TeamPlayUpdateTimerEvent {
|
impl FromRawGameEvent for TeamPlayUpdateTimerEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlayUpdateTimerEvent {})
|
Ok(TeamPlayUpdateTimerEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2757,7 +2755,7 @@ impl FromRawGameEvent for TeamPlayRoundStalemateEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlayOvertimeBeginEvent {}
|
pub struct TeamPlayOvertimeBeginEvent {}
|
||||||
impl FromRawGameEvent for TeamPlayOvertimeBeginEvent {
|
impl FromRawGameEvent for TeamPlayOvertimeBeginEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlayOvertimeBeginEvent {})
|
Ok(TeamPlayOvertimeBeginEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2765,7 +2763,7 @@ impl FromRawGameEvent for TeamPlayOvertimeBeginEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlayOvertimeEndEvent {}
|
pub struct TeamPlayOvertimeEndEvent {}
|
||||||
impl FromRawGameEvent for TeamPlayOvertimeEndEvent {
|
impl FromRawGameEvent for TeamPlayOvertimeEndEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlayOvertimeEndEvent {})
|
Ok(TeamPlayOvertimeEndEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2773,7 +2771,7 @@ impl FromRawGameEvent for TeamPlayOvertimeEndEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlaySuddenDeathBeginEvent {}
|
pub struct TeamPlaySuddenDeathBeginEvent {}
|
||||||
impl FromRawGameEvent for TeamPlaySuddenDeathBeginEvent {
|
impl FromRawGameEvent for TeamPlaySuddenDeathBeginEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlaySuddenDeathBeginEvent {})
|
Ok(TeamPlaySuddenDeathBeginEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2781,7 +2779,7 @@ impl FromRawGameEvent for TeamPlaySuddenDeathBeginEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlaySuddenDeathEndEvent {}
|
pub struct TeamPlaySuddenDeathEndEvent {}
|
||||||
impl FromRawGameEvent for TeamPlaySuddenDeathEndEvent {
|
impl FromRawGameEvent for TeamPlaySuddenDeathEndEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlaySuddenDeathEndEvent {})
|
Ok(TeamPlaySuddenDeathEndEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3326,7 +3324,7 @@ impl FromRawGameEvent for TeamPlayTeamBalancedPlayerEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamPlaySetupFinishedEvent {}
|
pub struct TeamPlaySetupFinishedEvent {}
|
||||||
impl FromRawGameEvent for TeamPlaySetupFinishedEvent {
|
impl FromRawGameEvent for TeamPlaySetupFinishedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamPlaySetupFinishedEvent {})
|
Ok(TeamPlaySetupFinishedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3400,7 +3398,7 @@ impl FromRawGameEvent for ShowFreezePanelEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct HideFreezePanelEvent {}
|
pub struct HideFreezePanelEvent {}
|
||||||
impl FromRawGameEvent for HideFreezePanelEvent {
|
impl FromRawGameEvent for HideFreezePanelEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(HideFreezePanelEvent {})
|
Ok(HideFreezePanelEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3408,7 +3406,7 @@ impl FromRawGameEvent for HideFreezePanelEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct FreezeCamStartedEvent {}
|
pub struct FreezeCamStartedEvent {}
|
||||||
impl FromRawGameEvent for FreezeCamStartedEvent {
|
impl FromRawGameEvent for FreezeCamStartedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(FreezeCamStartedEvent {})
|
Ok(FreezeCamStartedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3416,7 +3414,7 @@ impl FromRawGameEvent for FreezeCamStartedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct LocalPlayerChangeTeamEvent {}
|
pub struct LocalPlayerChangeTeamEvent {}
|
||||||
impl FromRawGameEvent for LocalPlayerChangeTeamEvent {
|
impl FromRawGameEvent for LocalPlayerChangeTeamEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(LocalPlayerChangeTeamEvent {})
|
Ok(LocalPlayerChangeTeamEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3440,7 +3438,7 @@ impl FromRawGameEvent for LocalPlayerScoreChangedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct LocalPlayerChangeClassEvent {}
|
pub struct LocalPlayerChangeClassEvent {}
|
||||||
impl FromRawGameEvent for LocalPlayerChangeClassEvent {
|
impl FromRawGameEvent for LocalPlayerChangeClassEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(LocalPlayerChangeClassEvent {})
|
Ok(LocalPlayerChangeClassEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3448,7 +3446,7 @@ impl FromRawGameEvent for LocalPlayerChangeClassEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct LocalPlayerRespawnEvent {}
|
pub struct LocalPlayerRespawnEvent {}
|
||||||
impl FromRawGameEvent for LocalPlayerRespawnEvent {
|
impl FromRawGameEvent for LocalPlayerRespawnEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(LocalPlayerRespawnEvent {})
|
Ok(LocalPlayerRespawnEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3532,7 +3530,7 @@ impl FromRawGameEvent for PlayerAccountChangedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct SpyPdaResetEvent {}
|
pub struct SpyPdaResetEvent {}
|
||||||
impl FromRawGameEvent for SpyPdaResetEvent {
|
impl FromRawGameEvent for SpyPdaResetEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(SpyPdaResetEvent {})
|
Ok(SpyPdaResetEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3579,7 +3577,7 @@ impl FromRawGameEvent for PlayerStatsUpdatedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct PlayingCommentaryEvent {}
|
pub struct PlayingCommentaryEvent {}
|
||||||
impl FromRawGameEvent for PlayingCommentaryEvent {
|
impl FromRawGameEvent for PlayingCommentaryEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(PlayingCommentaryEvent {})
|
Ok(PlayingCommentaryEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3922,7 +3920,7 @@ impl FromRawGameEvent for AchievementEarnedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct SpecTargetUpdatedEvent {}
|
pub struct SpecTargetUpdatedEvent {}
|
||||||
impl FromRawGameEvent for SpecTargetUpdatedEvent {
|
impl FromRawGameEvent for SpecTargetUpdatedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(SpecTargetUpdatedEvent {})
|
Ok(SpecTargetUpdatedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3972,7 +3970,7 @@ impl FromRawGameEvent for TournamentStateUpdateEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TournamentEnableCountdownEvent {}
|
pub struct TournamentEnableCountdownEvent {}
|
||||||
impl FromRawGameEvent for TournamentEnableCountdownEvent {
|
impl FromRawGameEvent for TournamentEnableCountdownEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TournamentEnableCountdownEvent {})
|
Ok(TournamentEnableCountdownEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3996,7 +3994,7 @@ impl FromRawGameEvent for PlayerCalledForMedicEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct LocalPlayerBecameObserverEvent {}
|
pub struct LocalPlayerBecameObserverEvent {}
|
||||||
impl FromRawGameEvent for LocalPlayerBecameObserverEvent {
|
impl FromRawGameEvent for LocalPlayerBecameObserverEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(LocalPlayerBecameObserverEvent {})
|
Ok(LocalPlayerBecameObserverEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4145,7 +4143,7 @@ impl FromRawGameEvent for PlayerHealedMedicCallEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct LocalPlayerChargeReadyEvent {}
|
pub struct LocalPlayerChargeReadyEvent {}
|
||||||
impl FromRawGameEvent for LocalPlayerChargeReadyEvent {
|
impl FromRawGameEvent for LocalPlayerChargeReadyEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(LocalPlayerChargeReadyEvent {})
|
Ok(LocalPlayerChargeReadyEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4153,7 +4151,7 @@ impl FromRawGameEvent for LocalPlayerChargeReadyEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct LocalPlayerWindDownEvent {}
|
pub struct LocalPlayerWindDownEvent {}
|
||||||
impl FromRawGameEvent for LocalPlayerWindDownEvent {
|
impl FromRawGameEvent for LocalPlayerWindDownEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(LocalPlayerWindDownEvent {})
|
Ok(LocalPlayerWindDownEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4278,7 +4276,7 @@ impl FromRawGameEvent for EscortRecedeEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct GameUIActivatedEvent {}
|
pub struct GameUIActivatedEvent {}
|
||||||
impl FromRawGameEvent for GameUIActivatedEvent {
|
impl FromRawGameEvent for GameUIActivatedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(GameUIActivatedEvent {})
|
Ok(GameUIActivatedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4286,7 +4284,7 @@ impl FromRawGameEvent for GameUIActivatedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct GameUIHiddenEvent {}
|
pub struct GameUIHiddenEvent {}
|
||||||
impl FromRawGameEvent for GameUIHiddenEvent {
|
impl FromRawGameEvent for GameUIHiddenEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(GameUIHiddenEvent {})
|
Ok(GameUIHiddenEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4464,7 +4462,7 @@ impl FromRawGameEvent for ArenaMatchMaxStreakEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ArenaRoundStartEvent {}
|
pub struct ArenaRoundStartEvent {}
|
||||||
impl FromRawGameEvent for ArenaRoundStartEvent {
|
impl FromRawGameEvent for ArenaRoundStartEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(ArenaRoundStartEvent {})
|
Ok(ArenaRoundStartEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5565,7 +5563,7 @@ impl FromRawGameEvent for MedicDeathEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct OvertimeNagEvent {}
|
pub struct OvertimeNagEvent {}
|
||||||
impl FromRawGameEvent for OvertimeNagEvent {
|
impl FromRawGameEvent for OvertimeNagEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(OvertimeNagEvent {})
|
Ok(OvertimeNagEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5573,7 +5571,7 @@ impl FromRawGameEvent for OvertimeNagEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TeamsChangedEvent {}
|
pub struct TeamsChangedEvent {}
|
||||||
impl FromRawGameEvent for TeamsChangedEvent {
|
impl FromRawGameEvent for TeamsChangedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(TeamsChangedEvent {})
|
Ok(TeamsChangedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5794,7 +5792,7 @@ impl FromRawGameEvent for PlayerMvpEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RaidSpawnMobEvent {}
|
pub struct RaidSpawnMobEvent {}
|
||||||
impl FromRawGameEvent for RaidSpawnMobEvent {
|
impl FromRawGameEvent for RaidSpawnMobEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(RaidSpawnMobEvent {})
|
Ok(RaidSpawnMobEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5802,7 +5800,7 @@ impl FromRawGameEvent for RaidSpawnMobEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RaidSpawnSquadEvent {}
|
pub struct RaidSpawnSquadEvent {}
|
||||||
impl FromRawGameEvent for RaidSpawnSquadEvent {
|
impl FromRawGameEvent for RaidSpawnSquadEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(RaidSpawnSquadEvent {})
|
Ok(RaidSpawnSquadEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5872,7 +5870,7 @@ impl FromRawGameEvent for NumCappersChangedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct PlayerRegenerateEvent {}
|
pub struct PlayerRegenerateEvent {}
|
||||||
impl FromRawGameEvent for PlayerRegenerateEvent {
|
impl FromRawGameEvent for PlayerRegenerateEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(PlayerRegenerateEvent {})
|
Ok(PlayerRegenerateEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5903,7 +5901,7 @@ impl FromRawGameEvent for UpdateStatusItemEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct StatsResetRoundEvent {}
|
pub struct StatsResetRoundEvent {}
|
||||||
impl FromRawGameEvent for StatsResetRoundEvent {
|
impl FromRawGameEvent for StatsResetRoundEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(StatsResetRoundEvent {})
|
Ok(StatsResetRoundEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5911,7 +5909,7 @@ impl FromRawGameEvent for StatsResetRoundEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ScoreStatsAccumulatedUpdateEvent {}
|
pub struct ScoreStatsAccumulatedUpdateEvent {}
|
||||||
impl FromRawGameEvent for ScoreStatsAccumulatedUpdateEvent {
|
impl FromRawGameEvent for ScoreStatsAccumulatedUpdateEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(ScoreStatsAccumulatedUpdateEvent {})
|
Ok(ScoreStatsAccumulatedUpdateEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5919,7 +5917,7 @@ impl FromRawGameEvent for ScoreStatsAccumulatedUpdateEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ScoreStatsAccumulatedResetEvent {}
|
pub struct ScoreStatsAccumulatedResetEvent {}
|
||||||
impl FromRawGameEvent for ScoreStatsAccumulatedResetEvent {
|
impl FromRawGameEvent for ScoreStatsAccumulatedResetEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(ScoreStatsAccumulatedResetEvent {})
|
Ok(ScoreStatsAccumulatedResetEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6466,7 +6464,7 @@ impl FromRawGameEvent for ThrowableHitEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct PumpkinLordSummonedEvent {}
|
pub struct PumpkinLordSummonedEvent {}
|
||||||
impl FromRawGameEvent for PumpkinLordSummonedEvent {
|
impl FromRawGameEvent for PumpkinLordSummonedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(PumpkinLordSummonedEvent {})
|
Ok(PumpkinLordSummonedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6474,7 +6472,7 @@ impl FromRawGameEvent for PumpkinLordSummonedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct PumpkinLordKilledEvent {}
|
pub struct PumpkinLordKilledEvent {}
|
||||||
impl FromRawGameEvent for PumpkinLordKilledEvent {
|
impl FromRawGameEvent for PumpkinLordKilledEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(PumpkinLordKilledEvent {})
|
Ok(PumpkinLordKilledEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6855,7 +6853,7 @@ impl FromRawGameEvent for PlayerBonusPointsEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct PlayerUpgradedEvent {}
|
pub struct PlayerUpgradedEvent {}
|
||||||
impl FromRawGameEvent for PlayerUpgradedEvent {
|
impl FromRawGameEvent for PlayerUpgradedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(PlayerUpgradedEvent {})
|
Ok(PlayerUpgradedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6966,7 +6964,7 @@ impl FromRawGameEvent for PlayerKilledAchievementZoneEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct PartyUpdatedEvent {}
|
pub struct PartyUpdatedEvent {}
|
||||||
impl FromRawGameEvent for PartyUpdatedEvent {
|
impl FromRawGameEvent for PartyUpdatedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(PartyUpdatedEvent {})
|
Ok(PartyUpdatedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6974,7 +6972,7 @@ impl FromRawGameEvent for PartyUpdatedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct LobbyUpdatedEvent {}
|
pub struct LobbyUpdatedEvent {}
|
||||||
impl FromRawGameEvent for LobbyUpdatedEvent {
|
impl FromRawGameEvent for LobbyUpdatedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(LobbyUpdatedEvent {})
|
Ok(LobbyUpdatedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7005,7 +7003,7 @@ impl FromRawGameEvent for MvmMissionUpdateEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RecalculateHolidaysEvent {}
|
pub struct RecalculateHolidaysEvent {}
|
||||||
impl FromRawGameEvent for RecalculateHolidaysEvent {
|
impl FromRawGameEvent for RecalculateHolidaysEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(RecalculateHolidaysEvent {})
|
Ok(RecalculateHolidaysEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7061,7 +7059,7 @@ impl FromRawGameEvent for RemoveNemesisRelationshipsEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MvmCreditBonusWaveEvent {}
|
pub struct MvmCreditBonusWaveEvent {}
|
||||||
impl FromRawGameEvent for MvmCreditBonusWaveEvent {
|
impl FromRawGameEvent for MvmCreditBonusWaveEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(MvmCreditBonusWaveEvent {})
|
Ok(MvmCreditBonusWaveEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7069,7 +7067,7 @@ impl FromRawGameEvent for MvmCreditBonusWaveEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MvmCreditBonusAllEvent {}
|
pub struct MvmCreditBonusAllEvent {}
|
||||||
impl FromRawGameEvent for MvmCreditBonusAllEvent {
|
impl FromRawGameEvent for MvmCreditBonusAllEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(MvmCreditBonusAllEvent {})
|
Ok(MvmCreditBonusAllEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7077,7 +7075,7 @@ impl FromRawGameEvent for MvmCreditBonusAllEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MvmCreditBonusAllAdvancedEvent {}
|
pub struct MvmCreditBonusAllAdvancedEvent {}
|
||||||
impl FromRawGameEvent for MvmCreditBonusAllAdvancedEvent {
|
impl FromRawGameEvent for MvmCreditBonusAllAdvancedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(MvmCreditBonusAllAdvancedEvent {})
|
Ok(MvmCreditBonusAllAdvancedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7101,7 +7099,7 @@ impl FromRawGameEvent for MvmQuickSentryUpgradeEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MvmTankDestroyedByPlayersEvent {}
|
pub struct MvmTankDestroyedByPlayersEvent {}
|
||||||
impl FromRawGameEvent for MvmTankDestroyedByPlayersEvent {
|
impl FromRawGameEvent for MvmTankDestroyedByPlayersEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(MvmTankDestroyedByPlayersEvent {})
|
Ok(MvmTankDestroyedByPlayersEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7320,7 +7318,7 @@ impl FromRawGameEvent for MvmBombResetByPlayerEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MvmBombAlarmTriggeredEvent {}
|
pub struct MvmBombAlarmTriggeredEvent {}
|
||||||
impl FromRawGameEvent for MvmBombAlarmTriggeredEvent {
|
impl FromRawGameEvent for MvmBombAlarmTriggeredEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(MvmBombAlarmTriggeredEvent {})
|
Ok(MvmBombAlarmTriggeredEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7344,7 +7342,7 @@ impl FromRawGameEvent for MvmBombDeployResetByPlayerEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MvmWaveFailedEvent {}
|
pub struct MvmWaveFailedEvent {}
|
||||||
impl FromRawGameEvent for MvmWaveFailedEvent {
|
impl FromRawGameEvent for MvmWaveFailedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(MvmWaveFailedEvent {})
|
Ok(MvmWaveFailedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7352,7 +7350,7 @@ impl FromRawGameEvent for MvmWaveFailedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MvmResetStatsEvent {}
|
pub struct MvmResetStatsEvent {}
|
||||||
impl FromRawGameEvent for MvmResetStatsEvent {
|
impl FromRawGameEvent for MvmResetStatsEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(MvmResetStatsEvent {})
|
Ok(MvmResetStatsEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7512,7 +7510,7 @@ impl FromRawGameEvent for MvmSniperHeadshotCurrencyEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MvmMannhattanPitEvent {}
|
pub struct MvmMannhattanPitEvent {}
|
||||||
impl FromRawGameEvent for MvmMannhattanPitEvent {
|
impl FromRawGameEvent for MvmMannhattanPitEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(MvmMannhattanPitEvent {})
|
Ok(MvmMannhattanPitEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7520,7 +7518,7 @@ impl FromRawGameEvent for MvmMannhattanPitEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct FlagCarriedInDetectionZoneEvent {}
|
pub struct FlagCarriedInDetectionZoneEvent {}
|
||||||
impl FromRawGameEvent for FlagCarriedInDetectionZoneEvent {
|
impl FromRawGameEvent for FlagCarriedInDetectionZoneEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(FlagCarriedInDetectionZoneEvent {})
|
Ok(FlagCarriedInDetectionZoneEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7528,7 +7526,7 @@ impl FromRawGameEvent for FlagCarriedInDetectionZoneEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MvmAdvWaveKilledStunRadioEvent {}
|
pub struct MvmAdvWaveKilledStunRadioEvent {}
|
||||||
impl FromRawGameEvent for MvmAdvWaveKilledStunRadioEvent {
|
impl FromRawGameEvent for MvmAdvWaveKilledStunRadioEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(MvmAdvWaveKilledStunRadioEvent {})
|
Ok(MvmAdvWaveKilledStunRadioEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7625,7 +7623,7 @@ impl FromRawGameEvent for RdTeamPointsChangedEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RdRulesStateChangedEvent {}
|
pub struct RdRulesStateChangedEvent {}
|
||||||
impl FromRawGameEvent for RdRulesStateChangedEvent {
|
impl FromRawGameEvent for RdRulesStateChangedEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(RdRulesStateChangedEvent {})
|
Ok(RdRulesStateChangedEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7895,7 +7893,7 @@ impl FromRawGameEvent for PlayerInitialSpawnEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct CompetitiveVictoryEvent {}
|
pub struct CompetitiveVictoryEvent {}
|
||||||
impl FromRawGameEvent for CompetitiveVictoryEvent {
|
impl FromRawGameEvent for CompetitiveVictoryEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(CompetitiveVictoryEvent {})
|
Ok(CompetitiveVictoryEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8306,7 +8304,7 @@ impl FromRawGameEvent for HLTVChatEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ReplayStartRecordEvent {}
|
pub struct ReplayStartRecordEvent {}
|
||||||
impl FromRawGameEvent for ReplayStartRecordEvent {
|
impl FromRawGameEvent for ReplayStartRecordEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(ReplayStartRecordEvent {})
|
Ok(ReplayStartRecordEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8351,7 +8349,7 @@ impl FromRawGameEvent for ReplaySessionInfoEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ReplayEndRecordEvent {}
|
pub struct ReplayEndRecordEvent {}
|
||||||
impl FromRawGameEvent for ReplayEndRecordEvent {
|
impl FromRawGameEvent for ReplayEndRecordEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(ReplayEndRecordEvent {})
|
Ok(ReplayEndRecordEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8359,7 +8357,7 @@ impl FromRawGameEvent for ReplayEndRecordEvent {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ReplayReplaysAvailableEvent {}
|
pub struct ReplayReplaysAvailableEvent {}
|
||||||
impl FromRawGameEvent for ReplayReplaysAvailableEvent {
|
impl FromRawGameEvent for ReplayReplaysAvailableEvent {
|
||||||
fn from_raw_event(values: Vec<GameEventValue>) -> Result<Self> {
|
fn from_raw_event(_values: Vec<GameEventValue>) -> Result<Self> {
|
||||||
Ok(ReplayReplaysAvailableEvent {})
|
Ok(ReplayReplaysAvailableEvent {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
use bitstream_reader::BitRead;
|
use bitstream_reader::BitRead;
|
||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
use crate::{ParseError, Result};
|
use crate::{ParseError, Result};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use bitstream_reader::{BitRead, BitReadSized, LittleEndian};
|
use bitstream_reader::{BitRead, LittleEndian};
|
||||||
|
|
||||||
use crate::demo::sendprop::read_bit_coord;
|
use crate::demo::sendprop::read_bit_coord;
|
||||||
use crate::demo::vector::Vector;
|
use crate::demo::vector::Vector;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::iter::FromIterator;
|
use std::iter::FromIterator;
|
||||||
|
|
||||||
use bitstream_reader::{BitRead, BitReadSized, LittleEndian};
|
use bitstream_reader::{BitRead, LittleEndian};
|
||||||
|
|
||||||
use crate::demo::gameevent_gen::GameEventType;
|
use crate::demo::gameevent_gen::GameEventType;
|
||||||
use crate::demo::gamevent::{
|
use crate::demo::gamevent::{
|
||||||
GameEvent, GameEventDefinition, GameEventEntry, GameEventValue, GameEventValueType,
|
GameEvent, GameEventDefinition, GameEventEntry, GameEventValue, GameEventValueType,
|
||||||
RawGameEvent,
|
RawGameEvent,
|
||||||
};
|
};
|
||||||
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
use crate::{Parse, ParserState, ReadResult, Result, Stream};
|
||||||
|
|
||||||
fn read_event_value(stream: &mut Stream, definition: &GameEventEntry) -> Result<GameEventValue> {
|
fn read_event_value(stream: &mut Stream, definition: &GameEventEntry) -> Result<GameEventValue> {
|
||||||
Ok(match definition.kind {
|
Ok(match definition.kind {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::Stream;
|
use crate::Stream;
|
||||||
/// Messages that consists only of primitives and string and can be derived
|
/// Messages that consists only of primitives and string and can be derived
|
||||||
use bitstream_reader::{BitRead, BitStream, LittleEndian};
|
use bitstream_reader::{BitRead, LittleEndian};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
#[derive(BitRead, Debug)]
|
#[derive(BitRead, Debug)]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
use std::mem::discriminant;
|
|
||||||
|
|
||||||
use bitstream_reader::{BitRead, LittleEndian};
|
|
||||||
use enum_primitive_derive::Primitive;
|
use enum_primitive_derive::Primitive;
|
||||||
use num_traits::FromPrimitive;
|
use num_traits::FromPrimitive;
|
||||||
|
|
||||||
|
|
@ -9,13 +6,12 @@ pub use generated::*;
|
||||||
use crate::demo::message::bspdecal::*;
|
use crate::demo::message::bspdecal::*;
|
||||||
use crate::demo::message::classinfo::*;
|
use crate::demo::message::classinfo::*;
|
||||||
use crate::demo::message::gameevent::*;
|
use crate::demo::message::gameevent::*;
|
||||||
use crate::demo::message::generated::*;
|
|
||||||
use crate::demo::message::packetentities::*;
|
use crate::demo::message::packetentities::*;
|
||||||
use crate::demo::message::stringtable::*;
|
use crate::demo::message::stringtable::*;
|
||||||
use crate::demo::message::tempentities::*;
|
use crate::demo::message::tempentities::*;
|
||||||
use crate::demo::message::usermessage::*;
|
use crate::demo::message::usermessage::*;
|
||||||
use crate::demo::message::voice::*;
|
use crate::demo::message::voice::*;
|
||||||
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
use crate::{Parse, ParseError, ParserState, Result, Stream};
|
||||||
|
|
||||||
pub mod bspdecal;
|
pub mod bspdecal;
|
||||||
pub mod classinfo;
|
pub mod classinfo;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
use bitstream_reader::{BitRead, BitReadSized, LittleEndian};
|
use bitstream_reader::BitRead;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use crate::demo::packet::datatable::ServerClass;
|
use crate::demo::packet::datatable::ServerClass;
|
||||||
use crate::demo::sendprop::SendProp;
|
use crate::demo::sendprop::SendProp;
|
||||||
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
use crate::{Parse, ParserState, Result, Stream};
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize)]
|
||||||
pub struct EntityId(u32);
|
pub struct EntityId(u32);
|
||||||
|
|
@ -45,14 +45,14 @@ pub struct PacketEntitiesMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parse for PacketEntitiesMessage {
|
impl Parse for PacketEntitiesMessage {
|
||||||
fn parse(stream: &mut Stream, state: &ParserState) -> Result<Self> {
|
fn parse(stream: &mut Stream, _state: &ParserState) -> Result<Self> {
|
||||||
let max_entries = stream.read_sized(11)?;
|
let max_entries = stream.read_sized(11)?;
|
||||||
let delta = stream.read()?;
|
let delta = stream.read()?;
|
||||||
let base_line = stream.read_sized(1)?;
|
let base_line = stream.read_sized(1)?;
|
||||||
let updated_entries: u16 = stream.read_sized(11)?;
|
let _updated_entries: u16 = stream.read_sized(11)?;
|
||||||
let length: u32 = stream.read_sized(20)?;
|
let length: u32 = stream.read_sized(20)?;
|
||||||
let updated_base_line = stream.read()?;
|
let updated_base_line = stream.read()?;
|
||||||
let data = stream.read_bits(length as usize)?;
|
let _data = stream.read_bits(length as usize)?;
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
use std::collections::HashMap;
|
use bitstream_reader::{BitBuffer, BitStream, LittleEndian};
|
||||||
|
|
||||||
use bitstream_reader::{BitBuffer, BitRead, BitReadSized, BitStream, LittleEndian};
|
|
||||||
use num_traits::{PrimInt, Unsigned};
|
use num_traits::{PrimInt, Unsigned};
|
||||||
use snap::Decoder;
|
use snap::Decoder;
|
||||||
|
|
||||||
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
|
||||||
use crate::demo::packet::stringtable::{
|
use crate::demo::packet::stringtable::{
|
||||||
ExtraData, FixedUserdataSize, StringTable, StringTableEntry,
|
ExtraData, FixedUserdataSize, StringTable, StringTableEntry,
|
||||||
};
|
};
|
||||||
|
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct CreateStringTableMessage {
|
pub struct CreateStringTableMessage {
|
||||||
|
|
@ -30,7 +28,7 @@ impl From<&StringTable> for StringTableMeta {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parse for CreateStringTableMessage {
|
impl Parse for CreateStringTableMessage {
|
||||||
fn parse(stream: &mut Stream, state: &ParserState) -> Result<Self> {
|
fn parse(stream: &mut Stream, _state: &ParserState) -> Result<Self> {
|
||||||
let name = stream.read()?;
|
let name = stream.read()?;
|
||||||
let max_entries: u16 = stream.read()?;
|
let max_entries: u16 = stream.read()?;
|
||||||
let encode_bits = log_base2(max_entries);
|
let encode_bits = log_base2(max_entries);
|
||||||
|
|
@ -106,11 +104,7 @@ impl Parse for UpdateStringTableMessage {
|
||||||
let mut data = stream.read_bits(len)?;
|
let mut data = stream.read_bits(len)?;
|
||||||
|
|
||||||
let entries = match state.string_tables.get(table_id as usize) {
|
let entries = match state.string_tables.get(table_id as usize) {
|
||||||
Some(table) => parse_string_table_update(
|
Some(table) => parse_string_table_update(&mut data, table, changed),
|
||||||
&mut data,
|
|
||||||
table,
|
|
||||||
changed,
|
|
||||||
),
|
|
||||||
None => return Err(ParseError::StringTableNotFound(table_id)),
|
None => return Err(ParseError::StringTableNotFound(table_id)),
|
||||||
}?;
|
}?;
|
||||||
|
|
||||||
|
|
@ -129,7 +123,7 @@ fn parse_string_table_update(
|
||||||
let mut last_entry: i16 = -1;
|
let mut last_entry: i16 = -1;
|
||||||
let mut history: Vec<Option<String>> = Vec::new();
|
let mut history: Vec<Option<String>> = Vec::new();
|
||||||
|
|
||||||
for i in 0..entry_count {
|
for _ in 0..entry_count {
|
||||||
let index = if stream.read()? {
|
let index = if stream.read()? {
|
||||||
(last_entry + 1) as u16
|
(last_entry + 1) as u16
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -138,11 +132,7 @@ fn parse_string_table_update(
|
||||||
|
|
||||||
last_entry = index as i16;
|
last_entry = index as i16;
|
||||||
|
|
||||||
let entry = read_table_entry(
|
let entry = read_table_entry(stream, table_meta, &history)?;
|
||||||
stream,
|
|
||||||
table_meta,
|
|
||||||
&history
|
|
||||||
)?;
|
|
||||||
// optimize: any way to get rid of the clone here?
|
// optimize: any way to get rid of the clone here?
|
||||||
// `entries` always outlives `history` without reallocation
|
// `entries` always outlives `history` without reallocation
|
||||||
let text = entry.text.clone();
|
let text = entry.text.clone();
|
||||||
|
|
@ -163,12 +153,11 @@ fn parse_string_table_list(
|
||||||
table_meta: &StringTableMeta,
|
table_meta: &StringTableMeta,
|
||||||
entry_count: u16,
|
entry_count: u16,
|
||||||
) -> ReadResult<Vec<StringTableEntry>> {
|
) -> ReadResult<Vec<StringTableEntry>> {
|
||||||
let entry_bits = log_base2(table_meta.max_entries);
|
|
||||||
let mut entries = Vec::with_capacity(entry_count as usize);
|
let mut entries = Vec::with_capacity(entry_count as usize);
|
||||||
|
|
||||||
let mut history: Vec<Option<String>> = Vec::new();
|
let mut history: Vec<Option<String>> = Vec::new();
|
||||||
|
|
||||||
for i in 0..entry_count {
|
for _ in 0..entry_count {
|
||||||
if !stream.read::<bool>()? {
|
if !stream.read::<bool>()? {
|
||||||
panic!("there should be no holes when reading CreateStringTable message");
|
panic!("there should be no holes when reading CreateStringTable message");
|
||||||
};
|
};
|
||||||
|
|
@ -231,10 +220,7 @@ fn read_table_entry(
|
||||||
}
|
}
|
||||||
.map(ExtraData::new);
|
.map(ExtraData::new);
|
||||||
|
|
||||||
Ok(StringTableEntry {
|
Ok(StringTableEntry { text, extra_data })
|
||||||
text,
|
|
||||||
extra_data,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn read_var_int(stream: &mut Stream) -> ReadResult<u32> {
|
pub fn read_var_int(stream: &mut Stream) -> ReadResult<u32> {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
use bitstream_reader::{BitRead, BitReadSized, LittleEndian};
|
use crate::{Parse, ParserState, Result, Stream};
|
||||||
|
|
||||||
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
|
||||||
|
|
||||||
use super::packetentities::PacketEntity;
|
use super::packetentities::PacketEntity;
|
||||||
use super::stringtable::read_var_int;
|
use super::stringtable::read_var_int;
|
||||||
|
|
@ -11,10 +9,10 @@ pub struct TempEntitiesMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parse for TempEntitiesMessage {
|
impl Parse for TempEntitiesMessage {
|
||||||
fn parse(stream: &mut Stream, state: &ParserState) -> Result<Self> {
|
fn parse(stream: &mut Stream, _state: &ParserState) -> Result<Self> {
|
||||||
let count: u8 = stream.read()?;
|
let _count: u8 = stream.read()?;
|
||||||
let length = read_var_int(stream)?;
|
let length = read_var_int(stream)?;
|
||||||
let data = stream.read_bits(length as usize)?;
|
let _data = stream.read_bits(length as usize)?;
|
||||||
|
|
||||||
Ok(TempEntitiesMessage {
|
Ok(TempEntitiesMessage {
|
||||||
entities: Vec::new(),
|
entities: Vec::new(),
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
use bitstream_reader::{BitRead, BitReadSized, LittleEndian};
|
use bitstream_reader::{BitRead, LittleEndian};
|
||||||
use enum_primitive_derive::Primitive;
|
use enum_primitive_derive::Primitive;
|
||||||
use num_traits::{FromPrimitive, ToPrimitive};
|
use num_traits::FromPrimitive;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use crate::demo::message::usermessage::UserMessage::SayText2;
|
|
||||||
use crate::{ReadResult, Stream};
|
use crate::{ReadResult, Stream};
|
||||||
|
|
||||||
#[derive(Primitive, Clone, Copy, Debug)]
|
#[derive(Primitive, Clone, Copy, Debug)]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use bitstream_reader::{BitRead, BitStream, LittleEndian};
|
use bitstream_reader::{BitRead, LittleEndian};
|
||||||
|
|
||||||
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
use crate::{ReadResult, Stream};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct VoiceInitMessage {
|
pub struct VoiceInitMessage {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ pub struct DataTablePacket {
|
||||||
impl Parse for DataTablePacket {
|
impl Parse for DataTablePacket {
|
||||||
fn parse(stream: &mut Stream, _state: &ParserState) -> Result<Self> {
|
fn parse(stream: &mut Stream, _state: &ParserState) -> Result<Self> {
|
||||||
let tick = stream.read()?;
|
let tick = stream.read()?;
|
||||||
let start = stream.pos();
|
|
||||||
let len = stream.read_int::<usize>(32)?;
|
let len = stream.read_int::<usize>(32)?;
|
||||||
let mut packet_data = stream.read_bits(len * 8)?;
|
let mut packet_data = stream.read_bits(len * 8)?;
|
||||||
|
|
||||||
|
|
@ -41,7 +40,7 @@ impl Parse for DataTablePacket {
|
||||||
let mut array_element_prop = None;
|
let mut array_element_prop = None;
|
||||||
let mut props = Vec::with_capacity(prop_count);
|
let mut props = Vec::with_capacity(prop_count);
|
||||||
|
|
||||||
for i in 0..prop_count {
|
for _ in 0..prop_count {
|
||||||
let prop: SendPropDefinition =
|
let prop: SendPropDefinition =
|
||||||
SendPropDefinition::read(&mut packet_data, name.clone())?;
|
SendPropDefinition::read(&mut packet_data, name.clone())?;
|
||||||
if prop.flags.contains(SendPropFlag::InsideArray) {
|
if prop.flags.contains(SendPropFlag::InsideArray) {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use bitstream_reader::{BitRead, BitSize, LazyBitRead, LittleEndian};
|
||||||
|
|
||||||
use crate::demo::message::Message;
|
use crate::demo::message::Message;
|
||||||
use crate::demo::vector::Vector;
|
use crate::demo::vector::Vector;
|
||||||
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
use crate::{Parse, ParserState, ReadResult, Result, Stream};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MessagePacket {
|
pub struct MessagePacket {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ use std::fmt;
|
||||||
use bitstream_reader::{BitRead, LittleEndian};
|
use bitstream_reader::{BitRead, LittleEndian};
|
||||||
|
|
||||||
use crate::demo::message::stringtable::StringTableMeta;
|
use crate::demo::message::stringtable::StringTableMeta;
|
||||||
use crate::demo::sendprop::SendPropFlag::Exclude;
|
|
||||||
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
||||||
|
|
||||||
#[derive(BitRead, Clone, Copy, Debug)]
|
#[derive(BitRead, Clone, Copy, Debug)]
|
||||||
|
|
@ -88,7 +87,7 @@ impl BitRead<LittleEndian> for StringTableEntry {
|
||||||
fn read(stream: &mut Stream) -> ReadResult<Self> {
|
fn read(stream: &mut Stream) -> ReadResult<Self> {
|
||||||
Ok(StringTableEntry {
|
Ok(StringTableEntry {
|
||||||
text: Some(stream.read()?),
|
text: Some(stream.read()?),
|
||||||
extra_data: stream.read()?
|
extra_data: stream.read()?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -100,7 +99,8 @@ impl fmt::Debug for StringTableEntry {
|
||||||
Some(extra_data) => write!(
|
Some(extra_data) => write!(
|
||||||
f,
|
f,
|
||||||
"StringTableEntry{{ text: \"{}\" extra_data: {} bytes }}",
|
"StringTableEntry{{ text: \"{}\" extra_data: {} bytes }}",
|
||||||
self.text(), extra_data.byte_len
|
self.text(),
|
||||||
|
extra_data.byte_len
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -115,7 +115,6 @@ pub struct StringTablePacket {
|
||||||
impl Parse for StringTablePacket {
|
impl Parse for StringTablePacket {
|
||||||
fn parse(stream: &mut Stream, _state: &ParserState) -> Result<Self> {
|
fn parse(stream: &mut Stream, _state: &ParserState) -> Result<Self> {
|
||||||
let tick = stream.read_int(32)?;
|
let tick = stream.read_int(32)?;
|
||||||
let start = stream.pos();
|
|
||||||
let length: usize = stream.read_int(32)?;
|
let length: usize = stream.read_int(32)?;
|
||||||
let mut packet_data = stream.read_bits(length * 8)?;
|
let mut packet_data = stream.read_bits(length * 8)?;
|
||||||
let count: usize = packet_data.read_int(8)?;
|
let count: usize = packet_data.read_int(8)?;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::thread::spawn;
|
|
||||||
|
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use serde_repr::Serialize_repr;
|
use serde_repr::Serialize_repr;
|
||||||
|
|
@ -197,7 +196,7 @@ impl MessageHandler for Analyser {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StringTableEntryHandler for Analyser {
|
impl StringTableEntryHandler for Analyser {
|
||||||
fn handle_string_entry(&mut self, table: &String, index: usize, entry: &StringTableEntry) {
|
fn handle_string_entry(&mut self, table: &String, _index: usize, entry: &StringTableEntry) {
|
||||||
match table.as_str() {
|
match table.as_str() {
|
||||||
"userinfo" => {
|
"userinfo" => {
|
||||||
match (&entry.text, &entry.extra_data) {
|
match (&entry.text, &entry.extra_data) {
|
||||||
|
|
@ -230,7 +229,7 @@ impl Analyser {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn change_name(&mut self, from: String, to: String) {
|
fn change_name(&mut self, from: String, to: String) {
|
||||||
for (id, user) in self.users.iter_mut() {
|
for (_, user) in self.users.iter_mut() {
|
||||||
if user.name == from {
|
if user.name == from {
|
||||||
user.name = to;
|
user.name = to;
|
||||||
return;
|
return;
|
||||||
|
|
@ -239,12 +238,13 @@ impl Analyser {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_event(&mut self, event: GameEvent, tick: u32) {
|
fn handle_event(&mut self, event: GameEvent, tick: u32) {
|
||||||
|
const WIN_REASON_TIME_LIMIT: u8 = 6;
|
||||||
|
|
||||||
match event {
|
match event {
|
||||||
GameEvent::PlayerDeath(event) => self.deaths.push(Death::from_event(event, tick)),
|
GameEvent::PlayerDeath(event) => self.deaths.push(Death::from_event(event, tick)),
|
||||||
GameEvent::PlayerSpawn(event) => self.user_spawns.push(Spawn::from_event(event, tick)),
|
GameEvent::PlayerSpawn(event) => self.user_spawns.push(Spawn::from_event(event, tick)),
|
||||||
GameEvent::TeamPlayRoundWin(event) => {
|
GameEvent::TeamPlayRoundWin(event) => {
|
||||||
// 6 = time limit
|
if event.win_reason != WIN_REASON_TIME_LIMIT {
|
||||||
if event.win_reason != 6 {
|
|
||||||
self.rounds.push(Round::from_event(event, tick))
|
self.rounds.push(Round::from_event(event, tick))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -274,7 +274,7 @@ impl Analyser {
|
||||||
pub fn get_match_state(self, state: ParserState) -> MatchState {
|
pub fn get_match_state(self, state: ParserState) -> MatchState {
|
||||||
MatchState {
|
MatchState {
|
||||||
start_tick: self.start_tick,
|
start_tick: self.start_tick,
|
||||||
interval_per_tick: state.interval_per_tick,
|
interval_per_tick: state.demo_meta.interval_per_tick,
|
||||||
chat: self.chat,
|
chat: self.chat,
|
||||||
deaths: self.deaths,
|
deaths: self.deaths,
|
||||||
rounds: self.rounds,
|
rounds: self.rounds,
|
||||||
|
|
@ -304,7 +304,7 @@ impl UserState {
|
||||||
for spawn in spawns {
|
for spawn in spawns {
|
||||||
teams.insert(spawn.user, spawn.team);
|
teams.insert(spawn.user, spawn.team);
|
||||||
let user_classes = classes.entry(spawn.user).or_default();
|
let user_classes = classes.entry(spawn.user).or_default();
|
||||||
let mut class_spawns = user_classes.entry(spawn.class).or_default();
|
let class_spawns = user_classes.entry(spawn.class).or_default();
|
||||||
*class_spawns += 1;
|
*class_spawns += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
use std::cell::RefCell;
|
|
||||||
use std::collections::HashMap;
|
|
||||||
use std::rc::Rc;
|
|
||||||
|
|
||||||
use crate::demo::message::{Message, MessageType};
|
use crate::demo::message::{Message, MessageType};
|
||||||
use crate::demo::packet::datatable::{SendTable, ServerClass};
|
use crate::demo::packet::datatable::{SendTable, ServerClass};
|
||||||
use crate::demo::packet::stringtable::{StringTable, StringTableEntry};
|
use crate::demo::packet::stringtable::{StringTable, StringTableEntry};
|
||||||
|
|
@ -68,7 +64,8 @@ impl DemoHandler {
|
||||||
fn handle_string_table(&mut self, table: StringTable) {
|
fn handle_string_table(&mut self, table: StringTable) {
|
||||||
self.string_table_names.push(table.name.clone());
|
self.string_table_names.push(table.name.clone());
|
||||||
|
|
||||||
self.state_handler.handle_string_table_meta(table.get_table_meta());
|
self.state_handler
|
||||||
|
.handle_string_table_meta(table.get_table_meta());
|
||||||
for (entry_index, entry) in table.entries.into_iter().enumerate() {
|
for (entry_index, entry) in table.entries.into_iter().enumerate() {
|
||||||
self.handle_string_entry(&table.name, entry_index, entry);
|
self.handle_string_entry(&table.name, entry_index, entry);
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +107,7 @@ impl DemoHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_match_state(mut self) -> MatchState {
|
pub fn get_match_state(self) -> MatchState {
|
||||||
self.analyser.get_match_state(self.state_handler)
|
self.analyser.get_match_state(self.state_handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,12 @@
|
||||||
use std::collections::HashMap;
|
|
||||||
use std::rc::Rc;
|
|
||||||
|
|
||||||
use bitstream_reader::{BitRead, LittleEndian, ReadError};
|
use bitstream_reader::{BitRead, LittleEndian, ReadError};
|
||||||
|
|
||||||
use crate::demo::gameevent_gen::GameEventType;
|
|
||||||
use crate::demo::gamevent::{GameEventValue, GameEventValueType};
|
use crate::demo::gamevent::{GameEventValue, GameEventValueType};
|
||||||
use crate::demo::header::Header;
|
use crate::demo::header::Header;
|
||||||
use crate::demo::message::{Message, MessageType};
|
|
||||||
use crate::demo::packet::stringtable::StringTableEntry;
|
|
||||||
use crate::demo::packet::Packet;
|
use crate::demo::packet::Packet;
|
||||||
use crate::demo::parser::analyser::{Analyser, MatchState};
|
use crate::demo::parser::analyser::MatchState;
|
||||||
use crate::demo::parser::handler::{DemoHandler, MessageHandler, StringTableEntryHandler};
|
use crate::demo::parser::handler::DemoHandler;
|
||||||
pub use crate::demo::parser::state::ParserState;
|
pub use crate::demo::parser::state::ParserState;
|
||||||
use crate::Stream;
|
use crate::Stream;
|
||||||
use std::cell::RefCell;
|
|
||||||
use std::ops::Deref;
|
|
||||||
|
|
||||||
mod analyser;
|
mod analyser;
|
||||||
mod handler;
|
mod handler;
|
||||||
|
|
@ -77,7 +69,7 @@ pub trait Parse: Sized {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: BitRead<LittleEndian>> Parse for T {
|
impl<T: BitRead<LittleEndian>> Parse for T {
|
||||||
fn parse(stream: &mut Stream, state: &ParserState) -> Result<Self> {
|
fn parse(stream: &mut Stream, _state: &ParserState) -> Result<Self> {
|
||||||
Self::read(stream).map_err(ParseError::from)
|
Self::read(stream).map_err(ParseError::from)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,25 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::demo::gameevent_gen::GameEventType;
|
|
||||||
use crate::demo::gamevent::GameEventDefinition;
|
use crate::demo::gamevent::GameEventDefinition;
|
||||||
use crate::demo::message::gameevent::GameEventTypeId;
|
use crate::demo::message::gameevent::GameEventTypeId;
|
||||||
use crate::demo::message::packetentities::EntityId;
|
use crate::demo::message::packetentities::EntityId;
|
||||||
use crate::demo::message::stringtable::StringTableMeta;
|
use crate::demo::message::stringtable::StringTableMeta;
|
||||||
use crate::demo::message::{Message, MessageType};
|
use crate::demo::message::{Message, MessageType};
|
||||||
use crate::demo::packet::datatable::{SendTable, ServerClass};
|
use crate::demo::packet::datatable::{SendTable, ServerClass};
|
||||||
use crate::demo::packet::stringtable::{StringTable, StringTableEntry};
|
use crate::demo::packet::stringtable::StringTableEntry;
|
||||||
use crate::demo::packet::Packet;
|
|
||||||
use crate::demo::parser::handler::{MessageHandler, StringTableEntryHandler};
|
use crate::demo::parser::handler::{MessageHandler, StringTableEntryHandler};
|
||||||
use crate::demo::sendprop::SendProp;
|
use crate::demo::sendprop::SendProp;
|
||||||
use crate::Stream;
|
use crate::Stream;
|
||||||
use std::mem::replace;
|
|
||||||
|
|
||||||
pub type StringEntryHandler = Box<FnMut(&String, &StringTableEntry) -> ()>;
|
#[derive(Default)]
|
||||||
|
pub struct DemoMeta {
|
||||||
|
pub version: u16,
|
||||||
|
pub game: String,
|
||||||
|
pub interval_per_tick: f32,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct ParserState {
|
pub struct ParserState {
|
||||||
pub version: u16,
|
|
||||||
pub static_baselines: HashMap<u32, StaticBaseline>,
|
pub static_baselines: HashMap<u32, StaticBaseline>,
|
||||||
pub event_definitions: HashMap<GameEventTypeId, GameEventDefinition>,
|
pub event_definitions: HashMap<GameEventTypeId, GameEventDefinition>,
|
||||||
pub string_tables: Vec<StringTableMeta>,
|
pub string_tables: Vec<StringTableMeta>,
|
||||||
|
|
@ -26,8 +27,7 @@ pub struct ParserState {
|
||||||
pub send_tables: HashMap<String, SendTable>,
|
pub send_tables: HashMap<String, SendTable>,
|
||||||
pub server_classes: Vec<ServerClass>,
|
pub server_classes: Vec<ServerClass>,
|
||||||
pub instance_baselines: [HashMap<EntityId, Vec<SendProp>>; 2],
|
pub instance_baselines: [HashMap<EntityId, Vec<SendProp>>; 2],
|
||||||
pub game: String,
|
pub demo_meta: DemoMeta,
|
||||||
pub interval_per_tick: f32,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct StaticBaseline {
|
pub struct StaticBaseline {
|
||||||
|
|
@ -81,9 +81,9 @@ impl MessageHandler for ParserState {
|
||||||
fn handle_message(&mut self, message: Message, _tick: u32) {
|
fn handle_message(&mut self, message: Message, _tick: u32) {
|
||||||
match message {
|
match message {
|
||||||
Message::ServerInfo(message) => {
|
Message::ServerInfo(message) => {
|
||||||
self.version = message.version;
|
self.demo_meta.version = message.version;
|
||||||
self.game = message.game;
|
self.demo_meta.game = message.game;
|
||||||
self.interval_per_tick = message.interval_per_tick
|
self.demo_meta.interval_per_tick = message.interval_per_tick
|
||||||
}
|
}
|
||||||
Message::GameEventList(message) => {
|
Message::GameEventList(message) => {
|
||||||
self.event_definitions = message.event_list;
|
self.event_definitions = message.event_list;
|
||||||
|
|
@ -94,7 +94,7 @@ impl MessageHandler for ParserState {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StringTableEntryHandler for ParserState {
|
impl StringTableEntryHandler for ParserState {
|
||||||
fn handle_string_entry(&mut self, table: &String, index: usize, entry: &StringTableEntry) {
|
fn handle_string_entry(&mut self, table: &String, _index: usize, entry: &StringTableEntry) {
|
||||||
match table.as_str() {
|
match table.as_str() {
|
||||||
"instancebaseline" => match &entry.extra_data {
|
"instancebaseline" => match &entry.extra_data {
|
||||||
Some(extra) => match entry.text().parse::<u32>() {
|
Some(extra) => match entry.text().parse::<u32>() {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
use bitstream_reader::{BitRead, BitSize, LittleEndian};
|
use bitstream_reader::{BitRead, BitSize};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use crate::{ReadResult, Stream};
|
|
||||||
|
|
||||||
#[derive(BitRead, BitSize, Debug, Clone, Copy, Default, Serialize)]
|
#[derive(BitRead, BitSize, Debug, Clone, Copy, Default, Serialize)]
|
||||||
pub struct Vector {
|
pub struct Vector {
|
||||||
pub x: f32,
|
pub x: f32,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue