void main() { /*CLoggingStream errors(L"errorLogs"); g_Scripts.reset(new Scripting::Scripts(errors, "D:\\Development\\C++\\Phasor - Copy\\Release")); g_Scripts->OpenScript("lua_test"); g_Scripts->OpenScript("lua_test1"); //Scripting::OpenScript("lua_test1"); Scripting::PhasorCaller caller; caller.AddArg("hello"); Scripting::Result result = caller.Call("funca"); caller.AddArg("hello_again"); caller.Call("funca"); std::cout << result.size() << std::endl; g_Scripts->CloseScript("lua_test"); g_Scripts->CloseScript("lua_test1");*/ /*PhasorThread thread; thread.run(); std::unique_ptr<PhasorThreadEvent> e = TestEvent::Create(0); thread.InvokeInAux(std::move(e)); for (int i =0; i < 100000; i++) { thread.ProcessEvents(); Sleep(5); //if (count == 100) break; } thread.close(); while (!thread.has_closed()) { Sleep(10); }*/ Timers timers; timer_t timer = TestTimer::Create(1000); timers.AddTimer(std::move(timer)); timer_t timer1 = TestTimer1::Create(1000, timer->GetID()); timer_t timer2 = TestTimer1::Create(1000, timer1->GetID()); timers.AddTimer(std::move(timer2)); timers.AddTimer(std::move(timer1)); while (1) { timers.Process(); Sleep(20); } }
CAFKDetection::CAFKDetection(s_player& player, Timers& timers) : player(player), timers(timers), move_count(0), afk_duration(0) { timer_ptr timer(new CAFKDetectionEvent(60000,*this)); timer_id = timers.AddTimer(std::move(timer)); }