GetInstance() public static méthode

public static GetInstance ( ) : Singleton,
Résultat Singleton,
Exemple #1
0
        public override void OnUpdate(float elapseSeconds, float realElapseSeconds)
        {
            base.OnUpdate(elapseSeconds, realElapseSeconds);
            if (loadSceneComplete)
            {
                return;
            }
            if (null != loadingBarAsyncOperation)
            {
                sceneLoadingProgress?.Invoke(0.0f);
                if (loadingBarAsyncOperation.isDone)
                {
                    loadingBarAsyncOperation = null;
                    sceneLoadingProgress?.Invoke(0.0f);
                    unloadAssetsAsyncOperation = Resources.UnloadUnusedAssets();
                }
            }
            else if (unloadAssetsAsyncOperation != null)
            {
                if (unloadAssetsAsyncOperation.isDone)
                {
                    unloadAssetsAsyncOperation = null;
                    Singleton <GameEntry> .GetInstance().GetComponent <ResourceComponent>().ClearMemory();

                    if (!AppConst.ResourceConfig.IsUseAssetBundle)
                    {
                        isBundleLoaded = true;
                    }
                    else
                    {
                        Singleton <GameEntry> .GetInstance().GetComponent <ResourceComponent>().RequestResource(GetSceneName(targetScene),
                                                                                                                (a, b) =>
                        {
                            isBundleLoaded = true;
                        }, enResourceLoadMode.Async, enResourceLoadCache.PermanentLoad);
                    }
                }
                else
                {
                    sceneLoadingProgress(0.0f + unloadAssetsAsyncOperation.progress * 0.15f);
                }
            }
            else if (isBundleLoaded)
            {
                loadingSceneAsyncOperation = SceneManager.LoadSceneAsync(GetSceneName(targetScene));
                loadingSceneAsyncOperation.allowSceneActivation = false;
                isBundleLoaded = false;
            }
            else if (null != loadingSceneAsyncOperation)
            {
                if (loadingSceneAsyncOperation.isDone)
                {
                    loadingSceneAsyncOperation.allowSceneActivation = true;
                    var obj = GameObject.Find("Scene");
                    if (obj)
                    {
                        obj.StaticBatching();
                    }
                    sceneLoadedCallback?.Invoke();
                    sceneLoadedCallback        = null;
                    loadingSceneAsyncOperation = null;
                    Singleton <GameEntry> .GetInstance().GetComponent <ResourceComponent>().UnloadLoadTypeResourceByName(enResourceLoadCache.PermanentLoad, GetSceneName(targetScene));
                }
                else
                {
                    sceneLoadingProgress(0.15f + loadingSceneAsyncOperation.progress * 0.85f);
                }
            }
        }
Exemple #2
0
        private void SpawnMonster(Action _action, ref PoolObjHandle <ActorRoot> tarActor)
        {
            SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");

            if (refParamObject == null || !refParamObject.Originator || refParamObject.Originator.get_handle().ActorControl == null)
            {
                DebugHelper.Assert(false, "Failed find orignal actor of this skill. action:{0}", new object[]
                {
                    _action.name
                });
                return;
            }
            if (refParamObject.Originator.get_handle().ActorControl.IsDeadState)
            {
                return;
            }
            DebugHelper.Assert(refParamObject.Originator.get_handle().ValueComponent != null, "ValueComponent is null");
            ResCallMonster dataByKey = GameDataMgr.callMonsterDatabin.GetDataByKey((long)this.ConfigID);

            DebugHelper.Assert(dataByKey != null, "Failed find call monster config id:{0} action:{1}", new object[]
            {
                this.ConfigID,
                _action.name
            });
            if (dataByKey == null)
            {
                return;
            }
            int num = Math.Min(CallMonsterTick.MaxLevel, this.SelectLevel(ref refParamObject.Originator, ref dataByKey, ref refParamObject));
            ResMonsterCfgInfo dataCfgInfo = MonsterDataHelper.GetDataCfgInfo((int)dataByKey.dwMonsterID, num);

            DebugHelper.Assert(dataCfgInfo != null, "Failed find monster id={0} diff={1} action:{2}", new object[]
            {
                dataByKey.dwMonsterID,
                num,
                _action.name
            });
            if (dataCfgInfo == null)
            {
                return;
            }
            string     text   = StringHelper.UTF8BytesToString(ref dataCfgInfo.szCharacterInfo) + ".asset";
            CActorInfo exists = Singleton <CResourceManager> .GetInstance().GetResource(text, typeof(CActorInfo), 0, false, false).m_content as CActorInfo;

            if (exists)
            {
                ActorMeta actorMeta  = default(ActorMeta);
                ActorMeta actorMeta2 = actorMeta;
                actorMeta2.ConfigId  = (int)dataByKey.dwMonsterID;
                actorMeta2.ActorType = ActorTypeDef.Actor_Type_Monster;
                actorMeta2.ActorCamp = this.SelectCamp(ref refParamObject.Originator);
                actorMeta2.EnCId     = (int)dataByKey.dwMonsterID;
                actorMeta2.Difficuty = (byte)num;
                actorMeta2.SkinID    = refParamObject.Originator.get_handle().TheActorMeta.SkinID;
                actorMeta            = actorMeta2;
                VInt3 location = tarActor.get_handle().location;
                VInt3 forward  = tarActor.get_handle().forward;
                if (!PathfindingUtility.IsValidTarget(refParamObject.Originator.get_handle(), location))
                {
                    location = refParamObject.Originator.get_handle().location;
                    forward  = refParamObject.Originator.get_handle().forward;
                }
                PoolObjHandle <ActorRoot> poolObjHandle = Singleton <GameObjMgr> .GetInstance().SpawnActorEx(null, ref actorMeta, location, forward, false, true);

                if (poolObjHandle)
                {
                    poolObjHandle.get_handle().InitActor();
                    this.ApplyMonsterAdditive(ref refParamObject.Originator, ref poolObjHandle, ref dataByKey);
                    MonsterWrapper monsterWrapper = poolObjHandle.get_handle().ActorControl as MonsterWrapper;
                    if (monsterWrapper != null)
                    {
                        monsterWrapper.SetHostActorInfo(ref refParamObject.Originator, refParamObject.SlotType, this.bCopyedHeroInfo);
                        if (this.wayPoint != null)
                        {
                            monsterWrapper.AttackAlongRoute(this.wayPoint.GetComponent <WaypointsHolder>());
                        }
                        if (this.LifeTime > 0)
                        {
                            monsterWrapper.LifeTime = this.LifeTime;
                        }
                    }
                    poolObjHandle.get_handle().PrepareFight();
                    Singleton <GameObjMgr> .get_instance().AddActor(poolObjHandle);

                    poolObjHandle.get_handle().StartFight();
                    poolObjHandle.get_handle().ObjLinker.Invincible = this.Invincible;
                    poolObjHandle.get_handle().ObjLinker.CanMovable = this.Moveable;
                    poolObjHandle.get_handle().Visible = refParamObject.Originator.get_handle().Visible;
                    poolObjHandle.get_handle().ValueComponent.actorSoulLevel = refParamObject.Originator.get_handle().ValueComponent.actorSoulLevel;
                    refParamObject.Originator.get_handle().ValueComponent.AddSoulExp(0, false, AddSoulType.Other);
                }
            }
        }
