* Batch block updates
* Apply review change requests
* Allow blockUpdate to carry multiple block updates in single message
* Read until there is nothing left
* Use mesh_storage.BlockUpdate
* Break instead of boolean
* Restore client side neighbor updates
* Move side check in blockUpdate out of the loop
* Update src/utils.zig
* Fix minor issues
* Reverse ownership logic + change contains into liesInChunk
* Update liesInChunk
* No name for upadeBlock param
* Apply review change requests
* Fix formatting
* Restore onBreakClient where it should be
* Update src/renderer/chunk_meshing.zig
* Update src/renderer/chunk_meshing.zig
* Converge formatting with master
* fix formatting (https://github.com/ziglang/zig-spec/issues/38 is so stupid)
---------
Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
* Create the foundations of the new network system.
* Fix memory leak
* Implement a simple additive-increase-multiplicative-decrease congestion control scheme.
Also fixed the locking with the send path
* Fix edge case for mismatch in read and available position
* fix formatting
* Reimplemtent network statistics of the F6 menu
* Fix problem the F6 window size
* Rename size to capacity
* Implement the advanced network debug menu
* Fix a few problems
* Actually call the handlePacketLoss function
* Reduce startup delay and fix possible problems with negative RTTs
* Fix crash in block of partially received packets.
* Use a PriorityQueue for unconfirmed packets.
Also fixed a display issue in the advanced network menu
* Always send confirmations and change how packet loss is handled to avoid killing the network connection by only resending packets outside the receive buffer.
* Use the length instead of the endIndex in the CircularBufferQueue
this just made everything more difficult to work with.
* Optimize CircularBufferQueue.enqueueSlice with memcpy
* Fix problem with zero-length packets, which is a valid use case
* Fix a small edge case
* fix formatting
* Add missing code to increase the capacity in enqueueSlice
* Don't send more data than the receive buffer can fit.
* Use a better data structures that handles the received ranges
* Use memcpy in more circular buffer functions
* Send a keepalive if the connection hasn't been established but the player was invited by the server
* Implement disconnecting for the new protocol
* Reimplement timeout
* Only add new connections when the other side actually sent an init packet.
otherwise the connections stay in the queue, and need keepalives.
also moved the code from the invite window to network.zig, where it belongs
* Don't allow queueing more than 2 GiB of data (i32 limit)
* Reimplement and simplify reconnection
* Use member functions for Socket
* React to packets using a scheme similar to TCP
TCP will send a fast retransmit on first loss discovered by DACKs, shortly after starting the RTO timer.
In essence this means that only second loss of the smallest packets is handled by congestion control.
* Increase scaling after congestion control halves bandwidth.
Now it increases it by at least 1%, isntead of only by the MTU
* Use start and len instead of start and end for the RangeBuffer
* Use ListUnmanaged in RangeBuffer
* Rename flawedReceive to tryReceive
* Add a `ms` constant to make it easier to see what units some of the constants use.
Also added a function alias for microTimestamp to make it potentially easier to change to other timestamps in the future.
I also bumped model index size to 32 bits (storage is currently limited to 20 bits though)
We can afford this, since it's CPU side and it's only stored perblock type.
* Format all the files
* Fix compilation error.
* The install scripts now patch render.zig from the zig standard library.
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update the formatter, it doesn't need to run on .zig files anymore.
* Update ci.yml
* Update ci.yml
* Add a mistake to check if it works
* IT WORKS!
Previously there was a (mostly invisible) layer of sunlight being emitted around every block.
fixes#880 and should also make light propagation on placing blocks faster.
Syntactically this seems to be a pretty neutral change, some expression get longer, other get shorter.
But I guess it increases type safety and I could also replace some of the more magic operations, like `neighbor ^ 1` with a named function.
fixes#602
Full faces of non-cube models now block light and occlude neighbor faces, whereas the others will let light through.
This does make light propapagation significantly (~40%) slower though due to the extra logic involved.
Closes#295
This allows using the StackAllocator for more data structures and library functions.
Fixes#268Fixes#95 (at least to the point where I can't do anything about it)
This is done by reusing the lightQueue instead of allocating new ones(→less locking in the allocator) and by avoiding too frequent task priority updates(→less locking when adding new tasks).
The remaining 30% will hopefully be done by improvements to the zig GPA.
To let the rest of the code know about this decision I implemented a wrapper over the Allocator interface which cannot fail.
This is just the first step in the upcoming refactoring attempt.