diff --git a/ryzom/client/src/interface_v3/action_handler_help.cpp b/ryzom/client/src/interface_v3/action_handler_help.cpp index 070aafd55..26926a9d5 100644 --- a/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -2088,8 +2088,10 @@ void getItemText (CDBCtrlSheet *item, string &itemText, const CItemSheet*pIS) break; case ITEMFAMILY::PET_ANIMAL_TICKET: { +#ifdef RYZOM_FORGE string nr = (itemInfo.PetNumber > 0) ? toString(itemInfo.PetNumber) : "(slot)" + toString(item->getIndexInDB()); strFindReplace(itemText, "%petnumber", nr); +#endif } break; default: diff --git a/ryzom/client/src/interface_v3/action_handler_item.cpp b/ryzom/client/src/interface_v3/action_handler_item.cpp index e6218121a..1db7d264d 100644 --- a/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -165,9 +165,9 @@ void CInterfaceItemEdition::CItemEditionWindow::infoReceived() display->setTextFormatTaged(localDesc); else { - string text = itemInfo.CustomText.toUtf8(); + string text = itemInfo.CustomText; string::size_type delimiter = text.find(' '); - if(text.size() > 3 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B') + if (NLMISC::startsWith(text, "@WEB")) { CGroupHTML *pGH = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:web_transactions:content:html")); if (pGH) diff --git a/ryzom/common/data_common/msg.xml b/ryzom/common/data_common/msg.xml index 3c0d19a3c..032cd5b07 100644 --- a/ryzom/common/data_common/msg.xml +++ b/ryzom/common/data_common/msg.xml @@ -168,7 +168,7 @@ - + diff --git a/ryzom/common/src/game_share/inventories.h b/ryzom/common/src/game_share/inventories.h index a31eb1af3..8ff5861b6 100644 --- a/ryzom/common/src/game_share/inventories.h +++ b/ryzom/common/src/game_share/inventories.h @@ -367,8 +367,8 @@ namespace INVENTORIES bms.serial( _SlotIndex, CInventoryCategoryTemplate::SlotBitSize ); uint i; - // SHEET, QUALITY, QUANTITY, USER_COLOR, CREATE_TIME and SERIAL never require compression - for (i = 0; i < 6; ++i) + // SHEET, QUALITY, QUANTITY, and USER_COLOR never require compression + for (i = 0; i < 4; ++i) bms.serial((uint32&)_ItemProp[i], DataBitSize[i]); // For all other the compression is simple the first bit indicates if the value is zero @@ -376,22 +376,38 @@ namespace INVENTORIES { for (; i < NbItemPropId; ++i) { - bool b; - bms.serialBit(b); - if (b) - _ItemProp[i] = 0; - else + if (DataBitSize[i] < 3) + { + // Don't compress 1 or 2 bits either bms.serial((uint32&)_ItemProp[i], DataBitSize[i]); + } + else + { + bool b; + bms.serialBit(b); + if (b) + _ItemProp[i] = 0; + else + bms.serial((uint32 &)_ItemProp[i], DataBitSize[i]); + } } } else { for (; i != NbItemPropId; ++i) { - bool b = (_ItemProp[i] == 0); - bms.serialBit(b); - if (!b) + if (DataBitSize[i] < 3) + { + // Don't compress 1 or 2 bits either bms.serial((uint32&)_ItemProp[i], DataBitSize[i]); + } + else + { + bool b = (_ItemProp[i] == 0); + bms.serialBit(b); + if (!b) + bms.serial((uint32 &)_ItemProp[i], DataBitSize[i]); + } } } } diff --git a/ryzom/server/src/entities_game_service/admin.cpp b/ryzom/server/src/entities_game_service/admin.cpp index 6c91c9f39..b0a055c2d 100644 --- a/ryzom/server/src/entities_game_service/admin.cpp +++ b/ryzom/server/src/entities_game_service/admin.cpp @@ -8317,7 +8317,7 @@ NLMISC_COMMAND(eventSetBotSheet, "Change the sheet of a bot", " ") { @@ -8337,7 +8337,7 @@ NLMISC_COMMAND(eventSetItemCustomText, "set an item custom text, which replaces NLMISC::fromString(args[2], slot); text.fromUtf8(args[3]); - sint32 ret = clientEventSetItemCustomText(c, inventory, slot, text); + sint32 ret = clientItemWrite(c, inventory, slot, text); switch (ret) { diff --git a/ryzom/server/src/entities_game_service/client_messages.cpp b/ryzom/server/src/entities_game_service/client_messages.cpp index 3a6e0269e..91e34593a 100644 --- a/ryzom/server/src/entities_game_service/client_messages.cpp +++ b/ryzom/server/src/entities_game_service/client_messages.cpp @@ -427,7 +427,7 @@ void cbClientItemRename(NLNET::CMessage &msgin, const std::string &serviceName, /// -1: Invalid inventory /// -2: Invalid slot /// -3: Empty slot -sint32 cbClientItemWrite(CCharacter* character, INVENTORIES::TInventory inventory, uint32 slot, ucstring const& text) +sint32 clientItemWrite(CCharacter* character, INVENTORIES::TInventory inventory, uint32 slot, ucstring const& text) { if (inventory==INVENTORIES::UNDEFINED) { @@ -504,8 +504,8 @@ void cbClientItemWrite( NLNET::CMessage& msgin, const std::string & serviceName, } // prevent use of @WEB at begin - if (text.size() >= 4 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B') - text = text.substr(4, text.size() - 4); + if (NLMISC::startsWith(text, "@WEB")) + text = text.substr(4); // force that the begin of the text for non admin is %mfc if(!text.empty() && text.substr(0, 4) != string("%mfc")) @@ -514,7 +514,7 @@ void cbClientItemWrite( NLNET::CMessage& msgin, const std::string & serviceName, } } - cbClientItemWrite(character, inventory, slot, text); + clientItemWrite(character, inventory, slot, text); } /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp b/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp index fe63153ca..589c549e9 100644 --- a/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp +++ b/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp @@ -1164,7 +1164,7 @@ void CGameItem::setAccessGrade(EGSPD::CGuildGrade::TGuildGrade value) } } -void CGameItem::setPhraseId(const std::string &str, bool literal = false) +void CGameItem::setPhraseId(const std::string &str, bool literal) { if (literal != _PhraseLiteral || _PhraseId != str) {