|
UFO: Alien Invasion
|
Main part of the game logic. More...
#include "g_client.h"#include "g_actor.h"#include "g_ai.h"#include "g_combat.h"#include "g_edicts.h"#include "g_inventory.h"#include "g_match.h"#include "g_move.h"#include "g_reaction.h"#include "g_utils.h"#include "g_vis.h"
Go to the source code of this file.
Functions | |
| Player * | G_PlayerGetNextHuman (Player *lastPlayer) |
| Iterate through the list of players. | |
| Player * | G_PlayerGetNextAI (Player *lastPlayer) |
| Iterate through the list of players. | |
| Player * | G_PlayerGetNextActiveHuman (Player *lastPlayer) |
| Iterate through the list of players. | |
| Player * | G_PlayerGetNextActiveAI (Player *lastPlayer) |
| Iterate through the list of players. | |
| playermask_t | G_TeamToPM (int team) |
| Generates the player bit mask for a given team. | |
| teammask_t | G_PMToVis (playermask_t playerMask) |
| Converts player mask to vis mask. | |
| playermask_t | G_VisToPM (teammask_t teamMask) |
| Converts vis mask to player mask. | |
| void | G_ClientPrintf (const Player &player, int printLevel, const char *fmt,...) |
| void | G_GiveTimeUnits (int team) |
| Network function to update the time units (TUs) for each team-member. | |
| void | G_AppearPerishEvent (playermask_t playerMask, bool appear, Edict &check, const Edict *ent) |
| Send the appear or perish event to the affected clients. | |
| void | G_SendInvisible (const Player &player) |
This function sends all the actors to the client that are not visible initially - this is needed because an actor can e.g. produce sounds that are send over the net. And the client can only handle them if he knows the le_t (local entity) already. | |
| int | G_GetActiveTeam (void) |
| Returns the current active team to the server. | |
| static bool | G_ActionCheck (const Player &player, Edict *ent) |
| Checks whether the requested action is possible. | |
| bool | G_ActionCheckForCurrentTeam (const Player &player, Actor *ent, int TU) |
| Checks whether the requested action is possible for the current active team. | |
| bool | G_ActionCheckForReaction (const Player &player, Actor *actor, int TU) |
| Checks whether the requested action is possible. | |
| static void | G_ClientTurn (Player &player, Actor *actor, dvec_t dvec) |
| Sends the actual actor turn event over the netchannel. | |
| static void | G_ClientStateChangeUpdate (Edict &ent) |
| After an actor changed his state, he might get visible for other players. Check the vis here and send the state change to the clients that are seeing him already. | |
| void | G_ClientStateChange (const Player &player, Actor *actor, int reqState, bool checkaction) |
| Changes the state of a player/soldier. | |
| bool | G_ClientCanReload (Actor *actor, containerIndex_t containerID) |
| Returns true if actor can reload weapon. | |
| bool | G_ClientGetWeaponFromInventory (Actor *actor) |
| Retrieve or collect a loaded weapon from any linked container for the actor's right hand. | |
| 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. | |
| int | G_ClientAction (Player &player) |
| The client sent us a message that he did something. We now execute the related function(s) and notify him if necessary. | |
| static void | G_GetTeam (Player &player) |
| Sets the teamnum var for this match. | |
| bool | G_SetTeamForPlayer (Player &player, const int team) |
| Set the used team for the given player. | |
| int | G_ClientGetTeamNum (const Player &player) |
| Returns the assigned team number of the player. | |
| int | G_ClientGetTeamNumPref (const Player &player) |
| Returns the preferred team number for the player. | |
| bool | G_ClientIsReady (const Player *player) |
| static void | G_GetStartingTeam (const Player &player) |
| Chose a team that should start the match. | |
| static Edict * | G_ClientGetFreeSpawnPoint (const Player &player, int spawnType) |
| Find valid actor spawn fields for this player. | |
| static bool | G_ActorSpawnIsAllowed (const int num, const int team) |
| Checks whether the spawn of an actor is allowed for the current running match. | |
| static void | G_ThinkActorDieAfterSpawn (Edict *ent) |
| Think function for actors that spawn dead. | |
| static void | G_ThinkActorGoCrouch (Edict *ent) |
| Think function for actors that spawn crouched. | |
| 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. | |
| static void | G_ClientReadInventory (Edict *ent) |
| Read the inventory from the clients team data. | |
| static void | G_ClientReadCharacter (Edict *ent) |
| Reads the character data from the netchannel that is needed to spawn an actor. | |
| static void | G_ClientSkipActorInfo (void) |
| Call this if you want to skip some actor netchannel data. | |
| static void | G_ClientAssignDefaultActorValues (Actor *actor) |
| Used after spawning an actor to set some default values that are not read from the network event. | |
| 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, inventory, etc..) over the network. | |
| static void | G_ClientSendEdictsAndBrushModels (const Player &player) |
| Send brush models for entities like func_breakable and func_door and triggers with their bounding boxes to the client and let him know about them. There are also entities that are announced here, but fully handled clientside - like func_rotating. | |
| bool | G_ClientBegin (Player &player) |
| This functions starts the client. | |
| void | G_ClientStartMatch (Player &player) |
| Sets the team, init the TU and sends the player stats. | |
| void | G_ClientUserinfoChanged (Player &player, const char *userinfo) |
| called whenever the player updates a userinfo variable. | |
| bool | G_ClientConnect (Player *player, char *userinfo, size_t userinfoSize) |
| Checks whether the connection is valid or invalid and set some user info keys. | |
| void | G_ClientDisconnect (Player &player) |
| void | G_ResetClientData (void) |
| Called after every player has joined. | |
Variables | |
| static chrScoreMission_t | scoreMission [MAX_EDICTS] |
| static int | scoreMissionNum = 0 |
Main part of the game logic.
In case the connection is established (G_ClientConnect), the client state is cs_connected. The client will send SV_STATE_NEW, SV_New_f sets the state to cs_spawning, and asks the client to precache the data after sending the configstrings. After the client is done with it, it will send "begin" to the server. SV_Begin_f will now set the client state to cs_began and calls G_ClientBegin. The server will ask the client to execute "spawnsoldiers" now. The client is answering with clc_teaminfo and the server will call G_ClientTeamInfo. The client state is now cs_spawned. Last but not least the server informs the client that the match can now get started by asking to execute "startmatch". The client answers with NET_STATE_STARTMATCH and G_ClientStartMatch is executed.
Definition in file g_client.cpp.
|
static |
Checks whether the requested action is possible.
| [in] | player | Which player (human player) is trying to do the action |
| [in] | ent | Which of his units is trying to do the action. |
Definition at line 337 of file g_client.cpp.
References _, G_ClientPrintf(), G_IsActor, G_IsDead, G_IsStunned, Edict::getPlayerNum(), Edict::getTeam(), Edict::inuse, and PRINT_HUD.
Referenced by G_ActionCheckForCurrentTeam(), and G_ActionCheckForReaction().
Checks whether the requested action is possible for the current active team.
| [in] | player | Which player (human player) is trying to do the action |
| [in] | ent | Which of his units is trying to do the action. |
| [in] | TU | The time units to check against the ones ent has. the action with |
Definition at line 380 of file g_client.cpp.
References _, G_ActionCheck(), G_ActorUsableTUs(), G_ClientPrintf(), level, and PRINT_HUD.
Referenced by G_ActorInvMove(), G_ClientMove(), G_ClientPrintf(), G_ClientShoot(), G_ClientStateChange(), G_ClientTurn(), and G_ClientUseEdict().
Checks whether the requested action is possible.
| [in] | player | Which player (human player) is trying to do the action |
| [in] | actor | Which of his units is trying to do the action. |
| [in] | TU | The time units to check against the ones actor has. the action with |
Definition at line 403 of file g_client.cpp.
References G_ActionCheck(), and Edict::getTus().
Referenced by G_ActionCheckForCurrentTeam2(), and G_ClientShoot().
Checks whether the spawn of an actor is allowed for the current running match.
| num | The nth actor the player want to spawn in the game. |
| team | The team the player is part of. |
true if spawn is allowed, false otherwise. Definition at line 1002 of file g_client.cpp.
References G_IsSinglePlayer, level, sv_maxsoldiersperplayer, and sv_maxsoldiersperteam.
Referenced by G_ClientTeamInfo().
| void G_AppearPerishEvent | ( | playermask_t | playerMask, |
| bool | appear, | ||
| Edict & | check, | ||
| const Edict * | ent ) |
Send the appear or perish event to the affected clients.
| [in] | playerMask | These are the affected players or clients In case of e.g. teamplay there can be more than one client affected - thus this is a player mask |
| [in] | appear | Is this event about an appearing actor (or a perishing one) |
| [in] | check | The edict we are talking about (that appears or perishes) |
| [in] | ent | The edict that was responsible for letting the check edict appear or perish. Might be nullptr. |
Definition at line 245 of file g_client.cpp.
References ET_ACTOR, ET_ACTOR2x2, ET_CAMERA, ET_ITEM, ET_PARTICLE, ET_TRIGGER_RESCUE, G_EventActorAppear(), G_EventAddBrushModel(), G_EventCameraAppear(), G_EventEdictAppear(), G_EventEdictPerish(), G_EventSendParticle(), G_IsVisibleOnBattlefield, G_PMToVis(), G_SendInventory(), G_VisFlagsSwap(), gi, makeActor(), and Edict::type.
Referenced by AI_CheckRespawn(), G_ClientPrintf(), G_DoTestVis(), G_MissionThink(), G_SplashDamage(), and G_VisMakeEverythingVisible().
| int G_ClientAction | ( | Player & | player | ) |
The client sent us a message that he did something. We now execute the related function(s) and notify him if necessary.
| [in] | player | The player to execute the action for (the actor belongs to this player) |
Definition at line 638 of file g_client.cpp.
References Edict::chr, Edict::clientAction, format(), G_ActorInvMove(), G_ActorReserveTUs(), G_ActorUseDoor(), G_ClientMove(), G_ClientShoot(), G_ClientStateChange(), G_ClientTurn(), G_EdictsGetByNum(), G_IsDoor, G_ReactionFireSettingsUpdate(), Inventory::getItemAtPos(), gi, i, character_t::inv, INVDEF, INVSH_GetItemByIDX(), isValidContId(), makeActor(), pa_format, PA_INVMOVE, PA_MOVE, PA_NULL, PA_REACT_SELECT, PA_RESERVE_STATE, PA_SHOOT, PA_STATE, PA_TURN, PA_USE, chrReservations_t::reaction, and character_t::reservedTus.
Referenced by G_ActionCheckForCurrentTeam2(), and GetGameAPI().
Used after spawning an actor to set some default values that are not read from the network event.
| actor | The actor edict to set the values for. |
Definition at line 1190 of file g_client.cpp.
References ABILITY_MIND, chrScoreMission_t::carriedWeight, Edict::chr, CHRSH_CharGetBody(), CHRSH_CharGetHead(), GET_MORALE, Inventory::getWeight(), gi, character_t::HP, Edict::HP, character_t::inv, character_t::morale, character_t::score, character_t::scoreMission, scoreMission, scoreMissionNum, Actor::setBody(), Actor::setHead(), Edict::setMorale(), and chrScoreGlobal_t::skills.
Referenced by G_ClientTeamInfo().
| bool G_ClientBegin | ( | Player & | player | ) |
This functions starts the client.
Definition at line 1323 of file g_client.cpp.
References CS_PLAYERCOUNT, CS_PLAYERNAMES, G_ClientSendEdictsAndBrushModels(), G_EventEnd(), G_EventStart(), G_GetTeam(), gi, level, PRINT_CONSOLE, and sv_teamplay.
Referenced by G_ActionCheckForCurrentTeam2(), and GetGameAPI().
| bool G_ClientCanReload | ( | Actor * | actor, |
| containerIndex_t | containerID ) |
Returns true if actor can reload weapon.
Definition at line 536 of file g_client.cpp.
References Edict::chr, CID_LEFT, Item::def(), Edict::getContainer(), Inventory::getNextCont(), Container::getNextItem(), Edict::getRightHandItem(), character_t::inv, Item::isHeldTwoHanded(), and objDef_t::isLoadableInWeapon().
Referenced by AI_TryToReloadWeapon(), AIL_canreload(), and G_ActionCheckForCurrentTeam2().
| bool G_ClientConnect | ( | Player * | player, |
| char * | userinfo, | ||
| size_t | userinfoSize ) |
Checks whether the connection is valid or invalid and set some user info keys.
| [in,out] | player | The player that is trying to connect to the game |
| [in,out] | userinfo | The userinfo data that is checked and changed |
| [in] | userinfoSize | The size of the userinfo buffer |
false if the connection is refused, true otherwise Definition at line 1436 of file g_client.cpp.
References Com_Printf(), G_ClientDisconnect(), G_ClientUserinfoChanged(), G_PlayerToPM, gi, Info_SetValueForKey(), Info_ValueForKey(), OBJZERO, password, PRINT_CONSOLE, Q_streq, REJ_BANNED, REJ_PASSWORD_REQUIRED_OR_INCORRECT, REJ_SERVER_FULL, and SV_FilterPacket().
Referenced by G_ActionCheckForCurrentTeam2(), and GetGameAPI().
| void G_ClientDisconnect | ( | Player & | player | ) |
Definition at line 1476 of file g_client.cpp.
References CS_PLAYERCOUNT, G_ActorDie(), G_ClientEndRound(), G_EdictsGetNextLivingActor(), G_MatchEndCheck(), gi, level, Edict::pnum, PRINT_CONSOLE, and STATE_DEAD.
Referenced by G_ActionCheckForCurrentTeam2(), G_ClientConnect(), G_GetTeam(), and GetGameAPI().
Find valid actor spawn fields for this player.
| [in] | player | The player to spawn the actors for. |
| [in] | spawnType | The type of spawn-point so search for (ET_ACTORSPAWN or ET_ACTOR2x2SPAWN) |
Definition at line 963 of file g_client.cpp.
References count, ET_ACTOR2x2SPAWN, ET_ACTORSPAWN, G_EdictsGetLivingActorFromPos(), G_EdictsGetNextInUse(), Edict::getTeam(), level, MAX_EDICTS, Edict::pos, and Edict::type.
Referenced by G_ClientGetFreeSpawnPointForActorSize().
| 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.
| [in] | player | The player to get the free spawn points for |
| [in] | actorSize | The actor size to get a spawning point for |
nullptr if no free spawning point was found Definition at line 1039 of file g_client.cpp.
References ACTOR_SIZE_2x2, ACTOR_SIZE_NORMAL, Edict::chr, ET_ACTOR, ET_ACTOR2x2, ET_ACTOR2x2SPAWN, ET_ACTORSPAWN, character_t::fieldSize, Edict::fieldSize, FL_DESTROYABLE, Edict::flags, G_ActorModifyCounters(), G_ClientGetFreeSpawnPoint(), G_EdictDuplicate(), G_ReactionFireTargetsCreate(), G_ThinkActorDieAfterSpawn(), G_ThinkActorGoCrouch(), G_VisFlagsReset(), Edict::getTeam(), gi, Edict::HP, level, makeActor(), Edict::nextthink, Edict::setMorale(), Edict::setPlayerNum(), Edict::spawnflags, STATE_CROUCHED, STATE_DEAD, STATE_STUN, Edict::think, and Edict::type.
Referenced by G_ActionCheckForCurrentTeam2(), G_ClientTeamInfo(), and G_SpawnAIPlayer().
| int G_ClientGetTeamNum | ( | const Player & | player | ) |
Returns the assigned team number of the player.
Definition at line 889 of file g_client.cpp.
Referenced by G_ActionCheckForCurrentTeam2(), G_GetTeam(), and GetGameAPI().
| int G_ClientGetTeamNumPref | ( | const Player & | player | ) |
Returns the preferred team number for the player.
Definition at line 897 of file g_client.cpp.
References Info_IntegerForKey().
Referenced by G_ActionCheckForCurrentTeam2(), and G_GetTeam().
| bool G_ClientGetWeaponFromInventory | ( | Actor * | actor | ) |
Retrieve or collect a loaded weapon from any linked container for the actor's right hand.
Definition at line 568 of file g_client.cpp.
References Edict::chr, CID_RIGHT, Container::def(), Item::def(), G_ActorInvMove(), Inventory::getNextCont(), Container::getNextItem(), character_t::inv, INVDEF, Item::isWeapon(), Item::mustReload(), invDef_t::out, character_t::teamDef, and teamDef_t::weapons.
Referenced by AI_ActorThink(), AIL_grabweapon(), and G_ActionCheckForCurrentTeam2().
| void G_ClientInitActorStates | ( | const Player & | player | ) |
This is called after the actors are spawned and will set actor states without consuming TUs.
| player | The player to perform the action for |
Definition at line 1215 of file g_client.cpp.
References G_ActorSetTU(), G_ClientStateChange(), G_ClientStateChangeUpdate(), G_EdictsGetActorByUCN(), G_ReactionFireSettingsReserveTUs(), G_ReactionFireSettingsUpdate(), Edict::getTus(), gi, i, INVSH_GetItemByIDX(), length, and NONE.
Referenced by G_ActionCheckForCurrentTeam2(), and GetGameAPI().
| bool G_ClientIsReady | ( | const Player * | player | ) |
true if the player is for starting the multiplayer match Definition at line 905 of file g_client.cpp.
Referenced by G_ActionCheckForCurrentTeam2(), and GetGameAPI().
Send messages to human players
| player | A player (AI players are ignored here) |
| printLevel | A numeric value to restrict and channel the printing (CONSOLE, HUD, CHAT...) |
| fmt | A format string as in printf |
Definition at line 206 of file g_client.cpp.
References G_IsAIPlayer, and gi.
Referenced by G_ActionCheck(), G_ActionCheckForCurrentTeam(), G_ActorInvMove(), G_CheckFlood(), G_ClientShoot(), G_ClientStateChange(), G_Players_f(), G_ReactionFireCanBeEnabled(), G_Say_f(), G_ShootGrenade(), Message_Use(), and Touch_NextMapTrigger().
Reads the character data from the netchannel that is needed to spawn an actor.
| ent | The actor entity to save the read data in. |
Definition at line 1125 of file g_client.cpp.
References chrScoreGlobal_t::assignedMissions, character_t::body, character_t::bodySkin, teamDef_t::bodyTemplate, Edict::chr, chrScoreGlobal_t::experience, character_t::gender, gi, character_t::head, character_t::headSkin, character_t::HP, character_t::init(), KILLED_NUM_TYPES, chrScoreGlobal_t::kills, MAX_TEAMDEFS, character_t::maxHP, character_t::minHP, character_t::morale, character_t::name, BodyData::numBodyParts(), character_t::path, character_t::score, SKILL_NUM_TYPES, chrScoreGlobal_t::skills, character_t::STUN, chrScoreGlobal_t::stuns, character_t::teamDef, woundInfo_t::treatmentLevel, character_t::ucn, and character_t::wounds.
Referenced by G_ClientSkipActorInfo(), and G_ClientTeamInfo().
Read the inventory from the clients team data.
| ent | The actor's entity that should receive the items. |
Definition at line 1102 of file g_client.cpp.
References ABILITY_POWER, Inventory::canHoldItemWeight(), Edict::chr, CID_EQUIP, Com_Printf(), Item::def(), G_ReadItem(), game, Edict::getIdNum(), gi, invDef_t::id, objDef_t::id, character_t::inv, level, character_t::score, chrScoreGlobal_t::skills, and invDef_t::temp.
Referenced by G_ClientTeamInfo().
|
static |
Send brush models for entities like func_breakable and func_door and triggers with their bounding boxes to the client and let him know about them. There are also entities that are announced here, but fully handled clientside - like func_rotating.
| [in] | player | The player the edicts are send to |
Definition at line 1296 of file g_client.cpp.
References ET_NULL, G_EdictsGetFirst(), G_EdictsGetNextInUse(), G_EventAddBrushModel(), G_PlayerToPM, G_VisFlagsAdd(), Edict::solid, SOLID_BSP, Edict::type, and Edict::visflags.
Referenced by G_ClientBegin().
Call this if you want to skip some actor netchannel data.
Definition at line 1168 of file g_client.cpp.
References G_ClientReadCharacter(), G_ReadItem(), gi, and i.
Referenced by G_ClientTeamInfo().
| void G_ClientStartMatch | ( | Player & | player | ) |
Sets the team, init the TU and sends the player stats.
Definition at line 1361 of file g_client.cpp.
References G_CheckVisPlayer(), G_EventEnd(), G_EventReset(), G_GetStartingTeam(), G_IsMultiPlayer, G_SendInvisible(), G_SendPlayerStats(), G_VisFlagsClear(), gi, level, PRINT_CONSOLE, and sv_roundtimelimit.
Referenced by G_ActionCheckForCurrentTeam2(), and GetGameAPI().
Changes the state of a player/soldier.
| [in,out] | player | The player who controls the actor |
| [in] | actor | the edict to perform the state change for |
| [in] | reqState | The bit-map of the requested state change |
| [in] | checkaction | if false only activate the events - network stuff is handled in the calling function don't even use the G_ActionCheckForCurrentTeam function |
Definition at line 473 of file g_client.cpp.
References _, Edict::chr, chrReservations_t::crouch, Edict::fieldSize, G_ActionCheckForCurrentTeam(), G_ActorReserveTUs(), G_ActorSetMaxs(), G_ActorUseTU(), G_ClientPrintf(), G_ClientStateChangeUpdate(), G_EventReactionFireChange(), G_IsAI, G_ReactionFireSettingsReserveTUs(), G_SetState, G_ToggleCrouched, gi, Actor::isCrouched(), Actor::isReaction(), Actor::isShaken(), Edict::pos, PRINT_HUD, Actor::removeReaction(), character_t::reservedTus, chrReservations_t::shot, STATE_CROUCHED, STATE_REACTION, and TU_CROUCH.
Referenced by AI_ActorThink(), AI_InitPlayer(), AIL_crouch(), AIL_reactionfire(), G_ActionCheckForCurrentTeam2(), G_ActorDieOrStun(), G_ClientAction(), G_ClientInitActorStates(), G_ClientMove(), G_MoraleBehaviour(), G_MoralePanic(), G_MoraleRage(), G_ReactionFireSettingsUpdate(), and G_ThinkActorGoCrouch().
After an actor changed his state, he might get visible for other players. Check the vis here and send the state change to the clients that are seeing him already.
| ent | The actor edict |
Definition at line 446 of file g_client.cpp.
References G_CheckVis(), G_CheckVisTeamAll(), G_EventEnd(), G_EventSendState(), G_SendStats(), G_VisToPM(), Edict::getTeam(), and Edict::visflags.
Referenced by G_ClientInitActorStates(), and G_ClientStateChange().
| void G_ClientTeamInfo | ( | const Player & | player | ) |
The client lets the server spawn the actors for a given player by sending their information (models, inventory, etc..) over the network.
| [in] | player | The player to spawn the actors for. |
Definition at line 1255 of file g_client.cpp.
References AIL_InitActor(), Com_DPrintf(), Com_Printf(), Edict::contentFlags, DEBUG_GAME, Edict::fieldSize, G_ActorGetContentFlags(), G_ActorGiveTimeUnits(), G_ActorSpawnIsAllowed(), G_ClientAssignDefaultActorValues(), G_ClientGetFreeSpawnPointForActorSize(), G_ClientReadCharacter(), G_ClientReadInventory(), G_ClientSkipActorInfo(), G_TouchTriggers(), game, Edict::getTeam(), gi, i, length, Edict::origin, and TEAM_NO_ACTIVE.
Referenced by G_ActionCheckForCurrentTeam2(), and GetGameAPI().
Sends the actual actor turn event over the netchannel.
Definition at line 415 of file g_client.cpp.
References Edict::dir, G_ActionCheckForCurrentTeam(), G_ActorDoTurn(), G_ActorUseTU(), G_EventActorTurn(), G_EventEnd(), G_SendStats(), getDVdir, and TU_TURN.
Referenced by G_ClientAction().
This function 'uses' the edict. E.g. it opens the door when the player wants it to open.
| [in] | player | The player is trying to activate the door |
| [in,out] | actor | The actor the player is using to activate the entity |
| [in,out] | edict | The entity that is to be used |
Definition at line 614 of file g_client.cpp.
References G_ActionCheckForCurrentTeam(), G_ActorUseTU(), G_EventEnd(), G_SendStats(), G_UseEdict(), and Edict::TU.
Referenced by G_ActionCheckForCurrentTeam2(), and G_ActorUseDoor().
| void G_ClientUserinfoChanged | ( | Player & | player, |
| const char * | userinfo ) |
called whenever the player updates a userinfo variable.
Definition at line 1393 of file g_client.cpp.
References Com_DPrintf(), CS_PLAYERNAMES, DEBUG_GAME, G_GetTeam(), G_MatchIsRunning(), gi, Info_IntegerForKey(), Info_Validate(), Info_ValueForKey(), Q_strncpyz(), and TEAM_NO_ACTIVE.
Referenced by G_ActionCheckForCurrentTeam2(), G_ClientConnect(), and GetGameAPI().
Returns the current active team to the server.
TEAM_NO_ACTIVE there is either noDefinition at line 327 of file g_client.cpp.
References level.
Referenced by G_ClientEndRound(), G_ClientPrintf(), G_GetNextActiveTeam(), and GetGameAPI().
|
static |
Chose a team that should start the match.
| [in] | player | In singleplayer mode the team of this player will get the first turn |
Definition at line 916 of file g_client.cpp.
References frand(), G_IsSinglePlayer, G_MatchIsRunning(), G_PlayerGetNextActiveHuman(), G_PrintStats(), int(), level, and MAX_TEAMS.
Referenced by G_ClientStartMatch().
|
static |
Sets the teamnum var for this match.
| [in] | player | Pointer to connected player |
Definition at line 740 of file g_client.cpp.
References Com_DPrintf(), DEBUG_GAME, G_ClientDisconnect(), G_ClientGetTeamNum(), G_ClientGetTeamNumPref(), G_IsMultiPlayer, G_IsSinglePlayer, G_PlayerGetNextActiveAI(), G_PlayerGetNextActiveHuman(), G_SetTeamForPlayer(), gi, i, level, MAX_TEAMS, PRINT_CONSOLE, sv_maxteams, sv_teamplay, TEAM_CIVILIAN, TEAM_DEFAULT, TEAM_MAX_HUMAN, and TEAM_PHALANX.
Referenced by G_ClientBegin(), and G_ClientUserinfoChanged().
Network function to update the time units (TUs) for each team-member.
| [in] | team | The index of the team to update the values for. |
Definition at line 224 of file g_client.cpp.
References G_ActorGiveTimeUnits(), G_EdictsGetNextLivingActorOfTeam(), and G_SendStats().
Referenced by G_ClientEndRound(), and G_ClientPrintf().
| Player * G_PlayerGetNextActiveAI | ( | Player * | lastPlayer | ) |
Iterate through the list of players.
| lastPlayer | The player found in the previous iteration; if nullptr, we start at the beginning |
Definition at line 126 of file g_client.cpp.
References G_PlayerGetNextAI().
Referenced by AI_Run(), G_ClientEndRound(), G_GetPlayerForTeam(), and G_GetTeam().
| Player * G_PlayerGetNextActiveHuman | ( | Player * | lastPlayer | ) |
Iterate through the list of players.
| lastPlayer | The player found in the previous iteration; if nullptr, we start at the beginning |
Definition at line 110 of file g_client.cpp.
References G_PlayerGetNextHuman().
Referenced by AI_Run(), G_CheckForceEndRound(), G_ClientEndRound(), G_GetPlayerForTeam(), G_GetStartingTeam(), G_GetTeam(), G_Players_f(), G_PMToVis(), G_Say_f(), and G_VisToPM().
| Player * G_PlayerGetNextAI | ( | Player * | lastPlayer | ) |
Iterate through the list of players.
| lastPlayer | The player found in the previous iteration; if nullptr, we start at the beginning |
Definition at line 84 of file g_client.cpp.
References game.
Referenced by AI_CreatePlayer(), and G_PlayerGetNextActiveAI().
| Player * G_PlayerGetNextHuman | ( | Player * | lastPlayer | ) |
Iterate through the list of players.
| lastPlayer | The player found in the previous iteration; if nullptr, we start at the beginning |
Definition at line 58 of file g_client.cpp.
References game.
Referenced by G_PlayerGetNextActiveHuman(), G_SetTeamForPlayer(), G_TeamToPM(), and TEST_F().
| teammask_t G_PMToVis | ( | playermask_t | playerMask | ) |
Converts player mask to vis mask.
| [in] | playerMask | The player bit mask (contains the player numbers) that is converted to a vis mask |
playerMask. Definition at line 165 of file g_client.cpp.
References G_PlayerGetNextActiveHuman(), G_PlayerToPM, and G_TeamToVisMask.
Referenced by G_AppearPerishEvent(), and G_SplashDamage().
Called after every player has joined.
Definition at line 1510 of file g_client.cpp.
References OBJZERO, scoreMission, and scoreMissionNum.
Referenced by G_ActionCheckForCurrentTeam2(), and G_SpawnEntities().
| void G_SendInvisible | ( | const Player & | player | ) |
This function sends all the actors to the client that are not visible initially - this is needed because an actor can e.g. produce sounds that are send over the net. And the client can only handle them if he knows the le_t (local entity) already.
G_CheckVis call for every new actor or player Definition at line 302 of file g_client.cpp.
References G_EdictsGetNextActor(), G_EventActorAdd(), G_IsVisibleForTeam, G_PlayerToPM, Edict::getTeam(), level, and TEAM_NO_ACTIVE.
Referenced by G_ClientPrintf(), and G_ClientStartMatch().
| bool G_SetTeamForPlayer | ( | Player & | player, |
| const int | team ) |
Set the used team for the given player.
| [out] | player | The player the team should be set for |
| [in] | team | The team to set for the given player |
true if the team was set successfully, false otherwise. Definition at line 852 of file g_client.cpp.
References G_IsAIPlayer, g_nospawn, G_PlayerGetNextHuman(), gi, Info_SetValueForKeyAsInteger(), level, MAX_TEAMS, sv_teamplay, TEAM_ALIEN, TEAM_CIVILIAN, and TEAM_NO_ACTIVE.
Referenced by AI_CreatePlayer(), G_ActionCheckForCurrentTeam2(), and G_GetTeam().
| playermask_t G_TeamToPM | ( | int | team | ) |
Generates the player bit mask for a given team.
| [in] | team | The team to create the player bit mask for |
Definition at line 144 of file g_client.cpp.
References G_PlayerGetNextHuman(), and G_PlayerToPM.
Referenced by G_ActorInvMove(), G_CheckVisTeam(), G_EventActorAppear(), G_EventSendState(), G_EventSetClientAction(), G_GetClosePlayerMask(), G_SendStats(), G_SplashDamage(), and G_VisMakeEverythingVisible().
Think function for actors that spawn dead.
| ent | The actor |
Definition at line 1014 of file g_client.cpp.
References G_ActorDieOrStun(), makeActor(), and Edict::think.
Referenced by G_ClientGetFreeSpawnPointForActorSize().
Think function for actors that spawn crouched.
| ent | The actor |
Definition at line 1026 of file g_client.cpp.
References G_ClientStateChange(), Edict::getPlayer(), makeActor(), STATE_CROUCHED, and Edict::think.
Referenced by G_ClientGetFreeSpawnPointForActorSize().
| playermask_t G_VisToPM | ( | teammask_t | teamMask | ) |
Converts vis mask to player mask.
| [in] | teamMask | The visibility bit mask (contains the team numbers) that is converted to a player mask |
vis_mask. Definition at line 186 of file g_client.cpp.
References G_PlayerGetNextActiveHuman(), G_PlayerToPM, and G_TeamToVisMask.
Referenced by AI_CheckRespawn(), G_ActorCheckRevitalise(), G_ActorDieOrStun(), G_ActorInvMove(), G_ClientMove(), G_ClientShoot(), G_ClientStateChangeUpdate(), G_Damage(), G_EventActorDie(), G_EventActorRevitalise(), G_EventActorTurn(), G_EventCenterView(), G_EventEndShoot(), G_EventInventoryAmmo(), G_EventPerish(), G_EventShoot(), G_EventShootHidden(), G_EventSpawnFootstepSound(), G_EventStartShoot(), G_EventThrow(), G_InventoryRemoveItemByID(), G_InventoryToFloor(), G_MissionThink(), G_MoraleBehaviour(), G_MoralePanic(), G_MoraleRage(), G_MoraleStopPanic(), G_MoraleStopRage(), G_ReactionFireSettingsUpdate(), G_SplashDamage(), G_VisMakeEverythingVisible(), and Think_SmokeAndFire().
|
static |
Definition at line 51 of file g_client.cpp.
Referenced by G_ClientAssignDefaultActorValues(), G_ResetClientData(), and G_UpdateCharacterBodycount().
|
static |
Definition at line 52 of file g_client.cpp.
Referenced by G_ClientAssignDefaultActorValues(), and G_ResetClientData().