Skip to content

[DNM]feat: Supports multiple workshop addons - #100

Draft
2vg wants to merge 13 commits into
Kxnrl:masterfrom
2vg:epic
Draft

[DNM]feat: Supports multiple workshop addons#100
2vg wants to merge 13 commits into
Kxnrl:masterfrom
2vg:epic

Conversation

@2vg

@2vg 2vg commented May 5, 2026

Copy link
Copy Markdown
Contributor

Implemented functionality equivalent to MAM in MS.
The implementation is based on s2ze's MAM, thanks!: Source2ze/MultiAddonManager
Need to actually test it to make sure there are no problems, also the code will need some adjustments, so this is just a draft for now.

* feat: wip

* fix: fix typo

* feat: rework

* feat: impl all

* fix: fix type

* fix: va

* fix: cmdline

* fix: add OnSteamApiActivated

* fix: fixed

* feat: removed debuglog

* fix: fix??

* fix: fixed missing CUtlString constructor (Kxnrl#99)

* feat: refactor

* fix: fix import

* fix: fixed add_client_addon

* chore: remove unnecessary comments

* fix: fixed import

* chore: add Acknowledgements

* chore: add initial ver doc

@Nukoooo Nukoooo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i might leave more reviews later but this is what i can think of for now

"linux": 56,
"windows": 56
},
// str "Sending S2C_CONNECTION to %s [addons:'%s']\n" 中的 addons 字段

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can be replaced with sv->GetAddonName()

return ReplyConnection(pServer, pClient);

static auto addonsOffset = g_pGameData->GetOffset("CNetworkGameServer::m_Addons");
auto pServerAddons = reinterpret_cast<CUtlString*>(reinterpret_cast<uintptr_t>(pServer) + addonsOffset);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

use sv->GetAddonName()


BeginStaticHookScope(HostStateRequest)
{
DeclareStaticDetourHook(HostStateRequest, void, (void* a1, CHostStateRequest* pRequest))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the code is duplicated, i think exporting a callback from DualAddon is better


BeginMemberHookScope(INetChannel)
{
DeclareMemberDetourHook(SendNetMessage, bool, (INetChannel * pNetChannel, CNetMessagePB<CNETMsg_SignonState> * pData, int a4))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the code is duplicated, i think exporting a callback from DualAddon is better

Comment thread Sharp.Core/SharpCore.cs Outdated

#endregion

#region Extra Addon

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

would be better to move to a service/manager

Comment thread Sharp.Shared/IModSharp.cs Outdated

#endregion

#region Extra Addon

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

would be better to move to a service/manager

@2vg

2vg commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

i tested the sv running for several hours with multiple addons enabled, and there were absolutely no noticeable issues or server crashes
i will resume the review process after testing a few C# APIs

@Prefix

Prefix commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

quite useful if you want radio panel per server basis, beside shared assets

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.

3 participants