thebuildcraft / RemotePlayerWaypointsForXaero

Shows player and marker positions from Dynmap, Bluemap, Squaremap or Pl3xMap in game using Xaeros Minimap and Worldmap. Also displays AFK status in the tab list.
GNU General Public License v3.0
10 stars 3 forks source link

Online map request failure for Pl3xmap #20

Closed shayypy closed 2 weeks ago

shayypy commented 3 weeks ago

Hello, I'm receiving the following error for a Pl3xmap configuration. Below is my config file as requested in #19. The server is whitelisted but the map is accessible publicly.

image

Config

{
    "enabled": true,
    "enablePlayerWaypoints": true,
    "enableMarkerWaypoints": true,
    // in ms
    "updateDelay": 2000,
    "serverEntries": [
        {
            "maptype": "Pl3xMap",
            "ip": "vanilla.xmcnet.work",
            "link": "https://map.xmcnet.work"
        }
    ],
    // default Y coordinate for maps that don't provide Y coordinates
    "defaultY": 64,
    // in sec
    "timeUntilAfk": 300,
    "unknownAfkStateColor": 6316128,
    "AfkColor": 16733440,
    "playerWaypointColor": "Black",
    "markerWaypointColor": "Gray",
    "showAfkTimeInTabList": true,
    "debugMode": false,
    "ignoredServers": [],
    // in m
    "minDistance": 0,
    // in m
    "maxDistance": 100000,
    // in m
    "minDistanceMarker": 0,
    // in m
    "maxDistanceMarker": 100000
}
thebuildcraft commented 3 weeks ago

That's weird... It works for me. Could you please try and update all your mods and mod loader? If it still doesn't work, please send me the following information:

shayypy commented 3 weeks ago

I made a new instance for testing:

Everything seems to be on the latest version.

It might be worth noting that I have a VPN connection, but this still occurs when it's disabled and I can access the map in my browser with and without it connected.

thebuildcraft commented 3 weeks ago

I don't know what is going on there... I have the exact same setup, just on my localhost server, and I'm connected to your Pl3xMap and it works fine. Does this server have a lobby or is a server network?

shayypy commented 3 weeks ago

No lobby, you just join and go straight into the world

thebuildcraft commented 3 weeks ago

Is the mod outputting something to the logs?

shayypy commented 3 weeks ago

Ah I should have checked that to start. Here are the logs from when it shows the error:

[14:46:48] [Timer-1/INFO]:
 new link: https://map.xmcnet.work/tiles/settings.json
