Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate server cache and credentials cache #87

Closed
thmsndk opened this issue Oct 29, 2019 · 21 comments · Fixed by #245
Closed

Separate server cache and credentials cache #87

thmsndk opened this issue Oct 29, 2019 · 21 comments · Fixed by #245
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@thmsndk
Copy link
Owner

thmsndk commented Oct 29, 2019

The serverlist currently consist of a "ServerCache". this cache is persisted to a binary file, containing all servers and credentials for theese servers.

Instead we should have 3 seperate files

  • A file containing all manually added servers
  • A file containing credentials to servers
    • If credentials are supplied by a ServerSourceProvider, theese credentials should not be persisted in this credentials file.
    • It should be possible to persist multiple credentials to the same server.
    • It should be possible to connect without persisting credentials to a file (Save checkbox)
  • A file containing stats for servers
    • This file can contain amount of users, likes, last online, availability
    • last time connected to server.

This way, servers provided by "third party" sources are not cached in anything other that the stats file. Third party sources should be able to supply multiple credentials to a server.
As a simple solution each pair of credentials could cause a new entry in the server list.

Theese files should be versioned in some way, such that older versions can be migrated to newer versions.

@thmsndk thmsndk added the enhancement New feature or request label Oct 29, 2019
@thmsndk thmsndk added this to the 0.0.9 milestone Oct 1, 2020
@thmsndk thmsndk self-assigned this Apr 15, 2021
@thmsndk
Copy link
Owner Author

thmsndk commented Apr 15, 2021

Perhaps we should just embrace the SS3 Unified Credentials file, even for manually added servers?

@thmsndk
Copy link
Owner Author

thmsndk commented Apr 18, 2021

Work in progress, initial dialog for showing potential locations.
image

@AlinaNova21
Copy link

I would just filter it to one extension in the dropdown to make it a bit more user friendly

@thmsndk
Copy link
Owner Author

thmsndk commented Apr 23, 2021

Limited to .yml files
image

We also now persist the official server list in a cached file and restore it in case of the official server list not responding
image

@thmsndk
Copy link
Owner Author

thmsndk commented Apr 23, 2021

Considering I'm messing around with the server browser, are there any enhancements that could be done to it? or anything people feel they are missing?

image

@Gadjung
Copy link

Gadjung commented Apr 23, 2021

could add a check of what state we're on the server, spawned / not spawned ?

@Gadjung
Copy link

Gadjung commented Apr 23, 2021

or quick check how many rooms are owned (not sure if possible / worthwhile)

@Gadjung
Copy link

Gadjung commented Apr 23, 2021

could also provide the (i) icon with server message on hover ;)

@thmsndk
Copy link
Owner Author

thmsndk commented Apr 23, 2021

Good suggestions, they all require additional calls to endpoints though.

could add a check of what state we're on the server, spawned / not spawned ?

Would require an additional call to get world state, but could be doable
image

or quick check how many rooms are owned (not sure if possible / worthwhile)

Would require an additional call to an endpoint

  • https://screeps.com/api/user/rooms?id={id} requires us to supply the userId

  • https://screeps.com/api/user/overview?interval=8&statName=energyHarvested if we want additional data, but that requires us to have authenticated first.

  • /api/user/find?username=thmsn can give us the badge, userId and gcl without being authenticated, but we don't have the username on official

could also provide the (i) icon with server message on hover ;)

We get this with the api/version call, that we already call. the issue is that it is html, so we would need to parse it in a feasible manner to present it. also #157
S+ example:

image

I was also considering looking at the "features" part of api/version, showing what mods are installed if they have added it to the features part.
image

@AlinaNova21
Copy link

For private servers, you can hit /stats to get some info including owned room counts. Can probably lookup the user in that list. Thats added by screepsmod-admin-utils, so you can also detect its availability via the features. (Although most servers already run it)
image

@Gadjung
Copy link

Gadjung commented Apr 24, 2021

also getting and displaying 'shardName' (and not allowing to connect until it's obtained) should prevent some issues after connection

@thmsndk
Copy link
Owner Author

thmsndk commented Apr 24, 2021

also getting and displaying 'shardName' (and not allowing to connect until it's obtained) should prevent some issues after connection

That is part of api/version, and I should have fixed it my issuing a version call when you select the server :)

But I guess we could display shardnames 🤔 at least if there is only 1, not sure what to display on mmo

@Gadjung
Copy link

Gadjung commented Apr 24, 2021

all the shards on mmo ? can also hardcode them since i dont think they'll change

@thmsndk
Copy link
Owner Author

thmsndk commented Apr 24, 2021

New edit server dialog
Official
image
Private
image

@AlinaNova21
Copy link

all the shards on mmo ? can also hardcode them since i dont think they'll change

I wouldn't hardcode them, just pull the shards array from /api/version since mmo does have that too.

@AlinaNova21
Copy link

AlinaNova21 commented Apr 24, 2021

@thmsndk Might want to add protocol to that, just a http and https dropdown should be enough. Or a secure checkbox since thats how UCF does it. I don't like the idea of assuming 443 is always https and others aren't. (I might decide to use 8443 for a testing server or something!)

@thmsndk
Copy link
Owner Author

thmsndk commented Apr 27, 2021

Added a SSL checkbox below port
image

@thmsndk
Copy link
Owner Author

thmsndk commented May 6, 2021

Well... this is looking rather terrible 😆
image
image

@thmsndk
Copy link
Owner Author

thmsndk commented Jun 2, 2021

Calling auth/me to get the badge on the server, this also gives us the username and id
image

@thmsndk
Copy link
Owner Author

thmsndk commented Jun 3, 2021

image

@thmsndk
Copy link
Owner Author

thmsndk commented Jun 10, 2021

image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants