Exemplo n.º 1
0
    void _Packet(ScFatigueRemainTimes p)
    {
        m_remainTime  = (long)p.remainTimes;
        m_recevieTime = Time.realtimeSinceStartup;

        DispatchEvent(SDKEvent.GLOBAL, SDKEvent.PopSdk(SDKEvent.LOCAL_NOTIFY, SwitchType.Fatigue));
    }
Exemplo n.º 2
0
    public void RoleStartEnterGame(int rIndex, bool isFirstEnter = false)
    {
        Game.WillEnterGame();

        rIndex = Mathf.Clamp(rIndex, 0, roleList.Length - 1);

        var p = PacketObject.Create <CsEnterGame>();

        p.roleId        = roleList[rIndex].roleId;
        p.gameVersion   = Launch.Updater.currentVersion;
        p.sourceHash    = AssetBundles.AssetManager.dataHash;
        p.machineNumber = SystemInfo.deviceUniqueIdentifier;
        p.producer      = SystemInfo.deviceModel;
        session.Send(p);

        PlayerPrefs.SetString(lastEnterRoleSaveKey, p.roleId.ToString());
        PlayerPrefs.Save();

        if (!isFirstEnter)
        {
            Game.GoHome();
        }

        DispatchEvent(SDKEvent.GLOBAL, SDKEvent.PopSdk(SDKEvent.SELECT_ROLE, roleList[rIndex].roleId));
    }
Exemplo n.º 3
0
    void _Packet(ScSkillInfo p)
    {
        p.CopyTo(ref skillInfo);

        OnGetAllSkillData();
        //OnAddDataToSkillLvDic();
        OnAddDataToSkillStateDic();

        DispatchModuleEvent(EventUpdateSkillPanel);

        DispatchEvent(SDKEvent.GLOBAL, SDKEvent.PopSdk(SDKEvent.LOCAL_NOTIFY, SwitchType.SkillPoint));
    }
Exemplo n.º 4
0
    void _Packet(ScSkillPointRemainTimes p)
    {
        if (p.remainTimes == 0)
        {
            return;
        }
        m_recevieTime = Time.realtimeSinceStartup;
        m_remainTime  = p.remainTimes;

        if (skillInfo != null)
        {
            DispatchEvent(SDKEvent.GLOBAL, SDKEvent.PopSdk(SDKEvent.LOCAL_NOTIFY, SwitchType.SkillPoint));
        }
    }
Exemplo n.º 5
0
    private void SetSwitchState()
    {
        if (switchInfo == null || switchInfo.Length < 1)
        {
            return;
        }
        for (int i = 0; i < switchInfo.Length; i++)
        {
            var _id = switchInfo[i].switchId;
            if (_id == 0)
            {
                continue;
            }

            var type  = (SwitchType)_id;
            var state = switchInfo[i].value;
            if (m_pushState.ContainsKey(type))
            {
                m_pushState[type] = state;
                continue;
            }
            m_pushState.Add(type, state);

            if (type == SwitchType.UnionBoss)
            {
                DispatchEvent(SDKEvent.GLOBAL, SDKEvent.PopSdk(SDKEvent.UNION_CHANGE, modulePlayer.roleInfo.leagueID, state));
            }

            if (type == SwitchType.UnionBoss || type == SwitchType.SystemPao)
            {
                continue;
            }

            if (type == SwitchType.Labyrinth || type == SwitchType.SkillPoint || type == SwitchType.RoyalPvp)
            {
                var _type = type == SwitchType.Labyrinth ? HomeIcons.Labyrinth : type == SwitchType.RoyalPvp ? HomeIcons.Match : HomeIcons.Skill;
                var canIn = moduleGuide.IsActiveFunction(_type);
                if (!canIn)
                {
                    continue;
                }
            }

            DispatchEvent(SDKEvent.GLOBAL, SDKEvent.PopSdk(SDKEvent.TAG, state, _id));
        }
    }
Exemplo n.º 6
0
    void _Packet(ScSystemChangeSwitch p)
    {
        if (p.result == 0)
        {
            var type = (SwitchType)p.switchId;
            if (m_pushState.ContainsKey(type))
            {
                m_pushState[type] = p.value;

                if (type != SwitchType.UnionBoss && type != SwitchType.SystemPao)
                {
                    var canIn = true;
                    if (type == SwitchType.Labyrinth || type == SwitchType.SkillPoint || type == SwitchType.RoyalPvp)
                    {
                        var _type = type == SwitchType.Labyrinth ? HomeIcons.Labyrinth : type == SwitchType.RoyalPvp ? HomeIcons.Match : HomeIcons.Skill;
                        canIn = moduleGuide.IsActiveFunction(_type);
                    }
                    if (canIn)
                    {
                        DispatchEvent(SDKEvent.GLOBAL, SDKEvent.PopSdk(SDKEvent.TAG, p.value, p.switchId));
                    }
                }

                if (type == SwitchType.Fatigue || type == SwitchType.SkillPoint)
                {
                    DispatchEvent(SDKEvent.GLOBAL, SDKEvent.PopSdk(SDKEvent.LOCAL_NOTIFY, type));
                }

                if (type == SwitchType.UnionBoss)
                {
                    DispatchEvent(SDKEvent.GLOBAL, SDKEvent.PopSdk(SDKEvent.UNION_CHANGE, modulePlayer.roleInfo.leagueID, p.value));
                }
            }
            DispatchModuleEvent(EventSavePushState);
        }
        else
        {
            moduleGlobal.ShowMessage(Util.GetString(9212, 8));
        }
    }
Exemplo n.º 7
0
    void _ME(ModuleEvent <Module_Guide> e)
    {
        if (e.moduleEvent == Module_Guide.EventUnlockFunctionStart)
        {
            var ids = e.param1 as int[];
            if (ids == null && ids.Length < 1)
            {
                return;
            }

            for (int i = 0; i < ids.Length; i++)
            {
                var type  = (HomeIcons)ids[i];
                var _type = SwitchType.Fatigue;

                if (type == HomeIcons.Labyrinth)
                {
                    _type = SwitchType.Labyrinth;
                }
                else if (type == HomeIcons.Match)
                {
                    _type = SwitchType.RoyalPvp;
                }
                else if (type == HomeIcons.Skill)
                {
                    _type = SwitchType.SkillPoint;
                }
                else if (type == HomeIcons.Guild)
                {
                    _type = SwitchType.UnionBoss;
                }

                if (_type != SwitchType.Fatigue && moduleSet.pushState.ContainsKey(_type) && moduleSet.pushState[_type] == 1)
                {
                    DispatchEvent(SDKEvent.GLOBAL, SDKEvent.PopSdk(SDKEvent.TAG, (uint)1, (byte)_type));
                }
            }
        }
    }