Commit 0605614
committed
fix #3057: route AlreadyExists uploads to /content/maps/ not /content/games/
Re-uploading an existing map dropped the file into /content/games/, so
BuildLinks (which probes /content/maps/) never saw it and LinkCount stayed
0 — the "WILL NOT BE DOWNLOADABLE" the ticket describes.
Root cause: `res.ResourceInfo is Map` was the subfolder discriminator.
On the AlreadyExists path UnitSyncer skips GetResourceFromFileName and
returns the plain ResourceInfo from ArchiveCache (ArchiveCache.cs:36
constructs them as `new ResourceInfo() { ... }`, not Map), so the check
is silently false. Only the brand-new-registration path produced a Map
instance, so only new-map uploads ever worked.
Verified empirically against live zero-k.info — all 5 maps from the
ticket are sitting at /content/games/{name}.sd7 (200 OK) instead of
/content/maps/. Other casualties found via the same scan:
Hide_and_Seek_2.2.3, Coastlines_Dry_V2.2, Supreme_Crossing_V1.
Fix: derive `isMap` from `resource.TypeID == ResourceType.Map` (DB is
the source of truth; we're already loading `resource` in this scope).
Keep `is Map` as the fallback for the very first registration of a new
map where the DB row doesn't exist yet at the point of subfolder choice.
Stranded files at /content/games/ are left in place — a re-upload after
deploy puts them at the correct path. Cleanup of orphans deferred.1 parent 2079fa4 commit 0605614
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | 455 | | |
460 | 456 | | |
461 | 457 | | |
462 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
463 | 470 | | |
464 | 471 | | |
465 | 472 | | |
| |||
0 commit comments