mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
[Protocol] Add PROPRIETARY to protocol enumeration (#59)
* [Protocol] Add CUSTOM to protocol enumeration * [Protocol] Rename CUSTOM to PROPRIETARY * [Protocol] Rename struct to ProprietaryProtocol and do the same thing to generic response * [Protocol] Revert proprietary change on generic response
This commit is contained in:
parent
b368877031
commit
c55254aaf6
3 changed files with 22 additions and 11 deletions
|
|
@ -114,7 +114,7 @@ pub mod vr;
|
|||
|
||||
use crate::protocols::gamespy::GameSpyVersion;
|
||||
use crate::protocols::quake::QuakeVersion;
|
||||
use crate::protocols::types::CommonResponse;
|
||||
use crate::protocols::types::{CommonResponse, ProprietaryProtocol};
|
||||
use crate::protocols::{self, Protocol};
|
||||
use crate::GDResult;
|
||||
use std::net::{IpAddr, SocketAddr};
|
||||
|
|
@ -172,8 +172,12 @@ pub fn query(game: &Game, address: &IpAddr, port: Option<u16>) -> GDResult<Box<d
|
|||
QuakeVersion::Three => protocols::quake::three::query(&socket_addr, None).map(Box::new)?,
|
||||
}
|
||||
}
|
||||
Protocol::TheShip => ts::query(address, port).map(Box::new)?,
|
||||
Protocol::FFOW => ffow::query(address, port).map(Box::new)?,
|
||||
Protocol::JC2MP => jc2mp::query(address, port).map(Box::new)?,
|
||||
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)?,
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue