kylepaulsen / ValheimWebMap

A Valheim dedicated server mod to host a web accessible map.
29 stars 13 forks source link

The site does not work correctly #7

Closed 1fr4m3 closed 3 years ago

1fr4m3 commented 3 years ago

Greetings.

Installed your mod today. Everything works without errors, there is nothing in the console. The site does not display a map, the left menu does not work, does not display pins. But at the same time, in the folder with the dedicated server, everything is created (files). Created an image with a map, pins, etc., but displays nothing on the site.

When enabled, display on the map for everyone I appear, movements are visible Perhaps these are all problems on my part. But I still ask for help

image image image image image image image

kylepaulsen commented 3 years ago

This is odd. What browser are you using? And there were no browser console errors (F12 in most modern browsers). The only things I could think of is that maybe you need to zoom in a bit using mousewheel (the map starts out very zoomed out). But even then, you should be seeing pins. I wonder if you tried loading the page too soon after server start? Maybe try reloading the page after you are in game.

rysson commented 3 years ago

I suggest to install last version (1.1.0), released 20 min ago (there was changes in URLs for config and map), next check errors in a browser dev console, as @kylepaulsen wrote. Next check network transfer files (the same browser dev console).

If movement works websocket is connected.

1fr4m3 commented 3 years ago

i used google chrome and opera gx

image image

rysson commented 3 years ago

Oh, JSON prepared by mod has some issue I guess.

Could you type here:

Those configs differ, first if editable source, second is prepared by map mod for JS front-end.

EDIT: Do you upgrade mode to 1.1.0 version? And do you make full reload in the browser (ex. Shit-Ctrl-R)?

1fr4m3 commented 3 years ago

Oh, JSON prepared by mod has some issue I guess.

Could you type here:

  • your config (file from server map mod),
{
    "// lines that look like this are comments and dont do anything.": 0,

    "// http server listens on below port. Default: 3000": 0,
    "server_port": 3000,

    "// A larger explore_radius reveals the map more quickly. Default: 100": 0,
    "explore_radius": 100,

    "// How zoomed in should the web map start at? Higher is more zoomed in. Default: 200": 0,
    "default_zoom": 200,

    "// How many pins each client is allowed to make before old ones start being deleted. Default: 50": 0,
    "max_pins_per_user": 50,

    "// How often do we send position data to web browsers in seconds. Default: 0.5": 0,
    "player_update_interval": 0.5,

    "// How often do we update the fog texture on the server in seconds. Default: 1": 0,
    "update_fog_texture_interval": 1,

    "// How often do we save the fog texture in seconds. Default: 30": 0,
    "save_fog_texture_interval": 30,

    "// Should the server cache web files to be more performant? Default: true": 0,
    "cache_server_files": true,

    "// How large is the map texture? Probably dont change this. Default: 2048": 0,
    "texture_size": 2048,

    "// How many in game units does a map pixel represent? Probably dont change this. Default: 12": 0,
    "pixel_size": 12
}
  • content of sent config (5th file on your network list) – you can get it browser dev console.

{"world_name":"TEST","world_start_pos": "-2,427281,37,2745,-1,760558","default_zoom":200,"texture_size":2048,"pixel_size":12,"update_interval":0,5,"explore_radius":100}

Those configs differ, first if editable source, second is prepared by map mod for JS front-end.

EDIT: Do you upgrade mode to 1.1.0 version? And do you make full reload in the browser (ex. Shit-Ctrl-R)?

Yes. And showed new error after Shift-Ctrl-R. image

rysson commented 3 years ago

Thanks a lot! I see error "update_interval":0,5 I suppose decimal point in your language is comma , (like in mine, but I have English set on server). Fanny issue.

I don't know C#, but if I will have to fix it I'll try to change:

diff --git a/WebMap/Config.cs b/WebMap/Config.cs
index 9abeaa8..9f5af00 100644
--- a/WebMap/Config.cs
+++ b/WebMap/Config.cs
@@ -135,7 +135,7 @@ namespace WebMap {
             sb.Append($"\"default_zoom\":{DEFAULT_ZOOM},");
             sb.Append($"\"texture_size\":{TEXTURE_SIZE},");
             sb.Append($"\"pixel_size\":{PIXEL_SIZE},");
-            sb.Append($"\"update_interval\":{PLAYER_UPDATE_INTERVAL},");
+            sb.Append($"\"update_interval\":{PLAYER_UPDATE_INTERVAL.toString("G", System.Globalization.CultureInfo.InvariantCulture)},");
             sb.Append($"\"explore_radius\":{EXPLORE_RADIUS}");
             sb.Append("}");

We have to wait for @kylepaulsen.

BTW. favicon.ico is only website icon, there is no one in web map mod. Maybe @kylepaulsen add one someday. Built-in or even custom.

rysson commented 3 years ago

@1fr4m3, like workaround you can change locale (language) on your server or set only integers instead floats (ex. "update_interval": 1).

kylepaulsen commented 3 years ago

Hey thanks @rysson and @1fr4m3 for the investigation. I'll try to get this fix out soon.

1fr4m3 commented 3 years ago

@1fr4m3, like workaround you can change locale (language) on your server or set only integers instead floats (ex. "update_interval": 1).

ye, its worked image

1fr4m3 commented 3 years ago

I also noticed that ping and pins is displayed not where I put it. Screenshot_7 Screenshot_6

Screenshot_4 Screenshot_5 Screenshot_3

after refreshing the page, the pin was removed and a silhouette appeared image

Perhaps this is a problem on my part, I'm not sure, but just in case, I'm reporting everything, if the mod is bug

kylepaulsen commented 3 years ago

@1fr4m3 I just updated the mod to v1.1.1 I'm hoping this version resolves all these issues. Let me know if you are able to try it and it works.

kylepaulsen commented 3 years ago

Oh and you may need to delete BepInEx/plugins/WebMap/map_data/your_map_name/pins.csv

1fr4m3 commented 3 years ago

Everything works, thank you very much!

kylepaulsen commented 3 years ago

👍