Example #1
0
        public void SendNotification(PokeRoutineExecutor routine, PokeTradeDetail <T> info, PokeTradeSummary message)
        {
            var msg = message.Summary;

            if (message.Details.Count > 0)
            {
                msg += ", " + string.Join(", ", message.Details.Select(z => $"{z.Heading}: {z.Detail}"));
            }
            LogUtil.LogInfo(msg, routine.Connection.Name);
        }
        private void RelocateProcessedFile(PokeRoutineExecutor completedBy)
        {
            if (SourcePath == null || !Directory.Exists(Path.GetDirectoryName(SourcePath)) || !File.Exists(SourcePath))
            {
                return;
            }
            if (DestinationPath == null || !Directory.Exists(Path.GetDirectoryName(DestinationPath)))
            {
                return;
            }

            if (File.Exists(DestinationPath))
            {
                File.Delete(DestinationPath);
            }
            File.Move(SourcePath, DestinationPath);
            LogUtil.LogInfo("Moved processed trade to destination folder.", completedBy.Connection.Name);
        }
Example #3
0
 public void TradeSearching(PokeRoutineExecutor routine, PokeTradeDetail <T> info)
 {
     LogUtil.LogInfo($"Searching for trade with {info.Trainer.TrainerName}, sending {(Species)info.TradeData.Species}", routine.Connection.Name);
 }
Example #4
0
 public void SendNotification(PokeRoutineExecutor routine, TPoke obj, string message) => Notifier.SendNotification(routine, this, obj, message);
Example #5
0
 public void SendNotification(PokeRoutineExecutor routine, LegalityAnalysis la) => Notifier.SendNotification(routine, this, la);
Example #6
0
 public void SendNotification(PokeRoutineExecutor routine, PokeTradeSummary obj) => Notifier.SendNotification(routine, this, obj);
Example #7
0
 public void SendNotification(PokeRoutineExecutor <TPoke> routine, string message) => Notifier.SendNotification(routine, this, message);
Example #8
0
 public void SendNotification(PokeRoutineExecutor routine, PokeTradeDetail <T> info, T result, string message)
 {
     LogUtil.LogInfo($"Notifying {info.Trainer.TrainerName} about their {(Species)result.Species}", routine.Connection.Name);
     LogUtil.LogInfo(message, routine.Connection.Name);
 }
Example #9
0
 public void SendNotification(PokeRoutineExecutor routine, PokeTradeDetail <T> info, string message)
 {
     LogUtil.LogInfo(message, routine.Connection.Name);
 }
Example #10
0
 public void TradeInitialize(PokeRoutineExecutor routine) => Notifier.TradeInitialize(routine, this);
 public override void TradeFinished(PokeRoutineExecutor routine, TPoke result)
 {
     base.TradeFinished(routine, result);
     RelocateProcessedFile(routine);
 }
 public void TradeFinished(PokeRoutineExecutor routine, TPoke result)
 {
     Notifier.TradeFinished(routine, this, result);
     RelocateProcessedFile(routine);
 }
Example #13
0
        public void CalculateAndNotify(T pkm, PokeTradeDetail <T> detail, SeedCheckSettings settings, PokeRoutineExecutor <T> bot)
        {
            const string msg = "Seed searching implementation not found. " +
                               "Please let the person hosting the bot know that they need to provide the required Z3 files.";

            detail.SendNotification(bot, msg);
        }
Example #14
0
 public void SendNotification(PokeRoutineExecutor routine, PokeTradeDetail <T> info, LegalityAnalysis la)
 {
     LogUtil.LogInfo($"Notifying {info.Trainer.TrainerName} about their legality check results: {la.Report(false)}", routine.Connection.Name);
 }
Example #15
0
 public void TradeCanceled(PokeRoutineExecutor routine, PokeTradeDetail <T> info, PokeTradeResult msg)
 {
     LogUtil.LogInfo($"Canceling trade with {info.Trainer.TrainerName}, because {msg}.", routine.Connection.Name);
     OnFinish?.Invoke(routine);
 }
Example #16
0
 public void TradeFinished(PokeRoutineExecutor routine, PokeTradeDetail <T> info, T result)
 {
     LogUtil.LogInfo($"Finished trading {info.Trainer.TrainerName} {(Species)info.TradeData.Species} for {(Species)result.Species}", routine.Connection.Name);
     OnFinish?.Invoke(routine);
 }
Example #17
0
 public void TradeSearching(PokeRoutineExecutor routine) => Notifier.TradeSearching(routine, this);
Example #18
0
 public void TradeCanceled(PokeRoutineExecutor routine, PokeTradeResult msg) => Notifier.TradeCanceled(routine, this, msg);
Example #19
0
 public virtual void TradeFinished(PokeRoutineExecutor routine, TPoke result)
 {
     Notifier.TradeFinished(routine, this, result);
 }
Example #20
0
 public void TradeInitialize(PokeRoutineExecutor routine, PokeTradeDetail <T> info)
 {
     LogUtil.LogInfo($"Starting trade loop for {info.Trainer.TrainerName}, sending {(Species)info.TradeData.Species}", routine.Connection.Name);
 }
Example #21
0
 public void TradeFinished(PokeRoutineExecutor routine, PokeTradeDetail <T> info, T result)
 {
     LogUtil.Log(LogLevel.Info, $"Finished trade for {info.Trainer.TrainerName}, sending {(Species)info.TradeData.Species}", routine.Connection.Name);
     LogUtil.Log(LogLevel.Info, $"Received: {(Species)result.Species}.", routine.Connection.Name);
     OnFinish?.Invoke(routine);
 }