MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / AddChatCommandToQueue

Function AddChatCommandToQueue

netcon/mtclient/chat_api.cpp:1017–1036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1015}
1016
1017void 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
1038Chat_command *GetChatCommandFromQueue() {
1039 static Chat_command response_cmd;

Callers 5

ChatGetStringFunction · 0.85
AddChatUserFunction · 0.85
RemoveChatUserFunction · 0.85
RemoveAllChatUsersFunction · 0.85
ParseIRCMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected