1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! `IEngineReplay`, the engine's services for its replay system, among them
//! the recalculation of the server's tags.
//!
//! The engine keeps the server's tags in `sv_tags` (see
//! [`server_game_tags`](super::server_game_tags)). It recalculates them as
//! levels start and as variables marked
//! [`NOTIFY`](crate::commands::CommandFlags::NOTIFY) change: for each variable
//! the game lists, it adds the variable's tag while the variable is not at its
//! default and removes it otherwise, and leaves every other tag, such as one a
//! plugin added, as it is. A game's hook on that list, such as one that
//! [excludes](super::server_game_tags::TaggedConVar::exclude) a variable, runs
//! for each recalculation.
//!
//! The engine recalculates the tags for a change in the change callback that
//! also announces it, which does nothing for a variable without the flag. A
//! variable set with [`ConVar::set_string_quietly`], whose flag is cleared
//! for the change, so leaves the tags as they were, until the next level or
//! the next announced change. [`EngineReplay::recalculate_tags`] has the engine
//! recalculate them at once instead.
//!
//! The engine is not public. All of the above is inferred, not read in its
//! source: what its recalculation does, that it runs in the callback that
//! announces a change, and that the engine exports this interface. It is
//! inferred from the interface's header, which declares its version, from
//! TF2's client library, which requests it from the engine, from TF2's list
//! of the variables that tag the server, which notes that they need
//! `FCVAR_NOTIFY` "so the tags are recalculated and uploaded to the master
//! server when the convar is changed" (`game/shared/tf/tf_gamerules.cpp`),
//! and from how `sv_tags` changes as those variables do. Should the engine
//! not export the interface, [`Server::engine_replay`] fails.
//!
//! [`ConVar::set_string_quietly`]: super::cvar::ConVar::set_string_quietly
//! [`Server::engine_replay`]: crate::Server::engine_replay
use ;
use vcall;
interface!