Go to the source code of this file.
Defines | |
#define | NUMVERTEXNORMALS 162 |
Functions | |
void | NET_WriteChar (struct dbuffer *buf, char c) |
void | NET_WriteByte (struct dbuffer *buf, byte c) |
void | NET_WriteShort (struct dbuffer *buf, int c) |
void | NET_WriteLong (struct dbuffer *buf, int c) |
void | NET_WriteString (struct dbuffer *buf, const char *str) |
void | NET_WriteRawString (struct dbuffer *buf, const char *str) |
void | NET_WriteCoord (struct dbuffer *buf, float f) |
void | NET_WritePos (struct dbuffer *buf, const vec3_t pos) |
void | NET_Write2Pos (struct dbuffer *buf, vec2_t pos) |
void | NET_WriteGPos (struct dbuffer *buf, const pos3_t pos) |
void | NET_WriteAngle (struct dbuffer *buf, float f) |
void | NET_WriteAngle16 (struct dbuffer *buf, float f) |
void | NET_WriteDir (struct dbuffer *buf, const vec3_t vector) |
void | NET_vWriteFormat (struct dbuffer *buf, const char *format, va_list ap) |
Writes to buffer according to format; version without syntactic sugar for variable arguments, to call it from other functions with variable arguments. | |
void | NET_WriteFormat (struct dbuffer *buf, const char *format,...) |
The user-friendly version of NET_WriteFormat that writes variable arguments to buffer according to format. | |
void | NET_VPrintf (struct dbuffer *buf, const char *format, va_list ap, char *str, size_t length) |
void | NET_WriteMsg (struct net_stream *s, struct dbuffer *buf) |
Enqueue the buffer in the net stream for ONE client. | |
void | NET_WriteConstMsg (struct net_stream *s, const struct dbuffer *buf) |
Enqueue the buffer in the net stream for MULTIPLE clients. | |
void | NET_OOB_Printf (struct net_stream *s, const char *format,...) __attribute__((format(printf |
void int | NET_ReadChar (struct dbuffer *buf) |
int | NET_ReadByte (struct dbuffer *buf) |
Reads a byte from the netchannel. | |
int | NET_ReadShort (struct dbuffer *buf) |
int | NET_PeekShort (const struct dbuffer *buf) |
Peeks into a buffer without changing it to get a short int. | |
int | NET_ReadLong (struct dbuffer *buf) |
int | NET_ReadString (struct dbuffer *buf, char *string, size_t length) |
int | NET_ReadStringLine (struct dbuffer *buf, char *string, size_t length) |
float | NET_ReadCoord (struct dbuffer *buf) |
void | NET_ReadPos (struct dbuffer *buf, vec3_t pos) |
void | NET_Read2Pos (struct dbuffer *buf, vec2_t pos) |
void | NET_ReadGPos (struct dbuffer *buf, pos3_t pos) |
float | NET_ReadAngle (struct dbuffer *buf) |
float | NET_ReadAngle16 (struct dbuffer *buf) |
void | NET_ReadDir (struct dbuffer *buf, vec3_t vector) |
void | NET_ReadData (struct dbuffer *buf, void *buffer, int size) |
void | NET_vReadFormat (struct dbuffer *buf, const char *format, va_list ap) |
Reads from a buffer according to format; version without syntactic sugar for variable arguments, to call it from other functions with variable arguments. | |
void | NET_ReadFormat (struct dbuffer *buf, const char *format,...) |
The user-friendly version of NET_ReadFormat that reads variable arguments from a buffer according to format. | |
struct dbuffer * | NET_ReadMsg (struct net_stream *s) |
Reads messages from the network channel and adds them to the dbuffer where you can use the NET_Read* functions to get the values in the correct order. | |
Variables | |
const vec3_t | bytedirs [NUMVERTEXNORMALS] |
Definition in file netpack.h.
void NET_OOB_Printf | ( | struct net_stream * | s, | |
const char * | format, | |||
... | ||||
) |
int NET_PeekShort | ( | const struct dbuffer * | buf | ) |
Peeks into a buffer without changing it to get a short int.
buf | The buffer, returned unchanged, no need to be copied before. |
Definition at line 262 of file netpack.c.
References dbuffer_get(), and LittleShort().
Referenced by CL_CheckDefault().
float NET_ReadAngle | ( | struct dbuffer * | buf | ) |
Definition at line 375 of file netpack.c.
References NET_ReadChar().
Referenced by NET_vReadFormat(), and SV_ReadAngle().
float NET_ReadAngle16 | ( | struct dbuffer * | buf | ) |
Definition at line 380 of file netpack.c.
References NET_ReadShort(), and SHORT2ANGLE.
int NET_ReadByte | ( | struct dbuffer * | buf | ) |
Reads a byte from the netchannel.
Definition at line 239 of file netpack.c.
References dbuffer_extract().
Referenced by CL_ActorDoMove(), CL_DoEndRound(), CL_EndRoundAnnounce(), CL_GetEventTime(), CL_ParseEvent(), CL_ParseResults(), CL_ParseServerMessage(), CL_PingServerCallback(), CL_RconCallback(), CL_ReadPackets(), CL_ServerInfoCallback(), CL_StartGame(), CP_ParseCharacterData(), NET_ReadData(), NET_ReadDir(), NET_ReadGPos(), NET_ReadString(), NET_ReadStringLine(), NET_vReadFormat(), SV_ReadByte(), and SV_ReadPacket().
void int NET_ReadChar | ( | struct dbuffer * | buf | ) |
returns -1 if no more characters are available
Definition at line 225 of file netpack.c.
References dbuffer_extract().
Referenced by NET_ReadAngle(), NET_vReadFormat(), and SV_ReadChar().
float NET_ReadCoord | ( | struct dbuffer * | buf | ) |
Definition at line 339 of file netpack.c.
References NET_ReadLong().
void NET_ReadData | ( | struct dbuffer * | buf, | |
void * | buffer, | |||
int | size | |||
) |
Definition at line 388 of file netpack.c.
References byte, i, and NET_ReadByte().
Referenced by SV_ReadData().
Definition at line 396 of file netpack.c.
References bytedirs, Com_Error(), ERR_DROP, lengthof, NET_ReadByte(), and VectorCopy.
Referenced by NET_vReadFormat(), and SV_ReadDir().
void NET_ReadFormat | ( | struct dbuffer * | buf, | |
const char * | format, | |||
... | ||||
) |
The user-friendly version of NET_ReadFormat that reads variable arguments from a buffer according to format.
Definition at line 475 of file netpack.c.
References NET_vReadFormat().
Referenced by CL_ActorAdd(), CL_ActorAppear(), CL_ActorDie(), CL_ActorDoorAction(), CL_ActorDoShoot(), CL_ActorDoShootTime(), CL_ActorDoThrow(), CL_ActorDoTurn(), CL_ActorReactionFireChange(), CL_ActorReservationChange(), CL_ActorResetClientAction(), CL_ActorRevitalised(), CL_ActorShootHidden(), CL_ActorShootHiddenTime(), CL_ActorStartShoot(), CL_ActorStateChange(), CL_ActorStats(), CL_AddBrushModel(), CL_AddEdict(), CL_CenterView(), CL_DoorClose(), CL_DoorOpen(), CL_EntAppear(), CL_EntDestroy(), CL_EntPerish(), CL_GetEventTime(), CL_InvAmmo(), CL_InvDel(), CL_InvReload(), CL_NetReceiveItem(), CL_ParticleAppear(), CL_ParticleSpawnEvent(), and CL_Reset().
Definition at line 368 of file netpack.c.
References NET_ReadByte().
Referenced by NET_vReadFormat(), and SV_ReadGPos().
int NET_ReadLong | ( | struct dbuffer * | buf | ) |
Definition at line 271 of file netpack.c.
References dbuffer_extract(), and LittleLong().
Referenced by CL_ParseServerData(), CP_ParseCharacterData(), NET_Read2Pos(), NET_ReadCoord(), NET_ReadPos(), NET_vReadFormat(), and SV_ReadLong().
struct dbuffer* NET_ReadMsg | ( | struct net_stream * | s | ) | [read] |
Reads messages from the network channel and adds them to the dbuffer where you can use the NET_Read* functions to get the values in the correct order.
Definition at line 556 of file netpack.c.
References dbuffer_add(), len, LittleLong(), NET_StreamDequeue(), NET_StreamGetLength(), NET_StreamPeek(), and new_dbuffer().
Referenced by CL_PingServerCallback(), CL_RconCallback(), CL_ReadPackets(), CL_ServerInfoCallback(), and SV_ReadPacket().
Definition at line 356 of file netpack.c.
References NET_ReadLong().
Referenced by CL_ParseStartSoundPacket(), NET_vReadFormat(), and SV_ReadPos().
int NET_ReadShort | ( | struct dbuffer * | buf | ) |
Definition at line 248 of file netpack.c.
References dbuffer_extract(), and LittleShort().
Referenced by CL_ActorAdd(), CL_ActorAppear(), CL_ActorDoMove(), CL_ActorDoMoveTime(), CL_ActorDoThrowTime(), CL_ActorStats(), CL_Explode(), CL_GetEventTime(), CL_InvAdd(), CL_ParseConfigString(), CL_ParseServerData(), CP_ParseCharacterData(), NET_ReadAngle16(), NET_vReadFormat(), and SV_ReadShort().
int NET_ReadString | ( | struct dbuffer * | buf, | |
char * | string, | |||
size_t | length | |||
) |
char *s = NET_ReadString(sb); char *t = NET_ReadString(sb);
The second reading uses the same data buffer for the string - so s is no longer the first - but the second string [in,out] | buf | The input buffer to read the string data from |
[out] | string | The output buffer to read the string into |
[in] | length | The size of the output buffer |
Definition at line 292 of file netpack.c.
References NET_ReadByte().
Referenced by CL_ConnectionlessPacket(), CL_ParseServerData(), CL_ParseServerInfoMessage(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseTeamInfoMessage(), CL_PingServerCallback(), CL_RconCallback(), CL_SetConfigString(), NET_vReadFormat(), SV_ExecuteClientMessage(), and SV_ReadString().
int NET_ReadStringLine | ( | struct dbuffer * | buf, | |
char * | string, | |||
size_t | length | |||
) |
Definition at line 317 of file netpack.c.
References NET_ReadByte().
Referenced by CL_ConnectionlessPacket(), CL_PingServerCallback(), CL_RconCallback(), CL_ServerInfoCallback(), and SV_ConnectionlessPacket().
void NET_VPrintf | ( | struct dbuffer * | buf, | |
const char * | format, | |||
va_list | ap, | |||
char * | str, | |||
size_t | length | |||
) |
Definition at line 581 of file netpack.c.
References dbuffer_add(), len, and Q_vsnprintf().
Referenced by SV_BroadcastPrintf(), SV_ClientCommand(), and SV_ClientPrintf().
void NET_vReadFormat | ( | struct dbuffer * | buf, | |
const char * | format, | |||
va_list | ap | |||
) |
Reads from a buffer according to format; version without syntactic sugar for variable arguments, to call it from other functions with variable arguments.
[in] | buf | The buffer we read the data from |
[in] | format | The format string may not be NULL |
Definition at line 411 of file netpack.c.
References byte, Com_Error(), ERR_DROP, i, NET_ReadAngle(), NET_ReadByte(), NET_ReadChar(), NET_ReadDir(), NET_ReadGPos(), NET_ReadLong(), NET_ReadPos(), NET_ReadShort(), and NET_ReadString().
Referenced by NET_ReadFormat(), and SV_ReadFormat().
void NET_vWriteFormat | ( | struct dbuffer * | buf, | |
const char * | format, | |||
va_list | ap | |||
) |
Writes to buffer according to format; version without syntactic sugar for variable arguments, to call it from other functions with variable arguments.
Definition at line 141 of file netpack.c.
References byte, Com_Error(), ERR_DROP, i, NET_WriteAngle(), NET_WriteByte(), NET_WriteChar(), NET_WriteDir(), NET_WriteGPos(), NET_WriteLong(), NET_WritePos(), NET_WriteShort(), and NET_WriteString().
Referenced by MSG_Write_PA(), NET_WriteFormat(), and SV_WriteFormat().
void NET_WriteAngle | ( | struct dbuffer * | buf, | |
float | f | |||
) |
Definition at line 98 of file netpack.c.
References NET_WriteByte().
Referenced by NET_vWriteFormat(), and SV_WriteAngle().
void NET_WriteAngle16 | ( | struct dbuffer * | buf, | |
float | f | |||
) |
Definition at line 103 of file netpack.c.
References ANGLE2SHORT, and NET_WriteShort().
Definition at line 36 of file netpack.c.
References dbuffer_add().
Referenced by CL_ConnectionlessPacket(), CL_Disconnect(), CL_ForwardToServer_f(), CL_NextRound_f(), CL_RequestNextDownload(), CL_SendChangedUserinfos(), Cmd_ForwardToServer(), GAME_CP_InitializeBattlescape(), GAME_NetSendCharacter(), GAME_SendCurrentTeamSpawningInfo(), GAME_SpawnSoldiers(), NET_vWriteFormat(), NET_WriteAngle(), NET_WriteDir(), NET_WriteGPos(), SV_AddEvent(), SV_BroadcastPrintf(), SV_ClientCommand(), SV_ClientPrintf(), SV_Configstring(), SV_DropClient(), SV_EndEvents(), SV_FinalMessage(), SV_FindIndex(), SV_New_f(), SV_StartSound(), SV_WriteByte(), SV_WriteDummyByte(), SVC_Status(), and SVC_TeamInfo().
void NET_WriteChar | ( | struct dbuffer * | buf, | |
char | c | |||
) |
Definition at line 31 of file netpack.c.
References dbuffer_add().
Referenced by NET_vWriteFormat(), and SV_WriteChar().
void NET_WriteConstMsg | ( | struct net_stream * | s, | |
const struct dbuffer * | buf | |||
) |
Enqueue the buffer in the net stream for MULTIPLE clients.
Definition at line 534 of file netpack.c.
References dbuffer_get_at(), dbuffer_len, len, LittleLong(), NET_StreamEnqueue(), and pos.
Referenced by SV_BroadcastPrintf(), SV_FinalMessage(), and SV_Multicast().
void NET_WriteCoord | ( | struct dbuffer * | buf, | |
float | f | |||
) |
Definition at line 67 of file netpack.c.
References NET_WriteLong().
Definition at line 112 of file netpack.c.
References bytedirs, DotProduct, i, lengthof, and NET_WriteByte().
Referenced by NET_vWriteFormat(), and SV_WriteDir().
void NET_WriteFormat | ( | struct dbuffer * | buf, | |
const char * | format, | |||
... | ||||
) |
The user-friendly version of NET_WriteFormat that writes variable arguments to buffer according to format.
Definition at line 211 of file netpack.c.
References NET_vWriteFormat().
Referenced by CL_NetSendItem(), and MSG_Write_PA().
Definition at line 91 of file netpack.c.
References NET_WriteByte().
Referenced by NET_vWriteFormat(), and SV_WriteGPos().
void NET_WriteLong | ( | struct dbuffer * | buf, | |
int | c | |||
) |
Definition at line 47 of file netpack.c.
References dbuffer_add(), and LittleLong().
Referenced by GAME_NetSendCharacter(), NET_vWriteFormat(), NET_Write2Pos(), NET_WriteCoord(), NET_WritePos(), SV_New_f(), and SV_WriteLong().
void NET_WriteMsg | ( | struct net_stream * | s, | |
struct dbuffer * | buf | |||
) |
Enqueue the buffer in the net stream for ONE client.
Definition at line 512 of file netpack.c.
References dbuffer_extract(), dbuffer_len, free_dbuffer(), len, LittleLong(), and NET_StreamEnqueue().
Referenced by CL_ConnectionlessPacket(), CL_Disconnect(), CL_ForwardToServer_f(), CL_NextRound_f(), CL_RequestNextDownload(), CL_SendChangedUserinfos(), Cmd_ForwardToServer(), GAME_CP_InitializeBattlescape(), GAME_SpawnSoldiers(), MSG_Write_PA(), SV_ClientCommand(), SV_ClientPrintf(), SV_DropClient(), SV_New_f(), SVC_Status(), and SVC_TeamInfo().
Definition at line 84 of file netpack.c.
References NET_WriteLong().
Referenced by NET_vWriteFormat(), SV_StartSound(), and SV_WritePos().
void NET_WriteRawString | ( | struct dbuffer * | buf, | |
const char * | str | |||
) |
Definition at line 61 of file netpack.c.
References dbuffer_add().
Referenced by SVC_Status(), and SVC_TeamInfo().
void NET_WriteShort | ( | struct dbuffer * | buf, | |
int | c | |||
) |
Definition at line 41 of file netpack.c.
References dbuffer_add(), and LittleShort().
Referenced by CL_NetSendInventory(), GAME_CP_InitializeBattlescape(), GAME_NetSendCharacter(), NET_vWriteFormat(), NET_WriteAngle16(), SV_Configstring(), SV_FindIndex(), SV_New_f(), and SV_WriteShort().
void NET_WriteString | ( | struct dbuffer * | buf, | |
const char * | str | |||
) |
Definition at line 53 of file netpack.c.
References dbuffer_add().
Referenced by CL_ConnectionlessPacket(), CL_Disconnect(), CL_RequestNextDownload(), CL_SendChangedUserinfos(), GAME_NetSendCharacter(), GAME_SpawnSoldiers(), NET_vWriteFormat(), SV_Configstring(), SV_DropClient(), SV_FinalMessage(), SV_FindIndex(), SV_New_f(), SV_StartSound(), SV_WriteString(), and SVC_TeamInfo().
Definition at line 27 of file netpack.c.
Referenced by LE_ActorBodyHit(), LE_AddProjectile(), LET_Projectile(), NET_ReadDir(), and NET_WriteDir().