| 1801 | received = msg; |
| 1802 | } |
| 1803 | else |
| 1804 | { |
| 1805 | NetMessage* ptr = received; |
| 1806 | while (ptr->next && ptr->next->getSerial() < s) |
| 1807 | { |
| 1808 | ptr = ptr->next; |
| 1809 | } |
| 1810 | msg->next = ptr->next; |
| 1811 | ptr->next = msg; |
| 1812 | } |
| 1813 | } |
| 1814 | else |
| 1815 | { |
| 1816 | msg->next = nullptr; |
| 1817 | received = msg; |
| 1818 | } |
| 1819 | } |
| 1820 | |
| 1821 | void NetClient::ProcessRawMagicMessages(RawMagicClientCallback* callback, void* context) |
| 1822 | { |
| 1823 | if (!callback) |
| 1824 | { |
| 1825 | return; |
| 1826 | } |
| 1827 | while (true) |
| 1828 | { |
| 1829 | enterRcv(); |
| 1830 | if (rawMagicReceived.Size() <= 0) |
| 1831 | { |
| 1832 | leaveRcv(); |
| 1833 | break; |
| 1834 | } |
| 1835 | RawMagicMessage item; |
| 1836 | item.from = rawMagicReceived[0].from; |
| 1837 | item.magic = rawMagicReceived[0].magic; |
| 1838 | item.data.Resize(rawMagicReceived[0].data.Size()); |
| 1839 | if (item.data.Size() > 0) |
| 1840 | { |
| 1841 | memcpy(item.data.Data(), rawMagicReceived[0].data.Data(), item.data.Size()); |
| 1842 | } |
| 1843 | rawMagicReceived.Delete(0); |
| 1844 | leaveRcv(); |
| 1845 | (*callback)(item.magic, item.data.Data(), item.data.Size(), context); |
| 1846 | } |
| 1847 | } |
| 1848 | |
| 1849 | void NetClient::RemoveUserMessages() |
| 1850 | { |
| 1851 | enterRcv(); |
| 1852 | Ref<NetMessage> tmp; |
| 1853 | while (received) |
nothing calls this directly
no test coverage detected