mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 02:40:17 +02:00
- try to improve network performance
This commit is contained in:
@@ -28,9 +28,7 @@ using namespace std;
|
|||||||
|
|
||||||
namespace Glest{ namespace Game{
|
namespace Glest{ namespace Game{
|
||||||
|
|
||||||
// 20 was working ok, we try 10 to see if its better for performance
|
int GameConstants::networkFramePeriod = 20;
|
||||||
//int GameConstants::networkFramePeriod = 20;
|
|
||||||
int GameConstants::networkFramePeriod = 10;
|
|
||||||
int GameConstants::updateFps = 40;
|
int GameConstants::updateFps = 40;
|
||||||
int GameConstants::cameraFps = 100;
|
int GameConstants::cameraFps = 100;
|
||||||
|
|
||||||
|
@@ -79,9 +79,9 @@ void ClientInterfaceThread::execute() {
|
|||||||
Chrono chrono;
|
Chrono chrono;
|
||||||
|
|
||||||
// Set socket to blocking
|
// Set socket to blocking
|
||||||
if(clientInterface != NULL && clientInterface->getSocket(true) != NULL) {
|
//if(clientInterface != NULL && clientInterface->getSocket(true) != NULL) {
|
||||||
clientInterface->getSocket(true)->setBlock(true);
|
// clientInterface->getSocket(true)->setBlock(true);
|
||||||
}
|
//}
|
||||||
|
|
||||||
for(;this->clientInterface != NULL;) {
|
for(;this->clientInterface != NULL;) {
|
||||||
if(getQuitStatus() == true) {
|
if(getQuitStatus() == true) {
|
||||||
@@ -1782,8 +1782,8 @@ NetworkMessageType ClientInterface::waitForMessage(int waitMicroseconds)
|
|||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
// Sleep every x milli-seconds we wait to let other threads work
|
// Sleep every x milli-seconds we wait to let other threads work
|
||||||
else if(chrono.getMillis() % 50 == 0) {
|
else if(chrono.getMillis() % 100 == 0) {
|
||||||
sleep(5);
|
sleep(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
//sleep(waitSleepTime);
|
//sleep(waitSleepTime);
|
||||||
|
Reference in New Issue
Block a user