protected void UndoOfflinePlayer(Player p, TimeSpan delta, string whoName, Vec3S32[] marks) { if (p != null && !CheckUndoPerms(p, Group.findPlayerGroup(whoName))) { return; } UndoOfflineDrawOp op = new UndoOfflineDrawOp(); op.Start = DateTime.UtcNow.Subtract(delta); op.whoName = whoName; DrawOp.DoDrawOp(op, null, p, marks); if (op.found) { Chat.MessageAll("{0}%S's actions for the past &b{1} %Swere undone.", PlayerInfo.GetColoredName(p, whoName), delta.Shorten(true)); Server.s.Log(whoName + "'s actions for the past " + delta.Shorten(true) + " were undone."); if (p != null) { p.level.Save(true); } } else { Player.Message(p, "Could not find player specified."); } }
void UndoOfflinePlayer(Player p, string whoName, CatchPos cpos, ushort x, ushort y, ushort z) { Group group = Group.findPlayerGroup(whoName); if (group.Permission >= p.group.Permission) { MessageTooHighRank(p, "undo", false); return; } UndoOfflineDrawOp op = new UndoOfflineDrawOp(); op.Start = DateTime.UtcNow.AddTicks(-cpos.seconds * TimeSpan.TicksPerSecond); op.whoName = whoName; DrawOp.DoDrawOp(op, null, p, cpos.x, cpos.y, cpos.z, x, y, z); if (op.foundUser) { Player.GlobalMessage(group.color + whoName + "%S's actions for the past &b" + cpos.seconds + " %Sseconds were undone."); Server.s.Log(whoName + "'s actions for the past " + cpos.seconds + " seconds were undone."); p.level.Save(true); } else { Player.SendMessage(p, "Could not find player specified."); } }
void UndoOfflinePlayer(Player p, long seconds, string whoName) { if (!CheckAdditionalPerm(p)) { MessageNeedPerms(p, "can undo other players."); return; } UndoOfflineDrawOp op = new UndoOfflineDrawOp(); op.Start = DateTime.UtcNow.AddTicks(-seconds * TimeSpan.TicksPerSecond); op.whoName = whoName; DrawOp.DoDrawOp(op, null, p, new [] { Vec3U16.MaxVal, Vec3U16.MaxVal }); if (op.foundUser) { Player.GlobalMessage(Server.FindColor(whoName) + whoName + "%S's actions for the past &b" + seconds + " %Sseconds were undone."); Server.s.Log(whoName + "'s actions for the past " + seconds + " seconds were undone."); p.level.Save(true); } else { Player.SendMessage(p, "Could not find player specified."); } }