Quote:
Originally Posted by borzaka
Couple of suggestions: - prefix is not always backup_round, it can be set to any custom by mp_backup_round_file cvar
I have multi instance servers, where I have to set this to different values to not overwrite each other.
- You can use completely different backup file name patterns by mp_backup_round_file_pattern cvar
e.g. %prefix%_%date%_%time%_%team1%_%team2%_%map%_ round%round%_score_%score1%_%score2%.txt
- mp_backup_restore_load_file pauses automatically after executing mp_backup_restore_load_file, if the mp_backup_restore_load_autopause cvar left default, no need to pause again
So, I would pay attention to custom backup file prefixes and names and use the values from cvars.
|
Hmm, that's a good catch. Would if I do this? I don't know much about this cvars.
PHP Code:
char filepath[PLATFORM_MAX_PATH];
char num[5];
Format(filepath, sizeof(filepath), "%s", g_BackupPrefixPattern);
ReplaceString(filepath, sizeof(filepath), "%prefix%", g_BackupPrefix);
if(round < 10)
{
Format(num, sizeof(num), "0%d", round);
ReplaceString(filepath, sizeof(filepath), "%round%", num);
}
else
{
Format(num, sizeof(num), "%d", round);
ReplaceString(filepath, sizeof(filepath), "%round%", num);
}
ServerCommand("mp_backup_restore_load_file %s", filepath);
Code:
public void OnMapStart()
{
FindConVar("mp_backup_round_file").GetString(g_BackupPrefix, sizeof(g_BackupPrefix));
FindConVar("mp_backup_round_file_pattern").GetString(g_BackupPrefixPattern, sizeof(g_BackupPrefixPattern));
ServerCommand("mp_backup_restore_load_autopause 0");
ServerCommand("mp_backup_round_auto 1");
}
EDIT: After F-ing up my mind, I couldn't think of any way to replace this with old round's prefix :/ "%date%_%time%_%team1%_%team2%_%map%_ round%round%_score_%score1%_%score2%"
"%map%" can be possible but rest, I don't know. Any help would be appreciated!
__________________