stevenarella icon indicating copy to clipboard operation
stevenarella copied to clipboard

Unable to ping bungeecord servers

Open terrarier2111 opened this issue 3 years ago • 4 comments

When pinging BungeeCord servers, the server list only shows "Connecting", "Connection timed out (os error 110)" or "Connection refused (os error 111)" while connecting with original minecraft works fine.

terrarier2111 avatar Jul 04 '21 14:07 terrarier2111

Previous BungeeCord problems: #125 #142 May need to add some special connection handling for Bungee Or does the BungeeCord server have an SRV record? If so, not yet supported: https://github.com/iceiix/stevenarella/blob/eb452abbb5b34d7dd89610f51990527605d3fafc/protocol/src/protocol/mod.rs#L1046

        // TODO SRV record support

see also: https://github.com/iceiix/stevenarella/issues/401 server_list: automatically show LAN servers

iceiix avatar Jul 18 '21 16:07 iceiix

I tried it with Hypixel and some others and it didn't work, I don't know if they have a SRV record.

terrarier2111 avatar Jul 20 '21 09:07 terrarier2111

Should I close this issue? I fixed the issue for my project, but I can leave it open if it has any value to this project.

terrarier2111 avatar Aug 08 '21 16:08 terrarier2111

Yes I would like to fix this here too, curious of your fix? Couldn't find much searching for https://github.com/terrarier2111/Leafish/search?q=bungeecord - maybe this: SRV lookup in https://github.com/terrarier2111/Leafish/blame/f44cf08d818f755e9ca834ec6c55ee3912e67312/protocol/src/protocol/mod.rs#L1132-L1151

impl Conn {
    fn get_server_addresses(mut hostname: &str) -> Vec<String> {
        let mut addresses = vec![];
        let parts = hostname.split(':').collect::<Vec<&str>>();
        if parts.len() > 1 {
            addresses.push(hostname.to_string());
            hostname = parts[0];
        }
        let records = RESOLVER.srv_lookup(format!("_minecraft._tcp.{}", hostname));
        if records.is_ok() {
            for record in records.unwrap() {
                debug!("{}:{}", record.target(), record.port());
                addresses.push(format!("{}:{}", record.target(), record.port()));
            }
        }
        addresses.push(format!("{}:25565", hostname));
        addresses
    }

added in https://github.com/terrarier2111/Leafish/commit/d8ce7ec59ae90e80cde3d8c6af319ee672157acc

iceiix avatar Sep 06 '21 23:09 iceiix