r2618 - in branches/nexuiz-2.0: Docs/server data data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat May 19 15:24:18 EDT 2007


Author: div0
Date: 2007-05-19 15:24:18 -0400 (Sat, 19 May 2007)
New Revision: 2618

Modified:
   branches/nexuiz-2.0/Docs/server/server.cfg
   branches/nexuiz-2.0/data/default.cfg
   branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc
   branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
   branches/nexuiz-2.0/data/qcsrc/server/keyhunt.qc
Log:
keyhunt effect fixes; optional prevention of gametype changes; random map selection is now the default; update server.cfg


Modified: branches/nexuiz-2.0/Docs/server/server.cfg
===================================================================
--- branches/nexuiz-2.0/Docs/server/server.cfg	2007-05-19 19:22:50 UTC (rev 2617)
+++ branches/nexuiz-2.0/Docs/server/server.cfg	2007-05-19 19:24:18 UTC (rev 2618)
@@ -16,8 +16,12 @@
 // for more g_maplist examples.
 
 //g_maplist 'dm_aggressor''dm_aneurysm''dm_basement''dm_bleach''dm_bluesky''dm_bloodprison''dm_darkzone''dm_downer''dm_evilspace''dm_farewell''dm_runningman''dm_runningman_1on1remix''dm_silvercity''dm_skyway''dm_slimepit''dm_soylent''dm_starship''dm_stormkeep''dm_toxic''dm_warfare' // the map cycle for the server
-//g_maplist_shuffle 0 // 1 will choose a random map as next map
+//g_maplist_shuffle 1 // 0 always selects the next map out of g_maplist (but then set better set g_maplist_votable 0 below to prevent repetitive votes), 1 will select random maps each time
 
+//g_maplist_votable 5 // number of maps to vote between; set to 0 to disable the map voting screen (please enable g_maplist_shuffle above when this is enabled, or votes will be repetitive)
+//g_maplist_votable_suggestions 2 // number of suggestions to accept using the suggestmap command
+//g_maplist_votable_suggestions_change_gametype 1 // 0 will forbid suggestmap to change the game type
+
 //maxplayers 8 // number of players allowed on the server
 //port 26000 // the port used by the server
 //sv_public 1 // 0 if the server should not be on the public servers list
@@ -42,8 +46,10 @@
 //sv_vote_commands "restart timelimit fraglimit chmap g_grappling_hook sv_defaultplayer_fbskin_green sv_defaultplayer_fbskin_red sv_defaultplayer_fbskin_orange sv_defaultplayer_fbskin_off" // players can vote for those commands or use them if they are masters
 //sv_vote_call 1 // 0 will disable the normal voting
 //sv_vote_master 1 // 0 will disable voting to become masters
+//sv_vote_master_password "" // when set, vdo login master will allow you to run votable commands directly using vdo
+//sv_vote_simple_majority 0 // 1 will make votes succeed if there are more yes than no votes; with 0 (default), more than half of the players have to say yes
+//sv_vote_change_gametype 1 // 0 will forbid changing the game type by map votes
 
-
 //sv_defaultcharacter 0 // 1 will force a specific model for all players
 //sv_defaultplayermodel models/player/nexus.zym // this model will be used
 //sv_defaultplayerskin 0 // this skin number will be forced for all players

Modified: branches/nexuiz-2.0/data/default.cfg
===================================================================
--- branches/nexuiz-2.0/data/default.cfg	2007-05-19 19:22:50 UTC (rev 2617)
+++ branches/nexuiz-2.0/data/default.cfg	2007-05-19 19:24:18 UTC (rev 2618)
@@ -220,7 +220,7 @@
 seta g_maplist $g_maplist_defaultlist
 seta g_maplist_index 0 // this is used internally for saving position in maplist cycle
 seta g_maplist_selectrandom 0 // if 1, a random map will be chosen as next map - DEPRECATED in favor of g_maplist_shuffle
