}

        private void InitTelematics()
        {
            if (IsTelematicsEnabled())
            {
                _tc = new TelemetryClient();
                _tc.Context.InstrumentationKey = GetInstrumentationKey();
                _tc.InstrumentationKey = GetInstrumentationKey();

                // Set session data:

                _tc.Context.Session.Id = Guid.NewGuid().ToString();
                _tc.Context.Component.Version = GetAppVersion().Result;
                _tc.Context.Device.OperatingSystem = Environment.OSVersion.ToString();
                _tc.TrackEvent("StartCLI");
            }
        }

        internal void ShowVersion()
        {
            Console.ForegroundColor = ConsoleColor.Yellow;
            System.Console.WriteLine("Certify SSL Manager - CLI v4.0.0. Certify.Core v" + GetAppVersion().Result);
            Console.ForegroundColor = ConsoleColor.White;
            System.Console.WriteLine("For more information see " + GetAppWebsiteURL());
            System.Console.WriteLine("");
        }

        internal void ShowACMEInfo()
        {
            /*
                        var certifyManager = new CertifyManager();
                        string vaultInfo = certifyManager.GetVaultSummary();
                        string acmeInfo = certifyManager.GetAcmeSummary();

                        Console.ForegroundColor = ConsoleColor.DarkYellow;
                        System.Console.WriteLine("Let's Encrypt ACME API: " + acmeInfo);
                        System.Console.WriteLine("ACMESharp Vault: " + vaultInfo);
            */
            System.Console.WriteLine("");
            Console.ForegroundColor = ConsoleColor.White;
        }

        internal void ShowHelp()
        {
            Console.ForegroundColor = ConsoleColor.White;
            System.Console.WriteLine("Usage: certify <command> \n");
            System.Console.WriteLine("certify renew : renew certificates for all auto renewed managed sites");
            System.Console.WriteLine("certify list : list managed certificates and current running/not running status in IIS");
            System.Console.WriteLine("certify diag : check existing ssl bindings and managed certificate integrity");
            System.Console.WriteLine("certify importcsv : import managed certificates from a CSV file.");
            System.Console.WriteLine("\n\n");
            System.Console.WriteLine("\n\n");
            System.Console.WriteLine("For help, see the docs at https://docs.certifytheweb.com");

            System.Console.WriteLine("\n");
        }

        internal async Task PerformAutoRenew()
        {
            if (_tc == null) InitTelematics();
            if (_tc!= null)
            {
                _tc.TrackEvent("CLI_BeginAutoRenew");
            }

            Console.ForegroundColor = ConsoleColor.White;
            System.Console.WriteLine("\nPerforming Auto Renewals..\n");

            //go through list of items configured for auto renew, perform renewal and report the result
            var results = await _certifyClient.BeginAutoRenewal();
            Console.ForegroundColor = ConsoleColor.White;

            foreach (var r in results)
            {
                if (r.ManagedItem!= null)
                {
                    System.Console.WriteLine("--------------------------------------");
                    if (r.IsSuccess)
                    {
                        Console.ForegroundColor = ConsoleColor.Green;
                        System.Console.WriteLine(r.ManagedItem.Name);
                    }
                    else
                    {
                        Console.ForegroundColor = ConsoleColor.DarkYellow;
                        System.Console.WriteLine(r.ManagedItem.Name);

                        if (r.Message!= null)
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            System.Console.WriteLine(r.Message);
                        }
                    }
                }
            }
            Console.ForegroundColor = ConsoleColor.White;

            System.Console.WriteLine("Completed:" + results.Where(r => r.IsSuccess == true).Count());
            if (results.Any(r => r.IsSuccess == false))
            {
                Console.ForegroundColor = ConsoleColor.Red;
                System.Console.WriteLine("Failed:" + results.Where(r => r.IsSuccess == false).Count());
                Console.ForegroundColor = ConsoleColor.White;
            }
        }

        internal void ListManagedCertificates()
        {
            var managedCertificates = _certifyClient.GetManagedCertificates(new ManagedCertificateFilter()).Result;

            foreach (var site in managedCertificates)
            {
                Console.ForegroundColor = ConsoleColor.White;

                Console.WriteLine($"{site.Name},{site.DateExpiry}");
            }
        }
    }
}
I am trying to understand the Allegro timer/interrupt code in a little more detail as I need a high precision timer system for high speed animations. I need to animate loads of things at all kinds of speeds but using just one interrupt.
In a nutshell to get the full range of intervals I need (in this case to animate stuff with a range from 1 to 60 times per sec) I need to install a timer that fires every 120 hunds/sec. I figure this because it allows me to move things at >30 intervals (say 55 or 49 etc). To not double the timer range to 120 (as in run it at 60 ticks) means that there is no difference between moving 31 and 59 times per sec as the move interval will not divide into the ticks.
Anyway putting all that stuff aside (which can clearly be a real head bender) my questions are...
1. Am I missing the point totally and looking at things the wrong way? Is there another way of getting stuff to animate at anything from 1 to 59 or even say 47 times per sec?
2. If my game slows down to < 120 FPS (very likely at times) would the timer interrupt not fire on time. So it it seperate from the game code like a "proper hardware" interrupt under DOS?
3. Is 120 ticks per sec considered too fast for an Allegro interrupt? Not the norm surely?
I think the highest you can really depend on is about 100 ticks a second -- the timers arn't much more accurate than 10ms... (I don't think even the Windows OS timers are for that matter)...
At any rate, if you're going to max out at 60 animations per second, then the most you'll ever need to call your timer is 60 times a second...
Basically, in each of your objects have a constant variable that says how many ticks to skip per frame of animation, and another variable to count. (For instance if you want to animate an object at 60 fps, you would never skip any frames and the constant would be 1, if you wanted 30 fps for another object, you would set it to 2, 45 fps would be 1.33, 15 fps would be 4 -- I think the formula is something like constant_skip_var = (1/(fps/60) )
every tick you would add one to the counter, and every time the counter was equal to or greater than the constant you would call your animate (usually just incrase the frame counter) and subtract the constant value from the counter value.
--- that method has some obvious flaws though.
1. Am I missing the point totally and looking at things the wrong way? Is there another way of getting stuff to animate at anything from 1 to 59 or even say 47 times per sec?
You should be able to do everything with a single-speed timer, for example 100Hz.
Animate means either or all of the following:a) take a "logical step" in the unit's AI: examine the situation and make decisions accordingly.b) modify the coordinates : this is the movement.c) modifiy the appearance. sprite, color, blinking effect on/off, angle (heading)
For b), you can use coordinates and speed with a precision higher than pixel "integers". So you can precisely map any speed and position: A constant +0.35 speed will result in a movement of 35 pixels per second.
a) and c) usually can be taken as discrete steps, so they don't need sub-step precision.
There are 1000 milliseconds(msecs) in a second, and 1000 usecs in a millisecond.
Tested on windows and linux and usec precision appears to be pretty consistent.
[edit]Heres some usage:
...
Timer::time_t t = timer.usecs();
...
cout << timer.usecs() - t << " Microseconds have passed.\n";
How is my posting? - iPad POS
If some of your animations are running too fast you should have a frame display for multiple updates.So if your code looks like this:
You can make it run at half speed by changing it to look like this:
________________________________________________Play my games at
Just some simple math is needed. Here is my (probably flawed somehow) code from a TINS a few years ago:
anim.h:
anim.c:
And here is the abitmap utility:
BAF.zone | SantaHack!