From 7f8118e0cbcea2b54b7c14119626772c88e42d94 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 13 Oct 2014 14:49:18 +0200 Subject: cWorld: Fixed scheduler. Fixes #1534. Added a test case into the Debuggers plugin. --- MCServer/Plugins/Debuggers/Debuggers.lua | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index f66ac76a0..3dcd4ebee 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -10,9 +10,6 @@ g_ShowFoodStats = false; -- When true, each player's food stats are sent to the function Initialize(Plugin) - Plugin:SetName("Debuggers") - Plugin:SetVersion(1) - --[[ -- Test multiple hook handlers: cPluginManager.AddHook(cPluginManager.HOOK_TICK, OnTick1); @@ -68,6 +65,8 @@ function Initialize(Plugin) PM:BindCommand("/rmitem", "debuggers", HandleRMItem, "- Remove the specified item from the inventory."); PM:BindCommand("/pickups", "debuggers", HandlePickups, "- Spawns random pickups around you"); PM:BindCommand("/poof", "debuggers", HandlePoof, "- Nudges pickups close to you away from you"); + + PM:BindConsoleCommand("sched", HandleConsoleSchedule, "Tests the world scheduling"); Plugin:AddWebTab("Debuggers", HandleRequest_Debuggers) Plugin:AddWebTab("StressTest", HandleRequest_StressTest) @@ -1630,3 +1629,17 @@ end + +function HandleConsoleSchedule(a_Split) + LOG("Scheduling a task for 2 seconds in the future") + cRoot:Get():GetDefaultWorld():ScheduleTask(40, + function () + LOG("Scheduled function is called.") + end + ) + return true, "Task scheduled" +end + + + + -- cgit v1.2.3