UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
q_shared.h File Reference

Common header file. More...

#include "../shared/ufotypes.h"
#include "../shared/shared.h"
#include "../shared/mathlib.h"
#include "../shared/defines.h"
#include "../common/list.h"
#include "inv_shared.h"
#include "chr_shared.h"
#include "q_sizes.h"

Go to the source code of this file.

Data Structures

struct  cvarlist_s
 
struct  gametype_s
 
class  TerrainDef
 Terrain property table entry Terrain is defined by the file map_earth_terrain.png in pics/geoscape. It is a map of the world where the different terrainTypes are drawn in different colors. The colors used in that map must have the exact RGB values as in the table, or they won't be recognized. More...
 
class  TerrainDefs
 
struct  mapDef_s
 
struct  csi_s
 The csi structure is the client-server-information structure which contains all the static data needed by the server and the client. More...
 

Macros

#define TEAM_NO_ACTIVE   -1
 
#define TEAM_CIVILIAN   0
 
#define TEAM_PHALANX   1
 
#define TEAM_ALIEN   7
 
#define TEAM_MAX_HUMAN   TEAM_ALIEN - 1
 
#define EVENT_INSTANTLY   0x80
 
#define DOOR_ROTATION_ANGLE   90
 
#define ST_RIGHT   0
 The right hand should be used for shooting. More...
 
#define ST_RIGHT_REACTION   1
 The right hand reaction fire should be used for shooting. More...
 
#define ST_LEFT   2
 The left hand should be used for shooting. More...
 
#define ST_LEFT_REACTION   3
 The left hand reaction fire should be used for shooting. More...
 
#define ST_HEADGEAR   4
 The headgear slot item should be used when shooting/using the item in the slot. More...
 
#define ST_NUM_SHOOT_TYPES   5
 Amount of shoottypes available. More...
 
#define IS_SHOT_REACTION(x)   ((x) == ST_RIGHT_REACTION || (x) == ST_LEFT_REACTION)
 Determine whether the selected shoot type is for reaction fire. More...
 
#define IS_SHOT_LEFT(x)   ((x) == ST_LEFT || (x) == ST_LEFT_REACTION)
 Determine whether the selected shoot type is for the item in the left hand, either shooting or reaction fire. More...
 
#define IS_SHOT_RIGHT(x)   ((x) == ST_RIGHT || (x) == ST_RIGHT_REACTION)
 Determine whether the selected shoot type is for the item in the right hand, either shooting or reaction fire. More...
 
#define IS_SHOT_HEADGEAR(x)   ((x) == ST_HEADGEAR)
 Determine whether the selected shoot type is for the item in the headgear slot. More...
 
#define SF_IMPACT   1
 
#define SF_BODY   2
 
#define SF_BOUNCING   4
 
#define SF_BOUNCED   8
 
#define SKIP_LOCAL_ENTITY   (-1)
 
#define MAX_DEATH   3
 
#define STATE_PUBLIC   0x00FF
 
#define STATE_DEAD   0x0003
 
#define STATE_CROUCHED   0x0004
 
#define STATE_PANIC   0x0008
 
#define STATE_RAGE   0x0010
 
#define STATE_INSANE   0x0020
 
#define STATE_STUN   0x0043
 
#define STATE_DAZED   0x0080
 
#define STATE_REACTION   0x0300
 
#define STATE_SHAKEN   0x0400
 
#define STATE_XVI   0x0800
 
#define GRAVITY   500.0
 
#define MAX_SKILL   100
 
#define MAX_MAXHP   255
 
#define MIN_TU   39
 
#define WEIGHT_LIGHT   0.2f
 
#define WEIGHT_HEAVY   0.5f
 
#define WEIGHT_NORMAL_PENALTY   0.3f
 
#define WEIGHT_HEAVY_PENALTY   0.6f
 
#define WEIGHT_FACTOR   1000.0f
 
#define GET_ENCUMBRANCE_PENALTY(weight, max)   (1.0f - ((weight) > (max) * WEIGHT_FACTOR * WEIGHT_HEAVY ? WEIGHT_HEAVY_PENALTY : (weight) > (max) * WEIGHT_FACTOR * WEIGHT_LIGHT ? WEIGHT_NORMAL_PENALTY : 0.0f))
 
#define GET_ACC(ab, sk, pn)   ((pn) - (((float)(ab) - 10) / (MAX_SKILL / 2) + ((float)(sk) - 10) / (MAX_SKILL / 2)) / 2)
 
#define GET_MORALE(ab)   (std::min((100 + (ab) * 150/MAX_SKILL), 255))
 
#define GET_TU(ab, md)   (MIN_TU * (md) + (ab) * 20 / MAX_SKILL)
 
#define DOOR_OPEN_REVERSE   4
 
#define GET_SLIDING_DOOR_SHIFT_VECTOR(dir, speed, vecout)   do { const bool reverse = (dir) & DOOR_OPEN_REVERSE; VectorClear(vecout); vecout[dir & 3] = reverse ? -speed : speed; } while (0);
 
