cl_parse.c File Reference

Parse a message (event) received from the server. More...

#include "../client.h"
#include "cl_localentity.h"
#include "cl_parse.h"
#include "cl_hud.h"
#include "../cl_game.h"
#include "../ui/ui_main.h"
#include "events/e_parse.h"
#include "../multiplayer/mp_chatmessages.h"
Include dependency graph for cl_parse.c:

Go to the source code of this file.

Functions

static void CL_ParseServerData (struct dbuffer *msg)
 Written by SV_New_f in sv_user.c.
static void CL_ParseClientinfo (int player)
 Parses client names that are displayed on the targeting box for multiplayer games.
const char * CL_PlayerGetName (int player)
 Get the player name.
static void CL_ParseConfigString (struct dbuffer *msg)
static void CL_ParseStartSoundPacket (struct dbuffer *msg)
 Parsed a server send sound package.
void CL_ParseServerMessage (svc_ops_t cmd, struct dbuffer *msg)
 Parses the server sent data from the given buffer.

Variables

static const char * svc_strings [UCHAR_MAX+1]
 see also svc_ops_e in common.h

Detailed Description

Parse a message (event) received from the server.

Definition in file cl_parse.c.


Function Documentation

static void CL_ParseClientinfo ( int  player  )  [static]

Parses client names that are displayed on the targeting box for multiplayer games.

See also:
CL_AddTargetingBoX

Definition at line 98 of file cl_parse.c.

References clientinfo_t::cinfo, cl, CL_PlayerGetName(), clientinfo_t::name, and Q_strncpyz().

Referenced by CL_ParseConfigString().

static void CL_ParseConfigString ( struct dbuffer msg  )  [static]
static void CL_ParseServerData ( struct dbuffer msg  )  [static]
void CL_ParseServerMessage ( svc_ops_t  cmd,
struct dbuffer msg 
)
static void CL_ParseStartSoundPacket ( struct dbuffer msg  )  [static]

Parsed a server send sound package.

See also:
svc_sound
SV_StartSound

Definition at line 161 of file cl_parse.c.

References Com_sprintf(), FS_CheckFile(), i, MAX_QPATH, NET_ReadPos(), NET_ReadString(), S_LoadSample(), S_PlaySample(), SND_VOLUME_DEFAULT, SOUND_ATTN_NORM, and va().

Referenced by CL_ParseServerMessage().

const char* CL_PlayerGetName ( int  player  ) 

Get the player name.

Parameters:
player The index of the player
Returns:
The name of the player

Definition at line 114 of file cl_parse.c.

References CL_GetConfigString(), CS_PLAYERNAMES, and MAX_CLIENTS.

Referenced by CL_AddTargetingBox(), CL_ParseClientinfo(), and GAME_MP_EndRoundAnnounce().


Variable Documentation

const char* svc_strings[UCHAR_MAX+1] [static]
Initial value:
{
    "svc_bad",

    "svc_nop",
    "svc_disconnect",
    "svc_reconnect",
    "svc_sound",
    "svc_print",
    "svc_stufftext",
    "svc_serverdata",
    "svc_configstring",
    "svc_event"
}

see also svc_ops_e in common.h

Note:
don't change the array size - a NET_ReadByte can return values between 0 and UCHAR_MAX (-1 is not handled here)

Definition at line 40 of file cl_parse.c.

Referenced by CL_ParseServerMessage().


Generated by  doxygen 1.6.2