Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Original configs are not supported without modifications #2

Closed
oleg35hp opened this issue Nov 27, 2022 · 1 comment
Closed

Original configs are not supported without modifications #2

oleg35hp opened this issue Nov 27, 2022 · 1 comment

Comments

@oleg35hp
Copy link

[stripper.smx] Section declared without header on line 109, col 1 of addons/sourcemod/configs/stripper/global_filters.cfg

taken from https://www.bailopan.net/stripper/

filter:
{
"prop1" "val1"
}
{
"prop3" "val3"
}

@tilgep
Copy link
Owner

tilgep commented Nov 27, 2022

This is an error from the SMCParser, there is no easy way for me to fix this as sections are required to have a header when parsing a file using one.

I would argue that its not great that the original stripper allows this as it can be ambiguous what the block is doing if you aren't aware that it defaults to filter and carries the previous mode over to the next block if undefined, which can make the config harder to read. I understand its not ideal that its not fully backwards compatible, but for 99% of configs this shouldn't be a problem and it can be easily fixed.

I'm not going to fix this in the plugin, you can make the blocks without headers filter: to have the same functionality.
For other configs, you must set the header to the last defined header, or filter if there is no defined header above.

Using your example, the fixed version would be:

filter:
{
"prop1" "val1"
}
filter:
{
"prop3" "val3"
}

@tilgep tilgep closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2022
ecsr added a commit to ecsr/stripper-source-configs that referenced this issue Dec 11, 2022
SMCParser requires section headers when parsing a config, see tilgep/stripper#2 for more info.
ecsr added a commit to ecsr/stripper-source-configs that referenced this issue Dec 11, 2022
SMCParser requires section headers when parsing a config, see tilgep/stripper#2 for more info.
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

No branches or pull requests

2 participants