diff --git a/autorecorder.sp b/autorecorder.sp index f4201f1..dc3653e 100644 --- a/autorecorder.sp +++ b/autorecorder.sp @@ -25,6 +25,11 @@ * [*] Fixed minimum player count setting being off by one * [*] Fixed player counting code getting out of range * [*] Updated source code to the new syntax +* Apr 15, 2022 - v.1.3.1: +* [*] Increased the length limit of the map name in the demo filename +* [*] Fixed workshop map demo filenames missing the .dem extension +* Jun 05, 2022 - v.1.3.2: +* [*] Handled tv_record not resolving relative paths including "." * */ @@ -33,7 +38,7 @@ #pragma semicolon 1 #pragma newdecls required -#define PLUGIN_VERSION "1.3.0" +#define PLUGIN_VERSION "1.3.2" public Plugin myinfo = { @@ -77,10 +82,7 @@ public void OnPluginStart() char sPath[PLATFORM_MAX_PATH]; g_hDemoPath.GetString(sPath, sizeof(sPath)); - if(!DirExists(sPath)) - { - InitDirectory(sPath); - } + OnConVarChanged(g_hDemoPath, sPath, sPath); g_hMinPlayersStart.AddChangeHook(OnConVarChanged); g_hIgnoreBots.AddChangeHook(OnConVarChanged); @@ -98,9 +100,23 @@ public void OnConVarChanged(ConVar convar, const char[] oldValue, const char [] { if(convar == g_hDemoPath) { - if(!DirExists(newValue)) + // Handle tv_record not resolving relative paths including "." + char demoPath[PLATFORM_MAX_PATH]; + g_hDemoPath.GetString(demoPath, sizeof(demoPath)); + if (StrEqual(demoPath, ".")) + { + demoPath = ""; + } + ReplaceString(demoPath, sizeof(demoPath), "./", ""); + g_hDemoPath.SetString(demoPath); + if (StrEqual(demoPath, "")) { - InitDirectory(newValue); + return; + } + + if(!DirExists(demoPath)) + { + InitDirectory(demoPath); } } else @@ -222,16 +238,28 @@ void StartRecord() { char sPath[PLATFORM_MAX_PATH]; char sTime[16]; - char sMap[32]; + char sMap[48]; g_hDemoPath.GetString(sPath, sizeof(sPath)); FormatTime(sTime, sizeof(sTime), "%Y%m%d-%H%M%S", GetTime()); GetCurrentMap(sMap, sizeof(sMap)); // replace slashes in map path name with dashes, to prevent fail on workshop maps - ReplaceString(sMap, sizeof(sMap), "/", "-", false); + ReplaceString(sMap, sizeof(sMap), "/", "-", false); + // replace periods in map path name with underscores, so workshop map demos still get a .dem extension + ReplaceString(sMap, sizeof(sMap), ".", "_", false); - ServerCommand("tv_record \"%s/auto-%s-%s\"", sPath, sTime, sMap); + if (StrEqual(sPath, "")) + { + ServerCommand("tv_record \"auto-%s-%s\"", sTime, sMap); + } + else + { + char demoFilename[72]; + Format(demoFilename, sizeof(demoFilename), "%s/auto-%s-%s", sPath, sTime, sMap); + ReplaceString(demoFilename, sizeof(demoFilename), "//", "/", false); + ServerCommand("tv_record \"%s\"", demoFilename); + } g_bIsRecording = true; LogMessage("Recording to auto-%s-%s.dem", sTime, sMap); diff --git a/nextmap_poplimits.sp b/nextmap_poplimits.sp index 9958e61..1e13619 100644 --- a/nextmap_poplimits.sp +++ b/nextmap_poplimits.sp @@ -32,7 +32,7 @@ */ #include -#include "include/nextmap.inc" +#include "nextmap.inc" #pragma semicolon 1 #pragma newdecls required diff --git a/plugins/afkicker.smx b/plugins/afkicker.smx new file mode 100644 index 0000000..7c5244e Binary files /dev/null and b/plugins/afkicker.smx differ diff --git a/plugins/autorecorder.smx b/plugins/autorecorder.smx new file mode 100644 index 0000000..bab1dcc Binary files /dev/null and b/plugins/autorecorder.smx differ diff --git a/plugins/inschat.smx b/plugins/inschat.smx new file mode 100644 index 0000000..83005ce Binary files /dev/null and b/plugins/inschat.smx differ diff --git a/plugins/jail.smx b/plugins/jail.smx new file mode 100644 index 0000000..6e3ab84 Binary files /dev/null and b/plugins/jail.smx differ diff --git a/plugins/mapstats.smx b/plugins/mapstats.smx new file mode 100644 index 0000000..0f875de Binary files /dev/null and b/plugins/mapstats.smx differ diff --git a/plugins/nextmap_poplimits.smx b/plugins/nextmap_poplimits.smx new file mode 100644 index 0000000..80eb7da Binary files /dev/null and b/plugins/nextmap_poplimits.smx differ diff --git a/plugins/nmrihstats.smx b/plugins/nmrihstats.smx new file mode 100644 index 0000000..ebf92a3 Binary files /dev/null and b/plugins/nmrihstats.smx differ diff --git a/plugins/qpdis.smx b/plugins/qpdis.smx new file mode 100644 index 0000000..4c04101 Binary files /dev/null and b/plugins/qpdis.smx differ diff --git a/plugins/setheads.smx b/plugins/setheads.smx new file mode 100644 index 0000000..ca0059c Binary files /dev/null and b/plugins/setheads.smx differ diff --git a/plugins/shipchat.smx b/plugins/shipchat.smx new file mode 100644 index 0000000..95b16f3 Binary files /dev/null and b/plugins/shipchat.smx differ diff --git a/plugins/teambalancer.smx b/plugins/teambalancer.smx new file mode 100644 index 0000000..95f39bb Binary files /dev/null and b/plugins/teambalancer.smx differ diff --git a/plugins/teamswap.smx b/plugins/teamswap.smx new file mode 100644 index 0000000..ccfdc48 Binary files /dev/null and b/plugins/teamswap.smx differ diff --git a/plugins/tkmanager.smx b/plugins/tkmanager.smx new file mode 100644 index 0000000..834b8e4 Binary files /dev/null and b/plugins/tkmanager.smx differ diff --git a/plugins/whitelist.smx b/plugins/whitelist.smx new file mode 100644 index 0000000..8da377d Binary files /dev/null and b/plugins/whitelist.smx differ