Ok, it looks strange, so i write here.
Game Team Fortress 2, SourceMod v1.9.0.6237, extension v1.1.1 (manually builded from sourcecode with CLang).
All works good, but
SourceTV_GetRecordingTick() always return
-1.
I have code:
Code:
void Recorder_Stop() {
Recorder_Validate(); // this is stock just checks, recording in progress or not. if not - throws an error.
int iRecordedTicks = SourceTV_GetRecordingTick();
SourceTV_StopRecording();
g_bRecording = false;
g_iEndTime = GetTime();
char szDemoPath[PLATFORM_MAX_PATH];
int iPos = FormatEx(szDemoPath, sizeof(szDemoPath), "%s/%s", g_szBaseDemoPath, g_szDemoName);
strcopy(szDemoPath[iPos], sizeof(szDemoPath)-iPos, ".json");
JSONObject hMetaInfo = new JSONObject();
hMetaInfo.SetInt("start_time", g_iStartTime);
hMetaInfo.SetInt("end_time", g_iEndTime);
hMetaInfo.SetInt("recorded_ticks", iRecordedTicks);
hMetaInfo.SetString("unique_id", g_szDemoName);
hMetaInfo.SetString("play_map", g_szMapName);
// ... more code for writing JSON too ...
// ... saving JSON ...
}
Note: i write
recorded_ticks with value from
SourceTV_GetRecordingTicks(). Native called before stopping record.
All looks good, but in JSON:
Code:
{
"start_time": 1565718510,
"end_time": 1565722914,
"recorded_ticks": -1,
// more additional fields...
}
What i do wrong?
__________________