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