(10-10-2019, 05:44 PM)xoft Wrote: Sorry for the late reply, only now I noticed your post had another question in it.I was looking over the protocol details, and since Minecraft uses variable-length integers (VarInt and VarLong) for data like packet lengths and IDs, how would you modify the Buffer class to read and write those efficiently without over-allocating? Do you have an example of how you decode a VarInt byte-by-byte from the stream?
нулс бравл
The Buffer class can be pretty much substituted by a std::string - it has the append and erase operations, you just need to add a "read position" and possibly some helper functions to read individual data types.
Edit: Also, if we are transitioning to std::string as a backing buffer, do you find that frequent erase() operations on the front of the string cause noticeable performance overhead due to memory shifting, or is it negligible for standard player counts?