-seta g_maplist_shuffle 0 // new randomization method: like selectrandom, but avoid playing the same maps in short succession. This works by taking out the first element and inserting it into g_maplist with a bias to the end of the list.
+seta g_maplist_shuffle 1 // new randomization method: like selectrandom, but avoid playing the same maps in short succession. This works by taking out the first element and inserting it into g_maplist with a bias to the end of the list.
 // timeout for kill credit when your damage knocks someone into a death trap
 set g_maxpushtime 8.0
 
@@ -568,6 +568,8 @@
 set sv_vote_wait 120
 // a simple majority suffices to accept a vote (meaning: YES votes > NO votes, otherwise: YES votes > half of the players)
 set sv_vote_simple_majority 0
+// when disabled, don't allow game type changes
+set sv_vote_change_gametype 1
 alias vhelp "cmd vote help"
 alias vstatus "cmd vote status"
 alias vcall "cmd vote call $*"
@@ -678,6 +680,7 @@
 set g_maplist_votable_keeptwotime 15
 set g_maplist_votable_timeout 30 // note: must be below 50 seconds!
 set g_maplist_votable_suggestions 2
+set g_maplist_votable_suggestions_change_gametype 1
 alias suggestmap "cmd suggestmap $1"
 
 set g_chat_flood_spl 0                   // seconds between lines to not count as flooding

Modified: branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc	2007-05-19 19:22:50 UTC (rev 2617)
+++ branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc	2007-05-19 19:24:18 UTC (rev 2618)
@@ -435,11 +435,19 @@
 	else
 		return TRUE;
 
+	if(!cvar("sv_vote_change_gametype"))
+		if(!IsSameGametype(argv(1)))
+		{
+			sprint(self, "This server does not allow changing the game type by map votes.\n");
+			return FALSE;
+		}
+
 	if(!TryFile(strcat("maps/", argv(1), ext)))
 	{
 		sprint(self, strcat("^1Invalid mapname, \"^3", argv(1), "^1\" does not exist on this server.\n"));
 		return FALSE;
 	}
+
 	return TRUE;
 }
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2007-05-19 19:22:50 UTC (rev 2617)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2007-05-19 19:24:18 UTC (rev 2618)
@@ -383,6 +383,15 @@
 	return "dm";
 }
 
+float IsSameGametype(string mapcfgname)
+{
+	string gt;
+	gt = GetGametype();
+	if(substring(mapcfgname, 0, strlen(gt) + 1) == strcat(gt, "_"))
+		return TRUE;
+	return FALSE;
+}
+
 string getmapname_stored;
 string GetMapname()
 {
@@ -1566,6 +1575,12 @@
 		return "Suggestions are not accepted on this server.";
 	if(mapvote_initialized)
 		return "Can't suggest - voting is already in progress!";
+	if(!cvar("g_maplist_votable_suggestions_change_gametype"))
+		if(!IsSameGametype(m))
+		{
+			return "This server does not allow changing the game type by map suggestions.";
+		}
+
 	if(!TryFile(strcat("maps/", m, ".mapcfg")))
 		return "The map you suggested is not available on this server.";
 	for(i = 0; i < mapvote_suggestion_ptr; ++i)

Modified: branches/nexuiz-2.0/data/qcsrc/server/keyhunt.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/keyhunt.qc	2007-05-19 19:22:50 UTC (rev 2617)
+++ branches/nexuiz-2.0/data/qcsrc/server/keyhunt.qc	2007-05-19 19:24:18 UTC (rev 2618)
@@ -20,7 +20,7 @@
 
 vector KH_KEY_MIN = '-10 -10 -46';
 vector KH_KEY_MAX = '10 10 3';
-float KH_KEY_BRIGHTNESS = 0.015625;
+float KH_KEY_BRIGHTNESS = 4;
 
 typedef void(void) kh_Think_t;
 var kh_Think_t kh_Controller_Thinkfunc;
@@ -35,7 +35,6 @@
 	return 0;
 }
 
