protocol
Module¶
Source code: protocol.py
Bad
Class¶
- class vgio.quake2.protocol.Bad¶
Class for representing a Bad message
This is an error message and should not appear.
- Bad.__init__()¶
- classmethod Bad.read(file)¶
- classmethod Bad.write(file, bad=None)¶
MuzzleFlash
Class¶
- class vgio.quake2.protocol.MuzzleFlash(entity, weapon)¶
Class for representing a MuzzleFlash message
Muzzle flashes for player weapons.
- entity¶
The entity number
- weapon¶
The weapon id
- MuzzleFlash.__init__(entity, weapon)¶
- classmethod MuzzleFlash.read(file)¶
- classmethod MuzzleFlash.write(file, muzzle_flash)¶
MuzzleFlash2
Class¶
- class vgio.quake2.protocol.MuzzleFlash2(entity, flash_number)¶
Class for representing a MuzzleFlash2 message
Muzzle flashes for enemy weapons.
- entity¶
The entity number
- flash_number¶
The flash number
- MuzzleFlash2.__init__(entity, flash_number)¶
- classmethod MuzzleFlash2.read(file)¶
- classmethod MuzzleFlash2.write(file, muzzle_flash2)¶
TempEntity
Class¶
- class vgio.quake2.protocol.TempEntity(type, *args)¶
Class for representing a Temp_entity message
Creates a temporary entity. The attributes of the message depend on the type of entity being created.
- type¶
The type of the temporary entity.
- TempEntity.__init__(type, *args)¶
- classmethod TempEntity.read(file)¶
- classmethod TempEntity.write(file, temp_entity)¶
Layout
Class¶
- class vgio.quake2.protocol.Layout(text)¶
Class for representing a Layout message
Updates the player’s field computer via a simple scripting language.
- text¶
Script source as plain text
- Layout.__init__(text)¶
- classmethod Layout.read(file)¶
- classmethod Layout.write(file, layout)¶
Inventory
Class¶
- class vgio.quake2.protocol.Inventory(inventory)¶
Class for representing a Inventory message
- inventory¶
A sequence of exactly 256 integers representing the player’s current inventory item counts.
- Inventory.__init__(inventory)¶
- classmethod Inventory.read(file)¶
- classmethod Inventory.write(file, inventory)¶
Nop
Class¶
- class vgio.quake2.protocol.Nop¶
Class for representing a Nop message
- Nop.__init__()¶
- classmethod Nop.read(file)¶
- classmethod Nop.write(file, nop=None)¶
Disconnect
Class¶
- class vgio.quake2.protocol.Disconnect¶
Class for representing a Disconnect message
- Disconnect.__init__()¶
- classmethod Disconnect.read(file)¶
- classmethod Disconnect.write(file, disconnect=None)¶
Reconnect
Class¶
- class vgio.quake2.protocol.Reconnect¶
Class for representing a Reconnect message
- Reconnect.__init__()¶
- classmethod Reconnect.read(file)¶
- classmethod Reconnect.write(file, reconnect=None)¶
Sound
Class¶
- class vgio.quake2.protocol.Sound(flags, sound_number, volume=1.0, attenuation=1, offset=0, channel=0, entity=0, position=None)¶
Class for representing a Sound message
- flags¶
A bit field indicating what data is sent.
- sound_number¶
The sound number
- volume¶
The sound volume
- attenuation¶
The sound attenuation
- offset¶
The offset between the frame start and sound start
- channel¶
The sound channel, maximum of eight.
- entity¶
The entity that owns the sound
- position¶
The position of the sound
- Sound.__init__(flags, sound_number, volume=1.0, attenuation=1, offset=0, channel=0, entity=0, position=None)¶
- classmethod Sound.read(file)¶
- classmethod Sound.write(file, sound)¶
Print
Class¶
- class vgio.quake2.protocol.Print(level, text)¶
Class for representing a Print message
- level¶
Priority level of print
- text¶
The print text
- Print.__init__(level, text)¶
- classmethod Print.read(file)¶
- classmethod Print.write(file, print)¶
StuffText
Class¶
- class vgio.quake2.protocol.StuffText(text)¶
Class for representing a StuffText message
- text¶
The text sent to the client console.
- StuffText.__init__(text)¶
- classmethod StuffText.read(file)¶
- classmethod StuffText.write(file, stuff_text)¶
ServerData
Class¶
- class vgio.quake2.protocol.ServerData(protocol_version, server_count, attract_loop, game_directory, player_number, map_name)¶
Class for representing a ServerData message
- protocol_version¶
Protocol version of the server.
- server_count¶
Server identification.
- attract_loop¶
The demo type. A value of 0 indicates over wire network data.
- game_directory¶
The game directory. The default is the empty string which indicates ‘baseq2’
- player_number¶
The player id.
- map_name¶
The name of the level.
- ServerData.__init__(protocol_version, server_count, attract_loop, game_directory, player_number, map_name)¶
- classmethod ServerData.read(file)¶
- classmethod ServerData.write(file, server_data)¶
ConfigString
Class¶
- class vgio.quake2.protocol.ConfigString(index, text)¶
Class for representing a ConfigString message
- ConfigString.__init__(index, text)¶
- classmethod ConfigString.read(file)¶
- classmethod ConfigString.write(file, config_string)¶
SpawnBaseline
Class¶
- class vgio.quake2.protocol.SpawnBaseline(number=0, model_index=0, model_index_2=0, model_index_3=0, model_index_4=0, frame=0, skin_number=0, effects=0, render_fx=0, origin_x=0, origin_y=0, origin_z=0, angles_x=0, angles_y=0, angles_z=0, old_origin_x=0, old_origin_y=0, old_origin_z=0, sound=0, event=0, solid=0)¶
Class for representing a SpawnBaseline message
- SpawnBaseline.__init__(number=0, model_index=0, model_index_2=0, model_index_3=0, model_index_4=0, frame=0, skin_number=0, effects=0, render_fx=0, origin_x=0, origin_y=0, origin_z=0, angles_x=0, angles_y=0, angles_z=0, old_origin_x=0, old_origin_y=0, old_origin_z=0, sound=0, event=0, solid=0)¶
- classmethod SpawnBaseline.read(file)¶
- classmethod SpawnBaseline.write(file, spawn_baseline)¶
CenterPrint
Class¶
- class vgio.quake2.protocol.CenterPrint(text='')¶
Class for representing a Centerprint message
- CenterPrint.__init__(text='')¶
- classmethod CenterPrint.read(file)¶
- classmethod CenterPrint.write(file, center_print)¶
Download
Class¶
- class vgio.quake2.protocol.Download¶
Class for representing a Download message
- Download.__init__()¶
- classmethod Download.read(file)¶
- classmethod Download.write(file, download)¶
PlayerInfo
Class¶
- class vgio.quake2.protocol.PlayerInfo¶
Class for representing a PlayerInfo message
- PlayerInfo.__init__()¶
- classmethod PlayerInfo.read(file)¶
- classmethod PlayerInfo.write(file, player_info)¶
PacketEntities
Class¶
- class vgio.quake2.protocol.PacketEntities¶
Class for representing a PacketEntities message
- PacketEntities.__init__()¶
- classmethod PacketEntities.read(file)¶
- classmethod PacketEntities.write(file, packet_entities)¶
DeltaPacketEntities
Class¶
- class vgio.quake2.protocol.DeltaPacketEntities¶
Class for representing a DeltaPacketEntities message
- DeltaPacketEntities.__init__()¶
- classmethod DeltaPacketEntities.read(file)¶
- classmethod DeltaPacketEntities.write(file, delta_packet_entities)¶
Frame
Class¶
- class vgio.quake2.protocol.Frame(server_frame=0, delta_frame=0, areas=())¶
Class for representing a Frame message
- server_frame¶
- delta_frame¶
- areas¶
- Frame.__init__(server_frame=0, delta_frame=0, areas=())¶
- classmethod Frame.read(file)¶
- classmethod Frame.write(file, frame)¶
MessageBlock
Class¶
- class vgio.quake2.protocol.MessageBlock¶
Class for representing a message block
- messages¶
A sequence of messages.
- MessageBlock.__init__()¶
- static MessageBlock.read(file)¶
- static MessageBlock.write(file, message_block)¶