set g_spawnshieldtime 1 "number of seconds you are invincible after you spawned, this shield is lost after you fire"
set g_antilag 2 "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past, 3 = unverified client side hit scan)"
set g_antilag_nudge 0 "don't touch"
-set g_antilag_bullets 1 "Bullets AntiLag (0 = no AntiLag, 1 = server side hit scan in the past) - DO NOT TOUCH (severely changes weapon balance)"
set g_shootfromclient 2 "let client decide if it has the gun left or right; if set to 2, center handedness is allowed; see also cl_gunalign"
set g_shootfromeye 0 "shots are fired from your eye/crosshair; visual gun position can still be influenced by cl_gunalign 1 and 2"
set g_shootfromcenter 0 "weapon gets moved to the center, shots still come from the barrel of your weapon; visual gun position can still be influenced by cl_gunalign 1 and 2"
set g_spawn_useallspawns 0 "use all spawns, e.g. also team spawns in non-teamplay, and all spawns, even enemy spawns, in teamplay"
// respawn delay
set g_respawn_delay 2 "number of seconds you have to wait before you can respawn again"
+set g_respawn_delay_max 0 "number of seconds you can wait before you're forced to respawn (only effective with g_forced_respawn 1)"
set g_respawn_waves 0 "respawn in waves (every n seconds), intended to decrease overwhelming base attacks"
// overtime
seta menu_slist_showempty 1 "show servers even if they are no empty and have no opponents to play against"
seta menu_slist_modfilter "" // set to either: !modname or modname. modname of = means "same as we are running now".
+// other serverlist cvars
+seta menu_slist_categories 1
+seta menu_slist_categories_onlyifmultiple 1
+seta menu_slist_purethreshold 0
+seta menu_slist_modimpurity 0
+seta menu_slist_recommendations 3
+seta menu_slist_recommendations_maxping 150
+seta menu_slist_recommendations_minfreeslots 1
+seta menu_slist_recommendations_minhumans 0
+seta menu_slist_recommendations_purethreshold -1
+
+// serverlist category override cvars
+seta menu_slist_categories_CAT_FAVORITED_override ""
+seta menu_slist_categories_CAT_RECOMMENDED_override ""
+seta menu_slist_categories_CAT_NORMAL_override ""
+seta menu_slist_categories_CAT_SERVERS_override "CAT_NORMAL"
+seta menu_slist_categories_CAT_XPM_override "CAT_NORMAL"
+seta menu_slist_categories_CAT_MODIFIED_override ""
+seta menu_slist_categories_CAT_OVERKILL_override ""
+seta menu_slist_categories_CAT_MINSTAGIB_override ""
+seta menu_slist_categories_CAT_DEFRAG_override ""
+
seta menu_weaponarena ""
seta menu_maxplayers 16 "maxplayers value when the menu starts a game"
alias cl_hook_gamestart_dom
alias cl_hook_gamestart_ctf
alias cl_hook_gamestart_lms
-alias cl_hook_gamestart_arena
alias cl_hook_gamestart_ca
alias cl_hook_gamestart_kh
alias cl_hook_gamestart_ons
alias sv_hook_gamestart_dom
alias sv_hook_gamestart_ctf
alias sv_hook_gamestart_lms
-alias sv_hook_gamestart_arena
alias sv_hook_gamestart_ca
alias sv_hook_gamestart_kh
alias sv_hook_gamestart_ons
seta leadlimit_override -1 "Lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
seta capturelimit_override -1 "Capture limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
seta captureleadlimit_override -1 "Capture llead imit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
-seta g_arena_point_limit -1 "Arena point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
-seta g_arena_point_leadlimit -1 "Arena point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
seta g_domination_point_limit -1 "Domination point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
seta g_domination_point_leadlimit -1 "Domination point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
seta g_keyhunt_point_limit -1 "Keyhunt point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
set g_kh_respawn_delay 0
set g_kh_respawn_waves 0
set g_kh_weapon_stay 0
-set g_arena_respawn_delay 0
-set g_arena_respawn_waves 0
-set g_arena_weapon_stay 0
set g_ca_respawn_delay 0
set g_ca_respawn_waves 0
set g_ca_weapon_stay 0
set g_ft_weapon_stay 0
-// =======
-// arena
-// =======
-set g_arena 0 "Arena: many one-on-one rounds are played to find the winner"
-set g_arena_maxspawned 2 "maximum number of players to spawn at once (the rest is spectating, waiting for their turn)"
-set g_arena_roundbased 1 "if disabled, the next player will spawn as soon as someone dies"
-set g_arena_round_timelimit 180
-set g_arena_warmup 5 "time, newly spawned players have to prepare themselves in round based matches"
-
-
// =========
// assault
// =========
set g_ca_teams 0
-
// ==================
// capture the flag
// ==================
SCM := $(shell if [ -d .svn ]; then echo svn; elif [ -d ../.git ]; then echo git; fi)
PERL ?= perl
-QCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON=1
+QCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"'
QCC ?= gmqcc
QCCVERSIONFILE := qccversion.$(shell $(QCC) --version > qccversion.txt && git hash-object qccversion.txt)
CSQCPlayer_ModelAppearance_Apply(self.entnum == player_localnum + 1);
CSQCPlayer_LOD_Apply();
if(!isplayer)
+ {
+ skeleton_loadinfo(self);
+ float doblend = (self.bone_upperbody >= 0);
CSQCPlayer_FallbackFrame_Apply();
+ if(doblend)
+ {
+ skeleton_from_frames(self, self.csqcmodel_isdead);
+ }
+ else
+ {
+ free_skeleton_from_frames(self);
+ // just in case, clear these (we're animating in frame and frame3)
+ self.lerpfrac = 0;
+ self.lerpfrac4 = 0;
+ }
+ }
else
{
// we know that frame3 and frame4 fields, used by InterpolateAnimation, are left alone - but that is all we know!
return stringwidth(s, FALSE, theSize);
}
-void drawstringright(vector position, string text, vector scale, vector rgb, float theAlpha, float flag)
+void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag)
{
- position_x -= 2 / 3 * strlen(text) * scale_x;
- drawstring(position, text, scale, rgb, theAlpha, flag);
+ position_x -= 2 / 3 * strlen(text) * theScale_x;
+ drawstring(position, text, theScale, rgb, theAlpha, flag);
}
-void drawstringcenter(vector position, string text, vector scale, vector rgb, float theAlpha, float flag)
+void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag)
{
- position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * scale_x);
- drawstring(position, text, scale, rgb, theAlpha, flag);
+ position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale_x);
+ drawstring(position, text, theScale, rgb, theAlpha, flag);
}
// return the string of the onscreen race timer
s = sprintf(_("^1Press ^3%s^1 for gamemode info"), getcommandkey("server info", "+show_info"));
drawInfoMessage(s)
- if(gametype == MAPINFO_TYPE_ARENA)
- s = _("^1Wait for your turn to join");
- else if(gametype == MAPINFO_TYPE_LMS)
+ if(gametype == MAPINFO_TYPE_LMS)
{
entity sk;
sk = playerslots[player_localnum];
_drawpic_picpath = string_null;\
} while(0)
-void drawpic_aspect_skin_expanding(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
+void drawpic_aspect_skin_expanding(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
{
float sz;
sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
- drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, scale, 1), pic, scale * sz, rgb, theAlpha * (1 - fadelerp), flag);
+ drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, theScale, 1), pic, theScale * sz, rgb, theAlpha * (1 - fadelerp), flag);
}
-void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
+void drawpic_aspect_skin_expanding_two(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
{
- drawpic_aspect_skin_expanding(position, pic, scale, rgb, theAlpha, flag, fadelerp);
- drawpic_skin(position, pic, scale, rgb, theAlpha * fadelerp, flag);
+ drawpic_aspect_skin_expanding(position, pic, theScale, rgb, theAlpha, flag, fadelerp);
+ drawpic_skin(position, pic, theScale, rgb, theAlpha * fadelerp, flag);
}
#define SET_POS_AND_SZ_Y_ASPECT(allow_colors)\
float textaspect, oldsz;\
}
vector drawfontscale;
-void drawstring_expanding(vector position, string text, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
+void drawstring_expanding(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
{
float sz;
sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
drawfontscale = sz * '1 1 0';
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
- drawstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, FALSE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag);
+ drawstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, FALSE, theScale * (sz / drawfontscale_x)) / (theScale_x * sz)), text, theScale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag);
// width parameter:
// (scale_x * sz / drawfontscale_x) * drawfontscale_x * SIZE1 / (scale_x * sz)
// SIZE1
drawstring_expanding(pos, text, '1 1 0' * sz_y, color, theAlpha, drawflag, fadelerp);
}
-void drawcolorcodedstring_expanding(vector position, string text, vector scale, float theAlpha, float flag, float fadelerp)
+void drawcolorcodedstring_expanding(vector position, string text, vector theScale, float theAlpha, float flag, float fadelerp)
{
float sz;
sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
drawfontscale = sz * '1 1 0';
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
- drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, TRUE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag);
+ drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, TRUE, theScale * (sz / drawfontscale_x)) / (theScale_x * sz)), text, theScale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag);
drawfontscale = '1 1 0';
}
switch(self.cnt)
{
- case PROJECTILE_BULLET_GLOWING:
- case PROJECTILE_BULLET_GLOWING_TRACER:
- adddynamiclight(self.origin, 50 * a, '1 1 0');
- break;
+ // Possibly add dlights here.
default:
break;
}
{
case PROJECTILE_ELECTRO: setmodel(self, "models/ebomb.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
case PROJECTILE_ROCKET: setmodel(self, "models/rocket.md3");self.traileffect = particleeffectnum("TR_ROCKET"); self.scale = 2; break;
- case PROJECTILE_BULLET: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_bullet"); break;
- case PROJECTILE_BULLET_GLOWING: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_rifle_weak"); break;
- case PROJECTILE_BULLET_GLOWING_TRACER: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_rifle"); break;
case PROJECTILE_CRYLINK: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
case PROJECTILE_CRYLINK_BOUNCING: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
case PROJECTILE_ELECTRO_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
const float PROJECTILE_ELECTRO = 1;
const float PROJECTILE_ROCKET = 2;
const float PROJECTILE_TAG = 3;
-const float PROJECTILE_BULLET = 4;
const float PROJECTILE_CRYLINK = 5;
const float PROJECTILE_ELECTRO_BEAM = 6;
const float PROJECTILE_GRENADE = 7;
const float PROJECTILE_HOOKBOMB = 16;
const float PROJECTILE_HAGAR = 17;
const float PROJECTILE_HAGAR_BOUNCING = 18;
-const float PROJECTILE_BULLET_GLOWING = 19;
const float PROJECTILE_CRYLINK_BOUNCING = 20;
const float PROJECTILE_FIREBALL = 21;
const float PROJECTILE_FIREMINE = 22;
-const float PROJECTILE_BULLET_GLOWING_TRACER = 23;
const float PROJECTILE_RAPTORCANNON = 24;
const float PROJECTILE_RAPTORBOMB = 25;
CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, glowmod_x, 255, 0, 255) \
CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, glowmod_y, 255, 0, 255) \
CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, glowmod_z, 255, 0, 255) \
+ CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, colormod_x, 255, 0, 255) \
+ CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, colormod_y, 255, 0, 255) \
+ CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, colormod_z, 255, 0, 255) \
CSQCMODEL_ENDIF \
CSQCMODEL_IF(isplayer) \
CSQCMODEL_PROPERTY(128, float, ReadByte, WriteByte, anim_state) \
CSQCMODEL_ENDIF \
CSQCMODEL_PROPERTY(512, float, ReadChar, WriteChar, anim_upper_action) \
CSQCMODEL_PROPERTY(512, float, ReadApproxPastTime, WriteApproxPastTime, anim_upper_time) \
- CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
- CSQCMODEL_ENDIF
+ CSQCMODEL_ENDIF \
+ CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
+ CSQCMODEL_PROPERTY_SCALED(4096, float, ReadByte, WriteByte, scale, 16, 0, 255)
// TODO get rid of colormod/glowmod here, find good solution for nex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
// add hook function calls here
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_FREEZETAG;
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CA;
}
- if( diameter < 4096)
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_ARENA;
if(spawnpoints >= 12 && diameter > 5120)
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_KEYHUNT;
}
case MAPINFO_TYPE_DOMINATION: return "200 20 0";
case MAPINFO_TYPE_CTF: return "300 20 10 0";
case MAPINFO_TYPE_LMS: return "9 20 0";
- case MAPINFO_TYPE_ARENA: return "10 20 0";
case MAPINFO_TYPE_CA: return "10 20 0";
case MAPINFO_TYPE_KEYHUNT: return "1000 20 3 0";
case MAPINFO_TYPE_ASSAULT: return "20 0";
REGISTER_GAMETYPE(_("Last Man Standing"),lms,g_lms,LMS,"timelimit=20 lives=9 leadlimit=0");
#define g_lms IS_GAMETYPE(LMS)
-REGISTER_GAMETYPE(_("Arena"),arena,g_arena,ARENA,"timelimit=20 pointlimit=10 leadlimit=0");
-#define g_arena IS_GAMETYPE(ARENA)
-
REGISTER_GAMETYPE(_("Race"),rc,g_race,RACE,"timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0");
#define g_race IS_GAMETYPE(RACE)
// used for simplifying ACCUMULATE_FUNCTIONs
#define SET_FIRST_OR_LAST(input,first,count) if(!input) { input = (first + count); }
#define SET_FIELD_COUNT(field,first,count) if(!field) { field = (first + count); ++count; }
-#define CHECK_MAX_COUNT(name,max,count,type) if(count == max) { error(strcat("Maximum ", type, " hit: ", #name, ": ", ftos(count), ".\n")); }
+#define CHECK_MAX_COUNT(name,max,count,type) if(count > max) { error(strcat("Maximum ", type, " hit: ", #name, ": ", ftos(count), ".\n")); }
// this returns a tempstring containing a copy of s with additional \n newlines added, it also replaces \n in the text with a real newline
// NOTE: s IS allowed to be a tempstring
void CSQCModel_Read(float isnew)
{
float sf;
- sf = ReadShort();
+ sf = ReadInt24_t();
// some nice flags for CSQCMODEL_IF and the hooks
local noref float isplayer = (self.entnum >= 1 && self.entnum <= maxclients);
#undef CSQCMODEL_IF
if(sf & CSQCMODEL_PROPERTY_MODELINDEX)
+ {
+ vector pmin = self.mins, pmax = self.maxs;
setmodelindex(self, self.modelindex); // this retrieves the .model key and sets mins/maxs/absmin/absmax
- // FIXME do we WANT this to override mins/maxs?
+ setsize(self, pmin, pmax);
+ }
if(sf & CSQCMODEL_PROPERTY_TELEPORTED)
{
.float frame2time;
.float lerpfrac;
-#define CSQCMODEL_PROPERTY_FRAME 32768
-#define CSQCMODEL_PROPERTY_TELEPORTED 16384 // the "teleport bit" cancelling interpolation
-#define CSQCMODEL_PROPERTY_MODELINDEX 8192
-#define CSQCMODEL_PROPERTY_ORIGIN 4096
-#define CSQCMODEL_PROPERTY_YAW 2048
-#define CSQCMODEL_PROPERTY_PITCHROLL 1024
-#define CSQCMODEL_PROPERTY_FRAME2 512
-#define CSQCMODEL_PROPERTY_LERPFRAC 256
+#define CSQCMODEL_PROPERTY_FRAME 8388608
+#define CSQCMODEL_PROPERTY_TELEPORTED 4194304 // the "teleport bit" cancelling interpolation
+#define CSQCMODEL_PROPERTY_MODELINDEX 2097152
+#define CSQCMODEL_PROPERTY_ORIGIN 1048576
+#define CSQCMODEL_PROPERTY_YAW 524288
+#define CSQCMODEL_PROPERTY_PITCHROLL 262144
+#define CSQCMODEL_PROPERTY_FRAME2 131072
+#define CSQCMODEL_PROPERTY_LERPFRAC 65536
+#define CSQCMODEL_PROPERTY_SIZE 32768
#define ALLPROPERTIES_COMMON \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME, float, ReadByte, WriteByte, frame) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_x) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_y) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_z) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, mins_x) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, mins_y) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, mins_z) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, maxs_x) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, maxs_y) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, maxs_z) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_PITCHROLL, float, ReadAngle, WriteAngle, angles_x) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_YAW, float, ReadAngle, WriteAngle, angles_y) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_PITCHROLL, float, ReadAngle, WriteAngle, angles_z) \
unused_float = isnolocalplayer;
WriteByte(MSG_ENTITY, ENT_CLIENT_MODEL);
- WriteShort(MSG_ENTITY, sf);
+ WriteInt24_t(MSG_ENTITY, sf);
#define CSQCMODEL_IF(cond) if(cond) {
#define CSQCMODEL_ENDIF }
}
#define CSQCMODEL_PROPERTY_SCALED(flag,t,r,w,f,s,mi,ma) \
{ \
- t tmp = bound(mi, s * self.f, ma) - mi; \
+ t tmp = rint(bound(mi, s * self.f, ma) - mi); \
if(tmp != self.csqcmodel_##f) \
{ \
self.csqcmodel_##f = tmp; \
void(float width, float height) m_draw;
void(float mode) m_toggle;
void() m_shutdown;
+// optional: float(float) m_gethostcachecategory;
/////////////////////////////////////////////////////////
// sys constants
void sethostcachemaskstring(float mask, float fld, string str, float op) = #616;
void sethostcachemasknumber(float mask, float fld, float num, float op) = #617;
void resorthostcache(void) = #618;
-void sethostcachesort(float fld, float descending) = #619;
-void refreshhostcache(void) = #620;
+float SLSF_DESCENDING = 1;
+float SLSF_FAVORITES = 2;
+float SLSF_CATEGORIES = 4;
+void sethostcachesort(float fld, float slsf) = #619;
+void refreshhostcache(...) = #620; // optional boolean argument "clear_list"
float gethostcachenumber(float fld, float hostnr) = #621;
float gethostcacheindexforkey(string key) = #622;
void addwantedhostcachekey(string key) = #623;
CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
+ RegisterSLCategories();
+
float ddsload = cvar("r_texture_dds_load");
float texcomp = cvar("gl_texturecompression");
updateCompression();
me.TR(me);
me.TD(me, 1, 0.4, e = makeXonoticTextLabel(0, _("Filter:")));
- me.TD(me, 1, me.columns - 0.6 * 3 - 0.4, e = makeXonoticInputBox(0, string_null));
+ me.TD(me, 1, me.columns - 0.6 * 3 - 0.9 - 0.4, e = makeXonoticInputBox(0, string_null));
e.onChange = ServerList_Filter_Change;
e.onChangeEntity = slist;
slist.controlledTextbox = e;
+ me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories"))));
+ e.onClickEntity = slist;
+ e.onClick = ServerList_Categories_Click;
me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showempty", ZCTX(_("SRVS^Empty"))));
slist.filterShowEmpty = e.checked;
e.onClickEntity = slist;
METHOD(XonoticServerList, clickListBoxItem, void(entity, float, vector))
METHOD(XonoticServerList, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(XonoticServerList, keyDown, float(entity, float, float, float))
+ METHOD(XonoticServerList, toggleFavorite, void(entity, string))
ATTRIB(XonoticServerList, iconsSizeFactor, float, 0.85)
ATTRIB(XonoticServerList, ipAddressBox, entity, NULL)
ATTRIB(XonoticServerList, favoriteButton, entity, NULL)
ATTRIB(XonoticServerList, nextRefreshTime, float, 0)
- METHOD(XonoticServerList, refreshServerList, void(entity, float)) // refresh mode: 0 = just reparametrize, 1 = send new requests, 2 = clear
+ METHOD(XonoticServerList, refreshServerList, void(entity, float)) // refresh mode: REFRESHSERVERLIST_*
ATTRIB(XonoticServerList, needsRefresh, float, 1)
METHOD(XonoticServerList, focusEnter, void(entity))
METHOD(XonoticServerList, positionSortButton, void(entity, entity, float, float, string, void(entity, entity)))
ATTRIB(XonoticServerList, seenIPv4, float, 0)
ATTRIB(XonoticServerList, seenIPv6, float, 0)
+ ATTRIB(XonoticServerList, categoriesHeight, float, 1.25)
+
+ METHOD(XonoticServerList, getTotalHeight, float(entity))
+ METHOD(XonoticServerList, getItemAtPos, float(entity, float))
+ METHOD(XonoticServerList, getItemStart, float(entity, float))
+ METHOD(XonoticServerList, getItemHeight, float(entity, float))
ENDCLASS(XonoticServerList)
entity makeXonoticServerList();
+#ifndef IMPLEMENTATION
+float autocvar_menu_slist_categories;
+float autocvar_menu_slist_categories_onlyifmultiple;
+float autocvar_menu_slist_purethreshold;
+float autocvar_menu_slist_modimpurity;
+float autocvar_menu_slist_recommendations;
+float autocvar_menu_slist_recommendations_maxping;
+float autocvar_menu_slist_recommendations_minfreeslots;
+float autocvar_menu_slist_recommendations_minhumans;
+float autocvar_menu_slist_recommendations_purethreshold;
+
+// server cache fields
+#define SLIST_FIELDS \
+ SLIST_FIELD(CNAME, "cname") \
+ SLIST_FIELD(PING, "ping") \
+ SLIST_FIELD(GAME, "game") \
+ SLIST_FIELD(MOD, "mod") \
+ SLIST_FIELD(MAP, "map") \
+ SLIST_FIELD(NAME, "name") \
+ SLIST_FIELD(MAXPLAYERS, "maxplayers") \
+ SLIST_FIELD(NUMPLAYERS, "numplayers") \
+ SLIST_FIELD(NUMHUMANS, "numhumans") \
+ SLIST_FIELD(NUMBOTS, "numbots") \
+ SLIST_FIELD(PROTOCOL, "protocol") \
+ SLIST_FIELD(FREESLOTS, "freeslots") \
+ SLIST_FIELD(PLAYERS, "players") \
+ SLIST_FIELD(QCSTATUS, "qcstatus") \
+ SLIST_FIELD(CATEGORY, "category") \
+ SLIST_FIELD(ISFAVORITE, "isfavorite")
+
+#define SLIST_FIELD(suffix,name) float SLIST_FIELD_##suffix;
+SLIST_FIELDS
+#undef SLIST_FIELD
+
+const float REFRESHSERVERLIST_RESORT = 0; // sort the server list again to update for changes to e.g. favorite status, categories
+const float REFRESHSERVERLIST_REFILTER = 1; // ..., also update filter and sort criteria
+const float REFRESHSERVERLIST_ASK = 2; // ..., also suggest querying servers now
+const float REFRESHSERVERLIST_RESET = 3; // ..., also clear the list first
+
+// function declarations
+float IsServerInList(string list, string srv);
+#define IsFavorite(srv) IsServerInList(cvar_string("net_slist_favorites"), srv)
+#define IsPromoted(srv) IsServerInList(_Nex_ExtResponseSystem_PromotedServers, srv)
+#define IsRecommended(srv) IsServerInList(_Nex_ExtResponseSystem_RecommendedServers, srv)
+
+entity RetrieveCategoryEnt(float catnum);
+
+float CheckCategoryOverride(float cat);
+float CheckCategoryForEntry(float entry);
+float m_gethostcachecategory(float entry) { return CheckCategoryOverride(CheckCategoryForEntry(entry)); }
+
+void RegisterSLCategories();
+
void ServerList_Connect_Click(entity btn, entity me);
+void ServerList_Categories_Click(entity box, entity me);
void ServerList_ShowEmpty_Click(entity box, entity me);
void ServerList_ShowFull_Click(entity box, entity me);
void ServerList_Filter_Change(entity box, entity me);
void ServerList_Info_Click(entity btn, entity me);
void ServerList_Update_favoriteButton(entity btn, entity me);
-#ifndef IMPLEMENTATION
-float SLIST_FIELD_CNAME;
-float SLIST_FIELD_PING;
-float SLIST_FIELD_GAME;
-float SLIST_FIELD_MOD;
-float SLIST_FIELD_MAP;
-float SLIST_FIELD_NAME;
-float SLIST_FIELD_MAXPLAYERS;
-float SLIST_FIELD_NUMPLAYERS;
-float SLIST_FIELD_NUMHUMANS;
-float SLIST_FIELD_NUMBOTS;
-float SLIST_FIELD_PROTOCOL;
-float SLIST_FIELD_FREESLOTS;
-float SLIST_FIELD_PLAYERS;
-float SLIST_FIELD_QCSTATUS;
-float SLIST_FIELD_ISFAVORITE;
-#endif
+// fields for category entities
+#define MAX_CATEGORIES 9
+#define CATEGORY_FIRST 1
+entity categories[MAX_CATEGORIES];
+float category_ent_count;
+.string cat_name;
+.string cat_string;
+.string cat_enoverride_string;
+.string cat_dioverride_string;
+.float cat_enoverride;
+.float cat_dioverride;
+
+// fields for drawing categories
+float category_name[MAX_CATEGORIES];
+float category_item[MAX_CATEGORIES];
+float category_draw_count;
+
+#define SLIST_CATEGORIES \
+ SLIST_CATEGORY(CAT_FAVORITED, "", "", ZCTX(_("SLCAT^Favorites"))) \
+ SLIST_CATEGORY(CAT_RECOMMENDED, "", "", ZCTX(_("SLCAT^Recommended"))) \
+ SLIST_CATEGORY(CAT_NORMAL, "", "CAT_SERVERS", ZCTX(_("SLCAT^Normal Servers"))) \
+ SLIST_CATEGORY(CAT_SERVERS, "CAT_NORMAL", "CAT_SERVERS", ZCTX(_("SLCAT^Servers"))) \
+ SLIST_CATEGORY(CAT_XPM, "CAT_NORMAL", "CAT_SERVERS", ZCTX(_("SLCAT^Competitive Mode"))) \
+ SLIST_CATEGORY(CAT_MODIFIED, "", "CAT_SERVERS", ZCTX(_("SLCAT^Modified Servers"))) \
+ SLIST_CATEGORY(CAT_OVERKILL, "", "CAT_SERVERS", ZCTX(_("SLCAT^Overkill Mode"))) \
+ SLIST_CATEGORY(CAT_MINSTAGIB, "", "CAT_SERVERS", ZCTX(_("SLCAT^MinstaGib Mode"))) \
+ SLIST_CATEGORY(CAT_DEFRAG, "", "CAT_SERVERS", ZCTX(_("SLCAT^Defrag Mode")))
+
+#define SLIST_CATEGORY_AUTOCVAR(name) autocvar_menu_slist_categories_##name##_override
+#define SLIST_CATEGORY(name,enoverride,dioverride,str) \
+ float name; \
+ var string SLIST_CATEGORY_AUTOCVAR(name) = enoverride;
+SLIST_CATEGORIES
+#undef SLIST_CATEGORY
#endif
-
+#endif
#ifdef IMPLEMENTATION
-void ServerList_UpdateFieldIDs()
+
+void RegisterSLCategories()
{
- SLIST_FIELD_CNAME = gethostcacheindexforkey( "cname" );
- SLIST_FIELD_PING = gethostcacheindexforkey( "ping" );
- SLIST_FIELD_GAME = gethostcacheindexforkey( "game" );
- SLIST_FIELD_MOD = gethostcacheindexforkey( "mod" );
- SLIST_FIELD_MAP = gethostcacheindexforkey( "map" );
- SLIST_FIELD_NAME = gethostcacheindexforkey( "name" );
- SLIST_FIELD_MAXPLAYERS = gethostcacheindexforkey( "maxplayers" );
- SLIST_FIELD_NUMPLAYERS = gethostcacheindexforkey( "numplayers" );
- SLIST_FIELD_NUMHUMANS = gethostcacheindexforkey( "numhumans" );
- SLIST_FIELD_NUMBOTS = gethostcacheindexforkey( "numbots" );
- SLIST_FIELD_PROTOCOL = gethostcacheindexforkey( "protocol" );
- SLIST_FIELD_FREESLOTS = gethostcacheindexforkey( "freeslots" );
- SLIST_FIELD_PLAYERS = gethostcacheindexforkey( "players" );
- SLIST_FIELD_QCSTATUS = gethostcacheindexforkey( "qcstatus" );
- SLIST_FIELD_ISFAVORITE = gethostcacheindexforkey( "isfavorite" );
-}
-
-float IsFavorite(string srv)
+ entity cat;
+ #define SLIST_CATEGORY(name,enoverride,dioverride,str) \
+ SET_FIELD_COUNT(name, CATEGORY_FIRST, category_ent_count) \
+ CHECK_MAX_COUNT(name, MAX_CATEGORIES, category_ent_count, "SLIST_CATEGORY") \
+ cat = spawn(); \
+ categories[name - 1] = cat; \
+ cat.classname = "slist_category"; \
+ cat.cat_name = strzone(#name); \
+ cat.cat_enoverride_string = strzone(SLIST_CATEGORY_AUTOCVAR(name)); \
+ cat.cat_dioverride_string = strzone(dioverride); \
+ cat.cat_string = strzone(str);
+ SLIST_CATEGORIES
+ #undef SLIST_CATEGORY
+
+ float i, x, catnum;
+ string s;
+
+ #define PROCESS_OVERRIDE(override_string,override_field) \
+ for(i = 0; i < category_ent_count; ++i) \
+ { \
+ s = categories[i].override_string; \
+ if((s != "") && (s != categories[i].cat_name)) \
+ { \
+ catnum = 0; \
+ for(x = 0; x < category_ent_count; ++x) \
+ { if(categories[x].cat_name == s) { \
+ catnum = (x+1); \
+ break; \
+ } } \
+ if(catnum) \
+ { \
+ strunzone(categories[i].override_string); \
+ categories[i].override_field = catnum; \
+ continue; \
+ } \
+ else \
+ { \
+ print(sprintf( \
+ "RegisterSLCategories(): Improper override '%s' for category '%s'!\n", \
+ s, \
+ categories[i].cat_name \
+ )); \
+ } \
+ } \
+ strunzone(categories[i].override_string); \
+ categories[i].override_field = 0; \
+ }
+ PROCESS_OVERRIDE(cat_enoverride_string, cat_enoverride)
+ PROCESS_OVERRIDE(cat_dioverride_string, cat_dioverride)
+ #undef PROCESS_OVERRIDE
+}
+
+// Supporting Functions
+entity RetrieveCategoryEnt(float catnum)
+{
+ if((catnum > 0) && (catnum <= category_ent_count))
+ {
+ return categories[catnum - 1];
+ }
+ else
+ {
+ error(sprintf("RetrieveCategoryEnt(%d): Improper category number!\n", catnum));
+ return world;
+ }
+}
+
+float IsServerInList(string list, string srv)
{
string p;
float i, n;
if(srv == "")
return FALSE;
p = crypto_getidfp(srv);
- n = tokenize_console(cvar_string("net_slist_favorites"));
+ n = tokenize_console(list);
for(i = 0; i < n; ++i)
{
if(substring(argv(i), 0, 1) != "[" && strlen(argv(i)) == 44 && strstrofs(argv(i), ".", 0) < 0)
return FALSE;
}
-void ToggleFavorite(string srv)
+float CheckCategoryOverride(float cat)
+{
+ entity catent = RetrieveCategoryEnt(cat);
+ if(catent)
+ {
+ float override = (autocvar_menu_slist_categories ? catent.cat_enoverride : catent.cat_dioverride);
+ if(override) { return override; }
+ else { return cat; }
+ }
+ else
+ {
+ error(sprintf("CheckCategoryOverride(%d): Improper category number!\n", cat));
+ return cat;
+ }
+}
+
+float CheckCategoryForEntry(float entry)
+{
+ string s, k, v, modtype = "";
+ float j, m, impure = 0, freeslots = 0, sflags = 0;
+ s = gethostcachestring(SLIST_FIELD_QCSTATUS, entry);
+ m = tokenizebyseparator(s, ":");
+
+ for(j = 2; j < m; ++j)
+ {
+ if(argv(j) == "") { break; }
+ k = substring(argv(j), 0, 1);
+ v = substring(argv(j), 1, -1);
+ switch(k)
+ {
+ case "P": { impure = stof(v); break; }
+ case "S": { freeslots = stof(v); break; }
+ case "F": { sflags = stof(v); break; }
+ case "M": { modtype = strtolower(v); break; }
+ }
+ }
+
+ if(modtype != "xonotic") { impure += autocvar_menu_slist_modimpurity; }
+
+ // check if this server is favorited
+ if(gethostcachenumber(SLIST_FIELD_ISFAVORITE, entry)) { return CAT_FAVORITED; }
+
+ // now check if it's recommended
+ if(autocvar_menu_slist_recommendations)
+ {
+ string cname = gethostcachestring(SLIST_FIELD_CNAME, entry);
+
+ if(IsPromoted(cname)) { return CAT_RECOMMENDED; }
+ else
+ {
+ float recommended = 0;
+ if(autocvar_menu_slist_recommendations & 1)
+ {
+ if(IsRecommended(cname)) { ++recommended; }
+ else { --recommended; }
+ }
+ if(autocvar_menu_slist_recommendations & 2)
+ {
+ if(
+ ///// check for minimum free slots
+ (freeslots >= autocvar_menu_slist_recommendations_minfreeslots)
+
+ && // check for purity requirement
+ (
+ (autocvar_menu_slist_recommendations_purethreshold < 0)
+ ||
+ (impure <= autocvar_menu_slist_recommendations_purethreshold)
+ )
+
+ && // check for minimum amount of humans
+ (
+ gethostcachenumber(SLIST_FIELD_NUMHUMANS, entry)
+ >=
+ autocvar_menu_slist_recommendations_minhumans
+ )
+
+ && // check for maximum latency
+ (
+ gethostcachenumber(SLIST_FIELD_PING, entry)
+ <=
+ autocvar_menu_slist_recommendations_maxping
+ )
+ )
+ { ++recommended; }
+ else
+ { --recommended; }
+ }
+ if(recommended > 0) { return CAT_RECOMMENDED; }
+ }
+ }
+
+ // if not favorited or recommended, check modname
+ if(modtype != "xonotic")
+ {
+ switch(modtype)
+ {
+ // old servers which don't report their mod name are considered modified now
+ case "": { return CAT_MODIFIED; }
+
+ case "xpm": { return CAT_XPM; }
+ case "minstagib": { return CAT_MINSTAGIB; }
+ case "overkill": { return CAT_OVERKILL; }
+ //case "nix": { return CAT_NIX; }
+ //case "newtoys": { return CAT_NEWTOYS; }
+
+ // "cts" is allowed as compat, xdf is replacement
+ case "cts":
+ case "xdf": { return CAT_DEFRAG; }
+
+ default: { dprint(sprintf("Found strange mod type: %s\n", modtype)); return CAT_MODIFIED; }
+ }
+ }
+
+ // must be normal or impure server
+ return ((impure > autocvar_menu_slist_purethreshold) ? CAT_MODIFIED : CAT_NORMAL);
+}
+
+void XonoticServerList_toggleFavorite(entity me, string srv)
{
string s, s0, s1, s2, srv_resolved, p;
float i, n, f;
cvar_set("net_slist_favorites", strcat(s, s1, srv));
}
- resorthostcache();
+ me.refreshServerList(me, REFRESHSERVERLIST_RESORT);
}
void ServerList_Update_favoriteButton(entity btn, entity me)
{
- if(IsFavorite(me.ipAddressBox.text))
- me.favoriteButton.setText(me.favoriteButton, _("Remove"));
- else
- me.favoriteButton.setText(me.favoriteButton, _("Bookmark"));
+ me.favoriteButton.setText(me.favoriteButton,
+ (IsFavorite(me.ipAddressBox.text) ?
+ _("Remove") : _("Favorite")
+ )
+ );
}
entity makeXonoticServerList()
{
me.configureXonoticListBox(me);
- ServerList_UpdateFieldIDs();
+ // update field ID's
+ #define SLIST_FIELD(suffix,name) SLIST_FIELD_##suffix = gethostcacheindexforkey(name);
+ SLIST_FIELDS
+ #undef SLIST_FIELD
+ // clear list
me.nItems = 0;
}
void XonoticServerList_setSelected(entity me, float i)
}
void XonoticServerList_refreshServerList(entity me, float mode)
{
- // 0: just reparametrize
- // 1: also ask for new servers
- // 2: clear
//print("refresh of type ", ftos(mode), "\n");
- /* if(mode == 2) // borken
- {
- // clear list
- localcmd("net_slist\n");
- me.needsRefresh = 1; // net_slist kills sort order, so we need to restore it later
- }
- else */
+
+ if(mode >= REFRESHSERVERLIST_REFILTER)
{
- float m, o, i, n; // moin moin
+ float m, i, n;
+ float listflags = 0;
string s, typestr, modstr;
+
s = me.filterString;
m = strstrofs(s, ":", 0);
sethostcachemaskstring(++m, SLIST_FIELD_PLAYERS, s, SLIST_TEST_CONTAINS);
sethostcachemaskstring(++m, SLIST_FIELD_QCSTATUS, strcat(s, ":"), SLIST_TEST_STARTSWITH);
}
- o = 2; // favorites first
- if(me.currentSortOrder < 0)
- o |= 1; // descending
- sethostcachesort(me.currentSortField, o);
- resorthostcache();
- if(mode >= 1)
- refreshhostcache();
+
+ // sorting flags
+ //listflags |= SLSF_FAVORITES;
+ listflags |= SLSF_CATEGORIES;
+ if(me.currentSortOrder < 0) { listflags |= SLSF_DESCENDING; }
+ sethostcachesort(me.currentSortField, listflags);
}
+
+ resorthostcache();
+ if(mode >= REFRESHSERVERLIST_ASK)
+ refreshhostcache(mode >= REFRESHSERVERLIST_RESET);
}
void XonoticServerList_focusEnter(entity me)
{
return;
}
me.nextRefreshTime = time + 10;
- me.refreshServerList(me, 1);
+ me.refreshServerList(me, REFRESHSERVERLIST_ASK);
}
+
void XonoticServerList_draw(entity me)
{
float i, found, owned;
_Nex_ExtResponseSystem_BannedServersNeedsRefresh = 0;
}
+ if(_Nex_ExtResponseSystem_PromotedServersNeedsRefresh)
+ {
+ if(!me.needsRefresh)
+ me.needsRefresh = 3;
+ _Nex_ExtResponseSystem_PromotedServersNeedsRefresh = 0;
+ }
+
+ if(_Nex_ExtResponseSystem_RecommendedServersNeedsRefresh)
+ {
+ if(!me.needsRefresh)
+ me.needsRefresh = 3;
+ _Nex_ExtResponseSystem_RecommendedServersNeedsRefresh = 0;
+ }
+
if(me.currentSortField == -1)
{
me.setSortOrder(me, SLIST_FIELD_PING, +1);
- me.refreshServerList(me, 2);
+ me.refreshServerList(me, REFRESHSERVERLIST_RESET);
}
else if(me.needsRefresh == 1)
{
else if(me.needsRefresh == 2)
{
me.needsRefresh = 0;
- me.refreshServerList(me, 0);
+ me.refreshServerList(me, REFRESHSERVERLIST_REFILTER);
+ }
+ else if(me.needsRefresh == 3)
+ {
+ me.needsRefresh = 0;
+ me.refreshServerList(me, REFRESHSERVERLIST_RESORT);
}
owned = ((me.selectedServer == me.ipAddressBox.text) && (me.ipAddressBox.text != ""));
- me.nItems = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT);
+ for(i = 0; i < category_draw_count; ++i) { category_name[i] = -1; category_item[i] = -1; }
+ category_draw_count = 0;
+
+ if(autocvar_menu_slist_categories >= 0) // if less than 0, don't even draw a category heading for favorites
+ {
+ float itemcount = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT);
+ me.nItems = itemcount;
+
+ //float visible = floor(me.scrollPos / me.itemHeight);
+ // ^ unfortunately no such optimization can be made-- we must process through the
+ // entire list, otherwise there is no way to know which item is first in its category.
+
+ // binary search method suggested by div
+ float x;
+ float begin = 0;
+ for(x = 1; x <= category_ent_count; ++x) {
+ float first = begin;
+ float last = (itemcount - 1);
+ if (first > last) {
+ // List is empty.
+ break;
+ }
+ float catf = gethostcachenumber(SLIST_FIELD_CATEGORY, first);
+ float catl = gethostcachenumber(SLIST_FIELD_CATEGORY, last);
+ if (catf > x) {
+ // The first one is already > x.
+ // Therefore, category x does not exist.
+ // Higher numbered categories do exist though.
+ } else if (catl < x) {
+ // The last one is < x.
+ // Thus this category - and any following -
+ // don't exist.
+ break;
+ } else if (catf == x) {
+ // Starts at first. This breaks the loop
+ // invariant in the binary search and thus has
+ // to be handled separately.
+ if(gethostcachenumber(SLIST_FIELD_CATEGORY, first) != x)
+ error("Category mismatch I");
+ if(first > 0)
+ if(gethostcachenumber(SLIST_FIELD_CATEGORY, first - 1) == x)
+ error("Category mismatch II");
+ category_name[category_draw_count] = x;
+ category_item[category_draw_count] = first;
+ ++category_draw_count;
+ begin = first + 1;
+ } else {
+ // At this point, catf <= x < catl, thus
+ // catf < catl, thus first < last.
+ // INVARIANTS:
+ // last - first >= 1
+ // catf == gethostcachenumber(SLIST_FIELD_CATEGORY(first)
+ // catl == gethostcachenumber(SLIST_FIELD_CATEGORY(last)
+ // catf < x
+ // catl >= x
+ while (last - first > 1) {
+ float middle = floor((first + last) / 2);
+ // By loop condition, middle != first && middle != last.
+ float cat = gethostcachenumber(SLIST_FIELD_CATEGORY, middle);
+ if (cat >= x) {
+ last = middle;
+ catl = cat;
+ } else {
+ first = middle;
+ catf = cat;
+ }
+ }
+ if (catl == x) {
+ if(gethostcachenumber(SLIST_FIELD_CATEGORY, last) != x)
+ error("Category mismatch III");
+ if(last > 0)
+ if(gethostcachenumber(SLIST_FIELD_CATEGORY, last - 1) == x)
+ error("Category mismatch IV");
+ category_name[category_draw_count] = x;
+ category_item[category_draw_count] = last;
+ ++category_draw_count;
+ begin = last + 1; // already scanned through these, skip 'em
+ }
+ else
+ begin = last; // already scanned through these, skip 'em
+ }
+ }
+ if(autocvar_menu_slist_categories_onlyifmultiple && (category_draw_count == 1))
+ {
+ category_name[0] = -1;
+ category_item[0] = -1;
+ category_draw_count = 0;
+ me.nItems = itemcount;
+ }
+ }
+ else { me.nItems = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT); }
me.connectButton.disabled = ((me.nItems == 0) && (me.ipAddressBox.text == ""));
me.infoButton.disabled = ((me.nItems == 0) || !owned);
if(me.selectedServer)
{
for(i = 0; i < me.nItems; ++i)
+ {
if(gethostcachestring(SLIST_FIELD_CNAME, i) == me.selectedServer)
{
if(i != me.selectedItem)
found = 1;
break;
}
+ }
}
if(!found)
+ {
if(me.nItems > 0)
{
if(me.selectedItem >= me.nItems)
strunzone(me.selectedServer);
me.selectedServer = strzone(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
}
-
+ }
+
if(owned)
{
if(me.selectedServer != me.ipAddressBox.text)
me.filterString = strzone(box.text);
else
me.filterString = string_null;
- me.refreshServerList(me, 0);
+ me.refreshServerList(me, REFRESHSERVERLIST_REFILTER);
+
+ me.ipAddressBox.setText(me.ipAddressBox, "");
+ me.ipAddressBox.cursorPos = 0;
+ me.ipAddressBoxFocused = -1;
+}
+void ServerList_Categories_Click(entity box, entity me)
+{
+ box.setChecked(box, autocvar_menu_slist_categories = !autocvar_menu_slist_categories);
+ me.refreshServerList(me, REFRESHSERVERLIST_RESORT);
me.ipAddressBox.setText(me.ipAddressBox, "");
me.ipAddressBox.cursorPos = 0;
void ServerList_ShowEmpty_Click(entity box, entity me)
{
box.setChecked(box, me.filterShowEmpty = !me.filterShowEmpty);
- me.refreshServerList(me, 0);
+ me.refreshServerList(me, REFRESHSERVERLIST_REFILTER);
me.ipAddressBox.setText(me.ipAddressBox, "");
me.ipAddressBox.cursorPos = 0;
void ServerList_ShowFull_Click(entity box, entity me)
{
box.setChecked(box, me.filterShowFull = !me.filterShowFull);
- me.refreshServerList(me, 0);
+ me.refreshServerList(me, REFRESHSERVERLIST_REFILTER);
me.ipAddressBox.setText(me.ipAddressBox, "");
me.ipAddressBox.cursorPos = 0;
if(me.selectedServer)
strunzone(me.selectedServer);
me.selectedServer = string_null;
- me.refreshServerList(me, 0);
+ me.refreshServerList(me, REFRESHSERVERLIST_REFILTER);
}
void XonoticServerList_positionSortButton(entity me, entity btn, float theOrigin, float theSize, string theTitle, void(entity, entity) theFunc)
{
}
void ServerList_Connect_Click(entity btn, entity me)
{
- if(me.ipAddressBox.text == "")
- localcmd("connect ", me.selectedServer, "\n");
- else
- localcmd("connect ", me.ipAddressBox.text, "\n");
+ localcmd(sprintf("connect %s\n",
+ ((me.ipAddressBox.text != "") ?
+ me.ipAddressBox.text : me.selectedServer
+ )
+ ));
}
void ServerList_Favorite_Click(entity btn, entity me)
{
ipstr = netaddress_resolve(me.ipAddressBox.text, 26000);
if(ipstr != "")
{
- ToggleFavorite(me.ipAddressBox.text);
+ me.toggleFavorite(me, me.ipAddressBox.text);
me.ipAddressBoxFocused = -1;
}
}
void ServerList_Info_Click(entity btn, entity me)
{
- main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
+ if (me.nItems != 0)
+ main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
DialogOpenButton_Click(me, main.serverInfoDialog);
}
void XonoticServerList_clickListBoxItem(entity me, float i, vector where)
float m, pure, freeslots, j, sflags;
string s, typestr, versionstr, k, v, modname;
+ //print(sprintf("time: %f, i: %d, item: %d, nitems: %d\n", time, i, item, me.nItems));
+
+ vector oldscale = draw_scale;
+ vector oldshift = draw_shift;
+#define SET_YRANGE(start,end) \
+ draw_scale = boxToGlobalSize(eX * 1 + eY * (end - start), oldscale); \
+ draw_shift = boxToGlobal(eY * start, oldshift, oldscale);
+
+ for (j = 0; j < category_draw_count; ++j) {
+ // Matches exactly the headings with increased height.
+ if (i == category_item[j])
+ break;
+ }
+
+ if (j < category_draw_count)
+ {
+ entity catent = RetrieveCategoryEnt(category_name[j]);
+ if(catent)
+ {
+ SET_YRANGE(
+ (me.categoriesHeight - 1) / (me.categoriesHeight + 1),
+ me.categoriesHeight / (me.categoriesHeight + 1)
+ );
+ draw_Text(
+ eY * me.realUpperMargin
+ +
+#if 0
+ eX * (me.columnNameOrigin + (me.columnNameSize - draw_TextWidth(catent.cat_string, 0, me.realFontSize)) * 0.5),
+ catent.cat_string,
+#else
+ eX * (me.columnNameOrigin),
+ strcat(catent.cat_string, ":"),
+#endif
+ me.realFontSize,
+ '1 1 1',
+ SKINALPHA_TEXT,
+ 0
+ );
+ SET_YRANGE(me.categoriesHeight / (me.categoriesHeight + 1), 1);
+ }
+ }
+
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
// 4: AES recommended and will be used
// 5: AES required
- {
- vector iconSize = '0 0 0';
- iconSize_y = me.realFontSize_y * me.iconsSizeFactor;
- iconSize_x = me.realFontSize_x * me.iconsSizeFactor;
-
- vector iconPos = '0 0 0';
- iconPos_x = (me.columnIconsSize - 3 * iconSize_x) * 0.5;
- iconPos_y = (1 - iconSize_y) * 0.5;
+ // --------------
+ // RENDER ICONS
+ // --------------
+ vector iconSize = '0 0 0';
+ iconSize_y = me.realFontSize_y * me.iconsSizeFactor;
+ iconSize_x = me.realFontSize_x * me.iconsSizeFactor;
- string n;
+ vector iconPos = '0 0 0';
+ iconPos_x = (me.columnIconsSize - 3 * iconSize_x) * 0.5;
+ iconPos_y = (1 - iconSize_y) * 0.5;
- if (!(me.seenIPv4 && me.seenIPv6))
- {
- iconPos_x += iconSize_x * 0.5;
- }
- else if(me.seenIPv4 && me.seenIPv6)
- {
- n = string_null;
- if(isv6)
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_ipv6"), 0); // PRECACHE_PIC_MIPMAP
- else if(isv4)
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_ipv4"), 0); // PRECACHE_PIC_MIPMAP
- if(n)
- draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
- iconPos_x += iconSize_x;
- }
+ string n;
- if(q > 0)
- {
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), 0); // PRECACHE_PIC_MIPMAP
+ if (!(me.seenIPv4 && me.seenIPv6))
+ {
+ iconPos_x += iconSize_x * 0.5;
+ }
+ else if(me.seenIPv4 && me.seenIPv6)
+ {
+ n = string_null;
+ if(isv6)
+ draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_ipv6"), 0); // PRECACHE_PIC_MIPMAP
+ else if(isv4)
+ draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_ipv4"), 0); // PRECACHE_PIC_MIPMAP
+ if(n)
draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
- }
iconPos_x += iconSize_x;
+ }
- if(modname == "Xonotic")
- {
- if(pure == 0)
- {
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), PRECACHE_PIC_MIPMAP);
- draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
- }
- }
- else
- {
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_", modname), PRECACHE_PIC_MIPMAP);
- if(draw_PictureSize(n) == '0 0 0')
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_"), PRECACHE_PIC_MIPMAP);
- if(pure == 0)
- draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
- else
- draw_Picture(iconPos, n, iconSize, '1 1 1', SKINALPHA_SERVERLIST_ICON_NONPURE);
- }
- iconPos_x += iconSize_x;
+ if(q > 0)
+ {
+ draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), 0); // PRECACHE_PIC_MIPMAP
+ draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
+ }
+ iconPos_x += iconSize_x;
- if(sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS))
+ if(modname == "Xonotic")
+ {
+ if(pure == 0)
{
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_stats1"), 0); // PRECACHE_PIC_MIPMAP
+ draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), PRECACHE_PIC_MIPMAP);
draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
}
- iconPos_x += iconSize_x;
}
+ else
+ {
+ draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_", modname), PRECACHE_PIC_MIPMAP);
+ if(draw_PictureSize(n) == '0 0 0')
+ draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_"), PRECACHE_PIC_MIPMAP);
+ if(pure == 0)
+ draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
+ else
+ draw_Picture(iconPos, n, iconSize, '1 1 1', SKINALPHA_SERVERLIST_ICON_NONPURE);
+ }
+ iconPos_x += iconSize_x;
+ if(sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS))
+ {
+ draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_stats1"), 0); // PRECACHE_PIC_MIPMAP
+ draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
+ }
+ iconPos_x += iconSize_x;
+
+ // --------------
+ // RENDER TEXT
+ // --------------
+
+ // ping
s = ftos(p);
draw_Text(me.realUpperMargin * eY + (me.columnPingOrigin + me.columnPingSize - draw_TextWidth(s, 0, me.realFontSize)) * eX, s, me.realFontSize, theColor, theAlpha, 0);
+
+ // server name
s = draw_TextShortenToWidth(gethostcachestring(SLIST_FIELD_NAME, i), me.columnNameSize, 0, me.realFontSize);
draw_Text(me.realUpperMargin * eY + me.columnNameOrigin * eX, s, me.realFontSize, theColor, theAlpha, 0);
+
+ // server map
s = draw_TextShortenToWidth(gethostcachestring(SLIST_FIELD_MAP, i), me.columnMapSize, 0, me.realFontSize);
draw_Text(me.realUpperMargin * eY + (me.columnMapOrigin + (me.columnMapSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
+
+ // server gametype
s = draw_TextShortenToWidth(typestr, me.columnTypeSize, 0, me.realFontSize);
draw_Text(me.realUpperMargin * eY + (me.columnTypeOrigin + (me.columnTypeSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
+
+ // server playercount
s = strcat(ftos(gethostcachenumber(SLIST_FIELD_NUMHUMANS, i)), "/", ftos(gethostcachenumber(SLIST_FIELD_MAXPLAYERS, i)));
draw_Text(me.realUpperMargin * eY + (me.columnPlayersOrigin + (me.columnPlayersSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
}
float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift)
{
- float i;
vector org, sz;
org = boxToGlobal(eY * (me.selectedItem * me.itemHeight - me.scrollPos), me.origin, me.size);
}
else if(scan == K_INS || scan == K_MOUSE3 || scan == K_KP_INS)
{
- i = me.selectedItem;
- if(i < me.nItems)
+ if(me.nItems != 0)
{
- ToggleFavorite(me.selectedServer);
+ me.toggleFavorite(me, me.selectedServer);
me.ipAddressBoxFocused = -1;
return 1;
}
else
return me.controlledTextbox.keyDown(me.controlledTextbox, scan, ascii, shift);
}
+
+float XonoticServerList_getTotalHeight(entity me) {
+ float num_normal_rows = me.nItems;
+ float num_headers = category_draw_count;
+ return me.itemHeight * (num_normal_rows + me.categoriesHeight * num_headers);
+}
+float XonoticServerList_getItemAtPos(entity me, float pos) {
+ pos = pos / me.itemHeight;
+ float i;
+ for (i = category_draw_count - 1; i >= 0; --i) {
+ float itemidx = category_item[i];
+ float itempos = i * me.categoriesHeight + category_item[i];
+ if (pos >= itempos + me.categoriesHeight + 1)
+ return itemidx + 1 + floor(pos - (itempos + me.categoriesHeight + 1));
+ if (pos >= itempos)
+ return itemidx;
+ }
+ // No category matches? Note that category 0 is... 0. Therefore no headings exist at all.
+ return floor(pos);
+}
+float XonoticServerList_getItemStart(entity me, float item) {
+ float i;
+ for (i = category_draw_count - 1; i >= 0; --i) {
+ float itemidx = category_item[i];
+ float itempos = i * me.categoriesHeight + category_item[i];
+ if (item >= itemidx + 1)
+ return (itempos + me.categoriesHeight + 1 + item - (itemidx + 1)) * me.itemHeight;
+ if (item >= itemidx)
+ return itempos * me.itemHeight;
+ }
+ // No category matches? Note that category 0 is... 0. Therefore no headings exist at all.
+ return item * me.itemHeight;
+}
+float XonoticServerList_getItemHeight(entity me, float item) {
+ float i;
+ for (i = 0; i < category_draw_count; ++i) {
+ // Matches exactly the headings with increased height.
+ if (item == category_item[i])
+ return me.itemHeight * (me.categoriesHeight + 1);
+ }
+ return me.itemHeight;
+}
+
#endif
}
}
+void DisableServerBackwardsCompatibility()
+{
+ cvar_set("gameversion_min", ftos(100 * floor(cvar("gameversion") / 100)));
+}
+
void UpdateNotification_URI_Get_Callback(float id, float status, string data)
{
float n;
else
n = tokenizebyseparator(data, "\n");
- if(n >= 1)
+ float i;
+ string s;
+
+ string un_version = "";
+ string un_download = "";
+ string un_url = "";
+ string un_bannedservers = "";
+ string un_emergency_pk3s = "";
+ string un_promoted = "";
+ string un_recommended = "";
+ string un_compatexpire = "";
+
+ for(i = 0; i < n; ++i)
{
- _Nex_ExtResponseSystem_UpdateTo = argv(0);
-
- if(vercmp(cvar_string("g_xonoticversion"), _Nex_ExtResponseSystem_UpdateTo) >= 0)
+ s = substring(argv(i), 2, -1);
+ if(s == "") { continue; } // ignore empty lines
+
+ switch(substring(argv(i), 0, 1))
{
- _Nex_ExtResponseSystem_UpdateTo = ""; // no update needed
- }
- else
- {
- // update needed
- if(n >= 2)
- print(sprintf(_("Update can be downloaded at:\n%s\n"), argv(1)));
- if(n >= 3)
- _Nex_ExtResponseSystem_UpdateToURL = strzone(argv(2));
+ #define APPEND_TO_STRING(list,sep,add) ((list) = (((list) != "") ? strcat(list, sep, add) : (add)))
+ case "V":
+ {
+ un_version = s;
+ break;
+ }
+ case "C":
+ {
+ un_compatexpire = s;
+ break;
+ }
+ case "D":
+ {
+ un_download = s;
+ break;
+ }
+ case "U":
+ {
+ un_url = s;
+ break;
+ }
+ case "B":
+ {
+ APPEND_TO_STRING(un_bannedservers, " ", s);
+ break;
+ }
+ case "E":
+ {
+ if(cvar("menu_updatecheck_getpacks"))
+ APPEND_TO_STRING(un_emergency_pk3s, " ", s);
+ break;
+ }
+ case "P":
+ {
+ APPEND_TO_STRING(un_promoted, " ", s);
+ break;
+ }
+ case "R":
+ {
+ APPEND_TO_STRING(un_recommended, " ", s);
+ break;
+ }
}
+ }
- _Nex_ExtResponseSystem_UpdateTo = strzone(_Nex_ExtResponseSystem_UpdateTo);
-
- if(n >= 4)
+ if(un_version != "")
+ {
+ if(vercmp(cvar_string("g_xonoticversion"), un_version) < 0)
{
- _Nex_ExtResponseSystem_BannedServers = strzone(argv(3));
- _Nex_ExtResponseSystem_BannedServersNeedsRefresh = 1;
+ // update needed
+ _Nex_ExtResponseSystem_UpdateTo = strzone(un_version);
+ if(un_download) { print(sprintf(_("Update can be downloaded at:\n%s\n"), un_download)); }
+ if(un_url) { _Nex_ExtResponseSystem_UpdateToURL = strzone(un_url); }
+ DisableServerBackwardsCompatibility();
}
-
- if(n >= 5)
+ else if(cvar_string("g_xonoticversion") == un_version)
{
- if(cvar("menu_updatecheck_getpacks"))
+ if(un_compatexpire != "")
{
- _Nex_ExtResponseSystem_Packs = strzone(argv(4));
- _Nex_ExtResponseSystem_PacksStep = 1;
+ string curdate = strftime(FALSE, "%Y%m%d%H%M%S");
+ if (strcmp(curdate, un_compatexpire) >= 0)
+ DisableServerBackwardsCompatibility();
}
}
}
+
+ if(un_emergency_pk3s != "")
+ {
+ _Nex_ExtResponseSystem_Packs = strzone(un_emergency_pk3s);
+ _Nex_ExtResponseSystem_PacksStep = 1;
+ }
+
+ if(un_promoted != "")
+ {
+ _Nex_ExtResponseSystem_PromotedServers = strzone(un_promoted);
+ _Nex_ExtResponseSystem_PromotedServersNeedsRefresh = 1;
+ }
+
+ if(un_recommended != "")
+ {
+ _Nex_ExtResponseSystem_RecommendedServers = strzone(un_recommended);
+ _Nex_ExtResponseSystem_RecommendedServersNeedsRefresh = 1;
+ }
}
// END OF URI SYSTEM ////////////////////////////////////////////////////////
// for privacy, munge the start count a little
startcnt = floor((floor(startcnt / 10) + random()) * 10);
- uri = sprintf("http://www.xonotic.org/dl/checkupdate.txt?version=%s&cnt=%d", uri_escape(cvar_string("g_xonoticversion")), startcnt);
-
-#ifdef CVAR_POPCON
- float cvar_handle, popcon_handle;
- float n, i, j;
- string k, s;
- cvar_handle = buf_create();
- buf_cvarlist(cvar_handle, "", "");
- n = buf_getsize(cvar_handle);
- popcon_handle = buf_create();
- for(i= 0, j = 0; i < n; ++i)
- {
- k = bufstr_get(cvar_handle, i);
- if(!(cvar_type(k) & CVAR_TYPEFLAG_SAVED))
- continue;
- s = sprintf("%s=%d", uri_escape(k), cvar_string(k) != cvar_defstring(k));
- bufstr_set(popcon_handle, j, s);
- ++j;
- }
- buf_del(cvar_handle);
- uri_postbuf(
- uri, URI_GET_UPDATENOTIFICATION,
- "application/x-www-form-urlencoded",
- "&",
- popcon_handle
- );
- buf_del(popcon_handle);
-#else
+ uri = sprintf("http://update.xonotic.org/checkupdate.txt?version=%s&cnt=%d", uri_escape(cvar_string("g_xonoticversion")), startcnt);
uri_get(uri, URI_GET_UPDATENOTIFICATION);
-#endif
}
}
// note: include only those that should be in the menu!
#define GAMETYPES \
- GAMETYPE(MAPINFO_TYPE_ARENA) \
GAMETYPE(MAPINFO_TYPE_ASSAULT) \
GAMETYPE(MAPINFO_TYPE_CTF) \
GAMETYPE(MAPINFO_TYPE_CA) \
string _Nex_ExtResponseSystem_BannedServers;
float _Nex_ExtResponseSystem_BannedServersNeedsRefresh;
+string _Nex_ExtResponseSystem_PromotedServers;
+float _Nex_ExtResponseSystem_PromotedServersNeedsRefresh;
+string _Nex_ExtResponseSystem_RecommendedServers;
+float _Nex_ExtResponseSystem_RecommendedServersNeedsRefresh;
#define autocvar_fraglimit_override cvar("fraglimit_override")
float autocvar_g_allow_oldnexbeam;
float autocvar_g_antilag;
-float autocvar_g_antilag_bullets;
float autocvar_g_antilag_nudge;
-float autocvar_g_arena_maxspawned;
-float autocvar_g_arena_point_leadlimit;
-float autocvar_g_arena_point_limit;
-float autocvar_g_arena_roundbased;
-float autocvar_g_arena_round_timelimit;
-float autocvar_g_arena_warmup;
float autocvar_g_balance_armor_blockpercent;
float autocvar_g_balance_armor_limit;
float autocvar_g_balance_armor_regen;
float autocvar_g_domination_point_rate;
float autocvar_g_domination_teams_override;
float autocvar_g_forced_respawn;
+float autocvar_g_respawn_delay_max;
string autocvar_g_forced_team_blue;
string autocvar_g_forced_team_otherwise;
string autocvar_g_forced_team_pink;
FOR_EACH_REALCLIENT(head)
{
- if(IS_PLAYER(head) || g_lms || g_arena || head.caplayer == 1)
+ if(IS_PLAYER(head) || g_lms || head.caplayer == 1)
++activerealplayers;
++realplayers;
}
if (self.deadflag == DEAD_DYING)
{
- if(self.respawn_flags & RESPAWN_FORCE)
+ if((self.respawn_flags & RESPAWN_FORCE) && !autocvar_g_respawn_delay_max)
self.deadflag = DEAD_RESPAWNING;
else if(!button_pressed)
self.deadflag = DEAD_DEAD;
{
if(button_pressed)
self.deadflag = DEAD_RESPAWNABLE;
+ else if(time >= self.respawn_time_max && (self.respawn_flags & RESPAWN_FORCE))
+ self.deadflag = DEAD_RESPAWNING;
}
else if (self.deadflag == DEAD_RESPAWNABLE)
{
if(time > self.respawn_time)
{
self.respawn_time = time + 1; // only retry once a second
+ self.respawn_time_max = self.respawn_time;
respawn();
}
}
if(self.respawn_flags & RESPAWN_SILENT)
self.stat_respawn_time = 0;
+ else if((self.respawn_flags & RESPAWN_FORCE) && autocvar_g_respawn_delay_max)
+ self.stat_respawn_time = self.respawn_time_max;
else
self.stat_respawn_time = self.respawn_time;
}
self.teleportable = oldself.teleportable;
self.damagedbycontents = oldself.damagedbycontents;
self.angles = oldself.angles;
+ self.v_angle = oldself.v_angle;
self.avelocity = oldself.avelocity;
self.classname = "body";
self.damageforcescale = oldself.damageforcescale;
self.respawn_time = ceil((time + sdelay) / waves) * waves;
else
self.respawn_time = time + sdelay;
+ if(autocvar_g_respawn_delay_max > sdelay)
+ self.respawn_time_max = time + autocvar_g_respawn_delay_max;
+ else
+ self.respawn_time_max = self.respawn_time;
if((sdelay + waves >= 5.0) && (self.respawn_time - time > 1.75))
self.respawn_countdown = 10; // first number to count down from is 10
else
{
if(IS_CLIENT(self))
{
- if(!IS_PLAYER(self) && !lockteams && !g_arena)
+ if(!IS_PLAYER(self) && !lockteams)
{
if(nJoinAllowed(self))
{
{
if(IS_CLIENT(self))
{
- if(g_arena) { return; }
if(g_lms)
{
if(self.lms_spectate_warning)
void ReadyRestart()
{
// no arena, assault support yet...
- if(g_arena | g_assault | gameover | intermission_running | race_completing)
+ if(g_assault | gameover | intermission_running | race_completing)
localcmd("restart\n");
else
localcmd("\nsv_hook_gamerestart\n");
.float play_time;
.float respawn_flags;
.float respawn_time;
+.float respawn_time_max;
.float death_time;
.float fade_time;
.float fade_rate;
self.colormod = '1 0 0' + '0 1 0' * (2 * h - 0.5);
else
self.colormod = '1 1 1';
+
+ CSQCMODEL_AUTOUPDATE();
}
void func_breakable_look_destroyed()
{
func_breakable_look_destroyed();
func_breakable_behave_destroyed();
+
+ CSQCMODEL_AUTOUPDATE();
}
void func_breakable_restore()
{
func_breakable_look_restore();
func_breakable_behave_restore();
+
+ CSQCMODEL_AUTOUPDATE();
}
vector debrisforce; // global, set before calling this
func_breakable_behave_destroyed();
else
func_breakable_behave_restore();
+
+ CSQCMODEL_AUTOUPDATE();
}
// destructible walls that can be used to trigger target_objective_decrease
self.reset = func_breakable_reset;
func_breakable_reset();
+
+ CSQCMODEL_AUTOINIT();
}
// for use in maps with a "model" key set
// mapinfo
BADCVAR("fraglimit");
- BADCVAR("g_arena");
BADCVAR("g_assault");
BADCVAR("g_ca");
BADCVAR("g_ca_teams");
// does nothing visible
BADCVAR("captureleadlimit_override");
- BADCVAR("g_arena_point_leadlimit");
BADCVAR("g_balance_kill_delay");
BADCVAR("g_ca_point_leadlimit");
BADCVAR("g_ctf_captimerecord_always");
{
s = strcat(":player:see-labels:", GetPlayerScoreString(other, 0), ":");
s = strcat(s, ftos(rint(time - other.jointime)), ":");
- if(IS_PLAYER(other) || g_arena || other.caplayer == 1 || g_lms)
+ if(IS_PLAYER(other) || other.caplayer == 1 || g_lms)
s = strcat(s, ftos(other.team), ":");
else
s = strcat(s, "spectator:");
if(WinningConditionHelper_zeroisworst)
leadlimit = 0; // not supported in this mode
- if(g_dm || g_tdm || g_arena || g_ca || (g_race && !g_race_qualifying) || g_nexball)
+ if(g_dm || g_tdm || g_ca || (g_race && !g_race_qualifying) || g_nexball)
// these modes always score in increments of 1, thus this makes sense
{
if(leaderfrags != WinningConditionHelper_topscore)
g_warmup_allguns = cvar("g_warmup_allguns");
g_warmup_allow_timeout = cvar("g_warmup_allow_timeout");
- if ((g_race && g_race_qualifying == 2) || g_arena || g_assault || cvar("g_campaign"))
+ if ((g_race && g_race_qualifying == 2) || g_assault || cvar("g_campaign"))
warmup_stage = 0; // these modes cannot work together, sorry
g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon");
+++ /dev/null
-.float spawned;
-float maxspawned;
-float numspawned;
-.entity spawnqueue_next;
-.entity spawnqueue_prev;
-.float spawnqueue_in;
-entity spawnqueue_first;
-entity spawnqueue_last;
-
-void Spawnqueue_Insert(entity e)
-{
- if(e.spawnqueue_in)
- return;
- dprint(strcat("Into queue: ", e.netname, "\n"));
- e.spawnqueue_in = TRUE;
- e.spawnqueue_prev = spawnqueue_last;
- e.spawnqueue_next = world;
- if(spawnqueue_last)
- spawnqueue_last.spawnqueue_next = e;
- spawnqueue_last = e;
- if(!spawnqueue_first)
- spawnqueue_first = e;
-}
-
-void Spawnqueue_Remove(entity e)
-{
- if(!e.spawnqueue_in)
- return;
- dprint(strcat("Out of queue: ", e.netname, "\n"));
- e.spawnqueue_in = FALSE;
- if(e == spawnqueue_first)
- spawnqueue_first = e.spawnqueue_next;
- if(e == spawnqueue_last)
- spawnqueue_last = e.spawnqueue_prev;
- if(e.spawnqueue_prev)
- e.spawnqueue_prev.spawnqueue_next = e.spawnqueue_next;
- if(e.spawnqueue_next)
- e.spawnqueue_next.spawnqueue_prev = e.spawnqueue_prev;
- e.spawnqueue_next = world;
- e.spawnqueue_prev = world;
-}
-
-void Spawnqueue_Unmark(entity e)
-{
- if(!e.spawned)
- return;
- e.spawned = FALSE;
- numspawned = numspawned - 1;
-}
-
-void Spawnqueue_Mark(entity e)
-{
- if(e.spawned)
- return;
- e.spawned = TRUE;
- numspawned = numspawned + 1;
-}
-
-float Arena_CheckWinner()
-{
- entity e;
-
- if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
- {
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
- round_handler_Init(5, autocvar_g_arena_warmup, autocvar_g_arena_round_timelimit);
- return 1;
- }
-
- if(numspawned > 1)
- return 0;
-
- entity champion;
- champion = world;
- FOR_EACH_CLIENT(e)
- {
- if(e.spawned && IS_PLAYER(e))
- champion = e;
- }
-
- if(champion)
- {
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_PLAYER_WIN, champion.netname);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_PLAYER_WIN, champion.netname);
- UpdateFrags(champion, +1);
- }
- else
- {
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
- }
- round_handler_Init(5, autocvar_g_arena_warmup, autocvar_g_arena_round_timelimit);
- return 1;
-}
-
-void Arena_AddChallengers()
-{
- entity e;
- if(time < 2) // don't force players to spawn so early
- return;
- e = self;
- while(numspawned < maxspawned && spawnqueue_first)
- {
- self = spawnqueue_first;
-
- bprint ("^4", self.netname, "^4 is the next challenger\n");
-
- Spawnqueue_Remove(self);
- Spawnqueue_Mark(self);
-
- self.classname = "player";
- PutClientInServer();
- }
- self = e;
-}
-
-float prev_numspawned;
-float Arena_CheckPlayers()
-{
- Arena_AddChallengers();
-
- if(numspawned >= 2)
- {
- if(prev_numspawned > 0)
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_PLAYERS);
- prev_numspawned = -1;
- return 1;
- }
-
- if(prev_numspawned != numspawned && numspawned == 1)
- {
- if(maxspawned - numspawned > 0)
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_PLAYERS, maxspawned - numspawned);
- prev_numspawned = numspawned;
- }
-
- return 0;
-}
-
-void Arena_RoundStart()
-{
- entity e;
- FOR_EACH_PLAYER(e)
- e.player_blocked = 0;
-}
-
-MUTATOR_HOOKFUNCTION(arena_ClientDisconnect)
-{
- Spawnqueue_Unmark(self);
- Spawnqueue_Remove(self);
- return 1;
-}
-
-MUTATOR_HOOKFUNCTION(arena_reset_map_players)
-{
- FOR_EACH_CLIENT(self)
- {
- if(self.spawned)
- {
- PutClientInServer();
- self.player_blocked = 1;
- }
- else
- PutObserverInServer();
- }
- return 1;
-}
-
-MUTATOR_HOOKFUNCTION(arena_MakePlayerObserver)
-{
- if(self.version_mismatch)
- {
- self.frags = FRAGS_SPECTATOR;
- Spawnqueue_Unmark(self);
- Spawnqueue_Remove(self);
- }
- else
- {
- self.frags = FRAGS_LMS_LOSER;
- Spawnqueue_Insert(self);
- }
- return 1;
-}
-
-MUTATOR_HOOKFUNCTION(arena_PutClientInServer)
-{
- if(!self.spawned)
- self.classname = "observer";
- return 1;
-}
-
-MUTATOR_HOOKFUNCTION(arena_ClientConnect)
-{
- self.classname = "observer";
- Spawnqueue_Insert(self);
- return 1;
-}
-
-MUTATOR_HOOKFUNCTION(arena_PlayerSpawn)
-{
- Spawnqueue_Remove(self);
- Spawnqueue_Mark(self);
- if(arena_roundbased)
- self.player_blocked = 1;
- return 1;
-}
-
-MUTATOR_HOOKFUNCTION(arena_ForbidPlayerScore_Clear)
-{
- return 1;
-}
-
-MUTATOR_HOOKFUNCTION(arena_GiveFragsForKill)
-{
- if(arena_roundbased)
- frag_score = 0; // score will be given to the champion when the round ends
- return 1;
-}
-
-MUTATOR_HOOKFUNCTION(arena_PlayerDies)
-{
- // put dead players in the spawn queue
- if(arena_roundbased)
- self.respawn_flags = (RESPAWN_FORCE | RESPAWN_SILENT);
- else
- self.respawn_flags = RESPAWN_SILENT;
- Spawnqueue_Unmark(self);
- return 1;
-}
-
-MUTATOR_HOOKFUNCTION(arena_SV_StartFrame)
-{
- if(gameover) return 1;
- if(time <= game_starttime || !arena_roundbased)
- Arena_AddChallengers();
- return 1;
-}
-
-MUTATOR_HOOKFUNCTION(arena_FilterItem)
-{
- if(autocvar_g_powerups <= 0)
- if(self.flags & FL_POWERUP)
- return TRUE;
-
- return FALSE;
-}
-
-void arena_Initialize()
-{
- maxspawned = max(2, autocvar_g_arena_maxspawned);
- arena_roundbased = autocvar_g_arena_roundbased;
- if(arena_roundbased)
- {
- round_handler_Spawn(Arena_CheckPlayers, Arena_CheckWinner, Arena_RoundStart);
- round_handler_Init(5, autocvar_g_arena_warmup, autocvar_g_arena_round_timelimit);
- }
-}
-
-MUTATOR_DEFINITION(gamemode_arena)
-{
- MUTATOR_HOOK(ClientDisconnect, arena_ClientDisconnect, CBC_ORDER_ANY);
- MUTATOR_HOOK(reset_map_players, arena_reset_map_players, CBC_ORDER_ANY);
- MUTATOR_HOOK(MakePlayerObserver, arena_MakePlayerObserver, CBC_ORDER_ANY);
- MUTATOR_HOOK(PutClientInServer, arena_PutClientInServer, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientConnect, arena_ClientConnect, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, arena_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(ForbidPlayerScore_Clear, arena_ForbidPlayerScore_Clear, CBC_ORDER_ANY);
- MUTATOR_HOOK(GiveFragsForKill, arena_GiveFragsForKill, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, arena_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(SV_StartFrame, arena_SV_StartFrame, CBC_ORDER_ANY);
- MUTATOR_HOOK(FilterItem, arena_FilterItem, CBC_ORDER_ANY);
-
- MUTATOR_ONADD
- {
- if(time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- arena_Initialize();
- }
-
- MUTATOR_ONREMOVE
- {
- print("This is a game type and it cannot be removed at runtime.");
- return -1;
- }
-
- return 0;
-}
+++ /dev/null
-// should be removed in the future, as other code should not have to care
-float arena_roundbased;
onslaught_updatelinks();
}
+void onslaught_controlpoint_think()
+{
+ self.nextthink = time;
+ CSQCMODEL_AUTOUPDATE();
+}
+
void onslaught_controlpoint_reset()
{
if(self.goalentity && self.goalentity != world)
self.isshielded = TRUE;
self.enemy.solid = SOLID_NOT;
self.enemy.colormap = self.colormap;
- self.think = self.enemy.think = func_null;
- self.nextthink = 0; // don't like func_null :P
+ self.think = onslaught_controlpoint_think;
+ self.enemy.think = func_null;
+ self.nextthink = time; // don't like func_null :P
setmodel(self, "models/onslaught/controlpoint_pad.md3");
//setsize(self, '-32 -32 0', '32 32 8');
activator = self;
SUB_UseTargets(); // to reset the structures, playerspawns etc.
+
+ CSQCMODEL_AUTOUPDATE();
}
/*QUAKED spawnfunc_onslaught_controlpoint (0 .5 .8) (-32 -32 0) (32 32 128)
self.enemy.colormap = self.colormap;
waypoint_spawnforitem(self);
+
+ self.think = onslaught_controlpoint_think;
+ self.nextthink = time;
WaypointSprite_SpawnFixed(string_null, self.origin + '0 0 128', self, sprite, RADARICON_NONE, '0 0 0');
WaypointSprite_UpdateRule(self.sprite, NUM_TEAM_2, SPRITERULE_TEAMPLAY);
onslaught_updatelinks();
self.reset = onslaught_controlpoint_reset;
+
+ CSQCMODEL_AUTOINIT();
}
float onslaught_link_send(entity to, float sendflags)
MUTATOR_DECLARATION(gamemode_assault);
-MUTATOR_DECLARATION(gamemode_arena);
MUTATOR_DECLARATION(gamemode_ca);
MUTATOR_DECLARATION(gamemode_keyhunt);
MUTATOR_DECLARATION(gamemode_freezetag);
}
self.nextthink = time;
+
+ CSQCMODEL_AUTOUPDATE();
}
.float old_solid, old_movetype;
{
// spawn a new object with default properties
- entity e;
+ entity e, oldself;
e = spawn();
e.classname = "object";
e.takedamage = DAMAGE_AIM;
setorigin(e, trace_endpos);
e.angles_y = self.v_angle_y;
}
+
+ oldself = self;
+ self = e;
+ CSQCMODEL_AUTOINIT();
+ self = oldself;
object_count += 1;
return e;
mutators/base.qh
mutators/mutators.qh
mutators/gamemode_assault.qh
-mutators/gamemode_arena.qh
mutators/gamemode_ca.qh
mutators/gamemode_ctf.qh
mutators/gamemode_domination.qh
mutators/base.qc
mutators/gamemode_assault.qc
-mutators/gamemode_arena.qc
mutators/gamemode_ca.qc
mutators/gamemode_ctf.qc
mutators/gamemode_domination.qc
s = strcat(s, ":human");
else
s = strcat(s, ":bot");
- if(!IS_PLAYER(p) && !g_arena && p.caplayer != 1 && !g_lms)
+ if(!IS_PLAYER(p) && p.caplayer != 1 && !g_lms)
s = strcat(s, ":spectator");
}
else
{
- if(IS_PLAYER(p) || g_arena || p.caplayer == 1 || g_lms)
+ if(IS_PLAYER(p) || p.caplayer == 1 || g_lms)
s = GetPlayerScoreString(p, 2);
else
s = "-666";
}
else
{
- float mindist;
- if(g_arena && arena_roundbased)
- mindist = 800;
- else
- mindist = 100;
- firstspot = Spawn_FilterOutBadSpots(firstspot, mindist, teamcheck);
+ firstspot = Spawn_FilterOutBadSpots(firstspot, 100, teamcheck);
// there is 50/50 chance of choosing a random spot or the furthest spot
// (this means that roughly every other spawn will be furthest, so you
gametypename = "ffa";
if(teamplay)
gametypename = "team";
- if(g_arena)
- gametypename = "tournament";
if(g_ctf)
gametypename = "ctf";
if(maxclients == 1)
MUTATOR_ADD(gamemode_lms);
}
- if(g_arena)
- {
- fraglimit_override = autocvar_g_arena_point_limit;
- leadlimit_override = autocvar_g_arena_point_leadlimit;
- MUTATOR_ADD(gamemode_arena);
- }
-
if(g_ca)
{
ActivateTeamplay();
//.float bulletcounter;
void turret_machinegun_attack()
{
- fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
UziFlash();
self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL;
self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
- if (!autocvar_g_antilag_bullets)
- self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
+ self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
if (turret_stdproc_init("machinegun_std", "models/turrets/base.md3", "models/turrets/machinegun.md3", TID_MACHINEGUN) == 0)
{
void walker_attack()
{
sound (self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTEN_NORM);
- fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
}
self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MOVE ;
self.aim_flags = TFL_AIM_LEAD;
- if (autocvar_g_antilag_bullets)
- self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
- else
- self.aim_flags |= TFL_AIM_SHOTTIMECOMPENSATE;
+ self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
self.turret_respawnhook = walker_respawnhook;
v_forward = normalize(v_forward);
v += v_forward * 50;
-//void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
+//void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float bulletconstant)
fireBallisticBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_speed,
- 5, autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0, 1, autocvar_g_vehicle_spiderbot_minigun_bulletconstant);
+ 5, autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0, autocvar_g_vehicle_spiderbot_minigun_bulletconstant);
endFireBallisticBullet();
self.owner = world;
}
-void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
+void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float bulletconstant)
{
float lag, dt, savetime; //, density;
entity pl, oldself;
- float antilagging;
-
- antilagging = (autocvar_g_antilag_bullets && (pSpeed >= autocvar_g_antilag_bullets));
entity proj;
proj = spawn();
proj.classname = "bullet";
proj.owner = proj.realowner = self;
PROJECTILE_MAKETRIGGER(proj);
- if(gravityfactor > 0)
- {
- proj.movetype = MOVETYPE_TOSS;
- proj.gravity = gravityfactor;
- }
- else
- proj.movetype = MOVETYPE_FLY;
+ proj.movetype = MOVETYPE_FLY;
proj.think = SUB_Remove;
proj.nextthink = time + lifetime; // min(pLifetime, vlen(world.maxs - world.mins) / pSpeed);
- W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, antilagging);
+ W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, TRUE);
proj.angles = vectoangles(proj.velocity);
if(bulletconstant > 0)
proj.dmg_radius = autocvar_g_ballistics_materialconstant / bulletconstant;
other = proj; MUTATOR_CALLHOOK(EditProjectile);
- if(antilagging)
- {
- float eff;
+ float eff;
- if(tracereffects & EF_RED)
- eff = particleeffectnum("tr_rifle");
- else if(tracereffects & EF_BLUE)
- eff = particleeffectnum("tr_rifle_weak");
- else
- eff = particleeffectnum("tr_bullet");
+ if(tracereffects & EF_RED)
+ eff = particleeffectnum("tr_rifle");
+ else if(tracereffects & EF_BLUE)
+ eff = particleeffectnum("tr_rifle_weak");
+ else
+ eff = particleeffectnum("tr_bullet");
+
+ // NOTE: this may severely throw off weapon balance
+ lag = ANTILAG_LATENCY(self);
+ if(lag < 0.001)
+ lag = 0;
+ if (!IS_REAL_CLIENT(self))
+ lag = 0;
+ if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
+ lag = 0; // only do hitscan, but no antilag
+
+ if(lag)
+ FOR_EACH_PLAYER(pl)
+ if(pl != self)
+ antilag_takeback(pl, time - lag);
- // NOTE: this may severely throw off weapon balance
- lag = ANTILAG_LATENCY(self);
- if(lag < 0.001)
- lag = 0;
- if (!IS_REAL_CLIENT(self))
- lag = 0;
- if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
- lag = 0; // only do hitscan, but no antilag
+ oldself = self;
+ self = proj;
- if(lag)
- FOR_EACH_PLAYER(pl)
- if(pl != self)
- antilag_takeback(pl, time - lag);
+ savetime = frametime;
+ frametime = 0.05;
- oldself = self;
- self = proj;
+ for(;;)
+ {
+ // DP tracetoss is stupid and always traces in 0.05s
+ // ticks. This makes it trace in 0.05*0.125s ticks
+ // instead.
+ vector v0;
+ v0 = self.velocity;
+ self.velocity = self.velocity * 0.125;
+ trace_fraction = 0;
+ fireBallisticBullet_trace_callback_ent = self;
+ fireBallisticBullet_trace_callback_eff = eff;
+ WarpZone_TraceToss_ThroughZone(self, self.owner, world, fireBallisticBullet_trace_callback);
+ self.velocity = v0;
+
+ if(trace_fraction == 1)
+ break;
+ // won't hit anything anytime soon (DP's
+ // tracetoss does 200 tics of, here,
+ // 0.05*0.125s, that is, 1.25 seconds
- savetime = frametime;
- frametime = 0.05;
+ other = trace_ent;
+ dt = WarpZone_tracetoss_time * 0.125; // this is only approximate!
+ setorigin(self, trace_endpos);
+ self.velocity = WarpZone_tracetoss_velocity * (1 / 0.125);
- for(;;)
+ if(!SUB_OwnerCheck())
{
- // DP tracetoss is stupid and always traces in 0.05s
- // ticks. This makes it trace in 0.05*0.125s ticks
- // instead.
- vector v0;
- float g0;
- v0 = self.velocity;
- g0 = self.gravity;
- self.velocity = self.velocity * 0.125;
- self.gravity *= 0.125 * 0.125;
- trace_fraction = 0;
- fireBallisticBullet_trace_callback_ent = self;
- fireBallisticBullet_trace_callback_eff = eff;
- WarpZone_TraceToss_ThroughZone(self, self.owner, world, fireBallisticBullet_trace_callback);
- self.velocity = v0;
- self.gravity = g0;
-
- if(trace_fraction == 1)
+ if(SUB_NoImpactCheck())
break;
- // won't hit anything anytime soon (DP's
- // tracetoss does 200 tics of, here,
- // 0.05*0.125s, that is, 1.25 seconds
-
- other = trace_ent;
- dt = WarpZone_tracetoss_time * 0.125; // this is only approximate!
- setorigin(self, trace_endpos);
- self.velocity = WarpZone_tracetoss_velocity * (1 / 0.125);
-
- if(!SUB_OwnerCheck())
- {
- if(SUB_NoImpactCheck())
- break;
-
- // hit the player
- W_BallisticBullet_Hit();
- }
- if(proj.dmg_radius < 0) // these NEVER penetrate solid
- break;
+ // hit the player
+ W_BallisticBullet_Hit();
+ }
- // if we hit "weapclip", bail out
- //
- // rationale of this check:
- //
- // any shader that is solid, nodraw AND trans is meant to clip weapon
- // shots and players, but has no other effect!
- //
- // if it is not trans, it is caulk and should not have this side effect
- //
- // matching shaders:
- // common/weapclip (intended)
- // common/noimpact (is supposed to eat projectiles, but is erased farther above)
- if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
- if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID))
- if (!(trace_dphitcontents & DPCONTENTS_OPAQUE))
- break;
+ if(proj.dmg_radius < 0) // these NEVER penetrate solid
+ break;
- // go through solid!
- if(!W_BallisticBullet_LeaveSolid((other && (other.solid != SOLID_BSP)) ? eff : -1))
- break;
+ // if we hit "weapclip", bail out
+ //
+ // rationale of this check:
+ //
+ // any shader that is solid, nodraw AND trans is meant to clip weapon
+ // shots and players, but has no other effect!
+ //
+ // if it is not trans, it is caulk and should not have this side effect
+ //
+ // matching shaders:
+ // common/weapclip (intended)
+ // common/noimpact (is supposed to eat projectiles, but is erased farther above)
+ if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
+ if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID))
+ if (!(trace_dphitcontents & DPCONTENTS_OPAQUE))
+ break;
- W_BallisticBullet_LeaveSolid_think();
+ // go through solid!
+ if(!W_BallisticBullet_LeaveSolid((other && (other.solid != SOLID_BSP)) ? eff : -1))
+ break;
- self.projectiledeathtype |= HITTYPE_BOUNCE;
- }
- frametime = savetime;
- self = oldself;
+ W_BallisticBullet_LeaveSolid_think();
- if(lag)
- FOR_EACH_PLAYER(pl)
- if(pl != self)
- antilag_restore(pl);
+ self.projectiledeathtype |= HITTYPE_BOUNCE;
+ }
+ frametime = savetime;
+ self = oldself;
- remove(proj);
+ if(lag)
+ FOR_EACH_PLAYER(pl)
+ if(pl != self)
+ antilag_restore(pl);
- return;
- }
+ remove(proj);
- if(tracereffects & EF_RED)
- CSQCProjectile(proj, TRUE, PROJECTILE_BULLET_GLOWING_TRACER, TRUE);
- else if(tracereffects & EF_BLUE)
- CSQCProjectile(proj, TRUE, PROJECTILE_BULLET_GLOWING, TRUE);
- else
- CSQCProjectile(proj, TRUE, PROJECTILE_BULLET, TRUE);
+ return;
}
void fireBullet (vector start, vector dir, float spread, float damage, float force, float dtype, float tracer)
W_DecreaseAmmo(ammo_nails, pAmmo, autocvar_g_balance_rifle_reload_ammo);
- W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, pSound, CH_WEAPON_A, pDamage * pShots);
+ W_SetupShot (self, TRUE, 2, pSound, CH_WEAPON_A, pDamage * pShots);
pointparticles(particleeffectnum("rifle_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
}
for(i = 0; i < pShots; ++i)
- fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), pBulletConstant);
endFireBallisticBullet();
if (autocvar_g_casings >= 2)
W_DecreaseAmmo(ammo_shells, ammoamount, autocvar_g_balance_shotgun_reload_ammo);
- W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, d * bullets);
+ W_SetupShot (self, TRUE, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, d * bullets);
for (sc = 0;sc < bullets;sc = sc + 1)
- fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, f, WEP_SHOTGUN, 0, 1, bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, f, WEP_SHOTGUN, 0, bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, autocvar_g_balance_shotgun_primary_ammo);
if(vlen(self.origin-self.enemy.origin) <= autocvar_g_balance_shotgun_secondary_melee_range)
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
else
- {
- if(autocvar_g_antilag_bullets)
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
- else
- self.BUTTON_ATCK = bot_aim(autocvar_g_balance_shotgun_primary_speed, 0, 0.001, FALSE);
- }
+ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
else if (req == WR_THINK)
{
void W_UZI_Attack (float deathtype)
{
- W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
+ W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
if (!autocvar_g_norecoil)
{
self.punchangle_x = random () - 0.5;
ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
if (self.misc_bulletcounter == 1)
- fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_force, deathtype, 0, autocvar_g_balance_uzi_bulletconstant);
else
- fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, deathtype, 0, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
W_DecreaseAmmo(ammo_nails, autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_reload_ammo);
- W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage);
+ W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage);
if (!autocvar_g_norecoil)
{
self.punchangle_x = random () - 0.5;
}
uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max);
- fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
self.misc_bulletcounter = self.misc_bulletcounter + 1;
void uzi_mode1_fire_burst()
{
- W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage);
+ W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage);
if (!autocvar_g_norecoil)
{
self.punchangle_x = random () - 0.5;
self.punchangle_y = random () - 0.5;
}
- fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
cat uncrustify.cfg
printf "%s = %s\n" "$KEY" "$choice"
} > uncrustify.cfg.test
- uncrustify -c uncrustify.cfg.test --replace --no-backup $FILES >/dev/null 2>&1
+ UNCRUSTIFY_CONFIG=uncrustify.cfg.test sh uncrustify.sh $FILES >/dev/null 2>&1
status=$?
if [ $status -gt 1 ]; then
echo "# ERROR: $KEY = $choice crashes with status $status."
indent_func_call_param = true # false/true
# Same as indent_func_call_param, but for function defs
-indent_func_def_param = true # false/true
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_func_def_param = false # false/true
# Same as indent_func_call_param, but for function protos
-indent_func_proto_param = true # false/true
+# WARNING: Code doesn't seem to use this feature - delete from the config?
+indent_func_proto_param = false # false/true
# Same as indent_func_call_param, but for class declarations
# WARNING: Code doesn't seem to use this feature - delete from the config?
indent_template_param = false # false/true
# Double the indent for indent_func_xxx_param options
-indent_func_param_double = false # false/true
+indent_func_param_double = true # false/true
# Indentation column for standalone 'const' function decl/proto qualifier
# WARNING: Code doesn't seem to use this feature - delete from the config?
sp_arith = ignore # ignore/add/remove/force #force
# Add or remove space around assignment operator '=', '+=', etc
-# NOTE: is 44 worse than ignore
+# NOTE: is 54 worse than ignore
sp_assign = add # ignore/add/remove/force
# Add or remove space around '=' in C++11 lambda capture specifications. Overrides sp_assign
sp_bool = add # ignore/add/remove/force
# Add or remove space around compare operator '<', '>', '==', etc
-# NOTE: is 196 worse than ignore
+# NOTE: is 198 worse than ignore
sp_compare = add # ignore/add/remove/force
# Add or remove space inside '(' and ')'
sp_inside_paren = remove # ignore/add/remove/force
# Add or remove space between nested parens
-# NOTE: is 14 worse than ignore
+# NOTE: is 18 worse than ignore
sp_paren_paren = remove # ignore/add/remove/force
# Whether to balance spaces inside nested parens
sp_inside_square = remove # ignore/add/remove/force
# Add or remove space after ','
-# NOTE: is 742 worse than ignore
sp_after_comma = add # ignore/add/remove/force #force
# Add or remove space before ','
nl_union_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'if' and '{'
-# NOTE: is 245 worse than ignore
+# NOTE: is 231 worse than ignore
nl_if_brace = add # ignore/add/remove/force
# Add or remove newline between '}' and 'else'
#
# The position of arithmetic operators in wrapped expressions
-pos_arith = join # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
+pos_arith = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
# The position of assignment in wrapped expressions.
# Do not affect '=' followed by '{'
-pos_assign = join # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
+pos_assign = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
# The position of boolean operators in wrapped expressions
-pos_bool = join # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
+pos_bool = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
# The position of comparison operators in wrapped expressions
-# WARNING: Best is not unique (join lead)
-pos_compare = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
+pos_compare = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
# The position of conditional (b ? t : f) operators in wrapped expressions
-# NOTE: is 4 worse than ignore
-pos_conditional = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
+pos_conditional = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
# The position of the comma in wrapped expressions
-# NOTE: is 2 worse than ignore
-pos_comma = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
+pos_comma = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force
# The position of the comma in the constructor initialization list
# WARNING: Code doesn't seem to use this feature - delete from the config?
# Will add or remove the braces around a fully braced case statement.
# Will only remove the braces if there are no variable declarations in the block.
-# NOTE: is 581 worse than ignore
+# NOTE: is 507 worse than ignore
mod_case_brace = remove # ignore/add/remove/force
# If TRUE, it will remove a void 'return;' that appears as the last statement in a function.
--- /dev/null
+fix_function_types() {
+ # Uncrustify handles QC function types (example:
+ # void(void) func;
+ # ) wrong and removes the space between type and variable. Fix this by
+ # a simple sed on ")letter" which should normally not occur.
+ sed -e 's/)\([A-Za-z0-9]\)/) \1/g' "$@"
+}
+
+if [ -z "$UNCRUSTIFY_CONFIG" ]; then
+ UNCRUSTIFY_CONFIG=`git rev-parse --show-toplevel`/qcsrc/uncrustify.cfg
+fi
+
+case "$#" in
+ 0)
+ uncrustify --frag -c "$UNCRUSTIFY_CONFIG" |\
+ fix_function_types
+ ;;
+ *)
+ uncrustify --replace --no-backup -c "$UNCRUSTIFY_CONFIG" "$@" &&\
+ fix_function_types -i "$@"
+ ;;
+esac
0
-\XonoticSingleplayerDialog\Jouer en mode un joueur contre des adversaires contrôlés par l'ordinateur
+\XonoticSingleplayerDialog\Jouer tout seul contre des adversaires contrôlés par ordinateur
-\XonoticMultiplayerDialog\Jouer en ligne avec des amis en réseau local ou sur Internet
-\XonoticMultiplayerDialog/Serveurs\Trouver des serveurs pour y jouer dessus
+\XonoticMultiplayerDialog\Jouer en ligne, en LAN avec vos amis, voir vos démos et modifier vos paramètres joueur
+\XonoticMultiplayerDialog/Serveurs\Trouver des serveurs où jouer
\menu_slist_showempty\Montrer les serveurs vides
\menu_slist_showfull\Montrer les serveurs où toutes les places sont prises
-\net_slist_pause\Ne met pas à jour la liste de serveurs pour éviter de "glisser" sur un autre serveur
-\XonoticMultiplayerDialog/Info...\Montrer plus d'information sur le serveur séléctionné
+\net_slist_pause\Ne pas mettre à jour la liste de serveurs pour éviter de "glisser" sur un autre serveur
+\XonoticMultiplayerDialog/Info...\Montrer plus d'informations sur le serveur sélectionné
\XonoticMultiplayerDialog/Marque-page\Mettre le serveur en haut de la liste pour pouvoir le repérer plus facilement plus tard
\XonoticMultiplayerDialog/Créer\Héberger votre propre partie
-\XonoticMultiplayerDialog/Vidéos\Regarder des Vidéos pré-enregistrées
-\XonoticMultiplayerDialog/Player Setup\Personaliser vos paramètres
+\XonoticMultiplayerDialog/Vidéos\Parcourir et regarder vos démos
+\XonoticMultiplayerDialog/Player Setup\Personnaliser vos paramètres joueur
-\XonoticTeamSelectDialog/join 'best' team (auto-select)\Auto-séléction de l'équipe qui a le plus besoin de vous (recommandé)
-\XonoticTeamSelectDialog/rouge\Joindre l'équipe rouge
-\XonoticTeamSelectDialog/bleu\Joindre l'équipe bleue
-\XonoticTeamSelectDialog/jaune\Joindre l'équipe jaune
-\XonoticTeamSelectDialog/rose\Joindre l'équipe rose
+\XonoticTeamSelectDialog/join 'best' team (auto-select)\Auto-séléction de l'équipe (recommandé)
+\XonoticTeamSelectDialog/rouge\Rejoindre l'équipe rouge
+\XonoticTeamSelectDialog/bleu\Rejoindre l'équipe bleue
+\XonoticTeamSelectDialog/jaune\Rejoindre l'équipe jaune
+\XonoticTeamSelectDialog/rose\Rejoindre l'équipe rose
-\timelimit_override\Limite de temps au match, le match se finit quand elle est atteinte
-\fraglimit_override\Limite de tués pour le match, le match se finit quand elle est atteinte
+\timelimit_override\Limite de temps, le match se termine lorsque celle-ci est atteinte
+\fraglimit_override\Limite de frags pour le match, le match se termine lorsque celle-ci est atteinte
\menu_maxplayers\Le nombre maximum de personnes pouvant jouer sur votre serveur en même temps
-\bot_number\Nombre d'adversaires ordinateur
+\bot_number\Nombre d'adversaires contrôlés par ordinateur
\skill\Spécifier la difficulté des adversaires ordinateur
\g_maplist_votable\Le nombre de cartes pouvant être votées à la fin du match
-\sv_vote_simple_majority_factor\À partir de 51% de oui seulement, un vote est gagné
-\XonoticMultiplayerDialog/Advanced settings...\Paramètres du serveur avancés
-\XonoticMultiplayerDialog/Mutators...\Spéciales et arènes d'une seule arme
-\g_dodging\Enable dodging
+\sv_vote_simple_majority_factor\La majorité simple remporte un vote
+\XonoticMultiplayerDialog/Advanced settings...\Paramètres serveur avancés
+\XonoticMultiplayerDialog/Mutators...\Mutators et arènes avec une seule arme
+\g_dodging\Activer les esquives
\g_cloaked\Tous les joueurs sont presque invisibles
-\g_footsteps\Activer les bruitages de pas
-\g_midair\Il faut que votre adversaire soit en l'air pour lui faire mal
-\g_vampire\Les dégâts faits à vos enemies vous font gagner de la santé
-\g_bloodloss\Si vous avez moins de santé que spécifié ici, vous perdrez du sang et mourez progressivement
-\sv_gravity\Vous tombez plus lentement, comme sur la lune
+\g_footsteps\Activer les bruits de pas
+\g_midair\Il faut que votre adversaire soit en l'air pour lui infliger des dégâts
+\g_vampire\Les dégâts infligés à vos ennemis vous rendent la santé
+\g_bloodloss\Si vous avez moins de santé que spécifié ici, vous perdrez du sang et mourrez progressivement
+\sv_gravity\Vous tombez plus lentement, une valeur peu élevée correspond à une faible gravité
\g_grappling_hook\Tous les joueurs ont un grappin
\g_jetpack\Tous les joueurs ont un jetpack
-\g_pinata\Tous les joueurs lâchent toutes leurs armes quand ils meurent
-\g_weapon_stay\Les armes restent où elles sont quand elles sont prises sur la carte
-\g_weaponarena\Séléctionner une arène d'une seule arme donne des munitions illimitées pour cette arme, et désactive toutes les autres armes
-\menu_weaponarena_with_laser\Also enable the laser in the weapon arena
-\g_minstagib\Tous les joueurs reçoivent un MinstaNex, qui est un sniper hyperpuissant qui tue d'un coup. Si vous n'avez plus de munitions, vous mourez progressivement.
-\g_nix\No Items Xonotic; tous les joueurs ont la même arme en même temps, et on change d'arme régulièrement
-\g_nix_with_laser\Porter le laser avec l'arme du No Items Xonotic
-\XonoticMultiplayerDialog/Select all\Séléctionner toutes les cartes
-\XonoticMultiplayerDialog/Select none\Déséléctionner toutes les cartes
+\g_pinata\Les joueurs lâchent toutes leurs armes quand ils meurent
+\g_weapon_stay\Les armes restent où elles sont lorsqu'elles sont ramassées
+\g_weaponarena\Sélectionner une arène avec une seule arme fera apparaître les joueurs avec cette arme et des munitions illimitées, et désactive toutes les autres armes
+\g_minstagib\Tous les joueurs reçoivent un Minstanex, qui est un fusil de précision d'une puissance infinie. Si vous êtes à court de munition, vous mourrez dans les 10 secondes à moins de parvenir à recharger votre arme. Le tir secondaire est un laser qui n'inflige aucun dégât et qui est utile pour sauter sur de longues distances.
+\g_nix\No Items Xonotic - tous les joueurs jouent avec la même arme, et celle-ci change régulièrement.
+\g_nix_with_laser\Autoriser le laser en plus de l'arme courante dans le mode Nix
+\XonoticMultiplayerDialog/Select all\Sélectionner toutes les cartes
+\XonoticMultiplayerDialog/Select none\Désélectionner toutes les cartes
-\XonoticMultiplayerDialog/Test Performance\Faire un test de performance en utilisant la vidéo choisie
+\XonoticMultiplayerDialog/Test Performance\Faire un test de performance en utilisant la démo sélectionnée
\fov\Champ de vision en degrés, par défaut 90, certains joueurs préfèrent entre 110 et 130
-\cl_bobcycle\Effet de "tremblement" de la caméra en courant
-\cl_zoomfactor\Facteur de Zoom
-\cl_zoomsensitivity\Changer la sensitivité du Zoom: 0 est la plus basse, 1 ne comporte pas de changement par rapport au mode dézoomé
-\cl_zoomspeed\Facteur "d'adoucissement" du Zoom, 0 désactive complètement
+\cl_bobcycle\Effet de "tremblement" de la vue lorsque vous courez
+\cl_zoomfactor\Facteur du zoom lorsque vous appuyez sur le bouton de zoom
+\cl_zoomsensitivity\Changer la sensibilité du zoom : 0 est la valeur la plus basse, 1 correspond à l'absence de zoom
+\cl_zoomspeed\Facteur "d'adoucissement" du zoom, 0 le désactive complètement
\XonoticMultiplayerDialog/Weapon settings...\Paramétrer les armes (affichage, priorité)
-\cl_weaponpriority_useforcycling\Utiliser la liste de priorité pour le changement d'armes à la molette
-\cl_autoswitch\Automatiquement changer d'arme si vous avez une meilleure arme que celle que vous portez
-\r_drawviewmodel\Afficher l'arme à la permière personne
+\cl_weaponpriority_useforcycling\Utiliser la liste de priorité pour le changement d'armes avec la molette de la souris
+\cl_autoswitch\Automatiquement changer d'arme si vous ramassez une meilleure arme que celle que vous portez
+\r_drawviewmodel\Afficher l'arme à la première personne
\cl_gunalign\Position de l'arme à l'écran, reconnection au serveur nécessaire pour prendre effet
-\crosshair_per_weapon\Set a different crosshair for each weapon, good if you play without weapon models
-\crosshair_color_per_weapon\Set the color of the crosshair depending on the weapon you are currently holding
+\crosshair_per_weapon\Définir un viseur différent pour chaque arme, utile si vous jouez sans afficher l'arme
+\crosshair_color_per_weapon\Définir la couleur du viseur selon l'arme que vous utilisez
\crosshair_size\Ajuster la taille du viseur
\crosshair_color_alpha\Ajuster l'opacité du viseur
-\crosshair_color\Ajuster le couleur du viseur
+\crosshair_color\Ajuster la couleur du viseur
\sbar_hudselector\Utiliser l'ancienne interface HUD
\XonoticMultiplayerDialog/Waypoints setup...\-
\_cl_name\Pseudonyme utilisé pour vous reconnaître dans le jeu
\XonoticSettingsDialog\Changer les paramètres du jeu
-\XonoticCreditsDialog\Les Crédits de Xonotic
+\XonoticCreditsDialog\Les crédits de Xonotic
\XonoticTeamSelectDialog\-
\XonoticMutatorsDialog\-
\XonoticMapInfoDialog\-
\XonoticQuitDialog/Non\'Faut que je fragge plus de monde!
\XonoticSettingsDialog/Contrôles\Paramètres contrôle souris/clavier
-\sensitivity\Sensitivité de la souris
-\menu_mouse_speed\Sensitivité de la souris dans les menus, n'affecte pas le jeu
-\m_filter\Adoucit le mouvement de souris, mais crée une légère latence de souris
+\sensitivity\Sensibilité de la souris
+\menu_mouse_speed\Sensibilité de la souris dans les menus, n'affecte pas le jeu
+\m_filter\Adoucit le mouvement de souris, mais crée une légère latence
\m_pitch\Inverser la souris sur l'axe vertical (mode jeu d'avion)
\vid_dgamouse\Utiliser une souris DGA
-\con_closeontoggleconsole\Autoriser la fermeture de console avec la touche d'ouverture de console (sinon, Shift+Échap)
+\con_closeontoggleconsole\Permet de fermer la console avec le même raccourci utilisé pour l'ouvrir
-\XonoticSettingsDialog/Vidéo\Video settings
+\XonoticSettingsDialog/Vidéo\Paramètres vidéo
\vid_width\Résolution de l'écran
-\vid_bitsperpixel\Profondeur des couleurs: 16 bits est plus rapide, mais 32 bits est de meilleure qualité (recommandé)
-\vid_fullscreen\Activer le mode plein écran (par défaut: activé)
-\vid_vsync\Activer la syncronisation verticale pour éviter des problèmes d'affichage, limite le nombre maximum d'images par seconde (par défaut: désactivé)
-\gl_texture_anisotropy\Qualité du filtrage anistrope (par défaut: 1x)
-\r_glsl\Activer les Shaders OpenGL 2.0 pour des effets de lumière améliorés
-\gl_vbo\Utiliser les VBOs pour stocker les modèles 3D statiques dans la mémoire pour une meilleure performance (par défaut: Points et Triangles)
-\r_depthfirst\Éviter des problèmes de profondeur de rendu en faisant un rendu de profondeur de la carte/joueurs avant le rendu "standard" (par défaut: désactivé)
-\gl_texturecompression\Compresser les textures pour économiser de la mémoire graphique (par défaut: aucun)
-\gl_finish\Faire attendre le processeur que le rendu graphique se finisse pour éviter des problèmes d'affichage divers (par défaut: désactivé)
-\v_brightness\Luminosité du noir (par défaut: 0)
-\v_contrast\Luminosité du blanc (par défaut: 1)
-\v_gamma\Correction du gamma ne changeant pas la luminosité du noir ou du blanc (par défaut: 1.125)
-\v_contrastboost\Multiplier le constraste dans des salles sombres (par défaut: 1)
-\r_glsl_saturation\Ajustement de la saturation (0 = noir et blanc, 1 = normal, 2 = saturé) des couleurs (par défaut: 1)
-\v_glslgamma\Utiliser GLSL pour corriger le gamma, attention, cela risque d'augementer fortement l'utilisation de ressources (par défaut: désactivé)
-\r_ambient\Lumière ambiente, si elle est trop élévée, les cartes auront un éclairage plus "plat" et moins contrasté
-\r_hdr_scenebrightness\Éclairage du rendu global (par défaut: 1)
-\vid_samples\Activer l'anticrénelage, réduit l'effet d'escalier sur les modèles 3D, mais augmente fortement l'utilisation des ressources
-\v_flipped\Mode mirroir (par défaut: désactivé)
+\vid_bitsperpixel\Profondeur des couleurs : 16 bits est plus rapide, mais 32 bits est de meilleure qualité (recommandé)
+\vid_fullscreen\Activer le mode plein écran (par défaut : activé)
+\vid_vsync\Activer la syncronisation verticale pour éviter des problèmes d'affichage, limite le nombre maximum d'images par seconde (par défaut : désactivé)
+\gl_texture_anisotropy\Qualité du filtrage anistrope (par défaut : 1x)
+\r_glsl\Activer les Shaders OpenGL 2.0 pour des effets de lumière améliorés (par défaut : désactivé)
+\gl_vbo\Utiliser les VBOs pour stocker les modèles 3D statiques dans la mémoire pour une meilleure performance (par défaut : Points et Triangles)
+\r_depthfirst\Éviter des problèmes de profondeur de rendu en faisant un rendu de profondeur de la carte/joueurs avant le rendu "standard" (par défaut : désactivé)
+\gl_texturecompression\Compresser les textures pour économiser de la mémoire graphique (par défaut : aucun)
+\gl_finish\Demander au processeur d'attendre la fin du rendu graphique afin éviter des problèmes d'affichage divers (par défaut : désactivé)
+\v_brightness\Luminosité du noir (par défaut : 0)
+\v_contrast\Luminosité du blanc (par défaut : 1)
+\v_gamma\Correction du gamma n'affectant pas la luminosité du noir ou du blanc (par défaut : 1.125)
+\v_contrastboost\Multiplier le constraste dans les salles sombres (par défaut : 1)
+\r_glsl_saturation\Ajustement de la saturation (0 = noir et blanc, 1 = normal, 2 = saturé) des couleurs (par défaut : 1)
+\v_glslgamma\Utiliser GLSL pour corriger le gamma, attention, cela risque d'augementer fortement l'utilisation de ressources (par défaut : désactivé)
+\r_ambient\Lumière ambiante, si elle est trop élévée, les cartes auront un éclairage plus "plat" et moins contrasté (par défaut : 4)
+\r_hdr_scenebrightness\Éclairage du rendu global (par défaut : 1)
+\vid_samples\Activer l'anticrénelage, réduit l'effet d'escalier sur les modèles 3D, mais augmente fortement l'utilisation des ressources (par défaut : désactivé)
+\v_flipped\Mode miroir (par défaut : désactivé)
\XonoticSettingsDialog/Graphiques\Paramètres des effets graphiques
-\r_subdivisions_tolerance\Ajuster la qualité des modèles 3D de carte (courbes, tuyaux) (par défaut: normal)
-\gl_picmip\Ajuster la qualité des textures. La baisser diminue l'utilisation des ressources, mais rend les textures floues. (par défaut: normal)
-\r_picmipworld\If set, only reduce the texture quality of models (default: enabled)
-\mod_q3bsp_nolightmaps\Utiliser des lightmaps haute résolution, augmente l'utilisation des resources, mais rend les lightmaps plus nettes (par défaut: activé)
-\cl_particles_quality\Nombre de particules; moins de particules consomment moins de ressources (par défaut: 1.0)
-\r_drawparticles_drawdistance\Toutes les particules qui sont plus loin que cette distance ne seront pas affichées (par défaut: 1000)
-\cl_decals\Activer les marques d'impacts et de sang (par défaut: activé)
-\r_drawdecals_drawdistance\Toutes les marques d'impacts qui sont plus loin que cette distance ne seront pas affichées (par défaut: 300)
-\cl_decals_time\Temps en secondes avant que les marques d'impacts disparaissent (par défaut: 2 secondes)
-\cl_gentle\Remplacer les effets gore par des effets moins violents (par défaut: désactivé)
-\cl_nogibs\Réduire le nombre de Gibs ou les désactiver totalement (par défaut: beaucoup)
-\v_kicktime\Faire trembler la vue en recevant des dégâts (par défaut: 0)
-\r_glsl_deluxemapping\Utiliser les effets lumineux avancés (par défaut: activé)
-\r_shadow_gloss\Utiliser le reflet des textures (par défaut: activé)
-\gl_flashblend\Enable faster but uglier dynamic lights by rendering bright coronas instead of real dynamic lights (default: disabled)
-\r_shadow_realtime_dlight\Activer le rendu des lumières dynamiques en temps réel (par défaut: activé)
-\r_shadow_realtime_dlight_shadows\Activer le rendu des ombres depuis les lumières dynamiques en temps réel (par défaut: désactivé)
-\r_shadow_realtime_world\Activer le rendu des lumières carte en temps réel, a un gros impact sur la performance (par défaut: désactivé)
-\r_shadow_realtime_world_shadows\Activer le rendu des ombres depuis les lumières carte en temps réel, a un impact sur la performance aussi (par défaut: désactivé)
-\r_shadow_usenormalmap\Utiliser des effets d'ombrage de lumière sur les textures (par défaut: activé)
-\r_showsurfaces\Désactiver les textures et les remplacer par des couleurs unies. Utile pour les configurations très faible, mais laid. (par défaut: désactivé)
-\r_glsl_offsetmapping\Activer l'effet de relief sur les textures, a un léger impact sur la performance (par défaut: désactivé)
-\r_glsl_offsetmapping_reliefmapping\Augmenter la qualité des effets de relief sur les textures, a un gros impact sur la performance (par défaut: désactivé)
-\r_water\Activer des reflets de réflecion et de réfraction d'eau et des portails Warpzone (par défaut: désactivé)
-\r_water_resolutionmultiplier\Qualité des reflets d'eau et des portails Warpzone, l'augmenter a un gros impact sur la performance (par défaut: bon)
-\r_coronas\Activer des effets d'éblouissement peu gourmands (par défaut: activé)
-\r_coronas_occlusionquery\Prendre en compte la visibilité pour les effets "Brillance Lumière" (par défaut: activé)
-\r_bloom\Activer un effet d'éblouissement plus beau, mais gourmand (par défaut: désactivé)
-\r_hdr\Activer un effet d'ébloissement encore plus beau, mais encore plus gourmand (par défaut: désactivé)
+\r_subdivisions_tolerance\Ajuster la qualité des modèles 3D de la carte (courbes, tuyaux) (par défaut : normal)
+\gl_picmip\Ajuster la qualité des textures. La baisser diminue l'utilisation des ressources, mais rend les textures floues. (par défaut : bon)
+\r_picmipworld\Si activé, réduira uniquement la qualité des textures des joueurs (par défaut : activé)
+\mod_q3bsp_nolightmaps\Utiliser des lightmaps haute résolution, augmente l'utilisation de la mémoire, mais rend les lightmaps plus nettes (par défaut : activé)
+\cl_particles_quality\Nombre de particules ; moins de particules consomment moins de ressources (par défaut : 1)
+\r_drawparticles_drawdistance\Toutes les particules situées au-delà de cette distance ne seront pas affichées (par défaut : 1000)
+\cl_decals\Activer les marques d'impacts et de sang (par défaut : activé)
+\r_drawdecals_drawdistance\Toutes les marques d'impacts qui sont plus loin que cette distance ne seront pas affichées (par défaut : 300)
+\cl_decals_time\Durée en secondes avant que les marques d'impacts ne disparaissent (par défaut : 2)
+\cl_gentle\Remplacer les effets gores par des effets moins violents (par défaut : désactivé)
+\cl_nogibs\Réduire les effets gores ou les désactiver totalement (par défaut : beaucoup)
+\v_kicktime\Faire trembler la vue lorsque vous êtes touché (durée par défaut : 0)
+\r_glsl_deluxemapping\Utiliser les effets lumineux avancés (par défaut : activé)
+\r_shadow_gloss\Utiliser le reflet des textures (par défaut : activé)
+\gl_flashblend\Activer les lumières dynamiques rapides - mais plus laides - en affichant des couronnes de lumière à la place des vraies lumières dynamiques (par défaut : désactivé)
+\r_shadow_realtime_dlight\Activer le rendu des lumières dynamiques des explosions et des roquettes (par défaut : activé)
+\r_shadow_realtime_dlight_shadows\Activer le rendu des ombres depuis les lumières dynamiques en temps réel (par défaut : désactivé)
+\r_shadow_realtime_world\Activer le rendu des lumières carte en temps réel, a un gros impact sur la performance (par défaut : désactivé)
+\r_shadow_realtime_world_shadows\Activer le rendu des ombres depuis les lumières carte en temps réel (par défaut : désactivé)
+\r_shadow_usenormalmap\Utiliser des effets d'ombrage de lumière sur les textures (par défaut : activé)
+\r_showsurfaces\Désactiver les textures et les remplacer par des couleurs unies. Utile pour les configurations très légères, mais le rendu est très laid. (par défaut : désactivé)
+\r_glsl_offsetmapping\Activer l'effet de relief sur les textures, a un léger impact sur la performance (par défaut : désactivé)
+\r_glsl_offsetmapping_reliefmapping\Augmenter la qualité des effets de relief sur les textures, a un gros impact sur la performance (par défaut : désactivé)
+\r_water\Qualité des reflets et de la réfraction de l'eau et des portails, a un gros impact sur la performance dans les cartes avec des surfaces réfléchissantes (par défaut : désactivé)
+\r_water_resolutionmultiplier\Résolution des reflets/réfractions (par défaut : bon)
+\r_coronas\Activer des effets d'éblouissement peu gourmands autour de certaines sources de lumière (par défaut : activé)
+\r_coronas_occlusionquery\Estomper les effets d'éblouissement pour ne pas perdre en visibilité (par défaut : activé)
+\r_bloom\Activer l'effet "bloom", qui éclaire les pixels situés au voisinage de pixels très brillants. A un gros impact sur la performance (par défaut : désactivé)
+\r_hdr\Effet "bloom" de qualité encore supérieure, mais encore plus gourmand (par défaut : désactivé)
\r_motionblur\Intensité du flou de mouvement - 0.4 est recommandé
+\hud_postprocessing_maxbluralpha\Activer des effets de postprocessing spéciaux lorque vous êtes touché, lorsque vous êtes sous l'eau ou lorsque vous utilisez un bonus (par défaut : désactivé)
-\XonoticSettingsDialog/Audio\Audio settings
+\XonoticSettingsDialog/Audio\Paramètres audio
\mastervolume\-
\bgmvolume\-
\snd_staticvolume\-
\snd_channel1volume\-
\snd_speed\Fréquence de la sortie audio
\snd_channels\Nombre de canaux pour la sortie audio
-\snd_swapstereo\Échanger les canneaux stéréo gauche/droite
-\snd_spatialization_control\Essayer de diminuer le "constraste" entre la partie gauche et droite du casque audio pour un meilleur son
-\cl_voice_directional\Activer les voix des personnages sur la carte
-\cl_voice_directional_taunt_attenuation\Distance à laquelle les voix sont audibles
-\cl_autotaunt\Automatiquement narguer les enemis quand vous les tuez
-\cl_sound_maptime_warning\Voix (en anglais) qui vous dit le temps restant avant la fin du match
-\cl_hitsound\Jouer un son quand vous touchez un enemi
-\menu_sounds\Jouer des sons en cliquant ou en passant la souris sur des options
-
-\XonoticSettingsDialog/Réseau\Paramètres du jeu en réseau
+\snd_swapstereo\Inverser les canaux stéréo gauche/droite
+\snd_spatialization_control\Essayer de diminuer le "contraste" entre la partie gauche et droite du casque pour un meilleur son
+\cl_voice_directional\Activer les voix directionnelles des personnages sur la carte
+\cl_voice_directional_taunt_attenuation\Distance jusqu'à laquelle les voix demeurent audibles
+\cl_autotaunt\Automatiquement narguer les ennemis lorsque vous les tuez
+\cl_sound_maptime_warning\Voix (en anglais) qui annonce le temps restant avant la fin du match
+\cl_hitsound\Jouer un son lorsque vous touchez un ennemi
+\menu_sounds\Jouer des sons en cliquant ou en survolant des boutons
+
+\XonoticSettingsDialog/Réseau\Paramètres réseau
\cl_movement\Activer la prédiction des mouvements du joueur pour éviter les saccades lors de parties en réseau
\cl_nolerp\Algorithme pour éviter les saccades lors de parties en réseau
-\shownetgraph\Show a graph of packet sizes and other information
-\_cl_rate\Specify your network speed with this slider
-\cl_netfps\Nombre maximum de paquets à envoyer au server chaque seconde
-\cl_curl_maxdownloads\Nombre maximum de téléchargements simultanés
-\cl_curl_maxspeed\Vitesse maximum de téléchargement
-\cl_port\Forcer le client à passer par le port défini (UDP) s'il n'est pas 0
+\shownetgraph\Afficher la taille des paquets et d'autres informations dans un graphique
+\_cl_rate\Spécifier la vitesse de votre réseau avec ce curseur
+\cl_netfps\Nombre maximum de paquets à envoyer au serveur chaque seconde
+\cl_curl_maxdownloads\Nombre maximum de téléchargements simultanés en HTTP/FTP
+\cl_curl_maxspeed\Vitesse maximale de téléchargement
+\cl_port\Forcer le client à passer par le port choisi sauf s'il est défini à 0
\XonoticSettingsDialog/Autres\Autres paramètres
-\menu_tooltips\Menu tooltips: disabled, standard or advanced (also shows cvar or console command bound to the menu item)
-\showtime\Montrer l'heure, utile pour les captures d'écran
-\showdate\Montrer la date, utile pour les captures d'écran
-\showfps\Montrer le nombre d'Images Par Seconde rendues (Frames Per Second = FPS)
+\menu_tooltips\Info-bulles : désactivé, standard ou avancé (affiche aussi la cvar ou la commande associée)
+\showtime\Afficher l'heure, utile pour les captures d'écran
+\showdate\Afficher la date, utile pour les captures d'écran
+\showfps\Afficher le nombre d'images par seconde actuel (FPS = Frames Per Second)
\XonoticSettingsDialog/Advanced settings...\Paramètres avancés pour configuer le jeu dans ses moindres détails
\g_friendlyfire\Pourcentage de dégâts infligés aux équipiers si vous les touchez
\g_mirrordamage\Pourcentage de dégâts infligés aux équipiers qui vous sera renvoyé
-\g_tdm_teams_override\Écraser le nombre d'équipes défini par la carte
+\g_tdm_teams_override\Outrepasser le nombre d'équipes définies par la carte
\viewsize\Enable/Désactiver l'arrière plan de l'interface
-\cl_hidewaypoints\Montrer/Cacher les Waypoints (flèches 3D)
-\g_waypointsprite_scale\Ajuster la taille des Waypoints
-\g_waypointsprite_alpha\Ajuster l'opacité des Waypoints
-\cl_shownames\Afficher le nom du joueur que vous pointez avec votre viseur
+\cl_hidewaypoints\Afficher les waypoints (flèches 3D)
+\g_waypointsprite_scale\Ajuster la taille des waypoints
+\g_waypointsprite_alpha\Ajuster l'opacité des waypoints
+\cl_shownames\Afficher le nom du joueur que vous avez dans votre viseur
-\crosshair_hittest\Aucun: aucun effet de viseur - TrueAim: rendre le viseur flou si vous risquez de vous blesser vous même ou un équipier - Enemis: rendre le viseur plus grand si vous pouvez toucher un enemi
+\crosshair_hittest\Aucun: aucun effet de viseur - TrueAim: rendre le viseur flou si vous risquez de tirer dans un mur - Ennemis: rendre le viseur plus grand si vous pouvez toucher un ennemi