mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 18:38:26 +00:00
add something to migrate cvars from shavit-replay and shavit-misc
This commit is contained in:
parent
849bc0ed76
commit
3c46d9c257
@ -115,6 +115,26 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|
|||||||
CreateNative("Shavit_GetTimesTeleported", Native_GetTimesTeleported);
|
CreateNative("Shavit_GetTimesTeleported", Native_GetTimesTeleported);
|
||||||
CreateNative("Shavit_HasSavestate", Native_HasSavestate);
|
CreateNative("Shavit_HasSavestate", Native_HasSavestate);
|
||||||
|
|
||||||
|
if (!FileExists("cfg/sourcemod/plugin.shavit-checkpoints.cfg") && FileExists("cfg/sourcemod/plugin.shavit-misc.cfg"))
|
||||||
|
{
|
||||||
|
File source = OpenFile("cfg/sourcemod/plugin.shavit-misc.cfg", "r");
|
||||||
|
File destination = OpenFile("cfg/sourcemod/plugin.shavit-checkpoints.cfg", "w");
|
||||||
|
|
||||||
|
if (source && destination)
|
||||||
|
{
|
||||||
|
char line[512];
|
||||||
|
|
||||||
|
while (!source.EndOfFile() && source.ReadLine(line, sizeof(line)))
|
||||||
|
{
|
||||||
|
ReplaceString(line, sizeof(line), "_misc_", "_checkpoints_");
|
||||||
|
destination.WriteLine("%s", line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete destination;
|
||||||
|
delete source;
|
||||||
|
}
|
||||||
|
|
||||||
RegPluginLibrary("shavit-checkpoints");
|
RegPluginLibrary("shavit-checkpoints");
|
||||||
|
|
||||||
gB_Late = late;
|
gB_Late = late;
|
||||||
|
|||||||
@ -285,6 +285,25 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|
|||||||
CreateNative("Shavit_GetLoopingBotByName", Native_GetLoopingBotByName);
|
CreateNative("Shavit_GetLoopingBotByName", Native_GetLoopingBotByName);
|
||||||
CreateNative("Shavit_SetReplayCacheName", Native_SetReplayCacheName);
|
CreateNative("Shavit_SetReplayCacheName", Native_SetReplayCacheName);
|
||||||
|
|
||||||
|
if (!FileExists("cfg/sourcemod/plugin.shavit-replay-playback.cfg") && FileExists("cfg/sourcemod/plugin.shavit-replay.cfg"))
|
||||||
|
{
|
||||||
|
File source = OpenFile("cfg/sourcemod/plugin.shavit-replay.cfg", "r");
|
||||||
|
File destination = OpenFile("cfg/sourcemod/plugin.shavit-replay-playback.cfg", "w");
|
||||||
|
|
||||||
|
if (source && destination)
|
||||||
|
{
|
||||||
|
char line[512];
|
||||||
|
|
||||||
|
while (!source.EndOfFile() && source.ReadLine(line, sizeof(line)))
|
||||||
|
{
|
||||||
|
destination.WriteLine("%s", line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete destination;
|
||||||
|
delete source;
|
||||||
|
}
|
||||||
|
|
||||||
// registers library, check "bool LibraryExists(const char[] name)" in order to use with other plugins
|
// registers library, check "bool LibraryExists(const char[] name)" in order to use with other plugins
|
||||||
RegPluginLibrary("shavit-replay-playback");
|
RegPluginLibrary("shavit-replay-playback");
|
||||||
|
|
||||||
|
|||||||
@ -106,6 +106,25 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|
|||||||
CreateNative("Shavit_SetReplayData", Native_SetReplayData);
|
CreateNative("Shavit_SetReplayData", Native_SetReplayData);
|
||||||
CreateNative("Shavit_SetPlayerPreFrames", Native_SetPlayerPreFrames);
|
CreateNative("Shavit_SetPlayerPreFrames", Native_SetPlayerPreFrames);
|
||||||
|
|
||||||
|
if (!FileExists("cfg/sourcemod/plugin.shavit-replay-recorder.cfg") && FileExists("cfg/sourcemod/plugin.shavit-replay.cfg"))
|
||||||
|
{
|
||||||
|
File source = OpenFile("cfg/sourcemod/plugin.shavit-replay.cfg", "r");
|
||||||
|
File destination = OpenFile("cfg/sourcemod/plugin.shavit-replay-recorder.cfg", "w");
|
||||||
|
|
||||||
|
if (source && destination)
|
||||||
|
{
|
||||||
|
char line[512];
|
||||||
|
|
||||||
|
while (!source.EndOfFile() && source.ReadLine(line, sizeof(line)))
|
||||||
|
{
|
||||||
|
destination.WriteLine("%s", line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete destination;
|
||||||
|
delete source;
|
||||||
|
}
|
||||||
|
|
||||||
RegPluginLibrary("shavit-replay-recorder");
|
RegPluginLibrary("shavit-replay-recorder");
|
||||||
|
|
||||||
gB_Late = late;
|
gB_Late = late;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user