diff --git a/src/node/tests/zipped_testdata.zip b/src/node/tests/zipped_testdata.zip index 667d04c3..61d135e3 100644 Binary files a/src/node/tests/zipped_testdata.zip and b/src/node/tests/zipped_testdata.zip differ diff --git a/src/parser/src/parser.rs b/src/parser/src/parser.rs index 56a93998..a2321afd 100644 --- a/src/parser/src/parser.rs +++ b/src/parser/src/parser.rs @@ -9,6 +9,7 @@ use crate::parser_thread_settings::*; use crate::parser_threads::demo_cmd_type_from_int; use crate::prop_controller::PropController; use crate::read_bits::Bitreader; +use crate::stringtables::parse_userinfo; use crate::stringtables::StringTable; use crate::stringtables::UserInfo; use crate::variants::PropColumn; @@ -191,6 +192,15 @@ impl Parser { self.baselines.insert(k, i.data.as_ref().unwrap().clone()); } } + if item.table_name == Some("userinfo".to_string()) { + for i in &item.items { + if let Ok(player) = parse_userinfo(&i.data()) { + if player.steamid != 0 { + self.stringtable_players.insert(player.steamid, player); + } + } + } + } } Ok(()) } diff --git a/src/parser/src/parser_threads.rs b/src/parser/src/parser_threads.rs index efccc44f..2c1c2c39 100644 --- a/src/parser/src/parser_threads.rs +++ b/src/parser/src/parser_threads.rs @@ -4,6 +4,7 @@ use crate::netmessage_types::netmessage_type_from_int; use crate::netmessage_types::NetmessageType; use crate::parser_thread_settings::ParserThread; use crate::read_bits::Bitreader; +use crate::stringtables::parse_userinfo; use bitter::BitReader; use csgoproto::demo::*; use csgoproto::netmessages::*; @@ -149,6 +150,15 @@ impl ParserThread { self.baselines.insert(k, i.data.as_ref().unwrap().clone()); } } + if item.table_name == Some("userinfo".to_string()) { + for i in &item.items { + if let Ok(player) = parse_userinfo(&i.data()) { + if player.steamid != 0 { + self.stringtable_players.insert(player.steamid, player); + } + } + } + } } let p = full_packet.packet.0.unwrap(); let mut bitreader = Bitreader::new(p.data()); diff --git a/src/parser/src/stringtables.rs b/src/parser/src/stringtables.rs index 835bd04a..caf18452 100644 --- a/src/parser/src/stringtables.rs +++ b/src/parser/src/stringtables.rs @@ -178,7 +178,7 @@ impl Parser { Ok(()) } } -fn parse_userinfo(bytes: &[u8]) -> Result { +pub fn parse_userinfo(bytes: &[u8]) -> Result { let player = match CMsgPlayerInfo::parse_from_bytes(bytes) { Err(_e) => return Err(DemoParserError::MalformedMessage), Ok(player) => player, diff --git a/src/python/tests/gen_test_data.py b/src/python/tests/gen_test_data.py index 01d9add3..7421a9a3 100644 --- a/src/python/tests/gen_test_data.py +++ b/src/python/tests/gen_test_data.py @@ -53,5 +53,8 @@ def gen_event_with_prop_tests(): wanted_prop = "is_alive" gen_prop_test(wanted_prop)""" +wanted_props = ["velocity", "velocity_X", "velocity_Y", "velocity_Z"] +for prop in wanted_props: + gen_prop_test(prop) -gen_event_with_prop_tests() \ No newline at end of file +# gen_event_with_prop_tests() \ No newline at end of file diff --git a/src/python/tests/zipped_testdata.zip b/src/python/tests/zipped_testdata.zip index 4214a593..b407e32d 100644 Binary files a/src/python/tests/zipped_testdata.zip and b/src/python/tests/zipped_testdata.zip differ