Exemple #3
0
        public static void SendQuerySymbol()
        {
            CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x46c);

            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, true);
        }
Exemple #4
0
 static public CommonCanvasManager GetInstance( )
 {
     return(Singleton <CommonCanvasManager> .GetInstance());
 }
Exemple #5
0
        public void UpdateLogic(int delta)
        {
            this.m_frameTimer += (uint)delta;
            if (((this.dynamicPropertyConfig != 0) && (this._updateDatabin != null)) && (this._updateDatabin.ContainsKey(this.dynamicPropertyConfig) && Singleton <BattleLogic> .GetInstance().isFighting))
            {
                UpdatePropertyList list = this._updateDatabin[this.dynamicPropertyConfig];
                for (int i = 0; i < list.propertyList.Count; i++)
                {
                    ResBattleDynamicProperty property = (ResBattleDynamicProperty)list.propertyList[i];
                    ulong logicFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

                    if ((logicFrameTick < property.dwVarPara1) || (i == (list.propertyList.Count - 1)))
                    {
                        list.deltaTime     += (uint)(logicFrameTick - this.lastSystemTime);
                        this.lastSystemTime = logicFrameTick;
                        if (list.deltaTime >= property.dwVarPara2)
                        {
                            list.deltaTime -= property.dwVarPara2;
                            this.UpdateActorProperty(ref property);
                        }
                        return;
                    }
                }
            }
        }
        public override void BuildGameContext(ProtocolObject svrInfo)
        {
            SCPKG_STARTSINGLEGAMERSP svrGameInfo = (SCPKG_STARTSINGLEGAMERSP)svrInfo;

            Singleton <GameContextEx> .GetInstance().InitSingleGame(svrGameInfo);
        }
    public static bool CheckSkipCondition(NewbieGuideSkipConditionItem item, uint[] param)
    {
        switch (item.wType)
        {
        case 1:
        {
            bool result = false;
            if (param != null && param.Length > 0)
            {
                if (param[0] == item.Param[0])
                {
                    result = Singleton <CAdventureSys> .GetInstance().IsLevelFinished((int)param[0]);
                }
            }
            else
            {
                result = Singleton <CAdventureSys> .GetInstance().IsLevelFinished((int)item.Param[0]);
            }
            return(result);
        }

        case 2:
            return(MonoSingleton <NewbieGuideManager> .GetInstance().IsNewbieGuideComplete(item.Param[0]));

        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
        case 11:
        case 12:
        case 13:
        case 14:
        case 15:
        case 16:
        case 17:
        case 18:
        case 19:
        case 20:
        case 21:
        case 22:
        case 23:
        case 24:
        case 31:
        case 32:
        case 33:
        case 34:
        case 35:
        case 36:
        case 37:
        case 38:
        case 40:
        case 41:
        case 45:
        case 46:
        case 47:
        case 48:
        case 51:
        {
            int num = NewbieGuideCheckSkipConditionUtil.TranslateFromSkipCond((NewbieGuideSkipConditionType)item.wType);
            return(num == -1 || Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(num));
        }

        case 30:
            return(MonoSingleton <NewbieGuideManager> .GetInstance().IsNewbieBitSet((int)item.Param[0]));

        case 42:
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM);
                if (useableContainer != null)
                {
                    int useableStackCount = useableContainer.GetUseableStackCount(COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL, item.Param[0]);
                    return(useableStackCount >= 2);
                }
            }
            return(false);
        }

        case 43:
        {
            int num2 = NewbieGuideCheckSkipConditionUtil.TranslateFromSkipCond((NewbieGuideSkipConditionType)item.wType);
            if (num2 == -1)
            {
                return(true);
            }
            if (item.Param[0] == 0u)
            {
                return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(num2));
            }
            return(!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(num2));
        }

        case 44:
        {
            CRoleInfo masterRoleInfo2 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo2.IsNewbieAchieveSet((int)(item.Param[0] + (uint)NewbieGuideManager.WEAKGUIDE_BIT_OFFSET)));
        }

        case 49:
        {
            CRoleInfo masterRoleInfo3 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo3 == null)
            {
                return(false);
            }
            bool flag      = masterRoleInfo3.IsGuidedStateSet(89);
            bool flag2     = masterRoleInfo3.IsGuidedStateSet(90);
            bool arg_258_0 = flag || flag2;
            return(masterRoleInfo3.IsGuidedStateSet(89) || masterRoleInfo3.IsGuidedStateSet(90));
        }
        }
        return(true);
    }
