示例#1
0
        void LicenseClientExchange()
        {
            lock (LicenseClientLock)
            {
                var Time = Bib3.Glob.StopwatchZaitMiliSictInt();

                var LicenseClientExchangeStartedLastAge = Time - LicenseClientExchangeStartedLastTime;

                if (LicenseClientExchangeStartedLastAge < LicenseClientExchangeDistanceMin)
                {
                    return;
                }

                if (null == LicenseClient)
                {
                    LicenseClient = new PropertyGenTimespanInt64 <LicenseClient>(new LicenseClient(), Time, Time);

                    SensorServerDispatcher = new SimpleSensorServerDispatcher()
                    {
                        LicenseClient    = LicenseClient.Value,
                        SensorAppManager = SensorAppManager,
                    };
                }

                LicenseClient.Value.ServerAddress = LicenseClientConfigControl?.ApiVersionAddress();

                var EveOnlineClientProcessId = this.EveOnlineClientProcessId;

                LicenseClientExchangeStartedLastTime = Time;

                Task.Run(() =>
                {
                    var LicenseClient = this.LicenseClient;

                    if (null == LicenseClient?.Value)
                    {
                        return;
                    }

                    LicenseClient.Value.Timeout = 4000;

                    SensorServerDispatcher.Exchange(
                        EveOnlineClientProcessId,
                        RequestedMeasurementTime ?? Int64.MaxValue,
                        CallbackMeasurementMemoryNew);
                });
            }
        }
示例#2
0
        static void SampleRun()
        {
            Console.WriteLine("this Programm reads the memory of the eve online client process.");
            Console.WriteLine("start an eve online client and login to your account. Then press any key to continue.\n");
            Console.ReadKey();

            var Config = Extension.ConfigReadFromConsole();

            if (null == Config)
            {
                Console.WriteLine("reading config failed.");
                return;
            }

            var LicenseClient = new BotEngine.Interface.LicenseClient()
            {
                ServerAddress = Config.LicenseServerAddress, LicenseKey = Config.LicenseKey
            };

            Console.WriteLine();
            Console.WriteLine("connecting to " + (LicenseClient?.ServerAddress ?? "") + " using Key \"" + (LicenseClient?.LicenseKey ?? "") + "\" ....");

            while (!LicenseClient.AuthCompleted)
            {
                LicenseClient.ExchangeAuth();

                Thread.Sleep(1111);
            }

            var AuthResult = LicenseClient?.ExchangeAuthLast?.Value?.Response;

            var LicenseServerSessionId = AuthResult?.SessionId;

            Console.WriteLine("Auth completed, SessionId = " + (LicenseServerSessionId ?? "null"));

            Console.WriteLine("\nstarting to set up the sensor and read from memory.\nthe initial measurement takes longer.");

            var SensorAppManager = new BotEngine.Interface.InterfaceAppManager();

            var SensorServerHub = new SimpleSensorServerDispatcher()
            {
                SensorAppManager = SensorAppManager, LicenseClient = LicenseClient
            };

            BotEngine.Interface.FromProcessMeasurement <IMemoryMeasurement> MeasurementMemoryReceivedLast = null;

            while (true)
            {
                try
                {
                    //	Limit the frequency of measurements.
                    var RequestedMeasurementTime =
                        (MeasurementMemoryReceivedLast?.Begin + MeasurementTimeDistanceMin) ??
                        Bib3.Glob.StopwatchZaitMiliSictInt();

                    //	not specifying a subset to read, the sensor will simply read all available (types in MemoryStruct namespace) structures from memory.
                    SensorServerHub.Exchange(
                        Config.EveOnlineClientProcessId,
                        RequestedMeasurementTime,
                        Measurement =>
                    {
                        MeasurementMemoryReceivedLast = Measurement;
                        MeasurementReceived(Measurement);
                    });
                }
                finally
                {
                    Thread.Sleep(250);
                }
            }
        }
示例#3
0
		static void SampleRun()
		{
			Console.WriteLine("this Programm reads the memory of the eve online client process.");
			Console.WriteLine("start an eve online client and login to your account. Then press any key to continue.\n");
            Console.ReadKey();

			var Config = Extension.ConfigReadFromConsole();

			if (null == Config)
			{
				Console.WriteLine("reading config failed.");
				return;
			}

			var LicenseClient = new BotEngine.Interface.LicenseClient() { ServerAddress = Config.LicenseServerAddress, LicenseKey = Config.LicenseKey };

			Console.WriteLine();
			Console.WriteLine("connecting to " + (LicenseClient?.ServerAddress ?? "") + " using Key \"" + (LicenseClient?.LicenseKey ?? "") + "\" ....");

			while (!LicenseClient.AuthCompleted)
			{
				LicenseClient.ExchangeAuth();

				Thread.Sleep(1111);
			}

			var AuthResult = LicenseClient?.ExchangeAuthLast?.Value?.Response;

			var LicenseServerSessionId = AuthResult?.SessionId;

			Console.WriteLine("Auth completed, SessionId = " + (LicenseServerSessionId ?? "null"));

			Console.WriteLine("\nstarting to set up the sensor and read from memory.\nthe initial measurement takes longer.");

			var SensorAppManager = new BotEngine.Interface.InterfaceAppManager();

			var SensorServerHub = new SimpleSensorServerDispatcher() { SensorAppManager = SensorAppManager, LicenseClient = LicenseClient };

			BotEngine.Interface.FromProcessMeasurement<IMemoryMeasurement> MeasurementMemoryReceivedLast = null;

			while (true)
			{
				try
				{
					//	Limit the frequency of measurements.
					var RequestedMeasurementTime =
						(MeasurementMemoryReceivedLast?.Begin + MeasurementTimeDistanceMin) ??
						Bib3.Glob.StopwatchZaitMiliSictInt();

					//	not specifying a subset to read, the sensor will simply read all available (types in MemoryStruct namespace) structures from memory.
					SensorServerHub.Exchange(
						Config.EveOnlineClientProcessId,
						RequestedMeasurementTime,
						Measurement =>
						{
							MeasurementMemoryReceivedLast = Measurement;
							MeasurementReceived(Measurement);
						});
				}
				finally
				{
					Thread.Sleep(250);
				}
			}
		}