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

[Bug]: Renaming a Server causes all Waypoints to vanish #715

Open
pumpkinhasapatch opened this issue Jun 3, 2024 · 3 comments
Open

[Bug]: Renaming a Server causes all Waypoints to vanish #715

pumpkinhasapatch opened this issue Jun 3, 2024 · 3 comments

Comments

@pumpkinhasapatch
Copy link

What happened?

Minecraft version: Fabric 1.20.6
Mod version: 5.9.32
(This has also happened on every other version of JourneyMap I've tried)

Description: When a server name is changed in the Multiplayer Menu, a new folder for that server is created in .minecraft/journeymap/data/mp and all previous data including Waypoints is kept in a folder with the old Server Name and ignored by the JourneyMap mod.

This is frustrating because I have to manually go into that folder in my Minecraft install, rename the folder Minecraft-Server to match the new name and change spaces to dashes (-).

Possible fix: When a Server is edited in the Multiplayer Menu and name change is detected, rename the appropriate folder in .minecraft/journeymap/data/mp.

Mod Loader

Fabric

Minecraft Version

other (please list)

Version

other (please list)

Relevant log output

A log does not seem to be relevant here. You can easily reproduce the bug yourself with the instructions above. I am using default JourneyMap settings and will upload if needed.

@mysticdrew
Copy link
Member

This is not a bug.
This is how saving server data works.
There is no good solution to saving multiplayer data. IPs can change, users can change the name of the server on the client.
I do plan on adding an import/export option to make it a bit easier so you don't need to manually move the files.

I thought about adding a hook to the multiplayer screen to detect a name change. However, this scenario is also problematic.
Example.
User creates a server with the default name "Minecraft Server" connects to the server, JourneyMap is on the server so it sends the worldId, it creates a folder named Minecraft~Server_worldidvalue, they play it for a bit, then leave.
Then they add a new server and also name it "Minecraft Server" (this is extremely common) log into the server, it does not have journeymap on it. So, we use the seedId that is sent from the server by vanilla. It creates a folder named Minecraft~Server_id-12341234. This scenario is why we use worldId or seedId(which can be 0 on many public bukkit/spigot servers)

They exit back to the multiplayer menu and edit the name of one of the servers that displays in the menu as "Minecraft Server" to "CoolServer". Okay, so which one did they edit?

The ID is sent from the server, in the menu we don't know which one is which.

This is an issue I have been thinking about for a long long time to solve. I am going to close this as it is not a but, just an annoyance and I do plan to add more solutions. It is well known issue. However, we can still discuss it here if you wish.

@mysticdrew
Copy link
Member

mysticdrew commented Jun 4, 2024

What I am considering:
Is instead of going with "WorldName_ID" for the folder name.
We go with "WorldName_IP_PORT" at the base folder level, I can monitor those fields if a user updates them and then update the folder name when it changes. Then inside that folder will contain the "WorldID" or separate "IP:PORT" folders. So when a user connects to a server with multiple servers like bungeecord servers. All the world folders are contained inside the base folder.

I have also thought about adding a hash to the servers.dat folder for each server entry, and that maps to the path where the data folder is for that server. However, then if a user wants to share the data files with other users on the server, that can be a bit complex and some launchers overwrite the file and that may erase our entries.

So, this is not something that will come soon as I am in the middle of the waypoint rewrite, which is my priority and needs to be done asap so we can get v6 out the door. After that I will make this a priority.

@pumpkinhasapatch
Copy link
Author

Thanks for the quick reply, it seems this is a well-known issue and you have tried a lot of things to solve it already.

I tried to look into the mod myself to search for solutions, but I realised this repo is empty and all code is under a "ARR license" (I guess this means All Rights Reserved) and I'm not that experienced with Java. Oh well...

It might not be completely possible to fix this, but you could add the Menu Hook and move folders around anyway, just so it doesn't wipe player's Waypoint data every time a Server Name is changed. If there is ever a conflict where two Minecraft Servers or folders have the same name, tell the user and open the journeymap folder for them to manually sort it themselves.

We just have to do this carefully in a way that won't corrupt map data or show Waypoints on the wrong server (which has happened to me on a few Bungee servers with custom worlds).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants