From 1ffc7d99d401f68cb8fac33214457082bd3b40dc Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sun, 10 Apr 2011 23:50:47 +0000 Subject: [PATCH] - calculate megapack techtree CRC first if it exists in the users techtrees --- .../shared_lib/sources/platform/common/simple_threads.cpp | 8 ++++++++ source/shared_lib/sources/platform/posix/socket.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/source/shared_lib/sources/platform/common/simple_threads.cpp b/source/shared_lib/sources/platform/common/simple_threads.cpp index 0c1ee7b7..e2770bf5 100644 --- a/source/shared_lib/sources/platform/common/simple_threads.cpp +++ b/source/shared_lib/sources/platform/common/simple_threads.cpp @@ -66,7 +66,15 @@ void FileCRCPreCacheThread::execute() { vector techPaths; findDirs(techDataPaths, techPaths); if(techPaths.empty() == false) { + // Always calc megapack first so its up to date sooner + const string megapackTechtreeName = "megapack"; + vector::iterator iterFindMegaPack = std::find(techPaths.begin(),techPaths.end(),megapackTechtreeName); + if(iterFindMegaPack != techPaths.end()) { + techPaths.erase(iterFindMegaPack); + techPaths.insert(techPaths.begin(),megapackTechtreeName); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] Found megapack techtree and placing it at the TOP of the list\n",__FILE__,__FUNCTION__,__LINE__); + } unsigned int techsPerWorker = (techPaths.size() / MAX_FileCRCPreCacheThread_WORKER_THREADS); if(techPaths.size() % MAX_FileCRCPreCacheThread_WORKER_THREADS != 0) { techsPerWorker++; diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index 9b3925d9..78e5db7e 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1445,7 +1445,7 @@ bool Socket::isConnected() { int err = peek(&tmp, 1, false); if(err <= 0 && err != PLATFORM_SOCKET_TRY_AGAIN) { if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"[%s::%s Line: %d] ERROR Peek failed, err = %d, error = %s\n",__FILE__,__FUNCTION__,__LINE__,err,getLastSocketErrorFormattedText().c_str()); - SystemFlags::OutputDebug(SystemFlags::debugError,"SOCKET DISCONNECTED In [%s::%s Line: %d] ERROR Peek failed, err = %d, error = %s\n",__FILE__,__FUNCTION__,__LINE__,err,getLastSocketErrorFormattedText().c_str()); + if(SystemFlags::VERBOSE_MODE_ENABLED) SystemFlags::OutputDebug(SystemFlags::debugError,"SOCKET DISCONNECTED In [%s::%s Line: %d] ERROR Peek failed, err = %d, error = %s\n",__FILE__,__FUNCTION__,__LINE__,err,getLastSocketErrorFormattedText().c_str()); return false; } }