Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Generals/Code/GameEngine/Source/GameNetwork/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class Network : public NetworkInterface
__int64 m_nextFrameTime; ///< When did we execute the last frame? For slugging the GameLogic...

Bool m_frameDataReady; ///< Is the frame data for the next frame ready to be executed by TheGameLogic?
Bool m_isStalling;

// CRC info
Bool m_checkCRCsThisFrame;
Expand Down Expand Up @@ -269,6 +270,7 @@ Network::Network()
m_checkCRCsThisFrame = FALSE;
m_didSelfSlug = FALSE;
m_frameDataReady = FALSE;
m_isStalling = FALSE;
m_sawCRCMismatch = FALSE;
//

Expand Down Expand Up @@ -334,6 +336,7 @@ void Network::init()
m_lastExecutionFrame = m_runAhead - 1; // subtract 1 since we're starting on frame 0
m_lastFrameCompleted = m_runAhead - 1; // subtract 1 since we're starting on frame 0
m_frameDataReady = FALSE;
m_isStalling = FALSE;
m_didSelfSlug = FALSE;

m_localStatus = NETLOCALSTATUS_PREGAME;
Expand Down Expand Up @@ -692,6 +695,7 @@ void Network::update( void )
// 4. If all commands are there, put that frame's commands on TheCommandList.
//
m_frameDataReady = FALSE;
m_isStalling = FALSE;

#if defined(RTS_DEBUG)
if (m_networkOn == FALSE) {
Expand Down Expand Up @@ -723,6 +727,11 @@ void Network::update( void )
m_frameDataReady = TRUE; // Tell the GameEngine to run the commands for the new frame.
}
}
else {
__int64 curTime;
QueryPerformanceCounter((LARGE_INTEGER *)&curTime);
m_isStalling = curTime >= m_nextFrameTime;
}
}

void Network::liteupdate() {
Expand Down Expand Up @@ -812,9 +821,7 @@ Bool Network::isFrameDataReady() {

Bool Network::isStalling()
{
__int64 curTime;
QueryPerformanceCounter((LARGE_INTEGER *)&curTime);
return curTime >= m_nextFrameTime;
return m_isStalling;
}

/**
Expand Down
13 changes: 10 additions & 3 deletions GeneralsMD/Code/GameEngine/Source/GameNetwork/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class Network : public NetworkInterface
__int64 m_nextFrameTime; ///< When did we execute the last frame? For slugging the GameLogic...

Bool m_frameDataReady; ///< Is the frame data for the next frame ready to be executed by TheGameLogic?
Bool m_isStalling;

// CRC info
Bool m_checkCRCsThisFrame;
Expand Down Expand Up @@ -269,6 +270,7 @@ Network::Network()
m_checkCRCsThisFrame = FALSE;
m_didSelfSlug = FALSE;
m_frameDataReady = FALSE;
m_isStalling = FALSE;
m_sawCRCMismatch = FALSE;
//

Expand Down Expand Up @@ -334,6 +336,7 @@ void Network::init()
m_lastExecutionFrame = m_runAhead - 1; // subtract 1 since we're starting on frame 0
m_lastFrameCompleted = m_runAhead - 1; // subtract 1 since we're starting on frame 0
m_frameDataReady = FALSE;
m_isStalling = FALSE;
m_didSelfSlug = FALSE;

m_localStatus = NETLOCALSTATUS_PREGAME;
Expand Down Expand Up @@ -692,6 +695,7 @@ void Network::update( void )
// 4. If all commands are there, put that frame's commands on TheCommandList.
//
m_frameDataReady = FALSE;
m_isStalling = FALSE;

#if defined(RTS_DEBUG)
if (m_networkOn == FALSE) {
Expand Down Expand Up @@ -723,6 +727,11 @@ void Network::update( void )
m_frameDataReady = TRUE; // Tell the GameEngine to run the commands for the new frame.
}
}
else {
__int64 curTime;
QueryPerformanceCounter((LARGE_INTEGER *)&curTime);
m_isStalling = curTime >= m_nextFrameTime;
}
}

void Network::liteupdate() {
Expand Down Expand Up @@ -812,9 +821,7 @@ Bool Network::isFrameDataReady() {

Bool Network::isStalling()
{
__int64 curTime;
QueryPerformanceCounter((LARGE_INTEGER *)&curTime);
return curTime >= m_nextFrameTime;
return m_isStalling;
}

/**
Expand Down
Loading