UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
g_client.h
Go to the documentation of this file.
1 
7 /*
8 Copyright (C) 2002-2020 UFO: Alien Invasion.
9 
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License
12 as published by the Free Software Foundation; either version 2
13 of the License, or (at your option) any later version.
14 
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 See the GNU General Public License for more details.
20 
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 */
25 
26 #pragma once
27 
28 #include "g_local.h"
29 
30 Player* G_PlayerGetNextHuman(Player* lastPlayer);
31 Player* G_PlayerGetNextAI(Player* lastPlayer);
32 Player* G_PlayerGetNextActiveHuman(Player* lastPlayer);
33 Player* G_PlayerGetNextActiveAI(Player* lastPlayer);
34 playermask_t G_TeamToPM(int team);
37 void G_ClientPrintf(const Player& player, int printlevel, const char* fmt, ...) __attribute__((format(__printf__, 3, 4)));
38 void G_GiveTimeUnits(int team);
39 void G_AppearPerishEvent(playermask_t player_mask, bool appear, Edict& check, const Edict* ent);
40 void G_SendInvisible(const Player& player);
41 int G_GetActiveTeam(void);
42 bool G_ActionCheckForCurrentTeam(const Player& player, Actor* ent, int TU);
43 bool G_ActionCheckForCurrentTeam2(const Player& player, Edict* ent, int TU);
44 bool G_ActionCheckForReaction(const Player& player, Actor* actor, int TU);
45 void G_ClientStateChange(const Player& player, Actor* actor, int reqState, bool checkaction);
46 bool G_ClientCanReload(Actor* actor, containerIndex_t containerID);
48 bool G_ClientUseEdict(const Player& player, Actor* actor, Edict* door);
49 int G_ClientAction(Player& player);
50 bool G_SetTeamForPlayer(Player& player, const int team);
51 int G_ClientGetTeamNum(const Player& player);
52 int G_ClientGetTeamNumPref(const Player& player);
53 bool G_ClientIsReady(const Player* player);
54 Actor* G_ClientGetFreeSpawnPointForActorSize(const Player& player, const actorSizeEnum_t actorSize);
55 void G_ClientInitActorStates(const Player& player);
56 void G_ClientTeamInfo(const Player& player);
57 bool G_ClientBegin(Player& player);
58 void G_ClientStartMatch(Player& player);
59 void G_ClientUserinfoChanged(Player& player, const char* userinfo);
60 bool G_ClientConnect(Player* player, char* userinfo, size_t userinfoSize); /* can't change to Player&. Conflict with SrvPlayer ! */
61 void G_ClientDisconnect(Player& player);
62 void G_ResetClientData(void);
bool G_ClientGetWeaponFromInventory(Actor *actor)
Retrieve or collect a loaded weapon from any linked container for the actor's right hand...
Definition: g_client.cpp:568
int G_ClientAction(Player &player)
The client sent us a message that he did something. We now execute the related function(s) and notify...
Definition: g_client.cpp:638
bool G_ClientCanReload(Actor *actor, containerIndex_t containerID)
Returns true if actor can reload weapon.
Definition: g_client.cpp:536
void G_SendInvisible(const Player &player)
This function sends all the actors to the client that are not visible initially - this is needed beca...
Definition: g_client.cpp:302
bool G_ClientIsReady(const Player *player)
Definition: g_client.cpp:905
void G_ClientInitActorStates(const Player &player)
This is called after the actors are spawned and will set actor states without consuming TUs...
Definition: g_client.cpp:1215
unsigned int playermask_t
Definition: g_events.h:34
int32_t actorSizeEnum_t
Definition: ufotypes.h:77
#define __attribute__(x)
Definition: cxx.h:37
bool G_ActionCheckForCurrentTeam2(const Player &player, Edict *ent, int TU)
void G_ClientPrintf(const Player &player, int printlevel, const char *fmt,...) __attribute__((format(__printf__
bool G_ActionCheckForReaction(const Player &player, Actor *actor, int TU)
Checks whether the requested action is possible.
Definition: g_client.cpp:403
bool G_SetTeamForPlayer(Player &player, const int team)
Set the used team for the given player.
Definition: g_client.cpp:852
bool G_ClientConnect(Player *player, char *userinfo, size_t userinfoSize)
Checks whether the connection is valid or invalid and set some user info keys.
Definition: g_client.cpp:1436
Player * G_PlayerGetNextActiveAI(Player *lastPlayer)
Iterate through the list of players.
Definition: g_client.cpp:126
playermask_t G_TeamToPM(int team)
Generates the player bit mask for a given team.
Definition: g_client.cpp:144
An Edict of type Actor.
Definition: g_edict.h:348
Player * G_PlayerGetNextAI(Player *lastPlayer)
Iterate through the list of players.
Definition: g_client.cpp:84
bool G_ClientUseEdict(const Player &player, Actor *actor, Edict *door)
This function 'uses' the edict. E.g. it opens the door when the player wants it to open...
Definition: g_client.cpp:614
int32_t containerIndex_t
Definition: inv_shared.h:46
void G_ClientStateChange(const Player &player, Actor *actor, int reqState, bool checkaction)
Changes the state of a player/soldier.
Definition: g_client.cpp:473
Actor * G_ClientGetFreeSpawnPointForActorSize(const Player &player, const actorSizeEnum_t actorSize)
Searches a free spawning point for a given actor size and turns it into an actor. ...
Definition: g_client.cpp:1039
void G_ClientTeamInfo(const Player &player)
The client lets the server spawn the actors for a given player by sending their information (models...
Definition: g_client.cpp:1255
Local definitions for game module.
int G_ClientGetTeamNum(const Player &player)
Returns the assigned team number of the player.
Definition: g_client.cpp:889
bool G_ClientBegin(Player &player)
This functions starts the client.
Definition: g_client.cpp:1323
void G_AppearPerishEvent(playermask_t player_mask, bool appear, Edict &check, const Edict *ent)
Send the appear or perish event to the affected clients.
Definition: g_client.cpp:245
int G_GetActiveTeam(void)
Returns the current active team to the server.
Definition: g_client.cpp:327
Player * G_PlayerGetNextHuman(Player *lastPlayer)
Iterate through the list of players.
Definition: g_client.cpp:58
void G_ResetClientData(void)
Called after every player has joined.
Definition: g_client.cpp:1510
unsigned int teammask_t
Definition: g_vis.h:30
bool G_ActionCheckForCurrentTeam(const Player &player, Actor *ent, int TU)
Checks whether the requested action is possible for the current active team.
Definition: g_client.cpp:380
void G_ClientStartMatch(Player &player)
Sets the team, init the TU and sends the player stats.
Definition: g_client.cpp:1361
void G_ClientDisconnect(Player &player)
Definition: g_client.cpp:1476
teammask_t G_PMToVis(playermask_t playerMask)
Converts player mask to vis mask.
Definition: g_client.cpp:165
playermask_t G_VisToPM(teammask_t teamMask)
Converts vis mask to player mask.
Definition: g_client.cpp:186
Definition: g_edict.h:45
Player * G_PlayerGetNextActiveHuman(Player *lastPlayer)
Iterate through the list of players.
Definition: g_client.cpp:110
void void G_GiveTimeUnits(int team)
Network function to update the time units (TUs) for each team-member.
Definition: g_client.cpp:224
int G_ClientGetTeamNumPref(const Player &player)
Returns the preferred team number for the player.
Definition: g_client.cpp:897
void format(__printf__, 1, 2)))
void G_ClientUserinfoChanged(Player &player, const char *userinfo)
called whenever the player updates a userinfo variable.
Definition: g_client.cpp:1393