Commit 7587f761 authored by Rudolf Polzer's avatar Rudolf Polzer

indicate mod in menu HUD if sent by the server; detect minstagib and CTS and...

indicate mod in menu HUD if sent by the server; detect minstagib and CTS and send as mod string already
parent a17c6988
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"
......
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"
......
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"
......
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"
......
......@@ -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
......
g_mod_physics CPMA
// these values match CPMA
sv_gravity 800
sv_maxspeed 320
sv_maxairspeed 320
......
g_mod_physics Fruit
// physicsNoQWBunny.cfg vs physicsXPM.cfg
sv_gravity 800
sv_maxspeed 320
sv_maxairspeed 320
......
g_mod_physics Havoc
// Xonotic Havoc physics (work in progress)
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 220
......
g_mod_physics LeeStricklin-ModdedFruit
// "NoQWBunny" physics based on XPM
sv_gravity 800
sv_maxspeed 424
sv_maxairspeed 400
......
g_mod_physics LeeStricklin
// "NoQWBunny" physics based on XPM
sv_gravity 800
sv_maxspeed 320
sv_maxairspeed 424
......
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
......
g_mod_physics Lzd
//LZD Physics Config v0.1
//By PCLizard and Oh Hai :)
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 300
......
g_mod_physics Nexuiz10
// Xonotic 1.0 physics
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 100
......
g_mod_physics Nexuiz11
// Xonotic 1.5 physics
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 50
......
g_mod_physics Nexuiz151
// experimental post-Xonotic 1.5 physics (never released)
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 50
......
g_mod_physics Nexuiz151b
// experimental post-Xonotic 1.5 physics (never released)
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 25
......
g_mod_physics Nexuiz16rc1
// experimental post-Xonotic 1.5 physics (never released)
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 50
......
g_mod_physics Nexuiz20
// Quake, Bunny Reintroduced (Xonotic 2.0 to 2.4.2 physics)
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 220
......
g_mod_physics Nexuiz25
// Xonotic 2.5 physics
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 220
......
g_mod_physics Nexuiz26
// Xonotic 2.6 physics
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 220
......
g_mod_physics NoQWBunny-nexbased
// "NoQWBunny" physics based on Nexuiz 2.0-2.4.2
sv_gravity 800
sv_maxspeed 360
sv_maxairspeed 400
......
g_mod_physics Q
// Quake 1
sv_gravity 800
sv_maxspeed 320
sv_maxairspeed 30
......
g_mod_physics Q2
// Quake 2
sv_gravity 800
sv_maxspeed 300
sv_maxairspeed 300
......
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
......
g_mod_physics Q3
// these values match Quake3
sv_gravity 800
sv_maxspeed 320
sv_maxairspeed 320
......
g_mod_physics QBF
// Quake, Bunny Fixed (feels very slow)
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 250
......
g_mod_physics QBFplus
// Quake, Bunny Fixed Plus (faster using forward hopping)
sv_gravity 800
sv_maxspeed 400
sv_maxairspeed 220
......
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
......
g_mod_physics Warsow
// these values match Warsow 0.42
sv_gravity 850
sv_maxspeed 320
sv_maxairspeed 320
......
g_mod_physics WarsowClassicBunny
// these values match Warsow 0.42 GS_CLASSICBUNNY
sv_gravity 850
sv_maxspeed 320
sv_maxairspeed 320
......
g_mod_physics WarsowDev
// these values match Warsow 0.42
sv_gravity 850
sv_maxspeed 320
sv_maxairspeed 320
......
g_mod_physics Xonotic
// current Xonotic physics
sv_gravity 800
sv_maxspeed 360
sv_maxairspeed 360
......
g_mod_physics Xonotic010
// Xonotic 0.1.0preview physics
sv_gravity 800
sv_maxspeed 360
sv_maxairspeed 400
......
g_mod_physics XPM
// Nexrun tweaked to suit CPM
sv_gravity 800
sv_maxspeed 320
// CPMA: 320
......
g_mod_physics XPMLight
// Nexrun tweaked to suit CPM
sv_gravity 800
sv_maxspeed 320
// CPMA: 320
......
......@@ -5,4 +5,5 @@
//# define WORKAROUND_XON010
//# define COMPAT_XON010_CHANNELS
# define COMPAT_XON050_ENGINE
# define COMPAT_NO_MOD_IS_XONOTIC
#endif
......@@ -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');
......
......@@ -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);
......
......@@ -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))
......
......@@ -654,3 +654,5 @@ typedef vector(entity player, entity spot, vector current) spawn_evalfunc_t;
.spawn_evalfunc_t spawn_evalfunc;
.entity conveyor;
string modname;
......@@ -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;
}
......
......@@ -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 :<letter>
fullstatus = autocvar_g_full_getstatus_responses;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment