示例#1
0
    public void Connect(PRoomInfo room)
    {
        if (room == null)
        {
            Logger.LogError("Stream::Connect: Invalid room!");
            return;
        }

        room.CopyTo(m_room);

        UpdateServer(m_room.host, m_room.port);

        session.RemoveEventListener(Events.SESSION_LOST_CONNECTION, OnLostConnection);

        m_useGameSession = false;
        if (host == session.host && port == session.port)
        {
            m_useGameSession = true;

            session.AddEventListener(Events.SESSION_LOST_CONNECTION, OnLostConnection);
            OnConnected();
        }
        else
        {
            Connect();
        }
    }
示例#2
0
    private void Invation_succed(PMatchInfo[] infolist, PRoomInfo room)
    {
        moduleMatch.beiInvated = false;
        moduleMatch.Info_sss   = null;
        modulePVP.isInvation   = true;
        Is_Filed = false;
        state    = State.MatchSuccess;
        SetActive(state, modulePVP.opType);

        if (!modulePVP.connected || modulePVP.RoomId != room.room_key)
        {
            modulePVP.Connect(room);
            MatchSuccessState(infolist);
        }
    }