[14:46:50] [Timer-1/INFO]:
 [System] [CHAT] [Remote Player Waypoints For Xaero's Map]: Failed to make online map request. Please check your config (probably your link...) or report a bug.
[14:46:50] [Timer-1/INFO]:
 [STDERR]: java.io.FileNotFoundException: https://map.xmcnet.work/tiles/minecraft:overworld/markers.json
[14:46:50] [Timer-1/INFO]:
 [STDERR]:  at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
[14:46:50] [Timer-1/INFO]:
 [STDERR]:  at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
[14:46:50] [Timer-1/INFO]:
 [STDERR]:  at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
[14:46:50] [Timer-1/INFO]:
 [STDERR]:  at de.the_build_craft.remote_player_waypoints_for_xaero.HTTP.makeTextHttpRequest(HTTP.java:72)
[14:46:50] [Timer-1/INFO]:
 [STDERR]:  at de.the_build_craft.remote_player_waypoints_for_xaero.HTTP.makeJSONHTTPRequest(HTTP.java:61)
[14:46:50] [Timer-1/INFO]:
 [STDERR]:  at de.the_build_craft.remote_player_waypoints_for_xaero.connections.Pl3xMapConnection.getMarkerLayers(Pl3xMapConnection.java:115)
[14:46:50] [Timer-1/INFO]:
 [STDERR]:  at de.the_build_craft.remote_player_waypoints_for_xaero.connections.Pl3xMapConnection.getWaypointPositions(Pl3xMapConnection.java:97)
[14:46:50] [Timer-1/INFO]:
 [STDERR]:  at de.the_build_craft.remote_player_waypoints_for_xaero.UpdateTask.run(UpdateTask.java:148)
[14:46:50] [Timer-1/INFO]:
 [STDERR]:  at java.base/java.util.TimerThread.mainLoop(Unknown Source)
[14:46:50] [Timer-1/INFO]:
 [STDERR]:  at java.base/java.util.TimerThread.run(Unknown Source)
[14:46:52] [Timer-1/INFO]:
 new link: https://map.xmcnet.work/tiles/settings.json
[14:46:52] [Timer-1/INFO]:
 [STDERR]: java.io.FileNotFoundException: https://map.xmcnet.work/tiles/minecraft:overworld/markers.json
[14:46:52] [Timer-1/INFO]:
 [STDERR]:  at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
[14:46:52] [Timer-1/INFO]:
 [STDERR]:  at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
[14:46:52] [Timer-1/INFO]:
 [STDERR]:  at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
[14:46:52] [Timer-1/INFO]:
 [STDERR]:  at de.the_build_craft.remote_player_waypoints_for_xaero.HTTP.makeTextHttpRequest(HTTP.java:72)
[14:46:52] [Timer-1/INFO]:
 [STDERR]:  at de.the_build_craft.remote_player_waypoints_for_xaero.HTTP.makeJSONHTTPRequest(HTTP.java:61)
[14:46:52] [Timer-1/INFO]:
 [STDERR]:  at de.the_build_craft.remote_player_waypoints_for_xaero.connections.Pl3xMapConnection.getMarkerLayers(Pl3xMapConnection.java:115)
[14:46:52] [Timer-1/INFO]:
 [STDERR]:  at de.the_build_craft.remote_player_waypoints_for_xaero.connections.Pl3xMapConnection.getWaypointPositions(Pl3xMapConnection.java:97)
[14:46:52] [Timer-1/INFO]:
 [STDERR]:  at de.the_build_craft.remote_player_waypoints_for_xaero.UpdateTask.run(UpdateTask.java:148)
[14:46:52] [Timer-1/INFO]:
 [STDERR]:  at java.base/java.util.TimerThread.mainLoop(Unknown Source)
[14:46:52] [Timer-1/INFO]:
 [STDERR]:  at java.base/java.util.TimerThread.run(Unknown Source)
shayypy commented 3 weeks ago

I looked on the server filesystem and the directory minecraft-overworld exists but not minecraft:overworld. So https://map.xmcnet.work/tiles/minecraft-overworld/markers.json resolves fine

thebuildcraft commented 3 weeks ago

I have found the issue: grafik In the player data, it is "minecraft:overworld" but in the marker data it is "minecraft-overworld". On my local test server it works. And the test with your server also worked, because it never tried to get the markers, because it never found me on your map, because I was on my test server. Could you try to disable the marker waypoints in your config, please?

shayypy commented 3 weeks ago

I removed the markers and reloaded but the same error still occurs in the logs and in chat. Correct me if I'm wrong but is this not because the player list is showing minecraft:overworld when the real path is what's shown in worldSettings? I would think that I need to correct/compensate for what plexmap is serving in players?

thebuildcraft commented 3 weeks ago

I'm sorry, but don't fully get what you are saying... The problem is how my code generates the http get request link for the markers: it uses the world name of the player using the mod to figure out from which world to take the markers from. I need to do this, because some servers have more than the usual 3 dimensions. And also: did you disable the marker display in my mod, or on your server? Because I meant, you should disable it in my client mod so that it hopefully won't throw that error. Anyway... it's getting late for me. I will have another look at it tomorrow.

shayypy commented 3 weeks ago

Oh sorry, I thought you meant on the server, so I removed the markers. Yes, disabling the marker waypoints setting in your mod allows it to load normally.

thebuildcraft commented 2 weeks ago

I was just about to try to fix your issue... Then I noticed that your server switched to Bluemap. I'm also unable to reproduce this issue on other Pl3xMaps. Do you still have some problems with my mod? Otherwise, I can close this issue.

shayypy commented 2 weeks ago

Sorry about that, I was trying to push for Pl3xmap because of this issue but we switched anyway after 1.21. I've started another instance of our plexmap-enabled 1.20.6 server if you would like to be whitelisted on it for testing. The map link for this instance is https://map.nj.xmcnet.work.

thebuildcraft commented 2 weeks ago

Thank you so much! Yes, I would like to be whitelisted because this issue is very hard to debug otherwise. I will then try to fix it (and port to 1.21) as soon as I can.

shayypy commented 2 weeks ago

Can do, what is your minecraft username?

thebuildcraft commented 2 weeks ago

Oh, yes sorry... the_build_craft

shayypy commented 2 weeks ago

👍 you're whitelisted on vanilla.nj.xmcnet.work

thebuildcraft commented 2 weeks ago

Thank you, I will look at it later.

thebuildcraft commented 2 weeks ago

Hi. I fixed the bug. The fix probably looks too simple. But from my understanding it is all that is needed. For the case, that some other problems with marker get-requests occur, I have some other fixes not committed yet, where I put the marker request in a separate try catch block. I will release them together with some other refactors to the whole UpdateTaks.

And thanks again for providing your server for testing!

shayypy commented 2 weeks ago

Thanks! 🎉