mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
[Games] Add timeout settings for proprietary games (#67)
Adding query functions with timeout settings to proprietary games allows the generic query with timeout function to pass the timeout settings through. This does change how the pre-existing FFOW query_with_timeout function worked: it accepted a non-optional timeout settings, this was changed to optional to be consistent with other query_with_timeout functions and to move deciding what to do if the user doesn't provide timeout settings to a more central location. Closes #64
This commit is contained in:
parent
f3a792e325
commit
e207e8dc95
4 changed files with 28 additions and 15 deletions
|
|
@ -186,12 +186,15 @@ pub fn query_with_timeout(
|
|||
QuakeVersion::Three => protocols::quake::three::query(&socket_addr, timeout_settings).map(Box::new)?,
|
||||
}
|
||||
}
|
||||
// TODO: No way to query proprietary games with timeout
|
||||
Protocol::PROPRIETARY(protocol) => {
|
||||
match protocol {
|
||||
ProprietaryProtocol::TheShip => ts::query(address, port).map(Box::new)?,
|
||||
ProprietaryProtocol::FFOW => ffow::query(address, port).map(Box::new)?,
|
||||
ProprietaryProtocol::JC2MP => jc2mp::query(address, port).map(Box::new)?,
|
||||
ProprietaryProtocol::TheShip => {
|
||||
ts::query_with_timeout(address, port, timeout_settings).map(Box::new)?
|
||||
}
|
||||
ProprietaryProtocol::FFOW => ffow::query_with_timeout(address, port, timeout_settings).map(Box::new)?,
|
||||
ProprietaryProtocol::JC2MP => {
|
||||
jc2mp::query_with_timeout(address, port, timeout_settings).map(Box::new)?
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue