From: Rudolf Polzer Date: Sun, 19 Feb 2012 15:03:55 +0000 (+0100) Subject: indicate mod in menu HUD if sent by the server; detect minstagib and CTS and send... X-Git-Tag: xonotic-v0.6.0~66^2~15 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7587f761ea3fafc4a91425cc044124d0d08709b6;p=xonotic%2Fxonotic-data.pk3dir.git indicate mod in menu HUD if sent by the server; detect minstagib and CTS and send as mod string already --- diff --git a/balance25.cfg b/balance25.cfg index 420020622..51bb152dd 100644 --- a/balance25.cfg +++ b/balance25.cfg @@ -1,3 +1,5 @@ +g_mod_balance Nexuiz25 + // {{{ starting gear set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms" set g_start_weapon_shotgun -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms" diff --git a/balanceFruitieX.cfg b/balanceFruitieX.cfg index 221f725a5..ced09e7d1 100644 --- a/balanceFruitieX.cfg +++ b/balanceFruitieX.cfg @@ -1,3 +1,5 @@ +g_mod_balance FruitieX + // {{{ starting gear set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms" set g_start_weapon_shotgun -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms" diff --git a/balanceXPM.cfg b/balanceXPM.cfg index 574af5b2f..c439c3218 100644 --- a/balanceXPM.cfg +++ b/balanceXPM.cfg @@ -1,3 +1,5 @@ +g_mod_balance XPM + // {{{ starting gear set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms" set g_start_weapon_shotgun -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms" diff --git a/balanceXonotic.cfg b/balanceXonotic.cfg index c411b883d..4648f4ac4 100644 --- a/balanceXonotic.cfg +++ b/balanceXonotic.cfg @@ -1,3 +1,5 @@ +g_mod_balance Xonotic + // {{{ starting gear set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms" set g_start_weapon_shotgun -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms" diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 30c70dd0b..bd85db335 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1858,6 +1858,12 @@ set g_playerstats_debug 0 "when 1, player stats are dumped to the console too" // autoscreenshots set g_max_info_autoscreenshot 3 "how many info_autoscreenshot entities are allowed" +// mod names for server browser +// note: the lowest of these that mismatches default is used +set g_mod_physics "" "Current physics config name" +set g_mod_balance "" "Current balance config name" +set g_mod_config "" "Current config mod name" + // session locking locksession 1 diff --git a/physicsCPMA.cfg b/physicsCPMA.cfg index 620ec882e..9734cfc6f 100644 --- a/physicsCPMA.cfg +++ b/physicsCPMA.cfg @@ -1,4 +1,6 @@ +g_mod_physics CPMA // these values match CPMA + sv_gravity 800 sv_maxspeed 320 sv_maxairspeed 320 diff --git a/physicsFruit.cfg b/physicsFruit.cfg index 1afb26330..5f65d66d8 100644 --- a/physicsFruit.cfg +++ b/physicsFruit.cfg @@ -1,4 +1,6 @@ +g_mod_physics Fruit // physicsNoQWBunny.cfg vs physicsXPM.cfg + sv_gravity 800 sv_maxspeed 320 sv_maxairspeed 320 diff --git a/physicsHavoc.cfg b/physicsHavoc.cfg index d78346e1b..f10715872 100644 --- a/physicsHavoc.cfg +++ b/physicsHavoc.cfg @@ -1,4 +1,6 @@ +g_mod_physics Havoc // Xonotic Havoc physics (work in progress) + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 220 diff --git a/physicsLeeStricklin-ModdedFruit.cfg b/physicsLeeStricklin-ModdedFruit.cfg index 21bafef57..3553a94a7 100644 --- a/physicsLeeStricklin-ModdedFruit.cfg +++ b/physicsLeeStricklin-ModdedFruit.cfg @@ -1,4 +1,6 @@ +g_mod_physics LeeStricklin-ModdedFruit // "NoQWBunny" physics based on XPM + sv_gravity 800 sv_maxspeed 424 sv_maxairspeed 400 diff --git a/physicsLeeStricklin.cfg b/physicsLeeStricklin.cfg index 3c740da33..e4aef4440 100644 --- a/physicsLeeStricklin.cfg +++ b/physicsLeeStricklin.cfg @@ -1,4 +1,6 @@ +g_mod_physics LeeStricklin // "NoQWBunny" physics based on XPM + sv_gravity 800 sv_maxspeed 320 sv_maxairspeed 424 diff --git a/physicsLeeStricklinOld.cfg b/physicsLeeStricklinOld.cfg index d240d991b..eda92ac69 100644 --- a/physicsLeeStricklinOld.cfg +++ b/physicsLeeStricklinOld.cfg @@ -1,5 +1,7 @@ +g_mod_physics LeeStricklinOld // These have been modified from Nexuiz 2.4.2's physicsQBR.cfg file and a bunch of other crap div0 threw on here :P // DO NOT SCREW WITH friction on land, edge friction, step height, or sv_airaccel_qw + sv_gravity 819 sv_maxspeed 420 sv_maxairspeed 283 diff --git a/physicsLzd.cfg b/physicsLzd.cfg index 86b4bdcf0..cd76c2fe3 100644 --- a/physicsLzd.cfg +++ b/physicsLzd.cfg @@ -1,5 +1,7 @@ +g_mod_physics Lzd //LZD Physics Config v0.1 //By PCLizard and Oh Hai :) + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 300 diff --git a/physicsNexuiz10.cfg b/physicsNexuiz10.cfg index a6673a28e..6c99b307f 100644 --- a/physicsNexuiz10.cfg +++ b/physicsNexuiz10.cfg @@ -1,4 +1,6 @@ +g_mod_physics Nexuiz10 // Xonotic 1.0 physics + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 100 diff --git a/physicsNexuiz11.cfg b/physicsNexuiz11.cfg index 60459c374..65a6a4b6f 100644 --- a/physicsNexuiz11.cfg +++ b/physicsNexuiz11.cfg @@ -1,4 +1,6 @@ +g_mod_physics Nexuiz11 // Xonotic 1.5 physics + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 50 diff --git a/physicsNexuiz151.cfg b/physicsNexuiz151.cfg index b099d4cf3..833a67dce 100644 --- a/physicsNexuiz151.cfg +++ b/physicsNexuiz151.cfg @@ -1,4 +1,6 @@ +g_mod_physics Nexuiz151 // experimental post-Xonotic 1.5 physics (never released) + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 50 diff --git a/physicsNexuiz151b.cfg b/physicsNexuiz151b.cfg index 8821b5a31..31380c973 100644 --- a/physicsNexuiz151b.cfg +++ b/physicsNexuiz151b.cfg @@ -1,4 +1,6 @@ +g_mod_physics Nexuiz151b // experimental post-Xonotic 1.5 physics (never released) + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 25 diff --git a/physicsNexuiz16rc1.cfg b/physicsNexuiz16rc1.cfg index ff6343f78..f3a85e50b 100644 --- a/physicsNexuiz16rc1.cfg +++ b/physicsNexuiz16rc1.cfg @@ -1,4 +1,6 @@ +g_mod_physics Nexuiz16rc1 // experimental post-Xonotic 1.5 physics (never released) + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 50 diff --git a/physicsNexuiz20.cfg b/physicsNexuiz20.cfg index 0834bb5aa..60071e184 100644 --- a/physicsNexuiz20.cfg +++ b/physicsNexuiz20.cfg @@ -1,4 +1,6 @@ +g_mod_physics Nexuiz20 // Quake, Bunny Reintroduced (Xonotic 2.0 to 2.4.2 physics) + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 220 diff --git a/physicsNexuiz25.cfg b/physicsNexuiz25.cfg index 8c5ab5e85..dd984bb31 100644 --- a/physicsNexuiz25.cfg +++ b/physicsNexuiz25.cfg @@ -1,4 +1,6 @@ +g_mod_physics Nexuiz25 // Xonotic 2.5 physics + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 220 diff --git a/physicsNexuiz26.cfg b/physicsNexuiz26.cfg index 4e104d1aa..827bbc55c 100644 --- a/physicsNexuiz26.cfg +++ b/physicsNexuiz26.cfg @@ -1,4 +1,6 @@ +g_mod_physics Nexuiz26 // Xonotic 2.6 physics + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 220 diff --git a/physicsNoQWBunny-nexbased.cfg b/physicsNoQWBunny-nexbased.cfg index e74b332ed..f8d43c4f2 100644 --- a/physicsNoQWBunny-nexbased.cfg +++ b/physicsNoQWBunny-nexbased.cfg @@ -1,4 +1,6 @@ +g_mod_physics NoQWBunny-nexbased // "NoQWBunny" physics based on Nexuiz 2.0-2.4.2 + sv_gravity 800 sv_maxspeed 360 sv_maxairspeed 400 diff --git a/physicsQ.cfg b/physicsQ.cfg index 1eb53ab38..c26745629 100644 --- a/physicsQ.cfg +++ b/physicsQ.cfg @@ -1,4 +1,6 @@ +g_mod_physics Q // Quake 1 + sv_gravity 800 sv_maxspeed 320 sv_maxairspeed 30 diff --git a/physicsQ2.cfg b/physicsQ2.cfg index 2e3c0af6f..05e2f1456 100644 --- a/physicsQ2.cfg +++ b/physicsQ2.cfg @@ -1,4 +1,6 @@ +g_mod_physics Q2 // Quake 2 + sv_gravity 800 sv_maxspeed 300 sv_maxairspeed 300 diff --git a/physicsQ2a.cfg b/physicsQ2a.cfg index 2d223a205..9b953e32e 100644 --- a/physicsQ2a.cfg +++ b/physicsQ2a.cfg @@ -1,4 +1,6 @@ +g_mod_physics Q2a // Quake 2 if pm_airaccelerate were set to 10 and not 0 (Q1-like) + sv_gravity 800 sv_maxspeed 300 sv_maxairspeed 30 diff --git a/physicsQ3.cfg b/physicsQ3.cfg index b3fdf41a8..eed1c7409 100644 --- a/physicsQ3.cfg +++ b/physicsQ3.cfg @@ -1,4 +1,6 @@ +g_mod_physics Q3 // these values match Quake3 + sv_gravity 800 sv_maxspeed 320 sv_maxairspeed 320 diff --git a/physicsQBF.cfg b/physicsQBF.cfg index 390cb968a..8dff0edd9 100644 --- a/physicsQBF.cfg +++ b/physicsQBF.cfg @@ -1,4 +1,6 @@ +g_mod_physics QBF // Quake, Bunny Fixed (feels very slow) + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 250 diff --git a/physicsQBFplus.cfg b/physicsQBFplus.cfg index 8c1a78f3b..634b6083e 100644 --- a/physicsQBFplus.cfg +++ b/physicsQBFplus.cfg @@ -1,4 +1,6 @@ +g_mod_physics QBFplus // Quake, Bunny Fixed Plus (faster using forward hopping) + sv_gravity 800 sv_maxspeed 400 sv_maxairspeed 220 diff --git a/physicsSamual.cfg b/physicsSamual.cfg index 178eed0ae..8019089bf 100644 --- a/physicsSamual.cfg +++ b/physicsSamual.cfg @@ -1,4 +1,6 @@ +g_mod_physics Samual // Mix of 2.3 physics and NANL physics, goal of going for faster movement + sv_gravity 800 sv_maxspeed 420 sv_maxairspeed 235 diff --git a/physicsWarsow.cfg b/physicsWarsow.cfg index 6cae75a79..7d66b3716 100644 --- a/physicsWarsow.cfg +++ b/physicsWarsow.cfg @@ -1,4 +1,6 @@ +g_mod_physics Warsow // these values match Warsow 0.42 + sv_gravity 850 sv_maxspeed 320 sv_maxairspeed 320 diff --git a/physicsWarsowClassicBunny.cfg b/physicsWarsowClassicBunny.cfg index 5c0c81c8f..1dbb14a90 100644 --- a/physicsWarsowClassicBunny.cfg +++ b/physicsWarsowClassicBunny.cfg @@ -1,4 +1,6 @@ +g_mod_physics WarsowClassicBunny // these values match Warsow 0.42 GS_CLASSICBUNNY + sv_gravity 850 sv_maxspeed 320 sv_maxairspeed 320 diff --git a/physicsWarsowDev.cfg b/physicsWarsowDev.cfg index 0c30fcd9a..f2f989d75 100644 --- a/physicsWarsowDev.cfg +++ b/physicsWarsowDev.cfg @@ -1,4 +1,6 @@ +g_mod_physics WarsowDev // these values match Warsow 0.42 + sv_gravity 850 sv_maxspeed 320 sv_maxairspeed 320 diff --git a/physicsX.cfg b/physicsX.cfg index 7a78d3726..e2a3ef648 100644 --- a/physicsX.cfg +++ b/physicsX.cfg @@ -1,4 +1,6 @@ +g_mod_physics Xonotic // current Xonotic physics + sv_gravity 800 sv_maxspeed 360 sv_maxairspeed 360 diff --git a/physicsX010.cfg b/physicsX010.cfg index bda627271..77926d05f 100644 --- a/physicsX010.cfg +++ b/physicsX010.cfg @@ -1,4 +1,6 @@ +g_mod_physics Xonotic010 // Xonotic 0.1.0preview physics + sv_gravity 800 sv_maxspeed 360 sv_maxairspeed 400 diff --git a/physicsXPM.cfg b/physicsXPM.cfg index f78153948..55e2ef01d 100644 --- a/physicsXPM.cfg +++ b/physicsXPM.cfg @@ -1,4 +1,6 @@ +g_mod_physics XPM // Nexrun tweaked to suit CPM + sv_gravity 800 sv_maxspeed 320 // CPMA: 320 diff --git a/physicsXPMLight.cfg b/physicsXPMLight.cfg index 3a8b8e150..d0f31c2c0 100644 --- a/physicsXPMLight.cfg +++ b/physicsXPMLight.cfg @@ -1,4 +1,6 @@ +g_mod_physics XPMLight // Nexrun tweaked to suit CPM + sv_gravity 800 sv_maxspeed 320 // CPMA: 320 diff --git a/qcsrc/common/util-pre.qh b/qcsrc/common/util-pre.qh index 5a22d3612..518a5698d 100644 --- a/qcsrc/common/util-pre.qh +++ b/qcsrc/common/util-pre.qh @@ -5,4 +5,5 @@ //# define WORKAROUND_XON010 //# define COMPAT_XON010_CHANNELS # define COMPAT_XON050_ENGINE +# define COMPAT_NO_MOD_IS_XONOTIC #endif diff --git a/qcsrc/menu/skin-customizables.inc b/qcsrc/menu/skin-customizables.inc index 3eb91ee9d..bfbe8021f 100644 --- a/qcsrc/menu/skin-customizables.inc +++ b/qcsrc/menu/skin-customizables.inc @@ -230,6 +230,7 @@ SKINBEGIN SKINFLOAT(ALPHA_SERVERLIST_IMPOSSIBLE, 0.7); SKINVECTOR(COLOR_SERVERLIST_IMPOSSIBLE, '0.3 0.3 0.3'); SKINSTRING(GFX_SERVERLIST_ICON, "icon"); + SKINFLOAT(ALPHA_SERVERLIST_ICON_NONPURE, 0.5); // item: server info SKINVECTOR(COLOR_SERVERINFO_NAME, '1 1 1'); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c b/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c index 368785705..33a06b7bc 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c @@ -40,15 +40,6 @@ CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog) ATTRIB(XonoticServerInfoDialog, pureLabel, entity, NULL) ENDCLASS(XonoticServerInfoDialog) -float SLIST_FIELD_NAME; -float SLIST_FIELD_CNAME; -float SLIST_FIELD_QCSTATUS; -float SLIST_FIELD_MAP; -float SLIST_FIELD_PLAYERS; -float SLIST_FIELD_NUMHUMANS; -float SLIST_FIELD_MAXPLAYERS; -float SLIST_FIELD_NUMBOTS; -float SLIST_FIELD_MOD; void Join_Click(entity btn, entity me); #endif @@ -56,7 +47,7 @@ void Join_Click(entity btn, entity me); void XonoticServerInfoDialog_loadServerInfo(entity me, float i) { float m, pure, freeslots, j, numh, maxp, numb, sflags; - string s, typestr, versionstr, k, v; + string s, typestr, versionstr, k, v, modname; // ==================================== // First clear and unzone the strings @@ -120,11 +111,9 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) // ========================== // Now, fill in the strings // ========================== - SLIST_FIELD_NAME = gethostcacheindexforkey("name"); me.currentServerName = strzone(gethostcachestring(SLIST_FIELD_NAME, i)); me.nameLabel.setText(me.nameLabel, me.currentServerName); - SLIST_FIELD_CNAME = gethostcacheindexforkey("cname"); me.currentServerCName = strzone(gethostcachestring(SLIST_FIELD_CNAME, i)); me.cnameLabel.setText(me.cnameLabel, me.currentServerCName); @@ -132,7 +121,6 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) typestr = _("N/A"); versionstr = _("N/A"); - SLIST_FIELD_QCSTATUS = gethostcacheindexforkey("qcstatus"); s = gethostcachestring(SLIST_FIELD_QCSTATUS, i); m = tokenizebyseparator(s, ":"); if(m >= 2) @@ -142,6 +130,7 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) } freeslots = -1; sflags = -1; + modname = ""; for(j = 2; j < m; ++j) { if(argv(j) == "") @@ -154,27 +143,34 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) freeslots = stof(v); else if(k == "F") sflags = stof(v); + else if(k == "M") + modname = v; } +#ifdef COMPAT_NO_MOD_IS_XONOTIC + if(modname == "") + modname = "Xonotic"; +#endif + + s = gethostcachestring(SLIST_FIELD_MOD, i); + if(s != "data") + if(modname == "Xonotic") + modname = s; + j = MapInfo_Type_FromString(typestr); // try and get the real name of the game type if(j) { typestr = MapInfo_Type_ToText(j); } // only set it if we actually found it me.currentServerType = strzone(typestr); me.typeLabel.setText(me.typeLabel, me.currentServerType); - SLIST_FIELD_MAP = gethostcacheindexforkey("map"); me.currentServerMap = strzone(gethostcachestring(SLIST_FIELD_MAP, i)); me.mapLabel.setText(me.mapLabel, me.currentServerMap); - SLIST_FIELD_PLAYERS = gethostcacheindexforkey("players"); me.currentServerPlayers = strzone(gethostcachestring(SLIST_FIELD_PLAYERS, i)); me.rawPlayerList.setPlayerList(me.rawPlayerList, me.currentServerPlayers); - SLIST_FIELD_NUMHUMANS = gethostcacheindexforkey("numhumans"); numh = gethostcachenumber(SLIST_FIELD_NUMHUMANS, i); - SLIST_FIELD_MAXPLAYERS = gethostcacheindexforkey("maxplayers"); maxp = gethostcachenumber(SLIST_FIELD_MAXPLAYERS, i); - SLIST_FIELD_NUMBOTS = gethostcacheindexforkey("numbots"); numb = gethostcachenumber(SLIST_FIELD_NUMBOTS, i); me.currentServerNumPlayers = strzone(sprintf(_("%d/%d"), numh, maxp)); me.numPlayersLabel.setText(me.numPlayersLabel, me.currentServerNumPlayers); @@ -188,10 +184,8 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) me.currentServerNumFreeSlots = strzone(s); me.numFreeSlotsLabel.setText(me.numFreeSlotsLabel, me.currentServerNumFreeSlots); - SLIST_FIELD_MOD = gethostcacheindexforkey("mod"); - s = gethostcachestring(SLIST_FIELD_MOD, i); - s = ((s == "data") ? _("Default") : s); - me.currentServerMod = strzone(s); + me.currentServerMod = ((modname == "Xonotic") ? _("Default") : modname); + me.currentServerMod = strzone(modname); me.modLabel.setText(me.modLabel, me.currentServerMod); me.currentServerVersion = strzone(versionstr); diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index 82fdbfb5e..8c003b900 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -64,9 +64,7 @@ void ServerList_Filter_Change(entity box, entity me); void ServerList_Favorite_Click(entity btn, entity me); void ServerList_Info_Click(entity btn, entity me); void ServerList_Update_favoriteButton(entity btn, entity me); -#endif -#ifdef IMPLEMENTATION float SLIST_FIELD_CNAME; float SLIST_FIELD_PING; float SLIST_FIELD_GAME; @@ -82,6 +80,9 @@ float SLIST_FIELD_FREESLOTS; float SLIST_FIELD_PLAYERS; float SLIST_FIELD_QCSTATUS; float SLIST_FIELD_ISFAVORITE; +#endif + +#ifdef IMPLEMENTATION void ServerList_UpdateFieldIDs() { SLIST_FIELD_CNAME = gethostcacheindexforkey( "cname" ); @@ -600,7 +601,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float vector theColor; float theAlpha; float m, pure, freeslots, j, sflags; - string s, typestr, versionstr, k, v; + string s, typestr, versionstr, k, v, modname; if(isSelected) draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED); @@ -614,6 +615,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float } freeslots = -1; sflags = -1; + modname = ""; for(j = 2; j < m; ++j) { if(argv(j) == "") @@ -626,8 +628,27 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float freeslots = stof(v); else if(k == "F") sflags = stof(v); + else if(k == "M") + modname = v; } +#ifdef COMPAT_NO_MOD_IS_XONOTIC + if(modname == "") + modname = "Xonotic"; +#endif + + SLIST_FIELD_MOD = gethostcacheindexforkey("mod"); + s = gethostcachestring(SLIST_FIELD_MOD, i); + if(s != "data") + if(modname == "Xonotic") + modname = s; + + // list the mods here on which the pure server check actually works + if(modname != "Xonotic") + if(modname != "MinstaGib") + if(modname != "CTS") + pure = 0; + if(gethostcachenumber(SLIST_FIELD_FREESLOTS, i) <= 0) theAlpha = SKINALPHA_SERVERLIST_FULL; else if(freeslots == 0) @@ -731,8 +752,23 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), iconSize, '1 1 1', 1); iconPos_x += iconSize_x; - if(pure == 0) - draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), iconSize, '1 1 1', 1); + if(modname == "Xonotic") + { + if(pure == 0) + draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), iconSize, '1 1 1', 1); + } + else + { + string n; + n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_", modname); + if(draw_PictureSize(n) != '0 0 0') + { + 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)) diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 22d9e54d6..61e3215e1 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -654,3 +654,5 @@ typedef vector(entity player, entity spot, vector current) spawn_evalfunc_t; .spawn_evalfunc_t spawn_evalfunc; .entity conveyor; + +string modname; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index f699ababc..acf820803 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -301,6 +301,7 @@ void cvar_changes_init() BADCVAR("g_domination_point_leadlimit"); BADCVAR("g_forced_respawn"); BADCVAR("g_keyhunt_point_leadlimit"); + BADPREFIX("g_mod_"); BADCVAR("g_nexball_goalleadlimit"); BADCVAR("g_runematch_point_leadlimit"); BADCVAR("leadlimit_and_fraglimit"); @@ -908,6 +909,22 @@ void spawnfunc_worldspawn (void) PlayerStats_Init(); + modname = "Xonotic"; + // weird mutators that deserve to count as mod + if(autocvar_g_minstagib) + modname = "MinstaGib"; + // weird game types that deserve to count as mod + if(g_cts) + modname = "CTS"; + // physics/balance/config changes that count as mod + if(cvar_string("g_mod_physics") != cvar_defstring("g_mod_physics")) + modname = cvar_string("g_mod_physics"); + if(cvar_string("g_mod_balance") != cvar_defstring("g_mod_balance")) + modname = cvar_string("g_mod_balance"); + if(cvar_string("g_mod_config") != cvar_defstring("g_mod_config")) + modname = cvar_string("g_mod_config"); + modname = strzone(modname); + world_initialized = 1; } diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index b56065ded..3a9a7ada3 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -387,6 +387,7 @@ void WinningConditionHelper() s = strcat(s, ":P", ftos(cvar_purechanges_count)); s = strcat(s, ":S", ftos(nJoinAllowed(0))); s = strcat(s, ":F", ftos(serverflags)); + s = strcat(s, ":M", modname); s = strcat(s, "::", GetPlayerScoreString(world, 1)); // make this 1 once we can, note: this doesn't contain any : fullstatus = autocvar_g_full_getstatus_responses;