| 4 | BEGIN_NS(net) |
| 5 | |
| 6 | Message* 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 | |
| 19 | void MessageFactory::Grow(uint32_t lastMessageId) |
| 20 | { |