public void SendClientStatus(int to_client_id = 0)
    {
        Coop_Model_ClientStatus model = new Coop_Model_ClientStatus();

        model.id       = 1003;
        model.status   = (int)coopClient.status;
        model.joinType = (int)coopClient.joinType;
        Send(model, true, to_client_id, null, delegate
        {
            if (model.status != (int)coopClient.status)
            {
                return(false);
            }
            return(true);
        });
    }
Esempio n. 2
0
    protected override bool HandleCoopEvent(CoopPacket packet)
    {
        bool result = false;

        switch (packet.packetType)
        {
        case PACKET_TYPE.CLIENT_STATUS:
        {
            Coop_Model_ClientStatus model5 = packet.GetModel <Coop_Model_ClientStatus>();
            result = coopClient.OnRecvClientStatus(model5, packet);
            break;
        }

        case PACKET_TYPE.CLIENT_LOADING_PROGRESS:
        {
            Coop_Model_ClientLoadingProgress model4 = packet.GetModel <Coop_Model_ClientLoadingProgress>();
            result = coopClient.OnRecvClientLoadingProgress(model4);
            break;
        }

        case PACKET_TYPE.CLIENT_CHANGE_EQUIP:
        {
            Coop_Model_ClientChangeEquip model3 = packet.GetModel <Coop_Model_ClientChangeEquip>();
            result = coopClient.OnRecvClientChangeEquip(model3);
            break;
        }

        case PACKET_TYPE.CLIENT_BATTLE_RETIRE:
        {
            Coop_Model_ClientBattleRetire model2 = packet.GetModel <Coop_Model_ClientBattleRetire>();
            result = coopClient.OnRecvClientBattleRetire(model2);
            break;
        }

        case PACKET_TYPE.CLIENT_SERIES_PROGRESS:
        {
            Coop_Model_ClientSeriesProgress model = packet.GetModel <Coop_Model_ClientSeriesProgress>();
            result = coopClient.OnRecvClientSeriesProgress(model);
            break;
        }
        }
        return(result);
    }
    public virtual bool OnRecvClientStatus(Coop_Model_ClientStatus model, CoopPacket packet)
    {
        //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
        if (isLeave)
        {
            MonoBehaviourSingleton <CoopManager> .I.coopMyClient.WelcomeClient(clientId);
        }
        SetStatus((CLIENT_STATUS)model.status);
        joinType = (CLIENT_JOIN_TYPE)model.joinType;
        if (model.status == 5)
        {
            if (isStageHost && MonoBehaviourSingleton <CoopManager> .I.coopStage.isRecvStageInfo && MonoBehaviourSingleton <InGameProgress> .IsValid())
            {
                MonoBehaviourSingleton <InGameProgress> .I.StartTimer(0f);
            }
            if (MonoBehaviourSingleton <StageObjectManager> .IsValid())
            {
                List <StageObject> list = new List <StageObject>(MonoBehaviourSingleton <StageObjectManager> .I.cacheList);
                int i = 0;
                for (int count = list.Count; i < count; i++)
                {
                    Player player = list[i] as Player;
                    if (!(player == null) && player.coopClientId == clientId && player.isWaitBattleStart)
                    {
                        MonoBehaviourSingleton <StageObjectManager> .I.RemoveCacheObject(player);

                        player.get_gameObject().SetActive(true);
                        player.ActBattleStart(false);
                    }
                }
            }
        }
        if (isPartyOwner && model.status == 6)
        {
            MonoBehaviourSingleton <CoopManager> .I.coopRoom.SetOwnerCleared();
        }
        if (MonoBehaviourSingleton <CoopManager> .I.coopRoom.NeedsForceLeave())
        {
            MonoBehaviourSingleton <CoopNetworkManager> .I.Close(1000, "Bye!", null);
        }
        return(true);
    }