From 16afa277def8ffc478a271854c7735acffa09c76 Mon Sep 17 00:00:00 2001 From: cavedude00 Date: Thu, 27 Feb 2014 23:21:57 -0800 Subject: [PATCH] Exported TrainDisc to Lua. Updated idle timer names. --- changelog.txt | 4 ++++ zone/lua_client.cpp | 6 ++++++ zone/lua_client.h | 1 + zone/net.cpp | 19 ++++++++++--------- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/changelog.txt b/changelog.txt index f59ae6a35..56afea293 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,9 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 02/27/2014 == +cavedude: Exported TrainDisc to Lua. + == 02/26/2014 == Kayen: Implemented SE_FrenziedDevestation - increase critical spell chacnce and 2x mana cost for DD spells Kayen: Fixed SE_SpellProcChance - Now works on spell dervived procs @@ -8,6 +11,7 @@ cavedude: Added two new NPC special_abilities. ALWAYS_FLEE, which forces the NPC cavedude: Fixed an issue where rectangular roamboxes could cause an NPC to get stuck on a single coord. cavedude: Added a new roambox column, mindelay allowing you to have more control over the roambox delay. Uleat: Fix for 'sqrt' failure on vs2010 clients +image: Added idle zone timer to save CPU cycles. Required SQL: utils/sql/git/required/2014_02_26_roambox_update.sql diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index f49fb0da0..a1af1b499 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -560,6 +560,11 @@ void Lua_Client::UnscribeSpellAll(bool update_client) { self->UnscribeSpellAll(update_client); } +void Lua_Client::TrainDisc(int itemid) { + Lua_Safe_Call_Void(); + self->TrainDiscipline(itemid); +} + void Lua_Client::UntrainDisc(int slot) { Lua_Safe_Call_Void(); self->UntrainDisc(slot); @@ -1352,6 +1357,7 @@ luabind::scope lua_register_client() { .def("UnscribeSpell", (void(Lua_Client::*)(int,bool))&Lua_Client::UnscribeSpell) .def("UnscribeSpellAll", (void(Lua_Client::*)(void))&Lua_Client::UnscribeSpellAll) .def("UnscribeSpellAll", (void(Lua_Client::*)(bool))&Lua_Client::UnscribeSpellAll) + .def("TrainDisc", (void(Lua_Client::*)(int))&Lua_Client::TrainDisc) .def("UntrainDisc", (void(Lua_Client::*)(int))&Lua_Client::UntrainDisc) .def("UntrainDisc", (void(Lua_Client::*)(int,bool))&Lua_Client::UntrainDisc) .def("UntrainDiscAll", (void(Lua_Client::*)(void))&Lua_Client::UntrainDiscAll) diff --git a/zone/lua_client.h b/zone/lua_client.h index 4aedd0df5..8809779e9 100644 --- a/zone/lua_client.h +++ b/zone/lua_client.h @@ -138,6 +138,7 @@ public: void UnscribeSpell(int slot, bool update_client); void UnscribeSpellAll(); void UnscribeSpellAll(bool update_client); + void TrainDisc(int itemid); void UntrainDisc(int slot); void UntrainDisc(int slot, bool update_client); void UntrainDiscAll(); diff --git a/zone/net.cpp b/zone/net.cpp index 5c1f95e16..d870ee550 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -336,8 +336,10 @@ int main(int argc, char** argv) { bool worldwasconnected = worldserver.Connected(); EQStream* eqss; EQStreamInterface *eqsi; - Timer temp_timer(10); - temp_timer.Start(); + uint8 IDLEZONEUPDATE = 200; + uint8 ZONEUPDATE = 10; + Timer zoneupdate_timer(ZONEUPDATE); + zoneupdate_timer.Start(); while(RunLoops) { { //profiler block to omit the sleep from times @@ -381,13 +383,12 @@ int main(int argc, char** argv) { entity_list.AddClient(client); } - uint8 IDLEZONETIME = 200; - if ( numclients < 1 && temp_timer.GetDuration() != IDLEZONETIME ) - temp_timer.SetTimer(IDLEZONETIME); - else if ( numclients > 0 && temp_timer.GetDuration() == IDLEZONETIME ) + if ( numclients < 1 && zoneupdate_timer.GetDuration() != IDLEZONEUPDATE ) + zoneupdate_timer.SetTimer(IDLEZONEUPDATE); + else if ( numclients > 0 && zoneupdate_timer.GetDuration() == IDLEZONEUPDATE ) { - temp_timer.SetTimer(10); - temp_timer.Trigger(); + zoneupdate_timer.SetTimer(ZONEUPDATE); + zoneupdate_timer.Trigger(); } //check for timeouts in other threads @@ -402,7 +403,7 @@ int main(int argc, char** argv) { worldwasconnected = false; } - if (ZoneLoaded && temp_timer.Check()) { + if (ZoneLoaded && zoneupdate_timer.Check()) { { if(net.group_timer.Enabled() && net.group_timer.Check()) entity_list.GroupProcess();