MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / CalculateValueSize

Function CalculateValueSize

engine/Poseidon/Network/NetworkMsg.cpp:1157–1168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1155
1156// size calculation - simple types
1157// Calculate size of serialized and compressed value
1158template <class Type>
1159int CalculateValueSize(const Type& value, NetworkCompressionType compression)
1160{
1161 switch (compression)
1162 {
1163 case NCTNone:
1164 case NCTDefault:
1165 return sizeof(value);
1166 default:
1167 LOG_ERROR(Network, "Unsupported compression method {}", (int)compression);
1168 return 0;
1169 }
1170}
1171

Callers 1

CalculateSizeMethod · 0.70

Calls 3

GetIdMethod · 0.80
toIntFunction · 0.50
GetLengthMethod · 0.45

Tested by

no test coverage detected