Skip to content

Commit

Permalink
clear string tables cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
LaihoE committed Oct 31, 2023
1 parent 3f0ec09 commit 2f1c84d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,17 @@ impl Parser {
}
svc_CreateStringTable => self.parse_create_stringtable(&msg_bytes),
svc_UpdateStringTable => self.update_string_table(&msg_bytes),
svc_ClearAllStringTables => self.clear_stringtables(),
_ => Ok(()),
};
ok?
}
Ok(())
}
fn clear_stringtables(&mut self) -> Result<(), DemoParserError> {
self.string_tables = vec![];
Ok(())
}

pub fn parse_header(&mut self, bytes: &[u8]) -> Result<(), DemoParserError> {
let header: CDemoFileHeader = Message::parse_from_bytes(bytes).unwrap();
Expand Down
6 changes: 6 additions & 0 deletions src/parser/src/parser_threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ impl ParserThread {
CS_UM_PlayerStatsUpdate => self.parse_player_stats_update(&msg_bytes),
CS_UM_ServerRankUpdate => self.create_custom_event_rank_update(&msg_bytes),
net_Tick => self.parse_net_tick(&msg_bytes),
svc_ClearAllStringTables => self.clear_stringtables(),
_ => Ok(()),
};
ok?;
Expand Down Expand Up @@ -156,12 +157,17 @@ impl ParserThread {
CS_UM_PlayerStatsUpdate => self.parse_player_stats_update(&msg_bytes),
svc_ServerInfo => self.parse_server_info(&msg_bytes),
net_Tick => self.parse_net_tick(&msg_bytes),
svc_ClearAllStringTables => self.clear_stringtables(),
_ => Ok(()),
};
ok?
}
Ok(())
}
fn clear_stringtables(&mut self) -> Result<(), DemoParserError> {
self.string_tables = vec![];
Ok(())
}

pub fn parse_server_info(&mut self, bytes: &[u8]) -> Result<(), DemoParserError> {
let server_info: CSVCMsg_ServerInfo = match Message::parse_from_bytes(bytes) {
Expand Down

0 comments on commit 2f1c84d

Please sign in to comment.