diff --git a/code/ryzom/server/src/admin_modules/as_module.cpp b/code/ryzom/server/src/admin_modules/as_module.cpp index 30dad668d..24cba13f0 100644 --- a/code/ryzom/server/src/admin_modules/as_module.cpp +++ b/code/ryzom/server/src/admin_modules/as_module.cpp @@ -785,9 +785,9 @@ retry_pending_command: if (buffer.FrameStart == buffer.FrameEnd) { // the buffer is empty - ret.push_back(0); - ret.push_back(0); - ret.push_back(0); + ret.push_back(std::string()); + ret.push_back(std::string()); + ret.push_back(std::string()); } else { diff --git a/code/ryzom/server/src/ai_service/ai_bot_npc.cpp b/code/ryzom/server/src/ai_service/ai_bot_npc.cpp index 77870adb7..3072a9f1d 100644 --- a/code/ryzom/server/src/ai_service/ai_bot_npc.cpp +++ b/code/ryzom/server/src/ai_service/ai_bot_npc.cpp @@ -243,7 +243,7 @@ void CSpawnBotNpc::updateChat(CAIState const* state) // update chat information if any CNpcChatProfileImp const* const chatProfile = botNpc.getChat(); - if (!chatProfile) + if (chatProfile) { _CurrentChatProfile = CNpcChatProfileImp::combineChatProfile(*chatProfile, itChat->getChat()); // the chat profile has been combined, send it to EGS diff --git a/code/ryzom/server/src/ai_service/ai_instance.cpp b/code/ryzom/server/src/ai_service/ai_instance.cpp index a4da91956..fb0c08375 100644 --- a/code/ryzom/server/src/ai_service/ai_instance.cpp +++ b/code/ryzom/server/src/ai_service/ai_instance.cpp @@ -636,7 +636,7 @@ static CAIVector randomPos(double dispersionRadius) { return CAIVector(0., 0.); } - const uint32 maxLimit = std::numeric_limits::max() >> 1; + static const uint32 maxLimit = std::numeric_limits::max() >> 1; double rval = (double)CAIS::rand32(maxLimit)/(double)maxLimit; // [0-1[ double r = dispersionRadius*sqrt(rval); rval = (double)CAIS::rand32(maxLimit)/(double)maxLimit; // [0-1[ diff --git a/code/ryzom/server/src/ai_service/ai_outpost.cpp b/code/ryzom/server/src/ai_service/ai_outpost.cpp index 385b7a849..43994c245 100644 --- a/code/ryzom/server/src/ai_service/ai_outpost.cpp +++ b/code/ryzom/server/src/ai_service/ai_outpost.cpp @@ -1153,7 +1153,7 @@ NLMISC_COMMAND(displayOutposts, "list the available outpost", "") if (args.size() > 0) return false; - uint32 instanceNumber = std::numeric_limits::max(); + static const uint32 instanceNumber = std::numeric_limits::max(); for (uint i=0; i::max())>>1; + static const uint32 maxLimit = std::numeric_limits::max() >> 1; double rval = (double)CAIS::rand32(maxLimit)/(double)maxLimit; // [0-1[ double r = dispersionRadius*sqrt(rval); rval = (double)CAIS::rand32(maxLimit)/(double)maxLimit; // [0-1[ diff --git a/code/ryzom/server/src/ai_service/generic_logic_action.cpp b/code/ryzom/server/src/ai_service/generic_logic_action.cpp index 7869ffa56..30edfb460 100644 --- a/code/ryzom/server/src/ai_service/generic_logic_action.cpp +++ b/code/ryzom/server/src/ai_service/generic_logic_action.cpp @@ -2067,7 +2067,7 @@ public: CGrpFauna *grpFauna = safe_cast(group); CGrpFauna::TPlaces place; - _Activity == fa_rest ? place = CGrpFauna::REST_PLACE : CGrpFauna::EAT_PLACE; + place = (_Activity == fa_rest ? CGrpFauna::REST_PLACE : CGrpFauna::EAT_PLACE); // change the state of the fauna group if needed // lookup for the cycle we want uint32 i; diff --git a/code/ryzom/server/src/ai_service/knapsack_solver.cpp b/code/ryzom/server/src/ai_service/knapsack_solver.cpp index a22477e9c..3db80f392 100644 --- a/code/ryzom/server/src/ai_service/knapsack_solver.cpp +++ b/code/ryzom/server/src/ai_service/knapsack_solver.cpp @@ -397,8 +397,9 @@ CKnapsackSolver::CKnapsackSolver(IKnapsackContext* context, bool* _take) { if (_take==NULL && size()!=0) { - _Take = new bool[size()]; - for (size_t i=0; igetNextChangedValue( entityIndex, propIndex ); while (entityIndex != LAST_CHANGED) { - if (propIndex == DSPropertyPOSX || propIndex == DSPropertyPOSX ) + if (propIndex == DSPropertyPOSX || propIndex == DSPropertyPOSY ) { const CEntityId &entityId=DataSet->getEntityId(entityIndex); if (entityId.getType() == RYZOMID::player) diff --git a/code/ryzom/server/src/ai_share/world_map.cpp b/code/ryzom/server/src/ai_share/world_map.cpp index 677e8cb97..ad9465441 100644 --- a/code/ryzom/server/src/ai_share/world_map.cpp +++ b/code/ryzom/server/src/ai_share/world_map.cpp @@ -265,6 +265,7 @@ void CDirectionMap::serial(NLMISC::IStream& f) { if (f.isReading()) Layers[i] = new CDirectionLayer(); + nlassert(Layers[i]); f.serial(*Layers[i]); } } @@ -430,6 +431,7 @@ void CMultiLayerCell::serial(NLMISC::IStream& f) } else { + nlassert(_Layers[slot]); I16x16Layer::save(f, _Layers[slot]->_HeightMap); } @@ -657,6 +659,7 @@ void CWorldMap::serial(NLMISC::IStream &f) if (present) { //nldebug("Save SuperCell %d/%d", i, j); + nlassert(_GridFastAccess[i]); f.serial(*(_GridFastAccess[i])); } diff --git a/code/ryzom/server/src/ai_share/world_map.h b/code/ryzom/server/src/ai_share/world_map.h index f9e46ecfc..fd650458a 100644 --- a/code/ryzom/server/src/ai_share/world_map.h +++ b/code/ryzom/server/src/ai_share/world_map.h @@ -1673,6 +1673,7 @@ void CTopology::serial(NLMISC::IStream& f) if (f.isReading()) DirectionMap = new CDirectionMap(); + nlassert(DirectionMap); f.serial(*DirectionMap); } diff --git a/code/ryzom/server/src/entities_game_service/building_manager/destination.cpp b/code/ryzom/server/src/entities_game_service/building_manager/destination.cpp index 51f159489..ac1f92a4b 100644 --- a/code/ryzom/server/src/entities_game_service/building_manager/destination.cpp +++ b/code/ryzom/server/src/entities_game_service/building_manager/destination.cpp @@ -430,6 +430,7 @@ bool CExitDestination::isUserAllowed(CCharacter * user, uint16 ownerIdx) if (user && user->isDead()) return false; + nlassert(user); CMirrorPropValueRO mirrorCell( TheDataset, user->getEntityRowId(), DSPropertyCELL ); sint32 cell = mirrorCell; const IRoomInstance * room = CBuildingManager::getInstance()->getRoomInstanceFromCell( cell ); diff --git a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp index 1b7f0c901..ad12a39be 100644 --- a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp +++ b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp @@ -986,6 +986,10 @@ void CPlayerService::egsAddMonkeyPlayer() } idx++; } + else + { + return; + } } if( PlayerManager.getPlayer( userId ) != 0 ) diff --git a/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.h b/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.h index 89d3271ae..767a69075 100644 --- a/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.h +++ b/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.h @@ -140,7 +140,7 @@ public: _ExceptionString = std::string(" : Invalid stat name ") + var; return _ExceptionString.c_str(); } - virtual ~EInvalidStat() throw() {} + virtual ~EInvalidStat() NL_OVERRIDE {} private: mutable std::string _ExceptionString; }; diff --git a/code/ryzom/server/src/entities_game_service/forage_progress.cpp b/code/ryzom/server/src/entities_game_service/forage_progress.cpp index a3e3a739d..6fdff5d23 100644 --- a/code/ryzom/server/src/entities_game_service/forage_progress.cpp +++ b/code/ryzom/server/src/entities_game_service/forage_progress.cpp @@ -81,10 +81,8 @@ void CForageProgress::reportXP( CCharacter *extractor, const CHarvestSource *sou { H_AUTO(CForageProgress_reportXP); -#if !FINAL_VERSION nlassert(extractor); nlassert(source); -#endif // Don't earn any XP for anyone if the quantity is 0 if ( amount() == 0 ) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp index d967e6971..d38672173 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp @@ -599,6 +599,7 @@ class CMissionActionRecvItem : public IMissionAction instance->getEntities(entities); if ( entities.empty() ) return; + nlassert(instance); if ( dynamic_cast(instance) ) { if ( _Group ) @@ -957,6 +958,7 @@ class CMissionActionRecvNamedItem : public IMissionAction instance->getEntities(entities); if ( entities.empty() ) return; + nlassert(instance); if ( dynamic_cast(instance) ) { if ( _Group ) @@ -1624,6 +1626,7 @@ class CMissionActionLearnBrick : public IMissionAction instance->getEntities(entities); if ( entities.empty() ) return; + nlassert(instance); if ( dynamic_cast(instance) ) { if ( _Group ) @@ -1768,6 +1771,7 @@ class CMissionActionUnlearnBrick : public IMissionAction instance->getEntities(entities); if ( entities.empty() ) return; + nlassert(instance); if ( dynamic_cast(instance) ) { if ( _Group ) @@ -4356,7 +4360,7 @@ class CMissionActionSetRespawnPoints : public IMissionAction CMissionParser::tokenizeString(script[2], ";", args); // check that the given respawn points exist and are all in the same continent - CONTINENT::TContinent lastContinent; + CONTINENT::TContinent lastContinent = CONTINENT::UNKNOWN; for (uint i = 0; i < args.size(); i++) { string respawnPointName = CMissionParser::getNoBlankString(args[i]); diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_base_behaviour.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_base_behaviour.cpp index 61cc84998..d0635ad0f 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_base_behaviour.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_base_behaviour.cpp @@ -650,6 +650,7 @@ CMissionEvent::TResult CMissionBaseBehaviour::processEvent( const TDataSetRow & { MISDBG("%s ok, step %u done -> mission completed", sDebugPrefix.c_str(), currentStep->getIndexInTemplate() ); templ->AlreadyDone = true; + nlassert(user); if(!user->isShopingListInProgress()) user->endBotChat(); return CMissionEvent::MissionEnds; @@ -660,6 +661,7 @@ CMissionEvent::TResult CMissionBaseBehaviour::processEvent( const TDataSetRow & MISDBG("%s ok, step %u done -> mission failed", sDebugPrefix.c_str(), currentStep->getIndexInTemplate() ); _ProcessingState = Normal; onFailure( true ); + nlassert(user); if(!user->isShopingListInProgress()) user->endBotChat(); return CMissionEvent::MissionFailed; diff --git a/code/ryzom/server/src/entities_game_service/modules/character_control.cpp b/code/ryzom/server/src/entities_game_service/modules/character_control.cpp index 0a41e08b1..68fb6e735 100644 --- a/code/ryzom/server/src/entities_game_service/modules/character_control.cpp +++ b/code/ryzom/server/src/entities_game_service/modules/character_control.cpp @@ -414,28 +414,31 @@ public: } CRingRewardPoints &rrp = ic->getRingRewardPoints(); - SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); - CRingRewardPoints::TGenerateRewardResult result = rrp.generateReward(scenario->getSessionLevel()); - switch(result) + if (scenario) { - case CRingRewardPoints::grr_ok: - params[0].Literal = rewardText; - break; - case CRingRewardPoints::grr_ok_rare: - params[0].Literal = rareRewardText; - break; - case CRingRewardPoints::grr_no_place: - params[0].Literal = inventoryFullText; - break; - case CRingRewardPoints::grr_no_points: - params[0].Literal = notEnoughPointsText; - break; - case CRingRewardPoints::grr_invalid: - default: - params[0].Literal = ""; + SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); + CRingRewardPoints::TGenerateRewardResult result = rrp.generateReward(scenario->getSessionLevel()); + switch (result) + { + case CRingRewardPoints::grr_ok: + params[0].Literal = rewardText; + break; + case CRingRewardPoints::grr_ok_rare: + params[0].Literal = rareRewardText; + break; + case CRingRewardPoints::grr_no_place: + params[0].Literal = inventoryFullText; + break; + case CRingRewardPoints::grr_no_points: + params[0].Literal = notEnoughPointsText; + break; + case CRingRewardPoints::grr_invalid: + default: + params[0].Literal = ucstring(); + } + if (!params[0].Literal.empty()) + PHRASE_UTILITIES::sendDynamicSystemMessage( creatureRowId, "LITERAL", params ); } - if (!params[0].Literal.empty()) - PHRASE_UTILITIES::sendDynamicSystemMessage( creatureRowId, "LITERAL", params ); } /* diff --git a/code/ryzom/server/src/entities_game_service/modules/easter_egg.h b/code/ryzom/server/src/entities_game_service/modules/easter_egg.h index d4020f105..c104ff8de 100644 --- a/code/ryzom/server/src/entities_game_service/modules/easter_egg.h +++ b/code/ryzom/server/src/entities_game_service/modules/easter_egg.h @@ -97,7 +97,7 @@ private: }; uint32 _GetEasterNextId() { return _EasterEggNextId++; } - void _SpawnEasterEgg(uint32 easterEggId, NLMISC::CSheetId sheet, uint32 aiInstanceId, sint32 x, sint32 y, sint32 z, float heading, const std::string&name="", const std::string& look="") const; + void _SpawnEasterEgg(uint32 easterEggId, NLMISC::CSheetId sheet, uint32 aiInstanceId, sint32 x, sint32 y, sint32 z, float heading, const std::string &name = std::string(), const std::string &look = std::string()) const; void _UnspawnEasterEgg(uint32 easterEggId, uint32 aiInstanceId); void _AddEntityEasterAssociation(const NLMISC::CEntityId &entityId, uint32 easterEggId); void _RemoveEntityEasterAssociation(const NLMISC::CEntityId &entityId, uint32 easterEggId); diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp index 924c3b0f9..55781d6bd 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp @@ -1668,7 +1668,7 @@ void CCombatPhrase::execute() if (entity) entity->cancelStaticEffects(); - if (entity->getId().getType() == RYZOMID::player) + if (entity && entity->getId().getType() == RYZOMID::player) { CCharacter* player = dynamic_cast (entity); if (player) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp index cd153c5ad..c2f52a32c 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp @@ -756,8 +756,8 @@ uint CFgProspectionPhrase::generateSources( CCharacter *player ) for ( uint iSource=0; iSource!=nbOfSources; ++iSource ) { TNothingFoundReason reason; - const CStaticDepositRawMaterial *rawMaterial; - CDeposit *deposit, *depositForK; + const CStaticDepositRawMaterial *rawMaterial = NULL; + CDeposit *deposit = NULL, *depositForK; // Make several attempts to find a pos that matches the filters for ( uint iAttempt=0; iAttempt!=(uint)_NbAttempts; ++iAttempt ) @@ -782,7 +782,7 @@ uint CFgProspectionPhrase::generateSources( CCharacter *player ) break; // stop attempts if RM found (rawMaterial) or impossible to find one (!deposit) } - if ( rawMaterial ) + if ( rawMaterial && deposit ) { // Find or open a forage site //nlassert( deposit && depositForK && forageSite ); CRecentForageSite *forageSite = deposit->findOrCreateForageSite( pos ); @@ -1003,6 +1003,7 @@ void CFgProspectionPhrase::startLocateDeposit( CCharacter *player ) else { // Retain the first found matching deposit in which we are, or the nearest matching deposit + nlassert(matchingDeposits.size()); TDepositLoc *retainedLoc = NULL; float minDist = _ForageRange; for ( vector::iterator itd=matchingDeposits.begin(); itd!=matchingEnd; ++itd ) @@ -1024,6 +1025,7 @@ void CFgProspectionPhrase::startLocateDeposit( CCharacter *player ) } // Start the effect + nlassert(retainedLoc); CVector2f locatedPoint( retainedLoc->NearestPos ); TReportAction report; sint32 effectFocusCostByUpdate = _FocusCost / ForageFocusRatioOfLocateDeposit.get(); diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_mod_defense.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_mod_defense.cpp index 5df901722..2efc70a9f 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_mod_defense.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_mod_defense.cpp @@ -74,6 +74,7 @@ void CSpecialPowerModDefense::apply() effectFamily = EFFECT_FAMILIES::PowerModDefenseSkill; break; default: + effectFamily = EFFECT_FAMILIES::Unknown; break; } diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.h b/code/ryzom/server/src/entities_game_service/player_manager/character.h index 9631bb01a..048962238 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.h @@ -1510,7 +1510,7 @@ public: uint8 interfaceCounter() const; /// Register character name in IOS - void registerName(const ucstring &newName = std::string("")); + void registerName(const ucstring &newName = std::string()); /// Mount a mount void mount( TDataSetRow PetRowId ); diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp index 31eacae82..fb673d500 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp @@ -968,6 +968,11 @@ NLMISC_COMMAND(buildSpire, "build a spire"," ") x = 11105.0f; y = -4400.0f; } + else + { + log.displayNL( "buildSpire : Invalid region '%s'", args[1].c_str() ); + return; + } NLMISC::CVector vec( x, y, 0.0f ); @@ -1032,6 +1037,11 @@ NLMISC_COMMAND(destroySpire, "destroy a spire","") x = 11105.0f; y = -4400.0f; } + else + { + log.displayNL( "destroySpire : Invalid region '%s'", args[1].c_str() ); + return; + } NLMISC::CVector vec( x, y, 0.0f ); diff --git a/code/ryzom/server/src/entities_game_service/shop_type/character_shopping_list.cpp b/code/ryzom/server/src/entities_game_service/shop_type/character_shopping_list.cpp index 9ff677e10..6e21460d5 100644 --- a/code/ryzom/server/src/entities_game_service/shop_type/character_shopping_list.cpp +++ b/code/ryzom/server/src/entities_game_service/shop_type/character_shopping_list.cpp @@ -194,8 +194,11 @@ bool CCharacterShoppingList::passThruFilter(TItemTradePtr itemTrade, bool dynnam { const CStaticItem * form = CSheets::getForm( itemTrade->getSheetId() ); + if (!_Character) + return false; + // No filter on Faction trade - if(_Character && _Character->getBotChatType() == BOTCHATTYPE::TradeFactionFlag) + if(_Character->getBotChatType() == BOTCHATTYPE::TradeFactionFlag) return true; if( form != 0 ) diff --git a/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp b/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp index eb831f2cf..4c1338148 100644 --- a/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp @@ -1043,7 +1043,7 @@ void CShopTypeManager::addTpShopBase( uint32 shopCategoryNumber, uint32 ecosyste //---------------------------------------------------------------------------- void CShopTypeManager::addShopBase( uint32 shopCategoryNumber, CMerchant& merchant, std::vector< uint32 >& rmSelector, std::vector< uint32 >& originSelector, std::vector< uint32 >& qualitySelector, std::vector< uint32 >& levelSelector, std::vector< uint32 >& shopTypeSelector ) { - TShopTypeSelected shopTypeSelected; + TShopTypeSelected shopTypeSelected = InvalidShopSelected; if( shopTypeSelector.size() == 0 ) { shopTypeSelected = AllShopSelected; @@ -1052,15 +1052,15 @@ void CShopTypeManager::addShopBase( uint32 shopCategoryNumber, CMerchant& mercha { for( uint32 i = 0; i < shopTypeSelector.size(); ++i ) { - if( _CategoryName[ shopTypeSelector[ i ] ] == string("STATIC_SHOP") ) + if( _CategoryName[ shopTypeSelector[ i ] ] == "STATIC_SHOP" ) { shopTypeSelected = StaticShopSelected; } - else if( _CategoryName[ shopTypeSelector[ i ] ] == string("DYNAMIC_SHOP") ) + else if( _CategoryName[ shopTypeSelector[ i ] ] == "DYNAMIC_SHOP" ) { shopTypeSelected = DynamicShopSelected; } - else if( _CategoryName[ shopTypeSelector[ i ] ] == string("STATIC_DYNAMIC_SHOP") ) + else if( _CategoryName[ shopTypeSelector[ i ] ] == "STATIC_DYNAMIC_SHOP" ) { shopTypeSelected = AllShopSelected; } diff --git a/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.h b/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.h index 2c0864a27..1e5eb0b3c 100644 --- a/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.h +++ b/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.h @@ -51,7 +51,7 @@ class CShopTypeManager : public NLMISC::CEvalNumExpr { public: - enum TShopTypeSelected { StaticShopSelected = 0, DynamicShopSelected, AllShopSelected }; + enum TShopTypeSelected { StaticShopSelected = 0, DynamicShopSelected, AllShopSelected, InvalidShopSelected }; /// init / release class static void initShopBase(); diff --git a/code/ryzom/server/src/general_utilities_service/gus_net_hub.cpp b/code/ryzom/server/src/general_utilities_service/gus_net_hub.cpp index 8457d7888..53550a65e 100644 --- a/code/ryzom/server/src/general_utilities_service/gus_net_hub.cpp +++ b/code/ryzom/server/src/general_utilities_service/gus_net_hub.cpp @@ -242,8 +242,8 @@ namespace GUSNET void CHubModule::registerRemoteModule(TRemoteModuleOnHubPtr module) { // make sure the module isn't already registered - for (TRemoteModules::iterator it=_RemoteModules.begin();it!=_RemoteModules.end();++it) - BOMB_IF((*it).second==module,"Attempt to add the same module to a hub more than once",return) + for (TRemoteModules::iterator it = _RemoteModules.begin(); it != _RemoteModules.end(); ++it) + BOMB_IF((*it).second == module, "Attempt to add the same module to a hub more than once", return); // add the module to the _RemoteModules map _RemoteModules[module->getUniqueId()]=module; diff --git a/code/ryzom/server/src/general_utilities_service/gus_net_implementation.cpp b/code/ryzom/server/src/general_utilities_service/gus_net_implementation.cpp index 49bc6dde9..730c9f04a 100644 --- a/code/ryzom/server/src/general_utilities_service/gus_net_implementation.cpp +++ b/code/ryzom/server/src/general_utilities_service/gus_net_implementation.cpp @@ -63,8 +63,8 @@ namespace GUSNET void CGusNetImplementation::addHubModule(THubModulePtr hub) { // make sure the hub wasn't already registered - for (uint32 i=0;i<_Hubs.size();++i) - BOMB_IF(_Hubs[i]==hub,"Attempt to add the same hub to the CGusNetImplementation singleton more than once",return) + for (uint32 i = 0; i < _Hubs.size(); ++i) + BOMB_IF(_Hubs[i] == hub, "Attempt to add the same hub to the CGusNetImplementation singleton more than once", return); // add the new hub nldebug("GUSNET: Registering new hub: %d",hub->getPort()); @@ -74,8 +74,8 @@ namespace GUSNET void CGusNetImplementation::addConnectionModule(TConnectionModulePtr connection) { // make sure the connection wasn't already registered - for (uint32 i=0;i<_Connections.size();++i) - BOMB_IF(_Connections[i]==connection,"Attempt to add the same connection to the CGusNetImplementation singleton more than once",return) + for (uint32 i = 0; i < _Connections.size(); ++i) + BOMB_IF(_Connections[i] == connection, "Attempt to add the same connection to the CGusNetImplementation singleton more than once", return); // add the new connection nldebug("GUSNET: Registering new connection: %s",connection->getConnectionAddress().c_str()); diff --git a/code/ryzom/server/src/general_utilities_service/remote_saves_interface.cpp b/code/ryzom/server/src/general_utilities_service/remote_saves_interface.cpp index 3bcd3cc74..826a330cb 100644 --- a/code/ryzom/server/src/general_utilities_service/remote_saves_interface.cpp +++ b/code/ryzom/server/src/general_utilities_service/remote_saves_interface.cpp @@ -94,7 +94,7 @@ namespace SAVES { for (uint32 i=_Callbacks.size();i--;) { - BOMB_IF(_Callbacks[i]==cb,"BUG: Attempting to add the same callback to an RS module more than once",return) + BOMB_IF(_Callbacks[i] == cb, "BUG: Attempting to add the same callback to an RS module more than once", return); } _Callbacks.push_back(cb); if (isReady()) diff --git a/code/ryzom/server/src/general_utilities_service/saves_unit.cpp b/code/ryzom/server/src/general_utilities_service/saves_unit.cpp index 28879553e..d22f26317 100644 --- a/code/ryzom/server/src/general_utilities_service/saves_unit.cpp +++ b/code/ryzom/server/src/general_utilities_service/saves_unit.cpp @@ -514,7 +514,7 @@ namespace SAVES // run through the buffer performing a very simple shift and xor checksum (good enough for our purposes) // note that we could have used an MD5 but his is much much much faster (less strain on the CPU) - uint64 checksum; + uint64 checksum = 0; for (uint32 i=fileBody.size()/8;i--;) { checksum= ((checksum<<1)|(checksum>>63))^((uint64*)&fileBody[0])[i]; diff --git a/code/ryzom/server/src/gpm_service/world_position_manager.cpp b/code/ryzom/server/src/gpm_service/world_position_manager.cpp index d5cb1622b..2fe6189b2 100644 --- a/code/ryzom/server/src/gpm_service/world_position_manager.cpp +++ b/code/ryzom/server/src/gpm_service/world_position_manager.cpp @@ -1702,6 +1702,10 @@ void CWorldPositionManager::computeCellVision( CCell *cell, CVisionEntry* entiti } while (offsetPtr <= offsetEnd); } + else + { + nlassume(cell->isIndoor()); + } // then adds entities diff --git a/code/ryzom/server/src/input_output_service/chat_manager.cpp b/code/ryzom/server/src/input_output_service/chat_manager.cpp index f20d4300d..ddaf6b836 100644 --- a/code/ryzom/server/src/input_output_service/chat_manager.cpp +++ b/code/ryzom/server/src/input_output_service/chat_manager.cpp @@ -2154,8 +2154,7 @@ void CChatManager::displayChatClients(NLMISC::CLog &log) } else { - log.displayNL("*no name* %s:%x %s mode '%s'", - ci->EntityId.toString().c_str(), + log.displayNL("*no name* *no id*:%x %s mode '%s'", im->first.getIndex(), im->second->isMuted()?"(muted)":"", CChatGroup::groupTypeToString(im->second->getChatMode()).c_str() ); diff --git a/code/ryzom/server/src/input_output_service/chat_manager.h b/code/ryzom/server/src/input_output_service/chat_manager.h index a64b68d52..d9b539a87 100644 --- a/code/ryzom/server/src/input_output_service/chat_manager.h +++ b/code/ryzom/server/src/input_output_service/chat_manager.h @@ -415,7 +415,7 @@ public: * \param sender is the id of the sender * \param customTxt is a custom text which can be added immediately after the chat message, on the same line */ - void sendChat2Ex( CChatGroup::TGroupType senderChatMode, const TDataSetRow &receiver, uint32 phraseId, const TDataSetRow &sender = TDataSetRow(), ucstring customTxt = ucstring("")); + void sendChat2Ex( CChatGroup::TGroupType senderChatMode, const TDataSetRow &receiver, uint32 phraseId, const TDataSetRow &sender = TDataSetRow(), ucstring customTxt = ucstring()); /** * Send a custom emote chat message diff --git a/code/ryzom/server/src/input_output_service/commands.cpp b/code/ryzom/server/src/input_output_service/commands.cpp index 0432e5afe..f33f3ed21 100644 --- a/code/ryzom/server/src/input_output_service/commands.cpp +++ b/code/ryzom/server/src/input_output_service/commands.cpp @@ -150,6 +150,7 @@ NLMISC_COMMAND(smTest, "Send a test dyn string to a client (look at first phrase else { log.displayNL("Unknown player name '%s'", args[2].c_str()); + return true; } } else if (args[1] == "TEST_ENTITY") @@ -173,6 +174,7 @@ NLMISC_COMMAND(smTest, "Send a test dyn string to a client (look at first phrase else { log.displayNL("Can't make entity ID from '%s'", args[2].c_str()); + return true; } } else if (args[1] == "TEST_SBRICK") diff --git a/code/ryzom/server/src/input_output_service/parameter_traits.cpp b/code/ryzom/server/src/input_output_service/parameter_traits.cpp index 5aad15a57..108f5bf88 100644 --- a/code/ryzom/server/src/input_output_service/parameter_traits.cpp +++ b/code/ryzom/server/src/input_output_service/parameter_traits.cpp @@ -85,8 +85,7 @@ bool CStringManager::CParameterTraits::eval(CStringManager::TLanguages lang,cons } uint32 stringId = ew.getStringId(rowIndex, colIndex); - const std::string &str = SM->getString(stringId).toString(); - NLMISC::strlwr(str); + std::string str = NLMISC::toLower(SM->getString(stringId).toString()); LOG("SM : (paramTraits) eval condition for property %s [%s] %s [%s]", cond.Property.c_str(), str.c_str(), OperatorNames[cond.Operator], cond.ReferenceStr.c_str()); diff --git a/code/ryzom/server/src/monitor_service/mirrors.cpp b/code/ryzom/server/src/monitor_service/mirrors.cpp index a8c4f26d5..ab31236f5 100644 --- a/code/ryzom/server/src/monitor_service/mirrors.cpp +++ b/code/ryzom/server/src/monitor_service/mirrors.cpp @@ -214,7 +214,7 @@ void CMirrors::processMirrorUpdates() //nlassert(entityIndex.getIndex() < client.Entites.size()); bool wasPresent = (entityIndex.getIndex() < client.Entites.size() && (client.Entites[entityIndex.getIndex()].Flags & CMonitorClient::CEntityEntry::Present) != 0); // See if position changed - if (propIndex == DSPropertyPOSX || propIndex == DSPropertyPOSX) + if (propIndex == DSPropertyPOSX || propIndex == DSPropertyPOSY) { if (pos.x > topleft.x && pos.x < bottomright.x && pos.y > topleft.y && pos.y < bottomright.y) { diff --git a/code/ryzom/server/src/pd_lib/db_description_parser.cpp b/code/ryzom/server/src/pd_lib/db_description_parser.cpp index 55eb4a3d6..92a18fd89 100644 --- a/code/ryzom/server/src/pd_lib/db_description_parser.cpp +++ b/code/ryzom/server/src/pd_lib/db_description_parser.cpp @@ -65,7 +65,7 @@ bool CDBDescriptionParser::loadDescriptionFile(const string& filename) bool success = loadDescription(buffer); - delete buffer; + delete[] buffer; return success; } diff --git a/code/ryzom/server/src/pd_lib/db_reference_file.cpp b/code/ryzom/server/src/pd_lib/db_reference_file.cpp index edb8c596e..e08578b5e 100644 --- a/code/ryzom/server/src/pd_lib/db_reference_file.cpp +++ b/code/ryzom/server/src/pd_lib/db_reference_file.cpp @@ -343,12 +343,14 @@ bool CDBReferenceFile::update(uint32 index, const uint8* rowdata) if (!writeBuffer(tempRowBuffer, _Header.FullRowSize)) { nlwarning("CDBReferenceFile::update(): failed, can't increase file '%s' size", filepath.c_str()); - delete tempRowBuffer; + delete[] tempRowBuffer; return false; } ++_Header.EndIndex; } + + delete[] tempRowBuffer; } // seek to row in file diff --git a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp index 7393aec96..c1b2c1485 100644 --- a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp +++ b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp @@ -996,12 +996,12 @@ restartLoop: if (authorCharId != 0) { author = CCharacter::load(_RingDb, authorCharId, __FILE__, __LINE__); - BOMB_IF(author == NULL, "Failed to load the scenario author character "<getOwnerId(), __FILE__, __LINE__); - BOMB_IF(animator == NULL, "Failed to load the scenario animator character "<getOwnerId(), return;) + BOMB_IF(animator == NULL, "Failed to load the scenario animator character " << session->getOwnerId(), return;); // try to load an existing scenario record CScenarioPtr scenario; @@ -1127,12 +1127,12 @@ restartLoop: if (authorCharId != 0) { author = CCharacter::load(_RingDb, authorCharId, __FILE__, __LINE__); - BOMB_IF(author == NULL, "Failed to load the scenario author character "<getOwnerId(), __FILE__, __LINE__); - BOMB_IF(animator == NULL, "Failed to load the scenario animator character "<getOwnerId(), return;) + BOMB_IF(animator == NULL, "Failed to load the scenario animator character " << session->getOwnerId(), return;); // try to load an existing scenario record CScenarioPtr scenario; @@ -3115,7 +3115,7 @@ endOfWelcomeUserResult: for (uint i=0; igetSessionParticipants().size(); ++i) { const CSessionParticipantPtr &part = session->getSessionParticipantsByIndex(i); - BOMB_IF(part == NULL, "RSM:on_unsubsribeSession : error accessing participants at index "<>4, 4, "failed to accesss participants record"); return) + BOMB_IF(part == NULL, "RSM:on_unsubsribeSession : error accessing participants at index " << i << ", part is NULL", invokeResult(from, charId >> 4, 4, "failed to accesss participants record"); return); if (part->getCharId() == charId && part->getStatus() == TSessionPartStatus::sps_play_subscribed)