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

Ability to reconfigure core/server sockets at runtime #12475

Closed
SoniEx2 opened this issue Jun 25, 2022 · 10 comments
Closed

Ability to reconfigure core/server sockets at runtime #12475

SoniEx2 opened this issue Jun 25, 2022 · 10 comments
Labels
Feature request Issues that request the addition or enhancement of a feature @ Network Possible close @ Script API Won't add The feature request was rejected and will not be added.

Comments

@SoniEx2
Copy link

SoniEx2 commented Jun 25, 2022

Problem

A clear and concise description of what the problem is.
ie: Why is this needed?
Ex. I'm always frustrated when [...]

There's no run-time "open to LAN"/"open to tailscale" feature.

Solutions

A clear and concise description of what you want to happen.

There should be an API to reconfigure core/server sockets at runtime, so that "open to LAN"/etc can be provided by a trusted mod.

Alternatives

A clear and concise description of any alternative solutions or features you've considered.

There's really no practical alternative way of implementing this.

Additional context

Add any other context or screenshots about the feature request here.

N/A

@SoniEx2 SoniEx2 added the Feature request Issues that request the addition or enhancement of a feature label Jun 25, 2022
@Zughy
Copy link
Member

Zughy commented Jun 25, 2022

Duplicate of #10120 ?

@SoniEx2
Copy link
Author

SoniEx2 commented Jun 25, 2022

No, this is for reconfiguring the server socket.

The one used to join the game.

@rubenwardy
Copy link
Member

This seems a lot like an XY problem, and isn't something that should be added to the modding API. It's dangerous, complicated, and out-of-scope. Which socket the server binds to is very much a server admin / IT thing, not a mod thing.

Access to the server socket wouldn't allow you to implement Open to LAN, as singleplayer mode is a bit more than just sockets - there's also the singleplayer username. Also, "Host Server" is Minetest's equivalent of "Open to LAN".

If you wanted to implement Open to LAN in a mod, you could require the player to use Host server and then enforce singleplayer in your mod when your Open to LAN option is disabled.

If you have a more complicated use case, then it would be better to make a program that wraps Minetest to implement it

@SoniEx2
Copy link
Author

SoniEx2 commented Jun 25, 2022

It should be possible to open to LAN at runtime.

And also, it should be possible for a locally-installed (trusted) mod to open to "LAN" and configure proxies ( #12474 ) at runtime. At that point, it's no longer "open to LAN" but "open to friends", who can be anywhere, and it can use any service to do the proxying (e.g. tailscale).

(the singleplayer username is just an username. yeah it'd be a bit weird but if that bothers someone then #12476 )

@appgurueu
Copy link
Contributor

It should be possible to open to LAN at runtime.

But why? What's the issue with restarting the server when you want to host a server? NTM mods probably expecting minetest.is_singleplayer() to return the same value across a session. I don't see this feature being worth the effort.

@SoniEx2
Copy link
Author

SoniEx2 commented Jun 26, 2022

Because being able to do it at runtime is more flexible. Not everyone wants to have to restart their game just to do a socket()/bind() dance again.

@appgurueu
Copy link
Contributor

Because being able to do it at runtime is more flexible. Not everyone wants to have to restart their game just to do a socket()/bind() dance again.

There even is a proxy. Use that if you don't want to restart at all cost. This feature isn't worth implementing.

@SoniEx2
Copy link
Author

SoniEx2 commented Jun 26, 2022

Speaking as a player: "Open to..." at runtime feels better than having to restart.

UX matters. Maybe you, a dev, don't care about players, but players generally care about players.

@rubenwardy
Copy link
Member

I'm taking SmallJoker's thumbs up as support, so closing this issue as Won't Add. See #12475 (comment) for reasons

This issue isn't directly about an Open to LAN option, it's about mod control over the network sockets. An issue about Open to LAN could be considered - I think it would be low priority though as you can just click host server. There are things that would improve UX much more like UPnP service detection and URIs to join servers

@rubenwardy rubenwardy added the Won't add The feature request was rejected and will not be added. label Jun 26, 2022
@rubenwardy rubenwardy closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2022
@SoniEx2
Copy link
Author

SoniEx2 commented Jun 26, 2022

Hmm... Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Issues that request the addition or enhancement of a feature @ Network Possible close @ Script API Won't add The feature request was rejected and will not be added.
Projects
None yet
Development

No branches or pull requests

4 participants