Freeciv-3.2
|
Public Member Functions | |
__init__ (self, typing.Iterable[str] poscaps, typing.Iterable[str] negcaps, "Packet" packet, int no) | |
ScriptConfig | cfg (self) |
bool | gen_stats (self) |
"str | None" | log_macro (self) |
bool | gen_log (self) |
str | packet_name (self) |
str | type (self) |
bool | no_packet (self) |
bool | delta (self) |
want_force (self) | |
str | is_info (self) |
"list[str]" | cancel (self) |
bool | differ_used (self) |
str | condition (self) |
int | bits (self) |
str | receive_prototype (self) |
str | send_prototype (self) |
str | send_handler (self) |
str | receive_handler (self) |
str | get_stats (self) |
str | get_bitvector (self) |
str | get_report_part (self) |
str | get_reset_part (self) |
str | get_hash (self) |
str | get_cmp (self) |
str | get_send (self) |
str | get_delta_send_body (self, str before_return="") |
str | get_receive (self) |
str | get_delta_receive_body (self) |
Data Fields | |
packet | |
no | |
name | |
poscaps | |
negcaps | |
fields | |
key_fields | |
other_fields | |
keys_format | |
keys_arg | |
no_packet | |
Represents one variant of a packet. Packets with add-cap or remove-cap fields have different variants for different combinations of the relevant optional capabilities.
Definition at line 1752 of file generate_packets.py.
generate_packets.Variant.__init__ | ( | self, | |
typing.Iterable[str] | poscaps, | ||
typing.Iterable[str] | negcaps, | ||
"Packet" | packet, | ||
int | no | ||
) |
Definition at line 1757 of file generate_packets.py.
int generate_packets.Variant.bits | ( | self | ) |
The length of the bitvector for this variant.
Definition at line 1909 of file generate_packets.py.
"list[str]" generate_packets.Variant.cancel | ( | self | ) |
List of packets to cancel when sending or receiving this packet See Packet.cancel
Definition at line 1870 of file generate_packets.py.
ScriptConfig generate_packets.Variant.cfg | ( | self | ) |
Configuration used when generating code for this packet variant See self.packet and Packet.cfg
Definition at line 1800 of file generate_packets.py.
str generate_packets.Variant.condition | ( | self | ) |
The condition determining whether this variant should be used, based on capabilities. See get_packet_handlers_fill_capability()
Definition at line 1894 of file generate_packets.py.
bool generate_packets.Variant.delta | ( | self | ) |
Whether this packet can use delta optimization See Packet.delta
Definition at line 1851 of file generate_packets.py.
bool generate_packets.Variant.differ_used | ( | self | ) |
Whether the send function needs a `differ` boolean. See get_send()
Definition at line 1877 of file generate_packets.py.
bool generate_packets.Variant.gen_log | ( | self | ) |
Whether to generate log calls for this packet variant See self.log_macro
Definition at line 1823 of file generate_packets.py.
bool generate_packets.Variant.gen_stats | ( | self | ) |
Whether to generate delta stats code for this packet variant See self.cfg and ScriptConfig.gen_stats
Definition at line 1808 of file generate_packets.py.
str generate_packets.Variant.get_bitvector | ( | self | ) |
Generate the declaration of the fields bitvector type for this packet variant
Definition at line 1968 of file generate_packets.py.
str generate_packets.Variant.get_cmp | ( | self | ) |
Generate the key comparison function for this variant
Definition at line 2037 of file generate_packets.py.
str generate_packets.Variant.get_delta_receive_body | ( | self | ) |
Helper for get_receive(). Generate the part of the receive function responsible for recreating the full packet from the received delta and the last cached packet.
Definition at line 2403 of file generate_packets.py.
Helper for get_send(). Generate the part of the send function that computes and transmits the delta between the real packet and the last cached packet.
Definition at line 2214 of file generate_packets.py.
str generate_packets.Variant.get_hash | ( | self | ) |
Generate the key hash function for this variant
Definition at line 2005 of file generate_packets.py.
str generate_packets.Variant.get_receive | ( | self | ) |
Generate the receive function for this packet variant
Definition at line 2309 of file generate_packets.py.
str generate_packets.Variant.get_report_part | ( | self | ) |
Generate the part of the delta_stats_report8) function specific to this packet variant
Definition at line 1975 of file generate_packets.py.
str generate_packets.Variant.get_reset_part | ( | self | ) |
Generate the part of the delta_stats_reset() function specific to this packet variant
Definition at line 1995 of file generate_packets.py.
str generate_packets.Variant.get_send | ( | self | ) |
Generate the send function for this packet variant
Definition at line 2072 of file generate_packets.py.
str generate_packets.Variant.get_stats | ( | self | ) |
Generate the declaration of the delta stats counters associated with this packet variant
Definition at line 1952 of file generate_packets.py.
str generate_packets.Variant.is_info | ( | self | ) |
Whether this is an info or game-info packet
Definition at line 1865 of file generate_packets.py.
"str | None" generate_packets.Variant.log_macro | ( | self | ) |
The log macro used to generate log calls for this packet variant, or None if no log calls should be generated See self.cfg and ScriptConfig.log_macro
Definition at line 1815 of file generate_packets.py.
bool generate_packets.Variant.no_packet | ( | self | ) |
Whether the send function should not take/need a packet struct See Packet.no_packet
Definition at line 1844 of file generate_packets.py.
str generate_packets.Variant.packet_name | ( | self | ) |
Name of the packet this is a variant of See Packet.name
Definition at line 1830 of file generate_packets.py.
str generate_packets.Variant.receive_handler | ( | self | ) |
Code to set the receive handler for this variant See get_packet_handlers_fill_initial and get_packet_handlers_fill_capability
Definition at line 1943 of file generate_packets.py.
str generate_packets.Variant.receive_prototype | ( | self | ) |
The prototype of this variant's receive function
Definition at line 1914 of file generate_packets.py.
str generate_packets.Variant.send_handler | ( | self | ) |
Code to set the send handler for this variant See get_packet_handlers_fill_initial and get_packet_handlers_fill_capability
Definition at line 1924 of file generate_packets.py.
str generate_packets.Variant.send_prototype | ( | self | ) |
The prototype of this variant's send function
Definition at line 1919 of file generate_packets.py.
str generate_packets.Variant.type | ( | self | ) |
Type (enum constant) of the packet this is a variant of See Packet.type
Definition at line 1837 of file generate_packets.py.
generate_packets.Variant.want_force | ( | self | ) |
Whether send function takes a force_to_send boolean See Packet.want_force
Definition at line 1858 of file generate_packets.py.
generate_packets.Variant.fields |
Definition at line 1772 of file generate_packets.py.
generate_packets.Variant.key_fields |
Definition at line 1778 of file generate_packets.py.
generate_packets.Variant.keys_arg |
Definition at line 1788 of file generate_packets.py.
generate_packets.Variant.keys_format |
Definition at line 1783 of file generate_packets.py.
generate_packets.Variant.name |
Definition at line 1763 of file generate_packets.py.
generate_packets.Variant.negcaps |
Definition at line 1769 of file generate_packets.py.
generate_packets.Variant.no |
Definition at line 1761 of file generate_packets.py.
generate_packets.Variant.no_packet |
Definition at line 1882 of file generate_packets.py.
generate_packets.Variant.other_fields |
Definition at line 1780 of file generate_packets.py.
generate_packets.Variant.packet |
Definition at line 1759 of file generate_packets.py.
generate_packets.Variant.poscaps |
Definition at line 1766 of file generate_packets.py.