#include "shared/shared.h"
#include "common/msg.h"
#include "common/protocol.h"
#include "common/sizebuf.h"
#include "common/math.h"
Go to the source code of this file.
Macros | |
#define | COORD2SHORT(x) ((int)((x)*8.0f)) |
#define | SHORT2COORD(x) ((x)*(1.0f/8)) |
#define | ANGLE2BYTE(x) ((int)((x)*256.0f/360)&255) |
#define | BYTE2ANGLE(x) ((x)*(360.0f/256)) |
Functions | |
void | MSG_Init (void) |
void | MSG_BeginWriting (void) |
void | MSG_WriteChar (int c) |
void | MSG_WriteByte (int c) |
void | MSG_WriteShort (int c) |
void | MSG_WriteLong (int c) |
void | MSG_WriteString (const char *string) |
static void | MSG_WriteCoord (float f) |
void | MSG_WritePos (const vec3_t pos) |
void | MSG_WriteAngle (float f) |
void | MSG_WriteDir (const vec3_t dir) |
void | MSG_PackEntity (entity_packed_t *out, const entity_state_t *in, qboolean short_angles) |
void | MSG_WriteDeltaEntity (const entity_packed_t *from, const entity_packed_t *to, msgEsFlags_t flags) |
void | MSG_PackPlayer (player_packed_t *out, const player_state_t *in) |
void | MSG_WriteDeltaPlayerstate_Default (const player_packed_t *from, const player_packed_t *to) |
int | MSG_WriteDeltaPlayerstate_Enhanced (const player_packed_t *from, player_packed_t *to, msgPsFlags_t flags) |
void | MSG_BeginReading (void) |
byte * | MSG_ReadData (size_t len) |
int | MSG_ReadChar (void) |
int | MSG_ReadByte (void) |
int | MSG_ReadShort (void) |
int | MSG_ReadWord (void) |
int | MSG_ReadLong (void) |
size_t | MSG_ReadString (char *dest, size_t size) |
size_t | MSG_ReadStringLine (char *dest, size_t size) |
static float | MSG_ReadCoord (void) |
void | MSG_ReadPos (vec3_t pos) |
static float | MSG_ReadAngle (void) |
static float | MSG_ReadAngle16 (void) |
void | MSG_ReadDir (vec3_t dir) |
void | MSG_ReadDeltaUsercmd (const usercmd_t *from, usercmd_t *to) |
void | MSG_ReadDeltaUsercmd_Hacked (const usercmd_t *from, usercmd_t *to) |
int | MSG_ReadBits (int bits) |
void | MSG_ReadDeltaUsercmd_Enhanced (const usercmd_t *from, usercmd_t *to, int version) |
Variables | |
sizebuf_t | msg_write |
byte | msg_write_buffer [MAX_MSGLEN] |
sizebuf_t | msg_read |
byte | msg_read_buffer [MAX_MSGLEN] |
const entity_packed_t | nullEntityState |
const player_packed_t | nullPlayerState |
const usercmd_t | nullUserCmd |
Definition at line 1437 of file msg.c.
Referenced by CL_ConnectionlessPacket(), NetchanNew_Process(), NetchanOld_Process(), and SV_ConnectionlessPacket().
void MSG_PackEntity | ( | entity_packed_t * | out, |
const entity_state_t * | in, | ||
qboolean | short_angles | ||
) |
Definition at line 468 of file msg.c.
Referenced by build_gamestate(), CL_GTV_EmitFrame(), CL_Record_f(), create_baselines(), emit_base_frame(), emit_frame(), emit_packet_entities(), and SV_BuildClientFrame().
void MSG_PackPlayer | ( | player_packed_t * | out, |
const player_state_t * | in | ||
) |
Definition at line 763 of file msg.c.
Referenced by build_gamestate(), CL_GTV_EmitFrame(), emit_base_frame(), emit_delta_frame(), emit_frame(), and SV_BuildClientFrame().
|
inlinestatic |
|
inlinestatic |
Definition at line 1718 of file msg.c.
Referenced by MSG_ReadDeltaUsercmd_Enhanced(), and SV_NewClientExecuteMove().
Definition at line 1475 of file msg.c.
Referenced by AC_ParseClientAck(), AC_ParseMessage(), AC_ParseQueryReply(), CL_GetDemoInfo(), CL_ParseDownload(), CL_ParseFrame(), CL_ParseMuzzleFlashPacket(), CL_ParsePrint(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseTEntPacket(), CL_SeekDemoMessage(), MSG_ReadBits(), MSG_ReadDeltaUsercmd(), MSG_ReadDeltaUsercmd_Hacked(), MSG_ReadDir(), MSG_ReadString(), MSG_ReadStringLine(), MVD_ParseFrame(), MVD_ParseMessage(), MVD_ParseMulticast(), MVD_ParsePacketPlayers(), MVD_ParsePrint(), MVD_ParseSound(), MVD_ParseUnicast(), MVD_UnicastPrint(), NetchanNew_Process(), NetchanOld_Process(), parse_message(), read_level_file(), read_server_file(), SV_ExecuteClientMessage(), SV_GetSaveInfo(), SV_NewClientExecuteMove(), and SV_OldClientExecuteMove().
Definition at line 1461 of file msg.c.
Referenced by MSG_ReadAngle(), MSG_ReadBits(), and MSG_ReadDeltaUsercmd_Hacked().
|
inlinestatic |
Definition at line 1575 of file msg.c.
Referenced by MSG_ReadPos().
byte* MSG_ReadData | ( | size_t | len | ) |
Definition at line 1443 of file msg.c.
Referenced by MSG_ReadByte(), MSG_ReadChar(), MSG_ReadLong(), MSG_ReadShort(), MSG_ReadWord(), and read_level_file().
void MSG_ReadDeltaUsercmd | ( | const usercmd_t * | from, |
usercmd_t * | to | ||
) |
void MSG_ReadDeltaUsercmd_Hacked | ( | const usercmd_t * | from, |
usercmd_t * | to | ||
) |
void MSG_ReadDir | ( | vec3_t | dir | ) |
Definition at line 1517 of file msg.c.
Referenced by AC_ParseClient(), CL_ConnectionlessPacket(), CL_GetDemoInfo(), CL_ParseFrame(), CL_ParseServerData(), CL_ParseSetting(), CL_ParseTEntPacket(), MSG_ReadBits(), MVD_ParseServerData(), NetchanNew_Process(), NetchanOld_Process(), parse_hello(), read_level_file(), read_server_file(), SV_ConnectionlessPacket(), SV_GetSaveInfo(), SV_NewClientExecuteMove(), and SV_OldClientExecuteMove().
void MSG_ReadPos | ( | vec3_t | pos | ) |
Definition at line 1580 of file msg.c.
Referenced by CL_ParseStartSoundPacket(), and CL_ParseTEntPacket().
Definition at line 1489 of file msg.c.
Referenced by CL_GetDemoInfo(), CL_ParseDownload(), CL_ParseFrame(), CL_ParseGamestate(), CL_ParseInventory(), CL_ParseMuzzleFlashPacket(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseTEntPacket(), CL_SeekDemoMessage(), MSG_ReadAngle16(), MSG_ReadBits(), MSG_ReadCoord(), MSG_ReadDeltaUsercmd(), MSG_ReadDeltaUsercmd_Hacked(), MVD_ParseConfigstring(), MVD_ParsePacketPlayers(), MVD_ParseServerData(), MVD_ParseSound(), MVD_UnicastString(), NetchanNew_Process(), NetchanOld_Process(), parse_stream_start(), read_level_file(), and SV_ParseClientSetting().
size_t MSG_ReadString | ( | char * | dest, |
size_t | size | ||
) |
Definition at line 1531 of file msg.c.
Referenced by AC_ParseError(), AC_ParseFileViolation(), AC_ParseViolation(), CL_GetDemoInfo(), CL_ParseCenterPrint(), CL_ParseConfigstring(), CL_ParseInfoMessage(), CL_ParseLayout(), CL_ParsePrint(), CL_ParsePrintMessage(), CL_ParseServerData(), CL_ParseStuffText(), CL_SeekDemoMessage(), MVD_ParseConfigstring(), MVD_ParsePrint(), MVD_ParseServerData(), MVD_UnicastLayout(), MVD_UnicastPrint(), MVD_UnicastString(), MVD_UnicastStuff(), parse_hello(), parse_stringcmd(), read_level_file(), read_server_file(), SV_GetSaveInfo(), SV_ParseClientCommand(), SV_ParseDeltaUserinfo(), and SV_ParseFullUserinfo().
size_t MSG_ReadStringLine | ( | char * | dest, |
size_t | size | ||
) |
Definition at line 1553 of file msg.c.
Referenced by CL_ConnectionlessPacket(), and SV_ConnectionlessPacket().
Definition at line 1503 of file msg.c.
Referenced by AC_ParseClient(), CL_ParseZPacket(), MVD_ParseMulticast(), and parse_hello().
void MSG_WriteAngle | ( | float | f | ) |
Definition at line 214 of file msg.c.
Referenced by SV_InitGameProgs().
Definition at line 107 of file msg.c.
Referenced by AC_Announce(), AC_ClientConnect(), AC_ClientDisconnect(), AC_ClientQuery(), AC_SendChecks(), AC_SendHello(), AC_SendPing(), AC_SendPrefs(), AC_WriteString(), CL_ClientCommand(), CL_ConnectionlessPacket(), CL_Disconnect(), CL_EmitDemoSnapshot(), CL_GTV_EmitFrame(), CL_Record_f(), CL_SendBatchedCmd(), CL_SendDefaultCmd(), CL_SendUserinfo(), CL_UpdateBlendSetting(), CL_UpdateFootstepsSetting(), CL_UpdateGibSetting(), CL_UpdateGunSetting(), CL_UpdatePredictSetting(), CL_UpdateRecordingSetting(), demo_emit_snapshot(), emit_base_frame(), emit_delta_frame(), emit_frame(), emit_gamestate(), emit_snd(), gtv_forward_cmd(), handle_filtercmd(), MSG_WriteAngle(), MSG_WriteDeltaEntity(), MSG_WriteDeltaPlayerstate_Default(), MSG_WriteDeltaPlayerstate_Enhanced(), MSG_WriteDir(), MSG_WriteString(), MVD_BroadcastPrintf(), MVD_ChangeLevel(), MVD_LayoutChannels(), MVD_LayoutClients(), MVD_LayoutFollow(), MVD_LayoutMenu(), MVD_LayoutScores(), MVD_ParseSound(), MVD_SwitchChannel(), MVD_UpdateConfigstring(), PF_bprintf(), PF_centerprintf(), PF_configstring(), PF_cprintf(), PF_PositionedSound(), PF_StartSound(), redirect(), stuff_cmds(), SV_BeginDownload_f(), SV_BroadcastCommand(), SV_BroadcastPrintf(), SV_ClientCommand(), SV_ClientPrintf(), SV_DropClient(), SV_FinalMessage(), SV_FlushRedirect(), SV_InitGameProgs(), SV_New_f(), SV_StopDownload_f(), SV_Stuff_f(), SV_StuffAll_f(), SV_WriteFrameToClient_Default(), SV_WriteFrameToClient_Enhanced(), write_cs_list(), write_datagram_new(), write_level_file(), write_plain_baselines(), write_plain_configstrings(), and write_server_file().
Definition at line 89 of file msg.c.
Referenced by MSG_WriteDeltaPlayerstate_Default(), MSG_WriteDeltaPlayerstate_Enhanced(), and SV_InitGameProgs().
|
inlinestatic |
Definition at line 188 of file msg.c.
Referenced by MSG_WritePos().
void MSG_WriteDeltaEntity | ( | const entity_packed_t * | from, |
const entity_packed_t * | to, | ||
msgEsFlags_t | flags | ||
) |
Definition at line 505 of file msg.c.
Referenced by CL_GTV_EmitFrame(), CL_Record_f(), emit_base_frame(), emit_frame(), emit_gamestate(), emit_packet_entities(), SV_EmitPacketEntities(), and write_baseline().
void MSG_WriteDeltaPlayerstate_Default | ( | const player_packed_t * | from, |
const player_packed_t * | to | ||
) |
Definition at line 795 of file msg.c.
Referenced by emit_delta_frame(), and SV_WriteFrameToClient_Default().
int MSG_WriteDeltaPlayerstate_Enhanced | ( | const player_packed_t * | from, |
player_packed_t * | to, | ||
msgPsFlags_t | flags | ||
) |
void MSG_WriteDir | ( | const vec3_t | dir | ) |
Definition at line 460 of file msg.c.
Referenced by SV_InitGameProgs().
Definition at line 144 of file msg.c.
Referenced by AC_ClientConnect(), AC_ClientDisconnect(), AC_ClientQuery(), AC_SendChecks(), AC_SendHello(), AC_SendPrefs(), CL_Record_f(), CL_SendBatchedCmd(), CL_SendDefaultCmd(), emit_delta_frame(), emit_gamestate(), MSG_WriteDeltaEntity(), MSG_WriteDeltaPlayerstate_Default(), MSG_WriteDeltaPlayerstate_Enhanced(), parse_hello(), redirect(), send_hello(), SV_InitGameProgs(), SV_New_f(), SV_WriteFrameToClient_Default(), SV_WriteFrameToClient_Enhanced(), write_level_file(), and write_server_file().
void MSG_WritePos | ( | const vec3_t | pos | ) |
Definition at line 198 of file msg.c.
Referenced by MVD_ParseSound(), PF_PositionedSound(), PF_StartSound(), and SV_InitGameProgs().
Definition at line 125 of file msg.c.
Referenced by AC_ClientConnect(), AC_ClientDisconnect(), AC_ClientQuery(), AC_SendChecks(), AC_SendHello(), AC_SendPing(), AC_SendPrefs(), CL_EmitDemoSnapshot(), CL_GTV_EmitFrame(), CL_Record_f(), CL_UpdateBlendSetting(), CL_UpdateFootstepsSetting(), CL_UpdateGibSetting(), CL_UpdateGunSetting(), CL_UpdatePredictSetting(), CL_UpdateRecordingSetting(), demo_emit_snapshot(), emit_base_frame(), emit_frame(), emit_gamestate(), emit_packet_entities(), emit_snd(), MSG_WriteCoord(), MSG_WriteDeltaEntity(), MSG_WriteDeltaPlayerstate_Default(), MSG_WriteDeltaPlayerstate_Enhanced(), MVD_ParseSound(), MVD_UpdateConfigstring(), PF_configstring(), PF_PositionedSound(), PF_StartSound(), send_hello(), send_stream_start(), SV_BeginDownload_f(), SV_EmitPacketEntities(), SV_InitGameProgs(), SV_New_f(), SV_StopDownload_f(), write_cs_list(), write_level_file(), and write_plain_configstrings().
void MSG_WriteString | ( | const char * | string | ) |
Definition at line 160 of file msg.c.
Referenced by CL_ClientCommand(), CL_EmitDemoSnapshot(), CL_Record_f(), CL_SendUserinfo(), emit_gamestate(), MVD_ChangeLevel(), MVD_LayoutScores(), MVD_SwitchChannel(), MVD_UpdateConfigstring(), redirect(), send_hello(), SV_FinalMessage(), SV_InitGameProgs(), SV_New_f(), SV_Stuff_f(), SV_StuffAll_f(), write_cs_list(), and write_server_file().
sizebuf_t msg_read |
Definition at line 37 of file msg.c.
Referenced by AC_ParseClient(), AC_ParseClientAck(), AC_ParseFileViolation(), AC_ParseMessage(), AC_ParseQueryReply(), AC_ParseViolation(), CL_PacketEvent(), CL_ParseDownload(), CL_ParseFrame(), CL_ParseGamestate(), CL_ParsePacketEntities(), CL_ParseServerMessage(), CL_ParseZPacket(), CL_Seek_f(), CL_SeekDemoMessage(), demo_read_message(), demo_skip_map(), FIFO_ReadMessage(), MSG_BeginReading(), MSG_Init(), MSG_ReadBits(), MSG_ReadData(), MVD_ParseFrame(), MVD_ParseMessage(), MVD_ParseMulticast(), MVD_ParsePacketEntities(), MVD_ParsePacketPlayers(), MVD_ParseServerData(), MVD_ParseUnicast(), MVD_Seek_f(), MVD_UnicastPrint(), MVD_UnicastString(), MVD_UnicastStuff(), MVD_WriteDemoMessage(), NET_GetUdpPackets(), NetchanNew_Process(), NetchanOld_Process(), parse_message(), parse_stream_data(), read_binary_file(), read_first_message(), read_level_file(), read_next_message(), read_server_file(), SV_ExecuteClientMessage(), SV_NewClientExecuteMove(), SV_PacketEvent(), and SV_ParseDeltaUserinfo().
byte msg_read_buffer[MAX_MSGLEN] |
Definition at line 38 of file msg.c.
Referenced by CL_ParseZPacket(), demo_load_message(), demo_read_message(), demo_skip_map(), FIFO_ReadMessage(), MSG_Init(), NET_GetUdpPackets(), read_binary_file(), read_first_message(), and read_next_message().
sizebuf_t msg_write |
Definition at line 34 of file msg.c.
Referenced by AC_Announce(), AC_Flush(), AC_Write(), CL_Disconnect(), CL_EmitDemoFrame(), CL_EmitDemoSnapshot(), CL_GTV_EmitFrame(), CL_GTV_Resume(), CL_Record_f(), CL_SendBatchedCmd(), CL_SendDefaultCmd(), compress_message(), demo_emit_snapshot(), filter_unicast_data(), gtv_forward_cmd(), MSG_BeginWriting(), MSG_Init(), MSG_WriteByte(), MSG_WriteChar(), MSG_WriteLong(), MSG_WriteShort(), MVD_BroadcastPrintf(), MVD_ChangeLevel(), MVD_Frame(), MVD_StreamedRecord_f(), MVD_UpdateConfigstring(), parse_hello(), parse_stream_start(), PF_bprintf(), PF_configstring(), PF_cprintf(), PF_Unicast(), rec_frame(), rec_start(), rec_write(), redirect(), repack_unreliables(), resume_streams(), send_hello(), send_stream_start(), SV_BroadcastCommand(), SV_BroadcastPrintf(), SV_ClientAddMessage(), SV_FinalMessage(), SV_Multicast(), SV_MvdEndFrame(), SV_MvdMapChanged(), SV_MvdMulticast(), SV_MvdUnicast(), SV_RunGameFrame(), SV_StuffAll_f(), SV_WriteFrameToClient_Enhanced(), write_datagram_new(), write_datagram_old(), write_level_file(), write_message(), write_msg(), write_plain_baselines(), write_plain_configstrings(), write_server_file(), and write_snd().
byte msg_write_buffer[MAX_MSGLEN] |
Definition at line 35 of file msg.c.
Referenced by MSG_Init().
const entity_packed_t nullEntityState |
Definition at line 40 of file msg.c.
Referenced by MSG_WriteDeltaEntity(), and SV_EmitPacketEntities().
const player_packed_t nullPlayerState |
Definition at line 41 of file msg.c.
Referenced by MSG_WriteDeltaPlayerstate_Default(), and MSG_WriteDeltaPlayerstate_Enhanced().