void do_timewarp (dbref player, dbref cause, int key, char *arg) { int secs; secs = atoi(arg); if ((key == 0) || (key & TWARP_QUEUE)) /* Sem/Wait queues */ do_queue(player, cause, QUEUE_WARP, arg); if (key & TWARP_DUMP) mudstate.dump_counter -= secs; if (key & TWARP_CLEAN) mudstate.check_counter -= secs; if (key & TWARP_IDLE) mudstate.idle_counter -= secs; if (key & TWARP_RWHO) mudstate.rwho_counter -= secs; }
void do_timewarp(dbref executor, dbref caller, dbref enactor, int eval, int key, char *arg) { UNUSED_PARAMETER(eval); int secs; secs = mux_atol(arg); // Sem/Wait queues // if ((key == 0) || (key & TWARP_QUEUE)) { do_queue(executor, caller, enactor, 0, QUEUE_WARP, arg); } // Once these are adjusted, we need to Cancel and reschedule the task. // CLinearTimeDelta ltd; ltd.SetSeconds(secs); if (key & TWARP_DUMP) { mudstate.dump_counter -= ltd; scheduler.CancelTask(dispatch_DatabaseDump, 0, 0); scheduler.DeferTask(mudstate.dump_counter, PRIORITY_SYSTEM, dispatch_DatabaseDump, 0, 0); } if (key & TWARP_CLEAN) { mudstate.check_counter -= ltd; scheduler.CancelTask(dispatch_FreeListReconstruction, 0, 0); scheduler.DeferTask(mudstate.check_counter, PRIORITY_SYSTEM, dispatch_FreeListReconstruction, 0, 0); } if (key & TWARP_IDLE) { mudstate.idle_counter -= ltd; scheduler.CancelTask(dispatch_IdleCheck, 0, 0); scheduler.DeferTask(mudstate.idle_counter, PRIORITY_SYSTEM, dispatch_IdleCheck, 0, 0); } if (key & TWARP_EVENTS) { mudstate.events_counter -= ltd; scheduler.CancelTask(dispatch_CheckEvents, 0, 0); scheduler.DeferTask(mudstate.events_counter, PRIORITY_SYSTEM, dispatch_CheckEvents, 0, 0); } }