-vector kh_average_teamcolor;
 entity kh_controller;
 float kh_tracking_enabled;
 float kh_teams;
@@ -283,6 +282,27 @@
 			self.team = attacker.team;
 }
 
+vector kh_TeamColor(float teem)
+{
+	switch(teem)
+	{
+		case COLOR_TEAM1:
+			//return '103 0 0' / 255.0;
+			return '0.4039 0.0000 0.0000';
+		case COLOR_TEAM2:
+			//return '35 35 191' / 255.0;
+			return '0.1373 0.1373 0.7490';
+		case COLOR_TEAM3:
+			//return '187 167 15' / 255.0;
+			return '0.7333 0.6549 0.0588';
+		case COLOR_TEAM4:
+			//return '139 79 107' / 255.0;
+			return '0.5451 0.3099 0.4196';
+		default:
+			return '1 1 1';
+	}
+}
+
 void kh_Key_Spawn(entity initial_owner, float angle)
 {
 	entity key;
@@ -299,32 +319,24 @@
 	key.model = "key";
 	key.kh_dropperteam = 0;
 	setsize(key, KH_KEY_MIN, KH_KEY_MAX);
+	key.colormod = kh_TeamColor(initial_owner.team) * KH_KEY_BRIGHTNESS;
 
 	switch(initial_owner.team)
 	{
 		case COLOR_TEAM1:
 			key.netname = "^1red key";
-			key.colormod = '103 0 0' * KH_KEY_BRIGHTNESS;
-			kh_average_teamcolor += key.colormod;
 			break;
 		case COLOR_TEAM2:
 			key.netname = "^4blue key";
-			key.colormod = '35 35 191' * KH_KEY_BRIGHTNESS;
-			kh_average_teamcolor += key.colormod;
 			break;
 		case COLOR_TEAM3:
 			key.netname = "^3yellow key";
-			key.colormod = '187 167 15' * KH_KEY_BRIGHTNESS;
-			kh_average_teamcolor += key.colormod;
 			break;
 		case COLOR_TEAM4:
 			key.netname = "^6pink key";
-			key.colormod = '139 79 107' * KH_KEY_BRIGHTNESS;
-			kh_average_teamcolor += key.colormod;
 			break;
 		default:
 			key.netname = "NETGIER key";
-			key.colormod = '1 1 1';
 			break;
 	}
 
@@ -554,8 +566,7 @@
 		te_lightning2(world, lastorigin, firstorigin);
 	}
 	midpoint = midpoint * (1 / kh_teams);
-	//dprint("Custom flash around ", vtos(midpoint), " color ", vtos(kh_average_teamcolor), "\n");
-	te_customflash(midpoint, 1000, 1, kh_average_teamcolor);
+	te_customflash(midpoint, 1000, 1, kh_TeamColor(teem) * 0.5 + '0.5 0.5 0.5'); // make the color >=0.5 in each component
 
 	sound(world, CHAN_AUTO, kh_sound_capture, 1, ATTN_NONE);
 	kh_FinishRound();
@@ -699,7 +710,6 @@
 		if(clienttype(player) == CLIENTTYPE_REAL)
 			centerprint_expire(player, CENTERPRIO_SPAM);
 
-	kh_average_teamcolor = '0 0 0';
 	for(i = 0; i < kh_teams; ++i)
 	{
 		teem = kh_Team_ByID(i);
@@ -719,8 +729,6 @@
 		//kh_Key_Spawn(my_player, 360 * i / kh_teams);
 	}
 
-	kh_average_teamcolor = kh_average_teamcolor * (1 / max3(kh_average_teamcolor_x, kh_average_teamcolor_y, kh_average_teamcolor_z));
-
 	kh_tracking_enabled = FALSE;
 	kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_tracking"), "Scanning frequency range...", kh_EnableTrackingDevice);
 }




More information about the nexuiz-commits mailing list