UFO: Alien Invasion
Loading...
Searching...
No Matches
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"
Include dependency graph for cl_parse.cpp:

Go to the source code of this file.

Functions

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

Variables

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

Detailed Description

Parse a message (event) received from the server.

Definition in file cl_parse.cpp.

Function Documentation

◆ CL_GetPlayerNum()

int CL_GetPlayerNum ( void )

Definition at line 103 of file cl_parse.cpp.

References cls.

Referenced by GAME_GetImportData(), cgame_import_t::int(), and S_MumbleUpdate().

◆ CL_ParseClientinfo()

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(), CS_PLAYERNAMES, clientinfo_t::name, and Q_strncpyz().

Referenced by CL_ParseConfigString().

◆ CL_ParseConfigString()

◆ CL_ParseServerData()

void CL_ParseServerData ( dbuffer * msg)
static

Written by SV_New_f in sv_user.c.

Definition at line 62 of file cl_parse.cpp.

References ca_connected, cl, CL_SetClientState(), Com_DPrintf(), Com_Error(), DEBUG_CLIENT, ERR_DROP, i, NET_ReadLong(), NET_ReadShort(), NET_ReadString(), PROTOCOL_VERSION, and refdef.

Referenced by CL_ParseServerMessage().

◆ CL_ParseServerMessage()

◆ CL_PlayerGetName()

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, and clientinfo_t::name.

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

Variable Documentation

◆ svc_strings

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().