예제 #1
0
        private void DutyStateChangedHandler(bool on_duty)
        {
            Globals.IsPlayerOnDuty = on_duty;

            if (on_duty)
            {
                Function.MonitorAICalls();
                Function.CheckForUpdates();
                CheckIfCalloutActiveFiber.Resume();
                DetectOpenSimpleNotepadFiber.Resume();
                DetectOpenCloseRequestedFiber.Resume();
                Function.LogDebug("Successfully loaded LSPDFR Computer+.");

                if (Function.IsAlprPlusRunning())
                {
                    Function.LogDebug("C+: Registering for ALPR+ Events");
                    ALPRPlusFunctions.OnAlprPlusMessage += ALPRPlusFunctions_OnAlprPlusMessage;
                    ALPRPlusFunctions.RegisterForEvents();
                }
                else
                {
                    Function.LogDebug("C+: ALPR+ Not Detected");
                }
            }
            else
            {
                if (Function.IsAlprPlusRunning())
                {
                    ALPRPlusFunctions.OnAlprPlusMessage -= ALPRPlusFunctions_OnAlprPlusMessage;
                }
            }
        }
예제 #2
0
파일: Main.cs 프로젝트: iPeer/AlfredoRedux
 private void OnOnDutyStateChanged(bool onDuty)
 {
     IS_ON_DUTY = onDuty;
     if (onDuty)
     {
         CheckThread.Resume();
         if (ApplyOnGoOnDuty)
         {
             DoMagic();
         }
     }
 }
예제 #3
0
        private void DutyStateChangedHandler(bool on_duty)
        {
            Globals.IsPlayerOnDuty = on_duty;

            if (on_duty)
            {
                XmlConfigs.ReadDefinitionsAndGlobalize();
                Function.MonitorAICalls();
                Function.CheckForUpdates();
                CheckIfCalloutActiveFiber.Resume();
                DetectOpenSimpleNotepadFiber.Resume();
                DetectOpenCPlusOnFootFiber.Resume();
                DetectOpenCloseRequestedFiber.Resume();
                Function.LogDebug("Successfully loaded LSPDFR Computer+.");
                InitStorage();
                if (Function.IsAlprPlusRunning())
                {
                    Function.LogDebug("C+: Registering for ALPR+ Events");
                    ALPRPlusFunctions.OnAlprPlusMessage += ALPRPlusFunctions_OnAlprPlusMessage;
                    ALPRPlusFunctions.RegisterForEvents();
                }
                else
                {
                    Function.LogDebug("C+: ALPR+ Not Detected");
                }
                if (Function.IsBPSRunning())
                {
                    // @TODO put this back once Albo tests integration
                    //ComputerPlusEntity.PersonaType = PersonaTypes.BPS;
                }
            }
            else
            {
                if (Function.IsAlprPlusRunning())
                {
                    ALPRPlusFunctions.OnAlprPlusMessage -= ALPRPlusFunctions_OnAlprPlusMessage;
                }
            }
        }