Add non-functional stub for talk.

- Added a message upon running '/talk'. This allows me to see if the command is actually executed.
This commit is contained in:
Barry Kane 2023-02-16 23:08:18 +00:00
parent ff281e5ce6
commit b61520b998
1 changed files with 14 additions and 1 deletions

View File

@ -297,7 +297,20 @@ int evaluateNextCommand(gameLogicParameters * parameters, queue * queue)
// Talk command: Allows the player to begin a chat session with another player: // Talk command: Allows the player to begin a chat session with another player:
if (strncmp(currentCommand->command, "talk", 4) == 0) if (strncmp(currentCommand->command, "talk", 4) == 0)
{ {
// TODO: Implement. userMessage * talkMessage = malloc(sizeof(userMessage));
talkMessage->senderName[0] = '\0';
// Temporary message until we can implement objects, events, and challenges.
strcpy(talkMessage->messageContent, "The try command is currently not implemented. Implement it if you want to use it.\n");
// Allocate an outputMessage for the queue:
outputMessage * talkOutputMessage = createTargetedOutputMessage(talkMessage, &currentCommand->caller, 1);
// Queue the outputMessage:
pushQueue(parameters->outputQueue, talkOutputMessage, OUTPUT_MESSAGE);
// Free the userMessage:
free(talkMessage);
} }
// Stat command: Displays the current character's sheet. // Stat command: Displays the current character's sheet.
if (strncmp(currentCommand->command, "stat", 4) == 0) if (strncmp(currentCommand->command, "stat", 4) == 0)