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

Function MultiDoTypeIcon

Descent3/multi.cpp:8345–8363  ·  view source on GitHub ↗

the server is telling us that about a player's message-type state (is [not] typing a message)

Source from the content-addressed store, hash-verified

8343
8344// the server is telling us that about a player's message-type state (is [not] typing a message)
8345void MultiDoTypeIcon(uint8_t *data) {
8346 int count = 0;
8347 SKIP_HEADER(data, &count);
8348 int pnum = MultiGetByte(data, &count);
8349 bool typing = (MultiGetByte(data, &count)) ? true : false;
8350
8351 ASSERT(pnum >= 0 && pnum < MAX_PLAYERS);
8352
8353 uint32_t bit = 0x01;
8354 bit = bit << pnum;
8355
8356 if (typing) {
8357 mprintf(0, "%s is typing\n", Players[pnum].callsign);
8358 Players_typing |= bit;
8359 } else {
8360 mprintf(0, "%s is done typing\n", Players[pnum].callsign);
8361 Players_typing &= ~bit;
8362 }
8363}
8364
8365// tell the clients that a player is [not] typing a message
8366void MultiSendTypeIcon(int pnum, bool typing_message) {

Callers 2

MultiSendTypeIconFunction · 0.85
MultiProcessDataFunction · 0.85

Calls 2

SKIP_HEADERFunction · 0.85
MultiGetByteFunction · 0.85

Tested by

no test coverage detected