laverdet / screeps-steamless-client

56 stars 19 forks source link

Localhost Web Server on 8080 loads fine, but map and rooms are blank screens #2

Open BippyMiester opened 2 years ago

BippyMiester commented 2 years ago

The web server boots up nicely, and I'm able to access the world map for my specific server on 10.0.0.2:21025. However the world map only works if you use the new alpha version, and even then it doesn't show any of the current creeps (green dots) in my room. Then I click on my room and I'm met with a blank screen.

See attached screenshots for reference.

https://prnt.sc/1x9t6r8 https://prnt.sc/1x9t7ne https://prnt.sc/1x9t856

bastianh commented 2 years ago

I think this project has some issues when using a private server... it works fine with the live version of the game and with the xxscreeps server

bastianh commented 2 years ago

the problem is the steam client is adding a shard to the url when it shouldn't ... but I don't know how that is configured :(

bastianh commented 2 years ago

I think I found the problem .. the private server sends in /api/version : ... "serverData":{"shards":[null], ... which is evaluated in official: ${Boolean(version?.serverData?.shards)}, as true

tianyma commented 2 years ago

I think I found the problem .. the private server sends in /api/version : ... "serverData":{"shards":[null], ... which is evaluated in official: ${Boolean(version?.serverData?.shards)}, as true

I met the same problem, could you tell me how to fix that?

thmsndk commented 2 years ago

I am getting blank screens as well, the issue seems to be that it tries to load assets from http://localhost:21025/assets/map/shard0/W11N6.png?but the assets are not served fromshard0, they are served from http://localhost:21025/assets/map/W11N6.png? without theshard0` part,

I might be running into this issue due to me using the mod admin utils, but most people use this. I guess admin utils could be updated to also serve the assests on the url with the shardname?

thmsndk commented 2 years ago

Due note that the alpha map works, I assume this is because the new alpha map renders the terrain, instead of fetching it from png files http://localhost:8080/(http://localhost:21025)/#!/map2/shard0?pos=-3.71,-6&scale=58.7

I have not been able to find the place where the map/shard0/W11N6.png? is tacked on yet. so I am unable to replace it properly in index.ts

When loading the room itself I am not sure what causes issues, but it seems. the only request that fails is the one fetching decorations, failing with 404 http://localhost:8080/(http://localhost:21025)/api/game/room-decorations?room=W5N8&shard=shard0

bastianh commented 2 years ago

As I Said the issue is that the problem is that the official flag has to be set correctly.

On official server and for xxscreeps true and false for the normal private server.

It will then use the correct path for the png

bastianh commented 2 years ago

The script is cached so fixing the flag might not work without a full reload

thmsndk commented 2 years ago

@bastianh And here I thought I had refreshed the cache, you are right, as long as you change the following to return false https://github.com/laverdet/screeps-steamless-client/blob/9296d5b177e4c0806fb2c14defdb6c603ce6d285/src/index.ts#L202

and remember to refresh the cache in your browser after changing it then it loads fine :) image

Jomik commented 2 years ago

5 should fix this

Jomik commented 2 years ago

This should be closed. Unless you are waiting for a release 😄

Elbarae1921 commented 11 months ago

Are there any particular changes to be made on the server? I'm still experiencing this same issue

Screenshot 2023-11-17 at 01 46 09

in my case this is what serverData.shards looks like

Screenshot 2023-11-17 at 01 48 20

or is the fix simply not released yet?

laverdet commented 11 months ago

In your particular case I would recommend not naming your shard with any non a-z0-9 characters.

Olfi01 commented 3 weeks ago

I am having the same issue with the latest version, shards is [ null ] as with OP

Olfi01 commented 3 weeks ago

I just figured out that in my case the problem is an SSL error connecting to the server's 21025 port, presumably because the server can't serve on HTTPS since it doesn't have a valid certificate (the website itself is running behind a reverse proxy)

So in conclusion, it's a problem with my networking setup, not with this software.

laverdet commented 3 weeks ago

Just remove the s from https? I don't get the problem.