Example #1
0
        public static void RecordDone(LoLRecorder sender, bool isSuccess, string reason)
        {
            if (isSuccess)
            {
                try
                {
                    string ReplayDir = System.Environment.CurrentDirectory + "\\Replay";
                    string str       = sender.record.gameId + ".lpr";
                    string text      = ReplayDir + "\\" + str;
                    if (!Directory.Exists(ReplayDir))
                    {
                        Directory.CreateDirectory(ReplayDir);
                    }
                    if (File.Exists(text))
                    {
                        return;
                    }
                    sender.record.writeToFile(text);
                    sender.record.writeResultToFile(ReplayDir + "\\" + sender.record.gameId + "_result.json");

                    Console.WriteLine("Success:" + sender.record.gameId.ToString());
                }
                catch
                {
                }
            }
            else
            {
            }
        }
Example #2
0
        public static void StartNewRecoding(GameInfo g)
        {
            LoLRecorder r = new LoLRecorder(g);

            r.doneEvent += RecordDone;
            try
            {
                r.startRecording();
            }
            catch
            {
                Console.Write("Error:" + JsonConvert.SerializeObject(g));
            }
        }