Exemple #8
0
        public void ConvertServerDetailData(CSDT_ACNT_DETAIL_INFO detailInfo)
        {
            this._doubleKillCount  = 0;
            this._trippleKillCount = 0;
            this._quataryKillCount = 0;
            this._pentaKillCount   = 0;
            this._holyShitCount    = 0;
            this._mvpCnt           = 0;
            this._loseMvpCount     = 0;
            if (detailInfo != null)
            {
                this._playerName = StringHelper.UTF8BytesToString(ref detailInfo.szAcntName);
                this.m_uuid      = detailInfo.ullUid;
                this.m_vipInfo   = new SCPKG_GAME_VIP_NTF();
                this.m_vipInfo.stGameVipClient = detailInfo.stGameVip;
                this._playerHeadUrl            = Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(ref detailInfo.szOpenUrl);

                this._playerLevel = detailInfo.dwLevel;
                ResAcntExpInfo dataByKey = GameDataMgr.acntExpDatabin.GetDataByKey(this._playerLevel);
                this._playerNeedExp      = dataByKey.dwNeedExp;
                this._playerExp          = detailInfo.dwExp;
                this._power              = detailInfo.dwPower;
                this._pvpLevel           = detailInfo.dwPvpLevel;
                this._playerPvpExp       = detailInfo.dwPvpExp;
                this._gender             = (COM_SNSGENDER)detailInfo.bGender;
                this._privilegeType      = (COM_PRIVILEGE_TYPE)detailInfo.bPrivilege;
                this._gradeOfRank        = detailInfo.bGradeOfRank;
                this._highestGradeOfRank = detailInfo.bMaxGradeOfRank;
                this.GuildName           = StringHelper.UTF8BytesToString(ref detailInfo.stGuildInfo.szGuildName);
                this.GuildState          = (COM_PLAYER_GUILD_STATE)detailInfo.stGuildInfo.bGuildState;
                this.qqVipMask           = detailInfo.dwQQVIPMask;
                for (int i = 0; i < detailInfo.stStatistic.stKVDetail.dwNum; i++)
                {
                    COMDT_STATISTIC_KEY_VALUE_INFO comdt_statistic_key_value_info = detailInfo.stStatistic.stKVDetail.astKVDetail[i];
                    switch (((RES_STATISTIC_SETTLE_DATA_TYPE)comdt_statistic_key_value_info.dwKey))
                    {
                    case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_MVP_CNT:
                        this._mvpCnt = (int)comdt_statistic_key_value_info.dwValue;
                        break;

                    case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_LOSE_SOUL:
                        this._loseMvpCount = (int)comdt_statistic_key_value_info.dwValue;
                        break;

                    case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_GODLIKE_CNT:
                        this._holyShitCount = (int)comdt_statistic_key_value_info.dwValue;
                        break;

                    case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_DOUBLE_KILL_CNT:
                        this._doubleKillCount = (int)comdt_statistic_key_value_info.dwValue;
                        break;

                    case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_TRIPLE_KILL_CNT:
                        this._trippleKillCount = (int)comdt_statistic_key_value_info.dwValue;
                        break;

                    case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_QUATARY_KILL_CNT:
                        this._quataryKillCount = (int)comdt_statistic_key_value_info.dwValue;
                        break;

                    case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_PENTA_KILL_CNT:
                        this._pentaKillCount = (int)comdt_statistic_key_value_info.dwValue;
                        break;
                    }
                }
                this._5V5TotalCount           = (int)detailInfo.stStatistic.stFiveVsFiveInfo.dwTotalNum;
                this._5V5WinCount             = (int)detailInfo.stStatistic.stFiveVsFiveInfo.dwWinNum;
                this._3V3TotalCount           = (int)detailInfo.stStatistic.stThreeVsThreeInfo.dwTotalNum;
                this._3V3WinCount             = (int)detailInfo.stStatistic.stThreeVsThreeInfo.dwWinNum;
                this._2V2TotalCount           = (int)detailInfo.stStatistic.stTwoVsTwoInfo.dwTotalNum;
                this._2V2WinCount             = (int)detailInfo.stStatistic.stTwoVsTwoInfo.dwWinNum;
                this._1V1TotalCount           = (int)detailInfo.stStatistic.stOneVsOneInfo.dwTotalNum;
                this._1V1WinCount             = (int)detailInfo.stStatistic.stOneVsOneInfo.dwWinNum;
                this._vsAiTotalCount          = (int)detailInfo.stStatistic.stVsMachineInfo.dwTotalNum;
                this._vsAiWinCount            = (int)detailInfo.stStatistic.stVsMachineInfo.dwWinNum;
                this._rankTotalCount          = (int)detailInfo.stStatistic.stLadderInfo.dwTotalNum;
                this._rankWinCount            = (int)detailInfo.stStatistic.stLadderInfo.dwWinNum;
                this._entertainmentTotalCount = (int)detailInfo.stStatistic.stEntertainmentInfo.dwTotalNum;
                this._entertainmentWinCount   = (int)detailInfo.stStatistic.stEntertainmentInfo.dwWinNum;
                this._heroCnt  = (int)detailInfo.stMostUsedHero.dwTotalHeroNum;
                this._skinCnt  = (int)detailInfo.stMostUsedHero.dwTotalSkinNum;
                this._isOnLine = detailInfo.bIsOnline != 0;
                if (this._mostUsedHeroList == null)
                {
                    this._mostUsedHeroList = new ListView <COMDT_MOST_USED_HERO_INFO>();
                }
                else
                {
                    this._mostUsedHeroList.Clear();
                }
                int num2 = (int)Mathf.Min((float)detailInfo.stMostUsedHero.dwHeroNum, (float)detailInfo.stMostUsedHero.astHeroInfoList.Length);
                for (int j = 0; j < num2; j++)
                {
                    this._mostUsedHeroList.Add(detailInfo.stMostUsedHero.astHeroInfoList[j]);
                }
                this.SortMostUsedHeroList();
            }
        }
Exemple #9
0
        public void ChangeSkillIcon(int skillID)
        {
            ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey((long)skillID);

            if (dataByKey != null)
            {
                GameObject skillImg = this.GetSkillImg();
                if (skillImg != null)
                {
                    Image component = skillImg.GetComponent <Image>();
                    if (component != null)
                    {
                        component.SetSprite(CUIUtility.s_Sprite_Dynamic_Skill_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szIconPath), Singleton <CBattleSystem> .GetInstance().FightFormScript, true, false, false, false);
                    }
                }
            }
        }
        public static void On_RESET_BURNING_PROGRESS_RSP(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            Singleton <EventRouter> .GetInstance().BroadCastEvent <CSPkg>("Burn_RESET_BURNING_PROGRESS_RSP", msg);
        }
        public static void Send_Get_BURNING_PROGRESS_REQ()
        {
            CSPkg msg = NetworkModule.CreateDefaultCSPKG(0xa8c);

            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, true);
        }
