minetest-mapserver / mapserver

Minetest realtime mapserver, written in go
Other
101 stars 22 forks source link

Allow initial rendering without creating socket #403

Open Laudrin opened 3 months ago

Laudrin commented 3 months ago

Thank you for the great tool! 🙂

If I have mapserver (v4.9.1 on Windows 10 64 bit) running for a world I'm playing in at the moment and try letting mapserver do the initial rendering of another world in the background, mapserver tries to create a socket on a fixed address before starting rendering. Of course this fails with an error, as the socket on that address is already open.

panic: listen tcp :8080: bind: Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet werden.

(Retranslation:) Normally, each socket address (protocol, network address or connection) may only be used once.

This could also happen if there is another program using that socket, so this is not only in case you want to render other worlds while mapserver is active for one world.

mapserver -help gives no help to change the socket address, after checking the world directory, I found the mapserver.json, changed the socket address and got mapserver running in the background. So far, so good, but this is not optimal if you only want to run the initial rendering for a world and have each world on the same socket address when active.

So I would suggest the following improvements for the command line / mapserver arguments:

Of course the commands are only suggestions. 🙂 What do you think about that?

Laudrin commented 3 months ago

Another idea for the user's convenience:

mapserver -open-in-browser would open the map in the user's standard browser, using the socked/port saved in mapserver.json.