aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Utilities/TaskScheduler.cpp
AgeCommit message (Collapse)Author
2015-08-21Core/Build: Merge common library and move database out of sharedStormBytePP
2015-06-30Core/Utilities: Fix callback invokation when there are no tasks present.Naios
* thx @joschiwald for noticing. (cherry picked from commit 836ec5a6e6109abe9491e204c1221e21ba9fcc81)
2015-06-21Core/Utilities: TaskScheduler: add a task validator and on update success ↵Naios
callback. * makes it possible to block tasks if there is an active spellcast. * requested by @joschiwald (cherry picked from commit 3d95aba2b3d58057f3eeed6d4dd6e51ea49b77f6)
2015-06-03Core/Shared: Hide the internal shared_ptr of the TaskContextNaios
* use . operator instead of -> to access the TaskContext now. * Add TaskContext::IsExpired to check whether the owner has expired. (cherry picked from commit 151a0f5c5e1133a21c46a8d55c834ff52061c3fa)
2015-05-31Shared/Util: Introduce a task scheduler which schedules task with c++11 ↵Naios
techniques. * Use std::function as callback (methods, lamdas & std::bind). * Uses std::chrono::duration as duration type (Milliseconds, Seconds...) - With c++11 user defined literals we could just write "11s" for example (MSVS 2015, gcc & clang). * Provides a lot of overloads for easier usage: - Static durations or random durations between min and max. - Named (with group ids - group id 0 is possible) or anonymous tasks. - Asynchronous tasks. * Is adapted to the current needs of scripting: - Repeat tasks through the TaskContext - Schedule new tasks from the context. - Provides access to the times repeat counter of a task, this will help to schedule multi step events (dialogs for example). See https://gist.github.com/Naios/6d143538abdc3d32fd2b for usage examples. (cherry picked from commit da77a90aa98bc6e34c001ca871700cec7c6e5017)