Esempio n. 1
0
    private void OnMemberReborn(FrameData d)
    {
        if (d.parameters == null || d.parameters.Length == 0)
        {
            Logger.LogError("call frame action [PlayerReborn] ,but the parameters is null,please check out");
            return;
        }

        int guid = d.parameters.GetValue <int>(0);

        if (moduleTeam.members == null)
        {
            Logger.LogError("moduleTeam.members is null,please check out");
            return;
        }

        var memberData = moduleTeam.members.GetValue <PTeamMemberInfo>(guid);

        if (memberData == null)
        {
            Logger.LogError("Team member [{0}] cannot be finded", guid);
            return;
        }

        OnMemberReborn(memberData);
        moduleTeam.DispatchReborn(memberData);
    }
Esempio n. 2
0
    private void OnMemberQuitEarlySettlement(FrameData d)
    {
        if (moduleTeam.members == null)
        {
            return;
        }

        var reason = (EnumTeamQuitState)d.parameters.GetValue <int>(0);

        if (reason != EnumTeamQuitState.EarlySettlement)
        {
            return;
        }

        var member = moduleTeam.members.GetValue <PTeamMemberInfo>(d.parameters.GetValue <int>(1));

        if (member == null)
        {
            return;
        }

        FightRecordManager.RecordLog <LogTeamQuit>(log =>
        {
            log.tag    = (byte)TagType.TeamQuit;
            log.roleId = member.roleId;
            log.reason = (sbyte)reason;
        });

        var c = m_teamMembers.Find(o => o.roleId == member.roleId);

        if (!c)
        {
            return;
        }

        //掉线,角色直接死亡
        bool alive = c && c.health > 0;

        if (reason == EnumTeamQuitState.EarlySettlement && !isEndingState && !m_isPVEFinish && !m_recvOverMsg && alive)
        {
            c?.Kill();
        }

        //切换队长
        if (member.teamLeader > 0)
        {
            foreach (var item in moduleTeam.members)
            {
                item.teamLeader = (byte)(item.roleId == member.roleId ? 0 : 1);
            }

            if (c)
            {
                var temp = m_normalMember;
                m_normalMember = c;
                m_teamLeader   = temp;
                Logger.LogInfo("OnMemberQuit... team leader change to {0}", m_teamLeader ? m_teamLeader.uiName : "null");
            }
        }
    }
Esempio n. 3
0
    private void OnTransportSceneOver(FrameData d)
    {
        //组队的时候,一旦开始处理切换场景完毕,就统一开启逻辑帧
        OnLogicTransportFinish();
        m_allMemberTransportOver = true;
        moduleTeam.TransportOver();
#if AI_LOG
        Module_AI.LogBattleMsg(player, "[set m_allMemberTransportOver as true.....]");
#endif
    }
Esempio n. 4
0
    private void OnStoryStepChange(FrameData d)
    {
        int             storyId    = d.parameters.GetValue <int>(0);
        int             storyIndex = d.parameters.GetValue <int>(1);
        EnumContextStep step       = (EnumContextStep)d.parameters.GetValue <int>(2);

        BaseStory story = moduleStory.GetCurrentValidStory();

        if (!story)
        {
            Logger.LogWarning("there is no active story...please check out data is [id = {0},index = {1} step = {2}]");
            return;
        }

        story.RecvFrameData(storyId, storyIndex, step);
    }
Esempio n. 5
0
 protected void StartTransportScene(FrameData d)
 {
     HandleTransportScene(m_tempTransportSceneBehaviour);
     moduleTeam.HandleStartTransportFrameEvent();
 }