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

ILaunchPluginService: preLaunch callback? #35

Closed
Mumfrey opened this issue Sep 25, 2019 · 2 comments
Closed

ILaunchPluginService: preLaunch callback? #35

Mumfrey opened this issue Sep 25, 2019 · 2 comments

Comments

@Mumfrey
Copy link

Mumfrey commented Sep 25, 2019

Preamble

It's taken me a long time to get the new Mixin version to a point where I'm happy with it, mostly due to personal commitments, so I'd like to apologise for the radio silence from my end. The approach I have taken while developing Mixin for ModLauncher is to work around things as they are, since I felt that until I was happy with the engineering of the solution that asking for changes to ModLauncher was frivolous. I wanted to make sure I was asking for the right things.

To this end, I've wrapped the work-arounds and reflection-based shims into a single class which I've named Internals. This issue pertains to one of the duties offloaded to Internals, identifying the moment immediately prior to startup.

The Issue

As you may recall, Mixin processing happens in phases in order that Mixins can be loaded, conformed to the current environment, and are then ready for application during the unfolding of the lifecycle phase.

With the current design, Mixin begins the only phase (DEFAULT) as the game starts. Mixins which were previously obtained by the platform agents - eg. from FML mod containers, classpath entries, or the command line - are then selected into the environment ready for application.

Currently the only way I have discovered to detect this event is via the rather crufty method of log watching, and simply hunting for the "Launching Target" message that ML emits prior to start.

This isn't the most elegant solution in the world, so it would be helpful if either ILaunchPluginService or ITransformationService could be notified immediately prior to the call to launch service launch with some kind of preLaunch callback.

Would this be possible? I can think of reasons it might not be desirable to put it into ITransformationService but if it could be added to ILaunchPluginService that would allow me to nuke this particular hack.


As a side note, obviously Internals contains some other cruft, but rather than make a "kitchen sink" issue I figured it was more appropriate to list these as separate issues for your consideration.

@cpw
Copy link
Member

cpw commented Sep 25, 2019

I can definitely arrange a call to launch plugins notifying about impending launch. Not sure what context you'd want here though that you don't already get earlier?

@Mumfrey
Copy link
Author

Mumfrey commented Sep 26, 2019

No additional context is required, it's purely a notification that "all the pregame stuff has ended, switch to application". As discussed I will flesh out the Mixin service extension object to receive the mod containers from FML so that the container discovery can be made more robust.

Under LaunchWrapper this point used to be detected via the call to getLaunchArguments but under ML there is no direct indication that all the pre-launch has completed and to proceed to the next phase.

@cpw cpw closed this as completed in ca3b447 Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants