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

Lifecycle part 1 - IUserMod #773

Closed
wants to merge 2 commits into from
Closed

Conversation

originalfoo
Copy link
Member

Relates to #767 :

Small first step splitting some stuff out of the IUserMod to get feedback as to whether the general approach is heading in right direction.

The IUserMod (TrafficManagerMod.cs) class is still responsible for the messy wiring and state management. It calls "lifecycle events" in the Lifecycle.cs class, which in turn call methods located elsewhere.

The logging is overly verbose and would be trimmed down once stuff gets moved to docs somewhere.

The goal is that we should be able to see at a glance, in the Lifecycle.cs what the mod is doing at the various stages, without having to wade through vast reems of boilerplate and other code. With the comments removed, it looks like this: #767 (comment)

I've dumped some of the code from TrafficManagerMod.cs in to a Temp.cs which will become obsolete once #699 is done.

Next step would be to do similar for LoadingExtension.cs - move the meaty bits in to a separate class, and then use the loading extension to trigger a bunch of additional "lifecycle events" in the Lifecycle.cs which in turn will just call methods elswhere.

Let me know what you think :)

Small first step splitting some stuff out of the IUserMod to get feedback as to whether the general approach is heading in right direction.
@originalfoo originalfoo added technical Tasks that need to be performed in order to improve quality and maintainability code cleanup Refactor code, remove old code, improve maintainability labels Mar 3, 2020
@originalfoo originalfoo requested a review from a team March 3, 2020 03:21
@originalfoo originalfoo self-assigned this Mar 3, 2020
Copy link
Collaborator

@kvakvs kvakvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice
How's Lifecycle going to handle unload/reload, being a singleton?

@originalfoo
Copy link
Member Author

How's Lifecycle going to handle unload/reload, being a singleton?

Are you referring to the stuff that's in LoadingExtension.cs? If so, I currently have no idea whatsoever.

@originalfoo originalfoo modified the milestone: 11.2 Mar 3, 2020
originalfoo added a commit that referenced this pull request Mar 3, 2020
Not updated the `LoadingExtension` because PRs #773 and #699 will be changing it.
@originalfoo
Copy link
Member Author

Closing this as the loading extension was massively cleaned during migration to Harmony 2.x #866

@originalfoo originalfoo added the obsolete Superseded by another issue label May 25, 2020
@kianzarrin
Copy link
Collaborator

Closing this as the loading extension was massively cleaned during migration to Harmony 2.x #866

Only the harmony/detour stuff.

@originalfoo originalfoo added this to the Abandoned milestone Jan 18, 2022
@originalfoo originalfoo deleted the lifecycle-part1-iusermod branch February 14, 2022 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Refactor code, remove old code, improve maintainability obsolete Superseded by another issue technical Tasks that need to be performed in order to improve quality and maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants