Skip to content

Commit

Permalink
Allow hostnames and all port numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
vstumpf authored and vE5li committed May 18, 2024
1 parent 809cc33 commit c6c8468
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion korangar/src/loaders/server/client_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub struct Service {
pub address: String,

/// Connection server port (default 6900).
pub port: i16,
pub port: u16,

/// Must be equal to **client_version_to_connect** defined in server's
/// login_athena.conf.
Expand Down
6 changes: 3 additions & 3 deletions korangar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ mod world;

use std::cell::RefCell;
use std::io::Cursor;
use std::net::{IpAddr, SocketAddr};
use std::net::ToSocketAddrs;
use std::rc::Rc;
use std::str::FromStr;
use std::sync::Arc;

use cgmath::{Vector2, Vector3};
Expand Down Expand Up @@ -1002,7 +1001,8 @@ fn main() {
.iter()
.find(|service| service.service_id() == service_id)
.unwrap();
let socket_address = SocketAddr::new(IpAddr::from_str(&service.address).expect("ill formatted service IP"), service.port as u16);
let address = format!("{}:{}", service.address, service.port);
let socket_address = address.to_socket_addrs().expect("Failed to resolve IP").next().expect("ill formatted service IP");

saved_login_server_address = Some(socket_address);
saved_username = username.clone();
Expand Down

0 comments on commit c6c8468

Please sign in to comment.