Example #1
0
        public string AllTrackedFiles(IrcBotFramework.IrcCommand command)
        {
            if (command.Destination != "reside_priv") return "You cannot use this command";

            foreach (TrackData dat in ManifestTrackList)
            {
                SendMessage(command.Destination, string.Format("{0} is tracking {1} last updated {2} url: {3}", dat.TrackedBy, dat.Name, dat.LastUpdated, dat.Manifest));
            }

            return "Done";
        }
Example #2
0
        public string AnalyzeChanges(IrcBotFramework.IrcCommand command)
        {
            string branch = command.Parameters[0];

            Branch b = (Branch)Enum.Parse(typeof(Branch), branch);

            string analysis = PS2Analyzer.AnalyzePS2(Constants.Directories[b]);

            string revName = branch + DateTime.Now.ToString("yyyy-MM-dd");
            AutoAnalyze(branch, analysis, revName);

            return "Done: " + string.Format("http://www.testoutfit.info/lebot/RevisionReports/{0}", revName + "Changes.txt");
        }
Example #3
0
        public string LastUpdate(IrcBotFramework.IrcCommand command)
        {
            if(command.Parameters.Length == 1 && command.Parameters[0] == "all" && command.Destination == "#reside_priv")
            {
                foreach(TrackData d in ManifestTrackList.OrderByDescending(d => d.LastUpdated))
                {
                     SendMessage(command.Destination, d.Name + " was last updated on: " + d.LastUpdated.ToString());
                }
                return "Done.";
            }

            string[] PublicTracked = { "Live", "Test", "China_Live", "EQNLandmark" };

            foreach (TrackData d in ManifestTrackList.Where(d => PublicTracked.Contains(d.Name)).OrderByDescending(d => d.LastUpdated))
            {
                SendMessage(command.Destination, d.Name + " was last updated on: " + d.LastUpdated.ToString());
            }

            return "Done.";
        }
Example #4
0
        public string TrackManifestFile(IrcBotFramework.IrcCommand command)
        {
            if (command.Destination != "#reside_priv") return "You cannot use this command";

            if (command.Parameters.Length != 2) return ".trackmanifest <name> <manifesturl>";

            string name = command.Parameters[0];
            if (ManifestTrackList.Where(x => x.Name == name).DefaultIfEmpty(null).FirstOrDefault() != null)
            {
                return "Already tracking that!";
            }

            string url = command.Parameters[1];
            string owner = command.Source.Nick;

            TrackData dat = new TrackData()
            {
                Name = name,
                Manifest = url,
                TrackedBy = owner,
                LastUpdated = DateTime.MinValue,
            };

            ManifestTrackList.Add(dat);

            using (JsonTextWriter wr = new JsonTextWriter(new System.IO.StreamWriter(TrackedManifestFile)))
            {
                JsonSerializer ser = new JsonSerializer();
                wr.Formatting = Formatting.Indented;
                ser.Serialize(wr, ManifestTrackList);
            }

            return "Done";
        }