DMFCBase::SendControlMessageToPlayer Sends a [1 byte] control message to a player
| 568 | // |
| 569 | // Sends a [1 byte] control message to a player |
| 570 | void 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 | // |
no test coverage detected