Esempio n. 1
0
    public bool TriggerWeakGuide(uint mainLineId, uint startIndex = 1u)
    {
        NewbieWeakGuideMainLineConf newbieWeakGuideMainLineConf = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieWeakGuideMainLineConf(mainLineId);

        int num;

        if (this.mWeakGuideTriggerTime.TryGetValue(newbieWeakGuideMainLineConf.dwID, ref num) && CRoleInfo.GetCurrentUTCTime() - num < (int)newbieWeakGuideMainLineConf.bCDTime)
        {
            return(true);
        }
        if (this.isGuiding)
        {
            this.RemoveAllEffect();
        }
        this.clear();
        this.curWeakMainLineConf = newbieWeakGuideMainLineConf;
        this.isGuiding           = true;
        this.mConfList           = Singleton <NewbieGuideDataManager> .GetInstance().GetWeakScriptList(mainLineId);

        this.m_CurStep = startIndex;
        this.OpenGuideForm();
        if (this.mConfList == null && this.curWeakMainLineConf != null)
        {
            this.CompleteAll();
        }
        else
        {
            this.CheckNext();
            this.mWeakGuideTriggerTime.set_Item(mainLineId, CRoleInfo.GetCurrentUTCTime());
        }
        return(true);
    }
    public void ForceSetWeakGuideCompleteAll(bool bReset, bool setOldPlayerBit = false, bool sync = true)
    {
        List <uint> list = new List <uint>();

        Dictionary <uint, bool> .KeyCollection.Enumerator enumerator = this.mWeakCompleteCacheDic.get_Keys().GetEnumerator();
        while (enumerator.MoveNext())
        {
            uint current = enumerator.get_Current();
            if (!this.mWeakCompleteCacheDic.get_Item(current))
            {
                NewbieWeakGuideMainLineConf newbieWeakGuideMainLineConf = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieWeakGuideMainLineConf(current);

                if (newbieWeakGuideMainLineConf != null && newbieWeakGuideMainLineConf.bOnlyOnce == 1 && newbieWeakGuideMainLineConf.bOldPlayerGuide != 1)
                {
                    list.Add(newbieWeakGuideMainLineConf.dwID);
                }
                if (setOldPlayerBit && newbieWeakGuideMainLineConf != null && newbieWeakGuideMainLineConf.bOldPlayerGuide == 1)
                {
                    list.Add(newbieWeakGuideMainLineConf.dwID);
                }
            }
        }
        for (int i = 0; i < list.get_Count(); i++)
        {
            MonoSingleton <NewbieGuideManager> .GetInstance().SetWeakGuideComplete(list.get_Item(i), bReset, sync);
        }
    }
 public bool TriggerWeakNewbieGuide(NewbieWeakGuideMainLineConf conf, NewbieGuideTriggerTimeType type, bool checkCondition)
 {
     if (conf != null && !this.IsWeakLineComplete(conf.dwID) && !Singleton <WatchController> .get_instance().IsWatching&& (!checkCondition || (this.CheckLevelLimit(conf) && this.CheckLevelLimitLower(conf) && this.CheckTriggerCondition(0u, conf.astTriggerCondition))))
     {
         uint weakStartIndexByMianLineConf = this.GetWeakStartIndexByMianLineConf(type, conf);
         return(this.TriggerWeakNewbieGuide(conf.dwID, weakStartIndexByMianLineConf));
     }
     return(false);
 }
    private bool CheckLevelLimitLower(NewbieWeakGuideMainLineConf conf)
    {
        if (conf.wTriggerLevelLowerLimit == 0)
        {
            return(true);
        }
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

        return(masterRoleInfo == null || masterRoleInfo.PvpLevel >= (uint)conf.wTriggerLevelLowerLimit);
    }
Esempio n. 5
0
    public bool TriggerWeakNewbieGuide(NewbieWeakGuideMainLineConf conf, NewbieGuideTriggerTimeType type, bool checkCondition)
    {
        if ((((conf == null) || this.IsWeakLineComplete(conf.dwID)) || Singleton <WatchController> .instance.IsWatching) || (checkCondition && ((!this.CheckLevelLimit(conf) || !this.CheckLevelLimitLower(conf)) || !this.CheckTriggerCondition(0, conf.astTriggerCondition))))
        {
            return(false);
        }
        uint weakStartIndexByMianLineConf = this.GetWeakStartIndexByMianLineConf(type, conf);

        return(this.TriggerWeakNewbieGuide(conf.dwID, weakStartIndexByMianLineConf));
    }
