Revert "MCE: replace map-based CD system with time-based one"
This reverts commit 217f1680e0
.
This commit is contained in:
parent
8af0baef6e
commit
3807248278
@ -237,7 +237,7 @@ public void OnPluginStart()
|
|||||||
g_Cvar_ExtendTimeStep = CreateConVar("mce_extend_timestep", "15", "Specifies how much many more minutes each extension makes", _, true, 5.0);
|
g_Cvar_ExtendTimeStep = CreateConVar("mce_extend_timestep", "15", "Specifies how much many more minutes each extension makes", _, true, 5.0);
|
||||||
g_Cvar_ExtendRoundStep = CreateConVar("mce_extend_roundstep", "5", "Specifies how many more rounds each extension makes", _, true, 1.0);
|
g_Cvar_ExtendRoundStep = CreateConVar("mce_extend_roundstep", "5", "Specifies how many more rounds each extension makes", _, true, 1.0);
|
||||||
g_Cvar_ExtendFragStep = CreateConVar("mce_extend_fragstep", "10", "Specifies how many more frags are allowed when map is extended.", _, true, 5.0);
|
g_Cvar_ExtendFragStep = CreateConVar("mce_extend_fragstep", "10", "Specifies how many more frags are allowed when map is extended.", _, true, 5.0);
|
||||||
g_Cvar_ExcludeMaps = CreateConVar("mce_exclude", "5", "Specifies for how many hours past maps should be excluded from the vote.", _, true, 0.0);
|
g_Cvar_ExcludeMaps = CreateConVar("mce_exclude", "5", "Specifies how many past maps to exclude from the vote.", _, true, 0.0);
|
||||||
g_Cvar_IncludeMaps = CreateConVar("mce_include", "5", "Specifies how many maps to include in the vote.", _, true, 2.0, true, 7.0);
|
g_Cvar_IncludeMaps = CreateConVar("mce_include", "5", "Specifies how many maps to include in the vote.", _, true, 2.0, true, 7.0);
|
||||||
g_Cvar_IncludeMapsReserved = CreateConVar("mce_include_reserved", "2", "Specifies how many private/random maps to include in the vote.", _, true, 0.0, true, 5.0);
|
g_Cvar_IncludeMapsReserved = CreateConVar("mce_include_reserved", "2", "Specifies how many private/random maps to include in the vote.", _, true, 0.0, true, 5.0);
|
||||||
g_Cvar_NoVoteMode = CreateConVar("mce_novote", "1", "Specifies whether or not MapChooser should pick a map if no votes are received.", _, true, 0.0, true, 1.0);
|
g_Cvar_NoVoteMode = CreateConVar("mce_novote", "1", "Specifies whether or not MapChooser should pick a map if no votes are received.", _, true, 0.0, true, 1.0);
|
||||||
@ -378,8 +378,6 @@ public void OnPluginStart()
|
|||||||
g_MapVoteRunoffStartForward = CreateGlobalForward("OnMapVoteRunnoffWarningStart", ET_Ignore);
|
g_MapVoteRunoffStartForward = CreateGlobalForward("OnMapVoteRunnoffWarningStart", ET_Ignore);
|
||||||
|
|
||||||
InternalRestoreMapCooldowns();
|
InternalRestoreMapCooldowns();
|
||||||
|
|
||||||
CreateTimer(60.0, UpdateCooldowns, INVALID_HANDLE, TIMER_REPEAT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
|
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
|
||||||
@ -528,21 +526,16 @@ public void OnMapEnd()
|
|||||||
g_WarningTimer = INVALID_HANDLE;
|
g_WarningTimer = INVALID_HANDLE;
|
||||||
g_RunoffCount = 0;
|
g_RunoffCount = 0;
|
||||||
|
|
||||||
if(g_SaveCDOnMapEnd)
|
|
||||||
{
|
|
||||||
static char map[PLATFORM_MAX_PATH];
|
|
||||||
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
|
||||||
int Cooldown = InternalGetMapCooldown(map);
|
|
||||||
g_OldMapList.SetValue(map, Cooldown, true);
|
|
||||||
InternalStoreMapCooldowns();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Action UpdateCooldowns(Handle timer)
|
|
||||||
{
|
|
||||||
static char map[PLATFORM_MAX_PATH];
|
static char map[PLATFORM_MAX_PATH];
|
||||||
int Cooldown;
|
int Cooldown;
|
||||||
|
|
||||||
|
if(g_SaveCDOnMapEnd)
|
||||||
|
{
|
||||||
|
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
||||||
|
Cooldown = InternalGetMapCooldown(map);
|
||||||
|
g_OldMapList.SetValue(map, Cooldown, true);
|
||||||
|
}
|
||||||
|
|
||||||
StringMapSnapshot OldMapListSnapshot = g_OldMapList.Snapshot();
|
StringMapSnapshot OldMapListSnapshot = g_OldMapList.Snapshot();
|
||||||
for(int i = 0; i < OldMapListSnapshot.Length; i++)
|
for(int i = 0; i < OldMapListSnapshot.Length; i++)
|
||||||
{
|
{
|
||||||
@ -2308,7 +2301,7 @@ stock int InternalGetMapCooldown(const char[] map)
|
|||||||
g_Config.Rewind();
|
g_Config.Rewind();
|
||||||
}
|
}
|
||||||
|
|
||||||
return RoundToNearest(Cooldown * 60.0);
|
return Cooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckMapRestrictions(bool time = false, bool players = false)
|
void CheckMapRestrictions(bool time = false, bool players = false)
|
||||||
|
@ -118,8 +118,6 @@ public void OnPluginStart()
|
|||||||
CreateConVar("ne_version", MCE_VERSION, "Nominations Extended Version", FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD);
|
CreateConVar("ne_version", MCE_VERSION, "Nominations Extended Version", FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD);
|
||||||
|
|
||||||
g_mapTrie = CreateTrie();
|
g_mapTrie = CreateTrie();
|
||||||
|
|
||||||
CreateTimer(60.0, ForceUpdate, INVALID_HANDLE, TIMER_REPEAT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public APLRes AskPluginLoad2(Handle hThis, bool bLate, char[] err, int iErrLen)
|
public APLRes AskPluginLoad2(Handle hThis, bool bLate, char[] err, int iErrLen)
|
||||||
@ -241,11 +239,6 @@ void UpdateMapTrie()
|
|||||||
delete excludeMaps;
|
delete excludeMaps;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Action ForceUpdate(Handle timer)
|
|
||||||
{
|
|
||||||
UpdateMapTrie();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnNominationRemoved(const char[] map, int owner)
|
public void OnNominationRemoved(const char[] map, int owner)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
@ -298,9 +291,7 @@ public Action Command_Addmap(int client, int args)
|
|||||||
if((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS)
|
if((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS)
|
||||||
{
|
{
|
||||||
int Cooldown = GetMapCooldown(mapname);
|
int Cooldown = GetMapCooldown(mapname);
|
||||||
int ConvertedCooldown[2];
|
CPrintToChat(client, "[NE] %t (%d)", "Map in Exclude List", Cooldown);
|
||||||
ConvertCooldown(Cooldown, ConvertedCooldown);
|
|
||||||
CPrintToChat(client, "[NE] %T", "Map Nominate Cooldown Error", client, ConvertedCooldown[0], ConvertedCooldown[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED)
|
if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED)
|
||||||
@ -394,7 +385,7 @@ public Action Command_AddExclude(int client, int args)
|
|||||||
{
|
{
|
||||||
if(args < 1)
|
if(args < 1)
|
||||||
{
|
{
|
||||||
CReplyToCommand(client, "[NE] Usage: sm_nominate_exclude <mapname> [cooldown (minutes)] [mode]");
|
CReplyToCommand(client, "[NE] Usage: sm_nominate_exclude <mapname>");
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -510,9 +501,7 @@ public Action Command_Nominate(int client, int args)
|
|||||||
if(((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) && AreRestrictionsActive())
|
if(((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) && AreRestrictionsActive())
|
||||||
{
|
{
|
||||||
int Cooldown = GetMapCooldown(mapname);
|
int Cooldown = GetMapCooldown(mapname);
|
||||||
int ConvertedCooldown[2];
|
CPrintToChat(client, "[NE] %t (%d)", "Map in Exclude List", Cooldown);
|
||||||
ConvertCooldown(Cooldown, ConvertedCooldown);
|
|
||||||
CPrintToChat(client, "[NE] %T", "Map Nominate Cooldown Error", client, ConvertedCooldown[0], ConvertedCooldown[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED)
|
if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED)
|
||||||
@ -885,9 +874,7 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
|||||||
if(((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) && AreRestrictionsActive())
|
if(((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) && AreRestrictionsActive())
|
||||||
{
|
{
|
||||||
int Cooldown = GetMapCooldown(map);
|
int Cooldown = GetMapCooldown(map);
|
||||||
int ConvertedCooldown[2];
|
Format(display, sizeof(display), "%s (%T %d)", buffer, "Recently Played", param1, Cooldown);
|
||||||
ConvertCooldown(Cooldown, ConvertedCooldown);
|
|
||||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Cooldown", param1, ConvertedCooldown[0], ConvertedCooldown[1]);
|
|
||||||
return RedrawMenuItem(display);
|
return RedrawMenuItem(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1063,9 +1050,7 @@ public int Handler_AdminMapSelectMenu(Menu menu, MenuAction action, int param1,
|
|||||||
if((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS)
|
if((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS)
|
||||||
{
|
{
|
||||||
int Cooldown = GetMapCooldown(map);
|
int Cooldown = GetMapCooldown(map);
|
||||||
int ConvertedCooldown[2];
|
Format(display, sizeof(display), "%s (%T %d)", buffer, "Recently Played", param1, Cooldown);
|
||||||
ConvertCooldown(Cooldown, ConvertedCooldown);
|
|
||||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Cooldown", param1, ConvertedCooldown[0], ConvertedCooldown[1]);
|
|
||||||
return RedrawMenuItem(display);
|
return RedrawMenuItem(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1229,9 +1214,3 @@ stock int GetVIPTimeRestriction()
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
stock void ConvertCooldown(int Cooldown, int Time[2])
|
|
||||||
{
|
|
||||||
Time[0] = Cooldown / 60;
|
|
||||||
Time[1] = Cooldown - (Time[0] * 60);
|
|
||||||
}
|
|
||||||
|
@ -111,15 +111,9 @@
|
|||||||
"en" "VIP Nomination"
|
"en" "VIP Nomination"
|
||||||
}
|
}
|
||||||
|
|
||||||
"Map Nominate Cooldown Error"
|
|
||||||
{
|
|
||||||
"#format" "{1:d},{2:d}"
|
|
||||||
"en" "You need to wait {1} hours and {2} minutes for the map to come off cooldown."
|
|
||||||
}
|
|
||||||
|
|
||||||
"Map Nominate VIP Error"
|
"Map Nominate VIP Error"
|
||||||
{
|
{
|
||||||
"en" "You need to be VIP to nominate this map."
|
"en" "Only VIPs can nominate this map."
|
||||||
}
|
}
|
||||||
|
|
||||||
"Map Nominate Time Error"
|
"Map Nominate Time Error"
|
||||||
@ -146,12 +140,6 @@
|
|||||||
"en" "The maximum amount ({1}) of maps from this group has already been nominated."
|
"en" "The maximum amount ({1}) of maps from this group has already been nominated."
|
||||||
}
|
}
|
||||||
|
|
||||||
"Map Cooldown"
|
|
||||||
{
|
|
||||||
"#format" "{1:d},{2:d}"
|
|
||||||
"en" "Cooldown: {1}H{2}M"
|
|
||||||
}
|
|
||||||
|
|
||||||
"Map Time Restriction"
|
"Map Time Restriction"
|
||||||
{
|
{
|
||||||
"#format" "{1:s},{2:d},{3:d}"
|
"#format" "{1:s},{2:d},{3:d}"
|
||||||
|
Loading…
Reference in New Issue
Block a user