void UndoLevelPhysics(Player p, TimeSpan delta) { if (!CheckExtraPerm(p, 2)) { MessageNeedExtra(p, "undo physics.", 2); return; } if (p != null && !p.group.CanExecute("physics")) { Player.Message(p, "You can only undo physics if you can use /physics."); return; } CmdPhysics.SetPhysics(p.level, 0); UndoPhysicsDrawOp op = new UndoPhysicsDrawOp(); op.Start = DateTime.UtcNow.Subtract(delta); DrawOp.DoDrawOp(op, null, p, new Vec3S32[] { Vec3U16.MaxVal, Vec3U16.MaxVal }); Chat.MessageAll("Physics were undone &b{0}", delta.Shorten()); Server.s.Log("Physics were undone &b" + delta.Shorten()); p.level.Save(true); }
void UndoLevelPhysics(Player p, long seconds) { if (!CheckAdditionalPerm(p, 2)) { MessageNeedPerms(p, "can undo physics.", 2); return; } if (p != null && !p.group.CanExecute("physics")) { Player.SendMessage(p, "You can only undo physics if you can use /physics."); return; } Command.all.Find("physics").Use(p, "0"); UndoPhysicsDrawOp op = new UndoPhysicsDrawOp(); op.seconds = seconds; DrawOp.DoDrawOp(op, null, p, new [] { Vec3U16.MaxVal, Vec3U16.MaxVal }); Player.GlobalMessage("Physics were undone &b" + seconds + " %Sseconds"); Server.s.Log("Physics were undone &b" + seconds + " %Sseconds"); p.level.Save(true); }
void UndoPhysics(Player p, CommandData data, TimeSpan delta) { if (!CheckExtraPerm(p, data, 1)) { return; } if (!p.group.CanExecute("Physics")) { p.Message("%WYou can only undo physics if you can use %T/Physics"); return; } CmdPhysics.SetPhysics(p.level, 0); UndoPhysicsDrawOp op = new UndoPhysicsDrawOp(); op.Start = DateTime.UtcNow.Subtract(delta); DrawOpPerformer.Do(op, null, p, new Vec3S32[] { Vec3U16.MinVal, Vec3U16.MaxVal }); p.level.Message("Physics were undone &b" + delta.Shorten()); Logger.Log(LogType.UserActivity, "Physics were undone &b" + delta.Shorten()); p.level.Save(true); }