Quake II RTX doxygen  1.0 dev
g_main.c File Reference
#include "g_local.h"

Go to the source code of this file.

Functions

void SpawnEntities (const char *mapname, const char *entities, const char *spawnpoint)
 
void ClientThink (edict_t *ent, usercmd_t *cmd)
 
qboolean ClientConnect (edict_t *ent, char *userinfo)
 
void ClientUserinfoChanged (edict_t *ent, char *userinfo)
 
void ClientDisconnect (edict_t *ent)
 
void ClientBegin (edict_t *ent)
 
void ClientCommand (edict_t *ent)
 
void RunEntity (edict_t *ent)
 
void WriteGame (const char *filename, qboolean autosave)
 
void ReadGame (const char *filename)
 
void WriteLevel (const char *filename)
 
void ReadLevel (const char *filename)
 
void InitGame (void)
 
void G_RunFrame (void)
 
void ShutdownGame (void)
 
q_exported game_export_t * GetGameAPI (game_import_t *import)
 
void Com_LPrintf (print_type_t type, const char *fmt,...)
 
void Com_Error (error_type_t type, const char *fmt,...)
 
void ClientEndServerFrames (void)
 
edict_t * CreateTargetChangeLevel (char *map)
 
void EndDMLevel (void)
 
void CheckNeedPass (void)
 
void CheckDMRules (void)
 
void ExitLevel (void)
 

Variables

game_locals_t game
 
level_locals_t level
 
game_import_t gi
 
game_export_t globals
 
spawn_temp_t st
 
int sm_meat_index
 
int snd_fry
 
int meansOfDeath
 
edict_t * g_edicts
 
cvar_t * deathmatch
 
cvar_t * coop
 
cvar_t * dmflags
 
cvar_t * skill
 
cvar_t * fraglimit
 
cvar_t * timelimit
 
cvar_t * password
 
cvar_t * spectator_password
 
cvar_t * needpass
 
cvar_t * maxclients
 
cvar_t * maxspectators
 
cvar_t * maxentities
 
cvar_t * g_select_empty
 
cvar_t * dedicated
 
cvar_t * nomonsters
 
cvar_t * filterban
 
cvar_t * sv_maxvelocity
 
cvar_t * sv_gravity
 
cvar_t * sv_rollspeed
 
cvar_t * sv_rollangle
 
cvar_t * gun_x
 
cvar_t * gun_y
 
cvar_t * gun_z
 
cvar_t * run_pitch
 
cvar_t * run_roll
 
cvar_t * bob_up
 
cvar_t * bob_pitch
 
cvar_t * bob_roll
 
cvar_t * sv_cheats
 
cvar_t * flood_msgs
 
cvar_t * flood_persecond
 
cvar_t * flood_waitdelay
 
cvar_t * sv_maplist
 
cvar_t * sv_features
 
cvar_t * sv_flaregun
 

Function Documentation

◆ CheckDMRules()

void CheckDMRules ( void  )

Definition at line 403 of file g_main.c.

404 {
405  int i;
406  gclient_t *cl;
407 
409  return;
410 
411  if (!deathmatch->value)
412  return;
413 
414  if (timelimit->value) {
415  if (level.time >= timelimit->value * 60) {
416  gi.bprintf(PRINT_HIGH, "Timelimit hit.\n");
417  EndDMLevel();
418  return;
419  }
420  }
421 
422  if (fraglimit->value) {
423  for (i = 0 ; i < maxclients->value ; i++) {
424  cl = game.clients + i;
425  if (!g_edicts[i + 1].inuse)
426  continue;
427 
428  if (cl->resp.score >= fraglimit->value) {
429  gi.bprintf(PRINT_HIGH, "Fraglimit hit.\n");
430  EndDMLevel();
431  return;
432  }
433  }
434  }
435 }

Referenced by G_RunFrame().

◆ CheckNeedPass()

void CheckNeedPass ( void  )

Definition at line 378 of file g_main.c.

379 {
380  int need;
381 
382  // if password or spectator_password has changed, update needpass
383  // as needed
384  if (password->modified || spectator_password->modified) {
385  password->modified = spectator_password->modified = qfalse;
386 
387  need = 0;
388 
389  if (*password->string && Q_stricmp(password->string, "none"))
390  need |= 1;
391  if (*spectator_password->string && Q_stricmp(spectator_password->string, "none"))
392  need |= 2;
393 
394  gi.cvar_set("needpass", va("%d", need));
395  }
396 }

Referenced by G_RunFrame().

◆ ClientBegin()

void ClientBegin ( edict_t *  ent)

Definition at line 1267 of file p_client.c.

1268 {
1269  int i;
1270 
1271  ent->client = game.clients + (ent - g_edicts - 1);
1272 
1273  if (deathmatch->value) {
1274  ClientBeginDeathmatch(ent);
1275  return;
1276  }
1277 
1278  // if there is already a body waiting for us (a loadgame), just
1279  // take it, otherwise spawn one from scratch
1280  if (ent->inuse == qtrue) {
1281  // the client has cleared the client side viewangles upon
1282  // connecting to the server, which is different than the
1283  // state when the game is saved, so we need to compensate
1284  // with deltaangles
1285  for (i = 0 ; i < 3 ; i++)
1286  ent->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(ent->client->ps.viewangles[i]);
1287  } else {
1288  // a spawn point will completely reinitialize the entity
1289  // except for the persistant data that was initialized at
1290  // ClientConnect() time
1291  G_InitEdict(ent);
1292  ent->classname = "player";
1293  InitClientResp(ent->client);
1294  PutClientInServer(ent);
1295  }
1296 
1297  if (level.intermissiontime) {
1299  } else {
1300  // send effect if in a multiplayer game
1301  if (game.maxclients > 1) {
1302  gi.WriteByte(svc_muzzleflash);
1303  gi.WriteShort(ent - g_edicts);
1304  gi.WriteByte(MZ_LOGIN);
1305  gi.multicast(ent->s.origin, MULTICAST_PVS);
1306 
1307  gi.bprintf(PRINT_HIGH, "%s entered the game\n", ent->client->pers.netname);
1308  }
1309  }
1310 
1311  // make sure all view stuff is valid
1312  ClientEndServerFrame(ent);
1313 }

Referenced by GetGameAPI().

◆ ClientCommand()

void ClientCommand ( edict_t *  ent)

Definition at line 846 of file g_cmds.c.

847 {
848  char *cmd;
849 
850  if (!ent->client)
851  return; // not fully in game yet
852 
853  cmd = gi.argv(0);
854 
855  if (Q_stricmp(cmd, "players") == 0) {
856  Cmd_Players_f(ent);
857  return;
858  }
859  if (Q_stricmp(cmd, "say") == 0) {
860  Cmd_Say_f(ent, qfalse, qfalse);
861  return;
862  }
863  if (Q_stricmp(cmd, "say_team") == 0) {
864  Cmd_Say_f(ent, qtrue, qfalse);
865  return;
866  }
867  if (Q_stricmp(cmd, "score") == 0) {
868  Cmd_Score_f(ent);
869  return;
870  }
871  if (Q_stricmp(cmd, "help") == 0) {
872  Cmd_Help_f(ent);
873  return;
874  }
875 
877  return;
878 
879  if (Q_stricmp(cmd, "use") == 0)
880  Cmd_Use_f(ent);
881  else if (Q_stricmp(cmd, "drop") == 0)
882  Cmd_Drop_f(ent);
883  else if (Q_stricmp(cmd, "give") == 0)
884  Cmd_Give_f(ent);
885  else if (Q_stricmp(cmd, "god") == 0)
886  Cmd_God_f(ent);
887  else if (Q_stricmp(cmd, "notarget") == 0)
888  Cmd_Notarget_f(ent);
889  else if (Q_stricmp(cmd, "noclip") == 0)
890  Cmd_Noclip_f(ent);
891  else if (Q_stricmp(cmd, "inven") == 0)
892  Cmd_Inven_f(ent);
893  else if (Q_stricmp(cmd, "invnext") == 0)
894  SelectNextItem(ent, -1);
895  else if (Q_stricmp(cmd, "invprev") == 0)
896  SelectPrevItem(ent, -1);
897  else if (Q_stricmp(cmd, "invnextw") == 0)
899  else if (Q_stricmp(cmd, "invprevw") == 0)
901  else if (Q_stricmp(cmd, "invnextp") == 0)
903  else if (Q_stricmp(cmd, "invprevp") == 0)
905  else if (Q_stricmp(cmd, "invuse") == 0)
906  Cmd_InvUse_f(ent);
907  else if (Q_stricmp(cmd, "invdrop") == 0)
908  Cmd_InvDrop_f(ent);
909  else if (Q_stricmp(cmd, "weapprev") == 0)
910  Cmd_WeapPrev_f(ent);
911  else if (Q_stricmp(cmd, "weapnext") == 0)
912  Cmd_WeapNext_f(ent);
913  else if (Q_stricmp(cmd, "weaplast") == 0)
914  Cmd_WeapLast_f(ent);
915  else if (Q_stricmp(cmd, "kill") == 0)
916  Cmd_Kill_f(ent);
917  else if (Q_stricmp(cmd, "putaway") == 0)
918  Cmd_PutAway_f(ent);
919  else if (Q_stricmp(cmd, "wave") == 0)
920  Cmd_Wave_f(ent);
921  else if (Q_stricmp(cmd, "playerlist") == 0)
922  Cmd_PlayerList_f(ent);
923  else // anything that doesn't match a command will be a chat
924  Cmd_Say_f(ent, qfalse, qtrue);
925 }

Referenced by GetGameAPI().

◆ ClientConnect()

qboolean ClientConnect ( edict_t *  ent,
char *  userinfo 
)

Definition at line 1389 of file p_client.c.

1390 {
1391  char *value;
1392 
1393  // check to see if they are on the banned IP list
1394  value = Info_ValueForKey(userinfo, "ip");
1395  if (SV_FilterPacket(value)) {
1396  Info_SetValueForKey(userinfo, "rejmsg", "Banned.");
1397  return qfalse;
1398  }
1399 
1400  // check for a spectator
1401  value = Info_ValueForKey(userinfo, "spectator");
1402  if (deathmatch->value && *value && strcmp(value, "0")) {
1403  int i, numspec;
1404 
1405  if (*spectator_password->string &&
1406  strcmp(spectator_password->string, "none") &&
1407  strcmp(spectator_password->string, value)) {
1408  Info_SetValueForKey(userinfo, "rejmsg", "Spectator password required or incorrect.");
1409  return qfalse;
1410  }
1411 
1412  // count spectators
1413  for (i = numspec = 0; i < maxclients->value; i++)
1414  if (g_edicts[i + 1].inuse && g_edicts[i + 1].client->pers.spectator)
1415  numspec++;
1416 
1417  if (numspec >= maxspectators->value) {
1418  Info_SetValueForKey(userinfo, "rejmsg", "Server spectator limit is full.");
1419  return qfalse;
1420  }
1421  } else {
1422  // check for a password
1423  value = Info_ValueForKey(userinfo, "password");
1424  if (*password->string && strcmp(password->string, "none") &&
1425  strcmp(password->string, value)) {
1426  Info_SetValueForKey(userinfo, "rejmsg", "Password required or incorrect.");
1427  return qfalse;
1428  }
1429  }
1430 
1431 
1432  // they can connect
1433  ent->client = game.clients + (ent - g_edicts - 1);
1434 
1435  // if there is already a body waiting for us (a loadgame), just
1436  // take it, otherwise spawn one from scratch
1437  if (ent->inuse == qfalse) {
1438  // clear the respawning variables
1439  InitClientResp(ent->client);
1440  if (!game.autosaved || !ent->client->pers.weapon)
1441  InitClientPersistant(ent->client);
1442  }
1443 
1444  ClientUserinfoChanged(ent, userinfo);
1445 
1446  if (game.maxclients > 1)
1447  gi.dprintf("%s connected\n", ent->client->pers.netname);
1448 
1449  ent->svflags = 0; // make sure we start with known default
1450  ent->client->pers.connected = qtrue;
1451  return qtrue;
1452 }

