[DNM]feat: Supports multiple workshop addons - #100
Conversation
* 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
left a comment
There was a problem hiding this comment.
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 字段 |
There was a problem hiding this comment.
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); |
|
|
||
| BeginStaticHookScope(HostStateRequest) | ||
| { | ||
| DeclareStaticDetourHook(HostStateRequest, void, (void* a1, CHostStateRequest* pRequest)) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
the code is duplicated, i think exporting a callback from DualAddon is better
|
|
||
| #endregion | ||
|
|
||
| #region Extra Addon |
There was a problem hiding this comment.
would be better to move to a service/manager
|
|
||
| #endregion | ||
|
|
||
| #region Extra Addon |
There was a problem hiding this comment.
would be better to move to a service/manager
|
i tested the sv running for several hours with multiple addons enabled, and there were absolutely no noticeable issues or server crashes |
|
quite useful if you want radio panel per server basis, beside shared assets |
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.