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

Method SendControlMessageToPlayer

netgames/dmfc/dmfcpackets.cpp:570–584  ·  view source on GitHub ↗

DMFCBase::SendControlMessageToPlayer Sends a [1 byte] control message to a player

Source from the content-addressed store, hash-verified

568//
569// Sends a [1 byte] control message to a player
570void DMFCBase::SendControlMessageToPlayer(int pnum, uint8_t msg) {
571 int count = 0;
572 uint8_t data[MAX_GAME_DATA_SIZE];
573 StartPacket(data, SPID_CONTROLMSG, &count);
574
575 MultiAddByte(msg, data, &count);
576 MultiAddByte(GetPlayerNum(), data, &count);
577 MultiAddByte(pnum, data, &count);
578
579 if (GetLocalRole() != LR_SERVER) {
580 // send it to the server to forward to a client
581 SendPacket(data, count, SP_SERVER);
582 } else
583 SendPacket(data, count, pnum);
584}
585
586// DMFCBase::ReceiveControlMessage
587//

Callers 4

KickPlayerFunction · 0.80
BanPlayerFunction · 0.80
OnServerCollideFunction · 0.80

Calls 1

MultiAddByteFunction · 0.85

Tested by

no test coverage detected