UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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"

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. More...
 
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. More...
 
static const mapDef_tGAME_MP_MapInfo (int step)
 
static void GAME_MP_UpdateGametype_f (void)
 Update the map according to the gametype. More...
 
static void GAME_MP_AddChatMessage (const char *text)
 Displays a chat on the hud and add it to the chat buffer. More...
 
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_tGetCGameAPI (const cgame_import_t *import)
 

Variables

static const cgame_import_tcgi
 
static linkedList_tmp_chatMessageStack = nullptr
 
static const cmdList_t multiplayerCmds []
 

Detailed Description

Multiplayer game type code.

Definition in file cl_game_multiplayer.cpp.

Function Documentation

static 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 Com_Trim(), Q_strncpyz(), and TEXT_CHAT_WINDOW.

Referenced by GetCGameAPI().

static void GAME_MP_EndRoundAnnounce ( int  playerNum,
int  team 
)
static

Definition at line 52 of file cl_game_multiplayer.cpp.

References _, cgame_import_s::CL_PlayerGetName(), and Com_sprintf().

Referenced by GetCGameAPI().

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

Definition at line 223 of file cl_game_multiplayer.cpp.

References GAME_MP_ParseTeamInfoMessage(), Q_streq, and SV_CMD_TEAMINFO.

Referenced by GetCGameAPI().

static void GAME_MP_InitStartup ( void  )
static
Todo:
make equipment configurable for multiplayer

Definition at line 238 of file cl_game_multiplayer.cpp.

References cgame_import_s::Cvar_ForceSet(), cgame_import_s::Cvar_Set(), GAME_MP_CallbacksInit(), and GAME_MP_ServerListInit().

Referenced by GetCGameAPI().

static void GAME_MP_NotifyEvent ( event_t  eventType)
static

Definition at line 44 of file cl_game_multiplayer.cpp.

References EV_RESET.

Referenced by GetCGameAPI().

static 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 _, i, MAX_TEAMS, TEXT_LIST2, and va().

Referenced by GetCGameAPI().

static void GAME_MP_Shutdown ( void  )
static
static CGAME_HARD_LINKED_FUNCTIONS void GAME_MP_StartBattlescape ( bool  isTeamPlay)
static

Definition at line 37 of file cl_game_multiplayer.cpp.

References cvar_s::modified, and rcon_client_password.

Referenced by GetCGameAPI().

static void GAME_MP_StartServer_f ( void  )
static

Starts a server and checks if the server loads a team unless he is a dedicated server admin.

Todo:
implement different ufo and dropship support for multiplayer, too (see skirmish)

Definition at line 71 of file cl_game_multiplayer.cpp.

References _, mapDef_s::aircraft, cl_maxsoldiersperplayer, cl_maxsoldiersperteam, cgame_import_s::Com_GetRandomMapAssemblyNameForCraft(), cgame_import_s::Cvar_Set(), linkedList_t::data, cgame_import_s::GAME_GetCurrentSelectedMap(), cvar_s::integer, cgame_import_s::LIST_GetRandom(), mapDef_s::mapTheme, mapDef_s::multiplayer, mapDef_s::params, mapDef_s::teams, and mapDef_s::ufos.

Variable Documentation

const cgame_import_t* cgi
static

Definition at line 33 of file cl_game_multiplayer.cpp.

linkedList_t* mp_chatMessageStack = nullptr
static

Definition at line 206 of file cl_game_multiplayer.cpp.

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.