diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 7ffaa247..8967aa6a 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -3,6 +3,22 @@ MEGAGLEST CHANGELOG To see a timeline of detail changes please visit: http://sourceforge.net/apps/trac/megaglest/timeline +v3.8.0-beta1 +- Greater ability to translate game content into your native language. (including techtrees) + - Added Hebrew, Arabic, Vietnamese. +- better network game performance / management to handle slower clients. +- performance improvements. +- Enhanced AI behaviour. +- new game content including maps and tilesets. +- many bugfixes discovered in 3.7.1 +- added ability for stand alone mod's to customize more of the engine like about screen. +- animated tileset object support. +- easier ability to download game content from host. +- many new lua functions for scenario modders. +- addition of google-breakpad to better track down bugs. +- color picking is now the default selection mode +- + v3.7.1 - bugfixes reported in the bugs forum since 3.7.0 diff --git a/source/glest_game/ai/ai_interface.cpp b/source/glest_game/ai/ai_interface.cpp index f7b99867..0caec7c0 100644 --- a/source/glest_game/ai/ai_interface.cpp +++ b/source/glest_game/ai/ai_interface.cpp @@ -123,7 +123,7 @@ void AiInterfaceThread::execute() { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] ****************** STARTING worker thread this = %p\n",__FILE__,__FUNCTION__,__LINE__,this); - bool minorDebugPerformance = false; + //bool minorDebugPerformance = false; Chrono chrono; //unsigned int idx = 0; diff --git a/source/glest_game/ai/ai_rule.cpp b/source/glest_game/ai/ai_rule.cpp index 404398e7..72928d98 100644 --- a/source/glest_game/ai/ai_rule.cpp +++ b/source/glest_game/ai/ai_rule.cpp @@ -1327,7 +1327,6 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ int lowestCommandCount=1000000; int currentProducerIndex=backupProducers[randomstart]; int bestIndex=-1; - int currentCommandCount=0; for(unsigned int i=randomstart; i= backupProducers.size()) { @@ -1349,7 +1348,7 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ throw megaglest_runtime_error(szBuf); } - currentCommandCount=aiInterface->getMyUnit(currentProducerIndex)->getCommandSize(); + int currentCommandCount=aiInterface->getMyUnit(currentProducerIndex)->getCommandSize(); if( currentCommandCount==1 && aiInterface->getMyUnit(currentProducerIndex)->getCurrCommand()->getCommandType()->getClass()==ccStop) {// special for non buildings diff --git a/source/glest_game/ai/path_finder.cpp b/source/glest_game/ai/path_finder.cpp index 9e84e534..b09ac30e 100644 --- a/source/glest_game/ai/path_finder.cpp +++ b/source/glest_game/ai/path_finder.cpp @@ -1599,7 +1599,6 @@ bool PathFinder::unitCannotMove(Unit *unit) { bool unitImmediatelyBlocked = false; // First check if unit currently blocked all around them, if so don't try to pathfind - const bool showConsoleDebugInfo = Config::getInstance().getBool("EnablePathfinderDistanceOutput","false"); const Vec2i unitPos = unit->getPos(); int failureCount = 0; int cellCount = 0; diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 9e66f851..d742a3eb 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -2045,13 +2045,12 @@ void Game::update() { if(hasAIPlayer == true) { //sleep(0); - bool workThreadsFinished = false; Chrono chronoAI; chronoAI.start(); const int MAX_FACTION_THREAD_WAIT_MILLISECONDS = 20000; for(;chronoAI.getMillis() < MAX_FACTION_THREAD_WAIT_MILLISECONDS;) { - workThreadsFinished = true; + bool workThreadsFinished = true; for(int j = 0; j < world.getFactionCount(); ++j) { Faction *faction = world.getFaction(j); if(faction == NULL) { diff --git a/source/glest_game/game/script_manager.cpp b/source/glest_game/game/script_manager.cpp index 2c178cbc..844421d2 100644 --- a/source/glest_game/game/script_manager.cpp +++ b/source/glest_game/game/script_manager.cpp @@ -30,10 +30,8 @@ ScriptManagerMessage::ScriptManagerMessage() : text(""), header("") { this->teamIndex=-1; } -ScriptManagerMessage::ScriptManagerMessage(string text, string header, - int factionIndex,int teamIndex) { - this->text = text; - this->header = header; +ScriptManagerMessage::ScriptManagerMessage(string textIn, string headerIn, + int factionIndex,int teamIndex) : text(textIn), header(headerIn) { this->factionIndex = factionIndex; this->teamIndex = teamIndex; } diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index 312fd568..75e45893 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -2090,8 +2090,9 @@ void Renderer::renderConsole(const Console *console,const bool showFullConsole, int x= console->getXPos()-5; int y= console->getYPos()-5; int h= console->getLineHeight()*console->getStoredLineCount(); - int w= 1000; - if(h>0){ + + if(h > 0) { + int w= 1000; //background glPushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT); glEnable(GL_BLEND); @@ -4312,8 +4313,6 @@ void Renderer::renderSurface(const int renderFps) { } else { - int lastSurfaceDataIndex = -1; - const bool useVBOs = false; const bool useSurfaceCache = false; @@ -4349,6 +4348,7 @@ void Renderer::renderSurface(const int renderFps) { } surface->reserve(qCache.visibleScaledCellList.size()); + int lastSurfaceDataIndex = -1; for(int visibleIndex = 0; visibleIndex < qCache.visibleScaledCellList.size(); ++visibleIndex) { Vec2i &pos = qCache.visibleScaledCellList[visibleIndex]; @@ -4429,22 +4429,12 @@ void Renderer::renderSurface(const int renderFps) { cellData->normals.push_back(tc10->getNormal()); cellData->bufferCount++; } - -/* - if(useSurfaceCache == true) { - std::pair > &surfaceCacheEntity = mapSurfaceData[snapshotOfvisibleQuad.getString()]; - surfaceCacheEntity.first.start(); - } -*/ } - //printf("\nsurface.size() = %d vs qCache.visibleScaledCellList.size() = %d snapshotOfvisibleQuad [%s]\n",surface.size(),qCache.visibleScaledCellList.size(),snapshotOfvisibleQuad.getString().c_str()); std::vector *surface = &surfaceData; if(useSurfaceCache == true) { std::pair > &surfaceCacheEntity = mapSurfaceData[snapshotOfvisibleQuad.getString()]; surface = &surfaceCacheEntity.second; - - //printf("Surface Cache Size for Rendering using VA's = " MG_SIZE_T_SPECIFIER "\n",mapSurfaceData.size()); } glEnableClientState(GL_VERTEX_ARRAY); diff --git a/source/glest_game/main/intro.cpp b/source/glest_game/main/intro.cpp index 1538ba31..6e4bf293 100644 --- a/source/glest_game/main/intro.cpp +++ b/source/glest_game/main/intro.cpp @@ -667,8 +667,6 @@ void Intro::render() { return; } - int difTime=0; - canRender(); incrementFps(); @@ -686,7 +684,7 @@ void Intro::render() { for(int i = 0; i < texts.size(); ++i) { Text *text= texts[i]; - difTime= 1000 * timer / GameConstants::updateFps - text->getTime(); + int difTime= 1000 * timer / GameConstants::updateFps - text->getTime(); if(difTime > 0 && difTime < appearTime + showTime + disapearTime) { float alpha= 1.f; diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index c139a780..bd95ee29 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -466,7 +466,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, labelTeam.setFont(CoreData::getInstance().getMenuFontBig()); labelTeam.setFont3D(CoreData::getInstance().getMenuFontBig3D()); - xoffset=100; + //xoffset=100; //texts buttonClearBlockedPlayers.setText(lang.get("BlockPlayerClear")); diff --git a/source/glest_game/menu/menu_state_load_game.cpp b/source/glest_game/menu/menu_state_load_game.cpp index 0148caff..d354049b 100644 --- a/source/glest_game/menu/menu_state_load_game.cpp +++ b/source/glest_game/menu/menu_state_load_game.cpp @@ -353,14 +353,11 @@ void MenuStateLoadGame::mouseUp(int x, int y, const MouseButton mouseButton){ } } -void MenuStateLoadGame::deleteSlot(int i){ - if(selectedButton==slots[i]){ - selectedButton=NULL; - } -// buttonToDelete=slots[i]; -// slots.erase(i); -// slotsGB.erase(i); -} +//void MenuStateLoadGame::deleteSlot(int i){ +// if(selectedButton==slots[i]){ +// selectedButton=NULL; +// } +//} void MenuStateLoadGame::mouseMove(int x, int y, const MouseState *ms){ diff --git a/source/glest_game/menu/menu_state_load_game.h b/source/glest_game/menu/menu_state_load_game.h index 066b7f91..0bc7be42 100644 --- a/source/glest_game/menu/menu_state_load_game.h +++ b/source/glest_game/menu/menu_state_load_game.h @@ -67,7 +67,7 @@ public: private: void clearSlots(); - void deleteSlot(int i); + //void deleteSlot(int i); void listFiles(); void showMessageBox(const string &text, const string &header, bool toggle); diff --git a/source/glest_game/menu/menu_state_options_network.cpp b/source/glest_game/menu/menu_state_options_network.cpp index 7a346025..9425c0c3 100644 --- a/source/glest_game/menu/menu_state_options_network.cpp +++ b/source/glest_game/menu/menu_state_options_network.cpp @@ -301,20 +301,20 @@ void MenuStateOptionsNetwork::reloadUI() { GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName); } -void MenuStateOptionsNetwork::showMessageBox(const string &text, const string &header, bool toggle){ - if(!toggle){ - mainMessageBox.setEnabled(false); - } - - if(!mainMessageBox.getEnabled()){ - mainMessageBox.setText(text); - mainMessageBox.setHeader(header); - mainMessageBox.setEnabled(true); - } - else{ - mainMessageBox.setEnabled(false); - } -} +//void MenuStateOptionsNetwork::showMessageBox(const string &text, const string &header, bool toggle){ +// if(!toggle){ +// mainMessageBox.setEnabled(false); +// } +// +// if(!mainMessageBox.getEnabled()){ +// mainMessageBox.setText(text); +// mainMessageBox.setHeader(header); +// mainMessageBox.setEnabled(true); +// } +// else{ +// mainMessageBox.setEnabled(false); +// } +//} void MenuStateOptionsNetwork::mouseClick(int x, int y, MouseButton mouseButton){ diff --git a/source/glest_game/menu/menu_state_options_network.h b/source/glest_game/menu/menu_state_options_network.h index 50efad74..71a470fb 100644 --- a/source/glest_game/menu/menu_state_options_network.h +++ b/source/glest_game/menu/menu_state_options_network.h @@ -82,7 +82,7 @@ public: private: void saveConfig(); void setActiveInputLable(GraphicLabel* newLable); - void showMessageBox(const string &text, const string &header, bool toggle); + //void showMessageBox(const string &text, const string &header, bool toggle); }; }}//end namespace diff --git a/source/glest_game/menu/menu_state_options_sound.cpp b/source/glest_game/menu/menu_state_options_sound.cpp index a8cc3e55..0410364f 100644 --- a/source/glest_game/menu/menu_state_options_sound.cpp +++ b/source/glest_game/menu/menu_state_options_sound.cpp @@ -230,20 +230,20 @@ void MenuStateOptionsSound::reloadUI() { -void MenuStateOptionsSound::showMessageBox(const string &text, const string &header, bool toggle){ - if(!toggle){ - mainMessageBox.setEnabled(false); - } - - if(!mainMessageBox.getEnabled()){ - mainMessageBox.setText(text); - mainMessageBox.setHeader(header); - mainMessageBox.setEnabled(true); - } - else{ - mainMessageBox.setEnabled(false); - } -} +//void MenuStateOptionsSound::showMessageBox(const string &text, const string &header, bool toggle){ +// if(!toggle){ +// mainMessageBox.setEnabled(false); +// } +// +// if(!mainMessageBox.getEnabled()){ +// mainMessageBox.setText(text); +// mainMessageBox.setHeader(header); +// mainMessageBox.setEnabled(true); +// } +// else{ +// mainMessageBox.setEnabled(false); +// } +//} void MenuStateOptionsSound::mouseClick(int x, int y, MouseButton mouseButton){ diff --git a/source/glest_game/menu/menu_state_options_sound.h b/source/glest_game/menu/menu_state_options_sound.h index c2bf1773..dc4cef95 100644 --- a/source/glest_game/menu/menu_state_options_sound.h +++ b/source/glest_game/menu/menu_state_options_sound.h @@ -66,7 +66,7 @@ public: private: void saveConfig(); void setActiveInputLable(GraphicLabel* newLable); - void showMessageBox(const string &text, const string &header, bool toggle); + //void showMessageBox(const string &text, const string &header, bool toggle); }; }}//end namespace diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index fb6b3d14..0d1f908c 100644 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -77,7 +77,7 @@ void ClientInterfaceThread::execute() { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] ****************** STARTING worker thread this = %p\n",__FILE__,__FUNCTION__,__LINE__,this); - bool minorDebugPerformance = false; + //bool minorDebugPerformance = false; Chrono chrono; // Set socket to blocking @@ -1044,7 +1044,6 @@ void ClientInterface::updateFrame(int *checkFrame) { case nmtCommandList: { - int waitCount = 0; //make sure we read the message time_t receiveTimeElapsed = time(NULL); NetworkMessageCommandList networkMessageCommandList; @@ -1060,13 +1059,7 @@ void ClientInterface::updateFrame(int *checkFrame) { throw megaglest_runtime_error("error retrieving nmtCommandList returned false!"); } - // while(receiveMessage(&networkMessageCommandList) == false && - // isConnected() == true && - // difftime(time(NULL),receiveTimeElapsed) <= (messageWaitTimeout / 2000)) { - // waitCount++; - // } - - if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] receiveMessage took %lld msecs, waitCount = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis(),waitCount); + if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] receiveMessage took %lld msecs\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis()); if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled) chrono.start(); MutexSafeWrapper safeMutex(networkCommandListThreadAccessor,CODE_AT_LINE); diff --git a/source/glest_game/types/tileset_model_type.cpp b/source/glest_game/types/tileset_model_type.cpp index 5bd08c5b..d897fcc1 100644 --- a/source/glest_game/types/tileset_model_type.cpp +++ b/source/glest_game/types/tileset_model_type.cpp @@ -23,6 +23,7 @@ TilesetModelType::TilesetModelType() { height = 0; rotationAllowed = false; smoothTwoFrameAnim = false; + randomPositionEnabled = false; animSpeed = 0; } diff --git a/source/glest_game/world/map.cpp b/source/glest_game/world/map.cpp index 0f738d1d..334e493a 100644 --- a/source/glest_game/world/map.cpp +++ b/source/glest_game/world/map.cpp @@ -499,9 +499,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) { } } } - else{ - if(f) fclose(f); - + else { throw megaglest_runtime_error("Can't open file"); } fclose(f); diff --git a/source/glest_game/world/world.cpp b/source/glest_game/world/world.cpp index f54d67cb..edb39352 100644 --- a/source/glest_game/world/world.cpp +++ b/source/glest_game/world/world.cpp @@ -633,13 +633,12 @@ void World::updateAllFactionUnits() { perfList.push_back(perfBuf); } - bool workThreadsFinished = false; Chrono chrono; chrono.start(); const int MAX_FACTION_THREAD_WAIT_MILLISECONDS = 20000; for(;chrono.getMillis() < MAX_FACTION_THREAD_WAIT_MILLISECONDS;) { - workThreadsFinished = true; + bool workThreadsFinished = true; for(int i = 0; i < factionCount; ++i) { Faction *faction = getFaction(i); if(faction->isWorkerThreadSignalCompleted(frameCount) == false) { diff --git a/source/shared_lib/sources/graphics/JPGReader.cpp b/source/shared_lib/sources/graphics/JPGReader.cpp index 1dfd9b7d..37e2fd90 100644 --- a/source/shared_lib/sources/graphics/JPGReader.cpp +++ b/source/shared_lib/sources/graphics/JPGReader.cpp @@ -153,13 +153,13 @@ Pixmap2D* JPGReader::read(ifstream& is, const string& path, Pixmap2D* ret) const //std::cout << "output width and height: " << cinfo.output_width <<" pixels and " << cinfo.output_height <<" pixels." << std::endl; /* now actually read the jpeg into the raw buffer */ row_pointer[0] = new unsigned char[cinfo.output_width*cinfo.num_components]; - size_t location = 0; //Current pixel /* read one scan line at a time */ /* Again you need to invert the lines unfortunately*/ while( cinfo.output_scanline < cinfo.output_height ) { jpeg_read_scanlines( &cinfo, row_pointer, 1 ); - location = (cinfo.output_height - cinfo.output_scanline)*cinfo.output_width*picComponents; + //Current pixel + size_t location = (cinfo.output_height - cinfo.output_scanline) * cinfo.output_width * picComponents; if (picComponents == cinfo.num_components) { memcpy(pixels+location,row_pointer[0],cinfo.output_width*cinfo.num_components); } else { diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 8685cb09..707bbbff 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -438,14 +438,14 @@ bool fileExists(const string &path) { fclose(file); return true; } - else { +// else { //int fileErrno = errno; -#ifdef WIN32 - int fileErrno = errno; - DWORD error = GetLastError(); - string strError = "[#6] Could not open file, result: " + intToStr(error) + " - " + intToStr(fileErrno) + " " + strerror(fileErrno) + " [" + path + "]"; -#endif - } +//#ifdef WIN32 + //int fileErrno = errno; + //DWORD error = GetLastError(); + //string strError = "[#6] Could not open file, result: " + intToStr(error) + " - " + intToStr(fileErrno) + " " + strerror(fileErrno) + " [" + path + "]"; +//#endif +// } return false; } @@ -699,7 +699,7 @@ pair hasCachedFileCRCValue(string crcCacheFile, uint32 &value) { char gameVer[500]=""; char svnVer[500]=""; char actualFilePath[8096]=""; - int readbytes = fscanf(fp,"%20ld,%20u,%20ld\n%s\n%s\n%s", + int readbytes = fscanf(fp,"%20ld,%20u,%20ld\n%499s\n%499s\n%8095s", &refreshDate, &crcValue, &lastUpdateDate, diff --git a/source/shared_lib/sources/platform/common/simple_threads.cpp b/source/shared_lib/sources/platform/common/simple_threads.cpp index 404c7e53..ad5f6b98 100644 --- a/source/shared_lib/sources/platform/common/simple_threads.cpp +++ b/source/shared_lib/sources/platform/common/simple_threads.cpp @@ -96,9 +96,8 @@ void FileCRCPreCacheThread::execute() { if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] techsPerWorker = %u, MAX_FileCRCPreCacheThread_WORKER_THREADS = %d, techPaths.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,techsPerWorker,MAX_FileCRCPreCacheThread_WORKER_THREADS,(int)techPaths.size()); - unsigned int consumedWorkers = 0; - try { + unsigned int consumedWorkers = 0; for(unsigned int workerIdx = 0; workerIdx < MAX_FileCRCPreCacheThread_WORKER_THREADS; ++workerIdx) { if(getQuitStatus() == true) { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); @@ -162,9 +161,9 @@ void FileCRCPreCacheThread::execute() { sleep(0); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] Waiting for Spawned CRC threads to complete, preCacheWorkerThreadList.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,(int)preCacheWorkerThreadList.size()); - bool hasRunningWorkerThread = true; try { + bool hasRunningWorkerThread = true; for(;hasRunningWorkerThread == true;) { hasRunningWorkerThread = false; for(unsigned int idx = 0; idx < preCacheWorkerThreadList.size(); idx++) { diff --git a/source/shared_lib/sources/platform/posix/ircclient.cpp b/source/shared_lib/sources/platform/posix/ircclient.cpp index 0f82692b..fb22d142 100644 --- a/source/shared_lib/sources/platform/posix/ircclient.cpp +++ b/source/shared_lib/sources/platform/posix/ircclient.cpp @@ -236,8 +236,6 @@ void event_privmsg (irc_session_t * session, const char * event, const char * or } void dcc_recv_callback (irc_session_t * session, irc_dcc_t id, int status, void * ctx, const char * data, unsigned int length) { - static int count = 1; - char buf[12]=""; switch (status) { @@ -252,6 +250,9 @@ void dcc_recv_callback (irc_session_t * session, irc_dcc_t id, int status, void } else { if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("DCC %d: %s\n", id, data); + + static int count = 1; + char buf[12]=""; sprintf (buf, "DCC [%d]: %d", id, count++); irc_dcc_msg (session, id, buf); } diff --git a/source/shared_lib/sources/platform/sdl/thread.cpp b/source/shared_lib/sources/platform/sdl/thread.cpp index 617f6813..734bcbb4 100644 --- a/source/shared_lib/sources/platform/sdl/thread.cpp +++ b/source/shared_lib/sources/platform/sdl/thread.cpp @@ -272,7 +272,7 @@ void Thread::queueAutoCleanThread() { if(Thread::getEnableVerboseMode()) printf("In Thread::shutdownThreads Line: %d\n",__LINE__); BaseThread *base_thread = dynamic_cast(this); - ThreadGarbageCollector *garbage_collector = dynamic_cast(this); + //ThreadGarbageCollector *garbage_collector = dynamic_cast(this); if(Thread::getEnableVerboseMode()) printf("In Thread::shutdownThreads Line: %d thread = %p base_thread = %p [%s]\n",__LINE__,this,base_thread,(base_thread != NULL ? base_thread->getUniqueID().c_str() : "n/a")); MutexSafeWrapper safeMutex(cleanupThreadMutex.get()); diff --git a/source/shared_lib/sources/util/properties.cpp b/source/shared_lib/sources/util/properties.cpp index 04651fa4..ac170a53 100644 --- a/source/shared_lib/sources/util/properties.cpp +++ b/source/shared_lib/sources/util/properties.cpp @@ -179,7 +179,6 @@ void Properties::load(const string &path, bool clearCurrentProperties) { string getUserHomeFromGLIBC() { string home_folder = ""; - char dateiname[512]; const char *homedir = getenv("HOME"); if (!homedir) { #if _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED diff --git a/source/shared_lib/sources/util/util.cpp b/source/shared_lib/sources/util/util.cpp index fca0c457..e03ec729 100644 --- a/source/shared_lib/sources/util/util.cpp +++ b/source/shared_lib/sources/util/util.cpp @@ -833,31 +833,17 @@ bool checkVersionComptability(string clientVersionString, string serverVersionSt if(SystemFlags::VERBOSE_MODE_ENABLED) { // debug version strings for(unsigned int i = 0; i < tokensServer.size(); ++i) { - printf("Server version index = %d str [%s] IsNumeric = %d\n",i,tokensServer[i].c_str(),IsNumeric(tokensServer[i].c_str(),false)); + printf("Server version index = %u str [%s] IsNumeric = %d\n",i,tokensServer[i].c_str(),IsNumeric(tokensServer[i].c_str(),false)); } for(unsigned int i = 0; i < tokens.size(); ++i) { - printf("Client version index = %d str [%s] IsNumeric = %d\n",i,tokens[i].c_str(),IsNumeric(tokens[i].c_str(),false)); + printf("Client version index = %u str [%s] IsNumeric = %d\n",i,tokens[i].c_str(),IsNumeric(tokens[i].c_str(),false)); } } // **NOTE: // after of 3.7.0 we go to 2 digi version compatibility, check if both // client and server are at least 3.7 - bool compatiblePost3_7_0_Check = false; bool compatiblePre3_7_0_1_Check = true; -// if(tokens.size() >= 3 && tokensServer.size() >= 3 && -// tokensServer[0] != "" && IsNumeric(tokensServer[0].c_str(),false) && strToInt(tokensServer[0]) == 3 && -// tokensServer[1] != "" && IsNumeric(tokensServer[1].c_str(),false) && strToInt(tokensServer[1]) == 7 && -// (tokensServer[2][0] == '0' || tokensServer[2][0] == '1') && -// tokens[0] != "" && IsNumeric(tokens[0].c_str(),false) && strToInt(tokens[0]) == 3 && -// tokens[1] != "" && IsNumeric(tokens[1].c_str(),false) && strToInt(tokens[1]) == 7 && -// (tokens[2][0] == '0' || tokens[2][0] == '1')) { -// -// compatiblePost3_7_0_Check = false; -// compatiblePre3_7_0_1_Check = false; -// compatible = true; -// } -// else if(tokens.size() >= 2 && tokensServer.size() >= 2) { if(tokens.size() >= 2 && tokensServer.size() >= 2) { if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); @@ -869,6 +855,7 @@ bool checkVersionComptability(string clientVersionString, string serverVersionSt if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); + bool compatiblePost3_7_0_Check = false; // Both are at least 3.7.0, now check if both are > 3.7.0 if(tokens.size() >= 3 && tokensServer.size() >= 3) { if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);