more games with version

This commit is contained in:
Pedro Ivo Hudson 2024-02-04 11:50:40 -03:00
parent 69c94cbbad
commit c367771801
3 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,7 @@ export default class doom3 extends Core {
let reader = this.reader(body)
const protoVersion = reader.uint(4)
state.raw.protocolVersion = (protoVersion >> 16) + '.' + (protoVersion & 0xffff)
state.version = state.raw.protocolVersion
// some doom implementations send us a packet size here, some don't (etqw does this)
// we can tell if this is a packet size, because the third and fourth byte will be 0 (no packets are that massive)

View File

@ -17,5 +17,6 @@ export default class eco extends Core {
state.gamePort = serverInfo.GamePort
state.players = serverInfo.OnlinePlayersNames?.map(name => ({ name, raw: {} })) || []
state.raw = serverInfo
state.version = state.raw.Version
}
}

View File

@ -19,5 +19,6 @@ export default class factorio extends Core {
state.players = players.map(player => ({ name: player, raw: {} }))
state.raw = serverInfo
state.version = state.raw.application_version.game_version + '.' + state.raw.application_version.build_version
}
}