From 87e6c19981fb8e65b99ca29ebea4ab73711af558 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 27 Feb 2012 15:04:33 +0100 Subject: [PATCH] Changed: #1433 Merge changes from patch 1.13 --- code/ryzom/common/src/game_share/bot_chat_types.h | 2 ++ code/ryzom/common/src/game_share/entity_types.h | 2 +- code/ryzom/common/src/game_share/item_infos.cpp | 2 ++ code/ryzom/common/src/game_share/item_infos.h | 1 + .../common/src/game_share/persistent_data_template.h | 12 ++++++++---- code/ryzom/common/src/game_share/pvp_mode.cpp | 2 ++ code/ryzom/common/src/game_share/pvp_mode.h | 4 +++- .../common/src/game_share/ryzom_mirror_properties.h | 2 +- code/ryzom/common/src/game_share/send_chat.h | 2 +- 9 files changed, 21 insertions(+), 8 deletions(-) diff --git a/code/ryzom/common/src/game_share/bot_chat_types.h b/code/ryzom/common/src/game_share/bot_chat_types.h index 779bc8ba3..19982f106 100644 --- a/code/ryzom/common/src/game_share/bot_chat_types.h +++ b/code/ryzom/common/src/game_share/bot_chat_types.h @@ -82,6 +82,8 @@ namespace BOTCHATTYPE ResaleKOBroken, // this item can't be sold because its Resold time has expired ResaleKONoTimeLeft, + // this item can't be sold because the owner has locked it (temporary hack to get around modifying database.xml) + ResaleKOLockedByOwner, NumBotChatResaleFlag }; diff --git a/code/ryzom/common/src/game_share/entity_types.h b/code/ryzom/common/src/game_share/entity_types.h index 3841f9a17..68b42e954 100644 --- a/code/ryzom/common/src/game_share/entity_types.h +++ b/code/ryzom/common/src/game_share/entity_types.h @@ -130,7 +130,7 @@ const TCoord THRESHOLD_BEHAVIOUR = 60000; // Name const TPropIndex PROPERTY_NAME_STRING_ID = 6; -const TCoord THRESHOLD_NAME_STRING_ID = 25000; +const TCoord THRESHOLD_NAME_STRING_ID = 100000; // Main target const TPropIndex PROPERTY_TARGET_ID = 7; diff --git a/code/ryzom/common/src/game_share/item_infos.cpp b/code/ryzom/common/src/game_share/item_infos.cpp index a968ff8a4..af84c5d6c 100644 --- a/code/ryzom/common/src/game_share/item_infos.cpp +++ b/code/ryzom/common/src/game_share/item_infos.cpp @@ -73,6 +73,7 @@ CItemInfos::CItemInfos() LacustreMagicResistance = 0; JungleMagicResistance = 0; PrimaryRootMagicResistance = 0; + PetNumber = 0; // 1 based! } void CItemInfos::serial(NLMISC::IStream & s) @@ -130,5 +131,6 @@ void CItemInfos::serial(NLMISC::IStream & s) s.serial( CustomText ); s.serial( R2ItemDescription ); s.serial( R2ItemComment ); + s.serial( PetNumber ); } diff --git a/code/ryzom/common/src/game_share/item_infos.h b/code/ryzom/common/src/game_share/item_infos.h index ff34bfddc..3fd94444e 100644 --- a/code/ryzom/common/src/game_share/item_infos.h +++ b/code/ryzom/common/src/game_share/item_infos.h @@ -139,6 +139,7 @@ public: ucstring CustomText; ucstring R2ItemDescription; ucstring R2ItemComment; + uint8 PetNumber; // 1 based pet index //@} }; diff --git a/code/ryzom/common/src/game_share/persistent_data_template.h b/code/ryzom/common/src/game_share/persistent_data_template.h index ef76101cd..08211687a 100644 --- a/code/ryzom/common/src/game_share/persistent_data_template.h +++ b/code/ryzom/common/src/game_share/persistent_data_template.h @@ -176,16 +176,20 @@ inline uint32 saveGameCycleToSecond(NLMISC::TGameCycle tick) { // Evaluate the UTC of this event (with the current date of save). Suppose that 1 second==10 tick - return sint32(NLMISC::CTime::getSecondsSince1970()) + (sint32(tick) - sint32(CTickEventHandler::getGameCycle()))/10; + if (tick < CTickEventHandler::getGameCycle()) + return NLMISC::CTime::getSecondsSince1970(); + else + return NLMISC::CTime::getSecondsSince1970() + (tick - CTickEventHandler::getGameCycle())/10; // NB: result should be positive since no event should have been launched before 1970! } inline NLMISC::TGameCycle loadSecondToGameCycle(uint32 second) { + if (second < NLMISC::CTime::getSecondsSince1970()) + return 0; + // Convert UTC of the event to game cycle. Suppose that 1 second==10 tick - sint32 newTick= CTickEventHandler::getGameCycle() + (sint32(second) - sint32(NLMISC::CTime::getSecondsSince1970()))*10; - // If game cycle is loaded on a server where current game cycle is too young, we can have here negative values => avoid them - return std::max(newTick, sint32(0)); + return CTickEventHandler::getGameCycle() + (second - NLMISC::CTime::getSecondsSince1970())*10; } #endif diff --git a/code/ryzom/common/src/game_share/pvp_mode.cpp b/code/ryzom/common/src/game_share/pvp_mode.cpp index aa3ac1496..3e13fd428 100644 --- a/code/ryzom/common/src/game_share/pvp_mode.cpp +++ b/code/ryzom/common/src/game_share/pvp_mode.cpp @@ -35,6 +35,8 @@ namespace PVP_MODE NL_STRING_CONVERSION_TABLE_ENTRY(PvpZoneOutpost) NL_STRING_CONVERSION_TABLE_ENTRY(PvpFaction) NL_STRING_CONVERSION_TABLE_ENTRY(PvpFactionFlagged) + NL_STRING_CONVERSION_TABLE_ENTRY(PvpZoneSafe) + NL_STRING_CONVERSION_TABLE_ENTRY(PvpSafe) NL_END_STRING_CONVERSION_TABLE(TPVPMode, PVPModeConversion, Unknown) TPVPMode fromString(const std::string & str) diff --git a/code/ryzom/common/src/game_share/pvp_mode.h b/code/ryzom/common/src/game_share/pvp_mode.h index dd52f1fd6..0e654752f 100644 --- a/code/ryzom/common/src/game_share/pvp_mode.h +++ b/code/ryzom/common/src/game_share/pvp_mode.h @@ -32,10 +32,12 @@ namespace PVP_MODE PvpZoneOutpost = 32, PvpFaction = 64, PvpFactionFlagged = 128, + PvpZoneSafe = 256, + PvpSafe = 512, Unknown, NbModes = Unknown, - NbBits = 8 // number of bits needed to store all valid values + NbBits = 10 // number of bits needed to store all valid values }; diff --git a/code/ryzom/common/src/game_share/ryzom_mirror_properties.h b/code/ryzom/common/src/game_share/ryzom_mirror_properties.h index 0aab0b870..afd0ac892 100644 --- a/code/ryzom/common/src/game_share/ryzom_mirror_properties.h +++ b/code/ryzom/common/src/game_share/ryzom_mirror_properties.h @@ -138,7 +138,7 @@ void initRyzomVisualPropertyIndices( CMirroredDataSet& dataset ); #define TYPE_BOT_TRADE_SELECTOR2 uint64 #define TYPE_EVENT_FACTION_ID uint32 -#define TYPE_PVP_MODE uint8 +#define TYPE_PVP_MODE uint32 #define TYPE_PVP_CLAN uint32 #define TYPE_FUEL bool diff --git a/code/ryzom/common/src/game_share/send_chat.h b/code/ryzom/common/src/game_share/send_chat.h index cefb8bba0..1efa7acee 100644 --- a/code/ryzom/common/src/game_share/send_chat.h +++ b/code/ryzom/common/src/game_share/send_chat.h @@ -115,7 +115,7 @@ inline void npcChatToChannelEx(const TDataSetRow &senderId, CChatGroup::TGroupTy * Chat group can be constructed from CChatGroup class. * sentence is the sentence to be sent. */ -inline void npcChatToChannelSentence(const TDataSetRow &senderId, CChatGroup::TGroupType groupType, std::string& sentence) +inline void npcChatToChannelSentence(const TDataSetRow &senderId, CChatGroup::TGroupType groupType, ucstring& sentence) { NLNET::CMessage msgout("NPC_CHAT_SENTENCE"); msgout.serial(const_cast(senderId));