Gaming32 / world-host

Host your singleplayer worlds without having to run a server or setup port forwarding! In the future, we also plan to support Bedrock Edition clients through the use of Geyser.
MIT License
59 stars 11 forks source link

[Suggestion] Switch for automatic IP printing #121

Open mpustovoi opened 2 months ago

mpustovoi commented 2 months ago

I suggest having a switch in the mod settings that will automatically execute the command /worldhost ip so that modpack user doesn't have to perform additional actions that the user doesn't know about. Personally, I use your mod along with Custom LAN, so I've never seen your mod's screen. If there is a hint on it, then I'll pass it and then consider it's more of a compatibility problem with Custom LAN, as mentioned in https://github.com/Gaming32/world-host/issues/1. I see it as something like: Automatically print IPNo/Only tunneling IP/Only temporary IP/Both.

Gaming32 commented 2 months ago

The thing with the temporary IP is that it only works up to 60 seconds from when you run the command. It is temporary, after all. I'll consider adding the other thing though.

mpustovoi commented 2 months ago

Oh, got it. I thought that the temporary IP only applies to the current gaming session.

Gaming32 commented 2 months ago

/worldhost ip works until you close the game. If you leave the world and host a new one, the /worldhost ip will be the same. /worldhost tempip, on the other hand, only works for 60 seconds. It also only works if you have UPnP enabled and your router supports it.

mpustovoi commented 2 months ago

So, if I close the game completely, next time when I enter my world /worldhost ip will give me new IP, right? I'm just asking to know, since the minimap mod requires the same IP to save the world map as the same one, and not consider it as a different server.

Gaming32 commented 2 months ago

Yes, it will give you a new IP. I do realize that this can cause issues with minimaps, but it's not really solvable without integrations from those minimap mods (which will shortly become easier).

mpustovoi commented 2 months ago

It's a shame that those aren't open source.

Gaming32 commented 2 months ago

Some are. I'll probably PR support into other mods that need world identification though, such as Bobby or Distant Horizons.

Gaming32 commented 2 months ago

Though I just realized that the "easier way" actually doesn't help at all.

mpustovoi commented 2 months ago

Maybe it can be done via playerdata or something, but I'm generally just a Minecraft player, so...