screeps-steamless-client icon indicating copy to clipboard operation
screeps-steamless-client copied to clipboard

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

Open BippyMiester opened this issue 4 years ago • 16 comments

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

BippyMiester avatar Oct 25 '21 04:10 BippyMiester

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 avatar Oct 25 '21 18:10 bastianh

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 avatar Nov 02 '21 12:11 bastianh

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

bastianh avatar Nov 12 '21 15:11 bastianh

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?

matianyun avatar Nov 22 '21 12:11 matianyun

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 the shard0` 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 avatar Dec 23 '21 11:12 thmsndk

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

thmsndk avatar Dec 23 '21 11:12 thmsndk

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 avatar Dec 23 '21 15:12 bastianh

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

bastianh avatar Dec 23 '21 15:12 bastianh

@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

thmsndk avatar Dec 24 '21 10:12 thmsndk

#5 should fix this

Jomik avatar Feb 20 '22 14:02 Jomik

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

Jomik avatar Mar 22 '22 08:03 Jomik

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?

Elbarae1921 avatar Nov 17 '23 00:11 Elbarae1921

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

laverdet avatar Nov 17 '23 04:11 laverdet