static void DrawImageCallback([NotNull] Player player, [NotNull] Vector3I[] marks, [NotNull] object tag) {
ImageDrawOperation op = (ImageDrawOperation)tag;
player.Message("&HDrawImage: Downloading {0}", op.ImageUrl);
try {
op.Prepare(marks);
if (!player.CanDraw(op.BlocksTotalEstimate)) {
player.Message(
"DrawImage: You are only allowed to run commands that affect up to {0} blocks. This one would affect {1} blocks.",
player.Info.Rank.DrawLimit,
op.BlocksTotalEstimate);
return;
}
op.Begin();
} catch (ArgumentException ex) {
player.Message("&WDrawImage: Error setting up: " + ex.Message);
} catch (Exception ex) {
Logger.Log(LogType.Warning,
"{0}: Error downloading image from {1}: {2}",
op.Description,
op.ImageUrl,
ex);
player.Message("&WDrawImage: Error downloading: " + ex.Message);
}
}