From 189fc7a2d9cfa38937b7ddc573f6a495e56e9cb9 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 15 Dec 2015 13:39:02 +0100 Subject: [PATCH] Changed: Minor changes --HG-- branch : develop --- .../common/src/game_share/persistent_data.cpp | 14 +++--- .../common/src/game_share/persistent_data.h | 2 +- .../server/src/backup_service/commands.cpp | 2 +- .../src/entities_game_service/admin.cpp | 6 +-- .../game_event_manager.cpp | 2 +- .../mission_manager/mission_queue_manager.cpp | 2 +- .../outpost_manager/outpost_manager.cpp | 2 +- .../shop_type/named_items.cpp | 2 +- .../merge_commands.cpp | 4 +- .../stat_char_commands.cpp | 2 +- .../pd_support_service/stat_char_commands.cpp | 2 +- .../stat_character_scan_job.cpp | 2 +- .../src/server_share/handy_commands.cpp | 13 ++--- .../tools/patch_gen/patch_gen_common.cpp | 48 +++++++++---------- code/ryzom/tools/pdr_util/pdr_util.cpp | 2 +- code/ryzom/tools/stats_scan/char_commands.cpp | 4 +- .../tools/stats_scan/character_scan_job.cpp | 2 +- 17 files changed, 56 insertions(+), 55 deletions(-) diff --git a/code/ryzom/common/src/game_share/persistent_data.cpp b/code/ryzom/common/src/game_share/persistent_data.cpp index b11fcf0b9..85c873ba4 100644 --- a/code/ryzom/common/src/game_share/persistent_data.cpp +++ b/code/ryzom/common/src/game_share/persistent_data.cpp @@ -825,14 +825,14 @@ bool CPersistentDataRecord::writeToFile(const std::string &fileName, TFileFormat goto binary_file; } } - BOMB("Bad file type supplied to writeToFile() - file not saved: "<8 && *(uint32*)&buffer[4]==length); @@ -1143,7 +1143,7 @@ bool CPersistentDataRecord::readFromFile(const std::string &fileName) } // it's not a valid binary file so see whether it looks like a valid text file - DROP_IF(!buffer.isValidText(),"File is binary but 'file size' header entry doesn't match true file size",return false); + DROP_IF(!buffer.isValidText(),"File is binary but 'file size' header entry doesn't match true file size", return false); // parse the data as text... return fromString(buffer); @@ -1153,13 +1153,13 @@ bool CPersistentDataRecord::readFromFile(const std::string &fileName) // open the file CIFile f; bool open = f.open(fileName); - DROP_IF( !open, "Failed to open input file "<getGuildId(); NLMISC::CEntityId id= c->getId(); - static CPersistentDataRecord pdr; + static CPersistentDataRecord pdr; pdr.clear(); pdr.readFromTxtFile(fileName+".xml"); c->apply(pdr); @@ -2249,7 +2249,7 @@ NLMISC_CATEGORISED_COMMAND(pdr,saveToPDR,"save a character to a binary PDR file" if (args.size () < 2) return false; GET_CHARACTER - std::string fileName = args[1]; + std::string fileName = args[1]; if( c ) { @@ -2280,7 +2280,7 @@ NLMISC_CATEGORISED_COMMAND(pdr,loadFromPDR,"load a character from a binary PDR f uint32 guildId= c->getGuildId(); NLMISC::CEntityId id= c->getId(); - static CPersistentDataRecord pdr; + static CPersistentDataRecord pdr; pdr.clear(); pdr.readFromBinFile(fileName+".pdr"); c->apply(pdr); diff --git a/code/ryzom/server/src/entities_game_service/game_event_manager.cpp b/code/ryzom/server/src/entities_game_service/game_event_manager.cpp index d96f122b9..21117ef3e 100644 --- a/code/ryzom/server/src/entities_game_service/game_event_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/game_event_manager.cpp @@ -64,7 +64,7 @@ void CGameEventManager::init() if (CFile::fileExists(sFilename)) { - static CPersistentDataRecord pdr; + static CPersistentDataRecord pdr; pdr.clear(); pdr.readFromTxtFile(sFilename); apply(pdr); diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp index 76ddcc3ae..c88b11f66 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp @@ -53,7 +53,7 @@ void CMissionQueueManager::init() if (CFile::fileExists(sFilename)) { - static CPersistentDataRecord pdr; + static CPersistentDataRecord pdr; pdr.clear(); pdr.readFromTxtFile(sFilename); apply(pdr); diff --git a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp index 681a9d7dd..681a32943 100644 --- a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp @@ -428,7 +428,7 @@ void COutpostManager::loadOutpostSaveFiles() // else // { // // load dynamic data -// static CPersistentDataRecord pdr; +// static CPersistentDataRecord pdr; // pdr.clear(); // pdr.readFromBinFile(files[i]); // outpost->apply( pdr ); diff --git a/code/ryzom/server/src/entities_game_service/shop_type/named_items.cpp b/code/ryzom/server/src/entities_game_service/shop_type/named_items.cpp index 9c5425c94..ba29e78ad 100644 --- a/code/ryzom/server/src/entities_game_service/shop_type/named_items.cpp +++ b/code/ryzom/server/src/entities_game_service/shop_type/named_items.cpp @@ -66,7 +66,7 @@ void CNamedItems::loadNamedItemsFromFile(const std::string & fileName) return; } - static CPersistentDataRecord pdr; + static CPersistentDataRecord pdr; pdr.clear(); pdr.readFromTxtFile(path); CInventoryPtr inv = loadFromPdr(pdr); diff --git a/code/ryzom/server/src/general_utilities_service/merge_commands.cpp b/code/ryzom/server/src/general_utilities_service/merge_commands.cpp index c24a210c3..ef661eb75 100644 --- a/code/ryzom/server/src/general_utilities_service/merge_commands.cpp +++ b/code/ryzom/server/src/general_utilities_service/merge_commands.cpp @@ -60,7 +60,7 @@ NLMISC_CATEGORISED_COMMAND(ShardMerge,mergeGuildIdFix,"set the guild ids in the nlinfo("Setting id for guild: %s to: %d",fdc[i].FileName.c_str(),id); // read the file - static CPersistentDataRecord pdr; + static CPersistentDataRecord pdr; pdr.clear(); pdr.readFromFile(fdc[i].FileName.c_str()); @@ -107,7 +107,7 @@ NLMISC_CATEGORISED_COMMAND(ShardMerge,mergeChangeCharacterNames,"change names of // read the file NLMISC::CSString fileName= args[0]+NLMISC::toString("/characters/account_%d_%d_pdr.bin",account,slot); DROP_IF(!NLMISC::CFile::fileExists(fileName),"Skipping inexistant file: "+fileName,continue); - static CPersistentDataRecord pdr; + static CPersistentDataRecord pdr; pdr.clear(); pdr.readFromFile(fileName.c_str()); diff --git a/code/ryzom/server/src/general_utilities_service/stat_char_commands.cpp b/code/ryzom/server/src/general_utilities_service/stat_char_commands.cpp index 3a4c98232..03908bff2 100644 --- a/code/ryzom/server/src/general_utilities_service/stat_char_commands.cpp +++ b/code/ryzom/server/src/general_utilities_service/stat_char_commands.cpp @@ -139,7 +139,7 @@ NLMISC_CATEGORISED_COMMAND(Stats,listCharNames,"display the names of the charact std::sort(files.begin(),files.end()); for (uint32 i=0;i %s",fd.FileName.c_str(),outputFileName.c_str()); - static CPersistentDataRecord pdr; + static CPersistentDataRecord pdr; pdr.clear(); pdr.readFromFile(fd.FileName); pdr.writeToFile(outputFileName); @@ -168,7 +168,7 @@ NLMISC_CATEGORISED_COMMAND(utils,pdr2bin,"convert one or more sets of pdr files fd.FileName.rightCrop(4)+".bin": fd.FileName+".bin"; log.displayNL("Converting to Binary : %s => %s",fd.FileName.c_str(),outputFileName.c_str()); - static CPersistentDataRecord pdr; + static CPersistentDataRecord pdr; pdr.clear(); pdr.readFromFile(fd.FileName); pdr.writeToFile(outputFileName); @@ -200,7 +200,7 @@ NLMISC_CATEGORISED_COMMAND(utils,pdr2txt,"convert one or more sets of pdr files fd.FileName.rightCrop(4)+".txt": fd.FileName+".txt"; log.displayNL("Converting to TXT : %s => %s",fd.FileName.c_str(),outputFileName.c_str()); - static CPersistentDataRecord pdr; + static CPersistentDataRecord pdr; pdr.clear(); pdr.readFromFile(fd.FileName); pdr.writeToFile(outputFileName); @@ -264,17 +264,18 @@ NLMISC_CATEGORISED_COMMAND(utils,pdrInfo,"Extract info from pdr file(s)","