mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-06 15:27:28 +00:00
[Protocol] Enable the use of Ipv6 addresses (#41)
Replace usages of Ipv4Addr with IpAddr which allows the use of either Ipv4 or Ipv6. This patch essentially consists of running: "sed -i 's/Ipv4Addr/IpAddr/g' src/**/*.rs examples/*" and fixing the errors.
This commit is contained in:
parent
e620398615
commit
3f654e0dfd
60 changed files with 155 additions and 162 deletions
|
|
@ -4,7 +4,7 @@ use gamedig::protocols::valve;
|
|||
use gamedig::protocols::valve::Engine;
|
||||
use gamedig::{aliens, aoc, arma2oa, ase, asrd, avorion, bat1944, bb2, bf1942, bm, bo, ccure, cosu, cs, cscz, csgo, css, dod, dods, doi, dst, ffow, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, ohd, onset, pz, ror2, rust, sc, sdtd, ss, tf, tf2, tfc, ts, unturned, ut, vr, GDResult, cw};
|
||||
use std::env;
|
||||
use std::net::Ipv4Addr;
|
||||
use std::net::IpAddr;
|
||||
|
||||
fn main() -> GDResult<()> {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
|
|
@ -20,7 +20,7 @@ fn main() -> GDResult<()> {
|
|||
return Ok(());
|
||||
}
|
||||
|
||||
let ip = &args[2].as_str().parse::<Ipv4Addr>().unwrap();
|
||||
let ip = &args[2].as_str().parse::<IpAddr>().unwrap();
|
||||
let port = match args.len() == 4 {
|
||||
false => {
|
||||
if args[1].starts_with("_") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue