| 1015 | } |
| 1016 | |
| 1017 | void AddChatCommandToQueue(int command, const void *data, int len) { |
| 1018 | Currcommand = Firstcommand; |
| 1019 | if (Firstcommand == nullptr) { |
| 1020 | Firstcommand = (Chat_command *)DLLmem_malloc(sizeof(Chat_command)); |
| 1021 | // ASSERT(Firstcommand); |
| 1022 | Firstcommand->next = nullptr; |
| 1023 | Currcommand = Firstcommand; |
| 1024 | } else { |
| 1025 | while (Currcommand->next) { |
| 1026 | Currcommand = Currcommand->next; |
| 1027 | } |
| 1028 | Currcommand->next = (Chat_command *)DLLmem_malloc(sizeof(Chat_command)); |
| 1029 | // ASSERT(Currcommand->next); |
| 1030 | Currcommand = Currcommand->next; |
| 1031 | } |
| 1032 | Currcommand->command = command; |
| 1033 | if (len && data) |
| 1034 | memcpy(&Currcommand->data, data, len); |
| 1035 | Currcommand->next = nullptr; |
| 1036 | } |
| 1037 | |
| 1038 | Chat_command *GetChatCommandFromQueue() { |
| 1039 | static Chat_command response_cmd; |
no outgoing calls
no test coverage detected