fixed missing include for server when trying to get the date

This commit is contained in:
SIELA1915 2016-01-31 15:39:32 +01:00
parent d6e8706581
commit db771f1d2b
5 changed files with 11 additions and 27 deletions

View file

@ -876,12 +876,8 @@ class CAHGuildSheetOpen : public IActionHandler
rt.updateRyzomClock(rGuildMembers[i].EnterDate); rt.updateRyzomClock(rGuildMembers[i].EnterDate);
ucstring str = toString("%03d", (sint)RT.getRyzomWeek()) + " "; ucstring str = toString("%03d", (sint)RT.getRyzomWeek()) + " ";
str += CI18N::get("ui"+WEEKDAY::toString( (WEEKDAY::EWeekDay)RT.getRyzomDayOfWeek() )) + " - "; str += CI18N::get("ui"+WEEKDAY::toString( (WEEKDAY::EWeekDay)RT.getRyzomDayOfWeek() )) + " - ";
ucstring year = CI18N::get("uiYear"); ucstring year = RT.getRyzomYearStr();
if (year.length() == 0) { str += year + " - "
str += toString("%04d", RT.getRyzomYear()) + " - ";
} else {
str += year + " - ";
}
str += CI18N::get("uiEon"); str += CI18N::get("uiEon");
pViewEnterDate->setText(str); pViewEnterDate->setText(str);
} }

View file

@ -1487,12 +1487,8 @@ void CInterfaceManager::updateFrameEvents()
str += toString("%02d", (sint)RT.getRyzomTime()) + CI18N::get("uiMissionTimerHour") + " - "; str += toString("%02d", (sint)RT.getRyzomTime()) + CI18N::get("uiMissionTimerHour") + " - ";
str += toString("%d", (sint)RT.getRyzomWeek()) + " "; str += toString("%d", (sint)RT.getRyzomWeek()) + " ";
str += CI18N::get("ui"+WEEKDAY::toString( (WEEKDAY::EWeekDay)RT.getRyzomDayOfWeek() )) + " - "; str += CI18N::get("ui"+WEEKDAY::toString( (WEEKDAY::EWeekDay)RT.getRyzomDayOfWeek() )) + " - ";
ucstring year = CI18N::get("uiYear"); ucstring year = RT.getRyzomYearStr();
if (year.length() == 0) {
str += toString("%04d", RT.getRyzomYear()) + " - ";
} else {
str += year + " - "; str += year + " - ";
}
str += CI18N::get("uiEon"); str += CI18N::get("uiEon");
pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:time")); pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:time"));

View file

@ -20,6 +20,7 @@
#define RY_TIME_AND_SEASON_H #define RY_TIME_AND_SEASON_H
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "nel/misc/i18n.h"
const uint RYZOM_HOURS_IN_TICKS = 9000; const uint RYZOM_HOURS_IN_TICKS = 9000;
const uint RYZOM_DAY_IN_HOUR = 24; const uint RYZOM_DAY_IN_HOUR = 24;
@ -153,6 +154,9 @@ public:
// get ryzom Year // get ryzom Year
inline uint32 getRyzomYear() const { return _RyzomDay / RYZOM_YEAR_IN_DAY + RYZOM_START_YEAR; } inline uint32 getRyzomYear() const { return _RyzomDay / RYZOM_YEAR_IN_DAY + RYZOM_START_YEAR; }
// get ryzom Year as string
inline ucstring getRyzomYearStr() const { return CI18N::get("uiYear").length()==0?toString(_RyzomDay / RYZOM_YEAR_IN_DAY + RYZOM_START_YEAR):CI18N::get("uiYear"); }
// get ryzom week // get ryzom week
inline uint32 getRyzomWeek() const { return (_RyzomDay % RYZOM_YEAR_IN_DAY) / RYZOM_WEEK_IN_DAY; } inline uint32 getRyzomWeek() const { return (_RyzomDay % RYZOM_YEAR_IN_DAY) / RYZOM_WEEK_IN_DAY; }

View file

@ -39,7 +39,7 @@
#include "fx_entity_manager.h" #include "fx_entity_manager.h"
#include "ai_script_data_manager.h" #include "ai_script_data_manager.h"
#include "commands.h" #include "commands.h"
#include "i18n.h"
#include "ais_user_models.h" #include "ais_user_models.h"
extern bool GrpHistoryRecordLog; extern bool GrpHistoryRecordLog;
@ -3065,14 +3065,8 @@ static void displayTime(const CRyzomTime &rt, NLMISC::CLog &log)
log.displayNL(result.c_str()); log.displayNL(result.c_str());
std::string week = toString("%03d", rt.getRyzomWeek()); std::string week = toString("%03d", rt.getRyzomWeek());
std::string dayName = CI18N::get("ui"+WEEKDAY::toString((WEEKDAY::EWeekDay) rt.getRyzomDayOfWeek())).toUtf8(); std::string dayName = CI18N::get("ui"+WEEKDAY::toString((WEEKDAY::EWeekDay) rt.getRyzomDayOfWeek())).toUtf8();
std::string year; std::string year = rt.getRyzomYearStr().toUtf8();
std::string eon = CI18N::get("uiEon").toUtf8(); std::string eon = CI18N::get("uiEon").toUtf8();
ucstring yearBool = CI18N::get("uiYear");
if (yearBool.length() == 0) {
year = toString("%04d", rt.getRyzomYear());
} else {
year = yearBool.toUtf8();
}
result = NLMISC::toString("week:day:year:eon = %s:%s:%s:%s", result = NLMISC::toString("week:day:year:eon = %s:%s:%s:%s",
week, week,
dayName, dayName,

View file

@ -3366,14 +3366,8 @@ void getRyzomDateStr__s(CStateInstance* entity, CScriptStack& stack)
std::string week = toString("%03d", rt.getRyzomWeek()); std::string week = toString("%03d", rt.getRyzomWeek());
std::string dayName = CI18N::get("ui"+WEEKDAY::toString((WEEKDAY::EWeekDay) rt.getRyzomDayOfWeek())).toUtf8(); std::string dayName = CI18N::get("ui"+WEEKDAY::toString((WEEKDAY::EWeekDay) rt.getRyzomDayOfWeek())).toUtf8();
std::string year; std::string year = toString(rt.getRyzomYearStr());
std::string eon = CI18N::get("uiEon").toUtf8(); std::string eon = CI18N::get("uiEon").toUtf8();
ucstring yearBool = CI18N::get("uiYear");
if (yearBool.length() == 0) {
year = toString("%04d", rt.getRyzomYear());
} else {
year = yearBool.toUtf8();
}
result += NLMISC::toString(" / %s %s - %s - %s", result += NLMISC::toString(" / %s %s - %s - %s",
week, week,
dayName, dayName,