// 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 #define CSQC_REVISION 17 // probably put these in common/ // so server/ and client/ can be synced better const float GAME_DEATHMATCH = 1; const float GAME_TEAM_DEATHMATCH = 2; const float GAME_DOMINATION = 3; const float GAME_CTF = 4; const float GAME_RUNEMATCH = 5; const float GAME_LMS = 6; const float GAME_ARENA = 7; const float GAME_KEYHUNT = 8; const float GAME_ASSAULT = 9; const float GAME_ONSLAUGHT = 10; const float GAME_RACE = 11; const float AS_STRING = 1; const float AS_INT = 2; const float AS_FLOAT_TRUNCATED = 2; const float AS_FLOAT = 8; const float ENT_CLIENT = 0; const float ENT_CLIENT_DEAD = 1; const float ENT_CLIENT_ENTCS = 2; const float ENT_CLIENT_SCORES_INFO = 3; const float ENT_CLIENT_SCORES = 4; const float ENT_CLIENT_TEAMSCORES = 5; const float ENT_CLIENT_POINTPARTICLES = 6; const float ENT_CLIENT_RAINSNOW = 7; const float ENT_CLIENT_LASER = 8; /////////////////////////// // key constants // // these are the key numbers that should be passed to Key_Event // const float K_TAB = 9; const float K_ENTER = 13; const float K_ESCAPE = 27; const float K_SPACE = 32; // normal keys should be passed as lowercased ascii const float K_BACKSPACE = 127; const float K_UPARROW = 128; const float K_DOWNARROW = 129; const float K_LEFTARROW = 130; const float K_RIGHTARROW = 131; const float K_ALT = 132; const float K_CTRL = 133; const float K_SHIFT = 134; const float K_F1 = 135; const float K_F2 = 136; const float K_F3 = 137; const float K_F4 = 138; const float K_F5 = 139; const float K_F6 = 140; const float K_F7 = 141; const float K_F8 = 142; const float K_F9 = 143; const float K_F10 = 144; const float K_F11 = 145; const float K_F12 = 146; const float K_INS = 147; const float K_DEL = 148; const float K_PGDN = 149; const float K_PGUP = 150; const float K_HOME = 151; const float K_END = 152; const float K_KP_HOME = 160; const float K_KP_UPARROW = 161; const float K_KP_PGUP = 162; const float K_KP_LEFTARROW = 163; const float K_KP_5 = 164; const float K_KP_RIGHTARROW = 165; const float K_KP_END = 166; const float K_KP_DOWNARROW = 167; const float K_KP_PGDN = 168; const float K_KP_ENTER = 169; const float K_KP_INS = 170; const float K_KP_DEL = 171; const float K_KP_SLASH = 172; const float K_KP_MINUS = 173; const float K_KP_PLUS = 174; const float K_PAUSE = 255; // // joystick buttons // const float K_JOY1 = 768; const float K_JOY2 = 769; const float K_JOY3 = 770; const float K_JOY4 = 771; // // aux keys are for multi-buttoned joysticks to generate so they can use // the normal binding process // const float K_AUX1 = 772; const float K_AUX2 = 773; const float K_AUX3 = 774; const float K_AUX4 = 775; const float K_AUX5 = 776; const float K_AUX6 = 777; const float K_AUX7 = 778; const float K_AUX8 = 779; const float K_AUX9 = 780; const float K_AUX10 = 781; const float K_AUX11 = 782; const float K_AUX12 = 783; const float K_AUX13 = 784; const float K_AUX14 = 785; const float K_AUX15 = 786; const float K_AUX16 = 787; const float K_AUX17 = 788; const float K_AUX18 = 789; const float K_AUX19 = 790; const float K_AUX20 = 791; const float K_AUX21 = 792; const float K_AUX22 = 793; const float K_AUX23 = 794; const float K_AUX24 = 795; const float K_AUX25 = 796; const float K_AUX26 = 797; const float K_AUX27 = 798; const float K_AUX28 = 799; const float K_AUX29 = 800; const float K_AUX30 = 801; const float K_AUX31 = 802; const float K_AUX32 = 803; // // mouse buttons generate virtual keys // const float K_MOUSE1 = 512; const float K_MOUSE2 = 513; const float K_MOUSE3 = 514; const float K_MWHEELUP = 515; const float K_MWHEELDOWN = 516; const float K_MOUSE4 = 517; const float K_MOUSE5 = 518; const float K_MOUSE6 = 519; const float K_MOUSE7 = 520; const float K_MOUSE8 = 521; const float K_MOUSE9 = 522; const float K_MOUSE10 = 523; const float K_MOUSE11 = 524; const float K_MOUSE12 = 525; const float K_MOUSE13 = 526; const float K_MOUSE14 = 527; const float K_MOUSE15 = 528; const float K_MOUSE16 = 529; /////////////////////////// // cvar constants float CVAR_SAVE = 1; float CVAR_NOTIFY = 2; float CVAR_READONLY = 4; /////////////////////////// // csqc communication stuff const float ENTCS_MSG_END = 0; const float ENTCS_MSG_ONS_GPS = 1; const float ENTCS_MSG_ONS_REMOVE = 2; const float ENTCS_MSG_INIT = 3; const float TE_CSQC_INIT = 100; const float TE_CSQC_PING = 101; const float TE_CSQC_CAPTURES = 102; const float TE_CSQC_RETURNS = 103; const float TE_CSQC_DEATHS = 104; const float TE_CSQC_PICTURE = 105; const float TE_CSQC_MAPVOTE = 106; const float TE_CSQC_CONFIG = 107; const float TE_CSQC_SCORESINFO = 108; const float TE_CSQC_RACE = 109; const float TE_CSQC_FORCESCOREBOARD = 110; const float TE_CSQC_SPECTATING = 111; const float TE_CSQC_SPAWN = 112; const float TE_CSQC_ZOOMNOTIFY = 113; const float TE_CSQC_HOLDANGLES = 114; const float STAT_KH_KEYS = 32; const float STAT_CTF_STATE = 33; const float STAT_SYS_TICRATE = 34; const float STAT_WEAPONS = 35; const float STAT_SWITCHWEAPON = 36; const float CTF_STATE_ATTACK = 1; const float CTF_STATE_DEFEND = 2; const float CTF_STATE_COMMANDER = 3; // moved that here so the client knows the max. // # of maps, I'll use arrays for them :P #define MAPVOTE_COUNT 10 const float MAPVOTE_NET_INIT = 0; const float MAPVOTE_NET_UPDATE = 1; const float MAPVOTE_NET_PIC = 2; const float MAPVOTE_NET_OWNVOTE = 3; const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder const float RACE_NET_CHECKPOINT_CLEAR = 1; const float RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder const float RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent const float RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent const float RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder /** * Lower scores are better (e.g. suicides) */ #define SFL_LOWER_IS_BETTER 1 /** * Don't show zero values as scores */ #define SFL_HIDE_ZERO 2 /** * Allow a column to be hidden (do not automatically add it even if it is a sorting key) */ #define SFL_ALLOW_HIDE 16 /** * Display as a rank (with st, nd, rd, th suffix) */ #define SFL_RANK 32 /** * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!) */ #define SFL_TIME 64 // not an extra constant yet #define SFL_ZERO_IS_WORST SFL_TIME /** * Scoring priority (NOTE: PRIMARY is used for fraglimit) */ #define SFL_SORT_PRIO_SECONDARY 4 #define SFL_SORT_PRIO_PRIMARY 8 #define SFL_SORT_PRIO_MASK 12 /** * Score indices */ #define MAX_SCORE 10 #define MAX_TEAMSCORE 2 #define ST_SCORE 0 #define SP_KILLS 0 #define SP_DEATHS 1 #define SP_SUICIDES 2 #define SP_SCORE 3 // game mode specific indices are not in common/, but in server/scores_rules.qc! // Weapon indexes // %weaponaddpoint float WEP_FIRST = 1; float WEP_LASER = 1; float WEPBIT_LASER = 1; // always: 2^(w-1) float WEP_SHOTGUN = 2; float WEPBIT_SHOTGUN = 2; float WEP_UZI = 3; float WEPBIT_UZI = 4; float WEP_GRENADE_LAUNCHER = 4; float WEPBIT_GRENADE_LAUNCHER = 8; float WEP_ELECTRO = 5; float WEPBIT_ELECTRO = 16; float WEP_CRYLINK = 6; float WEPBIT_CRYLINK = 32; float WEP_NEX = 7; float WEPBIT_NEX = 64; float WEP_HAGAR = 8; float WEPBIT_HAGAR = 128; float WEP_ROCKET_LAUNCHER = 9; float WEPBIT_ROCKET_LAUNCHER = 256; float WEP_PORTO = 10; float WEPBIT_PORTO = 512; float WEP_MINSTANEX = 11; float WEPBIT_MINSTANEX = 1024; float WEP_LAST = 11; float WEPBIT_ALL = 2047; float WEP_COUNT = 12; float IT_UNLIMITED_AMMO = 1; // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup. float IT_SHELLS = 256; float IT_NAILS = 512; float IT_ROCKETS = 1024; float IT_CELLS = 2048; float IT_SUPERWEAPON = 4096; float IT_AMMO = 7936; float IT_STRENGTH = 8192; float IT_INVINCIBLE = 16384; float IT_HEALTH = 32768; // union: // for items: float IT_KEY1 = 131072; float IT_KEY2 = 262144; // for players: float IT_RED_FLAG_TAKEN = 32768; float IT_RED_FLAG_LOST = 65536; float IT_RED_FLAG_CARRING = 98304; float IT_BLUE_FLAG_TAKEN = 131072; float IT_BLUE_FLAG_LOST = 262144; float IT_BLUE_FLAG_CARRING = 393216; // end float IT_5HP = 524288; float IT_25HP = 1048576; float IT_ARMOR_SHARD = 2097152; float IT_ARMOR = 4194304;