mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #1564 from def-/pr-dummy-fixes
Some more dummy fixes (might fix #1415)
This commit is contained in:
commit
1fd130cf15
|
@ -347,6 +347,8 @@ CClient::CClient() : m_DemoPlayer(&m_SnapshotDelta)
|
|||
m_SnapshotStorage[1].Init();
|
||||
m_ReceivedSnapshots[0] = 0;
|
||||
m_ReceivedSnapshots[1] = 0;
|
||||
m_SnapshotParts[0] = 0;
|
||||
m_SnapshotParts[1] = 0;
|
||||
|
||||
m_VersionInfo.m_State = CVersionInfo::STATE_INIT;
|
||||
|
||||
|
@ -606,7 +608,7 @@ void CClient::OnEnterGame()
|
|||
m_aSnapshots[g_Config.m_ClDummy][SNAP_PREV] = 0;
|
||||
m_SnapshotStorage[g_Config.m_ClDummy].PurgeAll();
|
||||
m_ReceivedSnapshots[g_Config.m_ClDummy] = 0;
|
||||
m_SnapshotParts = 0;
|
||||
m_SnapshotParts[g_Config.m_ClDummy] = 0;
|
||||
m_PredTick[g_Config.m_ClDummy] = 0;
|
||||
m_CurrentRecvTick[g_Config.m_ClDummy] = 0;
|
||||
m_CurGameTick[g_Config.m_ClDummy] = 0;
|
||||
|
@ -1767,14 +1769,14 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket)
|
|||
{
|
||||
if(GameTick != m_CurrentRecvTick[g_Config.m_ClDummy])
|
||||
{
|
||||
m_SnapshotParts = 0;
|
||||
m_SnapshotParts[g_Config.m_ClDummy] = 0;
|
||||
m_CurrentRecvTick[g_Config.m_ClDummy] = GameTick;
|
||||
}
|
||||
|
||||
mem_copy((char*)m_aSnapshotIncomingData + Part*MAX_SNAPSHOT_PACKSIZE, pData, clamp(PartSize, 0, (int)sizeof(m_aSnapshotIncomingData) - Part*MAX_SNAPSHOT_PACKSIZE));
|
||||
m_SnapshotParts |= 1<<Part;
|
||||
m_SnapshotParts[g_Config.m_ClDummy] |= 1<<Part;
|
||||
|
||||
if(m_SnapshotParts == (unsigned)((1<<NumParts)-1))
|
||||
if(m_SnapshotParts[g_Config.m_ClDummy] == (unsigned)((1<<NumParts)-1))
|
||||
{
|
||||
static CSnapshot Emptysnap;
|
||||
CSnapshot *pDeltaShot = &Emptysnap;
|
||||
|
@ -1789,7 +1791,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket)
|
|||
CompleteSize = (NumParts-1) * MAX_SNAPSHOT_PACKSIZE + PartSize;
|
||||
|
||||
// reset snapshoting
|
||||
m_SnapshotParts = 0;
|
||||
m_SnapshotParts[g_Config.m_ClDummy] = 0;
|
||||
|
||||
// find snapshot that we should use as delta
|
||||
Emptysnap.Clear();
|
||||
|
@ -2039,14 +2041,14 @@ void CClient::ProcessServerPacketDummy(CNetChunk *pPacket)
|
|||
{
|
||||
if(GameTick != m_CurrentRecvTick[!g_Config.m_ClDummy])
|
||||
{
|
||||
m_SnapshotParts = 0;
|
||||
m_SnapshotParts[!g_Config.m_ClDummy] = 0;
|
||||
m_CurrentRecvTick[!g_Config.m_ClDummy] = GameTick;
|
||||
}
|
||||
|
||||
mem_copy((char*)m_aSnapshotIncomingData + Part*MAX_SNAPSHOT_PACKSIZE, pData, clamp(PartSize, 0, (int)sizeof(m_aSnapshotIncomingData) - Part*MAX_SNAPSHOT_PACKSIZE));
|
||||
m_SnapshotParts |= 1<<Part;
|
||||
m_SnapshotParts[!g_Config.m_ClDummy] |= 1<<Part;
|
||||
|
||||
if(m_SnapshotParts == (unsigned)((1<<NumParts)-1))
|
||||
if(m_SnapshotParts[!g_Config.m_ClDummy] == (unsigned)((1<<NumParts)-1))
|
||||
{
|
||||
static CSnapshot Emptysnap;
|
||||
CSnapshot *pDeltaShot = &Emptysnap;
|
||||
|
@ -2061,7 +2063,7 @@ void CClient::ProcessServerPacketDummy(CNetChunk *pPacket)
|
|||
CompleteSize = (NumParts-1) * MAX_SNAPSHOT_PACKSIZE + PartSize;
|
||||
|
||||
// reset snapshoting
|
||||
m_SnapshotParts = 0;
|
||||
m_SnapshotParts[!g_Config.m_ClDummy] = 0;
|
||||
|
||||
// find snapshot that we should use as delta
|
||||
Emptysnap.Clear();
|
||||
|
@ -2719,7 +2721,6 @@ void CClient::InitInterfaces()
|
|||
void CClient::Run()
|
||||
{
|
||||
m_LocalStartTime = time_get();
|
||||
m_SnapshotParts = 0;
|
||||
|
||||
if(m_GenerateTimeoutSeed)
|
||||
{
|
||||
|
|
|
@ -90,7 +90,7 @@ class CClient : public IClient, public CDemoPlayer::IListener
|
|||
|
||||
char m_aServerAddressStr[256];
|
||||
|
||||
unsigned m_SnapshotParts;
|
||||
unsigned m_SnapshotParts[2];
|
||||
int64 m_LocalStartTime;
|
||||
|
||||
int m_DebugFont;
|
||||
|
|
Loading…
Reference in a new issue