OpenTTD Source: CommandPacket Struct Reference

OpenTTD Source 15.0-RC2

Data Fields
CommandPacket Struct Reference

Everything we need to know about a command to be able to execute it. More...

`#include <network_internal.h>`

## Data Fields
CompanyID | company = CompanyID::Invalid()
| company that is executing the command
uint32_t | frame = 0
| the frame in which this packet is executed
bool | my_cmd = false
| did the command originate from "me"
Commands | cmd {}
| command being executed.
StringID | err_msg {}
| string ID of error message to use.
CommandCallback * | callback = nullptr
| any callback function executed upon successful completion of the command.
CommandDataBuffer | data {}
| command parameters.

## Detailed Description

Everything we need to know about a command to be able to execute it.

Definition at line 95 of file network_internal.h.

## Field Documentation

## ◆ callback

CommandCallback* CommandPacket::callback = nullptr

any callback function executed upon successful completion of the command.

Definition at line 102 of file network_internal.h.

Referenced by DistributeCommandPacket(), NetworkSendCommand(), NetworkSyncCommandQueue(), NetworkGameSocketHandler::ReceiveCommand(), and NetworkGameSocketHandler::SendCommand().

## ◆ cmd

Commands CommandPacket::cmd {}

command being executed.

Definition at line 100 of file network_internal.h.

Referenced by NetworkReplaceCommandClientId(), NetworkSendCommand(), ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(), ClientNetworkGameSocketHandler::Receive_SERVER_COMMAND(), NetworkGameSocketHandler::ReceiveCommand(), ServerNetworkAdminSocketHandler::SendCmdLogging(), ClientNetworkGameSocketHandler::SendCommand(), ServerNetworkGameSocketHandler::SendCommand(), and NetworkGameSocketHandler::SendCommand().

## ◆ company

CompanyID CommandPacket::company = CompanyID::Invalid()

company that is executing the command

Definition at line 96 of file network_internal.h.

Referenced by NetworkSendCommand(), ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(), NetworkGameSocketHandler::ReceiveCommand(), ServerNetworkAdminSocketHandler::SendCmdLogging(), and NetworkGameSocketHandler::SendCommand().

## ◆ data

CommandDataBuffer CommandPacket::data {}

command parameters.

Definition at line 103 of file network_internal.h.

Referenced by NetworkSendCommand(), ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(), NetworkGameSocketHandler::ReceiveCommand(), ServerNetworkAdminSocketHandler::SendCmdLogging(), NetworkGameSocketHandler::SendCommand(), and UnpackNetworkCommand().

## ◆ err_msg

StringID CommandPacket::err_msg {}

string ID of error message to use.

Definition at line 101 of file network_internal.h.

Referenced by NetworkSendCommand(), NetworkGameSocketHandler::ReceiveCommand(), NetworkGameSocketHandler::SendCommand(), and UnpackNetworkCommand().

## ◆ frame

uint32_t CommandPacket::frame = 0

the frame in which this packet is executed

Definition at line 97 of file network_internal.h.

Referenced by DistributeCommandPacket(), NetworkSendCommand(), ClientNetworkGameSocketHandler::Receive_SERVER_COMMAND(), ServerNetworkAdminSocketHandler::SendCmdLogging(), and ServerNetworkGameSocketHandler::SendCommand().

## ◆ my_cmd

bool CommandPacket::my_cmd = false

did the command originate from "me"

Definition at line 98 of file network_internal.h.

Referenced by DistributeCommandPacket(), NetworkSendCommand(), ClientNetworkGameSocketHandler::Receive_SERVER_COMMAND(), ServerNetworkGameSocketHandler::SendCommand(), and UnpackNetworkCommand().

The documentation for this struct was generated from the following file:

- src/network/network_internal.h