mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-31 11:51:28 +00:00
[Quest API] Add Zone Uptime Exports to Perl/Lua (#4339)
This commit is contained in:
parent
316fa54bd8
commit
cd03152550
@ -1547,16 +1547,17 @@ void PerlembParser::ExportMobVariables(
|
||||
void PerlembParser::ExportZoneVariables(std::string& package_name)
|
||||
{
|
||||
if (zone) {
|
||||
ExportVar(package_name.c_str(), "zoneid", zone->GetZoneID());
|
||||
ExportVar(package_name.c_str(), "zoneln", zone->GetLongName());
|
||||
ExportVar(package_name.c_str(), "zonesn", zone->GetShortName());
|
||||
ExportVar(package_name.c_str(), "instanceid", zone->GetInstanceID());
|
||||
ExportVar(package_name.c_str(), "instanceversion", zone->GetInstanceVersion());
|
||||
TimeOfDay_Struct eqTime{ };
|
||||
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &eqTime);
|
||||
ExportVar(package_name.c_str(), "zonehour", eqTime.hour - 1);
|
||||
ExportVar(package_name.c_str(), "zoneid", zone->GetZoneID());
|
||||
ExportVar(package_name.c_str(), "zoneln", zone->GetLongName());
|
||||
ExportVar(package_name.c_str(), "zonemin", eqTime.minute);
|
||||
ExportVar(package_name.c_str(), "zonesn", zone->GetShortName());
|
||||
ExportVar(package_name.c_str(), "zonetime", (eqTime.hour - 1) * 100 + eqTime.minute);
|
||||
ExportVar(package_name.c_str(), "zoneuptime", Timer::GetCurrentTime() / 1000);
|
||||
ExportVar(package_name.c_str(), "zoneweather", zone->zone_weather);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5576,6 +5576,11 @@ bool lua_send_parcel(luabind::object lua_table)
|
||||
return CharacterParcelsRepository::InsertOne(database, e).id;
|
||||
}
|
||||
|
||||
uint32 lua_get_zone_uptime()
|
||||
{
|
||||
return Timer::GetCurrentTime() / 1000;
|
||||
}
|
||||
|
||||
#define LuaCreateNPCParse(name, c_type, default_value) do { \
|
||||
cur = table[#name]; \
|
||||
if(luabind::type(cur) != LUA_TNIL) { \
|
||||
@ -6380,6 +6385,7 @@ luabind::scope lua_register_general() {
|
||||
luabind::def("get_zone_id_by_long_name", &lua_get_zone_id_by_long_name),
|
||||
luabind::def("get_zone_short_name_by_long_name", &lua_get_zone_short_name_by_long_name),
|
||||
luabind::def("send_parcel", &lua_send_parcel),
|
||||
luabind::def("get_zone_uptime", &lua_get_zone_uptime),
|
||||
/*
|
||||
Cross Zone
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user