Jump to content

j4r0d

Members
  • Posts

    22
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

j4r0d's Achievements

Member

Member (2/3)

0

Reputation

  1. Still no news about updated patch for lastest revisions? Thanks
  2. I've updated also Demonic Circle for mangos 10168+ Ofc tested and works fine http://paste2.org/p/910321 Enjoy
  3. Due to high changes in lastest revision i decided to update this patch for rev 10168+ I have tested and seems to works fine http://paste2.org/p/910284 --------> Old patch updated to 10168+ http://paste2.org/p/910294 --------> New patch updated to 10168+ (cleaned up something) Enjoy
  4. Patch doesn't work anymore from revision 10156+, can someone update the patch? Thanks
  5. Confirmed, same problem for me.
  6. Yep, confirmed... mangosd.conf cannot be modified, so will work only if original.
  7. Yeah... i've tested it and works fine also for Essence of Gossamer and Devotion aura, great job
  8. Patch seems does not work correctly on lastest revisions (10000+) works only for talent Reaping, need update Thanks
  9. omg sorry diff --git a/src/game/MapUpdater.cpp b/src/game/MapUpdater.cpp new file mode 100644 index 0000000..1a37d7e --- /dev/null +++ b/src/game/MapUpdater.cpp @@ -0,0 +1,140 @@ +#include "MapUpdater.h" + +#include "DelayExecutor.h" +#include "Map.h" +#include "Database/DatabaseEnv.h" + +#include <ace/Guard_T.h> +#include <ace/Method_Request.h> + +//the reason this things are here is that i want to make +//the netcode patch and the multithreaded maps independant +//once they are merged 1 class should be used +class WDBThreadStartReq1 : public ACE_Method_Request +{ +public: + WDBThreadStartReq1 () { } + virtual int + call (void) + { + WorldDatabase.ThreadStart (); + return 0; + } +}; + +class WDBThreadEndReq1 : public ACE_Method_Request +{ +public: + WDBThreadEndReq1 () { } + virtual int + call (void) + { + WorldDatabase.ThreadEnd (); + return 0; + } +}; + +class MapUpdateRequest : public ACE_Method_Request +{ +public: + Map& m_map; + MapUpdater& m_updater; + ACE_UINT32 m_diff; + MapUpdateRequest (Map& m,MapUpdater& u,ACE_UINT32 d) : m_map(m),m_updater(u),m_diff(d) { } + virtual int + call (void) + { + m_map.Update (m_diff); + m_updater.update_finished (); + return 0; + } +}; + +MapUpdater::MapUpdater () : +m_mutex (), +m_condition (m_mutex), +m_executor (), +pedning_requests (0) +{ + return; +} + +MapUpdater::~MapUpdater () +{ + this->deactivate (); +} + +int +MapUpdater::activate (size_t num_threads) +{ + return this->m_executor.activate (static_cast<int> (num_threads), + new WDBThreadStartReq1, + new WDBThreadEndReq1); +} + +int +MapUpdater::Deactivate (void) +{ + this->wait (); + + return this->m_executor.deactivate (); +} + +int +MapUpdater::wait () +{ + ACE_GUARD_RETURN(ACE_Thread_Mutex,guard,this->m_mutex,-1); + + while(this->pedning_requests > 0) + this->m_condition.wait (); + + return 0; +} + +int +MapUpdater::schedule_update(Map& map, ACE_UINT32 diff) +{ + ACE_GUARD_RETURN(ACE_Thread_Mutex,guard,this->m_mutex,-1); + + ++this->pedning_requests; + + if( this->m_executor.execute (new MapUpdateRequest(map,*this,diff)) == -1) + { + ACE_DEBUG ((LM_ERROR, + ACE_TEXT ("(%t) \\n"), + ACE_TEXT ("Failed to schedule Map Update"))); + + --this->pedning_requests; + return -1; + } + + return 0; +} + +bool +MapUpdater::activated () +{ + return m_executor.activated(); +} + +void +MapUpdater::update_finished () +{ + ACE_GUARD (ACE_Thread_Mutex, guard, this->m_mutex); + + if (this->pedning_requests == 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%t)\\n"), + ACE_TEXT ("MapUpdater::update_finished BUG, report to devs"))); + + return; + } + + --this->pedning_requests; + + //TODO can more than one thread call wait (), it shouldnt happen + //however I ensure if in future more than 1 thread call it by + //using broadcast instead of signal () + this->m_condition.broadcast (); +} diff --git a/src/game/MapUpdater.h b/src/game/MapUpdater.h new file mode 100644 index 0000000..d4d4be5 --- /dev/null +++ b/src/game/MapUpdater.h @@ -0,0 +1,46 @@ +#ifndef _MAP_UPDATER_H_INCLUDED +#define _MAP_UPDATER_H_INCLUDED + + +#include <ace/Thread_Mutex.h> +#include <ace/Condition_Thread_Mutex.h> + +#include "DelayExecutor.h" + +class Map; + +class MapUpdater +{ +public: + MapUpdater (); + virtual ~MapUpdater (); + + friend class MapUpdateRequest; + + /// schedule update on a map, the update will start + /// as soon as possible , + /// it may even start before the call returns + int schedule_update(Map& map, ACE_UINT32 diff); + + /// Wait untill all pending updates finish + int wait (); + + /// Start the worker threads + int activate (size_t num_threads); + + /// Stop the worker threads + int deactivate (void); + + bool activated (); + +private: + /// hook called by worker threads + void update_finished (); + + DelayExecutor m_executor; + ACE_Condition_Thread_Mutex m_condition; + ACE_Thread_Mutex m_mutex; + size_t pedning_requests; +}; + +#endif //_MAP_UPDATER_H_INCLUDED diff --git a/src/shared/DelayExecutor.cpp b/src/shared/DelayExecutor.cpp new file mode 100644 index 0000000..d567ceb --- /dev/null +++ b/src/shared/DelayExecutor.cpp @@ -0,0 +1,130 @@ +#include <ace/Singleton.h> +#include <ace/Thread_Mutex.h> + +#include "DelayExecutor.h" + +#include <ace/Log_Msg.h> + +DelayExecutor* +DelayExecutor::instance () +{ + return ACE_Singleton<DelayExecutor, ACE_Thread_Mutex>::instance (); +} + +DelayExecutor::DelayExecutor () : +activated_ (false), +pre_svc_hook_ (0), +post_svc_hook_ (0) { } + +DelayExecutor::~DelayExecutor () +{ + if (pre_svc_hook_) + delete pre_svc_hook_; + + if (post_svc_hook_) + delete post_svc_hook_; + + this->deactivate (); + + //todo probably free the queue ?? +} + +int +DelayExecutor::Deactivate () +{ + if (!this->activated ()) + return -1; + + this->activated (false); + + this->queue_.queue ()->deactivate (); + + this->wait (); + + return 0; +} + +int +DelayExecutor::svc (void) +{ + if (pre_svc_hook_) + pre_svc_hook_->call (); + + for (; + { + ACE_Method_Request* rq = this->queue_.dequeue (); + + if (!rq) + break; + + rq->call (); + + delete rq; + } + + if (post_svc_hook_) + post_svc_hook_->call (); + + return 0; +} + +int +DelayExecutor::activate (int num_threads, + ACE_Method_Request* pre_svc_hook, + ACE_Method_Request* post_svc_hook) +{ + if (this->activated ()) + return -1; + + if (num_threads < 1) + return -1; + + if (pre_svc_hook_) + delete pre_svc_hook_; + + if (post_svc_hook_) + delete post_svc_hook_; + + this->pre_svc_hook_ = pre_svc_hook; + this->post_svc_hook_ = post_svc_hook; + + this->queue_.queue ()->activate (); + + if( ACE_Task_Base::activate (THR_NEW_LWP | THR_JOINABLE | THR_INHERIT_SCHED, + num_threads) == -1) + return -1; + + this->activated(true); + + return true; +} + +int +DelayExecutor::execute (ACE_Method_Request* new_req) +{ + if(new_req == NULL) + return -1; + + if(this->queue_.enqueue (new_req, + (ACE_Time_Value*)&ACE_Time_Value::zero) == -1) + { + delete new_req; + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("(%t) %p\\n"), + ACE_TEXT ("DelayExecutor::execute enqueue")), + -1); + } + return 0; +} + +bool +DelayExecutor::activated () +{ + return this->activated_; +} + +void +DelayExecutor::activated (bool s) +{ + this->activated_ = s; +} diff --git a/src/shared/DelayExecutor.h b/src/shared/DelayExecutor.h new file mode 100644 index 0000000..18c6a1b --- /dev/null +++ b/src/shared/DelayExecutor.h @@ -0,0 +1,39 @@ +#ifndef _M_DELAY_EXECUTOR_H +#define _M_DELAY_EXECUTOR_H + +#include <ace/Task.h> +#include <ace/Activation_Queue.h> +#include <ace/Method_Request.h> + +class DelayExecutor : protected ACE_Task_Base +{ +public: + DelayExecutor (); + virtual ~DelayExecutor (); + + static DelayExecutor* instance (); + + /// example + /// DelayExecutor::instance ()->execute(new MyRequest(myarg)); + /// returns -1 on failures + int execute (ACE_Method_Request* new_req); + + int activate (int num_threads = 1, + ACE_Method_Request* pre_svc_hook = 0, + ACE_Method_Request* post_svc_hook = 0); + + int deactivate (); + + bool activated (); + + virtual int svc (void); +private: + ACE_Activation_Queue queue_; + ACE_Method_Request* pre_svc_hook_; + ACE_Method_Request* post_svc_hook_; + + void activated (bool s); + bool activated_; +}; + +#endif // _M_DELAY_EXECUTOR_H
  10. Patch updated for rev 10003+ remember that this patch need test first http://paste2.org/p/856193
  11. Hi, I fixed with Laise help rupture crits As we know, with patch 3.3.3 "Rupture" spell, now can crit. "Rupture" Rank 1 http://www.wowhead.com/spell=1943 There's the patch : http://paste2.org/p/855070 Works perfectly for me, test it please Enjoy
  12. Anyone can update SoTA+Buildings patch for clean mangos 9993+? So we can start work on crashfix and other problems if are present Thanks
  13. There's the patch updated for Multithreaded Maps, required Mangos 9976+ I have included some missing things, and also included compatibility for VC100 project http://paste2.org/p/852526 Enjoy EDIT : Patch updated again due to fix on gameobject problems, like base capture in Arathi Basin, opening chests and some other
  14. Mathman, i don't have the patch for Strand of the Ancients, so i can't try by self if Destructible Buildings patch is still stable with this battleground.... please link me SoTA patch, and i will make a test
  15. Ok there is the final release of Destructible Buildings, tested and seems to works fine and stable. http://paste2.org/p/841160 Also fixed gameobject crash encountered in lastest Destructible Buildings revision. Please test and give ur feedbacks thanks EDIT : This patch works but is still unstable when we are in range of gameobjects with quests, atm i don't know how to fix this problem, if someone know how to fix this, post it
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use