Exemple #12
0
        public void SetData(GameObject root, CUIFormScript formScript)
        {
            ResRandomRewardStore dataByKey = GameDataMgr.randowmRewardDB.GetDataByKey(0xa029);

            for (int i = 0; i < 3; i++)
            {
                string                 name        = string.Format("Panel/QQVip/AwardGrid/QQ/ListElement{0}/ItemCell", i);
                GameObject             gameObject  = root.transform.FindChild(name).gameObject;
                ResDT_RandomRewardInfo info        = dataByKey.astRewardDetail[i];
                CUseable               itemUseable = CUseableManager.CreateUsableByRandowReward((RES_RANDOM_REWARD_TYPE)info.bItemType, (int)info.dwLowCnt, info.dwItemID);
                if (itemUseable != null)
                {
                    if (gameObject.GetComponent <CUIEventScript>() == null)
                    {
                        gameObject.AddComponent <CUIEventScript>();
                    }
                    CUICommonSystem.SetItemCell(formScript, gameObject, itemUseable, true, false);
                }
            }
            ResRandomRewardStore store2 = GameDataMgr.randowmRewardDB.GetDataByKey(0xa02a);

            for (int j = 0; j < 3; j++)
            {
                string                 str2     = string.Format("Panel/QQVip/AwardGrid/QQVip/ListElement{0}/ItemCell", j);
                GameObject             itemCell = root.transform.FindChild(str2).gameObject;
                ResDT_RandomRewardInfo info2    = store2.astRewardDetail[j];
                CUseable               useable2 = CUseableManager.CreateUsableByRandowReward((RES_RANDOM_REWARD_TYPE)info2.bItemType, (int)info2.dwLowCnt, info2.dwItemID);
                if (useable2 != null)
                {
                    if (itemCell.GetComponent <CUIEventScript>() == null)
                    {
                        itemCell.AddComponent <CUIEventScript>();
                    }
                    CUICommonSystem.SetItemCell(formScript, itemCell, useable2, true, false);
                }
            }
            this.m_BtnQQ = root.transform.FindChild("Panel/QQVip/AwardGrid/QQ/Button/").gameObject;
            Text      componentInChildren = root.transform.FindChild("Panel/QQVip/AwardGrid/QQVip/Button/").gameObject.GetComponentInChildren <Text>();
            CRoleInfo masterRoleInfo      = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                if (masterRoleInfo.HasVip(0x10))
                {
                    if (this.m_BtnQQ.activeInHierarchy)
                    {
                        this.m_BtnQQ.GetComponentInChildren <Text>().text = "续费QQ会员";
                    }
                    componentInChildren.text = "续费超级会员";
                }
                else if (masterRoleInfo.HasVip(1))
                {
                    if (this.m_BtnQQ.activeInHierarchy)
                    {
                        this.m_BtnQQ.GetComponentInChildren <Text>().text = "续费QQ会员";
                    }
                    componentInChildren.text = "开通超级会员";
                }
                else if (!masterRoleInfo.HasVip(1))
                {
                    if (this.m_BtnQQ.activeInHierarchy)
                    {
                        this.m_BtnQQ.GetComponentInChildren <Text>().text = "开通QQ会员";
                    }
                    componentInChildren.text = "开通超级会员";
                }
            }
        }
Exemple #13
0
        public override void Init()
        {
            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_QQ, new CUIEventManager.OnUIEventHandler(this.BuyPcikQQ));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_QQVIP, new CUIEventManager.OnUIEventHandler(this.BuyPcikQQVip));
        }
Exemple #14
0
        public void Clear()
        {
            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.BuyPick_QQ, new CUIEventManager.OnUIEventHandler(this.BuyPcikQQ));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.BuyPick_QQVIP, new CUIEventManager.OnUIEventHandler(this.BuyPcikQQVip));
        }
Exemple #15
0
        public void UpdateLogic(int delta)
        {
            Singleton <SceneManagement> .GetInstance().UpdateDirtyNodes();

            if (!this.m_bSoldierOverNum)
            {
                bool flag = true;
                for (int m = 0; m < this.soldierAreas.Count; m++)
                {
                    SoldierRegion region = this.soldierAreas[m];
                    if (region.isStartup)
                    {
                        SoldierSpawnResult result = region.UpdateLogicSpec(delta);
                        flag &= result != SoldierSpawnResult.ShouldWaitSoldierInterval;
                    }
                }
                if (flag)
                {
                    this.CheckSoldierOverNumUpper();
                }
            }
            else
            {
                this.CheckSoldierOverNumLower();
            }
            for (int i = 0; i < this.commonSpawnGroups.Count; i++)
            {
                CommonSpawnGroup group = this.commonSpawnGroups[i];
                if (group.isStartup)
                {
                    group.UpdateLogic(delta);
                }
            }
            for (int j = 0; j < this.spawnGroups.Count; j++)
            {
                SpawnGroup group2 = this.spawnGroups[j];
                if (group2.isStartup)
                {
                    group2.UpdateLogic(delta);
                }
            }
            int count = this.objTriggerMultiMap.Count;

            for (int k = 0; k < count; k++)
            {
                ObjTriggerKeyValuePair      pair     = this.objTriggerMultiMap[k];
                GameObject                  obj2     = pair.obj;
                ListView <AreaEventTrigger> triggers = pair.triggers;
                if (((obj2 != null) && obj2.activeSelf) && ((Singleton <FrameSynchr> .instance.CurFrameNum % 4) == (k % 4)))
                {
                    bool flag2 = false;
                    for (int n = 0; n < triggers.Count; n++)
                    {
                        AreaEventTrigger trigger = triggers[n];
                        if ((trigger != null) && trigger.isStartup)
                        {
                            trigger.UpdateLogic(delta * 4);
                            flag2 |= trigger.bDoDeactivating;
                        }
                    }
                    if (flag2)
                    {
                        for (int num7 = 0; num7 < triggers.Count; num7++)
                        {
                            AreaEventTrigger trigger2 = triggers[num7];
                            if (trigger2 != null)
                            {
                                trigger2.DoSelfDeactivating();
                            }
                        }
                    }
                }
            }
        }
 private void SetSkillSlotUseTime(SkillSlotType _slotType, int _cdTime)
 {
     this.skillSlotHurt[(int) _slotType].cdTime = _cdTime;
     this.skillSlotHurt[(int) _slotType].recordTime = Singleton<FrameSynchr>.GetInstance().LogicFrameTick;
 }
Exemple #17
0
 public void SetSkillLevel(int slotId, int level)
 {
     this.skillLevelArr[slotId] = level;
     Singleton <EventRouter> .GetInstance().BroadCastEvent <uint>("HeroSkillLevelChange", this.m_heroCfgId);
 }
 public void InitSkillSlotExtraHurt(SkillSlot _slot)
 {
     int slotType = (int) _slot.SlotType;
     uint skillUseCount = _slot.GetSkillUseCount();
     if (this.extraHurtList.Count >= 1)
     {
         if (this.skillSlotHurt[slotType].skillUseCount >= uint.MaxValue)
         {
             this.skillSlotHurt[slotType].skillUseCount = 0;
         }
         if ((skillUseCount == (this.skillSlotHurt[slotType].skillUseCount + 1)) && ((Singleton<FrameSynchr>.GetInstance().LogicFrameTick - this.skillSlotHurt[slotType].recordTime) <= this.skillSlotHurt[slotType].cdTime))
         {
             this.skillSlotHurt[slotType].curTotalHurt = this.skillSlotHurt[slotType].nextTotalHurt;
             this.skillSlotHurt[slotType].nextTotalHurt = 0;
         }
         else
         {
             this.skillSlotHurt[slotType].curTotalHurt = 0;
             this.skillSlotHurt[slotType].nextTotalHurt = 0;
         }
     }
 }
