Freeciv-3.2
|
Public Member Functions | |
__init__ (self, ScriptConfig cfg, str packet_type, int packet_number, str flags_text, typing.Iterable[str] lines, typing.Callable[[str], RawFieldType] resolve_type) | |
str | name (self) |
bool | no_packet (self) |
str | extra_send_args (self) |
str | extra_send_args2 (self) |
str | extra_send_args3 (self) |
str | send_prototype (self) |
str | lsend_prototype (self) |
str | dsend_prototype (self) |
str | dlsend_prototype (self) |
"set[str]" | all_caps (self) |
str | get_struct (self) |
str | get_prototypes (self) |
str | get_stats (self) |
str | get_report_part (self) |
str | get_reset_part (self) |
str | get_send (self) |
str | get_variants (self) |
str | get_lsend (self) |
str | get_dsend (self) |
str | get_dlsend (self) |
Static Public Attributes | |
CANCEL_PATTERN = re.compile(r"^cancel\((.*)\)$") | |
str | is_info = "no" |
bool | want_dsend = False |
bool | want_lsend = False |
bool | want_force = False |
bool | want_pre_send = False |
bool | want_post_send = False |
bool | want_post_recv = False |
bool | delta = True |
bool | no_handle = False |
bool | handle_via_packet = True |
bool | handle_per_conn = False |
Represents a single packet type (possibly with multiple variants)
Definition at line 2512 of file generate_packets.py.
generate_packets.Packet.__init__ | ( | self, | |
ScriptConfig | cfg, | ||
str | packet_type, | ||
int | packet_number, | ||
str | flags_text, | ||
typing.Iterable[str] | lines, | ||
typing.Callable[[str], RawFieldType] | resolve_type | ||
) |
Reimplemented in generate_packets.PacketsDefinition.
Definition at line 2561 of file generate_packets.py.
"set[str]" generate_packets.Packet.all_caps | ( | self | ) |
Set of all capabilities affecting this packet
Reimplemented in generate_packets.PacketsDefinition.
Definition at line 2746 of file generate_packets.py.
str generate_packets.Packet.dlsend_prototype | ( | self | ) |
Prototype for the dlsend function (directly takes values; list of connections)
Definition at line 2739 of file generate_packets.py.
str generate_packets.Packet.dsend_prototype | ( | self | ) |
Prototype for the dsend function (directly takes values instead of a packet struct)
Definition at line 2733 of file generate_packets.py.
str generate_packets.Packet.extra_send_args | ( | self | ) |
Argements for the regular send function
Definition at line 2692 of file generate_packets.py.
str generate_packets.Packet.extra_send_args2 | ( | self | ) |
Arguments passed from lsend to send See also extra_send_args
Definition at line 2701 of file generate_packets.py.
str generate_packets.Packet.extra_send_args3 | ( | self | ) |
Arguments for the dsend and dlsend functions
Definition at line 2713 of file generate_packets.py.
str generate_packets.Packet.get_dlsend | ( | self | ) |
Generate the implementation of the dlsend function, combining dsend and lsend functionality. See self.get_dsend() and self.get_lsend()
Definition at line 2891 of file generate_packets.py.
str generate_packets.Packet.get_dsend | ( | self | ) |
Generate the implementation of the dsend function, which directly takes packet fields instead of a packet struct.
Definition at line 2871 of file generate_packets.py.
str generate_packets.Packet.get_lsend | ( | self | ) |
Generate the implementation of the lsend function, which takes a list of connections to send a packet to.
Definition at line 2857 of file generate_packets.py.
str generate_packets.Packet.get_prototypes | ( | self | ) |
Generate the header prototype declarations for the public functions associated with this packet.
Definition at line 2769 of file generate_packets.py.
str generate_packets.Packet.get_report_part | ( | self | ) |
Generate this packet's part of the delta_stats_report() function. See Variant.get_report_part() and PacketsDefinition.code_delta_stats_report
Definition at line 2795 of file generate_packets.py.
str generate_packets.Packet.get_reset_part | ( | self | ) |
Generate this packet's part of the delta_stats_reset() function. See Variant.get_reset_part() and PacketsDefinition.code_delta_stats_reset
Definition at line 2802 of file generate_packets.py.
str generate_packets.Packet.get_send | ( | self | ) |
Generate the implementation of the send function, which sends a given packet to a given connection.
Definition at line 2809 of file generate_packets.py.
str generate_packets.Packet.get_stats | ( | self | ) |
Generate the code declaring counters for this packet's variants. See Variant.get_stats()
Definition at line 2789 of file generate_packets.py.
str generate_packets.Packet.get_struct | ( | self | ) |
Generate the struct definition for this packet
Definition at line 2751 of file generate_packets.py.
str generate_packets.Packet.get_variants | ( | self | ) |
Generate all code associated with individual variants of this packet; see the Variant class (and its methods) for details.
Definition at line 2837 of file generate_packets.py.
str generate_packets.Packet.lsend_prototype | ( | self | ) |
Prototype for the lsend function (takes a list of connections)
Definition at line 2727 of file generate_packets.py.
str generate_packets.Packet.name | ( | self | ) |
Snake-case name of this packet type
Definition at line 2681 of file generate_packets.py.
bool generate_packets.Packet.no_packet | ( | self | ) |
Whether this packet's send functions should take no packet argument. This is the case iff this packet has no fields.
Definition at line 2686 of file generate_packets.py.
str generate_packets.Packet.send_prototype | ( | self | ) |
Prototype for the regular send function
Definition at line 2722 of file generate_packets.py.
generate_packets.Packet.all_fields |
Definition at line 2645 of file generate_packets.py.
generate_packets.Packet.cancel |
Definition at line 2575 of file generate_packets.py.
|
static |
Definition at line 2515 of file generate_packets.py.
generate_packets.Packet.cfg |
Definition at line 2563 of file generate_packets.py.
Definition at line 2547 of file generate_packets.py.
generate_packets.Packet.delta |
Definition at line 2613 of file generate_packets.py.
generate_packets.Packet.dirs |
Definition at line 2634 of file generate_packets.py.
generate_packets.Packet.fields |
Definition at line 2652 of file generate_packets.py.
Definition at line 2557 of file generate_packets.py.
generate_packets.Packet.handle_per_conn |
Definition at line 2622 of file generate_packets.py.
Definition at line 2553 of file generate_packets.py.
generate_packets.Packet.handle_via_packet |
Definition at line 2619 of file generate_packets.py.
|
static |
Definition at line 2521 of file generate_packets.py.
generate_packets.Packet.is_info |
Definition at line 2589 of file generate_packets.py.
generate_packets.Packet.name |
Definition at line 2630 of file generate_packets.py.
Definition at line 2550 of file generate_packets.py.
generate_packets.Packet.no_handle |
Definition at line 2616 of file generate_packets.py.
generate_packets.Packet.type |
Definition at line 2565 of file generate_packets.py.
generate_packets.Packet.type_number |
Definition at line 2570 of file generate_packets.py.
generate_packets.Packet.variants |
Definition at line 2674 of file generate_packets.py.
Definition at line 2525 of file generate_packets.py.
generate_packets.Packet.want_dsend |
Definition at line 2595 of file generate_packets.py.
Definition at line 2533 of file generate_packets.py.
generate_packets.Packet.want_force |
Definition at line 2601 of file generate_packets.py.
Definition at line 2529 of file generate_packets.py.
generate_packets.Packet.want_lsend |
Definition at line 2598 of file generate_packets.py.
Definition at line 2543 of file generate_packets.py.
generate_packets.Packet.want_post_recv |
Definition at line 2610 of file generate_packets.py.
Definition at line 2540 of file generate_packets.py.
generate_packets.Packet.want_post_send |
Definition at line 2607 of file generate_packets.py.
Definition at line 2537 of file generate_packets.py.
generate_packets.Packet.want_pre_send |
Definition at line 2604 of file generate_packets.py.