UFO: Alien Invasion
Loading...
Searching...
No Matches
cl_game_multiplayer.cpp File Reference

Multiplayer game type code. More...

#include "../../cl_shared.h"
#include "../cl_game.h"
#include "cl_game_multiplayer.h"
#include "mp_callbacks.h"
#include "mp_serverlist.h"
#include "../../ui/ui_data.h"
Include dependency graph for cl_game_multiplayer.cpp:

Go to the source code of this file.

Functions

static CGAME_HARD_LINKED_FUNCTIONS void GAME_MP_StartBattlescape (bool isTeamPlay)
static void GAME_MP_NotifyEvent (event_t eventType)
static void GAME_MP_EndRoundAnnounce (int playerNum, int team)
static void GAME_MP_StartServer_f (void)
 Starts a server and checks if the server loads a team unless he is a dedicated server admin.
static void GAME_MP_Results (dbuffer *msg, int winner, int *numSpawned, int *numAlive, int numKilled[][MAX_TEAMS], int numStunned[][MAX_TEAMS], bool nextmap)
 After a mission was finished this function is called.
static const mapDef_t * GAME_MP_MapInfo (int step)
static void GAME_MP_UpdateGametype_f (void)
 Update the map according to the gametype.
static void GAME_MP_AddChatMessage (const char *text)
 Displays a chat on the hud and add it to the chat buffer.
static bool GAME_MP_HandleServerCommand (const char *command, dbuffer *msg)
static void GAME_MP_InitStartup (void)
static void GAME_MP_Shutdown (void)
static void GAME_MP_RunFrame (float secondsSinceLastFrame)
const cgame_export_t * GetCGameAPI (const cgame_import_t *import)

Variables

static const cgame_import_t * cgi
static linkedList_t * mp_chatMessageStack = nullptr
static const cmdList_t multiplayerCmds []

Detailed Description

Multiplayer game type code.

Definition in file cl_game_multiplayer.cpp.

Function Documentation

◆ GAME_MP_AddChatMessage()

void GAME_MP_AddChatMessage ( const char * text)
static

Displays a chat on the hud and add it to the chat buffer.

Definition at line 211 of file cl_game_multiplayer.cpp.

References cgi, Com_Trim(), GAME_MP_AddChatMessage(), mp_chatMessageStack, Q_strncpyz(), and TEXT_CHAT_WINDOW.

Referenced by GAME_MP_AddChatMessage(), and GetCGameAPI().

◆ GAME_MP_EndRoundAnnounce()

void GAME_MP_EndRoundAnnounce ( int playerNum,
int team )
static

◆ GAME_MP_HandleServerCommand()

bool GAME_MP_HandleServerCommand ( const char * command,
dbuffer * msg )
static

◆ GAME_MP_InitStartup()

void GAME_MP_InitStartup ( void )
static

◆ GAME_MP_MapInfo()

◆ GAME_MP_NotifyEvent()

void GAME_MP_NotifyEvent ( event_t eventType)
static

Definition at line 44 of file cl_game_multiplayer.cpp.

References cgi, EV_RESET, and GAME_MP_NotifyEvent().

Referenced by GAME_MP_NotifyEvent(), and GetCGameAPI().

◆ GAME_MP_Results()

void GAME_MP_Results ( dbuffer * msg,
int winner,
int * numSpawned,
int * numAlive,
int numKilled[][MAX_TEAMS],
int numStunned[][MAX_TEAMS],
bool nextmap )
static

After a mission was finished this function is called.

Parameters
msgThe network message buffer
winnerThe winning team
numSpawnedThe amounts of all spawned actors per team
numAliveThe amount of survivors per team
numKilledThe amount of killed actors for all teams. The first dimension contains the attacker team, the second the victim team
numStunnedThe amount of stunned actors for all teams. The first dimension contains the attacker team, the second the victim team
nextmapIndicates if there is another map to follow within the same mission

Definition at line 125 of file cl_game_multiplayer.cpp.

References _, cgi, GAME_MP_Results(), i, MAX_TEAMS, TEXT_LIST2, and va().

Referenced by GAME_MP_Results(), and GetCGameAPI().

◆ GAME_MP_RunFrame()

◆ GAME_MP_Shutdown()

◆ GAME_MP_StartBattlescape()

CGAME_HARD_LINKED_FUNCTIONS void GAME_MP_StartBattlescape ( bool isTeamPlay)
static

◆ GAME_MP_StartServer_f()

void GAME_MP_StartServer_f ( void )
static

◆ GAME_MP_UpdateGametype_f()

◆ GetCGameAPI()

Variable Documentation

◆ cgi

const cgame_import_t* cgi
static

Definition at line 33 of file cl_game_multiplayer.cpp.

◆ mp_chatMessageStack

linkedList_t* mp_chatMessageStack = nullptr
static

Definition at line 206 of file cl_game_multiplayer.cpp.

Referenced by GAME_MP_AddChatMessage().

◆ multiplayerCmds

const cmdList_t multiplayerCmds[]
static
Initial value:
= {
{"mp_startserver", GAME_MP_StartServer_f, nullptr},
{"mp_updategametype", GAME_MP_UpdateGametype_f, "Update the menu values with current gametype values"},
{nullptr, nullptr, nullptr}
}
static void GAME_MP_UpdateGametype_f(void)
Update the map according to the gametype.
static void GAME_MP_StartServer_f(void)
Starts a server and checks if the server loads a team unless he is a dedicated server admin.

Definition at line 233 of file cl_game_multiplayer.cpp.

Referenced by GAME_MP_InitStartup(), and GAME_MP_Shutdown().