commented out ping code and added synch check for large comamnds list

This commit is contained in:
Mark Vejvoda 2010-06-05 00:00:36 +00:00
parent 2970e5114a
commit 3b06db30e9
4 changed files with 24 additions and 1 deletions

View File

@ -37,7 +37,7 @@ public:
static const int serverPort= 61357;
static const int updateFps= 40;
static const int cameraFps= 100;
static const int networkFramePeriod= 10;
static const int networkFramePeriod= 20;
static const int networkExtraLatency= 200;
static const int maxClientConnectHandshakeSecs= 10;

View File

@ -111,6 +111,16 @@ void ClientInterface::update()
sendMessage(&networkMessageCommandList);
}
// Possible cause of out of synch since we have more commands that need
// to be sent in this frame
if(!requestedCommands.empty()) {
char szBuf[1024]="";
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING / ERROR, requestedCommands.size() = %d\n",__FILE__,__FUNCTION__,requestedCommands.size());
string sMsg = Config::getInstance().getString("NetPlayerName",Socket::getHostName().c_str()) + " may go out of synch: client requestedCommands.size() = " + intToStr(requestedCommands.size());
sendTextMessage(sMsg,-1);
}
//clear chat variables
chatText.clear();
chatSender.clear();

View File

@ -424,6 +424,16 @@ void ServerInterface::updateKeyframe(int frameCount){
}
}
// Possible cause of out of synch since we have more commands that need
// to be sent in this frame
if(!requestedCommands.empty()) {
char szBuf[1024]="";
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING / ERROR, requestedCommands.size() = %d\n",__FILE__,__FUNCTION__,requestedCommands.size());
string sMsg = Config::getInstance().getString("NetPlayerName",Socket::getHostName().c_str()) + " may go out of synch: server requestedCommands.size() = " + intToStr(requestedCommands.size());
sendTextMessage(sMsg,-1);
}
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] build command list took %d msecs, networkMessageCommandList.getCommandCount() = %d, frameCount = %d\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis(),networkMessageCommandList.getCommandCount(),frameCount);
//broadcast commands

View File

@ -1753,7 +1753,9 @@ void BroadCastSocketThread::execute() {
float Socket::getAveragePingMS(std::string host, int pingCount) {
double result = -1;
return result;
/*
const bool debugPingOutput = false;
char szCmd[1024]="";
#ifdef WIN32
@ -1852,6 +1854,7 @@ float Socket::getAveragePingMS(std::string host, int pingCount) {
}
}
return result;
*/
}
std::string Socket::getIpAddress() {