bravoserver / bravo

UNMAINTAINED: Reverse-engineered Minecraft stuff. Worked with 1.4.x protocol
http://bravoserver.org/
Other
206 stars 45 forks source link

Seasons don't affect the permanent cache #366

Closed MostAwesomeDude closed 11 years ago

MostAwesomeDude commented 13 years ago

Both the coolest and lamest bug around. Let's fix this.

justinnoah commented 11 years ago

bug/388 related?

MostAwesomeDude commented 11 years ago

388 is a little related.

There's a couple things we can do here. One way to do this would be to just change the current changing of the season so that it affects all caches. This would be easy, but might not be robust in the face of races.

Something that I want to do, because the current chunk cache in World is already racy, is to factor out chunk caching entirely into a new object, and then make that object robust. This would require figuring out a less racy way of evicting clean chunks from memory and dirty chunks to disk without compromising safety, and we might have to move away from our current hacky weakref-based eviction.

I want to consider that, while this is all happening, we might want to introduce more aggressive caching schemes, such as using inigos to track recently-used chunks. If we do this, then it'll require some kind of refactored cache anyway.