Esempio n. 6
0
 private bool SortWeakMianLineConf(NewbieWeakGuideMainLineConf confA, NewbieWeakGuideMainLineConf confB)
 {
     if (confA.dwPriority > confB.dwPriority)
     {
         return(false);
     }
     if ((confA.dwPriority >= confB.dwPriority) && (confA.dwID < confB.dwID))
     {
         return(false);
     }
     return(true);
 }
Esempio n. 7
0
    public List <uint> GetWeakMianLineIDList()
    {
        List <uint> list   = new List <uint>();
        int         length = this.mWeakMainLineCacheArr.Length;

        for (int i = 0; i < length; i++)
        {
            NewbieWeakGuideMainLineConf conf = this.mWeakMainLineCacheArr[i];
            list.Add(conf.dwID);
        }
        return(list);
    }
Esempio n. 8
0
    private bool CheckLevelLimit(NewbieWeakGuideMainLineConf conf)
    {
        if (conf.wTriggerLevelUpperLimit != 0)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                return(masterRoleInfo.PvpLevel <= conf.wTriggerLevelUpperLimit);
            }
        }
        return(true);
    }
Esempio n. 9
0
    public NewbieWeakGuideMainLineConf GetNewbieWeakGuideMainLineConf(uint id)
    {
        int length = this.mWeakMainLineCacheArr.Length;

        for (int i = 0; i < length; i++)
        {
            NewbieWeakGuideMainLineConf conf = this.mWeakMainLineCacheArr[i];
            if (conf.dwID == id)
            {
                return(conf);
            }
        }
        return(null);
    }
Esempio n. 10
0
    public bool IsContainsSkipConditionType(NewbieWeakGuideMainLineConf conf, NewbieGuideSkipConditionType type, uint[] param)
    {
        int length = conf.astSkipCondition.Length;

        for (int i = 0; i < length; i++)
        {
            NewbieGuideSkipConditionItem item = conf.astSkipCondition[i];
            if ((((NewbieGuideSkipConditionType)item.wType) == type) && NewbieGuideCheckSkipConditionUtil.CheckSkipCondition(item, param))
            {
                return(true);
            }
        }
        return(false);
    }
Esempio n. 11
0
    public bool IsContainsTriggerTimeType(NewbieWeakGuideMainLineConf conf, NewbieGuideTriggerTimeType type, uint[] param)
    {
        int num = conf.astTriggerTime.Length;

        for (int i = 0; i < num; i++)
        {
            NewbieGuideTriggerTimeItem newbieGuideTriggerTimeItem = conf.astTriggerTime[i];
            if (type == (NewbieGuideTriggerTimeType)newbieGuideTriggerTimeItem.wType && NewbieGuideCheckTriggerTimeUtil.CheckTriggerTime(newbieGuideTriggerTimeItem, param))
            {
                return(true);
            }
        }
        return(false);
    }
Esempio n. 12
0
    public bool IsContainsTriggerTimeType(NewbieWeakGuideMainLineConf conf, NewbieGuideTriggerTimeType type, uint[] param)
    {
        int length = conf.astTriggerTime.Length;

        for (int i = 0; i < length; i++)
        {
            NewbieGuideTriggerTimeItem time = conf.astTriggerTime[i];
            if ((type == ((NewbieGuideTriggerTimeType)time.wType)) && NewbieGuideCheckTriggerTimeUtil.CheckTriggerTime(time, param))
            {
                return(true);
            }
        }
        return(false);
    }
Esempio n. 13
0
 private void SortWeakMainLineList(NewbieWeakGuideMainLineConf[] list)
 {
     for (int i = 1; i < list.Length; i++)
     {
         NewbieWeakGuideMainLineConf confB = list[i];
         int index = i;
         while ((index > 0) && this.SortWeakMianLineConf(list[index - 1], confB))
         {
             list[index] = list[index - 1];
             index--;
         }
         list[index] = confB;
     }
 }
Esempio n. 14
0
 private void SortWeakMainLineList(NewbieWeakGuideMainLineConf[] list)
 {
     for (int i = 1; i < list.Length; i++)
     {
         NewbieWeakGuideMainLineConf newbieWeakGuideMainLineConf = list[i];
         int num = i;
         while (num > 0 && this.SortWeakMianLineConf(list[num - 1], newbieWeakGuideMainLineConf))
         {
             list[num] = list[num - 1];
             num--;
         }
         list[num] = newbieWeakGuideMainLineConf;
     }
 }