Exemple #19
0
 public string GetAchievementTips()
 {
     return(string.Format(StringHelper.UTF8BytesToString(ref this.m_cfgInfo.szTips), Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().Name));
 }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_RET_RELIVE packet = (GC_RET_RELIVE )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic

            Obj_MainPlayer MainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (null == MainPlayer)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }

            int           objId     = packet.ObjId;
            Obj_Character TargetObj = Singleton <ObjManager> .GetInstance().FindObjCharacterInScene(objId);

            if (TargetObj == null)
            {
                return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
            }

            if (objId == MainPlayer.ServerID)
            {
                // 自己
                if (packet.HasReviveTime)
                {
                    MainPlayer.ReliveEntryTime = packet.ReviveTime;
                }

                //主玩家自己。判断当前地形数据是否可用,如果不可用,更新地形数据
                //if (GameManager.gameManager != null)
                //{
                //    if (GameManager.gameManager.ActiveScene != null)
                //    {
                //        if (GameManager.gameManager.ActiveScene.TerrainData != null)
                //        {
                //            //地形数据存在,但数据没有加载成功
                //            if (!GameManager.gameManager.ActiveScene.TerrainData.RawDataOK)
                //            {
                //                GameManager.gameManager.m_loadErrorNum = 0;
                //                GameManager.gameManager.ActiveScene.SetTerrainData();
                //            }
                //        }
                //        else
                //        {
                //            //地形数据不存在,加载地形数据
                //            GameManager.gameManager.m_loadErrorNum = 0;
                //            GameManager.gameManager.ActiveScene.SetTerrainData();
                //        }
                //    }
                //}
            }

            if (packet.HasPos_x && packet.HasPos_z && packet.HasFacedir)
            {
                float   fEnterPosX  = ((float)packet.Pos_x) / 100;
                float   fEnterPosZ  = ((float)packet.Pos_z) / 100;
                Vector3 newPosition = new UnityEngine.Vector3(fEnterPosX, 0, fEnterPosZ);
                //if (GameManager.gameManager.ActiveScene.IsT4MScene())
                //{
                newPosition.y = GameManager.gameManager.ActiveScene.GetTerrainHeight(newPosition);
                //}
                //else if (null != Terrain.activeTerrain)
                //{
                //newPosition.y = GameManager.gameManager.ActiveScene.GetNavSampleHeight(newPosition);
                //}

                //Temp,保证版本正确性
                newPosition = ActiveScene.GetTerrainPosition(newPosition);
//                  if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_ERHAI)
//                  {
//                      newPosition.y = 18.0f;
//                  }
//                  else if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_YANGWANGGUMU
//                      || GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_WANGYOUGU
//                      || GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_TIANSHAN)
//                  {
//                      newPosition.y = 22.5f;
//                  }

                TargetObj.Position = newPosition;
            }

            //主角位置特殊处理
            if (objId == MainPlayer.ServerID)
            {
                MainPlayer.LastSyncPos = MainPlayer.Position;
                if (null == MainPlayer.NavAgent)
                {
                    MainPlayer.InitNavAgent();
                    MainPlayer.NavAgent.destination = MainPlayer.Position;
                }
            }

            TargetObj.OnRelife();
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Exemple #21
0
        public SingleGameContext(SCPKG_STARTSINGLEGAMERSP InMessage)
        {
            DebugHelper.Assert(InMessage != null, "输入不应该为null");
            base.RewardCount = (InMessage == null) ? 0 : ((int)InMessage.dwRewardNum);
            Singleton <ActorDataCenter> .instance.ClearHeroServerData();

            if (Singleton <GamePlayerCenter> .instance.GetAllPlayers().Count > 0)
            {
            }
            Singleton <GamePlayerCenter> .instance.ClearAllPlayers();

            if (((InMessage != null) && (InMessage.stDetail.stSingleGameSucc != null)) && (InMessage.stDetail.stSingleGameSucc.bNum >= 1))
            {
                this.DoNew9SlotCalc(InMessage);
                int num = Mathf.Min(InMessage.stDetail.stSingleGameSucc.bNum, InMessage.stDetail.stSingleGameSucc.astFighter.Length);
                for (int i = 0; i < num; i++)
                {
                    COMDT_PLAYERINFO comdt_playerinfo = InMessage.stDetail.stSingleGameSucc.astFighter[i];
                    if (comdt_playerinfo.bObjType != 0)
                    {
                        ulong uid = 0L;
                        uint  dwFakeLogicWorldID = 0;
                        uint  level = 1;
                        if (comdt_playerinfo.bObjType == 2)
                        {
                            if ((InMessage.bGameType == 1) && Convert.ToBoolean(InMessage.stGameParam.stSingleGameRspOfCombat.bIsWarmBattle))
                            {
                                uid = comdt_playerinfo.stDetail.stPlayerOfNpc.ullFakeUid;
                                dwFakeLogicWorldID = comdt_playerinfo.stDetail.stPlayerOfNpc.dwFakeLogicWorldID;
                                level = comdt_playerinfo.stDetail.stPlayerOfNpc.dwFakePvpLevel;
                            }
                            else
                            {
                                uid = 0L;
                                dwFakeLogicWorldID = 0;
                                level = comdt_playerinfo.dwLevel;
                            }
                        }
                        else
                        {
                            uid = (comdt_playerinfo.bObjType != 1) ? ((ulong)0L) : comdt_playerinfo.stDetail.stPlayerOfAcnt.ullUid;
                            dwFakeLogicWorldID = (comdt_playerinfo.bObjType != 1) ? 0 : ((uint)comdt_playerinfo.stDetail.stPlayerOfAcnt.iLogicWorldID);
                            level = comdt_playerinfo.dwLevel;
                        }
                        uint vipLv = 0;
                        if (comdt_playerinfo.stDetail.stPlayerOfAcnt != null)
                        {
                            vipLv = comdt_playerinfo.stDetail.stPlayerOfAcnt.stGameVip.dwCurLevel;
                        }
                        Player player = Singleton <GamePlayerCenter> .GetInstance().AddPlayer(comdt_playerinfo.dwObjId, (COM_PLAYERCAMP)comdt_playerinfo.bObjCamp, comdt_playerinfo.bPosOfCamp, level, comdt_playerinfo.bObjType != 1, StringHelper.UTF8BytesToString(ref comdt_playerinfo.szName), 0, (int)dwFakeLogicWorldID, uid, vipLv, null, 0);

                        if (player != null)
                        {
                            for (int j = 0; j < comdt_playerinfo.astChoiceHero.Length; j++)
                            {
                                uint dwHeroID = comdt_playerinfo.astChoiceHero[j].stBaseInfo.stCommonInfo.dwHeroID;
                                player.AddHero(dwHeroID);
                            }
                            player.isGM = LobbyMsgHandler.isHostGMAcnt;
                        }
                        Singleton <ActorDataCenter> .instance.AddHeroesServerData(comdt_playerinfo.dwObjId, comdt_playerinfo.astChoiceHero);
                    }
                    if (comdt_playerinfo.bObjType == 1)
                    {
                        Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(comdt_playerinfo.dwObjId);
                    }
                }
                if (InMessage.bGameType == 2)
                {
                    ResLevelCfgInfo dataByKey = GameDataMgr.levelDatabin.GetDataByKey(InMessage.iLevelId);
                    DebugHelper.Assert(dataByKey != null);
                    base.LevelContext = new SLevelContext();
                    base.LevelContext.Init(dataByKey, 1);
                    if (dataByKey.bGuideLevelSubType == 0)
                    {
                        base.LevelContext.isPVPLevel = true;
                        base.LevelContext.isPVPMode  = true;
                    }
                    else if (dataByKey.bGuideLevelSubType == 1)
                    {
                        base.LevelContext.isPVPLevel = false;
                        base.LevelContext.isPVPMode  = false;
                    }
                    base.LevelContext.GameType            = (COM_GAME_TYPE)InMessage.bGameType;
                    this.levelContext.bShowTrainingHelper = dataByKey.bShowTrainingHelper > 0;
                    this.m_LevelDesignFileName            = base.LevelContext.LevelDesignFileName;
                    this.m_LevelArtistFileName            = base.LevelContext.LevelArtistFileName;
                }
                else if (InMessage.bGameType == 0)
                {
                    ResLevelCfgInfo levelCfg = GameDataMgr.levelDatabin.GetDataByKey(InMessage.iLevelId);
                    DebugHelper.Assert(levelCfg != null);
                    base.LevelContext = new SLevelContext();
                    base.LevelContext.Init(levelCfg, Singleton <CAdventureSys> .instance.currentDifficulty);
                    base.LevelContext.GameType            = (COM_GAME_TYPE)InMessage.bGameType;
                    this.levelContext.bShowTrainingHelper = levelCfg.bShowTrainingHelper > 0;
                    this.m_LevelDesignFileName            = base.LevelContext.LevelDesignFileName;
                    this.m_LevelArtistFileName            = base.LevelContext.LevelArtistFileName;
                }
                else if (InMessage.bGameType == 7)
                {
                    ResLevelCfgInfo info3 = GameDataMgr.burnMap.GetDataByKey(Singleton <BurnExpeditionController> .GetInstance().model.Get_LevelID(Singleton <BurnExpeditionController> .GetInstance().model.curSelect_LevelIndex));
                    DebugHelper.Assert(info3 != null);
                    base.LevelContext = new SLevelContext();
                    base.LevelContext.Init(info3, 1);
                    base.LevelContext.GameType            = (COM_GAME_TYPE)InMessage.bGameType;
                    this.levelContext.bShowTrainingHelper = info3.bShowTrainingHelper > 0;
                    this.m_LevelDesignFileName            = base.LevelContext.LevelDesignFileName;
                    this.m_LevelArtistFileName            = base.LevelContext.LevelArtistFileName;
                }
                else if (InMessage.bGameType == 8)
                {
                    ResLevelCfgInfo info4 = GameDataMgr.arenaLevelDatabin.GetDataByKey(InMessage.iLevelId);
                    DebugHelper.Assert(info4 != null);
                    base.LevelContext = new SLevelContext();
                    base.LevelContext.Init(info4, 1);
                    base.LevelContext.GameType            = (COM_GAME_TYPE)InMessage.bGameType;
                    this.levelContext.bShowTrainingHelper = info4.bShowTrainingHelper > 0;
                    this.m_LevelDesignFileName            = base.LevelContext.LevelDesignFileName;
                    this.m_LevelArtistFileName            = base.LevelContext.LevelArtistFileName;
                }
                else if (InMessage.bGameType == 1)
                {
                    base.LevelContext          = CLevelCfgLogicManager.MakeMobaContext((uint)InMessage.iLevelId, COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT, 1);
                    base.LevelContext.GameType = (COM_GAME_TYPE)InMessage.bGameType;
                    ResAcntBattleLevelInfo info5 = GameDataMgr.pvpLevelDatabin.GetDataByKey((uint)InMessage.iLevelId);
                    if (info5 != null)
                    {
                        this.m_LevelDesignFileName = StringHelper.UTF8BytesToString(ref info5.stLevelCommonInfo.szDesignFileName);
                        if (info5.stLevelCommonInfo.szArtistFileName != null)
                        {
                            this.m_LevelArtistFileName = StringHelper.UTF8BytesToString(ref info5.stLevelCommonInfo.szArtistFileName);
                        }
                    }
                    else
                    {
                        ResCounterPartLevelInfo info6 = GameDataMgr.cpLevelDatabin.GetDataByKey((uint)InMessage.iLevelId);
                        this.m_LevelDesignFileName = StringHelper.UTF8BytesToString(ref info6.stLevelCommonInfo.szDesignFileName);
                        if (info6.stLevelCommonInfo.szArtistFileName != null)
                        {
                            this.m_LevelArtistFileName = StringHelper.UTF8BytesToString(ref info6.stLevelCommonInfo.szArtistFileName);
                        }
                    }
                    base.LevelContext.isWarmBattle      = Convert.ToBoolean(InMessage.stGameParam.stSingleGameRspOfCombat.bIsWarmBattle);
                    base.LevelContext.DynamicDifficulty = InMessage.stGameParam.stSingleGameRspOfCombat.bAILevel;
                    base.LevelContext.MapType           = InMessage.stGameParam.stSingleGameRspOfCombat.bMapType;
                }
            }
        }
 public void EndPageSlideIn()
 {
     Singleton <CSoundManager> .GetInstance().PostEvent("UI_count_slide02", null);
 }