#define MAX_TILESTRINGS   8
 
#define MAX_CLIENTS   256 /* absolute limit */
 
#define MAX_GENERAL   (MAX_CLIENTS*2) /* general config strings */
 
#define MAX_ENTITYSTRINGS   2
 
#define CS_NAME   0
 
#define CS_MAPTITLE   1
 
#define CS_MAXCLIENTS   2
 
#define CS_MAPCHECKSUM   3
 
#define CS_MAXSOLDIERSPERTEAM   4
 
#define CS_MAXSOLDIERSPERPLAYER   5
 
#define CS_ENABLEMORALE   6
 
#define CS_MAXTEAMS   7
 
#define CS_PLAYERCOUNT   8
 
#define CS_VERSION   9
 
#define CS_UFOCHECKSUM   10
 
#define CS_OBJECTAMOUNT   11
 
#define CS_LIGHTMAP   12
 
#define CS_MAPZONE   13
 
#define CS_VICTORY_CONDITIONS   14
 
#define CS_ENTITYSTRING   15
 
#define CS_TILES   (CS_ENTITYSTRING+MAX_ENTITYSTRINGS)
 
#define CS_POSITIONS   (CS_TILES+MAX_TILESTRINGS)
 
#define CS_MODELS   (CS_POSITIONS+MAX_TILESTRINGS)
 
#define CS_PLAYERNAMES   (CS_MODELS+MAX_MODELS)
 
#define CS_GENERAL   (CS_PLAYERNAMES+MAX_CLIENTS)
 
#define MAX_CONFIGSTRINGS   (CS_GENERAL+MAX_GENERAL)
 
#define MAX_GAMETYPES   16
 
#define MAX_CVARLISTINGAMETYPE   16
 
#define MAX_TERRAINDEFS   16
 Terrain property table Terrain is defined by the file map_earth_terrain.png in pics/geoscape. It is a map of the world where the different terrainTypes are drawn in different colors. The colors used in that map must have the exact RGB values as in the table, or they won't be recognized. More...
 
#define MapDef_ForeachCondition(var, condition)
 
#define MapDef_Foreach(var)   MapDef_ForeachCondition(var, 1)
 
#define REJ_PASSWORD_REQUIRED_OR_INCORRECT   "Password required or incorrect."
 Reject messages that are send to the client from the game module. More...
 
#define BAD_RCON_PASSWORD   "Bad rcon_password."
 
#define REJ_BANNED   "Banned."
 
#define REJ_SERVER_FULL   "Server is full."
 
#define REJ_SERVER_VERSION_MISMATCH   "The server is running a different version of the game."
 
#define REJ_GAME_ALREADY_STARTED   "Game has started already."
 
#define REJ_CONNECTION_REFUSED   "Connection refused."
 
#define SV_CMD_CONNECT   "connect"
 
#define SV_CMD_RCON   "rcon"
 
#define SV_CMD_STATUS   "status"
 
#define SV_CMD_TEAMINFO   "teaminfo"
 
#define SV_CMD_INFO   "info"
 
#define SV_CMD_PRINT   "print"
 
#define SV_CMD_ACK   "ack"
 
#define CL_CMD_PING   "ping"
 
#define CL_CMD_ECHO   "echo"
 
#define CL_PRECACHE   "precache"
 
#define CL_SPAWNSOLDIERS   "spawnsoldiers"
 
#define CL_STARTMATCH   "startmatch"
 
#define CL_CMD_COMMAND   "cmd"
 
#define CL_CMD_CLIENT_CONNECT   "client_connect"
 
#define NET_STATE_NEW   "new"
 
#define NET_STATE_BEGIN   "begin"
 
#define NET_STATE_STARTMATCH   "startmatch"
 
#define NET_STATE_DISCONNECT   "disconnect"
 
#define NET_STATE_INFO   "info"
 

Typedefs

typedef int32_t shoot_types_t
 Available shoot types - also see the ST_ constants. More...
 
typedef struct cvarlist_s cvarlist_t
 
typedef struct gametype_s gametype_t
 
typedef struct mapDef_s mapDef_t
 
typedef struct csi_s csi_t
 The csi structure is the client-server-information structure which contains all the static data needed by the server and the client. More...
 

Enumerations