Esempio n. 15
0
    private uint GetWeakStartIndexByMianLineConf(NewbieGuideTriggerTimeType type, NewbieWeakGuideMainLineConf conf)
    {
        uint dwStartIndex = 1;
        int  length       = conf.astTriggerTime.Length;

        for (int i = 0; i < length; i++)
        {
            NewbieGuideTriggerTimeItem item = conf.astTriggerTime[i];
            if ((((NewbieGuideTriggerTimeType)item.wType) == type) && (item.dwStartIndex > 0))
            {
                dwStartIndex = item.dwStartIndex;
            }
        }
        return(dwStartIndex);
    }
Esempio n. 16
0
    private uint GetWeakStartIndexByMianLineConf(NewbieGuideTriggerTimeType type, NewbieWeakGuideMainLineConf conf)
    {
        uint result = 1u;
        int  num    = conf.astTriggerTime.Length;

        for (int i = 0; i < num; i++)
        {
            NewbieGuideTriggerTimeItem newbieGuideTriggerTimeItem = conf.astTriggerTime[i];
            if ((NewbieGuideTriggerTimeType)newbieGuideTriggerTimeItem.wType == type && newbieGuideTriggerTimeItem.dwStartIndex > 0u)
            {
                result = newbieGuideTriggerTimeItem.dwStartIndex;
            }
        }
        return(result);
    }
Esempio n. 17
0
    public ListView <NewbieWeakGuideMainLineConf> GetNewBieGuideWeakMainLineConfListByTiggerTimeType(NewbieGuideTriggerTimeType type, uint[] param)
    {
        this.mCacheWeakSourceList.Clear();
        this.mCacheWeakSourceList.AddRange(this.mWeakMainLineCacheArr);
        this.mCacheWeakTargetList.Clear();
        int count = this.mCacheWeakSourceList.Count;

        for (int i = 0; i < count; i++)
        {
            NewbieWeakGuideMainLineConf conf = this.mCacheWeakSourceList[i];
            if (this.IsContainsTriggerTimeType(conf, type, param))
            {
                this.mCacheWeakTargetList.Add(conf);
            }
        }
        return(this.mCacheWeakTargetList);
    }
Esempio n. 18
0
    public bool CheckTriggerTime(NewbieGuideTriggerTimeType type, params uint[] param)
    {
        if (!this.newbieGuideEnable)
        {
            return(false);
        }
        if (!this.m_IsCheckSkip)
        {
            return(false);
        }
        if (this.currentNewbieGuideId == 0u)
        {
            ListView <NewbieGuideMainLineConf> newbieGuideMainLineConfListByTriggerTimeType = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideMainLineConfListByTriggerTimeType(type, param);

            int count = newbieGuideMainLineConfListByTriggerTimeType.get_Count();
            for (int i = 0; i < count; i++)
            {
                NewbieGuideMainLineConf conf = newbieGuideMainLineConfListByTriggerTimeType.get_Item(i);
                if (this.CheckTrigger(type, conf))
                {
                    if (Singleton <NewbieWeakGuideControl> .get_instance().isGuiding)
                    {
                        Singleton <NewbieWeakGuideControl> .get_instance().RemoveAllEffect();
                    }
                    return(true);
                }
            }
            ListView <NewbieWeakGuideMainLineConf> newBieGuideWeakMainLineConfListByTiggerTimeType = Singleton <NewbieGuideDataManager> .GetInstance().GetNewBieGuideWeakMainLineConfListByTiggerTimeType(type, param);

            count = newBieGuideWeakMainLineConfListByTiggerTimeType.get_Count();
            for (int j = 0; j < count; j++)
            {
                NewbieWeakGuideMainLineConf conf2 = newBieGuideWeakMainLineConfListByTiggerTimeType.get_Item(j);
                if (this.TriggerWeakNewbieGuide(conf2, type, true))
                {
                    return(true);
                }
            }
        }
        return(false);
    }
Esempio n. 19
0
    public ListView <NewbieWeakGuideMainLineConf> GetNewbieGuideWeakMianLineConfListBySkipType(NewbieGuideSkipConditionType type)
    {
        this.mCacheWeakSourceList.Clear();
        this.mCacheWeakSourceList.AddRange(this.mWeakMainLineCacheArr);
        ListView <NewbieWeakGuideMainLineConf> listView = new ListView <NewbieWeakGuideMainLineConf>();
        int count = this.mCacheWeakSourceList.get_Count();

        for (int i = 0; i < count; i++)
        {
            NewbieWeakGuideMainLineConf newbieWeakGuideMainLineConf = this.mCacheWeakSourceList.get_Item(i);
            for (int j = 0; j < newbieWeakGuideMainLineConf.astSkipCondition.Length; j++)
            {
                if ((NewbieGuideSkipConditionType)newbieWeakGuideMainLineConf.astSkipCondition[j].wType == type)
                {
                    listView.Add(newbieWeakGuideMainLineConf);
                    break;
                }
            }
        }
        return(listView);
    }
