Automatically showing server in LAN

I’ve just started using MineOS and I’m loving what I see so far.
I’m sure this is an easy one and something that I’ve missed.

Previously when hosting the server on my local workstation everyone on the LAN could see the server when they went into the multiplayer screen.

Now that I’ve moved the server across to MineOS the server doesn’t show up, but everyone can still connect by selecting Add Server and entering the IP.

Is there any further configuration I need to do, is there a specific port that minecraft queries for servers on (apart from the obvious 25565 which is of course already open)?

I know at least on Windows I had to create an exception for java to allow this to happen, so what’s the equivalent for MineOS.

Thanks

To the best of my understanding, to have it show up automatically in LAN, you need to open up port 4445 in UDP.

I haven’t tried this myself, but there seems to be a few page that corroborate this, as 4445 is a port used for upnotifyp, which is a registered port that programs use for this purpose.

one
two
three

Thanks for that, unfortunately it’s made no difference.
4445 is definitely used when you use the Open to LAN option.

I’ve configured the iptables policy to ACCEPT on the INPUT chain and still nothing.
So I’m at a complete loss.

On Windows I had to create a javaw.exe any-any rule for it to see the server (when it was hosted on Windows), but that’s a client side rule anyway.
I’ve done some captures with wireshark and I can’t pinpoint the traffic.

Any other ideas?

I looks as thought the std client when run in lan mode actively advertises itself.

More info here including an example script:

http://void7.net/advertising-linux-minecraft-servers-to-the-lan/

Yeah, that’s how it works when you select Open to LAN from within the client.

And now with further testing it looks like I was dreaming about the server doing any broadcasting of it’s own.

So, thank you for the script, it works, now I just need to figure out how to integrate it into the server startup :wink:

Should be able to do a one liner in rc.local to run that script in a screen session

I’ve ported this to node.js (hopefully it can be included in the next mineos)

1 Like

I can say with 100% certainty that the next version of MineOS would include this functionality, especially thanks to you figuring it all out for me! That said, there’s not much movement on the mineos-node git nowadays (roughly since bukkit imploded), so it’s uncertain when or if that should ever come to fruition.

Did LAN server capabilities ever get merged into MineOS?

If you’re referring to whether this functionality has been implemented into the Python-based MineOS webui (the one everybody currently uses), no, unfortunately it probably won’t be.

I’m looking at implementing this now into the new node.js based web-ui, but I haven’t gotten it working yet…did you get your linked code-snippet to work?

Linked code-snippet?
I didn’t end up integrating it into MineOS-node if that’s what you mean. I think you’d have to have a checkbox so people can specify if it’s a local server, you then add or subtract from an array of local servers and stop and start the advertiser

Where is it failing?

:edit:
from looking at your code I think the easiest thing might be each server has an isLocal true/false,
in (maybe) self.start

if self.isLocal = true
    add self.motd,self.server-port to localServerArray
    re/start advertiser (use my child branch broadcast.js)
    // proc = child.spawn("node", ["broadcast", localServerArray]);
    // proc.on('error', function(e){console.log(e)});
    // record pid of this process? then you can kill it and restart.

in self.stop and self.kill

if self.isLocal = true
    remove self from localServerArray
    re/start advertiser

maybe I will one day make it something like broadcast.add(MOTD,port) and broadcast.remove(port) and handle all the restarting etc but for now, this will do. Theoretically you wouldn’t necessarily need to restart if you can edit the broadcast.js server array on the fly.

I mean your node code. I couldn’t get it to work, nor when implemented it in mineos-node.

It was working when I made it.
Did you use it with the motd and port like this
“A MOTD here”, 25565
?

Can you show me what you did and any errors you got?

I’m literally just running nodejs advert.js. No errors–just nothing at all shows up in the Minecraft client.

Interesting. Works for me. I’m updating master to pick up servers from an external file.
Do client games when opened to LAN work for you?

Yeah, my connectivity to servers itself is just fine. I’ll take another look at my VM (the one I use to open up minecraft) and check if I’m not doing something exceedingly simple like firewalling UDP, and I might be surprised it’s already working. I already have coded it all out and it’s ready for a pull request into master once I can verify it works.

1 Like

Is this the issue that prevents me from accessing “Open to LAN” option which prevents me from enabling cheats?

Running FreeNAS 9.3
New MineOS plugin.

I can run the plugin and login with the client, but I don’t have access to the “Open to LAN” option to Enable cheats to run in game commands.

Is there a work around?

Mineos doesn’t (and can’t) affect the availability of functionality within Minecraft such as this. I’m not familiar with your issue, but broadcast to lan is a separate and unrelated issue.