|
let game_id = format!("{epoch}-{player_slugs}-{safe_map}"); |
|
let filename = format!("{game_id}.json"); |
Windows file paths max out at 260 characters, including the drive path C:\ and null terminator at the end. A 4 on 4 or larger could easily blow past this limit as is. I think a simple length check and stripping out characters (before the .json) would probably be the minimum fix, though that's not ideal. Other options are trying to form a slug again without the player races or dynamically checking if the user has enabled extended path support. We could also save some characters by using the race shorthand HU/OR/UD/NE instead of the full name in the slugs and using a colon instead of parenthesis e.g.
1746300000-Foo(Human)-Bar(Undead)-LostTemple.json
becomes
1746300000-Foo:HU-Bar:UD-LostTemple.json
Admittedly not pretty, but might be worth it if end users aren't expected to work with these files manually.
magic-sentry/cli/src/main.rs
Lines 269 to 270 in 10525b8
Windows file paths max out at 260 characters, including the drive path
C:\and null terminator at the end. A 4 on 4 or larger could easily blow past this limit as is. I think a simple length check and stripping out characters (before the .json) would probably be the minimum fix, though that's not ideal. Other options are trying to form a slug again without the player races or dynamically checking if the user has enabled extended path support. We could also save some characters by using the race shorthand HU/OR/UD/NE instead of the full name in the slugs and using a colon instead of parenthesis e.g.Admittedly not pretty, but might be worth it if end users aren't expected to work with these files manually.