View Single Post
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-07-2018 , 16:35   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1607

Quote:
Originally Posted by fysiks View Post
Why do you say that? I don't see anything in timeleft.amxx that would conflict with Galileo.
Years of observation. Trial and error. Luckily rockthevote replaces time-left quite well. I haven't ever bothered to look at the code.

grep time galileo.sma

Code:
 
	dbg_log(4, "%32s mp_timelimit: %f  g_originalTimelimit: %f", "vote_setupEnd(in)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
	g_originalTimelimit = get_cvar_float("mp_timelimit");
	// as long as the time limit isn't set to 0, we can manage the end of the map automatically
	dbg_log(2, "%32s mp_timelimit: %f  g_originalTimelimit: %f", "vote_setupEnd(out)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
	new secondsLeft = get_timeleft();	
	dbg_log(2, "%32s mp_timelimit: %f", "map_manageEnd(in)", get_cvar_float("mp_timelimit"));
			server_cmd("mp_timelimit 0");
			//new chatTime = floatround(get_cvar_float("mp_chattime"), floatround_floor);
			// change the map after "chattime" is over
			set_task(floatmax(get_cvar_float("mp_chattime"), 2.0), "map_change");
	dbg_log(2, "%32s mp_timelimit: %f", "map_manageEnd(out)", get_cvar_float("mp_timelimit"));
	// make sure the reset time is the original time limit 
	// change the map after "chattime" is over
	set_task(floatmax(get_cvar_float("mp_chattime"), 2.0), "map_change");
	// announce: "time to choose"
		new bool:allowExtend = !allowStay && ((isRunoff && g_choiceCnt == 1) || (!(g_voteStatus & VOTE_FORCED) && !isRunoff && get_cvar_float("mp_timelimit") < get_pcvar_float(cvar_extendmapMax)));
			allowExtend = !allowStay && ((isRunoff && g_choiceCnt == 1) || (!isRunoff && get_cvar_float("mp_timelimit") < get_pcvar_float(cvar_extendmapMax)));
	dbg_log(2, "%32s mp_timelimit: %f  g_rtvWait: %f  extendmapStep: %f", "map_extend(in)", get_cvar_float("mp_timelimit"), g_rtvWait, get_pcvar_float(cvar_extendmapStep));		
	// reset the "rtv wait" time, taking into consideration the map extension
		g_rtvWait = get_cvar_float("mp_timelimit") + g_rtvWait;
	set_cvar_float("mp_timelimit", get_cvar_float("mp_timelimit") + get_pcvar_float(cvar_extendmapStep));
	dbg_log(2, "%32s mp_timelimit: %f  g_rtvWait: %f  extendmapStep: %f", "map_extend(out)", get_cvar_float("mp_timelimit"), g_rtvWait, get_pcvar_float(cvar_extendmapStep));		
	// restore the map's timelimit, just in case we had changed it
		// probably admin did something dumb like changed the map time limit below
		// the time remaining in the map, thus making the map over immediately.
	dbg_log(2, "%32s mp_timelimit: %f", "map_getMinutesElapsed(in/out)", get_cvar_float("mp_timelimit"));		
	return get_cvar_float("mp_timelimit") - (float(get_timeleft()) / 60.0);
	// make sure enough time has gone by on the current map
	// make sure the rtv reminder timer has stopped
			// initialize the rtv reminder timer to repeat how many rocks are still needed, at regular intervals
	dbg_log(2, "%32s mp_timelimit: %f  g_originalTimelimit: %f", "srv_handleEmpty(in)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
	if (g_originalTimelimit != get_cvar_float("mp_timelimit"))
		// means that if someone comes into the server, the time limit will 
		// be the extended time limit rather than the normal time limit. bad.
		// reset the original time limit
	dbg_log(2, "%32s mp_timelimit: %f  g_originalTimelimit: %f", "srv_handleEmpty(out)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
	dbg_log(2, "%32s mp_timelimit: %f  g_originalTimelimit: %f", "map_restoreOriginalTimeLimit(in)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
		server_cmd("mp_timelimit %f", g_originalTimelimit);
	dbg_log(2, "%32s mp_timelimit: %f  g_originalTimelimit: %f", "map_restoreOriginalTimeLimit(out)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
		// grab the current game time
		new Float:gameTime = get_gametime();


Timeleft is ok without Galileo and Galileo is well without it. Making them work together I think is more of a labor for Galileo. It is 3rd party. 2 dev team plugins are disabled already. What is 1 more?

Timeleft: replace len hardcoded content by charsmax and sizeof --possibly more compatible.
Gal threw an error over weekend. Debug is on it now. When timeleft is running the crashes are harder and the error never comes up. If this comes as a surprise to you test it!
__________________
DJEarthQuake is offline