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

Read bot names from text/separate file #245

Open
bgstack15 opened this issue Jan 5, 2024 · 3 comments
Open

Read bot names from text/separate file #245

bgstack15 opened this issue Jan 5, 2024 · 3 comments
Labels
feature Additional functionality that might require some significant work

Comments

@bgstack15
Copy link
Contributor

Would you please consider storing the BOT_NAMES variable in a separate file that can be mounted into the docker container, so I can populate the BOT_NAMES with my own list more easily? They are currently stored with other logic in sw-ui/src/jsMain/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt

@joffrey-bion
Copy link
Owner

Interesting proposal. I guess that would be possible if I moved this constant out of the UI (because at the moment it's part of the generated JS, and JavaScript cannot read files because it's in the browser).

At the moment the server is flexible and asks for the bot name in API calls, just like a regular player name. Putting a list of names in the UI was a very quick and easy implementation but technically the server could provide the names as a default if no name is provided when making the call. This way the list could be a replaceable resource file.

@bgstack15
Copy link
Contributor Author

So I couldn't even just replace this one file in the docker container and get immediate updates, because it's compiled/generated/something, as it is presently implemented?

@joffrey-bion
Copy link
Owner

joffrey-bion commented Jan 5, 2024

At the moment, the whole UI is compiled to JavaScript (from Kotlin), and currently the tooling can only create one big JS file (sw-ui.js) with all the JS code, so you don't have the granularity of the original Kotlin sources.

This JS file is served by the server as a resource, so it is packaged in the jar at BOOT-INF/classes/static/sw-ui.js. So technically you could already modify this file by looking for the list and replacing the names (or adding names), but that's a bit tedious for you. It would be nicer if I made a change so the names are easier to override.

@joffrey-bion joffrey-bion added the feature Additional functionality that might require some significant work label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Additional functionality that might require some significant work
Projects
None yet
Development

No branches or pull requests

2 participants