Skip to content

Allow multiple addons#113

Merged
Extremelyd1 merged 5 commits intoExtremelyd1:masterfrom
dplochcoder:addons
Sep 17, 2025
Merged

Allow multiple addons#113
Extremelyd1 merged 5 commits intoExtremelyd1:masterfrom
dplochcoder:addons

Conversation

@dplochcoder
Copy link
Contributor

Making a separate PR for this. This changes the addon loader to allow multiple addons from singular linked assemblies.

There was a comment saying this was intentionally prevented, but I was not able to discern the reason neither locally nor from commit history. Multiple addons from the same assembly appears to work fine for ingame servers, so I'd like to lift this requirement for dedicated servers as well if possible.

@Extremelyd1
Copy link
Owner

The reason that I only allow loading one addon from a single assembly is that I don't see why you would want to have multiple addons in a single assembly. You can use addon packet IDs to send different kinds of data from client addon to server addon and vice versa.
Having multiple addons in a single assembly allows consumers of the API to mistakenly branch out with different addon classes instead of branching out with packet IDs.

What is the reason that you are wanting to have multiple addons in a single assembly. Of course, if you can justify this, I'd be happy to lift the restriction.

Copy link
Owner

@Extremelyd1 Extremelyd1 left a comment

Choose a reason for hiding this comment

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

Apart from my comment asking for reasoning for the PR, the changes seem to contain another PR as well, namely #112.

@dplochcoder
Copy link
Contributor Author

What is the reason that you are wanting to have multiple addons in a single assembly?

There are structural reasons one might want different addons in the same assembly; in my case, I'm modifying TheHuntIsOn to add server-pause functionality as its own module. For this functionality to be in the same addon as the EventNetwork module would require tightly-coupling unrelated code, and adding a bunch of conditional handling for pause-related messages on an instance that doesn't support pausing. It was much cleaner to structure the code as two addons rather than one addon with a bunch of conditionals. I was also surprised to learn that multiple addons works fine with a local server but not a dedicated one.

@Extremelyd1 Extremelyd1 added the safe to build It is safe to run the workflow for this PR label Sep 17, 2025
@github-actions github-actions bot removed the safe to build It is safe to run the workflow for this PR label Sep 17, 2025
@Extremelyd1 Extremelyd1 merged commit 0b1b7a7 into Extremelyd1:master Sep 17, 2025
1 check failed
@Extremelyd1
Copy link
Owner

I've added the IPauseManager interface and moved the time scale event to PauseManager. I've agreed with lifting the restriction of multiple addons.

@dplochcoder
Copy link
Contributor Author

Any ETA on when this will be released? Would like to close out Korzer420/TheHuntIsOn#10 too which depends on these changes

@Extremelyd1
Copy link
Owner

It has been released now @dplochcoder, sorry for the delay.

HKMP release v2.4.3

@dplochcoder
Copy link
Contributor Author

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants