ScottyGEE wrote:Although I know I wouldn't be allowed to see serenity's fine sourcecode, you describing it as a beast makes me want to see it for the mind boggling that would follow :P
And 2 hours for a simple number change? Am I correct when I assume the The Forgotten Room didnt work because it had over 40mb (thus the 4) and you needed to change it to 5? Or is it something much bigger...
Hmm, you don't have to answer actually because I probably wouldn''t be able to comprehend the answer ;P
Basically Serenity stores things in 2^24 byte chunks at a time...And I had a line calculating how big of a chunk I could write, subtracting 4 bytes for the header, not taking into account the 0 value, since 0xFFFFFF is actually (2^24) - 1...So it was wrapping around, creating a size of 00000, and screwing up the rest of the header with wrap around...(Carrying the one as the cliche goes)...So when applying, the header would be screwed up, and it would skip the command packet, ignoring that 2^24 bytes of data...Because of where the error was in my code, it only effected you if you used up the first 2^24 byte chunk in changes/additions, then had a second addition chunk of 2^24 bytes...
To find this I had to create a patch, figure out what was missing when applying, create an uncompressed patch to see if it was the applier not applying it, or the creator not adding it, then try to narrow down why the applier wasn't applying it...Which happened to be an issue with the creator...Serenity's pretty efficient, so the code tends to be somewhat convoluted...Especially when you don't look at it for months on end...