Add a native for getting Shavit's replay folder path for personal replays

This commit is contained in:
BoomShotKapow 2021-11-03 08:20:52 +00:00
parent b3f89493b0
commit 70ca6ace3d
2 changed files with 15 additions and 0 deletions

View File

@ -265,6 +265,15 @@ native void Shavit_GetReplayName(int style, int track, char[] buffer, int length
*/
native void Shavit_GetReplayCacheName(int bot, char[] buffer, int length);
/**
* Retrieves the folder path where the replay files are saved.
*
* @param buffer Buffer string.
* @param length String length.
* @noreturn
*/
native void Shavit_GetReplayFolderPath(char[] buffer, int length);
/**
* Checks if there's loaded replay data for a bhop style or not.
*

View File

@ -284,6 +284,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
CreateNative("Shavit_StartReplayFromFile", Native_StartReplayFromFile);
CreateNative("Shavit_GetLoopingBotByName", Native_GetLoopingBotByName);
CreateNative("Shavit_SetReplayCacheName", Native_SetReplayCacheName);
CreateNative("Shavit_GetReplayFolderPath", Native_GetReplayFolderPath);
if (!FileExists("cfg/sourcemod/plugin.shavit-replay-playback.cfg") && FileExists("cfg/sourcemod/plugin.shavit-replay.cfg"))
{
@ -1390,6 +1391,11 @@ public int Native_SetReplayCacheName(Handle plugin, int numParams)
return 0;
}
public int Native_GetReplayFolderPath(Handle handler, int numParams)
{
return SetNativeString(1, gS_ReplayFolder, GetNativeCell(2));
}
public Action Timer_Cron(Handle Timer)
{
for (int i = 1; i <= MaxClients; i++)