From b4638c79699b6ce84fdeff9e9f413b8c6a56a905 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 24 Jun 2021 12:19:47 +0800 Subject: [PATCH] Include fixes from atys branch --- .../server/src/ai_service/ai_script_data_manager.cpp | 11 +++++++---- ryzom/server/src/ai_service/family_profile_tribe.cpp | 4 ++-- ryzom/server/src/ai_service/script_vm.cpp | 2 +- .../src/entity_view_service/entity_view_service.h | 2 +- ryzom/server/src/logger_service/log_query.cpp | 4 ++-- ryzom/server/src/logger_service/log_query.h | 5 +++-- .../src/server_share/npc_description_messages.cpp | 2 +- ryzom/server/src/server_share/stat_db_common.h | 2 +- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/ryzom/server/src/ai_service/ai_script_data_manager.cpp b/ryzom/server/src/ai_service/ai_script_data_manager.cpp index 7a94283c0..4c78bda9d 100644 --- a/ryzom/server/src/ai_service/ai_script_data_manager.cpp +++ b/ryzom/server/src/ai_service/ai_script_data_manager.cpp @@ -128,12 +128,15 @@ string CAIScriptDataManager::makePdrFileName() { string aisName; // get the AIS local path - CConfigFile::CVar *var = IService::getInstance()->ConfigFile.getVarPtr("AESAliasName"); - if (var) - aisName = var->asString(0); - else + //CConfigFile::CVar *var = IService::getInstance()->ConfigFile.getVarPtr("AESAliasName"); + // aisName must be get from getServiceAliasName to manage "-N AIS_NAME" command line arg + + aisName = IService::getInstance()->getServiceAliasName(); + + if (aisName.empty()) aisName = "unamed_ais"; + return string("ai_script_data/")+aisName+"_pdr.bin"; } diff --git a/ryzom/server/src/ai_service/family_profile_tribe.cpp b/ryzom/server/src/ai_service/family_profile_tribe.cpp index adf33b3c2..2238e4bb6 100644 --- a/ryzom/server/src/ai_service/family_profile_tribe.cpp +++ b/ryzom/server/src/ai_service/family_profile_tribe.cpp @@ -592,8 +592,8 @@ void CGrpProfileDynHarvest::checkTargetsAround () if (!_Grp->calcCenterPos(centerPos)) // true if there's some bots in the group. break; - const uint32 playerRadius= uint(30); // _AggroRange); - const uint32 botRadius=uint(0); // _AggroRange); + const uint32 playerRadius=30; // _AggroRange); + const uint32 botRadius=0; // _AggroRange); const uint32 minRadius=playerRadius>botRadius?botRadius:playerRadius; diff --git a/ryzom/server/src/ai_service/script_vm.cpp b/ryzom/server/src/ai_service/script_vm.cpp index 69c9ef908..748c88ded 100644 --- a/ryzom/server/src/ai_service/script_vm.cpp +++ b/ryzom/server/src/ai_service/script_vm.cpp @@ -870,7 +870,7 @@ void CScriptVM::interpretCode( { otherContext = callerContext; } - else + else if (thisContext != NULL) { otherContext = thisContext->findContext(strId); } diff --git a/ryzom/server/src/entity_view_service/entity_view_service.h b/ryzom/server/src/entity_view_service/entity_view_service.h index 5656d86eb..2b7e47ca1 100644 --- a/ryzom/server/src/entity_view_service/entity_view_service.h +++ b/ryzom/server/src/entity_view_service/entity_view_service.h @@ -179,7 +179,7 @@ public: { nlinfo("Create entity %s", id.toString().c_str()); - std::pair res = _Entities.insert(std::make_pair(id, CEntity())); + std::pair res = _Entities.insert(std::make_pair(id, CEntity())); TEntityMap::iterator ite = res.first; nlassert(ite != _Entities.end() && res.second); diff --git a/ryzom/server/src/logger_service/log_query.cpp b/ryzom/server/src/logger_service/log_query.cpp index 069409313..313a98caa 100644 --- a/ryzom/server/src/logger_service/log_query.cpp +++ b/ryzom/server/src/logger_service/log_query.cpp @@ -145,7 +145,7 @@ CQueryParser::TParserResult CQueryParser::parseQuery(const std::string &queryStr return pr; } - std::shared_ptr rootNode(parseExpr(first, queryStr.end())); + CUniquePtr rootNode(parseExpr(first, queryStr.end())); // make sure we have consumed all the stream iterator rew = first; @@ -153,7 +153,7 @@ CQueryParser::TParserResult CQueryParser::parseQuery(const std::string &queryStr if (tok.TokenType != tt_EOF) throw EInvalidQuery(tok.It, "Not all the query content have been read"); - pr.QueryTree = rootNode; + pr.QueryTree = CUniquePtrMove(rootNode); return pr; } diff --git a/ryzom/server/src/logger_service/log_query.h b/ryzom/server/src/logger_service/log_query.h index 89675d0e9..8999b67d6 100644 --- a/ryzom/server/src/logger_service/log_query.h +++ b/ryzom/server/src/logger_service/log_query.h @@ -1191,7 +1191,8 @@ public: struct TParserResult { /// The query tree - mutable std::shared_ptr QueryTree; + //mutable std::shared_ptr QueryTree; + mutable CUniquePtr QueryTree; /// Option to extract full context with selected logs bool FullContext; @@ -1205,7 +1206,7 @@ public: } TParserResult(const TParserResult &other) - : QueryTree(other.QueryTree), + : QueryTree(CUniquePtrMove(other.QueryTree)), FullContext(other.FullContext), OutputPrefix(other.OutputPrefix) diff --git a/ryzom/server/src/server_share/npc_description_messages.cpp b/ryzom/server/src/server_share/npc_description_messages.cpp index 2373721ee..6db67ef82 100644 --- a/ryzom/server/src/server_share/npc_description_messages.cpp +++ b/ryzom/server/src/server_share/npc_description_messages.cpp @@ -21,7 +21,7 @@ #include "nel/misc/command.h" #include "nel/misc/path.h" #include "npc_description_messages.h" -#include "../../server/src/ai_share/ai_share.h" +#include "../ai_share/ai_share.h" using namespace NLMISC; using namespace std; diff --git a/ryzom/server/src/server_share/stat_db_common.h b/ryzom/server/src/server_share/stat_db_common.h index 0aee064d0..38f3eb5a9 100644 --- a/ryzom/server/src/server_share/stat_db_common.h +++ b/ryzom/server/src/server_share/stat_db_common.h @@ -20,7 +20,7 @@ #define RY_STAT_DB_COMMON_H -#include "../../server/src/entities_game_service/common_pd.h" +#include "../entities_game_service/common_pd.h" #endif // RY_STAT_DB_COMMON_H