lowered numbers for sleeping when game is loading in network mode and allow ini override of values
This commit is contained in:
parent
e8279621b1
commit
33e1af022a
|
@ -696,7 +696,9 @@ void ClientInterface::waitUntilReady(Checksum* checksum) {
|
|||
int64 lastMillisCheck = 0;
|
||||
|
||||
uint64 waitLoopIterationCount = 0;
|
||||
const uint64 MAX_LOOP_COUNT_BEFORE_SLEEP = 300;
|
||||
uint64 MAX_LOOP_COUNT_BEFORE_SLEEP = 100;
|
||||
MAX_LOOP_COUNT_BEFORE_SLEEP = Config::getInstance().getInt("NetworkClientLoopGameLoadingCap",intToStr(MAX_LOOP_COUNT_BEFORE_SLEEP).c_str());
|
||||
uint sleepMillis = Config::getInstance().getInt("NetworkClientLoopGameLoadingCapSleepMillis","1");
|
||||
|
||||
//wait until we get a ready message from the server
|
||||
while(true) {
|
||||
|
@ -705,7 +707,7 @@ void ClientInterface::waitUntilReady(Checksum* checksum) {
|
|||
|
||||
waitLoopIterationCount++;
|
||||
if(waitLoopIterationCount > 0 && waitLoopIterationCount % MAX_LOOP_COUNT_BEFORE_SLEEP == 0) {
|
||||
sleep(1);
|
||||
sleep(sleepMillis);
|
||||
waitLoopIterationCount = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1176,11 +1176,14 @@ void ServerInterface::waitUntilReady(Checksum *checksum) {
|
|||
|
||||
Lang &lang= Lang::getInstance();
|
||||
uint64 waitLoopIterationCount = 0;
|
||||
const uint64 MAX_LOOP_COUNT_BEFORE_SLEEP = 300;
|
||||
uint64 MAX_LOOP_COUNT_BEFORE_SLEEP = 100;
|
||||
MAX_LOOP_COUNT_BEFORE_SLEEP = Config::getInstance().getInt("NetworkServerLoopGameLoadingCap",intToStr(MAX_LOOP_COUNT_BEFORE_SLEEP).c_str());
|
||||
uint sleepMillis = Config::getInstance().getInt("NetworkServerLoopGameLoadingCapSleepMillis","1");
|
||||
|
||||
while(exitServer == false && allReady == false && logger.getCancelLoading() == false) {
|
||||
waitLoopIterationCount++;
|
||||
if(waitLoopIterationCount > 0 && waitLoopIterationCount % MAX_LOOP_COUNT_BEFORE_SLEEP == 0) {
|
||||
sleep(1);
|
||||
sleep(sleepMillis);
|
||||
waitLoopIterationCount = 0;
|
||||
}
|
||||
vector<string> waitingForHosts;
|
||||
|
|
Loading…
Reference in New Issue
Block a user