aozhiwei 3a7638a790 1
2020-02-11 11:38:28 +08:00

38 lines
883 B
C++
Executable File

#include "precompile.h"
#include "global.h"
int g_hint_flags = 0;
bool Global::IsVirtualItem(int itemid)
{
return (itemid == VID_Item_Exp ||
itemid == VID_Item_Gold ||
itemid == VID_Soul_Stone ||
itemid == VID_Pickaxe);
}
time_t Global::BetweenDays(time_t time1, time_t time2)
{
return (time1 + g_time_zone*3600)/3600/24 - (time2 + g_time_zone*3600)/3600/24;
}
time_t Global::GetDaySeconds(time_t time, int incdays)
{
return time_t((time + g_time_zone * 3600)/3600/24 + incdays) * 3600 * 24 - 3600 * g_time_zone;
}
bool Global::IsTimeToReset(int time)
{
return BetweenDays(g_nowtime - 60 * SYS_RESET_TIME, time - 60 * SYS_RESET_TIME) > 0;
}
int Global::g_nowtime = time(nullptr);
int Global::g_time_zone = 8;
bool Global::g_shutdown = false;
bool IsValidSlotId(int slot_id)
{
return slot_id >= 0 && slot_id < IS_END;
}