Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }