| 638 | } |
| 639 | |
| 640 | void 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 | |
| 674 | void NetworkKeys::SendAll(const NetworkConnection* target) |
| 675 | { |