This commit is contained in:
Robin Appelman 2022-08-26 00:39:34 +02:00
commit 916ff9d1a5
2 changed files with 7 additions and 0 deletions

View file

@ -20,6 +20,7 @@ export async function parseDemo(bytes: Uint8Array): Promise<ParsedDemo> {
name: m.get_player_name(state, i), name: m.get_player_name(state, i),
steamId: m.get_player_steam_id(state, i), steamId: m.get_player_steam_id(state, i),
entityId: m.get_player_entity_id(state, i), entityId: m.get_player_entity_id(state, i),
userId: m.get_player_user_id(state, i),
}) })
} }
@ -64,6 +65,7 @@ export interface PlayerInfo {
entityId: number, entityId: number,
name: string, name: string,
steamId: string, steamId: string,
userId: number,
} }
export enum Team { export enum Team {

View file

@ -156,6 +156,11 @@ pub fn get_player_entity_id(state: &FlatState, player_id: usize) -> u32 {
state.player_info[player_id].entity_id.into() state.player_info[player_id].entity_id.into()
} }
#[wasm_bindgen]
pub fn get_player_user_id(state: &FlatState, player_id: usize) -> u8 {
state.player_info[player_id].user_id.into()
}
#[wasm_bindgen] #[wasm_bindgen]
pub fn get_player_steam_id(state: &FlatState, player_id: usize) -> String { pub fn get_player_steam_id(state: &FlatState, player_id: usize) -> String {
state.player_info[player_id].steam_id.clone() state.player_info[player_id].steam_id.clone()