Exemple #23
0
    protected void SortByNewRule()
    {
        // 先按照帮主第一玩家第二的规则排
        Dictionary <UInt64, GuildMember> tempList = new Dictionary <ulong, GuildMember> ();

        foreach (KeyValuePair <ulong, GuildMember> member in m_GuildMemberList)       // 会长
        {
            if (member.Value.IsValid() && member.Value.Job == (int)Games.GlobeDefine.GameDefine_Globe.GUILD_JOB.CHIEF)
            {
                tempList.Add(member.Key, member.Value);
                break;
            }
        }

        foreach (KeyValuePair <ulong, GuildMember> member in m_GuildMemberList)       // 玩家自己
        {
            if (tempList.ContainsKey(member.Key))
            {
                break;
            }
            if (member.Value.IsValid() && member.Key == Singleton <ObjManager> .GetInstance().MainPlayer.GUID)
            {
                tempList.Add(member.Key, member.Value);
                break;
            }
        }

        foreach (KeyValuePair <ulong, GuildMember> member in m_GuildMemberList)       // 副帮主
        {
            if (tempList.ContainsKey(member.Key))
            {
                continue;
            }
            if (member.Value.IsValid() && member.Value.Job == (int)Games.GlobeDefine.GameDefine_Globe.GUILD_JOB.VICE_CHIEF)
            {
                tempList.Add(member.Key, member.Value);
                continue;
            }
        }

        foreach (KeyValuePair <ulong, GuildMember> member in m_GuildMemberList)// 长老
        {
            if (tempList.ContainsKey(member.Key))
            {
                continue;
            }
            if (member.Value.IsValid() && member.Value.Job == (int)Games.GlobeDefine.GameDefine_Globe.GUILD_JOB.ELDER)
            {
                tempList.Add(member.Key, member.Value);
                continue;
            }
        }

        SortedDictionary <uint, GuildMember> levelTempList = new SortedDictionary <uint, GuildMember> (new MySortU());


        foreach (KeyValuePair <ulong, GuildMember> member in m_GuildMemberList) // 按照等级排序,需要排除键值相同的情况所以指定SortedDictionary中的compare方法
        {
            if (tempList.ContainsKey(member.Key))                               // 已经排过的不处理
            {
                continue;
            }
            levelTempList.Add((uint)(200 - member.Value.Level), member.Value);               // 按照等级降序排列
        }

        foreach (var levelItem in levelTempList)
        {
            tempList.Add(levelItem.Value.Guid, levelItem.Value);
        }


        m_GuildMemberList.Clear();
        m_GuildMemberList = tempList;
    }
 public void TreasureBoxShaking()
 {
     Singleton <CSoundManager> .GetInstance().PostEvent("UI_count_box", null);
 }
        public override void Init()
        {
            Singleton <EventRouter> .GetInstance().AddEventHandler <uint, int>("HeroExperienceAdd", new Action <uint, int>(this.OnExperienceHeroAdd));

            Singleton <EventRouter> .GetInstance().AddEventHandler <string, uint, uint>("HeroExperienceTimeUpdate", new Action <string, uint, uint>(this.OnHeroExperienceTimeUpdate));
        }
