]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mapinfo.qh
Merge remote branch 'origin/master' into samual/add_eventlog_reporting
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapinfo.qh
1 float MAPINFO_TYPE_DEATHMATCH           = 1;
2 float MAPINFO_TYPE_LMS                  = 2;
3 float MAPINFO_TYPE_ARENA                = 4;
4 float MAPINFO_TYPE_RUNEMATCH            = 8;
5 float MAPINFO_TYPE_RACE                 = 16;
6 float MAPINFO_TYPE_CTS                  = 32;
7 float MAPINFO_TYPE_TEAM_DEATHMATCH      = 64;
8 float MAPINFO_TYPE_CTF                  = 128;
9 float MAPINFO_TYPE_CA                   = 256;
10 float MAPINFO_TYPE_DOMINATION           = 512;
11 float MAPINFO_TYPE_KEYHUNT              = 1024;
12 float MAPINFO_TYPE_ASSAULT              = 2048;
13 float MAPINFO_TYPE_ONSLAUGHT            = 4096;
14 float MAPINFO_TYPE_NEXBALL              = 8192;
15 float MAPINFO_TYPE_FREEZETAG            = 16384;
16 float MAPINFO_TYPE_KEEPAWAY     = 32768;
17 float MAPINFO_TYPE_ALL                  = 65535; // this has to include all above bits
18
19 float MAPINFO_FEATURE_WEAPONS       = 1; // not defined for minstagib-only maps
20
21 float MAPINFO_FLAG_HIDDEN           = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
22 float MAPINFO_FLAG_FORBIDDEN        = 2; // don't even allow the map by a cvar setting that allows hidden maps
23 float MAPINFO_FLAG_FRUSTRATING      = 4; // this map is near impossible to play, enable at your own risk
24
25 float MapInfo_count;
26
27 // info about a map that MapInfo loads
28 string MapInfo_Map_bspname;
29 string MapInfo_Map_title;
30 string MapInfo_Map_titlestring; // either bspname: title or just title, depending on whether bspname is redundant
31 string MapInfo_Map_description;
32 string MapInfo_Map_author;
33 string MapInfo_Map_clientstuff; // not in cache, only for map load
34 string MapInfo_Map_fog; // not in cache, only for map load
35 float MapInfo_Map_supportedGametypes;
36 float MapInfo_Map_supportedFeatures;
37 float MapInfo_Map_flags;
38 vector MapInfo_Map_mins; // these are '0 0 0' if not supported!
39 vector MapInfo_Map_maxs; // these are '0 0 0' if not specified!
40
41 // load MapInfo_count; generate mapinfo for maps that miss them, and clear the
42 // cache; you need to call MapInfo_FilterGametype afterwards!
43 void MapInfo_Enumerate();
44
45 // filter the info by game type mask (updates MapInfo_count)
46 float MapInfo_progress;
47 float MapInfo_FilterGametype(float gametype, float features, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then; use MapInfo_progress as progress indicator)
48 float MapInfo_CurrentFeatures(); // retrieves currently required features from cvars
49 float MapInfo_CurrentGametype(); // retrieves current gametype from cvars
50 float MapInfo_ForbiddenFlags(); // retrieves current flags from cvars
51 float MapInfo_RequiredFlags(); // retrieves current flags from cvars
52
53 // load info about the i-th map into the MapInfo_Map_* globals
54 float MapInfo_Get_ByID(float i); // 1 on success, 0 on failure
55 string MapInfo_BSPName_ByID(float i);
56
57 // load info about a map by name into the MapInfo_Map_* globals
58 float MapInfo_Get_ByName(string s, float allowGenerate, float gametypeToSet); // 1 on success, 0 on failure, 2 if it autogenerated a mapinfo file
59
60 // look for a map by a prefix, returns the actual map name on success, string_null on failure or ambigous match
61 string MapInfo_FindName_match; // the name of the map that was found
62 float MapInfo_FindName_firstResult; // -1 if none were found, index of first one if not unique but found (FindName then returns -1)
63 float MapInfo_FindName(string s);
64 string MapInfo_FixName(string s);
65
66 // play a map
67 float MapInfo_CheckMap(string s); // returns 0 if the map can't be played with the current settings
68 void MapInfo_LoadMap(string s);
69
70 // list all maps for the current game type
71 string MapInfo_ListAllowedMaps(float pFlagsRequired, float pFlagsForbidden);
72 // list all allowed maps (for any game type)
73 string MapInfo_ListAllAllowedMaps(float pFlagsRequired, float pFlagsForbidden);
74
75 // gets a gametype from a string
76 float MapInfo_Type_FromString(string t);
77 string MapInfo_Type_ToString(float t);
78 string MapInfo_GetGameTypeCvar(float t);
79 void MapInfo_SwitchGameType(float t);
80
81 // to be called from worldspawn to set up cvars
82 void MapInfo_LoadMapSettings(string s);
83
84 void MapInfo_Cache_Destroy(); // disable caching
85 void MapInfo_Cache_Create(); // enable caching
86 void MapInfo_Cache_Invalidate(); // delete cache if any, but keep enabled
87
88 void MapInfo_ClearTemps(); // call this when done with mapinfo for this frame
89
90 void MapInfo_Shutdown(); // call this in the shutdown handler
91
92 #define MAPINFO_SETTEMP_ACL_USER cvar_string("g_mapinfo_settemp_acl")
93 #define MAPINFO_SETTEMP_ACL_SYSTEM "-g_mapinfo_* -rcon_* -settemp_* -_* -g_ban* +*"