fBaseXtensions.Game.Profile.CheckCurrentProfileBehavior C# (CSharp) Method

CheckCurrentProfileBehavior() private method

Tracks Current Profile Behavior and sets IsRunningOOCBehavior depending on the current Type of behavior.
private CheckCurrentProfileBehavior ( bool forceUpdate = false ) : void
forceUpdate bool
return void
        internal void CheckCurrentProfileBehavior(bool forceUpdate=false)
        {
            if (forceUpdate || DateTime.Now.Subtract(LastProfileBehaviorCheck).TotalMilliseconds > 250)
            {
                LastProfileBehaviorCheck = DateTime.Now;

                if ((currentProfileBehavior == null && ProfileManager.CurrentProfileBehavior != null && ProfileManager.CurrentProfileBehavior.Behavior != null)
                     || (ProfileManager.CurrentProfileBehavior != null && ProfileManager.CurrentProfileBehavior.Behavior != null && currentProfileBehavior != null && currentProfileBehavior.Behavior.Guid != ProfileManager.CurrentProfileBehavior.Behavior.Guid))
                {
                    currentProfileBehavior = ProfileManager.CurrentProfileBehavior;
                    Logger.Write(LogLevel.Event, "Profile Behavior Changed To {0} [{1}]", currentProfileBehavior.GetType().ToString(), currentProfileBehavior.StatusText);

                    Type profileTagType = currentProfileBehavior.GetType();

                    PreviousProfileBehaviorType = CurrentProfileBehaviorType;
                    CurrentProfileBehaviorType = GetProfileBehaviorType(profileTagType);

                    if (OnProfileBehaviorChange != null)
                        OnProfileBehaviorChange(CurrentProfileBehaviorType);
                }
            }
        }