Beispiel #1
0
        public static void authenticate()
        {
            try
            {
                // stored in properties file installed with application
                CLIENT_SECRET = RuntimeProperties.getProperty("client_secret");

                // init expire time
                expireTime = System.DateTime.Now;

                // wait for token to be received
                //tokenEndpointDecoded["access_token"];
                //tokenEndpointDecoded["refresh_token"];
                //tokenEndpointDecoded["expires_in"];
                tokens = getAccessCodeAsync().GetAwaiter().GetResult();

                // update expire time based on token
                expireTime = expireTime.AddSeconds(System.Double.Parse(tokens["expires_in"]));
            }
            catch (System.Exception e)
            {
                MessageBox.Show("Could not Authenticate - check log file for details");
                LOG.Error("Could not Authenticate", e);
            }
        }
Beispiel #2
0
        public void setLogFile(string filename, int mins)
        {
            LOG.Debug("Selecting EQ Log File: " + filename);

            if (File.Exists(filename))
            {
                logFilePath = filename.Substring(0, filename.LastIndexOf("\\")) + "\\";
                logFileName = filename.Substring(filename.LastIndexOf("\\") + 1);
                lastMins    = mins;

                LOG.Warn("Looking for entries newer than " + lastMins + " minutes.");

                MatchCollection matches = userFromFileName.Matches(logFileName);
                if (matches.Count > 0)
                {
                    LOG.Debug("Found Player: " + matches[0].Groups[1].Value);
                    RuntimeProperties.setProperty("player", matches[0].Groups[1].Value);
                }

                // save log file to settings
                RuntimeProperties.setProperty("log_file", filename);

                start();
            }
            else
            {
                LOG.Error("Selected EQ Log File missing: " + filename);
            }
        }