Freeciv-3.3
|
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 | send_params (self) |
str | send_args (self) |
str | dsend_params (self) |
str | send_prototype (self) |
str | lsend_prototype (self) |
str | dsend_prototype (self) |
str | dlsend_prototype (self) |
"set[str]" | all_caps (self) |
bool | complex (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_init (self) |
str | get_free_destroy (self) |
str | get_send (self) |
str | get_variants (self) |
str | get_lsend (self) |
str | get_dsend (self) |
str | get_dlsend (self) |
Static Public Attributes | |
RESET_PATTERN = re.compile(r"^reset\((.*)\)$") | |
ScriptConfig | cfg |
str | type |
int | type_number |
str | reset_packets : "list[str]" |
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 |
Directions | dirs |
str | all_fields : "list[Field]" |
str | fields : "list[Field]" |
str | variants : "list[Variant]" |
Represents a single packet type (possibly with multiple variants)
Definition at line 3197 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 3278 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 3447 of file generate_packets.py.
bool generate_packets.Packet.complex | ( | self | ) |
Whether this packet's struct requires special handling for initialization, copying, and destruction.
Definition at line 3452 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 3440 of file generate_packets.py.
str generate_packets.Packet.dsend_params | ( | self | ) |
Parameters for the dsend and dlsend functions, not including the connection or list of connections to send to
Definition at line 3413 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 3434 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 3650 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 3629 of file generate_packets.py.
str generate_packets.Packet.get_free_destroy | ( | self | ) |
Generate this packet's free and destroy functions, which free memory associated with complex-typed fields of this packet, and optionally the allocation of the packet itself (destroy).
Definition at line 3536 of file generate_packets.py.
str generate_packets.Packet.get_init | ( | self | ) |
Generate this packet's init function, which initializes the packet struct so its complex-typed fields are usable, and sets all fields to the empty default state used for computing deltas
Definition at line 3515 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 3615 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 3475 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 3501 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 3508 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 3569 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 3495 of file generate_packets.py.
str generate_packets.Packet.get_struct | ( | self | ) |
Generate the struct definition for this packet
Definition at line 3457 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 3597 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 3428 of file generate_packets.py.
str generate_packets.Packet.name | ( | self | ) |
Snake-case name of this packet type
Definition at line 3379 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 3384 of file generate_packets.py.
str generate_packets.Packet.send_args | ( | self | ) |
Arguments passed from lsend to send, not including the connection to send to See also extra_send_args
Definition at line 3400 of file generate_packets.py.
str generate_packets.Packet.send_params | ( | self | ) |
Parameters for the send and lsend functions, not including the connection or list of connections to send to
Definition at line 3390 of file generate_packets.py.
str generate_packets.Packet.send_prototype | ( | self | ) |
Prototype for the regular send function
Definition at line 3423 of file generate_packets.py.
Definition at line 3265 of file generate_packets.py.
generate_packets.Packet.all_fields |
Definition at line 3351 of file generate_packets.py.
|
static |
Definition at line 3206 of file generate_packets.py.
generate_packets.Packet.cfg |
Definition at line 3280 of file generate_packets.py.
Definition at line 3248 of file generate_packets.py.
generate_packets.Packet.delta |
Definition at line 3320 of file generate_packets.py.
|
static |
Definition at line 3262 of file generate_packets.py.
generate_packets.Packet.dirs |
Definition at line 3341 of file generate_packets.py.
Definition at line 3272 of file generate_packets.py.
generate_packets.Packet.fields |
Definition at line 3353 of file generate_packets.py.
Definition at line 3258 of file generate_packets.py.
generate_packets.Packet.handle_per_conn |
Definition at line 3329 of file generate_packets.py.
Definition at line 3254 of file generate_packets.py.
generate_packets.Packet.handle_via_packet |
Definition at line 3326 of file generate_packets.py.
|
static |
Definition at line 3222 of file generate_packets.py.
generate_packets.Packet.is_info |
Definition at line 3296 of file generate_packets.py.
Definition at line 3251 of file generate_packets.py.
generate_packets.Packet.no_handle |
Definition at line 3323 of file generate_packets.py.
Definition at line 3218 of file generate_packets.py.
generate_packets.Packet.reset_packets |
Definition at line 3284 of file generate_packets.py.
|
static |
Definition at line 3200 of file generate_packets.py.
|
static |
Definition at line 3209 of file generate_packets.py.
generate_packets.Packet.type |
Definition at line 3281 of file generate_packets.py.
|
static |
Definition at line 3215 of file generate_packets.py.
generate_packets.Packet.type_number |
Definition at line 3282 of file generate_packets.py.
Definition at line 3275 of file generate_packets.py.
generate_packets.Packet.variants |
Definition at line 3373 of file generate_packets.py.
Definition at line 3226 of file generate_packets.py.
generate_packets.Packet.want_dsend |
Definition at line 3302 of file generate_packets.py.
Definition at line 3234 of file generate_packets.py.
generate_packets.Packet.want_force |
Definition at line 3308 of file generate_packets.py.
Definition at line 3230 of file generate_packets.py.
generate_packets.Packet.want_lsend |
Definition at line 3305 of file generate_packets.py.
Definition at line 3244 of file generate_packets.py.
generate_packets.Packet.want_post_recv |
Definition at line 3317 of file generate_packets.py.
Definition at line 3241 of file generate_packets.py.
generate_packets.Packet.want_post_send |
Definition at line 3314 of file generate_packets.py.
Definition at line 3238 of file generate_packets.py.
generate_packets.Packet.want_pre_send |
Definition at line 3311 of file generate_packets.py.