Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract first 8 bits of userid #225

Merged
merged 3 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
bitter = "0.7.0"
protobuf = "3.5.0"
protobuf = "=3.5.1"
snap = "1.1.0"
ahash = "0.8.3"
regex = "1.7.3"
Expand All @@ -19,7 +19,7 @@ memmap2 = "0.9.4"
serde = { version = "1.0.164", features = ["derive"] }
libc = "0.2.147"
rayon = "1.7.0"
protobuf-support = "3.5.0"
protobuf-support = "=3.5.1"
proc-macro2 = "1.0.69"
rand = "0.8.5"
opus = { version = "0.3.0", optional = true}
Expand Down
112 changes: 44 additions & 68 deletions src/parser/src/e2e_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,10 +1259,7 @@ mod tests {
};

let mut wanted_prop_states: AHashMap<std::string::String, Variant> = AHashMap::default();
wanted_prop_states.insert(
"CCSGameRulesProxy.CCSGameRules.m_bBombPlanted".to_string(),
Variant::Bool(true),
);
wanted_prop_states.insert("CCSGameRulesProxy.CCSGameRules.m_bBombPlanted".to_string(), Variant::Bool(true));
let settings_with_filter = ParserInputs {
wanted_players: vec![76561198244754626],
real_name_to_og_name: AHashMap::default(),
Expand All @@ -1287,14 +1284,7 @@ mod tests {
let output = ds.parse_demo(&mmap).unwrap();
let output_with_filter = ds_with_filter.parse_demo(&mmap).unwrap();

let positions = match output
.df
.get(&PLAYER_X_ID)
.unwrap()
.data
.clone()
.unwrap_or(VarVec::F32(vec![]))
{
let positions = match output.df.get(&PLAYER_X_ID).unwrap().data.clone().unwrap_or(VarVec::F32(vec![])) {
VarVec::F32(positions_vec) => positions_vec,
_ => vec![],
};
Expand All @@ -1305,14 +1295,7 @@ mod tests {
.find(|prop| prop.prop_name == "CCSGameRulesProxy.CCSGameRules.m_bBombPlanted")
.map(|prop| prop.id)
.unwrap();
let bomb = match output
.df
.get(&bomb_prop_id)
.unwrap()
.data
.clone()
.unwrap_or(VarVec::Bool(vec![]))
{
let bomb = match output.df.get(&bomb_prop_id).unwrap().data.clone().unwrap_or(VarVec::Bool(vec![])) {
VarVec::Bool(bomb_vec) => bomb_vec,
_ => vec![],
};
Expand All @@ -1324,14 +1307,7 @@ mod tests {
_ => None,
})
.collect();
let automatically_filtered_positions = match output_with_filter
.df
.get(&PLAYER_X_ID)
.unwrap()
.data
.clone()
.unwrap_or(VarVec::F32(vec![]))
{
let automatically_filtered_positions = match output_with_filter.df.get(&PLAYER_X_ID).unwrap().data.clone().unwrap_or(VarVec::F32(vec![])) {
VarVec::F32(positions_vec) => positions_vec,
_ => vec![],
};
Expand Down Expand Up @@ -3543,46 +3519,46 @@ mod tests {
"user_id",
PropColumn {
data: Some(I32(vec![
Some(65283),
Some(65285),
Some(65282),
Some(65281),
Some(65287),
Some(65288),
Some(65289),
Some(65280),
Some(65286),
Some(65284),
Some(65283),
Some(65285),
Some(65282),
Some(65281),
Some(65287),
Some(65288),
Some(65289),
Some(65280),
Some(65286),
Some(65284),
Some(65283),
Some(65285),
Some(65282),
Some(65281),
Some(65287),
Some(65288),
Some(65289),
Some(65280),
Some(65286),
Some(65284),
Some(65283),
Some(65285),
Some(65282),
Some(65281),
Some(65287),
Some(65288),
Some(65289),
Some(65280),
Some(65286),
Some(65284),
Some(3),
Some(5),
Some(2),
Some(1),
Some(7),
Some(8),
Some(9),
Some(0),
Some(6),
Some(4),
Some(3),
Some(5),
Some(2),
Some(1),
Some(7),
Some(8),
Some(9),
Some(0),
Some(6),
Some(4),
Some(3),
Some(5),
Some(2),
Some(1),
Some(7),
Some(8),
Some(9),
Some(0),
Some(6),
Some(4),
Some(3),
Some(5),
Some(2),
Some(1),
Some(7),
Some(8),
Some(9),
Some(0),
Some(6),
Some(4),
])),
num_nones: 0,
},
Expand Down
2 changes: 1 addition & 1 deletion src/parser/src/first_pass/stringtables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub fn parse_userinfo(bytes: &[u8]) -> Result<UserInfo, DemoParserError> {
is_hltv: player.ishltv(),
steamid: player.xuid(),
name: player.name().to_string(),
userid: player.userid(),
userid: player.userid() & 0xff,
})
}

Expand Down
Loading