mirror of
https://codeberg.org/demostf/tf-demos-viewer.git
synced 2026-06-03 18:14:11 +02:00
userid
This commit is contained in:
parent
c9fb39f7b2
commit
916ff9d1a5
2 changed files with 7 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ export async function parseDemo(bytes: Uint8Array): Promise<ParsedDemo> {
|
|||
name: m.get_player_name(state, i),
|
||||
steamId: m.get_player_steam_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,
|
||||
name: string,
|
||||
steamId: string,
|
||||
userId: number,
|
||||
}
|
||||
|
||||
export enum Team {
|
||||
|
|
|
|||
|
|
@ -156,6 +156,11 @@ pub fn get_player_entity_id(state: &FlatState, player_id: usize) -> u32 {
|
|||
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]
|
||||
pub fn get_player_steam_id(state: &FlatState, player_id: usize) -> String {
|
||||
state.player_info[player_id].steam_id.clone()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue