Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASA (Ark Survival Ascended): Returns a random server from the cluster (Ignores Port) #204

Closed
ElBretxa opened this issue May 19, 2024 · 3 comments · Fixed by #225
Closed
Labels
bug Something isn't working v0.5.X Things about v0.5.X
Milestone

Comments

@ElBretxa
Copy link

Describe the bug
It doesn't matter the port you enter, it will just return one of the servers that is in that ip.

Steps To Reproduce
Here my code, for server EU-PVP-TheIsland2163 (ip and port corresponds to it)

`
use gamedig::games::asa;
use std::net::IpAddr;
use std::str::FromStr;

#[tokio::main]
async fn main() {
let server_ip = "5.62.112.8";
let server_port = Some(7779);

let ip: IpAddr = IpAddr::from_str(server_ip).expect("Invalid IP address");

match asa::query(&ip, server_port) {
    Ok(response) => {
        println!("Server: {:?}", response);
        println!("Server name: {}", response.name);
        println!("Players: {}/{}", response.players_online, response.players_maxmimum);
        for player in response.players {
            println!("Player: {}", player.name);
        }
    }
    Err(e) => eprintln!("Failed to query server: {}", e),
}

}
`

Expected behavior
It should return the specified server, but it returns one of the following server. Each query I do can be a different one from that list

EU-PVE-TheIsland5197, EU-PVP-TheIsland2162, EU-PVE-TheIsland5196, EU-PVP-TheIsland2164, EU-PVP-TheIsland2163

@ElBretxa ElBretxa added the bug Something isn't working label May 19, 2024
@cainthebest cainthebest added this to the Backlog milestone Sep 30, 2024
@cainthebest cainthebest added the v0.5.X Things about v0.5.X label Oct 1, 2024
@digitalfiz
Copy link

I noticed this has a v.0.5 tag, but I am on v0.5.1, and this problem still exists.

@cainthebest
Copy link
Member

@digitalfiz I just edited the label's for it to be more clear, it should have been v0.5.X

@cainthebest
Copy link
Member

Just a self note

Epic returns a list of sessions, we need to filter the one with the desired port.

Node ref:
https://github.com/gamedig/node-gamedig/blob/fe9d4f2cfcebd8748d9690c7414f606b02db8d7b/protocols/epic.js#L118-L121

@cainthebest cainthebest linked a pull request Oct 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v0.5.X Things about v0.5.X
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants