void AccessMission(int nMissionID, int nNpcID, bool bCheck = true, byte[] adrmData = null)
    {
        PeEntity npc = EntityMgr.Instance.Get(nNpcID);

        if (IsOwner)
        {
            MissionManager.Instance.ProcessSingleMode(nMissionID, npc, MissionManager.TakeMissionType.TakeMissionType_Get, bCheck);
        }
        else
        {
            if (PeGameMgr.IsMultiStory)
            {
                RMRepository.Import(adrmData);
            }
            else
            {
                AdRMRepository.Import(adrmData);
            }

            AiAdNpcNetwork adNpc = AiAdNpcNetwork.Get <AiAdNpcNetwork>(nNpcID);
            MissionManager.Instance.ProcessSingleMode(nMissionID, npc, MissionManager.TakeMissionType.TakeMissionType_Get, bCheck, adNpc);
        }

        if (null != npc)
        {
            npc.SetAttribute(AttribType.DefaultPlayerID, Id, false);
        }
    }
    //同步任务
    void RPC_S2C_SyncMissions(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        byte[] pmData     = stream.Read <byte[]> ();
        byte[] adrmData   = stream.Read <byte[]> ();
        byte[] tmData     = stream.Read <byte[]>();
        byte[] tmadrmData = stream.Read <byte[]>();

        if (PeGameMgr.IsMultiStory)
        {
            if (adrmData != null)
            {
                RMRepository.Import(adrmData);
            }
            if (tmadrmData != null)
            {
                RMRepository.Import(tmadrmData);
            }
        }
        else
        {
            if (adrmData != null)
            {
                AdRMRepository.Import(adrmData);
            }
            if (tmadrmData != null)
            {
                AdRMRepository.Import(tmadrmData);
            }
        }
        StartCoroutine(WaitForMissionModule(pmData, tmData));
    }
Beispiel #3
0
 protected override void SetData(byte[] data)
 {
     if (null != data)
     {
         AdRMRepository.Import(data);
     }
 }