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

Method SendPending

Source/Engine/Networking/NetworkManager.cpp:640–672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638}
639
640void NetworkKeys::SendPending()
641{
642 PROFILE_CPU();
643 PROFILE_MEM(Networking);
644 ScopeLock lock(Lock);
645
646 // Add new keys
647 int32 initialCount = Table.Count();
648 int32 sendIndex = initialCount;
649 for (auto& e : PendingIds)
650 {
651 const int32 key = sendIndex++;
652 LookupId.Add(e.Key, key);
653 Table.Add(e.Value);
654 }
655 for (auto& e : PendingNames)
656 {
657 const int32 key = sendIndex++;
658 LookupName.Add(e.Key, key);
659 Table.Add(e.Value);
660 }
661
662 // Send new entries
663 sendIndex = initialCount;
664 for (auto& e : PendingIds)
665 Send(e.Value, sendIndex++);
666 for (auto& e : PendingNames)
667 Send(e.Value, sendIndex++);
668
669 // Clear lists
670 PendingIds.Clear();
671 PendingNames.Clear();
672}
673
674void NetworkKeys::SendAll(const NetworkConnection* target)
675{

Callers 1

UpdateMethod · 0.80

Calls 3

CountMethod · 0.45
AddMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected