MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / onReceivePacket

Method onReceivePacket

src/OpenLoco/src/Network/NetworkClient.cpp:132–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void NetworkClient::onReceivePacket([[maybe_unused]] IUdpSocket& socket, std::unique_ptr<INetworkEndpoint> endpoint, const Packet& packet)
133{
134 // TODO do we really need the check, it is possible but unlikely
135 // for something else to hijack the UDP client port
136 if (_serverEndpoint != nullptr && endpoint->equals(*_serverEndpoint))
137 {
138 _serverConnection->receivePacket(packet);
139 }
140}
141
142void NetworkClient::onCancel()
143{

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
receivePacketMethod · 0.80

Tested by

no test coverage detected