enum  event_t {
  EV_NULL, EV_RESET, EV_START, EV_ENDROUND,
  EV_ENDROUNDANNOUNCE, EV_RESULTS, EV_CENTERVIEW, EV_MOVECAMERA,
  EV_ENT_APPEAR, EV_ENT_PERISH, EV_ENT_DESTROY, EV_ADD_BRUSH_MODEL,
  EV_ADD_EDICT, EV_ACTOR_APPEAR, EV_ACTOR_ADD, EV_ACTOR_TURN,
  EV_ACTOR_MOVE, EV_ACTOR_REACTIONFIRECHANGE, EV_ACTOR_REACTIONFIREADDTARGET, EV_ACTOR_REACTIONFIREREMOVETARGET,
  EV_ACTOR_REACTIONFIRETARGETUPDATE, EV_ACTOR_REACTIONFIREABORTSHOT, EV_ACTOR_START_SHOOT, EV_ACTOR_SHOOT,
  EV_ACTOR_SHOOT_HIDDEN, EV_ACTOR_THROW, EV_ACTOR_END_SHOOT, EV_ACTOR_DIE,
  EV_ACTOR_REVITALISED, EV_ACTOR_STATS, EV_ACTOR_STATECHANGE, EV_ACTOR_RESERVATIONCHANGE,
  EV_ACTOR_WOUND, EV_INV_ADD, EV_INV_DEL, EV_INV_AMMO,
  EV_INV_RELOAD, EV_INV_TRANSFER, EV_MODEL_EXPLODE, EV_MODEL_EXPLODE_TRIGGERED,
  EV_PARTICLE_APPEAR, EV_PARTICLE_SPAWN, EV_SOUND, EV_DOOR_OPEN,
  EV_DOOR_CLOSE, EV_CLIENT_ACTION, EV_RESET_CLIENT_ACTION, EV_CAMERA_APPEAR,
  EV_NUM_EVENTS
}
 Possible event values. More...
 
enum  entity_type_t {
  ET_NULL, ET_ACTORSPAWN, ET_ACTOR, ET_ITEM,
  ET_BREAKABLE, ET_TRIGGER, ET_TRIGGER_HURT, ET_TRIGGER_TOUCH,
  ET_TRIGGER_RESCUE, ET_TRIGGER_NEXTMAP, ET_DOOR, ET_DOOR_SLIDING,
  ET_ROTATING, ET_ACTOR2x2SPAWN, ET_ACTOR2x2, ET_CIVILIANTARGET,
  ET_MISSION, ET_ACTORHIDDEN, ET_PARTICLE, ET_SOUND,
  ET_SOLID, ET_MESSAGE, ET_SMOKE, ET_FIRE,
  ET_SMOKESTUN, ET_CAMERA, ET_MAX, ENTITY_TYPE_ENSURE_32BIT = 0x7FFFFFFF
}
 
enum  camera_type_t { CAMERA_MOBILE, CAMERA_STATIONARY, CAMERA_MAX, CAMERA_ENSURE_32BIT = 0x7FFFFFFF }
 
enum  player_action_t {
  PA_NULL, PA_TURN, PA_MOVE, PA_STATE,
  PA_SHOOT, PA_USE, PA_INVMOVE, PA_REACT_SELECT,
  PA_RESERVE_STATE, PA_NUM_EVENTS
}
 

Functions

void Sys_Error (const char *error,...) __attribute__((noreturn
 
void format (__printf__, 1, 2)))
 
