-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Context on the current state
Currently, the CostCalculator mod (or more precisely ModUtils) has pre- and post-inject functions around the function Eco.WebServer.Web.Startup.SetupStaticFile(IApplicationBuilder, PhysicalFileProvider) function, in order to add additional entries to the appBuilder. Depending on the order in which a new StaticFileOptions object is added to the appBuilder, it will take precedence or get overridden by other files on the same path (Those added first take precedence).
Describe the solution you'd like
Allow modifying or overriding the Eco.Webserver.Web.Startup class before it is used by Eco.WebServer.Webserver.StartWebApp. This way, mods could modify or override the paths that the webserver provides, allowing modifications and additions to the webpage without having to use harmony.
Describe alternatives you've considered
Another solution would be to add a way to register additional directories in the Mods folder to act as another path which the webserver would use. This would allow for modders to include html, js, etc. files with their mods that would be accessible through the website. However, this alternative would lack the ability to modify existing files and thus would be incapable of changing any features already provided by the base game, in addition to requiring modifications to the current vue.js implementations to allow adding new sidebar buttons for these additional sites.
What you would caution against
I would caution against adding modding support to the WebClient directory directly akin to how it works in the Mods directly. This is because this approach would involve server owners to have to split downloaded mods into two separate directories when adding website mods or require the EcoServer to add logic to do it for them.
This would complicate modding for both modders, as they would need to make sure to structure their mods in some particular way; as well as end users as they would need to understand to use the EcoServer to download mods vs mod.io, or have to understand which mod-provided directories go where.
In contrast, it is currently fairly easy to make single dll or single directory mods that the server owner can simply place in the Mods directory.