MCPcopy Create free account
hub / github.com/Norbyte/bg3se / GetFreeMessage

Method GetFreeMessage

BG3Extender/Extender/Shared/ExtenderNet.cpp:6–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4BEGIN_NS(net)
5
6Message* MessageFactory::GetFreeMessage(uint32_t messageId)
7{
8 if (messageId < MessagePools.size()) {
9 EnterCriticalSection(&CriticalSection);
10 auto msg = MessagePools[messageId]->GetFreeMessage();
11 LeaveCriticalSection(&CriticalSection);
12 return msg;
13 } else {
14 ERR("GetFreeMessage(): Message factory not registered for this message type?");
15 return nullptr;
16 }
17}
18
19void MessageFactory::Grow(uint32_t lastMessageId)
20{

Callers

nothing calls this directly

Calls 5

CreateNewMethod · 0.80
popMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected