laverdet / screeps-steamless-client

56 stars 19 forks source link

fix: private server compatibility #14

Closed admon84 closed 1 year ago

admon84 commented 1 year ago

Changes

This fixes the world and room views when connected to private servers that have a shard name set via screepsmod-admin-utils.

world map before after
world_before world_after
room view before after
room_before room_after
laverdet commented 1 year ago

Do private servers send shard information now?

The client has a bunch of functionality blocked behind the official flag. When using the steamless client against xxscreeps we want that behavior to come through since xxscreeps is closer to the official world server than classic private servers. In xxscreeps I can't actually send official because then the real Steam client tries to access map assets through the hardcoded CDN URL. That's what all this rewriting logic is about.

I'm sending an "official-like" feature flag from xxscreeps. Maybe you could detect this, instead of the hostname: https://github.com/laverdet/xxscreeps/blob/52e4cb07b5aad57da1a1654ffec17e47f1aa493b/src/backend/endpoints/version.ts

admon84 commented 1 year ago

Thanks for the feedback. I get shard information back on my private server. I think it comes from using the screepsmod-admin-utils plugin though (which lets you specify the shard name in config)

shard

I'll spend some time getting familiar with xxscreeps and work on adjusting the changes based on your suggestion.

admon84 commented 1 year ago

The updates are ready for review. Let me know if that's along the same lines as what you had in mind.

I tested private servers running with xxscreeps and screeps-launcher and the official server, all seems to be working as expected for me.

laverdet commented 1 year ago

Cool thanks!