GlowstoneMC / Glowstone-Legacy

An open-source server for the Bukkit Minecraft modding interface
Other
363 stars 122 forks source link

Print out bound port #574

Closed Aaron1011 closed 9 years ago

Aaron1011 commented 9 years ago

Currently, if port is set to 0 in the config, there's no way to determine the port that the server actually gets bound to.

This PR prints out the port that was bound t, and updates getPort to return the port actually bound if, if 0 was specified.

Aaron1011 commented 9 years ago

This resolves issue https://github.com/GlowstoneMC/Glowstone/issues/571

turt2live commented 9 years ago

I don't think this needs a variable to be stored 0.01% of the time it will be used. Just pull the value from the bound socket.

Aaron1011 commented 9 years ago

Then, I'd just be storing the channel or socket instead. It's not accessible from the main server outside bind()

turt2live commented 9 years ago

Then the variable should always be used

SpaceManiac commented 9 years ago

Merged in 1311a2a3330e60f9e4da56de4b160fc8b98d4e6f.