UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cl_parse.cpp 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 "../cgame/cl_game.h"
#include "events/e_parse.h"

Go to the source code of this file.

Functions

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

Variables

static char const *const svc_strings []
 see also svc_ops_e in common.h More...
 

Detailed Description

Parse a message (event) received from the server.

Definition in file cl_parse.cpp.

Function Documentation

int CL_GetPlayerNum ( void  )

Definition at line 103 of file cl_parse.cpp.

References cls, and client_static_s::team.

Referenced by GAME_GetImportData(), and S_MumbleUpdate().

static void CL_ParseClientinfo ( unsigned int  player)
static

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

See also
CL_AddTargetingBoX

Definition at line 94 of file cl_parse.cpp.

References cl, CL_GetConfigString(), clientBattleScape_s::clientinfo, CS_PLAYERNAMES, clientinfo_t::name, and Q_strncpyz().

Referenced by CL_ParseConfigString().

static void CL_ParseServerData ( dbuffer msg)
static
const char* CL_PlayerGetName ( unsigned int  player)

Get the player name.

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

Definition at line 113 of file cl_parse.cpp.

References cl, clientBattleScape_s::clientinfo, and clientinfo_t::name.

Referenced by CL_ActorDie(), CL_AddTargetingBox(), GAME_GetImportData(), and S_MumbleUpdate().

Variable Documentation

char const* const svc_strings[]
static
Initial value:
=
{
"svc_bad",
"svc_nop",
"svc_ping",
"svc_disconnect",
"svc_reconnect",
"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 38 of file cl_parse.cpp.

Referenced by CL_ParseServerMessage().