示例#1
0
    public void OnRecvNotifyTraceBoss(int fromClientId, Coop_Model_RoomNotifyTraceBoss model)
    {
        if (MonoBehaviourSingleton <QuestManager> .IsValid())
        {
            ExploreStatus.TraceInfo[] bossTraceHistory = MonoBehaviourSingleton <QuestManager> .I.GetBossTraceHistory();

            if (bossTraceHistory == null || bossTraceHistory.Length <= 0 || bossTraceHistory[bossTraceHistory.Length - 1].mapId != model.mid)
            {
                bool       reserve    = false;
                CoopClient coopClient = clients.FindByClientId(fromClientId);
                string     playerName = coopClient.GetPlayerName();
                if (MonoBehaviourSingleton <InGameProgress> .IsValid() && MonoBehaviourSingleton <InGameProgress> .I.progressEndType == InGameProgress.PROGRESS_END_TYPE.NONE)
                {
                    int num = 0;
                    num = ((model.lc != 0) ? 8004 : 8003);
                    string text = StringTable.Format(STRING_CATEGORY.IN_GAME, (uint)num, playerName);
                    UIInGamePopupDialog.PushOpen(text, false, 1.22f);
                }
                else if (QuestManager.IsValidExplore())
                {
                    reserve = true;
                }
                if (QuestManager.IsValidExplore())
                {
                    MonoBehaviourSingleton <QuestManager> .I.UpdateBossTraceHistory(model.mid, model.lc, playerName, reserve);
                }
            }
        }
    }
    public void SendNotifyTraceBoss(int mapId, int lastCount)
    {
        Coop_Model_RoomNotifyTraceBoss coop_Model_RoomNotifyTraceBoss = new Coop_Model_RoomNotifyTraceBoss();

        coop_Model_RoomNotifyTraceBoss.id  = 1001;
        coop_Model_RoomNotifyTraceBoss.mid = mapId;
        coop_Model_RoomNotifyTraceBoss.lc  = lastCount;
        MonoBehaviourSingleton <CoopNetworkManager> .I.SendBroadcast(coop_Model_RoomNotifyTraceBoss, true, null, null);
    }
    protected override bool HandleCoopEvent(CoopPacket packet)
    {
        bool result = false;

        switch (packet.packetType)
        {
        case PACKET_TYPE.ROOM_SYNC_ALL_PORTAL_POINT:
        {
            Coop_Model_RoomSyncAllPortalPoint model16 = packet.GetModel <Coop_Model_RoomSyncAllPortalPoint>();
            coopRoom.OnRecvSyncAllPortalPoint(model16);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_UPDATE_PORTAL_POINT:
        {
            Coop_Model_RoomUpdatePortalPoint model15 = packet.GetModel <Coop_Model_RoomUpdatePortalPoint>();
            coopRoom.OnRecvRoomUpdatePortalPoint(model15);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_SYNC_EXPLORE_BOSS:
        {
            Coop_Model_RoomSyncExploreBoss model14 = packet.GetModel <Coop_Model_RoomSyncExploreBoss>();
            coopRoom.OnRecvSyncExploreBoss(model14);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_SYNC_EXPLORE_BOSS_MAP:
        {
            Coop_Model_RoomSyncExploreBossMap model13 = packet.GetModel <Coop_Model_RoomSyncExploreBossMap>();
            coopRoom.OnRecvSyncExploreBossMap(model13);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_EXPLORE_BOSS_DAMAGE:
        {
            Coop_Model_RoomExploreBossDamage model12 = packet.GetModel <Coop_Model_RoomExploreBossDamage>();
            coopRoom.OnRecvExploreBossDamage(packet.fromClientId, model12);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_EXPLORE_ALIVE:
        {
            Coop_Model_RoomExploreAlive model11 = packet.GetModel <Coop_Model_RoomExploreAlive>();
            coopRoom.OnRecvExploreAlive();
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_EXPLORE_ALIVE_REQUEST:
        {
            Coop_Model_RoomExploreAliveRequest model10 = packet.GetModel <Coop_Model_RoomExploreAliveRequest>();
            coopRoom.OnRecvExploreAliveRequest();
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_EXPLORE_BOSS_DEAD:
        {
            Coop_Model_RoomExploreBossDead model9 = packet.GetModel <Coop_Model_RoomExploreBossDead>();
            result = coopRoom.OnRecvExploreBossDead(model9);
            break;
        }

        case PACKET_TYPE.ROOM_NOTIFY_ENCOUNTER_BOSS:
        {
            Coop_Model_RoomNotifyEncounterBoss model8 = packet.GetModel <Coop_Model_RoomNotifyEncounterBoss>();
            coopRoom.OnRecvNotifyEncounterBoss(packet.fromClientId, model8);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_SYNC_PLAYER_STATUS:
        {
            Coop_Model_RoomSyncPlayerStatus model7 = packet.GetModel <Coop_Model_RoomSyncPlayerStatus>();
            coopRoom.OnRecvSyncPlayerStatus(packet.fromClientId, model7);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_CHAT_STAMP:
        {
            Coop_Model_RoomChatStamp model6 = packet.GetModel <Coop_Model_RoomChatStamp>();
            coopRoom.OnRecvChatStamp(packet.fromClientId, model6);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_MOVE_FIELD:
        {
            Coop_Model_RoomMoveField model5 = packet.GetModel <Coop_Model_RoomMoveField>();
            coopRoom.OnRecvMoveField(model5);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_RUSH_REQUEST:
        {
            Coop_Model_RushRequest model4 = packet.GetModel <Coop_Model_RushRequest>();
            coopRoom.OnRecvRushRequest(packet.fromClientId, model4);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_RUSH_REQUESTED:
        {
            Coop_Model_RushRequested model3 = packet.GetModel <Coop_Model_RushRequested>();
            coopRoom.OnRecvRushRequested(model3);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_SYNC_DEFENSE_BATTLE:
        {
            Coop_Model_RoomSyncDefenseBattle model2 = packet.GetModel <Coop_Model_RoomSyncDefenseBattle>();
            coopRoom.OnRecvSyncDefenseBattle(model2);
            result = true;
            break;
        }

        case PACKET_TYPE.ROOM_NOTIFY_TRACE_BOSS:
        {
            Coop_Model_RoomNotifyTraceBoss model = packet.GetModel <Coop_Model_RoomNotifyTraceBoss>();
            coopRoom.OnRecvNotifyTraceBoss(packet.fromClientId, model);
            result = true;
            break;
        }
        }
        return(result);
    }