void Com_Printf (const char *msg,...) __attribute__((format(__printf__
 
void void Com_DPrintf (int level, const char *msg,...) __attribute__((format(__printf__
 
int Com_GetMapDefNumber (void)
 
mapDef_tCom_GetMapDefByIDX (int index)
 
mapDef_tCom_GetMapDefinitionByID (const char *mapDefID)
 

Variables

const char * pa_format [PA_NUM_EVENTS]
 Player action format strings for netchannel transfer. More...
 
csi_t csi
 

Detailed Description

Common header file.

Todo:
Apparently included by every file - unnecessary?

Definition in file q_shared.h.

Macro Definition Documentation

#define BAD_RCON_PASSWORD   "Bad rcon_password."

Definition at line 581 of file q_shared.h.

Referenced by CL_ConnectionlessPacket(), and SVC_RemoteCommand().

#define CL_CMD_CLIENT_CONNECT   "client_connect"

Definition at line 606 of file q_shared.h.

Referenced by CL_ConnectionlessPacket(), and SVC_DirectConnect().

#define CL_CMD_COMMAND   "cmd"

Definition at line 605 of file q_shared.h.

Referenced by CL_ConnectionlessPacket().

#define CL_CMD_ECHO   "echo"

Definition at line 598 of file q_shared.h.

Referenced by CL_ConnectionlessPacket().

#define CL_CMD_PING   "ping"

Definition at line 597 of file q_shared.h.

Referenced by CL_ConnectionlessPacket().

#define CL_PRECACHE   "precache"

Definition at line 601 of file q_shared.h.

Referenced by CL_InitLocal(), and SV_New_f().

#define CL_SPAWNSOLDIERS   "spawnsoldiers"

Definition at line 602 of file q_shared.h.

Referenced by CL_InitLocal(), and SV_CheckSpawnSoldiers().

#define CL_STARTMATCH   "startmatch"

Definition at line 603 of file q_shared.h.

Referenced by CL_InitLocal(), and SV_CheckStartMatch().

#define CS_ENABLEMORALE   6

enable the morale states in multiplayer

Definition at line 315 of file q_shared.h.

Referenced by SP_worldspawn().

#define CS_ENTITYSTRING   15

additional worldspawn settings

Definition at line 324 of file q_shared.h.

Referenced by CL_CanMultiplayerStart(), SV_GetConfigStringLength(), SV_Map(), SV_ParseUMP(), and TEST_F().

#define CS_GENERAL   (CS_PLAYERNAMES+MAX_CLIENTS)

Definition at line 329 of file q_shared.h.

Referenced by SV_GetConfigStringLength().

#define CS_LIGHTMAP   12
#define CS_MAPCHECKSUM   3

for catching cheater maps

Definition at line 312 of file q_shared.h.

Referenced by CL_CanMultiplayerStart(), SV_Map(), and SV_SetConfigString().

#define CS_MAPTITLE   1

display map title string - translated client side

Definition at line 310 of file q_shared.h.

Referenced by CL_LogEvent(), CL_ViewLoadMedia(), GAME_StartBattlescape(), and SV_Map().

#define CS_MAPZONE   13

for terrain texture replacement

Definition at line 322 of file q_shared.h.

Referenced by CL_ViewLoadMedia(), and SV_Map().

#define CS_MAXCLIENTS   2

Definition at line 311 of file q_shared.h.

Referenced by SP_worldspawn().

#define CS_MAXSOLDIERSPERPLAYER   5

max soldiers per player when in teamplay mode

Definition at line 314 of file q_shared.h.

Referenced by SP_worldspawn().

#define CS_MAXSOLDIERSPERTEAM   4

max soldiers per team

Definition at line 313 of file q_shared.h.

Referenced by SP_worldspawn().

#define CS_MAXTEAMS   7

how many multiplayer teams for this map

Definition at line 316 of file q_shared.h.

Referenced by G_RunFrame(), and SP_worldspawn().

#define CS_NAME   0

config strings are a general means of communication from the server to all connected clients. Each config string can usually be at most MAX_TOKEN_CHARS characters, but some of them (eg. CS_TILES) can span a multiple of that.

Definition at line 309 of file q_shared.h.

Referenced by CL_CanMultiplayerStart(), CL_ViewLoadMedia(), SV_Map(), and SV_New_f().

#define CS_OBJECTAMOUNT   11

amount of defined objects in the script files

Definition at line 320 of file q_shared.h.

Referenced by CL_CanMultiplayerStart(), SV_Map(), and SV_SetConfigString().

#define CS_PLAYERCOUNT   8

amount of already connected players

Definition at line 317 of file q_shared.h.

Referenced by G_ClientBegin(), and G_ClientDisconnect().

#define CS_UFOCHECKSUM   10

checksum of ufo files

Definition at line 319 of file q_shared.h.

Referenced by CL_CanMultiplayerStart(), SV_Map(), and SV_SetConfigString().

#define CS_VERSION   9

what is the servers version

Definition at line 318 of file q_shared.h.

Referenced by CL_CanMultiplayerStart(), and SV_Map().

#define CS_VICTORY_CONDITIONS   14

a list of msgids seperated by ,

Definition at line 323 of file q_shared.h.

Referenced by G_MissionAddVictoryMessage(), and GAME_InitMissionBriefing().

#define DOOR_OPEN_REVERSE   4

Definition at line 293 of file q_shared.h.

Referenced by Door_Use(), LET_RotateDoor(), SP_func_door(), and SP_func_door_sliding().

#define DOOR_ROTATION_ANGLE   90

Definition at line 187 of file q_shared.h.

Referenced by Door_Use(), and LET_RotateDoor().

#define EVENT_INSTANTLY   0x80

add this flag for instant event execution

Definition at line 73 of file q_shared.h.

Referenced by CL_ParseEvent(), G_EventActorAdd(), G_EventReset(), G_EventStart(), SV_AddEvent(), SV_QueueEvent(), and TEST_F().

#define GET_ACC (   ab,
  sk,
  pn 
)    ((pn) - (((float)(ab) - 10) / (MAX_SKILL / 2) + ((float)(sk) - 10) / (MAX_SKILL / 2)) / 2)
Todo:
Skill-influence needs some balancing.

Definition at line 289 of file q_shared.h.

Referenced by CL_GetHitProbability(), and G_CalcEffectiveSpread().

#define GET_ENCUMBRANCE_PENALTY (   weight,
  max 
)    (1.0f - ((weight) > (max) * WEIGHT_FACTOR * WEIGHT_HEAVY ? WEIGHT_HEAVY_PENALTY : (weight) > (max) * WEIGHT_FACTOR * WEIGHT_LIGHT ? WEIGHT_NORMAL_PENALTY : 0.0f))
#define GET_MORALE (   ab)    (std::min((100 + (ab) * 150/MAX_SKILL), 255))
#define GET_SLIDING_DOOR_SHIFT_VECTOR (   dir,
  speed,
  vecout 
)    do { const bool reverse = (dir) & DOOR_OPEN_REVERSE; VectorClear(vecout); vecout[dir & 3] = reverse ? -speed : speed; } while (0);

Definition at line 294 of file q_shared.h.

Referenced by Door_SlidingUse(), and LET_SlideDoor().

#define GET_TU (   ab,
  md 
)    (MIN_TU * (md) + (ab) * 20 / MAX_SKILL)
#define GRAVITY   500.0
#define IS_SHOT_HEADGEAR (   x)    ((x) == ST_HEADGEAR)

Determine whether the selected shoot type is for the item in the headgear slot.

Definition at line 245 of file q_shared.h.

Referenced by AI_GetItemForShootType(), CL_ActorDoShoot(), CL_ActorStartShoot(), and G_PrepareShot().

#define IS_SHOT_LEFT (   x)    ((x) == ST_LEFT || (x) == ST_LEFT_REACTION)

Determine whether the selected shoot type is for the item in the left hand, either shooting or reaction fire.

Definition at line 241 of file q_shared.h.

Referenced by AI_GetItemForShootType(), AI_IsHandForForShootTypeFree(), CL_ActorDoShoot(), and CL_ActorStartShoot().

#define IS_SHOT_REACTION (   x)    ((x) == ST_RIGHT_REACTION || (x) == ST_LEFT_REACTION)

Determine whether the selected shoot type is for reaction fire.

Definition at line 239 of file q_shared.h.

Referenced by AI_GetItemForShootType(), and AI_IsHandForForShootTypeFree().

#define IS_SHOT_RIGHT (   x)    ((x) == ST_RIGHT || (x) == ST_RIGHT_REACTION)

Determine whether the selected shoot type is for the item in the right hand, either shooting or reaction fire.

Definition at line 243 of file q_shared.h.

Referenced by AI_GetItemForShootType(), AI_IsHandForForShootTypeFree(), CL_ActorDoShoot(), CL_ActorGetMuzzle(), CL_ActorStartShoot(), G_EventInventoryAmmo(), G_PrepareShot(), and ReactionFire::shoot().

#define MapDef_Foreach (   var)    MapDef_ForeachCondition(var, 1)

Definition at line 505 of file q_shared.h.

Referenced by Com_GetMapDefinitionByID(), TEST_F(), and UI_SelectMap_f().

#define MapDef_ForeachCondition (   var,
  condition 
)
Value:
for (int var##__loopvar = 0; (var) = nullptr, var##__loopvar < Com_GetMapDefNumber(); var##__loopvar++) \
if ((var) = Com_GetMapDefByIDX(var##__loopvar), !(condition)) {} else
int Com_GetMapDefNumber(void)
mapDef_t * Com_GetMapDefByIDX(int index)

Definition at line 501 of file q_shared.h.

Referenced by TEST_F(), and UI_RequestMapList_f().

#define MAX_CLIENTS   256 /* absolute limit */
#define MAX_CONFIGSTRINGS   (CS_GENERAL+MAX_GENERAL)
#define MAX_CVARLISTINGAMETYPE   16

Definition at line 335 of file q_shared.h.

Referenced by Com_ParseGameTypes().

#define MAX_DEATH   3
See also
STATE_DEAD

Definition at line 257 of file q_shared.h.

Referenced by Com_ParseTeam(), and G_ActorDie().

#define MAX_ENTITYSTRINGS   2

Definition at line 301 of file q_shared.h.

Referenced by SV_GetConfigStringLength().

#define MAX_GAMETYPES   16

game types

Definition at line 333 of file q_shared.h.

Referenced by Com_ParseGameTypes().

#define MAX_GENERAL   (MAX_CLIENTS*2) /* general config strings */

Definition at line 300 of file q_shared.h.

Referenced by SV_GetConfigStringLength().

#define MAX_MAXHP   255

Definition at line 279 of file q_shared.h.

Referenced by CHAR_UpdateSkills().

#define MAX_SKILL   100
#define MAX_TERRAINDEFS   16

Terrain property table Terrain is defined by the file map_earth_terrain.png in pics/geoscape. It is a map of the world where the different terrainTypes are drawn in different colors. The colors used in that map must have the exact RGB values as in the table, or they won't be recognized.

See also
GEO_GetColor

Definition at line 388 of file q_shared.h.

Referenced by TerrainDefs::add(), TerrainDefs::findByColor(), TerrainDefs::findByName(), and TerrainDefs::~TerrainDefs().

#define MAX_TILESTRINGS   8
#define MIN_TU   39

Definition at line 280 of file q_shared.h.

#define NET_STATE_BEGIN   "begin"

Definition at line 609 of file q_shared.h.

Referenced by CL_RequestNextDownload().

#define NET_STATE_DISCONNECT   "disconnect"

Definition at line 611 of file q_shared.h.

Referenced by CL_Disconnect().

#define NET_STATE_INFO   "info"

Definition at line 612 of file q_shared.h.

#define NET_STATE_NEW   "new"

Definition at line 608 of file q_shared.h.

Referenced by CL_ConnectionlessPacket().

#define NET_STATE_STARTMATCH   "startmatch"

Definition at line 610 of file q_shared.h.

Referenced by GAME_StartMatch().

#define REJ_BANNED   "Banned."

Definition at line 582 of file q_shared.h.

Referenced by CL_ConnectionlessPacket(), and G_ClientConnect().

#define REJ_CONNECTION_REFUSED   "Connection refused."

Definition at line 586 of file q_shared.h.

Referenced by CL_ConnectionlessPacket(), and SVC_DirectConnect().

#define REJ_GAME_ALREADY_STARTED   "Game has started already."

Definition at line 585 of file q_shared.h.

Referenced by CL_ConnectionlessPacket(), and SVC_DirectConnect().

#define REJ_PASSWORD_REQUIRED_OR_INCORRECT   "Password required or incorrect."

Reject messages that are send to the client from the game module.

Definition at line 580 of file q_shared.h.

Referenced by CL_ConnectionlessPacket(), and G_ClientConnect().

#define REJ_SERVER_FULL   "Server is full."

Definition at line 583 of file q_shared.h.

Referenced by CL_ConnectionlessPacket(), G_ClientConnect(), and SVC_DirectConnect().

#define REJ_SERVER_VERSION_MISMATCH   "The server is running a different version of the game."

Definition at line 584 of file q_shared.h.

Referenced by CL_ConnectionlessPacket(), and SVC_DirectConnect().

#define SF_BODY   2

impact on actors

Definition at line 249 of file q_shared.h.

Referenced by CL_ActorShootHidden(), G_ShootGrenade(), G_ShootSingle(), LE_AddGrenade(), and LE_AddProjectile().

#define SF_BOUNCED   8

at least hit the ground once and can now start to bounce

Definition at line 251 of file q_shared.h.

Referenced by CL_ActorDoShoot(), CL_ActorDoShootTime(), CL_ActorDoThrow(), G_ShootGrenade(), and G_ShootSingle().

#define SF_BOUNCING   4

item should bounce around (like grenades)

Definition at line 250 of file q_shared.h.

Referenced by CL_ActorShootHidden(), G_ShootGrenade(), G_ShootSingle(), LE_AddGrenade(), and LE_AddProjectile().

#define SF_IMPACT   1

impact on none actor objects

Definition at line 248 of file q_shared.h.

Referenced by CL_ActorShootHidden(), G_ShootGrenade(), G_ShootSingle(), LE_AddGrenade(), and LE_AddProjectile().

#define SKIP_LOCAL_ENTITY   (-1)
#define ST_HEADGEAR   4

The headgear slot item should be used when shooting/using the item in the slot.

Note
shoot_types_t value

Definition at line 231 of file q_shared.h.

Referenced by CL_ActorShoot().

#define ST_LEFT   2

The left hand should be used for shooting.

Note
shoot_types_t value

Definition at line 221 of file q_shared.h.

Referenced by actorL_throwgrenade(), AIL_positionshoot(), and CL_ActorShoot().

#define ST_LEFT_REACTION   3

The left hand reaction fire should be used for shooting.

Note
shoot_types_t value

Definition at line 226 of file q_shared.h.

Referenced by ReactionFire::tryToShoot().

#define ST_NUM_SHOOT_TYPES   5

Amount of shoottypes available.

Note
shoot_types_t value

Definition at line 236 of file q_shared.h.

Referenced by AI_FighterCalcActionScore(), AI_HasLineOfFire(), AIL_GetBestShot(), G_PrepareShot(), and ReactionFire::tryToShoot().

#define ST_RIGHT   0

The right hand should be used for shooting.

Note
shoot_types_t value

Definition at line 211 of file q_shared.h.

Referenced by actorL_throwgrenade(), AI_FighterCalcActionScore(), AI_HasLineOfFire(), AIL_GetBestShot(), AIL_positionshoot(), and CL_ActorShoot().

#define ST_RIGHT_REACTION   1

The right hand reaction fire should be used for shooting.

Note
shoot_types_t value

Definition at line 216 of file q_shared.h.

Referenced by ReactionFire::tryToShoot().

#define STATE_DAZED   0x0080

dazed and unable to move

Definition at line 269 of file q_shared.h.

Referenced by CL_ActorStateChange(), Actor::isDazed(), Actor::removeDazed(), and Actor::setDazed().

#define STATE_DEAD   0x0003

0 alive, 1-3 different deaths

See also
MAX_DEATH

Definition at line 262 of file q_shared.h.

Referenced by CL_ActorStateChange(), G_ClientDisconnect(), G_ClientGetFreeSpawnPointForActorSize(), Actor::isDead(), and Actor::isStunned().

#define STATE_INSANE   0x0020
#define STATE_PANIC   0x0008
#define STATE_PUBLIC   0x00FF

mask to separate private flags from events

Definition at line 261 of file q_shared.h.

Referenced by G_EventActorAdd(), G_EventActorAppear(), and G_EventSendState().

#define STATE_RAGE   0x0010

pretty self-explaining

Definition at line 266 of file q_shared.h.

Referenced by CL_ActorStateChange(), Actor::isRaged(), Actor::removeRaged(), and Actor::setRaged().

#define STATE_SHAKEN   0x0400

forced reaction fire

Definition at line 273 of file q_shared.h.

Referenced by CL_ActorStateChange(), Actor::isShaken(), Actor::removeShaken(), and Actor::setShaken().

#define STATE_STUN   0x0043
#define STATE_XVI   0x0800

controlled by the other team

Definition at line 274 of file q_shared.h.

Referenced by Edict::isOpponent().

#define SV_CMD_ACK   "ack"

Definition at line 596 of file q_shared.h.

Referenced by CL_ConnectionlessPacket().

#define SV_CMD_CONNECT   "connect"

Definition at line 588 of file q_shared.h.

Referenced by CL_Connect(), SV_ConnectionlessPacket(), and TEST_F().

#define SV_CMD_INFO   "info"

Definition at line 592 of file q_shared.h.

Referenced by GAME_MP_PingServer(), SV_ConnectionlessPacket(), and SVC_Info().

#define SV_CMD_PRINT   "print"
#define SV_CMD_RCON   "rcon"

Definition at line 589 of file q_shared.h.

Referenced by GAME_MP_Rcon(), GAME_MP_RunFrame(), and SV_ConnectionlessPacket().

#define SV_CMD_STATUS   "status"

Definition at line 590 of file q_shared.h.

Referenced by GAME_MP_ServerInfo_f(), and SV_ConnectionlessPacket().

#define SV_CMD_TEAMINFO   "teaminfo"
#define TEAM_MAX_HUMAN   TEAM_ALIEN - 1
#define WEIGHT_HEAVY   0.5f

Definition at line 282 of file q_shared.h.

#define WEIGHT_HEAVY_PENALTY   0.6f

Definition at line 284 of file q_shared.h.

#define WEIGHT_LIGHT   0.2f

Definition at line 281 of file q_shared.h.

#define WEIGHT_NORMAL_PENALTY   0.3f

Definition at line 283 of file q_shared.h.

Referenced by HUD_UpdateActorLoad_f(), and INV_UpdateActorLoad_f().

Typedef Documentation

typedef struct csi_s csi_t

The csi structure is the client-server-information structure which contains all the static data needed by the server and the client.

Note
Most of this comes from the script files
typedef struct cvarlist_s cvarlist_t
typedef struct gametype_s gametype_t
typedef struct mapDef_s mapDef_t
typedef int32_t shoot_types_t

Available shoot types - also see the ST_ constants.

Definition at line 206 of file q_shared.h.

Enumeration Type Documentation

Enumerator
CAMERA_MOBILE 
CAMERA_STATIONARY 
CAMERA_MAX 
CAMERA_ENSURE_32BIT 

Definition at line 178 of file q_shared.h.

Enumerator
ET_NULL 
ET_ACTORSPAWN 
ET_ACTOR 
ET_ITEM 
ET_BREAKABLE 
ET_TRIGGER 
ET_TRIGGER_HURT 
ET_TRIGGER_TOUCH 
ET_TRIGGER_RESCUE 
ET_TRIGGER_NEXTMAP 
ET_DOOR 
ET_DOOR_SLIDING 
ET_ROTATING 
ET_ACTOR2x2SPAWN 
ET_ACTOR2x2 
ET_CIVILIANTARGET 
ET_MISSION 
ET_ACTORHIDDEN 
ET_PARTICLE 
ET_SOUND 
ET_SOLID 
ET_MESSAGE 
ET_SMOKE 
ET_FIRE 
ET_SMOKESTUN 
ET_CAMERA 
ET_MAX 
ENTITY_TYPE_ENSURE_32BIT 

Definition at line 145 of file q_shared.h.

enum event_t

Possible event values.

See also
cl_parse.c for event bindings
Enumerator
EV_NULL 
EV_RESET 
EV_START 
EV_ENDROUND 

ends the current team's turn CL_DoEndRound

EV_ENDROUNDANNOUNCE 
EV_RESULTS 
EV_CENTERVIEW 
EV_MOVECAMERA 
EV_ENT_APPEAR 
EV_ENT_PERISH 

empty container or destroy inventory - set le invis to true see CL_EntPerish

EV_ENT_DESTROY 
EV_ADD_BRUSH_MODEL 
EV_ADD_EDICT 
EV_ACTOR_APPEAR 
EV_ACTOR_ADD 
EV_ACTOR_TURN 

turn an actor around

EV_ACTOR_MOVE 
EV_ACTOR_REACTIONFIRECHANGE 
EV_ACTOR_REACTIONFIREADDTARGET 
EV_ACTOR_REACTIONFIREREMOVETARGET 
EV_ACTOR_REACTIONFIRETARGETUPDATE 
EV_ACTOR_REACTIONFIREABORTSHOT 
EV_ACTOR_START_SHOOT 
EV_ACTOR_SHOOT 
EV_ACTOR_SHOOT_HIDDEN 
EV_ACTOR_THROW 
EV_ACTOR_END_SHOOT 
EV_ACTOR_DIE 
EV_ACTOR_REVITALISED 
EV_ACTOR_STATS 
EV_ACTOR_STATECHANGE 

set an actor to crouched or reaction fire

EV_ACTOR_RESERVATIONCHANGE 
EV_ACTOR_WOUND 
EV_INV_ADD 
EV_INV_DEL 
EV_INV_AMMO 
EV_INV_RELOAD 
EV_INV_TRANSFER 
EV_MODEL_EXPLODE 

delay the event execution by the impact time

EV_MODEL_EXPLODE_TRIGGERED 

don't delay the model explode event

EV_PARTICLE_APPEAR 
EV_PARTICLE_SPAWN 
EV_SOUND 
EV_DOOR_OPEN 
EV_DOOR_CLOSE 
EV_CLIENT_ACTION 
EV_RESET_CLIENT_ACTION 
EV_CAMERA_APPEAR 
EV_NUM_EVENTS 

Definition at line 79 of file q_shared.h.

Enumerator
PA_NULL 
PA_TURN 
PA_MOVE 
PA_STATE 
PA_SHOOT 
PA_USE 
PA_INVMOVE 
PA_REACT_SELECT 
PA_RESERVE_STATE 
PA_NUM_EVENTS 

Definition at line 189 of file q_shared.h.

Function Documentation

void void Com_DPrintf ( int  level,
const char *  msg,
  ... 
)
mapDef_t* Com_GetMapDefByIDX ( int  index)
mapDef_t* Com_GetMapDefinitionByID ( const char *  mapDefID)

Definition at line 3620 of file scripts.cpp.

References Com_DPrintf(), DEBUG_SHARED, mapDef_s::id, MapDef_Foreach, and Q_streq.

int Com_GetMapDefNumber ( void  )

Definition at line 60 of file cl_game_campaign.cpp.

References cgi, csi, cgame_import_s::csi, and csi_s::numMDs.

void Com_Printf ( const char *  msg,
  ... 
)
void format ( __printf__  ,
,
 
)

Referenced by G_ClientAction().

void Sys_Error ( const char *  error,
  ... 
)

Variable Documentation

csi_t csi

Definition at line 39 of file common.cpp.

Referenced by CL_ActorAdd(), CL_ActorAppear(), CL_CanMultiplayerStart(), CL_InitAfter(), CL_PrecacheCharacterModels(), CL_TeamDefInitMenu(), CL_ViewLoadMedia(), CL_ViewPrecacheModels(), Com_AddObjectLinks(), Com_GetBodyTemplateByID(), Com_GetCharacterTemplateByID(), Com_GetMapDefByIDX(), Com_GetMapDefNumber(), Com_GetNameListByID(), Com_GetTeamDefinitionByID(), Com_GetUGVByID(), Com_GetUGVByIDSilent(), Com_ParseActorNames(), Com_ParseArmourOrResistance(), Com_ParseBodyTemplate(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseGameTypes(), Com_ParseImplant(), Com_ParseInventory(), Com_ParseItem(), Com_ParseMapDefinition(), Com_ParseScripts(), Com_ParseTeam(), Com_ParseTerrainDefinition(), Com_ParseUGVs(), Com_ParseValue(), Com_ValueToStr(), GAME_ChangeEquip(), GAME_GetImportData(), GAME_LoadItem(), GAME_SaveTeam(), GAME_SetMode(), GAME_Spawn(), GAME_SwitchCurrentSelectedMap(), INV_EquipmentDefSanityCheck(), INV_GetEquipmentDefinitionByID(), INV_ItemDescription(), INV_UpdateObject_f(), LE_AddProjectile(), LET_Projectile(), PR_UpdateProductionList(), ResetInventoryList(), RS_InitTree(), S_PrecacheSamples(), SV_InitGameProgs(), SV_Map(), TEST_F(), TEST_Init(), GameTest::testCountSpawnpointsForMapInMultiplayerMode(), UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeGetItem(), UI_ContainerItemIteratorNext(), UI_ContainerNodeUpdateEquipment(), UI_MapInfo(), UI_MapInfoGetNext(), UI_RequestMapList_f(), and UI_SelectMap_f().

const char* pa_format[PA_NUM_EVENTS]

Player action format strings for netchannel transfer.

Note
They all have a prefix
See also
MSG_Write_PA

Definition at line 34 of file q_shared.cpp.

Referenced by G_ClientAction(), and MSG_Write_PA().