Referenced by GetGameAPI().

◆ ClientDisconnect()

void ClientDisconnect ( edict_t *  ent)

Definition at line 1462 of file p_client.c.

1463 {
1464  //int playernum;
1465 
1466  if (!ent->client)
1467  return;
1468 
1469  gi.bprintf(PRINT_HIGH, "%s disconnected\n", ent->client->pers.netname);
1470 
1471  // send effect
1472  if (ent->inuse) {
1473  gi.WriteByte(svc_muzzleflash);
1474  gi.WriteShort(ent - g_edicts);
1475  gi.WriteByte(MZ_LOGOUT);
1476  gi.multicast(ent->s.origin, MULTICAST_PVS);
1477  }
1478 
1479  gi.unlinkentity(ent);
1480  ent->s.modelindex = 0;
1481  ent->s.sound = 0;
1482  ent->s.event = 0;
1483  ent->s.effects = 0;
1484  ent->solid = SOLID_NOT;
1485  ent->inuse = qfalse;
1486  ent->classname = "disconnected";
1487  ent->client->pers.connected = qfalse;
1488 
1489  // FIXME: don't break skins on corpses, etc
1490  //playernum = ent-g_edicts-1;
1491  //gi.configstring (CS_PLAYERSKINS+playernum, "");
1492 }

Referenced by GetGameAPI().

◆ ClientEndServerFrames()

void ClientEndServerFrames ( void  )

Definition at line 279 of file g_main.c.

280 {
281  int i;
282  edict_t *ent;
283 
284  // calc the player views now that all pushing
285  // and damage has been added
286  for (i = 0 ; i < maxclients->value ; i++) {
287  ent = g_edicts + 1 + i;
288  if (!ent->inuse || !ent->client)
289  continue;
291  }
292 
293 }

Referenced by ExitLevel(), and G_RunFrame().

◆ ClientThink()

void ClientThink ( edict_t *  ent,
usercmd_t *  cmd 
)

Definition at line 1534 of file p_client.c.

1535 {
1536  gclient_t *client;
1537  edict_t *other;
1538  int i, j;
1539  pmove_t pm;
1540 
1541  level.current_entity = ent;
1542  client = ent->client;
1543 
1544  if (level.intermissiontime) {
1545  client->ps.pmove.pm_type = PM_FREEZE;
1546  // can exit intermission after five seconds
1547  if (level.time > level.intermissiontime + 5.0
1548  && (ucmd->buttons & BUTTON_ANY))
1549  level.exitintermission = qtrue;
1550  return;
1551  }
1552 
1553  pm_passent = ent;
1554 
1555  if (ent->client->chase_target) {
1556 
1557  client->resp.cmd_angles[0] = SHORT2ANGLE(ucmd->angles[0]);
1558  client->resp.cmd_angles[1] = SHORT2ANGLE(ucmd->angles[1]);
1559  client->resp.cmd_angles[2] = SHORT2ANGLE(ucmd->angles[2]);
1560 
1561  } else {
1562 
1563  // set up for pmove
1564  memset(&pm, 0, sizeof(pm));
1565 
1566  if (ent->movetype == MOVETYPE_NOCLIP)
1567  client->ps.pmove.pm_type = PM_SPECTATOR;
1568  else if (ent->s.modelindex != 255)
1569  client->ps.pmove.pm_type = PM_GIB;
1570  else if (ent->deadflag)
1571  client->ps.pmove.pm_type = PM_DEAD;
1572  else
1573  client->ps.pmove.pm_type = PM_NORMAL;
1574 
1575  client->ps.pmove.gravity = sv_gravity->value;
1576  pm.s = client->ps.pmove;
1577 
1578  for (i = 0 ; i < 3 ; i++) {
1579  pm.s.origin[i] = ent->s.origin[i] * 8;
1580  pm.s.velocity[i] = ent->velocity[i] * 8;
1581  }
1582 
1583  if (memcmp(&client->old_pmove, &pm.s, sizeof(pm.s))) {
1584  pm.snapinitial = qtrue;
1585  // gi.dprintf ("pmove changed!\n");
1586  }
1587 
1588  pm.cmd = *ucmd;
1589 
1590  pm.trace = PM_trace; // adds default parms
1591  pm.pointcontents = gi.pointcontents;
1592 
1593  // perform a pmove
1594  gi.Pmove(&pm);
1595 
1596  // save results of pmove
1597  client->ps.pmove = pm.s;
1598  client->old_pmove = pm.s;
1599 
1600  for (i = 0 ; i < 3 ; i++) {
1601  ent->s.origin[i] = pm.s.origin[i] * 0.125;
1602  ent->velocity[i] = pm.s.velocity[i] * 0.125;
1603  }
1604 
1605  VectorCopy(pm.mins, ent->mins);
1606  VectorCopy(pm.maxs, ent->maxs);
1607 
1608  client->resp.cmd_angles[0] = SHORT2ANGLE(ucmd->angles[0]);
1609  client->resp.cmd_angles[1] = SHORT2ANGLE(ucmd->angles[1]);
1610  client->resp.cmd_angles[2] = SHORT2ANGLE(ucmd->angles[2]);
1611 
1612  if (ent->groundentity && !pm.groundentity && (pm.cmd.upmove >= 10) && (pm.waterlevel == 0)) {
1613  gi.sound(ent, CHAN_VOICE, gi.soundindex("*jump1.wav"), 1, ATTN_NORM, 0);
1614  PlayerNoise(ent, ent->s.origin, PNOISE_SELF);
1615  }
1616 
1617  ent->viewheight = pm.viewheight;
1618  ent->waterlevel = pm.waterlevel;
1619  ent->watertype = pm.watertype;
1620  ent->groundentity = pm.groundentity;
1621  if (pm.groundentity)
1622  ent->groundentity_linkcount = pm.groundentity->linkcount;
1623 
1624  if (ent->deadflag) {
1625  client->ps.viewangles[ROLL] = 40;
1626  client->ps.viewangles[PITCH] = -15;
1627  client->ps.viewangles[YAW] = client->killer_yaw;
1628  } else {
1629  VectorCopy(pm.viewangles, client->v_angle);
1630  VectorCopy(pm.viewangles, client->ps.viewangles);
1631  }
1632 
1633  gi.linkentity(ent);
1634 
1635  if (ent->movetype != MOVETYPE_NOCLIP)
1636  G_TouchTriggers(ent);
1637 
1638  // touch other objects
1639  for (i = 0 ; i < pm.numtouch ; i++) {
1640  other = pm.touchents[i];
1641  for (j = 0 ; j < i ; j++)
1642  if (pm.touchents[j] == other)
1643  break;
1644  if (j != i)
1645  continue; // duplicated
1646  if (!other->touch)
1647  continue;
1648  other->touch(other, ent, NULL, NULL);
1649  }
1650 
1651  }
1652 
1653  client->oldbuttons = client->buttons;
1654  client->buttons = ucmd->buttons;
1655  client->latched_buttons |= client->buttons & ~client->oldbuttons;
1656 
1657  // save light level the player is standing on for
1658  // monster sighting AI
1659  ent->light_level = ucmd->lightlevel;
1660 
1661  // fire weapon from final position if needed
1662  if (client->latched_buttons & BUTTON_ATTACK) {
1663  if (client->resp.spectator) {
1664 
1665  client->latched_buttons = 0;
1666 
1667  if (client->chase_target) {
1668  client->chase_target = NULL;
1669  client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
1670  } else
1671  GetChaseTarget(ent);
1672 
1673  } else if (!client->weapon_thunk) {
1674  client->weapon_thunk = qtrue;
1675  Think_Weapon(ent);
1676  }
1677  }
1678 
1679  if (client->resp.spectator) {
1680  if (ucmd->upmove >= 10) {
1681  if (!(client->ps.pmove.pm_flags & PMF_JUMP_HELD)) {
1682  client->ps.pmove.pm_flags |= PMF_JUMP_HELD;
1683  if (client->chase_target)
1684  ChaseNext(ent);
1685  else
1686  GetChaseTarget(ent);
1687  }
1688  } else
1689  client->ps.pmove.pm_flags &= ~PMF_JUMP_HELD;
1690  }
1691 
1692  // update chase cam if being followed
1693  for (i = 1; i <= maxclients->value; i++) {
1694  other = g_edicts + i;
1695  if (other->inuse && other->client->chase_target == ent)
1697  }
1698 }

Referenced by GetGameAPI().

◆ ClientUserinfoChanged()

void ClientUserinfoChanged ( edict_t *  ent,
char *  userinfo 
)

Definition at line 1325 of file p_client.c.

1326 {
1327  char *s;
1328  int playernum;
1329 
1330  // check for malformed or illegal info strings
1331  if (!Info_Validate(userinfo)) {
1332  strcpy(userinfo, "\\name\\badinfo\\skin\\male/grunt");
1333  }
1334 
1335  // set name
1336  s = Info_ValueForKey(userinfo, "name");
1337  strncpy(ent->client->pers.netname, s, sizeof(ent->client->pers.netname) - 1);
1338 
1339  // set spectator
1340  s = Info_ValueForKey(userinfo, "spectator");
1341  // spectators are only supported in deathmatch
1342  if (deathmatch->value && *s && strcmp(s, "0"))
1343  ent->client->pers.spectator = qtrue;
1344  else
1345  ent->client->pers.spectator = qfalse;
1346 
1347  // set skin
1348  s = Info_ValueForKey(userinfo, "skin");
1349 
1350  playernum = ent - g_edicts - 1;
1351 
1352  // combine name and skin into a configstring
1353  gi.configstring(CS_PLAYERSKINS + playernum, va("%s\\%s", ent->client->pers.netname, s));
1354 
1355  // fov
1356  if (deathmatch->value && ((int)dmflags->value & DF_FIXED_FOV)) {
1357  ent->client->ps.fov = 90;
1358  } else {
1359  ent->client->ps.fov = atoi(Info_ValueForKey(userinfo, "fov"));
1360  if (ent->client->ps.fov < 1)
1361  ent->client->ps.fov = 90;
1362  else if (ent->client->ps.fov > 160)
1363  ent->client->ps.fov = 160;
1364  }
1365 
1366  // handedness
1367  s = Info_ValueForKey(userinfo, "hand");
1368  if (strlen(s)) {
1369  ent->client->pers.hand = atoi(s);
1370  }
1371 
1372  // save off the userinfo in case we want to check something later
1373  strncpy(ent->client->pers.userinfo, userinfo, sizeof(ent->client->pers.userinfo) - 1);
1374 }

