Overview
Command packets allow direct control of aircraft parameters, chat communication, and weapon loadout configuration. These are essential for creating interactive features and game modifications.FSNETCMD_AIRCMD
Packet ID:30 | Direction: Bidirectional (Server ↔ Client)
Used to send commands to aircraft, such as changing fuel, payload, engine settings, and flight characteristics.
Location
lib/PacketManager/packets/FSNETCMD_AIRCMD.py
Fields
Target aircraft identifier
Command string (e.g., “INITFUEL 5000kg” or “*43 1000”)
Parsed command tuple (command_name, value) if message starts with
*Methods
Decodes the AIRCMD packet and parses command if presentExample:
Parses engine commands (messages starting with
*)Parameters:message(str): Command message like “*43 1000”
tuple | None - (command_name, value) or None if invalidExample:Creates an AIRCMD packetParameters:
aircraft_id(int): Target aircraftmessage(str): Command stringwith_size(bool): Include size header
bytes - Encoded packetExample:Sets aircraft payload (cargo/passenger weight)Parameters:
aircraft_id(int): Target aircraftpayload(int): Payload weightunits(str): Weight units (“kg” or “lb”), default “kg”with_size(bool): Include size header
Sets any aircraft parameter using AIRCMD keywordsParameters:
aircraft_id(int): Target aircraftcommand(str): Command name from AIRCMD_KEYWORDSvalue(str | int): Command valuewith_size(bool): Include size header
Enables or disables afterburnerParameters:
aircraft_id(int): Target aircraftenabled(int | bool): 1/True for on, 0/False for offwith_size(bool): Include size header
AIRCMD Keywords
Commands are defined inconstants.py as AIRCMD_KEYWORDS. Common commands include:
- INITFUEL - Set fuel amount (e.g., “3750kg”)
- INITLOAD - Set payload weight (e.g., “2000kg”)
- AFTBURNR - Afterburner on/off (“TRUE”/“FALSE”)
- WEIGHCLN - Clean weight of aircraft
- WEIGFUEL - Maximum fuel weight
- WEIGLOAD - Maximum payload weight
- MAXSPEED - Maximum airspeed
- INITAAM - Initial AAM count
- INITAGM - Initial AGM count
- INITBOMB - Initial bomb count
- POSITION - Set position (“X Y Z [M]”)
- ATTITUDE - Set attitude (“H P B [DEG]”)
- INITSPED - Set initial speed
Usage Examples
Refueling System
Damage-Based Afterburner Control
Dynamic Aircraft Modification
FSNETCMD_TEXTMESSAGE
Packet ID:32 | Direction: Bidirectional (Server ↔ Client)
Handles in-game chat messages between players.
Location
lib/PacketManager/packets/FSNETCMD_TEXTMESSAGE.py
Fields
Full message including username in format: “(Username)message text”
Username of the sender (parsed from raw_message)
Message text without username prefix
Methods
Decodes the text message packet and extracts user/messageExample:
Creates a text message packetParameters:
message(str): Message text (can include username in parentheses)with_size(bool): Include size header
bytes - Encoded packetExample:Usage Examples
Chat Filter Plugin
Chat Commands
Discord Integration
Custom Chat Helper
FSNETCMD_WEAPONCONFIG
Packet ID:36 | Direction: Bidirectional (Server ↔ Client)
Configures aircraft weapon loadouts and smoke colors.
Location
lib/PacketManager/packets/FSNETCMD_WEAPONCONFIG.py
Fields
Target aircraft identifier
Number of weapon entries (multiplied by 2)
Dictionary mapping weapon types to counts/configurations
- Key: Weapon name (e.g., “FSWEAPON_AIM9”, “FSWEAPON_BOMB”)
- Value: Count (int) or RGB color list for smoke
Methods
Decodes weapon configuration packetExample:
Creates a weapon configuration packetParameters:
aircraft_id(int): Target aircraftweapon_config(dict): Weapon type → count mappingwith_size(bool): Include size header
bytes - Encoded packetExample:Adds smoke generators to an aircraft with default gray colorParameters:
aircraft_id(int): Target aircraft
bytes - Encoded packet with size headerExample:Weapon Types
Defined in constants.py:101-154 as FSWEAPON_DICT:- FSWEAPON_GUN (0) - Machine gun
- FSWEAPON_AIM9 (1) - Short-range AAM
- FSWEAPON_AGM65 (2) - Air-to-ground missile
- FSWEAPON_BOMB (3) - Standard bomb
- FSWEAPON_ROCKET (4) - Unguided rockets
- FSWEAPON_FLARE (5) - Countermeasure flares
- FSWEAPON_AIM120 (6) - Medium-range AAM
- FSWEAPON_BOMB250 (7) - 250lb bomb
- FSWEAPON_SMOKE (8) - Smoke generator
- FSWEAPON_BOMB500HD (9) - 500lb high-drag bomb
- FSWEAPON_AIM9X (10) - Advanced short-range AAM
- FSWEAPON_SMOKE0-7 (32-39) - Individual smoke colors
Usage Examples
Custom Loadouts
Smoke Color Configuration
Mission-Based Loadouts
Combat-Related Packets
FSNETCMD_MISSILELAUNCH
Packet ID:20 | Direction: Bidirectional (Server ↔ Client)
Sent when a missile or weapon is launched.
Location
lib/PacketManager/packets/FSNETCMD_MISSILELAUNCH.py
Key Fields
weapon_type(int/str) - Weapon identifierposition[x, y, z] - Launch positionatti[h, p, b] - Launch attitudevelocity(float) - Initial velocityfired_by_aircraft(int) - Launching aircraft IDfired_by(int) - Player IDfired_at(int) - Target ID (for guided weapons)
FSNETCMD_GETDAMAGE
Packet ID:22 | Direction: Bidirectional (Server ↔ Client)
Sent when an aircraft or ground target takes damage.
Location
lib/PacketManager/packets/FSNETCMD_GETDAMAGE.py
Key Fields
victim_id(int) - ID of damaged objectvictim_type(int) - Object type (aircraft/ground)attacker_id(int) - ID of attackerattacker_type(int) - Attacker typedamage(int) - Damage amountweapon_type(str) - Weapon that caused damage
FSNETCMD_LOCKON
Packet ID:18 | Direction: Bidirectional (Server ↔ Client)
Sent when a player locks onto a target.
Location
lib/PacketManager/packets/FSNETCMD_LOCKON.py
Key Fields
locker_id(int) - ID of locking aircraftlocker_is_air(bool) - Is locker an aircraft?lockee_id(int) - ID of locked targetlockee_is_air(bool) - Is target an aircraft?
Performance Tips
- Cache encoded packets that are sent repeatedly
- Use
with_size=Truefor network transmission - Batch weapon configs instead of sending multiple packets
- Filter chat messages on server side to reduce bandwidth