1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 18:24:05 +02:00

improved user info handling

This commit is contained in:
Robin Appelman 2020-02-09 16:38:38 +01:00
commit 1eb6c06ac3
7 changed files with 14 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"chat":[],"users":{"2":{"classes":{},"name":"Icewind | demos.tf","userId":2,"steamId":"[U:1:64229260]","team":"other"}},"deaths":[],"rounds":[],"startTick":4854,"intervalPerTick":0.015} {"chat":[],"users":{"2":{"classes":{},"name":"Icewind | demos.tf","userId":2,"steamId":"[U:1:64229260]","team":"other"}},"deaths":[],"rounds":[],"startTick":4854,"intervalPerTick":0.015}

View file

@ -359,17 +359,20 @@ impl Analyser {
.unwrap_or_else(|| Ok((user_id.0 as u32).into())) .unwrap_or_else(|| Ok((user_id.0 as u32).into()))
{ {
Ok(entity_id) if !steam_id.is_empty() => { Ok(entity_id) if !steam_id.is_empty() => {
self.state.users.insert( self.state
user_id, .users
UserInfo { .entry(user_id)
.and_modify(|info| {
info.entity_id = entity_id;
})
.or_insert_with(|| UserInfo {
classes: ClassList::default(), classes: ClassList::default(),
team: Team::Other, team: Team::Other,
steam_id, steam_id,
user_id, user_id,
name, name,
entity_id, entity_id,
}, });
);
} }
_ => {} _ => {}
} }