[Voice]: Add debug print (#1009)

This commit is contained in:
Edo 2023-05-04 18:40:38 +01:00 committed by GitHub
parent 4f4ef31840
commit e018f6c8fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 64 additions and 0 deletions

View File

@ -320,6 +320,7 @@ namespace Components
auto* clc = Game::CL_GetLocalClientConnection(0);
if (!Game::NET_CompareBaseAdr(clc->serverAddress, *address))
{
Logger::Debug("Ignoring stray 'v' network message from '{}'", Game::NET_AdrToString(*address));
return;
}

View File

@ -0,0 +1,39 @@
#include <STDInclude.hpp>
#include "FastCriticalSection.hpp"
namespace Game::Engine
{
FastCriticalSectionScopeRead::FastCriticalSectionScopeRead(FastCriticalSection* cs)
: cs_(cs)
{
if (this->cs_)
{
Sys_LockRead(this->cs_);
}
}
FastCriticalSectionScopeRead::~FastCriticalSectionScopeRead()
{
if (this->cs_)
{
Sys_UnlockRead(this->cs_);
}
}
FastCriticalSectionScopeWrite::FastCriticalSectionScopeWrite(FastCriticalSection* cs)
: cs_(cs)
{
if (this->cs_)
{
Sys_LockWrite(this->cs_);
}
}
FastCriticalSectionScopeWrite::~FastCriticalSectionScopeWrite()
{
if (this->cs_)
{
Sys_UnlockWrite(this->cs_);
}
}
}

View File

@ -0,0 +1,24 @@
#pragma once
namespace Game::Engine
{
class FastCriticalSectionScopeRead
{
public:
FastCriticalSectionScopeRead(FastCriticalSection* cs);
~FastCriticalSectionScopeRead();
private:
FastCriticalSection* cs_;
};
class FastCriticalSectionScopeWrite
{
public:
FastCriticalSectionScopeWrite(FastCriticalSection* cs);
~FastCriticalSectionScopeWrite();
private:
FastCriticalSection* cs_;
};
}