Referenced by ClientConnect(), GetGameAPI(), and PutClientInServer().

◆ Com_Error()

void Com_Error ( error_type_t  type,
const char *  fmt,
  ... 
)

Definition at line 258 of file g_main.c.

259 {
260  va_list argptr;
261  char text[MAX_STRING_CHARS];
262 
263  va_start(argptr, fmt);
264  Q_vsnprintf(text, sizeof(text), fmt, argptr);
265  va_end(argptr);
266 
267  gi.error("%s", text);
268 }

Referenced by _os_get_io(), Action_Init(), add_msg_packet(), BSP_ClusterVis(), BSP_Free(), BSP_InlineModel(), BSP_Load(), bsp_mesh_create_from_bsp(), CalcSurfaceExtents(), CL_CheckTimeout(), CL_ConnectionlessPacket(), CL_Disconnect_f(), CL_FinishDownload(), CL_GetEntitySoundOrigin(), CL_HandleDownload(), CL_Init(), CL_InitRefresh(), CL_ParseBaseline(), CL_ParseConfigstring(), CL_ParseDeltaEntity(), CL_ParseDownload(), CL_ParseFrame(), CL_ParseMuzzleFlashPacket(), CL_ParsePacketEntities(), CL_ParsePlayerSkin(), CL_ParseReconnect(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseTEnt(), CL_ParseTEntPacket(), CL_ParseZPacket(), CL_QueueDownload(), CL_RegisterBspModels(), CL_RequestNextDownload(), CL_SeekDemoMessage(), CL_UpdateConfigstring(), CM_FatPVS(), collect_surfaces(), COM_BlockSequenceCRCByte(), Com_Error_f(), Com_ErrorDrop_f(), COM_FileExtension(), COM_SkipPath(), Con_RegisterMedia(), Cvar_Get(), D_SCAlloc(), file_for_handle(), find_handle(), finish_demo(), FloodArea_r(), free_msg_packet(), FS_FOpenFile(), fs_game_changed(), FS_LoadFileEx(), FS_Write(), GL_DrawEntities(), GL_LoadWorld(), hq2x_blend(), hq4x_blend(), Hunk_Alloc(), Hunk_Begin(), Hunk_End(), Hunk_Free(), IMG_Find(), IMG_ForHandle(), IMG_GetPalette(), IMG_Init(), IMG_ResampleTexture(), inflate_udp_download(), init_vulkan(), Key_Event(), Keybind_Init(), Menu_AddItem(), Menu_Draw(), Menu_Init(), MOD_ForHandle(), MOD_Init(), MOD_Reference(), MOD_Reference_GL(), MOD_Reference_RTX(), MSG_PackEntity(), MSG_ReadBits(), MSG_ReadData(), MSG_ReadDir(), MSG_WriteByte(), MSG_WriteChar(), MSG_WriteDeltaEntity(), MSG_WriteDeltaPlayerstate_Default(), MSG_WriteDeltaPlayerstate_Enhanced(), MSG_WriteShort(), MVD_ParseEntityString(), NET_BaseAdrToString(), NET_OpenServer(), NET_SendPacket(), Netchan_Setup(), NetchanOld_TransmitNextFragment(), os_add_io(), os_get_io(), os_net_init(), pack_put(), PF_AreasConnected(), PF_configstring(), PF_cprintf(), PF_error(), PF_FindIndex(), PF_FreeTags(), PF_inVIS(), PF_PositionedSound(), PF_SetAreaPortalState(), PF_setmodel(), PF_TagMalloc(), PF_WriteFloat(), Q_strlcat(), Q_vsnprintf(), R_BeginRegistration(), R_BeginRegistration_RTX(), R_BuildLightMap(), R_BuildPolygonFromSurface(), R_ClipAndDrawPoly(), R_DrawBEntitiesOnList(), R_DrawEntities(), R_Init_RTX(), R_RecursiveClipBPoly(), R_RegisterModel(), R_RenderFrame(), R_RenderFrame_GL(), read_level_file(), read_server_file(), S_PickChannel(), S_SfxForHandle(), SCR_ExecuteLayoutString(), SCR_ReadNextFrame(), SCR_UpdateScreen(), start_udp_download(), Static_Init(), SV_HullForEntity(), SV_InitGame(), SV_InitGameProgs(), SV_Multicast(), SV_PointContents(), SV_Trace(), SWimp_ModeChanged(), Sys_FreeLibrary(), SZ_GetSpace(), TH_DrawLayoutString(), UI_OpenMenu(), UI_PopMenu(), V_CalcFov(), VID_EndFrame(), Win_Init(), Z_Realloc(), Z_ReservedAlloc(), Z_TagMalloc(), and Z_Validate().

◆ Com_LPrintf()

void Com_LPrintf ( print_type_t  type,
const char *  fmt,
  ... 
)

Definition at line 242 of file g_main.c.

243 {
244  va_list argptr;
245  char text[MAX_STRING_CHARS];
246 
247  if (type == PRINT_DEVELOPER) {
248  return;
249  }
250 
251  va_start(argptr, fmt);
252  Q_vsnprintf(text, sizeof(text), fmt, argptr);
253  va_end(argptr);
254 
255  gi.dprintf("%s", text);
256 }

Referenced by CL_ConnectionlessPacket(), CL_ParseBaseline(), CL_ParseDeltaEntity(), CL_ParseFrame(), CL_ParsePrint(), CL_ParseServerMessage(), CL_SeekDemoMessage(), finish_download(), PF_cprintf(), SV_ConSay_f(), and Sys_GetAntiCheatAPI().

◆ CreateTargetChangeLevel()

edict_t* CreateTargetChangeLevel ( char *  map)

Definition at line 302 of file g_main.c.

303 {
304  edict_t *ent;
305 
306  ent = G_Spawn();
307  ent->classname = "target_changelevel";
308  Q_snprintf(level.nextmap, sizeof(level.nextmap), "%s", map);
309  ent->map = level.nextmap;
310  return ent;
311 }

Referenced by EndDMLevel().

◆ EndDMLevel()

void EndDMLevel ( void  )

Definition at line 320 of file g_main.c.

321 {
322  edict_t *ent;
323  char *s, *t, *f;
324  static const char *seps = " ,\n\r";
325 
326  // stay on same level flag
327  if ((int)dmflags->value & DF_SAME_LEVEL) {
329  return;
330  }
331 
332  // see if it's in the map list
333  if (*sv_maplist->string) {
334  s = strdup(sv_maplist->string);
335  f = NULL;
336  t = strtok(s, seps);
337  while (t != NULL) {
338  if (Q_stricmp(t, level.mapname) == 0) {
339  // it's in the list, go to the next one
340  t = strtok(NULL, seps);
341  if (t == NULL) { // end of list, go to first one
342  if (f == NULL) // there isn't a first one, same level
344  else
346  } else
348  free(s);
349  return;
350  }
351  if (!f)
352  f = t;
353  t = strtok(NULL, seps);
354  }
355  free(s);
356  }
357 
358  if (level.nextmap[0]) // go to a specific map
360  else { // search for a changelevel
361  ent = G_Find(NULL, FOFS(classname), "target_changelevel");
362  if (!ent) {
363  // the map designer didn't include a changelevel,
364  // so create a fake ent that goes back to the same level
366  return;
367  }
368  BeginIntermission(ent);
369  }
370 }

Referenced by CheckDMRules().

◆ ExitLevel()

void ExitLevel ( void  )

Definition at line 443 of file g_main.c.

444 {
445  int i;
446  edict_t *ent;
447  char command [256];
448 
449  Q_snprintf(command, sizeof(command), "gamemap \"%s\"\n", level.changemap);
450  gi.AddCommandString(command);
451  level.changemap = NULL;
455 
456  // clear some things before going to next level
457  for (i = 0 ; i < maxclients->value ; i++) {
458  ent = g_edicts + 1 + i;
459  if (!ent->inuse)
460  continue;
461  if (ent->health > ent->client->pers.max_health)
462  ent->health = ent->client->pers.max_health;
463  }
464 
465 }

Referenced by G_RunFrame().

◆ G_RunFrame()

void G_RunFrame ( void  )

Definition at line 474 of file g_main.c.

475 {
476  int i;
477  edict_t *ent;
478 
479  level.framenum++;
481 
482  // choose a client for monsters to target this frame
484 
485  // exit intermissions
486 
487  if (level.exitintermission) {
488  ExitLevel();
489  return;
490  }
491 
492  //
493  // treat each object in turn
494  // even the world gets a chance to think
495  //
496  ent = &g_edicts[0];
497  for (i = 0 ; i < globals.num_edicts ; i++, ent++) {
498  if (!ent->inuse)
499  continue;
500 
501  level.current_entity = ent;
502 
503  VectorCopy(ent->s.origin, ent->s.old_origin);
504 
505  // if the ground entity moved, make sure we are still on it
506  if ((ent->groundentity) && (ent->groundentity->linkcount != ent->groundentity_linkcount)) {
507  ent->groundentity = NULL;
508  if (!(ent->flags & (FL_SWIM | FL_FLY)) && (ent->svflags & SVF_MONSTER)) {
509  M_CheckGround(ent);
510  }
511  }
512 
513  if (i > 0 && i <= maxclients->value) {
515  continue;
516  }
517 
518  G_RunEntity(ent);
519  }
520 
521  // see if it is time to end a deathmatch
522  CheckDMRules();
523 
524  // see if needpass needs updated
525  CheckNeedPass();
526 
527  // build the playerstate_t structures for all players
529 }

Referenced by GetGameAPI().

◆ GetGameAPI()

q_exported game_export_t* GetGameAPI ( game_import_t *  import)

Definition at line 210 of file g_main.c.

211 {
212  gi = *import;
213 
214  globals.apiversion = GAME_API_VERSION;
215  globals.Init = InitGame;
216  globals.Shutdown = ShutdownGame;
217  globals.SpawnEntities = SpawnEntities;
218 
219  globals.WriteGame = WriteGame;
220  globals.ReadGame = ReadGame;
221  globals.WriteLevel = WriteLevel;
222  globals.ReadLevel = ReadLevel;
223 
224  globals.ClientThink = ClientThink;
225  globals.ClientConnect = ClientConnect;
226  globals.ClientUserinfoChanged = ClientUserinfoChanged;
227  globals.ClientDisconnect = ClientDisconnect;
228  globals.ClientBegin = ClientBegin;
229  globals.ClientCommand = ClientCommand;
230 
231  globals.RunFrame = G_RunFrame;
232 
233  globals.ServerCommand = ServerCommand;
234 
235  globals.edict_size = sizeof(edict_t);
236 
237  return &globals;
238 }

◆ InitGame()

void InitGame ( void  )

Definition at line 114 of file g_main.c.

115 {
116  gi.dprintf("==== InitGame ====\n");
117 
118  gun_x = gi.cvar("gun_x", "0", 0);
119  gun_y = gi.cvar("gun_y", "0", 0);
120  gun_z = gi.cvar("gun_z", "0", 0);
121 
122  //FIXME: sv_ prefix is wrong for these
123  sv_rollspeed = gi.cvar("sv_rollspeed", "200", 0);
124  sv_rollangle = gi.cvar("sv_rollangle", "2", 0);
125  sv_maxvelocity = gi.cvar("sv_maxvelocity", "2000", 0);
126  sv_gravity = gi.cvar("sv_gravity", "800", 0);
127 
128  // noset vars
129  dedicated = gi.cvar("dedicated", "0", CVAR_NOSET);
130 
131  nomonsters = gi.cvar("nomonsters", "0", 0);
132 
133  // latched vars
134  sv_cheats = gi.cvar("cheats", "0", CVAR_SERVERINFO | CVAR_LATCH);
135  gi.cvar("gamename", GAMEVERSION , CVAR_SERVERINFO | CVAR_LATCH);
136  gi.cvar("gamedate", __DATE__ , CVAR_SERVERINFO | CVAR_LATCH);
137 
138  maxclients = gi.cvar("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH);
139  maxspectators = gi.cvar("maxspectators", "4", CVAR_SERVERINFO);
140  deathmatch = gi.cvar("deathmatch", "0", CVAR_LATCH);
141  coop = gi.cvar("coop", "0", CVAR_LATCH);
142  skill = gi.cvar("skill", "1", CVAR_LATCH);
143  maxentities = gi.cvar("maxentities", "1024", CVAR_LATCH);
144 
145  // change anytime vars
146  dmflags = gi.cvar("dmflags", "0", CVAR_SERVERINFO);
147  fraglimit = gi.cvar("fraglimit", "0", CVAR_SERVERINFO);
148  timelimit = gi.cvar("timelimit", "0", CVAR_SERVERINFO);
149  password = gi.cvar("password", "", CVAR_USERINFO);
150  spectator_password = gi.cvar("spectator_password", "", CVAR_USERINFO);
151  needpass = gi.cvar("needpass", "0", CVAR_SERVERINFO);
152  filterban = gi.cvar("filterban", "1", 0);
153 
154  g_select_empty = gi.cvar("g_select_empty", "0", CVAR_ARCHIVE);
155 
156  run_pitch = gi.cvar("run_pitch", "0.002", 0);
157  run_roll = gi.cvar("run_roll", "0.005", 0);
158  bob_up = gi.cvar("bob_up", "0.005", 0);
159  bob_pitch = gi.cvar("bob_pitch", "0.002", 0);
160  bob_roll = gi.cvar("bob_roll", "0.002", 0);
161 
162  // flood control
163  flood_msgs = gi.cvar("flood_msgs", "4", 0);
164  flood_persecond = gi.cvar("flood_persecond", "4", 0);
165  flood_waitdelay = gi.cvar("flood_waitdelay", "10", 0);
166 
167  // dm map list
168  sv_maplist = gi.cvar("sv_maplist", "", 0);
169 
170  // obtain server features
171  sv_features = gi.cvar("sv_features", NULL, 0);
172 
173  // flare gun switch:
174  // 0 = no flare gun
175  // 1 = spawn with the flare gun
176  // 2 = spawn with the flare gun and some grenades
177  sv_flaregun = gi.cvar("sv_flaregun", "2", 0);
178 
179  // export our own features
180  gi.cvar_forceset("g_features", va("%d", G_FEATURES));
181 
182  // items
183  InitItems();
184 
185  game.helpmessage1[0] = 0;
186  game.helpmessage2[0] = 0;
187 
188  // initialize all entities for this game
189  game.maxentities = maxentities->value;
190  clamp(game.maxentities, (int)maxclients->value + 1, MAX_EDICTS);
191  g_edicts = gi.TagMalloc(game.maxentities * sizeof(g_edicts[0]), TAG_GAME);
192  globals.edicts = g_edicts;
193  globals.max_edicts = game.maxentities;
194 
195  // initialize all clients for this game
196  game.maxclients = maxclients->value;
197  game.clients = gi.TagMalloc(game.maxclients * sizeof(game.clients[0]), TAG_GAME);
198  globals.num_edicts = game.maxclients + 1;
199 }

Referenced by GetGameAPI().

◆ ReadGame()

void ReadGame ( const char *  filename)

Definition at line 810 of file g_save.c.

811 {
812  FILE *f;
813  int i;
814 
815  gi.FreeTags(TAG_GAME);
816 
817  f = fopen(filename, "rb");
818  if (!f)
819  gi.error("Couldn't open %s", filename);
820 
821  i = read_int(f);
822  if (i != SAVE_MAGIC1) {
823  fclose(f);
824  gi.error("Not a save game");
825  }
826 
827  i = read_int(f);
828  if (i != SAVE_VERSION) {
829  fclose(f);
830  gi.error("Savegame from an older version");
831  }
832 
834 
835  // should agree with server's version
836  if (game.maxclients != (int)maxclients->value) {
837  fclose(f);
838  gi.error("Savegame has bad maxclients");
839  }
840  if (game.maxentities <= game.maxclients || game.maxentities > MAX_EDICTS) {
841  fclose(f);
842  gi.error("Savegame has bad maxentities");
843  }
844 
845  g_edicts = gi.TagMalloc(game.maxentities * sizeof(g_edicts[0]), TAG_GAME);
846  globals.edicts = g_edicts;
847  globals.max_edicts = game.maxentities;
848 
849  game.clients = gi.TagMalloc(game.maxclients * sizeof(game.clients[0]), TAG_GAME);
850  for (i = 0; i < game.maxclients; i++) {
852  }
853 
854  fclose(f);
855 }

Referenced by GetGameAPI().

◆ ReadLevel()

void ReadLevel ( const char *  filename)

Definition at line 912 of file g_save.c.

913 {
914  int entnum;
915  FILE *f;
916  int i;
917  edict_t *ent;
918 
919  // free any dynamic memory allocated by loading the level
920  // base state
921  gi.FreeTags(TAG_LEVEL);
922 
923  f = fopen(filename, "rb");
924  if (!f)
925  gi.error("Couldn't open %s", filename);
926 
927  // wipe all the entities
928  memset(g_edicts, 0, game.maxentities * sizeof(g_edicts[0]));
929  globals.num_edicts = maxclients->value + 1;
930 
931  i = read_int(f);
932  if (i != SAVE_MAGIC2) {
933  fclose(f);
934  gi.error("Not a save game");
935  }
936 
937  i = read_int(f);
938  if (i != SAVE_VERSION) {
939  fclose(f);
940  gi.error("Savegame from an older version");
941  }
942 
943  // load the level locals
945 
946  // load all the entities
947  while (1) {
948  entnum = read_int(f);
949  if (entnum == -1)
950  break;
951  if (entnum < 0 || entnum >= game.maxentities) {
952  gi.error("%s: bad entity number", __func__);
953  }
954  if (entnum >= globals.num_edicts)
955  globals.num_edicts = entnum + 1;
956 
957  ent = &g_edicts[entnum];
958  read_fields(f, entityfields, ent);
959  ent->inuse = qtrue;
960  ent->s.number = entnum;
961 
962  // let the server rebuild world links for this ent
963  memset(&ent->area, 0, sizeof(ent->area));
964  gi.linkentity(ent);
965  }
966 
967  fclose(f);
968 
969  // mark all clients as unconnected
970  for (i = 0 ; i < maxclients->value ; i++) {
971  ent = &g_edicts[i + 1];
972  ent->client = game.clients + i;
973  ent->client->pers.connected = qfalse;
974  }
975 
976  // do any load time things at this point
977  for (i = 0 ; i < globals.num_edicts ; i++) {
978  ent = &g_edicts[i];
979 
980  if (!ent->inuse)
981  continue;
982 
983  // fire any cross-level triggers
984  if (ent->classname)
985  if (strcmp(ent->classname, "target_crosslevel_target") == 0)
986  ent->nextthink = level.time + ent->delay;
987 
988  if (ent->think == func_clock_think || ent->use == func_clock_use) {
989  char *msg = ent->message;
990  ent->message = gi.TagMalloc(CLOCK_MESSAGE_SIZE, TAG_LEVEL);
991  if (msg) {
992  Q_strlcpy(ent->message, msg, CLOCK_MESSAGE_SIZE);
993  gi.TagFree(msg);
994  }
995  }
996  }
997 }

Referenced by GetGameAPI().

◆ RunEntity()

void RunEntity ( edict_t *  ent)

◆ ShutdownGame()

void ShutdownGame ( void  )

Definition at line 97 of file g_main.c.

98 {
99  gi.dprintf("==== ShutdownGame ====\n");
100 
101  gi.FreeTags(TAG_LEVEL);
102  gi.FreeTags(TAG_GAME);
103 }

Referenced by GetGameAPI().

◆ SpawnEntities()

void SpawnEntities ( const char *  mapname,
const char *  entities,
const char *  spawnpoint 
)

Definition at line 568 of file g_spawn.c.

569 {
570  edict_t *ent;
571  int inhibit;
572  char *com_token;
573  int i;
574  float skill_level;
575 
576  skill_level = floor(skill->value);
577  if (skill_level < 0)
578  skill_level = 0;
579  if (skill_level > 3)
580  skill_level = 3;
581  if (skill->value != skill_level)
582  gi.cvar_forceset("skill", va("%f", skill_level));
583 
584  SaveClientData();
585 
586  gi.FreeTags(TAG_LEVEL);
587 
588  memset(&level, 0, sizeof(level));
589  memset(g_edicts, 0, game.maxentities * sizeof(g_edicts[0]));
590 
591  strncpy(level.mapname, mapname, sizeof(level.mapname) - 1);
592  strncpy(game.spawnpoint, spawnpoint, sizeof(game.spawnpoint) - 1);
593 
594  // set client fields on player ents
595  for (i = 0 ; i < game.maxclients ; i++)
596  g_edicts[i + 1].client = game.clients + i;
597 
598  ent = NULL;
599  inhibit = 0;
600 
601 // parse ents
602  while (1) {
603  // parse the opening brace
604  com_token = COM_Parse(&entities);
605  if (!entities)
606  break;
607  if (com_token[0] != '{')
608  gi.error("ED_LoadFromFile: found %s when expecting {", com_token);
609 
610  if (!ent)
611  ent = g_edicts;
612  else
613  ent = G_Spawn();
614  ED_ParseEdict(&entities, ent);
615 
616  // yet another map hack
617  if (!Q_stricmp(level.mapname, "command") && !Q_stricmp(ent->classname, "trigger_once") && !Q_stricmp(ent->model, "*27"))
618  ent->spawnflags &= ~SPAWNFLAG_NOT_HARD;
619 
620  // remove things (except the world) from different skill levels or deathmatch
621  if (ent != g_edicts) {
622  if (nomonsters->value && (strstr(ent->classname, "monster") || strstr(ent->classname, "misc_deadsoldier") || strstr(ent->classname, "misc_insane"))) {
623  G_FreeEdict(ent);
624  inhibit++;
625  continue;
626  }
627  if (deathmatch->value) {
628  if (ent->spawnflags & SPAWNFLAG_NOT_DEATHMATCH) {
629  G_FreeEdict(ent);
630  inhibit++;
631  continue;
632  }
633  } else {
634  if ( /* ((coop->value) && (ent->spawnflags & SPAWNFLAG_NOT_COOP)) || */
635  ((skill->value == 0) && (ent->spawnflags & SPAWNFLAG_NOT_EASY)) ||
636  ((skill->value == 1) && (ent->spawnflags & SPAWNFLAG_NOT_MEDIUM)) ||
637  (((skill->value == 2) || (skill->value == 3)) && (ent->spawnflags & SPAWNFLAG_NOT_HARD))
638  ) {
639  G_FreeEdict(ent);
640  inhibit++;
641  continue;
642  }
643  }
644 
646  }
647 
648  ED_CallSpawn(ent);
649  }
650 
651  gi.dprintf("%i entities inhibited\n", inhibit);
652 
653 #ifdef DEBUG
654  i = 1;
655  ent = EDICT_NUM(i);
656  while (i < globals.num_edicts) {
657  if (ent->inuse != 0 || ent->inuse != 1)
658  Com_DPrintf("Invalid entity %d\n", i);
659  i++, ent++;
660  }
661 #endif
662 
663  G_FindTeams();
664 
666 }

Referenced by GetGameAPI().

◆ WriteGame()

void WriteGame ( const char *  filename,
qboolean  autosave 
)

Definition at line 784 of file g_save.c.

785 {
786  FILE *f;
787  int i;
788 
789  if (!autosave)
790  SaveClientData();
791 
792  f = fopen(filename, "wb");
793  if (!f)
794  gi.error("Couldn't open %s", filename);
795 
798 
799  game.autosaved = autosave;
801  game.autosaved = qfalse;
802 
803  for (i = 0; i < game.maxclients; i++) {
805  }
806 
807  fclose(f);
808 }

Referenced by GetGameAPI().

◆ WriteLevel()

void WriteLevel ( const char *  filename)

Definition at line 866 of file g_save.c.

867 {
868  int i;
869  edict_t *ent;
870  FILE *f;
871 
872  f = fopen(filename, "wb");
873  if (!f)
874  gi.error("Couldn't open %s", filename);
875 
878 
879  // write out level_locals_t
881 
882  // write out all the entities
883  for (i = 0; i < globals.num_edicts; i++) {
884  ent = &g_edicts[i];
885  if (!ent->inuse)
886  continue;
887  write_int(f, i);
888  write_fields(f, entityfields, ent);
889  }
890  write_int(f, -1);
891 
892  fclose(f);
893 }

Referenced by GetGameAPI().

Variable Documentation

◆ bob_pitch

cvar_t* bob_pitch

Definition at line 63 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ bob_roll

cvar_t* bob_roll

Definition at line 64 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ bob_up

cvar_t* bob_up

Definition at line 62 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ coop

◆ deathmatch

cvar_t* deathmatch

Definition at line 33 of file g_main.c.

Referenced by BeginIntermission(), bfg_think(), Chaingun_Fire(), CheckDMRules(), ClientBegin(), ClientBeginServerFrame(), ClientConnect(), ClientObituary(), ClientUserinfoChanged(), Cmd_Give_f(), Cmd_God_f(), Cmd_Help_f(), Cmd_Noclip_f(), Cmd_Notarget_f(), Cmd_Score_f(), drop_make_touchable(), G_SetStats(), InitGame(), Machinegun_Fire(), MegaHealth_think(), monster_start(), MoveClientToIntermission(), P_FallingDamage(), Pickup_Adrenaline(), Pickup_Ammo(), Pickup_AncientHead(), Pickup_Armor(), Pickup_Bandolier(), Pickup_Health(), Pickup_Pack(), Pickup_PowerArmor(), Pickup_Powerup(), Pickup_Weapon(), player_die(), PlayerNoise(), PlayerTrail_Init(), PutClientInServer(), respawn(), rocket_touch(), SelectSpawnPoint(), SP_func_door(), SP_func_explosive(), SP_info_player_deathmatch(), SP_item_health(), SP_item_health_large(), SP_item_health_mega(), SP_item_health_small(), SP_light(), SP_misc_actor(), SP_misc_deadsoldier(), SP_misc_explobox(), SP_misc_insane(), SP_monster_berserk(), SP_monster_boss2(), SP_monster_boss3_stand(), SP_monster_brain(), SP_monster_chick(), SP_monster_flipper(), SP_monster_floater(), SP_monster_flyer(), SP_monster_gladiator(), SP_monster_gunner(), SP_monster_hover(), SP_monster_infantry(), SP_monster_jorg(), SP_monster_makron(), SP_monster_medic(), SP_monster_mutant(), SP_monster_parasite(), SP_monster_soldier(), SP_monster_soldier_light(), SP_monster_soldier_ss(), SP_monster_supertank(), SP_monster_tank(), SP_point_combat(), SP_target_goal(), SP_target_help(), SP_target_lightramp(), SP_target_secret(), SP_turret_driver(), SP_worldspawn(), SpawnEntities(), SpawnItem(), T_Damage(), TossClientWeapon(), use_target_changelevel(), weapon_bfg_fire(), Weapon_Blaster_Fire(), Weapon_HyperBlaster_Fire(), weapon_railgun_fire(), and weapon_shotgun_fire().

◆ dedicated

cvar_t* dedicated

Definition at line 46 of file g_main.c.

Referenced by InitGame().

◆ dmflags

◆ filterban

cvar_t* filterban

Definition at line 49 of file g_main.c.

Referenced by InitGame(), SV_FilterPacket(), and SVCmd_WriteIP_f().

◆ flood_msgs

cvar_t* flood_msgs

Definition at line 68 of file g_main.c.

Referenced by Cmd_Say_f(), and InitGame().

◆ flood_persecond

cvar_t* flood_persecond

Definition at line 69 of file g_main.c.

Referenced by Cmd_Say_f(), and InitGame().

◆ flood_waitdelay

cvar_t* flood_waitdelay

Definition at line 70 of file g_main.c.

Referenced by Cmd_Say_f(), and InitGame().

◆ fraglimit

cvar_t* fraglimit

Definition at line 37 of file g_main.c.

Referenced by CheckDMRules(), and InitGame().

◆ g_edicts

◆ g_select_empty

cvar_t* g_select_empty

Definition at line 45 of file g_main.c.

Referenced by InitGame(), and Use_Weapon().

◆ game

◆ gi

game_import_t gi

Definition at line 23 of file g_main.c.

Referenced by actor_dead(), actor_pain(), actor_use(), ai_run(), BecomeExplosion1(), BecomeExplosion2(), berserk_dead(), berserk_die(), berserk_fidget(), berserk_pain(), berserk_search(), berserk_sight(), berserk_swing(), bfg_explode(), bfg_think(), bfg_touch(), Blaster_Fire(), blaster_touch(), body_die(), Boss2_CheckAttack(), boss2_dead(), boss2_die(), boss2_pain(), boss2_search(), BossExplode(), brain_chest_open(), brain_dead(), brain_die(), brain_duck_down(), brain_duck_up(), brain_hit_left(), brain_hit_right(), brain_idle(), brain_pain(), brain_search(), brain_sight(), brain_swing_left(), brain_swing_right(), brain_tentacle_attack(), button_fire(), CanDamage(), Chaingun_Fire(), ChangeWeapon(), check_dodge(), CheckDMRules(), CheckNeedPass(), chick_dead(), chick_die(), chick_duck_down(), chick_duck_up(), chick_pain(), Chick_PreAttack1(), chick_sight(), ChickMoan(), ChickReload(), ChickSlash(), ClientBegin(), ClientBeginDeathmatch(), ClientCommand(), ClientConnect(), ClientDisconnect(), ClientEndServerFrame(), ClientObituary(), ClientThink(), ClientUserinfoChanged(), Cmd_Drop_f(), Cmd_Give_f(), Cmd_God_f(), Cmd_InvDrop_f(), Cmd_Inven_f(), Cmd_InvUse_f(), Cmd_Noclip_f(), Cmd_Notarget_f(), Cmd_PlayerList_f(), Cmd_Players_f(), Cmd_Say_f(), Cmd_Use_f(), Cmd_Wave_f(), Com_Error(), Com_LPrintf(), commander_body_think(), commander_body_use(), CopyToBodyQue(), DeathmatchScoreboard(), DeathmatchScoreboardMessage(), door_go_down(), door_go_up(), door_hit_bottom(), door_hit_top(), door_touch(), door_use_areaportals(), DoRespawn(), Drop_Ammo(), Drop_Item(), Drop_Weapon(), droptofloor(), ED_CallSpawn(), ED_NewString(), ED_ParseEdict(), ED_ParseField(), ExitLevel(), FindTarget(), fire_bfg(), fire_blaster(), fire_flaregun(), fire_grenade(), fire_grenade2(), fire_hit(), fire_lead(), fire_rail(), fire_rocket(), flare_sparks(), flipper_dead(), flipper_die(), flipper_pain(), flipper_preattack(), flipper_sight(), floater_dead(), floater_die(), floater_idle(), floater_pain(), floater_sight(), floater_wham(), floater_zap(), flyer_die(), flyer_idle(), flyer_pain(), flyer_pop_blades(), flyer_sight(), flyer_slash_left(), flyer_slash_right(), flymonster_start_go(), FoundTarget(), func_explosive_spawn(), func_train_find(), func_wall_use(), G_CopyString(), G_FindTeams(), G_FreeEdict(), G_PickTarget(), G_RunEntity(), G_SetClientSound(), G_SetStats(), G_Spawn(), G_TouchSolids(), G_TouchTriggers(), G_UseTargets(), GaldiatorMelee(), GetChaseTarget(), GetGameAPI(), gib_touch(), gladiator_attack(), gladiator_cleaver_swing(), gladiator_dead(), gladiator_die(), gladiator_idle(), gladiator_pain(), gladiator_search(), gladiator_sight(), Grenade_Explode(), Grenade_Touch(), gunner_dead(), gunner_die(), gunner_duck_down(), gunner_duck_up(), gunner_idlesound(), gunner_opengun(), gunner_pain(), gunner_search(), gunner_sight(), HelpComputer(), hover_dead(), hover_die(), hover_pain(), hover_search(), hover_sight(), hurt_touch(), hurt_use(), infantry_cock_gun(), infantry_dead(), infantry_die(), infantry_duck_down(), infantry_duck_up(), infantry_fidget(), infantry_pain(), infantry_sight(), infantry_smack(), infantry_swing(), InitGame(), InitTrigger(), insane_dead(), insane_die(), insane_fist(), insane_moan(), insane_pain(), insane_scream(), insane_shake(), jorg_attack(), Jorg_CheckAttack(), jorg_dead(), jorg_death_hit(), jorg_die(), jorg_idle(), jorg_pain(), jorg_search(), jorg_step_left(), jorg_step_right(), jorgBFG(), KillBox(), light_use(), M_CatagorizePosition(), M_CheckAttack(), M_CheckBottom(), M_CheckGround(), M_droptofloor(), M_FliesOn(), M_WorldEffects(), Machinegun_Fire(), makron_brainsplorch(), Makron_CheckAttack(), makron_dead(), makron_die(), makron_hit(), makron_pain(), makron_popup(), makron_prerailgun(), makron_step_left(), makron_step_right(), makron_taunt(), makron_torso(), makronBFG(), MakronPrecache(), medic_cable_attack(), medic_dead(), medic_die(), medic_duck_down(), medic_duck_up(), medic_hook_launch(), medic_hook_retract(), medic_idle(), medic_pain(), medic_search(), medic_sight(), misc_deadsoldier_die(), monster_fire_bfg(), monster_fire_blaster(), monster_fire_bullet(), monster_fire_grenade(), monster_fire_railgun(), monster_fire_rocket(), monster_fire_shotgun(), monster_start(), monster_start_go(), monster_triggered_spawn(), MoveClientToIntermission(), mutant_check_landing(), mutant_dead(), mutant_die(), mutant_hit_left(), mutant_hit_right(), mutant_idle(), mutant_jump_takeoff(), mutant_pain(), mutant_search(), mutant_sight(), mutant_step(), mutant_swing(), P_DamageFeedback(), P_WorldEffects(), parasite_dead(), parasite_die(), parasite_drain_attack(), parasite_launch(), parasite_pain(), parasite_reel_in(), parasite_scratch(), parasite_search(), parasite_sight(), parasite_tap(), plat_go_down(), plat_go_up(), plat_hit_bottom(), plat_hit_top(), plat_spawn_inside_trigger(), player_die(), PlayerNoise(), PM_trace(), point_combat_touch(), PrecacheItem(), PutClientInServer(), read_data(), read_field(), read_index(), read_pointer(), read_string(), read_zstring(), ReadGame(), ReadLevel(), respawn(), rocket_touch(), SelectSpawnPoint(), ServerCommand(), SetItemNames(), SetRespawn(), ShutdownGame(), soldier_cock(), soldier_dead(), soldier_die(), soldier_duck_down(), soldier_duck_up(), soldier_idle(), soldier_pain(), soldier_sight(), SP_func_button(), SP_func_clock(), SP_func_conveyor(), SP_func_door(), SP_func_door_rotating(), SP_func_door_secret(), SP_func_explosive(), SP_func_killbox(), SP_func_object(), SP_func_plat(), SP_func_rotating(), SP_func_timer(), SP_func_train(), SP_func_wall(), SP_func_water(), SP_item_health(), SP_item_health_large(), SP_item_health_mega(), SP_item_health_small(), SP_light(), SP_light_mine1(), SP_light_mine2(), SP_misc_actor(), SP_misc_banner(), SP_misc_bigviper(), SP_misc_blackhole(), SP_misc_deadsoldier(), SP_misc_easterchick(), SP_misc_easterchick2(), SP_misc_eastertank(), SP_misc_explobox(), SP_misc_gib_arm(), SP_misc_gib_head(), SP_misc_gib_leg(), SP_misc_insane(), SP_misc_satellite_dish(), SP_misc_strogg_ship(), SP_misc_teleporter(), SP_misc_teleporter_dest(), SP_misc_viper(), SP_misc_viper_bomb(), SP_monster_berserk(), SP_monster_boss2(), SP_monster_boss3_stand(), SP_monster_brain(), SP_monster_chick(), SP_monster_commander_body(), SP_monster_flipper(), SP_monster_floater(), SP_monster_flyer(), SP_monster_gladiator(), SP_monster_gunner(), SP_monster_hover(), SP_monster_infantry(), SP_monster_jorg(), SP_monster_makron(), SP_monster_medic(), SP_monster_mutant(), SP_monster_parasite(), SP_monster_soldier(), SP_monster_soldier_light(), SP_monster_soldier_ss(), SP_monster_soldier_x(), SP_monster_supertank(), SP_monster_tank(), SP_path_corner(), SP_point_combat(), SP_target_actor(), SP_target_blaster(), SP_target_changelevel(), SP_target_character(), SP_target_earthquake(), SP_target_goal(), SP_target_help(), SP_target_lightramp(), SP_target_secret(), SP_target_speaker(), SP_trigger_gravity(), SP_trigger_hurt(), SP_trigger_key(), SP_trigger_multiple(), SP_trigger_once(), SP_trigger_push(), SP_turret_base(), SP_turret_breach(), SP_turret_driver(), SP_viewthing(), SP_worldspawn(), SpawnDamage(), SpawnEntities(), SpawnItem(), spectator_respawn(), StringToFilter(), supertank_dead(), supertank_die(), supertank_pain(), supertank_search(), SV_CalcBlend(), SV_FlyMove(), SV_movestep(), SV_Physics_Noclip(), SV_Physics_Pusher(), SV_Physics_Step(), SV_Physics_Toss(), SV_Push(), SV_PushEntity(), SV_RunThink(), SV_StepDirection(), SV_TestEntityPosition(), SVCmd_AddIP_f(), SVCmd_ListIP_f(), SVCmd_RemoveIP_f(), Svcmd_Test_f(), SVCmd_WriteIP_f(), T_Damage(), tank_dead(), tank_die(), tank_footstep(), tank_idle(), tank_pain(), tank_sight(), tank_thud(), tank_windup(), TankStrike(), target_actor_touch(), target_earthquake_think(), target_explosion_explode(), target_laser_start(), target_laser_think(), target_lightramp_think(), target_lightramp_use(), teleporter_touch(), Think_SpawnDoorTrigger(), ThrowClientHead(), ThrowDebris(), ThrowGib(), ThrowHead(), Touch_Item(), train_next(), train_wait(), TreadSound(), trigger_counter_use(), trigger_elevator_init(), trigger_elevator_use(), trigger_enable(), trigger_key_use(), trigger_push_touch(), turret_breach_finish_init(), turret_breach_fire(), UpdateChaseCam(), Use_Areaportal(), Use_Boss3(), Use_Invulnerability(), Use_Item(), Use_PowerArmor(), Use_Quad(), use_target_blaster(), use_target_changelevel(), use_target_goal(), use_target_secret(), use_target_spawner(), Use_Target_Speaker(), use_target_splash(), Use_Target_Tent(), Use_Weapon(), visible(), walkmonster_start_go(), weapon_bfg_fire(), weapon_flaregun_fire(), Weapon_Generic(), Weapon_Grenade(), weapon_grenadelauncher_fire(), Weapon_HyperBlaster_Fire(), weapon_railgun_fire(), Weapon_RocketLauncher_Fire(), weapon_shotgun_fire(), weapon_supershotgun_fire(), write_data(), write_field(), write_index(), write_pointer(), WriteGame(), and WriteLevel().

◆ globals

◆ gun_x

cvar_t* gun_x

Definition at line 56 of file g_main.c.

Referenced by InitGame(), and SV_CalcGunOffset().

◆ gun_y

cvar_t* gun_y

Definition at line 57 of file g_main.c.

Referenced by InitGame().

◆ gun_z

cvar_t* gun_z

Definition at line 58 of file g_main.c.

Referenced by InitGame().

◆ level

Definition at line 22 of file g_main.c.

Referenced by actor_attack(), actor_fire(), actor_pain(), actor_run(), actor_stand(), ai_checkattack(), ai_run(), AI_SetSightClient(), ai_stand(), ai_walk(), AngleMove_Begin(), AngleMove_Calc(), AngleMove_Final(), AttackFinished(), barrel_delay(), BeginIntermission(), berserk_pain(), bfg_explode(), bfg_think(), bfg_touch(), Boss2_CheckAttack(), boss2_pain(), BossExplode(), brain_dodge(), brain_duck_hold(), brain_pain(), buddy_allocator_allocate(), buddy_allocator_free(), button_wait(), Chaingun_Fire(), ChangeWeapon(), CheckDMRules(), CheckPowerArmor(), chick_duck_down(), chick_duck_hold(), chick_pain(), CL_ParsePrint(), ClientBegin(), ClientBeginDeathmatch(), ClientBeginServerFrame(), ClientCommand(), ClientEndServerFrame(), ClientThink(), Cmd_Kill_f(), Cmd_PlayerList_f(), Cmd_Say_f(), commander_body_think(), commander_body_use(), CopyToBodyQue(), CreateTargetChangeLevel(), DeathmatchScoreboardMessage(), door_go_up(), door_hit_top(), door_secret_blocked(), door_secret_move1(), door_secret_move3(), door_secret_move5(), door_touch(), Drop_Item(), drop_make_touchable(), droptofloor(), EndDMLevel(), ExitLevel(), FindTarget(), finish_download(), fire_bfg(), fire_blaster(), fire_flaregun(), fire_grenade(), fire_grenade2(), fire_rocket(), flare_sparks(), flare_think(), flipper_pain(), floater_pain(), flyer_pain(), FoundTarget(), func_clock_think(), func_timer_think(), func_timer_use(), func_train_find(), G_FreeEdict(), G_RunFrame(), G_SetClientEffects(), G_SetClientSound(), G_SetSpectatorStats(), G_SetStats(), G_Spawn(), G_UseTargets(), get_level_offset(), gib_think(), gib_touch(), gladiator_pain(), gunner_duck_down(), gunner_duck_hold(), gunner_pain(), HelpComputer(), hover_dead(), hover_deadthink(), hover_pain(), hurt_touch(), infantry_cock_gun(), infantry_duck_down(), infantry_duck_hold(), infantry_fire(), infantry_pain(), InitBodyQue(), InitClientResp(), insane_pain(), Jorg_CheckAttack(), jorg_pain(), Killed(), M_CheckAttack(), M_FliesOn(), M_FlyCheck(), M_MoveFrame(), M_SetEffects(), M_WorldEffects(), Machinegun_Fire(), Makron_CheckAttack(), makron_pain(), makron_torso(), makron_torso_think(), MakronSpawn(), MakronToss(), medic_cable_attack(), medic_duck_down(), medic_duck_hold(), medic_pain(), MegaHealth_think(), merge_blocks(), misc_banner_think(), misc_blackhole_think(), misc_easterchick2_think(), misc_easterchick_think(), misc_eastertank_think(), misc_satellite_dish_think(), misc_satellite_dish_use(), misc_viper_bomb_prethink(), misc_viper_bomb_use(), monster_start(), monster_start_go(), monster_triggered_spawn(), monster_triggered_spawn_use(), Move_Begin(), Move_Calc(), Move_Final(), MoveClientToIntermission(), multi_trigger(), mutant_check_landing(), mutant_jump_takeoff(), mutant_pain(), MVD_BroadcastPrintf(), MVD_ParsePrint(), MVD_UnicastPrint(), os_getsockopt(), os_setsockopt(), P_DamageFeedback(), P_FallingDamage(), P_WorldEffects(), parasite_pain(), path_corner_touch(), PF_bprintf(), PF_cprintf(), Pickup_Health(), Pickup_Powerup(), plat_hit_top(), player_die(), PlayerNoise(), PlayerTrail_Add(), point_combat_touch(), PutClientInServer(), ReadLevel(), remove_block_from_free_list(), respawn(), S_Activate(), SetRespawn(), soldier_attack3_refire(), soldier_dodge(), soldier_duck_down(), soldier_duck_hold(), soldier_fire(), soldier_pain(), SP_CreateCoopSpots(), SP_func_clock(), SP_func_door(), SP_func_door_rotating(), SP_func_object(), SP_func_timer(), SP_func_train(), SP_info_player_coop(), SP_info_player_start(), SP_misc_banner(), SP_misc_blackhole(), SP_misc_easterchick(), SP_misc_easterchick2(), SP_misc_eastertank(), SP_misc_explobox(), SP_misc_gib_arm(), SP_misc_gib_head(), SP_misc_gib_leg(), SP_misc_strogg_ship(), SP_misc_viper(), SP_monster_boss3_stand(), SP_monster_commander_body(), SP_monster_flyer(), SP_target_changelevel(), SP_target_crosslevel_target(), SP_target_goal(), SP_target_laser(), SP_target_secret(), SP_trigger_elevator(), SP_turret_breach(), SP_turret_driver(), SP_viewthing(), SP_worldspawn(), SpawnEntities(), SpawnItem(), spectator_respawn(), supertank_pain(), SV_BroadcastPrintf(), SV_CalcBlend(), SV_CalcViewOffset(), SV_ClientPrintf(), SV_MvdBroadcastPrint(), SV_RunThink(), T_Damage(), tank_attack(), tank_pain(), target_actor_touch(), target_earthquake_think(), target_earthquake_use(), target_laser_think(), target_lightramp_think(), target_lightramp_use(), TH_viewthing(), Think_AccelMove(), Think_Boss3Stand(), Think_Weapon(), ThrowDebris(), ThrowGib(), ThrowHead(), TossClientWeapon(), Touch_DoorTrigger(), Touch_Item(), Touch_Plat_Center(), train_blocked(), train_wait(), trigger_key_use(), trigger_push_touch(), turret_breach_think(), turret_driver_link(), turret_driver_think(), Use_Breather(), Use_Envirosuit(), Use_Invulnerability(), Use_Quad(), use_target_changelevel(), use_target_explosion(), use_target_goal(), use_target_secret(), walkmonster_start_go(), weapon_bfg_fire(), Weapon_Generic(), Weapon_Grenade(), weapon_grenade_fire(), Weapon_HyperBlaster_Fire(), write_free_block_to_list(), and WriteLevel().

◆ maxclients

◆ maxentities

cvar_t* maxentities

Definition at line 44 of file g_main.c.

Referenced by InitGame().

◆ maxspectators

cvar_t* maxspectators

Definition at line 43 of file g_main.c.

Referenced by ClientConnect(), InitGame(), and spectator_respawn().

◆ meansOfDeath

int meansOfDeath

Definition at line 29 of file g_main.c.

Referenced by ClientObituary(), Cmd_Kill_f(), and T_Damage().

◆ needpass

cvar_t* needpass

Definition at line 41 of file g_main.c.

Referenced by InitGame().

◆ nomonsters

cvar_t* nomonsters

Definition at line 47 of file g_main.c.

Referenced by InitGame(), and SpawnEntities().

◆ password

cvar_t* password

◆ run_pitch

cvar_t* run_pitch

Definition at line 60 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ run_roll

cvar_t* run_roll

Definition at line 61 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ skill

◆ sm_meat_index

int sm_meat_index

Definition at line 27 of file g_main.c.

Referenced by gib_touch(), and SP_worldspawn().

◆ snd_fry

int snd_fry

Definition at line 28 of file g_main.c.

Referenced by G_SetClientSound(), and SP_worldspawn().

◆ spectator_password

cvar_t* spectator_password

Definition at line 40 of file g_main.c.

Referenced by CheckNeedPass(), ClientConnect(), InitGame(), and spectator_respawn().

◆ st

◆ sv_cheats

cvar_t* sv_cheats

Definition at line 66 of file g_main.c.

Referenced by Cmd_Give_f(), Cmd_God_f(), Cmd_Noclip_f(), Cmd_Notarget_f(), and InitGame().

◆ sv_features

cvar_t* sv_features

Definition at line 74 of file g_main.c.

Referenced by InitGame().

◆ sv_flaregun

cvar_t* sv_flaregun

Definition at line 76 of file g_main.c.

Referenced by InitClientPersistant(), and InitGame().

◆ sv_gravity

cvar_t* sv_gravity

Definition at line 52 of file g_main.c.

Referenced by ClientThink(), InitGame(), SV_AddGravity(), and SV_Physics_Step().

◆ sv_maplist

cvar_t* sv_maplist

Definition at line 72 of file g_main.c.

Referenced by EndDMLevel(), and InitGame().

◆ sv_maxvelocity

cvar_t* sv_maxvelocity

Definition at line 51 of file g_main.c.

Referenced by InitGame(), and SV_CheckVelocity().

◆ sv_rollangle

cvar_t* sv_rollangle

Definition at line 55 of file g_main.c.

Referenced by InitGame(), and SV_CalcRoll().

◆ sv_rollspeed

cvar_t* sv_rollspeed

Definition at line 54 of file g_main.c.

Referenced by InitGame(), and SV_CalcRoll().

◆ timelimit

cvar_t* timelimit

Definition at line 38 of file g_main.c.

Referenced by CheckDMRules(), and InitGame().

gi
game_import_t gi
Definition: g_main.c:23
deathmatch
cvar_t * deathmatch
Definition: g_main.c:33
UpdateChaseCam
void UpdateChaseCam(edict_t *ent)
Definition: g_chase.c:20
Cmd_Inven_f
void Cmd_Inven_f(edict_t *ent)
Definition: g_cmds.c:421
game
game_locals_t game
Definition: g_main.c:21
deathmatch
cvar_t * deathmatch
Definition: g_main.c:33
PlayerTrail_Init
void PlayerTrail_Init(void)
Definition: p_trail.c:47
MoveClientToIntermission
void MoveClientToIntermission(edict_t *client)
Definition: p_hud.c:30
globals
game_export_t globals
Definition: g_main.c:24
write_int
static void write_int(FILE *f, int v)
Definition: g_save.c:446
ClientBeginServerFrame
void ClientBeginServerFrame(edict_t *ent)
Definition: p_client.c:1709
ReadLevel
void ReadLevel(const char *filename)
Definition: g_save.c:912
game_locals_t::helpmessage1
char helpmessage1[512]
Definition: g_local.h:268
G_Spawn
edict_t * G_Spawn(void)
Definition: g_utils.c:391
pm
static pmove_t * pm
Definition: pmove.c:44
Cmd_Give_f
void Cmd_Give_f(edict_t *ent)
Definition: g_cmds.c:147
sv_maxvelocity
cvar_t * sv_maxvelocity
Definition: g_main.c:51
sv_rollangle
cvar_t * sv_rollangle
Definition: g_main.c:55
G_RunEntity
void G_RunEntity(edict_t *ent)
Definition: g_phys.c:905
Info_Validate
qboolean Info_Validate(const char *s)
Definition: shared.c:1040
filterban
cvar_t * filterban
Definition: g_main.c:49
bob_roll
cvar_t * bob_roll
Definition: g_main.c:64
maxclients
cvar_t * maxclients
Definition: g_main.c:42
Q_snprintf
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
Definition: shared.c:846
CheckNeedPass
void CheckNeedPass(void)
Definition: g_main.c:378
ClientThink
void ClientThink(edict_t *ent, usercmd_t *cmd)
Definition: p_client.c:1534
ClientUserinfoChanged
void ClientUserinfoChanged(edict_t *ent, char *userinfo)
Definition: p_client.c:1325
com_token
static char com_token[4][MAX_TOKEN_CHARS]
Definition: shared.c:444
FRAMETIME
#define FRAMETIME
Definition: g_local.h:75
Cmd_Use_f
void Cmd_Use_f(edict_t *ent)
Definition: g_cmds.c:357
ClientConnect
qboolean ClientConnect(edict_t *ent, char *userinfo)
Definition: p_client.c:1389
write_fields
static void write_fields(FILE *f, const save_field_t *fields, void *base)
Definition: g_save.c:573
password
cvar_t * password
Definition: g_main.c:39
MOVETYPE_NOCLIP
@ MOVETYPE_NOCLIP
Definition: g_local.h:187
SPAWNFLAG_NOT_EASY
#define SPAWNFLAG_NOT_EASY
Definition: g_local.h:52
sv_gravity
cvar_t * sv_gravity
Definition: g_main.c:52
ClientBegin
void ClientBegin(edict_t *ent)
Definition: p_client.c:1267
PM_trace
trace_t q_gameabi PM_trace(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end)
Definition: p_client.c:1501
read_int
static int read_int(FILE *f)
Definition: g_save.c:599
ExitLevel
void ExitLevel(void)
Definition: g_main.c:443
G_TouchTriggers
void G_TouchTriggers(edict_t *ent)
Definition: g_utils.c:443
dedicated
cvar_t * dedicated
Definition: g_main.c:46
Cmd_WeapLast_f
void Cmd_WeapLast_f(edict_t *ent)
Definition: g_cmds.c:544
ClientEndServerFrames
void ClientEndServerFrames(void)
Definition: g_main.c:279
G_Find
edict_t * G_Find(edict_t *from, int fieldofs, char *match)
Definition: g_utils.c:43
G_FEATURES
#define G_FEATURES
Definition: g_local.h:30
SV_FilterPacket
qboolean SV_FilterPacket(char *from)
Definition: g_svcmds.c:116
maxspectators
cvar_t * maxspectators
Definition: g_main.c:43
Think_Weapon
void Think_Weapon(edict_t *ent)
Definition: p_weapon.c:260
FOFS
#define FOFS(x)
Definition: g_local.h:498
ClientUserinfoChanged
void ClientUserinfoChanged(edict_t *ent, char *userinfo)
Definition: p_client.c:1325
skill
cvar_t * skill
Definition: g_main.c:36
ShutdownGame
void ShutdownGame(void)
Definition: g_main.c:97
TAG_LEVEL
#define TAG_LEVEL
Definition: g_local.h:79
g_select_empty
cvar_t * g_select_empty
Definition: g_main.c:45
SPAWNFLAG_NOT_MEDIUM
#define SPAWNFLAG_NOT_MEDIUM
Definition: g_local.h:53
game_locals_t::spawnpoint
char spawnpoint[512]
Definition: g_local.h:277
g_edicts
edict_t * g_edicts
Definition: g_main.c:31
Q_vsnprintf
size_t Q_vsnprintf(char *dest, size_t size, const char *fmt, va_list argptr)
Definition: shared.c:791
ReadGame
void ReadGame(const char *filename)
Definition: g_save.c:810
other
@ other
Definition: ogg.c:63
password
cvar_t * password
Definition: g_main.c:39
IT_WEAPON
#define IT_WEAPON
Definition: g_local.h:211
clientfields
static const save_field_t clientfields[]
Definition: g_save.c:292
BeginIntermission
void BeginIntermission(edict_t *targ)
Definition: p_hud.c:70
FL_SWIM
#define FL_SWIM
Definition: g_local.h:60
SelectPrevItem
void SelectPrevItem(edict_t *ent, int itflags)
Definition: g_cmds.c:94
svc_muzzleflash
#define svc_muzzleflash
Definition: g_local.h:36
G_InitEdict
void G_InitEdict(edict_t *e)
Definition: g_utils.c:372
ClientDisconnect
void ClientDisconnect(edict_t *ent)
Definition: p_client.c:1462
level_locals_t::current_entity
edict_t * current_entity
Definition: g_local.h:332
game_locals_t::helpmessage2
char helpmessage2[512]
Definition: g_local.h:269
run_roll
cvar_t * run_roll
Definition: g_main.c:61
Cmd_Noclip_f
void Cmd_Noclip_f(edict_t *ent)
Definition: g_cmds.c:333
Cmd_God_f
void Cmd_God_f(edict_t *ent)
Definition: g_cmds.c:287
gi
game_import_t gi
Definition: g_main.c:23
ED_CallSpawn
void ED_CallSpawn(edict_t *ent)
Definition: g_spawn.c:340
Cmd_Players_f
void Cmd_Players_f(edict_t *ent)
Definition: g_cmds.c:640
sv_features
cvar_t * sv_features
Definition: g_main.c:74
G_FreeEdict
void G_FreeEdict(edict_t *e)
Definition: g_utils.c:421
Cmd_PutAway_f
void Cmd_PutAway_f(edict_t *ent)
Definition: g_cmds.c:610
CLOCK_MESSAGE_SIZE
#define CLOCK_MESSAGE_SIZE
Definition: g_local.h:692
SAVE_VERSION
#define SAVE_VERSION
Definition: g_save.c:768
sv_flaregun
cvar_t * sv_flaregun
Definition: g_main.c:76
ServerCommand
void ServerCommand(void)
Definition: g_svcmds.c:275
maxclients
cvar_t * maxclients
Definition: g_main.c:42
Cmd_Wave_f
void Cmd_Wave_f(edict_t *ent)
Definition: g_cmds.c:681
GetChaseTarget
void GetChaseTarget(edict_t *ent)
Definition: g_chase.c:155
Info_ValueForKey
char * Info_ValueForKey(const char *s, const char *key)
Definition: shared.c:945
va
char * va(const char *format,...)
Definition: shared.c:429
sv_maplist
cvar_t * sv_maplist
Definition: g_main.c:72
nomonsters
cvar_t * nomonsters
Definition: g_main.c:47
spectator_password
cvar_t * spectator_password
Definition: g_main.c:40
game_locals_t::clients
gclient_t * clients
Definition: g_local.h:273
WriteGame
void WriteGame(const char *filename, qboolean autosave)
Definition: g_save.c:784
bob_pitch
cvar_t * bob_pitch
Definition: g_main.c:63
game
game_locals_t game
Definition: g_main.c:21
flood_msgs
cvar_t * flood_msgs
Definition: g_main.c:68
Cmd_WeapPrev_f
void Cmd_WeapPrev_f(edict_t *ent)
Definition: g_cmds.c:474
pm_passent
edict_t * pm_passent
Definition: p_client.c:1498
level_locals_t::nextmap
char nextmap[MAX_QPATH]
Definition: g_local.h:303
Cmd_InvDrop_f
void Cmd_InvDrop_f(edict_t *ent)
Definition: g_cmds.c:571
globals
game_export_t globals
Definition: g_main.c:24
level
level_locals_t level
Definition: g_main.c:22
Cmd_Score_f
void Cmd_Score_f(edict_t *ent)
Definition: p_hud.c:255
Q_strlcpy
size_t Q_strlcpy(char *dst, const char *src, size_t size)
Definition: shared.c:715
g_edicts
edict_t * g_edicts
Definition: g_main.c:31
gamefields
static const save_field_t gamefields[]
Definition: g_save.c:413
Cmd_PlayerList_f
void Cmd_PlayerList_f(edict_t *ent)
Definition: g_cmds.c:810
GAMEVERSION
#define GAMEVERSION
Definition: g_local.h:33
entityfields
static const save_field_t entityfields[]
Definition: g_save.c:53
gun_y
cvar_t * gun_y
Definition: g_main.c:57
EndDMLevel
void EndDMLevel(void)
Definition: g_main.c:320
skill
cvar_t * skill
Definition: g_main.c:36
level_locals_t::framenum
int framenum
Definition: g_local.h:298
Cmd_InvUse_f
void Cmd_InvUse_f(edict_t *ent)
Definition: g_cmds.c:450
gun_x
cvar_t * gun_x
Definition: g_main.c:56
M_CheckGround
void M_CheckGround(edict_t *ent)
Definition: g_monster.c:139
game_locals_t::autosaved
qboolean autosaved
Definition: g_local.h:289
level_locals_t::exitintermission
int exitintermission
Definition: g_local.h:308
level_locals_t::time
float time
Definition: g_local.h:299
cl
client_state_t cl
Definition: main.c:99
Cmd_Kill_f
void Cmd_Kill_f(edict_t *ent)
Definition: g_cmds.c:595
dmflags
cvar_t * dmflags
Definition: g_main.c:35
Cmd_Help_f
void Cmd_Help_f(edict_t *ent)
Definition: p_hud.c:324
CheckDMRules
void CheckDMRules(void)
Definition: g_main.c:403
bob_up
cvar_t * bob_up
Definition: g_main.c:62
G_RunFrame
void G_RunFrame(void)
Definition: g_main.c:474
level_locals_t::intermissiontime
float intermissiontime
Definition: g_local.h:306
timelimit
cvar_t * timelimit
Definition: g_main.c:38
sv_rollspeed
cvar_t * sv_rollspeed
Definition: g_main.c:54
SPAWNFLAG_NOT_DEATHMATCH
#define SPAWNFLAG_NOT_DEATHMATCH
Definition: g_local.h:55
SPAWNFLAG_NOT_HARD
#define SPAWNFLAG_NOT_HARD
Definition: g_local.h:54
CreateTargetChangeLevel
edict_t * CreateTargetChangeLevel(char *map)
Definition: g_main.c:302
level_locals_t::changemap
char * changemap
Definition: g_local.h:307
InitGame
void InitGame(void)
Definition: g_main.c:114
TAG_GAME
#define TAG_GAME
Definition: g_local.h:78
PNOISE_SELF
#define PNOISE_SELF
Definition: g_local.h:179
ClientEndServerFrame
void ClientEndServerFrame(edict_t *ent)
Definition: p_view.c:889
ClientCommand
void ClientCommand(edict_t *ent)
Definition: g_cmds.c:846
maxentities
cvar_t * maxentities
Definition: g_main.c:44
needpass
cvar_t * needpass
Definition: g_main.c:41
ED_ParseEdict
void ED_ParseEdict(const char **data, edict_t *ent)
Definition: g_spawn.c:467
fraglimit
cvar_t * fraglimit
Definition: g_main.c:37
level
level_locals_t level
Definition: g_main.c:22
ChaseNext
void ChaseNext(edict_t *ent)
Definition: g_chase.c:107
SAVE_MAGIC2
#define SAVE_MAGIC2
Definition: g_save.c:767
PlayerNoise
void PlayerNoise(edict_t *who, vec3_t where, int type)
Definition: p_weapon.c:56
SPAWNFLAG_NOT_COOP
#define SPAWNFLAG_NOT_COOP
Definition: g_local.h:56
coop
cvar_t * coop
Definition: g_main.c:34
InitItems
void InitItems(void)
Definition: g_items.c:2132
FL_FLY
#define FL_FLY
Definition: g_local.h:59
msg
const char * msg
Definition: win.h:25
func_clock_use
void func_clock_use(edict_t *self, edict_t *other, edict_t *activator)
Definition: g_misc.c:1660
PutClientInServer
void PutClientInServer(edict_t *ent)
Definition: p_client.c:1073
Cmd_WeapNext_f
void Cmd_WeapNext_f(edict_t *ent)
Definition: g_cmds.c:509
SelectNextItem
void SelectNextItem(edict_t *ent, int itflags)
Definition: g_cmds.c:63
run_pitch
cvar_t * run_pitch
Definition: g_main.c:60
COM_Parse
char * COM_Parse(const char **data_p)
Definition: shared.c:455
sv_gravity
cvar_t * sv_gravity
Definition: g_main.c:52
maxspectators
cvar_t * maxspectators
Definition: g_main.c:43
Cmd_Say_f
void Cmd_Say_f(edict_t *ent, qboolean team, qboolean arg0)
Definition: g_cmds.c:731
Cmd_Notarget_f
void Cmd_Notarget_f(edict_t *ent)
Definition: g_cmds.c:311
EDICT_NUM
#define EDICT_NUM(n)
Definition: server.h:173
func_clock_think
void func_clock_think(edict_t *self)
Definition: g_misc.c:1600
G_FindTeams
void G_FindTeams(void)
Definition: g_spawn.c:521
dmflags
cvar_t * dmflags
Definition: g_main.c:35
Info_SetValueForKey
qboolean Info_SetValueForKey(char *s, const char *key, const char *value)
Definition: shared.c:1137
spectator_password
cvar_t * spectator_password
Definition: g_main.c:40
SaveClientData
void SaveClientData(void)
Definition: p_client.c:635
nomonsters
cvar_t * nomonsters
Definition: g_main.c:47
WriteLevel
void WriteLevel(const char *filename)
Definition: g_save.c:866
game_locals_t::maxentities
int maxentities
Definition: g_local.h:281
flood_persecond
cvar_t * flood_persecond
Definition: g_main.c:69
level_locals_t::mapname
char mapname[MAX_QPATH]
Definition: g_local.h:302
flood_waitdelay
cvar_t * flood_waitdelay
Definition: g_main.c:70
InitClientResp
void InitClientResp(gclient_t *client)
Definition: p_client.c:618
SAVE_MAGIC1
#define SAVE_MAGIC1
Definition: g_save.c:766
levelfields
static const save_field_t levelfields[]
Definition: g_save.c:249
ClientBeginDeathmatch
void ClientBeginDeathmatch(edict_t *ent)
Definition: p_client.c:1233
sv_cheats
cvar_t * sv_cheats
Definition: g_main.c:66
SpawnEntities
void SpawnEntities(const char *mapname, const char *entities, const char *spawnpoint)
Definition: g_spawn.c:568
AI_SetSightClient
void AI_SetSightClient(void)
Definition: g_ai.c:47
IT_POWERUP
#define IT_POWERUP
Definition: g_local.h:216
Cmd_Drop_f
void Cmd_Drop_f(edict_t *ent)
Definition: g_cmds.c:390
InitClientPersistant
void InitClientPersistant(gclient_t *client)
Definition: p_client.c:575
read_fields
static void read_fields(FILE *f, const save_field_t *fields, void *base)
Definition: g_save.c:755
gun_z
cvar_t * gun_z
Definition: g_main.c:58
game_locals_t::maxclients
int maxclients
Definition: g_local.h:280