mirror of
https://github.com/glest/glest-source.git
synced 2025-08-18 14:11:15 +02:00
commented out ping code and added synch check for large comamnds list
This commit is contained in:
@@ -37,7 +37,7 @@ public:
|
|||||||
static const int serverPort= 61357;
|
static const int serverPort= 61357;
|
||||||
static const int updateFps= 40;
|
static const int updateFps= 40;
|
||||||
static const int cameraFps= 100;
|
static const int cameraFps= 100;
|
||||||
static const int networkFramePeriod= 10;
|
static const int networkFramePeriod= 20;
|
||||||
static const int networkExtraLatency= 200;
|
static const int networkExtraLatency= 200;
|
||||||
static const int maxClientConnectHandshakeSecs= 10;
|
static const int maxClientConnectHandshakeSecs= 10;
|
||||||
|
|
||||||
|
@@ -111,6 +111,16 @@ void ClientInterface::update()
|
|||||||
sendMessage(&networkMessageCommandList);
|
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
|
//clear chat variables
|
||||||
chatText.clear();
|
chatText.clear();
|
||||||
chatSender.clear();
|
chatSender.clear();
|
||||||
|
@@ -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);
|
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
|
//broadcast commands
|
||||||
|
@@ -1753,7 +1753,9 @@ void BroadCastSocketThread::execute() {
|
|||||||
|
|
||||||
float Socket::getAveragePingMS(std::string host, int pingCount) {
|
float Socket::getAveragePingMS(std::string host, int pingCount) {
|
||||||
double result = -1;
|
double result = -1;
|
||||||
|
return result;
|
||||||
|
|
||||||
|
/*
|
||||||
const bool debugPingOutput = false;
|
const bool debugPingOutput = false;
|
||||||
char szCmd[1024]="";
|
char szCmd[1024]="";
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@@ -1852,6 +1854,7 @@ float Socket::getAveragePingMS(std::string host, int pingCount) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Socket::getIpAddress() {
|
std::string Socket::getIpAddress() {
|
||||||
|
Reference in New Issue
Block a user