예제 #1
0
    /// <summary>
    ///副本任务改变
    /// </summary>
    /// <param name="buf"></param>
    private void OnInstanceMissionChange(KProtoBuf buf)
    {
        var      msg   = buf as S2C_PVE_MISSION_VALUE_CHANGE;
        PveProxy proxy = (PveProxy)GameFacade.Instance.RetrieveProxy(ProxyName.PveProxy);

        var info = new PveMissionInfoVO();

        info.ID    = msg.mission_id;
        info.Value = msg.value;

        proxy.SetPveMission(info);
        proxy.ResetCountdown(msg.left_milisecond / 1000);
    }
예제 #2
0
    /// <summary>
    /// pve 结算奖励
    /// </summary>
    /// <param name="buf"></param>
    private void OnPveReward(KProtoBuf buf)
    {
        var msg = buf as S2C_REWARD_LIST;

        var list = new List <RewardDateVO>();

        foreach (var reward in msg.rewards)
        {
            var item = new RewardDateVO();
            item.Id  = (uint)reward.id;
            item.Num = reward.count;
            list.Add(item);
        }
        PveProxy pveProxy = (PveProxy)GameFacade.Instance.RetrieveProxy(ProxyName.PveProxy);

        pveProxy.SetSettlementRewards((int)msg.result, list);
    }
예제 #3
0
    /// <summary>
    /// 副本任务数据
    /// </summary>
    /// <param name="buf"></param>
    private void OnInstanceMissionDatas(KProtoBuf buf)
    {
        var      msg   = buf as S2C_PVE_MISSION_VALUES;
        PveProxy proxy = (PveProxy)GameFacade.Instance.RetrieveProxy(ProxyName.PveProxy);

        var list = new List <PveMissionInfoVO>();

        for (int i = 0; i < msg.values.Count; i++)
        {
            var info = new PveMissionInfoVO();
            info.ID    = msg.values[i].mission_id;
            info.Value = msg.values[i].value;
            list.Add(info);
        }
        proxy.UpdatePveMission(list);
        proxy.ResetCountdown(msg.left_milisecond / 1000);
    }
예제 #4
0
    /// <summary>
    /// 副本结束
    /// </summary>
    /// <param name="buf"></param>
    private void OnPveEnd(KProtoBuf buf)
    {
        PveProxy pveProxy = (PveProxy)GameFacade.Instance.RetrieveProxy(ProxyName.PveProxy);

        if (pveProxy.m_ExitSended)
        {
            return;
        }

        var msg = buf as S2C_PVE_END;

        C2S_ExitPve req = SingleInstanceCache.GetInstanceByType <C2S_ExitPve>();

        req.protocolID = (ushort)KC2S_Protocol.c2s_exit_pve;
        NetworkManager.Instance.SendToGameServer(req);

        pveProxy.m_ExitSended = true;
    }
예제 #5
0
    /// <summary>
    /// pve 战斗结算处理
    /// </summary>
    /// <param name="buf"></param>
    private void OnPveFightSettlement(KProtoBuf buf)
    {
        var msg = buf as S2C_FIGHT_RESULT;

        var list = new List <PveFightInfoVO>();

        foreach (var value in msg.player_results)
        {
            var info = new PveFightInfoVO();
            //info.PlayerID = value.playerID;
            //info.PlayerName = value.playerName;
            info.DpsCount   = value.damage;
            info.HurtCount  = value.damaged;
            info.KillCount  = value.kill_count;
            info.DeathCount = value.die_count;
            list.Add(info);
        }
        PveProxy pveProxy = (PveProxy)GameFacade.Instance.RetrieveProxy(ProxyName.PveProxy);

        pveProxy.SetSettlementFightInfos(list);
    }
예제 #6
0
 public PveController()
 {
     pveProxy = ((PveProxy)GameFacade.Instance.RetrieveProxy(ProxyName.PveProxy));
 }