Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
stream.cpp File Reference

The file containing the Minecraft Stream logic. More...

#include "stream.h"
#include <cstring>
#include <bit>
#include <stdexcept>
#include <algorithm>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
#include <utils/logger.h>

Macros

#define SEGMENT_BITS   0x7F
 Mask for VarInts.
 
#define CONTINUE_BIT   0x80
 Mask for Continue Bit.
 

Functions

size_t calculateVarIntSize (int i)
 Calculates the size of an int in VarInt format.
 

Detailed Description

The file containing the Minecraft Stream logic.

Author
Lygaen
Version
0.1
Date
2023-12-16

Macro Definition Documentation

◆ CONTINUE_BIT

#define CONTINUE_BIT   0x80

Mask for Continue Bit.

Mask for the bit representation of the continue bit, used to see if we need to load the next byte in

◆ SEGMENT_BITS

#define SEGMENT_BITS   0x7F

Mask for VarInts.

Mask for bit representation of varints, the most bit used to continue or not

Function Documentation

◆ calculateVarIntSize()

size_t calculateVarIntSize ( int i)

Calculates the size of an int in VarInt format.

Parameters
ithe int to calculates its size
Returns
size_t the size of i in VarInt format