Pass timestamp to playline hooks

This allows implementing timestamp-based (eg. client specific - #343)
filtering of playback buffers. For clients that don't support server-time,
getting an accurate timestamp out of a raw buffer playline is impossible.
This commit is contained in:
J-P Nurmi
2014-11-21 21:45:37 +01:00
parent acc3394cfc
commit 80b799cec0
5 changed files with 23 additions and 5 deletions
+3 -2
View File
@@ -596,14 +596,15 @@ void CChan::SendBuffer(CClient* pClient, const CBuffer& Buffer) {
size_t uSize = Buffer.Size();
for (size_t uIdx = 0; uIdx < uSize; uIdx++) {
CString sLine = Buffer.GetLine(uIdx, *pUseClient);
const CBufLine& BufLine = Buffer.GetBufLine(uIdx);
CString sLine = BufLine.GetLine(*pUseClient, MCString::EmptyMap);
if (bBatch) {
MCString msBatchTags = CUtils::GetMessageTags(sLine);
msBatchTags["batch"] = sBatchName;
CUtils::SetMessageTags(sLine, msBatchTags);
}
bool bNotShowThisLine = false;
NETWORKMODULECALL(OnChanBufferPlayLine(*this, *pUseClient, sLine), m_pNetwork->GetUser(), m_pNetwork, NULL, &bNotShowThisLine);
NETWORKMODULECALL(OnChanBufferPlayLine2(*this, *pUseClient, sLine, BufLine.GetTime()), m_pNetwork->GetUser(), m_pNetwork, NULL, &bNotShowThisLine);
if (bNotShowThisLine) continue;
m_pNetwork->PutUser(sLine, pUseClient);
}