Xonotic
|
#include "world.qh"
#include <common/constants.qh>
#include <common/deathtypes/all.qh>
#include <common/gamemodes/_mod.qh>
#include <common/gamemodes/sv_rules.qh>
#include <common/items/_mod.qh>
#include <common/mapinfo.qh>
#include <common/mapobjects/target/music.qh>
#include <common/mapobjects/trigger/hurt.qh>
#include <common/mapobjects/trigger/secret.qh>
#include <common/mapobjects/triggers.qh>
#include <common/monsters/_mod.qh>
#include <common/monsters/sv_monsters.qh>
#include <common/net_linked.qh>
#include <common/notifications/all.qh>
#include <common/physics/player.qh>
#include <common/playerstats.qh>
#include <common/state.qh>
#include <common/stats.qh>
#include <common/teams.qh>
#include <common/util.qh>
#include <common/vehicles/all.qh>
#include <common/weapons/_all.qh>
#include <server/anticheat.qh>
#include <server/antilag.qh>
#include <server/bot/api.qh>
#include <server/campaign.qh>
#include <server/cheats.qh>
#include <server/client.qh>
#include <server/command/common.qh>
#include <server/command/getreplies.qh>
#include <server/command/sv_cmd.qh>
#include <server/command/vote.qh>
#include <server/damage.qh>
#include <server/gamelog.qh>
#include <server/hook.qh>
#include <server/intermission.qh>
#include <server/ipban.qh>
#include <server/items/items.qh>
#include <server/main.qh>
#include <server/mapvoting.qh>
#include <server/mutators/_mod.qh>
#include <server/race.qh>
#include <server/scores.qh>
#include <server/scores_rules.qh>
#include <server/spawnpoints.qh>
#include <server/teamplay.qh>
#include <server/weapons/common.qh>
#include <server/weapons/weaponstats.qh>
Go to the source code of this file.
Macros | |
#define | BADCVAR(p) if(k == p) continue |
#define | BADPREFIX(p) if(substring(k, 0, strlen(p)) == p) continue |
#define | BADPRESUFFIX(p, s) if(substring(k, 0, strlen(p)) == p && substring(k, -strlen(s), -1) == s) continue |
#define | BADVALUE(p, val) if (k == p && v == val) continue |
#define | X(match) |
#define BADCVAR | ( | p | ) | if(k == p) continue |
Referenced by cvar_changes_init().
Referenced by cvar_changes_init().
#define BADPRESUFFIX | ( | p, | |
s | |||
) | if(substring(k, 0, strlen(p)) == p && substring(k, -strlen(s), -1) == s) continue |
Referenced by cvar_changes_init().
Referenced by cvar_changes_init().
#define X | ( | match | ) |
Referenced by spawnfunc().
void __init_dedicated_server_shutdown | ( | ) |
Definition at line 622 of file world.qc.
References MapInfo_Shutdown().
Referenced by Shutdown().
Definition at line 1413 of file world.qc.
References FOREACH_CLIENT, INGAME, and IS_PLAYER.
Referenced by WinningCondition_RanOutOfSpawns().
void CheckRules_World | ( | ) |
Definition at line 1593 of file world.qc.
References autocvar__endmatch, bprint(), checkrules_overtimesadded, checkrules_suddendeathend, checkrules_suddendeathwarning, CheckRules_World(), ClearWinners(), FOREACH_CLIENT, g_race, g_race_qualifying, GameRules_scoring_add, InitiateOvertime(), InitiateSuddenDeath(), intermission_running, IS_PLAYER, M_ARGV, MapVote_Start(), MapVote_Think(), MUTATOR_CALLHOOK, NextLevel(), NULL, player_count, ReadyRestart(), SetDefaultAlpha(), time, VoteThink(), warmup_stage, WINNING_NEVER, WINNING_STARTSUDDENDEATHOVERTIME, WINNING_YES, WinningCondition_RanOutOfSpawns(), and WinningCondition_Scores().
Referenced by CheckRules_World(), and StartFrame().
void ClearWinners | ( | ) |
Definition at line 1422 of file world.qc.
References FOREACH_CLIENT, INGAME, and IS_PLAYER.
Referenced by CheckRules_World(), LMS_NewPlayerLives(), spawnfunc(), WinningCondition_Invasion(), WinningCondition_LMS(), WinningCondition_RanOutOfSpawns(), and WinningCondition_Scores().
void cvar_changes_init | ( | ) |
Definition at line 149 of file world.qc.
References BADCVAR, BADPREFIX, BADPRESUFFIX, BADVALUE, buf_create, cvar_changes, cvar_defstring(), cvar_purechanges, cvar_purechanges_count, cvar_string(), strcat(), strfree, strlen(), strzone(), and v.
Referenced by spawnfunc().
Definition at line 2224 of file world.qc.
References DropToFloor_Handler(), and InitializeEntity().
Definition at line 2218 of file world.qc.
References dropped_origin, origin, and WITHSELF.
Referenced by droptofloor().
Definition at line 1170 of file world.qc.
References autocvar_sv_eventlog, autocvar_sv_eventlog_console, autocvar_sv_logscores_bots, autocvar_sv_logscores_console, autocvar_sv_logscores_file, autocvar_sv_logscores_filename, CS(), fclose(), FILE_APPEND, fopen(), FOREACH_CLIENT, fputs(), ftos(), GameLogEcho(), GetGametype(), GetMapname(), GetPlayerScoreString(), GetTeamScoreString(), INGAME_JOINED, IS_BOT_CLIENT, IS_PLAYER, IS_REAL_CLIENT, jointime, LOG_HELP, NULL, rint(), strcat(), teamplay, and time.
Referenced by GameCommand_printstats(), and NextLevel().
void EndFrame | ( | ) |
Definition at line 2300 of file world.qc.
References anticheat_endframe(), antilag_record(), autocvar_g_antilag_nudge, ceil(), CS(), entity(), FOREACH_CLIENT, frametime, g_monsters, g_projectiles, IL_EACH, IL_ENDFRAME(), IS_REAL_CLIENT, IS_SPEC, Physics_Frame(), systems_update(), and time.
Definition at line 634 of file world.qc.
References ScoreRules_generic(), and scores_initialized.
Referenced by InitGameplayMode().
Definition at line 1378 of file world.qc.
References autocvar_g_campaign, WINNING_NEVER, WINNING_NO, WINNING_STARTSUDDENDEATHOVERTIME, and WINNING_YES.
Referenced by WinningCondition_Scores().
Definition at line 115 of file world.qc.
References autocvar__sv_init, autocvar_g_maplist, autocvar_g_maplist_shuffle, cvar_set(), DoNextMapOverride(), ftos(), GotoNextMap(), LOG_INFO, MapInfo_CurrentFeatures(), MapInfo_CurrentGametype(), MapInfo_Enumerate(), MapInfo_FilterGametype(), MapInfo_ForbiddenFlags(), MapInfo_RequiredFlags(), nextthink, ShuffleMaplist(), time, and tokenizebyseparator.
Referenced by spawnfunc().
void InitGameplayMode | ( | ) |
Definition at line 640 of file world.qc.
References cache_lastmutatormsg, cache_mutatormsg, clientstuff, cvar_value_issafe(), gamemode_name, GameplayMode_DelayedInit(), GameRules_teams(), InitializeEntity(), LOG_INFO, MapInfo_ClearTemps(), MapInfo_LoadedGametype, MapInfo_LoadMapSettings(), MapInfo_Map_clientstuff, MapInfo_Map_fog, MapInfo_Type_ToText(), mapname, min(), NULL, string_null, strzone(), v, vector(), vlen(), VoteReset(), and world.
Referenced by spawnfunc().
void InitializeEntitiesRun | ( | ) |
Definition at line 2179 of file world.qc.
References backtrace, delete_fn(), entity(), eprint(), func_null(), initialize_entity_first, next, NULL, remove_except_protected(), remove_unsafely(), strcat(), and void.
Referenced by StartFrame().
Definition at line 2146 of file world.qc.
References entity(), initialize_entity_first, NULL, and prev.
Referenced by _StartItem(), buffs_Initialize(), ctf_FlagSetup(), ctf_Initialize(), dom_Initialize(), door_reset(), droptofloor(), InitGameplayMode(), invasion_Initialize(), ka_SpawnBall(), MUTATOR_HOOKFUNCTION(), nb_Initialize(), ons_ControlPoint_Setup(), ons_GeneratorSetup(), ons_Initialize(), readplayerstartcvars(), relocate_spawnpoint(), spawnfunc(), SUB_CalcAngleMoveEnt(), target_checkpoint_setup(), target_give_init(), tdm_Initialize(), Teleport_Touch(), train_next(), and trigger_push_findtarget().
void InitiateOvertime | ( | ) |
Definition at line 1369 of file world.qc.
References autocvar_timelimit_overtime, checkrules_overtimesadded, cvar_set(), ftos(), and NULL.
Referenced by CheckRules_World().
float InitiateSuddenDeath | ( | ) |
Definition at line 1337 of file world.qc.
References autocvar_g_campaign, autocvar_timelimit_overtime, autocvar_timelimit_overtimes, autocvar_timelimit_suddendeath, checkrules_overtimesadded, checkrules_suddendeathend, g_race, g_race_qualifying, race_StartCompleting(), and time.
Referenced by CheckRules_World().
bool MoveToRandomLocationWithinBounds | ( | entity | e, |
vector | boundmin, | ||
vector | boundmax, | ||
float | goodcontents, | ||
float | badcontents, | ||
float | badsurfaceflags, | ||
int | attempts, | ||
float | maxaboveground, | ||
float | minviewdistance | ||
) |
Definition at line 1035 of file world.qc.
References checkpvs(), entity(), ftos(), g_items, g_spawnpoints, IL_EACH, LOG_DEBUG, MOVE_NORMAL, normalize(), NULL, Q3SURFACEFLAG_SKY, random(), setorigin(), trace_dphitcontents, trace_dphitq3surfaceflags, trace_dphittexturename, trace_endpos, trace_fraction, trace_startsolid, vectoangles(), vector(), and vlen().
Referenced by MoveToRandomMapLocation().
float MoveToRandomMapLocation | ( | entity | e, |
float | goodcontents, | ||
float | badcontents, | ||
float | badsurfaceflags, | ||
float | attempts, | ||
float | maxaboveground, | ||
float | minviewdistance | ||
) |
Definition at line 1157 of file world.qc.
References MoveToRandomLocationWithinBounds(), and world.
Referenced by buff_Respawn(), CheatImpulse(), invasion_SpawnChosenMonster(), and ka_RespawnBall().
void NextLevel | ( | ) |
Definition at line 1276 of file world.qc.
References autocvar_g_campaign, autocvar_sv_eventlog, autocvar_sv_mapchange_delay, bprint(), CampaignPreIntermission(), CPID_Null, cvar_set(), DumpStats(), FixIntermissionClient(), FOREACH_CLIENT, GameLogClose(), GameLogEcho(), INGAME, intermission_exittime, intermission_running, IS_PLAYER, localcmd, MUTATOR_CALLHOOK, NULL, player_count, Team_ColorCode(), Team_ColorName_Upper, teamplay, time, VoteReset(), and WeaponStats_Shutdown().
Referenced by CheckRules_World().
void Physics_Frame | ( | ) |
Definition at line 2258 of file world.qc.
References g_moveables, IL_EACH, IS_CLIENT, MOVETYPE_NONE, MOVETYPE_PHYSICS, Movetype_Physics_NoMatchTicrate(), MOVETYPE_QCENTITY, MOVETYPE_USER_FIRST, MOVETYPE_USER_LAST, and systems_update().
Referenced by EndFrame().
void PingPLReport_Spawn | ( | ) |
Definition at line 95 of file world.qc.
References new_pure, pingplreport, PingPLReport_Think(), setthink, and time.
Referenced by spawnfunc().
Definition at line 57 of file world.qc.
References bound(), ceil(), cnt, CS(), entity(), IS_CLIENT, IS_REAL_CLIENT, LATENCY_THINKRATE, latency_time, maxclients, min(), MSG_BROADCAST, nextthink, ping, ping_movementloss, ping_packetloss, rint(), sys_frametime, time, WriteByte(), and WriteShort().
Referenced by PingPLReport_Spawn().
Definition at line 565 of file world.qc.
References cnt, and WriteShort().
Referenced by RandomSeed_Spawn().
void RandomSeed_Spawn | ( | ) |
Definition at line 578 of file world.qc.
References getthink, new_pure, randomseed, RandomSeed_Send(), RandomSeed_Think(), and setthink.
Referenced by spawnfunc().
void readlevelcvars | ( | ) |
Definition at line 2063 of file world.qc.
References cvar(), FOREACH, g_pickup_cells_max, g_pickup_fuel_max, g_pickup_nails_max, g_pickup_plasma_max, g_pickup_rockets_max, g_pickup_shells_max, g_pickup_weapons_anyway, g_weapon_stay, GetGametype(), MUTATOR_CALLHOOK, readplayerstartcvars(), SERVERFLAG_ALLOW_FULLBRIGHT, serverflags, strcat(), sv_ready_restart_after_countdown, time, and warmup_stage.
Referenced by spawnfunc().
void readplayerstartcvars | ( | ) |
Definition at line 1843 of file world.qc.
References argv(), autocvar_g_jetpack, autocvar_g_warmup_allguns, cvar(), cvar_string(), FOREACH, g_weapon_stay, g_weaponarena, g_weaponarena_list, g_weaponarena_weapons, GetResource(), InitializeEntity(), M_ARGV, Weapon::m_name, max(), MUTATOR_CALLHOOK, new_pure, NULL, random_start_ammo, random_start_weapons_count, SetResource(), start_ammo_cells, start_ammo_fuel, start_ammo_nails, start_ammo_plasma, start_ammo_rockets, start_ammo_shells, start_armorvalue, start_health, start_items, start_weapons, start_weapons_default, start_weapons_defaultmask, strcat(), strlen(), strzone(), substring(), tokenize_console, want_weapon(), warmup_start_ammo_cells, warmup_start_ammo_fuel, warmup_start_ammo_nails, warmup_start_ammo_plasma, warmup_start_ammo_rockets, warmup_start_ammo_shells, warmup_start_armorvalue, warmup_start_health, warmup_start_weapons, warmup_start_weapons_default, warmup_start_weapons_defaultmask, Weapon_from_name(), weaponarena_available_all_update(), weaponarena_available_devall_update(), weaponarena_available_most_update(), weapons_all(), weapons_devall(), and weapons_most().
Referenced by readlevelcvars().
float RedirectionThink | ( | ) |
Definition at line 2349 of file world.qc.
References autocvar_quit_and_redirect_timer, bprint(), cvar_set(), FOREACH_CLIENT, ftos(), IS_REAL_CLIENT, localcmd, LOG_INFO, redirection_target, strcat(), stuffcmd, and time.
Referenced by StartFrame().
void RestoreGame | ( | ) |
Definition at line 2390 of file world.qc.
References autocvar_sessionid, db_load(), MapInfo_CurrentFeatures(), MapInfo_CurrentGametype(), MapInfo_Enumerate(), MapInfo_FilterGametype(), MapInfo_ForbiddenFlags(), MapInfo_RequiredFlags(), MapInfo_Shutdown(), ServerProgsDB, strcat(), and WeaponStats_Init().
Definition at line 2230 of file world.qc.
References getthink, max(), nextthink, and time.
void SetDefaultAlpha | ( | ) |
Definition at line 104 of file world.qc.
References autocvar_g_player_alpha, default_player_alpha, default_weapon_alpha, and MUTATOR_CALLHOOK.
Referenced by CheckRules_World(), and spawnfunc().
Definition at line 1407 of file world.qc.
References FOREACH_CLIENT, INGAME, and IS_PLAYER.
Referenced by WinningCondition_Assault(), WinningCondition_Invasion(), WinningCondition_LMS(), and WinningCondition_Scores().
void Shutdown | ( | ) |
Definition at line 2407 of file world.qc.
References __init_dedicated_server_shutdown(), autocvar_chase_active, autocvar_cl_db_saveasdump, autocvar_developer, autocvar_r_drawviewmodel, autocvar_sessionid, autocvar_sv_db_saveasdump, Ban_SaveBans(), binddb, bot_endgame(), calledhooks, camera_active, chase_active_backup, cheatcount_total, CheatShutdown(), ClientProgsDB, cvar_defstring(), cvar_set(), db_close(), db_dump(), db_save(), deactivate_minigame(), ftos(), HOOK_END, HOOK_START, HUD_MinigameMenu_Close(), isdemo(), localcmd, LOG_INFO, LOG_TRACE, MapInfo_Shutdown(), NULL, orig_slowmo, players, ServerProgsDB, strcat(), strfree, sv_termsofservice_url_escaped, teams, tempdb, TemporaryDB, TIMEOUT_ACTIVE, WarpZone_Shutdown(), WeaponStats_Shutdown(), and world_initialized.
spawnfunc | ( | __init_dedicated_server | ) |
Definition at line 587 of file world.qc.
References delete_fn(), entity(), g_spawnpoints, GotoFirstMap(), IL_PUSH(), MapInfo_CurrentFeatures(), MapInfo_CurrentGametype(), MapInfo_Enumerate(), MapInfo_FilterGametype(), MapInfo_ForbiddenFlags(), MapInfo_RequiredFlags(), remove_unsafely(), setthink, static_init, static_init_late, static_init_precache, time, and world_initialized.
spawnfunc | ( | worldspawn | ) |
Definition at line 688 of file world.qc.
References argv(), autocvar_g_campaign, autocvar_g_norecoil, autocvar_g_pickup_items, autocvar_g_use_ammunition, autocvar_g_waypoints_for_items, autocvar_g_weaponarena, autocvar_sessionid, autocvar_sv_curl_serverpackages_auto, autocvar_sv_eventlog, autocvar_sv_eventlog_files_counter, autocvar_sv_termsofservice_url, Ban_LoadBans(), BITSET, boolean, bot_waypoints_for_items, CampaignPostInit(), CampaignPreInit(), changelevel(), CheatInit(), ClientInit_Spawn(), clientstuff, cons(), cvar_changes_init(), cvar_defstring(), cvar_set(), cvar_string(), cvar_value_issafe(), db_create(), db_load(), delete_fn(), endsWith, error(), fclose(), fexists(), fgets(), FILE_READ, floor(), fopen(), ftos(), GameLogEcho(), GameLogInit(), GameRules_limit_fallbacks(), GetGametype(), getladder(), getlsmaps(), getmaplist(), GetMapname(), getmonsterlist(), getrankings(), getrecords(), InitGameplayMode(), itos, localcmd, LOG_INFO, LOG_INFOF, M_ARGV, Map_MarkAsRecent(), MapInfo_CurrentFeatures(), MapInfo_CurrentGametype(), MapInfo_Enumerate(), MapInfo_FilterGametype(), MapInfo_ForbiddenFlags(), MapInfo_RequiredFlags(), mapname, matchid, modname, MUTATOR_CALLHOOK, Nagger_Init(), PingPLReport_Spawn(), player_count, q3compat, Q3COMPAT_ARENA, Q3COMPAT_DEFI, RACE_RECORD, random(), RandomSeed_Spawn(), readlevelcvars(), record_type, remove_safely(), server_is_dedicated, ServerProgsDB, SetDefaultAlpha(), SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS, spawnflags, startsWith, static_init, static_init_late, static_init_precache, stof(), strcat(), strcpy, strftime_s(), strzone(), sv_termsofservice_url_escaped, TemporaryDB, tokenize_console, WeaponStats_Init(), WinningConditionHelper(), world_already_spawned, world_initialized, and X.
spawnfunc | ( | light | ) |
STATIC_INIT_EARLY | ( | maxclients | ) |
void systems_update | ( | ) |
Definition at line 7 of file main.qc.
References SYSTEM_UPDATE, and time.
Referenced by EndFrame(), and Physics_Frame().
Definition at line 1725 of file world.qc.
References boolean, M_ARGV, MUTATOR_CALLHOOK, WEP_FLAG_HIDDEN, WEP_FLAG_MUTATORBLOCKED, WEP_FLAG_NORMAL, and WEP_FLAG_SPECIALATTACK.
Referenced by readplayerstartcvars(), and weapons_start().
Definition at line 1804 of file world.qc.
References g_weaponarena_weapons, start_weapons, warmup_start_weapons, weapons_all(), and weapons_start().
Referenced by readplayerstartcvars().
Definition at line 1817 of file world.qc.
References g_weaponarena_weapons, start_weapons, warmup_start_weapons, weapons_devall(), and weapons_start().
Referenced by readplayerstartcvars().
Definition at line 1830 of file world.qc.
References g_weaponarena_weapons, start_weapons, warmup_start_weapons, weapons_most(), and weapons_start().
Referenced by readplayerstartcvars().
WepSet weapons_all | ( | ) |
Definition at line 1774 of file world.qc.
References FOREACH, WEP_FLAG_MUTATORBLOCKED, and WEP_FLAG_SPECIALATTACK.
Referenced by readplayerstartcvars(), and weaponarena_available_all_update().
WepSet weapons_devall | ( | ) |
Definition at line 1784 of file world.qc.
References FOREACH.
Referenced by readplayerstartcvars(), and weaponarena_available_devall_update().
WepSet weapons_most | ( | ) |
Definition at line 1794 of file world.qc.
References FOREACH, WEP_FLAG_HIDDEN, WEP_FLAG_MUTATORBLOCKED, WEP_FLAG_NORMAL, and WEP_FLAG_SPECIALATTACK.
Referenced by readplayerstartcvars(), and weaponarena_available_most_update().
WepSet weapons_start | ( | ) |
Weapons the player normally starts with outside weapon arena.
Definition at line 1763 of file world.qc.
References FOREACH, and want_weapon().
Referenced by weaponarena_available_all_update(), weaponarena_available_devall_update(), and weaponarena_available_most_update().
float WinningCondition_RanOutOfSpawns | ( | ) |
Definition at line 1509 of file world.qc.
References AddWinners(), autocvar_g_spawn_useallspawns, checkrules_equality, ClearWinners(), entity(), FOREACH_CLIENT, g_spawnpoints, have_team_spawns, IL_EACH, IS_DEAD, IS_PLAYER, MAX_TEAMSCORE, NULL, NUM_TEAMS, some_spawn_has_been_used, team, Team_GetTeamFromIndex(), Team_GetTeamScore(), Team_IndexToTeam(), Team_IsValidTeam(), Team_SetTeamScore(), TeamBalance_CheckAllowedTeams(), TeamBalance_IsTeamAllowed(), TeamScore_AddToTeam(), WINNING_NO, and WINNING_YES.
Referenced by CheckRules_World().
Definition at line 1428 of file world.qc.
References autocvar_leadlimit_and_fraglimit, checkrules_suddendeathend, ClearWinners(), FLOAT_MAX, fragsleft_last, GetWinningCode(), max(), min(), MUTATOR_CALLHOOK, NULL, SetWinners(), team, Team_GetTeamFromIndex(), Team_IndexToTeam(), Team_SetTeamScore(), teamplay, TeamScore_GetCompareValue(), time, WinningConditionHelper(), WinningConditionHelper_equality, WinningConditionHelper_lowerisbetter, WinningConditionHelper_secondscore, WinningConditionHelper_topscore, WinningConditionHelper_winner, WinningConditionHelper_winnerteam, and WinningConditionHelper_zeroisworst.
Referenced by CheckRules_World(), WinningCondition_QualifyingThenRace(), and WinningCondition_Race().
int fragsleft_last |
Definition at line 1427 of file world.qc.
Referenced by WinningCondition_Scores().
const float LATENCY_THINKRATE = 10 |
Definition at line 52 of file world.qc.
Referenced by PingPLReport_Think().
float latency_time |
Definition at line 55 of file world.qc.
Referenced by PingPLReport_Think().
entity pingplreport |
Definition at line 56 of file world.qc.
Referenced by PingPLReport_Spawn().
entity randomseed |
Definition at line 564 of file world.qc.
Referenced by RandomSeed_Spawn().
const float SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS = 1 |
Definition at line 102 of file world.qc.
Referenced by spawnfunc().
bool world_already_spawned |
Definition at line 687 of file world.qc.
Referenced by spawnfunc().