GMDprivateServer
GMDprivateServer copied to clipboard
Scan uploaded levels for ACE
Added a LevelParser class which scans uploads for invalid things. I'd like someone with access to a PoC level to test on a local installation. And also sanity check my late-night code.
Using PHP's SPL gzread()
function you can read the uncompressed data in a loop. Changing the parser, the pickup trigger scan can be done incrementally. However the code uses zlib_decode()
I am still researching the specifics but I was unable to use the gz functions to decompress the level string. Only zlib_decode()
seemed to work. This is only an issue for extremely large levels like Ocular Miracle which result in an out-of-memory error.
Fixed various things. I think this also necessitates a server scan utility for existing levels.
does this support levelstrings compressed with both gzdeflate (H4sIAAA header in b64) and gzcompress (eJ header in b64), as well as uncompressed levelstrings?
does this support levelstrings compressed with both gzdeflate (H4sIAAA header in b64) and gzcompress (eJ header in b64), as well as uncompressed levelstrings?
Yes, zlib_decode() works on both deflate and gzip data. When the level string is uncompressed, the b64 and decompression don't run.
Yes, zlib_decode() works on both deflate and gzip data. When the level string is uncompressed, the b64 and decompression don't run.
Correction, it works as described but I haven't added the magic for deflate so it doesn't run. I'll fix this when I get home.