Esempio n. 1
0
        private void UpdateLogs(string deployHistory, int maxVersion)
        {
            MatchCollection matches = Regex.Matches(deployHistory, LogPattern);

            CurrentLogs_x86.Clear();
            CurrentLogs_x64.Clear();

            foreach (Match match in matches)
            {
                string[] data = match.Groups.Cast <Group>()
                                .Select(group => group.Value)
                                .Where(value => value.Length != 0)
                                .ToArray();

                string buildType = data[1];
                bool   is64Bit   = buildType.EndsWith("64", Program.StringFormat);

                DeployLog deployLog = new DeployLog()
                {
                    Is64Bit     = is64Bit,
                    VersionGuid = data[2],
                    TimeStamp   = DateTime.Parse(data[3], DateTimeFormatInfo.InvariantInfo),

                    MajorRev   = int.Parse(data[4], Program.NumberFormat),
                    Version    = int.Parse(data[5], Program.NumberFormat),
                    Patch      = int.Parse(data[6], Program.NumberFormat),
                    Changelist = int.Parse(data[7], Program.NumberFormat)
                };

                if (deployLog.Changelist < EarliestChangelist || deployLog.Version > maxVersion)
                {
                    continue;
                }

                HashSet <DeployLog> targetList;

                if (deployLog.Is64Bit)
                {
                    targetList = CurrentLogs_x64;
                }
                else
                {
                    targetList = CurrentLogs_x86;
                }

                targetList.Add(deployLog);
            }

            MakeDistinct(CurrentLogs_x64);
            MakeDistinct(CurrentLogs_x86);
        }
Esempio n. 2
0
        private void UpdateLogs(string deployHistory, int maxVersion)
        {
            var now     = DateTime.Now;
            var matches = Regex.Matches(deployHistory, LogPattern);

            CurrentLogs_x86.Clear();
            CurrentLogs_x64.Clear();

            foreach (Match match in matches)
            {
                string[] data = match.Groups.Cast <Group>()
                                .Select(group => group.Value)
                                .Where(value => value.Length != 0)
                                .ToArray();

                string buildType = data[1];
                bool   is64Bit   = buildType.EndsWith("64", Program.StringFormat);

                DeployLog deployLog = new DeployLog()
                {
                    Is64Bit     = is64Bit,
                    VersionGuid = data[2],
                    TimeStamp   = DateTime.Parse(data[3], DateTimeFormatInfo.InvariantInfo),

                    MajorRev   = int.Parse(data[4], Program.NumberFormat),
                    Version    = int.Parse(data[5], Program.NumberFormat),
                    Patch      = int.Parse(data[6], Program.NumberFormat),
                    Changelist = int.Parse(data[7], Program.NumberFormat)
                };

                if (deployLog.Changelist < EarliestChangelist || deployLog.Version > maxVersion)
                {
                    continue;
                }

                // olive71 (Ganesh) said we should expect builds older than ~3 months to be deleted.
                // Although in practice this isn't consistently done, it's better to be safe than sorry.
                // https://devforum.roblox.com/t/previous-roblox-builds-missing-from-deployment-server/469698/3

                var timespan = now - deployLog.TimeStamp;

                if (timespan.TotalDays > 90)
                {
                    continue;
                }

                // Unverified builds might need a moment.

                if (timespan.TotalMinutes < 5)
                {
                    continue;
                }

                HashSet <DeployLog> targetList;

                if (deployLog.Is64Bit)
                {
                    targetList = CurrentLogs_x64;
                }
                else
                {
                    targetList = CurrentLogs_x86;
                }

                targetList.Add(deployLog);
            }

            MakeDistinct(CurrentLogs_x64);
            MakeDistinct(CurrentLogs_x86);
        }