X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fconstants.qh;h=b0878773463fd3c6575d93258d7525d4bc981f92;hb=b683bf23a495d3b1b3f6df3bda75bfe0f069ab05;hp=9c998f39a85d6041a203f4915123294e3931d7d1;hpb=6e12e42c14caa13f188ad12ce1fce1358428bee4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 9c998f39a..b08787734 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -1,11 +1,44 @@ #ifndef CONSTANTS_H #define CONSTANTS_H +// COMMIT-TODO: Update if necessary before committing +// Revision 1: additional statistics sent (flag caps, returns, deaths) +// Revision 2: Mapvote preview pictures +// Revision 3: optimized map vote protocol +// Revision 4: CSQC config var system +// Revision 5: mapvote time fix +// Revision 6: more robust against packet loss/delays, also show not yet connected clients +// Revision 7: packet loss column +// Revision 8: race +// Revision 9: race delta +// Revision 10: scoreboard force +// Revision 11: scoreboard unforce; spectator support beginning +// Revision 12: smaller scores updates (SERVER: requires new engine) +// Revision 13: pointparticles +// Revision 14: laser +// Revision 15: zoom +// Revision 16: multi-weapons +// Revision 17: multi-weaponimpulses +// Revision 18: warmup +// Revision 19: fog +// Revision 20: naggers +// Revision 21: entcs for players optimized (position data down from 12 to 7 bytes); waypointsprites in csqc for team radar +// Revision 22: hook shot origin +#define CSQC_REVISION 22 + const int AS_STRING = 1; const int AS_INT = 2; const int AS_FLOAT_TRUNCATED = 2; const int AS_FLOAT = 8; +const int TE_CSQC_MUTATOR = 99; +#define MUTATOR_HASH(s) crc16(true, s) +#define WriteMutator(to, s) do { \ + WriteByte(to, TE_CSQC_MUTATOR); \ + WriteLong(to, MUTATOR_HASH(#s)); \ +} while (0) +#define ReadMutator() ReadLong() +#define ReadMutatorEquals(read, s) (read == MUTATOR_HASH(#s)) const int TE_CSQC_PICTURE = 100; const int TE_CSQC_RACE = 101; const int TE_CSQC_VORTEXBEAMPARTICLE = 103; @@ -46,12 +79,11 @@ const int ENT_CLIENT_POINTPARTICLES = 6; const int ENT_CLIENT_RAINSNOW = 7; const int ENT_CLIENT_LASER = 8; const int ENT_CLIENT_NAGGER = 9; // flags [votecalledvote] -const int ENT_CLIENT_WAYPOINT = 10; // flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable] const int ENT_CLIENT_RADARLINK = 11; // flags [startorigin] [endorigin] [startcolor+16*endcolor] const int ENT_CLIENT_PROJECTILE = 12; -const int ENT_CLIENT_GIBSPLASH = 13; + const int ENT_CLIENT_DAMAGEINFO = 14; -const int ENT_CLIENT_CASING = 15; + const int ENT_CLIENT_INIT = 16; const int ENT_CLIENT_MAPVOTE = 17; const int ENT_CLIENT_CLIENTDATA = 18; @@ -79,36 +111,40 @@ const int ENT_CLIENT_ELIMINATEDPLAYERS = 39; const int ENT_CLIENT_TURRET = 40; const int ENT_CLIENT_AUXILIARYXHAIR = 50; const int ENT_CLIENT_VEHICLE = 60; - -const int ENT_CLIENT_HEALING_ORB = 80; +const int ENT_CLIENT_LADDER = 61; +const int ENT_CLIENT_TRIGGER_PUSH = 62; +const int ENT_CLIENT_TARGET_PUSH = 63; +const int ENT_CLIENT_CONVEYOR = 64; +const int ENT_CLIENT_DOOR = 65; +const int ENT_CLIENT_TRAIN = 66; +const int ENT_CLIENT_PLAT = 67; +const int ENT_CLIENT_TRIGGER_IMPULSE = 68; +const int ENT_CLIENT_SWAMP = 69; +const int ENT_CLIENT_CORNER = 70; +const int ENT_CLIENT_KEYLOCK = 71; +const int ENT_CLIENT_GENERATOR = 72; +const int ENT_CLIENT_CONTROLPOINT_ICON = 73; + +const int ENT_CLIENT_MINIGAME = 75; +const int ENT_CLIENT_VIEWLOC = 78; +const int ENT_CLIENT_VIEWLOC_TRIGGER = 79; + +const int ENT_CLIENT_MUTATOR = TE_CSQC_MUTATOR; // 99 const int SPRITERULE_DEFAULT = 0; const int SPRITERULE_TEAMPLAY = 1; - -const int RADARICON_NONE = 0; -const int RADARICON_FLAG = 1; -const int RADARICON_FLAGCARRIER = 1; -const int RADARICON_HERE = 1; // TODO make these 3 and 4, and make images for them -const int RADARICON_DANGER = 1; -const int RADARICON_WAYPOINT = 1; -const int RADARICON_HELPME = 1; -const int RADARICON_CONTROLPOINT = 1; -const int RADARICON_GENERATOR = 1; -const int RADARICON_OBJECTIVE = 1; -const int RADARICON_DOMPOINT = 1; -const int RADARICON_POWERUP = 1; -const int RADARICON_TAGGED = 1; +const int SPRITERULE_SPECTATOR = 2; /////////////////////////// // keys pressed -const int KEY_FORWARD = 1; -const int KEY_BACKWARD = 2; -const int KEY_LEFT = 4; -const int KEY_RIGHT = 8; -const int KEY_JUMP = 16; -const int KEY_CROUCH = 32; -const int KEY_ATCK = 64; -const int KEY_ATCK2 = 128; +const int KEY_FORWARD = BIT(0); +const int KEY_BACKWARD = BIT(1); +const int KEY_LEFT = BIT(2); +const int KEY_RIGHT = BIT(3); +const int KEY_JUMP = BIT(4); +const int KEY_CROUCH = BIT(5); +const int KEY_ATCK = BIT(6); +const int KEY_ATCK2 = BIT(7); /////////////////////////// // cvar constants @@ -125,17 +161,7 @@ const int CTF_STATE_DEFEND = 2; const int CTF_STATE_COMMANDER = 3; const int HUD_NORMAL = 0; -const int HUD_VEHICLE_FIRST = 10; -const int HUD_SPIDERBOT = 10; -const int HUD_WAKIZASHI = 11; -const int HUD_RAPTOR = 12; -const int HUD_BUMBLEBEE = 13; -const int HUD_BUMBLEBEE_GUN = 14; -const int HUD_VEHICLE_LAST = 14; - -const vector eX = '1 0 0'; -const vector eY = '0 1 0'; -const vector eZ = '0 0 1'; +const int HUD_BUMBLEBEE_GUN = 25; // moved that here so the client knows the max. // # of maps, I'll use arrays for them :P @@ -144,27 +170,27 @@ const int MAPVOTE_COUNT = 30; /** * Lower scores are better (e.g. suicides) */ -const int SFL_LOWER_IS_BETTER = 1; +const int SFL_LOWER_IS_BETTER = BIT(0); /** * Don't show zero values as scores */ -const int SFL_HIDE_ZERO = 2; +const int SFL_HIDE_ZERO = BIT(1); /** * Allow a column to be hidden (do not automatically add it even if it is a sorting key) */ -const int SFL_ALLOW_HIDE = 16; +const int SFL_ALLOW_HIDE = BIT(4); /** * Display as a rank (with st, nd, rd, th suffix) */ -const int SFL_RANK = 32; +const int SFL_RANK = BIT(5); /** * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!) */ -const int SFL_TIME = 64; +const int SFL_TIME = BIT(6); // not an extra constant yet #define SFL_ZERO_IS_WORST SFL_TIME @@ -179,7 +205,7 @@ const int SFL_SORT_PRIO_MASK = 12; /** * Score indices */ -#define MAX_SCORE 10 +#define MAX_SCORE 12 #define MAX_TEAMSCORE 2 const int ST_SCORE = 0; @@ -187,6 +213,8 @@ const int SP_KILLS = 0; const int SP_DEATHS = 1; const int SP_SUICIDES = 2; const int SP_SCORE = 3; +const int SP_DMG = 10; +const int SP_DMGTAKEN = 11; // game mode specific indices are not in common/, but in server/scores_rules.qc! const int CH_INFO = 0; @@ -252,6 +280,10 @@ const int PROJECTILE_BUMBLE_BEAM = 31; const int PROJECTILE_MAGE_SPIKE = 32; const int PROJECTILE_SHAMBLER_LIGHTNING = 33; +const int PROJECTILE_ROCKETMINSTA_LASER = 34; + +// projectile IDs 40-50 reserved + const int PROJECTILE_RPC = 60; const int SPECIES_HUMAN = 0; @@ -277,7 +309,7 @@ const int SERVERFLAG_ALLOW_FULLBRIGHT = 1; const int SERVERFLAG_TEAMPLAY = 2; const int SERVERFLAG_PLAYERSTATS = 4; -// FIXME/EXPLAINME: why? +// FIXME/EXPLAINME: why? Mario: because vector autocvar_sv_player_maxs = '16 16 45'; vector autocvar_sv_player_mins = '-16 -16 -24'; vector autocvar_sv_player_viewoffset = '0 0 20'; @@ -286,6 +318,9 @@ vector autocvar_sv_player_crouch_mins = '-16 -16 -24'; vector autocvar_sv_player_crouch_viewoffset = '0 0 20'; vector autocvar_sv_player_headsize = '24 24 12'; + +// not so constant +#ifdef SVQC #define PL_VIEW_OFS autocvar_sv_player_viewoffset #define PL_MIN autocvar_sv_player_mins #define PL_MAX autocvar_sv_player_maxs @@ -293,16 +328,18 @@ vector autocvar_sv_player_headsize = '24 24 12'; #define PL_CROUCH_MIN autocvar_sv_player_crouch_mins #define PL_CROUCH_MAX autocvar_sv_player_crouch_maxs #define PL_HEAD autocvar_sv_player_headsize +#elif defined(CSQC) +#define PL_VIEW_OFS vec3(getstatf(STAT_PL_VIEW_OFS1), getstatf(STAT_PL_VIEW_OFS2), getstatf(STAT_PL_VIEW_OFS3)) +#define PL_MIN vec3(getstatf(STAT_PL_MIN1), getstatf(STAT_PL_MIN2), getstatf(STAT_PL_MIN3)) +#define PL_MAX vec3(getstatf(STAT_PL_MAX1), getstatf(STAT_PL_MAX2), getstatf(STAT_PL_MAX3)) +#define PL_CROUCH_VIEW_OFS vec3(getstatf(STAT_PL_CROUCH_VIEW_OFS1), getstatf(STAT_PL_CROUCH_VIEW_OFS2), getstatf(STAT_PL_CROUCH_VIEW_OFS3)) +#define PL_CROUCH_MIN vec3(getstatf(STAT_PL_CROUCH_MIN1), getstatf(STAT_PL_CROUCH_MIN2), getstatf(STAT_PL_CROUCH_MIN3)) +#define PL_CROUCH_MAX vec3(getstatf(STAT_PL_CROUCH_MAX1), getstatf(STAT_PL_CROUCH_MAX2), getstatf(STAT_PL_CROUCH_MAX3)) +#endif -// helpers -#define PL_VIEW_OFS_z autocvar_sv_player_viewoffset.z -#define PL_MIN_z autocvar_sv_player_mins.z -#define PL_MAX_z autocvar_sv_player_maxs.z -#define PL_CROUCH_VIEW_OFS_z autocvar_sv_player_crouch_viewoffset.z -#define PL_CROUCH_MIN_z autocvar_sv_player_mins.z -#define PL_HEAD_x autocvar_sv_player_headsize.x -#define PL_HEAD_y autocvar_sv_player_headsize.y -#define PL_HEAD_z autocvar_sv_player_headsize.z +// a bit more constant +const vector PL_MAX_CONST = '16 16 45'; +const vector PL_MIN_CONST = '-16 -16 -24'; // spawnpoint prios const int SPAWN_PRIO_NEAR_TEAMMATE_FOUND = 200; @@ -310,16 +347,6 @@ const int SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM = 100; const int SPAWN_PRIO_RACE_PREVIOUS_SPAWN = 50; const int SPAWN_PRIO_GOOD_DISTANCE = 10; -// URI handles -const int URI_GET_DISCARD = 0; -const int URI_GET_IPBAN = 1; -const int URI_GET_IPBAN_END = 16; -const int URI_GET_CURL = 17; -const int URI_GET_CURL_END = 32; -const int URI_GET_UPDATENOTIFICATION = 33; -const int URI_GET_URLLIB = 128; -const int URI_GET_URLLIB_END = 191; - // gametype vote flags const int GTV_FORBIDDEN = 0; // Cannot be voted const int GTV_AVAILABLE = 1; // Can be voted