feat: Block & Chunk API v2 & World region file - #35
Conversation
tobezdev
left a comment
There was a problem hiding this comment.
Code LGTM.
Gonna request changes on the tests_on_pr.yaml workflow because it is returning early with error code 126.
|
Ping me in staff-chat when this runs successfully and I'll approve it :D |
Yep, just setting it up at the moment thus why it fails |
tobezdev
left a comment
There was a problem hiding this comment.
Let's get an F in the chat for lines 65-80 on tests/net/sock.cpp - gg.
Nice work on fixing the workflow tho lol
That's because the codebase is cursed 😭😭 like either the linux kernel documentation is wrong or that gtest is doing something sneaky with the socket functions |

Apologies in advance if this pr is too big or has a part already in master but Git fucked up for me
These changes bring something very important! World Saving and also Stability! The removal of complex blocks for a new system brings more stability, increased peformance, lower file sizes and ram usage
A region file can currently be at minimum 65 kilobytes for
64stored chunks inside!Breaking changes
🪐 - The Cavernfall world version is now 0x00
💡 - World saving is now enabled
Critical fixes
world_savefile_manager::load_chunkdue to a missing return statement (severity: HIGH, would cause crashes no matter what)World::load_chunk(severity: HIGH, would cause chunks that could be loaded trough region files to not be registered inside of the world chunks and thus be leaked and not deletedFixes
NetworkBuff::can_readreturning false if ind + read size == sizeNetworkBuff::can_writereturning false if ind + write size == sizeNetworkBuff::read_bytereturning false instead of 0 when cannot readBehavioral changes
World::load_chunkandWorld::unload_chunkuse the new chunk region filesAPI changes
has_dataandget_datafunctionsChunk::remove_dataregionfile_header_tcavernfall::world::world_savefile_managerto manage region filescavernfall::world::world_savefileto represent a region save fileregion_file_data_entryto represent block data entries within chunksregion_file_chunkto contain region file chunksCodebase changes
cavernfall::fs::file_handle, a safe way to handle c++ files and allows for both writing and reading on the same pointer with automatic state switchingNetworkBuffinside of its own headerutils/num.hppTest changes
AllocatedAndStaticParitynetwork buffer test not being able to pass no matter what