[DRAFT]: Maxima Server #23
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the start of a major refactor of Maxima. The high-level purpose is to allow for multiple frontends to co-exist, so you can, for example, run the TUI and the UI at the same time, and their states will be synced. If you start a game through the TUI, and the UI is open, the UI should display that. This also fixes the dilemma of "if you launch a game through a third-party, which frontend is opened?"
This is being achieved by moving all of Maxima's logic into a separate server process, and turning
maxima_libinto a very thin client. The library will start (and download, if necessary) the server. Ideally we would embed the server binary in the library on build, but I don't think crates.io allows for that. The server will shut down if no clients are connected to it for a TBD amount of time. On Windows the server will live inside the win service, which will fix the issue of not having access to Program Files when downloading games.To start with, I've moved everything into a new
cratesfolder, and renamed the crates to usesnake_caseinstead ofkebab-case.maxima-libhas been entirely moved into the newmaxima_servercrate, andmaxima_protohas been created.Proto is the glue between the library and server. It contains the low-level RPC system, as well as the types that pass between the lib/server. It's almost feature-complete, except for server->client notification support. The RPCs are broken up into "components", which are declared like so:
maxima_libis now empty, but will be a higher-level abstraction of the proto requests/notifications, as well as server bootstrapping.The decoupling of Maxima's logic from the way you interface with it will also allow us to rethink a lot of questionable design decisions which stemmed from a need for a concise API.