Skip to content

[ALL] Add deletion of downloaded manifest files from Servers - #2025

Open
chocochocotorta wants to merge 2 commits into
ValveSoftware:masterfrom
chocochocotorta:particle-deletion
Open

[ALL] Add deletion of downloaded manifest files from Servers#2025
chocochocotorta wants to merge 2 commits into
ValveSoftware:masterfrom
chocochocotorta:particle-deletion

Conversation

@chocochocotorta

@chocochocotorta chocochocotorta commented Aug 26, 2026

Copy link
Copy Markdown

When connecting to a Community Server, this one can provide downloads of any type (in this case, .pcf files for particles and a txt inside maps that contains a manifest for particles or level sounds in a specific map).
While this is not an issue in custom maps that already packs it's own manifest file inside because it takes priority over the downloaded one, a server could maliciously send lots of particles manifest files for all the base game maps with a pcf that floods the "ParticleEffectNames" string table on precache (making some of the default particles from the base game not being precached and display the default error particle), mute/replace certain sounds, or crash the client when creating a Local Server.

The PR checks for files ending in particles.txt or level_sounds.txt inside download/maps and deletes them on game exit (like tf_delete_temp_files).
Tested both in TF2 & HL2:DM.

@neobenedict

neobenedict commented Aug 26, 2026

Copy link
Copy Markdown

If a malicious server forces download of multiple particle files this will only remove the first?

Better is just to reject "_particles.txt" suffix in the client download check but that's in engine.dll.

@chocochocotorta

chocochocotorta commented Aug 26, 2026

Copy link
Copy Markdown
Author

If a malicious server forces download of multiple particle files this will only remove the first?

In case the server does this, the client will just delete all files containing _particles.txt inside download/maps/.

Better is just to reject "_particles.txt" suffix in the client download check but that's in engine.dll.

That could also work, but i'm not sure how good would be for Valve to add that specific case inside the engine.
I made it this way so that servers could precache particles to the client and to prevent the client issue of having to deal with a server that sends so many particles (i based it the same way as the ConVar tf_delete_temp_files that got added on Scream Fortress XIII, if needed, i could make the logic only remove on Shutdown instead of server join/changelevel or server leave).

@KaelaSavia

Copy link
Copy Markdown

I recommend also doing same for following files:

_level_sounds.txt

For example:

cp_manor_event_level_sounds.txt

As these files can also be abused.

I'm personally against blocking things in engine.dll, as there are legitimate uses for uploading _level_sounds.txt or _particles.txt that is not packed into map. Removing these files just on disconnect would be most flexible in my opinion.

@chocochocotorta

chocochocotorta commented Aug 31, 2026

Copy link
Copy Markdown
Author

Replying to #2025 (comment)

I'll make the PR as draft and implement the same thing for level sounds too, it'll take me a bit of time since I'm outside.

@chocochocotorta
chocochocotorta marked this pull request as draft August 31, 2026 16:42
Added to remove both particles.txt and level_sounds.txt, moved to all games instead of just TF and only purge on game close.
@chocochocotorta
chocochocotorta deleted the particle-deletion branch September 2, 2026 20:51
@chocochocotorta
chocochocotorta restored the particle-deletion branch September 2, 2026 20:52
@chocochocotorta
chocochocotorta marked this pull request as ready for review September 2, 2026 20:53
@chocochocotorta

Copy link
Copy Markdown
Author

Replying to #2025 (comment)

Added to also delete _level_sounds.txt when closing the game (i tried to rename the branch and it accidentally got deleted from the PR).

@chocochocotorta chocochocotorta changed the title [TF2] Add deletion of downloaded Particles Manifest from Servers [ALL] Add deletion of downloaded manifest files from Servers Sep 2, 2026
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