Esempio n. 20
0
    public ListView <NewbieWeakGuideMainLineConf> GetNewbieGuideWeakMianLineConfListBySkipType(NewbieGuideSkipConditionType type)
    {
        this.mCacheWeakSourceList.Clear();
        this.mCacheWeakSourceList.AddRange(this.mWeakMainLineCacheArr);
        ListView <NewbieWeakGuideMainLineConf> view = new ListView <NewbieWeakGuideMainLineConf>();
        int count = this.mCacheWeakSourceList.Count;

        for (int i = 0; i < count; i++)
        {
            NewbieWeakGuideMainLineConf item = this.mCacheWeakSourceList[i];
            for (int j = 0; j < item.astSkipCondition.Length; j++)
            {
                if (((NewbieGuideSkipConditionType)item.astSkipCondition[j].wType) == type)
                {
                    view.Add(item);
                    break;
                }
            }
        }
        return(view);
    }
Esempio n. 21
0
    public void ForceSetWeakGuideCompleteAll(bool bReset)
    {
        List <uint> list = new List <uint>();

        Dictionary <uint, bool> .KeyCollection.Enumerator enumerator = this.mWeakCompleteCacheDic.Keys.GetEnumerator();
        while (enumerator.MoveNext())
        {
            uint current = enumerator.Current;
            if (!this.mWeakCompleteCacheDic[current])
            {
                NewbieWeakGuideMainLineConf newbieWeakGuideMainLineConf = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieWeakGuideMainLineConf(current);

                if (((newbieWeakGuideMainLineConf != null) && (newbieWeakGuideMainLineConf.bOnlyOnce == 1)) && (newbieWeakGuideMainLineConf.bOldPlayerGuide != 1))
                {
                    list.Add(newbieWeakGuideMainLineConf.dwID);
                }
            }
        }
        for (int i = 0; i < list.Count; i++)
        {
            MonoSingleton <NewbieGuideManager> .GetInstance().SetWeakGuideComplete(list[i], bReset);
        }
    }
Esempio n. 22
0
    private void CheckWeakSkipCondition(NewbieGuideSkipConditionType type, params uint[] param)
    {
        ListView <NewbieWeakGuideMainLineConf> newbieGuideWeakMianLineConfListBySkipType = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideWeakMianLineConfListBySkipType(type);

        int count = newbieGuideWeakMianLineConfListBySkipType.Count;

        for (int i = 0; i < count; i++)
        {
            NewbieWeakGuideMainLineConf conf = newbieGuideWeakMianLineConfListBySkipType[i];
            if (!this.IsWeakLineComplete(conf.dwID))
            {
                for (int j = 0; j < conf.astSkipCondition.Length; j++)
                {
                    NewbieGuideSkipConditionItem item = conf.astSkipCondition[j];
                    if ((((NewbieGuideSkipConditionType)item.wType) == type) && NewbieGuideCheckSkipConditionUtil.CheckSkipCondition(item, param))
                    {
                        this.SetWeakGuideComplete(conf.dwID, true);
                        break;
                    }
                }
            }
        }
    }
Esempio n. 23
0
    public bool TriggerWeakGuide(uint mainLineId, uint startIndex = 1)
    {
        if (this.isGuiding)
        {
            this.RemoveAllEffect();
        }
        this.clear();
        this.curWeakMainLineConf = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieWeakGuideMainLineConf(mainLineId);

        this.isGuiding = true;
        this.mConfList = Singleton <NewbieGuideDataManager> .GetInstance().GetWeakScriptList(mainLineId);

        this.m_CurStep = startIndex;
        this.OpenGuideForm();
        if ((this.mConfList == null) && (this.curWeakMainLineConf != null))
        {
            this.CompleteAll();
        }
        else
        {
            this.CheckNext();
        }
        return(true);
    }
Esempio n. 24
0
 private bool SortWeakMianLineConf(NewbieWeakGuideMainLineConf confA, NewbieWeakGuideMainLineConf confB)
 {
     return(confA.dwPriority <= confB.dwPriority && (confA.dwPriority < confB.dwPriority || confA.dwID >= confB.dwID));
 }
Esempio n. 25
0
 private bool CheckTriggerTime(NewbieWeakGuideMainLineConf conf)
 {
     return(!this.IsWeakLineComplete(conf.dwID) && (this.CheckLevelLimit(conf) && this.CheckLevelLimitLower(conf)));
 }
Esempio n. 26
0
 private void clear()
 {
     this.curWeakMainLineConf = null;
     this.isGuiding           = false;
     this.mToaddConfList.Clear();
 }