MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Send

Method Send

Source/Engine/Networking/NetworkManager.cpp:701–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699}
700
701void NetworkKeys::Send(const NetworkKey& key, uint32 index, const NetworkConnection* target)
702{
703 // TODO: optimize with batching multiple keys into a single message
704 auto peer = NetworkManager::Peer;
705 NetworkMessage msg = peer->BeginSendMessage();
706 NetworkMessageKey msgData;
707 msgData.Type = key.Type;
708 msgData.Index = index;
709 msg.WriteStructure(msgData);
710 if (key.Type == NetworkKey::TypeId)
711 msg.WriteGuid(key.Id);
712 else
713 msg.WriteStringAnsi(key.Name);
714 if (NetworkManager::IsClient())
715 peer->EndSendMessage(NetworkChannelType::Reliable, msg);
716 else if (target)
717 peer->EndSendMessage(NetworkChannelType::Reliable, msg, *target);
718 else
719 peer->EndSendMessage(NetworkChannelType::Reliable, msg, ActiveConnections);
720}
721
722void NetworkManagerService::Update()
723{

Callers

nothing calls this directly

Calls 4

BeginSendMessageMethod · 0.80
WriteStringAnsiMethod · 0.80
EndSendMessageMethod · 0.80
WriteGuidMethod · 0.45

Tested by

no test coverage detected