Repository navigation
Feature/http routes - #36
Merged
Merged
Conversation
GET /api/game/routes lists every route of the game server, read from the Express app when asked: method, path, path parameters, whether the engine, the game or a plugin registered it, and whether it only exists in development. Plugins are told apart by wrapping their setup and http hooks. Routes say what they do with describeRoute(), which is optional; the engine's own routes are described. The CLI dashboard gets a Routes tab and the editor a Server tab in the bottom dock, both showing that list as a table.
The activity bar now switches between the scene editor and the server's endpoint list, which takes the whole area next to the bar instead of a tab in the bottom dock. It is laid over the editor, so the viewport and the docks keep their state. The placeholder icons that did nothing are gone.
The activity bar gets a third entry that lists the plugins in the project's mavonengine.json: version, target, description, license, supported engine range and readme, plus the HTTP endpoints and prefabs that come from each one. Plugins that are missing or invalid are listed with the reason. The details come from a new dev server endpoint, GET /__mavonengine/plugins, which reads the config and the packages from disk on every request. Endpoints come from the game server's route list and prefabs from the editor's registry. Readmes are rendered by a small Markdown renderer that builds React elements, drops HTML and loads no images.
GET /api/game/plugins lists the plugins of the server's project: every plugin in mavonengine.json with its version, target and prefabs, plus plugins passed to the server directly, and whether each one's server entry is running. Readmes are left out; the dev server still sends them to the editor. The dashboard fetches the list together with the routes and shows it on a sixth tab: a table of the plugins, and for the selected one its details, prefabs and the HTTP endpoints it registered.
…d and editor plugins.json at the repository root lists the plugins anyone can install, starting with @mavonengine/http-monitoring. It is read from the main branch on GitHub whenever it is asked for: - `mavonengine plugins` prints it, marking what the project has - the dashboard's Plugins tab and the editor's Plugins view show the plugins the project doesn't have yet - the editor shows an available plugin's readme, fetched from the `readme` URL the list gives for it Under `mavonengine dev` those plugins, and from the editor any other package, can be installed without leaving the tool. `mavonengine dev` runs the install, adds plugins to mavonengine.json and restarts the dev script. The editor reaches it through the Vite dev server, which takes install requests only from localhost and from the game's own page, and refuses anything a shell could read as more than a package. Both ask first: installing a package runs its code on the machine, so the dialog says so, links to the source and wants a confirmation that it was checked.
The name follows the connection in a message of its own. The test read the server's players once, right after the browser said it was connected, and failed when the server had the player but not yet its name. It now asks again until the name is there, and says which names it got when it isn't.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.