Changed: #1433 Merge changes from patch 1.13

This commit is contained in:
kervala 2012-03-04 14:11:28 +01:00
parent 9d4a10cb78
commit 9b379c009d
4 changed files with 56 additions and 12 deletions

View file

@ -1108,9 +1108,7 @@ namespace CHARSYNC
void setResult(TCharacterNameResult value) void setResult(TCharacterNameResult value)
{ {
_Result = value; _Result = value;
} }
// //
uint32 getUserId() const uint32 getUserId() const
@ -1120,9 +1118,7 @@ namespace CHARSYNC
void setUserId(uint32 value) void setUserId(uint32 value)
{ {
_UserId = value; _UserId = value;
} }
// //
uint8 getCharIndex() const uint8 getCharIndex() const
@ -1132,9 +1128,7 @@ namespace CHARSYNC
void setCharIndex(uint8 value) void setCharIndex(uint8 value)
{ {
_CharIndex = value; _CharIndex = value;
} }
// //
const ucstring& getFullName() const const ucstring& getFullName() const
@ -1144,9 +1138,7 @@ namespace CHARSYNC
void setFullName(const ucstring &value) void setFullName(const ucstring &value)
{ {
_FullName = value; _FullName = value;
} }
bool operator == (const CValidateNameResult &other) const bool operator == (const CValidateNameResult &other) const
@ -1161,7 +1153,6 @@ namespace CHARSYNC
// constructor // constructor
CValidateNameResult() CValidateNameResult()
{ {
} }
void serial(NLMISC::IStream &s) void serial(NLMISC::IStream &s)
@ -1170,7 +1161,6 @@ namespace CHARSYNC
s.serial(_UserId); s.serial(_UserId);
s.serial(_CharIndex); s.serial(_CharIndex);
s.serial(_FullName); s.serial(_FullName);
} }

View file

@ -884,6 +884,7 @@ namespace RYMSG
std::vector< NLMISC::CSheetId > _LootList; std::vector< NLMISC::CSheetId > _LootList;
// //
NLMISC::CSheetId _Outpost; NLMISC::CSheetId _Outpost;
uint32 _Organization;
// //
float _MaxHitRangeForPC; float _MaxHitRangeForPC;
// //
@ -1336,6 +1337,21 @@ namespace RYMSG
_Outpost = value; _Outpost = value;
}
//
uint32 getOrganization() const
{
return _Organization;
}
void setOrganization(uint32 value)
{
_Organization = value;
} }
// //
float getMaxHitRangeForPC() const float getMaxHitRangeForPC() const
@ -1431,6 +1447,7 @@ namespace RYMSG
&& _ContextOptions == other._ContextOptions && _ContextOptions == other._ContextOptions
&& _LootList == other._LootList && _LootList == other._LootList
&& _Outpost == other._Outpost && _Outpost == other._Outpost
&& _Organization == other._Organization
&& _MaxHitRangeForPC == other._MaxHitRangeForPC && _MaxHitRangeForPC == other._MaxHitRangeForPC
&& _UserModelId == other._UserModelId && _UserModelId == other._UserModelId
&& _CustomLootTableId == other._CustomLootTableId && _CustomLootTableId == other._CustomLootTableId
@ -1489,6 +1506,7 @@ namespace RYMSG
s.serialCont(_ContextOptions); s.serialCont(_ContextOptions);
s.serialCont(_LootList); s.serialCont(_LootList);
s.serial(_Outpost); s.serial(_Outpost);
s.serial(_Organization);
s.serial(_MaxHitRangeForPC); s.serial(_MaxHitRangeForPC);
s.serial(_UserModelId); s.serial(_UserModelId);
s.serial(_CustomLootTableId); s.serial(_CustomLootTableId);

View file

@ -175,6 +175,42 @@
#include "nel/misc/hierarchical_timer.h" #include "nel/misc/hierarchical_timer.h"
inline uint32 saveGameCycleToSecond(NLMISC::TGameCycle tick) 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 // Evaluate the UTC of this event (with the current date of save). Suppose that 1 second==10 tick
if (tick < CTickEventHandler::getGameCycle()) if (tick < CTickEventHandler::getGameCycle())
return NLMISC::CTime::getSecondsSince1970(); 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 // Convert UTC of the event to game cycle. Suppose that 1 second==10 tick
return CTickEventHandler::getGameCycle() + (second - NLMISC::CTime::getSecondsSince1970())*10; return CTickEventHandler::getGameCycle() + (second - NLMISC::CTime::getSecondsSince1970())*10;
} }*/
#endif #endif
// GameCycle property (saved as a UTC of the current game cycle, support server migration) // GameCycle property (saved as a UTC of the current game cycle, support server migration)

View file

@ -51,4 +51,4 @@ std::map<std::string, CSPType::TSPType> CSPType::_ValueMap;
// End of static implementation of CSPType // End of static implementation of CSPType
} // End of EGSPD } // End of EGSPD