Skip to content

Commit 73a3bba

Browse files
committed
Only include downloaded addons in S2C_CONNECTION
1 parent d93771e commit 73a3bba

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/multiaddonmanager.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,18 @@ void FASTCALL Hook_ReplyConnection(INetworkGameServer *server, CServerSideClient
11721172
// Handle the first addon here. The rest should be handled in the SendNetMessage hook.
11731173
if (g_ClientAddons[steamID64].downloadedAddons.Find(clientAddons[0]) == -1)
11741174
g_ClientAddons[steamID64].currentPendingAddon = clientAddons[0];
1175+
1176+
// In some cases, clients can do a signature check on addons which fails and instantly disconnects them
1177+
// As a mitigation, remove all pending addons from S2C_CONNECTION except for the first one
1178+
int iAddonCount = clientAddons.Count();
1179+
1180+
if (!g_ClientAddons[steamID64].currentPendingAddon.empty() && iAddonCount > 1)
1181+
{
1182+
int iNextAddonIndex = clientAddons.Find(g_ClientAddons[steamID64].currentPendingAddon) + 1;
1183+
1184+
if (iNextAddonIndex > 0 && iNextAddonIndex < iAddonCount)
1185+
clientAddons.RemoveMultiple(iNextAddonIndex, iAddonCount - iNextAddonIndex);
1186+
}
11751187

11761188
*addons = VectorToString(clientAddons).c_str();
11771189

0 commit comments

Comments
 (0)