Exemple #26
0
 private void Awake()
 {
     Singleton <BattleLogic> .GetInstance().SetupMap(this);
 }
Exemple #27
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_CREATE_PLAYER packet = (GC_CREATE_PLAYER)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }

            //enter your logic
            //判断是MainPlayer还是其他Obj
            PlayerData playerDataPool = GameManager.gameManager.PlayerDataPool;

            if (playerDataPool.EnterSceneCache.EnterSceneServerID == packet.ServerId &&
                playerDataPool.EnterSceneCache.EnterSceneSceneID == packet.SceneClass)
            {
                playerDataPool.MainPlayerBaseAttr.RoleBaseID = packet.DataId;
                playerDataPool.MainPlayerBaseAttr.RoleName   = packet.Name;
                playerDataPool.MainPlayerBaseAttr.Force      = packet.Curforce;
                playerDataPool.MainPlayerBaseAttr.Die        = packet.IsDie == 1 ? true : false;
                //未存入BaseAttr而保存在Obj类中的时候,需要存入EnterSceneCache,然后在创建完Obj_MainPlayer的时候赋值,之后清空EnterSceneCache
                playerDataPool.EnterSceneCache.EnterSceneRoleBaseID = packet.DataId;
                playerDataPool.EnterSceneCache.Guid       = packet.Guid;
                playerDataPool.EnterSceneCache.Profession = packet.CurProfession;
                playerDataPool.PkModle = packet.PKModle;
                playerDataPool.m_objMountParam.MountID      = packet.MountID;
                playerDataPool.MainPlayerBaseAttr.MoveSpeed = (int)(packet.MoveSpeed / 100);
                playerDataPool.StealthLev = packet.StealthLev;
                if (packet.HasReliveTime)
                {
                    playerDataPool.ReliveEntryTime = packet.ReliveTime;
                }
                //临时代码,将OtherPlayer的ModelID赋值,从RoleBase表中读取
                Tab_RoleBaseAttr roleBaseAttr = TableManager.GetRoleBaseAttrByID(packet.DataId, 0);
                if (null != roleBaseAttr)
                {
                    playerDataPool.EnterSceneCache.EnterSceneCharModelID = roleBaseAttr.CharModelID;
                }
                playerDataPool.EnterSceneCache.ModelVisualID   = packet.ModelVisualID;
                playerDataPool.EnterSceneCache.WeaponDataID    = packet.WeaponDataID;
                playerDataPool.EnterSceneCache.WeaponEffectGem = packet.WeaponEffectGem;
                if (packet.HasPaoshangState)
                {
                    playerDataPool.EnterSceneCache.PaoShangState = packet.PaoshangState;
                }
                if (packet.HasVipCost)
                {
                    playerDataPool.VipCost = packet.VipCost;
                }
                if (packet.HasCombatValue)
                {
                    playerDataPool.PoolCombatValue = packet.CombatValue;
                }
                if (packet.HasBindparent)
                {
                    playerDataPool.MainBindParent = packet.Bindparent;
                }
                if (packet.HasLightSkillLevel)
                {
                    playerDataPool.MainPlayerBaseAttr.LightSkillLevel = packet.LightSkillLevel;
                }
                playerDataPool.MainBindChildren.Clear();
                for (int nindex = 0; nindex < GlobeVar.BIND_CHILDREN_MAX; ++nindex)
                {
                    if (nindex < packet.bindchildrenCount)
                    {
                        playerDataPool.MainBindChildren.Add(packet.GetBindchildren(nindex));
                    }
                    else
                    {
                        playerDataPool.MainBindChildren.Add(-1);
                    }
                }
                if (GameManager.gameManager.RunningScene == GameManager.gameManager.PlayerDataPool.EnterSceneCache.EnterSceneSceneID &&
                    GameManager.gameManager.PlayerDataPool.EnterSceneCache.EnterSceneServerID != -1 &&
                    GameManager.gameManager.PlayerDataPool.EnterSceneCache.EnterSceneRoleBaseID != -1)
                {
                    //创建MainPlayer
                    if ((int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_LOGIN != GameManager.gameManager.RunningScene &&
                        (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_FB_CABALINTRO != GameManager.gameManager.RunningScene)
                    {
                        Singleton <ObjManager> .GetInstance().CreateMainPlayer();
                    }
                }
            }
            else
            {
                //如果不是主角则是其他玩家
                //其他玩家创建的时候首先判断场景ID
                if (GameManager.gameManager.RunningScene != packet.SceneClass)
                {
                    return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
                }

                Obj_Init_Data initData = new Obj_Init_Data();
                initData.m_ServerID   = packet.ServerId;
                initData.m_Guid       = packet.Guid;
                initData.m_fX         = ((float)packet.PosX) / 100;
                initData.m_fZ         = ((float)packet.PosZ) / 100;
                initData.m_RoleBaseID = packet.DataId;
                //LogModule.DebugLog("Player GUID===================" + initData.m_Guid);
                //临时代码,将OtherPlayer的ModelID赋值,从RoleBase表中读取
                Tab_RoleBaseAttr roleBaseAttr = TableManager.GetRoleBaseAttrByID(initData.m_RoleBaseID, 0);
                if (null != roleBaseAttr)
                {
                    initData.m_CharModelID = roleBaseAttr.CharModelID;
                }
                initData.m_Force                = packet.Curforce;
                initData.m_StrName              = packet.Name;
                initData.m_nProfession          = packet.CurProfession;
                initData.m_strTitleName         = packet.Titlename;
                initData.m_CurTitleID           = packet.CurTitleID;
                initData.m_isInMainPlayerPKList = (packet.IsInPkList == 1 ? true : false);
                initData.m_IsDie                = packet.IsDie == 1 ? true : false;
                initData.m_MountID              = packet.MountID;
                initData.m_PkModel              = packet.PKModle;
                initData.m_MoveSpeed            = ((float)packet.MoveSpeed) / 100;
                initData.m_fDir                      = (float)packet.Facedir / 100;
                initData.m_ModelVisualID             = packet.ModelVisualID;
                initData.m_WeaponDataID              = packet.WeaponDataID;
                initData.m_WeaponEffectGem           = packet.WeaponEffectGem;
                initData.m_StealthLev                = packet.StealthLev;
                initData.m_GuildGuid                 = packet.GuildGuid;
                initData.m_bIsWildEnemyForMainPlayer = (packet.IsEnemy2Self == 1);
                if (packet.HasVipCost)
                {
                    initData.m_nOtherVipCost = packet.VipCost;
                }
                if (packet.HasCombatValue)
                {
                    initData.m_nOtherCombatValue = packet.CombatValue;
                }
                if (packet.HasBindparent)
                {
                    initData.m_BindParent = packet.Bindparent;
                }
                initData.m_BindChildren.Clear();
                for (int nindex = 0; nindex < GlobeVar.BIND_CHILDREN_MAX; ++nindex)
                {
                    if (nindex < packet.bindchildrenCount)
                    {
                        initData.m_BindChildren.Add(packet.GetBindchildren(nindex));
                    }
                    else
                    {
                        initData.m_BindChildren.Add(-1);
                    }
                }
                if (packet.HasPaoshangState)
                {
                    initData.m_nPaoShangState = packet.PaoshangState;
                }
                if (packet.HasFollowState)
                {
                    initData.m_bIsInTeamFollow = (packet.FollowState == 1 ? true : false);
                }

                //稍后添加消息包
                initData.m_changeState = packet.ChangeState;
                initData.m_FlyWingId   = packet.FlyWingId;
                Singleton <ObjManager> .GetInstance().NewCharacterObj(Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER, initData);

                //魂器
                Dictionary <UInt64, Dictionary <int, Belle> > AllOtherPlayerBellDic = BelleData.AllOtherPlayerBelleMap;
                Dictionary <int, Belle> otherPlayerBelleDic;
                if (AllOtherPlayerBellDic.TryGetValue(packet.Guid, out otherPlayerBelleDic))
                {
                    AllOtherPlayerBellDic.Remove(packet.Guid);
                }
                otherPlayerBelleDic = new Dictionary <int, Belle>();
                AllOtherPlayerBellDic.Add(packet.Guid, otherPlayerBelleDic);

                if (packet.BelleIdCount == packet.BelleCloseCount && packet.BelleCloseCount == packet.BelleLevelCount)
                {
                    for (int i = packet.BelleIdCount - 1; i > -1; --i)
                    {
                        otherPlayerBelleDic.Add(packet.GetBelleId(i), new Belle(packet.GetBelleId(i), packet.GetBelleClose(i), packet.GetBelleLevel(i)));
                    }
                }
            }

            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Exemple #28
0
 private void Start()
 {
     foreach (FuncRegion region in base.GetComponentsInChildren <FuncRegion>(true))
     {
         if (((region == null) || (!region.enabled || !region.gameObject.activeInHierarchy)) || !region.gameObject.activeSelf)
         {
             continue;
         }
         if (region is ReviveRegion)
         {
             this.reviveAreas.Add(region as ReviveRegion);
             continue;
         }
         if (region is SoldierRegion)
         {
             this.soldierAreas.Add(region as SoldierRegion);
             continue;
         }
         if (region is CommonSpawnGroup)
         {
             this.commonSpawnGroups.Add(region as CommonSpawnGroup);
             continue;
         }
         if (region is SpawnGroup)
         {
             this.spawnGroups.Add(region as SpawnGroup);
             continue;
         }
         if (region is WaypointsHolder)
         {
             this.waypointsList.Add(region as WaypointsHolder);
             continue;
         }
         if (region is AreaEventTrigger)
         {
             AreaEventTrigger item = region as AreaEventTrigger;
             this.triggerList.Add(item);
             GameObject gameObject = region.gameObject;
             ListView <AreaEventTrigger> triggers = null;
             for (int i = this.objTriggerMultiMap.Count - 1; i >= 0; i--)
             {
                 ObjTriggerKeyValuePair pair = this.objTriggerMultiMap[i];
                 if (pair.obj == gameObject)
                 {
                     triggers = pair.triggers;
                     break;
                 }
             }
             if (triggers == null)
             {
                 triggers = new ListView <AreaEventTrigger>();
                 ObjTriggerKeyValuePair pair2 = new ObjTriggerKeyValuePair {
                     obj      = gameObject,
                     triggers = triggers
                 };
                 this.objTriggerMultiMap.Add(pair2);
             }
             triggers.Add(item);
             continue;
         }
         if (region is DynamicChannel)
         {
             this.channelList.Add(region as DynamicChannel);
         }
     }
     this.TrueMen = new List <PoolObjHandle <ActorRoot> >(Singleton <GameObjMgr> .GetInstance().SoldierActors);
 }
Exemple #29
0
 public void unInit()
 {
     Singleton <EventRouter> .GetInstance().RemoveEventHandler("MasterAttributesChanged", new Action(this, (IntPtr)this.onAtrrChange));
 }
Exemple #30
0
        public static void OnHuoyue_Reward_RES(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            Singleton <CTaskSys> .get_instance().OnHuoyue_Reward_RES(ref msg);
        }