From e0a14d79acbc5067bd1d4413de269f5e4f266604 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 18 Nov 2019 09:33:23 +0800 Subject: [PATCH] Disable more of the pet name code --- code/ryzom/server/src/ai_service/ai_mgr_pet.cpp | 2 ++ .../entities_game_service/player_manager/character.cpp | 10 ++++++++++ .../entities_game_service/player_manager/character.h | 2 ++ .../player_manager/persistent_player_data.cpp | 2 +- code/ryzom/server/src/server_share/pet_interface_msg.h | 4 ++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/code/ryzom/server/src/ai_service/ai_mgr_pet.cpp b/code/ryzom/server/src/ai_service/ai_mgr_pet.cpp index 0fe7019a3..530fc140a 100644 --- a/code/ryzom/server/src/ai_service/ai_mgr_pet.cpp +++ b/code/ryzom/server/src/ai_service/ai_mgr_pet.cpp @@ -291,10 +291,12 @@ void CPetSpawnMsgImp::callback(std::string const& name, NLNET::TServiceId id) botPet->setSheet(sheet); +#ifdef RYZOM_FORGE_PET_NAME if (!CustomName.empty()) { botPet->setCustomName(CustomName); } +#endif if (!botPet->spawn()) { diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index 552925498..d5e836aa4 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -2904,7 +2904,9 @@ void CCharacter::postLoadTreatment() _PlayerPets[ i ].Slot = INVENTORIES::INVALID_INVENTORY_SLOT; } +#ifdef RYZOM_FORGE_PET_NAME sendPetCustomNameToClient(i); +#endif uint32 slot = _PlayerPets[ i ].initLinkAnimalToTicket( this, i ); if( slot < INVENTORIES::NbPackerSlots ) { @@ -5584,7 +5586,9 @@ bool CCharacter::spawnWaitingCharacterAnimalNear( uint index, const SGameCoordin msg.CharacterMirrorRow = _EntityRowId; msg.PetSheetId = _PlayerPets[ index ].PetSheetId; msg.PetIdx = index; +#ifdef RYZOM_FORGE_PET_NAME msg.CustomName = _PlayerPets[ index ].CustomName; +#endif msg.AIInstanceId = (uint16)destAIInstance; CWorldInstances::instance().msgToAIInstance( msg.AIInstanceId, msg); // The row will be received in AnimalSpawned() @@ -5696,7 +5700,9 @@ bool CCharacter::spawnCharacterAnimal(uint index ) msg.CharacterMirrorRow = _EntityRowId; msg.PetSheetId = _PlayerPets[ index ].PetSheetId; msg.PetIdx = index; +#ifdef RYZOM_FORGE_PET_NAME msg.CustomName = _PlayerPets[ index ].CustomName; +#endif CVector pos; pos.x = msg.Coordinate_X * 0.001f; @@ -18716,7 +18722,9 @@ uint32 CPetAnimal::initLinkAnimalToTicket( CCharacter * c, uint8 index ) { // Slot = ItemPtr->getLocSlot(); ItemPtr->setPetIndex(index); +#ifdef RYZOM_FORGE_PET_NAME ItemPtr->setCustomName(CustomName); +#endif Slot = ItemPtr->getInventorySlot(); return Slot; } @@ -18730,7 +18738,9 @@ uint32 CPetAnimal::initLinkAnimalToTicket( CCharacter * c, uint8 index ) // Slot = ItemPtr->getLocSlot(); Slot = ItemPtr->getInventorySlot(); ItemPtr->setPetIndex(index); +#ifdef RYZOM_FORGE_PET_NAME ItemPtr->setCustomName(CustomName); +#endif return Slot; } else 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 51976339b..ec12f94d4 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 @@ -314,7 +314,9 @@ struct CPetAnimal // get the max bulk of the animal inventory uint32 getAnimalMaxBulk(); +#ifdef RYZOM_FORGE_PET_NAME void setCustomName(const ucstring& customName) { CustomName = customName; } +#endif }; /** diff --git a/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp b/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp index 576819fcc..9ff135745 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp @@ -700,7 +700,7 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons LPROP(bool,IsMounted,if(IsMounted))\ PROP(bool,IsTpAllowed)\ PROP(TSatiety,Satiety)\ - PROP2(CustomName, ucstring, CustomName, CustomName = val)\ + /*PROP2(CustomName, ucstring, CustomName, CustomName = val)*/\ //#pragma message( PERSISTENT_GENERATION_MESSAGE ) #include "game_share/persistent_data_template.h" diff --git a/code/ryzom/server/src/server_share/pet_interface_msg.h b/code/ryzom/server/src/server_share/pet_interface_msg.h index f404a76ef..4162dbae7 100644 --- a/code/ryzom/server/src/server_share/pet_interface_msg.h +++ b/code/ryzom/server/src/server_share/pet_interface_msg.h @@ -43,7 +43,9 @@ public: uint16 PetIdx; // must be returned to EGS with CPetSpawnConfirmationMsg class sint32 Coordinate_X, Coordinate_Y, Coordinate_H; //For NEAR_POINT mode float Heading; //For NEAR_POINT mode +#ifdef RYZOM_FORGE_PET_NAME ucstring CustomName; +#endif virtual void description () { @@ -57,7 +59,9 @@ public: property ("Coordinate_Y", PropSInt32, (sint32)0, Coordinate_Y); property ("Coordinate_H", PropSInt32, (sint32)0, Coordinate_H); property ("Heading", PropFloat, 0.0f, Heading); +#ifdef RYZOM_FORGE_PET_NAME property ("CustomName", PropUCString, ucstring(""), CustomName); +#endif } virtual void callback (const std::string &/* name */, NLNET::TServiceId /* id */) {}