MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SendCommand

Method SendCommand

src/network/network_server.cpp:658–670  ·  view source on GitHub ↗

* Send a command to the client to execute. * @param cp The command to send. */

Source from the content-addressed store, hash-verified

656 * @param cp The command to send.
657 */
658NetworkRecvStatus ServerNetworkGameSocketHandler::SendCommand(const CommandPacket &cp)
659{
660 Debug(net, 9, "client[{}] SendCommand(): cmd={}", this->client_id, cp.cmd);
661
662 auto p = std::make_unique<Packet>(this, PACKET_SERVER_COMMAND);
663
664 this->NetworkGameSocketHandler::SendCommand(*p, cp);
665 p->Send_uint32(cp.frame);
666 p->Send_bool (cp.my_cmd);
667
668 this->SendPacket(std::move(p));
669 return NETWORK_RECV_STATUS_OKAY;
670}
671
672/**
673 * Send a chat message.

Callers 1

Calls 3

Send_uint32Method · 0.80
Send_boolMethod · 0.80
SendPacketMethod · 0.45

Tested by

no test coverage detected