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

Method GetFreeMessage

BG3Extender/Extender/Client/ClientNetworking.cpp:129–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129net::ExtenderMessage* NetworkManager::GetFreeMessage()
130{
131 auto client = GetClient();
132 if (!client || client->Status == 0) {
133 ERR("Attempted to send extender message when not connected to a server!");
134 return nullptr;
135 }
136
137 // We need to make sure that no extender message is sent if the other party
138 // does not have the new message ID-s installed, otherwise the peer will crash
139 // while trying to parse the packet.
140 if (!extenderSupport_) {
141 ERR("Attempted to send extender message to a host that does not understand extender protocol!");
142 return nullptr;
143 }
144
145 return (net::ExtenderMessage*)client->NetMessageFactory->GetFreeMessage((uint32_t)net::ExtenderMessage::MessageId);
146}
147
148net::ExtenderMessage* NetworkManager::GetFreeMessage(UserId userId)
149{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected