From 9b379c009d386b637287b8a871ba34b393c8b715 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Mar 2012 14:11:28 +0100 Subject: [PATCH] Changed: #1433 Merge changes from patch 1.13 --- .../src/game_share/character_sync_itf.h | 10 ----- .../common/src/game_share/msg_ais_egs_gen.h | 18 +++++++++ .../src/game_share/persistent_data_template.h | 38 ++++++++++++++++++- code/ryzom/common/src/game_share/sp_type.cpp | 2 +- 4 files changed, 56 insertions(+), 12 deletions(-) diff --git a/code/ryzom/common/src/game_share/character_sync_itf.h b/code/ryzom/common/src/game_share/character_sync_itf.h index 459659732..5481045ed 100644 --- a/code/ryzom/common/src/game_share/character_sync_itf.h +++ b/code/ryzom/common/src/game_share/character_sync_itf.h @@ -1108,9 +1108,7 @@ namespace CHARSYNC void setResult(TCharacterNameResult value) { - _Result = value; - } // uint32 getUserId() const @@ -1120,9 +1118,7 @@ namespace CHARSYNC void setUserId(uint32 value) { - _UserId = value; - } // uint8 getCharIndex() const @@ -1132,9 +1128,7 @@ namespace CHARSYNC void setCharIndex(uint8 value) { - _CharIndex = value; - } // const ucstring& getFullName() const @@ -1144,9 +1138,7 @@ namespace CHARSYNC void setFullName(const ucstring &value) { - _FullName = value; - } bool operator == (const CValidateNameResult &other) const @@ -1161,7 +1153,6 @@ namespace CHARSYNC // constructor CValidateNameResult() { - } void serial(NLMISC::IStream &s) @@ -1170,7 +1161,6 @@ namespace CHARSYNC s.serial(_UserId); s.serial(_CharIndex); s.serial(_FullName); - } diff --git a/code/ryzom/common/src/game_share/msg_ais_egs_gen.h b/code/ryzom/common/src/game_share/msg_ais_egs_gen.h index d7bfc39e7..e08716a4d 100644 --- a/code/ryzom/common/src/game_share/msg_ais_egs_gen.h +++ b/code/ryzom/common/src/game_share/msg_ais_egs_gen.h @@ -884,6 +884,7 @@ namespace RYMSG std::vector< NLMISC::CSheetId > _LootList; // NLMISC::CSheetId _Outpost; + uint32 _Organization; // float _MaxHitRangeForPC; // @@ -1336,6 +1337,21 @@ namespace RYMSG _Outpost = value; + } + + // + uint32 getOrganization() const + { + return _Organization; + } + + void setOrganization(uint32 value) + { + + + _Organization = value; + + } // float getMaxHitRangeForPC() const @@ -1431,6 +1447,7 @@ namespace RYMSG && _ContextOptions == other._ContextOptions && _LootList == other._LootList && _Outpost == other._Outpost + && _Organization == other._Organization && _MaxHitRangeForPC == other._MaxHitRangeForPC && _UserModelId == other._UserModelId && _CustomLootTableId == other._CustomLootTableId @@ -1489,6 +1506,7 @@ namespace RYMSG s.serialCont(_ContextOptions); s.serialCont(_LootList); s.serial(_Outpost); + s.serial(_Organization); s.serial(_MaxHitRangeForPC); s.serial(_UserModelId); s.serial(_CustomLootTableId); 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 08211687a..21cb2588d 100644 --- a/code/ryzom/common/src/game_share/persistent_data_template.h +++ b/code/ryzom/common/src/game_share/persistent_data_template.h @@ -175,6 +175,42 @@ #include "nel/misc/hierarchical_timer.h" inline uint32 saveGameCycleToSecond(NLMISC::TGameCycle tick) { + // Evaluate the UTC of this event (with the current date of save). Suppose that 1 second==10 tick + // NB: result should be positive since no event should have been launched before 1970! + if (tick < CTickEventHandler::getGameCycle()) + { + NLMISC::TGameCycle tick_dt = CTickEventHandler::getGameCycle() - tick; + uint32 s_dt = tick_dt / 10; + return NLMISC::CTime::getSecondsSince1970() - s_dt; + } + else + { + NLMISC::TGameCycle tick_dt = tick - CTickEventHandler::getGameCycle(); + uint32 s_dt = tick_dt / 10; + return NLMISC::CTime::getSecondsSince1970() + s_dt; + } +} +inline NLMISC::TGameCycle loadSecondToGameCycle(uint32 second) +{ + if (second < NLMISC::CTime::getSecondsSince1970()) + { + uint32 s_dt = NLMISC::CTime::getSecondsSince1970() - second; + NLMISC::TGameCycle tick_dt = s_dt * 10; + return CTickEventHandler::getGameCycle() - tick_dt; + } + else + { + uint32 s_dt = second - NLMISC::CTime::getSecondsSince1970(); + NLMISC::TGameCycle tick_dt = s_dt * 10; + return CTickEventHandler::getGameCycle() + tick_dt; + } +} + +/*inline uint32 saveGameCycleToSecond(NLMISC::TGameCycle tick) +{ + sint32 dt = CTickEventHandler::getGameCycle() - tick; + + // Evaluate the UTC of this event (with the current date of save). Suppose that 1 second==10 tick if (tick < CTickEventHandler::getGameCycle()) return NLMISC::CTime::getSecondsSince1970(); @@ -190,7 +226,7 @@ inline NLMISC::TGameCycle loadSecondToGameCycle(uint32 second) // Convert UTC of the event to game cycle. Suppose that 1 second==10 tick return CTickEventHandler::getGameCycle() + (second - NLMISC::CTime::getSecondsSince1970())*10; -} +}*/ #endif // GameCycle property (saved as a UTC of the current game cycle, support server migration) diff --git a/code/ryzom/common/src/game_share/sp_type.cpp b/code/ryzom/common/src/game_share/sp_type.cpp index 1ab59ed04..a05a8b554 100644 --- a/code/ryzom/common/src/game_share/sp_type.cpp +++ b/code/ryzom/common/src/game_share/sp_type.cpp @@ -51,4 +51,4 @@ std::map CSPType::_ValueMap; // End of static implementation of CSPType -} // End of EGSPD \ No newline at end of file +} // End of EGSPD